X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fhud.h;h=2e6838eb108288e4b67289c3ff9bcb7e5808adfe;hb=718bcafd5174690a7731f9b04873e9a09f7a47b7;hp=3897a850c332fba79a005e82d0558a4117e67202;hpb=1838a3fd696782b1733a435bbb25accf3e40d1f3;p=minetest.git diff --git a/src/hud.h b/src/hud.h index 3897a850c..2e6838eb1 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 @@ -101,8 +103,6 @@ class Hud { video::IVideoDriver *driver; scene::ISceneManager* smgr; gui::IGUIEnvironment *guienv; - gui::IGUIFont *font; - u32 text_height; IGameDef *gamedef; LocalPlayer *player; Inventory *inventory; @@ -115,20 +115,20 @@ class Hud { bool use_hotbar_image; std::string hotbar_selected_image; bool use_hotbar_selected_image; + v3s16 camera_offset; Hud(video::IVideoDriver *driver,scene::ISceneManager* smgr, - gui::IGUIEnvironment* guienv, gui::IGUIFont *font, - u32 text_height, IGameDef *gamedef, - LocalPlayer *player, Inventory *inventory); + gui::IGUIEnvironment* guienv, 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(); + 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);