163 lines
4.0 KiB
C++
163 lines
4.0 KiB
C++
#include "stdafx.h"
|
|
#include "SUILocalSignWnd.h"
|
|
|
|
//지역 표시 관련
|
|
static const int c_nSignDecoX = 148;
|
|
static const int c_nSignDecoY = 127;
|
|
static const float VIEW_TIME = 10000.f; /// 201.07.15 6초 -> 10초(로딩 시간에 따라 틀려짐;;)
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//지역 표시 정보 맵
|
|
void SUILocalSignWnd::SetLocalTitle( const char * pString, DWORD dwTime )
|
|
{
|
|
m_dwStartTime = dwTime;
|
|
SetAlphaClose( dwTime );
|
|
|
|
SetChildCaption( "static_area_title", pString );
|
|
|
|
if( pString != NULL && strlen(pString) > 0 )
|
|
{
|
|
//리사이즈
|
|
DWORD dwWidth = KTextPhrase::GetOneLineStringSize( pString );
|
|
|
|
KUIWnd * pBG = GetChild( "outframe" );
|
|
KUIWnd * pSign = GetChild( "static_area_title" );
|
|
|
|
|
|
if( pBG && pSign )
|
|
{
|
|
KRect bgRect = pBG->GetRect();
|
|
KRect signRect = pSign->GetRect();
|
|
|
|
int nHalfW = KUIWndManager::GetResolution().cx / 2;
|
|
|
|
if( dwWidth < 150 )
|
|
dwWidth = 150; //최소 사이즈 유지
|
|
|
|
signRect.left = nHalfW - (dwWidth / 2);
|
|
signRect.right = nHalfW + (dwWidth / 2);
|
|
|
|
dwWidth += c_nSignDecoX;
|
|
bgRect.left = nHalfW - (dwWidth / 2);
|
|
bgRect.right = nHalfW + (dwWidth / 2);
|
|
#ifdef _KUI_INVALIDATION
|
|
this->Resize( bgRect );
|
|
#endif
|
|
pBG->Resize( bgRect );
|
|
pSign->Resize( signRect );
|
|
|
|
pSign->MovePos( pBG->GetRect().left + (c_nSignDecoX/2), pSign->GetRect().top );
|
|
|
|
#ifdef _COUNTRY_ME_
|
|
pBG->ClipRect(bgRect);
|
|
// 중동한정으로 ClipRect 갱신 안해줘서 글자 짤리는 문제 해결하기 위함 by 정동섭
|
|
// 왜 한글버전엔 문제가 안 발생하지 -,-
|
|
signRect.left -= 50;
|
|
signRect.right += 0;
|
|
pSign->Resize( signRect );
|
|
pSign->ClipRect( signRect );
|
|
pSign->MovePos( pBG->GetRect().left + (c_nSignDecoX/2) - 25, pSign->GetRect().top );
|
|
#endif
|
|
|
|
#ifdef _KUI_INVALIDATION
|
|
this->MovePos( pBG->GetRect().left, pBG->GetRect().top );
|
|
#endif
|
|
pBG->SetShow( true );
|
|
pSign->SetShow( true );
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SetChildShow( "outframe" , false );
|
|
SetChildShow( "static_area_title", false );
|
|
}
|
|
}
|
|
|
|
bool SUILocalSignWnd::InitControls( KPoint kPos )
|
|
{
|
|
#ifdef _KUI_INVALIDATION
|
|
KUIControl * pBG = dynamicCast<KUIControl*>(GetChild( "outframe" ));
|
|
KUIControl * pSign = dynamicCast<KUIControl*>(GetChild( "static_area_title" ));
|
|
|
|
if( pBG ) this->AddPopupControl( pBG );
|
|
if( pSign ) this->AddPopupControl( pSign );
|
|
#endif
|
|
return SUIWnd::InitControls(kPos);
|
|
}
|
|
|
|
bool SUILocalSignWnd::InitData( bool bReload )
|
|
{
|
|
if( !bReload )
|
|
{ //리로드 일 경우
|
|
|
|
}
|
|
|
|
m_dwTime = 0;
|
|
m_dwStartTime = 0;
|
|
|
|
// SetChildShow( "outframe" , false );
|
|
// SetChildShow( "static_area_title", false );
|
|
|
|
return SUIWnd::InitData(bReload);
|
|
}
|
|
|
|
void SUILocalSignWnd::Process(DWORD dwTime)
|
|
{
|
|
if( m_dwStartTime )
|
|
{
|
|
DWORD dwLocalNameTime = dwTime-m_dwStartTime;
|
|
|
|
if( dwLocalNameTime > VIEW_TIME )
|
|
{
|
|
SetShow( false );
|
|
m_dwStartTime = 0;
|
|
}
|
|
else
|
|
{
|
|
float fTmRate = dwLocalNameTime / (float)VIEW_TIME;
|
|
float fAlpha = 1.0f;
|
|
|
|
if( fTmRate < 0.2f )
|
|
{
|
|
fAlpha = fTmRate / 0.2f;
|
|
}
|
|
else if( fTmRate < 0.5f )
|
|
{
|
|
fAlpha = 1.0f;
|
|
}
|
|
else
|
|
{
|
|
fAlpha = 1.0f - ( fTmRate - 0.5f ) * 2.0f;
|
|
}
|
|
|
|
// fAlpha = 1.0f - (float)(m_dwTime - m_dwLocalNameStartTime) / m_dwLocalNameDisplayTime;
|
|
ChangeAlpha(fAlpha);
|
|
|
|
//ChangeAlpha( 1.f - (float)(dwTime-m_dwStartTime)/VIEW_TIME );
|
|
}
|
|
}
|
|
}
|
|
|
|
#ifdef _KUI_INVALIDATION
|
|
// { [sonador]
|
|
void SUILocalSignWnd::Render( KViewportObject* pViewport, bool isFront )
|
|
{
|
|
bool bSavetofile = false;
|
|
if( m_bValidation == false )
|
|
{
|
|
bSavetofile = true;
|
|
}
|
|
|
|
KUIGenWnd::Render( pViewport, isFront );
|
|
|
|
if( bSavetofile )
|
|
{
|
|
//static int count = 0;
|
|
//std::string filename;
|
|
//XStringUtil::Format( filename, "xxxx%d", count++ );
|
|
//m_spRenderTarget->SaveToFile( filename.c_str() );
|
|
}
|
|
}
|
|
// }
|
|
#endif |