mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
update command /in
This commit is contained in:
+8
-15
@@ -95,33 +95,26 @@ 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
|
||||||
|
|
||||||
-- Set up a private editbox to handle macro execution
|
|
||||||
local editbox = CreateFrame("Editbox", "MacroEditBox")
|
local editbox = CreateFrame("Editbox", "MacroEditBox")
|
||||||
local line
|
|
||||||
editbox:RegisterEvent("EXECUTE_CHAT_LINE")
|
|
||||||
editbox:SetScript("OnEvent", function(self, event)
|
|
||||||
if event == "EXECUTE_CHAT_LINE" then
|
|
||||||
local defaulteditbox = pcall(ChatFrameEditBox)
|
|
||||||
self:SetText(line)
|
|
||||||
ChatEdit_SendText(self)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
editbox:Hide()
|
editbox:Hide()
|
||||||
|
|
||||||
local function OnCallback()
|
local function OnCallback(command)
|
||||||
MacroEditBox:GetScript("OnEvent")(MacroEditBox, "EXECUTE_CHAT_LINE")
|
local defaulteditbox = ChatFrameEditBox
|
||||||
|
MacroEditBox.chatType = defaulteditbox.chatType
|
||||||
|
MacroEditBox.tellTarget = defaulteditbox.tellTarget
|
||||||
|
MacroEditBox.channelTarget = defaulteditbox.channelTarget
|
||||||
|
MacroEditBox:SetText(command)
|
||||||
|
ChatEdit_SendText(MacroEditBox)
|
||||||
end
|
end
|
||||||
|
|
||||||
function E:DelayScriptCall(msg)
|
function E:DelayScriptCall(msg)
|
||||||
local secs, command = match(msg, "^(%S+)%s+(.*)$")
|
local secs, command = match(msg, "^(%S+)%s+(.*)$")
|
||||||
line = command
|
|
||||||
secs = tonumber(secs)
|
secs = tonumber(secs)
|
||||||
if (not secs) or (len(command) == 0) then
|
if (not secs) or (len(command) == 0) 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)
|
E:ScheduleTimer(OnCallback, secs, 1, command)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user