More tweaking

This commit is contained in:
Jean-Patrick Guerrero 2021-01-03 23:22:17 +01:00
parent 1455b1ff05
commit 4763463469

View File

@ -59,8 +59,8 @@ local sprintf, find, gmatch, match, sub, split, upper, lower =
string.sub, string.split, string.upper, string.lower string.sub, string.split, string.upper, string.lower
local min, max, floor, ceil, abs = math.min, math.max, math.floor, math.ceil, math.abs local min, max, floor, ceil, abs = math.min, math.max, math.floor, math.ceil, math.abs
local pairs, ipairs, next, type, setmetatable, tonum = local pairs, ipairs, next, type, setmetatable, tonum, unpack =
pairs, ipairs, next, type, setmetatable, tonumber pairs, ipairs, next, type, setmetatable, tonumber, unpack
local vec_add, vec_mul = vector.add, vector.multiply local vec_add, vec_mul = vector.add, vector.multiply
@ -100,7 +100,7 @@ local PNG = {
cancel_hover = "i3_cancel.png^\\[brighten", cancel_hover = "i3_cancel.png^\\[brighten",
search_hover = "i3_search.png^\\[brighten", search_hover = "i3_search.png^\\[brighten",
export_hover = "i3_export.png^\\[brighten", export_hover = "i3_export.png^\\[brighten",
trash_hover = "i3_trash.png^\\[brighten", trash_hover = "i3_trash.png^\\[brighten^\\[colorize:#f00:100",
compress_hover = "i3_compress.png^\\[brighten", compress_hover = "i3_compress.png^\\[brighten",
sort_az_hover = "i3_sort.png^\\[brighten", sort_az_hover = "i3_sort.png^\\[brighten",
sort_za_hover = "i3_sort2.png^\\[brighten", sort_za_hover = "i3_sort2.png^\\[brighten",
@ -1737,12 +1737,12 @@ local function get_inventory_mode(player, fs, data, full_height)
fs(fmt("bg9", 0, 0, data.xoffset, full_height, PNG.bg_full, 10)) fs(fmt("bg9", 0, 0, data.xoffset, full_height, PNG.bg_full, 10))
for i = 0, 7 do for i = 0, 7 do
fs(fmt("image", i + 0.235 + (i * 0.25), 6.1, 1, 1, "i3_hb_bg.png")) fs(fmt("image", i + 0.234 + (i * 0.25), 6.1, 1, 1, "i3_hb_bg.png"))
end end
fs("listring[current_player;main]", fs("listring[current_player;main]",
"list[current_player;main;0.235,6.1;8,1;]", "list[current_player;main;0.234,6.1;8,1;]",
"list[current_player;main;0.235,7.4;8,3;8]") "list[current_player;main;0.234,7.4;8,3;8]")
local props = player:get_properties() local props = player:get_properties()
local name = player:get_player_name() local name = player:get_player_name()
@ -1829,18 +1829,19 @@ local function get_inventory_mode(player, fs, data, full_height)
fs("scroll_container_end[]") fs("scroll_container_end[]")
end end
local i = 0
local btn = { local btn = {
trash = ES"Trash all items", {"trash", ES"Trash all items"},
sort_az = ES"Sort items (A-Z)", {"sort_az", ES"Sort items (A-Z)"},
sort_za = ES"Sort items (Z-A)", {"sort_za", ES"Sort items (Z-A)"},
compress = ES"Compress items", {"compress", ES"Compress items"},
} }
for btn_name, tooltip in pairs(btn) do for i, v in ipairs(btn) do
fs(fmt("image_button", i + 4.02 - (i * 0.4), local btn_name, tooltip = unpack(v)
fs(fmt("image_button", i + 3.447 - (i * 0.4),
full_height - 0.6, 0.35, 0.35, "", btn_name, "")) full_height - 0.6, 0.35, 0.35, "", btn_name, ""))
i = i + 1
fs(sprintf("tooltip[%s;%s]", btn_name, tooltip)) fs(sprintf("tooltip[%s;%s]", btn_name, tooltip))
end end
end end