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

New HUD element - waypoint.

This commit is contained in:
RealBadAngel 2014-01-26 21:31:59 +01:00
parent 3f0ee5d680
commit 21f1bec724
8 changed files with 85 additions and 9 deletions

View file

@ -49,7 +49,8 @@ enum HudElementType {
HUD_ELEM_IMAGE = 0,
HUD_ELEM_TEXT = 1,
HUD_ELEM_STATBAR = 2,
HUD_ELEM_INVENTORY = 3
HUD_ELEM_INVENTORY = 3,
HUD_ELEM_WAYPOINT = 4,
};
enum HudElementStat {
@ -61,7 +62,8 @@ enum HudElementStat {
HUD_STAT_ITEM,
HUD_STAT_DIR,
HUD_STAT_ALIGN,
HUD_STAT_OFFSET
HUD_STAT_OFFSET,
HUD_STAT_WORLD_POS
};
struct HudElement {
@ -75,6 +77,7 @@ struct HudElement {
u32 dir;
v2f align;
v2f offset;
v3f world_pos;
};
#ifndef SERVER
@ -93,6 +96,7 @@ struct ItemStack;
class Hud {
public:
video::IVideoDriver *driver;
scene::ISceneManager* smgr;
gui::IGUIEnvironment *guienv;
gui::IGUIFont *font;
u32 text_height;
@ -113,8 +117,9 @@ public:
std::string hotbar_selected_image;
bool use_hotbar_selected_image;
Hud(video::IVideoDriver *driver, gui::IGUIEnvironment* guienv,
gui::IGUIFont *font, u32 text_height, IGameDef *gamedef,
Hud(video::IVideoDriver *driver,scene::ISceneManager* smgr,
gui::IGUIEnvironment* guienv, gui::IGUIFont *font,
u32 text_height, IGameDef *gamedef,
LocalPlayer *player, Inventory *inventory);
void drawItem(v2s32 upperleftpos, s32 imgsize, s32 itemcount,