feat: quality border settings

This commit is contained in:
Salikh Gurgenidze
2025-11-20 13:41:44 +04:00
parent 097f78c4fc
commit a4af31e5e4
5 changed files with 216 additions and 14 deletions
+8
View File
@@ -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
+26
View File
@@ -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