Navigation Menu

Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
Also for slots
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbith committed Jul 3, 2022
1 parent 37e0c21 commit 8f4c9f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gui.lua
Expand Up @@ -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

Expand All @@ -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),
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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, "")
Expand Down
1 change: 1 addition & 0 deletions src/styles.lua
Expand Up @@ -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]",
}
Expand Down

0 comments on commit 8f4c9f2

Please sign in to comment.