Minetest 5.10.0-dev
 
Loading...
Searching...
No Matches
hud.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
4Copyright (C) 2017 red-001 <red-001@outlook.ie>
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU Lesser General Public License as published by
8the Free Software Foundation; either version 2.1 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU Lesser General Public License for more details.
15
16You should have received a copy of the GNU Lesser General Public License along
17with this program; if not, write to the Free Software Foundation, Inc.,
1851 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#pragma once
22
24#include <string>
25#include "common/c_types.h"
26
27#define HUD_DIR_LEFT_RIGHT 0
28#define HUD_DIR_RIGHT_LEFT 1
29#define HUD_DIR_TOP_BOTTOM 2
30#define HUD_DIR_BOTTOM_TOP 3
31
32#define HUD_CORNER_UPPER 0
33#define HUD_CORNER_LOWER 1
34#define HUD_CORNER_CENTER 2
35
36#define HUD_STYLE_BOLD 1
37#define HUD_STYLE_ITALIC 2
38#define HUD_STYLE_MONO 4
39
40// Note that these visibility flags do not determine if the hud items are
41// actually drawn, but rather, whether to draw the item should the rest
42// of the game state permit it.
43#define HUD_FLAG_HOTBAR_VISIBLE (1 << 0)
44#define HUD_FLAG_HEALTHBAR_VISIBLE (1 << 1)
45#define HUD_FLAG_CROSSHAIR_VISIBLE (1 << 2)
46#define HUD_FLAG_WIELDITEM_VISIBLE (1 << 3)
47#define HUD_FLAG_BREATHBAR_VISIBLE (1 << 4)
48#define HUD_FLAG_MINIMAP_VISIBLE (1 << 5)
49#define HUD_FLAG_MINIMAP_RADAR_VISIBLE (1 << 6)
50#define HUD_FLAG_BASIC_DEBUG (1 << 7)
51#define HUD_FLAG_CHAT_VISIBLE (1 << 8)
52
53#define HUD_PARAM_HOTBAR_ITEMCOUNT 1
54#define HUD_PARAM_HOTBAR_IMAGE 2
55#define HUD_PARAM_HOTBAR_SELECTED_IMAGE 3
56
57#define HUD_HOTBAR_ITEMCOUNT_DEFAULT 8
58#define HUD_HOTBAR_ITEMCOUNT_MAX 32
59
60#define HOTBAR_IMAGE_SIZE 48
61
73
91
98
116
117extern const EnumString es_HudElementType[];
118extern const EnumString es_HudElementStat[];
119extern const EnumString es_HudBuiltinElement[];
120
121// Minimap stuff
122
129
const EnumString es_HudElementStat[]
Definition hud.cpp:37
const EnumString es_HudBuiltinElement[]
Definition hud.cpp:58
HudElementStat
Definition hud.h:74
@ HUD_STAT_SIZE
Definition hud.h:85
@ HUD_STAT_TEXT2
Definition hud.h:87
@ HUD_STAT_NUMBER
Definition hud.h:79
@ HUD_STAT_WORLD_POS
Definition hud.h:84
@ HUD_STAT_DIR
Definition hud.h:81
@ HUD_STAT_ITEM
Definition hud.h:80
@ HUD_STAT_NAME
Definition hud.h:76
@ HUD_STAT_STYLE
Definition hud.h:88
@ HUD_STAT_TEXT
Definition hud.h:78
@ HudElementStat_END
Definition hud.h:89
@ HUD_STAT_OFFSET
Definition hud.h:83
@ HUD_STAT_SCALE
Definition hud.h:77
@ HUD_STAT_ALIGN
Definition hud.h:82
@ HUD_STAT_Z_INDEX
Definition hud.h:86
@ HUD_STAT_POS
Definition hud.h:75
HudCompassDir
Definition hud.h:92
@ HUD_COMPASS_ROTATE_REVERSE
Definition hud.h:94
@ HUD_COMPASS_TRANSLATE_REVERSE
Definition hud.h:96
@ HUD_COMPASS_TRANSLATE
Definition hud.h:95
@ HUD_COMPASS_ROTATE
Definition hud.h:93
const EnumString es_HudElementType[]
Definition hud.cpp:23
MinimapType
Definition hud.h:123
@ MINIMAP_TYPE_SURFACE
Definition hud.h:125
@ MINIMAP_TYPE_RADAR
Definition hud.h:126
@ MINIMAP_TYPE_OFF
Definition hud.h:124
@ MINIMAP_TYPE_TEXTURE
Definition hud.h:127
HudElementType
Definition hud.h:62
@ HUD_ELEM_IMAGE_WAYPOINT
Definition hud.h:68
@ HUD_ELEM_TEXT
Definition hud.h:64
@ HUD_ELEM_MINIMAP
Definition hud.h:70
@ HUD_ELEM_STATBAR
Definition hud.h:65
@ HUD_ELEM_INVENTORY
Definition hud.h:66
@ HUD_ELEM_HOTBAR
Definition hud.h:71
@ HUD_ELEM_IMAGE
Definition hud.h:63
@ HUD_ELEM_COMPASS
Definition hud.h:69
@ HUD_ELEM_WAYPOINT
Definition hud.h:67
core::vector2d< s32 > v2s32
Definition irr_v2d.h:28
core::vector2d< f32 > v2f
Definition irr_v2d.h:26
core::vector3df v3f
Definition irr_v3d.h:26
Definition c_types.h:31
Definition hud.h:99
u32 item
Definition hud.h:106
s16 z_index
Definition hud.h:112
std::string text
Definition hud.h:104
u32 style
Definition hud.h:114
v2f scale
Definition hud.h:103
v2s32 size
Definition hud.h:111
std::string text2
Definition hud.h:113
v2f pos
Definition hud.h:101
v3f world_pos
Definition hud.h:110
std::string name
Definition hud.h:102
HudElementType type
Definition hud.h:100
u32 dir
Definition hud.h:107
v2f align
Definition hud.h:108
v2f offset
Definition hud.h:109
u32 number
Definition hud.h:105