-
Notifications
You must be signed in to change notification settings - Fork 54
/
SlashCommands.lua
65 lines (59 loc) · 1.49 KB
/
SlashCommands.lua
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
--[[--------------------------------------------------
----- VanillaGuide -----
------------------
SlashCommands.lua
Authors: mrmr
Version: 1.04.2
------------------------------------------------------
Description:
This file handles Slash Commands using Ace2 lib
1.00
-- Initial Ace2 release
1.99a
-- Ally addition starter version
1.03
-- No Changes. Just adjusting "version".
1.99x for a beta release was a weird choise.
1.04.1
-- no changes at all ;)
1.04.2
-- no changes in here for this revision
------------------------------------------------------
Connection:
--]]--------------------------------------------------
local VGuide = VGuide
local options = {
type='group',
args = {
toggle = {
type = 'toggle',
name = 'toggle',
desc = 'This Toggle VanillaGuide Main Frame visibility',
get = "IsMFVisible",
set = "ToggleMFVisibility"
}
--},
},
}
VGuide:RegisterChatCommand({"/vguide", "/vg"}, options)
function VGuide:IsMFVisible()
local frame = getglobal("VG_MainFrame")
return frame:IsVisible()
end
function VGuide:ToggleMFVisibility()
local frame = getglobal("VG_MainFrame")
local fSettings = getglobal("VG_SettingsFrame")
if frame:IsVisible() then
frame:Hide()
if fSettings:IsVisible() then
fSettings.showthis = true
fSettings:Hide()
end
else
frame:Show()
if fSettings.showthis then
fSettings:Show()
end
end
end
return VGuide