feat: quality border settings
This commit is contained in:
@@ -39,6 +39,8 @@ function DB:Initialize()
|
||||
iconSize = 40,
|
||||
iconSpacing = 0,
|
||||
iconFontSize = 12,
|
||||
showQualityBorderEquipment = true,
|
||||
showQualityBorderOther = true,
|
||||
},
|
||||
}
|
||||
end
|
||||
@@ -62,6 +64,12 @@ function DB:Initialize()
|
||||
if not Guda_CharDB.settings.iconFontSize then
|
||||
Guda_CharDB.settings.iconFontSize = 12
|
||||
end
|
||||
if Guda_CharDB.settings.showQualityBorderEquipment == nil then
|
||||
Guda_CharDB.settings.showQualityBorderEquipment = true
|
||||
end
|
||||
if Guda_CharDB.settings.showQualityBorderOther == nil then
|
||||
Guda_CharDB.settings.showQualityBorderOther = true
|
||||
end
|
||||
|
||||
-- Initialize this character's data
|
||||
if not Guda_DB.characters[fullName] then
|
||||
|
||||
@@ -407,4 +407,30 @@ function Utils:GetItemPreferredContainer(itemLink)
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Check if an item is equipment (armor, weapon, or other equippable)
|
||||
-- Returns: true if item is equipment, false otherwise
|
||||
function Utils:IsEquipment(itemLink)
|
||||
if not itemLink then return false end
|
||||
|
||||
local itemID = self:ExtractItemID(itemLink)
|
||||
if not itemID then return false end
|
||||
|
||||
local itemName, _, itemRarity, itemLevel, itemCategory, itemType, itemStackCount, itemSubType, itemTexture, itemEquipLoc = self:GetItemInfoSafe(itemID)
|
||||
|
||||
-- Check if item has an equip location (most reliable method)
|
||||
if itemEquipLoc and itemEquipLoc ~= "" and itemEquipLoc ~= "INVTYPE_BAG" then
|
||||
return true
|
||||
end
|
||||
|
||||
-- Fallback: Check category (in case itemEquipLoc is not set)
|
||||
if itemCategory then
|
||||
local categoryLower = string.lower(itemCategory)
|
||||
if categoryLower == "armor" or categoryLower == "weapon" then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
Reference in New Issue
Block a user