1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix heart + bubble bar size on different texture packs

Add DPI support for statbar
Move heart+bubble bar to Lua HUD
Add statbar size (based upon an idea by blue42u)
Add support for customizing breath and statbar
This commit is contained in:
sapier 2014-04-28 23:41:27 +02:00
parent c80d67f48e
commit d3ee617f37
15 changed files with 325 additions and 51 deletions

View file

@ -2492,6 +2492,7 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
delete event.hudadd.align;
delete event.hudadd.offset;
delete event.hudadd.world_pos;
delete event.hudadd.size;
continue;
}
@ -2507,6 +2508,7 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
e->align = *event.hudadd.align;
e->offset = *event.hudadd.offset;
e->world_pos = *event.hudadd.world_pos;
e->size = *event.hudadd.size;
if (id == nhudelem)
player->hud.push_back(e);
@ -2520,6 +2522,7 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
delete event.hudadd.align;
delete event.hudadd.offset;
delete event.hudadd.world_pos;
delete event.hudadd.size;
}
else if (event.type == CE_HUDRM)
{
@ -2536,6 +2539,7 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
delete event.hudchange.v3fdata;
delete event.hudchange.v2fdata;
delete event.hudchange.sdata;
delete event.hudchange.v2s32data;
continue;
}
@ -2571,11 +2575,15 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
case HUD_STAT_WORLD_POS:
e->world_pos = *event.hudchange.v3fdata;
break;
case HUD_STAT_SIZE:
e->size = *event.hudchange.v2s32data;
break;
}
delete event.hudchange.v3fdata;
delete event.hudchange.v2fdata;
delete event.hudchange.sdata;
delete event.hudchange.v2s32data;
}
else if (event.type == CE_SET_SKY)
{
@ -3563,8 +3571,7 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
*/
if (show_hud)
{
hud.drawHotbar(client.getHP(), client.getPlayerItem(),
client.getBreath());
hud.drawHotbar(client.getPlayerItem());
}
/*