Version 0.41.3
[MineClone/MineClone2/MineClone2-Fixes.git] / mods / HUD / hudbars / default_settings.lua
blob91d3c67ebad6f2944bae3376fa97d141ac160626
1 -- (Hardcoded) default settings
2 -- Some of these settings have been modified for MCL2.
4 hb.settings.max_bar_length = 160
5 hb.settings.statbar_length = 20
7 -- Statbar positions
8 hb.settings.pos_left = {}
9 hb.settings.pos_right = {}
10 hb.settings.start_offset_left = {}
11 hb.settings.start_offset_right= {}
12 hb.settings.pos_left.x = hb.load_setting("hudbars_pos_left_x", "number", 0.5)
13 hb.settings.pos_left.y = hb.load_setting("hudbars_pos_left_y", "number", 1)
14 hb.settings.pos_right.x = hb.load_setting("hudbars_pos_right_x", "number", 0.5)
15 hb.settings.pos_right.y = hb.load_setting("hudbars_pos_right_y", "number", 1)
16 -- Modified in MCL2!
17 hb.settings.bar_type = hb.load_setting("hudbars_bar_type", "string", "statbar_modern", {"progress_bar", "statbar_classic", "statbar_modern"})
18 if hb.settings.bar_type == "progress_bar" then
19 hb.settings.start_offset_left.x = hb.load_setting("hudbars_start_offset_left_x", "number", -175)
20 hb.settings.start_offset_left.y = hb.load_setting("hudbars_start_offset_left_y", "number", -86)
21 hb.settings.start_offset_right.x = hb.load_setting("hudbars_start_offset_right_x", "number", 15)
22 hb.settings.start_offset_right.y = hb.load_setting("hudbars_start_offset_right_y", "number", -86)
23 else
24 hb.settings.start_offset_left.x = hb.load_setting("hudbars_start_statbar_offset_left_x", "number", -265)
25 hb.settings.start_offset_left.y = hb.load_setting("hudbars_start_statbar_offset_left_y", "number", -90)
26 hb.settings.start_offset_right.x = hb.load_setting("hudbars_start_statbar_offset_right_x", "number", 25)
27 hb.settings.start_offset_right.y = hb.load_setting("hudbars_start_statbar_offset_right_y", "number", -90)
28 end
29 -- Modified in MCL2!
30 hb.settings.vmargin = hb.load_setting("hudbars_vmargin", "number", 28)
31 hb.settings.tick = hb.load_setting("hudbars_tick", "number", 0.1)
33 -- Experimental setting: Changing this setting is not officially supported, do NOT rely on it!
34 hb.settings.forceload_default_hudbars = hb.load_setting("hudbars_forceload_default_hudbars", "bool", true)
36 -- Misc. settings
37 hb.settings.alignment_pattern = hb.load_setting("hudbars_alignment_pattern", "string", "zigzag", {"zigzag", "stack_up", "stack_down"})
38 hb.settings.autohide_breath = hb.load_setting("hudbars_autohide_breath", "bool", true)
40 local sorting = minetest.settings:get("hudbars_sorting")
41 if sorting ~= nil then
42 hb.settings.sorting = {}
43 hb.settings.sorting_reverse = {}
44 for k,v in string.gmatch(sorting, "(%w+)=(%w+)") do
45 hb.settings.sorting[k] = tonumber(v)
46 hb.settings.sorting_reverse[tonumber(v)] = k
47 end
48 else
49 -- Modified in MCL2!
50 hb.settings.sorting = { ["health"] = 0, ["hunger"] = 1, ["armor"] = 2, ["breath"] = 3, ["exhaustion"] = 4, ["saturation"] = 5 }
51 hb.settings.sorting_reverse = {}
52 for k,v in pairs(hb.settings.sorting) do
53 hb.settings.sorting_reverse[tonumber(v)] = k
54 end
55 end