replace deprecated functions
parent
f850e0ced8
commit
518fc06e05
|
@ -6,7 +6,7 @@ hbarmor.tick = 1 -- was 0.1
|
||||||
hbarmor.autohide = true -- hide when player not wearing armor
|
hbarmor.autohide = true -- hide when player not wearing armor
|
||||||
|
|
||||||
local armor_hud = {} -- HUD item id's
|
local armor_hud = {} -- HUD item id's
|
||||||
local enable_damage = minetest.setting_getbool("enable_damage")
|
local enable_damage = minetest.settings:get_bool("enable_damage")
|
||||||
|
|
||||||
--[[load custom settings
|
--[[load custom settings
|
||||||
local set = io.open(minetest.get_modpath("hbarmor").."/hbarmor.conf", "r")
|
local set = io.open(minetest.get_modpath("hbarmor").."/hbarmor.conf", "r")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
if not minetest.setting_getbool("enable_damage") then
|
if not minetest.settings:get_bool("enable_damage") then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -168,8 +168,8 @@ function set_sprinting(name, sprinting)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- sprint settings
|
-- sprint settings
|
||||||
local enable_sprint = minetest.setting_getbool("sprint") ~= false
|
local enable_sprint = minetest.settings:get_bool("sprint") ~= false
|
||||||
local enable_sprint_particles = minetest.setting_getbool("sprint_particles") ~= false
|
local enable_sprint_particles = minetest.settings:get_bool("sprint_particles") ~= false
|
||||||
local sprinters = {}
|
local sprinters = {}
|
||||||
|
|
||||||
local main_timer = 0
|
local main_timer = 0
|
||||||
|
|
|
@ -5,19 +5,19 @@ hb.hudbars_count = 0 -- number of registered HUD bars
|
||||||
hb.registered_slots = {} -- table of HUD bars for automatic positioning
|
hb.registered_slots = {} -- table of HUD bars for automatic positioning
|
||||||
hb.settings = {}
|
hb.settings = {}
|
||||||
|
|
||||||
local enable_damage = minetest.setting_getbool("enable_damage")
|
local enable_damage = minetest.settings:get_bool("enable_damage")
|
||||||
local gui_scale = tonumber(minetest.setting_get("gui_scaling")) or 1 -- scales hud
|
local gui_scale = tonumber(minetest.settings:get("gui_scaling")) or 1 -- scales hud
|
||||||
|
|
||||||
function hb.load_setting(sname, stype, defaultval, valid_values)
|
function hb.load_setting(sname, stype, defaultval, valid_values)
|
||||||
|
|
||||||
local sval
|
local sval
|
||||||
|
|
||||||
if stype == "string" then
|
if stype == "string" then
|
||||||
sval = minetest.setting_get(sname)
|
sval = minetest.settings:get(sname)
|
||||||
elseif stype == "bool" then
|
elseif stype == "bool" then
|
||||||
sval = minetest.setting_getbool(sname)
|
sval = minetest.settings:get_bool(sname)
|
||||||
elseif stype == "number" then
|
elseif stype == "number" then
|
||||||
sval = tonumber(minetest.setting_get(sname))
|
sval = tonumber(minetest.settings:get(sname))
|
||||||
end
|
end
|
||||||
|
|
||||||
if not sval then
|
if not sval then
|
||||||
|
@ -99,7 +99,7 @@ else
|
||||||
hb.size = {x = 17 * gui_scale, y = 17 * gui_scale}
|
hb.size = {x = 17 * gui_scale, y = 17 * gui_scale}
|
||||||
end
|
end
|
||||||
|
|
||||||
local sorting = minetest.setting_get("hudbars_sorting")
|
local sorting = minetest.settings:get("hudbars_sorting")
|
||||||
|
|
||||||
if sorting ~= nil then
|
if sorting ~= nil then
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue