Add icons to bars

This commit is contained in:
Wuzzy 2015-02-04 04:10:11 +01:00
parent 4776027d18
commit 1a89bda932

@ -7,8 +7,10 @@ hud.air = {}
-- HUD item ids -- HUD item ids
local health_hud = {} local health_hud = {}
local health_hud_text = {} local health_hud_text = {}
local health_hud_icon = {}
local air_hud = {} local air_hud = {}
local air_hud_text = {} local air_hud_text = {}
local air_hud_icon = {}
-- default settings -- default settings
@ -53,6 +55,14 @@ local function custom_hud(player)
if minetest.setting_getbool("enable_damage") then if minetest.setting_getbool("enable_damage") then
--health --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({ player:hud_add({
hud_elem_type = "image", hud_elem_type = "image",
position = HUD_HEALTH_POS, position = HUD_HEALTH_POS,
@ -80,6 +90,14 @@ local function custom_hud(player)
}) })
--air --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({ player:hud_add({
hud_elem_type = "image", hud_elem_type = "image",
position = HUD_AIR_POS, position = HUD_AIR_POS,