Removed UNIT_SPELLCAST_FAILED_QUIET handling (#18)

* Make sure items from import lists are cached

* Remove UNIT_SPELLCAST_FAILED_QUIET handling
Several talents seem to have a pulsing silent fail, EG blessed weapons, while watching for the event doesn't appear to help detect when crafter interrupts their craft.
This commit is contained in:
Jeremy P
2024-11-15 06:43:40 -08:00
committed by GitHub
parent b87f11ed87
commit 6b21cdf310
2 changed files with 53 additions and 50 deletions
+4
View File
@@ -1314,6 +1314,7 @@ function TSM:ImportGroup(importStr, groupPath)
end
local items = {}
local bulkquerybuffer = {}
local currentSubPath = ""
for _, str in ipairs(TSMAPI:SafeStrSplit(importStr, ",")) do
str = str:trim()
@@ -1336,10 +1337,13 @@ function TSM:ImportGroup(importStr, groupPath)
currentSubPath = subPath
elseif itemString then
items[itemString] = currentSubPath
local item = Item:CreateFromID(tonumber(noSpaceStr))
if not item:IsCached() then bulkquerybuffer[#bulkquerybuffer+1] = item.itemID end
else
return
end
end
TSMAPI:BulkQuery(bulkquerybuffer)
local num = 0
for itemString, subPath in pairs(items) do
@@ -50,7 +50,6 @@ function GUI:OnEnable()
GUI:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED", "EventHandler")
GUI:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED", "EventHandler")
GUI:RegisterEvent("UNIT_SPELLCAST_FAILED", "EventHandler")
GUI:RegisterEvent("UNIT_SPELLCAST_FAILED_QUIET", "EventHandler")
GUI:RegisterEvent("GUILDBANKFRAME_OPENED", "GatheringEventHandler")
GUI:RegisterEvent("GUILDBANKFRAME_CLOSED", "GatheringEventHandler")
GUI:RegisterEvent("GUILDBANKBAGSLOTS_CHANGED", "GatheringEventHandler")
@@ -240,7 +239,7 @@ function GUI:EventHandler(event, ...)
-- no longer casting a spell so discard spellID
TSM.currentspell = nil
-- TSMAPI:CreateTimeDelay("craftingQueueUpdateThrottle", 0.2, GUI.UpdateQueue)
elseif event == "UNIT_SPELLCAST_INTERRUPTED" or event == "UNIT_SPELLCAST_FAILED" or event == "UNIT_SPELLCAST_FAILED_QUIET" then
elseif event == "UNIT_SPELLCAST_INTERRUPTED" or event == "UNIT_SPELLCAST_FAILED" then
local unit = ...
if unit ~= "player" then return end