aboutsummaryrefslogtreecommitdiff
path: root/src/hud.cpp
diff options
context:
space:
mode:
authorDiego Martínez <kaeza@users.sf.net>2013-04-24 07:52:46 -0300
committerPerttu Ahola <celeron55@gmail.com>2013-04-24 17:28:00 +0300
commite703c5b81f87550e636ebb1ebb1eb64027a44687 (patch)
treee79287f264f46aa1789c30afff0569f92296ca87 /src/hud.cpp
parent33dd267fd9da1a89b44cd6eab590aadab0f4e335 (diff)
downloadminetest-e703c5b81f87550e636ebb1ebb1eb64027a44687.tar.gz
minetest-e703c5b81f87550e636ebb1ebb1eb64027a44687.tar.bz2
minetest-e703c5b81f87550e636ebb1ebb1eb64027a44687.zip
Added support to disable built-in HUD elements
Diffstat (limited to 'src/hud.cpp')
-rw-r--r--src/hud.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/hud.cpp b/src/hud.cpp
index 9db92db52..8daadad37 100644
--- a/src/hud.cpp
+++ b/src/hud.cpp
@@ -277,7 +277,7 @@ void Hud::drawStatbar(v2s32 pos, u16 corner, u16 drawdir, std::string texture, s
}
-void Hud::drawHotbar(v2s32 centerlowerpos, s32 halfheartcount, u16 playeritem) {
+void Hud::drawHotbar(v2s32 centerlowerpos, s32 halfheartcount, u16 playeritem, u32 flags) {
InventoryList *mainlist = inventory->getList("main");
if (mainlist == NULL) {
errorstream << "draw_hotbar(): mainlist == NULL" << std::endl;
@@ -288,8 +288,10 @@ void Hud::drawHotbar(v2s32 centerlowerpos, s32 halfheartcount, u16 playeritem) {
s32 width = hotbar_itemcount * (hotbar_imagesize + padding * 2);
v2s32 pos = centerlowerpos - v2s32(width / 2, hotbar_imagesize + padding * 2);
- drawItem(pos, hotbar_imagesize, hotbar_itemcount, mainlist, playeritem + 1, 0);
- drawStatbar(pos - v2s32(0, 4), HUD_CORNER_LOWER, HUD_DIR_LEFT_RIGHT,
+ if (flags & HUD_DRAW_HOTBAR)
+ drawItem(pos, hotbar_imagesize, hotbar_itemcount, mainlist, playeritem + 1, 0);
+ if (flags & HUD_DRAW_HEALTHBAR)
+ drawStatbar(pos - v2s32(0, 4), HUD_CORNER_LOWER, HUD_DIR_LEFT_RIGHT,
"heart.png", halfheartcount, v2s32(0, 0));
}