From e17e1080d38f375772d8f31d4774b488116cf114 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sat, 18 Jun 2022 19:56:47 +0200 Subject: [PATCH] Remove some unessecerary [resize --- src/caches.lua | 12 ++++++++---- src/gui.lua | 5 ++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/caches.lua b/src/caches.lua index edacf16..8ed0b65 100644 --- a/src/caches.lua +++ b/src/caches.lua @@ -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 diff --git a/src/gui.lua b/src/gui.lua index dd00dc6..7968393 100644 --- a/src/gui.lua +++ b/src/gui.lua @@ -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++