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

866 lines
25 KiB
C++

#include "stdafx.h"
#include "KUIControlStatic.h"
#include "KUIControlGauge.h"
#include "KUIControlEdit.h"
#include "KUIControlButton.h"
#include "SGameManager.h"
#include "SGameMessage.h"
//#include "SGameMessageUI.h"
#include "SUIPartyTypes.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 "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 "SUIPartyWndMgr.h"
namespace
{
const int c_nTitleSize = 17;
const int c_update_time = 1000;
};
//==============================================================================================================================================
// SUIPartyDualWnd
//==============================================================================================================================================
SUIPartyDualWnd::SUIPartyDualWnd( SGameManager* pGameManager, SUIDisplayInfo* pDisplayInfo )
: SUIWnd( pGameManager ), m_pDisplayInfo( pDisplayInfo )
{
m_pWndBig = NULL;
m_pWndSml = NULL;
m_nUISizeState = PARTY_UI_SIZE_SMALL;
m_bSetPartyMgr = true;
m_dwTime = 0;
m_bInitialize = false;
m_dwOldTime = 0;
}
SUIWnd* SUIPartyDualWnd::CreateWnd( const char* szFile, KUIWndManager* pWndManager, KPoint kPos, int nWindowID )
{
SUIWnd::CreateWnd( szFile, pWndManager, kPos, nWindowID );
m_pWndSml = new SUIPartyWndBase( m_pGameManager,m_pDisplayInfo );
if(m_pWndSml)
{
m_pWndSml->CreateWnd( "window_player_party_main_small.nui", pWndManager, KPoint(kPos.x, kPos.y), 0 );
m_pWndSml->SetParent(this);
m_pWndSml->SetUISizeState(PARTY_UI_SIZE_SMALL);
m_pWndSml->InitSecond();
m_pWndSml->SetShow(false);
AddChild(m_pWndSml);
}
m_pWndBig = new SUIPartyWndBase( m_pGameManager,m_pDisplayInfo );
if(m_pWndBig)
{
m_pWndBig->CreateWnd( "window_player_party_main.nui", pWndManager, KPoint(kPos.x, kPos.y), 1 );
m_pWndBig->SetParent(this);
m_pWndBig->SetUISizeState(PARTY_UI_SIZE_BIG);
m_pWndBig->InitSecond();
m_pWndBig->SetShow(true);
AddChild(m_pWndBig);
}
/// 2011.12.21 다른 곳에서 호출을 해준다 - prodongi
//initStatus();
return this;
}
void SUIPartyDualWnd::RefreshGaugeAll()
{
m_pWndSml->RefreshGaugeAll();
m_pWndBig->RefreshGaugeAll();
}
void SUIPartyDualWnd::RefreshGaugeByIndex(const char* szName)
{
m_pWndSml->RefreshGaugeByIndex(szName);
m_pWndBig->RefreshGaugeByIndex(szName);
}
void SUIPartyDualWnd::RefreshSlots()
{
if(m_nUISizeState == PARTY_UI_ID_SMALL)
{
m_pWndSml->RefreshSlots();
}
else
{
m_pWndBig->RefreshSlots();
}
CalculateSize();
// POINT pt = GetBuffRenderPos();
// m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE,
// "refresh", m_sPartyName.c_str(), number_t( pt.x ), number_t( pt.y ) ) );
}
void SUIPartyDualWnd::DisableSlots()
{
if(m_nUISizeState == PARTY_UI_ID_SMALL)
m_pWndSml->DisableSlots();
else
m_pWndBig->DisableSlots();
}
void SUIPartyDualWnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
{
if(m_nUISizeState == PARTY_UI_ID_SMALL)
m_pWndSml->PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
else
m_pWndBig->PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
}
DWORD SUIPartyDualWnd::OnMouseMessage(DWORD dwMessage, int x, int y) // 2011.09.16 servantes : OnMouseMessage추가
{
DWORD dwRet = SUIWnd::OnMouseMessage( dwMessage, x, y );
if(KMR_NO_GET & dwRet)
return dwRet;
return KMR_NORMAL;
}
void SUIPartyDualWnd::Process(DWORD dwTime)
{
//
// ┌─┐ ┌┐ ┌┐ ┌┐
// │나│ └┘ └┘ └┘
// └─┘ └──┴──┴── PARTY_SIEGE_OTHER
// |
// PARTY_NORMAL, PARTY_DUNGEON_RAID, PARTY_SIEGE, PARTY_BEARROAD
//
if(IsShow() == false)
{
m_dwOldTime = dwTime;
return ;
}
if( m_nPartyType != PARTY_SIEGE_OTHER ) // 다른 공격대 파티가 아니면
{
m_dwOldTime = dwTime;
return ;
}
DWORD dwFrameTick = dwTime - m_dwOldTime;
m_dwTime += dwFrameTick;
if( m_dwTime >= c_update_time )
{
m_dwTime = 0;
if(m_nUISizeState == PARTY_UI_SIZE_SMALL) // 작은 상태
{
m_pWndSml->Process(dwTime);
m_pWndSml->UpdatePartyMemberInfo();
}
else if(m_nUISizeState == PARTY_UI_SIZE_BIG) // 큰 상태
{
m_pWndBig->Process(dwTime);
m_pWndBig->UpdatePartyMemberInfo();
}
}
m_dwOldTime = dwTime;
}
void SUIPartyDualWnd::ProcMsgAtStatic( SGameMessage* pMsg )
{
switch( pMsg->nType )
{
case MSG_ENTER:
case MSG_LEAVE:
{
m_pWndSml->ProcMsgAtStatic( pMsg );
m_pWndBig->ProcMsgAtStatic( pMsg );
//DeselectSlot(); // 선택 슬롯 해제
notifyHideAllSelect();
/// 2011.12.21 버프 상태를 갱신해준다 - prodongi
if(m_nListSizeType == PARTY_UI_LIST_SIZE_EXTEND)
{
POINT rt = GetBuffRenderPos();
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "refresh", m_sPartyName.c_str(), number_t(rt.x), number_t(rt.y) ) );
}
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) );
}
break;
case IMSG_UI_MOVE:
{
m_pWndSml->ProcMsgAtStatic( pMsg );
m_pWndBig->ProcMsgAtStatic( pMsg );
pMsg->bUse = true;
return ;
}
break;
case IMSG_UI_RECT:
{
if(m_pWndSml->GetPartyType() == PARTY_SIEGE_OTHER)
{
SIMSG_UI_RECT* pRMsg = (SIMSG_UI_RECT*)pMsg;
pRMsg->rt = GetRect();
}
pMsg->bUse = true;
}
break;
case IMSG_SET_PARTY_TYPE:
{
SMSG_SET_PARTY_TYPE *pData = (SMSG_SET_PARTY_TYPE*)pMsg;
SetPartyType( pData->nPartyType ); // 파티타입설정
break;
}
case IMSG_UI_SEND_DATA:
{
SIMSG_UI_SEND_DATA *pData = (SIMSG_UI_SEND_DATA *)pMsg;
if ( pData->m_strString == "partywnd_minimize" ) // to small
{
ChangeWndState( 1 );
DeselectSlot(); // 슬롯 디셀렉트
}
else if( pData->m_strString == "partywnd_maximize" ) // to big
{
ChangeWndState( 0 );
DeselectSlot(); // 슬롯 디셀렉트
}
else if( pData->m_strString == "refresh_title" )
{
SetTitleCaption((int)pData->m_dwData);
}
else if( pData->m_strString == "show_small_ui" )
{
ChangeWndState(0);
CalculateSize();
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "set_party_name", m_sPartyName.c_str() ) );
//m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "small_buff", m_sPartyName.c_str() ) ); // 2011.11.14 - servantes : 버프 크기 조절
// 2011.12.15 - servantes : 위치 보정
POINT p = GetBuffRenderPos();
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "position", m_sPartyName.c_str(), (unsigned int)m_nUISizeState, number_t(p.x), number_t(p.y)));
DeselectSlot(); // 슬롯 디셀렉트
}
else if( pData->m_strString == "show_big_ui" )
{
ChangeWndState(1);
CalculateSize();
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "set_party_name", m_sPartyName.c_str() ) );
//m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "big_buff", m_sPartyName.c_str() ) );
// 2011.12.15 - servantes : 위치 보정
POINT p = GetBuffRenderPos();
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "position", m_sPartyName.c_str(), (unsigned int)m_nUISizeState, number_t(p.x), number_t(p.y)));
DeselectSlot(); // 슬롯 디셀렉트
}
else if (pData->m_strString == "extend_ui")
{
SetListSizeType(PARTY_UI_LIST_SIZE_EXTEND);
DeselectSlot();
}
else if (pData->m_strString == "reduce_ui")
{
SetListSizeType(PARTY_UI_LIST_SIZE_REDUCE);
DeselectSlot();
}
else if( pData->m_strString == "select_member_request_trade" )
{
if(m_nUISizeState == PARTY_UI_SIZE_SMALL) // 0:small
m_pWndSml->SendUIMessage( &SIMSG_UI_SEND_DATA((SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE)0, "select_member_request_trade") );
else
m_pWndBig->SendUIMessage( &SIMSG_UI_SEND_DATA((SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE)0, "select_member_request_trade") );
}
else if (pData->m_strString == "show_all_creature")
{
setShowAllCreature(true);
}
else if (pData->m_strString == "hide_all_creature")
{
setShowAllCreature(false);
}
else if (pData->m_strString == "state_all_on")
{
setShowAllBuff(true);
}
else if (pData->m_strString == "state_all_off")
{
setShowAllBuff(false);
}
else if (pData->m_strString == "one_state_on")
{
setShowOneBuff(pData->m_strString.c_str(), true, pData->m_nNumber.getAmount(), pData->m_nNumber2.getAmount());
}
else if (pData->m_strString == "one_state_off")
{
setShowOneBuff(pData->m_strString.c_str(), false, pData->m_nNumber.getAmount(), pData->m_nNumber2.getAmount());
}
else if (pData->m_strString == "show_one_creature")
{
setShowOneCreature(pData->m_strString.c_str(), true, pData->m_nNumber.getAmount());
}
else if (pData->m_strString == "hide_one_creature")
{
setShowOneCreature(pData->m_strString.c_str(), false, pData->m_nNumber.getAmount());
}
else if (pData->m_strString == "change_size") // 2012.02.13 - servantes : 크리처 리콜시 크리처가 있던 슬롯 위치 바닥클릭 안돼는 현상 수정을 위함
{
KRect rt = GetRect();
rt.right = rt.left + pData->m_nNumber.getAmount();
rt.bottom = rt.top + pData->m_nNumber2.getAmount();
ClipRect( rt );
SetRect( rt );
}
break;
}
}
if(m_nUISizeState == PARTY_UI_ID_SMALL)
m_pWndSml->ProcMsgAtStatic( pMsg );
else
m_pWndBig->ProcMsgAtStatic( pMsg );
}
void SUIPartyDualWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
{
int k=0;
k=0;
SUIWnd::OnNotifyUIWindowOpen(bOpen);
SetUISizeState( m_nUISizeState );
if(bOpen && m_nListSizeType == PARTY_UI_LIST_SIZE_EXTEND)
{
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, GetRect().right, GetRect().top ) );
// POINT pt = GetBuffRenderPos();
// m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE,
// "show_buff", m_sPartyName.c_str(), number_t( pt.x ), number_t( pt.y ) ) );
}
else
{
//메뉴는 같이 숨긴다.
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_MENU, false ) );
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "hide_buff", m_sPartyName.c_str() ) ); // 작은 버프 출력용 UI
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 ) );
DeselectSlot();
}
}
//2011.09.28 : servantes : 작은 UI와 큰 UI간의 메세지 전달 함수
void SUIPartyDualWnd::DeleverMessage(int nSendID, int nReceiveID, const char* pStrMessage, int w, int l)
{
if (nSendID == PARTY_UI_ID_SMALL)
{
if (nReceiveID == PARTY_UI_ID_BIG) // 작은 ui가 큰 ui에 보냄
{
if(::_stricmp( pStrMessage, "move_pos" ) == 0)
{
CalculateSize();
}
}
}
else if(nSendID == PARTY_UI_ID_BIG)
{
if (nReceiveID == PARTY_UI_ID_SMALL) // 큰 ui가 작은 ui에 보냄
{
if(::_stricmp( pStrMessage, "move_pos" ) == 0)
{
CalculateSize();
}
}
}
}
void SUIPartyDualWnd::CalculateSize()
{
/// 2011.11.11 - prodongi
int width = 0;
int height = 0;
int x=0, y=0;
if(m_nUISizeState == PARTY_UI_SIZE_SMALL) // 작은 상태
{
x = m_pWndSml->GetRect().left;
y = m_pWndSml->GetRect().top;
width = m_pWndSml->GetRect().GetWidth();
height = m_pWndSml->GetRect().GetHeight();
}
else if(m_nUISizeState == PARTY_UI_SIZE_BIG) // 큰 상태
{
x = m_pWndBig->GetRect().left;
y = m_pWndBig->GetRect().top;
width = m_pWndBig->GetRect().GetWidth();
height = m_pWndBig->GetRect().GetHeight();
}
KRect rt;
rt.left = x;
rt.top = y;
rt.right = rt.left + width;
rt.bottom = rt.top + height;
Resize(rt);
}
void SUIPartyDualWnd::ChangeWndState(int nUISizeState) // 0:small / 1:big
{
if(nUISizeState == PARTY_UI_SIZE_SMALL) // 0:small
{
m_nUISizeState = PARTY_UI_SIZE_SMALL;
KRect rt = m_pWndBig->GetRect();
m_pWndSml->SetShow(true);
m_pWndSml->OnNotifyUIWindowOpen(true);
m_pWndBig->SetShow(false);
m_pWndBig->OnNotifyUIWindowOpen(false);
m_pWndSml->RefreshSlots(); // 슬롯 갱신
m_pWndSml->MovePos(rt.left, rt.top);
}
else if(nUISizeState == PARTY_UI_SIZE_BIG)
{
m_nUISizeState = PARTY_UI_SIZE_BIG;
KRect rt = m_pWndSml->GetRect();
m_pWndSml->SetShow(false);
m_pWndSml->OnNotifyUIWindowOpen(false);
m_pWndBig->SetShow(true);
m_pWndBig->OnNotifyUIWindowOpen(true);
m_pWndBig->RefreshSlots(); // 슬롯 갱신
m_pWndBig->MovePos(rt.left, rt.top);
}
}
void SUIPartyDualWnd::SetPartyType(int type)
{
m_nPartyType = type;
m_pWndBig->SetPartyType(type);
m_pWndSml->SetPartyType(type);
}
void SUIPartyDualWnd::SetUISizeState(int nState)
{
if(nState == PARTY_UI_SIZE_SMALL)
{
m_nUISizeState = PARTY_UI_SIZE_SMALL;
m_pWndBig->SetShow(false);
m_pWndSml->SetShow(true);
m_pWndBig->OnNotifyUIWindowOpen(false);
m_pWndSml->OnNotifyUIWindowOpen(true);
}
else
{
m_nUISizeState = PARTY_UI_SIZE_BIG;
m_pWndBig->SetShow(true);
m_pWndSml->SetShow(false);
m_pWndBig->OnNotifyUIWindowOpen(true);
m_pWndSml->OnNotifyUIWindowOpen(false);
}
}
void SUIPartyDualWnd::SetListSizeType(int type)
{
if(type == PARTY_UI_LIST_SIZE_EXTEND)
{
m_nListSizeType = PARTY_UI_LIST_SIZE_EXTEND;
m_pWndBig->SetListSizeType(PARTY_UI_LIST_SIZE_EXTEND);
m_pWndSml->SetListSizeType(PARTY_UI_LIST_SIZE_EXTEND);
//POINT rt = GetBuffRenderPos();
//m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "show_buff", m_sPartyName.c_str(), number_t(rt.x), number_t(rt.y) ) );
POINT rt = GetBuffRenderPos();
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "show_buff", m_sPartyName.c_str(), number_t(rt.x), number_t(rt.y) ) );
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "buff_size_force", m_sPartyName.c_str(), unsigned int(m_nUISizeState) ) );
}
else
{
m_nListSizeType = PARTY_UI_LIST_SIZE_REDUCE;
m_pWndBig->SetListSizeType(PARTY_UI_LIST_SIZE_REDUCE);
m_pWndSml->SetListSizeType(PARTY_UI_LIST_SIZE_REDUCE);
//m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "hide_buff", m_sPartyName.c_str() ) );
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "hide_wnd", m_sPartyName.c_str()) );
}
/// 2011.12.20 big과 small의 사이즈가 바꼈는데, dual은 안 바뀌는 경우가 생기기 때문에 여기서 항상 설정을 해준다 - prodongi
if(m_nUISizeState == PARTY_UI_ID_SMALL)
SetRect(m_pWndSml->GetRect());
else
SetRect(m_pWndBig->GetRect());
}
void SUIPartyDualWnd::SetSiegeUIType(int type) // 2011.09.19 : servantes : 공격대 UI 타입
{
}
void SUIPartyDualWnd::RequestPartyJoinAccept()
{
if(m_nUISizeState == PARTY_UI_ID_SMALL)
m_pWndSml->RequestPartyJoinAccept();
else
m_pWndBig->RequestPartyJoinAccept();
}
void SUIPartyDualWnd::SetPartyName(const char* pName)
{
m_sPartyName = pName;
}
void SUIPartyDualWnd::initStatus()
{
//SetUISizeState(PARTY_UI_SIZE_SMALL);
//SetListSizeType(PARTY_UI_LIST_SIZE_EXTEND);
setShowAllCreature(true);
setShowAllBuff(false);
}
void SUIPartyDualWnd::notifyHideAllSelect()
{
SUIPartyWndMgr* parent = dynamicCast<SUIPartyWndMgr*>(GetParent());
if (parent)
{
parent->hideAllSelect();
}
}
void SUIPartyDualWnd::notifyMouseMessageReturnZero()
{
SUIPartyWndMgr* parent = dynamicCast<SUIPartyWndMgr*>(GetParent());
if (parent)
{
parent->notifyMouseMessageReturnZero();
}
}
void SUIPartyDualWnd::hideAllSelect()
{
m_pWndSml->hideSelect();
m_pWndBig->hideSelect();
}
void SUIPartyDualWnd::MoveWnd(int x, int y)
{
MovePos(x, y);
m_pWndSml->MovePos(x, y);
m_pWndBig->MovePos(x, y);
}
void SUIPartyDualWnd::setShowAllCreature(bool show)
{
m_showAllCreature = show;
for (int i = 0; i < SLOT_MAXLINE; ++i)
{
m_showCreature[i] = show;
}
if(m_nUISizeState == PARTY_UI_ID_SMALL)
m_pWndSml->setShowAllCreature(show);
else
m_pWndBig->setShowAllCreature(show);
notifyHideAllSelect();
}
void SUIPartyDualWnd::setShowAllBuff(bool show)
{
m_showAllBuff = show;
for (int i = 0; i < SLOT_MAXLINE; ++i)
{
m_showPlayerBuff[i] = show;
m_showCreatureBuff[i] = show;
}
/// 보이기
if (m_showAllBuff)
{
POINT pt = GetBuffRenderPos();
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "show_buff", m_sPartyName.c_str(), (unsigned int)m_nUISizeState, number_t(pt.x), number_t(pt.y) ) );
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "buff_size_force", m_sPartyName.c_str(), unsigned int(m_nUISizeState) ) );
}
/// 숨기기
else
{
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "hide_buff", m_sPartyName.c_str()) );
}
}
void SUIPartyDualWnd::setShowOneBuff(char const* data, bool show, int type, int slotIndex)
{
if(TS_ENTER::GAME_PLAYER == type)
m_showPlayerBuff[slotIndex] = show;
else if (TS_ENTER::GAME_SUMMON == type)
m_showCreatureBuff[slotIndex] = show;
/// 모든 슬롯이 똑같은 값일 때, m_showAllBuff를 조정해 준다
int memberNum;
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
memberNum = m_pWndSml->getMemberNum();
else
memberNum = m_pWndBig->getMemberNum();
int i;
bool beginValue = m_showPlayerBuff[0];
for (i = 0; i < memberNum; ++i)
{
if (m_showPlayerBuff[i] != beginValue) break;
if (m_showCreatureBuff[i] != beginValue) break;
}
if (i == memberNum)
{
m_showAllBuff = beginValue;
}
number_t _type(type);
number_t _index(slotIndex);
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, data, m_sPartyName.c_str(), _type, _index) );
///2011.12.21 버프의 위치를 맞춰 준다, 어느순간 위치가 안 맞는 경우가 있는 것 같아서 여기서 매번 넣어준다;; - prodongi
POINT p = GetBuffRenderPos();
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY_STATE, "position", m_sPartyName.c_str(), (unsigned int)m_nUISizeState, number_t(p.x), number_t(p.y)));
}
void SUIPartyDualWnd::setShowOneCreature(char const* data, bool show, int slotIndex)
{
m_showCreature[slotIndex] = show;
/// 모든 슬롯이 똑같은 값일 때, m_showAllBuff를 조정해 준다
int memberNum;
if(m_nUISizeState == PARTY_UI_SIZE_SMALL) memberNum = m_pWndSml->getMemberNum();
else memberNum = m_pWndBig->getMemberNum();
int i;
bool beginValue = m_showCreature[0];
for (i = 0; i < memberNum; ++i)
{
if (m_showCreature[i] != beginValue) break;
}
if (i == memberNum)
{
m_showAllCreature = beginValue;
}
if(m_nUISizeState == PARTY_UI_ID_SMALL)
m_pWndSml->RefreshSlots();
else
m_pWndBig->RefreshSlots();
notifyHideAllSelect();
}
POINT SUIPartyDualWnd::GetBuffRenderPos()
{
POINT pt;
if(m_nUISizeState == PARTY_UI_SIZE_SMALL)
{
pt.x = m_pWndSml->GetRect().right;
pt.y = m_pWndSml->GetRect().top + 34; // 30 : 닫기 버튼 높이 + 타이틀바 높이
}
else
{
pt.x = m_pWndBig->GetRect().right;
pt.y = m_pWndBig->GetRect().top + 39; // 38 : 닫기 버튼 높이 + 타이틀바 높이
}
return pt;
}
void SUIPartyDualWnd::ResetWnd()
{
m_sPartyName = "";
m_pWndSml->ResetWnd();
m_pWndBig->ResetWnd();
}
bool SUIPartyDualWnd::isInSubOptionButton(int x, int y)
{
if(m_nUISizeState == PARTY_UI_ID_SMALL)
return m_pWndSml->isInSubOptionButton(x, y);
else
return m_pWndBig->isInSubOptionButton(x, y);
return false;
}
// 2011.11.16 - servantes : 타이틀의 캡션 설정한다
void SUIPartyDualWnd::SetTitleCaption(int type_use)
{
m_pWndSml->SetTitleCaption(type_use);
m_pWndBig->SetTitleCaption(type_use);
}
// 선택된 슬롯 표시 숨김
void SUIPartyDualWnd::DeselectSlot()
{
m_pWndSml->DeselectSlot();
m_pWndBig->DeselectSlot();
}
void SUIPartyDualWnd::EnterCreature( AR_HANDLE hMaster, AR_HANDLE hCreature )
{
int slotIndex = m_PartyMgr.FindMemberIndex(hMaster);
m_showCreature[slotIndex] = true;
m_pWndSml->EnterCreature( hMaster, hCreature );
m_pWndBig->EnterCreature( hMaster, hCreature );
m_pWndSml->RefreshEnableSlots();
m_pWndBig->RefreshEnableSlots();
}
void SUIPartyDualWnd::LeaveCreature( AR_HANDLE hMaster, AR_HANDLE hCreature )
{
int slotIndex = m_PartyMgr.FindMemberIndex(hMaster);
m_pWndSml->LeaveCreature( hMaster, hCreature );
m_pWndBig->LeaveCreature( hMaster, hCreature );
m_pWndSml->RefreshEnableSlots();
m_pWndBig->RefreshEnableSlots();
/// 2012.02.10 모든 크리처가 없을 때만 hide 시켜줘야 된다. SPlayerSlot는 나중에 설정되기 때문에 SPlayerSlot로는 참조가 안됨
if (!m_pWndSml->isCreature(slotIndex))
{
m_showCreature[slotIndex] = false;
}
}
void SUIPartyDualWnd::CreatureInfo(STR_LIST& vectext)
{
int nCount = atoi( vectext[ 1 ].c_str() );
if(nCount <= 0)
return ;
int nPos = 2;
for(int i=0; i<nCount; i++, nPos+=3)
{
// 핸들(주인, 주크리처, 부크리처) 추가
char * strstoper;
AR_HANDLE hMaster = ::strtoul( vectext[ nPos + 0 ].c_str(), &strstoper, 10 );
AR_HANDLE hMain = ::strtoul( vectext[ nPos + 1 ].c_str(), &strstoper, 10 );
AR_HANDLE hSub = ::strtoul( vectext[ nPos + 2 ].c_str(), &strstoper, 10 );
m_pWndSml->CreatureInfo(hMaster, hMain, hSub);
m_pWndBig->CreatureInfo(hMaster, hMain, hSub);
}
m_pWndSml->RefreshEnableSlots();
m_pWndBig->RefreshEnableSlots();
}
void SUIPartyDualWnd::MemberCreatureInfo(STR_LIST& vectext)
{
int nPos = 1; // 첫번째는 파티 이름
// 핸들(주인, 주크리처, 부크리처) 추가
char * strstoper;
AR_HANDLE hMaster = ::strtoul( vectext[ nPos + 0 ].c_str(), &strstoper, 10 );
AR_HANDLE hMain = ::strtoul( vectext[ nPos + 1 ].c_str(), &strstoper, 10 );
AR_HANDLE hSub = ::strtoul( vectext[ nPos + 2 ].c_str(), &strstoper, 10 );
m_pWndSml->CreatureInfo(hMaster, hMain, hSub);
m_pWndBig->CreatureInfo(hMaster, hMain, hSub);
m_pWndSml->RefreshEnableSlots();
m_pWndBig->RefreshEnableSlots();
}
// 크리처 순서 2012.01.10 - servantes
void SUIPartyDualWnd::CreatureOrder(bool bFirst, AR_HANDLE hMaster, AR_HANDLE hCreature)
{
m_pWndSml->CreatureOrder(bFirst, hMaster, hCreature);
m_pWndBig->CreatureOrder(bFirst, hMaster, hCreature);
}
void SUIPartyDualWnd::LeaveCreature(bool bFirst, AR_HANDLE hMaster, AR_HANDLE hCreature)
{
m_pWndSml->LeaveCreature(bFirst, hMaster, hCreature);
m_pWndBig->LeaveCreature(bFirst, hMaster, hCreature);
}
// 크리처 핸들 설정
//void SUIPartyDualWnd::SetCreatureHandle( AR_HANDLE hMainCardCreature, AR_HANDLE hSubCardCreature, int index )
//void SUIPartyDualWnd::SetCreatureHandle( AR_HANDLE hMainCardCreature, int index )
//{
// m_pWndSml->SetCreatureHandle(hMainCardCreature, index);
// m_pWndBig->SetCreatureHandle(hMainCardCreature, index);
//}
void SUIPartyDualWnd::SetCreatureHandle( AR_HANDLE hMainCreature, int index )
{
m_pWndSml->SetCreatureHandle(hMainCreature, index);
m_pWndBig->SetCreatureHandle(hMainCreature, index);
}
/*
//void SUIPartyDualWnd::SetSubCreatureHandle( AR_HANDLE hSubCardCreature, int index )
//{
// m_pWndSml->SetSubCreatureHandle(hSubCardCreature, index);
// m_pWndBig->SetSubCreatureHandle(hSubCardCreature, index);
//}
void SUIPartyDualWnd::SetSubCreatureHandle( AR_HANDLE hCreature, int index )
{
m_pWndSml->SetSubCreatureHandle(hCreature, index);
m_pWndBig->SetSubCreatureHandle(hCreature, index);
}
*/
//void SUIPartyDualWnd::SetHideCreatureHandle( AR_HANDLE hSubardCreature, int index )
//void SUIPartyDualWnd::SetHideCreatureHandle( AR_HANDLE hSubardCreature, int index )
//{
// m_pWndSml->SetHideCreatureHandle(hSubCardCreature, index);
// m_pWndBig->SetHideCreatureHandle(hSubCardCreature, index);
//}
/*
void SUIPartyDualWnd::SetHideCreatureHandle( AR_HANDLE hCreature, int index )
{
m_pWndSml->SetHideCreatureHandle(hCreature, index);
m_pWndBig->SetHideCreatureHandle(hCreature, index);
}
*/
void SUIPartyDualWnd::setTitlebarArenaInfo(char const* aniName, char const* caption)
{
std::string str;
str = "<font:font_01><size:7><out><hcenter><vcenter>";
str += caption;
m_pWndSml->setTitlebarArenaInfo(aniName, str.c_str());
str = "<font:font_01><size:9><out><hcenter><vcenter>";
str += caption;
m_pWndBig->setTitlebarArenaInfo(aniName, str.c_str());
}