Exemple #1
0
void CWndGuildVote::SelChange(CGuild* pGuild, int nIndex)
{
	GUILD_VOTE_SELECT guildvotesel[4];
	
	CWndComboBox* pCombo = (CWndComboBox*)GetDlgItem(WIDC_COMBOBOX1);
	
	list <CGuildVote*>::iterator it = pGuild->m_votes.begin();
	
	for ( ; it != pGuild->m_votes.end() ; ++it )
	{
		if( (*it)->GetID() == pCombo->GetItemData(nIndex) )
		{
			guildvotesel[0] = (*it)->GetVoteSelect(0);
			guildvotesel[1] = (*it)->GetVoteSelect(1);
			guildvotesel[2] = (*it)->GetVoteSelect(2);
			guildvotesel[3] = (*it)->GetVoteSelect(3);
			
			SetQuestion( (*it)->GetQuestion() );
			break;
		}
	}
	
	SetszString( guildvotesel[0].szString, guildvotesel[1].szString, guildvotesel[2].szString, guildvotesel[3].szString );
	SetCount( guildvotesel[0].cbCount, guildvotesel[1].cbCount, guildvotesel[2].cbCount, guildvotesel[3].cbCount );
}
Exemple #2
0
void CEventHandler::LoadTrain(CWndControl* sender,CMainDlg* parent){
	
	CCharacter* m_char = parent->m_clsCurChar;
	if(m_char==NULL)
		return;
	CWndDlg* dlgCtrlContainer = parent->m_controlDlg;
	CWndComboBox * cmbTrain = static_cast<CWndComboBox*> (dlgCtrlContainer->GetControl(L"cmbGoBack"));
	//m_char->m_iTrainMap =_ttoi( cmbTrain->GetItem(cmbTrain->GetSelectedIndex()));
	m_char->m_iTrainMap =m_char->GetMapId( cmbTrain->GetItem(cmbTrain->GetSelectedIndex()));
	parent->MappingObj();
}
Exemple #3
0
void CEventHandler::SetPriority(CWndControl* sender,CMainDlg* parent){
	CWndComboBox* cmb = static_cast<CWndComboBox*> (sender);
	CWndDlg* dlgCtrlContainer = parent->m_controlDlg;
	CCharacter* m_char = parent->m_clsCurChar;
	if(m_char!=NULL){
	
		m_char->m_iPriority = cmb->GetSelectedIndex();
		
		CWndButton * btn = static_cast<CWndButton*> (dlgCtrlContainer->GetControl(L"btnPriority"));
		btn->SetEnabled(m_char->m_iPriority==1 || m_char->m_iPriority==2);
		m_char->serialize->SaveInfo(L"Priority",m_char->m_iPriority,TagType::Element,L"/Info");
	}
}
Exemple #4
0
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();
} 
void CWndAdminCreateItem::OnInitialUpdate() 
{ 
	CWndNeuz::OnInitialUpdate(); 

	CWndListBox* pListBox = (CWndListBox*)GetDlgItem( WIDC_CONTROL1 );
	for( int i = 0; i < prj.m_aPropItem.GetSize(); i++ )
	{
		ItemProp* pItemProp =  prj.GetItemProp( i );
		if( pItemProp )
		{
			if( GetLanguage() != LANG_KOR && pItemProp->nVer >= 7 && pItemProp->bCharged == TRUE )
				continue;
			int nIndex = pListBox->AddString( MakeName( pItemProp ) );
			pListBox->SetItemDataPtr( nIndex, pItemProp );
		}
	}
	CWndComboBox* pWndItemKind = (CWndComboBox*)GetDlgItem( WIDC_ITEM_KIND );
	CWndComboBox* pWndItemSex = (CWndComboBox*)GetDlgItem( WIDC_ITEM_SEX );
	CWndComboBox* pWndItemJob = (CWndComboBox*)GetDlgItem( WIDC_ITEM_JOB );
	CWndEdit* pWndLevel = (CWndEdit*)GetDlgItem( WIDC_LEVEL );
	CStringArray strArray;
	CScript::GetFindIdToArray( "IK2_", &strArray );
	int nIndex = pWndItemKind->AddString( "ALL" );
	pWndItemKind->SetItemData( nIndex, NULL_ID );
	for( i = 0; i < strArray.GetSize(); i++ )
	{
		nIndex = pWndItemKind->AddString( strArray.GetAt( i ) );
		DWORD dwNum = CScript::GetDefineNum( strArray.GetAt( i ) );
		pWndItemKind->SetItemData( nIndex, dwNum );
	}
	pWndItemKind->m_wndListBox.SortListBox();
	nIndex = pWndItemKind->m_wndListBox.FindString( 0, "ALL" );
	pWndItemKind->SetCurSel( nIndex );
	strArray.RemoveAll();
	CScript::GetFindIdToArray( "SEX_", &strArray );
	for( i = 0; i < strArray.GetSize(); i++ )
	{
		nIndex = pWndItemSex->AddString( strArray.GetAt( i ) );
		DWORD dwNum = CScript::GetDefineNum( strArray.GetAt( i ) );
		pWndItemSex->SetItemData( nIndex, dwNum );
	}
	pWndItemSex->SetCurSel( 2 );

	strArray.RemoveAll();
	CScript::GetFindIdToArray( "JOB_", &strArray );
	nIndex = pWndItemJob->AddString( "ALL" );
	pWndItemJob->SetItemData( nIndex, -1 );
	for( i = 0; i < strArray.GetSize(); i++ )
	{
		nIndex = pWndItemJob->AddString( strArray.GetAt( i ) );
		DWORD dwNum = CScript::GetDefineNum( strArray.GetAt( i ) );
		pWndItemJob->SetItemData( nIndex, dwNum );
	}
	pWndItemJob->m_wndListBox.SortListBox();
	nIndex = pWndItemJob->m_wndListBox.FindString( 0, "ALL" );
	pWndItemJob->SetCurSel( nIndex );
	// 좌표 이동 

	CRect rectRoot = m_pWndRoot->GetLayoutRect();
	CRect rectWindow = GetWindowRect();
	CPoint point( rectRoot.right - rectWindow.Width(), 110 );
	Move( point );
	MoveParentCenter();
} 
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 ); 
} 
Exemple #7
0
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();
} 
Exemple #8
0
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 ); 
} 
Exemple #9
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 ); 
}