fix: quality item colros for bank
This commit is contained in:
+2
-2
@@ -204,7 +204,7 @@ function BagFrame:UpdateSingleSlot(bagID, slotID)
|
|||||||
local itemData = nil
|
local itemData = nil
|
||||||
|
|
||||||
if itemLink then
|
if itemLink then
|
||||||
local texture, itemCount, locked = GetContainerItemInfo(bagID, slotID)
|
local texture, itemCount, locked, slotQuality = GetContainerItemInfo(bagID, slotID)
|
||||||
local itemID = nil
|
local itemID = nil
|
||||||
local _, _, idStr = string.find(itemLink, "item:(%d+)")
|
local _, _, idStr = string.find(itemLink, "item:(%d+)")
|
||||||
if idStr then itemID = tonumber(idStr) end
|
if idStr then itemID = tonumber(idStr) end
|
||||||
@@ -215,7 +215,7 @@ function BagFrame:UpdateSingleSlot(bagID, slotID)
|
|||||||
link = itemLink,
|
link = itemLink,
|
||||||
texture = texture,
|
texture = texture,
|
||||||
count = itemCount or 1,
|
count = itemCount or 1,
|
||||||
quality = quality or 0,
|
quality = quality or slotQuality or 0,
|
||||||
name = name,
|
name = name,
|
||||||
iLevel = iLevel,
|
iLevel = iLevel,
|
||||||
type = itemType,
|
type = itemType,
|
||||||
|
|||||||
+3
-3
@@ -154,18 +154,18 @@ function BankFrame:UpdateSingleSlot(bagID, slotID)
|
|||||||
local itemData = nil
|
local itemData = nil
|
||||||
|
|
||||||
if itemLink then
|
if itemLink then
|
||||||
local texture, itemCount, locked = GetContainerItemInfo(bagID, slotID)
|
local texture, itemCount, locked, quality = GetContainerItemInfo(bagID, slotID)
|
||||||
local itemID = nil
|
local itemID = nil
|
||||||
local _, _, idStr = string.find(itemLink, "item:(%d+)")
|
local _, _, idStr = string.find(itemLink, "item:(%d+)")
|
||||||
if idStr then itemID = tonumber(idStr) end
|
if idStr then itemID = tonumber(idStr) end
|
||||||
|
|
||||||
if itemID then
|
if itemID then
|
||||||
local name, link, quality, iLevel, _, itemType, stackCount, subType, _, equipLoc = GetItemInfo(itemID)
|
local name, link, itemQuality, iLevel, _, itemType, stackCount, subType, _, equipLoc = GetItemInfo(itemID)
|
||||||
itemData = {
|
itemData = {
|
||||||
link = itemLink,
|
link = itemLink,
|
||||||
texture = texture,
|
texture = texture,
|
||||||
count = itemCount or 1,
|
count = itemCount or 1,
|
||||||
quality = quality or 0,
|
quality = quality or itemQuality or 0, -- Prefer GetContainerItemInfo, fallback to GetItemInfo
|
||||||
name = name,
|
name = name,
|
||||||
iLevel = iLevel,
|
iLevel = iLevel,
|
||||||
type = itemType,
|
type = itemType,
|
||||||
|
|||||||
@@ -993,12 +993,21 @@ function Guda_ItemButton_SetItem(self, bagID, slotID, itemData, isBank, otherCha
|
|||||||
isLocked = locked
|
isLocked = locked
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Fall back to itemData.quality if live query returned nil (timing issue on bank open)
|
||||||
|
if itemQuality == nil and itemData and itemData.quality then
|
||||||
|
itemQuality = itemData.quality
|
||||||
|
end
|
||||||
|
|
||||||
-- Ensure itemData is populated for live items (needed for ItemDetection)
|
-- Ensure itemData is populated for live items (needed for ItemDetection)
|
||||||
if itemLink then
|
if itemLink then
|
||||||
local itemName, _, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture = GetItemInfo(itemLink)
|
local itemName, _, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture = GetItemInfo(itemLink)
|
||||||
-- For bank main bag, get quality from GetItemInfo
|
-- For bank main bag, get quality from GetItemInfo
|
||||||
if self.isBank and bagID == -1 then
|
if self.isBank and bagID == -1 then
|
||||||
itemQuality = itemRarity
|
itemQuality = itemRarity
|
||||||
|
-- Fall back to itemData.quality if GetItemInfo returned nil
|
||||||
|
if itemQuality == nil and itemData and itemData.quality then
|
||||||
|
itemQuality = itemData.quality
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if not itemData then
|
if not itemData then
|
||||||
-- Create new itemData
|
-- Create new itemData
|
||||||
|
|||||||
Reference in New Issue
Block a user