summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2015-02-04 04:10:11 +0100
committerWuzzy <almikes@aol.com>2015-02-04 04:10:11 +0100
commit1a89bda932ae35f482ba7352568dc2be8d996001 (patch)
tree22bf91968c38e7ee7e6934972a9ec515d093ff0c
parent4776027d184955458024fd4d27600448e34fac7c (diff)
Add icons to bars
-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,