1 -- (Hardcoded) default settings
3 hb
.settings
.max_bar_length
= 160
4 hb
.settings
.statbar_length
= 20
7 hb
.settings
.pos_left
= {}
8 hb
.settings
.pos_right
= {}
9 hb
.settings
.start_offset_left
= {}
10 hb
.settings
.start_offset_right
= {}
11 hb
.settings
.pos_left
.x
= hb
.load_setting("hudbars_pos_left_x", "number", 0.5)
12 hb
.settings
.pos_left
.y
= hb
.load_setting("hudbars_pos_left_y", "number", 1)
13 hb
.settings
.pos_right
.x
= hb
.load_setting("hudbars_pos_right_x", "number", 0.5)
14 hb
.settings
.pos_right
.y
= hb
.load_setting("hudbars_pos_right_y", "number", 1)
15 hb
.settings
.bar_type
= hb
.load_setting("hudbars_bar_type", "string", "progress_bar", {"progress_bar", "statbar_classic", "statbar_modern"})
16 if hb
.settings
.bar_type
== "progress_bar" then
17 hb
.settings
.start_offset_left
.x
= hb
.load_setting("hudbars_start_offset_left_x", "number", -175)
18 hb
.settings
.start_offset_left
.y
= hb
.load_setting("hudbars_start_offset_left_y", "number", -86)
19 hb
.settings
.start_offset_right
.x
= hb
.load_setting("hudbars_start_offset_right_x", "number", 15)
20 hb
.settings
.start_offset_right
.y
= hb
.load_setting("hudbars_start_offset_right_y", "number", -86)
22 hb
.settings
.start_offset_left
.x
= hb
.load_setting("hudbars_start_statbar_offset_left_x", "number", -265)
23 hb
.settings
.start_offset_left
.y
= hb
.load_setting("hudbars_start_statbar_offset_left_y", "number", -90)
24 hb
.settings
.start_offset_right
.x
= hb
.load_setting("hudbars_start_statbar_offset_right_x", "number", 25)
25 hb
.settings
.start_offset_right
.y
= hb
.load_setting("hudbars_start_statbar_offset_right_y", "number", -90)
27 hb
.settings
.vmargin
= hb
.load_setting("hudbars_vmargin", "number", 24)
28 hb
.settings
.tick
= hb
.load_setting("hudbars_tick", "number", 0.1)
30 -- Experimental setting: Changing this setting is not officially supported, do NOT rely on it!
31 hb
.settings
.forceload_default_hudbars
= hb
.load_setting("hudbars_forceload_default_hudbars", "bool", true)
34 hb
.settings
.alignment_pattern
= hb
.load_setting("hudbars_alignment_pattern", "string", "zigzag", {"zigzag", "stack_up", "stack_down"})
35 hb
.settings
.autohide_breath
= hb
.load_setting("hudbars_autohide_breath", "bool", true)
37 local sorting
= minetest
.settings
:get("hudbars_sorting")
38 if sorting
~= nil then
39 hb
.settings
.sorting
= {}
40 hb
.settings
.sorting_reverse
= {}
41 for k
,v
in string.gmatch(sorting
, "(%w+)=(%w+)") do
42 hb
.settings
.sorting
[k
] = tonumber(v
)
43 hb
.settings
.sorting_reverse
[tonumber(v
)] = k
46 hb
.settings
.sorting
= { ["health"] = 0, ["breath"] = 1 }
47 hb
.settings
.sorting_reverse
= { [0] = "health", [1] = "breath" }