Minor cleanup

This commit is contained in:
Jean-Patrick Guerrero 2021-01-24 04:45:24 +01:00
parent 2e05628048
commit fc851eade2

View File

@ -2175,30 +2175,24 @@ local function get_inv_slots(data, fs)
fs(fmt("image", i + inv_x + (i * 0.15), inv_y, 1, 1, "i3_hb_bg.png")) fs(fmt("image", i + inv_x + (i * 0.15), inv_y, 1, 1, "i3_hb_bg.png"))
end end
fs("style_type[list;size=1;spacing=0.15]") fs("style_type[list;size=1;spacing=0.15]", fmt("list[current_player;main;%f,%f;8,1;]", inv_x, inv_y))
fs(fmt("list[current_player;main;%f,%f;8,1;]", inv_x, inv_y))
local width, size, spacing_x, spacing_y, extra = 9, 0.96, 0.15, 0.15, 0 local width, size, spacing, extra = 9, 0.96, 0.15, 0
if bag then if bag then
if bag == "small" then if bag == "small" then
width, size, spacing_x, spacing_y = 10, 0.89, 0.1, 0.1 width, size, spacing, extra = 10, 0.89, 0.1, 0.01
extra = 0.01
elseif bag == "medium" then elseif bag == "medium" then
width, size, spacing_x, spacing_y = 12, 0.72, 0.1, 0.1 width, size, spacing, extra = 12, 0.72, 0.1, 0.032
extra = 0.032
elseif bag == "large" then elseif bag == "large" then
width, size, spacing_x, spacing_y = 12, 0.72, 0.1, 0.1 width, size, spacing, extra = 12, 0.72, 0.1, 0.032
extra = 0.032
end end
end end
fs(fmt("style_type[list;size=%f,%f;spacing=%f,%f]", size, size, spacing_x, spacing_y)) fs(fmt("style_type[list;size=%f;spacing=%f]", size, spacing),
fmt("list[current_player;main;%f,%f;%u,%u;8]", 0.234 + extra, inv_y + 1.25,
fs(fmt("list[current_player;main;%f,%f;%u,%u;8]", 0.234 + extra, inv_y + 1.25, width, (bag and BAG_SIZES[data.bag_size] or INV_SIZE) / width),
width, (bag and BAG_SIZES[data.bag_size] or INV_SIZE) / width)) "style_type[list;size=1;spacing=0.15]")
fs("style_type[list;size=1;spacing=0.15]")
end end
local function get_inventory_fs(player, data, fs) local function get_inventory_fs(player, data, fs)