mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
feat: re-enable boss health bar
This commit is contained in:
parent
177ed6d176
commit
04b76893ca
|
|
@ -365,7 +365,9 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
||||||
|
|
||||||
// if (false) //(true)
|
// if (false) //(true)
|
||||||
// {
|
// {
|
||||||
// renderBossHealth();
|
#ifdef ENABLE_JAVA_GUIS
|
||||||
|
renderBossHealth();
|
||||||
|
#endif
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
@ -1028,39 +1030,39 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Moved to the xui base scene
|
// Moved to the xui base scene
|
||||||
// void Gui::renderBossHealth(void)
|
void Gui::renderBossHealth(void)
|
||||||
// {
|
{
|
||||||
// if (EnderDragonRenderer::bossInstance == NULL) return;
|
if (EnderDragonRenderer::bossInstance == NULL) return;
|
||||||
//
|
|
||||||
// std::shared_ptr<EnderDragon> boss = EnderDragonRenderer::bossInstance;
|
std::shared_ptr<EnderDragon> boss = EnderDragonRenderer::bossInstance;
|
||||||
// EnderDragonRenderer::bossInstance = NULL;
|
EnderDragonRenderer::bossInstance = NULL;
|
||||||
//
|
|
||||||
// Minecraft *pMinecraft=Minecraft::GetInstance();
|
Minecraft *pMinecraft=Minecraft::GetInstance();
|
||||||
//
|
|
||||||
// Font *font = pMinecraft->font;
|
Font *font = pMinecraft->font;
|
||||||
//
|
|
||||||
// ScreenSizeCalculator ssc(pMinecraft->options, pMinecraft->width_phys, pMinecraft->height_phys);
|
ScreenSizeCalculator ssc(pMinecraft->options, pMinecraft->width_phys, pMinecraft->height_phys);
|
||||||
// int screenWidth = ssc.getWidth();
|
int screenWidth = ssc.getWidth();
|
||||||
//
|
|
||||||
// int w = 182;
|
int w = 182;
|
||||||
// int xLeft = screenWidth / 2 - w / 2;
|
int xLeft = screenWidth / 2 - w / 2;
|
||||||
//
|
|
||||||
// int progress = (int) (boss->getSynchedHealth() / (float) boss->getMaxHealth() * (float) (w + 1));
|
int progress = (int) (boss->getSynchedHealth() / (float) boss->getMaxHealth() * (float) (w + 1));
|
||||||
//
|
|
||||||
// int yo = 12;
|
int yo = 12;
|
||||||
// blit(xLeft, yo, 0, 74, w, 5);
|
blit(xLeft, yo, 0, 74, w, 5);
|
||||||
// blit(xLeft, yo, 0, 74, w, 5);
|
blit(xLeft, yo, 0, 74, w, 5);
|
||||||
// if (progress > 0)
|
if (progress > 0)
|
||||||
// {
|
{
|
||||||
// blit(xLeft, yo, 0, 79, progress, 5);
|
blit(xLeft, yo, 0, 79, progress, 5);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// std::wstring msg = L"Boss health - NON LOCALISED";
|
std::wstring msg = L"Boss health"/*L"Boss health - NON LOCALISED"*/;
|
||||||
// font->drawShadow(msg, screenWidth / 2 - font->width(msg) / 2, yo - 10, 0xff00ff);
|
font->drawShadow(msg, screenWidth / 2 - font->width(msg) / 2, yo - 10, 0xff00ff);
|
||||||
// glColor4f(1, 1, 1, 1);
|
glColor4f(1, 1, 1, 1);
|
||||||
// glBindTexture(GL_TEXTURE_2D, pMinecraft->textures->loadTexture(TN_GUI_ICONS) );//"/gui/icons.png"));
|
glBindTexture(GL_TEXTURE_2D, pMinecraft->textures->loadTexture(TN_GUI_ICONS) );//"/gui/icons.png"));
|
||||||
//
|
|
||||||
// }
|
}
|
||||||
|
|
||||||
void Gui::renderPumpkin(int w, int h)
|
void Gui::renderPumpkin(int w, int h)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public:
|
||||||
float tbr;
|
float tbr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//void renderBossHealth(void);
|
void renderBossHealth(void);
|
||||||
void renderPumpkin(int w, int h);
|
void renderPumpkin(int w, int h);
|
||||||
void renderVignette(float br, int w, int h);
|
void renderVignette(float br, int w, int h);
|
||||||
void renderTp(float br, int w, int h);
|
void renderTp(float br, int w, int h);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue