summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 1b674a0..a6af9d7 100644
--- a/init.lua
+++ b/init.lua
@@ -7,8 +7,10 @@ hud.air = {}
-- HUD item ids
local health_hud = {}
local health_hud_text = {}
+local health_hud_icon = {}
local air_hud = {}
local air_hud_text = {}
+local air_hud_icon = {}
-- default settings
@@ -53,6 +55,14 @@ local function custom_hud(player)
if minetest.setting_getbool("enable_damage") then
--health
+ health_hud_icon[name] = player:hud_add({
+ hud_elem_type = "image",
+ position = HUD_HEALTH_POS,
+ scale = { x = 1, y = 1 },
+ text = "hudbars_icon_health.png",
+ alignment = {x=-1,y=1},
+ offset = { x = HUD_HEALTH_OFFSET.x - 3, y = HUD_HEALTH_OFFSET.y },
+ })
player:hud_add({
hud_elem_type = "image",
position = HUD_HEALTH_POS,
@@ -80,6 +90,14 @@ local function custom_hud(player)
})
--air
+ air_hud_icon[name] = player:hud_add({
+ hud_elem_type = "image",
+ position = HUD_AIR_POS,
+ scale = { x = 1, y = 1 },
+ text = "hudbars_icon_breath.png",
+ alignment = {x=-1,y=1},
+ offset = { x = HUD_AIR_OFFSET.x - 3, y = HUD_AIR_OFFSET.y },
+ })
player:hud_add({
hud_elem_type = "image",
position = HUD_AIR_POS,