175 lines
4.1 KiB
C++
175 lines
4.1 KiB
C++
#include "stdafx.h"
|
|
#include "SStringDB.h"
|
|
#include <toolkit/XStringUtil.h>
|
|
|
|
#include "SGameManager.h"
|
|
#include "SGameMessage.h"
|
|
//#include "SGameMessageUI.h"
|
|
#include "SMessengerMgr.h"
|
|
|
|
//#include "KUIControl.h"
|
|
#include "KUIControlEdit.h"
|
|
|
|
#include "SUIAllianceGuild.h"
|
|
|
|
|
|
SUIAllianceGuild::SUIAllianceGuild( SGameManager * pGameManager ) :
|
|
SUIWnd( pGameManager ),
|
|
m_CtrlGuild( NULL ),
|
|
m_CtrlLeader( NULL ),
|
|
m_CtrlGuildCount( NULL ),
|
|
m_CtrlDungeon( NULL )
|
|
{
|
|
}
|
|
|
|
|
|
SUIAllianceGuild::~SUIAllianceGuild()
|
|
{
|
|
Release();
|
|
}
|
|
|
|
void SUIAllianceGuild::Release()
|
|
{
|
|
|
|
}
|
|
|
|
SUIWnd* SUIAllianceGuild::CreateWnd( const char* szFile, KUIWndManager* pWndManager, KPoint kPos, int nWindowID )
|
|
{
|
|
SUIWnd::CreateWnd( szFile, pWndManager, kPos, nWindowID );
|
|
|
|
|
|
return this;
|
|
}
|
|
|
|
|
|
bool SUIAllianceGuild::InitControls( KPoint kPos )
|
|
{
|
|
// 각 정보 컨트롤.
|
|
m_CtrlGuild = GetChild( "guild_data_text_18" );
|
|
m_CtrlLeader = GetChild( "guild_data_text_19" );
|
|
m_CtrlGuildCount = GetChild( "guild_data_text_20" );
|
|
m_CtrlDungeon = GetChild( "guild_data_text_23" );
|
|
|
|
|
|
// 텍스트 데코레이션 뽑아내기.
|
|
string strOrg( m_CtrlGuild->GetCaption() );
|
|
std::string::size_type sizeEnd = strOrg.find_last_of( ">" );
|
|
m_TextDecoration = strOrg.substr( 0, ++sizeEnd );
|
|
|
|
|
|
return SUIWnd::InitControls( kPos );
|
|
}
|
|
|
|
//void SUIAllianceGuild::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd)
|
|
//{
|
|
// if( bOpen )
|
|
// {
|
|
// //this->SetShow( true );
|
|
// //
|
|
// //// 기존 포커스 제거.
|
|
// //this->m_pManager->RemoveWnd( this );
|
|
//
|
|
// //// wnd 출력 리스트의 최하단에 추가. ( wnd 들중 가장 상위에 뜨게 된다. )
|
|
// //this->m_pManager->AddWnd( this );
|
|
//
|
|
// //// 가장위에 뜨도록 한다.
|
|
// //this->m_pManager->SetFocus( this );
|
|
// }
|
|
//
|
|
// SUIWnd::OnNotifyUIWindowOpen( bOpen, bLimitWnd );
|
|
//}
|
|
|
|
|
|
void SUIAllianceGuild::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_SEND_DATA :
|
|
{
|
|
// 연합길드 정보.
|
|
SIMSG_UI_SEND_DATA * pDataAlliance = dynamicCast< SIMSG_UI_SEND_DATA * >( pMsg );
|
|
if( !::_stricmp( "AllianceGuildName", pDataAlliance->m_strText.c_str() ) )
|
|
{
|
|
// 길드 정보 설정.
|
|
DataMapping( reinterpret_cast< SAllianceGuild * >( pDataAlliance->m_pData ) );
|
|
//DataMapping( pDataAlliance->m_strString );
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
void SUIAllianceGuild::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch( nMessage )
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK :
|
|
|
|
// close.
|
|
//servantes 2010.10.13
|
|
if( !::_stricmp( lpszControlID, "button_close" ) )
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_INFO_ALLIANCE, false ) );
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
// 윈도우 이동
|
|
case KUI_MESSAGE::KGENWND_MOVE:
|
|
|
|
LimitMoveWnd(); // 게임 외부로 나가지 못하게 제한
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
|
|
|
|
|
|
//DWORD SUIAllianceGuild::OnMouseMessage(DWORD dwMessage, int x, int y)
|
|
//{
|
|
// /*switch( dwMessage )
|
|
// {
|
|
// case KLBUTTON_DOWN :
|
|
//
|
|
// break;
|
|
//
|
|
// }*/
|
|
//
|
|
// return SUIWnd::OnMouseMessage(dwMessage, x, y);
|
|
//}
|
|
|
|
|
|
// 길드 정보 설정.
|
|
void SUIAllianceGuild::DataMapping( SAllianceGuild * pGuildData )
|
|
{
|
|
m_CtrlGuild->SetCaption( ( m_TextDecoration + pGuildData->strName ).c_str() ); // 길드명.
|
|
m_CtrlLeader->SetCaption( ( m_TextDecoration + pGuildData->strLeaderName ).c_str() ); // 길드장
|
|
m_CtrlGuildCount->SetCaption( CStringUtil::StringFormat( "%s%d", m_TextDecoration.c_str(), pGuildData->nMemberCount ).c_str() );// 길드원수
|
|
|
|
//// 소유던전.
|
|
//m_GuildMgr.GetAllianceGuild
|
|
//int nDungeonID = GetDungeonResDB().GetDungeonNameID( pGuildData->nID .GetGuildDungeonID() );
|
|
//strText.append( GetStringDB().GetString( nDungeonID ) );
|
|
//std::string::size_type nSize = strText.find( "empty" );
|
|
//strText = nSize == -1 ? strText : "";
|
|
//GetChild( "guild_data_text_11" )->SetCaption( strText.c_str() );
|
|
m_CtrlDungeon->SetCaption( " " );
|
|
} |