forked from isalcedo/VanillaGuide
-
Notifications
You must be signed in to change notification settings - Fork 2
/
SlashCommands.lua
45 lines (39 loc) · 988 Bytes
/
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
--[[--------------------------------------------------
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