757 lines
22 KiB
C++
757 lines
22 KiB
C++
|
|
#include "stdafx.h"
|
|
#include "SUIPartyWndMenuParty.h"
|
|
#include "KUiControlButton.h"
|
|
#include "KUIControlStatic.h"
|
|
#include "SGameManager.h"
|
|
//#include "SGameMessageUI.h"
|
|
#include "SGameInterface.h"
|
|
#include "SChatType.h"
|
|
#include "SGameOption.h"
|
|
#include "SUIPartyWndDual.h" // 2011.11.14 - servantes
|
|
#include "SUIPartyWndMgr.h"
|
|
#include "SMessengerMgr.h"
|
|
#include "SPlayerInfoMgr.h"
|
|
#include "SStringDB.h"
|
|
#include <toolkit/XStringUtil.h>
|
|
#include "SUIPartyTypes.h"
|
|
#include "SUIPartyWndDual.h"
|
|
#include "SUIPartyWndMgr.h"
|
|
#include "SUIAuthorityChecker.h"
|
|
#include "SUIDefine.h"
|
|
|
|
extern void MsgSplit( const char* szMsg, std::vector<std::string>& vecText, const wchar_t* lpDelimiter, bool bProcSpecialCharacter=false );
|
|
|
|
namespace
|
|
{
|
|
const int c_nPartyWndWidthSize = 138;
|
|
};
|
|
|
|
bool SUIPartyWndMenuParty::InitControls( KPoint kPos )
|
|
{
|
|
InitMenuList();
|
|
|
|
m_check0 = dynamicCast<KUIControlCheck*>(GetChild( "check00" ));
|
|
m_check1 = dynamicCast<KUIControlCheck*>(GetChild( "check01" ));
|
|
m_check2 = dynamicCast<KUIControlCheck*>(GetChild( "check02" ));
|
|
|
|
m_distributionStatic0 = dynamicCast<KUIControlStatic*>(GetChild("static00"));
|
|
m_distributionStatic0->SetEnableOption(true);
|
|
m_distributionStatic0->SetEnableColor("<#ffffff>");
|
|
m_distributionStatic1 = dynamicCast<KUIControlStatic*>(GetChild("static01"));
|
|
m_distributionStatic1->SetEnableOption(true);
|
|
m_distributionStatic1->SetEnableColor("<#ffffff>");
|
|
m_distributionStatic2 = dynamicCast<KUIControlStatic*>(GetChild("static02"));
|
|
m_distributionStatic2->SetEnableOption(true);
|
|
m_distributionStatic2->SetEnableColor("<#ffffff>");
|
|
|
|
m_button0 = dynamicCast<KUIControl*>(GetChild("button00"));
|
|
m_button1 = dynamicCast<KUIControl*>(GetChild("button01"));
|
|
m_button2 = dynamicCast<KUIControl*>(GetChild("button02"));
|
|
m_button3 = dynamicCast<KUIControl*>(GetChild("button03"));
|
|
m_button4 = dynamicCast<KUIControl*>(GetChild("button04"));
|
|
|
|
return SUIWnd::InitControls(kPos);
|
|
}
|
|
bool SUIPartyWndMenuParty::InitData( bool bReload )
|
|
{
|
|
m_nWorkMode = REQ_NONE;
|
|
|
|
m_button0->SetEnableColor( "<#ffffff>" );//파티 초대
|
|
m_button1->SetEnableColor( "<#ffffff>" );//파티 추방
|
|
m_button2->SetEnableColor( "<#ffffff>" );//권한 인계
|
|
m_button3->SetEnableColor( "<#ffffff>" );//파티 해산
|
|
m_button4->SetEnableColor( "<#ffffff>" );//파티 탈퇴
|
|
SetControlEnableColor( "buff_all_on_button", "<#ffffff>" ); // 전체 버프 보이기
|
|
SetControlEnableColor( "creature_all_on_button", "<#ffffff>" ); // 전체 크리처 보이기
|
|
SetControlEnableColor( "ui_small_view_button", "<#ffffff>" ); // ui 작게 보기
|
|
SetControlEnableColor("ui_fold_button", "<#ffffff>");
|
|
SetChildShow("ui_unfold_button", false);
|
|
SetChildShow( "buff_off_button", false ); // 전체 버프 보이기 // 2011.11.12 - servantes
|
|
SetChildShow( "creature_off_button", false ); // 전체 크리처 보이기 // 2011.11.12 - servantes
|
|
SetChildShow( "ui_default_view_button", false ); // UI 크게 보이기 // 2011.11.12 - servantes
|
|
|
|
/// 2011.11.14 예전 부터 있던 버그 때문에 creature show/hide는 추후에 구현하기로 함 - prodongi
|
|
SetControlEnable("creature_all_on_button", true);
|
|
|
|
m_bCheck00 = false;
|
|
m_bCheck01 = false;
|
|
m_bCheck02 = false;
|
|
|
|
// 2011.11.09 - prodongi
|
|
m_pGameManager->GetGameInterface()->addPopupList(TOGGLE_WINDOW::UIWINDOW_PARTY_MENU);
|
|
|
|
return SUIWnd::InitData(bReload);
|
|
}
|
|
void SUIPartyWndMenuParty::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
SUIWnd::OnNotifyUIWindowOpen(bOpen);
|
|
|
|
if( bOpen )
|
|
{
|
|
RefreshMenu();
|
|
/// 2011.11.10 dual에서 관리하도록 했습니다. - prodongi
|
|
/*
|
|
KUIControlCheck * pCheck03 = dynamicCast<KUIControlCheck*>(GetChild( "check03" ));
|
|
if( pCheck03 )
|
|
{
|
|
if( pCheck03->GetCheck() )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "state_on") );
|
|
else m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "state_off") );
|
|
}
|
|
*/
|
|
}
|
|
}
|
|
void SUIPartyWndMenuParty::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
switch(pMsg->nType)
|
|
{
|
|
case IMSG_UI_SEND_DATA: // 2011.09.08 - servantes : 메세지 추가
|
|
{
|
|
SIMSG_UI_SEND_DATA *pSendMsg = dynamicCast<SIMSG_UI_SEND_DATA*>(pMsg);
|
|
|
|
if( pSendMsg->m_strString == "beside_partywnd" ) // 2011.09.08 - servantes : 파티메뉴창을 위치를 바꾼다
|
|
{
|
|
SIMSG_UI_RECT sMsg(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY); // 파티창의 영역얻기
|
|
m_pGameManager->ProcMsgAtStatic( &sMsg );
|
|
|
|
KRect rtParent = sMsg.rt;
|
|
MovePos( rtParent.right, rtParent.top + 17 );
|
|
}
|
|
else if( pSendMsg->m_strString == "position" ) // ui position
|
|
{
|
|
MovePos( (int)pSendMsg->m_nNumber.getAmount(), (int)pSendMsg->m_nNumber2.getAmount() );
|
|
}
|
|
else if( pSendMsg->m_strString == "select_party" )
|
|
{
|
|
m_strSelectPartyName = pSendMsg->m_strText; // 선택한 파티 이름
|
|
|
|
if(m_strSelectPartyName.size())
|
|
{
|
|
SUIPartyWndMgr* pPartyWndMgr = (SUIPartyWndMgr*)this->m_pGameManager->GetSUI(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY);
|
|
if(pPartyWndMgr)
|
|
{
|
|
int id;
|
|
SUIPartyDualWnd* pWnd = pPartyWndMgr->FindWnd( m_strSelectPartyName.c_str(), id );
|
|
if(pWnd)
|
|
SetLinkPartyUIPtr( pWnd ); // 파티창 UI 포인터
|
|
}
|
|
}
|
|
}
|
|
else if (pSendMsg->m_strString == "popup_update")
|
|
{
|
|
updatePopup(pSendMsg->m_nNumber.getAmount(), pSendMsg->m_nNumber2.getAmount());
|
|
}
|
|
else if (pSendMsg->m_strString == "set_status")
|
|
{
|
|
std::vector<std::string> textList;
|
|
MsgSplit(pSendMsg->m_strText.c_str(), textList, L"|");
|
|
setViewStatus(sViewStatus::BUFF, atoi(textList[0].c_str()));
|
|
setViewStatus(sViewStatus::CREATURE, atoi(textList[1].c_str()));
|
|
setViewStatus(sViewStatus::SMALL_UI, atoi(textList[2].c_str()));
|
|
setViewStatus(sViewStatus::FOLDING, atoi(textList[3].c_str()));
|
|
textList.clear();
|
|
}
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case MSG_SEND_DATA:
|
|
{
|
|
SMSG_SEND_DATA *pSendMsg = dynamicCast<SMSG_SEND_DATA *>(pMsg);
|
|
if( pSendMsg->strMessage == "req_invite" )
|
|
m_nWorkMode = REQ_INVITE;
|
|
}
|
|
break;
|
|
|
|
case IMSG_UI_INPUTTEXT :
|
|
{
|
|
SIMSG_UI_INPUTTEXT *pTextInput = dynamicCast<SIMSG_UI_INPUTTEXT *>(pMsg);
|
|
if( pTextInput->m_strText.length() <= 0 ) return;
|
|
|
|
if( m_nWorkMode == REQ_INVITE )
|
|
{
|
|
m_nWorkMode = REQ_NONE ;
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_INVITE;
|
|
pMsg->strName = pTextInput->m_strText.c_str();
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else if( m_nWorkMode == REQ_KICK )
|
|
{
|
|
m_nWorkMode = REQ_NONE ;
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_KICK;
|
|
pMsg->strName = pTextInput->m_strText.c_str();
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else if( m_nWorkMode == REQ_TRANSFER )
|
|
{
|
|
m_nWorkMode = REQ_NONE ;
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_TRANSFER;
|
|
pMsg->strName = pTextInput->m_strText.c_str();
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
}
|
|
break;
|
|
|
|
case MSG_CHATTING:
|
|
{
|
|
SMSG_CHATTING* pChatMsg = ( SMSG_CHATTING* )pMsg;
|
|
|
|
if( pChatMsg->nChatType == CHAT_PARTY_SYSTEM )
|
|
RefreshMenu();
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
case IMSG_UI_MOVE:
|
|
{
|
|
SIMSG_UI_MOVE* pMoveMsg = ( SIMSG_UI_MOVE* )pMsg;
|
|
|
|
int nResolution_Width = GetGameOption().GetResolution_Width();
|
|
|
|
int nTempX( pMoveMsg->m_nX );
|
|
int nWidth( GetRect().GetWidth() );
|
|
if( nTempX + nWidth > nResolution_Width )
|
|
nTempX = nTempX - (nWidth+c_nPartyWndWidthSize);
|
|
|
|
MovePos( nTempX, pMoveMsg->m_nY + 17 );
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
bool SUIPartyWndMenuParty::IsPartyMember( const AR_HANDLE handle )
|
|
{
|
|
const SPlayerSlot * pMember = m_PartyMgr.FindMember( handle );
|
|
if( !pMember ) return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
void SUIPartyWndMenuParty::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch(nMessage)
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK:
|
|
{
|
|
if( !m_PartyMgr.IsExist() ) return;
|
|
|
|
if( ::_stricmp( lpszControlID, "button00" ) == 0 )
|
|
{ //파티 초대
|
|
//타겟이 있으므로 파티 초대 메세지 보낸다.
|
|
if( m_PlayerInfoMgr.GetTarget() && m_PlayerInfoMgr.GetGameObjType() == TS_ENTER::GAME_PLAYER )
|
|
{
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->strName = m_PlayerInfoMgr.GetName();
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_INVITE;
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else
|
|
{
|
|
//이름 입력 창 띄우기
|
|
m_nWorkMode = REQ_INVITE;
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_REQ_INPUTTEXT( SIMSG_UI_REQ_INPUTTEXT::USAGE_PARTY, SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, S(6786), 6583, 1901) ); // [sonador][7.0.6] Mantis 0002624
|
|
}
|
|
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button01" ) == 0 )
|
|
{ //파티 추방
|
|
if( m_PlayerInfoMgr.GetTarget() )
|
|
{
|
|
if( !IsPartyMember( m_PlayerInfoMgr.GetTarget() ) ) return;
|
|
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_KICK;
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else
|
|
{
|
|
//이름 입력 창 띄우기
|
|
m_nWorkMode = REQ_KICK;
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_REQ_INPUTTEXT( SIMSG_UI_REQ_INPUTTEXT::USAGE_PARTY, SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, S(6787), 6584, 9560 ) ); // [sonador][7.0.6] Mantis 0002624
|
|
}
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button02" ) == 0 )
|
|
{ //권한 인계
|
|
if( m_PlayerInfoMgr.GetTarget() )
|
|
{
|
|
if( !IsPartyMember( m_PlayerInfoMgr.GetTarget() ) ) return;
|
|
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_TRANSFER;
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else
|
|
{
|
|
//이름 입력 창 띄우기
|
|
m_nWorkMode = REQ_TRANSFER;
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_REQ_INPUTTEXT( SIMSG_UI_REQ_INPUTTEXT::USAGE_PARTY, SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, S(6788), 6779, 1902 ) ); // [sonador][7.0.6] Mantis 0002624
|
|
}
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button03" ) == 0 )
|
|
{ //파티 해산
|
|
{
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_DESTROY;
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button04" ) == 0 )
|
|
{ //파티 탈퇴
|
|
{
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_LEAVE;
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
}
|
|
/// 전체 버프 보이기/숨기기
|
|
else if (::_stricmp(lpszControlID, "buff_all_on_button") == 0)
|
|
{
|
|
clickToggleViewStatus(sViewStatus::BUFF);
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false ) );
|
|
}
|
|
/// 전체 크리처 보이기/숨기기
|
|
else if (::_stricmp(lpszControlID, "creature_all_on_button") == 0)
|
|
{
|
|
clickToggleViewStatus(sViewStatus::CREATURE);
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false ) );
|
|
}
|
|
/// UI 작게/크게 보기
|
|
else if (::_stricmp(lpszControlID, "ui_small_view_button") == 0)
|
|
{
|
|
clickToggleViewStatus(sViewStatus::SMALL_UI);
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false ) );
|
|
}
|
|
else if (::_stricmp(lpszControlID, "ui_fold_button") == 0)
|
|
{
|
|
clickToggleViewStatus(sViewStatus::FOLDING);
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false ) );
|
|
}
|
|
else if (::_stricmp(lpszControlID, "dddddddd") == 0)
|
|
{
|
|
clickToggleViewStatus(sViewStatus::FOLDING);
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false ) );
|
|
}
|
|
}
|
|
break;
|
|
case KUI_MESSAGE::KCHECK_CHANGE:
|
|
{
|
|
if( m_PartyMgr.IsLeader() )
|
|
{
|
|
if( ::_stricmp( lpszControlID, "check00" ) == 0 )
|
|
{
|
|
if( m_check0->GetCheck() )
|
|
{
|
|
m_check1->SetCheck( false );
|
|
m_check2->SetCheck( false );
|
|
|
|
m_bCheck00 = true;
|
|
m_bCheck01 = false;
|
|
m_bCheck02 = false;
|
|
|
|
/// 2011.05.13 - prodongi
|
|
//아이템 분배 각자
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_OPTION;
|
|
|
|
pMsg->strName = "monopoly";
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else
|
|
{
|
|
if (m_bCheck00)
|
|
m_check0->SetCheck( true );
|
|
}
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "check01" ) == 0 )
|
|
{
|
|
if( m_check1->GetCheck() )
|
|
{
|
|
m_check0->SetCheck( false );
|
|
m_check2->SetCheck( false );
|
|
|
|
m_bCheck00 = false;
|
|
m_bCheck01 = true;
|
|
m_bCheck02 = false;
|
|
|
|
/// 2011.05.13 - prodongi
|
|
//아이템 분배 랜덤
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_OPTION;
|
|
|
|
pMsg->strName = "random";
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else
|
|
{
|
|
if (m_bCheck01)
|
|
m_check1->SetCheck( true );
|
|
}
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "check02" ) == 0 )
|
|
{
|
|
if( m_check2->GetCheck() )
|
|
{
|
|
m_check0->SetCheck( false );
|
|
m_check1->SetCheck( false );
|
|
|
|
m_bCheck00 = false;
|
|
m_bCheck01 = false;
|
|
m_bCheck02 = true;
|
|
|
|
/// 2011.05.13 - prodongi
|
|
//아이템 분배 순차
|
|
SMSG_PARTY_COMMAND* pMsg = new SMSG_PARTY_COMMAND;
|
|
pMsg->mode = SMSG_PARTY_COMMAND::PARTY_OPTION;
|
|
|
|
pMsg->strName = "linear";
|
|
m_pGameManager->PostMsgAtDynamic( pMsg );
|
|
}
|
|
else
|
|
{
|
|
if (m_bCheck02)
|
|
m_check2->SetCheck( true );
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if( ::_stricmp( lpszControlID, "check00" ) == 0 ||
|
|
::_stricmp( lpszControlID, "check01" ) == 0 ||
|
|
::_stricmp( lpszControlID, "check02" ) == 0 )
|
|
{
|
|
//자유
|
|
if( m_PartyMgr.GetDivision() == 0 )
|
|
m_check0->SetCheck(true);
|
|
//랜덤
|
|
else if( m_PartyMgr.GetDivision() == 1 )
|
|
m_check1->SetCheck(true);
|
|
//순차
|
|
else if( m_PartyMgr.GetDivision() == 2 )
|
|
m_check2->SetCheck(true);
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
// menu
|
|
void SUIPartyWndMenuParty::ShowSelectMenu( int nIndex )
|
|
{
|
|
|
|
}
|
|
bool SUIPartyWndMenuParty::SelectPartyMenu( int nIndex )
|
|
{
|
|
|
|
|
|
return true;
|
|
}
|
|
bool SUIPartyWndMenuParty::SelectGuildMenu( int nIndex )
|
|
{
|
|
|
|
|
|
return true;
|
|
}
|
|
// init
|
|
void SUIPartyWndMenuParty::InitMenuList()
|
|
{
|
|
|
|
}
|
|
|
|
void SUIPartyWndMenuParty::SetControlEnableColor( const char * pControlName, const char * pColor )
|
|
{
|
|
KUIControl * pControl = dynamicCast<KUIControl *>(GetChild(pControlName));
|
|
if( pControl )
|
|
pControl->SetEnableColor( pColor );
|
|
}
|
|
|
|
void SUIPartyWndMenuParty::SetControlEnable( const char * pControlName, bool bEnable )
|
|
{
|
|
KUIControl * pControl = dynamicCast<KUIControl *>(GetChild(pControlName));
|
|
if( pControl )
|
|
{
|
|
if( bEnable )
|
|
pControl->Enable();
|
|
else
|
|
pControl->Disable();
|
|
}
|
|
}
|
|
|
|
void SUIPartyWndMenuParty::enableDistributionCheck(bool enable, KUIControlCheck* checkControl, KUIControlStatic* staticControl)
|
|
{
|
|
if (enable)
|
|
{
|
|
checkControl->Enable();
|
|
staticControl->Enable();
|
|
}
|
|
else
|
|
{
|
|
checkControl->Disable();
|
|
staticControl->Disable();
|
|
}
|
|
}
|
|
|
|
// list
|
|
void SUIPartyWndMenuParty::RefreshMenu()
|
|
{
|
|
if( !IsShow() ) return;
|
|
|
|
m_check0->SetCheck( false );
|
|
m_check1->SetCheck( false );
|
|
m_check2->SetCheck( false );
|
|
|
|
m_bCheck00 = false;
|
|
m_bCheck01 = false;
|
|
m_bCheck02 = false;
|
|
|
|
sAuthorityList checker;
|
|
checkAuthority(checker, &m_PartyMgr, &m_RaidMgr, &m_FriendMgr, &m_CutMgr, &m_PlayerInfoMgr, true);
|
|
|
|
(checker.m_invite) ? m_button0->Enable() : m_button0->Disable();
|
|
(checker.m_leave) ? m_button4->Enable() : m_button4->Disable();
|
|
(checker.m_kick) ? m_button1->Enable() : m_button1->Disable();
|
|
(checker.m_takeOver) ? m_button2->Enable() : m_button2->Disable();
|
|
(checker.m_dismiss) ? m_button3->Enable() : m_button3->Disable();
|
|
enableDistributionCheck(checker.m_itemPrivateDistribution, m_check0, m_distributionStatic0);
|
|
enableDistributionCheck(checker.m_itemRandomDistribution, m_check1, m_distributionStatic1);
|
|
enableDistributionCheck(checker.m_itemOrderDistribution, m_check2, m_distributionStatic2);
|
|
|
|
struct sSetCheck
|
|
{
|
|
void set(bool& check, KUIControlCheck* control)
|
|
{
|
|
if( control )
|
|
{
|
|
if (control->IsDisable()) control->Enable();
|
|
control->SetCheck( true );
|
|
}
|
|
check = true;
|
|
}
|
|
};
|
|
sSetCheck setCheck;
|
|
|
|
//자유
|
|
if( m_PartyMgr.GetDivision() == 0 )
|
|
{
|
|
setCheck.set(m_bCheck00, m_check0);
|
|
}
|
|
//랜덤
|
|
else if( m_PartyMgr.GetDivision() == 1 )
|
|
{
|
|
setCheck.set(m_bCheck01, m_check1);
|
|
}
|
|
//순차
|
|
else if( m_PartyMgr.GetDivision() == 2 )
|
|
{
|
|
setCheck.set(m_bCheck02, m_check2);
|
|
}
|
|
}
|
|
void SUIPartyWndMenuParty::RefreshPartyMenu()
|
|
{
|
|
|
|
}
|
|
void SUIPartyWndMenuParty::RefreshGuildMenu()
|
|
{
|
|
|
|
}
|
|
|
|
void SUIPartyWndMenuParty::RefreshMenuSlot()
|
|
{
|
|
|
|
}
|
|
void SUIPartyWndMenuParty::DisableMenuSlot()
|
|
{
|
|
|
|
}
|
|
|
|
void SUIPartyWndMenuParty::updatePopup(int x, int y)
|
|
{
|
|
if (!IsShow())
|
|
return ;
|
|
|
|
if (!IsInRect(x, y))
|
|
{
|
|
/// 2011.11.15 예외 처리 - prodongi
|
|
SUIPartyWndMgr* partyMgr = dynamicCast<SUIPartyWndMgr*>(m_pGameManager->GetGameInterface()->GetUIWindow(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY));
|
|
if (partyMgr)
|
|
{
|
|
int id;
|
|
SUIPartyDualWnd* dualWnd = partyMgr->FindWnd(m_PartyMgr.GetPartyName(), id);
|
|
if (dualWnd && dualWnd->isInSubOptionButton(x, y))
|
|
return ;
|
|
}
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false) );
|
|
}
|
|
}
|
|
|
|
void SUIPartyWndMenuParty::setViewStatus(int type, int status)
|
|
{
|
|
char const* pictoAniName;
|
|
char const* pictoControlName;
|
|
char const* controlName;
|
|
int stringId;
|
|
if (sViewStatus::BUFF == type)
|
|
{
|
|
controlName = "buff_all_on_button";
|
|
pictoControlName = "mark_buff_able";
|
|
if (1 == status) /// 보이기
|
|
{
|
|
stringId = 6521;
|
|
pictoAniName = "common_mark_menu_buff_able";
|
|
}
|
|
else /// 숨기기
|
|
{
|
|
stringId = 12033;
|
|
pictoAniName = "common_mark_menu_buff_disable";
|
|
}
|
|
}
|
|
else if (sViewStatus::CREATURE == type)
|
|
{
|
|
controlName = "creature_all_on_button";
|
|
pictoControlName = "mark_creature_able";
|
|
if (1 == status) /// 보이기
|
|
{
|
|
stringId = 12034;
|
|
pictoAniName = "common_mark_menu_creature_able";
|
|
}
|
|
else /// 숨기기
|
|
{
|
|
stringId = 12035;
|
|
pictoAniName = "common_mark_menu_creature_disable";
|
|
}
|
|
}
|
|
else if (sViewStatus::SMALL_UI == type)
|
|
{
|
|
controlName = "ui_small_view_button";
|
|
pictoControlName = "mark_view_small";
|
|
if (PARTY_UI_ID_SMALL == status) /// 작게 보기
|
|
{
|
|
stringId = 9558;
|
|
pictoAniName = "common_mark_menu_view_small";
|
|
}
|
|
else /// 크게 보기
|
|
{
|
|
stringId = 9559;
|
|
pictoAniName = "common_mark_menu_view_default";
|
|
}
|
|
}
|
|
else if (sViewStatus::FOLDING == type)
|
|
{
|
|
controlName = "ui_fold_button";
|
|
pictoControlName = "mark_ui_fold";
|
|
if (PARTY_UI_LIST_SIZE_EXTEND == status)
|
|
{
|
|
stringId = 9841;
|
|
pictoAniName = "common_mark_menu_ui_fold";
|
|
}
|
|
else
|
|
{
|
|
stringId = 9840;
|
|
pictoAniName = "common_mark_menu_ui_unfold";
|
|
}
|
|
}
|
|
|
|
KUIControlButton* button = dynamicCast<KUIControlButton*>(GetChild(controlName));
|
|
if (!button)
|
|
return ;
|
|
if (-1 == status)
|
|
{
|
|
button->Disable();
|
|
return ;
|
|
}
|
|
else
|
|
{
|
|
if (sViewStatus::CREATURE != type) ///크리처는 추가 작업 때 활성화 된다.
|
|
button->Enable();
|
|
}
|
|
|
|
m_viewStatus.m_status[type] = (byte)status;
|
|
|
|
std::string str;
|
|
XStringUtil::Format(str, "<font:font_01><size:8><hcenter><left>%s", S(stringId));
|
|
button->SetCaption(str.c_str());
|
|
|
|
KUIControlStatic* staticPicto = dynamicCast<KUIControlStatic*>(GetChild(pictoControlName));
|
|
if (staticPicto)
|
|
staticPicto->SetBack(c_szDEF_SPR_NAME, pictoAniName);
|
|
}
|
|
|
|
void SUIPartyWndMenuParty::clickSetViewStatus(int type, byte status)
|
|
{
|
|
if (sViewStatus::BUFF == type)
|
|
{
|
|
/// 2011.11.16 party_state로 보내는 것은 party wnd에서 바꿨습니다. - prodongi
|
|
/// 보이기
|
|
if (1 == status)
|
|
{
|
|
//m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "state_on", m_strSelectPartyName.c_str()) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "state_all_on", m_strSelectPartyName.c_str()));
|
|
}
|
|
/// 숨기기
|
|
else
|
|
{
|
|
//m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "state_off", m_strSelectPartyName.c_str()) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "state_all_off", m_strSelectPartyName.c_str()));
|
|
}
|
|
}
|
|
else if (sViewStatus::CREATURE == type)
|
|
{
|
|
/// 보이기
|
|
if (1 == status)
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "show_all_creature", m_strSelectPartyName.c_str()));
|
|
}
|
|
/// 숨기기
|
|
else
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "hide_all_creature", m_strSelectPartyName.c_str()));
|
|
}
|
|
}
|
|
else if (sViewStatus::SMALL_UI == type)
|
|
{
|
|
/// 크게 보기
|
|
if (PARTY_UI_SIZE_BIG == status)
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "show_big_ui", m_strSelectPartyName.c_str()));
|
|
}
|
|
/// 작게 보기
|
|
else
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "show_small_ui", m_strSelectPartyName.c_str()));
|
|
}
|
|
}
|
|
else if (sViewStatus::FOLDING == type)
|
|
{
|
|
if (PARTY_UI_LIST_SIZE_EXTEND == status)
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "extend_ui", m_strSelectPartyName.c_str()));
|
|
}
|
|
else
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "reduce_ui", m_strSelectPartyName.c_str()));
|
|
}
|
|
}
|
|
|
|
m_strSelectPartyName = "";
|
|
}
|
|
|
|
void SUIPartyWndMenuParty::clickToggleViewStatus(int type)
|
|
{
|
|
clickSetViewStatus(type, m_viewStatus.m_status[type]);
|
|
|
|
m_viewStatus.m_status[type] = (m_viewStatus.m_status[type] == 0) ? 1 : 0;
|
|
setViewStatus(type, m_viewStatus.m_status[type]);
|
|
}
|