From 0d0f4d6039cfdc77eb64461598fbff6a576919a2 Mon Sep 17 00:00:00 2001 From: shagu Date: Tue, 1 May 2018 12:18:19 +0200 Subject: [PATCH] mouseover: allow to use functions --- modules/mouseover.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/mouseover.lua b/modules/mouseover.lua index 361c83ff..a498ec91 100644 --- a/modules/mouseover.lua +++ b/modules/mouseover.lua @@ -2,7 +2,8 @@ pfUI:RegisterModule("mouseover", function () pfUI.uf.mouseover = CreateFrame("Frame", "pfMouseOver", UIParent) _G.SLASH_PFCAST1, _G.SLASH_LPFCAST2 = "/pfcast", "/pfmouse" - function SlashCmdList.PFCAST(msg, editbox) + function SlashCmdList.PFCAST(msg) + local func = loadstring(msg or "") local oldt = true local unit = "mouseover" if not UnitExists(unit) then @@ -21,7 +22,12 @@ pfUI:RegisterModule("mouseover", function () if UnitIsUnit("target", unit) then oldt = nil end TargetUnit(unit) - CastSpellByName(msg) + + if func then + func() + else + CastSpellByName(msg) + end if oldt then if pfUI.uf.target then