317 lines
8.7 KiB
C++
317 lines
8.7 KiB
C++
|
|
#include "stdafx.h"
|
|
#include "SGameManager.h"
|
|
#include "SGameMessage.h"
|
|
//#include "SGameMessageUI.h"
|
|
#include "SMessengerMgr.h"
|
|
#include "SPlayerInfoMgr.h"
|
|
//#include "KUIControl.h"
|
|
#include "KUIControlButton.h"
|
|
#include "SUIMemberPopupWnd.h"
|
|
|
|
SUIMemberPopupWnd::SUIMemberPopupWnd( SGameManager * pGameManager )
|
|
: SUIWnd( pGameManager ),
|
|
m_pInframeControl( NULL ),
|
|
m_MouseMoveX(0),
|
|
m_MouseMoveY(0)
|
|
{
|
|
|
|
}
|
|
|
|
SUIMemberPopupWnd::~SUIMemberPopupWnd()
|
|
{
|
|
Release();
|
|
}
|
|
|
|
|
|
// 메모리 해제.
|
|
void SUIMemberPopupWnd::Release()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
SUIWnd* SUIMemberPopupWnd::CreateWnd( const char* szFile, KUIWndManager* pWndManager, KPoint kPos, int nWindowID )
|
|
{
|
|
m_pInframeControl = GetChild( "inframe" );
|
|
|
|
return SUIWnd::CreateWnd( szFile, pWndManager, kPos, nWindowID );
|
|
}
|
|
|
|
|
|
void SUIMemberPopupWnd::Process(DWORD dwTime)
|
|
{
|
|
//if( this->GetIsOpen() && ( this->GetRect().IsInRect( m_MouseMoveX, m_MouseMoveY ) == false ) )
|
|
//{
|
|
// // 마우스가 영역을 벗어나면 닫기.
|
|
// m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUBMENU_RIGHTCLICK, false ) );
|
|
//}
|
|
}
|
|
|
|
|
|
void SUIMemberPopupWnd::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
switch( pMsg->nType )
|
|
{
|
|
/*case IMSG_UI_MOVE:
|
|
{
|
|
SIMSG_UI_MOVE* pMoveMsg = ( SIMSG_UI_MOVE* )pMsg;
|
|
|
|
MovePos( pMoveMsg->m_nX, pMoveMsg->m_nY );
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;*/
|
|
|
|
case IMSG_UI_MOVE:
|
|
{
|
|
SIMSG_UI_MOVE* pMoveMsg = ( SIMSG_UI_MOVE* )pMsg;
|
|
|
|
MovePos( pMoveMsg->m_nX, pMoveMsg->m_nY );
|
|
|
|
// 가장위에 뜨도록 한다.
|
|
this->m_pManager->SetFocus( this );
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
|
|
|
|
case IMSG_UI_SEND_DATA :
|
|
|
|
// 문자데이터( 맴버리스트에서 선택된 캐릭터 아이디 ).
|
|
m_strData = static_cast< SIMSG_UI_SEND_DATA * >( pMsg )->m_strString.c_str();
|
|
|
|
pMsg->bUse = true;
|
|
|
|
break;
|
|
|
|
|
|
case IMSG_MOUSEMOVE :
|
|
{
|
|
if( this->IsShow() )
|
|
{
|
|
SIMSG_MOUSEMOVE * pData = dynamicCast< SIMSG_MOUSEMOVE * >( pMsg );
|
|
m_MouseMoveX = LOWORD( pData->lParam ); //pData->wParam;
|
|
m_MouseMoveY = HIWORD( pData->lParam ); // pData->lParam;
|
|
|
|
if( !( this->GetRect().IsInRect( m_MouseMoveX, m_MouseMoveY ) ) )
|
|
{
|
|
// 마우스가 영역을 벗어나면 닫기.
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUBMENU_RIGHTCLICK, false ) );
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
|
|
}
|
|
|
|
//KUIPopup::ProcMsgAtStatic( pMsg );
|
|
}
|
|
|
|
|
|
void SUIMemberPopupWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd)
|
|
{
|
|
if( bOpen )
|
|
{
|
|
m_MouseMoveX = this->GetRect().left + 1;
|
|
m_MouseMoveY = this->GetRect().top + 1;
|
|
|
|
this->SetShow( true );
|
|
|
|
// 기존 포커스 제거.
|
|
this->m_pManager->RemoveWnd( this );
|
|
|
|
// wnd 출력 리스트의 최하단에 추가. ( wnd 들중 가장 상위에 뜨게 된다. )
|
|
this->m_pManager->AddWnd( this );
|
|
|
|
// 가장위에 뜨도록 한다.
|
|
this->m_pManager->SetFocus( this );
|
|
|
|
|
|
// 등급설정.
|
|
AuthorityProcess();
|
|
|
|
}
|
|
|
|
//KUIPopup::OnNotifyUIWindowOpen( bOpen, bLimitWnd );
|
|
}
|
|
|
|
|
|
void SUIMemberPopupWnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch( nMessage )
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK :
|
|
|
|
|
|
// 귓말하기.
|
|
if( !::_stricmp( lpszControlID, "guild_sub_menu_list_01" ) )
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_WHISPER( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_CHATTING, m_strData.c_str() ) );
|
|
}
|
|
|
|
|
|
// 차단.
|
|
else if( !::_stricmp( lpszControlID, "guild_sub_menu_list_02" ) )
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SMSG_FRIEND_COMMAND( SMSG_FRIEND_COMMAND::CUT_ADD, m_strData.c_str() ) );
|
|
}
|
|
|
|
// 등급관리.
|
|
else if( !::_stricmp( lpszControlID, "guild_sub_menu_list_05" ) )
|
|
{
|
|
KRect rt;
|
|
KUIWnd * pPosWnd = this->m_pGameManager->GetWndManager()->FindWnd("window_guild_sub_manage", "guild_class_text_01");
|
|
if( pPosWnd )
|
|
rt = pPosWnd->GetRect();
|
|
|
|
//// 길드맴버 팝업메뉴( 등급관리 ) -> 길드관리 Open -> 길드원관리 패널 Open
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_GUILD_WNDMSG( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_MAINWND, IMSG_UI_GUILD_MEMBERCLASS_SETUP )
|
|
);
|
|
|
|
// 해당 팝업 윈도우 오픈.
|
|
OpenPopupWnd( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_CLASS, rt.left-7, rt.top );
|
|
|
|
// 길드맴버 팝업메뉴( 등급관리 ) -> 길드원관리패널( 길드원등급 팝업 오픈 )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_GUILD_WNDMSG( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_CLASS,
|
|
SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_CLASS,
|
|
IMSG_UI_GUILD_MEMBERCLASS_SETUP, m_strData )
|
|
);
|
|
|
|
}
|
|
|
|
|
|
// 길드원 제명.
|
|
else if( !::_stricmp( lpszControlID, "guild_sub_menu_list_06" ) )
|
|
{
|
|
KRect rt;
|
|
KUIWnd * pPosWnd = this->m_pGameManager->GetWndManager()->FindWnd("window_guild_sub_manage", "guild_class_text_01");
|
|
if( pPosWnd )
|
|
rt = pPosWnd->GetRect();
|
|
|
|
//// 길드맴버 팝업메뉴( 등급관리 ) -> 길드관리 Open -> 길드원관리 패널 Open
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_GUILD_WNDMSG( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_MAINWND, IMSG_UI_GUILD_EXPULSION_SETUP )
|
|
);
|
|
|
|
// 해당 팝업 윈도우 오픈.
|
|
OpenPopupWnd( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_EXPULSION, rt.left-7, rt.top );
|
|
|
|
// 길드맴버 팝업메뉴( 등급관리 ) -> 길드원관리패널( 길드원제명 팝업 오픈 )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_GUILD_WNDMSG( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_EXPULSION,
|
|
SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_EXPULSION,
|
|
IMSG_UI_GUILD_EXPULSION_SETUP, m_strData )
|
|
);
|
|
}
|
|
|
|
|
|
// 친구추가.
|
|
else if( !::_stricmp( lpszControlID, "guild_sub_menu_list_04" ) )
|
|
{
|
|
// 친구추가 메세지 전송.
|
|
m_pGameManager->PostMsgAtDynamic( new SMSG_FRIEND_COMMAND( SMSG_FRIEND_COMMAND::FRIEND_ADD, m_strData.c_str() ) );
|
|
}
|
|
|
|
// 파티초대.
|
|
else if( !::_stricmp( lpszControlID, "guild_sub_menu_list_07" ) )
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SMSG_PARTY_COMMAND( SMSG_PARTY_COMMAND::PARTY_INVITE, m_strData.c_str() ) );
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
DWORD SUIMemberPopupWnd::OnMouseMessage(DWORD dwMessage, int x, int y)
|
|
{
|
|
//_oprint( "LEFT:%d, TOP:%d, ---------- X:%d, Y%d\n", this->GetRect().left, this->GetRect().top, x, y );
|
|
|
|
//KRect rt = this->GetRect();
|
|
//rt.left +=6;
|
|
//rt.top += 6;
|
|
//rt.right -= 6;
|
|
//rt.bottom -= 6;
|
|
|
|
//if( !rt.IsInRect( x, y ) )
|
|
//{
|
|
// // 창닫기.
|
|
// m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUBMENU_RIGHTCLICK, false ) );
|
|
//}
|
|
|
|
|
|
|
|
return SUIWnd::OnMouseMessage( dwMessage, x, y );
|
|
}
|
|
|
|
|
|
// 해당 팝업 윈도우 오픈.
|
|
void SUIMemberPopupWnd::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 열기.
|
|
}
|
|
|
|
|
|
/// @brief 마우스가 컨트롤 영역에 포커스가 on/off瑛뻑㎏?발생되는 통지 메세지를 날린다
|
|
void SUIMemberPopupWnd::OnMouseFocusOnNotify(KUIWnd* pWnd/*wnd*/, bool bFocus/*focusOn*/)
|
|
{
|
|
//if( pWnd == m_pInframeControl && !bFocus )
|
|
//{
|
|
// // 창닫기.
|
|
// m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUBMENU_RIGHTCLICK, false ) );
|
|
//}
|
|
}
|
|
|
|
// 등급설정.
|
|
void SUIMemberPopupWnd::AuthorityProcess()
|
|
{
|
|
// 권한.
|
|
SPlayerInfo player = m_PlayerInfoMgr.GetPlayerInfo();
|
|
SPlayerSlot * pPlayerSlot = this->m_GuildMgr.FindMember( player.GetName() );
|
|
if( pPlayerSlot )
|
|
{
|
|
int nAuthority = pPlayerSlot->GetAuthority();
|
|
|
|
// 길드마스터제외.
|
|
if( nAuthority == 7 )
|
|
return;
|
|
|
|
if( nAuthority > 0 && nAuthority <= 7 )
|
|
{
|
|
int nBitSet = m_GuildMgr.GetAuthorityClassBitSet( nAuthority - 1 ); // 권한 비트셋.
|
|
|
|
KUIControlButton * pBtnManage = dynamicCast< KUIControlButton * >( GetChild( "guild_sub_menu_list_05" ) );
|
|
pBtnManage->SetEnableColor( "<#ffffff>" );
|
|
|
|
KUIControlButton * pBtnExpulsion = dynamicCast< KUIControlButton * >( GetChild( "guild_sub_menu_list_06" ) );
|
|
pBtnExpulsion->SetEnableColor( "<#ffffff>" );
|
|
|
|
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();
|
|
}
|
|
}
|
|
}
|
|
} |