1019 lines
28 KiB
C++
1019 lines
28 KiB
C++
|
|
|
|
|
|
#include "stdafx.h"
|
|
#include "SGameSystem.h"
|
|
#include "KUIControlStatic.h"
|
|
#include "KUIControlGauge.h"
|
|
#include "KUIControlEdit.h"
|
|
#include "KUIControlButton.h"
|
|
|
|
#include "SGameManager.h"
|
|
#include "SGameMessage.h"
|
|
//#include "SGameMessageUI.h"
|
|
#include "SUIPartyWndBase.h"
|
|
#include "SUIPartyWndDual.h"
|
|
|
|
#include "SUIPartyWndMgr.h"
|
|
#include "SUIDisplayInfo.h"
|
|
|
|
#include "SUISysMsgDefine.h"
|
|
#include <toolkit/XStringUtil.h>
|
|
#include "SStringDB.h"
|
|
#include "SJobDB.h"
|
|
#include "SItemDB.h"
|
|
#include "SGameOption.h"
|
|
#include "SPlayerInfoMgr.h"
|
|
#include "SMessengerMgr.h"
|
|
//#include "Util.h"
|
|
#include "SChatType.h"
|
|
#include "SGameAvatarEx.h"
|
|
#include "SGame.h"
|
|
#include "SCreatureDB.h"
|
|
#include "ErrorCode/ErrorCode.h" // sonador 3.5.1 던전 시즈 레벨 제한
|
|
|
|
#include <kfile/KFileManager.h>
|
|
|
|
#include "SUIPartyStateSetWnd.h"
|
|
#include "IHuntaHolicSystem.h" // #2.1.2.11.1
|
|
#include "SSummonSlotMgr.h"
|
|
//#include "SUIUtil.h"
|
|
#include "SGameCreature.h"
|
|
#include "Arena\\ArenaUtility.h"
|
|
|
|
|
|
#define DEF_MYPARTY_ID 0 // 최초에 메세지 처리를 위해 만든 임의적인 파티의 아이디
|
|
#define DEF_MYPARTY_NAME "default" // 최초에 메세지 처리를 위해 만든 임의적인 파티의 이름
|
|
|
|
|
|
extern SGameSystem* g_pCurrentGameSystem;
|
|
extern void MsgSplit( const char* szMsg, std::vector<std::string>& vecText, const wchar_t* lpDelimiter, bool bProcSpecialCharacter=false );
|
|
|
|
|
|
namespace
|
|
{
|
|
POINT aDlgPos[8] =
|
|
{
|
|
{ 0, 210 }, // 내파티창
|
|
{ 140, 214 }, // 1번 공격대창
|
|
{ 235, 214 }, // 2번 공격대창
|
|
{ 330, 214 }, // 3번 공격대창
|
|
{ 425, 214 }, // 4번 공격대창
|
|
{ 520, 214 }, // 5번 공격대창
|
|
{ 615, 214 }, // 6번 공격대창
|
|
{ 710, 214 }, // 7번 공격대창
|
|
};
|
|
};
|
|
|
|
|
|
SUIPartyWndMgr::SUIPartyWndMgr( SGameManager* pGameManager, SUIDisplayInfo* pDisplayInfo )
|
|
: SUIWnd( pGameManager ), m_pDisplayInfo ( pDisplayInfo )
|
|
{
|
|
}
|
|
|
|
SUIPartyWndMgr::~SUIPartyWndMgr()
|
|
{
|
|
GetGameOption().SetPartyX(0);// pWnd->GetRect().left );
|
|
GetGameOption().SetPartyY(0);// pWnd->GetRect().top );
|
|
|
|
ClearWnd();
|
|
ResetWnd();
|
|
}
|
|
|
|
SUIWnd* SUIPartyWndMgr::CreateWnd( const char* szFile, KUIWndManager* pWndManager, KPoint kPos, int nWindowID )
|
|
{
|
|
SUIWnd::CreateWnd( szFile, pWndManager, kPos, nWindowID );
|
|
|
|
InitWnd();
|
|
|
|
SetShow(true);
|
|
|
|
KRect rt;
|
|
rt.left = 0;
|
|
rt.right = GetGameOption().GetResolution_Width();
|
|
rt.top = 0;
|
|
rt.bottom = GetGameOption().GetResolution_Height();
|
|
this->Resize(rt);
|
|
|
|
return this;
|
|
}
|
|
|
|
void SUIPartyWndMgr::InitWnd()
|
|
{
|
|
char buf[64];
|
|
int h = GetGameOption().GetResolution_Height();
|
|
int j=1;
|
|
for(int x=0; x<8; x++, j++)
|
|
{
|
|
sprintf(buf, "temp_party%d", x);
|
|
|
|
SUIPartyDualWnd* pWnd = new SUIPartyDualWnd(m_pGameManager, m_pDisplayInfo);
|
|
pWnd->CreateWnd("window_player_party_base.nui", m_pManager, KPoint(0, 0), x);
|
|
pWnd->SetParent(this);
|
|
pWnd->SetPartyName(buf);
|
|
pWnd->SetListSizeType(PARTY_UI_LIST_SIZE_EXTEND);
|
|
pWnd->MovePos(aDlgPos[x].x, aDlgPos[x].y);
|
|
pWnd->initStatus(); /// 2011.11.16 상태 초기화 - prodongi
|
|
pWnd->SetShow(false);
|
|
pWnd->OnNotifyUIWindowOpen(false);
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "small_buff", (unsigned int)x ) );
|
|
|
|
if(x == 0)
|
|
{
|
|
pWnd->SetPartyType(PARTY_NORMAL);
|
|
pWnd->ChangeWndState(PARTY_UI_SIZE_BIG);
|
|
}
|
|
else
|
|
{
|
|
pWnd->SetPartyType(PARTY_SIEGE_OTHER);
|
|
pWnd->ChangeWndState(PARTY_UI_SIZE_SMALL);
|
|
}
|
|
|
|
AddWnd(pWnd);
|
|
AddChild(pWnd);
|
|
}
|
|
}
|
|
|
|
bool SUIPartyWndMgr::InitControls( KPoint kPos )
|
|
{
|
|
m_isMouseMessageReturnZero = false;
|
|
|
|
return SUIWnd::InitControls( kPos );
|
|
}
|
|
|
|
void SUIPartyWndMgr::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
int k=0;
|
|
k=0;
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
void SUIPartyWndMgr::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
switch(pMsg->nType)
|
|
{
|
|
case IMSG_GET_PARTY_WND_PTR: //2011.11.14 - servantes : 파티 UI 포인터 얻기
|
|
{
|
|
SIMSG_GET_PARTY_WND_PTR* pData = (SIMSG_GET_PARTY_WND_PTR*)pMsg;
|
|
int id;
|
|
SUIPartyDualWnd* pWnd = FindWnd(pData->m_strName.c_str(), id);
|
|
if(pWnd)
|
|
{
|
|
pData->m_precvWnd = dynamicCast<void*>(pWnd);
|
|
pMsg->bUse = true;
|
|
return ;
|
|
}
|
|
break;
|
|
}
|
|
case IMSG_UI_SEND_DATA:
|
|
{
|
|
SIMSG_UI_SEND_DATA* pData = (SIMSG_UI_SEND_DATA *)pMsg;
|
|
if ( pData->m_strString == "RequestPartyJoinAccept" )
|
|
{
|
|
RequestPartyJoinAccept();
|
|
pMsg->bUse = true;
|
|
return ;
|
|
}
|
|
else if( pData->m_strString == "RequestPartyArenaOpponentJoinAccept" )
|
|
{
|
|
RequestPartyArenaOpponentJoinAccept();
|
|
pMsg->bUse = true;
|
|
return ;
|
|
}
|
|
else if( pData->m_strString == "RequestPartyArenaMemberJoinAccept" )
|
|
{
|
|
RequestPartyArenaMemberJoinAccept();
|
|
pMsg->bUse = true;
|
|
return ;
|
|
}
|
|
else if (pData->m_strString == "refreshAllTitle")
|
|
{
|
|
refreshAllTitle();
|
|
pMsg->bUse = true;
|
|
return ;
|
|
}
|
|
else if( pData->m_strString == "creature_info" )
|
|
{
|
|
STR_LIST strList;
|
|
MsgSplit( pData->m_strText.c_str(), strList, L"|" );
|
|
|
|
int id;
|
|
SUIPartyDualWnd* pWnd = FindWnd( strList[ 0 ].c_str(), id );
|
|
if(pWnd)
|
|
{
|
|
pWnd->CreatureInfo( strList );
|
|
}
|
|
}
|
|
else if( pData->m_strString == "member_creature_info" )
|
|
{
|
|
STR_LIST strList;
|
|
MsgSplit( pData->m_strText.c_str(), strList, L"|" );
|
|
|
|
int id;
|
|
SUIPartyDualWnd* pWnd = FindWnd( strList[ 0 ].c_str(), id );
|
|
if(pWnd)
|
|
{
|
|
pWnd->MemberCreatureInfo( strList );
|
|
}
|
|
}
|
|
else if( pData->m_strString == "enter_creature" )
|
|
{
|
|
AR_HANDLE hCreature = (AR_HANDLE)pData->m_dwData;
|
|
SGameAvatarEx* pCreature = GetObject( hCreature );
|
|
|
|
/// 2012.04.04 prodongi
|
|
if (!pCreature)
|
|
return ;
|
|
|
|
SPartyMgr* pParty = m_PartyMgr.FindPartyByPlayerHandle( pCreature->GetMaster() );
|
|
if(pParty)
|
|
{
|
|
int id;
|
|
SUIPartyDualWnd* pWnd = FindWnd( pParty->GetPartyName(), id );
|
|
if(pWnd)
|
|
{
|
|
pWnd->EnterCreature( pCreature->GetMaster(), hCreature );
|
|
}
|
|
}
|
|
}
|
|
else if( pData->m_strString == "leave_creature" )
|
|
{
|
|
AR_HANDLE hCreature = (AR_HANDLE)pData->m_dwData;
|
|
SGameAvatarEx* pCreature = GetObject( hCreature );
|
|
|
|
/// 2012.04.04 prodongi
|
|
if (!pCreature)
|
|
return ;
|
|
|
|
SPartyMgr* pParty = m_PartyMgr.FindPartyByPlayerHandle( pCreature->GetMaster() );
|
|
if(pParty)
|
|
{
|
|
int id;
|
|
SUIPartyDualWnd* pWnd = FindWnd( pParty->GetPartyName(), id );
|
|
if(pWnd)
|
|
{
|
|
pWnd->LeaveCreature( pCreature->GetMaster(), hCreature );
|
|
}
|
|
}
|
|
}
|
|
else if( pData->m_strString == "refresh_ui" )
|
|
{
|
|
SPartyMgr* pPartyMgr = m_PartyMgr.FindPartyByPlayerName( &pData->m_strText );
|
|
if(pPartyMgr == NULL)
|
|
return ;
|
|
|
|
int id;
|
|
SUIPartyDualWnd* pWnd = FindWnd( pPartyMgr->GetPartyName(), id );
|
|
if(pWnd)
|
|
{
|
|
pWnd->RefreshGaugeByIndex( pData->m_strText.c_str() );
|
|
}
|
|
}
|
|
else if( pData->m_strString == "refresh_all_ui" )
|
|
{
|
|
int id;
|
|
SUIPartyDualWnd* pWnd = FindWnd( pData->m_strText.c_str(), id );
|
|
if(pWnd)
|
|
{
|
|
pWnd->RefreshGaugeAll();
|
|
}
|
|
}
|
|
else if( pData->m_strString == "deselect" )
|
|
{
|
|
int id;
|
|
SUIPartyDualWnd* pWnd = FindWnd(pData->m_strText.c_str(), id);
|
|
if(pWnd)
|
|
{
|
|
pWnd->DeselectSlot();
|
|
}
|
|
}
|
|
else if( pData->m_strString == "set_creature_handle" ) // 2011.12.15 - servantes : 주크리처 핸들 설정
|
|
{
|
|
SUIPartyDualWnd* pWnd = FindWnd(0);
|
|
if(pWnd)
|
|
{
|
|
SPartyMgr* pParty = m_PartyMgr.Find( pWnd->GetPartyName());
|
|
if(pParty)
|
|
{
|
|
AR_HANDLE hMainCreature = (AR_HANDLE)pData->m_dwData;
|
|
pWnd->SetCreatureHandle(hMainCreature);
|
|
pWnd->RefreshSlots();
|
|
}
|
|
}
|
|
return ;
|
|
}
|
|
else if( pData->m_strString == "show_small_ui" || pData->m_strString == "show_big_ui" )
|
|
{
|
|
int id;
|
|
SUIPartyDualWnd* pWnd = FindWnd(pData->m_strText.c_str(), id);
|
|
if(pWnd)
|
|
{
|
|
pWnd->ProcMsgAtStatic( pMsg );
|
|
|
|
//if(pWnd->isShowAllBuff() && pWnd->GetListSizeType() == PARTY_UI_LIST_SIZE_EXTEND)
|
|
if(pWnd->GetListSizeType() == PARTY_UI_LIST_SIZE_EXTEND)
|
|
{
|
|
POINT pt = pWnd->GetBuffRenderPos();
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "buff_size", pData->m_strText.c_str(), unsigned int(pWnd->GetUISizeState()) ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "show_buff", pData->m_strText.c_str(), number_t(pt.x), number_t(pt.y) ) );
|
|
// m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "show_buff", pData->m_strText.c_str() ) );
|
|
}
|
|
else
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "hide_buff", pData->m_strText.c_str() ) );
|
|
|
|
pMsg->bUse = true;
|
|
return ;
|
|
}
|
|
}
|
|
else if( pData->m_strString == "create_my_party" ) // 내가 파티를 직접 만들때만 온다
|
|
{
|
|
int id = m_PartyMgr.FindPartyID( &pData->m_strText );
|
|
if(id < 0)
|
|
return ; // 에러 내 파티가 없다는 뜻
|
|
|
|
SUIPartyDualWnd* pWnd = FindWnd( id ); // 0 이어야만 한다 내 파티니까
|
|
if(pWnd)
|
|
{
|
|
int nType = (int)pData->m_nNumber2.getAmount();
|
|
SPartyMgr* pParty = m_PartyMgr.FindIncludeSlef(&pData->m_strText);
|
|
if(pParty && pWnd->GetFlagPartyMgr() == true)
|
|
{
|
|
pParty->SetShow(true);
|
|
}
|
|
|
|
pWnd->SetPartyIndex(DEF_MYPARTY_ID);
|
|
pWnd->SetPartyName(pData->m_strText.c_str());
|
|
pWnd->SetPartyType(nType);
|
|
pWnd->SetUISizeState(PARTY_UI_SIZE_BIG);
|
|
pWnd->RefreshSlots();
|
|
pWnd->SetShow(true);
|
|
pWnd->OnNotifyUIWindowOpen(true);
|
|
}
|
|
pMsg->bUse = true;
|
|
return ;
|
|
}
|
|
else if(pData->m_strString == "leave_party_me") // 2011.11.07 - servantes : 내가 추방 당했음
|
|
{
|
|
ResetWnd(); // 초기화
|
|
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itE = m_mapWnd.end();
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itS = m_mapWnd.begin();
|
|
for(; itS != itE; itS++)
|
|
{
|
|
SUIPartyDualWnd* p = itS->second;
|
|
p->SetShow(false);
|
|
}
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false ) );
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "hide_all_buff" ) );
|
|
pMsg->bUse = true;
|
|
return ;
|
|
}
|
|
else if(pData->m_strString == "delete_party_wnd")
|
|
{
|
|
ResetWnd( pData->m_strText.c_str() ); // 초기화
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false ) );
|
|
|
|
// 미니 버프창에도 해당 파티가 삭제 되었다고 알린다
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "sync_party_delete", pData->m_strText.c_str() ) );
|
|
pMsg->bUse = true;
|
|
}
|
|
else if(pData->m_strString == "hide_party_wnd2")
|
|
{
|
|
int id;
|
|
SUIPartyDualWnd* pWnd = FindWnd( pData->m_strText.c_str(), id );
|
|
if(pWnd)
|
|
{
|
|
SPartyMgr* pParty = m_PartyMgr.FindIncludeSlef(&pData->m_strText);
|
|
if(pParty)
|
|
pParty->SetShow(false);
|
|
|
|
pWnd->SetShow(false);
|
|
pWnd->OnNotifyUIWindowOpen(false);
|
|
pWnd->DisableSlots();
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "hide_buff", pData->m_strText.c_str() ) );
|
|
pMsg->bUse = true;
|
|
return ;
|
|
}
|
|
}
|
|
else if(pData->m_strString == "show_party_wnd2")
|
|
{
|
|
int id = m_PartyMgr.FindPartyID( &pData->m_strText );
|
|
if(id < 0)
|
|
return ; // 해당 파티가 없다는 뜻
|
|
|
|
SUIPartyDualWnd* pWnd = FindWnd( id );
|
|
if(pWnd)
|
|
{
|
|
SPartyMgr* pParty = m_PartyMgr.FindIncludeSlef(&pData->m_strText);
|
|
if(pParty)
|
|
pParty->SetShow(true);
|
|
|
|
int id = pWnd->GetPartyIndex();
|
|
pWnd->OnNotifyUIWindowOpen(true);
|
|
pWnd->RefreshSlots();
|
|
pWnd->SetShow(true);
|
|
|
|
// 미니 버프창 이름을 파티 이름과 동기화 시킨다 (이름으로 검색해서 버프를 출력 해주기 위해서)
|
|
POINT pt = pWnd->GetBuffRenderPos();
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "buff_size_force", pData->m_strText.c_str(), unsigned int(false) ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "show_buff", pData->m_strText.c_str(), number_t(pt.x), number_t(pt.y) ) );
|
|
|
|
pMsg->bUse = true;
|
|
return ;
|
|
}
|
|
}
|
|
else if(pData->m_strString == "show_party_wnd")
|
|
{
|
|
int id_party = (int)pData->m_nNumber.getAmount();
|
|
if(id_party < 0) // 내 파티
|
|
{
|
|
int id = m_PartyMgr.FindPartyID( &pData->m_strText );
|
|
if(id < 0)
|
|
return ; // 에러 내 파티가 없다는 뜻
|
|
|
|
SUIPartyDualWnd* pWnd = FindWnd( id ); // 0 이어야만 한다 내 파티니까
|
|
if(pWnd)
|
|
{
|
|
|
|
int nType = (int)pData->m_nNumber2.getAmount();
|
|
SPartyMgr* pParty = m_PartyMgr.FindIncludeSlef(&pData->m_strText);
|
|
if(pParty && pWnd->GetFlagPartyMgr() == true)
|
|
{
|
|
pParty->SetShow(true);
|
|
}
|
|
|
|
// pWnd->SetListSizeType(PARTY_UI_LIST_SIZE_EXTEND);
|
|
|
|
pWnd->SetPartyIndex(DEF_MYPARTY_ID);
|
|
pWnd->SetPartyName(pData->m_strText.c_str());
|
|
pWnd->SetPartyType(nType);
|
|
pWnd->SetTitleCaption();
|
|
pWnd->RefreshSlots();
|
|
// pWnd->initStatus();
|
|
pWnd->SetShow(true);
|
|
pWnd->OnNotifyUIWindowOpen(true);
|
|
|
|
SDEBUGLOG("party pos : x = %d / y = %d\n", pWnd->GetRect().left, pWnd->GetRect().top);
|
|
|
|
bool bBuffSizeForce = true; // big
|
|
if( pWnd->GetUISizeState() == PARTY_UI_SIZE_SMALL )
|
|
bBuffSizeForce = false; // small
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "buff_size_force", pData->m_strText.c_str(), unsigned int(bBuffSizeForce) ) );
|
|
|
|
if( pWnd->isShowAllBuff() == false )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "hide_buff", pData->m_strText.c_str() ) );
|
|
|
|
pMsg->bUse = true;
|
|
return ;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
int id = m_PartyMgr.FindPartyID( &pData->m_strText );
|
|
if(id < 0)
|
|
return ; // 해당 파티가 없다는 뜻
|
|
|
|
SUIPartyDualWnd* pWnd = FindWnd( id );
|
|
if(pWnd)
|
|
{
|
|
|
|
int nType = (int)pData->m_nNumber2.getAmount();
|
|
SPartyMgr* pParty = m_PartyMgr.FindIncludeSlef(&pData->m_strText);
|
|
if(pParty && pWnd->GetFlagPartyMgr() == true)
|
|
{
|
|
pParty->SetShow(true);
|
|
}
|
|
|
|
|
|
// pWnd->SetListSizeType(PARTY_UI_LIST_SIZE_EXTEND);
|
|
pWnd->SetPartyIndex(id);
|
|
pWnd->SetPartyName(pData->m_strText.c_str());
|
|
pWnd->SetPartyType(nType);
|
|
pWnd->SetTitleCaption();
|
|
pWnd->RefreshSlots();
|
|
pWnd->CalculateSize();
|
|
// pWnd->initStatus();
|
|
pWnd->SetShow(true);
|
|
|
|
SDEBUGLOG("party pos : x = %d / y = %d\n", pWnd->GetRect().left, pWnd->GetRect().top);
|
|
|
|
bool bBuffSizeForce = true; // big
|
|
if( pWnd->GetUISizeState() == PARTY_UI_SIZE_SMALL )
|
|
bBuffSizeForce = false; // small
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "buff_size_force", pData->m_strText.c_str(), unsigned int(bBuffSizeForce) ) );
|
|
|
|
if( pWnd->isShowAllBuff() == false )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "hide_buff", pData->m_strText.c_str() ) );
|
|
|
|
pMsg->bUse = true;
|
|
return ;
|
|
}
|
|
}
|
|
}
|
|
else if(pData->m_strString == "set_party_type")
|
|
{
|
|
int id = m_PartyMgr.FindPartyID( &pData->m_strText );
|
|
if(id < 0)
|
|
return ; // 에러 내 파티가 없다는 뜻
|
|
|
|
SUIPartyDualWnd* pWnd = FindWnd( id ); // 0 이어야만 한다 내 파티니까
|
|
if(pWnd)
|
|
{
|
|
pWnd->SetPartyType( (int)pData->m_dwData );
|
|
}
|
|
}
|
|
/// 2012.01.09 모든 파티창 접기 - prodongi
|
|
else if (pData->m_strString == "toggle_all_extend")
|
|
{
|
|
toggleAllExtend();
|
|
}
|
|
/// 2011.11.23 파티원 선택 - prodongi
|
|
else if(pData->m_strString == "select_party")
|
|
{
|
|
selectTarget(pData->m_dwData);
|
|
}
|
|
/// 2012.06.14 타이틀바 aniname을 아레나에 맞게바꿔준다 - prodongi
|
|
else if (pData->m_strString == "set_arena_titlebar_arena_info")
|
|
{
|
|
setTitlebarArenaInfo(pData->m_dwData);
|
|
}
|
|
else
|
|
{
|
|
int id;
|
|
/// 2011.11.16 pData->m_strText가 맞는 것 같습니다. - prodongi
|
|
SUIPartyDualWnd* pWnd = FindWnd(pData->m_strText.c_str(), id);
|
|
if(pWnd)
|
|
{
|
|
pWnd->ProcMsgAtStatic( pMsg );
|
|
}
|
|
pMsg->bUse = true;
|
|
}
|
|
}
|
|
break;
|
|
case MSG_CHATTING:
|
|
{
|
|
SMSG_CHATTING* pChatMsg = ( SMSG_CHATTING* )pMsg;
|
|
std::vector<std::string> vecText;
|
|
MsgSplit(pChatMsg->strText.c_str(), vecText, L"|" );
|
|
if (vecText.empty())
|
|
break;
|
|
SUIPartyDualWnd* wnd;
|
|
/// 2011.12.22 Destroy일 경우에는 자신 말고 다른 파티가 들어올 수 있다 - prodongi
|
|
/// 자신 말고 다른 파티가 들어 올 수 있는 경우가 다른 경우도 있는지는 잘 모르겠다
|
|
if (vecText[0] == "DESTROY")
|
|
{
|
|
int id;
|
|
wnd = FindWnd(vecText[1].c_str(), id);
|
|
}
|
|
else
|
|
{
|
|
wnd = FindWnd( 0 ); // 0 이어야만 한다 내 파티니까
|
|
}
|
|
if (wnd)
|
|
{
|
|
wnd->ProcMsgAtStatic( pMsg );
|
|
}
|
|
vecText.clear();
|
|
}
|
|
break;
|
|
case IMSG_UI_TARGET_INFO:
|
|
{
|
|
SIMSG_UI_TARGET_INFO* msg = dynamicCast<SIMSG_UI_TARGET_INFO*>(pMsg);
|
|
if (msg)
|
|
{
|
|
procMsgToDualWnd(pMsg, msg->strName.c_str() );
|
|
}
|
|
}
|
|
break;
|
|
case IMSG_UI_ACT_FAR_PARTY_TARGET:
|
|
{
|
|
SIMSG_UI_ACT_FAR_PARTY_TARGET* msg = dynamicCast<SIMSG_UI_ACT_FAR_PARTY_TARGET*>(pMsg);
|
|
if(msg)
|
|
{
|
|
procMsgToDualWnd(pMsg, msg->m_nTargetHandle);
|
|
}
|
|
}
|
|
break;
|
|
case IMSG_UI_TARGET_STAT:
|
|
{
|
|
SIMSG_UI_TARGET_STAT* msg = dynamicCast<SIMSG_UI_TARGET_STAT*>(pMsg);
|
|
if (msg)
|
|
{
|
|
procMsgToDualWnd(pMsg, msg->handle);
|
|
}
|
|
}
|
|
break;
|
|
case MSG_LEVEL_UPDATE:
|
|
{
|
|
SMSG_LEVEL_UPDATE* msg = dynamicCast<SMSG_LEVEL_UPDATE*>(pMsg);
|
|
if (msg)
|
|
{
|
|
procMsgToDualWnd(pMsg, msg->handle);
|
|
}
|
|
}
|
|
break;
|
|
case MSG_EXP_UPDATE:
|
|
{
|
|
SMSG_EXP_UPDATE* msg = dynamicCast<SMSG_EXP_UPDATE*>(pMsg);
|
|
if (msg)
|
|
{
|
|
procMsgToDualWnd(pMsg, msg->handle);
|
|
}
|
|
}
|
|
break;
|
|
case MSG_ENTER:
|
|
{
|
|
SMSG_ENTER* msg = dynamicCast<SMSG_ENTER*>(pMsg);
|
|
if (msg)
|
|
{
|
|
procMsgToDualWnd(pMsg, msg->handle);
|
|
}
|
|
}
|
|
break;
|
|
case MSG_LEAVE:
|
|
{
|
|
SMSG_LEAVE* msg = dynamicCast<SMSG_LEAVE*>(pMsg);
|
|
if (msg)
|
|
{
|
|
procMsgToDualWnd(pMsg, msg->handle);
|
|
}
|
|
}
|
|
break;
|
|
case IMSG_UI_INPUTTEXT:
|
|
{
|
|
/// 2011.12.27 IMSG_UI_INPUTTEXT는 dual wnd를 찾기 않고 자신의 dual wnd로 보내도 될 것 같다 - prodongi
|
|
SUIPartyDualWnd* pWnd = FindWnd( 0 ); // 0 이어야만 한다 내 파티니까
|
|
if(pWnd)
|
|
{
|
|
pWnd->ProcMsgAtStatic( pMsg );
|
|
}
|
|
}
|
|
break;
|
|
case IMSG_UI_MOVE:
|
|
{
|
|
SIMSG_UI_MOVE* pMoveMsg = (SIMSG_UI_MOVE*)pMsg;
|
|
if(pMoveMsg->m_strString.size())
|
|
{
|
|
int id;
|
|
SUIPartyDualWnd* pWnd = FindWnd(pMoveMsg->m_strString.c_str(), id);
|
|
if(pWnd)
|
|
{
|
|
pWnd->ProcMsgAtStatic( pMsg );
|
|
}
|
|
}
|
|
else
|
|
{
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itE = m_mapWnd.end();
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itS = m_mapWnd.begin();
|
|
for(; itS != itE; itS++)
|
|
{
|
|
SUIPartyDualWnd* p = itS->second;
|
|
p->ProcMsgAtStatic( pMsg );
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
void SUIPartyWndMgr::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
SUIWnd::OnNotifyUIWindowOpen(bOpen);
|
|
|
|
if (!bOpen)
|
|
{
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CREATURE, false) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CHARACTER, false) );
|
|
}
|
|
}
|
|
|
|
DWORD SUIPartyWndMgr::OnMouseMessage(DWORD dwMessage, int x, int y)
|
|
{
|
|
//return SUIWnd::OnMouseMessage( dwMessage, x, y );
|
|
// if( dwMessage == KLBUTTON_DOWN || dwMessage == KLBUTTON_UP )
|
|
// if( dwMessage == KLBUTTON_UP )
|
|
// {
|
|
// return 0;
|
|
// }
|
|
// return SUIWnd::OnMouseMessage( dwMessage, x, y );
|
|
|
|
DWORD dwRet = SUIWnd::OnMouseMessage( dwMessage, x, y );
|
|
|
|
if (m_isMouseMessageReturnZero)
|
|
{
|
|
m_isMouseMessageReturnZero = false;
|
|
return 0;
|
|
}
|
|
|
|
if(KMR_NO_GET & dwRet)
|
|
return dwRet;
|
|
|
|
return KMR_NORMAL;
|
|
}
|
|
|
|
void SUIPartyWndMgr::RemoveParty(const char* pstrPartyName)
|
|
{
|
|
if(pstrPartyName == NULL)
|
|
return ;
|
|
|
|
std::string str = pstrPartyName;
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itE = m_mapWnd.end();
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itS = m_mapWnd.begin();
|
|
for(; itS != itE; itS++)
|
|
{
|
|
SUIPartyDualWnd* pWnd = itS->second;
|
|
if( *pWnd->GetPartyName() == str )
|
|
{
|
|
RemoveChild((KUIWnd*)pWnd);
|
|
m_mapWnd.erase(itS); // 지운다
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
void SUIPartyWndMgr::AddWnd(SUIPartyDualWnd* pWnd)
|
|
{
|
|
if(pWnd)
|
|
m_mapWnd.insert(std::make_pair(*pWnd->GetPartyName(), pWnd));
|
|
}
|
|
|
|
SUIPartyDualWnd* SUIPartyWndMgr::FindWnd(const char* pstrName, int& out_id)
|
|
{
|
|
if(pstrName == NULL)
|
|
return NULL;
|
|
|
|
int k=0;
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itE = m_mapWnd.end();
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itS = m_mapWnd.begin();
|
|
for(; itS != itE; itS++, k++)
|
|
{
|
|
SUIPartyDualWnd* p = itS->second;
|
|
std::string pstr = *p->GetPartyName();
|
|
if( pstr.compare( pstrName ) == 0 )
|
|
{
|
|
out_id = k;
|
|
return p;
|
|
}
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
SUIPartyDualWnd* SUIPartyWndMgr::FindWndByName(const char* pstrName)
|
|
{
|
|
if(pstrName == NULL)
|
|
return NULL;
|
|
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator it = m_mapWnd.find(pstrName);
|
|
if(it != m_mapWnd.end())
|
|
return it->second;
|
|
return NULL;
|
|
}
|
|
|
|
SUIPartyDualWnd* SUIPartyWndMgr::FindWnd(int id)
|
|
{
|
|
if(id < 0)
|
|
return NULL;
|
|
|
|
int k=0;
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itE = m_mapWnd.end();
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itS = m_mapWnd.begin();
|
|
for(; itS != itE; itS++, k++)
|
|
{
|
|
if(k == id)
|
|
{
|
|
SUIPartyDualWnd* p = itS->second;
|
|
return p;
|
|
}
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
void SUIPartyWndMgr::ClearWnd()
|
|
{
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itE = m_mapWnd.end();
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itS = m_mapWnd.begin();
|
|
for(; itS != itE; itS++)
|
|
{
|
|
SUIPartyDualWnd* p = itS->second;
|
|
p->SetFlagPartyMgr(false);
|
|
}
|
|
m_mapWnd.clear();
|
|
}
|
|
|
|
void SUIPartyWndMgr::ResetWnd()
|
|
{
|
|
int out_id=0;
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itE = m_mapWnd.end();
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator itS = m_mapWnd.begin();
|
|
for(; itS != itE; itS++, out_id++)
|
|
{
|
|
SUIPartyDualWnd* pWnd = itS->second;
|
|
|
|
if(out_id == 0)
|
|
{
|
|
pWnd->SetUISizeState(PARTY_UI_SIZE_BIG);
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "big_buff", (unsigned int)out_id ) );
|
|
}
|
|
else
|
|
{
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "small_buff", (unsigned int)out_id ) );
|
|
}
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "hide_buff", pWnd->GetPartyName()->c_str() ) );
|
|
|
|
pWnd->ResetWnd();
|
|
pWnd->initStatus(); /// 2011.11.16 상태 초기화 - prodongi
|
|
pWnd->MovePos(aDlgPos[out_id].x, aDlgPos[out_id].y);
|
|
pWnd->SetShow(false);
|
|
pWnd->OnNotifyUIWindowOpen(false);
|
|
}
|
|
}
|
|
|
|
void SUIPartyWndMgr::ResetWnd(const char* pPartyName)
|
|
{
|
|
int out_id;
|
|
SUIPartyDualWnd* pParty = FindWnd(pPartyName, out_id);
|
|
if(pParty)
|
|
{
|
|
if(out_id == 0) // 내 파티를 초기화 해야 하는 경우 - 전체다 초기화 한다
|
|
{
|
|
ResetWnd();
|
|
}
|
|
else
|
|
{
|
|
pParty->ResetWnd();
|
|
pParty->initStatus(); /// 2011.11.16 상태 초기화 - prodongi
|
|
pParty->MovePos(aDlgPos[out_id].x, aDlgPos[out_id].y);
|
|
pParty->SetShow(false);
|
|
pParty->OnNotifyUIWindowOpen(false);
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "state_all_off", pParty->GetPartyName()->c_str()) );
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "small_buff", (unsigned int)out_id ) );
|
|
}
|
|
}
|
|
}
|
|
|
|
void SUIPartyWndMgr::RequestPartyJoinAccept()
|
|
{
|
|
if( GetGameOption().IsRejectTrade() )
|
|
{
|
|
m_pDisplayInfo->RequestJoinInvitedParty(false);
|
|
return;
|
|
}
|
|
|
|
std::string strText = SStringDB::ParseString( GetStringDB().GetString(SYS_MSG_PARTY_INVITE_CHECK), "#@party_name@#", m_PartyMgr.GetPartyName(), "#@user_name@#", m_PartyMgr.GetMessage() );
|
|
SIMSG_REQ_OPEN_MSGBOX msg( SIMSG_REQ_OPEN_MSGBOX::MSGBOX_PARTYJOINCHECK, strText.c_str(), true );
|
|
m_pGameManager->ProcMsgAtStatic( &msg );
|
|
}
|
|
|
|
void SUIPartyWndMgr::RequestPartyArenaOpponentJoinAccept()
|
|
{
|
|
if( GetGameOption().IsRejectTrade() )
|
|
{
|
|
m_pDisplayInfo->RequestArenaOpponentJoinInvitedParty(false);
|
|
return;
|
|
}
|
|
|
|
std::string strText = SR(2336, "#@player_name@#", m_PartyMgr.GetMessage());
|
|
SIMSG_REQ_OPEN_MSGBOX msg( SIMSG_REQ_OPEN_MSGBOX::MSGBOX_PARTYARENAOPPONENTJOINCHECK, strText.c_str(), true );
|
|
m_pGameManager->ProcMsgAtStatic( &msg );
|
|
}
|
|
|
|
void SUIPartyWndMgr::RequestPartyArenaMemberJoinAccept()
|
|
{
|
|
if( GetGameOption().IsRejectTrade() )
|
|
{
|
|
m_pDisplayInfo->RequestArenaMemberJoinInvitedParty(false);
|
|
return;
|
|
}
|
|
|
|
std::string strText = SStringDB::ParseString( GetStringDB().GetString(SYS_MSG_PARTY_INVITE_CHECK), "#@party_name@#", m_PartyMgr.GetPartyName(), "#@user_name@#", m_PartyMgr.GetMessage() );
|
|
SIMSG_REQ_OPEN_MSGBOX msg( SIMSG_REQ_OPEN_MSGBOX::MSGBOX_PARTYARENAMEMBERJOINCHECK, strText.c_str(), true );
|
|
m_pGameManager->ProcMsgAtStatic( &msg );
|
|
}
|
|
|
|
void SUIPartyWndMgr::hideAllSelect()
|
|
{
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator it = m_mapWnd.begin();
|
|
for (; it != m_mapWnd.end(); ++it)
|
|
{
|
|
it->second->hideAllSelect();
|
|
}
|
|
}
|
|
|
|
void SUIPartyWndMgr::procMsgToDualWnd(SGameMessage* msg, AR_HANDLE handle)
|
|
{
|
|
SPlayerSlot* playerSlot = m_PartyMgr.FindMember(handle);
|
|
if (playerSlot)
|
|
{
|
|
procMsgToDualWnd(msg, playerSlot->GetName());
|
|
}
|
|
/// 만약 크리처 일 경우에
|
|
else
|
|
{
|
|
SGameAvatarEx* avatar = GetObject(handle);
|
|
if (avatar && avatar->GetObjType() == TS_ENTER::GAME_SUMMON)
|
|
{
|
|
playerSlot = m_PartyMgr.FindMember(avatar->GetMaster());
|
|
if (playerSlot)
|
|
{
|
|
procMsgToDualWnd(msg, playerSlot->GetName());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void SUIPartyWndMgr::procMsgToDualWnd(SGameMessage* msg, char const* playerName)
|
|
{
|
|
if (!playerName)
|
|
return ;
|
|
|
|
std::string name = playerName;
|
|
SPartyMgr* partyMgr = m_PartyMgr.FindPartyByPlayerName(&name);
|
|
if (!partyMgr)
|
|
return ;
|
|
|
|
int id;
|
|
SUIPartyDualWnd* pWnd = FindWnd(partyMgr->GetPartyName(), id);
|
|
if(pWnd)
|
|
{
|
|
pWnd->ProcMsgAtStatic(msg);
|
|
}
|
|
}
|
|
|
|
void SUIPartyWndMgr::toggleAllExtend()
|
|
{
|
|
// 모두 접혀 있을 때는 펼침, 하나라도 펼져져 있을 때는 접힘
|
|
int sizeType = PARTY_UI_LIST_SIZE_EXTEND;
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator it = m_mapWnd.begin();
|
|
for (; it != m_mapWnd.end(); ++it)
|
|
{
|
|
if (!it->second->IsShow())
|
|
continue;
|
|
|
|
if (PARTY_UI_LIST_SIZE_EXTEND == it->second->GetListSizeType())
|
|
{
|
|
sizeType = PARTY_UI_LIST_SIZE_REDUCE;
|
|
break;
|
|
}
|
|
}
|
|
|
|
it = m_mapWnd.begin();
|
|
for (; it != m_mapWnd.end(); ++it)
|
|
{
|
|
it->second->SetListSizeType(sizeType);
|
|
}
|
|
}
|
|
|
|
void SUIPartyWndMgr::notifyMouseMessageReturnZero()
|
|
{
|
|
m_isMouseMessageReturnZero = true;
|
|
}
|
|
|
|
void SUIPartyWndMgr::selectTarget(unsigned int index)
|
|
{
|
|
std::vector<SPlayerSlot*> const& memberList = m_PartyMgr.GetMemberList();
|
|
if (memberList.size() <= index)
|
|
return ;
|
|
|
|
AR_HANDLE handle = memberList[index]->GetHandle();
|
|
SGameAvatarEx* target = GetObject(handle);
|
|
if (!target)
|
|
return ;
|
|
|
|
g_pCurrentGameSystem->SetTarget(target);
|
|
}
|
|
|
|
SGameAvatarEx* SUIPartyWndMgr::GetObject( AR_HANDLE handle )
|
|
{
|
|
SGame* pGame = m_pGameManager->GetActiveGame();
|
|
if( !pGame || pGame->GetGameType() != GAME_TYPE_WORLD )
|
|
return NULL;
|
|
|
|
return (SGameAvatarEx*)(pGame->GetGameObject(handle));
|
|
}
|
|
|
|
void SUIPartyWndMgr::setTitlebarArenaInfo(int team)
|
|
{
|
|
sArenaUtility utility;
|
|
char const* aniName = utility.teamToPartyTitleAniName(team);
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator it = m_mapWnd.begin();
|
|
for (; it != m_mapWnd.end(); ++it)
|
|
it->second->setTitlebarArenaInfo(aniName, "");
|
|
}
|
|
|
|
void SUIPartyWndMgr::refreshAllTitle()
|
|
{
|
|
std::map<std::string, SUIPartyDualWnd*>::iterator it = m_mapWnd.begin();
|
|
for (; it != m_mapWnd.end(); ++it)
|
|
it->second->SetTitleCaption(-1);
|
|
}
|