-inline u32 hud_get_free_id(Player *player) {
- size_t size = player->hud.size();
- for (size_t i = 0; i != size; i++) {
- if (!player->hud[i])
- return i;
- }
- return size;
-}
-
-#ifndef SERVER
-
-#include <IGUIFont.h>
-
-#include "gamedef.h"
-#include "inventory.h"
-#include "localplayer.h"
-
-class Hud {
-public:
- video::IVideoDriver *driver;
- gui::IGUIEnvironment *guienv;
- gui::IGUIFont *font;
- u32 text_height;
- IGameDef *gamedef;
- LocalPlayer *player;
- Inventory *inventory;
- ITextureSource *tsrc;
-
- v2u32 screensize;
- v2s32 displaycenter;
- s32 hotbar_imagesize;
-
- video::SColor crosshair_argb;
- video::SColor selectionbox_argb;
- bool use_crosshair_image;
-
- Hud(video::IVideoDriver *driver, gui::IGUIEnvironment* guienv,
- gui::IGUIFont *font, u32 text_height, IGameDef *gamedef,
- LocalPlayer *player, Inventory *inventory);
-
- void drawItem(v2s32 upperleftpos, s32 imgsize, s32 itemcount,
- InventoryList *mainlist, u16 selectitem, u16 direction);
- void drawLuaElements();
- 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 drawCrosshair();
- void drawSelectionBoxes(std::vector<aabb3f> &hilightboxes);
-};