Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
hud.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
4// Copyright (C) 2017 red-001 <red-001@outlook.ie>
5
6#pragma once
7
9#include <string>
10#include "common/c_types.h"
11
12#define HUD_DIR_LEFT_RIGHT 0
13#define HUD_DIR_RIGHT_LEFT 1
14#define HUD_DIR_TOP_BOTTOM 2
15#define HUD_DIR_BOTTOM_TOP 3
16
17#define HUD_CORNER_UPPER 0
18#define HUD_CORNER_LOWER 1
19#define HUD_CORNER_CENTER 2
20
21#define HUD_STYLE_BOLD 1
22#define HUD_STYLE_ITALIC 2
23#define HUD_STYLE_MONO 4
24
25// Note that these visibility flags do not determine if the hud items are
26// actually drawn, but rather, whether to draw the item should the rest
27// of the game state permit it.
28#define HUD_FLAG_HOTBAR_VISIBLE (1 << 0)
29#define HUD_FLAG_HEALTHBAR_VISIBLE (1 << 1)
30#define HUD_FLAG_CROSSHAIR_VISIBLE (1 << 2)
31#define HUD_FLAG_WIELDITEM_VISIBLE (1 << 3)
32#define HUD_FLAG_BREATHBAR_VISIBLE (1 << 4)
33#define HUD_FLAG_MINIMAP_VISIBLE (1 << 5)
34#define HUD_FLAG_MINIMAP_RADAR_VISIBLE (1 << 6)
35#define HUD_FLAG_BASIC_DEBUG (1 << 7)
36#define HUD_FLAG_CHAT_VISIBLE (1 << 8)
37
38#define HUD_PARAM_HOTBAR_ITEMCOUNT 1
39#define HUD_PARAM_HOTBAR_IMAGE 2
40#define HUD_PARAM_HOTBAR_SELECTED_IMAGE 3
41
42#define HUD_HOTBAR_ITEMCOUNT_DEFAULT 8
43#define HUD_HOTBAR_ITEMCOUNT_MAX 32
44
45#define HOTBAR_IMAGE_SIZE 48
46
58
76
83
84struct HudElement {
87 std::string name;
89 std::string text;
90 u32 number;
91 u32 item;
92 u32 dir;
97 s16 z_index = 0;
98 std::string text2;
99 u32 style;
100};
101
102extern const EnumString es_HudElementType[];
103extern const EnumString es_HudElementStat[];
104extern const EnumString es_HudBuiltinElement[];
105
106// Minimap stuff
107
114
const EnumString es_HudElementStat[]
Definition hud.cpp:22
const EnumString es_HudBuiltinElement[]
Definition hud.cpp:43
HudElementStat
Definition hud.h:59
@ HUD_STAT_SIZE
Definition hud.h:70
@ HUD_STAT_TEXT2
Definition hud.h:72
@ HUD_STAT_NUMBER
Definition hud.h:64
@ HUD_STAT_WORLD_POS
Definition hud.h:69
@ HUD_STAT_DIR
Definition hud.h:66
@ HUD_STAT_ITEM
Definition hud.h:65
@ HUD_STAT_NAME
Definition hud.h:61
@ HUD_STAT_STYLE
Definition hud.h:73
@ HUD_STAT_TEXT
Definition hud.h:63
@ HudElementStat_END
Definition hud.h:74
@ HUD_STAT_OFFSET
Definition hud.h:68
@ HUD_STAT_SCALE
Definition hud.h:62
@ HUD_STAT_ALIGN
Definition hud.h:67
@ HUD_STAT_Z_INDEX
Definition hud.h:71
@ HUD_STAT_POS
Definition hud.h:60
HudCompassDir
Definition hud.h:77
@ HUD_COMPASS_ROTATE_REVERSE
Definition hud.h:79
@ HUD_COMPASS_TRANSLATE_REVERSE
Definition hud.h:81
@ HUD_COMPASS_TRANSLATE
Definition hud.h:80
@ HUD_COMPASS_ROTATE
Definition hud.h:78
const EnumString es_HudElementType[]
Definition hud.cpp:8
MinimapType
Definition hud.h:108
@ MINIMAP_TYPE_SURFACE
Definition hud.h:110
@ MINIMAP_TYPE_RADAR
Definition hud.h:111
@ MINIMAP_TYPE_OFF
Definition hud.h:109
@ MINIMAP_TYPE_TEXTURE
Definition hud.h:112
HudElementType
Definition hud.h:47
@ HUD_ELEM_IMAGE_WAYPOINT
Definition hud.h:53
@ HUD_ELEM_TEXT
Definition hud.h:49
@ HUD_ELEM_MINIMAP
Definition hud.h:55
@ HUD_ELEM_STATBAR
Definition hud.h:50
@ HUD_ELEM_INVENTORY
Definition hud.h:51
@ HUD_ELEM_HOTBAR
Definition hud.h:56
@ HUD_ELEM_IMAGE
Definition hud.h:48
@ HUD_ELEM_COMPASS
Definition hud.h:54
@ HUD_ELEM_WAYPOINT
Definition hud.h:52
core::vector2d< s32 > v2s32
Definition irr_v2d.h:13
core::vector2d< f32 > v2f
Definition irr_v2d.h:11
core::vector3df v3f
Definition irr_v3d.h:11
Definition c_types.h:16
Definition hud.h:84
u32 item
Definition hud.h:91
s16 z_index
Definition hud.h:97
std::string text
Definition hud.h:89
u32 style
Definition hud.h:99
v2f scale
Definition hud.h:88
v2s32 size
Definition hud.h:96
std::string text2
Definition hud.h:98
v2f pos
Definition hud.h:86
v3f world_pos
Definition hud.h:95
std::string name
Definition hud.h:87
HudElementType type
Definition hud.h:85
u32 dir
Definition hud.h:92
v2f align
Definition hud.h:93
v2f offset
Definition hud.h:94
u32 number
Definition hud.h:90