Skip to content

Commit

Permalink
add slash commands (real config gui planned for future)
Browse files Browse the repository at this point in the history
  • Loading branch information
zendil committed Jul 29, 2016
1 parent b77fe5c commit 306a74f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Teds_PVP_Spelltimers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,28 @@ f:SetScript("OnUpdate", f.Update)
f:RegisterEvent("UNIT_AURA")
f:RegisterEvent("PLAYER_TARGET_CHANGED")
f:RegisterEvent("ADDON_LOADED")
--Define Slash Command Functions
local slash = {}
function slash:move(arg)
f:Mover()
end
function slash:help(arg)
print("TPST>Available commands are: /tpst move, /tpst help")
end
--Register Slash Commands
SLASH_TEDSPVPSPELLTIMERS1 = "/tpst"
local function SlashHandler(msg, editbox)
if msg == "" or msg == nil then
slash:help()
else
local command, arg = msg:match("^(%S*)%s*(.-)$")
command = string.lower(command)
if slash[command] then
slash[command](arg)
else
print("TPST>Not a recognized command! Try /tpst help")
end
end
end
SlashCmdList["TEDSPVPSPELLTIMERS"] = SlashHandler
--TODO: Ability to move frame, save position between sessions

0 comments on commit 306a74f

Please sign in to comment.