Example #1
0
bool CUILogIn::ReceiveMessage(CN3UIBase* pSender, DWORD dwMsg)
{
	if(NULL == pSender) return false;

	//s_CameraData.vp;  //불러 오는 과정을 살펴본다 
	//DWORD mm = s_CameraData.vp.Height;
	//DWORD ss = s_CameraData.vp.Width;	

	if (dwMsg == UIMSG_BUTTON_CLICK)
	{
		if (pSender == m_pBtn_LogIn && m_pEdit_id && m_pEdit_pw)
		{
			CGameProcedure::s_pProcLogIn->MsgSend_AccountLogIn(LIC_KNIGHTONLINE);
		}
		else if(pSender == m_pBtn_Connect)
		{
			CGameProcedure::s_pProcLogIn->ConnectToGameServer(); // 고른 게임 서버에 접속
		}
		else if (pSender == m_pBtn_Cancel)
		{
			//PostQuitMessage(0);	// 종료...
			CGameBase::s_bRunning = false;
		}
		else if(pSender == m_pBtn_Option) // 옵션..
		{
			std::string szMsg;
			szMsg = "Would you like to open the options?";//::_LoadStringFromResource(IDS_CONFIRM_EXECUTE_OPTION, szMsg);
			CGameProcedure::MessageBoxPost(szMsg, "", MB_YESNO, BEHAVIOR_EXECUTE_OPTION);
		}
	}
	else if(UIMSG_LIST_DBLCLK == dwMsg)
	{
		CGameProcedure::s_pProcLogIn->ConnectToGameServer(); // 고른 게임 서버에 접속
	}
	else if (dwMsg == UIMSG_EDIT_RETURN)
	{
		// TEMP(srmeier): there is a weird issue where the key inputs aren't going
		// through CGameProcedure::ProcessUIKeyInput() so CUILogIn::OnKeyPress() isn't
		// being called...
		if(!m_bLogIn && m_pEdit_id && m_pEdit_pw)
		{
			CN3UIBase* pMsgBox = CGameProcedure::s_pMsgBoxMgr->GetFocusMsgBox();
			if( !(pMsgBox && pMsgBox->IsVisible()) )
				CGameProcedure::s_pProcLogIn->MsgSend_AccountLogIn(LIC_KNIGHTONLINE);
		}
		else {
			ReceiveMessage(m_pBtn_Connect, UIMSG_BUTTON_CLICK);
		}
	}
	else if (dwMsg == UIMSG_EDIT_TAB)
	{
		// TEMP(srmeier): there is a weird issue where the key inputs aren't going
		// through CGameProcedure::ProcessUIKeyInput() so CUILogIn::OnKeyPress() isn't
		// being called...
		FocusCircular();
	}

	return true;
}
Example #2
0
CN3UIBase* CUIManager::GetTopUI(bool bVisible)
{
	if(!bVisible) 
	{
		if(m_Children.empty()) return NULL;
		else return *(m_Children.begin());
	}

	UIListItor it = m_Children.begin(), itEnd = m_Children.end();
	for(; it != itEnd; it++)
	{
		CN3UIBase* pUI = *(it);
		if(pUI->IsVisible()) return pUI;
	}
	
	return NULL;
}
Example #3
0
bool CUILogIn::ReceiveMessage(CN3UIBase* pSender, DWORD dwMsg)
{
	if(NULL == pSender) return false;

	//s_CameraData.vp;  //불러 오는 과정을 살펴본다 
	//DWORD mm = s_CameraData.vp.Height;
	//DWORD ss = s_CameraData.vp.Width;	

	if (dwMsg == UIMSG_BUTTON_CLICK)
	{
		if (pSender == m_pBtn_LogIn && m_pEdit_id && m_pEdit_pw)
		{
			CGameProcedure::s_pProcLogIn->MsgSend_AccountLogIn(LIC_KNIGHTONLINE);
		}
		else if(pSender == m_pBtn_Connect)
		{
			CGameProcedure::s_pProcLogIn->ConnectToGameServer(); // 고른 게임 서버에 접속
		}
		else if (pSender == m_pBtn_Cancel)
		{
			PostQuitMessage(0);	// 종료...
		}
		else if(pSender == m_pBtn_Option) // 옵션..
		{
			std::string szMsg;
			::_LoadStringFromResource(IDS_CONFIRM_EXECUTE_OPTION, szMsg);
			CGameProcedure::MessageBoxPost(szMsg, "", MB_YESNO, BEHAVIOR_EXECUTE_OPTION);
		}
	}
	else if(UIMSG_LIST_DBLCLK == dwMsg)
	{
		CGameProcedure::s_pProcLogIn->ConnectToGameServer(); // 고른 게임 서버에 접속
	}
	else if (dwMsg == UIMSG_EDIT_RETURN)
	{
		if(!m_bLogIn && m_pEdit_id && m_pEdit_pw)
		{
			CN3UIBase* pMsgBox = CGameProcedure::s_pMsgBoxMgr->GetFocusMsgBox();
			if( !(pMsgBox && pMsgBox->IsVisible()) )
				CGameProcedure::s_pProcLogIn->MsgSend_AccountLogIn(LIC_KNIGHTONLINE);
		}
	}

	return true;
}
Example #4
0
void CUIManager::UserMoveHideUIs()
{
	bool bHide = false;
	UIListItor it = m_Children.begin(), itEnd = m_Children.end();
	for(; it != itEnd; it++)
	{
		CN3UIBase* pUI = *(it);

		if(pUI == NULL) continue;

		if(pUI->IsVisible() && (pUI->GetStyle() & UISTYLE_USER_MOVE_HIDE))
		{
			bHide = true;
			pUI->SetVisibleWithNoSound(false, true);
		}
	}

	if(bHide) ReFocusUI();
}
Example #5
0
CN3UIBase* CUIManager::GetEnableFocusTopUI(bool bVisible)
{
	if(!bVisible) 
	{
		if(m_Children.empty()) return NULL;
		else return *(m_Children.begin());
	}

	UIListItor it = m_Children.begin(), itEnd = m_Children.end();
	for(; it != itEnd; it++)
	{
		CN3UIBase* pUI = *(it);
		if(pUI && pUI->IsVisible() &&	//보이고
			!(pUI->GetStyle() & UISTYLE_FOCUS_UNABLE) && //포커스가 가능하고
			!(pUI->GetStyle() & UISTYLE_HIDE_UNABLE)) //닫힐수 있는
			return pUI;
	}
	
	return NULL;
}
Example #6
0
void CUIManager::SetVisibleFocusedUI(CN3UIBase *pUI)
{
	if(NULL == pUI)
	{
		m_pUIFocused = NULL;
		return;
	}

	if(!pUI->IsVisible())
		return;

	UIListItor it = m_Children.begin(), itEnd = m_Children.end();

	DWORD dwUIStyle, dwUIHideStyle;
	CN3UIBase* pUIHide = NULL;

	dwUIStyle = pUI->GetStyle();
	if(dwUIStyle & UISTYLE_SHOW_ME_ALONE)
	{
		for(; it != itEnd;)
		{
			pUIHide = *it;
			if(pUIHide == NULL)
			{
				it = m_Children.erase(it);
				continue;
			}

			dwUIHideStyle = pUIHide->GetStyle();
			if(pUIHide->IsVisible() && pUI != pUIHide && !(dwUIHideStyle & UISTYLE_HIDE_UNABLE))
				pUIHide->SetVisibleWithNoSound(false, true);

			it++;
		}//
	}
	else if(!(dwUIStyle & UISTYLE_HIDE_UNABLE))
	{
		for(; it != itEnd;)
		{
			pUIHide = *it;
			if(pUIHide == NULL)
			{
				it = m_Children.erase(it);
				continue;
			}

			dwUIHideStyle = pUIHide->GetStyle();
			if(pUIHide->IsVisible() && pUI != pUIHide && (dwUIHideStyle & UISTYLE_SHOW_ME_ALONE))
				pUIHide->SetVisibleWithNoSound(false, true);
/*
			if(pUIHide->IsVisible() && pUI != pUIHide)
			{
				if(dwUIHideStyle & UISTYLE_SHOW_ME_ALONE)
					pUIHide->SetVisibleWithNoSound(false, true);
				else if( (dwUIStyle & UISTYLE_POS_LEFT) && (dwUIHideStyle & UISTYLE_POS_LEFT) )
					pUIHide->SetVisibleWithNoSound(false, true);
				else if( (dwUIStyle & UISTYLE_POS_RIGHT) && (dwUIHideStyle & UISTYLE_POS_RIGHT) )
					pUIHide->SetVisibleWithNoSound(false, true);
			}
*/
			it++;
		}
	}

	it = m_Children.begin();
	itEnd = m_Children.end();

	for(; it != itEnd; it++)
	{
		if(pUI == *it) break;
	}
	if(it == itEnd) return;

	if(!(dwUIStyle & UISTYLE_FOCUS_UNABLE))
	{
		it = m_Children.erase(it);			// 우선 리스트에서 지우고
		m_Children.push_front(pUI);	// 맨앞에 넣는다. 그리는 순서를 맨 나중에 그리도록 하고 메세지를 맨 먼저 받게 하려고
		ReorderChildList();	// child list 재정렬(항상 위에 뜨는 dialog 때문에 다시 정렬한다.)
	}

	m_pUIFocused = this->GetEnableFocusTopUI(true);
}