⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mpguagedialog.cpp

📁 墨香最新私服
💻 CPP
字号:
// MPGuageDialog.cpp: implementation of the CMPGuageDialog class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MPGuageDialog.h"
#include "./ObjectGuagen.h"
#include "WindowIDEnum.h"
#include "./interface/cstatic.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CMPGuageDialog::CMPGuageDialog()
{
	m_type = WT_MPGUAGEDLG;
}

CMPGuageDialog::~CMPGuageDialog()
{

}

void CMPGuageDialog::Linking()
{
	m_ExpGuage = (CObjectGuagen *)GetWindowForID(MP_GEXPGUAGE);
	m_Time = (cStatic *)GetWindowForID(MP_GTIME);
	m_ExpPercent = (cStatic *)GetWindowForID(MP_GEXPERCENT);
}

void CMPGuageDialog::SetExpGuage(float Percent)
{
	m_ExpGuage->SetValue(Percent, 0);
	char temp[5];
	sprintf(temp,"%4.2f%%",Percent*100);
	m_ExpPercent->SetStaticText(temp);
}

void CMPGuageDialog::SetTime(DWORD RemainTime)
{
	char buf[16];
	if(RemainTime < 30000)
		m_Time->SetFGColor(RGB_HALF(255, 0, 0));
	sprintf(buf, "%02d:%02d", RemainTime/60000, (RemainTime%60000)/1000);
	m_Time->SetStaticText(buf);
}

void CMPGuageDialog::SetEventMapTimer( DWORD RemainTime, BYTE bFlag )
{
	char buf[16];
	switch( bFlag )
	{
	case 0:		//ready
		m_Time->SetFGColor( RGB_HALF(0, 0, 255) );
		break;
	case 1:
		{
			if( RemainTime < 30000 )
				m_Time->SetFGColor(RGB_HALF(255, 0, 0));
		}
		break;
	case 2:
		m_Time->SetFGColor( RGB_HALF(0, 0, 255) );
		break;
	}

	sprintf( buf, "%02d:%02d", RemainTime/60000, (RemainTime%60000)/1000 );
	m_Time->SetStaticText( buf );
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -