void CWndGuildConfirm::OnInitialUpdate() { CWndNeuz::OnInitialUpdate(); // 여기에 코딩하세요 CWndEdit* pEdit = (CWndEdit*)GetDlgItem( WIDC_STATIC3 ); pEdit->SetTitle( strGuildName ); CRect rectRoot = m_pWndRoot->GetLayoutRect(); CRect rectWindow = GetWindowRect(); CPoint point( ( rectRoot.right - rectWindow.Width() ) / 2, 70 ); Move( point ); }
BOOL CWndVendorMessage::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) { CWndEdit* pWndText = (CWndEdit*)GetDlgItem( WIDC_EDIT1 ); switch(nID) { case WIDC_EDIT1: // 본문 if( message == EN_RETURN) { if( pWndText->m_string.IsEmpty() == FALSE ) { char szChat[1024]; if( strlen( pWndText->m_string ) < 1020 ) { CString strFormat; pWndText->m_string.GetTextFormat(strFormat); if( strlen( strFormat ) < 1020 ) { strcpy( szChat, strFormat ); g_DPlay.SendChatting( szChat ); pWndText->Empty(); } } } } break; case WIDC_BUTTON1: // 본문 { if( pWndText->m_string.IsEmpty() == FALSE ) { char szChat[1024]; if( strlen( pWndText->m_string ) < 1020 ) { CString strFormat; pWndText->m_string.GetTextFormat(strFormat); if( strlen( strFormat ) < 1020 ) { strcpy( szChat, strFormat ); g_DPlay.SendChatting( szChat ); pWndText->Empty(); } } } } break; case WTBID_CLOSE: { if( g_pPlayer->m_vtInfo.IsVendorOpen() ) g_DPlay.SendCloseChattingRoom(); } break; } return CWndNeuz::OnChildNotify( message, nID, pLResult ); }
void CWndIndirectTalk::OnDraw( C2DRender* p2DRender ) { CWorld* pWorld = g_WorldMng(); CMover* pMover = (CMover*)pWorld->GetObjFocus(); CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem( WIDC_EDIT1 ); TCHAR szNum[ 32 ]; if( pMover && pMover->GetType() == OT_MOVER ) itoa( pMover->GetId(), szNum, 10 ); else itoa( 0, szNum, 10 ); pWndEdit->SetString( szNum ); }
void CWndIndirectTalk::OnInitialUpdate() { CWndNeuz::OnInitialUpdate(); // 여기에 코딩하세요 CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem( WIDC_EDIT2); pWndEdit->AddWndStyle( EBS_AUTOVSCROLL ); // 윈도를 중앙으로 옮기는 부분. CRect rectRoot = m_pWndRoot->GetLayoutRect(); CRect rectWindow = GetWindowRect(); CPoint point( rectRoot.right - rectWindow.Width(), 110 ); Move( point ); MoveParentCenter(); }
void CWndGuildVote::SetszString(char *text1, char *text2, char *text3, char *text4 ) { CWndEdit* pEdit; pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT4 ); pEdit->SetString( text1 ); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT2 ); pEdit->SetString( text2 ); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT5 ); pEdit->SetString( text3 ); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT3 ); pEdit->SetString( text4 ); }
void CWndMessageBox::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) { if( nChar == VK_RETURN ) { CWndLogin *pWndLogin = (CWndLogin *)g_WndMng.GetWndBase( APP_LOGIN ); if( pWndLogin ) { CWndEdit* pPassword = (CWndEdit*) pWndLogin->GetDlgItem( WIDC_PASSWORD ); if( pPassword ) { pPassword->SetString("");//>m_string = ""; pPassword->PostMessage( WM_SETFOCUS );//SetFocus(); } Destroy(); } } }
void CWndDebugInfo::OnInitialUpdate() { CWndNeuz::OnInitialUpdate(); // 여기에 코딩하세요 CWndButton* pWndButton; pWndButton = (CWndButton*)GetDlgItem( WIDC_GRID ); pWndButton->SetCheck( g_WorldMng()->m_bViewGrid ); pWndButton = (CWndButton*)GetDlgItem( WIDC_TERRAIN ); pWndButton->SetCheck( g_WorldMng()->m_bViewTerrain ); pWndButton = (CWndButton*)GetDlgItem( WIDC_LOD_TERRAIN); pWndButton->SetCheck( g_WorldMng()->m_bViewLODTerrain); pWndButton = (CWndButton*)GetDlgItem( WIDC_LOD_OBJ ); pWndButton->SetCheck( g_WorldMng()->m_bViewLODObj ); pWndButton = (CWndButton*)GetDlgItem( WIDC_ANIMATION ); pWndButton->SetCheck( CObj::IsAnimate() ); pWndButton = (CWndButton*)GetDlgItem( WIDC_LIGHT ); pWndButton->SetCheck( g_WorldMng()->m_bViewLight ); //pWndButton = (CWndButton*)GetDlgItem( WIDC_CAPTURE ); pWndButton->SetCheck( ); pWndButton = (CWndButton*)GetDlgItem( WIDC_HIDE ); pWndButton->SetCheck( !g_pPlayer->IsVisible() ); pWndButton = (CWndButton*)GetDlgItem( WIDC_WIREFRAME ); pWndButton->SetCheck( g_WorldMng()->m_bViewWireframe ); pWndButton = (CWndButton*)GetDlgItem( WIDC_OBJECT ); pWndButton->SetCheck( g_WorldMng()->m_bViewAllObjects ); pWndButton = (CWndButton*)GetDlgItem( WIDC_FRAME_SKIP ); pWndButton->SetCheck( GetFrameSkip() ); pWndButton = (CWndButton*)GetDlgItem( WIDC_WEATHER ); pWndButton->SetCheck( g_WorldMng()->m_bViewWeather ); pWndButton = (CWndButton*)GetDlgItem( WIDC_BOUNDBOX ); pWndButton->SetCheck( g_WorldMng()->m_bViewBoundBox ); pWndButton = (CWndButton*)GetDlgItem( WIDC_ATTRIBUTE ); pWndButton->SetCheck( g_WorldMng()->m_bViewHeightAttribute ); pWndButton = (CWndButton*)GetDlgItem( WIDC_SKYBOX ); pWndButton->SetCheck( g_WorldMng()->m_bViewSkybox ); pWndButton = (CWndButton*)GetDlgItem( WIDC_NAME ); pWndButton->SetCheck( g_WorldMng()->m_bViewName ); pWndButton = (CWndButton*)GetDlgItem( WIDC_CULLOBJ ); pWndButton->SetCheck( g_WorldMng()->m_bCullObj ); pWndButton = (CWndButton*)GetDlgItem( WIDC_COLLISION ); pWndButton->SetCheck( CObj::m_bCollision ); pWndButton = (CWndButton*)GetDlgItem( WIDC_FOG ); pWndButton->SetCheck( g_WorldMng()->m_bViewFog ); pWndButton = (CWndButton*)GetDlgItem( WIDC_IDSTATE ); pWndButton->SetCheck( g_WorldMng()->m_bViewIdState ); pWndButton = (CWndButton*)GetDlgItem( WIDC_WATER ); pWndButton->SetCheck( g_WorldMng()->m_bViewWater ); pWndButton = (CWndButton*)GetDlgItem( WIDC_HOUR ); pWndButton->SetCheck( g_GameTimer.IsFixed() ); pWndButton = (CWndButton*)GetDlgItem( WIDC_CHECK1 ); pWndButton->SetCheck( g_WorldMng()->m_bViewHP ); CString string; string.Format( "%d", g_GameTimer.m_nHour ); CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem( WIDC_EDIT_HOUR ); pWndEdit->SetString( string ); pWndButton = (CWndButton*)GetDlgItem( WIDC_HOUR ); pWndButton->SetCheck( g_GameTimer.IsFixed() ); //g_World.m_bViewWater ////////////////////////////////////////////////////// CRect rectRoot = m_pWndRoot->GetLayoutRect(); CRect rectWindow = GetWindowRect(); CPoint point( rectRoot.right - rectWindow.Width(), 110 ); Move( point ); MoveParentCenter(); }
void CWndRepairItem::OnInitialUpdate() { CWndNeuz::OnInitialUpdate(); // 여기에 코딩하세요 memset( m_adwIdRepair, 0xff, sizeof(m_adwIdRepair) ); m_dwCost = 0; // CWndTabCtrl* pTabCtrl = (CWndTabCtrl*) GetDlgItem( WIDC_INVENTORY ); CWndEdit* pWndEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT1 ); pWndEdit->EnableWindow( FALSE ); pWndStaticCost = (CWndStatic*) GetDlgItem( WIDC_STATIC3 ); m_wndItemCtrl.Create( WLVS_ICON | WBS_NODRAWFRAME, CRect( 6, 24, 174, 192 ), this, 11 ); m_wndItemCtrl.InitItem( m_adwIdRepair ); // pRepairItem.SetItemContainer( ITYPE_ITEM, MAX_REPAIR ); // m_wndItemCtrl.InitItem( &pRepairItem, APP_REPAIR ); // WTCITEM tabTabItem; // tabTabItem.mask = WTCIF_TEXT | WTCIF_PARAM; // tabTabItem.pszText = "아이템"; // tabTabItem.pWndBase = &m_wndItemCtrl; // pTabCtrl->InsertItem( 0, &tabTabItem ); CWndInventory* pWndInventory = (CWndInventory*)g_WndMng.CreateApplet( APP_INVENTORY ); CRect rectInventory = pWndInventory->GetWindowRect( TRUE ); CPoint ptInventory = rectInventory.TopLeft(); CPoint ptMove; if( ptInventory.x > m_pWndRoot->GetWndRect().Width() / 2 ) ptMove = ptInventory - CPoint( rectInventory.Width(), 0 ); else ptMove = ptInventory + CPoint( rectInventory.Width(), 0 ); Move( ptMove ); /* CRect rectRoot = m_pWndRoot->GetLayoutRect(); CRect rectWindow = GetWindowRect(); CPoint point( rectRoot.right - rectWindow.Width(), 110 ); Move( point ); MoveParentCenter(); */ }
void CWndVendorMessage::OnInitialUpdate() { CWndNeuz::OnInitialUpdate(); CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem( WIDC_EDIT1 ); pWndEdit->AddWndStyle( EBS_AUTOVSCROLL ); pWndEdit->SetNativeMode(); pWndEdit->SetFocus(); #if __VER >= 11 // __MOD_VENDOR CWndTabCtrl* pWndTabCtrl = (CWndTabCtrl*)GetDlgItem( WIDC_TABCTRL1 ); WTCITEM tabTabItem; m_wndChat.Create(WBS_NODRAWFRAME, CRect( 0, 0, 300, 220 ), pWndTabCtrl, 10 ); m_wndChat.AddWndStyle(WBS_VSCROLL); tabTabItem.mask = WTCIF_TEXT | WTCIF_PARAM; tabTabItem.pszText = prj.GetText(TID_APP_DIALOG); //"대화" tabTabItem.pWndBase = &m_wndChat; pWndTabCtrl->InsertItem( 0, &tabTabItem ); if( m_nIsOwner ) { m_wndInfo.Create(WBS_NODRAWFRAME, CRect( 0, 0, 300, 220 ), pWndTabCtrl, 11 ); m_wndInfo.AddWndStyle(WBS_VSCROLL); tabTabItem.mask = WTCIF_TEXT | WTCIF_PARAM; tabTabItem.pszText = prj.GetText(TID_APP_INFOMATION); //"정보" tabTabItem.pWndBase = &m_wndInfo; pWndTabCtrl->InsertItem( 1, &tabTabItem ); } #endif CRect rectRoot = m_pWndRoot->GetLayoutRect(); CRect rectWindow = GetWindowRect(); CPoint point( rectRoot.right - rectWindow.Width(), 110 ); Move( point ); MoveParentCenter(); }
void CWndVendor::SetVendor( CMover* pVendor ) { m_pVendor = pVendor; m_wndctrlVendor.InitVendor( m_pVendor ); if( !m_pVendor->IsActiveMover() ) { CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem( WIDC_EDIT1 ); pWndEdit->SetString( pVendor->m_vtInfo.GetTitle() ); pWndEdit->EnableWindow( FALSE ); CWndButton* pButton = (CWndButton*)GetDlgItem( WIDC_OK ); pButton->SetVisible( FALSE ); pButton = (CWndButton*)GetDlgItem( WIDC_CANCEL ); pButton->SetVisible( FALSE ); } CWndWorld* pWndWorld = (CWndWorld*)g_WndMng.GetWndBase( APP_WORLD ); if( pWndWorld ) pWndWorld->m_objidTracking = NULL_ID; if( g_WndMng.m_pWndDialog ) Destroy(); }
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 ); }
void CWndGuildMerit::OnInitialUpdate() { CWndNeuz::OnInitialUpdate(); // 여기에 코딩하세요 LPWNDCTRL lpWndCtrl = GetWndCtrl( WIDC_LISTBOX1 ); m_wndctrlMerit.Create( WLVS_ICON | WBS_NODRAWFRAME, lpWndCtrl->rect, this, 100 ); // 윈도를 중앙으로 옮기는 부분. CRect rectRoot = m_pWndRoot->GetLayoutRect(); CRect rectWindow = GetWindowRect(); CPoint point( rectRoot.right - rectWindow.Width(), 110 ); Move( point ); MoveParentCenter(); TCHAR szNumber[ 64 ]; CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem( WIDC_EDIT1 ); _itot( 0, szNumber, 10 ); pWndEdit->SetString( szNumber ); pWndEdit->SetFocus(); }
void CWndGuildVoteSeting::OnInitialUpdate() { CWndNeuz::OnInitialUpdate(); // 여기에 코딩하세요 if( m_nSelect != -1 ) { //WIDC_EDIT1 CWndEdit* pEdit; CWndComboBox* pCombo = (CWndComboBox*)GetParentWnd()->GetDlgItem(WIDC_COMBOBOX1); CString str = pCombo->GetString(); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT1 ); pEdit->SetString( str ); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT2 ); pEdit->SetString( ((CWndEdit*) GetParentWnd()->GetDlgItem(WIDC_EDIT1))->GetString() ); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT3 ); pEdit->SetString( ((CWndEdit*) GetParentWnd()->GetDlgItem(WIDC_EDIT4))->GetString() ); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT5 ); pEdit->SetString( ((CWndEdit*) GetParentWnd()->GetDlgItem(WIDC_EDIT2))->GetString() ); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT6 ); pEdit->SetString( ((CWndEdit*) GetParentWnd()->GetDlgItem(WIDC_EDIT5))->GetString() ); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT4 ); pEdit->SetString( ((CWndEdit*) GetParentWnd()->GetDlgItem(WIDC_EDIT3))->GetString() ); } // 윈도를 중앙으로 옮기는 부분. CRect rectRoot = m_pWndRoot->GetLayoutRect(); CRect rectWindow = GetWindowRect(); CPoint point( rectRoot.right - rectWindow.Width(), 110 ); Move( point ); MoveParentCenter(); }
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 ); }
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 ); }
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 ); }
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 ); }
void CWndChat::OnInitialUpdate() { CWndNeuz::OnInitialUpdate(); #ifdef __CHAT_V19 CWndButton* pWndLock = (CWndButton*)GetDlgItem( WIDC_CHECK1 ); CWndButton* pWndLog = (CWndButton*)GetDlgItem( WIDC_CHECK3 ); CWndButton* pWndMoveLock = (CWndButton*)GetDlgItem( WIDC_MOVELOCK ); CWndButton* pWndHelp = (CWndButton*)GetDlgItem( WIDC_HELP ); CWndButton* pWndCheck = (CWndButton*)GetDlgItem( WIDC_RADIO6 ); pWndLock->SetVisible( false ); pWndLog->SetVisible( true ); pWndMoveLock->SetVisible( false ); pWndHelp->SetVisible( false ); pWndCheck->SetVisible(false); #endif //__CHAT_V19 //AddWndStyle( WBS_THICKFRAME ); m_timerDobe.Set( SEC( 5 ) ); LPWNDCTRL lpWndCtrl = GetWndCtrl( WIDC_MACRO_CHAT ); LPWNDCTRL lpWndText = GetWndCtrl( WIDC_CUSTOM1 ); m_wndMacroChat.Create( "g", WBS_NODRAWFRAME, lpWndCtrl->rect, this, WIDC_MACRO_CHAT ); m_wndMacroChat.AddWndStyle( WBS_NODRAWFRAME ); lpWndCtrl = GetWndCtrl( WIDC_EDIT ); m_wndEdit.Create( g_Neuz.GetSafeHwnd(), WBS_NODRAWFRAME, lpWndCtrl->rect, this, WIDC_EDIT ); m_wndText.Create( WBS_NOFRAME | WBS_NODRAWFRAME | WBS_VSCROLL, lpWndText->rect, this, WIDC_TEXT ); CWndText* pWndText = (CWndText*)GetDlgItem( WIDC_TEXT ); CWndEdit* pWndHead = (CWndEdit*)GetDlgItem( WIDC_HEAD ); CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem( WIDC_EDIT ); if( g_pPlayer->IsAuthHigher( AUTH_GAMEMASTER ) ) { pWndText->m_bEnableClipboard = TRUE; pWndHead->m_bEnableClipboard = TRUE; pWndEdit->m_bEnableClipboard = TRUE; } pWndEdit->SetNativeMode(); #if __VER >= 11 // __CSC_VER11_1 CRect rectEdit = m_wndEdit.GetWndRect(); rectEdit.left = rectEdit.left - 90; m_wndEdit.SetWndRect( rectEdit ); CRect customRect = lpWndCtrl->rect; CWndCustom* pCustom = (CWndCustom*)GetDlgItem(WIDC_MACRO_CHAT); if(pCustom) #ifdef __CHAT_V19 pCustom->Move(customRect.TopLeft().x - 112, customRect.TopLeft().y - 2); #else pCustom->Move(customRect.TopLeft().x - 119, customRect.TopLeft().y); pWndEdit->Move(customRect.TopLeft().x + 105, customRect.bottom + 30); #endif //__CHAT_V19 if(pWndHead) { pWndHead->EnableWindow(FALSE); pWndHead->SetVisible(FALSE); } #endif //__CSC_VER11_1 if( g_Option.m_nInstantHelp ) { CScript s; s.Load( MakePath( DIR_CLIENT, "InstantHelp.inc" ) ); s.GetToken(); while( s.tok != FINISHED ) { m_strArray.Add( s.Token ); s.GetToken(); } } //m_strArray. /* CRect rect = GetClientRect(); rect.top = rect.bottom - 20; rect.right = 70; rect.left += 5; rect.DeflateRect( 1, 1 ); m_wndBeginning.Create( g_Neuz.GetSafeHwnd(), WBS_NODRAWFRAME, rect, this, 1000); rect = GetClientRect(); rect.top = rect.bottom - 20; rect.left = 75; rect.right -= 134; rect.DeflateRect( 1, 1 ); //rect.left = rect.Width() * 20 / 100; //m_wndEdit.AddWndStyle( WBS_NODRAWFRAME ); m_wndEdit.Create( g_Neuz.GetSafeHwnd(), WBS_NODRAWFRAME, rect, this, 1001 ); */ // m_texEdit.LoadTexture( m_pApp->m_pd3dDevice, MakePath( DIR_THEME, "WndChat2.bmp" ), 0xffff00ff, TRUE ); /* rect = GetClientRect(); rect.top = rect.bottom - 20; rect.left = rect.right - 134; rect.right = r mnnnnft + 15; rect.DeflateRect( 1, 1 ); m_wndShout.Create( " ", 0, rect, this, 1010 ); rect = GetClientRect(); rect.top = rect.bottom - 20; rect.left = rect.right - 117; rect.right = rect.left + 15; rect.DeflateRect( 1, 1 ); m_wndParty.Create( " ", 0, rect, this, 1011 ); */ /* m_wndText.AddWndStyle( WBS_VSCROLL ); m_wndText.AddWndStyle( WBS_NOFRAME ); m_wndText.AddWndStyle( WBS_NODRAWFRAME ); m_wndText.Create( 0, rect, this, 1003 ); m_wndText.SetFont( g_Neuz.m_Theme.m_pFontChat ); m_wndText.m_string.Reset( m_pFont, &rect); */ /* rect = GetClientRect(); rect.left = rect.right - 100; //rect.bottom -= 80; rect.DeflateRect( 1, 1 ); m_wndReceiver.AddWndStyle( WBS_VSCROLL ); m_wndReceiver.AddWndStyle( WBS_NOFRAME ); m_wndReceiver.Create( EBS_AUTOVSCROLL, rect, this, 1002 ); m_wndReceiver.AddString( "Vampyre\n" ); m_wndReceiver.AddString( "Xuzhu\n" ); m_wndReceiver.AddString( "Zodiacus\n" ); m_wndReceiver.AddString( "Jeff\n" ); m_wndReceiver.m_string.Reset( m_pFont, &rect); */ //CWndText* pWndText = (CWndText*)GetDlgItem( WIDC_TEXT ); SetChannel(); CWndButton* pWndRadio1 = (CWndButton*)GetDlgItem( WIDC_RADIO1 ); CWndButton* pWndRadio2 = (CWndButton*)GetDlgItem( WIDC_RADIO2 ); CWndButton* pWndRadio3 = (CWndButton*)GetDlgItem( WIDC_RADIO3 ); CWndButton* pWndRadio4 = (CWndButton*)GetDlgItem( WIDC_RADIO4 ); CWndButton* pWndRadio5 = (CWndButton*)GetDlgItem( WIDC_RADIO5 ); if( m_nChatChannel == CHATSTY_GENERAL ) pWndRadio1->SetCheck( TRUE ); else if( m_nChatChannel == CHATSTY_WHISPER ) pWndRadio2->SetCheck( TRUE ); else if( m_nChatChannel == CHATSTY_SHOUT ) pWndRadio3->SetCheck( TRUE ); else if( m_nChatChannel == CHATSTY_PARTY ) pWndRadio4->SetCheck( TRUE ); else if( m_nChatChannel == CHATSTY_GUILD ) pWndRadio5->SetCheck( TRUE ); //pWndText->m_string.Init( //pWndText->m_string = g_WndMng.m_ChatString; pWndText->m_nLineSpace = 2; //pWndText->m_string.Reset( m_pFont, &pWndText->GetClientRect() ); //pWndText-> /* CRect rect = GetClientRect(); rect.bottom -= 20; rect.right -= 0;//100; rect.DeflateRect( 1, 1); m_wndText.SetWndRect( rect ); */ //LPBYTE m_wndChatEdit[3]; //CSize sizeWndChatEdit[3]; #if __VER >= 11 // __CSC_VER11_1 LoadTGA( MakePath( DIR_THEME, "WndChatEdit00_1.tga" ), &m_wndChatEdit[0] ); #else //__CSC_VER11_1 LoadTGA( MakePath( DIR_THEME, "WndChatEdit00.tga" ), &m_wndChatEdit[0] ); #endif //__CSC_VER11_1 LoadTGA( MakePath( DIR_THEME, "WndChatEdit01.tga" ), &m_wndChatEdit[1] ); #ifdef __LANG_IME_0327 LoadTGA( MakePath( DIR_THEME, ::GetLanguage(), "WndChatEdit02.tga" ), &m_wndChatEdit[2] ); #else // __LANG_IME_0327 LoadTGA( MakePath( DIR_THEME, "WndChatEdit02.tga" ), &m_wndChatEdit[2] ); #endif // __LANG_IME_0327 if( m_wndChatEdit[2].lpData == NULL ) { Error( "CWndChat::OnInitialUpdate() m_wndChatEdit[2].lpData = NULL" ); return; } /* CRect rectRoot = m_pWndRoot->GetLayoutRect(); CRect rectWindow = GetWindowRect(); CPoint point( 154, rectRoot.bottom - rectWindow.Height() ); Move( point ); */ #ifndef __CHAT_V19 CWndButton* pWndLock = (CWndButton*)GetDlgItem( WIDC_CHECK1 ); pWndLock->SetCheck( m_bChatLock ); CWndButton* pWndMoveLock = (CWndButton*)GetDlgItem( WIDC_MOVELOCK ); pWndMoveLock->SetCheck( m_bMoveLock ); #endif //__CHAT_V19 CRect rectRoot = m_pWndRoot->GetLayoutRect(); CRect rect = GetWindowRect(); int nWidth = rect.Width(); int nHeight = rect.Height(); int x = 0;//rectRoot.left + (rectRoot.Width() / 2) - (nWidth / 2); int y = rectRoot.bottom - nHeight; CPoint point( x, y ); Move( point ); m_timerInputTimeOut.Set( SEC( 300 ) ); #if __VER >= 8 //__Y_CHAT_SYSTEM_8 if( g_WndMng.m_pWndChatLog == NULL ) { g_WndMng.m_pWndChatLog = new CWndChatLog; if( g_WndMng.m_pWndChatLog ) { g_WndMng.m_pWndChatLog->Initialize( NULL, APP_CHAT_LOG ); CRect rectRoot = m_pWndRoot->GetLayoutRect(); CRect rect = GetWindowRect(TRUE); CRect rect2 = g_WndMng.m_pWndChatLog->GetClientRect(TRUE); int x = 0; int y = rect.top; if( (rect.right+rect2.Width()) < rectRoot.right ) x = rect.right; else x = (rect.left - rect2.Width() ); CPoint point( x, y ); g_WndMng.m_pWndChatLog->Move( point ); g_WndMng.m_pWndChatLog->SetVisible(FALSE); } } if( g_WndMng.m_pWndChatLog ) { CWndButton* pWndCheck3 = (CWndButton*)GetDlgItem( WIDC_CHECK3 ); if( pWndCheck3 ) pWndCheck3->SetCheck(g_WndMng.m_pWndChatLog->m_bVisible); } #endif //__Y_CHAT_SYSTEM_8 }
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 ); }
BOOL CWndGuildVoteSeting::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) { switch( nID ) { // 길드 설정창 클리어 case WIDC_VOTE_CLEAR: { CWndEdit* pEdit; pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT1 ); pEdit->SetString( "" ); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT2 ); pEdit->SetString( "" ); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT3 ); pEdit->SetString( "" ); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT5 ); pEdit->SetString( "" ); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT6 ); pEdit->SetString( "" ); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT4 ); pEdit->SetString( "" ); m_nSelect = -1; } break; // 길드 투표 시작 case WIDC_VOTE_START: { CGuild* pGuild = g_pPlayer->GetGuild(); if( pGuild ) { // 현재 투표할 메뉴가 완료된것이냐? CWndComboBox* pCombo = (CWndComboBox*)GetParentWnd()->GetDlgItem(WIDC_COMBOBOX1); if( m_nSelect != -1 ) { 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(m_nSelect) ) { if( (*it)->IsCompleted() ) { g_WndMng.OpenMessageBox( "투표가 완료된 사항입니다.", MB_OK, this ); return FALSE; } else { g_WndMng.OpenMessageBox( "이미 진행중입니다.", MB_OK, this ); return FALSE; } } } } } // 입력사항 체크 부분... CWndEdit* pEdit1 = (CWndEdit*) GetDlgItem( WIDC_EDIT1 ); CWndEdit* pEdit2 = (CWndEdit*) GetDlgItem( WIDC_EDIT2 ); if( strlen( pEdit1->GetString() ) <= 0 || strlen( pEdit2->GetString() ) <= 0 ) { g_WndMng.OpenMessageBox( "투표제목과 내용은 필수 입력 사항입니다.", MB_OK, this ); break; } int nChk = -1; CWndEdit* pEdit[4]; pEdit[0] = (CWndEdit*) GetDlgItem( WIDC_EDIT3 ); pEdit[1] = (CWndEdit*) GetDlgItem( WIDC_EDIT5 ); pEdit[2] = (CWndEdit*) GetDlgItem( WIDC_EDIT6 ); pEdit[3] = (CWndEdit*) GetDlgItem( WIDC_EDIT4 ); int i; for( i=0; i<4; i++ ) { if( strlen( pEdit[i]->GetString() ) > 0 ) nChk = i; } if( nChk != -1 ) { if( nChk < 1 ) { g_WndMng.OpenMessageBox( "투표 항목은 최소한 2개 이상이어야 합니다.", MB_OK, this ); break; } for( i=0; i<=nChk; i++ ) { if( strlen( pEdit[i]->GetString() ) <= 0 ) { g_WndMng.OpenMessageBox( "중간에 빈 내용이 있습니다.", MB_OK, this ); return FALSE; } } } else { g_WndMng.OpenMessageBox( "투표 항목은 최소한 2개 이상이어야 합니다.", MB_OK, this ); break; } LPCTSTR ptext[4]; ptext[0] = pEdit[0]->GetString(); ptext[1] = pEdit[1]->GetString(); ptext[2] = pEdit[2]->GetString(); ptext[3] = pEdit[3]->GetString(); g_DPlay.SendAddVote( pEdit1->GetString(), pEdit2->GetString(), ptext ); } Destroy(); } break; // 길드투표 끝내기 case WIDC_VOTE_FINISH: { CWndComboBox* pCombo = (CWndComboBox*)GetParentWnd()->GetDlgItem(WIDC_COMBOBOX1); if( pCombo->GetCurSel() != -1 ) g_DPlay.SendCloseVote( pCombo->GetItemData( pCombo->GetCurSel() ) ); Destroy(); } break; } return CWndNeuz::OnChildNotify( message, nID, pLResult ); }
void CWndGuildVote::SetQuestion( const char *question) { CWndEdit* pEdit; pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT1 ); pEdit->SetString(question); }
void CWndGuildVote::OnInitialUpdate() { CWndNeuz::OnInitialUpdate(); // 여기에 코딩하세요 CWndEdit* pEdit; pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT1 ); pEdit->EnableWindow(FALSE); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT4 ); pEdit->EnableWindow(FALSE); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT2 ); pEdit->EnableWindow(FALSE); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT5 ); pEdit->EnableWindow(FALSE); pEdit = (CWndEdit*) GetDlgItem( WIDC_EDIT3 ); pEdit->EnableWindow(FALSE); CGuild* pGuild = g_pPlayer->GetGuild(); if( !pGuild ) { g_WndMng.PutString( "소속된 길드가 없어서 길드투표창을 열 수 없습니다." ); Destroy(); return; } else if( !(pGuild->m_nLevel > 7) ) { g_WndMng.PutString( prj.GetText(TID_GAME_GUILDNOTLEVEL) ); Destroy(); return; } CWndComboBox* pCombo = (CWndComboBox*)GetDlgItem(WIDC_COMBOBOX1); pCombo->ResetContent(); list <CGuildVote*>::iterator it = pGuild->m_votes.begin(); for ( ; it != pGuild->m_votes.end() ; ++it ) { int nIndex; nIndex = pCombo->AddString( (*it)->GetTitle() ); pCombo->SetItemData( nIndex, (*it)->GetID() ); } 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 ); pWndButton[ 0 ]->SetGroup( TRUE ); // 윈도를 중앙으로 옮기는 부분. CRect rectRoot = m_pWndRoot->GetLayoutRect(); CRect rectWindow = GetWindowRect(); CPoint point( rectRoot.right - rectWindow.Width(), 110 ); Move( point ); MoveParentCenter(); }