5817 lines
182 KiB
C++
5817 lines
182 KiB
C++
|
|
|
|
|
|
#ifdef _PARTY_RENEWAL_X_
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "KUIControlStatic.h"
|
|
#include "KUIControlGauge.h"
|
|
#include "KUIControlEdit.h"
|
|
#include "KUIControlButton.h"
|
|
|
|
#include "SGameManager.h"
|
|
#include "SGameMessage.h"
|
|
#include "SGameMessageUI.h"
|
|
#include "SUIMessengerExWnd.h"
|
|
#include "SUIDisplayInfo.h"
|
|
|
|
#include "SUISysMsgDefine.h"
|
|
#include "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.h" // sonador 3.5.1 던전 시즈 레벨 제한
|
|
|
|
#include "XSimpleProfiler.h"
|
|
|
|
#include "KFileManager.h"
|
|
|
|
#include "SUIPartyStateSetWnd.h"
|
|
#include "IHuntaHolicSystem.h" // #2.1.2.11.1
|
|
// 2010.08.31 - prodongi
|
|
#include "SSummonSlotMgr.h"
|
|
#include "SUIUtil.h"
|
|
#include "SGameCreature.h"
|
|
|
|
extern void MsgSplit( const char* szMsg, std::vector<std::string>& vecText, const wchar_t* lpDelimiter, bool bProcSpecialCharacter=false );
|
|
|
|
namespace
|
|
{
|
|
const int c_nDelta = 32; // 리사이즈 단위
|
|
const int c_nCreatureDelta = 24; // 소환수 Max Height Size
|
|
|
|
const int c_nMaxHeight = 306; // 리사이즈시 최대 height
|
|
const int c_nMinHeight = 36; // 리사이즈시 최소 height
|
|
|
|
const int c_nMaxLine = 8; // 보여주는 최대 라인수
|
|
const int c_nMinLine = 6;
|
|
const int c_nChildHeight = 190;
|
|
|
|
const int c_nOUFRAME_OffSet = 9; // 아웃 프레임 창 크기시 적용 되는 수치
|
|
|
|
const int c_nMaxCreature = 2; // 소환하는 크리처 수
|
|
const int c_nTitleSize = 17;
|
|
|
|
const int c_nPartyWndWidthSize = 138;
|
|
|
|
enum
|
|
{
|
|
DIVISION_PERSONAL = 0,
|
|
DIVISION_SHARE,
|
|
DIVISION_TURN,
|
|
};
|
|
|
|
enum
|
|
{
|
|
MENU_POSITION = 0,
|
|
MENU_CREATE,
|
|
MENU_INVITE,
|
|
MENU_KICK,
|
|
MENU_LEADERCHANGE,
|
|
PARTY_MENU_DIVISION_PER,
|
|
PARTY_MENU_DIVISION_RAN,
|
|
PARTY_MENU_DIVISION_TURN,
|
|
MENU_LOGOUT,
|
|
};
|
|
|
|
enum
|
|
{
|
|
TAB_PARTY = 0,
|
|
TAB_GUILD,
|
|
TAB_FRIEND,
|
|
};
|
|
|
|
#define GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam))
|
|
};
|
|
|
|
|
|
|
|
SUIMessengerWnd::SSlotInfoCharacter::SSlotInfoCharacter()
|
|
{
|
|
pSelect = NULL;
|
|
pLogOff = NULL;
|
|
pDead = NULL;
|
|
pHP = NULL;
|
|
pMP = NULL;
|
|
pNoFrame = NULL;
|
|
pName = NULL;
|
|
pJob = NULL;
|
|
pNumber = NULL;
|
|
}
|
|
|
|
void SUIMessengerWnd::SSlotInfoCharacter::Show(bool bShow)
|
|
{
|
|
if(pSelect)
|
|
pSelect ->SetShow(bShow);
|
|
if(pLogOff)
|
|
pLogOff ->SetShow(bShow);
|
|
if(pDead)
|
|
pDead ->SetShow(bShow);
|
|
if(pHP)
|
|
pHP ->SetShow(bShow);
|
|
if(pMP)
|
|
pMP ->SetShow(bShow);
|
|
if(pNoFrame)
|
|
pNoFrame->SetShow(bShow);
|
|
if(pName)
|
|
pName ->SetShow(bShow);
|
|
if(pJob)
|
|
pJob ->SetShow(bShow);
|
|
if(pNumber)
|
|
pNumber ->SetShow(bShow);
|
|
}
|
|
|
|
KUIWnd* SUIMessengerWnd::SSlotInfoCharacter::GetControl(int id)
|
|
{
|
|
switch(id)
|
|
{
|
|
case SELECT:
|
|
return (KUIWnd*)pSelect;
|
|
case LOGOFF:
|
|
return (KUIWnd*)pLogOff;
|
|
case DEAD:
|
|
return (KUIWnd*)pDead;
|
|
case HP:
|
|
return (KUIWnd*)pHP;
|
|
case MP:
|
|
return (KUIWnd*)pMP;
|
|
case NOFRAME:
|
|
return (KUIWnd*)pNoFrame;
|
|
case NAME:
|
|
return (KUIWnd*)pName;
|
|
case JOB:
|
|
return (KUIWnd*)pJob;
|
|
case NUMBER:
|
|
return (KUIWnd*)pNumber;
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
SUIMessengerWnd::SSlotInfoCreature::SSlotInfoCreature()
|
|
{
|
|
pMainMark = NULL;
|
|
pSelect = NULL;
|
|
pHP = NULL;
|
|
pMP = NULL;
|
|
pJob = NULL;
|
|
pDead = NULL;
|
|
pHP2 = NULL;
|
|
pMP2 = NULL;
|
|
pJob2 = NULL;
|
|
pDead2 = NULL;
|
|
}
|
|
|
|
void SUIMessengerWnd::SSlotInfoCreature::Show(bool bShow, int id)
|
|
{
|
|
if(id == -1) // 전체
|
|
{
|
|
if(pMainMark)
|
|
pMainMark->SetShow(bShow);
|
|
if(pSelect)
|
|
pSelect ->SetShow(bShow);
|
|
if(pHP)
|
|
pHP ->SetShow(bShow);
|
|
if(pMP)
|
|
pMP ->SetShow(bShow);
|
|
if(pJob)
|
|
pJob ->SetShow(bShow);
|
|
if(pDead)
|
|
pDead ->SetShow(bShow);
|
|
if(pHP2)
|
|
pHP2 ->SetShow(bShow);
|
|
if(pMP2)
|
|
pMP2 ->SetShow(bShow);
|
|
if(pJob2)
|
|
pJob2 ->SetShow(bShow);
|
|
if(pDead2)
|
|
pDead2 ->SetShow(bShow);
|
|
}
|
|
else if(id == 0) // 첫번째
|
|
{
|
|
if(pMainMark)
|
|
pMainMark->SetShow(bShow);
|
|
if(pHP)
|
|
pHP ->SetShow(bShow);
|
|
if(pMP)
|
|
pMP ->SetShow(bShow);
|
|
if(pJob)
|
|
pJob ->SetShow(bShow);
|
|
if(pDead)
|
|
pDead ->SetShow(bShow);
|
|
}
|
|
else if(id == 1) // 두번째
|
|
{
|
|
if(pHP2)
|
|
pHP2 ->SetShow(bShow);
|
|
if(pMP2)
|
|
pMP2 ->SetShow(bShow);
|
|
if(pJob2)
|
|
pJob2 ->SetShow(bShow);
|
|
if(pDead2)
|
|
pDead2 ->SetShow(bShow);
|
|
}
|
|
}
|
|
|
|
KUIWnd* SUIMessengerWnd::SSlotInfoCreature::GetControl(int id)
|
|
{
|
|
switch(id)
|
|
{
|
|
case MAINMARK:
|
|
return (KUIWnd*)pMainMark;
|
|
case SELECT:
|
|
return (KUIWnd*)pSelect;
|
|
case HP:
|
|
return (KUIWnd*)pHP;
|
|
case MP:
|
|
return (KUIWnd*)pMP;
|
|
case JOB:
|
|
return (KUIWnd*)pJob;
|
|
case DEAD:
|
|
return (KUIWnd*)pDead;
|
|
case HP2:
|
|
return (KUIWnd*)pHP2;
|
|
case MP2:
|
|
return (KUIWnd*)pMP2;
|
|
case JOB2:
|
|
return (KUIWnd*)pJob2;
|
|
case DEAD2:
|
|
return (KUIWnd*)pDead2;
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
|
|
// 2011.05.17 - servantes
|
|
SUIMessengerWnd::~SUIMessengerWnd()
|
|
{
|
|
GetGameOption().SetPartyX( GetRect().left );
|
|
GetGameOption().SetPartyY( GetRect().top );
|
|
}
|
|
|
|
bool SUIMessengerWnd::InitControls( KPoint kPos )
|
|
{
|
|
CreateControls();
|
|
|
|
m_nListSizeType = PARTY_UI_LIST_SIZE_EXTEND;
|
|
|
|
m_pStaticTitleBar = dynamicCast<KUIControlStatic*>(GetChild("titlebar"));
|
|
m_pStaticTitle = dynamicCast<KUIControlStatic*>(GetChild("title"));
|
|
m_pBtnClose = dynamicCast<KUIControlSimpleButton*>(GetChild("button_close"));
|
|
m_pBtnMaximize = dynamicCast<KUIControlSimpleButton*>(GetChild("button_maximize"));
|
|
m_pBtnMinimize = dynamicCast<KUIControlSimpleButton*>(GetChild("button_minimize"));
|
|
m_pBtnSubOption = dynamicCast<KUIControlSimpleButton*>(GetChild("button_suboption"));
|
|
m_pStaticPartyMarkNormal = dynamicCast<KUIControlStatic*>(GetChild("mark_party"));
|
|
m_pStaticPartyMarkBearLoad = dynamicCast<KUIControlStatic*>(GetChild("mark_bearload"));
|
|
m_pStaticPartyMarkSeige = dynamicCast<KUIControlStatic*>(GetChild("mark_siege"));
|
|
m_pStaticPartyMarkSeigeOther = dynamicCast<KUIControlStatic*>(GetChild("mark_siege_viewer"));
|
|
|
|
KUIControlStatic* pWnd = dynamicCast<KUIControlStatic*>(GetChild( "select_dead00" ));
|
|
if( pWnd )
|
|
{
|
|
pWnd->SetEnableMouseClickMessage(true);
|
|
}
|
|
|
|
pWnd = dynamicCast<KUIControlStatic*>(GetChild( "party_name_text00" ));
|
|
if( pWnd )
|
|
{
|
|
pWnd->SetCaption("<font:font_01><size:9><hcenter><vcenter>");
|
|
}
|
|
|
|
return SUIWnd::InitControls( kPos );
|
|
}
|
|
bool SUIMessengerWnd::InitData( bool bReload )
|
|
{
|
|
for( unsigned int i(0); SLOT_MAXLINE>i; i++ )
|
|
m_bLogIn[i] = true;
|
|
|
|
m_nOldHP = 0;
|
|
m_nOldMP = 0;
|
|
|
|
m_nViewLine = 6;
|
|
|
|
m_nSelectIndex = -1;
|
|
|
|
// _close 앞 버튼
|
|
// KUIControlSimpleButton* pButton = dynamicCast<KUIControlSimpleButton*>(GetChild( "party_detailview_button" ));
|
|
// if( pButton ) pButton->SetButtonState( KUIControlSimpleButton::KBUTTON_DISABLE );
|
|
|
|
SetChildCaption( "titlebar", "" );
|
|
|
|
DisableSlots();
|
|
ChangeSize();
|
|
|
|
return SUIWnd::InitData(bReload);
|
|
}
|
|
// 생성
|
|
void SUIMessengerWnd::CreateControls()
|
|
{
|
|
RECT rc;
|
|
rc.left = 0; rc.top = c_nDelta; rc.right = 0; rc.bottom = c_nDelta;
|
|
|
|
SetChildAsButtom( "select_mouseclick" );
|
|
SetChildShow( "select_mouseclick", false );
|
|
|
|
SetChildAsButtom( "creature_mouseclick" );
|
|
SetChildShow( "creature_mouseclick", false );
|
|
|
|
// SetChildShow( "mark_party_leader", false ); // 2011.09.15 - servantes
|
|
m_pStaticLeaderMark = dynamicCast<KUIControlStatic*>( GetChild( "mark_party_leader" ) );
|
|
m_pStaticLeaderMark->SetShow( false );
|
|
|
|
int i = 0;
|
|
|
|
// 컨트롤들의 포인터를 받아 놓는다
|
|
// 파티원
|
|
m_aSlotChar[i].pDead = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "select_dead%02d", i ).c_str() ) );
|
|
m_aSlotChar[i].pNoFrame = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "panel_inframe_black%02d", i ).c_str() ) );
|
|
m_aSlotChar[i].pJob = dynamicCast<KUIControlIconStatic*>( GetChild( CStringUtil::StringFormat( "party_member_job%02d",i ).c_str() ) );
|
|
m_aSlotChar[i].pJob->SetAbleReSizeRes(false);
|
|
m_aSlotChar[i].pName = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "party_name_text%02d", i ).c_str() ) );
|
|
m_aSlotChar[i].pHP = dynamicCast<KUIControlGauge*> ( GetChild( CStringUtil::StringFormat( "party_hp_gauge%02d", i ).c_str() ) );
|
|
m_aSlotChar[i].pMP = dynamicCast<KUIControlGauge*> ( GetChild( CStringUtil::StringFormat( "party_mp_gauge%02d", i ).c_str() ) );
|
|
m_aSlotChar[i].pLogOff = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "select_logoff%02d", i ).c_str() ) );
|
|
m_aSlotChar[i].pSelect = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "select_zone%02d", i ).c_str() ) );
|
|
|
|
// 크리처1, 2
|
|
m_aSlotCreature[i].pDead = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "creature_dead%02d", i ).c_str() ) );
|
|
m_aSlotCreature[i].pMainMark = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "mark_creature_main%02d", i ).c_str() ) );
|
|
m_aSlotCreature[i].pSelect = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "creature_select_zone%02d", i ).c_str() ) );
|
|
m_aSlotCreature[i].pHP = dynamicCast<KUIControlGauge*> ( GetChild( CStringUtil::StringFormat( "creature_hp_gauge%02d", i ).c_str() ) );
|
|
m_aSlotCreature[i].pMP = dynamicCast<KUIControlGauge*> ( GetChild( CStringUtil::StringFormat( "creature_mp_gauge%02d", i ).c_str() ) );
|
|
m_aSlotCreature[i].pJob = dynamicCast<KUIControlIconStatic*>( GetChild( CStringUtil::StringFormat( "creature_job%02d", i ).c_str() ) );
|
|
m_aSlotCreature[i].pJob->SetAbleReSizeRes(false);
|
|
m_aSlotCreature[i].pHP2 = dynamicCast<KUIControlGauge*> ( GetChild( CStringUtil::StringFormat( "creature2_hp_gauge%02d", i ).c_str() ) );
|
|
m_aSlotCreature[i].pMP2 = dynamicCast<KUIControlGauge*> ( GetChild( CStringUtil::StringFormat( "creature2_mp_gauge%02d", i ).c_str() ) );
|
|
m_aSlotCreature[i].pJob2 = dynamicCast<KUIControlIconStatic*>( GetChild( CStringUtil::StringFormat( "creature2_job%02d", i ).c_str() ) );
|
|
m_aSlotCreature[i].pJob2->SetAbleReSizeRes(false);
|
|
m_aSlotCreature[i].pDead2 = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "creature2_dead%02d", i ).c_str() ) );
|
|
|
|
KUIControlIconStatic* pIcon(NULL);
|
|
std::string strDeadCtr, strCreatureDeadCtr;
|
|
for( i = 0; i < c_nMaxLine-1; i++ )
|
|
{
|
|
// 파티 멤버
|
|
strDeadCtr = CStringUtil::StringFormat( "select_dead%02d", i+1 );
|
|
CopyControl( CStringUtil::StringFormat( "select_dead%02d" , i ).c_str(), strDeadCtr.c_str(), rc );
|
|
CopyControl( CStringUtil::StringFormat( "panel_inframe_black%02d", i ).c_str(), CStringUtil::StringFormat( "panel_inframe_black%02d", i+1 ).c_str(), rc );
|
|
CopyControl( CStringUtil::StringFormat( "party_member_job%02d" , i ).c_str(), CStringUtil::StringFormat( "party_member_job%02d" , i+1 ).c_str(), rc );
|
|
CopyControl( CStringUtil::StringFormat( "party_name_text%02d" , i ).c_str(), CStringUtil::StringFormat( "party_name_text%02d" , i+1 ).c_str(), rc );
|
|
CopyControl( CStringUtil::StringFormat( "party_hp_gauge%02d" , i ).c_str(), CStringUtil::StringFormat( "party_hp_gauge%02d" , i+1 ).c_str(), rc );
|
|
CopyControl( CStringUtil::StringFormat( "party_mp_gauge%02d" , i ).c_str(), CStringUtil::StringFormat( "party_mp_gauge%02d" , i+1 ).c_str(), rc );
|
|
CopyControl( CStringUtil::StringFormat( "select_logoff%02d" , i ).c_str(), CStringUtil::StringFormat( "select_logoff%02d" , i+1 ).c_str(), rc );
|
|
CopyControl( CStringUtil::StringFormat( "select_zone%02d" , i ).c_str(), CStringUtil::StringFormat( "select_zone%02d" , i+1 ).c_str(), rc );
|
|
CopyControl( CStringUtil::StringFormat( "creature_select_zone%02d", i ).c_str(), CStringUtil::StringFormat( "creature_select_zone%02d", i+1 ).c_str(), rc );
|
|
SetChildAsButtom( strDeadCtr.c_str() );
|
|
|
|
// 파티원 크리처
|
|
strCreatureDeadCtr = CStringUtil::StringFormat( "creature_dead%02d", i+1 );
|
|
CopyControl( CStringUtil::StringFormat( "creature_dead%02d" , i ).c_str(), strCreatureDeadCtr.c_str(), rc );
|
|
CopyControl( CStringUtil::StringFormat( "mark_creature_main%02d", i ).c_str(), CStringUtil::StringFormat( "mark_creature_main%02d" , i+1 ).c_str(), rc );
|
|
CopyControl( CStringUtil::StringFormat( "creature_hp_gauge%02d" , i ).c_str(), CStringUtil::StringFormat( "creature_hp_gauge%02d" , i+1 ).c_str(), rc );
|
|
CopyControl( CStringUtil::StringFormat( "creature_mp_gauge%02d" , i ).c_str(), CStringUtil::StringFormat( "creature_mp_gauge%02d" , i+1 ).c_str(), rc );
|
|
pIcon = dynamicCast<KUIControlIconStatic*>( CopyControl( CStringUtil::StringFormat( "creature_job%02d" , i ).c_str(), CStringUtil::StringFormat( "creature_job%02d" , i+1 ).c_str(), rc ) );
|
|
if( pIcon ) pIcon->SetAbleReSizeRes(false);
|
|
|
|
strCreatureDeadCtr = CStringUtil::StringFormat( "creature2_dead%02d", i+1 );
|
|
CopyControl( CStringUtil::StringFormat( "creature2_dead%02d" , i ).c_str(), strCreatureDeadCtr.c_str(), rc );
|
|
CopyControl( CStringUtil::StringFormat( "creature2_hp_gauge%02d" , i ).c_str(), CStringUtil::StringFormat( "creature2_hp_gauge%02d" , i+1 ).c_str(), rc );
|
|
CopyControl( CStringUtil::StringFormat( "creature2_mp_gauge%02d" , i ).c_str(), CStringUtil::StringFormat( "creature2_mp_gauge%02d" , i+1 ).c_str(), rc );
|
|
pIcon = dynamicCast<KUIControlIconStatic*>( CopyControl( CStringUtil::StringFormat( "creature2_job%02d" , i ).c_str(), CStringUtil::StringFormat( "creature2_job%02d" , i+1 ).c_str(), rc ) );
|
|
if( pIcon ) pIcon->SetAbleReSizeRes(false);
|
|
|
|
KUIControlStatic* pWnd = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "select_zone%02d", i ).c_str() ) );
|
|
if( pWnd )
|
|
{
|
|
pWnd->SetEnableMouseClickMessage(true);
|
|
}
|
|
KUIControlStatic* pWnd2 = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "creature_select_zone%02d", i ).c_str() ) );
|
|
if( pWnd2 )
|
|
{
|
|
pWnd2->SetEnableMouseClickMessage(true);
|
|
}
|
|
|
|
// 컨트롤들의 포인터를 받아 놓는다
|
|
// 파티원
|
|
m_aSlotChar[i+1].pDead = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "select_dead%02d", i+1 ).c_str() ) );
|
|
m_aSlotChar[i+1].pNoFrame = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "panel_inframe_black%02d", i+1 ).c_str() ) );
|
|
m_aSlotChar[i+1].pJob = dynamicCast<KUIControlIconStatic*>( GetChild( CStringUtil::StringFormat( "party_member_job%02d",i+1 ).c_str() ) );
|
|
m_aSlotChar[i+1].pJob->SetAbleReSizeRes(false);
|
|
m_aSlotChar[i+1].pName = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "party_name_text%02d", i+1 ).c_str() ) );
|
|
m_aSlotChar[i+1].pHP = dynamicCast<KUIControlGauge*> ( GetChild( CStringUtil::StringFormat( "party_hp_gauge%02d", i+1 ).c_str() ) );
|
|
m_aSlotChar[i+1].pMP = dynamicCast<KUIControlGauge*> ( GetChild( CStringUtil::StringFormat( "party_mp_gauge%02d", i+1 ).c_str() ) );
|
|
m_aSlotChar[i+1].pLogOff = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "select_logoff%02d", i+1 ).c_str() ) );
|
|
m_aSlotChar[i+1].pSelect = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "select_zone%02d", i+1 ).c_str() ) );
|
|
|
|
// 크리처1, 2
|
|
m_aSlotCreature[i+1].pDead = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "creature_dead%02d", i+1 ).c_str() ) );
|
|
m_aSlotCreature[i+1].pMainMark = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "mark_creature_main%02d", i+1 ).c_str() ) );
|
|
m_aSlotCreature[i+1].pSelect = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "creature_select_zone%02d", i+1 ).c_str() ) );
|
|
m_aSlotCreature[i+1].pHP = dynamicCast<KUIControlGauge*> ( GetChild( CStringUtil::StringFormat( "creature_hp_gauge%02d", i+1 ).c_str() ) );
|
|
m_aSlotCreature[i+1].pMP = dynamicCast<KUIControlGauge*> ( GetChild( CStringUtil::StringFormat( "creature_mp_gauge%02d", i+1 ).c_str() ) );
|
|
m_aSlotCreature[i+1].pJob = dynamicCast<KUIControlIconStatic*>( GetChild( CStringUtil::StringFormat( "creature_job%02d", i+1 ).c_str() ) );
|
|
m_aSlotCreature[i+1].pJob->SetAbleReSizeRes(false);
|
|
m_aSlotCreature[i+1].pHP2 = dynamicCast<KUIControlGauge*> ( GetChild( CStringUtil::StringFormat( "creature2_hp_gauge%02d", i+1 ).c_str() ) );
|
|
m_aSlotCreature[i+1].pMP2 = dynamicCast<KUIControlGauge*> ( GetChild( CStringUtil::StringFormat( "creature2_mp_gauge%02d", i+1 ).c_str() ) );
|
|
m_aSlotCreature[i+1].pJob2 = dynamicCast<KUIControlIconStatic*>( GetChild( CStringUtil::StringFormat( "creature2_job%02d", i+1 ).c_str() ) );
|
|
m_aSlotCreature[i+1].pJob2->SetAbleReSizeRes(false);
|
|
m_aSlotCreature[i+1].pDead2 = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "creature2_dead%02d", i+1 ).c_str() ) );
|
|
}
|
|
|
|
for( int i = 0; i < c_nMaxLine; i++ )
|
|
{
|
|
m_aSlotChar[i].pNumber = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat("mark_number%02d", i ).c_str() ) );
|
|
SetChildAsTop( CStringUtil::StringFormat("mark_number%02d", i ).c_str() );
|
|
}
|
|
|
|
DisableSlots();
|
|
}
|
|
|
|
// //Debug 용
|
|
//#ifndef NDEBUG
|
|
// KUIWND_CREATE_ARG arg;
|
|
// arg.lpszAniName = "static_talk_outframe00";
|
|
// arg.lpszSprName = m_sSprName.c_str();
|
|
// arg.lpszClassName = "static";
|
|
// arg.lpszID = "_char_back_ground";
|
|
// arg.dwFlag = KFLAG_GET_PASS_MESSAGE;
|
|
// arg.dwStyle = 0;
|
|
// arg.rcRect = m_rcRegion;
|
|
// arg.pParent = this;
|
|
// arg.dwFlag = KFLAG_GET_PASS_MESSAGE;
|
|
// m_pManager->CreateControl(arg);
|
|
//#endif
|
|
|
|
// 모두 비활성
|
|
void SUIMessengerWnd::DisableSlots()
|
|
{
|
|
//OutputDebugString( "SUIMessengerWnd::DisableSlots()\n" );
|
|
|
|
// SetChildShow( "mark_party_leader", false );
|
|
m_pStaticLeaderMark->SetShow( false );
|
|
|
|
for( int i = 0; i < c_nMaxLine; i++ )
|
|
{
|
|
m_aSlotCreature[ i ].Show(false);
|
|
m_aSlotChar [ i ].Show(false);
|
|
}
|
|
}
|
|
|
|
void SUIMessengerWnd::DisableCreatureSlot( AR_HANDLE hMaster )
|
|
{
|
|
int nIndex(0);
|
|
PartyCreatureInfo rCreatureInfo;
|
|
GetCreature( hMaster, nIndex, rCreatureInfo );
|
|
|
|
if( rCreatureInfo.hCreature1st )
|
|
DisableCreatureSlot(nIndex);
|
|
}
|
|
|
|
void SUIMessengerWnd::DisableCreatureSlot( int nIndex )
|
|
{
|
|
m_aSlotCreature[ nIndex ].Show(false);
|
|
}
|
|
|
|
void SUIMessengerWnd::MoveSlot( int nIndex, int nY )
|
|
{
|
|
int nDeltaY(0);
|
|
|
|
KUIWnd* pWnd(NULL);
|
|
pWnd = GetChild( CStringUtil::StringFormat( "select_zone%02d", nIndex ).c_str() );
|
|
|
|
if( pWnd )
|
|
{
|
|
/*
|
|
nDeltaY = nY + 1 - pWnd->GetRect().top;
|
|
if( nDeltaY == 0 ) return;
|
|
pWnd->MovePos( pWnd->GetRect().left, nY+1 );
|
|
*/
|
|
|
|
//파티장 맨위로 가는부분 수정시 크리쳐 슬롯 위치 지대로 못 잡는 부분 수정
|
|
//2009-05-27: hunee
|
|
nDeltaY = nY - pWnd->GetRect().top;
|
|
if( nDeltaY == 0 ) return;
|
|
pWnd->MovePos( pWnd->GetRect().left, nY );
|
|
|
|
}
|
|
|
|
pWnd = GetChild( CStringUtil::StringFormat( "party_member_job%02d" , nIndex ).c_str() );
|
|
if( pWnd ) pWnd->MovePos( pWnd->GetRect().left, pWnd->GetRect().top + nDeltaY );
|
|
|
|
pWnd = GetChild( CStringUtil::StringFormat( "party_name_text%02d" , nIndex ).c_str() );
|
|
if( pWnd ) pWnd->MovePos( pWnd->GetRect().left, pWnd->GetRect().top + nDeltaY );
|
|
|
|
pWnd = GetChild( CStringUtil::StringFormat( "party_hp_gauge%02d" , nIndex ).c_str() );
|
|
if( pWnd ) pWnd->MovePos( pWnd->GetRect().left, pWnd->GetRect().top + nDeltaY );
|
|
|
|
pWnd = GetChild( CStringUtil::StringFormat( "party_mp_gauge%02d" , nIndex ).c_str() );
|
|
if( pWnd ) pWnd->MovePos( pWnd->GetRect().left, pWnd->GetRect().top + nDeltaY );
|
|
|
|
pWnd = GetChild( CStringUtil::StringFormat( "select_dead%02d" , nIndex ).c_str() );
|
|
if( pWnd ) pWnd->MovePos( pWnd->GetRect().left, pWnd->GetRect().top + nDeltaY );
|
|
|
|
pWnd = GetChild( CStringUtil::StringFormat( "select_logoff%02d" , nIndex ).c_str() );
|
|
if( pWnd ) pWnd->MovePos( pWnd->GetRect().left, pWnd->GetRect().top + nDeltaY );
|
|
}
|
|
|
|
void SUIMessengerWnd::MoveCreatureSlot( int nIndex, int nY )
|
|
{
|
|
int nDeltaY(0);
|
|
|
|
KUIWnd* pWnd(NULL);
|
|
pWnd = GetChild( CStringUtil::StringFormat( "creature_dead%02d", nIndex ).c_str() );
|
|
if( pWnd )
|
|
{
|
|
/*
|
|
nDeltaY = nY + 1 - pWnd->GetRect().top;
|
|
// if( nDeltaY == 0 ) return;
|
|
pWnd->MovePos( pWnd->GetRect().left, nY+1 );
|
|
*/
|
|
|
|
//파티장 맨위로 가는부분 수정시 크리쳐 슬롯 위치 지대로 못 잡는 부분 수정
|
|
//2009-05-27: hunee
|
|
nDeltaY = nY + 3 - pWnd->GetRect().top;
|
|
// if( nDeltaY == 0 ) return;
|
|
pWnd->MovePos( pWnd->GetRect().left, nY+3 );
|
|
}
|
|
|
|
pWnd = GetChild( CStringUtil::StringFormat( "creature_hp_gauge%02d" , nIndex ).c_str() );
|
|
if( pWnd )
|
|
pWnd->MovePos( pWnd->GetRect().left, pWnd->GetRect().top + nDeltaY );
|
|
|
|
pWnd = GetChild( CStringUtil::StringFormat( "creature_mp_gauge%02d" , nIndex ).c_str() );
|
|
if( pWnd )
|
|
pWnd->MovePos( pWnd->GetRect().left, pWnd->GetRect().top + nDeltaY );
|
|
|
|
pWnd = GetChild( CStringUtil::StringFormat( "creature_job%02d" , nIndex ).c_str() );
|
|
if( pWnd )
|
|
pWnd->MovePos( pWnd->GetRect().left, pWnd->GetRect().top + nDeltaY );
|
|
|
|
KUIWnd* pWnd2(NULL);
|
|
pWnd2 = GetChild( CStringUtil::StringFormat( "creature2_dead%02d", nIndex ).c_str() );
|
|
if( pWnd2 )
|
|
{
|
|
/*
|
|
nDeltaY = nY + 1 - pWnd->GetRect().top;
|
|
// if( nDeltaY == 0 ) return;
|
|
pWnd->MovePos( pWnd->GetRect().left, nY+1 );
|
|
*/
|
|
|
|
//파티장 맨위로 가는부분 수정시 크리쳐 슬롯 위치 지대로 못 잡는 부분 수정
|
|
//2009-05-27: hunee
|
|
nDeltaY = nY + 3 - pWnd2->GetRect().top;
|
|
// if( nDeltaY == 0 ) return;
|
|
pWnd2->MovePos( pWnd2->GetRect().left, nY+3 );
|
|
}
|
|
|
|
pWnd2 = GetChild( CStringUtil::StringFormat( "creature2_hp_gauge%02d" , nIndex ).c_str() );
|
|
if( pWnd2 )
|
|
pWnd2->MovePos( pWnd2->GetRect().left, pWnd2->GetRect().top + nDeltaY );
|
|
|
|
pWnd2 = GetChild( CStringUtil::StringFormat( "creature2_mp_gauge%02d" , nIndex ).c_str() );
|
|
if( pWnd2 )
|
|
pWnd2->MovePos( pWnd2->GetRect().left, pWnd2->GetRect().top + nDeltaY );
|
|
|
|
pWnd2 = GetChild( CStringUtil::StringFormat( "creature2_job%02d" , nIndex ).c_str() );
|
|
if( pWnd2 )
|
|
pWnd2->MovePos( pWnd2->GetRect().left, pWnd2->GetRect().top + nDeltaY );
|
|
}
|
|
|
|
void SUIMessengerWnd::ChangeSize()
|
|
{
|
|
//OutputDebugString( "SUIMessengerWnd::ChangeSize()\n" );
|
|
|
|
std::vector<SPlayerSlot*> vecMemberList;
|
|
vecMemberList = m_PartyMgr.GetMemberList();
|
|
|
|
|
|
KUIWnd* pWndTitleBar = GetChild( "titlebar" );
|
|
if(NULL == pWndTitleBar)
|
|
return ;
|
|
|
|
int x = 0, y = 0, th = 0, add_gh=0;
|
|
KRect rt = pWndTitleBar->GetRect();
|
|
x = rt.left; // 컨트롤 재비치를 위한 기준 x 축 좌표
|
|
y = rt.top - 17; // 컨트롤 재비치를 위한 기준 y 축 좌표
|
|
th = rt.GetHeight() + 17; // 최대, 최소, 닫기, 버튼이 있는 공간 + 타이틀바의 높이
|
|
// add_gh = y + th;
|
|
add_gh = rt.bottom;
|
|
|
|
|
|
KUIWnd* pWnd = GetChild( "select_zone00" );
|
|
if( pWnd == NULL ) return;
|
|
|
|
int nPos_Y( pWnd->GetRect().top );
|
|
|
|
|
|
//파티장 맨위로 가는부분 수정시 크리쳐 슬롯 위치 지대로 못 잡는 부분 수정
|
|
//2009-05-27: hunee
|
|
for( int i(0); i<vecMemberList.size(); ++i)
|
|
{
|
|
// MoveSlot(i ,nPos_Y);
|
|
MoveSlotEx(i, add_gh);
|
|
|
|
EnableSlot( i, true );
|
|
|
|
if( vecMemberList[i]->GetHandle() )
|
|
{
|
|
if( i > -1 && i < SLOT_MAXLINE )
|
|
{
|
|
if( m_vecCreatureList[i].bRender && m_vecCreatureList[i].bRenderUI )
|
|
EnableCreatureSlot(i, true);
|
|
else
|
|
EnableCreatureSlot(i, false);
|
|
}
|
|
}
|
|
}
|
|
KRect rcNew = GetRect();
|
|
// rcNew.bottom = nPos_Y + 3;
|
|
rcNew.bottom = add_gh;
|
|
Resize( rcNew );
|
|
SetCorrectionRect( rcNew, false );
|
|
}
|
|
|
|
void SUIMessengerWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
SUIWnd::OnNotifyUIWindowOpen(bOpen);
|
|
|
|
if( bOpen )
|
|
{
|
|
UnSelect();
|
|
|
|
|
|
SetChildCaption( "titlebar", CStringUtil::StringFormat( "<size:10><hcenter><vcenter>%s", m_PartyMgr.GetPartyName() ).c_str() );
|
|
|
|
if( !m_PartyMgr.IsExist() )
|
|
{
|
|
DisableSlots();
|
|
ChangeSize();
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, false ) );
|
|
}
|
|
else
|
|
{
|
|
m_pGameManager->PlaySound( "ui_popup_window01.wav" );
|
|
}
|
|
|
|
RefreshSelectMember( m_PlayerInfoMgr.GetTarget(), m_PlayerInfoMgr.GetTargetName() );
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, GetRect().right, GetRect().top ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, true ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, GetRect().right, GetRect().top+c_nTitleSize ) );
|
|
}
|
|
else
|
|
{
|
|
//메뉴는 같이 숨긴다.
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, false ) );
|
|
#ifdef _PARTY_RENEWAL_
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CHARACTER, false ) ); //2011.11.15 - servantes : enum 값의 스트링 변경
|
|
#else
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PRIVATE_PARTY_MENU, false ) );
|
|
#endif
|
|
|
|
}
|
|
|
|
GetGameOption().SetMessengerType( m_nTabType );
|
|
|
|
GetGameOption().SetMessangerOpep( bOpen );
|
|
}
|
|
|
|
// #2.1.2.11.1
|
|
void* SUIMessengerWnd::Perform( KID id, KArg& msg )
|
|
{
|
|
namespace hhi = huntaholic_interface;
|
|
|
|
if( id == hhi::id_disablePartyCommand )
|
|
{
|
|
KUIControlButton* button = dynamicCast< KUIControlButton* >( GetChild( "button_suboption" ) );
|
|
if( button )
|
|
button->Disable();
|
|
}
|
|
else if( id == hhi::id_enablePartyCommand )
|
|
{
|
|
KUIControlButton* button = dynamicCast< KUIControlButton* >( GetChild( "button_suboption" ) );
|
|
if( button )
|
|
button->Enable();
|
|
}
|
|
|
|
return (void*)1;
|
|
}
|
|
|
|
void SUIMessengerWnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
if( ::_stricmp( lpszControlID, "window_player_party_base" ) == 0 )
|
|
return ;
|
|
|
|
switch( nMessage )
|
|
{
|
|
case KUI_MESSAGE::KICON_CLICK: // StaticIcon Control // 2011.09.29 : servantes
|
|
{
|
|
if( ::_strnicmp( lpszControlID, "select_zone", 11 ) == 0 )
|
|
{
|
|
int k=0;
|
|
}
|
|
break;
|
|
}
|
|
case KUI_MESSAGE::KICON_RCLICK: // StaticIcon Control // 2011.09.29 : servantes
|
|
{
|
|
if( ::_strnicmp( lpszControlID, "select_zone", 11 ) == 0 ) // 2011.10.04 : servantes
|
|
{
|
|
KUIControlStatic* pStatic = dynamicCast<KUIControlStatic*>(GetChild(lpszControlID));
|
|
if(NULL == pStatic)
|
|
return ;
|
|
|
|
SUIRightMenu1Wnd* pWnd = (SUIRightMenu1Wnd*)m_pGameManager->GetSUI(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1);
|
|
if(NULL == pWnd)
|
|
return ;
|
|
|
|
pWnd->SetUISizeState( GetUISizeState() ); // 상태 변수값 전달
|
|
pWnd->ArrangeMenuByUISizeState( pWnd->GetUISizeState() ); // 메뉴 상태에 따라 재정렬
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU2, false ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1, true ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1, static_cast<int>(lparam), static_cast<int>(wparam) ) );
|
|
|
|
int nPos = atoi(&lpszControlID[11]);
|
|
if(nPos > -1)
|
|
{
|
|
SelectMember(nPos);
|
|
}
|
|
}
|
|
else if( ::_strnicmp( lpszControlID, "creature_select_zone", 20 ) == 0 ) // 2011.10.04 : servantes
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1, false ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU2, true ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU2, static_cast<int>(lparam), static_cast<int>(wparam) ) );
|
|
}
|
|
break;
|
|
}
|
|
case KUI_MESSAGE::KGENWND_RIGHT_CLICK:
|
|
{
|
|
//메뉴 활성화 하자
|
|
m_pGameManager->PlaySound( "ui_button_click.wav" );
|
|
|
|
if(m_pStaticTitleBar->GetRect().IsInRect((int)lparam, (int)wparam)) // 2011.10.04 : servantes
|
|
{
|
|
SUIRightMenu1Wnd* pWnd = (SUIRightMenu1Wnd*)m_pGameManager->GetSUI(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1);
|
|
if(NULL == pWnd)
|
|
return ;
|
|
|
|
pWnd->SetUISizeState( GetUISizeState() ); // 상태 변수값 전달
|
|
pWnd->ArrangeMenuByUISizeState( pWnd->GetUISizeState() ); // 메뉴 상태에 따라 재정렬
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU2, false ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1, true ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1, static_cast<int>(lparam), static_cast<int>(wparam) ) );
|
|
}
|
|
}
|
|
break;
|
|
|
|
case KUI_MESSAGE::KBUTTON_CLICK:
|
|
{
|
|
if( ::_stricmp( lpszControlID, "button_close" ) == 0 )
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, false ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false ) );
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button_suboption" ) == 0 )
|
|
{
|
|
SUITopPartyWnd* pParent = (SUITopPartyWnd*)GetParent(); // servantes 2011.09.08
|
|
if(pParent)
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, "beside_partywnd" ) );
|
|
}
|
|
//파티 옵션 창
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_TOGGLE_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU ) );
|
|
}
|
|
//2011.09.15 - servantes : 안쓰는 코드 제거 : 확장, 축소 버튼 내용 추가
|
|
else if( ::_stricmp( lpszControlID, "button_minimize" ) == 0 )
|
|
{
|
|
m_nListSizeType = PARTY_UI_LIST_SIZE_REDUCE; //2011.09.27 - servantes
|
|
|
|
// SetChildShow( "mark_party_leader", false );
|
|
m_pStaticLeaderMark->SetShow( false );
|
|
|
|
ChangeVisibleMinimizeManimizeButtom( TO_BE_MIN ); // 최소화 버튼 보이고 최대화 버튼 숨김
|
|
|
|
DisableSlots();
|
|
|
|
//std::vector<SPlayerSlot*> vecMemberList = m_PartyMgr.GetMemberList();
|
|
//int sz = vecMemberList.size();
|
|
//for(int x=0; x<sz;x++)
|
|
//{
|
|
// EnableCreatureSlot(x, false);
|
|
// EnableSlot(x, false);
|
|
//}
|
|
|
|
SUITopPartyWnd* pParent = (SUITopPartyWnd*)GetParent();
|
|
if(pParent)
|
|
{
|
|
pParent->SetListSizeType(PARTY_UI_LIST_SIZE_REDUCE);
|
|
pParent->SetUpClickDragRect(); // 2011.09.19 : servantes : UI 영역 재설정(클릭, 드래그)
|
|
|
|
if (m_nUISizeState == PARTY_UI_SIZE_SMALL)
|
|
pParent->DeleverMessage(PARTY_UI_ID_SMALL, PARTY_UI_ID_BIG, "push_minimize_button");
|
|
else if(m_nUISizeState == PARTY_UI_SIZE_BIG)
|
|
pParent->DeleverMessage(PARTY_UI_SIZE_BIG, PARTY_UI_ID_SMALL, "push_minimize_button");
|
|
}
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button_maximize" ) == 0 )
|
|
{
|
|
m_nListSizeType = PARTY_UI_LIST_SIZE_EXTEND; //2011.09.27 - servantes
|
|
|
|
ChangeVisibleMinimizeManimizeButtom( TO_BE_MAX ); // 최대화 버튼 보이고 최소화 버튼 숨김
|
|
|
|
//std::vector<SPlayerSlot*> vecMemberList = m_PartyMgr.GetMemberList();
|
|
//int sz = vecMemberList.size();
|
|
//for(int x=0; x<sz;x++)
|
|
//{
|
|
// EnableCreatureSlot(x, true);
|
|
// EnableSlot(x, true);
|
|
//}
|
|
RefreshSlots();
|
|
|
|
SUITopPartyWnd* pParent = (SUITopPartyWnd*)GetParent();
|
|
if(pParent)
|
|
{
|
|
pParent->SetListSizeType(PARTY_UI_LIST_SIZE_EXTEND);
|
|
pParent->SetUpClickDragRect(); // 2011.09.19 : servantes : UI 영역 재설정(클릭, 드래그)
|
|
|
|
if (m_nUISizeState == PARTY_UI_SIZE_SMALL)
|
|
pParent->DeleverMessage(PARTY_UI_ID_SMALL, PARTY_UI_ID_BIG, "push_maximize_button");
|
|
else if(m_nUISizeState == PARTY_UI_SIZE_BIG)
|
|
pParent->DeleverMessage(PARTY_UI_SIZE_BIG, PARTY_UI_ID_SMALL, "push_maximize_button");
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case KUI_MESSAGE::KGENWND_MOVE: // 윈도우 이동
|
|
{
|
|
LimitMoveWnd(); // 게임 외부로 나가지 못하게 제한
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, GetRect().right, GetRect().top ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, GetRect().right, GetRect().top+c_nTitleSize ) );
|
|
}
|
|
break;
|
|
case KUI_MESSAGE::KFOCUS_ACTIVATED:
|
|
{
|
|
// 2011.09.29 : servantes : 오른 클릭 팝업 메뉴 닫기
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1, false ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU2, false ) );
|
|
|
|
// 멤버 선택시 타겟 요청
|
|
if( GetRect().IsInRect( static_cast<int>(lparam), static_cast<int>(wparam) ) )
|
|
{
|
|
std::string strName;
|
|
KUIWnd* pWnd(NULL);
|
|
KUIWnd* pLogoutWnd(NULL);
|
|
KUIWnd* pName(NULL);
|
|
SGameAvatarEx* pTargetAvatar(NULL);
|
|
for( int i = 0; i < c_nMaxLine; i++ )
|
|
{
|
|
pWnd = GetChild( CStringUtil::StringFormat( "select_zone%02d", i ).c_str() );
|
|
|
|
pLogoutWnd = GetChild( CStringUtil::StringFormat( "select_logoff%02d", i ).c_str() );
|
|
// if( pLogoutWnd && pLogoutWnd->IsShow() && pLogoutWnd->GetRect().IsInRect( static_cast<int>(lparam), static_cast<int>(wparam) ) )
|
|
// return;
|
|
|
|
if( pWnd && pWnd->IsShow() && pWnd->GetRect().IsInRect( static_cast<int>(lparam), static_cast<int>(wparam) ) )
|
|
{
|
|
AR_HANDLE hParty = GetHandle(i);
|
|
if( hParty )
|
|
{
|
|
SIMSG_UI_ACT_TARGET* pMsg = new SIMSG_UI_ACT_TARGET;
|
|
|
|
pTargetAvatar = (SGameAvatarEx*)( GetObject(hParty) );
|
|
if( pTargetAvatar )
|
|
{
|
|
pMsg->m_nTargetHandle = hParty;
|
|
}
|
|
else
|
|
{
|
|
pMsg->m_nTargetHandle = NULL;
|
|
m_nSelectIndex = i;
|
|
SelectMember(i);
|
|
}
|
|
|
|
m_pDisplayInfo->SetPartyTarget( hParty ); //멀리 있는 로그인된 파티원에게 아이템 사용 가능
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
|
|
if( !pTargetAvatar )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_ACT_FAR_PARTY_TARGET(hParty) );
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
pWnd = GetChild( CStringUtil::StringFormat( "click_check%02d", i ).c_str() );
|
|
if( pWnd && pWnd->IsShow() && pWnd->GetRect().IsInRect( static_cast<int>(lparam), static_cast<int>(wparam) ) )
|
|
{
|
|
if( m_vecCreatureList[i].hCreature1st )
|
|
{
|
|
SIMSG_UI_ACT_TARGET* pMsg = new SIMSG_UI_ACT_TARGET;
|
|
pMsg->m_nTargetHandle = m_vecCreatureList[i].hCreature1st;
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
|
|
// 2011.05.17 - servantes 느려서 주석처리
|
|
// GetGameOption().SetPartyX( GetRect().left );
|
|
// GetGameOption().SetPartyY( GetRect().top );
|
|
}
|
|
|
|
void SUIMessengerWnd::UnSelect()
|
|
{
|
|
#ifdef _PARTY_RENEWAL_
|
|
m_hSelectMember = NULL; // 2011.10.05 : servantes : 선택한 멤버 핸들
|
|
m_strSelectMember = ""; // 2011.10.06 : servantes : 선택이름 초기화
|
|
#endif
|
|
|
|
m_nSelectIndex = -1;
|
|
m_nSelectCreatureIndex = -1;
|
|
|
|
SetChildShow( "select_mouseclick", false );
|
|
SetChildShow( "creature_mouseclick", false );
|
|
}
|
|
|
|
// 2010.08.31 - prodongi
|
|
void SUIMessengerWnd::unSelectCreature()
|
|
{
|
|
m_nSelectCreatureIndex = -1;
|
|
SetChildShow( "creature_mouseclick", false );
|
|
}
|
|
|
|
void SUIMessengerWnd::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
XSTART_PROFILE( "SUIMessengerWnd::ProcMsgAtStatic", 100 );
|
|
|
|
switch( pMsg->nType )
|
|
{
|
|
case IMSG_UI_RECT: // 2011.09.08 - servantes : 영역얻기
|
|
{
|
|
SIMSG_UI_RECT* pRMsg = (SIMSG_UI_RECT*)pMsg;
|
|
pRMsg->rt = GetRect();
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case MSG_CHANGE_NAME :
|
|
{
|
|
//OutputDebugString( "MSG_CHANGE_NAME\n" );
|
|
|
|
RefreshSlots();
|
|
}
|
|
break;
|
|
|
|
case IMSG_MOUSEWHEEL:
|
|
{
|
|
SIMSG_MOUSEWHEEL* pMouseWheel = (SIMSG_MOUSEWHEEL*)pMsg;
|
|
short zDelta;
|
|
zDelta = GET_WHEEL_DELTA_WPARAM(pMouseWheel->wParam);
|
|
|
|
_oprint( "MouseWheel %d\n", zDelta );
|
|
|
|
if( !m_PartyMgr.IsExist() ) return;
|
|
|
|
if( zDelta >= 0 )
|
|
{
|
|
//위로 선택
|
|
m_nSelectIndex--;
|
|
|
|
if( m_nSelectIndex < 0 )
|
|
m_nSelectIndex = m_PartyMgr.GetMemberCount()-1;
|
|
}
|
|
else
|
|
{
|
|
//아래 선택
|
|
m_nSelectIndex++;
|
|
|
|
if( m_nSelectIndex >= m_PartyMgr.GetMemberCount() )
|
|
m_nSelectIndex = 0;
|
|
}
|
|
|
|
SelectMember( m_nSelectIndex );
|
|
}
|
|
break;
|
|
|
|
case IMSG_UI_SEND_DATA:
|
|
{
|
|
SIMSG_UI_SEND_DATA *pData = (SIMSG_UI_SEND_DATA *)pMsg;
|
|
|
|
if( pData->m_strString == "party_update" )
|
|
{
|
|
RefreshPartyInfo();
|
|
RefreshOnLine();
|
|
|
|
if( !m_PartyMgr.GetSelectMember() )
|
|
UnSelect();
|
|
}
|
|
else if( pData->m_strString == "add_creature" )
|
|
{
|
|
pMsg->bUse = true;
|
|
|
|
AddCreature( pData->m_dwData );
|
|
|
|
//OutputDebugString( "add_creature\n" );
|
|
|
|
RefreshSlots();
|
|
}
|
|
else if( pData->m_strString == "add_creature_index" )
|
|
{
|
|
// 2010.08.30 - prodongi
|
|
//AddCreature( (int)pData->m_nNumber.getAmount() );
|
|
setRenderCreatureUI((int)pData->m_nNumber.getAmount(), true);
|
|
|
|
//OutputDebugString( "add_creature_index\n" );
|
|
|
|
RefreshSlots();
|
|
}
|
|
else if( pData->m_strString == "remove_creature" )
|
|
{
|
|
RemoveCreature( pData->m_dwData );
|
|
|
|
//OutputDebugString( "remove_creature\n" );
|
|
|
|
RefreshSlots();
|
|
}
|
|
else if( pData->m_strString == "remove_creature_index" )
|
|
{
|
|
// 2010.08.30 - prodongi
|
|
//RemoveCreature( (int)pData->m_nNumber.getAmount() );
|
|
setRenderCreatureUI((int)pData->m_nNumber.getAmount(), false);
|
|
|
|
//OutputDebugString( "remove_creature_index\n" );
|
|
|
|
RefreshSlots();
|
|
}
|
|
else if( pData->m_strString == "set_party_name" ) // 2011.10.06 : servantes : 파티이름 설정
|
|
{
|
|
std::string strCaption = "<font:font_01><size:9><left>";
|
|
strCaption += m_PartyMgr.GetPartyName();
|
|
m_pStaticTitle->SetCaption(strCaption.c_str());
|
|
}
|
|
else if( pData->m_strString == "whisper_chatting" ) // 2011.10.06 : servantes : 귓말하기
|
|
{
|
|
if( m_strSelectMember.size() )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_WHISPER( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_CHATTING, m_strSelectMember.c_str() ) );
|
|
}
|
|
else if( pData->m_strString == "add_friend" ) // 2011.10.06 : servantes : 친구추가
|
|
{
|
|
if( m_strSelectMember.size() )
|
|
m_pGameManager->PostMsgAtDynamic( new SMSG_FRIEND_COMMAND( SMSG_FRIEND_COMMAND::FRIEND_ADD, m_strSelectMember.c_str() ) );
|
|
}
|
|
else if( pData->m_strString == "block_friend" ) // 2011.10.06 : servantes : 차단
|
|
{
|
|
if( m_strSelectMember.size() )
|
|
m_pGameManager->PostMsgAtDynamic( new SMSG_FRIEND_COMMAND( SMSG_FRIEND_COMMAND::CUT_ADD, m_strSelectMember.c_str() ) );
|
|
}
|
|
else if( pData->m_strString == "request_compete" ) // 2011.10.06 : servantes : 대련 신청
|
|
{
|
|
if( m_strSelectMember.size() )
|
|
{
|
|
SMSG_CS_COMPETE_REQUEST* pMsg = new SMSG_CS_COMPETE_REQUEST;
|
|
pMsg->compete_type = COMPETE_TYPE_VS_PLAYER;
|
|
strcpy(pMsg->requestee, m_strSelectMember.c_str());
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
}
|
|
else if( pData->m_strString == "kick_out_party" ) // 2011.10.06 : servantes : 파티 추방
|
|
{
|
|
if( m_strSelectMember.size() )
|
|
{
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_KICK;
|
|
pMsg->strName = m_strSelectMember;
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
}
|
|
else if( pData->m_strString == "take_over_party" ) // 2011.10.06 : servantes : 파티장인계
|
|
{
|
|
if( m_strSelectMember.size() )
|
|
{
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_TRANSFER;
|
|
pMsg->strName = m_strSelectMember;
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
}
|
|
XDO_PROFILE( "SUIMessengerWnd::IMSG_UI_SEND_DATA" );
|
|
}
|
|
break;
|
|
case MSG_CHATTING:
|
|
{
|
|
SMSG_CHATTING* pChatMsg = ( SMSG_CHATTING* )pMsg;
|
|
|
|
if( pChatMsg->nChatType == CHAT_PARTY_SYSTEM )
|
|
{
|
|
OutputPartyText( pChatMsg->strText.c_str() );
|
|
|
|
if( m_nTabType == TAB_PARTY )
|
|
{
|
|
if( m_PartyMgr.IsExist() && m_PartyMgr.GetMemberCount() > 0 )
|
|
{
|
|
//OutputDebugString( "pChatMsg->nChatType == CHAT_PARTY_SYSTEM\n" );
|
|
RefreshSlots();
|
|
}
|
|
else
|
|
DisableSlots();
|
|
}
|
|
}
|
|
else if( pChatMsg->nChatType == CHAT_GUILD_SYSTEM )
|
|
{
|
|
OutputGuildText( pChatMsg->strText.c_str() );
|
|
}
|
|
else if( pChatMsg->nChatType == CHAT_RAID_SYSTEM )
|
|
{
|
|
OutputRaidText( pChatMsg->strText.c_str() );
|
|
}
|
|
else if( pChatMsg->nChatType == CHAT_ALLIANCE_SYSTEM )
|
|
{
|
|
OutputAllianceText( pChatMsg->strText.c_str() );
|
|
}
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case IMSG_UI_TARGET_INFO:
|
|
{
|
|
SIMSG_UI_TARGET_INFO* pTargetMsg = (SIMSG_UI_TARGET_INFO*)pMsg;
|
|
|
|
//if( m_nTabType == TAB_PARTY ) break;
|
|
|
|
m_PartyMgr.SetSelectMember( "none" );
|
|
m_PartyMgr.SetSelectMemberHandle( NULL );
|
|
|
|
if( pTargetMsg->handle )
|
|
{
|
|
RefreshSelectMember( m_PlayerInfoMgr.GetTarget(), m_PlayerInfoMgr.GetTargetName() );
|
|
}
|
|
else UnSelect();
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case IMSG_UI_ACT_FAR_PARTY_TARGET:
|
|
{
|
|
SIMSG_UI_ACT_FAR_PARTY_TARGET* pTargetMsg = (SIMSG_UI_ACT_FAR_PARTY_TARGET*)pMsg;
|
|
|
|
if( pTargetMsg->m_nTargetHandle )
|
|
{
|
|
// 멀리 있는 파티 타겟도 파티 창에서 선택 가능 하도록 변경. kappamind, 2010.01.14
|
|
SPlayerSlot* pPlayerSlot = m_PartyMgr.FindMember( pTargetMsg->m_nTargetHandle );
|
|
m_PartyMgr.SetSelectMember( pPlayerSlot->GetName() );
|
|
m_PartyMgr.SetSelectMemberHandle( pTargetMsg->m_nTargetHandle );
|
|
RefreshSelectMember( pTargetMsg->m_nTargetHandle, pPlayerSlot->GetName() );
|
|
}
|
|
else UnSelect();
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case IMSG_UI_TARGET_STAT:
|
|
case MSG_LEVEL_UPDATE:
|
|
case MSG_EXP_UPDATE:
|
|
{
|
|
if( m_nOldHP != m_PlayerInfoMgr.GetHP() || m_nOldMP != m_PlayerInfoMgr.GetMP() )
|
|
{
|
|
SMSG_CHATTING_REQUEST* pChatMsg = new SMSG_CHATTING_REQUEST;
|
|
memset( pChatMsg->szTarget, 0, sizeof(pChatMsg->szTarget) );
|
|
pChatMsg->type = CHAT_PARTY_SYSTEM;
|
|
pChatMsg->strText = "/파티정보";
|
|
m_pGameManager->PostMsgAtDynamic( pChatMsg );
|
|
|
|
m_nOldHP = m_PlayerInfoMgr.GetHP();
|
|
m_nOldMP = m_PlayerInfoMgr.GetMP();
|
|
}
|
|
|
|
if( m_nTabType == TAB_GUILD && pMsg->nType == MSG_LEVEL_UPDATE )
|
|
{
|
|
SMSG_CHATTING_REQUEST* pChatMsg = new SMSG_CHATTING_REQUEST;
|
|
memset( pChatMsg->szTarget, 0, sizeof(pChatMsg->szTarget) );
|
|
pChatMsg->type = CHAT_PARTY_SYSTEM;
|
|
pChatMsg->strText = "/파티정보";
|
|
m_pGameManager->PostMsgAtDynamic( pChatMsg );
|
|
}
|
|
|
|
if( pMsg->nType == IMSG_UI_TARGET_STAT )
|
|
{
|
|
SIMSG_UI_TARGET_STAT* pTargetMsg = (SIMSG_UI_TARGET_STAT*)pMsg;
|
|
|
|
SGameAvatarEx* pAvatar = (SGameAvatarEx*)( GetObject(pTargetMsg->handle) );
|
|
if( pAvatar && pAvatar->GetObjType() == TS_ENTER::GAME_SUMMON )
|
|
{
|
|
if( m_pDisplayInfo->IsPartyMember( pAvatar->GetMaster() ))
|
|
{
|
|
RefreshCreatureGauge( pTargetMsg->handle );
|
|
}
|
|
}
|
|
}
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case IMSG_UI_MOVE:
|
|
{
|
|
SIMSG_UI_MOVE* pMoveMsg = ( SIMSG_UI_MOVE* )pMsg;
|
|
MovePos( pMoveMsg->m_nX, pMoveMsg->m_nY );
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, GetRect().right, GetRect().top ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, GetRect().right, GetRect().top+c_nTitleSize ) );
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
|
|
case IMSG_UI_INPUTTEXT:
|
|
{
|
|
SIMSG_UI_INPUTTEXT* pInputMsg = (SIMSG_UI_INPUTTEXT*)pMsg;
|
|
if( pInputMsg->m_strText.empty() ) break;
|
|
|
|
SMSG_CHATTING_REQUEST msg;
|
|
msg.type = CHAT_NORMAL;
|
|
|
|
std::string strText;
|
|
switch( pInputMsg->m_nUsage )
|
|
{
|
|
case SIMSG_UI_REQ_INPUTTEXT::USAGE_PARTY:
|
|
{
|
|
if( !m_PartyMgr.IsExist() ) // 파티 결성
|
|
{
|
|
strText = "/set_party ";
|
|
strText += pInputMsg->m_strText;
|
|
msg.strText = strText;
|
|
}
|
|
else // 파티 초대
|
|
{
|
|
strText = "/invite ";
|
|
strText += pInputMsg->m_strText;
|
|
msg.strText = strText;
|
|
}
|
|
m_pGameManager->ProcMsgAtStatic( &msg );
|
|
}
|
|
break;
|
|
case SIMSG_UI_REQ_INPUTTEXT::USAGE_CREATE_GUILD :
|
|
{
|
|
strText = "/길드결성 ";
|
|
strText += pInputMsg->m_strText;
|
|
msg.strText = strText;
|
|
|
|
// 2011.07.27 - servantes : part2 [QA]_버그 #18046 와 동일한 내용 수정 : 어포스트로피(')표시가 길드 명에 있으면 게임 클라이언트가 종료됩니다
|
|
XStringUtil::Replace( msg.strText, "'", "`" );
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &msg );
|
|
}
|
|
break;
|
|
case SIMSG_UI_REQ_INPUTTEXT::USAGE_CREATE_ALLIANCE:
|
|
{
|
|
strText = "/길드연합 ";
|
|
strText += pInputMsg->m_strText;
|
|
msg.strText = strText;
|
|
|
|
// 2011.07.28 - servantes : part2 [QA]_버그 #18046 와 동일한 내용 수정 : 어포스트로피(')표시가 길드 명에 있으면 게임 클라이언트가 종료됩니다
|
|
XStringUtil::Replace( msg.strText, "'", "`" );
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &msg );
|
|
}
|
|
break;
|
|
}
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
|
|
case MSG_ENTER:
|
|
{
|
|
SMSG_ENTER* pEnter = (SMSG_ENTER*)pMsg;
|
|
|
|
if( pEnter->ObjType == TS_ENTER::GAME_SUMMON )
|
|
if( ChangeCreature( pEnter->handle ) )
|
|
{
|
|
//OutputDebugString( "if( pEnter->ObjType == TS_ENTER::GAME_SUMMON )\n" );
|
|
|
|
RefreshSlots();
|
|
}
|
|
else if( pEnter->ObjType == TS_ENTER::GAME_PLAYER )
|
|
if( ChangeMasterCreature( pEnter->handle ) )
|
|
{
|
|
//OutputDebugString( "else if( pEnter->ObjType == TS_ENTER::GAME_PLAYER )\n" );
|
|
|
|
RefreshSlots();
|
|
}
|
|
}
|
|
break;
|
|
|
|
case MSG_LEAVE:
|
|
{
|
|
SMSG_LEAVE* pLeave = (SMSG_LEAVE*)pMsg;
|
|
if( LeaveCreature( pLeave->handle ) != -1 )
|
|
{
|
|
//OutputDebugString( "SMSG_LEAVE* pLeave = (SMSG_LEAVE*)pMsg;\n" );
|
|
|
|
RefreshSlots();
|
|
}
|
|
else
|
|
{
|
|
LeaveMaster( pLeave->handle );
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// 크리처
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
bool SUIMessengerWnd::ChangeCreature( AR_HANDLE handle )
|
|
{
|
|
AR_HANDLE hMaster = GetMaster( handle );
|
|
int nIndex = m_PartyMgr.GetMemberIndex( hMaster );
|
|
if( hMaster && nIndex >= 0 && nIndex < c_nMaxLine )
|
|
{
|
|
if( m_vecCreatureList[nIndex].hMaster == hMaster )
|
|
{
|
|
m_vecCreatureList[nIndex].hCreature1st = handle;
|
|
m_vecCreatureList[nIndex].bRender = true;
|
|
m_vecCreatureList[nIndex].bRenderUI = true; // 2010.08.30 - prodongi
|
|
return true;
|
|
}
|
|
}
|
|
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
if( m_vecCreatureList[i].hMaster == hMaster )
|
|
{
|
|
m_vecCreatureList[i].hCreature1st = handle;
|
|
m_vecCreatureList[i].bRender = true;
|
|
m_vecCreatureList[i].bRenderUI = true; // 2010.08.30 - prodongi
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
bool SUIMessengerWnd::ChangeMasterCreature( AR_HANDLE hMaster )
|
|
{
|
|
int nIndex = m_PartyMgr.GetMemberIndex( hMaster );
|
|
if( hMaster && nIndex >= 0 && nIndex < c_nMaxLine )
|
|
{
|
|
SGameAvatarEx* pMaster = GetObject( hMaster );
|
|
if( pMaster )
|
|
{
|
|
m_vecCreatureList[nIndex].hMaster = hMaster;
|
|
m_vecCreatureList[nIndex].hCreature1st = pMaster->GetCreature();
|
|
m_vecCreatureList[nIndex].bRender = true;
|
|
m_vecCreatureList[nIndex].bRenderUI = true; // 2010.08.30 - prodongi
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
int SUIMessengerWnd::AddCreature( AR_HANDLE handle )
|
|
{
|
|
AR_HANDLE hMaster = GetMaster( handle );
|
|
int nIndex = m_PartyMgr.GetMemberIndex( hMaster );
|
|
if( hMaster && nIndex > -1 && nIndex < c_nMaxLine )
|
|
{
|
|
// m_vecCreatureList[nIndex].hMaster = hMaster;
|
|
// m_vecCreatureList[nIndex].hCreature1st = handle;
|
|
m_vecCreatureList[nIndex].bRender = true;
|
|
m_vecCreatureList[nIndex].bRenderUI = true; // 2010.08.30 - prodongi
|
|
return nIndex;
|
|
}
|
|
else
|
|
{
|
|
// int nGroupID = GetStringDB().GetGroupID( nMsgType );
|
|
// m_pDisplayInfo->AddSystemMessage( strMsg.c_str(), nGroupID );
|
|
m_pDisplayInfo->AddSystemMessage( "크리처의 마스터가 파티원이 아닙니다.", 0 );
|
|
return -1;
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
// 2010.08.30 - prodongi
|
|
/*
|
|
void SUIMessengerWnd::AddCreature( int nIndex )
|
|
{
|
|
// SGameAvatarEx* pPlayer = GetPlayerPtr( nIndex );
|
|
// if( pPlayer )
|
|
{
|
|
if( nIndex > -1 && nIndex < c_nMaxLine )
|
|
{
|
|
// m_vecCreatureList[nIndex].hMaster = pPlayer->GetArID();
|
|
// m_vecCreatureList[nIndex].hCreature1st = pPlayer->GetCreature();
|
|
m_vecCreatureList[nIndex].bRender = true;
|
|
}
|
|
}
|
|
}
|
|
*/
|
|
|
|
SGameAvatarEx* SUIMessengerWnd::GetPlayerPtr( int nIndex )
|
|
{
|
|
if( nIndex < 0 || nIndex >= m_PartyMgr.GetMemberCount() )
|
|
return NULL;
|
|
/*
|
|
if( nIndex == 0 )
|
|
{
|
|
SPlayerSlot* pSlot = m_PartyMgr.GetLeaderInfo();
|
|
if( pSlot ) return GetObject( pSlot->GetHandle() );
|
|
}
|
|
else
|
|
{
|
|
const int nLeaderIndex = m_PartyMgr.GetLeaderIndex();
|
|
if( nIndex < nLeaderIndex )
|
|
nIndex++;
|
|
|
|
std::vector<SPlayerSlot*> vecMemberList = m_PartyMgr.GetMemberList();
|
|
if( vecMemberList.size() > nIndex )
|
|
{
|
|
return GetObject( vecMemberList[nIndex]->GetHandle() );
|
|
}
|
|
}
|
|
*/
|
|
//순차분배 수정: 파티장이 0번 슬롯에 나오던 부분을 자기 위치에 나오도록 수정
|
|
//2009-02-23: hunee
|
|
std::vector<SPlayerSlot*> vecMemberList = m_PartyMgr.GetMemberList();
|
|
if( vecMemberList.size() > nIndex )
|
|
{
|
|
return GetObject( vecMemberList[nIndex]->GetHandle() );
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
void SUIMessengerWnd::LeaveMaster( AR_HANDLE hMaster )
|
|
{
|
|
int nIndex = m_PartyMgr.GetMemberIndex( hMaster );
|
|
if( hMaster && nIndex >= 0 && nIndex < c_nMaxLine )
|
|
{
|
|
if( m_vecCreatureList[nIndex].hMaster == hMaster )
|
|
{
|
|
m_vecCreatureList[nIndex].hMaster = NULL;
|
|
m_vecCreatureList[nIndex].hCreature1st = NULL;
|
|
m_vecCreatureList[nIndex].bRender = false;
|
|
m_vecCreatureList[nIndex].bRenderUI = false; // 2010.08.30 - prodongi
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
int SUIMessengerWnd::LeaveCreature( AR_HANDLE handle )
|
|
{
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
if( m_vecCreatureList[i].hCreature1st == handle )
|
|
{
|
|
m_vecCreatureList[i].hCreature1st = NULL;
|
|
m_vecCreatureList[i].bRender = false;
|
|
m_vecCreatureList[i].bRenderUI = false; // 2010.08.30 - prodongi
|
|
return i;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
int SUIMessengerWnd::RemoveCreature( AR_HANDLE handle )
|
|
{
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
if( m_vecCreatureList[i].hCreature1st == handle )
|
|
{
|
|
// m_vecCreatureList[i].hCreature1st = NULL;
|
|
m_vecCreatureList[i].bRender = false;
|
|
m_vecCreatureList[i].bRenderUI = false; // 2010.08.30 - prodongi
|
|
return i;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
// 2010.08.30 - prodongi
|
|
/*
|
|
void SUIMessengerWnd::RemoveCreature( int nIndex )
|
|
{
|
|
if( nIndex < 0 || nIndex >= c_nMaxLine )
|
|
return;
|
|
// m_vecCreatureList[nIndex].hCreature1st = NULL;
|
|
m_vecCreatureList[nIndex].bRender = false;
|
|
}
|
|
*/
|
|
|
|
// 2010.08.30 - prodongi
|
|
void SUIMessengerWnd::setRenderCreatureUI(int index, bool render)
|
|
{
|
|
if( index < 0 || index >= c_nMaxLine )
|
|
return;
|
|
m_vecCreatureList[index].bRenderUI = render;
|
|
// 2010.08.31 unselect creature - prodongi
|
|
if (!render)
|
|
unSelectCreature();
|
|
}
|
|
|
|
AR_HANDLE SUIMessengerWnd::GetMaster( AR_HANDLE handle )
|
|
{
|
|
SGameAvatarEx* pCreature = GetObject( handle );
|
|
if( pCreature && pCreature->GetObjType() == TS_ENTER::GAME_SUMMON )
|
|
return pCreature->GetMaster();
|
|
return 0;
|
|
}
|
|
|
|
SGameAvatarEx* SUIMessengerWnd::GetObject( AR_HANDLE handle )
|
|
{
|
|
SGame* pGame = m_pGameManager->GetActiveGame();
|
|
if( !pGame || pGame->GetGameType() != GAME_TYPE_WORLD )
|
|
return NULL;
|
|
|
|
return (SGameAvatarEx*)(pGame->GetGameObject(handle));
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// 슬롯
|
|
//////////////////////////////////////////////////////////////////////////
|
|
void SUIMessengerWnd::RefreshSlots()
|
|
{
|
|
if(m_nListSizeType == PARTY_UI_LIST_SIZE_REDUCE)
|
|
return ;
|
|
|
|
//OutputDebugString( "SUIMessengerWnd::RefreshSlots()\n" );
|
|
|
|
int nCount = 0;
|
|
|
|
switch(m_nTabType)
|
|
{
|
|
case TAB_PARTY:
|
|
case TAB_GUILD:
|
|
{
|
|
bool bExist = m_PartyMgr.IsExist();
|
|
nCount = m_PartyMgr.GetMemberCount();
|
|
|
|
if( !bExist || nCount <= 0 )
|
|
{
|
|
DisableSlots();
|
|
return;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
|
|
DisableSlots();
|
|
RefreshEnableSlots();
|
|
|
|
RefreshPartyInfo();
|
|
ChangeSize();
|
|
RefreshOnLine();
|
|
|
|
RefreshSelectMember( m_PlayerInfoMgr.GetTarget(), m_PlayerInfoMgr.GetTargetName() );
|
|
}
|
|
|
|
void SUIMessengerWnd::RefreshCreatureSlots()
|
|
{
|
|
int nIndex(-1);
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
if( m_vecCreatureList[i].hMaster )
|
|
{
|
|
nIndex = m_PartyMgr.GetMemberIndex( m_vecCreatureList[i].hMaster );
|
|
if( nIndex>=0 && nIndex != i )
|
|
{
|
|
m_vecCreatureList[nIndex].hCreature1st = m_vecCreatureList[i].hCreature1st;
|
|
m_vecCreatureList[nIndex].hMaster = m_vecCreatureList[i].hMaster;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
void SUIMessengerWnd::MoveSlotControl(const char* ptr_name, int x, int y)
|
|
{
|
|
KUIWnd* pWnd = GetChild( ptr_name );
|
|
if(pWnd)
|
|
pWnd->MovePos(x, y);
|
|
}
|
|
|
|
void SUIMessengerWnd::MoveSlotEx(int id_slot, int& x_next_startpos) // 2011.10.06 : servantes : 해당 슬롯의 컨트롤 위치를 변경한다
|
|
{
|
|
int x = 0, y = 0, th = 0, add_gh=0;
|
|
std::vector<SPlayerSlot*> vecMemberList = m_PartyMgr.GetMemberList();
|
|
SPlayerSlot* pSlot = vecMemberList[id_slot];
|
|
|
|
bool bCreatureExist = false;
|
|
|
|
PartyCreatureInfo rCreatureInfo;
|
|
GetCreature( pSlot->GetHandle(), id_slot, rCreatureInfo );
|
|
if(rCreatureInfo.hCreature1st)
|
|
bCreatureExist = true;
|
|
|
|
KUIWnd* pWndTitleBar = GetChild( "titlebar" );
|
|
if(NULL == pWndTitleBar)
|
|
return ;
|
|
KRect rt = pWndTitleBar->GetRect();
|
|
x = rt.left; // 컨트롤 재비치를 위한 기준 x 축 좌표
|
|
/* y = rt.top - 17; // 컨트롤 재비치를 위한 기준 y 축 좌표
|
|
th = rt.GetHeight() + 17; // 최대, 최소, 닫기, 버튼이 있는 공간 + 타이틀바의 높이
|
|
add_gh = y + th;
|
|
*/
|
|
add_gh = x_next_startpos;
|
|
|
|
// character
|
|
KUIWnd* pWndZone = GetChild( CStringUtil::StringFormat( "select_zone%02d", id_slot ).c_str() );
|
|
if(pWndZone)
|
|
pWndZone->MovePos(x, add_gh);
|
|
|
|
m_aSlotChar[id_slot].pNoFrame->MovePos(x + 2, add_gh + 2);
|
|
m_aSlotChar[id_slot].pJob ->MovePos(x + 2, add_gh + 11);
|
|
m_aSlotChar[id_slot].pNumber ->MovePos(x + 7, add_gh + 2);
|
|
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
|
|
{
|
|
int tg = -5;
|
|
m_aSlotChar[id_slot].pHP ->MovePos(x + 22 + tg, add_gh + 20 + tg);
|
|
m_aSlotChar[id_slot].pMP ->MovePos(x + 22 + tg, add_gh + 25 + tg);
|
|
m_aSlotChar[id_slot].pName ->MovePos(x + 35 + tg - 6, add_gh - 1);
|
|
}
|
|
else
|
|
{
|
|
m_aSlotChar[id_slot].pHP ->MovePos(x + 22, add_gh + 20);
|
|
m_aSlotChar[id_slot].pMP ->MovePos(x + 22, add_gh + 25);
|
|
m_aSlotChar[id_slot].pName ->MovePos(x + 35, add_gh + 1);
|
|
}
|
|
|
|
add_gh += pWndZone->GetRect().GetHeight();
|
|
x_next_startpos = add_gh;
|
|
|
|
// main creature
|
|
if(bCreatureExist)
|
|
{
|
|
m_aSlotCreature[id_slot].pJob ->MovePos(x + 2, add_gh + 1);
|
|
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
|
|
{
|
|
int tg = -5;
|
|
m_aSlotCreature[id_slot].pDead ->MovePos(x + 2 + tg, add_gh + 1 + tg);
|
|
m_aSlotCreature[id_slot].pHP ->MovePos(x + 22 + tg, add_gh + 11 + tg);
|
|
m_aSlotCreature[id_slot].pMP ->MovePos(x + 22 + tg, add_gh + 16 + tg);
|
|
|
|
m_aSlotCreature[id_slot].pMainMark->MovePos(x + 20 + tg, add_gh + 3 + tg);
|
|
m_aSlotCreature[id_slot].pDead2 ->MovePos(x + 51 + tg, add_gh + 1 + tg);
|
|
m_aSlotCreature[id_slot].pHP2 ->MovePos(x + 71 + tg, add_gh + 11 + tg);
|
|
m_aSlotCreature[id_slot].pMP2 ->MovePos(x + 71 + tg, add_gh + 16 + tg);
|
|
m_aSlotCreature[id_slot].pJob2 ->MovePos(x + 51 + 1, add_gh + 1);
|
|
}
|
|
else
|
|
{
|
|
m_aSlotCreature[id_slot].pDead ->MovePos(x + 2, add_gh + 1);
|
|
m_aSlotCreature[id_slot].pHP ->MovePos(x + 22, add_gh + 11);
|
|
m_aSlotCreature[id_slot].pMP ->MovePos(x + 22, add_gh + 16);
|
|
|
|
m_aSlotCreature[id_slot].pMainMark->MovePos(x + 20, add_gh + 0);
|
|
m_aSlotCreature[id_slot].pDead2 ->MovePos(x + 71, add_gh + 1);
|
|
m_aSlotCreature[id_slot].pHP2 ->MovePos(x + 91, add_gh + 11);
|
|
m_aSlotCreature[id_slot].pMP2 ->MovePos(x + 91, add_gh + 16);
|
|
m_aSlotCreature[id_slot].pJob2 ->MovePos(x + 71, add_gh + 1);
|
|
}
|
|
|
|
KUIWnd* pWndCreatureZone = GetChild( CStringUtil::StringFormat( "creature_dead%02d", id_slot ).c_str() );
|
|
if(pWndCreatureZone)
|
|
{
|
|
add_gh += pWndCreatureZone->GetRect().GetHeight();
|
|
x_next_startpos = add_gh;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
m_aSlotCreature[id_slot].Show(false);
|
|
}
|
|
}
|
|
|
|
void SUIMessengerWnd::RefreshEnableSlots()
|
|
{
|
|
//OutputDebugString( "SUIMessengerWnd::RefreshEnableSlots()\n" );
|
|
|
|
if(m_nListSizeType == PARTY_UI_LIST_SIZE_REDUCE) // 2011.09.27 - servantes
|
|
{
|
|
// SetChildShow( "mark_party_leader", false );
|
|
m_pStaticLeaderMark->SetShow( false );
|
|
return ;
|
|
}
|
|
|
|
std::vector<SPlayerSlot*> vecMemberList = m_PartyMgr.GetMemberList();
|
|
|
|
int nCount = static_cast<int>( vecMemberList.size() );
|
|
if(nCount > c_nMaxLine)
|
|
nCount = c_nMaxLine;
|
|
|
|
// 파티장 아이콘 보이지 않기
|
|
//2009-05-22 : hunee
|
|
// SetChildShow( "mark_party_leader", false );
|
|
m_pStaticLeaderMark->SetShow( false );
|
|
|
|
int nIndex(0);
|
|
int nLeaderSlotID = 0;
|
|
std::vector<SPlayerSlot*>::iterator itE = vecMemberList.end();
|
|
std::vector<SPlayerSlot*>::iterator itS = vecMemberList.begin();
|
|
for( int i(0); itS != itE; itS++, i++ )
|
|
{
|
|
SPlayerSlot* pSlot = (*itS);
|
|
if(pSlot->IsLeader() == true)
|
|
{
|
|
// KUIWnd* pWnd = GetChild( CStringUtil::StringFormat( "party_name_text%02d", i ).c_str() );
|
|
// if( pWnd )
|
|
// {
|
|
// KUIWnd * pLeaderWnd = GetChild("mark_party_leader");
|
|
// if (pLeaderWnd)
|
|
// {
|
|
KRect rect = m_aSlotChar[i].pName->GetRect();
|
|
m_pStaticLeaderMark->SetShow(true);
|
|
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
|
|
m_pStaticLeaderMark->MovePos( rect.left-8, rect.top + 2);
|
|
else
|
|
m_pStaticLeaderMark->MovePos( rect.left-12, rect.top + 1);
|
|
|
|
// }
|
|
// }
|
|
|
|
//KUIWnd* pWnd = GetChild( CStringUtil::StringFormat( "party_name_text%02d", i ).c_str() );
|
|
//if( pWnd )
|
|
//{
|
|
// KUIWnd * pLeaderWnd = GetChild("mark_party_leader");
|
|
// if (pLeaderWnd)
|
|
// {
|
|
// KRect rect = pWnd->GetRect();
|
|
// pLeaderWnd->MovePos( rect.left-12, rect.top + 1);
|
|
// pLeaderWnd->SetShow(true);
|
|
// }
|
|
//}
|
|
}
|
|
|
|
if(pSlot->GetHandle() == 0) // 핸들이 없으면 로그인하지 않은 상태
|
|
{
|
|
m_bLogIn[i] = false; // 로그오프
|
|
DisableCreatureSlot( i );
|
|
}
|
|
else
|
|
{
|
|
m_bLogIn[i] = true; // 로그인
|
|
}
|
|
|
|
SetMemberData( pSlot->GetName(), i );
|
|
|
|
UpdateCreatureData_N_UI( i, pSlot->GetHandle() );
|
|
}
|
|
}
|
|
|
|
void SUIMessengerWnd::UpdateCreatureData_N_UI( int nPos, AR_HANDLE hMaster )
|
|
{
|
|
if( nPos < 0 || nPos >= c_nMaxLine ) return;
|
|
|
|
// 2010.08.30 - prodongi
|
|
/*
|
|
if( SetPlayerCreatureData( nPos, hMaster ) == false ) //크리처 등록 체크
|
|
DisableCreatureSlot( nPos ); //크리처 등록 실패 했으니 랜더링 off
|
|
else if( m_vecCreatureList[nPos].bRender == false ) //크리처 랜더링 체크
|
|
DisableCreatureSlot( nPos ); //크리처 등록은 성공하였으나 랜더링 off 옵션 체크중
|
|
else EnableCreatureSlot( nPos, true ); //등록도 성공하고 랜더링도 걸어야 하니 on
|
|
*/
|
|
SetPlayerCreatureData( nPos, hMaster );
|
|
if (m_vecCreatureList[nPos].bRender && m_vecCreatureList[nPos].bRenderUI)
|
|
{
|
|
EnableCreatureSlot(nPos, true);
|
|
EnableCreatureSlot2nd(nPos, true);
|
|
}
|
|
else
|
|
DisableCreatureSlot(nPos);
|
|
}
|
|
|
|
bool SUIMessengerWnd::GetCreature( AR_HANDLE hMaster, int nIndex, PartyCreatureInfo& rCreatureInfo )
|
|
{
|
|
if( hMaster == NULL )
|
|
return false;
|
|
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
if( m_vecCreatureList[i].hMaster == hMaster )
|
|
{
|
|
nIndex = i;
|
|
rCreatureInfo = m_vecCreatureList[i];
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
int SUIMessengerWnd::GetCreatureIndex( AR_HANDLE handle )
|
|
{
|
|
if( handle == NULL ) return -1;
|
|
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
if( m_vecCreatureList[i].hCreature1st == handle )
|
|
{
|
|
return i;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
bool SUIMessengerWnd::IsAddCreature( AR_HANDLE handle, bool bMaster/*=false*/ )
|
|
{
|
|
if( handle == NULL ) return false;
|
|
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
if( bMaster && m_vecCreatureList[i].hMaster == handle )
|
|
if( m_vecCreatureList[i].hCreature1st != NULL )
|
|
return true;
|
|
|
|
if( !bMaster && m_vecCreatureList[i].hCreature1st == handle )
|
|
if( m_vecCreatureList[i].hMaster != NULL )
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void SUIMessengerWnd::SetMemberData( const char* szName, int nPos )
|
|
{
|
|
switch(m_nTabType)
|
|
{
|
|
case TAB_PARTY:
|
|
SetPartyMemberData(szName, nPos);
|
|
break;
|
|
case TAB_GUILD:
|
|
break;
|
|
}
|
|
}
|
|
|
|
void SUIMessengerWnd::SetPartyMemberData( const char* szName, int nPos )
|
|
{
|
|
int k=0;
|
|
k=0;
|
|
SPlayerSlot* pSlot = m_PartyMgr.FindMember( szName );
|
|
if( pSlot == NULL )
|
|
return;
|
|
|
|
// m_aSlotChar[nPos].pJob->OnChagneBackNotify();
|
|
m_aSlotChar[nPos].pJob->SetIcon( c_szDEF_SPR_NAME, GetJobDB().GetJobIconName(pSlot->GetJobID()) );
|
|
m_aSlotChar[nPos].pJob->SetTooltip(NULL);
|
|
|
|
// 직업 아이디
|
|
//KUIControlIconStatic* pIcon = ( KUIControlIconStatic* )GetChild( CStringUtil::StringFormat( "party_member_job%02d", nPos ).c_str() );
|
|
//if( pIcon )
|
|
//{
|
|
// pIcon->SetIcon( c_szDEF_SPR_NAME, GetJobDB().GetJobIconName(pSlot->GetJobID()) );
|
|
// pIcon->SetTooltip(NULL);
|
|
//}
|
|
//SetChildCaption( CStringUtil::StringFormat( "party_name_text%02d", nPos ).c_str(), CStringUtil::StringFormat( "<size:10><vcenter>%s",szName ).c_str() );
|
|
|
|
/// 2011.06.23 redmine 76 파티원이 매스 HP 리제너레이션, MP 리제너레이션 효과 적용 후 로그 아웃시 파티 창 문제 - prodongi
|
|
if (pSlot->GetHandle())
|
|
{
|
|
/// 2011.08.08 - prodongi
|
|
RefreshGauge( nPos, true, pSlot->GetHP(), 100 );
|
|
RefreshGauge( nPos, false, pSlot->GetMP(), 100 );
|
|
}
|
|
}
|
|
|
|
bool SUIMessengerWnd::SetPlayerCreatureData( int nPos, AR_HANDLE hMaster )
|
|
{
|
|
if( nPos < 0 || nPos >= c_nMaxLine )
|
|
return false;
|
|
|
|
m_vecCreatureList[nPos].hMaster = hMaster;
|
|
SGameAvatarEx* pMaster = GetObject( hMaster );
|
|
// 2010.08.12 - prodongi
|
|
//if( pMaster ) m_vecCreatureList[nPos].hCreature1st = pMaster->GetCreature();
|
|
if (pMaster)
|
|
{
|
|
// 2010.08.30 이체 소환후 바로 소환 해제했을 경우 - prodongi
|
|
if (!m_vecCreatureList[nPos].bRender && !m_vecCreatureList[nPos].bRenderUI)
|
|
m_vecCreatureList[nPos].bRenderUI = true;
|
|
|
|
m_vecCreatureList[nPos].hCreature1st = pMaster->GetCreature();
|
|
m_vecCreatureList[nPos].hCreature2nd = pMaster->GetCreature();
|
|
m_vecCreatureList[nPos].bRender = true;
|
|
}
|
|
|
|
if( m_vecCreatureList[nPos].hCreature1st )
|
|
{
|
|
SGameAvatarEx* pCreature = GetObject( m_vecCreatureList[nPos].hCreature1st );
|
|
if( pCreature && pCreature->IsActivated() )
|
|
{
|
|
SetCreatureData( nPos, m_vecCreatureList[nPos].hCreature1st );
|
|
SetCreature2ndData( nPos, m_vecCreatureList[nPos].hCreature2nd );
|
|
return true;
|
|
}
|
|
else
|
|
m_vecCreatureList[nPos].hCreature1st = NULL;
|
|
}
|
|
|
|
m_vecCreatureList[nPos].bRender = false;
|
|
m_vecCreatureList[nPos].bRenderUI = false; // 2010.08.30 - prodongi
|
|
|
|
return false;
|
|
}
|
|
|
|
bool SUIMessengerWnd::SetCreatureData( int nPos, AR_HANDLE handle )
|
|
{
|
|
if( nPos < 0 || nPos >= c_nMaxLine )
|
|
return false;
|
|
|
|
// 2010.08.31 - prodongi
|
|
//SGameAvatarEx* pCreature = GetObject( handle );
|
|
SGameCreature* pCreature = (SGameCreature*)GetObject(handle);
|
|
if( pCreature == NULL )
|
|
return false;
|
|
|
|
char iconName[128];
|
|
::getEnhanceIconName(iconName, pCreature->GetContentID(), pCreature->getEnhance());
|
|
m_aSlotCreature[nPos].pJob->SetIcon(c_szDEF_SPR_NAME, iconName);
|
|
|
|
RefreshGauge( nPos, true, pCreature->GetHP(), pCreature->GetMaxHP(), true);
|
|
RefreshGauge( nPos, false, pCreature->GetMP(), pCreature->GetMaxMP(), true);
|
|
return true;
|
|
}
|
|
|
|
bool SUIMessengerWnd::SetCreature2ndData( int nPos, AR_HANDLE handle )
|
|
{
|
|
if( nPos < 0 || nPos >= c_nMaxLine )
|
|
return false;
|
|
|
|
// 2010.08.31 - prodongi
|
|
//SGameAvatarEx* pCreature = GetObject( handle );
|
|
SGameCreature* pCreature = (SGameCreature*)GetObject(handle);
|
|
if( pCreature == NULL )
|
|
return false;
|
|
|
|
char iconName[128];
|
|
::getEnhanceIconName(iconName, pCreature->GetContentID(), pCreature->getEnhance());
|
|
m_aSlotCreature[nPos].pJob2->SetIcon(c_szDEF_SPR_NAME, iconName);
|
|
|
|
RefreshGauge2nd( nPos, true, pCreature->GetHP(), pCreature->GetMaxHP(), true);
|
|
RefreshGauge2nd( nPos, false, pCreature->GetMP(), pCreature->GetMaxMP(), true);
|
|
return true;
|
|
}
|
|
|
|
bool SUIMessengerWnd::RefreshCreatureGauge( AR_HANDLE handle )
|
|
{
|
|
int nCreatureIndex = GetCreatureIndex( handle );
|
|
if( nCreatureIndex == -1 )
|
|
return false;
|
|
|
|
return SetCreatureData( nCreatureIndex, handle );
|
|
}
|
|
|
|
/// 2011.08.08 - prodongi
|
|
void SUIMessengerWnd::RefreshGauge( int nPos, bool bHP, int curValue, int maxValue, bool bCreature/*=false*/ )
|
|
{
|
|
KUIControlGauge* pWnd;
|
|
if( bCreature )
|
|
pWnd = m_aSlotCreature[nPos].pHP;
|
|
else
|
|
pWnd = m_aSlotChar[nPos].pHP;
|
|
|
|
int per = static_cast<int>(m_pDisplayInfo->GetPercent(curValue, maxValue));
|
|
m_pDisplayInfo->RefreshGaugeAndStatic( pWnd, curValue, maxValue, per, DEFAULT_GAUGE_ANI_TIME );
|
|
pWnd->ReSizeBackGround();
|
|
|
|
if( bHP )
|
|
{
|
|
/// 2010.11.24 - prodongi
|
|
if( per > 50 )
|
|
{
|
|
if( stricmp( pWnd->GetAniName(), "common_gauge_titanium_player_hp100_himini" ) != 0 )
|
|
pWnd->SetBack( c_szDEF_SPR_NAME, "common_gauge_titanium_player_hp100_himini" );
|
|
}
|
|
else if( per > 20 )
|
|
{
|
|
if( stricmp( pWnd->GetAniName(), "common_gauge_titanium_player_hp50_himini" ) != 0 )
|
|
pWnd->SetBack( c_szDEF_SPR_NAME, "common_gauge_titanium_player_hp50_himini" );
|
|
}
|
|
else
|
|
{
|
|
if( stricmp( pWnd->GetAniName(), "common_gauge_titanium_player_hp20_himini" ) != 0 )
|
|
pWnd->SetBack( c_szDEF_SPR_NAME, "common_gauge_titanium_player_hp20_himini" );
|
|
}
|
|
|
|
KUIWnd* pDeadWnd;
|
|
if( bCreature )
|
|
pDeadWnd = m_aSlotCreature[nPos].pDead;
|
|
else
|
|
pDeadWnd = m_aSlotChar[nPos].pDead;
|
|
if( pDeadWnd )
|
|
{
|
|
if( nPos>=0 && nPos<SLOT_MAXLINE && !m_bLogIn[nPos] )
|
|
pDeadWnd->SetShow(per<=0);
|
|
else
|
|
pDeadWnd->SetShow(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
void SUIMessengerWnd::RefreshGauge2nd( int nPos, bool bHP, int curValue, int maxValue, bool bCreature/*=false*/ )
|
|
{
|
|
KUIControlGauge* pWnd;
|
|
if( bCreature )
|
|
pWnd = m_aSlotCreature[nPos].pHP2;
|
|
else
|
|
pWnd = m_aSlotChar[nPos].pHP;
|
|
|
|
int per = static_cast<int>(m_pDisplayInfo->GetPercent(curValue, maxValue));
|
|
m_pDisplayInfo->RefreshGaugeAndStatic( pWnd, curValue, maxValue, per, DEFAULT_GAUGE_ANI_TIME );
|
|
pWnd->ReSizeBackGround();
|
|
|
|
if( bHP )
|
|
{
|
|
/// 2010.11.24 - prodongi
|
|
if( per > 50 )
|
|
{
|
|
if( stricmp( pWnd->GetAniName(), "common_gauge_titanium_player_hp100_himini" ) != 0 )
|
|
pWnd->SetBack( c_szDEF_SPR_NAME, "common_gauge_titanium_player_hp100_himini" );
|
|
}
|
|
else if( per > 20 )
|
|
{
|
|
if( stricmp( pWnd->GetAniName(), "common_gauge_titanium_player_hp50_himini" ) != 0 )
|
|
pWnd->SetBack( c_szDEF_SPR_NAME, "common_gauge_titanium_player_hp50_himini" );
|
|
}
|
|
else
|
|
{
|
|
if( stricmp( pWnd->GetAniName(), "common_gauge_titanium_player_hp20_himini" ) != 0 )
|
|
pWnd->SetBack( c_szDEF_SPR_NAME, "common_gauge_titanium_player_hp20_himini" );
|
|
}
|
|
|
|
KUIWnd* pDeadWnd;
|
|
if( bCreature )
|
|
pDeadWnd = m_aSlotCreature[nPos].pDead2;
|
|
else
|
|
pDeadWnd = m_aSlotChar[nPos].pDead;
|
|
if( pDeadWnd )
|
|
{
|
|
if( nPos>=0 && nPos<SLOT_MAXLINE && !m_bLogIn[nPos] )
|
|
pDeadWnd->SetShow(per<=0);
|
|
else
|
|
pDeadWnd->SetShow(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
void SUIMessengerWnd::EnableSlot( int nPos, bool bShow )
|
|
{
|
|
m_aSlotChar[nPos].Show(bShow);
|
|
}
|
|
|
|
// 2011.09.15 - servantes : EnableCreatureSlot2nd 함수 추가 : 두번째 크리처도 표기해야 한다
|
|
void SUIMessengerWnd::EnableCreatureSlot( int nPos, bool bShow )
|
|
{
|
|
m_aSlotCreature[nPos].Show(bShow, 0);
|
|
}
|
|
void SUIMessengerWnd::EnableCreatureSlot2nd( int nPos, bool bShow )
|
|
{
|
|
m_aSlotCreature[nPos].Show(bShow, 1);
|
|
}
|
|
|
|
int SUIMessengerWnd::GetPartyType() // 2011.09.19 : servantes : 파티 타입 얻기
|
|
{
|
|
return m_nPartyType;
|
|
}
|
|
|
|
void SUIMessengerWnd::SetPartyType(int party_type) // 2011.09.19 : servantes : 파티 타입 설정 및 NUI 변경
|
|
{
|
|
m_pStaticPartyMarkBearLoad->SetShow(false);
|
|
m_pStaticPartyMarkSeige->SetShow(false);
|
|
m_pStaticPartyMarkSeigeOther->SetShow(false);
|
|
|
|
KRect rt = m_pStaticPartyMarkNormal->GetRect();
|
|
|
|
// 마크 표시
|
|
if (party_type == PARTY_SIEGE) // 공격대
|
|
{
|
|
m_pStaticPartyMarkSeige->SetShow(true);
|
|
m_pStaticPartyMarkSeige->MovePos(rt.left, rt.top);
|
|
|
|
m_pStaticPartyMarkNormal->SetShow(false);
|
|
m_pStaticPartyMarkBearLoad->SetShow(false);
|
|
m_pStaticPartyMarkSeigeOther->SetShow(false);
|
|
}
|
|
else if(party_type == PARTY_BEARROAD) // 베어로드(헌터홀릭)
|
|
{
|
|
m_pStaticPartyMarkBearLoad->SetShow(true);
|
|
m_pStaticPartyMarkBearLoad->MovePos(rt.left, rt.top);
|
|
|
|
m_pStaticPartyMarkNormal->SetShow(false);
|
|
m_pStaticPartyMarkSeige->SetShow(false);
|
|
m_pStaticPartyMarkSeigeOther->SetShow(false);
|
|
}
|
|
else if(party_type == PARTY_SIEGE_OTHER) // 공격대(다른 파티들)
|
|
{
|
|
m_pStaticPartyMarkSeigeOther->SetShow(true);
|
|
m_pStaticPartyMarkSeigeOther->MovePos(rt.left, rt.top);
|
|
|
|
m_pStaticPartyMarkNormal->SetShow(false);
|
|
m_pStaticPartyMarkSeige->SetShow(false);
|
|
m_pStaticPartyMarkBearLoad->SetShow(false);
|
|
}
|
|
else // 일반파티 // 던전 레이드
|
|
{
|
|
m_pStaticPartyMarkNormal->SetShow(true);
|
|
m_pStaticPartyMarkNormal->MovePos(rt.left, rt.top);
|
|
|
|
m_pStaticPartyMarkSeigeOther->SetShow(false);
|
|
m_pStaticPartyMarkSeige->SetShow(false);
|
|
m_pStaticPartyMarkBearLoad->SetShow(false);
|
|
}
|
|
|
|
switch(party_type)
|
|
{
|
|
case PARTY_NORMAL: // 일반파티 //2011.09.22
|
|
case PARTY_DUNGEON_RAID: // 던전 레이드
|
|
case PARTY_SIEGE: // 공격대
|
|
case PARTY_BEARROAD: // 베어로드(헌터홀릭)
|
|
{
|
|
m_nPartyType = party_type;
|
|
|
|
KRect rt = m_pBtnClose->GetRect();
|
|
m_pBtnClose->SetShow(false);
|
|
m_pBtnSubOption->SetShow(true);
|
|
|
|
if(m_nListSizeType == PARTY_UI_LIST_SIZE_EXTEND) // 리스트를 편 상태
|
|
{
|
|
m_pBtnMinimize->MovePos(rt.left, rt.top);
|
|
m_pBtnMinimize->SetShow(true);
|
|
m_pBtnMaximize->SetShow(false);
|
|
}
|
|
else // 리스트를 접은 상태
|
|
{
|
|
m_pBtnMaximize->MovePos(rt.left, rt.top);
|
|
m_pBtnMaximize->SetShow(true);
|
|
m_pBtnMinimize->SetShow(false);
|
|
}
|
|
|
|
if(m_nPartyType == PARTY_DUNGEON_RAID) // 던전 레이드
|
|
{
|
|
m_nPartyType = party_type;
|
|
}
|
|
else if(m_nPartyType == PARTY_SIEGE) // 공격대
|
|
{
|
|
m_nPartyType = party_type;
|
|
}
|
|
else if(m_nPartyType == PARTY_BEARROAD) // 베어로드(헌터홀릭)
|
|
{
|
|
m_nPartyType = party_type;
|
|
|
|
m_pBtnMinimize->MovePos(rt.left, rt.top);
|
|
m_pBtnMinimize->SetShow(true);
|
|
m_pBtnMaximize->SetShow(false);
|
|
}
|
|
break;
|
|
}
|
|
case PARTY_SIEGE_OTHER: // 공격대(다른 파티들)
|
|
{
|
|
m_nPartyType = party_type;
|
|
|
|
KRect rt = m_pBtnClose->GetRect();
|
|
m_pBtnClose->SetShow(true);
|
|
m_pBtnSubOption->SetShow(false);
|
|
|
|
if(m_nListSizeType == PARTY_UI_LIST_SIZE_EXTEND) // 리스트를 편 상태
|
|
{
|
|
m_pBtnMinimize->MovePos(rt.left - rt.GetWidth(), rt.top);
|
|
m_pBtnMinimize->SetShow(true);
|
|
m_pBtnMaximize->SetShow(false);
|
|
}
|
|
else // 리스트를 접은 상태
|
|
{
|
|
m_pBtnMaximize->MovePos(rt.left - rt.GetWidth(), rt.top);
|
|
m_pBtnMaximize->SetShow(true);
|
|
m_pBtnMinimize->SetShow(false);
|
|
}
|
|
|
|
if(m_nPartyType == PARTY_DUNGEON_RAID) // 던전 레이드
|
|
{
|
|
m_nPartyType = party_type;
|
|
}
|
|
else if(m_nPartyType == PARTY_SIEGE) // 공격대
|
|
{
|
|
m_nPartyType = party_type;
|
|
}
|
|
break;
|
|
}
|
|
default: // error
|
|
m_nPartyType = -1;
|
|
break;
|
|
}
|
|
}
|
|
|
|
void SUIMessengerWnd::SetUpClickDragRect() // 2011.09.19 : servantes : UI 영역 재설정
|
|
{
|
|
// 파티인원 X 리스트컨트롤 높이 만큼 영역 설정
|
|
/* std::vector<SPlayerSlot*> vecMemberList = m_PartyMgr.GetMemberList();
|
|
int sz = vecMemberList.size();
|
|
int nlistItemH = 0;
|
|
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL) // 작은 상태이면
|
|
{
|
|
if(m_nListSizeType == PARTY_UI_LIST_SIZE_REDUCE) //리스트를 접은 상태이면 : 2011.09.27 - servantes
|
|
sz = 0;
|
|
else
|
|
{
|
|
int x=0;
|
|
std::vector<SPlayerSlot*> memberlist = m_PartyMgr.GetMemberList();
|
|
std::vector<SPlayerSlot*>::iterator itE = memberlist.end();
|
|
std::vector<SPlayerSlot*>::iterator itS = memberlist.begin();
|
|
for(; itS != itE; itS++, x++)
|
|
{
|
|
SPlayerSlot* pSlot = (*itS);
|
|
if(pSlot->GetCreature(x))
|
|
nlistItemH += 20;
|
|
}
|
|
}
|
|
|
|
int tw = 97; // 작을 때 UI 폭
|
|
int th1 = 17; // UI 시작부터 최대, 최소화, 끄기 버튼의 높이
|
|
int th2 = 23; // 타이틀바 크기
|
|
int tL1 = 22; // 리스트 컨트롤의 리스트 레이블 한 개의 높이
|
|
int tL2 = (tL1 * sz) + nlistItemH; // 파티 인원 X 리스트 컨트롤의 리스트 레이블 한 개의 높이
|
|
KRect rt2 = this->GetRect();
|
|
KRect rt(rt2.left, rt2.top, rt2.left + tw, rt2.top + tL2 + th1 + th2);
|
|
SetRect(rt);
|
|
Resize(rt);
|
|
}
|
|
else // 큰 상태이면
|
|
{
|
|
if(m_nListSizeType == PARTY_UI_LIST_SIZE_REDUCE) //리스트를 접은 상태이면 : 2011.09.27 - servantes
|
|
sz = 0;
|
|
else
|
|
{
|
|
int x=0;
|
|
std::vector<SPlayerSlot*> memberlist = m_PartyMgr.GetMemberList();
|
|
std::vector<SPlayerSlot*>::iterator itE = memberlist.end();
|
|
std::vector<SPlayerSlot*>::iterator itS = memberlist.begin();
|
|
for(; itS != itE; itS++, x++)
|
|
{
|
|
SPlayerSlot* pSlot = (*itS);
|
|
if(pSlot->GetCreature(x))
|
|
nlistItemH += 14;
|
|
}
|
|
}
|
|
|
|
int tw = 138; // 클을 때 UI 폭
|
|
int th1 = 17; // UI 시작부터 최대, 최소화, 끄기 버튼의 높이
|
|
int th2 = 18; // 타이틀바 크기
|
|
int tL1 = 30; // 리스트 컨트롤의 리스트 레이블 한 개의 높이
|
|
int tL2 = (tL1 * sz) + nlistItemH; // 파티 인원 X 리스트 컨트롤의 리스트 레이블 한 개의 높이
|
|
KRect rt2 = this->GetRect();
|
|
KRect rt(rt2.left, rt2.top, rt2.left + tw, rt2.top + tL2 + th1 + th2);
|
|
SetRect(rt);
|
|
Resize(rt);
|
|
}*/
|
|
}
|
|
|
|
void SUIMessengerWnd::ChangeVisibleMinimizeManimizeButtom(int nToBeState)
|
|
{
|
|
if (nToBeState == TO_BE_MIN)
|
|
{
|
|
KRect rt = m_pBtnClose->GetRect();
|
|
|
|
if(m_nPartyType == PARTY_SIEGE_OTHER)
|
|
{
|
|
m_pBtnSubOption->SetShow(false);
|
|
m_pBtnClose->SetShow(true);
|
|
m_pBtnMinimize->SetShow(false);
|
|
m_pBtnMaximize->MovePos(rt.left - rt.GetWidth(), rt.top);
|
|
m_pBtnMaximize->SetShow(true);
|
|
}
|
|
else
|
|
{
|
|
m_pBtnSubOption->SetShow(true);
|
|
m_pBtnClose->SetShow(false);
|
|
m_pBtnMinimize->SetShow(false);
|
|
m_pBtnMaximize->MovePos(rt.left, rt.top);
|
|
m_pBtnMaximize->SetShow(true);
|
|
}
|
|
}
|
|
else if(nToBeState == TO_BE_MAX)
|
|
{
|
|
KRect rt = m_pBtnClose->GetRect();
|
|
|
|
if(m_nPartyType == PARTY_SIEGE_OTHER)
|
|
{
|
|
m_pBtnSubOption->SetShow(false);
|
|
m_pBtnClose->SetShow(true);
|
|
m_pBtnMaximize->SetShow(false);
|
|
m_pBtnMinimize->MovePos(rt.left - rt.GetWidth(), rt.top);
|
|
m_pBtnMinimize->SetShow(true);
|
|
}
|
|
else
|
|
{
|
|
m_pBtnSubOption->SetShow(true);
|
|
m_pBtnClose->SetShow(false);
|
|
m_pBtnMaximize->SetShow(false);
|
|
m_pBtnMinimize->MovePos(rt.left, rt.top);
|
|
m_pBtnMinimize->SetShow(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
void SUIMessengerWnd::SetListSizeType(int type) // 2011.09.19 : servantes : 리스트 크기 타입
|
|
{
|
|
int k=0;
|
|
k=0;
|
|
k=1;
|
|
m_nListSizeType = type;
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
|
|
{
|
|
if(m_nListSizeType == PARTY_UI_LIST_SIZE_EXTEND)
|
|
{
|
|
// UI 컨트롤 재배치
|
|
// 영역재설정
|
|
int k=0;
|
|
}
|
|
else
|
|
{
|
|
// UI 컨트롤 재배치
|
|
// 영역재설정
|
|
int k=0;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(m_nListSizeType == PARTY_UI_LIST_SIZE_EXTEND)
|
|
{
|
|
// UI 컨트롤 재배치
|
|
// 영역재설정
|
|
int k=0;
|
|
}
|
|
else
|
|
{
|
|
// UI 컨트롤 재배치
|
|
// 영역재설정
|
|
int k=0;
|
|
}
|
|
}
|
|
}
|
|
|
|
void SUIMessengerWnd::SetSiegeUIType(int type) // 2011.09.19 : servantes : 공격대 UI 타입
|
|
{
|
|
m_nSiegeUIType = type;
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
|
|
{
|
|
// UI 컨트롤 재배치
|
|
int k=0;
|
|
}
|
|
else
|
|
{
|
|
// UI 컨트롤 재배치
|
|
int k=0;
|
|
}
|
|
}
|
|
|
|
void SUIMessengerWnd::SendUIMessage(SGameMessage* pMsg) // 2011.10.05 : servantes : 메세지 처리 함수
|
|
{
|
|
if(NULL == pMsg)
|
|
return ;
|
|
|
|
switch(pMsg->nType)
|
|
{
|
|
case IMSG_UI_SEND_DATA:
|
|
{
|
|
SIMSG_UI_SEND_DATA *pData = (SIMSG_UI_SEND_DATA *)pMsg;
|
|
if( pData->m_strString == "select_member_request_trade" )
|
|
{
|
|
if(m_hSelectMember)
|
|
{
|
|
SGameAvatarEx* pTarget = (SGameAvatarEx*)m_pGameManager->GetActiveGame()->GetGameObject(m_hSelectMember);
|
|
if( pTarget && pTarget->GetObjType() == TS_ENTER::GAME_PLAYER )
|
|
{
|
|
m_pGameManager->GetActiveGame()->SendGameInterfaceMsg( &SIMSG_UI_DISPLAY_SYS_MSG( SYS_MSG_TRADE_REQUEST ) ); //거래 신청
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// 파티정보
|
|
//////////////////////////////////////////////////////////////////////////
|
|
void SUIMessengerWnd::RefreshPartyInfo()
|
|
{
|
|
// 분배 방식
|
|
int nDivision = -1;
|
|
if( m_nTabType == TAB_PARTY )
|
|
nDivision = m_PartyMgr.GetDivision();
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// 선택
|
|
//////////////////////////////////////////////////////////////////////////
|
|
void SUIMessengerWnd::SelectMember( int nPos )
|
|
{
|
|
m_nSelectIndex = nPos;
|
|
m_nSelectCreatureIndex = -1;
|
|
|
|
AR_HANDLE hPlayer = GetHandle(nPos);
|
|
if( !hPlayer )
|
|
{
|
|
KUIWnd* pWnd = GetChild( CStringUtil::StringFormat( "party_name_text%02d", nPos ).c_str() );
|
|
std::string strTemp;
|
|
if( pWnd )
|
|
strTemp = pWnd->GetCaption();
|
|
|
|
XStringUtil::Replace( strTemp, "<size:9><hcenter><vcenter>", "" ); // 2011.10.05 : servantes : 캡션 내용 교체되어 바꿈
|
|
|
|
m_strSelectMember = strTemp;
|
|
|
|
SPlayerSlot * pSlot = m_PartyMgr.FindMember( m_strSelectMember.c_str() );
|
|
|
|
if( !pSlot || !pWnd || strTemp.empty() )
|
|
{
|
|
UnSelect();
|
|
return;
|
|
}
|
|
m_hSelectMember = pSlot->GetHandle(); // 2011.10.05 : servantes : 선택한 멤버 핸들 얻기
|
|
}
|
|
|
|
|
|
KUIWnd* pInframe = GetChild( CStringUtil::StringFormat( "select_zone%02d", nPos ).c_str() );
|
|
if( pInframe )
|
|
{
|
|
const KRect& rIconRect = pInframe->GetRect();
|
|
|
|
KUIWnd* pClick = GetChild( "select_mouseclick" );
|
|
if( pClick )
|
|
{
|
|
pClick->MovePos( pClick->GetRect().left, rIconRect.top );
|
|
pClick->SetShow(true);
|
|
}
|
|
}
|
|
|
|
////근방 또는 로그인 되어 있으면, 타겟
|
|
//if( hPlayer )
|
|
//{
|
|
// // 타겟 요청
|
|
// SIMSG_UI_ACT_TARGET* pMsg = new SIMSG_UI_ACT_TARGET;
|
|
// pMsg->m_nTargetHandle = hPlayer;
|
|
|
|
// //멀리 있는 로그인된 파티원에게 아이템 사용 가능
|
|
// m_pDisplayInfo->SetPartyTarget( pMsg->m_nTargetHandle );
|
|
|
|
// m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
//}
|
|
}
|
|
void SUIMessengerWnd::SelectCreatureMember( int nPos )
|
|
{
|
|
if( nPos < 0 || nPos >= c_nMaxLine ) return;
|
|
|
|
m_nSelectCreatureIndex = nPos;
|
|
m_nSelectIndex = -1;
|
|
|
|
KUIWnd* pInframe = GetChild( CStringUtil::StringFormat( "click_check%02d", nPos ).c_str() );
|
|
if( pInframe )
|
|
{
|
|
const KRect& rIconRect = pInframe->GetRect();
|
|
|
|
KUIWnd* pClick = GetChild( "creature_mouseclick" );
|
|
if( pClick )
|
|
{
|
|
pClick->MovePos( pClick->GetRect().left, rIconRect.top );
|
|
pClick->SetShow(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
void SUIMessengerWnd::RefreshSelectMember( AR_HANDLE hPlayer, const char* szPlayer )
|
|
{
|
|
//OutputDebugString( "SUIMessengerWnd::RefreshSelectMember()\n" );
|
|
|
|
SetChildShow( "party_select_normal" );
|
|
|
|
if( !IsShow() ) return;
|
|
|
|
UnSelect();
|
|
|
|
// if( hPlayer == NULL )
|
|
// return;
|
|
|
|
// 현재 선택 된 파티원이 있고, 타겟이 설정이 안된 경우
|
|
// 선택 된 파티원으로 타겟 설정. kappamind, 2010.01.14
|
|
if( hPlayer == NULL )
|
|
{
|
|
if( ! m_PartyMgr.GetSelectMemberHandle() )
|
|
return;
|
|
|
|
hPlayer = m_PartyMgr.GetSelectMemberHandle();
|
|
}
|
|
|
|
KUIWnd* pClick(NULL);
|
|
for( int i = 0; i < c_nMaxLine; i++ )
|
|
{
|
|
if( hPlayer == GetHandle(i) )
|
|
{
|
|
m_nSelectIndex = i;
|
|
SelectMember(i);
|
|
return;
|
|
}
|
|
}
|
|
|
|
int nCreatureIndex = GetCreatureIndex( hPlayer );
|
|
if( nCreatureIndex != -1 )
|
|
{
|
|
if( m_vecCreatureList[nCreatureIndex].bRender == false )
|
|
return;
|
|
|
|
// sonador 7.0.22 Mantis 0002774: [타겟] tab키를 이용한 타겟설정 시 문제점
|
|
if( !m_PartyMgr.IsExistMember( m_vecCreatureList[ nCreatureIndex ].hMaster ) )
|
|
return;
|
|
|
|
m_nSelectCreatureIndex = nCreatureIndex;
|
|
SelectCreatureMember( nCreatureIndex );
|
|
return;
|
|
}
|
|
|
|
if( szPlayer )
|
|
{
|
|
int nIndex = GetSlotIndex( szPlayer );
|
|
if( nIndex != -1 )
|
|
{
|
|
m_nSelectIndex = nIndex;
|
|
SelectMember(nIndex);
|
|
}
|
|
}
|
|
}
|
|
|
|
AR_HANDLE SUIMessengerWnd::GetHandle( int nPos )
|
|
{
|
|
KUIWnd* pWnd = GetChild( CStringUtil::StringFormat( "party_name_text%02d", nPos ).c_str() );
|
|
|
|
if( pWnd == NULL ) return NULL;
|
|
//if( m_nTabType == TAB_PARTY ) return NULL;
|
|
if( !pWnd->IsShow() ) return NULL;
|
|
|
|
std::string strTemp = pWnd->GetCaption();
|
|
XStringUtil::Replace( strTemp, "<size:10><vcenter>", "" );
|
|
|
|
return m_PartyMgr.GetMemberHandle( strTemp.c_str() );
|
|
}
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// 공통
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
void SUIMessengerWnd::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 SUIMessengerWnd::RequestGuildJoinAccept()
|
|
{
|
|
//std::string strText = SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_INVITE_CHECK), "#@guild_name@#", m_GuildMgr.GetCommunityName(), "#@user_name@#", m_GuildMgr.GetMessage() );
|
|
std::string strText = SStringDB::ParseString( S( 1908 ), "#@user_name@#", m_GuildMgr.GetMessage(), "#@guild_name@#", m_GuildMgr.GetCommunityName() );
|
|
SIMSG_REQ_OPEN_MSGBOX msg( SIMSG_REQ_OPEN_MSGBOX::MSGBOX_GUILDJOINCHECK, strText.c_str(), true );
|
|
m_pGameManager->ProcMsgAtStatic( &msg );
|
|
}
|
|
|
|
void SUIMessengerWnd::RequestRaidGuildJoinAccept()
|
|
{
|
|
std::string strText = SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_PARTY_INVITE_CHECK), "#@party_name@#", m_RaidMgr.GetPartyName(), "#@user_name@#", m_RaidMgr.GetPartyManagerName() );
|
|
SIMSG_REQ_OPEN_MSGBOX msg( SIMSG_REQ_OPEN_MSGBOX::MSGBOX_RAID_GUILD_INVITE, strText.c_str(), true );
|
|
m_pGameManager->ProcMsgAtStatic( &msg );
|
|
}
|
|
|
|
void SUIMessengerWnd::RequestRaidMercenaryJoinAccept()
|
|
{
|
|
std::string strText = SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_MERCENARY_PARTY_INVITE_CHECK), "#@party_name@#", m_RaidMgr.GetMercenaryPartyName(), "#@user_name@#", m_RaidMgr.GetMercenaryPartyManagerName() );
|
|
SIMSG_REQ_OPEN_MSGBOX msg( SIMSG_REQ_OPEN_MSGBOX::MSGBOX_RAID_MERCENARY_INVITE, strText.c_str(), true );
|
|
m_pGameManager->ProcMsgAtStatic( &msg );
|
|
}
|
|
|
|
int SUIMessengerWnd::GetSlotIndex( const char * szPlayer )
|
|
{
|
|
for( int i = 0; i < c_nMaxLine; i++ )
|
|
{
|
|
KUIWnd* pWnd = GetChild( CStringUtil::StringFormat( "party_name_text%02d", i ).c_str() );
|
|
std::string strTemp;
|
|
if( pWnd )
|
|
strTemp = pWnd->GetCaption();
|
|
|
|
XStringUtil::Replace( strTemp, "<size:10><vcenter>", "" );
|
|
if( !_stricmp( strTemp.c_str(), szPlayer ) )
|
|
{
|
|
return i;
|
|
}
|
|
}
|
|
|
|
return -1;
|
|
}
|
|
|
|
void SUIMessengerWnd::RefreshOnLine()
|
|
{
|
|
//OutputDebugString( "SUIMessengerWnd::RefreshOnLine()\n" );
|
|
|
|
std::vector<SPlayerSlot*>& vecMemberList = m_PartyMgr.GetMemberList();
|
|
std::vector<SPlayerSlot*>::const_iterator it = vecMemberList.begin();
|
|
int nCount = static_cast<int>( vecMemberList.size() );
|
|
|
|
for( int i(0); c_nMaxLine>i; i++ )
|
|
{
|
|
if( i < nCount )
|
|
{
|
|
if(m_bLogIn[i] == true)
|
|
m_aSlotChar[i].pLogOff->SetShow(false);
|
|
else
|
|
m_aSlotChar[i].pLogOff->SetShow(true);
|
|
}
|
|
else
|
|
{
|
|
m_aSlotChar[i].pLogOff->SetShow(false);
|
|
}
|
|
}
|
|
|
|
//for( int i(0); c_nMaxLine>i; i++ )
|
|
//{
|
|
// if( i < nCount )
|
|
// SetChildShow( CStringUtil::StringFormat( "select_logoff%02d", i ).c_str(), !m_bLogIn[i] );
|
|
// else
|
|
// SetChildShow( CStringUtil::StringFormat( "select_logoff%02d", i ).c_str(), false );
|
|
//}
|
|
}
|
|
|
|
void SUIMessengerWnd::OutputPartyText( const char* szText )
|
|
{
|
|
std::vector<std::string> vecText;
|
|
|
|
MsgSplit( szText, vecText, L"|" );
|
|
|
|
size_t nTextSize = vecText.size();
|
|
|
|
if( nTextSize <= 0 ) return;
|
|
|
|
const char* szKeyword = vecText[0].c_str();
|
|
|
|
if( 0 == ::_stricmp( szKeyword, "TAKE_ITEM" ) )
|
|
{
|
|
if( nTextSize < 6 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
// 임시 .. 자기 자신에게도 메시지가 오므로 일단 여기서 이름으로 체크하여 막는다 .. 추후에 서버에서 아예 안보내도록 수정될 예정 ...
|
|
if( ::_stricmp( vecText[1].c_str(), m_PlayerInfoMgr.GetPlayerInfo().GetName() ) != 0 )
|
|
{
|
|
int nItemID = ::atoi( vecText[2].c_str() );
|
|
|
|
// 임시 !!!!! GetItemName() 마지막 파라미터로 xFlag가 추가되었다 .... 서버에서 보내달라고 요청해야한다 .. !!!!!!
|
|
std::string strItemName = m_pDisplayInfo->GetItemName( nItemID, true,
|
|
unsigned char( ::atoi(vecText[4].c_str()) ), unsigned char( ::atoi(vecText[3].c_str()) ) );
|
|
|
|
int nRank = GetItemDB().GetItemRank( nItemID );
|
|
std::string strItemColor = m_pDisplayInfo->GetItemColor( nRank );
|
|
XStringUtil::Format( strItemName, "%s%s<#fdddb0>", strItemColor.c_str(), strItemName.c_str() );
|
|
|
|
if( GetItemDB().IsJoin( nItemID ) )
|
|
{
|
|
std::string strItemCnt;
|
|
XStringUtil::Format( strItemCnt, "%s%s<#fdddb0>", strItemColor.c_str(), vecText[5].c_str() );
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_NOTICE_GET_ITEM_NUMBER, vecText[1].c_str(), strItemName.c_str(), strItemCnt.c_str() );
|
|
}
|
|
else
|
|
{
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_NOTICE_GET_ITEM, vecText[1].c_str(), strItemName.c_str() );
|
|
}
|
|
}
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "KICK" ) )
|
|
{
|
|
if( nTextSize < 3 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
if( m_PartyMgr.IsExist() )
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_BAN_NOTICE, vecText[2].c_str() );
|
|
else // TODO : 시스템 메시지 필요함
|
|
{
|
|
if( IsShow() )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, false ) );
|
|
|
|
int nGroupID = GetStringDB().GetGroupID( S(-206) );
|
|
m_pDisplayInfo->AddSystemMessage( SR( -206, "#@party_name@#", m_PartyMgr.GetPartyName() ).c_str(), nGroupID );
|
|
}
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "LOGIN" ) )
|
|
{
|
|
if( nTextSize < 3 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_NOTICE_MEMBER_LOGIN, vecText[2].c_str() );
|
|
}
|
|
else if( ::_stricmp( szKeyword, "NEW" ) == 0 )
|
|
{
|
|
if( nTextSize < 2 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_JOIN_MEMBER_NOTICE, vecText[1].c_str() );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "PROMOTE" ) )
|
|
{
|
|
if( nTextSize < 2 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_NEW_READER, vecText[1].c_str() );
|
|
}
|
|
|
|
else if( 0 == ::_stricmp( szKeyword, "LEAVE" ) )
|
|
{
|
|
if( m_PartyMgr.IsExist() )
|
|
{
|
|
if( nTextSize < 2 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_LEAVE_NOTICE, vecText[1].c_str() );
|
|
}
|
|
else
|
|
{
|
|
if( IsShow() )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, false ) );
|
|
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_LEAVE );
|
|
}
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "LOGOUT" ) )
|
|
{
|
|
if( nTextSize < 2 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_NOTICE_MEMBER_LOGOUT, vecText[1].c_str() );
|
|
}
|
|
|
|
else if( 0 == ::_stricmp( szKeyword, "TAMING_START" ) )
|
|
{
|
|
if( nTextSize < 2 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_CREATURE_TAME_SUCCESS, vecText[1].c_str() );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "TAMING_SUCCESS" ) )
|
|
{
|
|
if( nTextSize < 2 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_CREATURE_TAME_SUCCESS_BONUS, vecText[1].c_str() );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "TAMING_FAILED" ) )
|
|
{
|
|
if( nTextSize < 2 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_CREATURE_TAME_DISAPPEAR, vecText[1].c_str() );
|
|
}
|
|
else if( ::_stricmp( szKeyword, "MODE" ) == 0 )
|
|
{
|
|
if( nTextSize < 2 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
int nItemMode = ::atoi( vecText[1].c_str() );
|
|
//0:각자, 1:분배, 2:순차
|
|
if( nItemMode == 0 )
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_NOTICE_ITEM_RULE_PRIVATE );
|
|
else if( nItemMode == 1 )
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_NOTICE_ITEM_RULE_RANDOM );
|
|
else if( nItemMode == 2 )
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_NOTICE_ITEM_RULE_LINEAR );
|
|
}
|
|
else if( ::_stricmp( szKeyword, "CREATE" ) == 0 )
|
|
{
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_SETUP );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, true ) );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "JOIN" ) )
|
|
{
|
|
if( !IsShow() )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, true ) );
|
|
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_JOIN_MEMBER );
|
|
}
|
|
|
|
else if( 0 == ::_stricmp( szKeyword, "DESTROY" ) )
|
|
{
|
|
if( IsShow() )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, false ) );
|
|
|
|
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_BREAK );
|
|
}
|
|
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_ALREADY_PARTY_MEMBER" ) ) m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_CANT_SETUP );
|
|
else if( 0 == ::_stricmp( szKeyword, "INVALID_PARTY_NAME" ) ) m_pDisplayInfo->SetSysMsg( SYS_MSG_PARTY_WRONGSTR );
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_MAX" ) ) m_pDisplayInfo->AddSystemMessage( S(-207), GetStringDB().GetGroupID(-207) );
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_TARGET_ANOTHER" ) ) m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_ALREADY_OTHER_MEMBER );
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_YOU_CAN_JOIN_ONLY_ONE_PARTY" ) ) m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_ALREADY_OTHER_MEMBER );
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_INVALID_PARTY" ) ) m_pDisplayInfo->AddSystemMessage( S(-208), GetStringDB().GetGroupID(-208) );
|
|
else if( 0 == ::_stricmp( szKeyword, "ALREADY_EXIST" ) ) m_pDisplayInfo->SetSysMsg( SYS_MSG_NAME_DUPLICATE );
|
|
else if( 0 == ::_stricmp( szKeyword, "INVITE" ) ) RequestPartyJoinAccept();
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_PKRULE" ) ) m_pDisplayInfo->AddSystemMessage( S(1652) ); // PK On 상태일때 거부 메세지
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_IN_DEATHMATCH" ) ) m_pDisplayInfo->AddSystemMessage( S(9200) );
|
|
#ifdef _INSTANCE_DUNGEON_
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_IN_INSTANCE_DUNGEON" ) ) m_pDisplayInfo->AddSystemMessage( S(SYS_MSG_INVALID_ACT_IN_DUN) ); /// 2011.07.20 - prodongi
|
|
#endif
|
|
|
|
vecText.clear();
|
|
|
|
// RefreshSelectMember( m_PlayerInfoMgr.GetTarget(), m_PlayerInfoMgr.GetTargetName() );
|
|
}
|
|
|
|
void SUIMessengerWnd::OutputRaidText( const char* szText )
|
|
{
|
|
std::vector<std::string> vecText;
|
|
MsgSplit( szText, vecText, L"|" );
|
|
|
|
if( vecText.size() < 1 ) return;
|
|
|
|
const char* szKeyword = vecText[0].c_str();
|
|
|
|
std::string strMsg; strMsg.clear();
|
|
// std::string strPartyMsg = m_GuildMgr.GetMessage();
|
|
|
|
int nGroup = -1;
|
|
//if( 0 == ::_stricmp( szKeyword, "RAID_INFO" ) )
|
|
if( 0 == ::_stricmp( szKeyword, "RAID_GUILD_INVITE" ) ) RequestRaidGuildJoinAccept();
|
|
else if( 0 == ::_stricmp( szKeyword, "RAID_MERCENARY_INVITE" ) ) RequestRaidMercenaryJoinAccept();
|
|
|
|
//공대 생성 관련 에러 메세지
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_NOT_GUILD_LEADER" ) ) //길드장 아님
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_ERROR_NOT_GUILD_LEADER);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_RAID_ERROR_NOT_GUILD_LEADER );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_NOT_RAID_GUILD" ) ) //레이드 신청 안함
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_ERROR_NOT_RAID_GUILD);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_RAID_ERROR_NOT_RAID_GUILD );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_ALREADY_COMPLETE_RAID" ) ) //레이드 신청 안함
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_SIEGE_TEAM_SETUP_IMPOSSIBLE);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_SIEGE_TEAM_SETUP_IMPOSSIBLE );
|
|
|
|
// 2010.06.14. bintitle. UI팀 요청으로 MessageBox도 띄운다.
|
|
/// 2011.05.16 ProcMsgAtStatic는 정적 입력 변수이다 - prodongi
|
|
//m_pGameManager->ProcMsgAtStatic( new SIMSG_REQ_OPEN_MSGBOX( SIMSG_REQ_OPEN_MSGBOX::_MSGBOXID::MSGBOX_GUILD_YES, S( 1924 ) ) ); // stringDB 필요.
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_REQ_OPEN_MSGBOX( SIMSG_REQ_OPEN_MSGBOX::_MSGBOXID::MSGBOX_GUILD_YES, S( 1924 ) ) ); // stringDB 필요.
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_ALREADY_PARTY_MEMBER" ) ) //이미 파티 가입중
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_PARTY_ALREADY_OTHER_MEMBER);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_PARTY_ALREADY_OTHER_MEMBER );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "INVALID_PARTY_NAME" ) ) //잘못된 공대 이름
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_INVALID_PARTY_NAME);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_RAID_INVALID_PARTY_NAME );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ALREADY_EXIST" ) ) //이미 존재하는 공대 이름
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_ALREADY_EXIST);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_RAID_ALREADY_EXIST );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "CANT_JOIN" ) ) //공대 가입 불가
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_CANT_JOIN);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_RAID_CANT_JOIN );
|
|
}
|
|
//레이드 길드 공병 초대, 용병 공병 초대
|
|
//////////////////////////////////////////////////////////////////////////
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_TARGET_ANOTHER_GUILD" ) ) //다른 길드
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_ERROR_TARGET_ANOTHER_GUILD);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_RAID_ERROR_TARGET_ANOTHER_GUILD );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_MAX" ) ) //최대 파티 수 초과
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_ERROR_MAX);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_RAID_ERROR_MAX );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_TARGET_ANOTHER" ) ) //이미 다른 파티 소속중
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_PARTY_ALREADY_OTHER_MEMBER);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_PARTY_ALREADY_OTHER_MEMBER );
|
|
}
|
|
//레이드 길드 파티장 가입, 용병 파티장 가입
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//else if( 0 == ::_stricmp( szKeyword, "ERROR_ALREADY_PARTY_MEMBER" ) ) //이미 다른 파티 가입중
|
|
//{
|
|
// strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_ERROR_ALREADY_PARTY_MEMBER);
|
|
// nGroup = GetStringDB().GetGroupID( SYS_MSG_ERROR_ALREADY_PARTY_MEMBER );
|
|
//}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_INVALID_PARTY" ) ) //없는 파티
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_ERROR_INVALID_PARTY);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_RAID_ERROR_INVALID_PARTY );
|
|
}
|
|
//else if( 0 == ::_stricmp( szKeyword, "ERROR_MAX" ) ) //최대 파티수 초과
|
|
//{
|
|
// strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_ERROR_MAX);
|
|
// nGroup = GetStringDB().GetGroupID( SYS_MSG_ERROR_MAX );
|
|
//}
|
|
else if( 0 == ::_stricmp( szKeyword, "HAS_NO_AUTHORITY" ) ) //비밀번호 틀림
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_HAS_NO_AUTHORITY);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_RAID_HAS_NO_AUTHORITY );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_IN_DEATHMATCH" ) )
|
|
{
|
|
m_pDisplayInfo->AddSystemMessage( S(9200) );
|
|
}
|
|
//else if( 0 == ::_stricmp( szKeyword, "CANT_JOIN" ) ) //공대 가입 불가
|
|
//{
|
|
// strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_CANT_JOIN);
|
|
// nGroup = GetStringDB().GetGroupID( SYS_MSG_CANT_JOIN );
|
|
//}
|
|
//else if( 0 == ::_stricmp( szKeyword, "ALREADY_EXIST" ) ) //이미 존재함(흠. 이거 뜰 일 없을 듯.)
|
|
//{
|
|
// strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_ALREADY_EXIST);
|
|
// nGroup = GetStringDB().GetGroupID( SYS_MSG_RAID_ALREADY_EXIST);
|
|
//}
|
|
|
|
if( !strMsg.empty() )
|
|
m_pDisplayInfo->AddSystemMessage( strMsg.c_str(), nGroup );
|
|
|
|
vecText.clear();
|
|
}
|
|
|
|
void SUIMessengerWnd::OutputAllianceText( const char* szText )
|
|
{
|
|
std::vector<std::string> vecText;
|
|
MsgSplit( szText, vecText, L"|" );
|
|
|
|
if( vecText.size() < 1 ) return;
|
|
|
|
const char* szKeyword = vecText[0].c_str();
|
|
|
|
std::string strMsg; strMsg.clear();
|
|
|
|
int nGroup = -1;
|
|
int nID = -1;
|
|
|
|
// 연합 초대시
|
|
if( 0 == ::_stricmp( szKeyword, "ERROR_TARGET_ANOTHER" ) ) //존재하지 않는 길드이거나, 이미 다른 연합에 가입중인 길드입니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_NOT_INVITABLE_GUILD; // [sonador][3.2.2] 추가 수정분
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_NOT_ONLINE" ) ) //대상 길드의 길드장이 로그인 상태가 아닙니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_NOT_ONLINE;
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_LIMIT_EXCEED" ) ) //더 이상 연합 구성원을 추가할 수 없습니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_LIMIT_EXCEED;
|
|
}
|
|
|
|
// 연합 추방시
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_NOT_IN_ALLIANCE" ) ) //존재하지 않는 길드이거나, 연합 소속 길드가 아닙니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_NOT_IN_ALLIANCE;
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_IS_GUILD_MASTER" ) ) //자신의 길드를 추방할 수 없습니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_IS_GUILD_MASTER;
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_CANT_KICK" ) ) //해당 길드를 추방할 수 없습니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_CANT_KICK;
|
|
}
|
|
|
|
// 연합 탈퇴시
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_CANT_LEAVE" ) ) //해당 연합에서 탈퇴할 수 없습니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_CANT_LEAVE;
|
|
}
|
|
|
|
// 연합 가입시
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_ALREADY_IN_ALLIANCE" ) ) //이미 다른 연합에 가입 중입니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_ALREADY_IN_ALLIANCE;
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_INVALID_ALLIACE" ) ) //존재하지 않는 연합입니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_INVALID_ALLIACE;
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_PERMISSION_DENIED" ) ) //권한이 없습니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_PERMISSION_DENIED;
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_CANT_JOIN_ALLIANCE" ) ) //연합에 가입할 수 없습니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_CANT_JOIN_ALLIANCE;
|
|
}
|
|
|
|
// 연합 해체시
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_HAS_ALLIANCE_MEMBER" ) ) //연합에 소속된 길드가 있습니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_HAS_ALLIANCE_MEMBER;
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_CANT_DESTROY_GUILD" ) ) //연합을 해체할 수 없습니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_CANT_DESTROY_GUILD;
|
|
}
|
|
|
|
// 공용
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_IS_RAID" ) ) //이미 레이드를 신청한 상태입니다.
|
|
{
|
|
nID = SYS_MSG_ERROR_NOT_INVITABLE_GUILD; // [sonador][3.2.2] 추가 수정분
|
|
}
|
|
|
|
// { [sonador][3.2.1]룰 수정에 따른 시스템 메시지 추가
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_OTHER_MEMBER_EXIST" ) )
|
|
{
|
|
// 길드 연합 해산 시도시 멤버 길드가 마스터 길드 외에 더 있는 경우
|
|
nID = SYS_MSG_ERROR_OTHER_MEMBER_EXIST;
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "IS_IN_RAID_PARTY" ) )
|
|
{
|
|
// 길드 연합 탈퇴/추방시 연합에서 나갈 길드의 길드원 중 한 명이라도 공대 파티에 소속되어 있는 경우
|
|
nID = SYS_MSG_ERROR_IN_SIEGE_OR_RAID;
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_IN_SIEGE_OR_RAID" ) )
|
|
{
|
|
// 길드 연합 탈퇴/추방시 연합에서 나갈 길드의 길드원 중 한 명이라도 시즈 또는 레이드 던전에 입장한 상태인 경우
|
|
nID = SYS_MSG_ERROR_IN_SIEGE_OR_RAID;
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_INVALID_GUILD" ) )
|
|
{
|
|
// 길드 연합에 특정 길드를 초대하려고 할 때 대상 길드가 유효하지 않은 길드인 경우(없는 길드 이름을 지정하는 경우 등등)
|
|
nID = SYS_MSG_ERROR_NOT_INVITABLE_GUILD; // [sonador][3.2.2] 추가 수정분
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_ALLIANCE_BLOCK_TIME_LIMIT" ) )
|
|
{
|
|
// 길드 연합에 특정 길드를 초대하거나 특정 길드가 가입할 때 해당 길드가 기존의 연합에서 나온지 7일이 지나지 않아 연합에 가입할 수 없는 경우
|
|
nID = SYS_MSG_GUILD_REJOIN_LIMIT;
|
|
}
|
|
// }
|
|
|
|
if( nID != -1 ) OutputMsg( nID );
|
|
|
|
vecText.clear();
|
|
}
|
|
|
|
void SUIMessengerWnd::OutputMsg( int nMsgID )
|
|
{
|
|
std::string strMsg = m_pDisplayInfo->GetStringMessage(nMsgID);
|
|
int nGroup = GetStringDB().GetGroupID( nMsgID );
|
|
if( !strMsg.empty() )
|
|
m_pDisplayInfo->AddSystemMessage( strMsg.c_str(), nGroup );
|
|
}
|
|
|
|
void SUIMessengerWnd::OutputGuildText( const char* szText )
|
|
{
|
|
std::vector<std::string> vecText;
|
|
MsgSplit( szText, vecText, L"|" );
|
|
|
|
if( vecText.size() < 1 ) return;
|
|
|
|
const char* szKeyword = vecText[0].c_str();
|
|
|
|
std::string strMsg; strMsg.clear();
|
|
std::string strPartyMsg = m_GuildMgr.GetMessage();
|
|
|
|
int nGroup = -1;
|
|
|
|
if( ::_stricmp( szKeyword, "CREATE" ) == 0 )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, true ) );
|
|
else if( ::_stricmp( szKeyword, "NEW" ) == 0 )
|
|
{
|
|
strMsg = SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_JOIN_MEMBER_NOTICE), "#@user_name@#", strPartyMsg.c_str() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_JOIN_MEMBER_NOTICE );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "JOIN" ) )
|
|
{
|
|
strMsg = SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_JOIN_MEMBER), "#@guild_name@#", strPartyMsg.c_str() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_JOIN_MEMBER );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "PROMOTE" ) )
|
|
{
|
|
strMsg = SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_NEW_LEADER), "#@user_name@#", strPartyMsg.c_str() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_NEW_LEADER );
|
|
|
|
// 추가. bintitle. 2010.06.03
|
|
// 길드장 변경.
|
|
m_GuildMgr.ChangeLeader( strPartyMsg.c_str() );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_MAINWND, "change_guild_master" ) );
|
|
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "KICK" ) )
|
|
{
|
|
if( m_GuildMgr.IsExist() )
|
|
{
|
|
strMsg = SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_BAN_NOTICE), "#@user_name@#", strPartyMsg.c_str() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_BAN_NOTICE );
|
|
}
|
|
else
|
|
{
|
|
strMsg = SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_BAN), "#@guild_name@#", m_GuildMgr.GetCommunityName() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_BAN );
|
|
}
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "LEAVE" ) )
|
|
{
|
|
if( m_GuildMgr.IsExist() )
|
|
{
|
|
strMsg = SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_LEAVE_NOTICE), "#@guild_name@#", strPartyMsg.c_str() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_LEAVE_NOTICE );
|
|
}
|
|
else
|
|
{
|
|
strMsg = SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_LEAVE), "#@guild_name@#", strPartyMsg.c_str() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_LEAVE );
|
|
}
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "DESTROY" ) )
|
|
{
|
|
strMsg = SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_NOTICE_MEMBER_BREAKUP), "#@guild_name@#", strPartyMsg.c_str(), "#@user_name@#", m_GuildMgr.GetCommunityLeaderName() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_NOTICE_MEMBER_BREAKUP );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "LOGOUT" ) )
|
|
{
|
|
strMsg = SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_NOTICE_MEMBER_LOGOUT), "#@user_name@#", strPartyMsg.c_str() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_NOTICE_MEMBER_LOGOUT );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "LOGIN" ) )
|
|
{
|
|
strMsg = SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_NOTICE_MEMBER_LOGIN), "#@user_name@#", strPartyMsg.c_str() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_NOTICE_MEMBER_LOGIN );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_ALREADY_GUILD_MEMBER" ) )
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_ALREADY_OTHER_MEMBER);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_ALREADY_OTHER_MEMBER );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "INVLIAD_GUILD_NAME" ) )
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage( SYS_MSG_PARTY_WRONGSTR );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_PARTY_WRONGSTR );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_MAX" ) )
|
|
{
|
|
strMsg = S(-76);//"허용 인원이 초과되었습니다";
|
|
nGroup = GetStringDB().GetGroupID( -76 );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_TARGET_ANOTHER" ) )
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_ALREADY_OTHER_MEMBER);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_ALREADY_OTHER_MEMBER );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_YOU_CAN_JOIN_ONLY_ONE_GUILD" ) )
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_ALREADY_OTHER_MEMBER);
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_ALREADY_OTHER_MEMBER );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_GUILD_REJOIN_LIMIT" ) )
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage( SYS_MSG_GUILD_REJOIN_LIMIT );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_REJOIN_LIMIT );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_GUILD_BLOCK_TIME_LIMIT" ) )
|
|
{ //TODO : 시스템 메시지 추가되면 수정해야함
|
|
strMsg = m_pDisplayInfo->GetStringMessage( SYS_MSG_GUILD_REJOIN_LIMIT );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_GUILD_REJOIN_LIMIT );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_INVALID_GUILD" ) )
|
|
{
|
|
strMsg = S(-77);//"존재하지 않는 길드입니다.";
|
|
nGroup = GetStringDB().GetGroupID( -77 );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "ALREADY_EXIST" ) )
|
|
{
|
|
strMsg = S(-78);//"이미 존재하는 파티 이름입니다.";
|
|
nGroup = GetStringDB().GetGroupID( -78 );
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "INVITE" ) )
|
|
RequestGuildJoinAccept();
|
|
// { [sonador][3.2.2] 추가 수정분
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_DESTROY_IN_ALLIANCE" ) || 0 == ::_stricmp( szKeyword, "ERROR_DESTROY_DUNGEON_OWNER" ) )
|
|
{
|
|
strMsg = m_pDisplayInfo->GetStringMessage( SYS_MSG_ERROR_DESTROY_IN_ALLIANCE_OR_DUNGEON_OWNER );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_ERROR_DESTROY_IN_ALLIANCE_OR_DUNGEON_OWNER );
|
|
}
|
|
// }
|
|
else if( 0 == ::_stricmp( szKeyword, "APPOINT_RAID_LEADER" ) ) // sonador 3.5.1 던전 시즈 레벨 제한
|
|
{
|
|
if( vecText.size() < 3 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
std::string& NewBC = vecText[ 1 ];
|
|
std::string& OldBC = vecText[ 2 ];
|
|
|
|
NewBC.erase( std::remove( NewBC.begin(), NewBC.end(), ' ' ), NewBC.end() );
|
|
OldBC.erase( std::remove( OldBC.begin(), OldBC.end(), ' ' ), OldBC.end() );
|
|
|
|
int AppointMsgID = 0;
|
|
if( OldBC.empty() )
|
|
{
|
|
AppointMsgID = SYS_MSG_CHIEFWARRIOR_APPOINTMENT;
|
|
}
|
|
else
|
|
{
|
|
std::string FireMsg = SR( SYS_MSG_CHIEFWARRIOR_FIRE, "#@player_name@#", OldBC.c_str() );
|
|
if( !FireMsg.empty() )
|
|
m_pDisplayInfo->AddSystemMessage( FireMsg.c_str(), GetStringDB().GetGroupID( SYS_MSG_CHIEFWARRIOR_FIRE ) );
|
|
|
|
AppointMsgID = SYS_MSG_CHIEFWARRIOR_CHANGE;
|
|
}
|
|
|
|
if( !NewBC.empty() )
|
|
{
|
|
strMsg = SR( AppointMsgID, "#@player_name@#", NewBC.c_str() );
|
|
nGroup = GetStringDB().GetGroupID( AppointMsgID );
|
|
}
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "PROMOTE_RAID_LEADER" ) )
|
|
{
|
|
if( vecText.size() < 3 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
std::string& NewBC = vecText[ 1 ];
|
|
std::string& OldBC = vecText[ 2 ];
|
|
|
|
NewBC.erase( std::remove( NewBC.begin(), NewBC.end(), ' ' ), NewBC.end() );
|
|
OldBC.erase( std::remove( OldBC.begin(), OldBC.end(), ' ' ), OldBC.end() );
|
|
|
|
if( !NewBC.empty() )
|
|
{
|
|
strMsg = SR( SYS_MSG_CHIEFWARRIOR_CHANGE, "#@player_name@#", NewBC.c_str() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_CHIEFWARRIOR_CHANGE );
|
|
}
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "APPOINT_RAID_LEADER_FAIL" ) )
|
|
{
|
|
if( vecText.size() < 3 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
std::string& BC = vecText[ 1 ];
|
|
int AppointErrCode = ::atoi( vecText[ 2 ].c_str() );
|
|
|
|
BC.erase( std::remove( BC.begin(), BC.end(), ' ' ), BC.end() );
|
|
if( !BC.empty() )
|
|
{
|
|
switch( AppointErrCode )
|
|
{
|
|
case RESULT_ACCESS_DENIED: // 6 전투 대장 지정 아바타를 찾을 수 없음(로그아웃 상태)
|
|
strMsg = SR( SYS_MSG_CHIEFWARRIOR_NOTLOGIN, "#@player_name@#", BC.c_str() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_CHIEFWARRIOR_NOTLOGIN );
|
|
break;
|
|
case RESULT_NOT_OWN: // 3 같은 길드 소속이 아닌 아바타임
|
|
strMsg = S( SYS_MSG_CIHEFWARRIOR_NOGUILD );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_CIHEFWARRIOR_NOGUILD );
|
|
break;
|
|
case RESULT_NOT_ACTABLE_IN_SIEGE_OR_RAID: // 44 시즈 공대가 구성된 상태임
|
|
strMsg = S( SYS_MSG_CHIEFWARRIOR_CNTFIRE );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_CHIEFWARRIOR_CNTFIRE );
|
|
break;
|
|
case RESULT_NOT_ACTABLE: // 5 길드가 던전을 소유 중이지도 않고 레이드 신청 상태도 아님
|
|
break;
|
|
case RESULT_LIMIT_MIN: // 17 대상 플레이어의 레벨이 너무 낮음
|
|
break;
|
|
case RESULT_LIMIT_MAX: // 16 대상 플레이어의 레벨이 너무 높음
|
|
break;
|
|
case RESULT_TARGET_IN_SIEGE_OR_RAID: // 47 이번 주 중에 완료한 레이드 기록이 있음
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
else if( 0 == ::_stricmp( szKeyword, "DISMISS_RAID_LEADER" ) )
|
|
{
|
|
if( vecText.size() < 3 )
|
|
{
|
|
vecText.clear();
|
|
return;
|
|
}
|
|
|
|
std::string& BC = vecText[ 1 ];
|
|
int DismissType = ::atoi( vecText[ 2 ].c_str() );
|
|
BC.erase( std::remove( BC.begin(), BC.end(), ' ' ), BC.end() );
|
|
if( !BC.empty() )
|
|
{
|
|
switch( DismissType )
|
|
{
|
|
case 1: // 던전 시즈 종료에 의해 전투 대장이 해임되었습니다.
|
|
strMsg = S( SYS_MSG_CHIEFWARRIOR_DISMISSED_BY_SIEGE_OVER );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_CHIEFWARRIOR_DISMISSED_BY_SIEGE_OVER );
|
|
break;
|
|
case 2: // 전투 대장이 적정 레벨을 벗어나 해임되었습니다.
|
|
strMsg = SR( SYS_MSG_CHIEFWARRIOR_NOTLEVEL, "#@player_name@#", BC.c_str() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_CHIEFWARRIOR_NOTLEVEL );
|
|
break;
|
|
case 3: // 전투 대장이 길드를 탈퇴하여 해임되었습니다.
|
|
strMsg = SR( SYS_MSG_CHIEFWARRIOR_QUITGUILD, "#@player_name@#", BC.c_str() );
|
|
nGroup = GetStringDB().GetGroupID( SYS_MSG_CHIEFWARRIOR_QUITGUILD );
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
// PK On 일 때 거부 메세지
|
|
else if( 0 == ::_stricmp( szKeyword, "ERROR_PKRULE" ) )
|
|
{
|
|
m_pDisplayInfo->AddSystemMessage( S(1652) );
|
|
}
|
|
|
|
if( !strMsg.empty() )
|
|
m_pDisplayInfo->AddSystemMessage( strMsg.c_str(), nGroup );
|
|
|
|
// if( m_pPlayerInfoMgr )
|
|
// RefreshSelectMember( m_PlayerInfoMgr.GetTarget(), m_PlayerInfoMgr.GetTargetName() );
|
|
|
|
vecText.clear();
|
|
}
|
|
|
|
|
|
DWORD SUIMessengerWnd::OnMouseMessage(DWORD dwMessage, int x, int y)
|
|
{
|
|
if( dwMessage == KRBUTTON_DOWN )
|
|
{
|
|
if( GetRect().IsInRect( x, y ) )
|
|
{
|
|
/*
|
|
KUIWnd* pWnd(NULL);
|
|
KUIWnd* pLogoutWnd(NULL);
|
|
for( int i = 0; i < c_nMaxLine; i++ )
|
|
{
|
|
pWnd = GetChild( CStringUtil::StringFormat( "inframe%02d", i ).c_str() );
|
|
pLogoutWnd = GetChild( CStringUtil::StringFormat( "select_logoff%02d", i ).c_str() );
|
|
if( pLogoutWnd && pLogoutWnd->IsShow() && pLogoutWnd->GetRect().IsInRect( x, y ) )
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PRIVATE_PARTY_MENU, false ) );
|
|
return NULL;
|
|
}
|
|
|
|
if( pWnd && pWnd->IsShow() && pWnd->GetRect().IsInRect( x, y ) )
|
|
{
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_TOGGLE_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PRIVATE_PARTY_MENU) );
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "open_private_menu",
|
|
"player", i, number_t( pWnd->GetRect().right ), number_t( pWnd->GetRect().top )) );
|
|
return NULL;
|
|
}
|
|
|
|
pWnd = GetChild( CStringUtil::StringFormat( "click_check%02d", i ).c_str() );
|
|
if( pWnd && pWnd->IsShow() && pWnd->GetRect().IsInRect( x, y ) )
|
|
{
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_TOGGLE_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PRIVATE_PARTY_MENU) );
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "open_private_menu",
|
|
"creature", i, number_t( pWnd->GetRect().right ), number_t( pWnd->GetRect().top )) );
|
|
return NULL;
|
|
}
|
|
}
|
|
*/
|
|
}
|
|
}
|
|
|
|
//#ifdef _PARTY_RENEWAL_ // 2011.09.15 - servantes
|
|
SUIWnd::OnMouseMessage( dwMessage, x, y );
|
|
return KMR_NO_GET;
|
|
//#else
|
|
// return SUIWnd::OnMouseMessage( dwMessage, x, y );
|
|
//#endif
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// partymenu
|
|
bool SUIMessengerMenuWnd::InitControls( KPoint kPos )
|
|
{
|
|
InitMenuList();
|
|
|
|
return SUIWnd::InitControls(kPos);
|
|
}
|
|
bool SUIMessengerMenuWnd::InitData( bool bReload )
|
|
{
|
|
m_nWorkMode = REQ_NONE;
|
|
|
|
SetControlEnableColor( "button00", "<#ffffff>" );//파티 초대
|
|
SetControlEnableColor( "button01", "<#ffffff>" );//파티 추방
|
|
SetControlEnableColor( "button02", "<#ffffff>" );//권한 인계
|
|
SetControlEnableColor( "button03", "<#ffffff>" );//파티 해산
|
|
SetControlEnableColor( "button04", "<#ffffff>" );//파티 탈퇴
|
|
|
|
SetChildShow( "check02", false );
|
|
SetChildShow( "check03", true );
|
|
KUIControlCheck * pCheck03 = dynamicCast<KUIControlCheck*>(GetChild( "check03" ));
|
|
if( pCheck03 ) pCheck03->SetCheck(true);
|
|
|
|
m_bCheck00 = false;
|
|
m_bCheck01 = false;
|
|
m_bCheck02 = false;
|
|
|
|
return SUIWnd::InitData(bReload);
|
|
}
|
|
void SUIMessengerMenuWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
SUIWnd::OnNotifyUIWindowOpen(bOpen);
|
|
|
|
if( bOpen )
|
|
{
|
|
RefreshMenu();
|
|
KUIControlCheck * pCheck03 = dynamicCast<KUIControlCheck*>(GetChild( "check03" ));
|
|
if( pCheck03 )
|
|
{
|
|
if( pCheck03->GetCheck() )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "state_on") );
|
|
else m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "state_off") );
|
|
}
|
|
}
|
|
}
|
|
void SUIMessengerMenuWnd::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
switch(pMsg->nType)
|
|
{
|
|
case IMSG_UI_SEND_DATA: // 2011.09.08 - servantes : 메세지 추가
|
|
{
|
|
SIMSG_UI_SEND_DATA *pSendMsg = dynamicCast<SIMSG_UI_SEND_DATA*>(pMsg);
|
|
|
|
if( pSendMsg->m_strString == "beside_partywnd" ) // 2011.09.08 - servantes : 파티메뉴창을 위치를 바꾼다
|
|
{
|
|
SIMSG_UI_RECT sMsg(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY); // 파티창의 영역얻기
|
|
m_pGameManager->ProcMsgAtStatic( &sMsg );
|
|
|
|
KRect rtParent = sMsg.rt;
|
|
MovePos( rtParent.right, rtParent.top + 17 );
|
|
}
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case MSG_SEND_DATA:
|
|
{
|
|
SMSG_SEND_DATA *pSendMsg = dynamicCast<SMSG_SEND_DATA *>(pMsg);
|
|
if( pSendMsg->strMessage == "req_invite" )
|
|
m_nWorkMode = REQ_INVITE;
|
|
}
|
|
break;
|
|
|
|
case IMSG_UI_INPUTTEXT :
|
|
{
|
|
SIMSG_UI_INPUTTEXT *pTextInput = dynamicCast<SIMSG_UI_INPUTTEXT *>(pMsg);
|
|
if( pTextInput->m_strText.length() <= 0 ) return;
|
|
|
|
if( m_nWorkMode == REQ_INVITE )
|
|
{
|
|
m_nWorkMode = REQ_NONE ;
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_INVITE;
|
|
pMsg->strName = pTextInput->m_strText.c_str();
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else if( m_nWorkMode == REQ_KICK )
|
|
{
|
|
m_nWorkMode = REQ_NONE ;
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_KICK;
|
|
pMsg->strName = pTextInput->m_strText.c_str();
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else if( m_nWorkMode == REQ_TRANSFER )
|
|
{
|
|
m_nWorkMode = REQ_NONE ;
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_TRANSFER;
|
|
pMsg->strName = pTextInput->m_strText.c_str();
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
}
|
|
break;
|
|
|
|
case MSG_CHATTING:
|
|
{
|
|
SMSG_CHATTING* pChatMsg = ( SMSG_CHATTING* )pMsg;
|
|
|
|
if( pChatMsg->nChatType == CHAT_PARTY_SYSTEM )
|
|
RefreshMenu();
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case IMSG_UI_MOVE:
|
|
{
|
|
SIMSG_UI_MOVE* pMoveMsg = ( SIMSG_UI_MOVE* )pMsg;
|
|
|
|
int nResolution_Width = GetGameOption().GetResolution_Width();
|
|
|
|
int nTempX( pMoveMsg->m_nX );
|
|
int nWidth( GetRect().GetWidth() );
|
|
if( nTempX + nWidth > nResolution_Width )
|
|
nTempX = nTempX - (nWidth+c_nPartyWndWidthSize);
|
|
|
|
MovePos( nTempX, pMoveMsg->m_nY );
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
bool SUIMessengerMenuWnd::IsPartyMember( const AR_HANDLE handle )
|
|
{
|
|
const SPlayerSlot * pMember = m_PartyMgr.FindMember( handle );
|
|
if( !pMember ) return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
void SUIMessengerMenuWnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch(nMessage)
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK:
|
|
{
|
|
if( !m_PartyMgr.IsExist() ) return;
|
|
|
|
if( ::_stricmp( lpszControlID, "button00" ) == 0 )
|
|
{ //파티 초대
|
|
//타겟이 있으므로 파티 초대 메세지 보낸다.
|
|
if( m_PlayerInfoMgr.GetTarget() )
|
|
{
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_INVITE;
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else
|
|
{
|
|
//이름 입력 창 띄우기
|
|
m_nWorkMode = REQ_INVITE;
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_REQ_INPUTTEXT( SIMSG_UI_REQ_INPUTTEXT::USAGE_PARTY, SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, S(-13)/*"이름 입력해 주세요"*/ ) ); // [sonador][7.0.6] Mantis 0002624
|
|
}
|
|
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button01" ) == 0 )
|
|
{ //파티 추방
|
|
if( m_PlayerInfoMgr.GetTarget() )
|
|
{
|
|
if( !IsPartyMember( m_PlayerInfoMgr.GetTarget() ) ) return;
|
|
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_KICK;
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else
|
|
{
|
|
//이름 입력 창 띄우기
|
|
m_nWorkMode = REQ_KICK;
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_REQ_INPUTTEXT( SIMSG_UI_REQ_INPUTTEXT::USAGE_PARTY, SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, S(-13)/*"이름 입력해 주세요"*/ ) ); // [sonador][7.0.6] Mantis 0002624
|
|
}
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button02" ) == 0 )
|
|
{ //권한 인계
|
|
if( m_PlayerInfoMgr.GetTarget() )
|
|
{
|
|
if( !IsPartyMember( m_PlayerInfoMgr.GetTarget() ) ) return;
|
|
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_TRANSFER;
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else
|
|
{
|
|
//이름 입력 창 띄우기
|
|
m_nWorkMode = REQ_TRANSFER;
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_REQ_INPUTTEXT( SIMSG_UI_REQ_INPUTTEXT::USAGE_PARTY, SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, S(-13)/*"이름 입력해 주세요"*/ ) ); // [sonador][7.0.6] Mantis 0002624
|
|
}
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button03" ) == 0 )
|
|
{ //파티 해산
|
|
{
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_DESTROY;
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button04" ) == 0 )
|
|
{ //파티 탈퇴
|
|
{
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_LEAVE;
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case KUI_MESSAGE::KCHECK_CHANGE:
|
|
{
|
|
KUIControlCheck * pCheck00 = dynamicCast<KUIControlCheck*>(GetChild( "check00" ));
|
|
KUIControlCheck * pCheck01 = dynamicCast<KUIControlCheck*>(GetChild( "check01" ));
|
|
KUIControlCheck * pCheck02 = dynamicCast<KUIControlCheck*>(GetChild( "check02" ));
|
|
|
|
KUIControlCheck * pCheck03 = dynamicCast<KUIControlCheck*>(GetChild( "check03" ));
|
|
|
|
if( !pCheck00 || !pCheck01 || !pCheck02 || !pCheck03 ) return;
|
|
|
|
if( m_PartyMgr.IsLeader() )
|
|
{
|
|
if( ::_stricmp( lpszControlID, "check00" ) == 0 )
|
|
{
|
|
/// 2011.05.13 pCheck00->GetCheck() 안으로 이동(메모리 누수 발생 가능 때문에) - prodongi
|
|
/*
|
|
//아이템 분배 각자
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_OPTION;
|
|
*/
|
|
|
|
if( pCheck00->GetCheck() )
|
|
{
|
|
pCheck01->SetCheck( false );
|
|
pCheck02->SetCheck( false );
|
|
|
|
m_bCheck00 = true;
|
|
m_bCheck01 = false;
|
|
m_bCheck02 = false;
|
|
|
|
/// 2011.05.13 - prodongi
|
|
//아이템 분배 각자
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_OPTION;
|
|
|
|
pMsg->strName = "monopoly";
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else
|
|
{
|
|
if (m_bCheck00)
|
|
pCheck00->SetCheck( true );
|
|
}
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "check01" ) == 0 )
|
|
{
|
|
/// 2011.05.13 pCheck00->GetCheck() 안으로 이동(메모리 누수 발생 가능 때문에) - prodongi
|
|
/*
|
|
//아이템 분배 랜덤
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_OPTION;
|
|
*/
|
|
|
|
if( pCheck01->GetCheck() )
|
|
{
|
|
pCheck00->SetCheck( false );
|
|
pCheck02->SetCheck( false );
|
|
|
|
m_bCheck00 = false;
|
|
m_bCheck01 = true;
|
|
m_bCheck02 = false;
|
|
|
|
/// 2011.05.13 - prodongi
|
|
//아이템 분배 랜덤
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_OPTION;
|
|
|
|
pMsg->strName = "random";
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else
|
|
{
|
|
if (m_bCheck01)
|
|
pCheck01->SetCheck( true );
|
|
}
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "check02" ) == 0 )
|
|
{
|
|
/// 2011.05.13 pCheck00->GetCheck() 안으로 이동(메모리 누수 발생 가능 때문에) - prodongi
|
|
/*
|
|
//아이템 분배 순차
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_OPTION;
|
|
*/
|
|
|
|
if( pCheck02->GetCheck() )
|
|
{
|
|
pCheck00->SetCheck( false );
|
|
pCheck01->SetCheck( false );
|
|
|
|
m_bCheck00 = false;
|
|
m_bCheck01 = false;
|
|
m_bCheck02 = true;
|
|
|
|
/// 2011.05.13 - prodongi
|
|
//아이템 분배 순차
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_OPTION;
|
|
|
|
pMsg->strName = "linear";
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else
|
|
{
|
|
if (m_bCheck02)
|
|
pCheck02->SetCheck( true );
|
|
}
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "check03" ) == 0 )
|
|
{ //파티원 버프 표시
|
|
if( pCheck03->GetCheck() )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "state_on") );
|
|
else m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "state_off") );
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
// menu
|
|
void SUIMessengerMenuWnd::ShowSelectMenu( int nIndex )
|
|
{
|
|
|
|
}
|
|
bool SUIMessengerMenuWnd::SelectPartyMenu( int nIndex )
|
|
{
|
|
|
|
|
|
return true;
|
|
}
|
|
bool SUIMessengerMenuWnd::SelectGuildMenu( int nIndex )
|
|
{
|
|
|
|
|
|
return true;
|
|
}
|
|
// init
|
|
void SUIMessengerMenuWnd::InitMenuList()
|
|
{
|
|
|
|
}
|
|
|
|
void SUIMessengerMenuWnd::SetControlEnableColor( const char * pControlName, const char * pColor )
|
|
{
|
|
KUIControl * pControl = dynamicCast<KUIControl *>(GetChild(pControlName));
|
|
if( pControl )
|
|
pControl->SetEnableColor( pColor );
|
|
}
|
|
|
|
void SUIMessengerMenuWnd::SetControlEnable( const char * pControlName, bool bEnable )
|
|
{
|
|
KUIControl * pControl = dynamicCast<KUIControl *>(GetChild(pControlName));
|
|
if( pControl )
|
|
{
|
|
if( bEnable )
|
|
pControl->Enable();
|
|
else
|
|
pControl->Disable();
|
|
}
|
|
}
|
|
|
|
// list
|
|
void SUIMessengerMenuWnd::RefreshMenu()
|
|
{
|
|
if( !IsShow() ) return;
|
|
|
|
//자유
|
|
if( m_PartyMgr.GetDivision() == 0 )
|
|
{
|
|
KUIControlCheck * pCheck00 = dynamicCast<KUIControlCheck*>(GetChild( "check00" ));
|
|
KUIControlCheck * pCheck01 = dynamicCast<KUIControlCheck*>(GetChild( "check01" ));
|
|
KUIControlCheck * pCheck02 = dynamicCast<KUIControlCheck*>(GetChild( "check02" ));
|
|
if( pCheck00 ) pCheck00->SetCheck( true );
|
|
if( pCheck01 ) pCheck01->SetCheck( false );
|
|
if( pCheck02 ) pCheck02->SetCheck( false );
|
|
|
|
m_bCheck00 = true;
|
|
m_bCheck01 = false;
|
|
m_bCheck02 = false;
|
|
}
|
|
//랜덤
|
|
else if( m_PartyMgr.GetDivision() == 1 )
|
|
{
|
|
KUIControlCheck * pCheck00 = dynamicCast<KUIControlCheck*>(GetChild( "check00" ));
|
|
KUIControlCheck * pCheck01 = dynamicCast<KUIControlCheck*>(GetChild( "check01" ));
|
|
KUIControlCheck * pCheck02 = dynamicCast<KUIControlCheck*>(GetChild( "check02" ));
|
|
if( pCheck00 ) pCheck00->SetCheck( false );
|
|
if( pCheck01 ) pCheck01->SetCheck( true );
|
|
if( pCheck02 ) pCheck02->SetCheck( false );
|
|
|
|
m_bCheck00 = false;
|
|
m_bCheck01 = true;
|
|
m_bCheck02 = false;
|
|
}
|
|
//순차
|
|
else if( m_PartyMgr.GetDivision() == 2 )
|
|
{
|
|
KUIControlCheck * pCheck00 = dynamicCast<KUIControlCheck*>(GetChild( "check00" ));
|
|
KUIControlCheck * pCheck01 = dynamicCast<KUIControlCheck*>(GetChild( "check01" ));
|
|
KUIControlCheck * pCheck02 = dynamicCast<KUIControlCheck*>(GetChild( "check02" ));
|
|
if( pCheck00 ) pCheck00->SetCheck( false );
|
|
if( pCheck01 ) pCheck01->SetCheck( false );
|
|
if( pCheck02 ) pCheck02->SetCheck( true );
|
|
|
|
m_bCheck00 = false;
|
|
m_bCheck01 = false;
|
|
m_bCheck02 = true;
|
|
}
|
|
|
|
if( !m_PartyMgr.IsLeader() )
|
|
{
|
|
//?????
|
|
if( m_PartyMgr.GetDivision() == 0 )
|
|
{
|
|
KUIControlCheck * pCheck00 = dynamicCast<KUIControlCheck*>(GetChild( "check00" ));
|
|
KUIControlCheck * pCheck01 = dynamicCast<KUIControlCheck*>(GetChild( "check01" ));
|
|
KUIControlCheck * pCheck02 = dynamicCast<KUIControlCheck*>(GetChild( "check02" ));
|
|
if( pCheck00 ) pCheck00->SetShow( true );
|
|
if( pCheck01 ) pCheck01->SetShow( false );
|
|
if( pCheck02 ) pCheck02->SetShow( false );
|
|
}
|
|
else if( m_PartyMgr.GetDivision() == 1 )
|
|
{
|
|
KUIControlCheck * pCheck00 = dynamicCast<KUIControlCheck*>(GetChild( "check00" ));
|
|
KUIControlCheck * pCheck01 = dynamicCast<KUIControlCheck*>(GetChild( "check01" ));
|
|
KUIControlCheck * pCheck02 = dynamicCast<KUIControlCheck*>(GetChild( "check02" ));
|
|
if( pCheck00 ) pCheck00->SetShow( false );
|
|
if( pCheck01 ) pCheck01->SetShow( true );
|
|
if( pCheck02 ) pCheck02->SetShow( false );
|
|
}
|
|
else if( m_PartyMgr.GetDivision() == 2 )
|
|
{
|
|
KUIControlCheck * pCheck00 = dynamicCast<KUIControlCheck*>(GetChild( "check00" ));
|
|
KUIControlCheck * pCheck01 = dynamicCast<KUIControlCheck*>(GetChild( "check01" ));
|
|
KUIControlCheck * pCheck02 = dynamicCast<KUIControlCheck*>(GetChild( "check02" ));
|
|
if( pCheck00 ) pCheck00->SetShow( false );
|
|
if( pCheck01 ) pCheck01->SetShow( false );
|
|
if( pCheck02 ) pCheck02->SetShow( true );
|
|
}
|
|
|
|
SetControlEnable( "button00", false );//파티 초대
|
|
SetControlEnable( "button01", false );//파티 추방
|
|
SetControlEnable( "button02", false );//권한 인계
|
|
SetControlEnable( "button03", false );//파티 해산
|
|
SetControlEnable( "button04", true );//파티 탈퇴
|
|
|
|
SetControlEnable( "check00", false );
|
|
SetControlEnable( "check01", false );
|
|
SetControlEnable( "check02", false );//지원 안됨
|
|
// SetControlEnable( "check03", true );//지원 안됨
|
|
}
|
|
else
|
|
{
|
|
SetChildShow( "check00", true );
|
|
SetChildShow( "check01", true );
|
|
SetChildShow( "check02", true );
|
|
|
|
SetControlEnable( "button00", true );//파티 초대
|
|
SetControlEnable( "button01", true );//파티 추방
|
|
SetControlEnable( "button02", true );//권한 인계
|
|
SetControlEnable( "button03", true );//파티 해산
|
|
SetControlEnable( "button04", false );//파티 탈퇴
|
|
|
|
SetControlEnable( "check00", true );
|
|
SetControlEnable( "check01", true );
|
|
SetControlEnable( "check02", true );//지원 안됨
|
|
// SetControlEnable( "check03", true );//지원 안됨
|
|
}
|
|
|
|
}
|
|
void SUIMessengerMenuWnd::RefreshPartyMenu()
|
|
{
|
|
|
|
}
|
|
void SUIMessengerMenuWnd::RefreshGuildMenu()
|
|
{
|
|
|
|
}
|
|
|
|
void SUIMessengerMenuWnd::RefreshMenuSlot()
|
|
{
|
|
|
|
}
|
|
void SUIMessengerMenuWnd::DisableMenuSlot()
|
|
{
|
|
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//SUIPartyCreate//////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
bool SUIPartyCreate::InitControls( KPoint kPos )
|
|
{
|
|
return SUIWnd::InitControls( kPos );
|
|
}
|
|
|
|
bool SUIPartyCreate::InitData( bool bReload /*= false*/ )
|
|
{
|
|
SetCustomMovingRect( KRect( 0, 0, 300, 19 ) );
|
|
|
|
KUIControlCheck * pCheck00 = dynamicCast<KUIControlCheck*>(GetChild( "button_check_00" ));
|
|
KUIControlCheck * pCheck01 = dynamicCast<KUIControlCheck*>(GetChild( "button_check_01" ));
|
|
KUIControlCheck * pCheck02 = dynamicCast<KUIControlCheck*>(GetChild( "button_check_02" ));
|
|
|
|
pCheck00->SetCheck( true );
|
|
pCheck01->SetCheck( false );
|
|
pCheck02->SetCheck( false );
|
|
|
|
return SUIWnd::InitData( bReload );
|
|
}
|
|
|
|
void SUIPartyCreate::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
static bool bCheck00 = false;
|
|
static bool bCheck01 = false;
|
|
static bool bCheck02 = false;
|
|
|
|
switch( nMessage )
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK:
|
|
{
|
|
if( ::_stricmp( lpszControlID, "button_close" ) == 0 ||
|
|
::_stricmp( lpszControlID, "button_cancel" ) == 0 )
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_CREATE, false ) );
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button_ok" ) == 0 )
|
|
{
|
|
KUIControlEdit * pEdit = dynamicCast<KUIControlEdit*>(GetChild( "edit_party_name" ));
|
|
if( !pEdit ) return;
|
|
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_CREATE;
|
|
// pMsg->strName = "party";
|
|
pMsg->strName = pEdit->GetText();
|
|
|
|
//파티 이름을 넣어야 함.
|
|
if( pMsg->strName.length() <= 0 )
|
|
{
|
|
SAFE_DELETE( pMsg );
|
|
return;
|
|
}
|
|
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
|
|
//닫기
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_CREATE, false ) );
|
|
}
|
|
}
|
|
break;
|
|
|
|
case KUI_MESSAGE::KCHECK_CHANGE:
|
|
{
|
|
m_pGameManager->PlaySound( "ui_button_click.wav" );
|
|
|
|
KUIControlCheck * pCheck00 = dynamicCast<KUIControlCheck*>(GetChild( "button_check_00" ));
|
|
KUIControlCheck * pCheck01 = dynamicCast<KUIControlCheck*>(GetChild( "button_check_01" ));
|
|
KUIControlCheck * pCheck02 = dynamicCast<KUIControlCheck*>(GetChild( "button_check_02" ));
|
|
|
|
if( !pCheck00 || !pCheck01 || !pCheck02 ) return;
|
|
|
|
//각자
|
|
if( ::_stricmp( lpszControlID, "button_check_00" ) == 0 )
|
|
{
|
|
if( pCheck00->GetCheck() )
|
|
{
|
|
pCheck01->SetCheck( false );
|
|
pCheck02->SetCheck( false );
|
|
|
|
bCheck00 = true;
|
|
bCheck01 = false;
|
|
bCheck02 = false;
|
|
}
|
|
else
|
|
{
|
|
if (bCheck00)
|
|
pCheck00->SetCheck( true );
|
|
}
|
|
}
|
|
//순차
|
|
else if( ::_stricmp( lpszControlID, "button_check_01" ) == 0 )
|
|
{
|
|
if( pCheck01->GetCheck() )
|
|
{
|
|
pCheck00->SetCheck( false );
|
|
pCheck02->SetCheck( false );
|
|
|
|
bCheck00 = false;
|
|
bCheck01 = true;
|
|
bCheck02 = false;
|
|
}
|
|
else
|
|
{
|
|
if (bCheck01)
|
|
pCheck01->SetCheck( true );
|
|
}
|
|
}
|
|
//랜덤
|
|
else if( ::_stricmp( lpszControlID, "button_check_02" ) == 0 )
|
|
{
|
|
if( pCheck02->GetCheck() )
|
|
{
|
|
pCheck00->SetCheck( false );
|
|
pCheck01->SetCheck( false );
|
|
|
|
bCheck00 = false;
|
|
bCheck01 = false;
|
|
bCheck02 = true;
|
|
}
|
|
else
|
|
{
|
|
if (bCheck02)
|
|
pCheck02->SetCheck( true );
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
|
|
case KUI_MESSAGE::KGENWND_MOVE: // 윈도우 이동
|
|
{
|
|
LimitMoveWnd(); // 게임 외부로 나가지 못하게 제한
|
|
}
|
|
break;
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
void SUIPartyCreate::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
|
|
}
|
|
|
|
void SUIPartyCreate::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd/* = true*/ )
|
|
{
|
|
if( bOpen )
|
|
m_pGameManager->PlaySound( "ui_popup_window01.wav" );
|
|
else m_pGameManager->PlaySound( "ui_button_click.wav" );
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// SUIPartyStateWnd
|
|
|
|
namespace
|
|
{
|
|
const int c_nStateDelta = 32; //지속효과 리사이즈 단위
|
|
|
|
const char* c_lpStateSetID = "state_set%02d";
|
|
const char* c_lpCreatureStateSetID = "Creature_state_set%02d";
|
|
}
|
|
|
|
SUIPartyStateWnd::SUIPartyStateWnd( SGameManager* pGameManager, SUIDisplayInfo* pDisplayInfo )
|
|
: SUIWnd( pGameManager )
|
|
, m_pDisplayInfo( pDisplayInfo )
|
|
, m_bLeftRender(true), m_bStateRender(true)
|
|
{
|
|
for( int i(0); i<SLOT_MAXLINE; ++i )
|
|
{
|
|
m_MemberStateRender[i] = true;
|
|
m_CreatureStateRender[i] = true;
|
|
m_vecCreatureList[i].hCreature1st = NULL;
|
|
m_vecCreatureList[i].hMaster = NULL;
|
|
}
|
|
}
|
|
|
|
void SUIPartyStateWnd::ClearCtr()
|
|
{
|
|
}
|
|
|
|
bool SUIPartyStateWnd::InitControls( KPoint kPos )
|
|
{
|
|
std::string strID, strID2;
|
|
KRect rt(0,0,100,30);
|
|
|
|
SUIPartyStateSetWnd* pStateSetWnd(NULL);
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
strID = CStringUtil::StringFormat(c_lpStateSetID, i);
|
|
strID2 = CStringUtil::StringFormat(c_lpCreatureStateSetID, i);
|
|
|
|
pStateSetWnd = new SUIPartyStateSetWnd(m_pGameManager, m_pDisplayInfo, this, m_pManager, strID.c_str(), rt );
|
|
AddChild(pStateSetWnd);
|
|
|
|
pStateSetWnd = new SUIPartyStateSetWnd(m_pGameManager, m_pDisplayInfo, this, m_pManager, strID2.c_str(), KRect(rt.left, rt.top+c_nStateDelta, rt.right, rt.bottom+c_nStateDelta) );
|
|
pStateSetWnd->SetNegativeStateCnt( 10 );
|
|
AddChild(pStateSetWnd);
|
|
|
|
rt.top += c_nStateDelta;
|
|
rt.bottom += c_nStateDelta;
|
|
}
|
|
|
|
return SUIWnd::InitControls(kPos);
|
|
}
|
|
|
|
bool SUIPartyStateWnd::InitData( bool bReload )
|
|
{
|
|
return SUIWnd::InitData(bReload);
|
|
}
|
|
|
|
void SUIPartyStateWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
SUIWnd::OnNotifyUIWindowOpen(bOpen);
|
|
|
|
if( bOpen )
|
|
{
|
|
RefreshSlots();
|
|
}
|
|
}
|
|
|
|
void SUIPartyStateWnd::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
switch( pMsg->nType )
|
|
{
|
|
case IMSG_UI_SEND_DATA:
|
|
{
|
|
SIMSG_UI_SEND_DATA *pData = (SIMSG_UI_SEND_DATA *)pMsg;
|
|
|
|
if( pData->m_strString == "party_update" )
|
|
{
|
|
//RefreshSlots();
|
|
}
|
|
else if( pData->m_strString == "add_creature" )
|
|
{
|
|
pMsg->bUse = true;
|
|
|
|
AddCreature( pData->m_dwData );
|
|
RefreshSlots();
|
|
}
|
|
else if( pData->m_strString == "add_creature_index" )
|
|
{
|
|
// 2010.08.30 - prodongi
|
|
//AddCreature( (int)pData->m_nNumber.getAmount() );
|
|
RefreshSlots();
|
|
setRenderCreatureUI((int)pData->m_nNumber.getAmount(), true);
|
|
}
|
|
else if( pData->m_strString == "remove_creature" )
|
|
{
|
|
RemoveCreature( pData->m_dwData );
|
|
RefreshSlots();
|
|
}
|
|
else if( pData->m_strString == "remove_creature_index" )
|
|
{
|
|
// 2010.08.30 - prodongi
|
|
//RemoveCreature( (int)pData->m_nNumber.getAmount() );
|
|
setRenderCreatureUI((int)pData->m_nNumber.getAmount(), false);
|
|
RefreshSlots();
|
|
}
|
|
else if( pData->m_strString == "state_on" )
|
|
{
|
|
m_bStateRender = true;
|
|
RefreshSlots();
|
|
}
|
|
else if( pData->m_strString == "state_off" )
|
|
{
|
|
m_bStateRender = false;
|
|
DisableAllSlots();
|
|
}
|
|
else if( pData->m_strString == "one_state_on" )
|
|
{
|
|
if( pData->m_nNumber2>=0 && pData->m_nNumber2<SLOT_MAXLINE )
|
|
{
|
|
if( pData->m_nNumber == TS_ENTER::GAME_PLAYER )
|
|
m_MemberStateRender[ pData->m_nNumber2.getAmount() ] = true;
|
|
else if( pData->m_nNumber == TS_ENTER::GAME_SUMMON )
|
|
m_CreatureStateRender[ pData->m_nNumber2.getAmount() ] = true;
|
|
|
|
RefreshSlots();
|
|
}
|
|
}
|
|
else if( pData->m_strString == "one_state_off" )
|
|
{
|
|
if( pData->m_nNumber2>=0 && pData->m_nNumber2<SLOT_MAXLINE )
|
|
{
|
|
if( pData->m_nNumber == TS_ENTER::GAME_PLAYER )
|
|
m_MemberStateRender[ pData->m_nNumber2.getAmount() ] = false;
|
|
else if( pData->m_nNumber == TS_ENTER::GAME_SUMMON )
|
|
m_CreatureStateRender[ pData->m_nNumber2.getAmount() ] = false;
|
|
|
|
RefreshSlots();
|
|
}
|
|
}
|
|
else if( pData->m_strString == "open_private_menu" )
|
|
{
|
|
if( pData->m_dwData < 0 || pData->m_dwData >= SLOT_MAXLINE )
|
|
break;
|
|
|
|
SIMSG_UI_OPEN_PRIVATE_MENU Msg;
|
|
|
|
if( pData->m_strText == "player" )
|
|
{
|
|
Msg.m_bPlayer = true;
|
|
Msg.m_bRender = m_MemberStateRender[pData->m_dwData];
|
|
}
|
|
else if( pData->m_strText == "creature" )
|
|
{
|
|
Msg.m_bPlayer = false;
|
|
Msg.m_bRender = m_CreatureStateRender[pData->m_dwData];
|
|
}
|
|
|
|
Msg.m_nIndex = pData->m_dwData;
|
|
Msg.m_nX = pData->m_nNumber.getAmount();
|
|
Msg.m_nY = pData->m_nNumber2.getAmount();
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &Msg );
|
|
}
|
|
}
|
|
break;
|
|
case MSG_CHATTING:
|
|
{
|
|
SMSG_CHATTING* pChatMsg = ( SMSG_CHATTING* )pMsg;
|
|
|
|
if( pChatMsg->nChatType == CHAT_PARTY_SYSTEM )
|
|
{
|
|
if( m_PartyMgr.IsExist() && m_PartyMgr.GetMemberCount() > 0 )
|
|
{
|
|
RefreshSlots();
|
|
}
|
|
else
|
|
{
|
|
ClearCreatureList();
|
|
DisableAllSlots();
|
|
}
|
|
}
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case IMSG_UI_MOVE:
|
|
{
|
|
SIMSG_UI_MOVE* pMoveMsg = ( SIMSG_UI_MOVE* )pMsg;
|
|
|
|
Move( pMoveMsg->m_nX, pMoveMsg->m_nY+2 );
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case IMSG_UI_STATE_UPDATE:
|
|
{
|
|
SIMSG_UI_STATE_UPDATE* pStateUpdate = ( SIMSG_UI_STATE_UPDATE* )pMsg;
|
|
|
|
SUIPartyStateSetWnd* pWnd = GetChildWnd( pStateUpdate->m_hPlayer );
|
|
if( pWnd ) pWnd->StateUpdate(pMsg);
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case IMSG_UI_STATE_LIST_UPDATE:
|
|
{
|
|
SIMSG_UI_STATE_LIST_UPDATE* pStateListUpdate = ( SIMSG_UI_STATE_LIST_UPDATE* )pMsg;
|
|
|
|
SUIPartyStateSetWnd* pWnd = GetChildWnd( pStateListUpdate->hPlayer );
|
|
if( pWnd ) pWnd->StateListUpdate(pMsg);
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
|
|
case MSG_ENTER:
|
|
{
|
|
SMSG_ENTER* pEnter = (SMSG_ENTER*)pMsg;
|
|
|
|
if( pEnter->ObjType == TS_ENTER::GAME_SUMMON )
|
|
if( ChangeCreature( pEnter->handle ) )
|
|
RefreshSlots();
|
|
else if( pEnter->ObjType == TS_ENTER::GAME_PLAYER )
|
|
if( ChangeMasterCreature( pEnter->handle ) )
|
|
RefreshSlots();
|
|
}
|
|
break;
|
|
|
|
case MSG_LEAVE:
|
|
{
|
|
SMSG_LEAVE* pLeave = (SMSG_LEAVE*)pMsg;
|
|
if( LeaveCreature( pLeave->handle ) == -1 )
|
|
LeaveMaster( pLeave->handle );
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
bool SUIPartyStateWnd::ChangeCreature( AR_HANDLE handle )
|
|
{
|
|
AR_HANDLE hMaster = GetMaster( handle );
|
|
int nIndex = m_PartyMgr.GetMemberIndex( hMaster );
|
|
if( hMaster && nIndex >= 0 && nIndex < c_nMaxLine )
|
|
{
|
|
if( m_vecCreatureList[nIndex].hMaster == hMaster )
|
|
{
|
|
m_vecCreatureList[nIndex].hCreature1st = handle;
|
|
m_vecCreatureList[nIndex].bRender = true;
|
|
m_vecCreatureList[nIndex].bRenderUI = true; // 2010.08.30 - prodongi
|
|
return true;
|
|
}
|
|
}
|
|
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
if( m_vecCreatureList[i].hMaster == hMaster )
|
|
{
|
|
m_vecCreatureList[i].hCreature1st = handle;
|
|
m_vecCreatureList[i].bRender = true;
|
|
m_vecCreatureList[i].bRenderUI = true; // 2010.08.30 - prodongi
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
bool SUIPartyStateWnd::ChangeMasterCreature( AR_HANDLE hMaster )
|
|
{
|
|
int nIndex = m_PartyMgr.GetMemberIndex( hMaster );
|
|
if( hMaster && nIndex >= 0 && nIndex < c_nMaxLine )
|
|
{
|
|
SGameAvatarEx* pMaster = GetObject( hMaster );
|
|
if( pMaster )
|
|
{
|
|
m_vecCreatureList[nIndex].hMaster = hMaster;
|
|
m_vecCreatureList[nIndex].hCreature1st = pMaster->GetCreature();
|
|
m_vecCreatureList[nIndex].bRender = true;
|
|
m_vecCreatureList[nIndex].bRenderUI = true; // 2010.08.30 - prodongi
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void SUIPartyStateWnd::SetCreatureMaster( int nPos, AR_HANDLE hMaster )
|
|
{
|
|
if( nPos < 0 || nPos >= c_nMaxLine ) return;
|
|
|
|
m_vecCreatureList[nPos].hMaster = hMaster;
|
|
SGameAvatarEx* pMaster = GetObject( hMaster );
|
|
if( pMaster )
|
|
{
|
|
AR_HANDLE hCreature = pMaster->GetCreature();
|
|
SGameAvatarEx* pCreature = GetObject( hCreature );
|
|
|
|
if( pCreature && pCreature->IsActivated() )
|
|
{
|
|
// 2010.08.30 - prodongi
|
|
if (!m_vecCreatureList[nPos].bRender && !m_vecCreatureList[nPos].bRenderUI)
|
|
m_vecCreatureList[nPos].bRenderUI = true;
|
|
|
|
m_vecCreatureList[nPos].hCreature1st = hCreature;
|
|
// 2010.08.12 - prodongi
|
|
m_vecCreatureList[nPos].bRender = true;
|
|
}
|
|
else m_vecCreatureList[nPos].hCreature1st = NULL;
|
|
}
|
|
|
|
if( m_vecCreatureList[nPos].hCreature1st == NULL )
|
|
{
|
|
m_vecCreatureList[nPos].bRender = false;
|
|
m_vecCreatureList[nPos].bRenderUI = false; // 2010.08.30 - prodongi
|
|
}
|
|
}
|
|
|
|
int SUIPartyStateWnd::AddCreature( AR_HANDLE handle )
|
|
{
|
|
AR_HANDLE hMaster = GetMaster( handle );
|
|
int nIndex = m_PartyMgr.GetMemberIndex( hMaster );
|
|
if( hMaster && nIndex >= 0 && nIndex < c_nMaxLine )
|
|
{
|
|
// m_vecCreatureList[nIndex].hMaster = hMaster;
|
|
// m_vecCreatureList[nIndex].hCreature1st = handle;
|
|
m_vecCreatureList[nIndex].bRender = true;
|
|
m_vecCreatureList[nIndex].bRenderUI = true; // 2010.08.30 - prodongi
|
|
return nIndex;
|
|
}
|
|
else
|
|
{
|
|
// int nGroupID = GetStringDB().GetGroupID( nMsgType );
|
|
// m_pDisplayInfo->AddSystemMessage( strMsg.c_str(), nGroupID );
|
|
// m_pDisplayInfo->AddSystemMessage( "크리처의 마스터가 파티원이 아닙니다.", 0 );
|
|
return -1;
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
// 2010.08.30 - prodongi
|
|
/*
|
|
void SUIPartyStateWnd::AddCreature( int nIndex )
|
|
{
|
|
// SGameAvatarEx* pPlayer = GetPlayerPtr( nIndex );
|
|
// if( pPlayer )
|
|
{
|
|
// m_vecCreatureList[nIndex].hMaster = pPlayer->GetArID();
|
|
// m_vecCreatureList[nIndex].hCreature1st = pPlayer->GetCreature();
|
|
if( nIndex >= 0 && nIndex < c_nMaxLine )
|
|
{
|
|
m_vecCreatureList[nIndex].bRender = true;
|
|
}
|
|
}
|
|
}
|
|
*/
|
|
|
|
SGameAvatarEx* SUIPartyStateWnd::GetPlayerPtr( int nIndex )
|
|
{
|
|
if( nIndex < 0 || nIndex >= m_PartyMgr.GetMemberCount() )
|
|
return NULL;
|
|
/*
|
|
if( nIndex == 0 )
|
|
{
|
|
SPlayerSlot* pSlot = m_PartyMgr.GetLeaderInfo();
|
|
if( pSlot ) return GetObject( pSlot->GetHandle() );
|
|
}
|
|
else
|
|
{
|
|
const int nLeaderIndex = m_PartyMgr.GetLeaderIndex();
|
|
if( nIndex < nLeaderIndex )
|
|
nIndex++;
|
|
|
|
std::vector<SPlayerSlot*> vecMemberList;
|
|
vecMemberList = m_PartyMgr.GetMemberList();
|
|
if( vecMemberList[nIndex] )
|
|
{
|
|
return GetObject( vecMemberList[nIndex]->GetHandle() );
|
|
}
|
|
}
|
|
*/
|
|
//순차분배 수정: 파티장이 0번 슬롯에 나오던 부분을 자기 위치에 나오도록 수정
|
|
//2009-02-23: hunee
|
|
std::vector<SPlayerSlot*> vecMemberList;
|
|
vecMemberList = m_PartyMgr.GetMemberList();
|
|
if( vecMemberList[nIndex] )
|
|
{
|
|
return GetObject( vecMemberList[nIndex]->GetHandle() );
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
void SUIPartyStateWnd::LeaveMaster( AR_HANDLE hMaster )
|
|
{
|
|
int nIndex = m_PartyMgr.GetMemberIndex( hMaster );
|
|
if( hMaster && nIndex >= 0 && nIndex < c_nMaxLine )
|
|
{
|
|
if( m_vecCreatureList[nIndex].hMaster == hMaster )
|
|
{
|
|
m_vecCreatureList[nIndex].hMaster = NULL;
|
|
m_vecCreatureList[nIndex].hCreature1st = NULL;
|
|
m_vecCreatureList[nIndex].bRender = false;
|
|
m_vecCreatureList[nIndex].bRenderUI = false; // 2010.08.30 - prodongi
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
int SUIPartyStateWnd::LeaveCreature( AR_HANDLE handle )
|
|
{
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
if( m_vecCreatureList[i].hCreature1st == handle )
|
|
{
|
|
m_vecCreatureList[i].hCreature1st = NULL;
|
|
m_vecCreatureList[i].bRender = false;
|
|
m_vecCreatureList[i].bRenderUI = false; // 2010.08.30 - prodongi
|
|
return i;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
int SUIPartyStateWnd::RemoveCreature( AR_HANDLE handle )
|
|
{
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
if( m_vecCreatureList[i].hCreature1st == handle )
|
|
{
|
|
// m_vecCreatureList[i].hCreature1st = NULL;
|
|
m_vecCreatureList[i].bRender = false;
|
|
m_vecCreatureList[i].bRenderUI = false; // 2010.08.30 - prodongi
|
|
return i;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
// 2010.08.30 - prodongi
|
|
/*
|
|
void SUIPartyStateWnd::RemoveCreature( int nIndex )
|
|
{
|
|
if( nIndex < 0 || nIndex >= c_nMaxLine )
|
|
return;
|
|
// m_vecCreatureList[nIndex].hCreature1st = NULL;
|
|
m_vecCreatureList[nIndex].bRender = false;
|
|
}
|
|
*/
|
|
|
|
// 2010.08.30 - prodongi
|
|
void SUIPartyStateWnd::setRenderCreatureUI(int index, bool render)
|
|
{
|
|
if( index < 0 || index >= c_nMaxLine )
|
|
return;
|
|
m_vecCreatureList[index].bRenderUI = render;
|
|
}
|
|
|
|
void SUIPartyStateWnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch(nMessage)
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK:
|
|
{
|
|
}
|
|
break;
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
void SUIPartyStateWnd::ClearCreatureList()
|
|
{
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
m_vecCreatureList[i].hCreature1st = NULL;
|
|
m_vecCreatureList[i].hMaster = NULL;
|
|
m_vecCreatureList[i].bRender = false;
|
|
m_vecCreatureList[i].bRenderUI = false; // 2010.08.30 - prodongi
|
|
}
|
|
}
|
|
|
|
AR_HANDLE SUIPartyStateWnd::GetMaster( AR_HANDLE handle )
|
|
{
|
|
SGameAvatarEx* pCreature = GetObject( handle );
|
|
if( pCreature && pCreature->GetObjType() == TS_ENTER::GAME_SUMMON )
|
|
return pCreature->GetMaster();
|
|
return 0;
|
|
}
|
|
|
|
SGameAvatarEx* SUIPartyStateWnd::GetMasterPtr( AR_HANDLE handle )
|
|
{
|
|
SGameAvatarEx* pCreature = GetObject( handle );
|
|
if( pCreature && pCreature->GetObjType() == TS_ENTER::GAME_SUMMON )
|
|
return GetObject( pCreature->GetMaster() );
|
|
return NULL;
|
|
}
|
|
|
|
SGameAvatarEx* SUIPartyStateWnd::GetObject( AR_HANDLE handle )
|
|
{
|
|
SGame* pGame = m_pGameManager->GetActiveGame();
|
|
if( !pGame || pGame->GetGameType() != GAME_TYPE_WORLD )
|
|
return NULL;
|
|
|
|
return (SGameAvatarEx*)(pGame->GetGameObject(handle));
|
|
}
|
|
|
|
void SUIPartyStateWnd::Move( int nX, int nY )
|
|
{
|
|
int nResolution_Width = GetGameOption().GetResolution_Width();
|
|
|
|
int nTempX( nX );
|
|
int nWidth( GetRect().GetWidth() );
|
|
bool bMoveRight( !IsRenderStateLeft(nTempX+nWidth) );
|
|
|
|
if( bMoveRight )
|
|
{
|
|
nTempX = nTempX - (nWidth+c_nPartyWndWidthSize);
|
|
|
|
if( m_bLeftRender )
|
|
{
|
|
SUIPartyStateSetWnd* pStateSetWnd(NULL);
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
pStateSetWnd = dynamicCast<SUIPartyStateSetWnd*>(GetChild( CStringUtil::StringFormat( c_lpStateSetID, i ).c_str() ));
|
|
if( pStateSetWnd ) pStateSetWnd->SwapPos(false);
|
|
|
|
pStateSetWnd = dynamicCast<SUIPartyStateSetWnd*>(GetChild( CStringUtil::StringFormat( c_lpCreatureStateSetID, i ).c_str() ));
|
|
if( pStateSetWnd ) pStateSetWnd->SwapPos(false);
|
|
}
|
|
m_bLeftRender = false;
|
|
}
|
|
}
|
|
else if( !m_bLeftRender )
|
|
{
|
|
SUIPartyStateSetWnd* pStateSetWnd(NULL);
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
pStateSetWnd = dynamicCast<SUIPartyStateSetWnd*>(GetChild( CStringUtil::StringFormat( c_lpStateSetID, i ).c_str() ));
|
|
if( pStateSetWnd ) pStateSetWnd->SwapPos(true);
|
|
|
|
pStateSetWnd = dynamicCast<SUIPartyStateSetWnd*>(GetChild( CStringUtil::StringFormat( c_lpCreatureStateSetID, i ).c_str() ));
|
|
if( pStateSetWnd ) pStateSetWnd->SwapPos(true);
|
|
}
|
|
m_bLeftRender = true;
|
|
}
|
|
|
|
MovePos( nTempX, nY );
|
|
}
|
|
|
|
bool SUIPartyStateWnd::IsRenderStateLeft( int nRight/*=-1*/ )
|
|
{
|
|
int nResolution_Width = GetGameOption().GetResolution_Width();
|
|
if( nRight == -1 ) nRight = GetRect().right;
|
|
|
|
return nRight < nResolution_Width;
|
|
}
|
|
|
|
void SUIPartyStateWnd::RefreshSlots()
|
|
{
|
|
DisableAllSlots();
|
|
|
|
if( !m_bStateRender ) return;
|
|
#ifdef _PARTY_RENEWAL_ //2011.09.15 - servantes : test code
|
|
bool bExist = m_PartyMgr.IsExist();
|
|
int nCount( m_PartyMgr.GetMemberCount() );
|
|
if( !bExist || nCount <= 0 ) return;
|
|
|
|
RefreshEnableSlots();
|
|
|
|
nCount = min( c_nMaxLine, nCount );
|
|
ChangeSize( nCount );
|
|
#endif
|
|
}
|
|
|
|
void SUIPartyStateWnd::RefreshEnableSlots()
|
|
{
|
|
// RefreshCreatureSlots();
|
|
/*
|
|
// 첫번째 슬롯은 파튀장의 것
|
|
SPlayerSlot* pSlot( NULL );
|
|
pSlot = m_PartyMgr.GetLeaderInfo();
|
|
SetSlotData_N_Enable( 0, pSlot, false );
|
|
if( pSlot )
|
|
{
|
|
SetCreatureMaster( 0, pSlot->GetHandle() );
|
|
if( m_vecCreatureList[0].bRender )
|
|
SetSlotData_N_Enable( 0, m_vecCreatureList[0].hCreature1st, true );
|
|
}
|
|
|
|
std::vector<SPlayerSlot*>& vecMemberList = m_PartyMgr.GetMemberList();
|
|
|
|
int nIndex(1);
|
|
std::vector<SPlayerSlot*>::const_iterator it = vecMemberList.begin();
|
|
int nCount = static_cast<int>( vecMemberList.size() );
|
|
nCount = min( c_nMaxLine, nCount );
|
|
|
|
size_t nMemberSize = vecMemberList.size();
|
|
for( int i(0), nIndex(1); i<nMemberSize; ++i )
|
|
{
|
|
if( vecMemberList[i]->IsLeader() ) continue;
|
|
|
|
SetSlotData_N_Enable( nIndex, vecMemberList[i], false );
|
|
SetCreatureMaster( nIndex, vecMemberList[i]->GetHandle() );
|
|
if( m_vecCreatureList[nIndex].bRender )
|
|
SetSlotData_N_Enable( nIndex, m_vecCreatureList[nIndex].hCreature1st, true );
|
|
nIndex++;
|
|
}
|
|
*/
|
|
//순차분배 수정: 파티장이 0번 슬롯에 나오던 부분을 자기 위치에 나오도록 수정
|
|
//2009-02-23: hunee
|
|
// 첫번째 슬롯은 파튀장의 것
|
|
/*SPlayerSlot* pSlot( NULL );
|
|
pSlot = m_PartyMgr.GetLeaderInfo();
|
|
SetSlotData_N_Enable( 0, pSlot, false );
|
|
if( pSlot )
|
|
{
|
|
SetCreatureMaster( 0, pSlot->GetHandle() );
|
|
if( m_vecCreatureList[0].bRender )
|
|
SetSlotData_N_Enable( 0, m_vecCreatureList[0].hCreature1st, true );
|
|
}*/
|
|
|
|
std::vector<SPlayerSlot*>& vecMemberList = m_PartyMgr.GetMemberList();
|
|
|
|
std::vector<SPlayerSlot*>::const_iterator it = vecMemberList.begin();
|
|
int nCount = static_cast<int>( vecMemberList.size() );
|
|
nCount = min( c_nMaxLine, nCount );
|
|
|
|
int nIndex(0);
|
|
size_t nMemberSize = vecMemberList.size();
|
|
for( int i(0); i<nMemberSize; ++i )
|
|
{
|
|
//if( vecMemberList[i]->IsLeader() ) continue;
|
|
|
|
SetSlotData_N_Enable( nIndex, vecMemberList[i], false );
|
|
SetCreatureMaster( nIndex, vecMemberList[i]->GetHandle() );
|
|
// 2010.08.30 - prodongi
|
|
//if( m_vecCreatureList[nIndex].bRender )
|
|
if (m_vecCreatureList[nIndex].bRender && m_vecCreatureList[nIndex].bRenderUI)
|
|
SetSlotData_N_Enable( nIndex, m_vecCreatureList[nIndex].hCreature1st, true );
|
|
nIndex++;
|
|
}
|
|
}
|
|
|
|
void SUIPartyStateWnd::RefreshCreatureSlots()
|
|
{
|
|
int nIndex(-1);
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
if( m_vecCreatureList[i].hMaster )
|
|
{
|
|
nIndex = m_PartyMgr.GetMemberIndex( m_vecCreatureList[i].hMaster );
|
|
if( nIndex>=0 && nIndex != i && nIndex < c_nMaxLine )
|
|
{
|
|
m_vecCreatureList[nIndex].hCreature1st = m_vecCreatureList[i].hCreature1st;
|
|
m_vecCreatureList[nIndex].hMaster = m_vecCreatureList[i].hMaster;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void SUIPartyStateWnd::DisableAllSlots()
|
|
{
|
|
AR_HANDLE hNULL(NULL);
|
|
for( int i = 0; i < c_nMaxLine; i++ )
|
|
{
|
|
SetSlotData_N_Enable(i, hNULL, true);
|
|
SetSlotData_N_Enable(i, hNULL, false);
|
|
}
|
|
}
|
|
|
|
void SUIPartyStateWnd::SetSlotData_N_Enable( int nIndex, SPlayerSlot* pSlot, bool bCreature )
|
|
{
|
|
if( nIndex<0 || nIndex>=c_nMaxLine ) return;
|
|
|
|
if( pSlot )
|
|
SetSlotData_N_Enable( nIndex, pSlot->GetHandle(), bCreature );
|
|
}
|
|
|
|
void SUIPartyStateWnd::SetSlotData_N_Enable( int nIndex, AR_HANDLE handle, bool bCreature )
|
|
{
|
|
if( nIndex<0 || nIndex>=c_nMaxLine ) return;
|
|
|
|
SUIPartyStateSetWnd* pStateSetWnd(NULL);
|
|
if( bCreature )
|
|
pStateSetWnd = dynamicCast<SUIPartyStateSetWnd*>(GetChild( CStringUtil::StringFormat( c_lpCreatureStateSetID, nIndex ).c_str() ));
|
|
else pStateSetWnd = dynamicCast<SUIPartyStateSetWnd*>(GetChild( CStringUtil::StringFormat( c_lpStateSetID, nIndex ).c_str() ));
|
|
|
|
if( pStateSetWnd )
|
|
{
|
|
pStateSetWnd->SetPlayer( handle );
|
|
|
|
bool bShow( pStateSetWnd->IsLogin() );
|
|
if( bCreature ) bShow = (m_CreatureStateRender[nIndex] && bShow);
|
|
else bShow = (m_MemberStateRender[nIndex] && bShow);
|
|
|
|
pStateSetWnd->SetShow( bShow );
|
|
if( bShow ) pStateSetWnd->RefreshAllStateSlot();
|
|
}
|
|
}
|
|
|
|
void SUIPartyStateWnd::ChangeSize( int nCount )
|
|
{
|
|
//SPlayerSlot* pSlot = m_PartyMgr.GetLeaderInfo();
|
|
|
|
int nPos_Y( GetRect().top );
|
|
|
|
/*
|
|
//nPos_Y += m_vecCreatureList[0].bRender ? c_nDelta+c_nCreatureDelta : c_nDelta;//nPos_Y += IsAddCreature(pSlot->GetHandle(), true) ? c_nDelta+c_nCreatureDelta : c_nDelta;
|
|
std::vector<SPlayerSlot*>& vecMemberList = m_PartyMgr.GetMemberList();
|
|
|
|
size_t nMemberSize = vecMemberList.size();
|
|
for( int i(0), j(1); i<nMemberSize; ++i, ++j )
|
|
{
|
|
if( !vecMemberList[i] || vecMemberList[i]->IsLeader() )
|
|
{ --j;
|
|
continue;
|
|
}
|
|
|
|
MoveStateWindow(j, nPos_Y, false);
|
|
nPos_Y += c_nDelta;
|
|
|
|
if( m_vecCreatureList[j].bRender )
|
|
{
|
|
MoveStateWindow(j, nPos_Y, true);
|
|
nPos_Y += c_nCreatureDelta;
|
|
}
|
|
}
|
|
*/
|
|
//파티장 맨위로 가는부분 수정시 크리쳐 슬롯 위치 지대로 못 잡는 부분 수정
|
|
//2009-05-27: hunee
|
|
std::vector<SPlayerSlot*>& vecMemberList = m_PartyMgr.GetMemberList();
|
|
|
|
size_t nMemberSize = vecMemberList.size();
|
|
for( int i(0); i<nMemberSize; ++i )
|
|
{
|
|
MoveStateWindow(i, nPos_Y, false);
|
|
nPos_Y += c_nDelta;
|
|
|
|
if( m_vecCreatureList[i].bRender )
|
|
{
|
|
MoveStateWindow(i, nPos_Y, true);
|
|
nPos_Y += c_nCreatureDelta;
|
|
}
|
|
}
|
|
KRect rcNew = GetRect();
|
|
rcNew.bottom = nPos_Y + 3;
|
|
Resize( rcNew );
|
|
SetCorrectionRect( rcNew, false );
|
|
}
|
|
|
|
bool SUIPartyStateWnd::IsAddCreature( AR_HANDLE handle, bool bMaster/*=false*/ )
|
|
{
|
|
if( handle == NULL ) return false;
|
|
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
if( bMaster && m_vecCreatureList[i].hMaster == handle )
|
|
if( m_vecCreatureList[i].hCreature1st != NULL )
|
|
return true;
|
|
|
|
if( !bMaster && m_vecCreatureList[i].hCreature1st == handle )
|
|
if( m_vecCreatureList[i].hMaster != NULL )
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void SUIPartyStateWnd::MoveStateWindow( int nIndex, int nY, bool Creature )
|
|
{
|
|
SUIPartyStateSetWnd* pStateSetWnd(NULL);
|
|
|
|
if( Creature )
|
|
{
|
|
pStateSetWnd = dynamicCast<SUIPartyStateSetWnd*>(GetChild( CStringUtil::StringFormat( c_lpCreatureStateSetID, nIndex ).c_str() ));
|
|
if( pStateSetWnd ) pStateSetWnd->MovePos( pStateSetWnd->GetRect().left, nY );
|
|
}
|
|
else
|
|
{
|
|
pStateSetWnd = dynamicCast<SUIPartyStateSetWnd*>(GetChild( CStringUtil::StringFormat( c_lpStateSetID, nIndex ).c_str() ));
|
|
if( pStateSetWnd ) pStateSetWnd->MovePos( pStateSetWnd->GetRect().left, nY );
|
|
}
|
|
}
|
|
|
|
SUIPartyStateSetWnd* SUIPartyStateWnd::GetChildWnd( AR_HANDLE handle )
|
|
{
|
|
SUIPartyStateSetWnd* pStateSetWnd(NULL);
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
pStateSetWnd = dynamicCast<SUIPartyStateSetWnd*>(GetChild( CStringUtil::StringFormat( c_lpStateSetID, i ).c_str() ));
|
|
if( pStateSetWnd && pStateSetWnd->IsEqualPlayer(handle) )
|
|
return pStateSetWnd;
|
|
}
|
|
|
|
for( int i(0); i<c_nMaxLine; ++i )
|
|
{
|
|
pStateSetWnd = dynamicCast<SUIPartyStateSetWnd*>(GetChild( CStringUtil::StringFormat( c_lpCreatureStateSetID, i ).c_str() ));
|
|
if( pStateSetWnd && pStateSetWnd->IsEqualPlayer(handle) )
|
|
return pStateSetWnd;
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
DWORD SUIPartyStateWnd::OnMouseMessage(DWORD dwMessage, int x, int y)
|
|
{
|
|
if( dwMessage == KLBUTTON_DOWN )
|
|
return 0;
|
|
|
|
return SUIWnd::OnMouseMessage( dwMessage, x, y );
|
|
}
|
|
|
|
|
|
|
|
SUIMessengerPrivateMenuWnd::SUIMessengerPrivateMenuWnd( SGameManager* pGameManager, SUIDisplayInfo* pDisplayInfo )
|
|
: SUIWnd( pGameManager ), m_pDisplayInfo( pDisplayInfo ), m_nIndex(-1), m_bSendMsg(false), m_bPlayer(false), m_bRender(false)
|
|
{
|
|
//for( int i(0); i<SLOT_MAXLINE; ++i )
|
|
//{
|
|
// m_MemberStateRender[i] = true;
|
|
// m_CreatureStateRender[i] = true;
|
|
//}
|
|
}
|
|
|
|
bool SUIMessengerPrivateMenuWnd::InitControls( KPoint kPos )
|
|
{
|
|
KUIControlSimpleButton* pButton = dynamicCast<KUIControlSimpleButton*>(GetChild( "removebutton" ));
|
|
if( pButton ) pButton->SetEnableColor("");
|
|
|
|
return SUIWnd::InitControls( kPos );
|
|
}
|
|
|
|
void SUIMessengerPrivateMenuWnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch( nMessage )
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK:
|
|
{
|
|
if( !m_bSendMsg )
|
|
{
|
|
if( !m_bPlayer )
|
|
{
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, number_t( m_nIndex ), "remove_creature_index" ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, number_t( m_nIndex ), "remove_creature_index" ) );
|
|
}
|
|
else
|
|
{
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, number_t( m_nIndex ), "add_creature_index" ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, number_t( m_nIndex ), "add_creature_index" ) );
|
|
}
|
|
m_bSendMsg = true;
|
|
}
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PRIVATE_PARTY_MENU, false) );
|
|
}
|
|
break;
|
|
case KUI_MESSAGE::KCHECK_CHANGE:
|
|
{
|
|
KUIControlCheck * pCheck = dynamicCast<KUIControlCheck*>(GetChild( "rendercheck" ));
|
|
if( pCheck )
|
|
{
|
|
SIMSG_UI_SEND_DATA Msg;
|
|
Msg.m_nNumber2 = number_t( m_nIndex );
|
|
Msg.m_nTarget = SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE;
|
|
|
|
if( m_bPlayer )
|
|
{
|
|
Msg.m_nNumber = number_t( TS_ENTER::GAME_PLAYER );
|
|
|
|
if( pCheck->GetCheck() )
|
|
Msg.m_strString = "one_state_on";
|
|
else Msg.m_strString = "one_state_off";
|
|
}
|
|
else
|
|
{
|
|
Msg.m_nNumber = number_t( TS_ENTER::GAME_SUMMON );
|
|
|
|
if( pCheck->GetCheck() )
|
|
Msg.m_strString = "one_state_on";
|
|
else Msg.m_strString = "one_state_off";
|
|
}
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &Msg );
|
|
}
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PRIVATE_PARTY_MENU, false) );
|
|
}
|
|
break;
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
void SUIMessengerPrivateMenuWnd::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
switch( pMsg->nType )
|
|
{
|
|
case IMSG_UI_OPEN_PRIVATE_MENU:
|
|
{
|
|
SIMSG_UI_OPEN_PRIVATE_MENU *pData = (SIMSG_UI_OPEN_PRIVATE_MENU*)pMsg;
|
|
if( IsShow() )
|
|
{
|
|
if( pData->m_nIndex < 0 || pData->m_nIndex >= SLOT_MAXLINE )
|
|
break;
|
|
|
|
m_nIndex = pData->m_nIndex;
|
|
MovePos( pData->m_nX, pData->m_nY );
|
|
m_bRender = pData->m_bRender;
|
|
|
|
KUIControlSimpleButton* pButton = dynamicCast<KUIControlSimpleButton*>(GetChild( "removebutton" ));
|
|
KUIControlCheck * pCheck = dynamicCast<KUIControlCheck*>(GetChild( "rendercheck" ));
|
|
if( pData->m_bPlayer )
|
|
{
|
|
m_bPlayer = true;
|
|
|
|
if( pButton ) pButton->SetCaption( CStringUtil::StringFormat("<size:10><hcenter><vcenter>%s", S(-491)).c_str() );
|
|
if( pCheck ) pCheck->SetCheck(m_bRender);
|
|
}
|
|
else
|
|
{
|
|
m_bPlayer = false;
|
|
if( pButton ) pButton->SetCaption( CStringUtil::StringFormat("<size:10><hcenter><vcenter>%s", S(-492)).c_str() );
|
|
if( pCheck ) pCheck->SetCheck(m_bRender);
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
void SUIMessengerPrivateMenuWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
SUIWnd::OnNotifyUIWindowOpen(bOpen);
|
|
|
|
if( bOpen )
|
|
{
|
|
m_bSendMsg = false;
|
|
m_bPlayer = false;
|
|
}
|
|
}
|
|
|
|
SUITopPartyWnd* g_pUITopPartyWnd;
|
|
|
|
SUITopPartyWnd::SUITopPartyWnd( SGameManager* pGameManager, SUIDisplayInfo* pDisplayInfo )
|
|
: SUIWnd( pGameManager ), m_pDisplayInfo( pDisplayInfo )
|
|
{
|
|
m_pWndBig = NULL;
|
|
m_pWndSml = NULL;
|
|
m_nUISizeState = PARTY_UI_SIZE_SMALL;
|
|
|
|
g_pUITopPartyWnd = this;
|
|
}
|
|
|
|
SUIWnd* SUITopPartyWnd::CreateWnd( const char* szFile, KUIWndManager* pWndManager, KPoint kPos, int nWindowID )
|
|
{
|
|
SUIWnd::CreateWnd( szFile, pWndManager, kPos, nWindowID );
|
|
|
|
SUIMessengerWnd* pSmallWnd = new SUIMessengerWnd( m_pGameManager,m_pDisplayInfo ); // 2011.09.07 - servantes
|
|
if(pSmallWnd)
|
|
{
|
|
pSmallWnd->CreateWnd( "window_player_party_main_small.nui", pWndManager, KPoint(kPos.x, kPos.y) );
|
|
pSmallWnd->SetParent(this);
|
|
m_pWndSml = pSmallWnd;
|
|
m_pWndSml->SetShow(false);
|
|
m_pWndSml->SetUISizeState(PARTY_UI_SIZE_SMALL);
|
|
|
|
AddChild(m_pWndSml);
|
|
}
|
|
|
|
SUIMessengerWnd* pBigWnd = new SUIMessengerWnd( m_pGameManager,m_pDisplayInfo ); // 2011.09.07 - servantes
|
|
if(pBigWnd)
|
|
{
|
|
pBigWnd->CreateWnd( "window_player_party_main.nui", pWndManager, KPoint(kPos.x, kPos.y) );
|
|
pBigWnd->SetParent(this);
|
|
m_pWndBig = pBigWnd;
|
|
m_pWndBig->SetShow(true);
|
|
m_pWndBig->SetUISizeState(PARTY_UI_SIZE_BIG);
|
|
|
|
AddChild(m_pWndBig);
|
|
}
|
|
|
|
SetUISizeState(PARTY_UI_SIZE_BIG); // 2011.09.22 : servantes : 크기 상태 설정
|
|
|
|
return this;
|
|
}
|
|
|
|
bool SUITopPartyWnd::InitControls( KPoint kPos )
|
|
{
|
|
KRect rt(0, 17, 138, 17+23);
|
|
// KUIControlStatic* pZone = dynamicCast<KUIControlStatic*>(GetChild( "party_base" ));
|
|
// if(pZone)
|
|
// rt = pZone->GetRect();
|
|
SetCustomMovingRect(rt); // 타이틀 바 선택 영역, 이동위해 클릭 Area
|
|
|
|
return SUIWnd::InitControls( kPos );
|
|
}
|
|
|
|
void SUITopPartyWnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch( nMessage )
|
|
{
|
|
case KUI_MESSAGE::KGENWND_MOVE: // 윈도우 이동 2011.10.04 - servantes
|
|
{
|
|
LimitMoveWnd(); // 게임 외부로 나가지 못하게 제한
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, GetRect().right, GetRect().top + c_nTitleSize ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, GetRect().right, GetRect().top + c_nTitleSize ) );
|
|
}
|
|
break;
|
|
}
|
|
|
|
/*
|
|
if(m_bUseSmallUI == true) // small
|
|
{
|
|
switch( nMessage )
|
|
{
|
|
case KUI_MESSAGE::KGENWND_MOVE: // 윈도우 이동 2011.09.07 - servantes
|
|
{
|
|
LimitMoveWnd(); // 게임 외부로 나가지 못하게 제한
|
|
|
|
// m_pWndSml->ProcMsgAtStatic(&SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, GetRect().right, GetRect().top ));
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, GetRect().right, GetRect().top ) ); // 2011.09.14 - servantes : 메뉴 ui 위치 보정
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, GetRect().right, GetRect().top+c_nTitleSize ) );
|
|
|
|
return SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
case KUI_MESSAGE::KBUTTON_CLICK:
|
|
{
|
|
if( ::_stricmp( lpszControlID, "button_suboption" ) == 0 )
|
|
{
|
|
// 파티창이 작음으로 파티 메뉴창을 파티창 옆으로 옮겨준다
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, "beside_partywnd", -40, 0 ) ); // servantes 2011.09.08
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
// if(m_pWndSml)
|
|
// m_pWndSml->PumpUpMessage(lpszControlID, nMessage, lparam, wparam);
|
|
}
|
|
else
|
|
{
|
|
switch( nMessage )
|
|
{
|
|
case KUI_MESSAGE::KGENWND_MOVE: // 윈도우 이동 2011.09.07 - servantes
|
|
{
|
|
LimitMoveWnd(); // 게임 외부로 나가지 못하게 제한
|
|
|
|
// m_pWndBig->ProcMsgAtStatic(&SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, GetRect().right, GetRect().top ));
|
|
|
|
KRect rt = GetRect();
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, rt.right, rt.top ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, rt.right, rt.top+c_nTitleSize ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1, rt.right, rt.top+c_nTitleSize ) );
|
|
|
|
return SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
}
|
|
|
|
// if(m_pWndBig)
|
|
// m_pWndBig->PumpUpMessage(lpszControlID, nMessage, lparam, wparam);
|
|
}
|
|
*/
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
DWORD SUITopPartyWnd::OnMouseMessage(DWORD dwMessage, int x, int y) // 2011.09.16 servantes : OnMouseMessage추가
|
|
{
|
|
/* if(dwMessage == KRBUTTON_DOWN)
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1, true ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1, GetRect().right, GetRect().top + c_nTitleSize ) );
|
|
}
|
|
else if(dwMessage == KLBUTTON_DOWN) //KMOUSE_MOVE)
|
|
{
|
|
SUIWnd* pWnd = m_pGameManager->GetSUI(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1);
|
|
if(NULL == pWnd)
|
|
return SUIWnd::OnMouseMessage( dwMessage, x, y );
|
|
|
|
if(pWnd->IsShow())
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1, false ) );
|
|
}
|
|
}
|
|
*/
|
|
return SUIWnd::OnMouseMessage( dwMessage, x, y );
|
|
}
|
|
|
|
void SUITopPartyWnd::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
XSTART_PROFILE( "SUITopPartyWnd::ProcMsgAtStatic", 100 );
|
|
|
|
switch( pMsg->nType ) // 2011.09.15 - servantes : IMSG_UI_SEND_DATA 추가
|
|
{
|
|
case IMSG_UI_MOVE: // 2011.10.04 - servantes : 이동
|
|
{
|
|
SIMSG_UI_MOVE* pMoveMsg = ( SIMSG_UI_MOVE* )pMsg;
|
|
|
|
LimitMoveWnd(); // 게임 외부로 나가지 못하게 제한
|
|
|
|
KRect rt = GetRect();
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, rt.right, rt.top + c_nTitleSize ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, rt.right, rt.top + c_nTitleSize ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1, rt.right, rt.top + c_nTitleSize ) );
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case IMSG_UI_RECT: // 2011.09.08 - servantes : 영역얻기
|
|
{
|
|
SIMSG_UI_RECT* pRMsg = (SIMSG_UI_RECT*)pMsg;
|
|
pRMsg->rt = GetRect();
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case IMSG_SET_PARTY_TYPE: // 2011.09.20 : 파티타입
|
|
{
|
|
SMSG_SET_PARTY_TYPE *pData = (SMSG_SET_PARTY_TYPE*)pMsg;
|
|
SetPartyType( pData->nPartyType ); // 파티타입설정
|
|
break;
|
|
}
|
|
case IMSG_UI_SEND_DATA:
|
|
{
|
|
SIMSG_UI_SEND_DATA *pData = (SIMSG_UI_SEND_DATA *)pMsg;
|
|
|
|
if ( pData->m_strString == "partywnd_minimize" ) // to small
|
|
{
|
|
ChangeWndState( 1 );
|
|
KRect rt2 = this->GetRect();
|
|
KRect rt(rt2.left, rt2.top, rt2.left + 97, rt2.top + 17+18);
|
|
this->SetRect(rt);
|
|
|
|
KRect rt3 = m_pWndSml->GetRect();
|
|
KRect rt4(rt3.left, rt3.top, rt3.left + 97, rt3.top + 17+18);
|
|
m_pWndSml->SetRect(rt4);
|
|
|
|
KRect rt5 = m_pWndBig->GetRect();
|
|
KRect rt6(rt5.left, rt5.top, rt5.left + 97, rt5.top + 17+18);
|
|
m_pWndBig->SetRect(rt6);
|
|
|
|
m_pWndSml->SetUpClickDragRect(); // 2011.09.19 : servantes : UI 영역 재설정(클릭, 드래그)
|
|
m_pWndBig->SetUpClickDragRect(); // 2011.09.19 : servantes : UI 영역 재설정(클릭, 드래그)
|
|
}
|
|
else if( pData->m_strString == "partywnd_maximize" ) // to big
|
|
{
|
|
ChangeWndState( 0 );
|
|
KRect rt2 = this->GetRect();
|
|
KRect rt(rt2.left, rt2.top, rt2.left + 138, rt2.top + 17+23);
|
|
this->SetRect(rt);
|
|
|
|
KRect rt3 = m_pWndBig->GetRect();
|
|
KRect rt4(rt3.left, rt3.top, rt3.left + 138, rt3.top + 17+23);
|
|
m_pWndBig->SetRect(rt4);
|
|
|
|
KRect rt5 = m_pWndSml->GetRect();
|
|
KRect rt6(rt5.left, rt5.top, rt5.left + 138, rt5.top + 17+23);
|
|
m_pWndSml->SetRect(rt6);
|
|
|
|
m_pWndSml->SetUpClickDragRect(); // 2011.09.19 : servantes : UI 영역 재설정(클릭, 드래그)
|
|
m_pWndBig->SetUpClickDragRect(); // 2011.09.19 : servantes : UI 영역 재설정(클릭, 드래그)
|
|
}
|
|
else if( pData->m_strString == "add_party_members") // 2011.09.27 : servantes : 멤버 UI 슬롯 활성화
|
|
{
|
|
m_pWndSml->SetUpClickDragRect(); // 2011.09.19 : servantes : UI 영역 재설정(클릭, 드래그)
|
|
m_pWndBig->SetUpClickDragRect(); // 2011.09.19 : servantes : UI 영역 재설정(클릭, 드래그)
|
|
}
|
|
else if( pData->m_strString == "delete_party_members") // 2011.09.27 : servantes : 멤버 UI 슬롯 비활성화
|
|
{
|
|
m_pWndSml->DisableSlots();
|
|
m_pWndBig->DisableSlots();
|
|
}
|
|
else if( pData->m_strString == "add_party_member" )
|
|
{
|
|
;
|
|
}
|
|
else if( pData->m_strString == "del_party_member" )
|
|
{
|
|
m_PartyMgr.DeleteMember("아술아"); // 파티원 하나 더 추가 해서 삭제 테스트
|
|
// SetUpClickDragRect(); // UI 영역 재설정(클릭, 드래그)
|
|
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
|
|
m_pWndSml->RefreshSlots(); // 슬롯 갱신
|
|
else
|
|
m_pWndBig->RefreshSlots(); // 슬롯 갱신
|
|
}
|
|
else if( pData->m_strString == "set_party_type_normal" )
|
|
{
|
|
SetPartyType(PARTY_NORMAL);
|
|
}
|
|
else if( pData->m_strString == "set_party_type_bearload" )
|
|
{
|
|
SetPartyType(PARTY_BEARROAD);
|
|
}
|
|
else if( pData->m_strString == "set_party_type_dungeon_raid" )
|
|
{
|
|
SetPartyType(PARTY_DUNGEON_RAID);
|
|
}
|
|
else if( pData->m_strString == "set_party_type_siege" )
|
|
{
|
|
SetPartyType(PARTY_SIEGE);
|
|
}
|
|
else if( pData->m_strString == "set_party_type_siege_other" )
|
|
{
|
|
SetPartyType(PARTY_SIEGE_OTHER);
|
|
}
|
|
else if( pData->m_strString == "set_party_add_lable4" )
|
|
{
|
|
int k=0;
|
|
}
|
|
else if( pData->m_strString == "set_party_add_lable1" )
|
|
{
|
|
int k=0;
|
|
}
|
|
else if( pData->m_strString == "show_small_ui" )
|
|
{
|
|
ChangeWndState(0);
|
|
}
|
|
else if( pData->m_strString == "show_big_ui" )
|
|
{
|
|
ChangeWndState(1);
|
|
}
|
|
else if( pData->m_strString == "select_member_request_trade" )
|
|
{
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL) // 0:small
|
|
m_pWndSml->SendUIMessage( &SIMSG_UI_SEND_DATA((SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE)0, "select_member_request_trade") );
|
|
else
|
|
m_pWndBig->SendUIMessage( &SIMSG_UI_SEND_DATA((SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE)0, "select_member_request_trade") );
|
|
}
|
|
|
|
break;
|
|
}
|
|
}
|
|
|
|
if(m_nUISizeState == PARTY_UI_ID_SMALL)
|
|
m_pWndSml->ProcMsgAtStatic( pMsg );
|
|
else
|
|
m_pWndBig->ProcMsgAtStatic( pMsg );
|
|
}
|
|
|
|
void SUITopPartyWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
SUIWnd::OnNotifyUIWindowOpen(bOpen);
|
|
}
|
|
|
|
//2011.09.28 : servantes : 작은 UI와 큰 UI간의 메세지 전달 함수
|
|
void SUITopPartyWnd::DeleverMessage(int nSendID, int nReceiveID, const char* pStrMessage, int w, int l)
|
|
{
|
|
if (nSendID == PARTY_UI_ID_SMALL)
|
|
{
|
|
if (nReceiveID == PARTY_UI_ID_BIG) // 작은 ui가 큰 ui에 보냄
|
|
{
|
|
if(::_stricmp( pStrMessage, "push_minimize_button" ) == 0)
|
|
m_pWndBig->ChangeVisibleMinimizeManimizeButtom( TO_BE_MIN );
|
|
if(::_stricmp( pStrMessage, "push_maximize_button" ) == 0)
|
|
m_pWndBig->ChangeVisibleMinimizeManimizeButtom( TO_BE_MAX );
|
|
}
|
|
}
|
|
else if(nSendID == PARTY_UI_ID_BIG)
|
|
{
|
|
if (nReceiveID == PARTY_UI_ID_SMALL) // 큰 ui가 작은 ui에 보냄
|
|
{
|
|
if(::_stricmp( pStrMessage, "push_minimize_button" ) == 0)
|
|
m_pWndSml->ChangeVisibleMinimizeManimizeButtom( TO_BE_MIN );
|
|
if(::_stricmp( pStrMessage, "push_maximize_button" ) == 0)
|
|
m_pWndSml->ChangeVisibleMinimizeManimizeButtom( TO_BE_MAX );
|
|
}
|
|
}
|
|
}
|
|
|
|
void SUITopPartyWnd::ChangeWndState(int nUISizeState) // 0:small / 1:big
|
|
{
|
|
//OutputDebugString( "SUITopPartyWnd::ChangeWndState\n" );
|
|
|
|
if(nUISizeState == PARTY_UI_SIZE_SMALL) // 0:small
|
|
{
|
|
m_nUISizeState = PARTY_UI_SIZE_SMALL; // 2011.09.23 : servantes : 크기상태설정
|
|
|
|
m_pWndSml->SetShow(true);
|
|
m_pWndBig->SetShow(false);
|
|
SetUpClickDragRect(); // UI 영역 재설정(클릭, 드래그)
|
|
m_pWndSml->RefreshSlots(); // 슬롯 갱신
|
|
}
|
|
else if(nUISizeState == PARTY_UI_SIZE_BIG)
|
|
{
|
|
m_nUISizeState = PARTY_UI_SIZE_BIG; // 2011.09.23 : servantes : 크기상태설정
|
|
|
|
m_pWndSml->SetShow(false);
|
|
m_pWndBig->SetShow(true);
|
|
SetUpClickDragRect(); // UI 영역 재설정(클릭, 드래그)
|
|
m_pWndBig->RefreshSlots(); // 슬롯 갱신
|
|
}
|
|
|
|
SetUpClickDragRect();
|
|
}
|
|
|
|
int SUITopPartyWnd::GetPartyType() // 2011.09.19 : servantes : 파티 타입 얻기
|
|
{
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL) // 0:small
|
|
return m_pWndSml->GetPartyType();
|
|
|
|
return m_pWndBig->GetPartyType();
|
|
}
|
|
|
|
void SUITopPartyWnd::SetPartyType(int type) // 2011.09.19 : servantes : 파티 타입 설정 및 NUI 변경
|
|
{
|
|
m_nListSizeType = type;
|
|
m_pWndBig->SetPartyType(type);
|
|
m_pWndSml->SetPartyType(type);
|
|
|
|
SetUpClickDragRect();
|
|
}
|
|
|
|
void SUITopPartyWnd::SetUISizeState(int nState) // 2011.09.19 : servantes : UI 크기 상태
|
|
{
|
|
if(nState == PARTY_UI_SIZE_SMALL)
|
|
{
|
|
m_nUISizeState = PARTY_UI_SIZE_SMALL;
|
|
m_pWndBig->SetShow(false);
|
|
m_pWndSml->SetShow(true);
|
|
}
|
|
else
|
|
{
|
|
m_nUISizeState = PARTY_UI_SIZE_BIG;
|
|
m_pWndBig->SetShow(true);
|
|
m_pWndSml->SetShow(false);
|
|
}
|
|
}
|
|
|
|
void SUITopPartyWnd::SetListSizeType(int type) // 2011.09.19 : servantes : 리스트 크기 타입
|
|
{
|
|
if(type == PARTY_UI_LIST_SIZE_EXTEND)
|
|
{
|
|
m_nListSizeType = PARTY_UI_LIST_SIZE_EXTEND;
|
|
m_pWndBig->SetListSizeType(PARTY_UI_LIST_SIZE_EXTEND);
|
|
m_pWndSml->SetListSizeType(PARTY_UI_LIST_SIZE_EXTEND);
|
|
/*
|
|
if(m_nListSizeType == PARTY_UI_LIST_SIZE_EXTEND)
|
|
{
|
|
// UI 컨트롤 재배치
|
|
// 영역재설정
|
|
int k=0;
|
|
}
|
|
else
|
|
{
|
|
// UI 컨트롤 재배치
|
|
// 영역재설정
|
|
int k=0;
|
|
}*/
|
|
}
|
|
else
|
|
{
|
|
m_nListSizeType = PARTY_UI_LIST_SIZE_REDUCE;
|
|
m_pWndBig->SetListSizeType(PARTY_UI_LIST_SIZE_REDUCE);
|
|
m_pWndSml->SetListSizeType(PARTY_UI_LIST_SIZE_REDUCE);
|
|
/*
|
|
if(m_nListSizeType == PARTY_UI_LIST_SIZE_EXTEND)
|
|
{
|
|
// UI 컨트롤 재배치
|
|
// 영역재설정
|
|
int k=0;
|
|
}
|
|
else
|
|
{
|
|
// UI 컨트롤 재배치
|
|
// 영역재설정
|
|
int k=0;
|
|
}*/
|
|
}
|
|
}
|
|
|
|
void SUITopPartyWnd::SetSiegeUIType(int type) // 2011.09.19 : servantes : 공격대 UI 타입
|
|
{
|
|
/* m_nSiegeUIType = type;
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
|
|
{
|
|
// UI 컨트롤 재배치
|
|
int k=0;
|
|
}
|
|
else
|
|
{
|
|
// UI 컨트롤 재배치
|
|
int k=0;
|
|
}
|
|
*/
|
|
}
|
|
|
|
void SUITopPartyWnd::SetUpClickDragRect()
|
|
{
|
|
// 파티인원 X 리스트컨트롤 높이 만큼 영역 설정
|
|
/* std::vector<SPlayerSlot*> vecMemberList = m_PartyMgr.GetMemberList();
|
|
int sz = vecMemberList.size();
|
|
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL) // 작은 상태이면
|
|
{
|
|
if(m_nListSizeType == PARTY_UI_LIST_SIZE_REDUCE) //리스트를 접은 상태이면 : 2011.09.27 - servantes
|
|
sz = 0;
|
|
|
|
int tw = 97; // 작을 때 UI 폭
|
|
int th1 = 17; // UI 시작부터 최대, 최소화, 끄기 버튼의 높이
|
|
int th2 = 23; // 타이틀바 크기
|
|
int tL1 = 22; // 리스트 컨트롤의 리스트 레이블 한 개의 높이
|
|
int tL2 = tL1 * sz; // 파티 인원 X 리스트 컨트롤의 리스트 레이블 한 개의 높이
|
|
KRect rt2 = this->GetRect();
|
|
KRect rt(rt2.left, rt2.top, rt2.left + tw, rt2.top + tL2 + th1 + th2);
|
|
SetRect(rt);
|
|
Resize(rt);
|
|
}
|
|
else // 큰 상태이면
|
|
{
|
|
if(m_nListSizeType == PARTY_UI_LIST_SIZE_REDUCE) //리스트를 접은 상태이면 : 2011.09.27 - servantes
|
|
sz = 0;
|
|
|
|
int tw = 138; // 클을 때 UI 폭
|
|
int th1 = 17; // UI 시작부터 최대, 최소화, 끄기 버튼의 높이
|
|
int th2 = 18; // 타이틀바 크기
|
|
int tL1 = 30; // 리스트 컨트롤의 리스트 레이블 한 개의 높이
|
|
int tL2 = tL1 * sz; // 파티 인원 X 리스트 컨트롤의 리스트 레이블 한 개의 높이
|
|
KRect rt2 = this->GetRect();
|
|
KRect rt(rt2.left, rt2.top, rt2.left + tw, rt2.top + tL2 + th1 + th2);
|
|
SetRect(rt);
|
|
Resize(rt);
|
|
}
|
|
*/
|
|
/*
|
|
// 파티인원 X 리스트컨트롤 높이 만큼 영역 설정
|
|
std::vector<SPlayerSlot*> vecMemberList = m_PartyMgr.GetMemberList();
|
|
int sz = vecMemberList.size();
|
|
|
|
if(m_nListSizeType == PARTY_UI_LIST_SIZE_REDUCE) //리스트를 접은 상태이면 : 2011.09.27 - servantes
|
|
sz = 0;
|
|
|
|
int tw; // UI 폭
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
|
|
tw = 97;
|
|
else
|
|
tw = 138;
|
|
|
|
int th1 = 17; // UI 시작부터 최대, 최소화, 끄기 버튼의 높이
|
|
|
|
int th2 = 23; // 타이틀바 크기
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
|
|
th2 = 18;
|
|
|
|
int tL1 = 30; // 리스트 컨트롤의 리스트 레이블 한 개의 높이
|
|
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
|
|
tL1 = 22;
|
|
|
|
int tL2 = tL1 * sz; // 파티 인원 X 리스트 컨트롤의 리스트 레이블 한 개의 높이
|
|
KRect rt2 = this->GetRect();
|
|
KRect rt(rt2.left, rt2.top, rt2.left + tw, rt2.top + tL2 + th1 + th2);
|
|
SetRect(rt);
|
|
*/
|
|
m_pWndBig->SetUpClickDragRect();
|
|
m_pWndSml->SetUpClickDragRect();
|
|
}
|
|
|
|
|
|
|
|
#define STR_BTN_WHISPER "whisper_button" // 귓말하기
|
|
#define STR_BTN_ADD_FRIEND "add_friend_button" // 친구추가
|
|
#define STR_BTN_BLOCK "block_button" // 차단설정
|
|
#define STR_BTN_TRADE "trade_button" // 거래요청
|
|
#define STR_BTN_CHALLENGE "challenge_button" // 대련신청
|
|
#define STR_BTN_KICK_PARTY "kick_party_button" // 파티추방
|
|
#define STR_BTN_TAKEOVER_PARTY "takeover_party_button" // 파티장인계
|
|
#define STR_BTN_BUFF_ON "buff_on_button" // 버프 보이기
|
|
#define STR_BTN_CREATURE_ON "creature_on_button" // 크리처 보이기
|
|
#define STR_BTN_SHOW_UI_SMALL "ui_small_view_button" // UI 작게 보기
|
|
#define STR_BTN_BUFF_OFF "buff_off_button" // 버프 안보이기
|
|
#define STR_BTN_CREATURE_OFF "creature_off_button" // 크리처 안보이기
|
|
#define STR_BTN_SHOW_UI_BIG "ui_default_view_button" // UI 크게 보기
|
|
#define STR_BTN_FOLLOW "follow_button" // 따라가기
|
|
|
|
|
|
/// 우클릭 메뉴1 : 2011.09.16 - servantes
|
|
bool SUIRightMenu1Wnd::InitControls( KPoint kPos )
|
|
{
|
|
m_paMenuButton[RMN1_WHISPER ] = dynamicCast<KUIControlButton*>(GetChild("whisper_button"));
|
|
m_paMenuButton[RMN1_ADD_DRIEND ] = dynamicCast<KUIControlButton*>(GetChild("add_friend_button"));
|
|
m_paMenuButton[RMN1_BLOCK ] = dynamicCast<KUIControlButton*>(GetChild("block_button"));
|
|
m_paMenuButton[RMN1_REQUEST_DEAL ] = dynamicCast<KUIControlButton*>(GetChild("trade_button"));
|
|
m_paMenuButton[RMN1_REQUEST_FIGHT] = dynamicCast<KUIControlButton*>(GetChild("challenge_button"));
|
|
m_paMenuButton[RMN1_KICK_OUT ] = dynamicCast<KUIControlButton*>(GetChild("kick_party_button"));
|
|
m_paMenuButton[RMN1_CHANGE_LEADER] = dynamicCast<KUIControlButton*>(GetChild("takeover_party_button"));
|
|
m_paMenuButton[RMN1_SHOW_BUF ] = dynamicCast<KUIControlButton*>(GetChild("buff_on_button"));
|
|
m_paMenuButton[RMN1_SHOW_CREATURE] = dynamicCast<KUIControlButton*>(GetChild("creature_on_button"));
|
|
m_paMenuButton[RMN1_SHOW_SMALL_UI] = dynamicCast<KUIControlButton*>(GetChild("ui_small_view_button"));
|
|
m_paMenuButton[RMN1_HIDE_BUF ] = dynamicCast<KUIControlButton*>(GetChild("buff_off_button"));
|
|
m_paMenuButton[RMN1_HIDE_CREATURE] = dynamicCast<KUIControlButton*>(GetChild("creature_off_button"));
|
|
m_paMenuButton[RMN1_SHOW_BIG_UI ] = dynamicCast<KUIControlButton*>(GetChild("ui_default_view_button"));
|
|
m_paMenuButton[RMN1_FOLLOW ] = dynamicCast<KUIControlButton*>(GetChild("follow_button"));
|
|
|
|
m_paMenuButton[RMN1_HIDE_BUF ]->SetShow(false);
|
|
m_paMenuButton[RMN1_HIDE_CREATURE]->SetShow(false);
|
|
m_paMenuButton[RMN1_SHOW_BIG_UI ]->SetShow(false);
|
|
|
|
return SUIWnd::InitControls( kPos );
|
|
}
|
|
|
|
bool SUIRightMenu1Wnd::InitData( bool bReload )
|
|
{
|
|
return SUIWnd::InitData(bReload);
|
|
}
|
|
|
|
void SUIRightMenu1Wnd::ArrangeMenuByUISizeState(int nState)
|
|
{
|
|
int startx = 6, starty = 84, W = 114, H = 19;
|
|
if (nState == PARTY_UI_SIZE_SMALL) // 작게 보이는 상태일 경우
|
|
{
|
|
KRect rt = m_paMenuButton[RMN1_SHOW_SMALL_UI]->GetRect();
|
|
m_paMenuButton[RMN1_SHOW_BIG_UI ]->SetShow(true);
|
|
m_paMenuButton[RMN1_SHOW_SMALL_UI]->SetShow(false);
|
|
m_paMenuButton[RMN1_SHOW_BIG_UI ]->MovePos(rt.left, rt.top);
|
|
}
|
|
else if(nState == PARTY_UI_SIZE_BIG) // 크게 보이는 상태일 경우
|
|
{
|
|
KRect rt = m_paMenuButton[RMN1_SHOW_SMALL_UI]->GetRect();
|
|
m_paMenuButton[RMN1_SHOW_BIG_UI ]->SetShow(false);
|
|
m_paMenuButton[RMN1_SHOW_SMALL_UI]->SetShow(true);
|
|
m_paMenuButton[RMN1_SHOW_SMALL_UI]->MovePos(rt.left, rt.top);
|
|
}
|
|
}
|
|
|
|
void SUIRightMenu1Wnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch(nMessage)
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK:
|
|
{
|
|
BOOL bPushButton = FALSE;
|
|
if ( ::_stricmp( lpszControlID, STR_BTN_WHISPER ) == 0 ) // 귓말하기
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "whisper_chatting" ) );
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID, STR_BTN_ADD_FRIEND ) == 0 ) // 친구추가
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "add_friend" ) );
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID, STR_BTN_BLOCK ) == 0 ) // 차단설정
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "block_friend" ) );
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID, STR_BTN_TRADE ) == 0 ) // 거래요청
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "select_member_request_trade" ) );
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID, STR_BTN_CHALLENGE ) == 0 ) // 대련신청
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "request_compete" ) );
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID, STR_BTN_KICK_PARTY ) == 0 ) // 파티추방
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "kick_out_party" ) );
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID, STR_BTN_TAKEOVER_PARTY ) == 0 ) // 파티장인계
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "take_over_party" ) );
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID, STR_BTN_BUFF_ON ) == 0 ) // 버프 보이기
|
|
{
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID, STR_BTN_CREATURE_ON ) == 0 ) // 크리처 보이기
|
|
{
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID,STR_BTN_SHOW_UI_SMALL ) == 0 ) // UI 작게 보기
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "show_small_ui" ) );
|
|
|
|
ArrangeMenuByUISizeState(PARTY_UI_SIZE_SMALL);
|
|
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID,STR_BTN_BUFF_OFF ) == 0 ) // 버프 안보이기
|
|
{
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID,STR_BTN_CREATURE_OFF ) == 0 ) // 크리처 안보이기
|
|
{
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID,STR_BTN_SHOW_UI_BIG ) == 0 ) // UI 크게 보기
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "show_big_ui" ) );
|
|
|
|
ArrangeMenuByUISizeState(PARTY_UI_SIZE_BIG);
|
|
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID,STR_BTN_FOLLOW ) == 0 ) // 따라가기
|
|
{
|
|
if( m_PlayerInfoMgr.GetTarget() )
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SMSG_AUTO_FOLLOW() );
|
|
}
|
|
bPushButton = TRUE;
|
|
}
|
|
|
|
if(bPushButton)
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU1, false ) );
|
|
}
|
|
}
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
void SUIRightMenu1Wnd::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
XSTART_PROFILE( "SUIRightMenu1Wnd::ProcMsgAtStatic", 100 );
|
|
|
|
switch( pMsg->nType )
|
|
{
|
|
case IMSG_UI_MOVE:
|
|
{
|
|
SIMSG_UI_MOVE* pMoveMsg = ( SIMSG_UI_MOVE* )pMsg;
|
|
MovePos( pMoveMsg->m_nX, pMoveMsg->m_nY );
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
void SUIRightMenu1Wnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
SUIWnd::OnNotifyUIWindowOpen(bOpen);
|
|
}
|
|
|
|
|
|
#define STR_BTN2_BUFF_ON "buff_on_button" // 버프 보이기
|
|
#define STR_BTN2_CREATURE_ON "creature_on_button" // 크리처 보이기
|
|
#define STR_BTN2_BUFF_OFF "buff_off_button" // 버프 숨기기
|
|
#define STR_BTN2_CREATURE_OFF "creature_off_button" // 크리처 숨기기
|
|
|
|
/// 우클릭 메뉴2 : 2011.09.16 - servantes
|
|
bool SUIRightMenu2Wnd::InitControls( KPoint kPos )
|
|
{
|
|
m_paMenuButton[RMN2_SHOW_BUF ] = dynamicCast<KUIControlButton*>(GetChild("buff_on_button"));
|
|
m_paMenuButton[RMN2_SHOW_CREATURE] = dynamicCast<KUIControlButton*>(GetChild("creature_on_button"));
|
|
m_paMenuButton[RMN2_HIDE_BUF ] = dynamicCast<KUIControlButton*>(GetChild("buff_off_button"));
|
|
m_paMenuButton[RMN2_HIDE_CREATURE] = dynamicCast<KUIControlButton*>(GetChild("creature_off_button"));
|
|
|
|
m_paMenuButton[RMN2_HIDE_BUF ]->SetShow(false);
|
|
m_paMenuButton[RMN2_HIDE_CREATURE]->SetShow(false);
|
|
|
|
return SUIWnd::InitControls( kPos );
|
|
}
|
|
|
|
bool SUIRightMenu2Wnd::InitData( bool bReload )
|
|
{
|
|
return SUIWnd::InitData(bReload);
|
|
}
|
|
|
|
void SUIRightMenu2Wnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch(nMessage)
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK:
|
|
{
|
|
BOOL bPushButton = FALSE;
|
|
if ( ::_stricmp( lpszControlID, STR_BTN2_BUFF_ON ) == 0 ) // 버프 보이기
|
|
{
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID, STR_BTN2_CREATURE_ON ) == 0 ) // 크리처 보이기
|
|
{
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID, STR_BTN2_BUFF_OFF ) == 0 ) // 버프 숨기기
|
|
{
|
|
bPushButton = TRUE;
|
|
}
|
|
else if( ::_stricmp( lpszControlID, STR_BTN2_CREATURE_OFF ) == 0 ) // 크리처 숨기기
|
|
{
|
|
bPushButton = TRUE;
|
|
}
|
|
|
|
if(bPushButton)
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_RIGHT_CLICK_MENU2, false ) );
|
|
}
|
|
}
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
void SUIRightMenu2Wnd::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
XSTART_PROFILE( "SUIRightMenu2Wnd::ProcMsgAtStatic", 100 );
|
|
|
|
switch( pMsg->nType )
|
|
{
|
|
case IMSG_UI_MOVE:
|
|
{
|
|
SIMSG_UI_MOVE* pMoveMsg = ( SIMSG_UI_MOVE* )pMsg;
|
|
MovePos( pMoveMsg->m_nX, pMoveMsg->m_nY );
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
void SUIRightMenu2Wnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
SUIWnd::OnNotifyUIWindowOpen(bOpen);
|
|
}
|
|
|
|
#endif |