-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSlashCommands.lua
More file actions
28 lines (28 loc) · 1.07 KB
/
SlashCommands.lua
File metadata and controls
28 lines (28 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
local _, MPT = ...
local L = LibStub("AceLocale-3.0"):GetLocale("MPlusTimer")
function MPT.UI:SlashCommand(msg)
if msg == "debug" then
if MPTSV.debug then
MPTSV.debug = false
MPTGlobal = nil
print(L["Disabled debug mode for MPlusTimer"])
else
MPTSV.debug = true
MPTGlobal = MPT
print(L["Enabled debug mode for MPlusTimer, which allows accessing all local functions"])
end
elseif msg == "preview" then
if not MPT.IsPreview then -- not currently in preview
MPT:Init(true) -- Frame is set to movable in here as well
elseif C_ChallengeMode.IsChallengeModeActive() then -- in preview and currently in m+ so we display real states
MPT:Init(false)
MPT:MoveFrame(false)
elseif MPT.Frame and MPT.Frame:IsShown() then -- in preview but not in m+ so we hide the frame
MPT:ShowFrame(false)
end
elseif msg == "best" then
MPT:ShowPBFrame()
else
Settings.OpenToCategory(self.optionsFrame.name)
end
end