CoA: option to skip auto-loot for worldforged items
Adds a 'Skip auto-loot for Worldforged items' checkbox under the Faster Looting cog menu. When enabled, the SpeedyAutoLoot fast path leaves worldforged items in the loot window so you can review them before deciding to keep, rather than auto-looting everything in sight. Detection uses a hidden scanning tooltip: worldforged items show a green 'Worldforged' line below the item name (visible on db.exil.es tooltips too). Results are cached per itemLink to avoid re-scanning the same item on every loot opportunity. Skipped slots set self.isItemLocked so AutoLoot:ShowLootFrame keeps the window open, matching the existing behaviour for loot above the quality threshold.
This commit is contained in:
@@ -1783,6 +1783,7 @@ function LeaPlusLC:Isolated()
|
|||||||
LeaPlusLC:MakeTx(FasterLootPanel, "Settings", 16, -72)
|
LeaPlusLC:MakeTx(FasterLootPanel, "Settings", 16, -72)
|
||||||
LeaPlusLC:MakeCB(FasterLootPanel, "SmallerErrorFrame", "Smaller Error Frame", 16, -92, false, "If checked, your red error text frame, will be only one line long.")
|
LeaPlusLC:MakeCB(FasterLootPanel, "SmallerErrorFrame", "Smaller Error Frame", 16, -92, false, "If checked, your red error text frame, will be only one line long.")
|
||||||
LeaPlusLC:MakeCB(FasterLootPanel, "FasterErrorFrame", "Faster Error Frame", 16, -112, false, "If checked, your red error text frame, will be faster to fade|n(1 second instead of 5).")
|
LeaPlusLC:MakeCB(FasterLootPanel, "FasterErrorFrame", "Faster Error Frame", 16, -112, false, "If checked, your red error text frame, will be faster to fade|n(1 second instead of 5).")
|
||||||
|
LeaPlusLC:MakeCB(FasterLootPanel, "NoLootWorldforged", "Skip auto-loot for Worldforged items", 16, -132, false, "If checked, worldforged items will be left in the loot window instead of being auto-looted, so you can decide which ones to keep.")
|
||||||
|
|
||||||
LeaPlusLC:MakeTx(FasterLootPanel, "Full Inventory Sound", 356, -72)
|
LeaPlusLC:MakeTx(FasterLootPanel, "Full Inventory Sound", 356, -72)
|
||||||
LeaPlusLC:MakeSL(FasterLootPanel, "FullInvSound", "Drag to set the desired sound played when your inventory is Full. Set 0 to disable sound.", 0, 3, 1, 356, -92, "%.0f")
|
LeaPlusLC:MakeSL(FasterLootPanel, "FullInvSound", "Drag to set the desired sound played when your inventory is Full. Set 0 to disable sound.", 0, 3, 1, 356, -92, "%.0f")
|
||||||
@@ -1846,6 +1847,7 @@ function LeaPlusLC:Isolated()
|
|||||||
-- Reset checkboxes
|
-- Reset checkboxes
|
||||||
LeaPlusLC["SmallerErrorFrame"] = "Off"
|
LeaPlusLC["SmallerErrorFrame"] = "Off"
|
||||||
LeaPlusLC["FasterErrorFrame"] = "Off"
|
LeaPlusLC["FasterErrorFrame"] = "Off"
|
||||||
|
LeaPlusLC["NoLootWorldforged"] = "Off"
|
||||||
LeaPlusLC["FullInvSound"] = 1
|
LeaPlusLC["FullInvSound"] = 1
|
||||||
UIErrorsFrame:SetHeight(60)
|
UIErrorsFrame:SetHeight(60)
|
||||||
UIErrorsFrame:SetTimeVisible(5)
|
UIErrorsFrame:SetTimeVisible(5)
|
||||||
@@ -2013,9 +2015,39 @@ function LeaPlusLC:Isolated()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- CoA: tooltip-scanner to detect Worldforged items.
|
||||||
|
-- Worldforged items show a green "Worldforged" line below the item name.
|
||||||
|
-- They aren't distinguishable by item ID alone (rolled drops use synthetic
|
||||||
|
-- IDs in the 1.5b+ range, but base items can also be Worldforged), so we
|
||||||
|
-- scan the tooltip and cache the result per itemLink.
|
||||||
|
local wfTooltip = CreateFrame("GameTooltip", "LeaPlusWorldforgedScanner", nil, "GameTooltipTemplate")
|
||||||
|
wfTooltip:SetOwner(WorldFrame, "ANCHOR_NONE")
|
||||||
|
local wfCache = {}
|
||||||
|
local function IsWorldforgedLink(itemLink)
|
||||||
|
if not itemLink then return false end
|
||||||
|
local cached = wfCache[itemLink]
|
||||||
|
if cached ~= nil then return cached end
|
||||||
|
wfTooltip:ClearLines()
|
||||||
|
wfTooltip:SetHyperlink(itemLink)
|
||||||
|
local found = false
|
||||||
|
for j = 2, math.min(wfTooltip:NumLines(), 5) do
|
||||||
|
local line = _G["LeaPlusWorldforgedScannerTextLeft" .. j]
|
||||||
|
if line then
|
||||||
|
local text = line:GetText()
|
||||||
|
if text and text:find("Worldforged") then
|
||||||
|
found = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
wfCache[itemLink] = found
|
||||||
|
return found
|
||||||
|
end
|
||||||
|
|
||||||
function AutoLoot:LootItems(numItems)
|
function AutoLoot:LootItems(numItems)
|
||||||
|
|
||||||
local lootThreshold = (self.isClassic and select(2, GetLootMethod()) == 0) and GetLootThreshold() or 10
|
local lootThreshold = (self.isClassic and select(2, GetLootMethod()) == 0) and GetLootThreshold() or 10
|
||||||
|
local skipWorldforged = LeaPlusLC["NoLootWorldforged"] == "On"
|
||||||
for i = numItems, 1, -1 do
|
for i = numItems, 1, -1 do
|
||||||
|
|
||||||
local itemLink = GetLootSlotLink(i)
|
local itemLink = GetLootSlotLink(i)
|
||||||
@@ -2027,6 +2059,11 @@ function LeaPlusLC:Isolated()
|
|||||||
-- print("item is locked")
|
-- print("item is locked")
|
||||||
self.isItemLocked = true
|
self.isItemLocked = true
|
||||||
|
|
||||||
|
elseif skipWorldforged and IsWorldforgedLink(itemLink) then
|
||||||
|
|
||||||
|
-- CoA: leave worldforged in the loot window for manual review
|
||||||
|
self.isItemLocked = true
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
--===== FIX ME =====--
|
--===== FIX ME =====--
|
||||||
@@ -17046,6 +17083,7 @@ local function eventHandler(self, event, arg1, arg2, ...)
|
|||||||
LeaPlusLC:LoadVarNum("FullInvSound", 1, 0, 3)
|
LeaPlusLC:LoadVarNum("FullInvSound", 1, 0, 3)
|
||||||
LeaPlusLC:LoadVarChk("SmallerErrorFrame", "Off") -- Release in PvP Exclude Alterac Valley
|
LeaPlusLC:LoadVarChk("SmallerErrorFrame", "Off") -- Release in PvP Exclude Alterac Valley
|
||||||
LeaPlusLC:LoadVarChk("FasterErrorFrame", "Off") -- Release in PvP Exclude Alterac Valley
|
LeaPlusLC:LoadVarChk("FasterErrorFrame", "Off") -- Release in PvP Exclude Alterac Valley
|
||||||
|
LeaPlusLC:LoadVarChk("NoLootWorldforged", "Off") -- CoA: skip auto-loot for worldforged items
|
||||||
|
|
||||||
|
|
||||||
LeaPlusLC:LoadVarChk("NoRestedEmotes", "Off") -- Silence rested emotes
|
LeaPlusLC:LoadVarChk("NoRestedEmotes", "Off") -- Silence rested emotes
|
||||||
@@ -17498,6 +17536,7 @@ local function eventHandler(self, event, arg1, arg2, ...)
|
|||||||
LeaPlusDB["FullInvSound"] = LeaPlusLC["FullInvSound"]
|
LeaPlusDB["FullInvSound"] = LeaPlusLC["FullInvSound"]
|
||||||
LeaPlusDB["SmallerErrorFrame"] = LeaPlusLC["SmallerErrorFrame"]
|
LeaPlusDB["SmallerErrorFrame"] = LeaPlusLC["SmallerErrorFrame"]
|
||||||
LeaPlusDB["FasterErrorFrame"] = LeaPlusLC["SmallerErrorFrame"]
|
LeaPlusDB["FasterErrorFrame"] = LeaPlusLC["SmallerErrorFrame"]
|
||||||
|
LeaPlusDB["NoLootWorldforged"] = LeaPlusLC["NoLootWorldforged"]
|
||||||
|
|
||||||
LeaPlusDB["NoRestedEmotes"] = LeaPlusLC["NoRestedEmotes"]
|
LeaPlusDB["NoRestedEmotes"] = LeaPlusLC["NoRestedEmotes"]
|
||||||
LeaPlusDB["MuteGameSounds"] = LeaPlusLC["MuteGameSounds"]
|
LeaPlusDB["MuteGameSounds"] = LeaPlusLC["MuteGameSounds"]
|
||||||
|
|||||||
Reference in New Issue
Block a user