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(); }
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; }
void CUIItemExchange::Render() { if (!m_bVisible) return; // 보이지 않으면 자식들을 render하지 않는다. POINT ptCur = CGameProcedure::s_pLocalInput->MouseGetPos(); m_pUITooltipDlg->DisplayTooltipsDisable(); bool bTooltipRender = false; __IconItemSkill* spItem; for(UIListReverseItor itor = m_Children.rbegin(); m_Children.rend() != itor; ++itor) { CN3UIBase* pChild = (*itor); pChild->Render(); if ( (pChild->UIType() == UI_TYPE_ICON) && (pChild->GetStyle() & UISTYLE_ICON_HIGHLIGHT) ) { bTooltipRender = true; spItem = GetHighlightIconItem( (CN3UIIcon* )pChild ); } } if ( bTooltipRender ) m_pUITooltipDlg->DisplayTooltipsEnable(ptCur.x, ptCur.y, spItem ); }
void CUIManager::ReorderChildList() // 다이알로그 순서 재배치 { int iChildCount = m_Children.size(); if (iChildCount<=0) return; CN3UIBase** ppBuffer = new CN3UIBase*[iChildCount]; int iAlwaysTopChildCount = 0; for(UIListItor itor = m_Children.begin(); m_Children.end() != itor; ) { CN3UIBase* pChild = (*itor); if (pChild->GetStyle() & UISTYLE_ALWAYSTOP) { itor = m_Children.erase(itor); // 우선 리스트에서 지우고 ppBuffer[iAlwaysTopChildCount++] = pChild; } else ++itor; } int i; for (i=iAlwaysTopChildCount-1; i>=0; --i) { m_Children.push_front(ppBuffer[i]); // 맨앞에 넣는다. 그리는 순서를 맨 나중에 그리도록 하고 메세지를 맨 먼저 받게 하려고 } delete [] ppBuffer; }
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); }