Exemplo n.º 1
0
BOOL CWndChangePetName::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	if( nID == WIDC_OK )
	{
		CWndEdit* pEdit	= (CWndEdit*)GetDlgItem( WIDC_EDIT_CHANGENAME );
		CString string	= pEdit->GetString();

		DWORD dwError = ::IsValidPlayerName( string );
		if( dwError > 0 )
		{
			g_WndMng.OpenMessageBox( prj.GetText(dwError) );
			pEdit->SetFocus();
			return TRUE;
		}

		if( prj.IsInvalidName( string )
#ifdef __RULE_0615
			|| prj.IsAllowedLetter( string ) == FALSE
#endif	// __RULE_0615
			)
		{
			g_WndMng.OpenMessageBox( _T( prj.GetText(TID_DIAG_0020) ) );
			return TRUE;
		}
		// 펫 이름을 바꾸도록 요청하는 함수를 호출한다
		 g_DPlay.SendDoUseItemInput(m_dwId, (LPSTR)(LPCSTR)string);
		Destroy();
	}
	else if( nID == WIDC_CANCEL || nID == WTBID_CLOSE )
	{
#ifdef __S_SERVER_UNIFY
		if( g_WndMng.m_bAllAction == FALSE )
			return TRUE;
#endif // __S_SERVER_UNIFY
		Destroy();
	}

	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
} 
BOOL CWndAdminCreateItem::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	ItemProp* pItemProp;
	CWndListBox* pListBox = (CWndListBox*)GetDlgItem( WIDC_CONTROL1 );
	if( nID == WIDC_ITEM_KIND || nID == WIDC_ITEM_SEX || nID == WIDC_ITEM_JOB || nID == WIDC_LEVEL )
	{
		if( message == WNM_SELCHANGE || message == EN_CHANGE )
		{
			DWORD dwLevel = 0;
			CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem( WIDC_LEVEL );
			CString string = pWndEdit->GetString();
			dwLevel = atoi( string );
			CWndComboBox* pWndItemKind = (CWndComboBox*)GetDlgItem( WIDC_ITEM_KIND );
			CWndComboBox* pWndItemSex = (CWndComboBox*)GetDlgItem( WIDC_ITEM_SEX );
			CWndComboBox* pWndItemJob = (CWndComboBox*)GetDlgItem( WIDC_ITEM_JOB );
			pListBox->ResetContent();
			for( int i = 0; i < prj.m_aPropItem.GetSize(); i++ )
			{
				ItemProp* pItemProp =  prj.GetItemProp( i );
				DWORD dwKind = pWndItemKind->GetItemData( pWndItemKind->GetCurSel() );
				DWORD dwSex = pWndItemSex->GetItemData( pWndItemSex->GetCurSel() );
				DWORD dwJob = pWndItemJob->GetItemData( pWndItemJob->GetCurSel() );
				if( pItemProp && ( pItemProp->dwItemKind2 == dwKind || dwKind == NULL_ID ) &&
					 ( pItemProp->dwItemSex == dwSex || dwSex == SEX_SEXLESS ) )
				{
					if( pItemProp->dwLimitLevel1 >= dwLevel && ( pItemProp->dwItemJob == dwJob || dwJob == -1 ) )
					{
						if( GetLanguage() != LANG_KOR && pItemProp->nVer >= 7 && pItemProp->bCharged == TRUE )
							continue;
						int nIndex = pListBox->AddString( MakeName( pItemProp ) );
						pListBox->SetItemDataPtr( nIndex, pItemProp );
					}
				}
			}
		}
	}
	else
	if( nID == WIDC_OK || ( nID == WIDC_CONTROL1 && message == WNM_DBLCLK ) )
	{
		CString string;
		CWndText* pWndItemName = (CWndText*)GetDlgItem( WIDC_ITEM_NAME );
		CWndText* pWndItemNum = (CWndText*)GetDlgItem( WIDC_ITEM_NUM );
		DWORD dwNum;
		if( pWndItemNum->m_string.GetLength() ) 
		{
			dwNum = _ttoi(pWndItemNum->m_string);
		}
		else 
		{
			dwNum = 1;
		}
		
		dwNum = ( dwNum == 0? 1:dwNum );
		if( pWndItemName->m_string.GetLength() ) 
		{
			CString str2;
			str2 = pWndItemName->m_string;
			string.Format( "/ci %s %d",str2, dwNum);

			ParsingCommand( string.LockBuffer(), g_pPlayer );
			string.UnlockBuffer();
		}
		else 
		{
			int nIndex = pListBox->GetCurSel();
			if( nIndex != -1 ) 	
			{
				pItemProp = (ItemProp*)pListBox->GetItemDataPtr( nIndex );
				if( pItemProp )	
				{
					string.Format( "/ci \"%s\" %d", pItemProp->szName, dwNum);
					ParsingCommand( string.LockBuffer(), g_pPlayer );
					string.UnlockBuffer();
				}
			}
		}
	//	nID = WTBID_CLOSE;
	}
	else
	if( nID == WIDC_CANCEL || nID == WTBID_CLOSE )
	{
		nID = WTBID_CLOSE;
		Destroy( TRUE );
		return TRUE;
	}
	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
} 
Exemplo n.º 3
0
BOOL CWndVendor::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	if( message == 100 && nID == 100 )
	{
		LPSHORTCUT pShortcut	= (LPSHORTCUT)pLResult;
		if( pShortcut )
		{
			CWndBase* pWndFrame		= pShortcut->m_pFromWnd->GetFrameWnd();
			if( pWndFrame->GetWndId() == APP_INVENTORY )
			{
				CItemBase* pItemBase	= m_pVendor->GetItemId( pShortcut->m_dwId );
				if( pItemBase )
				{
					if( pItemBase->IsQuest() )
						return FALSE;

					if( pItemBase->GetProp()->dwItemKind3 == IK3_CLOAK && ( (CItemElem*)pItemBase )->m_idGuild != 0 )
						return FALSE;

//#if __VER >= 11 // __MA_VER11_05	// 케릭터 봉인 거래 기능 world,database,neuz	
//					if( pItemBase->m_dwItemId == II_SYS_SYS_SCR_SEALCHARACTER )
//						return FALSE;	// 개인상점판매허용
//#endif // __MA_VER11_05	// 케릭터 봉인 거래 기능 world,database,neuz

#if __VER >= 9 // __CSC_VER9_1
//					ItemProp* pItemProp = pItemBase->GetProp();
					CItemElem* pItemElem = (CItemElem*)pItemBase;
					if( pItemElem->IsFlag( CItemElem::expired ) )
						return TRUE;
					/*
					if(pItemProp->dwItemKind3 == IK3_EGG && pItemElem->m_pPet) //사망한 펫은 거래 불가
					{
						if(pItemElem->m_pPet->GetLife() <= 0)
							return FALSE;
					}
					*/
#endif //__CSC_VER9_1

					/*
					if( ((CItemElem*)pItemBase)->m_bCharged == 1 )
					{
						g_WndMng.PutString( prj.GetText( TID_GAME_NOTTRADE ), NULL, prj.GetTextColor( TID_GAME_NOTTRADE ) );
						return FALSE;
					}
					*/

					int iIndex	= pShortcut->m_dwData - 100;
					if( 0 <= iIndex && iIndex < MAX_VENDITEM )						
					{
						if( m_pVendor->m_vtInfo.GetItem( iIndex ) != NULL )
							return FALSE;
						
						if( IsUsingItem( pItemBase ) == FALSE && m_pVendor->IsActiveMover() && !m_pVendor->m_vtInfo.IsVendorOpen() )
						{
							SAFE_DELETE( m_pWndRegVend );
							m_pWndRegVend	= new CWndRegVend;
							m_pWndRegVend->Initialize( this );
							m_pWndRegVend->SetItem( iIndex, pItemBase );
						}
					}
				}
			}	// APP_INVENTORY
		}
	}
	else
	{
		if( nID == WIDC_OK )
		{
			if( g_pPlayer->m_pActMover->IsFly() )
				return TRUE;
			if( g_pPlayer->m_vtInfo.VendorIsVendor() == FALSE )
				return TRUE;
			CWndEdit* pWndEdit	= (CWndEdit*)GetDlgItem( WIDC_EDIT1 );
			CString strVendor	= pWndEdit->GetString();
			strVendor.TrimLeft();
			strVendor.TrimRight();

		/*#if __VER >= 11 // __MOD_VENDOR
			// 매물 액수 총합 + 현재 소지금이 2억1천이 넘으면 경고띄우고 리턴시킴.
			int nGold = (int)g_pPlayer->GetTotalGold();

			for( int iv = 0 ; iv < MAX_VENDITEM ; ++iv )
			{
				CItemBase *pItemBase = g_pPlayer->m_vtInfo.GetItem( iv );
				if( pItemBase == NULL )
					continue;

				nGold += ((CItemElem*)pItemBase)->m_nCost * pItemBase->GetExtra();
			}					
			
			if( nGold <= 0 || 2100000000 <= nGold )
			{
				g_WndMng.OpenMessageBox( _T(prj.GetText(TID_GAME_VENDOR_MAX_ALL_GOLD)), MB_OK, this );
				return TRUE;
			}
		#endif*/

			if( prj.IsInvalidName( strVendor )
#ifdef __RULE_0615
				|| prj.IsAllowedLetter( strVendor, TRUE ) == FALSE
#endif	// __RULE_0615
				)
			{
				g_WndMng.OpenMessageBox( _T( prj.GetText(TID_DIAG_0020) ) );
				return TRUE;
			}

			g_WndMng.WordChange( strVendor );
			// name
#ifdef __RULE_0615
			if( strVendor.GetLength() < 6 || strVendor.GetLength() > 32 )
#else	// __RULE_0615
			if( strVendor.GetLength() < 6 || strVendor.GetLength() >= 38 )
#endif	// __RULE_0615
			{
				g_WndMng.OpenMessageBox( _T( prj.GetText(TID_DIAG_0011) ) );
				return TRUE;
			}

			CString strFormat = strVendor;

			if( !strVendor.IsEmpty()  )
			{
				pWndEdit->m_string	= strFormat;
				pWndEdit->m_string.GetTextFormat(strFormat);
			}
			
#if __VER >= 8 // __S8_VENDOR_REVISION
			CWndVendorConfirm* pBox = new CWndVendorConfirm;
			g_WndMng.OpenCustomBox( "", pBox );			
			pBox->SetVendorName( strFormat );
			pBox->SetValue( prj.GetText( TID_GAME_VENDOR_START ) );
#else // __VER >= 8 // __S8_VENDOR_REVISION
			g_DPlay.SendPVendorOpen( (const char*)strFormat );
#endif // __VER >= 8 // __S8_VENDOR_REVISION
			CWndButton* pWndButton	= (CWndButton*)GetDlgItem( WIDC_OK );
			pWndButton->SetVisible( FALSE );
		}
		else if( nID == WIDC_CANCEL || nID == WTBID_CLOSE )
		{
#if __VER >= 8 // __S8_VENDOR_REVISION
			if( g_pPlayer->m_vtInfo.IsVendorOpen() )
			{
				CWndVendorConfirm* pBox = new CWndVendorConfirm;
				g_WndMng.OpenCustomBox( "", pBox );			
				pBox->SetValue( prj.GetText( TID_GAME_VENDOR_STOP ) );
				return FALSE;
			}
#endif // __VER >= 8 // __S8_VENDOR_REVISION
			Destroy( FALSE );
		}
		else if( nID == WIDC_CHAT )
		{
			BOOL bChattingRoom = FALSE;
			if( g_pPlayer->m_vtInfo.IsVendorOpen() )
			{
				g_DPlay.SendOpenChattingRoom();
				bChattingRoom = TRUE;
			}
			else if( g_pPlayer->m_vtInfo.GetOther() && g_Chatting.m_bState )
			{
				bChattingRoom = TRUE;
			}

			if( bChattingRoom )
			{
			#if __VER >= 11 // __MOD_VENDOR
				if(!m_pwndVenderMessage) 
				{
					m_pwndVenderMessage = new CWndVendorMessage;

					if(m_pVendor->IsActiveMover())
						m_pwndVenderMessage->m_nIsOwner = TRUE;
				#ifdef __FIX_WND_1109
					m_pwndVenderMessage->Initialize( this );
				#else	// __FIX_WND_1109
					m_pwndVenderMessage->Initialize( );
				#endif	// __FIX_WND_1109
				}
				else
				{
					if(m_pwndVenderMessage->IsVisible()) m_pwndVenderMessage->SetVisible(FALSE);
					else								 m_pwndVenderMessage->SetVisible(TRUE);
				}
			#else
				SAFE_DELETE( m_pwndVenderMessage );
				m_pwndVenderMessage = new CWndVendorMessage;
			#ifdef __FIX_WND_1109
				m_pwndVenderMessage->Initialize( this );
			#else	// __FIX_WND_1109
				m_pwndVenderMessage->Initialize( );
			#endif	// __FIX_WND_1109
			#endif

			}
		}
#if __VER >= 11 // __MOD_VENDOR
		else if(nID == WIDC_RESET)
		{
			
			CItemBase	apItem_VT[MAX_VENDITEM];		/// vendor and trader share pointer array
			ZeroMemory( apItem_VT, sizeof( apItem_VT ) );

			//if( g_pPlayer->m_vtInfo.IsVendorOpen() )
			//{
				for( int i = 0; i < MAX_VENDITEM; i++ )
				{
					// 리스트를 클리어 한다. 
					CItemBase* pItemBase = g_pPlayer->m_vtInfo.GetItem(i);
					if( pItemBase != NULL )
					{
						if( pItemBase->m_dwObjId != 0 )
							g_DPlay.SendUnregisterPVendorItem( i );
					}
				}

				// 저장버퍼도 클리어
				memset(g_Neuz.m_aSavedInven, 0, sizeof(g_Neuz.m_aSavedInven));
			//}
		}
#endif
	}
	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
}
Exemplo n.º 4
0
BOOL CWndGuildVote::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	CGuild* pGuild = g_pPlayer->GetGuild();

	if( pGuild == NULL )
		return FALSE;

	switch( nID )
	{
		case WIDC_COMBOBOX1:
			{
				if( message == WNM_SELCHANGE )
				{
					CWndComboBox* pCombo = (CWndComboBox*)GetDlgItem(WIDC_COMBOBOX1);
					SelChange( pGuild, pCombo->GetCurSel());
				}
				break;
			}
		// 길드 투표 설정
		case WIDC_VOTE_SETTING:
			{
				if(	pGuild->IsMaster( g_pPlayer->m_idPlayer ) == FALSE )
				{
					g_WndMng.OpenMessageBox( "길드마스터만 설정할수 있습니다.", MB_OK, this );
					break;
				}

				SAFE_DELETE( m_pWndGuildVoteSeting );
				m_pWndGuildVoteSeting = new CWndGuildVoteSeting;
				CWndComboBox* pCombo = (CWndComboBox*)GetDlgItem(WIDC_COMBOBOX1);
				m_pWndGuildVoteSeting->m_nSelect = pCombo->GetCurSel();
				m_pWndGuildVoteSeting->Initialize( this );
				break;
			}
		// 길드 투표
		case WIDC_VOTE:
			{
				// 현재 투표할 메뉴가 완료된것이냐?
				CWndComboBox* pCombo = (CWndComboBox*)GetDlgItem(WIDC_COMBOBOX1);

				if( pCombo->GetCurSel() == -1 )
				{
					g_WndMng.OpenMessageBox( "종류를 고르세요.", MB_OK, this );
					return FALSE;
				}
				
				
				if( pGuild->m_votes.size() )
				{
					list <CGuildVote*>::iterator it = pGuild->m_votes.begin();
					
					for ( ; it != pGuild->m_votes.end() ; ++it )
					{
						if( (*it)->GetID() == pCombo->GetItemData(pCombo->GetCurSel()) )
						{
							if( (*it)->IsCompleted() )
							{
								g_WndMng.OpenMessageBox( "투표가 완료된 사항입니다.", MB_OK, this );
								return FALSE;
							}
						}
					}
				}
				
				int nSelect = -1;

				CWndButton* pWndButton[4];				
				pWndButton[ 0 ] = (CWndButton*)GetDlgItem( WIDC_RADIO1 );
				pWndButton[ 1 ] = (CWndButton*)GetDlgItem( WIDC_RADIO2 );
				pWndButton[ 2 ] = (CWndButton*)GetDlgItem( WIDC_RADIO3 );
				pWndButton[ 3 ] = (CWndButton*)GetDlgItem( WIDC_RADIO4 );
				
				if( pWndButton[ 0 ]->GetCheck() )
					nSelect = 0;
				else
				if( pWndButton[ 1 ]->GetCheck() )
					nSelect = 1;
				else
				if( pWndButton[ 2 ]->GetCheck() )
					nSelect = 2;
				else
				if( pWndButton[ 3 ]->GetCheck() )
					nSelect = 3;


				CWndEdit* pEdit;

				switch(nSelect)
				{
					case 0:
						{
							pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT4 );

							if( strlen( pEdit->GetString() ) <= 0 )
								return FALSE;
						}
						break;
					case 1:
						{
							pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT2 );
							
							if( strlen( pEdit->GetString() ) <= 0 )
								return FALSE;
						}
						break;
					case 2:
						{
							pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT5 );
							
							if( strlen( pEdit->GetString() ) <= 0 )
								return FALSE;
						}
						break;
					case 3:
						{
							pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT3 );
							
							if( strlen( pEdit->GetString() ) <= 0 )
								return FALSE;
						}
						break;
				}

				g_DPlay.SendCastVote( pCombo->GetItemData( pCombo->GetCurSel() ), nSelect );
				break;
			}
	}

	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
} 
Exemplo n.º 5
0
BOOL CWndDebugInfo::OnChildNotify(UINT message,UINT nID,LRESULT* pLResult)
{
	CWndButton* pWndButton = (CWndButton*)*pLResult;
	//if( message == WNM_CLICKED )
	{
		switch( nID )
		{
		case WIDC_BUTTON1: // exp up
		{
			CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem( WIDC_EDIT1 );
			int nExp = _ttoi( pWndEdit->GetString() );

			if( nExp >= 0 && nExp < 0x7fffffff )
			{
				g_DPlay.SendExp( nExp );
			}
			break;
		}
			/*
		case 1003: // skinset
			g_pPlayer->SetSkinSet( _ttoi( m_wndEditExp.GetString() ) );
			break;
		case 1004: // hair
			g_pPlayer->SetHair( _ttoi( m_wndEditExp.GetString() ) );
			break;
		case 1005: // haircolor
			g_pPlayer->SetHairColor( _ttoi( m_wndEditExp.GetString() ) );
			break;
		case 1006: // face
			g_pPlayer->SetHead( _ttoi( m_wndEditExp.GetString() ) );
			break;
			
		case 1000:
			{
				CRect rect = GetWindowRect();
				m_wndExtend.SetCheck( !m_wndExtend.GetCheck() );
				if( m_wndExtend.GetCheck() )
					SetWndSize( rect.Width(), rect.Height() + 55 );
				else
					SetWndSize( rect.Width(), rect.Height() - 55 );
			}
			break;
			*/
//		case 100: g_World.m_bViewGrid      = !g_World.m_bViewGrid      ; 
		case WIDC_GRID: g_WorldMng()->m_bViewGrid      = !g_WorldMng()->m_bViewGrid      ; 
/*
			m_wndListBox.Create( WBS_MENU | WBS_NOFRAME, CRect(10,10,100,100), this, 10);
			m_wndListBox.AddString("test1");
			m_wndListBox.AddString("test1");
			m_wndListBox.AddString("test1");
			m_wndListBox.AddString("test1");
			m_wndListBox.AddString("test1");
			m_wndListBox.AddString("test1");
*/		//	m_wndListBox.AddString("test1");m_wndListBox.AddString("test1");m_wndListBox.AddString("test1");
				
			break;
//		case 101: g_World.m_bViewWireframe = !g_World.m_bViewWireframe ; break;
//		case 102: g_World.m_bViewSkybox    = !g_World.m_bViewSkybox    ; break;
//		case 103: g_World.m_bViewTerrain   = !g_World.m_bViewTerrain   ; break;
//		case 104: g_World.m_bViewObject    = !g_World.m_bViewObject    ; break;
//		case 105: 
//			g_World.m_bViewFog = !g_World.m_bViewFog; 			    
//			g_World.SetFogEnable( g_Neuz.m_pd3dDevice, g_World.m_bViewFog ); 
//			break;
//		case 106: g_World.m_bViewLOD       = !g_World.m_bViewLOD       ; break;
//		case 107: g_World.m_bViewWater     = !g_World.m_bViewWater     ; break;
//		case 108: g_World.m_bViewName      = !g_World.m_bViewName      ; break;
		case WIDC_WIREFRAME: g_WorldMng()->m_bViewWireframe = !g_WorldMng()->m_bViewWireframe ; break;
		case WIDC_SKYBOX: g_WorldMng()->m_bViewSkybox    = !g_WorldMng()->m_bViewSkybox    ; break;
		case WIDC_TERRAIN: g_WorldMng()->m_bViewTerrain   = !g_WorldMng()->m_bViewTerrain   ; break;
		case WIDC_OBJECT: g_WorldMng()->m_bViewAllObjects   = !g_WorldMng()->m_bViewAllObjects   ; break;
		case 105: 
			g_WorldMng()->m_bViewFog = !g_WorldMng()->m_bViewFog; 			    
			g_WorldMng()->SetFogEnable( g_Neuz.m_pd3dDevice, g_WorldMng()->m_bViewFog ); 
			break;
		case WIDC_LOD_TERRAIN: g_WorldMng()->m_bViewLODTerrain       = !g_WorldMng()->m_bViewLODTerrain       ; break;
		case WIDC_LOD_OBJ: g_WorldMng()->m_bViewLODObj      = !g_WorldMng()->m_bViewLODObj       ; break;
		case WIDC_WATER: g_WorldMng()->m_bViewWater     = !g_WorldMng()->m_bViewWater     ; break;
		case WIDC_NAME: g_WorldMng()->m_bViewName      = !g_WorldMng()->m_bViewName      ; break;
		case WIDC_ANIMATION: CObj::AnimateEnable( !CObj::IsAnimate() ); break;
		case WIDC_FRAME_SKIP: SetFrameSkip( !GetFrameSkip() ); break;
		case WIDC_FOG: g_WorldMng()->m_bViewFog = !g_WorldMng()->m_bViewFog; break;
		case WIDC_CHECK1: g_WorldMng()->m_bViewHP      = !g_WorldMng()->m_bViewHP      ; break;
			
//		case 111: g_World.m_bCullObj = !g_World.m_bCullObj; break;
//		case 112: g_World.m_bViewLight = !g_World.m_bViewLight; break;
//		case 113: g_World.m_bViewWeather = !g_World.m_bViewWeather; break;
		case WIDC_CULLOBJ: g_WorldMng()->m_bCullObj = !g_WorldMng()->m_bCullObj; break;
		case WIDC_LIGHT: g_WorldMng()->m_bViewLight = !g_WorldMng()->m_bViewLight; break;
		case WIDC_WEATHER: g_WorldMng()->m_bViewWeather = !g_WorldMng()->m_bViewWeather; break;
		case WIDC_ATTRIBUTE: g_WorldMng()->m_bViewHeightAttribute = !g_WorldMng()->m_bViewHeightAttribute; break;
		case WIDC_HIDE: g_pPlayer->SetVisible( !g_pPlayer->IsVisible() ); break;
		//case WIDC_114: m_pTheme->m_bNudeSkin = !m_pTheme->m_bNudeSkin; break;
			/*
		case 115: 
			if( g_Neuz.m_bCapture == FALSE )
			{
				m_wndDebug[ 15 ].SetCheck( !m_wndDebug[ 15 ].GetCheck() );
				m_pWndCapture = new CWndCapture;
				m_pWndCapture->Initialize( this, 100000 );
			} 
			else
			{
				g_Neuz.m_bCapture = FALSE;
				m_wndDebug[ 15 ].SetCheck( g_Neuz.m_bCapture );
			}
			break;
			*/
		case WIDC_BOUNDBOX: 
//			g_World.m_bViewBoundBox = !g_World.m_bViewBoundBox;
			g_WorldMng()->m_bViewBoundBox = !g_WorldMng()->m_bViewBoundBox;
			break;
		case WIDC_COLLISION:
			CObj::m_bCollision = !CObj::m_bCollision;
			break;
//			{
//				CWndSample* pWndSample = new CWndSample;
//				pWndSample->Initialize();
//			}
		case WIDC_IDSTATE:
			g_WorldMng()->m_bViewIdState = !g_WorldMng()->m_bViewIdState;
			break;
		case WIDC_HOUR:
			 g_GameTimer.SetFixed( !g_GameTimer.IsFixed() );
			 pWndButton = (CWndButton*)GetDlgItem( WIDC_HOUR );
			 if( pWndButton->GetCheck() )
			 {
				 CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem( WIDC_EDIT_HOUR );
				 int nHour = atoi( pWndEdit->GetString() );
				 if( nHour > 23 ) nHour = 23;
				 if( nHour < 0 ) nHour = 0;					 
				 g_GameTimer.SetTime( 0, nHour, 0, 0 );//Fixed( 	g_GameTimer.IsFixed() );//g_WorldMng()->m_nFixedHour = nHour;
			 }
			 
			break;
		case WIDC_EDIT_HOUR:
			{
				pWndButton = (CWndButton*)GetDlgItem( WIDC_HOUR );
				if( pWndButton->GetCheck() )
				{
					CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem( WIDC_EDIT_HOUR );
					int nHour = atoi( pWndEdit->GetString() );
					if( nHour > 23 ) nHour = 23;
					if( nHour < 0 ) nHour = 0;					 
					g_GameTimer.SetTime( 0, nHour, 0, 0 );//Fixed( 	g_GameTimer.IsFixed() );//g_WorldMng()->m_nFixedHour = nHour;
				}
			}
			break;
		}
	}
	return CWndNeuz::OnChildNotify( message, nID, pLResult );
}
Exemplo n.º 6
0
BOOL CWndGuildMerit::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	if ( message == EN_RETURN )
	{
		nID = WIDC_BUTTON1;
	}

	switch( nID )
	{
	case WIDC_CHECK2:	
		{
			CWndButton* pChk = (CWndButton*)GetDlgItem( WIDC_CHECK2 );
			
			m_nItem = pChk->GetCheck();

			if( m_nItem )
			{
				if( g_pPlayer )
				{
					CItemElem* pItemElem = NULL;
					
					for( int i=0; i<g_pPlayer->m_Inventory.GetMax() ; i++ )
					{
						pItemElem = g_pPlayer->m_Inventory.GetAtId(i);

						if( pItemElem == NULL )
							continue;
						
						if( pItemElem->GetProp()->dwItemKind3 == IK3_GEM )
						{
							pItemElem->SetExtra( pItemElem->m_nItemNum );
							m_wndctrlMerit.AddItem(pItemElem);
						}
					}
				}
			}
			else
			{
				m_wndctrlMerit.RestoreItem();
				m_wndctrlMerit.ClearItem();
			}
		}
		break;

	case WIDC_BUTTON1:		// OK
		{
			CWndEdit *pWndEdit = (CWndEdit *)GetDlgItem( WIDC_EDIT1 );
			m_nPenya = atoi( pWndEdit->GetString() );		// 문자열을 숫자로 변환.
			if( m_nPenya < 0 )
				m_nPenya = 0;
			CGuild* pGuild = g_pPlayer->GetGuild();
			if( pGuild )
			{
				// 페냐가 공헌가능한지 검사.
				if( m_nPenya )
				{
					CONTRIBUTION_RESULT cbResult = pGuild->CanContribute( 0, (DWORD)m_nPenya, g_pPlayer->m_idPlayer );
					if( cbResult == CONTRIBUTION_OK )	// 페냐 공헌가능.
						g_DPlay.SendGuildContribution( 0, m_nPenya );
					pGuild->MeritResultMsg( cbResult );	// 안내메시지.
				}
				
				//*
				// 공헌아이템
				if( m_nItem )
				{
					CONTRIBUTION_RESULT cbResult = pGuild->CanContribute( m_wndctrlMerit.GetTotalCount(), 0, g_pPlayer->m_idPlayer );
					if( cbResult == CONTRIBUTION_OK )	// 아이템 공헌가능
						g_DPlay.SendGuildContribution( 0, 0,  1);

					pGuild->MeritResultMsg( cbResult );	// 안내메시지.
				}
				
				/**/


			} // pGuild
			Destroy();
		}
		break;
	case 10000:
	case WIDC_BUTTON2:		// NO
		m_wndctrlMerit.RestoreItem();
		Destroy();			// 걍 창 닫고 나감.
		break;
	}

	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
}