diff --git a/mods/hbhunger/init.lua b/mods/hbhunger/init.lua index aec4911..f9c1e6b 100644 --- a/mods/hbhunger/init.lua +++ b/mods/hbhunger/init.lua @@ -52,6 +52,13 @@ hbhunger.SAT_MAX = 30 -- maximum satiation points hbhunger.SAT_INIT = 20 -- initial satiation points hbhunger.SAT_HEAL = 15 -- required satiation points to start healing +local set + +set= minetest.settings:get("hbhunger_satiation_tick") if set ~= nil then hbhunger.HUNGER_TICK = tonumber(set) end +set= minetest.settings:get("hbhunger_satiation_dig") if set ~= nil then hbhunger.HUNGER_DIG = tonumber(set) end +set= minetest.settings:get("hbhunger_satiation_place") if set ~= nil then hbhunger.HUNGER_PLACE = tonumber(set) end +set= minetest.settings:get("hbhunger_satiation_move") if set ~= nil then hbhunger.HUNGER_MOVE = tonumber(set) end +set= minetest.settings:get("hbhunger_satiation_lvl") if set ~= nil then hbhunger.HUNGER_LVL = tonumber(set) end --load custom settings local set = io.open(minetest.get_modpath("hbhunger").."/hbhunger.conf", "r") @@ -72,7 +79,7 @@ local sicon = "hbhunger_icon.png" if hb.settings.bar_type == "progress_bar" then sicon = nil end -hb.register_hudbar("satiation", 0xFFFFFF, S("Satiation"), { icon = sicon, bgicon = nil, bar = "hbhunger_bar.png" }, hbhunger.SAT_INIT, hbhunger.SAT_MAX, false, nil, { format_value = "%.1f", format_max_value = "%2d" }) +hb.register_hudbar("satiation", 0xFFFFFF, S("Satiation"), { icon = sicon, bgicon = nil, bar = "hbhunger_bar.png" }, hbhunger.SAT_INIT, hbhunger.SAT_MAX, false, nil, { format_value = "%02d", format_max_value = "%02d" }) -- update hud elemtens if value has changed local function update_hud(player) diff --git a/mods/hbhunger/settingtypes.txt b/mods/hbhunger/settingtypes.txt new file mode 100644 index 0000000..9a0d830 --- /dev/null +++ b/mods/hbhunger/settingtypes.txt @@ -0,0 +1,9 @@ +hbhunger_satiation_tick (Time in seconds after which 1 saturation point is taken) float 1600 + +hbhunger_satiation_sprint_dig (exhaustion increased this value after digged node) float 3 + +hbhunger_satiation_sprint_place (exhaustion increased this value after placed) float 1 + +hbhunger_satiation_sprint_move (exhaustion increased this value if player movement detected) float 0.3 + +hbhunger_satiation_sprint_lvl (at what exhaustion player satiation gets lowerd) float 160