Files
Leviathan/Client/Game/game/Interface/Party/SUIPartyWndBase.cpp
T
2026-06-01 12:46:52 +02:00

4707 lines
149 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include "stdafx.h"
#include "SNetMessage.h"
#include "KUIControlStatic.h"
#include "KUIControlGauge.h"
#include "KUIControlEdit.h"
#include "KUIControlButton.h"
#include "SGameManager.h"
#include "SGameMessage.h"
//#include "SGameMessageUI.h"
#include "SUIPartyWndBase.h"
#include "SUIPartyWndDual.h"
#include "SUIDisplayInfo.h"
#include "SUISysMsgDefine.h"
#include <toolkit/XStringUtil.h>
#include "SStringDB.h"
#include "SJobDB.h"
#include "SItemDB.h"
#include "SGameOption.h"
#include "SPlayerInfoMgr.h"
#include "SMessengerMgr.h"
//#include "Util.h"
#include "SChatType.h"
#include "SGameSystem.h"
#include "SGameAvatarEx.h"
#include "SGame.h"
#include "SCreatureDB.h"
#include "ErrorCode/ErrorCode.h" // sonador 3.5.1 던전 시즈 레벨 제한
#include <kfile/KFileManager.h>
#include "SUIPartyStateSetWnd.h"
#include "IHuntaHolicSystem.h" // #2.1.2.11.1
// 2010.08.31 - prodongi
#include "SSummonSlotMgr.h"
//#include "SUIUtil.h"
#include "SGameCreature.h"
#include "SUIPopupPartyMenuCharacterWnd.h"
#include "Arena\\ArenaSystem.h"
extern SGameSystem* g_pCurrentGameSystem;
extern void MsgSplit( const char* szMsg, std::vector<std::string>& vecText, const wchar_t* lpDelimiter, bool bProcSpecialCharacter=false );
namespace
{
const int c_nDelta = 30; // 리사이즈 단위
const int c_nCreatureDelta = 20; // 소환수 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;
const float c_fAlphaGradeRadius1 = 440.0f*440.0f;
const float c_fAlphaGradeRadius2 = 560.0f*560.0f;
const float c_fAlphaGrade0 = 1.0f;
const float c_fAlphaGrade1 = 0.5f;
const float c_fAlphaGrade2 = 0.25f;
const std::string c_strNameCaptionL = "<font:font_01><size:9><out><hcenter><vcenter>"; //2012. 1. 11 - marine 파티창의 파티 이름, 파티원 이름에 사용될 캡션
const std::string c_strNameCaptionS = "<font:font_01><size:7><out><hcenter><vcenter>";
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))
};
//==============================================================================================================================================
// SUIPartyWndBase
//==============================================================================================================================================
SUIPartyWndBase::SSlotInfoCharacter::SSlotInfoCharacter()
{
pSelect = NULL;
pLogOff = NULL;
pDead = NULL;
pHP = NULL;
pMP = NULL;
pNoFrame = NULL;
pName = NULL;
pJob = NULL;
pNumber = NULL;
}
void SUIPartyWndBase::SSlotInfoCharacter::Alpha(float fCost)
{
// if(pSelect)
// pSelect ->ChangeAlpha(fCost);
// if(pLogOff)
// pLogOff ->ChangeAlpha(fCost);
// if(pDead)
// pDead ->ChangeAlpha(fCost);
if(pHP)
pHP ->ChangeAlpha(fCost);
if(pMP)
pMP ->ChangeAlpha(fCost);
if(pNoFrame)
pNoFrame->ChangeAlpha(fCost);
// if(pName)
// pName ->ChangeAlpha(fCost);
if(pJob)
pJob ->ChangeAlpha(fCost);
if(pNumber)
pNumber ->ChangeAlpha(fCost);
}
void SUIPartyWndBase::SSlotInfoCharacter::Show(bool bShow, bool bIncludeLogOff, bool bIncludeDead)
{
if(pSelect)
pSelect ->SetShow(bShow);
if(pLogOff && bIncludeLogOff)
pLogOff ->SetShow(bShow);
if(pDead && bIncludeDead)
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* SUIPartyWndBase::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;
}
SUIPartyWndBase::SSlotInfoCreature::SSlotInfoCreature()
{
pMainMark = NULL;
pSelectMain = NULL;
pSelectSub = NULL;
pHP = NULL;
pMP = NULL;
pJob = NULL;
pDead = NULL;
pHP2 = NULL;
pMP2 = NULL;
pJob2 = NULL;
pDead2 = NULL;
}
void SUIPartyWndBase::SSlotInfoCreature::Alpha(float fCost)
{
if(pMainMark)
pMainMark->ChangeAlpha(fCost);
if(pHP)
pHP ->ChangeAlpha(fCost);
if(pMP)
pMP ->ChangeAlpha(fCost);
if(pJob)
pJob ->ChangeAlpha(fCost);
// if(pDead)
// pDead ->ChangeAlpha(fCost);
if(pHP2)
pHP2 ->ChangeAlpha(fCost);
if(pMP2)
pMP2 ->ChangeAlpha(fCost);
if(pJob2)
pJob2 ->ChangeAlpha(fCost);
// if(pDead2)
// pDead2 ->ChangeAlpha(fCost);
}
void SUIPartyWndBase::SSlotInfoCreature::Show(bool bShow, int id)
{
if(id == -1) // 전체
{
if(pMainMark)
pMainMark->SetShow(bShow);
if(pSelectMain)
pSelectMain->SetShow(bShow);
if(pSelectSub)
pSelectSub->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(pSelectMain)
pSelectMain->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(pSelectSub)
pSelectSub->SetShow(bShow);
if(pHP2)
pHP2 ->SetShow(bShow);
if(pMP2)
pMP2 ->SetShow(bShow);
if(pJob2)
pJob2 ->SetShow(bShow);
// if(pDead2)
// pDead2 ->SetShow(bShow);
}
}
KUIWnd* SUIPartyWndBase::SSlotInfoCreature::GetControl(int id)
{
switch(id)
{
case MAINMARK:
return (KUIWnd*)pMainMark;
case SELECT_MAIN:
return (KUIWnd*)pSelectMain;
case SELECT_SUB:
return (KUIWnd*)pSelectSub;
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;
}
SPartyMgr* GetPartyMgr(SUIPartyWndBase* p)
{
if(NULL == p)
return NULL;
SUIPartyDualWnd* pParent = dynamicCast<SUIPartyDualWnd*>(p->GetParent());
if(NULL == pParent)
return NULL;
return p->GetPartyListMgrPtr()->FindIncludeSlef( pParent->GetPartyName() );
}
// 2011.05.17 - servantes
SUIPartyWndBase::~SUIPartyWndBase()
{
this->SetFocus(false);
}
SUIWnd* SUIPartyWndBase::CreateWnd( const char* szFile, KUIWndManager* pWndManager, KPoint kPos, int nWindowID )
{
SUIWnd::CreateWnd( szFile, pWndManager, kPos, nWindowID );
SetCorrectionRect(KRect(0,0,0,0)); // 2011.11.17 - servantes : 보정영역이라는데 필요 없는것 같아 값을 0으로 설정
return this;
}
void SUIPartyWndBase::InitTooltip()
{
// 2011. 11. 16 - marine 고정 툴팁
if(m_pBtnMinimize) m_pBtnMinimize->SetTooltip(S(5125)); // "5125:접기"
if(m_pBtnMaximize) m_pBtnMaximize->SetTooltip(S(5126)); // "5126:열기"
if(m_pBtnSubOption) m_pBtnSubOption->SetTooltip(S(5127)); // "5127:파티메뉴"
if(m_pBtnClose) m_pBtnClose->SetTooltip(S(9226)); // "9226:닫기"
// 2012. 1. 10 - marine InitSecond() 에 있었는데 초기화시 한번만 해도 되므로 이동..
KUIControl* rmark = dynamicCast<KUIControl*>(GetChild("mark_right_click_01"));
if (rmark)
{
std::string str;
XStringUtil::Format(str, "<#b92c36>%s", S(1881)); /// 2011.05.24 칼라 적용 - prodongi "1881:우클릭 메뉴"
rmark->SetTooltip(str.c_str());
}
if(m_pStaticLeaderMark) m_pStaticLeaderMark->SetTooltip(S(5131)); //"5131:파티장 마크"
if(m_pStaticTopLeaderMark) m_pStaticTopLeaderMark->SetTooltip(S(5130)); //"5130:공대장 마크"
}
bool SUIPartyWndBase::InitControls( KPoint kPos )
{
CreateControls();
m_nListSizeType = PARTY_UI_LIST_SIZE_EXTEND;
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_pStaticTitleBar = dynamicCast<KUIControlStatic*> (GetChild("titlebar"));
m_pStaticTitle = dynamicCast<KUIControlStatic*> (GetChild("title"));
m_staticPartyMark = dynamicCast<KUIControlStatic*>(GetChild("mark_party"));
m_pStaticMinimizsMark = dynamicCast<KUIControlStatic*> (GetChild("minimize"));
m_pStaticPartyMarkSmile = dynamicCast<KUIControlStatic*> (GetChild("mark_attack_party_01"));
SetChildAsTop( "mark_party" );
m_pBtnClose ->SetShow(true);
m_pBtnMaximize ->SetShow(true);
m_pBtnMinimize ->SetShow(true);
m_pBtnSubOption ->SetShow(true);
m_pStaticTitleBar ->SetShow(true);
m_pStaticTitle ->SetShow(true);
m_pStaticMinimizsMark ->SetShow(false);
m_pStaticTitleBar->SetCaption("");
KUIControlStatic* pWnd = dynamicCast<KUIControlStatic*>(GetChild( "select_dead00" ));
if( pWnd )
{
pWnd->SetEnableMouseClickMessage(true);
}
InitTooltip(); // 2012. 1. 10 - marine 툴팁이 많아서 따로 뺌
// 커스텀 윈도우 move 영역 설정
SetCustomMovingRect( m_pStaticTitleBar->GetRect() );
return SUIWnd::InitControls( kPos );
}
void SUIPartyWndBase::InitSecond()
{
/// 2011.11.10 부모 저장 - prodongi
m_parent = dynamicCast<SUIPartyDualWnd*>(GetParent());
}
bool SUIPartyWndBase::InitData( bool bReload )
{
for( unsigned int i(0); SLOT_MAXLINE>i; i++ )
m_bLogIn[i] = true;
m_nOldHP = 0;
m_nOldMP = 0;
m_nOldTime = 0;
m_nViewLine = 6;
m_nSelectIndex = -1;
SetChildCaption( "titlebar", "" );
DisableSlots();
ChangeSize();
return SUIWnd::InitData(bReload);
}
// 생성
void SUIPartyWndBase::CreateControls()
{
RECT rc;
rc.left = 0; rc.top = c_nDelta; rc.right = 0; rc.bottom = c_nDelta;
m_pMouseClick = dynamicCast<KUIControlStatic*>(GetChild("select_mouseclick"));
m_pMouseClick->SetShow(false);
m_pMouseClickCreature = dynamicCast<KUIControlStatic*>(GetChild("creature_mouseclick"));
m_pMouseClickCreature->SetShow(false);
m_pStaticLeaderMark = dynamicCast<KUIControlStatic*>( GetChild( "mark_party_leader" ) ); // 파티 리더 마크
m_pStaticLeaderMark->SetShow( false );
m_pStaticTopLeaderMark = dynamicCast<KUIControlStatic*>( GetChild( "mark_siegeleader_01" ) ); // 공격대 전체 파티 리더 마크
m_pStaticTopLeaderMark->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() ) );
m_aSlotChar[i].pSelect->SetEnableMouseClickMessage(false);
// 크리처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].pSelectMain = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "creature_select_zone_main%02d", i ).c_str() ) );
m_aSlotCreature[i].pSelectMain->SetEnableMouseClickMessage(false);
m_aSlotCreature[i].pSelectSub = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "creature_select_zone_sub%02d", i ).c_str() ) );
m_aSlotCreature[i].pSelectSub->SetEnableMouseClickMessage(false);
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_main%02d", i ).c_str(), CStringUtil::StringFormat( "creature_select_zone_main%02d", i+1 ).c_str(), rc );
CopyControl( CStringUtil::StringFormat( "creature_select_zone_sub%02d", i ).c_str(), CStringUtil::StringFormat( "creature_select_zone_sub%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);
// 컨트롤들의 포인터를 받아 놓는다
// 파티원
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].pSelectMain = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "creature_select_zone_main%02d", i+1 ).c_str() ) );
m_aSlotCreature[i+1].pSelectSub = dynamicCast<KUIControlStatic*>( GetChild( CStringUtil::StringFormat( "creature_select_zone_sub%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() ) );
m_aSlotCreature[i+1].pMainMark->SetShow(false); // 2011.12.21 - servantes : 주크리처 표시 숨김
}
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() );
m_aSlotChar[i].pNumber->SetShow(false);
m_aSlotChar[i].pDead->SetShow(false);
SetChildAsTop( CStringUtil::StringFormat("select_logoff%02d", i ).c_str() );
SetChildAsTop( CStringUtil::StringFormat("select_dead%02d", i ).c_str() );
SetChildAsTop( CStringUtil::StringFormat("creature_select_zone%02d", i ).c_str() );
SetChildAsTop( CStringUtil::StringFormat("creature_dead%02d", i ).c_str() );
m_aSlotCreature[i].Show(false);
m_aSlotCreature[i].pDead->SetShow(false);
m_aSlotCreature[i].pDead2->SetShow(false);
}
SetChildAsButtom( "select_mouseclick" );
SetChildAsButtom( "creature_mouseclick" );
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 SUIPartyWndBase::DisableSlots()
{
//OutputDebugString( "SUIPartyWndBase::DisableSlots()\n" );
m_pStaticLeaderMark->SetShow( false );
for( int i = 0; i < c_nMaxLine; i++ )
{
m_aSlotCreature[ i ].Show(false);
m_aSlotChar [ i ].Show(false, true, true);
m_aSlotCreature[ i ].pDead->SetShow(false);
m_aSlotCreature[ i ].pDead2->SetShow(false);
m_aSlotChar [ i ].pDead->SetShow(false);
}
}
void SUIPartyWndBase::DisableCreatureSlot( AR_HANDLE hMaster )
{
int nIndex(0);
sBasePartyCreatureInfo rCreatureInfo;
GetCreature( hMaster, nIndex, rCreatureInfo );
if( rCreatureInfo.hCreature1st )
DisableCreatureSlot(nIndex);
}
void SUIPartyWndBase::DisableCreatureSlot( int nIndex )
{
//m_vecCreatureList[ nIndex ].bRender = false;
//m_vecCreatureList[ nIndex ].bRenderUI = false;
m_aSlotCreature[ nIndex ].Show(false);
}
void SUIPartyWndBase::MoveSlot( int nIndex, int nY )
{
int nDeltaY(0);
KUIWnd* pWnd(NULL);
pWnd = GetChild( CStringUtil::StringFormat( "select_zone%02d", nIndex ).c_str() );
if( pWnd )
{
//파티장 맨위로 가는부분 수정시 크리쳐 슬롯 위치 지대로 못 잡는 부분 수정
//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 SUIPartyWndBase::MoveCreatureSlot( int nIndex, int nY )
{
int nDeltaY(0);
KUIWnd* pWnd(NULL);
pWnd = GetChild( CStringUtil::StringFormat( "creature_dead%02d", nIndex ).c_str() );
if( pWnd )
{
//파티장 맨위로 가는부분 수정시 크리쳐 슬롯 위치 지대로 못 잡는 부분 수정
//2009-05-27: hunee
nDeltaY = nY + 3 - pWnd->GetRect().top;
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 )
{
//파티장 맨위로 가는부분 수정시 크리쳐 슬롯 위치 지대로 못 잡는 부분 수정
//2009-05-27: hunee
nDeltaY = nY + 3 - pWnd2->GetRect().top;
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 SUIPartyWndBase::ChangeSize()
{
std::vector<SPlayerSlot*> vecMemberList;
if(GetParent() == NULL)
return ;
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
vecMemberList = pParty->GetMemberList();
int x = 0, y = 0, th = 0, add_gh=0;
KRect rt = m_pStaticTitleBar->GetRect();
x = rt.left; // 컨트롤 재비치를 위한 기준 x 축 좌표
y = rt.top - 17; // 컨트롤 재비치를 위한 기준 y 축 좌표
th = rt.GetHeight() + 17; // 최대, 최소, 닫기, 버튼이 있는 공간 + 타이틀바의 높이
add_gh = rt.bottom;
KUIWnd* pWnd = GetChild( "select_zone00" );
if( pWnd == NULL ) return;
int nPos_Y( pWnd->GetRect().top );
/// 2011.11.11 확장 상태일 때만 enable 되도록 - prodongi
if (m_nListSizeType == PARTY_UI_LIST_SIZE_EXTEND)
{
//파티장 맨위로 가는부분 수정시 크리쳐 슬롯 위치 지대로 못 잡는 부분 수정
//2009-05-27: hunee
for( int i(0); i<vecMemberList.size(); ++i)
{
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 )
if (m_parent->isShowCreature(i) && m_vecCreatureList[i].hCreature1st)
{
EnableCreatureSlot(i, true);
}
else
EnableCreatureSlot(i, false);
}
}
}
}
/// 최소화 컨트롤 영역을 추가 해 준다
else if (m_nListSizeType == PARTY_UI_LIST_SIZE_REDUCE)
{
add_gh += m_pStaticMinimizsMark->GetRect().GetHeight(); /// minimize control
}
KRect rcNew = GetRect();
rcNew.right = rt.right;
rcNew.bottom = add_gh + 5;
//Resize( rcNew );
ClipRect(rcNew); // 2011.11.16 - servantes : 클립 영역 설정
SetRect(rcNew);
}
void SUIPartyWndBase::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
{
SUIWnd::OnNotifyUIWindowOpen(bOpen);
if( bOpen )
{
UnSelect();
}
GetGameOption().SetMessengerType( m_nTabType );
GetGameOption().SetMessangerOpep( bOpen );
}
// #2.1.2.11.1
void* SUIPartyWndBase::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 SUIPartyWndBase::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
{
if( ::_stricmp( lpszControlID, "window_player_party_base" ) == 0 )
return ;
switch( nMessage )
{
case KUI_MESSAGE::KICON_DBLCLK:
{
int k=0;
break;
}
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::KBUTTON_CLICK:
{
if(m_nPartyType != PARTY_SIEGE_OTHER)
{
if( ::_stricmp( lpszControlID, "button_suboption" ) == 0 )
{
std::string strPartyName;
SUIPartyDualWnd* pParent = (SUIPartyDualWnd*)GetParent();
if(pParent)
{
strPartyName = *pParent->GetPartyName();
pParent->DeselectSlot(); // 슬롯 디셀렉트
}
KRect rt = GetRect();
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, "select_party", strPartyName.c_str() ) );
m_pGameManager->PostMsgAtDynamic( new SIMSG_TOGGLE_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU ) );
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, rt.right, rt.top ) );
/// 2011.11.10 상태를 반대로 보내 준다 - prodongi
std::string strStatus;
getInverseStatusString(strStatus);
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, "set_status", strStatus.c_str()));
}
}
else if(m_nPartyType == PARTY_SIEGE_OTHER)
{
if( ::_stricmp( lpszControlID, "button_close" ) == 0 )
{
SUIPartyDualWnd* pParent = (SUIPartyDualWnd*)GetParent(); // servantes 2011.10.29
if(pParent)
{
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "hide_party_wnd2", pParent->GetPartyName()->c_str() ) );
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT, "hide_party_wnd2", pParent->GetPartyName()->c_str() ) );
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT_MINI, "hide_party_wnd2", pParent->GetPartyName()->c_str() ) ); // 2011. 11. 15 - marine
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_MINIMAP, "hide_party_wnd2", pParent->GetPartyName()->c_str() ) );
pParent->DeselectSlot(); // 슬롯 디셀렉트
}
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false ) );
}
}
//2011.09.15 - servantes : 안쓰는 코드 제거 : 확장, 축소 버튼 내용 추가
if( ::_stricmp( lpszControlID, "button_minimize" ) == 0 )
{
if(m_parent)
{
m_parent->SetListSizeType(PARTY_UI_LIST_SIZE_REDUCE);
m_parent->DeselectSlot(); // 슬롯 디셀렉트
}
}
else if( ::_stricmp( lpszControlID, "button_maximize" ) == 0 )
{
if(m_parent)
{
m_parent->SetListSizeType(PARTY_UI_LIST_SIZE_EXTEND);
m_parent->DeselectSlot(); // 슬롯 디셀렉트
}
}
}
break;
case KUI_MESSAGE::KGENWND_MOVE: // 윈도우 이동
{
LimitMoveWnd(); // 게임 외부로 나가지 못하게 제한
std::string strPartName;
SUIPartyDualWnd* pParent = (SUIPartyDualWnd*)GetParent();
if(pParent)
{
strPartName = *pParent->GetPartyName();
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "set_party_name", strPartName.c_str() ) );
/// 2011.11.14 버프의 위치 동기화 때문에 버프가 안 보일 때도 위치를 보내 준다 - prodongi
POINT pt = pParent->GetBuffRenderPos();
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, pt.x, pt.y ) );
/// 2011.11.11 부모 위치 동기화 - prodongi
pParent->SetRect(GetRect());
}
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, GetRect().right, GetRect().top ) );
}
break;
case KUI_MESSAGE::KFOCUS_ACTIVATED:
{
// 2011.09.29 : servantes : 오른 클릭 팝업 메뉴 닫기
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CHARACTER, 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( 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 SUIPartyWndBase::UnSelect()
{
m_hSelectMember = NULL; // 2011.10.05 : servantes : 선택한 멤버 핸들
m_strSelectMember = ""; // 2011.10.06 : servantes : 선택이름 초기화
m_nSelectIndex = -1;
m_nSelectCreatureIndex = -1;
}
// 2010.08.31 - prodongi
void SUIPartyWndBase::unSelectCreature()
{
m_nSelectCreatureIndex = -1;
SetChildShow( "creature_mouseclick", false );
}
void SUIPartyWndBase::ProcMsgAtStatic( SGameMessage* pMsg )
{
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 );
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
if( !pParty->IsExist() )
return;
if( zDelta >= 0 )
{
//위로 선택
m_nSelectIndex--;
if( m_nSelectIndex < 0 )
m_nSelectIndex = pParty->GetMemberCount()-1;
}
else
{
//아래 선택
m_nSelectIndex++;
if( m_nSelectIndex >= pParty->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" )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
RefreshPartyInfo();
RefreshOnLine();
if( !pParty->GetSelectMember() )
UnSelect();
}
else if( pData->m_strString == "on_logoff" )
{
for( int i(0); i<c_nMaxLine; ++i )
{
m_aSlotChar[i].pLogOff->SetShow(true);
}
}
else if( pData->m_strString == "hide_creature_index" )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
int id = pParty->FindMemberIndex( (AR_HANDLE)pData->m_nNumber.getAmount() );
if(id > -1)
{
//m_vecCreatureList[id].bRender = false;
//m_vecCreatureList[id].bRenderUI = false;
m_vecCreatureList[id].hCreature1st = 0;
m_vecCreatureList[id].hCreature2nd = 0;
EnableCreatureSlot(id, true);
RefreshSlots();
}
}
else if( pData->m_strString == "add_creature" )
{
AddCreature( pData->m_dwData );
//OutputDebugString( "add_creature\n" );
RefreshSlots();
}
else if( pData->m_strString == "add_creature_index" )
{
// 2010.08.30 - prodongi
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
setRenderCreatureUI((int)pData->m_nNumber.getAmount(), false);
//OutputDebugString( "remove_creature_index\n" );
RefreshSlots();
}
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 : 친구추가
{
/// 2011.12.27 정리 - prodongi
/*
if( m_strSelectMember.size() )
{
int command;
if (m_FriendMgr.IsExistMember(m_strSelectMember.c_str()))
{
command = SMSG_FRIEND_COMMAND::FRIEND_DELETE;
}
else
{
command = SMSG_FRIEND_COMMAND::FRIEND_ADD;
}
m_pGameManager->PostMsgAtDynamic( new SMSG_FRIEND_COMMAND( command, m_strSelectMember.c_str() ) );
}
*/
std::string name = findMemberName(&pData->m_strText, (int)pData->m_dwData);
if (!name.empty())
{
int command;
if (m_FriendMgr.IsExistMember(name.c_str()))
{
command = SMSG_FRIEND_COMMAND::FRIEND_DELETE;
}
else
{
command = SMSG_FRIEND_COMMAND::FRIEND_ADD;
}
m_pGameManager->PostMsgAtDynamic( new SMSG_FRIEND_COMMAND( command, name.c_str() ) );
}
}
else if( pData->m_strString == "block_friend" ) // 2011.10.06 : servantes : 차단
{
/// 2011.12.27 정리 - prodongi
/*
if( m_strSelectMember.size() )
{
int command;
if (m_CutMgr.IsExistMember(m_strSelectMember.c_str()))
{
command = SMSG_FRIEND_COMMAND::CUT_DELETE;
}
else
{
command = SMSG_FRIEND_COMMAND::CUT_ADD;
}
m_pGameManager->PostMsgAtDynamic( new SMSG_FRIEND_COMMAND( command, m_strSelectMember.c_str() ) );
}
*/
std::string name = findMemberName(&pData->m_strText, (int)pData->m_dwData);
if (!name.empty())
{
int command;
if (m_CutMgr.IsExistMember(name.c_str()))
{
command = SMSG_FRIEND_COMMAND::CUT_DELETE;
}
else
{
command = SMSG_FRIEND_COMMAND::CUT_ADD;
}
m_pGameManager->PostMsgAtDynamic( new SMSG_FRIEND_COMMAND( command, name.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 : 파티 추방
{
/*
SPartyMgr* pParty = this->m_PartyMgr.Find(&pData->m_strText); // 2011.12.19 : servantes : 선택 파티원 이름
if(pParty)
{
SPlayerSlot* pSlot = pParty->FindMemberByID((int)pData->m_dwData);
if(pSlot)
m_strSelectMember = pSlot->GetName();
}
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 );
m_pMouseClick->SetShow(false);
}
*/
/// 2011.12.27 정리 - prodongi
std::string name = findMemberName(&pData->m_strText, (int)pData->m_dwData);
if (!name.empty())
{
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_KICK;
pMsg->strName = name;
m_pGameManager->PostMsgAtDynamic( pMsg );
m_pMouseClick->SetShow(false);
}
}
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 );
}
}
/// 2012.05.22 잠수 신고 - prodongi
else if ("report_dive" == pData->m_strString)
{
/// 서버에 잠수 신고
TS_CS_BATTLE_ARENA_ABSENCE_CHECK_REQUEST msg;
msg.hCheckTarget = m_hSelectMember;
m_pGameManager->PendMessage(&msg);
sArenaSystem* arenaSystem = g_pCurrentGameSystem->getArenaSystem();
arenaSystem->setReportDrivePlayerName(m_strSelectMember.c_str());
}
pMsg->bUse = true;
}
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 )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
if( pParty->IsExist() && pParty->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;
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
pParty->SetSelectMember( "none" );
pParty->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 );
if (pPlayerSlot)
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty)
{
pParty->SetSelectMember( pPlayerSlot->GetName() );
pParty->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:
{
int hpp = m_PlayerInfoMgr.GetHP() *100/m_PlayerInfoMgr.GetMaxHP();
int mpp = m_PlayerInfoMgr.GetMP() *100/m_PlayerInfoMgr.GetMaxMP();
if( m_nOldHP != hpp || m_nOldMP != mpp )
{
if(m_parent->GetPartyName()->size() <= 0)
break;
if(m_PartyMgr.Find( m_parent->GetPartyName() ) == NULL)
break;
int cur = GetArTime();
int elapsed = cur - m_nOldTime;
int delta = abs(hpp-m_nOldHP) + abs(mpp-m_nOldMP) + elapsed/100;
if (elapsed>100 && delta>10)
{
SMSG_CHATTING_REQUEST* pChatMsg = new SMSG_CHATTING_REQUEST;
memset( pChatMsg->szTarget, 0, sizeof(pChatMsg->szTarget) );
pChatMsg->type = CHAT_PARTY_SYSTEM;
pChatMsg->strText = "/plist";
m_pGameManager->PostMsgAtDynamic( pChatMsg );
m_nOldHP = m_PlayerInfoMgr.GetHP()*100/m_PlayerInfoMgr.GetMaxHP();
m_nOldMP = m_PlayerInfoMgr.GetMP()*100/m_PlayerInfoMgr.GetMaxMP();
m_nOldTime = cur;
}
}
if( m_nTabType == TAB_GUILD && pMsg->nType == MSG_LEVEL_UPDATE )
{
if(m_parent->GetPartyName()->size() <= 0)
break;
if(m_PartyMgr.Find( m_parent->GetPartyName() ) == NULL)
break;
SMSG_CHATTING_REQUEST* pChatMsg = new SMSG_CHATTING_REQUEST;
memset( pChatMsg->szTarget, 0, sizeof(pChatMsg->szTarget) );
pChatMsg->type = CHAT_PARTY_SYSTEM;
pChatMsg->strText = "/plist";
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 );
LimitMoveWnd(); // 게임 외부로 나가지 못하게 제한
std::string strPartName;
SUIPartyDualWnd* pParent = (SUIPartyDualWnd*)GetParent();
if(NULL == pParent)
break;
strPartName = *pParent->GetPartyName();
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "set_party_name", strPartName.c_str() ) );
// m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, GetRect().right, GetRect().top+c_nTitleSize, strPartName.c_str() ) );
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, GetRect().right, GetRect().top, strPartName.c_str() ) ); // 2011.12.15 - servantes : 위치 보정
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, GetRect().right, GetRect().top ) );
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:
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
if( !pParty->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 = "/gcreate ";
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 = "/gacreate ";
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();
// 2012.02.13 - servantes : 크리처 리콜시 크리처가 있던 슬롯 위치 바닥클릭 안돼는 현상 수정을 위함
KRect rt = GetRect();
number_t w( rt.GetWidth() );
number_t h( rt.GetHeight() );
// 부모에게 크기 변경되었다고 알림
SUIPartyDualWnd *pParent = dynamicCast<SUIPartyDualWnd*> (this->GetParent());
if(!pParent)
return;
pParent->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "change_size", "", w, h ));
}
else
{
LeaveMaster( pLeave->handle );
}
}
break;
}
}
//////////////////////////////////////////////////////////////////////////
// 크리처
//////////////////////////////////////////////////////////////////////////
bool SUIPartyWndBase::ChangeCreature( AR_HANDLE handle )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return false;
AR_HANDLE hMaster = GetMaster( handle );
int nIndex = pParty->GetMemberIndex( hMaster );
if( hMaster && nIndex >= 0 && nIndex < c_nMaxLine )
{
if( m_vecCreatureList[nIndex].hMaster == hMaster )
{
//2011.11.07 - servantes : 두번째 크리처 소환시 핸들값 첫번째 것과 겹치지 않도록 수정
if(m_vecCreatureList[nIndex].hCreature1st == 0)
m_vecCreatureList[nIndex].hCreature1st = handle;
// else if(m_vecCreatureList[nIndex].hCreature1st != handle)
// m_vecCreatureList[nIndex].hCreature2nd = 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 SUIPartyWndBase::ChangeMasterCreature( AR_HANDLE hMaster )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return false;
int nIndex = pParty->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();
return true;
}
}
return false;
}
int SUIPartyWndBase::AddCreature( AR_HANDLE handle )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return -1;
AR_HANDLE hMaster = GetMaster( handle );
int nIndex = pParty->GetMemberIndex( hMaster );
if( hMaster && nIndex > -1 && nIndex < c_nMaxLine )
{
return nIndex;
}
else
{
m_pDisplayInfo->AddSystemMessage( "The creatures master is not a party member.", 0 );
return -1;
}
return -1;
}
SGameAvatarEx* SUIPartyWndBase::GetPlayerPtr( int nIndex )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return NULL;
if( nIndex < 0 || nIndex >= pParty->GetMemberCount() )
return NULL;
//순차분배 수정: 파티장이 0번 슬롯에 나오던 부분을 자기 위치에 나오도록 수정
//2009-02-23: hunee
std::vector<SPlayerSlot*> vecMemberList = pParty->GetMemberList();
if( vecMemberList.size() > nIndex )
{
return GetObject( vecMemberList[nIndex]->GetHandle() );
}
return NULL;
}
void SUIPartyWndBase::LeaveMaster( AR_HANDLE hMaster )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
int nIndex = pParty->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
RefreshSlots();
return;
}
}
}
int SUIPartyWndBase::LeaveCreature( AR_HANDLE handle )
{
bool bProcess = false;
for( int i(0); i<c_nMaxLine; ++i )
{
if( m_vecCreatureList[i].hCreature1st == handle )
{
m_vecCreatureList[i].hCreature1st = NULL;
bProcess = true;
}
else if( m_vecCreatureList[i].hCreature2nd == handle )
{
m_vecCreatureList[i].hCreature2nd = NULL;
bProcess = true;
}
// 2011.11.07 - servantes : 첫번째 두번째 크리처 핸들이 모두 0이면 해당 슬롯 렌더링 하지 않는다
// if( m_vecCreatureList[i].hCreature1st == 0 && m_vecCreatureList[i].hCreature2nd == 0 )
if( m_vecCreatureList[i].hCreature1st == 0 )
{
//m_vecCreatureList[i].bRender = false;
//m_vecCreatureList[i].bRenderUI = false; // 2010.08.30 - prodongi
return i;
}
if(bProcess == true)
return i;
}
return -1;
}
int SUIPartyWndBase::RemoveCreature( AR_HANDLE handle )
{
for( int i(0); i<c_nMaxLine; ++i )
{
if( m_vecCreatureList[i].hCreature1st == handle )
{
//m_vecCreatureList[i].bRender = false;
//m_vecCreatureList[i].bRenderUI = false; // 2010.08.30 - prodongi
return i;
}
}
return -1;
}
// 2010.08.30 - prodongi
void SUIPartyWndBase::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 SUIPartyWndBase::GetMaster( AR_HANDLE handle )
{
SGameAvatarEx* pCreature = GetObject( handle );
if( pCreature && pCreature->GetObjType() == TS_ENTER::GAME_SUMMON )
return pCreature->GetMaster();
return 0;
}
SGameAvatarEx* SUIPartyWndBase::GetObject( AR_HANDLE handle )
{
SGame* pGame = m_pGameManager->GetActiveGame();
if( !pGame || pGame->GetGameType() != GAME_TYPE_WORLD )
return NULL;
return (SGameAvatarEx*)(pGame->GetGameObject(handle));
}
//////////////////////////////////////////////////////////////////////////
// 슬롯
//////////////////////////////////////////////////////////////////////////
void SUIPartyWndBase::RefreshSlots()
{
/// 2011.11.10 아래 소스를 처리하지 않았을 때, 버그가 생기고 있어서, 주석 처리 했습니다.- prodongi
if(m_nListSizeType == PARTY_UI_LIST_SIZE_REDUCE)
{
ChangeSize();
return ;
}
int nCount = 0;
switch(m_nTabType)
{
case TAB_PARTY:
case TAB_GUILD:
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
bool bExist = pParty->IsExist();
nCount = pParty->GetMemberCount();
if( !bExist || nCount <= 0 )
{
DisableSlots();
return;
}
}
break;
}
DisableSlots();
RefreshEnableSlots();
RefreshPartyInfo();
ChangeSize();
RefreshOnLine();
// RefreshSelectMember( m_PlayerInfoMgr.GetTarget(), m_PlayerInfoMgr.GetTargetName() );
}
void SUIPartyWndBase::RefreshCreatureSlots()
{
int nIndex(-1);
for( int i(0); i<c_nMaxLine; ++i )
{
if( m_vecCreatureList[i].hMaster )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
nIndex = pParty->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 SUIPartyWndBase::MoveSlotControl(const char* ptr_name, int x, int y)
{
KUIWnd* pWnd = GetChild( ptr_name );
if(pWnd)
pWnd->MovePos(x, y);
}
void SUIPartyWndBase::MoveSlotEx(int id_slot, int& x_next_startpos) // 2011.10.06 : servantes : 해당 슬롯의 컨트롤 위치를 변경한다
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
int x = 0, y = 0, th = 0, add_gh=0;
std::vector<SPlayerSlot*> vecMemberList = pParty->GetMemberList();
SPlayerSlot* pSlot = vecMemberList[id_slot];
bool bCreatureExist = false;
sBasePartyCreatureInfo rCreatureInfo;
GetCreature( pSlot->GetHandle(), id_slot, rCreatureInfo );
//if(rCreatureInfo.hCreature1st && rCreatureInfo.bRenderUI == true)
if(rCreatureInfo.hCreature1st && m_parent->isShowCreature(id_slot))
bCreatureExist = true;
KRect rt = m_pStaticTitleBar->GetRect();
x = rt.left; // 컨트롤 재비치를 위한 기준 x 축 좌표
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);
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
{
int tg = -5;
m_aSlotChar[id_slot].pSelect ->MovePos(x + 0, add_gh);
m_aSlotChar[id_slot].pNoFrame->MovePos(x + 2, add_gh);
m_aSlotChar[id_slot].pJob ->MovePos(x + 2, add_gh + 9);
m_aSlotChar[id_slot].pNumber ->MovePos(x + 7, add_gh + 1);
m_aSlotChar[id_slot].pDead ->MovePos(x + 2, add_gh + 1);
m_aSlotChar[id_slot].pHP ->MovePos(x + 22 + tg, add_gh + 18 + tg);
m_aSlotChar[id_slot].pMP ->MovePos(x + 22 + tg, add_gh + 23 + tg);
m_aSlotChar[id_slot].pName ->MovePos(x + 35 + tg - 6, add_gh);
add_gh += m_aSlotChar[id_slot].pSelect->GetRect().GetHeight();
}
else
{
m_aSlotChar[id_slot].pSelect ->MovePos(x + 0, add_gh + 1);
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 + 3);
m_aSlotChar[id_slot].pDead ->MovePos(x + 2, add_gh + 2);
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 + 2);
add_gh += m_aSlotChar[id_slot].pSelect->GetRect().GetHeight() + 2;
}
x_next_startpos = add_gh;
// main creature
if(bCreatureExist)
{
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
{
int tg = -5;
m_aSlotCreature[id_slot].pSelectMain->MovePos(x, add_gh - 2);
m_aSlotCreature[id_slot].pSelectSub ->MovePos(x + 48, add_gh - 2);
m_aSlotCreature[id_slot].pJob ->MovePos(x + 2, add_gh - 1);
m_aSlotCreature[id_slot].pDead ->MovePos(x + 8 + tg, add_gh + 5 + tg);
m_aSlotCreature[id_slot].pHP ->MovePos(x + 22 + tg, add_gh + 9 + tg);
m_aSlotCreature[id_slot].pMP ->MovePos(x + 22 + tg, add_gh + 14 + tg);
m_aSlotCreature[id_slot].pMainMark ->MovePos(x + 21 + tg, add_gh + 2 + 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 + 9 + tg);
m_aSlotCreature[id_slot].pMP2 ->MovePos(x + 71 + tg, add_gh + 14 + tg);
m_aSlotCreature[id_slot].pJob2 ->MovePos(x + 51 + 1, add_gh - 1);
add_gh += m_aSlotCreature[id_slot].pSelectMain->GetRect().GetHeight() - 1;
}
else
{
m_aSlotCreature[id_slot].pSelectMain->MovePos(x, add_gh);
m_aSlotCreature[id_slot].pSelectSub->MovePos(x + 69, add_gh);
m_aSlotCreature[id_slot].pJob ->MovePos(x + 2, add_gh + 2);
m_aSlotCreature[id_slot].pDead ->MovePos(x + 2, add_gh + 2);
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 + 1);
m_aSlotCreature[id_slot].pDead2 ->MovePos(x + 71, add_gh + 2);
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 + 2);
add_gh += m_aSlotCreature[id_slot].pSelectMain->GetRect().GetHeight() - 2;
}
x_next_startpos = add_gh;
}
else
{
m_aSlotCreature[id_slot].Show(false);
}
}
bool SUIPartyWndBase::IsTopLeader( const char * szPlayer )
{
// SRaidInfo* pRaid = m_RaidMgr.GetRaidInfo(0);
SRaidInfo* pRaid = m_RaidMgr.GetTopRaidInfo();
if(pRaid == NULL)
return false;
const char* pTopLeaderName = pRaid->GetLeaderName();
if( strcmp(pTopLeaderName, szPlayer) == 0 )
return true;
return false;
}
//-----------------------------------------------------------------------------------------------------------------
// 활성화 슬롯 갱신
//-----------------------------------------------------------------------------------------------------------------
void SUIPartyWndBase::RefreshEnableSlots()
{
if(m_nListSizeType == PARTY_UI_LIST_SIZE_REDUCE)
{
m_pStaticLeaderMark->SetShow( false );
return ;
}
// 파티장 아이콘 보이지 않기
m_pStaticLeaderMark->SetShow( false );
m_pStaticTopLeaderMark->SetShow(false);
SPartyMgr* pParty = GetPartyMgr( this );
if(pParty == NULL)
{
SDEBUGLOG( "[SUIPartyWndBase] 파티 정보가 존재하지 않습니다." );
assert( pParty );
return ;
}
std::vector<SPlayerSlot*> vecMemberList( pParty->GetMemberList() );
UINT nTotalCount( vecMemberList.size() );
if( nTotalCount > SLOT_MAXLINE )
{
SLOG( "[SUIPartyWndBase] 파티원의 수가 최대 파티원을 넘어섰습니다. - [ %u/%u ]", nTotalCount, c_nMaxLine );
assert( NULL );
nTotalCount = SLOT_MAXLINE;
}
for( UINT nCount = 0; nCount < nTotalCount; nCount++ )
{
SPlayerSlot* pSlot( vecMemberList[nCount] );
if( NULL == pSlot )
{
SDEBUGLOG( "[SUIPartyWndBase] 슬롯 정보가 유효하지 않습니다" );
continue;
}
if(pSlot->GetHandle() == 0) // 핸들이 없으면 로그인하지 않은 상태
{
m_bLogIn[nCount] = false; // 로그오프
DisableCreatureSlot( nCount );
}
else
{
m_bLogIn[nCount] = true; // 로그인
}
std::string strName( pSlot->GetName() );
if( NULL == strName.length() )
{
SDEBUGLOG( "[SUIPartyWndBase] 이름 정보가 없습니다." );
continue;
}
int nAlphaGrade( NULL );
SetMemberData( pSlot->GetName(), nCount, nAlphaGrade );
m_vecCreatureList[ nCount ].hCreature1st = pSlot->GetMainCreatureHandle();
m_vecCreatureList[ nCount ].hCreature2nd = pSlot->GetSubCreatureHandle();
UpdateCreatureData_N_UI( nCount, pSlot->GetHandle(), nAlphaGrade );
if(pSlot->IsLeader() == true)
{
KRect rect = m_aSlotChar[nCount].pName->GetRect();
if(IsTopLeader(pSlot->GetName()) == true) // 공격대 전체 파티 리더이면
{
SetChildAsTop("mark_siegeleader_01");
m_pStaticTopLeaderMark->SetShow(true);
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
m_pStaticTopLeaderMark->MovePos( rect.left-8, rect.top + 2);
else
m_pStaticTopLeaderMark->MovePos( rect.left-12, rect.top + 1);
if(nAlphaGrade == 0)
m_pStaticTopLeaderMark->ChangeAlpha(c_fAlphaGrade0);
else if(nAlphaGrade == 1)
m_pStaticTopLeaderMark->ChangeAlpha(c_fAlphaGrade1);
else // 2
m_pStaticTopLeaderMark->ChangeAlpha(c_fAlphaGrade2);
}
else // 공격대 파티의 리더이면
{
SetChildAsTop("mark_party_leader");
m_pStaticLeaderMark->SetShow(true);
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
m_pStaticLeaderMark->MovePos( rect.left-8, rect.top);
else
m_pStaticLeaderMark->MovePos( rect.left-12, rect.top + 1);
if(nAlphaGrade == 0)
m_pStaticLeaderMark->ChangeAlpha(c_fAlphaGrade0);
else if(nAlphaGrade == 1)
m_pStaticLeaderMark->ChangeAlpha(c_fAlphaGrade1);
else // 2
m_pStaticLeaderMark->ChangeAlpha(c_fAlphaGrade2);
}
}
}
}
void SUIPartyWndBase::UpdateCreatureData_N_UI( int nPos, AR_HANDLE hMaster, int nAlphaGrade )
{
if( nPos < 0 || nPos >= c_nMaxLine )
return;
if(hMaster == NULL)
{
/// 2011.12.22 master가 없을 때는 초기화 해준다 - prodongi
SetPlayerCreatureData( nPos, NULL, nAlphaGrade );
return ;
}
SetPlayerCreatureData( nPos, hMaster, nAlphaGrade );
//if (m_vecCreatureList[nPos].bRender && m_vecCreatureList[nPos].bRenderUI)
// if (m_vecCreatureList[nPos].hCreature1st)
if (m_parent->isShowCreature(nPos) && m_vecCreatureList[nPos].hCreature1st)
{
EnableCreatureSlot(nPos, true);
if(m_vecCreatureList[nPos].hCreature2nd)
EnableCreatureSlot2nd(nPos, true);
}
else
DisableCreatureSlot(nPos);
}
bool SUIPartyWndBase::GetCreature( AR_HANDLE hMaster, int nIndex, sBasePartyCreatureInfo& 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 SUIPartyWndBase::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 SUIPartyWndBase::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 SUIPartyWndBase::SetMemberData( const char* szName, int nPos, int& nAlphaGrade )
{
switch(m_nTabType)
{
case TAB_PARTY:
SetPartyMemberData(szName, nPos, nAlphaGrade);
break;
case TAB_GUILD:
break;
}
}
void SUIPartyWndBase::SetPartyMemberData( const char* szName, int nPos, int& nAlphaGrade )
{
SPlayerSlot* pSlot = m_PartyMgr.FindMember(szName);
if( pSlot == NULL )
return;
SGameAvatarEx* pPlayer = (SGameAvatarEx*)m_pGameManager->GetActiveGame()->GetGameObject(pSlot->GetHandle());
if(m_bLogIn[nPos] && pPlayer) // 접속해 있을 경우
{
K3DVector* pPos = pPlayer->GetPosition();
float fx = pPos->x;
float fy = pPos->y;
// 2011.11.03 : servantes : 거리 계산후 알파 처리
K3DVector2 v1(0, 0);
if(g_pCurrentGameSystem)
{
SGameAvatarEx* pLocalPlayer = g_pCurrentGameSystem->GetLocalPlayer(); // 내 캐릭터
if( pLocalPlayer )
{
v1.x = pLocalPlayer->GetPosition()->x;
v1.y = pLocalPlayer->GetPosition()->y;
}
}
K3DVector2 v2(fx, fy);
K3DVALUE fDistance = (v1-v2).SquareMagnitude(); // SquareMagnitude
if(fDistance < c_fAlphaGradeRadius1) // 0 - 525
{
m_aSlotChar[nPos].Alpha(c_fAlphaGrade0);
nAlphaGrade = 0;
}
else if(fDistance >= c_fAlphaGradeRadius1 && fDistance < c_fAlphaGradeRadius2) // 525 - 1000
{
m_aSlotChar[nPos].Alpha(c_fAlphaGrade1);
nAlphaGrade = 1;
}
else if(fDistance >= c_fAlphaGradeRadius2) // 1000
{
m_aSlotChar[nPos].Alpha(c_fAlphaGrade2);
nAlphaGrade = 2;
}
}
else // 접속하지 않았을 경우
{
m_aSlotChar[nPos].Alpha(c_fAlphaGrade2);
nAlphaGrade = 2;
}
m_aSlotChar[nPos].Show(true);
m_aSlotChar[nPos].pJob->SetIcon( c_szDEF_SPR_NAME, GetJobDB().GetJobIconName(pSlot->GetJobID()) );
m_aSlotChar[nPos].pJob->SetTooltip(NULL);
std::string strCaption;
if(m_nUISizeState == PARTY_UI_ID_SMALL)
strCaption =c_strNameCaptionS;
else
strCaption = c_strNameCaptionL;
strCaption += szName;
m_aSlotChar[nPos].pName->SetCaption(strCaption.c_str());
/// 2011.06.23 redmine 76 파티원이 매스 HP 리제너레이션, MP 리제너레이션 효과 적용 후 로그 아웃시 파티 창 문제 - prodongi
int nHPPercent = pSlot->GetHP();
int nMPPercent = pSlot->GetMP();
int nHPMAX = 100;
int nMPMAX = 100;
if(pPlayer == NULL)
{
nHPPercent = 1;
nMPPercent = 1;
}
if(pPlayer && m_nPartyType == PARTY_SIEGE_OTHER) // 다른 파티이면
{
nHPPercent = pPlayer->GetHP();
nMPPercent = pPlayer->GetMP();
nHPMAX = pPlayer->GetMaxHP();
nMPMAX = pPlayer->GetMaxMP();
}
bool isPlayer = pPlayer ? true : false;
RefreshGauge( nPos, true, nHPPercent, nHPMAX, false, isPlayer );
RefreshGauge( nPos, false, nMPPercent, nMPMAX, false, isPlayer );
}
void SUIPartyWndBase::updateBuffVisible(int nPos)
{
if(m_nListSizeType == PARTY_UI_LIST_SIZE_REDUCE) // 접은 상태면 버프관련 메세지 보내지 않는다
return ;
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
/*
bool bShow = false;
SUIPartyStateWndMgr* pPartyStateWndMgr = dynamicCast<SUIPartyStateWndMgr*>( m_pGameManager->GetSUI( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE ) );
if(pPartyStateWndMgr)
{
if( pPartyStateWndMgr->GetBuffVisible( pParty->GetPartyName(), false, nPos, bShow ) < 0 )
return ;
}
*/
bool bShow = m_parent->isShowPlayerBuff(nPos);
number_t type ( TS_ENTER::GAME_SUMMON );
number_t index( nPos );
if(bShow == true)
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "one_state_on", pParty->GetPartyName(), type, index));
else
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "one_state_off", pParty->GetPartyName(), type, index));
}
void SUIPartyWndBase::RefreshGaugeAll()
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
int i=0;
std::vector<SPlayerSlot*> vecMemberList = pParty->GetMemberList();
std::vector<SPlayerSlot*>::iterator itE = vecMemberList.end();
std::vector<SPlayerSlot*>::iterator itS = vecMemberList.begin();
for(; itS != itE; itS++, i++)
{
SPlayerSlot* pSlot = (*itS);
if( pSlot == NULL )
return ;
if( pSlot->GetHandle() )
m_bLogIn[i] = true;
else
m_bLogIn[i] = false;
int nHPPercent = pSlot->GetHP();
int nMPPercent = pSlot->GetMP();
int nHPMAX = 100;
int nMPMAX = 100;
RefreshGauge( i, true, nHPPercent, nHPMAX );
RefreshGauge( i, false, nMPPercent, nMPMAX );
}
}
void SUIPartyWndBase::RefreshGaugeByIndex(const char* szName)
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
SPlayerSlot* pSlot = pParty->FindMember(szName);
if( pSlot == NULL )
return ;
int nPos = pParty->FindMemberIndex( pSlot->GetHandle() );
if(nPos < 0)
return ;
int nHPPercent = pSlot->GetHP();
int nMPPercent = pSlot->GetMP();
int nHPMAX = 100;
int nMPMAX = 100;
RefreshGauge( nPos, true, nHPPercent, nHPMAX );
RefreshGauge( nPos, false, nMPPercent, nMPMAX );
}
bool SUIPartyWndBase::SetPlayerCreatureData( int nPos, AR_HANDLE hMaster, int nAlphaGrade )
{
if( nPos < 0 || nPos >= c_nMaxLine )
return false;
m_vecCreatureList[nPos].hMaster = hMaster;
SGameAvatarEx* pMaster = GetObject( hMaster );
// 2010.08.12 - prodongi
/*
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].bRender = true;
}
*/
if(m_bLogIn[nPos]) // 접속해 있을 경우
{
if(nAlphaGrade == 0) // 0 - 525
{
m_aSlotCreature[nPos].Alpha(c_fAlphaGrade0);
}
else if(nAlphaGrade == 1) // 525 - 1000
{
m_aSlotCreature[nPos].Alpha(c_fAlphaGrade1);
}
else // 2 // 1000
{
m_aSlotCreature[nPos].Alpha(c_fAlphaGrade2);
}
}
else // 접속하지 않았을 경우
{
m_aSlotCreature[nPos].Alpha(1.0f);
}
SGameAvatarEx* pCreature = GetObject( m_vecCreatureList[nPos].hCreature1st );
if( pCreature && pCreature->IsActivated() )
{
SetCreatureData( nPos, m_vecCreatureList[nPos].hCreature1st );
m_aSlotCreature[nPos].pSelectMain->SetShow(true); // 2011.10.27 : servantes
if( m_vecCreatureList[nPos].hCreature2nd )
{
SGameAvatarEx* pCreature2nd = GetObject( m_vecCreatureList[nPos].hCreature2nd );
if( pCreature2nd )
{
SetCreature2ndData( nPos, m_vecCreatureList[nPos].hCreature2nd );
m_aSlotCreature[nPos].pSelectSub->SetShow(true);
return true;
}
else
{
m_vecCreatureList[nPos].hCreature2nd = NULL;
m_aSlotCreature[nPos].pSelectSub->SetShow(false);
}
}
return true;
}
else
{
m_vecCreatureList[nPos].hCreature1st = NULL;
m_aSlotCreature[nPos].pSelectMain->SetShow(false); // 2011.10.27 : servantes
m_vecCreatureList[nPos].hCreature2nd = NULL;
m_aSlotCreature[nPos].pSelectSub->SetShow(false);
}
//m_vecCreatureList[nPos].bRender = false;
//m_vecCreatureList[nPos].bRenderUI = false; // 2010.08.30 - prodongi
return false;
}
bool SUIPartyWndBase::SetCreatureData( int nPos, AR_HANDLE handle )
{
if( nPos < 0 || nPos >= c_nMaxLine )
return false;
// 2010.08.31 - prodongi
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);
m_aSlotCreature[nPos].pDead->SetShow(false);
RefreshGauge( nPos, true, pCreature->GetHP(), pCreature->GetMaxHP(), true);
RefreshGauge( nPos, false, pCreature->GetMP(), pCreature->GetMaxMP(), true);
return true;
}
bool SUIPartyWndBase::SetCreature2ndData( int nPos, AR_HANDLE handle )
{
if( nPos < 0 || nPos >= c_nMaxLine )
return false;
// 2010.08.31 - prodongi
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);
m_aSlotCreature[nPos].pDead2->SetShow(false);
RefreshGauge2nd( nPos, true, pCreature->GetHP(), pCreature->GetMaxHP(), true);
RefreshGauge2nd( nPos, false, pCreature->GetMP(), pCreature->GetMaxMP(), true);
return true;
}
bool SUIPartyWndBase::RefreshCreatureGauge( AR_HANDLE handle )
{
int nCreatureIndex = GetCreatureIndex( handle );
if( nCreatureIndex == -1 )
return false;
return SetCreatureData( nCreatureIndex, handle );
}
/// 2011.08.08 - prodongi
void SUIPartyWndBase::RefreshGauge( int nPos, bool bHP, int curValue, int maxValue, bool bCreature/*=false*/, bool isPlayer )
{
KUIControlGauge* pWnd;
if( bCreature )
{
if(bHP)
pWnd = m_aSlotCreature[nPos].pHP;
else
pWnd = m_aSlotCreature[nPos].pMP;
}
else
{
if(bHP)
pWnd = m_aSlotChar[nPos].pHP;
else
pWnd = m_aSlotChar[nPos].pMP;
}
int per = static_cast<int>(m_pDisplayInfo->GetPercent(curValue, maxValue));
if (isPlayer)
{
m_pDisplayInfo->RefreshGaugeAndStatic( pWnd, curValue, maxValue, per, DEFAULT_GAUGE_ANI_TIME );
pWnd->ReSizeBackGround();
}
if( bHP )
{
// 게이지 남은 양에 따라 텍스처 바꿔줌 // 2012.02.02 - servantes
setHPGaugeTexture( per, pWnd );
KUIWnd* pDeadWnd;
if( bCreature )
pDeadWnd = m_aSlotCreature[nPos].pDead;
else
pDeadWnd = m_aSlotChar[nPos].pDead;
if( pDeadWnd && m_bLogIn[nPos] )
{
if( nPos >= 0 && nPos < SLOT_MAXLINE && per <= 0 )
pDeadWnd->SetShow(true);
else
pDeadWnd->SetShow(false);
}
}
}
void SUIPartyWndBase::RefreshGauge2nd( int nPos, bool bHP, int curValue, int maxValue, bool bCreature/*=false*/ )
{
KUIControlGauge* pWnd;
if( bCreature )
{
if(bHP)
pWnd = m_aSlotCreature[nPos].pHP2;
else
pWnd = m_aSlotCreature[nPos].pMP2;
}
else
{
if(bHP)
pWnd = m_aSlotChar[nPos].pHP;
else
pWnd = m_aSlotChar[nPos].pMP;
}
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 SUIPartyWndBase::EnableSlot( int nPos, bool bShow )
{
m_aSlotChar[nPos].Show(bShow);
}
// 2011.09.15 - servantes : EnableCreatureSlot2nd 함수 추가 : 두번째 크리처도 표기해야 한다
void SUIPartyWndBase::EnableCreatureSlot( int nPos, bool bShow )
{
m_aSlotCreature[nPos].Show(bShow, 0);
}
void SUIPartyWndBase::EnableCreatureSlot2nd( int nPos, bool bShow )
{
m_aSlotCreature[nPos].Show(bShow, 1);
}
int SUIPartyWndBase::GetPartyType() // 2011.09.19 : servantes : 파티 타입 얻기
{
return m_nPartyType;
}
void SUIPartyWndBase::SetPartymark(int type)
{
if(!m_pStaticPartyMarkSmile)
return;
if(type == PARTY_SIEGE_OTHER) // 시즈 공대 다른 파티 일때만
{
SUIPartyDualWnd *pParent = dynamicCast<SUIPartyDualWnd*> (this->GetParent());
if(!pParent)
return;
std::string PartyName = *(pParent->GetPartyName());
int nNumber = m_RaidMgr.getNumberAtPartyName( PartyName );
m_pStaticPartyMarkSmile->SetAniName(CStringUtil::StringFormat("common_mark_titanium_attackteam_%02d", nNumber+1).c_str()); // 파티번호보다 스프라이트 셋이 하나 크다..
m_pStaticPartyMarkSmile->SetShow(true);
}
else
m_pStaticPartyMarkSmile->SetShow(false);
}
void SUIPartyWndBase::SetPartyType(int party_type) // 2011.09.19 : servantes : 파티 타입 설정 및 NUI 변경
{
SetPartymark(party_type);
int markToolTip;
char const* markAniName;
// 마크 표시
if(party_type == PARTY_SIEGE || party_type == PARTY_DUNGEON_RAID) // 시즈,레이드 (내파티)
{
markToolTip = 5132;
markAniName = "common_mark_titanium_siege";
}
else if(party_type == PARTY_BEARROAD) // 베어로드(헌터홀릭)
{
markToolTip = 5124;
markAniName = "common_mark_titanium_bearload";
}
/// PARTY_SIEGE_OTHER보다 isArenaParty의 우선 순위가 높기 때문에, PARTY_SIEGE_OTHER 보다 먼저 체크 되어야 한 다
else if (party_type == PARTY_ARENA || m_PartyMgr.isArenaParty())
{
markToolTip = 2309;
markAniName = "game_mark_titanium_arena_party";
}
else if(party_type == PARTY_SIEGE_OTHER) // 시즈,레이드 (다른 파티)
{
markToolTip = 5133;
markAniName = "common_mark_titanium_siege_viewer";
}
else // 일반파티
{
markToolTip = 5123;
markAniName = "common_mark_titanium_party";
}
m_staticPartyMark->SetTooltip(S(markToolTip));
m_staticPartyMark->SetAniName(markAniName);
/// 2012.06.14 기본 값 설정 - prodongi
if (PARTY_ARENA == party_type || m_PartyMgr.isArenaParty())
{
if (g_pCurrentGameSystem)
{
sArenaSystem* arenaSystem = g_pCurrentGameSystem->getArenaSystem();
sArenaUtility utility;
int myTeam = arenaSystem->getMyTeam();
SetChildAniName("titlebar_bg_default_party_01", utility.teamToPartyTitleAniName(myTeam));
}
}
/// 기본 값
else
{
SetChildAniName("titlebar_bg_default_party_01", "common_titlebar_trim_beamblue_party_bg");
}
switch(party_type)
{
case PARTY_NORMAL: // 일반파티 //2011.09.22
case PARTY_DUNGEON_RAID: // 던전 레이드
case PARTY_SIEGE: // 공격대
case PARTY_BEARROAD: // 베어로드(헌터홀릭)
case PARTY_ARENA:
{
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);
}
/// 위에서 파티 타입을 설정하는데 왜 또 설정 하는가?? - prodongi
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();
if (m_PartyMgr.isArenaParty())
m_pBtnClose->SetShow(false);
else
m_pBtnClose->SetShow(true);
m_pBtnSubOption->SetShow(false);
if(m_nListSizeType == PARTY_UI_LIST_SIZE_EXTEND) // 리스트를 편 상태
{
if (m_PartyMgr.isArenaParty())
m_pBtnMinimize->MovePos(rt.left, rt.top);
else
m_pBtnMinimize->MovePos(rt.left - rt.GetWidth(), rt.top);
m_pBtnMinimize->SetShow(true);
m_pBtnMaximize->SetShow(false);
}
else // 리스트를 접은 상태
{
if (m_PartyMgr.isArenaParty())
m_pBtnMaximize->MovePos(rt.left, rt.top);
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 SUIPartyWndBase::ChangeVisibleMinimizeManimizeButtom(int nToBeState)
{
if (nToBeState == TO_BE_MIN)
{
KRect rt = m_pBtnClose->GetRect();
if(m_nPartyType == PARTY_SIEGE_OTHER)
{
m_pBtnSubOption->SetShow(false);
m_pBtnMinimize->SetShow(false);
m_pBtnMaximize->SetShow(true);
if (m_PartyMgr.isArenaParty())
{
m_pBtnClose->SetShow(false);
m_pBtnMaximize->MovePos(rt.left, rt.top);
}
else
{
m_pBtnClose->SetShow(true);
m_pBtnMaximize->MovePos(rt.left - rt.GetWidth(), rt.top);
}
}
else
{
m_pBtnSubOption->SetShow(true);
m_pBtnClose->SetShow(false);
m_pBtnMinimize->SetShow(false);
m_pBtnMaximize->MovePos(rt.left, rt.top);
m_pBtnMaximize->SetShow(true);
}
// 2011. 11. 10 - marine 공대장 마크 안보이게
KUIControlStatic *pMark = dynamicCast<KUIControlStatic*>(GetChild("mark_siegeleader_01"));
if(pMark)
pMark->SetShow(false);
}
else if(nToBeState == TO_BE_MAX)
{
KRect rt = m_pBtnClose->GetRect();
if(m_nPartyType == PARTY_SIEGE_OTHER)
{
m_pBtnSubOption->SetShow(false);
m_pBtnMaximize->SetShow(false);
m_pBtnMinimize->SetShow(true);
if (m_PartyMgr.isArenaParty())
{
m_pBtnClose->SetShow(false);
m_pBtnMinimize->MovePos(rt.left, rt.top);
}
else
{
m_pBtnClose->SetShow(true);
m_pBtnMinimize->MovePos(rt.left - rt.GetWidth(), rt.top);
}
}
else
{
m_pBtnSubOption->SetShow(true);
m_pBtnClose->SetShow(false);
m_pBtnMaximize->SetShow(false);
m_pBtnMinimize->MovePos(rt.left, rt.top);
m_pBtnMinimize->SetShow(true);
}
// 2011. 11. 10 - marine 공대장 마크 보이게
KUIControlStatic *pMark = dynamicCast<KUIControlStatic*>(GetChild("mark_siegeleader_01"));
if(pMark)
pMark->SetShow(true);
}
}
void SUIPartyWndBase::SetListSizeType(int type) // 2011.09.19 : servantes : 리스트 크기 타입
{
m_nListSizeType = type;
if(m_nListSizeType == PARTY_UI_LIST_SIZE_REDUCE)
{
m_pStaticLeaderMark->SetShow( false );
ChangeVisibleMinimizeManimizeButtom( TO_BE_MIN ); // 최소화 버튼 보이고 최대화 버튼 숨김
DisableSlots();
setShowMinimizeMark(true);
ChangeSize();
// m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "hide_wnd", m_parent->GetPartyName()->c_str() ) );
}
else
{
m_nListSizeType = PARTY_UI_LIST_SIZE_EXTEND;
ChangeVisibleMinimizeManimizeButtom( TO_BE_MAX ); // 최대화 시킨다
RefreshSlots();
setShowMinimizeMark(false);
// m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "show_wnd" ) );
}
}
void SUIPartyWndBase::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 SUIPartyWndBase::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 )
{
SGame* pGame = m_pGameManager->GetActiveGame();
if(pGame)
{
TS_TRADE msg;
msg.mode = TS_TRADE::REQUEST_TRADE;
msg.target_player = pTarget->GetArID();
pGame->SendMsg( &msg );
m_pGameManager->GetActiveGame()->SendGameInterfaceMsg( &SIMSG_UI_DISPLAY_SYS_MSG( SYS_MSG_TRADE_REQUEST ) ); //거래 신청
}
}
}
}
}
}
}
//////////////////////////////////////////////////////////////////////////
// 파티정보
//////////////////////////////////////////////////////////////////////////
void SUIPartyWndBase::RefreshPartyInfo()
{
// 분배 방식
int nDivision = -1;
if( m_nTabType == TAB_PARTY )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
nDivision = pParty->GetDivision();
// nDivision = m_PartyMgr.GetDivision();
}
}
//////////////////////////////////////////////////////////////////////////
// 선택
//////////////////////////////////////////////////////////////////////////
void SUIPartyWndBase::SelectMember( int nPos )
{
m_nSelectIndex = nPos;
m_nSelectCreatureIndex = -1;
AR_HANDLE hPlayer = GetHandle(nPos);
if( hPlayer )
{
if( !m_aSlotChar[nPos].pName->IsShow() )
return ;
/// 2012.02.14 태그가 바뀔 수가 있기 때문에 캡션에서 이름을 추출함 - prodongi
std::string strToken;
extractTokenAndText(m_aSlotChar[nPos].pName->GetCaption(), strToken, m_strSelectMember);
m_hSelectMember = hPlayer;
}
else
{
UnSelect();
m_strSelectMember = "";
m_hSelectMember = 0;
}
}
void SUIPartyWndBase::SelectMemberForce( int nPos )
{
m_nSelectIndex = nPos;
m_nSelectCreatureIndex = -1;
m_strSelectMember = "";
m_hSelectMember = 0;
std::string strTemp;
if( m_aSlotChar[nPos].pName->IsShow() )
{
/// 2012.02.14 태그가 바뀔 수가 있기 때문에 캡션에서 이름을 추출함 - prodongi
std::string strToken;
extractTokenAndText(m_aSlotChar[nPos].pName->GetCaption(), strToken, m_strSelectMember);
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty)
{
m_hSelectMember = pParty->GetMemberHandle( strTemp.c_str() ); // 핸들
}
}
}
void SUIPartyWndBase::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 SUIPartyWndBase::RefreshSelectMember( AR_HANDLE hPlayer, const char* szPlayer )
{
//OutputDebugString( "SUIPartyWndBase::RefreshSelectMember()\n" );
SetChildShow( "party_select_normal" );
if( !IsShow() ) return;
UnSelect();
// 현재 선택 된 파티원이 있고, 타겟이 설정이 안된 경우
// 선택 된 파티원으로 타겟 설정. kappamind, 2010.01.14
if( hPlayer == NULL )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
if( ! pParty->GetSelectMemberHandle() )
return;
hPlayer = pParty->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 )
if (!m_parent->isShowCreature(nCreatureIndex))
return;
// sonador 7.0.22 Mantis 0002774: [타겟] tab키를 이용한 타겟설정 시 문제점
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
if( !pParty->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 SUIPartyWndBase::GetHandle( int nPos )
{
if( !m_aSlotChar[nPos].pName->IsShow() )
return NULL;
std::string strTemp = m_aSlotChar[nPos].pName->GetCaption();
if(m_nUISizeState == PARTY_UI_ID_SMALL)
XStringUtil::Replace( strTemp, c_strNameCaptionS , "" );
else
XStringUtil::Replace( strTemp, c_strNameCaptionL , "" );
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return 0;
return pParty->GetMemberHandle( strTemp.c_str() );
}
//////////////////////////////////////////////////////////////////////////
// 공통
//////////////////////////////////////////////////////////////////////////
void SUIPartyWndBase::RequestPartyJoinAccept()
{
if( GetGameOption().IsRejectTrade() )
{
m_pDisplayInfo->RequestJoinInvitedParty(false);
return;
}
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
std::string strText = SStringDB::ParseString( GetStringDB().GetString(SYS_MSG_PARTY_INVITE_CHECK), "#@party_name@#", pParty->GetPartyName(), "#@user_name@#", pParty->GetMessage() );
SIMSG_REQ_OPEN_MSGBOX msg( SIMSG_REQ_OPEN_MSGBOX::MSGBOX_PARTYJOINCHECK, strText.c_str(), true );
m_pGameManager->ProcMsgAtStatic( &msg );
}
void SUIPartyWndBase::RequestGuildJoinAccept()
{
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 SUIPartyWndBase::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 SUIPartyWndBase::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 SUIPartyWndBase::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();
if(m_nUISizeState == PARTY_UI_ID_SMALL)
XStringUtil::Replace( strTemp, "<font:font_01><size:7><hcenter><vcenter>", "" );
else
XStringUtil::Replace( strTemp, "<font:font_01><size:9><hcenter><vcenter>", "" );
if( !_stricmp( strTemp.c_str(), szPlayer ) )
{
return i;
}
}
return -1;
}
void SUIPartyWndBase::RefreshOnLine()
{
//OutputDebugString( "SUIPartyWndBase::RefreshOnLine()\n" );
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
std::vector<SPlayerSlot*>& vecMemberList = pParty->GetMemberList();
std::vector<SPlayerSlot*>::const_iterator it = vecMemberList.begin();
int nCount = static_cast<int>( vecMemberList.size() );
if(nCount > c_nMaxLine)
nCount = c_nMaxLine;
// for( int i(0); c_nMaxLine>i; i++ )
for( int i(0); nCount > i; i++ )
{
if(m_bLogIn[i] == true)
{
m_aSlotChar[i].pLogOff->SetShow(false);
}
else
{
KRect rt = m_aSlotChar[i].pSelect->GetRect();
m_aSlotChar[i].pLogOff->SetShow(true);
m_aSlotChar[i].pLogOff->MovePos(rt.left+ 2, rt.top + 2);
m_aSlotChar[i].pDead->SetShow(false);
}
}
}
void SUIPartyWndBase::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, "INVITE" ) )
int k=0;
if( 0 == ::_stricmp( szKeyword, "TAKE_ITEM" ) )
{
if( nTextSize < 6 )
{
vecText.clear();
return;
}
// 임시 .. 자기 자신에게도 메시지가 오므로 일단 여기서 이름으로 체크하여 막는다 .. 추후에 서버에서 아예 안보내도록 수정될 예정 ...
if( ::_stricmp( vecText[1].c_str(), g_pCurrentGameSystem->getLocalPlayerName() ) != 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, false ) )
{
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;
}
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
if( pParty->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 ) );
m_pGameManager->InterfaceMsg( &SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTYMATCHING, false ));
m_pGameManager->InterfaceMsg( &SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTYMATCHING_REGISTER, false ));// 파티매칭
m_pDisplayInfo->AddSystemMessage( SR( 409, "#@party_name@#", pParty->GetPartyName() ).c_str(), 99 );
}
}
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;
}
// "PROMOTE|파티ID|캐릭이름" 으로 변경됨
m_pDisplayInfo->SetPartySysMsg( SYS_MSG_PARTY_NEW_READER, vecText[2].c_str() );
}
else if( 0 == ::_stricmp( szKeyword, "LEAVE" ) )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
if( pParty->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, vecText[1].c_str(), vecText[2].c_str() );
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, true ) );
m_pGameManager->InterfaceMsg( &SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTYMATCHING, false ));
m_pGameManager->InterfaceMsg( &SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTYMATCHING_REGISTER, false ));// 파티매칭
}
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" ) )
{
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(433), 99 );
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(434), 99 );
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), 99 ); // PK On 상태일때 거부 메세지
else if( 0 == ::_stricmp( szKeyword, "ERROR_IN_DEATHMATCH" ) ) m_pDisplayInfo->AddSystemMessage( S(9200), 0 );
else if( 0 == ::_stricmp( szKeyword, "ERROR_IN_INSTANCE_DUNGEON" ) ) m_pDisplayInfo->AddSystemMessage( S(SYS_MSG_INVALID_ACT_IN_DUN), 0 ); /// 2011.07.20 - prodongi
else if( 0 == ::_stricmp( szKeyword, "ERROR_NOT_GUILD_MEMBER" ) ) m_pDisplayInfo->AddSystemMessage( S(6796), 0 );
/// 파티에서는 파티 종류에 상관없이 공통으로 들어오기 때문에 각 파티 종류에 해당 되는 부분에서 출력을 해줘야 될 것 같다.
/*
else if (0 == ::_stricmp(szKeyword, "ERROR_ALREADY_EXIST")) m_pDisplayInfo->AddSystemMessage( "ERROR_ALREADY_EXIST" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_READY")) m_pDisplayInfo->AddSystemMessage( "ERROR_READY" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_LIMIT_MAX")) m_pDisplayInfo->AddSystemMessage( "ERROR_LIMIT_MAX" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_TARGET_IN_HUNTAHOLIC")) m_pDisplayInfo->AddSystemMessage( "ERROR_TARGET_IN_HUNTAHOLIC" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_TARGET_IN_INSTANCE_DUNGEON")) m_pDisplayInfo->AddSystemMessage( "ERROR_TARGET_IN_INSTANCE_DUNGEON" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_TARGET_IN_DEATHMATCH")) m_pDisplayInfo->AddSystemMessage( "ERROR_TARGET_IN_DEATHMATCH" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_TARGET_ANOTHER")) m_pDisplayInfo->AddSystemMessage( "ERROR_TARGET_ANOTHER" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_INVALID_PARTY")) m_pDisplayInfo->AddSystemMessage( "ERROR_INVALID_PARTY" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_INVITATION_DENIED")) m_pDisplayInfo->AddSystemMessage( "ERROR_INVITATION_DENIED" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "HAS_NO_AUTHORITY")) m_pDisplayInfo->AddSystemMessage( "HAS_NO_AUTHORITY" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_IN_HUNTAHOLIC")) m_pDisplayInfo->AddSystemMessage( "ERROR_IN_HUNTAHOLIC" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_JOIN_TARGET_IN_HUNTAHOLIC")) m_pDisplayInfo->AddSystemMessage( "ERROR_JOIN_TARGET_IN_HUNTAHOLIC" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_JOIN_TARGET_IN_INSTANCE_DUNGEON")) m_pDisplayInfo->AddSystemMessage( "ERROR_JOIN_TARGET_IN_INSTANCE_DUNGEON" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_JOIN_TARGET_IN_DEATHMATCH")) m_pDisplayInfo->AddSystemMessage( "ERROR_JOIN_TARGET_IN_DEATHMATCH" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_JOIN_TARGET_ANOTHER")) m_pDisplayInfo->AddSystemMessage( "ERROR_JOIN_TARGET_ANOTHER" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_JOIN_TARGET_LIMIT")) m_pDisplayInfo->AddSystemMessage( "ERROR_JOIN_TARGET_LIMIT" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_JOIN_TARGET_READY")) m_pDisplayInfo->AddSystemMessage( "ERROR_JOIN_TARGET_READY" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_JOIN_TARGET_FAIL")) m_pDisplayInfo->AddSystemMessage( "ERROR_JOIN_TARGET_FAIL" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_NOT_ACTABLE")) m_pDisplayInfo->AddSystemMessage( "ERROR_NOT_ACTABLE" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_JOIN_TARGET_NOT_ACTABLE")) m_pDisplayInfo->AddSystemMessage( "ERROR_JOIN_TARGET_NOT_ACTABLE" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_JOIN_TARGET_MAX")) m_pDisplayInfo->AddSystemMessage( "ERROR_JOIN_TARGET_MAX" ); /// 스트링 필요
else if (0 == ::_stricmp(szKeyword, "ERROR_UNKNOWN")) m_pDisplayInfo->AddSystemMessage( "ERROR_JOIN_TARGET_UNKNOWN" ); /// 스트링 필요
*/
vecText.clear();
}
void SUIPartyWndBase::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();
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") ) //길드장 아님
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_ERROR_NOT_GUILD_LEADER), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_NOT_RAID_GUILD" ) ) //레이드 신청 안함
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_ERROR_NOT_RAID_GUILD), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_ALREADY_COMPLETE_RAID" ) ) //레이드 신청 안함
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_SIEGE_TEAM_SETUP_IMPOSSIBLE), 99);
// 2010.06.14. bintitle. UI팀 요청으로 MessageBox도 띄운다.
/// 2011.05.16 ProcMsgAtStatic는 정적 입력 변수이다 - prodongi
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" ) ) //이미 파티 가입중
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_PARTY_ALREADY_OTHER_MEMBER), 99);
}
else if( 0 == ::_stricmp( szKeyword, "INVALID_PARTY_NAME" ) ) //잘못된 공대 이름
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_INVALID_PARTY_NAME), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ALREADY_EXIST" ) ) //이미 존재하는 공대 이름
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_ALREADY_EXIST), 99);
}
else if( 0 == ::_stricmp( szKeyword, "CANT_JOIN" ) ) //공대 가입 불가
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_CANT_JOIN), 99);
}
//레이드 길드 공병 초대, 용병 공병 초대
//////////////////////////////////////////////////////////////////////////
else if( 0 == ::_stricmp( szKeyword, "ERROR_TARGET_ANOTHER_GUILD" ) ) //다른 길드
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_ERROR_TARGET_ANOTHER_GUILD), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_MAX" ) ) //최대 파티 수 초과
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_ERROR_MAX), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_TARGET_ANOTHER" ) ) //이미 다른 파티 소속중
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_PARTY_ALREADY_OTHER_MEMBER), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_INVALID_PARTY" ) ) //없는 파티
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_ERROR_INVALID_PARTY), 99);
}
else if( 0 == ::_stricmp( szKeyword, "HAS_NO_AUTHORITY" ) ) //비밀번호 틀림
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_RAID_HAS_NO_AUTHORITY), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_IN_DEATHMATCH" ) )
{
m_pDisplayInfo->AddSystemMessage( S(9200), 0 );
}
vecText.clear();
}
void SUIPartyWndBase::OutputAllianceText( const char* szText )
{
// Fraun performance tweak
std::vector<std::string> vecText;
MsgSplit( szText, vecText, L"|" );
if( vecText.size() < 1 ) return;
const char* szKeyword = vecText[0].c_str();
// 연합 초대시
if( 0 == ::_stricmp( szKeyword, "ERROR_TARGET_ANOTHER" ) ) //존재하지 않는 길드이거나, 이미 다른 연합에 가입중인 길드입니다.
{
m_pDisplayInfo->AddSystemMessage( S(SYS_MSG_ERROR_NOT_INVITABLE_GUILD), 99); // [sonador][3.2.2] 추가 수정분
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_NOT_ONLINE" ) ) //대상 길드의 길드장이 로그인 상태가 아닙니다.
{
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_NOT_ONLINE), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_LIMIT_EXCEED" ) ) //더 이상 연합 구성원을 추가할 수 없습니다.
{
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_LIMIT_EXCEED), 99);
}
// 연합 추방시
else if( 0 == ::_stricmp( szKeyword, "ERROR_NOT_IN_ALLIANCE" ) ) //존재하지 않는 길드이거나, 연합 소속 길드가 아닙니다.
{
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_NOT_IN_ALLIANCE), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_IS_GUILD_MASTER" ) ) //자신의 길드를 추방할 수 없습니다.
{
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_IS_GUILD_MASTER), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_CANT_KICK" ) ) //해당 길드를 추방할 수 없습니다.
{
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_CANT_KICK), 99);
}
// 연합 탈퇴시
else if( 0 == ::_stricmp( szKeyword, "ERROR_CANT_LEAVE" ) ) //해당 연합에서 탈퇴할 수 없습니다.
{
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_CANT_LEAVE), 99);
}
// 연합 가입시
else if( 0 == ::_stricmp( szKeyword, "ERROR_ALREADY_IN_ALLIANCE" ) ) //이미 다른 연합에 가입 중입니다.
{
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_ALREADY_IN_ALLIANCE), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_INVALID_ALLIACE" ) ) //존재하지 않는 연합입니다.
{
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_INVALID_ALLIACE), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_PERMISSION_DENIED" ) ) //권한이 없습니다.
{
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_PERMISSION_DENIED), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_CANT_JOIN_ALLIANCE" ) ) //연합에 가입할 수 없습니다.
{
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_CANT_JOIN_ALLIANCE), 99);
}
// 연합 해체시
else if( 0 == ::_stricmp( szKeyword, "ERROR_HAS_ALLIANCE_MEMBER" ) ) //연합에 소속된 길드가 있습니다.
{
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_HAS_ALLIANCE_MEMBER), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_CANT_DESTROY_GUILD" ) ) //연합을 해체할 수 없습니다.
{
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_CANT_DESTROY_GUILD), 99);
}
// 공용
else if( 0 == ::_stricmp( szKeyword, "ERROR_IS_RAID" ) ) //이미 레이드를 신청한 상태입니다.
{
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_NOT_INVITABLE_GUILD), 99); // [sonador][3.2.2] 추가 수정분
}
// { [sonador][3.2.1]룰 수정에 따른 시스템 메시지 추가
else if( 0 == ::_stricmp( szKeyword, "ERROR_OTHER_MEMBER_EXIST" ) )
{
// Alliance master guild cannot leave the alliance, and alliance cannot be disbanded until all guilds leave the alliance.
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_OTHER_MEMBER_EXIST), -1);
}
else if( 0 == ::_stricmp( szKeyword, "IS_IN_RAID_PARTY" ) )
{
// 길드 연합 탈퇴/추방시 연합에서 나갈 길드의 길드원 중 한 명이라도 공대 파티에 소속되어 있는 경우
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_IN_SIEGE_OR_RAID), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_IN_SIEGE_OR_RAID" ) )
{
// 길드 연합 탈퇴/추방시 연합에서 나갈 길드의 길드원 중 한 명이라도 시즈 또는 레이드 던전에 입장한 상태인 경우
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_IN_SIEGE_OR_RAID), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_INVALID_GUILD" ) )
{
// 길드 연합에 특정 길드를 초대하려고 할 때 대상 길드가 유효하지 않은 길드인 경우(없는 길드 이름을 지정하는 경우 등등)
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_ERROR_NOT_INVITABLE_GUILD), 99); // [sonador][3.2.2] 추가 수정분
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_ALLIANCE_BLOCK_TIME_LIMIT" ) )
{
// 길드 연합에 특정 길드를 초대하거나 특정 길드가 가입할 때 해당 길드가 기존의 연합에서 나온지 7일이 지나지 않아 연합에 가입할 수 없는 경우
m_pDisplayInfo->AddSystemMessage(S(SYS_MSG_GUILD_REJOIN_LIMIT), 99);
}
vecText.clear();
}
void SUIPartyWndBase::OutputGuildText( const char* szText )
{
// Fraun performance tweak
std::vector<std::string> vecText;
MsgSplit( szText, vecText, L"|" );
if( vecText.size() < 1 ) return;
const char* szKeyword = vecText[0].c_str();
std::string strPartyMsg = m_GuildMgr.GetMessage();
if( ::_stricmp( szKeyword, "CREATE" ) == 0 )
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, true ) );
else if( ::_stricmp( szKeyword, "NEW" ) == 0 )
{
m_pDisplayInfo->AddSystemMessage(SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_JOIN_MEMBER_NOTICE), "#@user_name@#", strPartyMsg.c_str() ).c_str(), 99);
}
else if( 0 == ::_stricmp( szKeyword, "JOIN" ) )
{
m_pDisplayInfo->AddSystemMessage(SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_JOIN_MEMBER), "#@guild_name@#", strPartyMsg.c_str() ).c_str(), 99);
}
else if( 0 == ::_stricmp( szKeyword, "PROMOTE" ) )
{
m_pDisplayInfo->AddSystemMessage(SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_NEW_LEADER), "#@user_name@#", strPartyMsg.c_str() ).c_str(), 99);
// 추가. 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() )
{
m_pDisplayInfo->AddSystemMessage(SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_BAN_NOTICE), "#@user_name@#", strPartyMsg.c_str() ).c_str(), 99);
}
else
{
m_pDisplayInfo->AddSystemMessage(SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_BAN), "#@guild_name@#", m_GuildMgr.GetCommunityName() ).c_str(), 99);
}
}
else if( 0 == ::_stricmp( szKeyword, "LEAVE" ) )
{
if( m_GuildMgr.IsExist() )
{
m_pDisplayInfo->AddSystemMessage(SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_LEAVE_NOTICE), "#@user_name@#", strPartyMsg.c_str() ).c_str(), 99);
}
else
{
m_pDisplayInfo->AddSystemMessage(SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_LEAVE), "#@guild_name@#", strPartyMsg.c_str() ).c_str(), 99);
}
}
else if( 0 == ::_stricmp( szKeyword, "DESTROY" ) )
{
m_pDisplayInfo->AddSystemMessage(SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_NOTICE_MEMBER_BREAKUP), "#@guild_name@#", strPartyMsg.c_str(), "#@user_name@#", m_GuildMgr.GetCommunityLeaderName() ).c_str(), 99);
}
else if( 0 == ::_stricmp( szKeyword, "LOGOUT" ) )
{
m_pDisplayInfo->AddSystemMessage(SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_NOTICE_MEMBER_LOGOUT), "#@user_name@#", strPartyMsg.c_str() ).c_str(), 2);
}
else if( 0 == ::_stricmp( szKeyword, "LOGIN" ) )
{
m_pDisplayInfo->AddSystemMessage(SStringDB::ParseString( m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_NOTICE_MEMBER_LOGIN), "#@user_name@#", strPartyMsg.c_str() ).c_str(), 2);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_ALREADY_GUILD_MEMBER" ) )
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_ALREADY_OTHER_MEMBER), 99);
}
else if( 0 == ::_stricmp( szKeyword, "INVLIAD_GUILD_NAME" ) )
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage( SYS_MSG_PARTY_WRONGSTR ), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_MAX" ) )
{
m_pDisplayInfo->AddSystemMessage(S(111), 0);//"허용 인원이 초과되었습니다";
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_TARGET_ANOTHER" ) )
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_ALREADY_OTHER_MEMBER), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_YOU_CAN_JOIN_ONLY_ONE_GUILD" ) )
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage(SYS_MSG_GUILD_ALREADY_OTHER_MEMBER), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_GUILD_REJOIN_LIMIT" ) )
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage( SYS_MSG_GUILD_REJOIN_LIMIT ), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_GUILD_BLOCK_TIME_LIMIT" ) )
{ //TODO : 시스템 메시지 추가되면 수정해야함
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage( SYS_MSG_GUILD_REJOIN_LIMIT ), 99);
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_INVALID_GUILD" ) )
{
m_pDisplayInfo->AddSystemMessage(S(629), 99); // The guild does not exist
}
else if( 0 == ::_stricmp( szKeyword, "ALREADY_EXIST" ) )
{
m_pDisplayInfo->AddSystemMessage(S(431), 99); // That party name is in use. Please try another party name.
}
else if (0 == ::_stricmp(szKeyword, "INVITE"))
{
RequestGuildJoinAccept();
}
else if( 0 == ::_stricmp( szKeyword, "ERROR_DESTROY_IN_ALLIANCE" ) || 0 == ::_stricmp( szKeyword, "ERROR_DESTROY_DUNGEON_OWNER" ) )
{
m_pDisplayInfo->AddSystemMessage(m_pDisplayInfo->GetStringMessage( SYS_MSG_ERROR_DESTROY_IN_ALLIANCE_OR_DUNGEON_OWNER ), 0);
}
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(), 99 );
AppointMsgID = SYS_MSG_CHIEFWARRIOR_CHANGE;
}
if( !NewBC.empty() )
{
m_pDisplayInfo->AddSystemMessage(SR( AppointMsgID, "#@player_name@#", NewBC.c_str() ).c_str(), 99);
}
}
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() )
{
m_pDisplayInfo->AddSystemMessage(SR( SYS_MSG_CHIEFWARRIOR_CHANGE, "#@player_name@#", NewBC.c_str() ).c_str(), 99);
}
}
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 전투 대장 지정 아바타를 찾을 수 없음(로그아웃 상태)
m_pDisplayInfo->AddSystemMessage(SR( SYS_MSG_CHIEFWARRIOR_NOTLOGIN, "#@player_name@#", BC.c_str() ).c_str(), 99);
break;
case RESULT_NOT_OWN: // 3 같은 길드 소속이 아닌 아바타임
m_pDisplayInfo->AddSystemMessage(S( SYS_MSG_CIHEFWARRIOR_NOGUILD ), 99);
break;
case RESULT_NOT_ACTABLE_IN_SIEGE_OR_RAID: // 44 시즈 공대가 구성된 상태임
m_pDisplayInfo->AddSystemMessage(S( SYS_MSG_CHIEFWARRIOR_CNTFIRE ), 99);
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: // 던전 시즈 종료에 의해 전투 대장이 해임되었습니다.
m_pDisplayInfo->AddSystemMessage(S( SYS_MSG_CHIEFWARRIOR_DISMISSED_BY_SIEGE_OVER ), 99);
break;
case 2: // 전투 대장이 적정 레벨을 벗어나 해임되었습니다.
m_pDisplayInfo->AddSystemMessage(SR( SYS_MSG_CHIEFWARRIOR_NOTLEVEL, "#@player_name@#", BC.c_str() ).c_str(), 99);
break;
case 3: // 전투 대장이 길드를 탈퇴하여 해임되었습니다.
m_pDisplayInfo->AddSystemMessage(SR( SYS_MSG_CHIEFWARRIOR_QUITGUILD, "#@player_name@#", BC.c_str() ).c_str(), 99);
break;
}
}
}
// PK On 일 때 거부 메세지
else if( 0 == ::_stricmp( szKeyword, "ERROR_PKRULE" ) )
{
m_pDisplayInfo->AddSystemMessage( S(1652), 99 );
}
else if( 0 == ::_stricmp( szKeyword, "GBUFF" ) )
{
if( vecText.size() < 6 )
{
vecText.clear();
return;
}
int nPoint = ::atoi( vecText[ 6 ].c_str() );
switch( nPoint )
{
case 1:
g_pCurrentGameSystem->GetGame()->AddNoticeMessageOnly( SR(763, "#@player@#", vecText[3].c_str() ).c_str() );
break;
case 10:
g_pCurrentGameSystem->GetGame()->AddNoticeMessageOnly( SR(892, "#@player@#", vecText[3].c_str() ).c_str() );
break;
}
}
else if( 0 == ::_stricmp( szKeyword, "GDONATE" ) )
{
if( vecText.size() < 6 )
{
vecText.clear();
return;
}
g_pCurrentGameSystem->GetGame()->AddNoticeMessageOnly( SR(762, "#@player@#", vecText[3].c_str(), "#@point@#", vecText[6].c_str() ).c_str() );
}
else if( 0 == ::_stricmp( szKeyword, "GUPGRADE" ) )
{
if( vecText.size() < 6 )
{
vecText.clear();
return;
}
g_pCurrentGameSystem->GetGame()->AddNoticeMessageOnly( SR(766, "#@grade@#", vecText[1].c_str() ).c_str() );
}
vecText.clear();
}
void SUIPartyWndBase::Process(DWORD dwTime)
{
SUIWnd::Process(dwTime);
}
DWORD SUIPartyWndBase::OnMouseMessage(DWORD dwMessage, int x, int y)
{
///2012.01.10 base의 최종 부모는 PartyMgr이기 때문에 OnMouseMessage를 (파티개수 * 크기 종류) 만큼 호출된다.
/// 그래서 visible과 rect 체크를 해줘야 됨 - prodongi
if (!IsShow() || !GetRect().IsInRect(x, y))
return SUIWnd::OnMouseMessage( dwMessage, x, y );
if( dwMessage == KRBUTTON_DOWN )
{
/// 2012.01.10 우클릭 메뉴 활성화 체크 - prodongi
if (checkActivateRMenu(x, y))
return SUIWnd::OnMouseMessage( dwMessage, x, y );
bool bLeaderMe = false;
char const* localPlayerName = g_pCurrentGameSystem->getLocalPlayerName();
SPlayerSlot* pMySlot = m_PartyMgr.FindMember(localPlayerName); // 내 캐릭터의 슬롯 정보
if(pMySlot)
bLeaderMe = pMySlot->IsLeader(); // 내가 리더인가?
m_strSelectMember = ""; // 2011.12.19 - servantes : 선택이름
for( int i = 0; i < c_nMaxLine; i++ )
{
//if(m_aSlotChar[i].pLogOff->IsShow() && m_aSlotChar[i].pLogOff->IsInRect(x, y))
//{
// m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CHARACTER, false ) );
// m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CREATURE, false ) );
// return KMR_NORMAL;
//}
// if(m_aSlotChar[i].pSelect->IsShow() && m_aSlotChar[i].pSelect->IsInRect(x, y))
if(m_aSlotChar[i].pSelect->IsInRect(x, y))
{
SUIPartyDualWnd* pParent = dynamicCast<SUIPartyDualWnd*>(GetParent());
if(NULL == pParent)
return NULL;
m_parent->notifyHideAllSelect();
KRect rt = m_aSlotChar[i].pSelect->GetRect();
// 선택된것 표시
m_pMouseClick->SetShow(true);
m_pMouseClick->MovePos(rt.left, rt.top - 1);
m_pMouseClickCreature->SetShow(false);
// 리더이면
std::string strSelectName = "";
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty)
{
std::vector<SPlayerSlot*> vecMemberList = pParty->GetMemberList();
SPlayerSlot* pSlot = vecMemberList[i];
bool bLogin = pSlot->IsLogin(); // 로그인한 상태인가?
m_strSelectMember = pSlot->GetName(); // 2011.12.19 - servantes : 선택이름
/// 2011.11.16 선택한 넘이 리더인지가 아니고, 자신이 리더인지 체크 해야 된다 - prodongi
if(pSlot->IsLeader() == true)
{
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(
SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CHARACTER, "leader", pSlot->GetName(),
(unsigned int)bLogin, number_t(1), number_t(GetPartyType()), number_t(bLeaderMe)
// isMyParty, number_t(1), number_t(GetPartyType()), number_t(bLeaderMe)
)
);
}
else
{
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(
SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CHARACTER, "not_leader", pSlot->GetName(),
(unsigned int)bLogin, number_t(0), number_t(GetPartyType()), number_t(bLeaderMe)
// isMyParty, number_t(0), number_t(GetPartyType()), number_t(bLeaderMe)
)
);
}
}
std::string strPartName;
if(pParent)
{
strPartName = *pParent->GetPartyName();
// m_pGameManager->ProcMsgAtStatic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "set_party_name", strPartName.c_str() ) );
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CHARACTER, "select_party", strPartName.c_str(),
number_t(GetPartyType()), number_t(i) ) ); // 어떤 파티창에서 클릭했는지 알기 위해 파티창 이름을 보낸다
}
/// 2011.11.17 상태를 반대로 보내 준다 - prodongi
number_t showBuff(m_parent->isShowPlayerBuff(i) ? 0 : 1);
number_t showCreature(m_parent->isShowCreature(i) ? 0 : 1);
number_t showSmallUi(m_parent->GetUISizeState() ? PARTY_UI_ID_SMALL : PARTY_UI_ID_BIG);
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CHARACTER, "set_status", "", 0, showBuff, showCreature, showSmallUi ) );
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CREATURE, false) );
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CHARACTER, true) );
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CHARACTER, "position", "", 0, number_t(rt.right), number_t(rt.top), number_t(m_parent->GetUISizeState()) ) );
/// 2011.12.16 타겟창이 선택되야 되기 때문에 SelectMemberForce 대신 selectTarget함수를 사용, - prodongi
selectTarget(GetHandle(i), i);
/*
// SelectMember(i);
SelectMemberForce(i);
*/
return KMR_NORMAL;
}
int winx, winy;
bool show = false;
m_pMouseClick->SetShow(false);
if(m_vecCreatureList[i].hCreature1st && m_aSlotCreature[i].pSelectMain->IsInRect(x, y))
{
winx = m_aSlotCreature[i].pSelectMain->GetRect().left;
winy = m_aSlotCreature[i].pSelectMain->GetRect().top;
show = true;
}
if(m_vecCreatureList[i].hCreature2nd && m_aSlotCreature[i].pSelectSub->IsInRect(x, y))
{
winx = m_aSlotCreature[i].pSelectSub->GetRect().left;
winy = m_aSlotCreature[i].pSelectSub->GetRect().top;
show = true;
}
if (show)
{
m_pMouseClickCreature->SetShow(true);
m_pMouseClickCreature->MovePos(winx, winy);
m_pGameManager->ProcMsgAtStatic( &SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CREATURE, true) );
m_pGameManager->ProcMsgAtStatic( &SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CHARACTER, false) );
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CREATURE, "select_party",
m_parent->GetPartyName()->c_str(), unsigned int(i) ) ); // 어떤 파티창에서 클릭했는지 알기 위해 파티창 이름을 보낸다
KRect rt = m_aSlotCreature[i].pSelectSub->GetRect();
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CREATURE, "position", "", 0, number_t( rt.right ), number_t( rt.top ), number_t(m_parent->GetUISizeState()) ) );
if(m_parent)
{
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "set_party_name", m_parent->GetPartyName()->c_str() ) );
}
/// 2011.11.17 상태를 반대로 보내 준다 - prodongi
number_t showBuff(m_parent->isShowCreatureBuff(i) ? 0 : 1);
number_t showCreature(m_parent->isShowCreature(i) ? 0 : 1);
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CREATURE, "set_status", "", 0, showBuff, showCreature ) );
return KMR_NORMAL;
}
}
m_pGameManager->ProcMsgAtStatic( &SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CREATURE, false) );
m_pGameManager->ProcMsgAtStatic( &SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CHARACTER, false) );
m_pGameManager->ProcMsgAtStatic( &SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false) );
m_pMouseClickCreature->SetShow(false);
return KMR_NORMAL;
}
else if( dwMessage == KLBUTTON_DBLCLK )
{
if( m_pStaticTitleBar->GetRect().IsInRect( x, y ) )
{
if(m_parent)
{
if(m_nListSizeType == PARTY_UI_LIST_SIZE_EXTEND)
{
m_parent->SetListSizeType(PARTY_UI_LIST_SIZE_REDUCE);
}
else
{
m_parent->SetListSizeType(PARTY_UI_LIST_SIZE_EXTEND);
}
}
}
}
else if( dwMessage == KRBUTTON_UP )
{
return KMR_NORMAL;
}
else if( dwMessage == KLBUTTON_DOWN ) // 마우스 왼쪽 버튼 클릭 : 2011.11.03 : servantes
{
/// 2012.01.09 마우스를 빈 공백에 클릭 했을 때, 지형이 픽킹 되도록 하기 위해서 - prodongi
if (!IsInRectWithChild(x, y))
{
notifyMouseMesseageReturnZero();
return 0;
}
m_pGameManager->ProcMsgAtStatic( &SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CREATURE, false) );
m_pGameManager->ProcMsgAtStatic( &SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_POPUP_PARTY_MENU_CHARACTER, false) );
std::string strPartName;
SUIPartyDualWnd* pParent = (SUIPartyDualWnd*)GetParent();
if(pParent)
{
strPartName = *pParent->GetPartyName();
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "set_party_name", strPartName.c_str() ) );
}
m_pMouseClickCreature->SetShow(false);
for( int i = 0; i < c_nMaxLine; i++ )
{
if(m_aSlotChar[i].pSelect->IsShow() && m_aSlotChar[i].pSelect->IsInRect(x, y)) // && m_bLogIn[i] == true)
{
/// 2011.12.20 party manager에게 모든 파티들의 셀렉트를 hide하라고 알려준다 - prodongi
m_parent->notifyHideAllSelect();
KRect rt = m_aSlotChar[i].pSelect->GetRect();
m_pMouseClick->SetShow(true);
m_pMouseClick->MovePos(rt.left, rt.top - 1);
//m_pMouseClickCreature->SetShow(false);
if( m_aSlotChar[i].pName->IsShow() )
{
std::string strTemp = m_aSlotChar[i].pName->GetCaption();
if(m_nUISizeState == PARTY_UI_ID_SMALL)
XStringUtil::Replace( strTemp, "<font:font_01><size:7><hcenter><vcenter>", "" );
else
XStringUtil::Replace( strTemp, "<font:font_01><size:9><hcenter><vcenter>", "" );
m_strSelectMember = strTemp; // 선택한 캐릭터 이름 얻기
}
// 2011.11.17 - servantes :PumpUpMessage 의 KFOCUS_ACTIVATED 에서 처리 하던 것인데 메세지가 오지 않아 이곳에서 처리
AR_HANDLE hParty = GetHandle(i);
if( hParty )
{
/// 2011.12.16 타겟 선택을 공통으로 사용하기 위해서 함수로 뺌 - prodongi
selectTarget(hParty, i);
/*
SIMSG_UI_ACT_TARGET* pMsg = new SIMSG_UI_ACT_TARGET;
SGameAvatarEx* 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 KMR_NORMAL;
}
return KMR_NORMAL;
}
if(m_vecCreatureList[i].hCreature1st && m_aSlotCreature[i].pSelectMain->IsInRect(x, y))
{
m_parent->notifyHideAllSelect();
//m_pMouseClick->SetShow(false);
m_pMouseClickCreature->SetShow(true);
KRect rt = m_aSlotCreature[i].pSelectMain->GetRect();
m_pMouseClickCreature->MovePos(rt.left, rt.top);
// 2011.11.17 - servantes :PumpUpMessage 의 KFOCUS_ACTIVATED 에서 처리 하던 것인데 메세지가 오지 않아 이곳에서 처리
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 KMR_NORMAL;
}
return KMR_NORMAL;
}
if(m_vecCreatureList[i].hCreature2nd && m_aSlotCreature[i].pSelectSub->IsInRect(x, y))
{
m_parent->notifyHideAllSelect();
//m_pMouseClick->SetShow(false);
m_pMouseClickCreature->SetShow(true);
KRect rt = m_aSlotCreature[i].pSelectSub->GetRect();
m_pMouseClickCreature->MovePos(rt.left, rt.top);
// 2011.11.17 - servantes :PumpUpMessage 의 KFOCUS_ACTIVATED 에서 처리 하던 것인데 메세지가 오지 않아 이곳에서 처리
if( m_vecCreatureList[i].hCreature2nd )
{
SIMSG_UI_ACT_TARGET* pMsg = new SIMSG_UI_ACT_TARGET;
pMsg->m_nTargetHandle = m_vecCreatureList[i].hCreature2nd;
m_pGameManager->PostMsgAtDynamic( pMsg );
return KMR_NORMAL;
}
return KMR_NORMAL;
}
}
m_parent->notifyHideAllSelect();
}
return SUIWnd::OnMouseMessage( dwMessage, x, y );
}
void SUIPartyWndBase::setShowAllCreature(bool show)
{
/*
if (show)
{
for( int i(0); i<c_nMaxLine; ++i )
{
if( m_bLogIn[i] == true && m_vecCreatureList[i].hCreature1st )
{
m_vecCreatureList[i].bRender = true;
m_vecCreatureList[i].bRenderUI = true;
}
else
{
m_vecCreatureList[i].bRender = false;
m_vecCreatureList[i].bRenderUI = false;
}
}
}
else
{
for( int i(0); i<c_nMaxLine; ++i )
{
m_vecCreatureList[i].bRender = false;
m_vecCreatureList[i].bRenderUI = false;
}
}
*/
RefreshSlots();
}
void SUIPartyWndBase::ResetWnd()
{
for( int i(0); i<c_nMaxLine; ++i )
{
//m_vecCreatureList[i].bRender = false;
//m_vecCreatureList[i].bRenderUI = false;
m_vecCreatureList[i].hCreature1st = 0;
m_vecCreatureList[i].hCreature2nd = 0;
m_vecCreatureList[i].hMaster = 0;
m_bLogIn[i] = false;
m_aSlotChar[i].Show(false);
m_aSlotCreature[i].Show(false);
m_aSlotChar[i].pName->SetCaption("");
}
m_pStaticTitle->SetCaption("");
}
bool SUIPartyWndBase::isInSubOptionButton(int x, int y)
{
return m_pBtnSubOption->IsInRect(x, y);
}
void SUIPartyWndBase::setShowMinimizeMark(bool show)
{
if (show)
{
KRect rt = m_pStaticTitleBar->GetRect();
m_pStaticMinimizsMark->SetShow(true);
m_pStaticMinimizsMark->MovePos(rt.left + 3, rt.bottom);
}
else
{
m_pStaticMinimizsMark->SetShow(false);
}
}
// 2011.11.16 - servantes : 타이틀의 캡션 설정한다
// type_use : -1 : 들어온 타입 변수 사용하지 않는다
void SUIPartyWndBase::SetTitleCaption(int type_use)
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
// 파티 이름
std::string strCaption;
if(m_nUISizeState == PARTY_UI_ID_SMALL)
strCaption =c_strNameCaptionS;
else
strCaption = c_strNameCaptionL;
// 2011. 11. 15 - marine 공대파티이름 얻어오기.. 파티종류에 따라 다르게 사용되야 할 것...
std::string strName;
int nPartyType = m_nPartyType;
if(type_use != -1) // -1 이 아니면 : 들어온 타입 변수 사용한다
nPartyType = type_use;
if(nPartyType == PARTY_NORMAL || nPartyType == PARTY_BEARROAD)
strName = pParty->GetPartyName();
else if (PARTY_ARENA == nPartyType || m_PartyMgr.isArenaParty())
strName = getArenaPartyName(pParty->GetPartyName());
else
strName = m_RaidMgr.getAttackUnitPartyName(pParty->GetPartyName());
strCaption += strName;
//if(strName.compare("") != 0) // 일단은 못찾으면 공대파티가 아니다...
// strCaption += strName;
//else
// strCaption += pParty->GetPartyName();
m_pStaticTitle->SetCaption(strCaption.c_str());
m_pStaticTitle->SetShow(true);
}
// 선택된 슬롯 표시 숨김
void SUIPartyWndBase::DeselectSlot()
{
m_pMouseClick->SetShow(false);
m_pMouseClickCreature->SetShow(false);
}
int SUIPartyWndBase::getMemberNum()
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return 0;
return (int)pParty->GetMemberList().size();
}
void SUIPartyWndBase::UpdatePartyMemberInfo()
{
RefreshSlots();
}
/*
// 보조크리처 핸들 설정
void SUIPartyWndBase::SetSubCreatureHandle( AR_HANDLE hSubCardCreature, int index ) //, AR_HANDLE hSubCardCreature, int index )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
std::vector<SPlayerSlot*> vecMemberList = pParty->GetMemberList();
std::vector<SPlayerSlot*>::iterator itE = vecMemberList.end();
std::vector<SPlayerSlot*>::iterator itS = vecMemberList.begin();
if(index) // 나
{
SGameAvatarEx* pLocalPlayer;
if(g_pCurrentGameSystem)
{
pLocalPlayer = g_pCurrentGameSystem->GetLocalPlayer();
if(pLocalPlayer == NULL) // 내가 없다고 에러!!
assert(NULL);
}
int i=0;
for( int i(0); itS != itE; itS++, i++ )
{
SPlayerSlot* pSlot = (*itS);
if(strcmp(pLocalPlayer->GetName(), pSlot->GetName()) == 0)
{
// m_vecCreatureList[ i ].hCreature1st = m_CreatureSlotMgr.GetCreatureHandleByCardHandle(hMainCardCreature);
// m_vecCreatureList[ i ].hCreature1st = hMainCardCreature;
// m_vecCreatureList[ i ].hCreature2nd = m_CreatureSlotMgr.GetCreatureHandleByCardHandle(hSubCardCreature);
m_vecCreatureList[ i ].hCreature2nd = hSubCardCreature;
break;
}
}
}
else // 타인
{
int i=0;
for( int i(0); itS != itE; itS++, i++ )
{
SPlayerSlot* pSlot = (*itS);
if(i == index)
{
m_vecCreatureList[ i ].hCreature2nd = hSubCardCreature;
// m_vecCreatureList[ i ].hCreature1st = m_CreatureSlotMgr.GetCreatureHandleByCardHandle(hMainCardCreature);
// m_vecCreatureList[ i ].hCreature2nd = m_CreatureSlotMgr.GetCreatureHandleByCardHandle(hSubCardCreature);
break;
}
}
}
}
*/
// 주크리처 핸들 설정
void SUIPartyWndBase::SetCreatureHandle( AR_HANDLE hMainCardCreature, int index ) //, AR_HANDLE hSubCardCreature, int index )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
std::vector<SPlayerSlot*> vecMemberList = pParty->GetMemberList();
std::vector<SPlayerSlot*>::iterator itE = vecMemberList.end();
std::vector<SPlayerSlot*>::iterator itS = vecMemberList.begin();
if(index) // 나
{
char const* localPlayerName = "";
if(g_pCurrentGameSystem)
{
localPlayerName = g_pCurrentGameSystem->getLocalPlayerName();
}
int i=0;
for( int i(0); itS != itE; itS++, i++ )
{
SPlayerSlot* pSlot = (*itS);
if(strcmp(localPlayerName, pSlot->GetName()) == 0)
{
m_vecCreatureList[ i ].hCreature1st = hMainCardCreature;
// m_vecCreatureList[ i ].hCreature2nd = 0;
//m_vecCreatureList[ i ].bRender = true;
//m_vecCreatureList[ i ].bRenderUI = true;
break;
}
}
}
else // 타인
{
int i=0;
for( int i(0); itS != itE; itS++, i++ )
{
SPlayerSlot* pSlot = (*itS);
if(i == index)
{
m_vecCreatureList[ i ].hCreature1st = hMainCardCreature;
//m_vecCreatureList[ i ].bRender = true;
//m_vecCreatureList[ i ].bRenderUI = true;
break;
}
}
}
}
void SUIPartyWndBase::selectTarget(AR_HANDLE handle, int index)
{
SIMSG_UI_ACT_TARGET* pMsg = new SIMSG_UI_ACT_TARGET;
SGameAvatarEx* pTargetAvatar = (SGameAvatarEx*)( GetObject(handle) );
if( pTargetAvatar )
{
pMsg->m_nTargetHandle = handle;
}
else
{
pMsg->m_nTargetHandle = NULL;
m_nSelectIndex = index;
SelectMember(index);
}
m_pDisplayInfo->SetPartyTarget( handle ); //멀리 있는 로그인된 파티원에게 아이템 사용 가능
m_pGameManager->PostMsgAtDynamic( pMsg );
if( !pTargetAvatar )
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_ACT_FAR_PARTY_TARGET(handle) );
}
void SUIPartyWndBase::hideSelect()
{
m_pMouseClick->SetShow(false);
m_pMouseClickCreature->SetShow(false);
}
void SUIPartyWndBase::EnterCreature( AR_HANDLE hMaster, AR_HANDLE hCreature )
{
SPartyMgr* pParty = GetPartyMgr( this );
if(pParty == NULL)
return ;
int slot_id = pParty->FindMemberIndex( hMaster );
if(0 > slot_id || SLOT_MAXLINE <= slot_id)
return ;
SPlayerSlot* pSlot = pParty->FindMemberHandle( hMaster );
if(pSlot == NULL)
return ;
if( pSlot->GetMainCreatureHandle() == hCreature )
{
m_vecCreatureList[ slot_id ].hCreature1st = hCreature;
m_aSlotCreature[ slot_id ].Show( true );
m_aSlotCreature[ slot_id ].pSelectMain->SetShow( true );
}
if( pSlot->GetSubCreatureHandle() == hCreature )
{
m_vecCreatureList[ slot_id ].hCreature2nd = hCreature;
m_aSlotCreature[ slot_id ].Show( true, 1 );
m_aSlotCreature[ slot_id ].pSelectSub->SetShow( true );
}
}
void SUIPartyWndBase::LeaveCreature( AR_HANDLE hMaster, AR_HANDLE hCreature )
{
SPartyMgr* pParty = GetPartyMgr( this );
if(pParty == NULL)
return ;
int slot_id = pParty->FindMemberIndex( hMaster );
if(0 > slot_id || SLOT_MAXLINE <= slot_id)
return ;
SPlayerSlot* pSlot = pParty->FindMemberHandle( hMaster );
if(pSlot == NULL)
return ;
if( pSlot->GetMainCreatureHandle() == hCreature )
{
m_vecCreatureList[ slot_id ].hCreature1st = 0;
m_aSlotCreature[ slot_id ].Show( false );
m_aSlotCreature[ slot_id ].pSelectMain->SetShow( false );
m_aSlotCreature[ slot_id ].pSelectSub->SetShow( false );
}
if( pSlot->GetSubCreatureHandle() == hCreature )
{
m_vecCreatureList[ slot_id ].hCreature2nd = 0;
m_aSlotCreature[ slot_id ].Show( false, 1 );
m_aSlotCreature[ slot_id ].pSelectSub->SetShow( false );
}
}
void SUIPartyWndBase::CreatureInfo(AR_HANDLE hMaster, AR_HANDLE hMain, AR_HANDLE hSub)
{
SPartyMgr* pParty = GetPartyMgr( this );
if(pParty == NULL)
return ;
int slot_id = pParty->FindMemberIndex( hMaster );
if(0 > slot_id || SLOT_MAXLINE <= slot_id)
return ;
// 주 크리처
m_vecCreatureList[ slot_id ].hCreature1st = hMain;
// 부 크리처
m_vecCreatureList[ slot_id ].hCreature2nd = hSub;
}
// 크리처 순서 2012.01.10 - servantes
void SUIPartyWndBase::CreatureOrder(bool bFirst, AR_HANDLE hMaster, AR_HANDLE hCreature)
{
AR_HANDLE _hMaster = GetMaster(hCreature);
if(_hMaster == NULL)
return ;
SPartyMgr* pParty = GetPartyMgr( this );
if(pParty == NULL)
return ;
int slot_id = pParty->FindMemberIndex( _hMaster );
if(0 > slot_id || SLOT_MAXLINE <= slot_id)
return ;
if(bFirst)
{
// 주 크리처
m_vecCreatureList[ slot_id ].hCreature1st = hCreature;
}
else
{
// 부 크리처
m_vecCreatureList[ slot_id ].hCreature2nd = hCreature;
}
if(IsShow() == false)
return ;
if(m_nListSizeType == PARTY_UI_LIST_SIZE_REDUCE)
return ;
RefreshEnableSlots();
}
void SUIPartyWndBase::LeaveCreature(bool bFirst, AR_HANDLE hMaster, AR_HANDLE hCreature)
{
AR_HANDLE _hMaster = GetMaster(hCreature);
if(_hMaster == NULL)
return ;
SPartyMgr* pParty = GetPartyMgr( this );
if(pParty == NULL)
return ;
int slot_id = pParty->FindMemberIndex( _hMaster );
if(0 > slot_id || SLOT_MAXLINE <= slot_id)
return ;
if(bFirst)
{
// 주 크리처
m_vecCreatureList[ slot_id ].hCreature1st = 0;
}
else
{
// 부 크리처
m_vecCreatureList[ slot_id ].hCreature2nd = 0;
}
RefreshEnableSlots();
}
std::string SUIPartyWndBase::findMemberName(std::string* partyName, int slotIndex)
{
std::string name;
SPartyMgr* pParty = m_PartyMgr.Find(partyName);
if(pParty)
{
SPlayerSlot* pSlot = pParty->FindMemberByID(slotIndex);
if(pSlot)
name = pSlot->GetName();
}
return name;
}
void SUIPartyWndBase::notifyMouseMesseageReturnZero()
{
if (!m_parent)
return ;
m_parent->notifyMouseMessageReturnZero();
}
bool SUIPartyWndBase::checkActivateRMenu(int x, int y)
{
if (!m_pStaticTitleBar)
return false;
if (!m_pStaticTitleBar->IsInRect(x, y))
return false;
SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE targetWnd = SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_RMENU;
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( targetWnd, "select_party", m_parent->GetPartyName()->c_str() ) );
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( targetWnd, true ) );
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_MOVE( targetWnd, x, y));
/// 상태들(반대로 보내준다)
std::string strStatus;
getInverseStatusString(strStatus);
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_RMENU, "set_status", strStatus.c_str()));
return true;
}
void SUIPartyWndBase::getInverseStatusString(std::string& str)
{
int showAllBuff(m_parent->isShowAllBuff() ? 0 : 1);
if (m_parent->GetListSizeType() == PARTY_UI_LIST_SIZE_REDUCE) showAllBuff = -1;
int showAllCreature = m_parent->isShowAllCreature() ? 0 : 1;
int showSmallUi = m_parent->GetUISizeState() == PARTY_UI_ID_BIG ? PARTY_UI_ID_SMALL : PARTY_UI_ID_BIG;
int foldingUi = m_parent->GetListSizeType() == PARTY_UI_LIST_SIZE_EXTEND ? PARTY_UI_LIST_SIZE_REDUCE : PARTY_UI_LIST_SIZE_EXTEND;
XStringUtil::Format(str, "%d|%d|%d|%d", showAllBuff, showAllCreature, showSmallUi, foldingUi);
}
bool SUIPartyWndBase::isCreature(int slotIndex) const
{
if (0 > slotIndex || SLOT_MAXLINE <= slotIndex)
return false;
/// 첫 번째 크리처가 없다면 갖고 있는 크리처는 없다.
return m_vecCreatureList[slotIndex].hCreature1st != 0;
}
void SUIPartyWndBase::setTitlebarArenaInfo(char const* aniName, char const* caption)
{
SetChildAniName("titlebar_bg_default_party_01", aniName);
/// 파티 이름은 서버에서 보내준 이름으로 하면 된다, caption 파라미터는 혹시라도 쓰일 수도 있을거 같아서 우선 남겨둔다
//SetChildCaption("title", caption);
}
std::string SUIPartyWndBase::getArenaPartyName(char const* partyName)
{
sArenaSystem* arenaSystem = g_pCurrentGameSystem->getArenaSystem();
int stringId;
int myTeam = arenaSystem->getMyTeam();
if (sArenaUtility::TEAM_ALLIANCE == myTeam) stringId = 2405;
else if (sArenaUtility::TEAM_WITCH == myTeam) stringId = 2406;
else return partyName;
/// getAttackUnitPartyName에서 갖고 옴
int partyNum = 0;
std::string strPartyName = partyName;
size_t nPos = strPartyName.find_first_of("_") + 1;
size_t nEndPos = strPartyName.size();
if(nPos == 0)
partyNum = 0;
else
{
std::string strSub = strPartyName.substr(nPos,nEndPos);
partyNum = atoi(strSub.c_str())+1;
}
return SR(stringId, "#@party_number@#", partyNum+1);
}
/*
// 사라지는 크리처 핸들 설정
void SUIPartyWndBase::SetHideCreatureHandle( AR_HANDLE hCreature, int index )
{
SPartyMgr* pParty = GetPartyMgr(this);
if(pParty == NULL)
return ;
std::vector<SPlayerSlot*> vecMemberList = pParty->GetMemberList();
std::vector<SPlayerSlot*>::iterator itE = vecMemberList.end();
std::vector<SPlayerSlot*>::iterator itS = vecMemberList.begin();
if(index) // 나
{
SGameAvatarEx* pLocalPlayer;
if(g_pCurrentGameSystem)
{
pLocalPlayer = g_pCurrentGameSystem->GetLocalPlayer();
if(pLocalPlayer == NULL) // 내가 없다고 에러!!
assert(NULL);
}
int i=0;
for( int i(0); itS != itE; itS++, i++ )
{
SPlayerSlot* pSlot = (*itS);
if(strcmp(pLocalPlayer->GetName(), pSlot->GetName()) == 0)
{
if(m_vecCreatureList[ i ].hCreature2nd == hCreature)
m_vecCreatureList[ i ].hCreature2nd = 0;
// m_vecCreatureList[ i ].hCreature2nd = 0;
break;
}
}
}
else // 타인
{
int i=0;
for( int i(0); itS != itE; itS++, i++ )
{
SPlayerSlot* pSlot = (*itS);
if(i == index)
{
if(m_vecCreatureList[ i ].hCreature2nd == hCreature)
m_vecCreatureList[ i ].hCreature2nd = 0;
// m_vecCreatureList[ i ].hCreature2nd = 0;
break;
}
}
}
}
*/