helpers: make hooksecurefunc append by default
This commit is contained in:
+3
-3
@@ -381,7 +381,7 @@ hooksecurefunc("CastSpell", function(id, bookType)
|
||||
local spellName = GetSpellName(id, bookType)
|
||||
CastCustom(spellName)
|
||||
end
|
||||
end, true)
|
||||
end)
|
||||
|
||||
hooksecurefunc("CastSpellByName", function(spell, target)
|
||||
_, lastrank = libspell.GetSpellInfo(spell)
|
||||
@@ -393,7 +393,7 @@ hooksecurefunc("CastSpellByName", function(spell, target)
|
||||
return
|
||||
end
|
||||
end
|
||||
end, true)
|
||||
end)
|
||||
|
||||
hooksecurefunc("UseAction", function(slot, target, button)
|
||||
scanner:SetAction(slot)
|
||||
@@ -404,6 +404,6 @@ hooksecurefunc("UseAction", function(slot, target, button)
|
||||
|
||||
if GetActionText(slot) or not IsCurrentAction(slot) then return end
|
||||
CastCustom(spellName)
|
||||
end, true)
|
||||
end)
|
||||
|
||||
ShaguTweaks.libcast = libcast
|
||||
|
||||
+3
-3
@@ -224,13 +224,13 @@ hooksecurefunc("CastSpell", function(id, bookType)
|
||||
local _, rank = libspell.GetSpellInfo(id, bookType)
|
||||
local duration = libdebuff:GetDuration(effect, rank)
|
||||
libdebuff:AddPending(UnitName("target"), UnitLevel("target"), effect, duration)
|
||||
end, true)
|
||||
end)
|
||||
|
||||
hooksecurefunc("CastSpellByName", function(effect, target)
|
||||
local _, rank = libspell.GetSpellInfo(effect)
|
||||
local duration = libdebuff:GetDuration(effect, rank)
|
||||
libdebuff:AddPending(UnitName("target"), UnitLevel("target"), effect, duration)
|
||||
end, true)
|
||||
end)
|
||||
|
||||
hooksecurefunc("UseAction", function(slot, target, button)
|
||||
if GetActionText(slot) or not IsCurrentAction(slot) then return end
|
||||
@@ -238,7 +238,7 @@ hooksecurefunc("UseAction", function(slot, target, button)
|
||||
local effect, rank = scanner:Line(1)
|
||||
local duration = libdebuff:GetDuration(effect, rank)
|
||||
libdebuff:AddPending(UnitName("target"), UnitLevel("target"), effect, duration)
|
||||
end, true)
|
||||
end)
|
||||
|
||||
function libdebuff:UnitDebuff(unit, id)
|
||||
local unitname = UnitName(unit)
|
||||
|
||||
+3
-3
@@ -304,7 +304,7 @@ hooksecurefunc("CastSpell", function(id, bookType)
|
||||
spell_queue[1] = effect
|
||||
spell_queue[2] = effect.. ( rank or "" )
|
||||
spell_queue[3] = UnitName("target") and UnitCanAssist("player", "target") and UnitName("target") or UnitName("player")
|
||||
end, true)
|
||||
end)
|
||||
|
||||
hooksecurefunc("CastSpellByName", function(effect, target)
|
||||
if not libpredict.sender.enabled then return end
|
||||
@@ -313,7 +313,7 @@ hooksecurefunc("CastSpellByName", function(effect, target)
|
||||
spell_queue[1] = effect
|
||||
spell_queue[2] = effect.. ( rank or "" )
|
||||
spell_queue[3] = UnitName("target") and UnitCanAssist("player", "target") and UnitName("target") or UnitName("player")
|
||||
end, true)
|
||||
end)
|
||||
|
||||
local scanner = libtipscan:GetScanner("prediction")
|
||||
hooksecurefunc("UseAction", function(slot, target, selfcast)
|
||||
@@ -325,7 +325,7 @@ hooksecurefunc("UseAction", function(slot, target, selfcast)
|
||||
spell_queue[1] = effect
|
||||
spell_queue[2] = effect.. ( rank or "" )
|
||||
spell_queue[3] = selfcast and UnitName("player") or UnitName("target") and UnitCanAssist("player", "target") and UnitName("target") or UnitName("player")
|
||||
end, true)
|
||||
end)
|
||||
|
||||
libpredict.sender = CreateFrame("Frame", "ShaguTweaksPredictionSender", UIParent)
|
||||
libpredict.sender.enabled = true
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
local _G = ShaguTweaks.GetGlobalEnv()
|
||||
local GetExpansion = ShaguTweaks.GetExpansion
|
||||
local libtipscan = ShaguTweaks.libtipscan
|
||||
local hooksecurefunc = ShaguTweaks.hooksecurefunc
|
||||
|
||||
local scanner = libtipscan:GetScanner("libspell")
|
||||
local libspell = {}
|
||||
|
||||
Reference in New Issue
Block a user