From 8f4c9f28f1cf4bfee33d83b69dfbcd98250e16a6 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sun, 3 Jul 2022 18:55:13 +0200 Subject: [PATCH] Also for slots --- src/gui.lua | 8 ++++---- src/styles.lua | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui.lua b/src/gui.lua index 4091a9c..c772137 100644 --- a/src/gui.lua +++ b/src/gui.lua @@ -883,7 +883,6 @@ local function get_output_fs(fs, data, rcp, is_recipe, shapeless, right, btn_siz local name = item:get_name() local count = item:get_count() local wear = item:get_wear() - local bt_s = BTN_SIZE * 1.2 local _name = fmt("_%s", name) local pos @@ -899,7 +898,8 @@ local function get_output_fs(fs, data, rcp, is_recipe, shapeless, right, btn_siz inv:set_stack("main", 1, item) pos = {x = X + 0.11, y = Y} else - image(X, Y - 0.11, bt_s, bt_s, PNG.slot) + local size = BTN_SIZE * 1.2 + slot(X, Y - 0.11, size, size) item_image_button( X + 0.11, Y, BTN_SIZE, BTN_SIZE, fmt("%s %u %u", name, count * (is_recipe and data.scrbar_rcp or data.scrbar_usg or 1), wear), @@ -1026,7 +1026,7 @@ local function get_grid_fs(fs, data, rcp, is_recipe) end if not large_recipe then - image(X, Y, btn_size, btn_size, PNG.slot) + slot(X, Y, btn_size, btn_size) end local btn_name = groups and fmt("group!%s!%s", groups[1], name) or name @@ -1427,7 +1427,7 @@ local function get_favs(fs, data) local Y = data.yoffset + 0.8 if data.query_item == item then - image(X, Y, btn_size, btn_size, PNG.slot) + slot(X, Y, btn_size, btn_size) end item_image_button(X, Y, btn_size, btn_size, item, name, "") diff --git a/src/styles.lua b/src/styles.lua index 082ff97..a994703 100644 --- a/src/styles.lua +++ b/src/styles.lua @@ -117,6 +117,7 @@ local fs_elements = { scrollbar = "scrollbar[%f,%f;%f,%f;%s;%s;%u]", model = "model[%f,%f;%f,%f;%s;%s;%s;%s;%s;%s;%s]", image_button = "image_button[%f,%f;%f,%f;%s;%s;%s]", + slot = "image[%f,%f;%f,%f;i3_slot.png;60,-60,60,-60]", animated_image = "animated_image[%f,%f;%f,%f;;%s;%u;%u]", item_image_button = "item_image_button[%f,%f;%f,%f;%s;%s;%s]", }