libtipscan: add new tooltip scanning library

This commit is contained in:
Road-block
2018-07-31 21:23:01 +02:00
committed by shagu
parent 1cebe52e29
commit 44ffb10024
14 changed files with 260 additions and 110 deletions
+2 -4
View File
@@ -289,13 +289,11 @@ hooksecurefunc("CastSpellByName", function(spellName, target)
end
end, true)
local scanner = CreateFrame("GameTooltip", "pfSpellScanner", nil, "GameTooltipTemplate")
scanner:SetOwner(WorldFrame, "ANCHOR_NONE")
local scanner = libtipscan:GetScanner("libcast")
hooksecurefunc("UseAction", function(slot, target, button)
if GetActionText(slot) or not IsCurrentAction(slot) then return end
scanner:ClearLines()
scanner:SetAction(slot)
local spellName = pfSpellScannerTextLeft1:GetText()
local spellName = scanner:Line(1)
CastCustom(spellName)
end, true)