This repository has been archived by the owner on Apr 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Safe Configs.lua
66 lines (59 loc) · 2.58 KB
/
Safe Configs.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
66
local configdelete = gui.Reference("Settings", "Configurations", "Manage Configurations", "Delete")
local configreset = gui.Reference("Settings", "Configurations", "Manage Configurations", "Reset")
local configsave = gui.Reference("Settings", "Configurations", "Manage Configurations", "Save")
local configimport = gui.Reference( "Settings", "Configurations", "Manage Configurations", "Import from Clipboard")
local luadelete = gui.Reference("Settings", "Lua Scripts", "Manage Scripts", "Delete")
local menu = gui.Reference("Menu")
local configcheckbox = gui.Checkbox(gui.Reference("Settings", "Configurations", "Manage Configurations"), _, "", 0)
local configtext = gui.Text(gui.Reference("Settings", "Configurations", "Manage Configurations"), "Enable destructive actions")
local luacheckbox = gui.Checkbox(gui.Reference("Settings", "Lua Scripts", "Manage Scripts"), _, "", 0)
local luatext = gui.Text(gui.Reference("Settings", "Lua Scripts", "Manage Scripts"), "Enable destructive actions")
configcheckbox:SetPosX(568)
configcheckbox:SetPosY(-43)
configtext:SetPosX(427)
configtext:SetPosY(-38)
luacheckbox:SetPosX(568)
luacheckbox:SetPosY(-43)
luatext:SetPosX(427)
luatext:SetPosY(-38)
local menustate = false
local toggled = false
configdelete:SetDisabled(true)
configreset:SetDisabled(true)
configsave:SetDisabled(true)
configimport:SetDisabled(true)
luadelete:SetDisabled(true)
local function ondraw()
if menu:IsActive() then
if (configcheckbox:GetValue() or luacheckbox:GetValue()) and not toggled then
configcheckbox:SetValue(true)
luacheckbox:SetValue(true)
configdelete:SetDisabled(false)
configreset:SetDisabled(false)
configsave:SetDisabled(false)
configimport:SetDisabled(false)
luadelete:SetDisabled(false)
toggled = true
end
if (not configcheckbox:GetValue() or not luacheckbox:GetValue()) and toggled then
configcheckbox:SetValue(false)
luacheckbox:SetValue(false)
configdelete:SetDisabled(true)
configreset:SetDisabled(true)
configsave:SetDisabled(true)
configimport:SetDisabled(true)
luadelete:SetDisabled(true)
toggled = false
end
elseif toggled then
configcheckbox:SetValue(false)
luacheckbox:SetValue(false)
configdelete:SetDisabled(true)
configreset:SetDisabled(true)
configsave:SetDisabled(true)
configimport:SetDisabled(true)
luadelete:SetDisabled(true)
toggled = false
end
end
callbacks.Register("Draw", ondraw)