Remove some unessecerary [resize

This commit is contained in:
Jean-Patrick Guerrero 2022-06-18 19:56:47 +02:00
parent f0f94017da
commit e17e1080d3
2 changed files with 10 additions and 7 deletions

View File

@ -319,17 +319,21 @@ local function get_cube(tiles)
return draw_cube(top, left, right)
end
local function is_cube(drawtype)
return drawtype == "normal" or drawtype == "liquid" or
sub(drawtype, 1, 9) == "glasslike" or
sub(drawtype, 1, 8) == "allfaces"
end
local function init_cubes()
for name, def in pairs(reg_nodes) do
if def then
local id = core.get_content_id(name)
if def.drawtype == "normal" or def.drawtype == "liquid" or
sub(def.drawtype, 1, 9) == "glasslike" or
sub(def.drawtype, 1, 8) == "allfaces" then
if is_cube(def.drawtype) then
i3.cubes[id] = get_cube(def.tiles)
elseif sub(def.drawtype, 1, 9) == "plantlike" or sub(def.drawtype, 1, 8) == "firelike" then
i3.plants[id] = def.inventory_image .. "^\\[resize:16x16"
i3.plants[id] = def.inventory_image
end
end
end

View File

@ -840,7 +840,7 @@ local function get_output_fs(fs, data, rcp, is_recipe, shapeless, right, btn_siz
local icon, tooltip = PNG.blank
if custom_recipe and true_str(custom_recipe.icon) then
icon = fmt("%s^\\[resize:16x16", custom_recipe.icon)
icon = custom_recipe.icon
elseif shapeless then
icon = PNG.shapeless
end
@ -1460,8 +1460,7 @@ local function get_tabs_fs(fs, player, data, full_height)
if true_str(def.image) then
local desc = translate(data.lang_code, def.description)
fs("style_type[image;noclip=true]")
fs("image", X + (tab_len / 2) - ((#desc * 0.1) / 2) - 0.55,
Y + 0.05, 0.35, 0.35, fmt("%s^\\[resize:16x16", def.image))
fs("image", X + (tab_len / 2) - ((#desc * 0.1) / 2) - 0.55, Y + 0.05, 0.35, 0.35, def.image)
end
c++