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

Commit

Permalink
Fix bug with group stereotype
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbith committed Jun 23, 2022
1 parent 3dfcd95 commit c421c49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/caches.lua
Expand Up @@ -25,9 +25,12 @@ end
local function cache_groups(group, groups)
i3.groups[group] = {}
i3.groups[group].groups = groups
i3.groups[group].stereotype = get_group_stereotype(groups[1])
i3.groups[group].items = groups_to_items(groups)

if #groups == 1 then
i3.groups[group].stereotype = get_group_stereotype(groups[1])
end

local items = i3.groups[group].items
if #items <= 1 then return end

Expand Down
4 changes: 2 additions & 2 deletions src/gui.lua
Expand Up @@ -18,7 +18,7 @@ IMPORT("S", "ES", "translate", "ItemStack", "toupper")
IMPORT("get_sorting_idx", "compression_active", "compressible")
IMPORT("get_bag_description", "get_detached_inv", "get_recipes")
IMPORT("maxn", "sort", "concat", "copy", "insert", "remove", "unpack")
IMPORT("get_group_stereotype", "extract_groups", "groups_to_items", "is_group", "item_has_groups", "get_group")
IMPORT("extract_groups", "groups_to_items", "is_group", "item_has_groups", "get_group")

local function fmt(elem, ...)
if not fs_elements[elem] then
Expand Down Expand Up @@ -998,7 +998,7 @@ local function get_grid_fs(fs, data, rcp, is_recipe)
if is_group(name) then
groups = group_cache and group_cache.groups or extract_groups(name)
name = group_cache and (group_cache.stereotype or group_cache.items[1]) or
get_group_stereotype(groups[1]) or groups_to_items(groups)[1]
groups_to_items(groups)[1]
end

local label = groups and "\nG" or ""
Expand Down

0 comments on commit c421c49

Please sign in to comment.