mirror of
https://github.com/mehah/otclient
synced 2026-08-15 16:29:06 -04:00
fix: stale loot-value frames in containers on in-place item updates (#1773)
This commit is contained in:
parent
50e59a07f6
commit
4f04a3cb8b
2 changed files with 9 additions and 0 deletions
|
|
@ -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'))
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue