MCL2-specific default HUD bars settings

This commit is contained in:
Wuzzy 2017-07-02 18:51:40 +02:00
parent 28dc5b802f
commit 1791907747
1 changed files with 12 additions and 4 deletions

View File

@ -1,4 +1,5 @@
-- (Hardcoded) default settings -- (Hardcoded) default settings
-- Some of these settings have been modified for MCL2.
hb.settings.max_bar_length = 160 hb.settings.max_bar_length = 160
hb.settings.statbar_length = 20 hb.settings.statbar_length = 20
@ -12,7 +13,8 @@ hb.settings.pos_left.x = hb.load_setting("hudbars_pos_left_x", "number", 0.5)
hb.settings.pos_left.y = hb.load_setting("hudbars_pos_left_y", "number", 1) hb.settings.pos_left.y = hb.load_setting("hudbars_pos_left_y", "number", 1)
hb.settings.pos_right.x = hb.load_setting("hudbars_pos_right_x", "number", 0.5) hb.settings.pos_right.x = hb.load_setting("hudbars_pos_right_x", "number", 0.5)
hb.settings.pos_right.y = hb.load_setting("hudbars_pos_right_y", "number", 1) hb.settings.pos_right.y = hb.load_setting("hudbars_pos_right_y", "number", 1)
hb.settings.bar_type = hb.load_setting("hudbars_bar_type", "string", "progress_bar", {"progress_bar", "statbar_classic", "statbar_modern"}) -- Modified in MCL2!
hb.settings.bar_type = hb.load_setting("hudbars_bar_type", "string", "statbar_modern", {"progress_bar", "statbar_classic", "statbar_modern"})
if hb.settings.bar_type == "progress_bar" then if hb.settings.bar_type == "progress_bar" then
hb.settings.start_offset_left.x = hb.load_setting("hudbars_start_offset_left_x", "number", -175) hb.settings.start_offset_left.x = hb.load_setting("hudbars_start_offset_left_x", "number", -175)
hb.settings.start_offset_left.y = hb.load_setting("hudbars_start_offset_left_y", "number", -86) hb.settings.start_offset_left.y = hb.load_setting("hudbars_start_offset_left_y", "number", -86)
@ -24,7 +26,8 @@ else
hb.settings.start_offset_right.x = hb.load_setting("hudbars_start_statbar_offset_right_x", "number", 25) hb.settings.start_offset_right.x = hb.load_setting("hudbars_start_statbar_offset_right_x", "number", 25)
hb.settings.start_offset_right.y = hb.load_setting("hudbars_start_statbar_offset_right_y", "number", -90) hb.settings.start_offset_right.y = hb.load_setting("hudbars_start_statbar_offset_right_y", "number", -90)
end end
hb.settings.vmargin = hb.load_setting("hudbars_vmargin", "number", 24) -- Modified in MCL2!
hb.settings.vmargin = hb.load_setting("hudbars_vmargin", "number", 32)
hb.settings.tick = hb.load_setting("hudbars_tick", "number", 0.1) hb.settings.tick = hb.load_setting("hudbars_tick", "number", 0.1)
-- Experimental setting: Changing this setting is not officially supported, do NOT rely on it! -- Experimental setting: Changing this setting is not officially supported, do NOT rely on it!
@ -43,6 +46,11 @@ if sorting ~= nil then
hb.settings.sorting_reverse[tonumber(v)] = k hb.settings.sorting_reverse[tonumber(v)] = k
end end
else else
hb.settings.sorting = { ["health"] = 0, ["breath"] = 1 } -- Modified in MCL2!
hb.settings.sorting_reverse = { [0] = "health", [1] = "breath" } hb.settings.sorting = { ["health"] = 0, ["hunger"] = 1, ["armor"] = 2, ["breath"] = 3, ["exhaustion"] = 4, ["saturation"] = 5 }
hb.settings.sorting_reverse = {}
for k,v in pairs(hb.settings.sorting) do
hb.settings.sorting_reverse[tonumber(v)] = k
end
end end