Files
Leviathan/Client/Game/game/Interface/RaidSiege/SUIRaidSiegeProgressRaidWnd.cpp
T
2026-06-01 12:46:52 +02:00

99 lines
2.2 KiB
C++

/// 2011.10.12 - prodongi
#include "stdafx.h"
#include "SUIRaidSiegeProgressRaidWnd.h"
#include "KUIControlStatic.h"
#include "SGameManager.h"
#include <toolkit/XStringUtil.h>
#include "SGameOption.h"
SUIRaidSiegeProgressRaidWnd::SUIRaidSiegeProgressRaidWnd(SGameManager* pGameManager) : SUIRaidSiegeProgressBaseWnd(pGameManager),
m_progressTime(0),
m_wndTimer(NULL),
m_start(false)
{
}
SUIRaidSiegeProgressRaidWnd::~SUIRaidSiegeProgressRaidWnd()
{
}
void SUIRaidSiegeProgressRaidWnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
{
switch (nMessage)
{
case KUI_MESSAGE::KGENWND_MOVE:
{
LimitMoveWnd();
}
break;
}
SUIWnd::PumpUpMessage(lpszControlID, nMessage, lparam, wparam);
}
void SUIRaidSiegeProgressRaidWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
{
}
bool SUIRaidSiegeProgressRaidWnd::InitControls( KPoint kPos )
{
m_wndTimer = dynamicCast<KUIControlStatic*>(GetChild("time_text_01"));
SetCustomMovingRect(GetRect());
addOpacityList();
return true;
}
void SUIRaidSiegeProgressRaidWnd::addOpacityList()
{
m_opacityChecker.addChild(this, "titlebar");
m_opacityChecker.addChild(this, "titlebar_deco");
m_opacityChecker.addChild(this, "titlebar_text");
m_opacityChecker.addChild(this, "outframe_01");
m_opacityChecker.addChild(this, "mark_raid_time_01");
}
void SUIRaidSiegeProgressRaidWnd::Process(DWORD dwTime)
{
SUIWnd::Process(dwTime);
DWORD elapsedtime = 0;
if (m_time)
elapsedtime = dwTime - m_time;
m_time = dwTime;
updateProgressTime(elapsedtime);
m_opacityChecker.update(elapsedtime, m_mouseX, m_mouseY, this);
}
void SUIRaidSiegeProgressRaidWnd::start(AR_TIME raidTime)
{
m_start = true;
m_progressTime = raidTime;
}
void SUIRaidSiegeProgressRaidWnd::end()
{
m_start = false;
}
void SUIRaidSiegeProgressRaidWnd::updateProgressTime(DWORD elapsedtime)
{
if (!m_start)
return ;
m_progressTime += elapsedtime;
DWORD t = m_progressTime/1000;
DWORD s = t%60;
DWORD m = (t/60)%60;
DWORD h = t/3600;
std::string strT;
XStringUtil::Format(strT, "<font:font_01><size:9><#ba1414><b><right>'%02d:%02d:%02d", h, m, s);
m_wndTimer->SetCaption(strT.c_str());
}