📄 bossmonsterguagedlg.cpp
字号:
// BossMonsterGuageDlg.cpp: implementation of the CBossMonsterGuageDlg class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "BossMonsterGuageDlg.h"
#include "WindowIDEnum.h"
#include "./Interface/cStatic.h"
#include "ObjectGuagen.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CBossMonsterGuageDlg::CBossMonsterGuageDlg()
{
m_pName = NULL;
m_pLifeText = NULL;
m_pLifeGuage = NULL;
m_pShieldText = NULL;
m_pShieldGuage = NULL;
m_type = WT_BOSSMONSTERGUAGEDLG;
}
CBossMonsterGuageDlg::~CBossMonsterGuageDlg()
{
}
void CBossMonsterGuageDlg::Linking()
{
m_pName = (cStatic *)GetWindowForID(CG_BOSSMONSTERGUAGENAME);
m_pLifeText = (cStatic *)GetWindowForID(CG_BOSSMONSTERGUAGELIFETEXT);
m_pLifeGuage = (CObjectGuagen *)GetWindowForID(CG_BOSSMONSTERGUAGELIFE);
// m_pShieldText = (cStatic *)GetWindowForID(CG_BOSSMONSTERGUAGESHIELDTEXT);
m_pShieldGuage = (CObjectGuagen *)GetWindowForID(CG_BOSSMONSTERGUAGESHIELD);
}
void CBossMonsterGuageDlg::SetMonsterName( char * szMonsterName )
{
if( m_pName )
m_pName->SetStaticText(szMonsterName);
}
void CBossMonsterGuageDlg::SetMonsterLife( DWORD curVal, DWORD maxVal )
{
ASSERT(maxVal>0);
char szValue[50];
sprintf( szValue, "%d / %d", curVal, maxVal );
if( m_pLifeText )
{
m_pLifeText->SetStaticText(szValue);
}
if( m_pLifeGuage )
{
m_pLifeGuage->SetValue((float)curVal/(float)maxVal, (1300/maxVal)*curVal);
}
}
void CBossMonsterGuageDlg::SetMonsterShield( DWORD curVal, DWORD maxVal )
{
ASSERT(maxVal>0);
char szValue[50];
sprintf( szValue, "%d / %d", curVal, maxVal );
if( m_pShieldText )
{
// m_pShieldText->SetStaticText(szValue);
}
if( m_pShieldGuage )
{
m_pShieldGuage->SetValue((float)curVal/(float)maxVal, (1300/maxVal)*curVal);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -