
Originally Posted by
Mila
Your mod for the HP bar is great. But it would be better if it shown by percentage, ie instead of showing HP / HP showing by % of life today... Just an idea, if you can implement would be great :)
This?

Enjoy:
mob_hp_bar.cpp
Code:
void CMob_HPBar::Draw()
{
if (this->MaxHP == 0) return;
float pHP = (this->HP * 100) / this->MaxHP;
if (pHP)
{
MU_DrawGUI(NEWUI_BAR_SWITCH01, (MAX_WIDTH / 2) - 80, 20, 160, 18);
MU_DrawColorButton(NEWUI_BAR_SWITCH02, (MAX_WIDTH / 2) - 75, 25, (150 * pHP) / 100, 8, 0, 0, MU_CreateColor(255, 0, 0, 150));
MU_SetColor(0xFF, 0xFF, 0xFF, 255);
MU_SetBGColor(0, 0, 0, 0);
char msg[100];
sprintf(msg, "%%%d", (int)pHP);
MU_OutText(310, 24, msg);
}
else
{
this->isDraw = false;
}
}