#include "stdafx.h" #include "SUIInstanceMainSubMenuWnd.h" #include "SGameManager.h" //#include "SGameMessageUI.h" #include "SGameMessage.h" #include "SGameAvatarEx.h" //#include "KUIControl.h" #include "SStringDB.h" #include "SGameSystem.h" extern SGameSystem* g_pCurrentGameSystem; SUIInstanceTaskbarEntranceWnd::SUIInstanceTaskbarEntranceWnd ( SGameManager* gameManager, SUIDisplayInfo* pDisplayInfo ) : SUIWnd( gameManager ), m_pDisplayInfo( pDisplayInfo ) { } SUIInstanceTaskbarEntranceWnd::~SUIInstanceTaskbarEntranceWnd () { m_emptyRegionControl.clear(); } bool SUIInstanceTaskbarEntranceWnd::InitControls( KPoint pos ) { getWndInfo(); //SetCustomMovingRect( KRect( 0, 0, 468, 20 ) ); // 타이틀 바 선택 영역, 이동위해 클릭 Area return SUIWnd::InitControls( pos ); } void SUIInstanceTaskbarEntranceWnd::ProcMsgAtStatic( SGameMessage* msg ) { switch(msg->nType) { case MSG_PROPERTY: { SMSG_PROPERTY* pPropertyMsg = (SMSG_PROPERTY*)msg; switch( pPropertyMsg->nPropertyType ) { case SMSG_PROPERTY::PROPERTY_HUNTAHOLIC_ENT: { std::string strV; strV = "<#fffffff>("; strV += pPropertyMsg->strValue; strV += ")"; SetChildCaption("text_bearload_02", strV.c_str() ); msg->bUse = true; } break; } } break; } } void SUIInstanceTaskbarEntranceWnd::PumpUpMessage( LPCTSTR controlID, DWORD msg, DWORD lparam, DWORD wparam ) { switch( msg ) { case KUI_MESSAGE::KBUTTON_CLICK: { m_pGameManager->StartSound( "ui_click_menu01.wav" ); SGameAvatarEx* localPlayer(NULL); localPlayer = g_pCurrentGameSystem->GetLocalPlayer(); if( localPlayer && localPlayer->IsCasting() ) { m_pDisplayInfo->AddSystemMessage( S(9241), 0 ); } else { if( ::_stricmp( controlID, "button_bearload_entrance_01") == 0 ) // 2011.05.06 - servantes { SMSG_INSTANCE_GAME_ENTER *pMsg = new SMSG_INSTANCE_GAME_ENTER(SMSG_INSTANCE_GAME_ENTER::INSTANCE_TYPE::HUNTAHOLIC_BEAR_ROAD); m_pGameManager->PostMsgAtDynamic( pMsg ); m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_INSTANCE_TASKBAR_ENTRANCE, false) ); } if( ::_stricmp( controlID, "button_death_entrance_nomal") == 0 ) // 2011.05.06 - servantes { /*SMSG_INSTANCE_GAME_ENTER *pMsg = new SMSG_INSTANCE_GAME_ENTER(SMSG_INSTANCE_GAME_ENTER::INSTANCE_TYPE::RANKED_DEATHMATCH); m_pGameManager->PostMsgAtDynamic( pMsg );*/ m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_INSTANCE_TASKBAR_ENTRANCE, false) ); m_pGameManager->PostMsgAtDynamic( new SIMSG_REQ_OPEN_MSGBOX( SIMSG_REQ_OPEN_MSGBOX::MSGBOX_DEATHMATCH_RANKED_ENTER, S( 9203 ), "deathmatchrankedenter" ) ); } if( ::_stricmp( controlID, "button_death_entrance_free") == 0 ) // 2011.05.06 - servantes { /*SMSG_INSTANCE_GAME_ENTER *pMsg = new SMSG_INSTANCE_GAME_ENTER(SMSG_INSTANCE_GAME_ENTER::INSTANCE_TYPE::FREED_DEATHMATCH); m_pGameManager->PostMsgAtDynamic( pMsg );*/ m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_INSTANCE_TASKBAR_ENTRANCE, false) ); m_pGameManager->PostMsgAtDynamic( new SIMSG_REQ_OPEN_MSGBOX( SIMSG_REQ_OPEN_MSGBOX::MSGBOX_DEATHMATCH_FREED_ENTER, S( 9203 ), "deathmatchfreedenter" ) ); } /// 2012.05.03 - prodongi else if (0 == ::_stricmp(controlID, "button_close")) { m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_INSTANCE_TASKBAR_ENTRANCE, false) ); } } } break; } SUIWnd::PumpUpMessage( controlID, msg, lparam, wparam ); } void SUIInstanceTaskbarEntranceWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd ) //servantes 2010.10.13 { SUIWnd::OnNotifyUIWindowOpen(bOpen); if( !bOpen ) { m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_INSTANCE_TASKBAR_ENTRANCE, false) ); } /// 2012.05.03 - prodongi else { syncPos(); } postUpdateMainMenuButton(); } void SUIInstanceTaskbarEntranceWnd::postUpdateMainMenuButton() { m_pGameManager->PostMsgAtDynamic( new SIMSG_UPDATE_MAIN_MENU_BUTTON()); } DWORD SUIInstanceTaskbarEntranceWnd::OnMouseMessage(DWORD dwMessage, int x, int y) { if (KLBUTTON_DOWN == dwMessage) { if (isEmptyControlRegion(x, y)) return KMR_GET_PASS; } return SUIWnd::OnMouseMessage(dwMessage, x, y); } void SUIInstanceTaskbarEntranceWnd::syncPos() { SUIWnd* menuWnd = m_pGameManager->GetSUI(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_MAINMENU); if (menuWnd) MovePos(menuWnd->GetRect().left, menuWnd->GetRect().top - GetRect().GetHeight()); } bool SUIInstanceTaskbarEntranceWnd::isEmptyControlRegion(int x, int y) const { std::list::const_iterator it = m_emptyRegionControl.begin(); for (; it != m_emptyRegionControl.end(); ++it) { if ((*it)->IsInRect(x, y)) return true; } return false; } void SUIInstanceTaskbarEntranceWnd::getWndInfo() { KUIWnd* wnd; /// wnd = GetChild("area_control"); if (wnd) m_emptyRegionControl.push_back(wnd); }