summaryrefslogtreecommitdiff
path: root/builtin.lua
diff options
context:
space:
mode:
Diffstat (limited to 'builtin.lua')
-rw-r--r--builtin.lua28
1 files changed, 23 insertions, 5 deletions
diff --git a/builtin.lua b/builtin.lua
index ea64992..057189c 100644
--- a/builtin.lua
+++ b/builtin.lua
@@ -1,3 +1,9 @@
+HUD_IW_MAX = 8
+HUD_IW_TICK = 0.4
+if minetest.is_singleplayer() == true then
+ HUD_IW_TICK = 0.2
+end
+
HUD_SB_SIZE = {x = 24, y = 24}
HUD_HEALTH_POS = {x = 0.5,y = 1}
@@ -9,6 +15,19 @@ HUD_HUNGER_OFFSET = {x = 15, y = -110}
HUD_ARMOR_POS = {x = 0.5, y = 1}
HUD_ARMOR_OFFSET = {x = -262, y = -110}
+-- Reorder everything when using ItemWeel
+hud.item_wheel = minetest.setting_getbool("hud_item_wheel")
+if hud.item_wheel then
+ HUD_HEALTH_POS = {x = 0.5,y = 1}
+ HUD_HEALTH_OFFSET = {x = -385, y = -77}
+ HUD_AIR_POS = {x = 0.5, y = 1}
+ HUD_AIR_OFFSET = {x = 150, y = -77}
+ HUD_HUNGER_POS = {x = 0.5, y = 1}
+ HUD_HUNGER_OFFSET = {x = 180, y = -44}
+ HUD_ARMOR_POS = {x = 0.5, y = 1}
+ HUD_ARMOR_OFFSET = {x = -415, y = -44}
+end
+
-- read hud.conf settings
hud.read_conf()
@@ -30,7 +49,7 @@ if damage_enabled then
size = HUD_SB_SIZE,
text = "hud_heart_fg.png",
number = 20,
- alignment = {x=-1,y=-1},
+ alignment = {x = -1, y = -1},
offset = HUD_HEALTH_OFFSET,
background = "hud_heart_bg.png",
events = {
@@ -49,7 +68,7 @@ if damage_enabled then
size = HUD_SB_SIZE,
text = "hud_air_fg.png",
number = 0,
- alignment = {x=-1,y=-1},
+ alignment = {x = -1, y = -1},
offset = HUD_AIR_OFFSET,
background = nil,
events = {
@@ -72,7 +91,7 @@ if damage_enabled then
size = HUD_SB_SIZE,
text = "hud_armor_fg.png",
number = 0,
- alignment = {x=-1,y=-1},
+ alignment = {x = -1, y = -1},
offset = HUD_ARMOR_OFFSET,
background = "hud_armor_bg.png",
autohide_bg = true,
@@ -85,10 +104,9 @@ if damage_enabled then
size = HUD_SB_SIZE,
text = "hud_hunger_fg.png",
number = 0,
- alignment = {x=-1,y=-1},
+ alignment = {x = -1, y = -1},
offset = HUD_HUNGER_OFFSET,
background = "hud_hunger_bg.png",
- --autohide_bg = true,
max = 0,
})
else