feat: BoE category
This commit is contained in:
+16
-1
@@ -574,16 +574,31 @@ function Utils:GetItemPreferredContainer(itemLink)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Check if an item is "Binds when equipped" by scanning its tooltip
|
-- Check if an item is "Binds when equipped" by scanning its tooltip
|
||||||
function Utils:IsBindOnEquip(bagID, slotID)
|
-- For bank items, use itemLink since SetBagItem may not work for bank slots
|
||||||
|
function Utils:IsBindOnEquip(bagID, slotID, itemLink)
|
||||||
if not bagID or not slotID then return false end
|
if not bagID or not slotID then return false end
|
||||||
|
|
||||||
local tooltip = GetScanTooltip()
|
local tooltip = GetScanTooltip()
|
||||||
if not tooltip then return false end
|
if not tooltip then return false end
|
||||||
|
|
||||||
tooltip:ClearLines()
|
tooltip:ClearLines()
|
||||||
|
|
||||||
|
-- Try SetBagItem first (works for regular bags and bank when open)
|
||||||
tooltip:SetBagItem(bagID, slotID)
|
tooltip:SetBagItem(bagID, slotID)
|
||||||
|
|
||||||
local numLines = tooltip:NumLines()
|
local numLines = tooltip:NumLines()
|
||||||
|
|
||||||
|
-- If no lines and we have itemLink, try SetHyperlink with itemString as fallback
|
||||||
|
if (not numLines or numLines == 0) and itemLink then
|
||||||
|
-- Extract itemString from link (format: item:12345:0:0:0...)
|
||||||
|
local _, _, itemString = string.find(itemLink, "(item:%d+:%d+:%d+:%d+)")
|
||||||
|
if itemString then
|
||||||
|
tooltip:ClearLines()
|
||||||
|
tooltip:SetHyperlink(itemString)
|
||||||
|
numLines = tooltip:NumLines()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if not numLines or numLines == 0 then return false end
|
if not numLines or numLines == 0 then return false end
|
||||||
|
|
||||||
-- Check tooltip lines for "Binds when equipped"
|
-- Check tooltip lines for "Binds when equipped"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
## Title: Guda
|
## Title: Guda
|
||||||
## Notes: All-in-one bag and bank addon for World of Warcraft 1.12.1 (Turtle WoW)
|
## Notes: All-in-one bag and bank addon for World of Warcraft 1.12.1 (Turtle WoW)
|
||||||
## Author: Vati
|
## Author: Vati
|
||||||
## Version: 1.5.4
|
## Version: 1.5.5
|
||||||
## SavedVariables: Guda_DB
|
## SavedVariables: Guda_DB
|
||||||
## SavedVariablesPerCharacter: Guda_CharDB
|
## SavedVariablesPerCharacter: Guda_CharDB
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -82,7 +82,7 @@ function Guda_CategorizeItem(itemData, bagID, slotID, categories, specialItems,
|
|||||||
|
|
||||||
-- Priority 6: BoE Equipment (Armor/Weapons that bind when equipped)
|
-- Priority 6: BoE Equipment (Armor/Weapons that bind when equipped)
|
||||||
if (itemData.class == "Weapon" or itemData.class == "Armor") and not isOtherChar then
|
if (itemData.class == "Weapon" or itemData.class == "Armor") and not isOtherChar then
|
||||||
local isBoE = addon.Modules.Utils:IsBindOnEquip(bagID, slotID)
|
local isBoE = addon.Modules.Utils:IsBindOnEquip(bagID, slotID, itemData.link)
|
||||||
if isBoE then
|
if isBoE then
|
||||||
table.insert(categories["BoE"], {bagID = bagID, slotID = slotID, itemData = itemData})
|
table.insert(categories["BoE"], {bagID = bagID, slotID = slotID, itemData = itemData})
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user