diff options
Diffstat (limited to 'src/hud.h')
-rw-r--r-- | src/hud.h | 27 |
1 files changed, 17 insertions, 10 deletions
@@ -45,6 +45,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #define HUD_HOTBAR_ITEMCOUNT_DEFAULT 8 #define HUD_HOTBAR_ITEMCOUNT_MAX 23 + +#define HOTBAR_IMAGE_SIZE 48 + enum HudElementType { HUD_ELEM_IMAGE = 0, HUD_ELEM_TEXT = 1, @@ -105,10 +108,6 @@ public: Inventory *inventory; ITextureSource *tsrc; - v2u32 screensize; - v2s32 displaycenter; - s32 hotbar_imagesize; - video::SColor crosshair_argb; video::SColor selectionbox_argb; bool use_crosshair_image; @@ -122,17 +121,25 @@ public: u32 text_height, IGameDef *gamedef, LocalPlayer *player, Inventory *inventory); - void drawItem(v2s32 upperleftpos, s32 imgsize, s32 itemcount, - InventoryList *mainlist, u16 selectitem, u16 direction); + void drawHotbar(s32 halfheartcount, u16 playeritem, s32 breath); + void resizeHotbar(); + void drawCrosshair(); + void drawSelectionBoxes(std::vector<aabb3f> &hilightboxes); void drawLuaElements(); +private: void drawStatbar(v2s32 pos, u16 corner, u16 drawdir, std::string texture, s32 count, v2s32 offset); - void drawHotbar(v2s32 centerlowerpos, s32 halfheartcount, u16 playeritem, s32 breath); - void resizeHotbar(); + void drawItems(v2s32 upperleftpos, s32 itemcount, s32 offset, + InventoryList *mainlist, u16 selectitem, u16 direction); + + void drawItem(const ItemStack &item, const core::rect<s32>& rect, bool selected); - void drawCrosshair(); - void drawSelectionBoxes(std::vector<aabb3f> &hilightboxes); + v2u32 m_screensize; + v2s32 m_displaycenter; + s32 m_hotbar_imagesize; + s32 m_padding; + video::SColor hbar_colors[4]; }; void drawItemStack(video::IVideoDriver *driver, |