From d3ee617f37984b380ebe32cd37ef1cda66d96c48 Mon Sep 17 00:00:00 2001 From: sapier Date: Mon, 28 Apr 2014 23:41:27 +0200 Subject: 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 --- src/hud.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/hud.h') diff --git a/src/hud.h b/src/hud.h index 1ace6646f..9969fce73 100644 --- a/src/hud.h +++ b/src/hud.h @@ -66,7 +66,8 @@ enum HudElementStat { HUD_STAT_DIR, HUD_STAT_ALIGN, HUD_STAT_OFFSET, - HUD_STAT_WORLD_POS + HUD_STAT_WORLD_POS, + HUD_STAT_SIZE }; struct HudElement { @@ -81,6 +82,7 @@ struct HudElement { v2f align; v2f offset; v3f world_pos; + v2s32 size; }; #ifndef SERVER @@ -122,14 +124,14 @@ public: u32 text_height, IGameDef *gamedef, LocalPlayer *player, Inventory *inventory); - void drawHotbar(s32 halfheartcount, u16 playeritem, s32 breath); + void drawHotbar(u16 playeritem); void resizeHotbar(); void drawCrosshair(); void drawSelectionBoxes(std::vector &hilightboxes); void drawLuaElements(v3s16 camera_offset); private: - void drawStatbar(v2s32 pos, u16 corner, u16 drawdir, - std::string texture, s32 count, v2s32 offset); + void drawStatbar(v2s32 pos, u16 corner, u16 drawdir, std::string texture, + s32 count, v2s32 offset, v2s32 size=v2s32()); void drawItems(v2s32 upperleftpos, s32 itemcount, s32 offset, InventoryList *mainlist, u16 selectitem, u16 direction); -- cgit v1.2.3