diff options
Diffstat (limited to 'builtin.lua')
-rw-r--r-- | builtin.lua | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/builtin.lua b/builtin.lua index 057189c..dfdb707 100644 --- a/builtin.lua +++ b/builtin.lua @@ -44,70 +44,70 @@ end if damage_enabled then hud.register("health", { - hud_elem_type = "statbar", - position = HUD_HEALTH_POS, - size = HUD_SB_SIZE, - text = "hud_heart_fg.png", - number = 20, - alignment = {x = -1, y = -1}, - offset = HUD_HEALTH_OFFSET, - background = "hud_heart_bg.png", - events = { - { - type = "damage", - func = function(player) - hud.change_item(player, "health", {number = player:get_hp()}) - end - } - }, + hud_elem_type = "statbar", + position = HUD_HEALTH_POS, + size = HUD_SB_SIZE, + text = "hud_heart_fg.png", + number = 20, + alignment = {x = -1, y = -1}, + offset = HUD_HEALTH_OFFSET, + background = "hud_heart_bg.png", + events = { + { + type = "damage", + func = function(player) + hud.change_item(player, "health", {number = player:get_hp()}) + end + } + }, }) hud.register("air", { - hud_elem_type = "statbar", - position = HUD_AIR_POS, - size = HUD_SB_SIZE, - text = "hud_air_fg.png", - number = 0, - alignment = {x = -1, y = -1}, - offset = HUD_AIR_OFFSET, - background = nil, - events = { - { - type = "breath", - func = function(player) - local air = player:get_breath() - if air > 10 then - air = 0 + hud_elem_type = "statbar", + position = HUD_AIR_POS, + size = HUD_SB_SIZE, + text = "hud_air_fg.png", + number = 0, + alignment = {x = -1, y = -1}, + offset = HUD_AIR_OFFSET, + background = nil, + events = { + { + type = "breath", + func = function(player) + local air = player:get_breath() + if air > 10 then + air = 0 + end + hud.change_item(player, "air", {number = air * 2}) end - hud.change_item(player, "air", {number = air * 2}) - end - } - }, + } + }, }) hud.register("armor", { - hud_elem_type = "statbar", - position = HUD_ARMOR_POS, - size = HUD_SB_SIZE, - text = "hud_armor_fg.png", - number = 0, - alignment = {x = -1, y = -1}, - offset = HUD_ARMOR_OFFSET, - background = "hud_armor_bg.png", - autohide_bg = true, - max = 20, + hud_elem_type = "statbar", + position = HUD_ARMOR_POS, + size = HUD_SB_SIZE, + text = "hud_armor_fg.png", + number = 0, + alignment = {x = -1, y = -1}, + offset = HUD_ARMOR_OFFSET, + background = "hud_armor_bg.png", + autohide_bg = true, + max = 20, }) hud.register("hunger", { - hud_elem_type = "statbar", - position = HUD_HUNGER_POS, - size = HUD_SB_SIZE, - text = "hud_hunger_fg.png", - number = 0, - alignment = {x = -1, y = -1}, - offset = HUD_HUNGER_OFFSET, - background = "hud_hunger_bg.png", - max = 0, + hud_elem_type = "statbar", + position = HUD_HUNGER_POS, + size = HUD_SB_SIZE, + text = "hud_hunger_fg.png", + number = 0, + alignment = {x = -1, y = -1}, + offset = HUD_HUNGER_OFFSET, + background = "hud_hunger_bg.png", + max = 0, }) else hud.show_armor = false |