📄 mugongbase.cpp
字号:
// MugongBase.cpp: implementation of the CMugongBase class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MugongBase.h"
#include "./Interface/cFont.h"
#include "./Input/Mouse.h"
#include "interface/cScriptManager.h"
#include "SkillManager_client.h"
#include "ChatManager.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMugongBase::CMugongBase()
{
}
CMugongBase::~CMugongBase()
{
}
void CMugongBase::SetMugongBase(MUGONGBASE * mugong)
{
memcpy(&m_MugongBaseInfo, mugong, sizeof(MUGONGBASE));
SetExpPoint(mugong->ExpPoint);
}
void CMugongBase::Init(LONG x, LONG y, WORD wid, WORD hei, cImage * lowImage, cImage * highImage, LONG ID)
{
cIcon::Init(x,y,wid,hei,lowImage,ID);
m_type = WT_MUGONG;
if(highImage)
m_pHighLayerImage = *highImage;
cImage bimg,gimg;
cImageRect rect;
SetRect(&rect,1010,216,1011,226);
SCRIPTMGR->GetImage(0,&bimg,&rect); //basicimage
SetRect(&rect,1006,216,1007,226);
SCRIPTMGR->GetImage(0,&gimg,&rect); //guageimage
m_Guage.Init(x-1,y+42,40,6, &bimg);
cImageScale scale;
scale.x = 40;
scale.y = 0.6;
m_Guage.SetScale(&scale);
m_Guage.SetGuageImagePos(0,0);
m_Guage.SetValue(0);
m_Guage.SetPieceImage(&gimg);
m_Guage.SetGuageWidth(40);
m_Guage.SetGuagePieceWidth(1);
m_Guage.SetGuagePieceHeightScale(0.6);
m_dwFontColor = 0xffffffff;
}
void CMugongBase::Render()
{
// if(GetSung() == 0)
// SetAlpha(120);
// else
// SetAlpha(255);
cIcon::Render();
if(!m_pHighLayerImage.IsNull())
m_pHighLayerImage.RenderSprite( NULL, NULL, 0, &m_absPos, RGBA_MERGE(m_dwImageRGB, m_alpha * m_dwOptionAlpha / 100));
if(m_MugongBaseInfo.Sung > 0)
{
static char nums[3];
if(m_MugongBaseInfo.Sung == 12)
wsprintf(nums,"%s", CHATMGR->GetChatMsg(179));
else
wsprintf(nums,"%d", m_MugongBaseInfo.Sung);
RECT rect={(LONG)m_absPos.x+1, (LONG)m_absPos.y+28, 1,1};
CFONT_OBJ->RenderFont( 0, nums, strlen(nums), &rect, m_dwFontColor );
}
if(IsDepend())
{
BYTE Sung = GetSung();
if(Sung < 12 && Sung > 0)
{
m_Guage.SetAbsXY(m_absPos.x-1,m_absPos.y+39);
m_Guage.Render();
}
}
}
void CMugongBase::SetExpPoint(EXPTYPE point)
{
m_MugongBaseInfo.ExpPoint = point;
CSkillInfo* pSkillInfo = SKILLMGR->GetSkillInfo(GetItemIdx());
if(pSkillInfo == NULL)
return;
BYTE Sung = GetSung();
if(Sung != 12 && Sung != 0)
{
GUAGEVAL gval = point / (GUAGEVAL)pSkillInfo->GetNeedExp(Sung);
m_Guage.SetValue(gval);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -