mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 16:34:45 +00:00
update DelayScriptCall function and load /kb command
This commit is contained in:
+23
-7
@@ -96,18 +96,34 @@ function E:BGStats()
|
|||||||
E:Print(L["Battleground datatexts will now show again if you are inside a battleground."])
|
E:Print(L["Battleground datatexts will now show again if you are inside a battleground."])
|
||||||
end
|
end
|
||||||
|
|
||||||
local function OnCallback(command)
|
-- Set up a private editbox to handle macro execution
|
||||||
MacroEditBox:GetScript("OnEvent")(MacroEditBox, "EXECUTE_CHAT_LINE", command)
|
local commando
|
||||||
|
local editbox = CreateFrame("Editbox", "MacroEditBox")
|
||||||
|
editbox:RegisterEvent("EXECUTE_CHAT_LINE")
|
||||||
|
editbox:SetScript("OnEvent",
|
||||||
|
function(self, event)
|
||||||
|
if event == "EXECUTE_CHAT_LINE" then
|
||||||
|
local defaulteditbox = pcall(ChatFrameEditBox)
|
||||||
|
self:SetText(commando)
|
||||||
|
ChatEdit_SendText(self)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
editbox:Hide()
|
||||||
|
|
||||||
|
local function OnCallback()
|
||||||
|
MacroEditBox:GetScript("OnEvent")(MacroEditBox, "EXECUTE_CHAT_LINE")
|
||||||
end
|
end
|
||||||
|
|
||||||
function E:DelayScriptCall(msg)
|
function E:DelayScriptCall(msg)
|
||||||
local secs, command = match(msg, "^([^%s]+)%s+(.*)$")
|
local secs, command = match(msg, "^([^%s]+)%s+(.*)$")
|
||||||
secs = tonumber(secs)
|
secs = tonumber(secs)
|
||||||
if (not secs) or (getn(command) == 0) then
|
commando = command
|
||||||
|
if not secs or not command then
|
||||||
self:Print("usage: /in <seconds> <command>")
|
self:Print("usage: /in <seconds> <command>")
|
||||||
self:Print("example: /in 1.5 /say hi")
|
self:Print("example: /in 1.5 /say hi")
|
||||||
else
|
else
|
||||||
E:ScheduleTimer(OnCallback, secs, command)
|
E:ScheduleTimer(OnCallback, secs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -124,7 +140,7 @@ function E:LoadCommands()
|
|||||||
self:RegisterChatCommand("disable", "DisableAddon")
|
self:RegisterChatCommand("disable", "DisableAddon")
|
||||||
self:RegisterChatCommand("farmmode", "FarmMode")
|
self:RegisterChatCommand("farmmode", "FarmMode")
|
||||||
|
|
||||||
-- if E:GetModule("ActionBars") and E.private.actionbar.enable then
|
if E:GetModule("ActionBars") and E.private.actionbar.enable then
|
||||||
-- self:RegisterChatCommand("kb", E:GetModule("ActionBars").ActivateBindMode)
|
self:RegisterChatCommand("kb", E:GetModule("ActionBars").ActivateBindMode)
|
||||||
-- end
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user