fix: stale loot-value frames in containers on in-place item updates (#1773)

This commit is contained in:
mimus-assa 2026-07-25 07:19:35 -06:00 committed by GitHub
parent 50e59a07f6
commit 4f04a3cb8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -1163,6 +1163,8 @@ function onContainerUpdateItem(container, slot, item, oldItem)
end
local itemWidget = container.itemsPanel:getChildById('item' .. slot)
itemWidget:setItem(item)
ItemsDatabase.setRarityItem(itemWidget, item)
ItemsDatabase.setTier(itemWidget, item)
itemWidget:setShowDuration(g_game.getFeature(GameThingClock) and modules.client_options.getOption('showExpiryInContainers'))
itemWidget:setShowCharges(g_game.getFeature(GameThingCounter) and modules.client_options.getOption('showExpiryInContainers'))

View file

@ -95,6 +95,13 @@ function ItemsDatabase.setRarityItem(widget, item, style)
local clip, imagePath = ItemsDatabase.getClipAndImagePath(item)
if not imagePath then
-- no frame applies (empty slot or frames disabled): clear a frame left by a previous item,
-- but only if this widget is currently showing one, to avoid clobbering custom backgrounds
local currentSource = widget:getImageSource()
if currentSource == "/images/ui/rarity_frames" or currentSource == "/images/ui/containerslot-coloredges" then
widget:setImageClip(nil)
widget:setImageSource('/images/ui/item')
end
return
end