Example #1
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 #2
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);
}