Integrate Legacy Inventory option per-player in Settings popup

This commit is contained in:
Jean-Patrick Guerrero
2022-08-28 13:31:01 +02:00
parent c8d6312772
commit 75fdd57f2a
8 changed files with 49 additions and 33 deletions

View File

@ -5,8 +5,8 @@ IMPORT("min", "max", "vec_eq", "vec_round")
IMPORT("S", "random", "translate", "ItemStack")
IMPORT("sort", "copy", "insert", "remove", "indexof")
IMPORT("fmt", "find", "match", "sub", "lower", "split", "toupper")
IMPORT("search", "sort_inventory", "sort_by_category", "get_recipes", "get_detached_inv")
IMPORT("msg", "is_fav", "pos_to_str", "str_to_pos", "add_hud_waypoint", "play_sound", "reset_data")
IMPORT("search", "sort_inventory", "sort_by_category", "get_recipes", "get_detached_inv", "update_inv_size")
IMPORT("valid_item", "get_stack", "craft_stack", "clean_name", "compressible", "check_privs", "safe_teleport")
local function inv_fields(player, data, fields)
@ -32,6 +32,10 @@ local function inv_fields(player, data, fields)
data[str] = true
end
if str == "legacy_inventory" then
update_inv_size(player, data)
end
elseif sub(field, 1, 8) == "setting_" then
data.show_setting = match(field, "_(%w+)$")