364 lines
10 KiB
C++
364 lines
10 KiB
C++
#include "stdafx.h"
|
|
#include "SGameManager.h"
|
|
#include "SMessage.h"
|
|
//#include "SGameMessageUI.h"
|
|
#include "SMessengerMgr.h"
|
|
#include "SPlayerInfoMgr.h"
|
|
|
|
#include "KUIControlButton.h"
|
|
#include "KUIControlPanel.h"
|
|
#include "KUIControlStatic.h"
|
|
|
|
#include "SUIAdministraionPanelWnd.h"
|
|
|
|
|
|
// ** 길드원 관리 패널 **
|
|
|
|
|
|
SUIAdministraionPanelWnd::SUIAdministraionPanelWnd( SGameManager * pGameManager, KUIControlPanelManager * pPanelManager ):
|
|
KUIControlPanel( pGameManager, pPanelManager ),
|
|
m_pExtensionButton( NULL ), // 확장버튼.
|
|
m_pBoxClassManage( NULL ), // 등급관리 박스.
|
|
m_pBoxMemberKick( NULL ) // 길드원제명 박스.
|
|
{
|
|
}
|
|
|
|
|
|
SUIAdministraionPanelWnd::~SUIAdministraionPanelWnd()
|
|
{
|
|
Release();
|
|
}
|
|
|
|
// 메모리 해제.
|
|
void SUIAdministraionPanelWnd::Release()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
//-----------------------------
|
|
// Override
|
|
|
|
// KUIControlPanel::
|
|
// 패널의 크기를 원본크기로 변경한다. 각 패널윈도우의 크기가 다르므로 재정의할것!!.
|
|
void SUIAdministraionPanelWnd::ResizeOriginal()
|
|
{
|
|
KRect rtWnd = this->GetRect();
|
|
const KRect & rtTitlebar = GetChild( "trim_titlebar_open" )->GetRect();
|
|
|
|
rtWnd.bottom = rtWnd.top + rtTitlebar.GetHeight() - 1;
|
|
|
|
// 윈도우 크기변경.
|
|
KUIWnd::OnSizeChangeNofity( rtWnd );
|
|
|
|
|
|
// Panel 의 함수.
|
|
KUIControlPanel::ResizeOriginal();
|
|
|
|
// 버튼 애니 변경.
|
|
PanelExtend();
|
|
}
|
|
|
|
|
|
bool SUIAdministraionPanelWnd::InitControls( KPoint kPos )
|
|
{
|
|
m_pBoxClassManage = dynamicCast< KUIControlStatic * >( GetChild( "backline_07" ) ); // 등급관리 박스.
|
|
m_pBoxMemberKick = dynamicCast< KUIControlStatic * >( GetChild( "backline_08" ) ); // 길드원제명 박스.
|
|
|
|
|
|
KUIControlButton * pBtn = dynamicCast< KUIControlButton * >( GetChild( "button_manage_01" ) );
|
|
pBtn->SetEnableColor( "<#ffffff>" );
|
|
pBtn->SetDisableColor( "<#a0a0a0>" );
|
|
|
|
pBtn = dynamicCast< KUIControlButton * >( GetChild( "button_manage_02" ) );
|
|
pBtn->SetEnableColor( "<#ffffff>" );
|
|
pBtn->SetDisableColor( "<#a0a0a0>" );
|
|
|
|
|
|
// ****
|
|
// 확장 여부에따라 숨김, 보임 처리가 바뀌는 Wnd 를 배열에 추가한다.
|
|
this->AddChangeVisibleWnd( GetChild( "select_list_red" ) );
|
|
|
|
// 확장버튼 컨트롤.
|
|
m_pExtensionButton = dynamicCast< KUIControlSimpleButton * >( GetChild( "sub_open" ) );
|
|
|
|
|
|
// 기본크기.
|
|
const KRect & rtTitlebar = GetChild( "trim_titlebar_open" )->GetRect();
|
|
KRect rtOriginal = this->GetRect(); // window의 크기.
|
|
rtOriginal.bottom = rtOriginal.top + rtTitlebar.GetHeight();
|
|
|
|
// 초기설정.( 확대, 축소 크기지정 )
|
|
this->Initialize( rtOriginal, this->GetRect() );
|
|
|
|
kPos.x = rtOriginal.left;
|
|
kPos.y = rtOriginal.top;
|
|
|
|
// 활성화시 텍스트 컬러.
|
|
KUIControlStatic* ctrlMenu = dynamicCast< KUIControlStatic * >( GetChild( "guild_manage_menu" ) );
|
|
if (ctrlMenu) ctrlMenu->SetEnableColor( "<#ffffff>" );
|
|
|
|
return SUIWnd::InitControls( kPos );
|
|
}
|
|
|
|
|
|
|
|
void SUIAdministraionPanelWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd)
|
|
{
|
|
// Open.
|
|
if( bOpen )
|
|
{
|
|
// 권한처리.
|
|
AuthorityProcess();
|
|
|
|
// 길드원 관리 모드 설정.
|
|
/// 2011.05.16 ProcMsgAtStatic는 정적 입력 변수이다 - prodongi
|
|
//m_pGameManager->ProcMsgAtStatic( new SIMSG_UI_GUILD_WNDMSG( SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE::UIWINDOW_GUILD_MAINWND, SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE::UIWINDOW_GUILD_MAIN_TAP_MEMBER, IMSG_UI_GUILD_MANAGE_MODE, true ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_GUILD_WNDMSG( SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE::UIWINDOW_GUILD_MAINWND, SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE::UIWINDOW_GUILD_MAIN_TAP_MEMBER, IMSG_UI_GUILD_MANAGE_MODE, true ) );
|
|
}
|
|
// Close.
|
|
else
|
|
{
|
|
// 길드원등급관리, 길드원제명 팝업 닫기.
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_CLASS, false ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_EXPULSION, false ) );
|
|
|
|
|
|
// 길드원 관리 모드 해제.
|
|
/// 2011.05.16 ProcMsgAtStatic는 정적 입력 변수이다 - prodongi
|
|
//m_pGameManager->ProcMsgAtStatic( new SIMSG_UI_GUILD_WNDMSG( SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE::UIWINDOW_GUILD_MAINWND, SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE::UIWINDOW_GUILD_MAIN_TAP_MEMBER, IMSG_UI_GUILD_MANAGE_MODE, false ) );
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UI_GUILD_WNDMSG( SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE::UIWINDOW_GUILD_MAINWND, SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE::UIWINDOW_GUILD_MAIN_TAP_MEMBER, IMSG_UI_GUILD_MANAGE_MODE, false ) );
|
|
}
|
|
}
|
|
|
|
|
|
// 셀렉트박스 전환.
|
|
void SUIAdministraionPanelWnd::SelectedBox( const int nType )
|
|
{
|
|
switch( nType )
|
|
{
|
|
case IMSG_UI_GUILD_MEMBERCLASS_SETUP : // 길드원등급관리.
|
|
m_pBoxClassManage->SetAniName( "common_panel_inframe_titanium_bend_red" );
|
|
m_pBoxMemberKick->SetAniName( "common_panel_inframe_titanium_bend_gray" );
|
|
break;
|
|
case IMSG_UI_GUILD_EXPULSION_SETUP : // 길드원제명.
|
|
m_pBoxMemberKick->SetAniName( "common_panel_inframe_titanium_bend_red" );
|
|
m_pBoxClassManage->SetAniName( "common_panel_inframe_titanium_bend_gray" );
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
void SUIAdministraionPanelWnd::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
switch( pMsg->nType )
|
|
{
|
|
|
|
case IMSG_UI_SEND_DATA:
|
|
{
|
|
if( IsShow() )
|
|
{
|
|
SIMSG_UI_SEND_DATA *pData = (SIMSG_UI_SEND_DATA *)pMsg;
|
|
|
|
if( pData->m_strString == "guild_update" )
|
|
{
|
|
// 권한설정.
|
|
AuthorityProcess();
|
|
}
|
|
|
|
//
|
|
// 길드장 변경.
|
|
else if( pData->m_strString == "change_guild_master" )
|
|
{
|
|
// 권한설정.
|
|
AuthorityProcess();
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
|
|
// 길드맴버 팝업메뉴( 등급관리 ) -> 길드원관리패널( 길드원등급 팝업 오픈 )
|
|
case IMSG_UI_GUILD_MEMBERCLASS_SETUP :
|
|
|
|
pMsg->bUse = true;
|
|
|
|
//-----------------------
|
|
// 길드원등급관리 팝업 Wnd.
|
|
|
|
// m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_CLASS,
|
|
// this->GetMultipurposePos().x, this->GetMultipurposePos().y ) );
|
|
|
|
OpenPopupWnd( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_CLASS, this->GetMultipurposePos().x, this->GetMultipurposePos().y );
|
|
//m_pGameManager->PostMsgAtDynamic( pMsg ); // 팝업 Wnd 에 데이터 전송.
|
|
|
|
// 셀렉트박스 전환.
|
|
SelectedBox( pMsg->nType );
|
|
|
|
break;
|
|
|
|
|
|
case IMSG_UI_GUILD_EXPULSION_SETUP :
|
|
|
|
pMsg->bUse = true;
|
|
|
|
// 셀렉트박스 전환.
|
|
SelectedBox( pMsg->nType );
|
|
|
|
break;
|
|
}
|
|
}
|
|
|
|
void SUIAdministraionPanelWnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch( nMessage )
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK :
|
|
|
|
{
|
|
// 확대축소 토글.
|
|
if( !::_stricmp( lpszControlID, "sub_open" ) || !::_stricmp( lpszControlID, "trim_titlebar_open" ))
|
|
{
|
|
// 토글.
|
|
this->ToggleExtend();
|
|
|
|
// 버튼 애니 변경.
|
|
PanelExtend();
|
|
|
|
// 확대 축소에 따른 내부처리.
|
|
PanelProcess();
|
|
}
|
|
|
|
// 길드원 등급관리 버튼.
|
|
else if( !::_stricmp( lpszControlID, "button_manage_01" ) )
|
|
{
|
|
//-----------------------
|
|
// 길드원등급관리 팝업 Wnd.
|
|
|
|
OpenPopupWnd( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_CLASS, this->GetMultipurposePos().x, this->GetMultipurposePos().y );
|
|
|
|
// 셀렉트박스 전환.
|
|
SelectedBox( IMSG_UI_GUILD_MEMBERCLASS_SETUP );
|
|
}
|
|
|
|
|
|
// 길드원제명 버튼.
|
|
else if( !::_stricmp( lpszControlID, "button_manage_02" ) )
|
|
{
|
|
//-----------------------
|
|
// 길드원제명 팝업 Wnd.
|
|
|
|
OpenPopupWnd( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_EXPULSION, this->GetMultipurposePos().x, this->GetMultipurposePos().y );
|
|
|
|
// 셀렉트박스 전환.
|
|
SelectedBox( IMSG_UI_GUILD_EXPULSION_SETUP );
|
|
}
|
|
|
|
}
|
|
break;
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
DWORD SUIAdministraionPanelWnd::OnMouseMessage(DWORD dwMessage, int x, int y)
|
|
{
|
|
|
|
return SUIWnd::OnMouseMessage(dwMessage, x, y);
|
|
}
|
|
|
|
|
|
// Panel 확대,축소
|
|
void SUIAdministraionPanelWnd::PanelExtend()
|
|
{
|
|
m_pExtensionButton->SetAniName( this->GetIsExtend() ? "common_button_titanium_sub_open" : "common_button_titanium_sub_close" );
|
|
|
|
|
|
}
|
|
|
|
// 확대 축소에 따른 내부처리.
|
|
void SUIAdministraionPanelWnd::PanelProcess()
|
|
{
|
|
// 확장상태.
|
|
if( this->GetIsExtend() )
|
|
{
|
|
// 길드원관리Opne -> 길드메인( 길드원탭 활성화 ).
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_GUILD_WNDMSG( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_MAINWND, IMSG_UI_GUILD_MEMBERTAB ) );
|
|
}
|
|
}
|
|
|
|
// 해당 팝업 윈도우 오픈.
|
|
void SUIAdministraionPanelWnd::OpenPopupWnd( int wndID, int posX, int posY )
|
|
{
|
|
SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE wndType = ( SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE )wndID;
|
|
|
|
// 이전에 열려있을 경우를 대비해서 닫는다.
|
|
//m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( wndType, false ) );
|
|
//m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_MOVE( wndType, posX, posY ) ); // 위치 지정.
|
|
//m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( wndType, true ) ); // 팝업 Wnd 열기.
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_MOVE( wndType, posX, posY ) ); // 위치 지정.
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_TOGGLE_UIWINDOW( wndType ) ); // 팝업 Wnd 열기.
|
|
|
|
}
|
|
|
|
|
|
// Open 시 필요기능정의.
|
|
void SUIAdministraionPanelWnd::CustomOpen()
|
|
{
|
|
// Panel 확대,축소
|
|
PanelExtend();
|
|
}
|
|
|
|
|
|
void SUIAdministraionPanelWnd::AuthorityProcess()
|
|
{
|
|
// 권한.
|
|
SPlayerInfo player = m_PlayerInfoMgr.GetPlayerInfo();
|
|
SPlayerSlot * pPlayerSlot = this->m_GuildMgr.FindMember( player.GetName() );
|
|
if( pPlayerSlot )
|
|
{
|
|
int nAuthority = pPlayerSlot->GetAuthority();
|
|
|
|
KUIControlButton * pBtnManage = dynamicCast< KUIControlButton * >( GetChild( "button_manage_01" ) );
|
|
pBtnManage->SetEnableColor( "<#ffffff>" );
|
|
|
|
KUIControlButton * pBtnExpulsion = dynamicCast< KUIControlButton * >( GetChild( "button_manage_02" ) );
|
|
pBtnExpulsion->SetEnableColor( "<#ffffff>" );
|
|
|
|
// 길드마스터.
|
|
if( nAuthority == 7 )
|
|
{
|
|
if( pBtnManage->IsDisable() )
|
|
pBtnManage->Enable();
|
|
|
|
if( pBtnExpulsion->IsDisable() )
|
|
pBtnExpulsion->Enable();
|
|
}
|
|
|
|
// 길드원.
|
|
else if( nAuthority > 0 && nAuthority <= 7 )
|
|
{
|
|
int nBitSet = m_GuildMgr.GetAuthorityClassBitSet( nAuthority - 1 ); // 권한 비트셋.
|
|
|
|
if( !( nBitSet & _PERMIT_REQUIRED_ACTION::PRA_GRANT_REVOKE_PERMISSION ) ) // 등급관리.
|
|
{
|
|
pBtnManage->Disable();
|
|
}
|
|
else
|
|
{
|
|
pBtnManage->Enable();
|
|
}
|
|
|
|
|
|
if( !( nBitSet & _PERMIT_REQUIRED_ACTION::PRA_MEMBER_KICK ) ) // 길드원제명.
|
|
{
|
|
pBtnExpulsion->Disable();
|
|
}
|
|
else
|
|
{
|
|
pBtnExpulsion->Enable();
|
|
}
|
|
}
|
|
}
|
|
|
|
} |