diff options
author | Wuzzy <almikes@aol.com> | 2015-03-23 18:35:19 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2015-03-23 18:35:19 +0100 |
commit | 015e23c6f24fbd00bc155c9cf08b7c01210342e5 (patch) | |
tree | 906d02e43891d309f5ef74c1d1479db9b8e225b6 /init.lua | |
parent | 2691a4e320e91c735016e4afc26f620898505542 (diff) |
Add setting to configure breath bar auto-hiding
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -19,6 +19,12 @@ hb.settings.start_offset_right = { x = 15, y = -86 } hb.settings.vmargin = 24 hb.settings.tick = 0.1 +hb.settings.autohide_breath = true +local autohide_breath = minetest.setting_getbool("hudbars_autohide_breath") +if autohide_breath ~= nil then + hb.settings.autohide_breath = autohide_breath +end + -- Table which contains all players with active default HUD bars (only for internal use) hb.players = {} @@ -289,7 +295,7 @@ local function custom_hud(player) hb.init_hudbar(player, "health", player:get_hp()) local breath = player:get_breath() local hide_breath - if breath == 11 then hide_breath = true else hide_breath = false end + if breath == 11 and hb.settings.autohide_breath == true then hide_breath = true else hide_breath = false end hb.init_hudbar(player, "breath", math.min(breath, 10), nil, hide_breath) end end @@ -301,7 +307,7 @@ local function update_hud(player) --air local breath = player:get_breath() - if breath == 11 then + if breath == 11 and hb.settings.autohide_breath == true then hb.hide_hudbar(player, "breath") else hb.unhide_hudbar(player, "breath") |