Skip to content

Commit

Permalink
added explicit call to reprocess items for refreshing categories
Browse files Browse the repository at this point in the history
  • Loading branch information
DJSchaffner committed Feb 21, 2024
1 parent 6b3a7c1 commit 70cf8da
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ local function updateCategories()

if itemSets == nil then
usedItems[id] = { setName }
-- Extend existing labels
-- Extend existing labels
else
table.insert(usedItems[id], setName)
end
Expand All @@ -77,6 +77,9 @@ local function updateCategories()
categories:AddItemToCategory(item, L:G(label))
-- printChat("Added item '" .. id .. "' to '" .. label .. "' category")
end

-- Force a refresh in BetterBags
categories:ReprocessAllItems()
end

local function initCategories()
Expand All @@ -85,7 +88,6 @@ local function initCategories()
CustomCategories = {}
end

printChat("ItemRack Loaded..")
printChat("Initializing Categories..")
updateCategories()
end
Expand All @@ -98,7 +100,7 @@ end
-------------------------------------------------------

-- Don't listen for load event since it should be loaded already (dependency)
ItemRack:RegisterExternalEventListener("ITEMRACK_SET_SAVED", itemRackUpdated)
ItemRack:RegisterExternalEventListener("ITEMRACK_SET_DELETED", itemRackUpdated)
initCategories()
ItemRack:RegisterExternalEventListener("ITEMRACK_SET_SAVED", itemRackUpdated)
ItemRack:RegisterExternalEventListener("ITEMRACK_SET_DELETED", itemRackUpdated)

initCategories()

0 comments on commit 70cf8da

Please sign in to comment.