262 lines
6.4 KiB
C++
262 lines
6.4 KiB
C++
|
|
#include "stdafx.h"
|
|
|
|
#include "KUIControlEdit.h"
|
|
#include "KUIControlButton.h"
|
|
#include "KUIControlStatic.h"
|
|
#include "KUIControlCombo.h"
|
|
#include "KUIControlClockBox.h"
|
|
|
|
#include "SGameManager.h"
|
|
#include "SUICharScreenControl.h"
|
|
#include "SUICreateCharWnd.h"
|
|
|
|
//#include "SGameMessageUI.h"
|
|
|
|
#include "GameDefine.h"
|
|
|
|
#include "SStringDB.h"
|
|
#include "SItemDB.h"
|
|
|
|
|
|
|
|
void SUICharScreenControl::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
if( KUI_MESSAGE::KBUTTON_CLICK == nMessage )
|
|
{
|
|
if( 0 == ::_stricmp( "zoom", lpszControlID ) )
|
|
{
|
|
m_bIsZoom = !m_bIsZoom;
|
|
KUIControlButton * pZoomBtn = dynamicCast<KUIControlButton *>(GetChild( "zoom" ));
|
|
KUIControlStatic * pZoomAni = dynamicCast<KUIControlStatic*>(GetChild( "static_zoom" ));
|
|
|
|
if( pZoomBtn && pZoomAni)
|
|
{
|
|
if( m_bIsZoom ) pZoomAni->SetAniName( "static_zoom_out" );
|
|
else pZoomAni->SetAniName( "static_zoom_in" );
|
|
|
|
pZoomBtn->Disable();
|
|
}
|
|
}
|
|
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UIWND_NOTIFY_TO_LOBBY( lpszControlID ) );
|
|
}
|
|
else if( KUI_MESSAGE::KBUTTON_PRESSING == nMessage )
|
|
{
|
|
if( 0 == ::_stricmp( "rotatelbtn", lpszControlID ) )
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UIWND_NOTIFY_TO_LOBBY( lpszControlID, true ) );
|
|
|
|
if( 0 == ::_stricmp( "rotaterbtn", lpszControlID ) )
|
|
m_pGameManager->ProcMsgAtStatic( &SIMSG_UIWND_NOTIFY_TO_LOBBY( lpszControlID, true ) );
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
|
|
DWORD SUICharScreenControl::OnMouseMessage(DWORD dwMessage, int x, int y)
|
|
{
|
|
//if( dwMessage == KLBUTTON_DOWN )
|
|
//m_pGameManager->StartSound( "ui_button_click.wav" );
|
|
|
|
return SUIWnd::OnMouseMessage(dwMessage, x, y);
|
|
}
|
|
|
|
|
|
void SUICharScreenControl::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
switch( pMsg->nType )
|
|
{
|
|
case IMSG_UI_CUSTOM:
|
|
{
|
|
SIMSG_UI_CUSTOM* pCustomMsg = (SIMSG_UI_CUSTOM*)pMsg;
|
|
/*if( pCustomMsg->m_nCmd == SIMSG_UI_CUSTOM::BUTTON_ON )
|
|
{
|
|
KUIControlSimpleButton * pZoomBtn = (KUIControlSimpleButton *)GetChild( "zoom" );
|
|
if( pZoomBtn )
|
|
{
|
|
pZoomBtn->Enable();
|
|
}
|
|
}
|
|
else */if( pCustomMsg->m_nCmd == SIMSG_UI_CUSTOM::BUTTON_ALLON
|
|
|| pCustomMsg->m_nCmd == SIMSG_UI_CUSTOM::BUTTON_ON )
|
|
{
|
|
KUIControlButton * pZoomBtn = dynamicCast<KUIControlButton *>(GetChild( "zoom" ));
|
|
if( pZoomBtn )
|
|
pZoomBtn->Enable();
|
|
|
|
KUIControlButton * pRotlBtn = dynamicCast<KUIControlButton *>(GetChild( "rotatelbtn" ));
|
|
if( pRotlBtn )
|
|
pRotlBtn->Enable();
|
|
|
|
KUIControlButton * pRotRBtn = dynamicCast<KUIControlButton *>(GetChild( "rotaterbtn" ));
|
|
if( pRotRBtn )
|
|
{
|
|
pRotRBtn->Enable();
|
|
}
|
|
}
|
|
else if( pCustomMsg->m_nCmd == SIMSG_UI_CUSTOM::BUTTON_ALLOFF )
|
|
{
|
|
KUIControlButton * pZoomBtn = dynamicCast<KUIControlButton *>(GetChild( "zoom" ));
|
|
if( pZoomBtn )
|
|
pZoomBtn->Disable();
|
|
|
|
KUIControlButton * pRotlBtn = dynamicCast<KUIControlButton *>(GetChild( "rotatelbtn" ));
|
|
if( pRotlBtn )
|
|
pRotlBtn->Disable();
|
|
|
|
KUIControlButton * pRotRBtn = dynamicCast<KUIControlButton *>(GetChild( "rotaterbtn" ));
|
|
if( pRotRBtn )
|
|
{
|
|
pRotRBtn->Disable();
|
|
}
|
|
|
|
}
|
|
else if( pCustomMsg->m_nCmd == SIMSG_UI_CUSTOM::WINDOW_CLOSE )
|
|
{
|
|
if( m_IsAlphaProc == ALPHA_OPEN || m_IsAlphaProc == ALPHA_OPENING )
|
|
{
|
|
m_IsAlphaProc = ALPHA_CLOSE;
|
|
m_dwPrevTime = m_dwTime;
|
|
}
|
|
}
|
|
else if( pCustomMsg->m_nCmd == SIMSG_UI_CUSTOM::BUTTON_CHANGE )
|
|
{
|
|
m_bIsZoom = false;
|
|
KUIControlStatic * pZoomAni = dynamicCast<KUIControlStatic*>(GetChild( "static_zoom" ));
|
|
if( pZoomAni )
|
|
pZoomAni->SetAniName( "static_zoom_in" );
|
|
}
|
|
else if( pCustomMsg->m_nCmd == SIMSG_UI_CUSTOM::BUTTON_OUT_ANI )
|
|
{
|
|
m_bIsZoom = true;
|
|
KUIControlStatic * pZoomAni = dynamicCast<KUIControlStatic*>(GetChild( "static_zoom" ));
|
|
if( pZoomAni )
|
|
pZoomAni->SetAniName( "static_zoom_out" );
|
|
}
|
|
else if( pCustomMsg->m_nCmd == SIMSG_UI_CUSTOM::BUTTON_IN_ANI )
|
|
{
|
|
m_bIsZoom = false;
|
|
KUIControlStatic * pZoomAni = dynamicCast<KUIControlStatic*>(GetChild( "static_zoom" ));
|
|
if( pZoomAni )
|
|
pZoomAni->SetAniName( "static_zoom_in" );
|
|
}
|
|
}
|
|
break;
|
|
};
|
|
}
|
|
|
|
void SUICharScreenControl::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
m_bIsZoom = false;
|
|
KUIControlStatic * pZoomAni = dynamicCast<KUIControlStatic*>(GetChild( "static_zoom" ));
|
|
if( pZoomAni )
|
|
pZoomAni->SetAniName( "static_zoom_in" );
|
|
|
|
if( bOpen )
|
|
{
|
|
m_IsAlphaProc = ALPHA_OPEN;
|
|
m_dwPrevTime = 0;
|
|
ChangeAlpha(0.f);
|
|
}
|
|
else
|
|
{
|
|
m_IsAlphaProc = ALPHA_NONE;
|
|
m_dwPrevTime = 0;
|
|
}
|
|
}
|
|
|
|
bool SUICharScreenControl::InitData( bool bReload)
|
|
{
|
|
m_bIsZoom = false;
|
|
m_dwPrevTime = 0;
|
|
m_dwTime = 0;
|
|
m_IsAlphaProc = ALPHA_NONE;
|
|
|
|
return SUIWnd::InitData(bReload);
|
|
}
|
|
|
|
void SUICharScreenControl::Process(DWORD dwTime)
|
|
{
|
|
m_dwTime = dwTime;
|
|
|
|
if( m_IsAlphaProc == ALPHA_OPEN && m_dwPrevTime == 0 )
|
|
{
|
|
m_dwPrevTime = m_dwTime;
|
|
}
|
|
|
|
if( m_IsAlphaProc != ALPHA_NONE && m_dwPrevTime != 0 )
|
|
{
|
|
if( (m_dwTime-m_dwPrevTime) <= 1000 )
|
|
{
|
|
if( m_IsAlphaProc == ALPHA_OPEN )
|
|
{
|
|
float fVal = (m_dwTime-m_dwPrevTime)/1000.f;
|
|
ChangeAlpha(fVal);
|
|
}
|
|
else if( m_IsAlphaProc == ALPHA_CLOSE )
|
|
{
|
|
float fVal = 1.f-((m_dwTime-m_dwPrevTime)/1000.f);
|
|
ChangeAlpha(fVal);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if( m_IsAlphaProc == ALPHA_OPEN )
|
|
{
|
|
m_IsAlphaProc = ALPHA_OPENING;
|
|
ChangeAlpha(1.f);
|
|
}
|
|
else if( m_IsAlphaProc == ALPHA_CLOSE )
|
|
{
|
|
ChangeAlpha(0.f);
|
|
|
|
//자기 자신 닫기
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_CREATECHAR_ROTATE00, false ) );
|
|
}
|
|
|
|
m_dwPrevTime = 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/*
|
|
|
|
void SUICreateCharRotate01::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
switch( pMsg->nType )
|
|
{
|
|
case IMSG_UI_CUSTOM:
|
|
{
|
|
SIMSG_UI_CUSTOM* pCustomMsg = (SIMSG_UI_CUSTOM*)pMsg;
|
|
if( pCustomMsg->m_nCmd == SIMSG_UI_CUSTOM::BUTTON_ON ||
|
|
pCustomMsg->m_nCmd == SIMSG_UI_CUSTOM::BUTTON_ALLON )
|
|
{
|
|
KUIControlSimpleButton * pRotRBtn = (KUIControlSimpleButton *)GetChild( "rotaterbtn" );
|
|
if( pRotRBtn )
|
|
{
|
|
pRotRBtn->Enable();
|
|
}
|
|
}
|
|
else if( pCustomMsg->m_nCmd == SIMSG_UI_CUSTOM::BUTTON_ALLOFF )
|
|
{
|
|
KUIControlSimpleButton * pRotRBtn = (KUIControlSimpleButton *)GetChild( "rotaterbtn" );
|
|
if( pRotRBtn )
|
|
{
|
|
pRotRBtn->Disable();
|
|
}
|
|
}
|
|
else if( pCustomMsg->m_nCmd == SIMSG_UI_CUSTOM::WINDOW_CLOSE )
|
|
{
|
|
if( m_IsAlphaProc == ALPHA_OPEN || m_IsAlphaProc == ALPHA_OPENING )
|
|
{
|
|
m_IsAlphaProc = ALPHA_CLOSE;
|
|
m_dwPrevTime = m_dwTime;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
};
|
|
}
|
|
|
|
*/ |