-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathExample.lua
262 lines (234 loc) · 5.85 KB
/
Example.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
local MacLib = loadstring(game:HttpGet("https://github.com/biggaboy212/Maclib/releases/latest/download/maclib.txt"))()
local Window = MacLib:Window({
Title = "Maclib Demo",
Subtitle = "This is a subtitle.",
Size = UDim2.fromOffset(868, 650),
DragStyle = 1,
DisabledWindowControls = {},
ShowUserInfo = true,
Keybind = Enum.KeyCode.RightControl,
AcrylicBlur = true,
})
local globalSettings = {
UIBlurToggle = Window:GlobalSetting({
Name = "UI Blur",
Default = Window:GetAcrylicBlurState(),
Callback = function(bool)
Window:SetAcrylicBlurState(bool)
Window:Notify({
Title = Window.Settings.Title,
Description = (bool and "Enabled" or "Disabled") .. " UI Blur",
Lifetime = 5
})
end,
}),
NotificationToggler = Window:GlobalSetting({
Name = "Notifications",
Default = Window:GetNotificationsState(),
Callback = function(bool)
Window:SetNotificationsState(bool)
Window:Notify({
Title = Window.Settings.Title,
Description = (bool and "Enabled" or "Disabled") .. " Notifications",
Lifetime = 5
})
end,
}),
ShowUserInfo = Window:GlobalSetting({
Name = "Show User Info",
Default = Window:GetUserInfoState(),
Callback = function(bool)
Window:SetUserInfoState(bool)
Window:Notify({
Title = Window.Settings.Title,
Description = (bool and "Showing" or "Redacted") .. " User Info",
Lifetime = 5
})
end,
})
}
local tabGroups = {
TabGroup1 = Window:TabGroup()
}
local tabs = {
Main = tabGroups.TabGroup1:Tab({ Name = "Demo", Image = "rbxassetid://18821914323" }),
Settings = tabGroups.TabGroup1:Tab({ Name = "Settings", Image = "rbxassetid://10734950309" })
}
local sections = {
MainSection1 = tabs.Main:Section({ Side = "Left" }),
}
sections.MainSection1:Header({
Name = "Header #1"
})
sections.MainSection1:Button({
Name = "Button",
Callback = function()
Window:Dialog({
Title = Window.Settings.Title,
Description = "Lorem ipsum odor amet, consectetuer adipiscing elit. Eros vestibulum aliquet mattis, ex platea nunc.",
Buttons = {
{
Name = "Confirm",
Callback = function()
print("Confirmed!")
end,
},
{
Name = "Cancel"
}
}
})
end,
})
sections.MainSection1:Input({
Name = "Input",
Placeholder = "Input",
AcceptedCharacters = "All",
Callback = function(input)
Window:Notify({
Title = Window.Settings.Title,
Description = "Successfully set input to " .. input
})
end,
onChanged = function(input)
print("Input is now " .. input)
end,
}, "Input")
sections.MainSection1:Slider({
Name = "Slider",
Default = 50,
Minimum = 0,
Maximum = 100,
DisplayMethod = "Percent",
Precision = 0,
Callback = function(Value)
print("Changed to ".. Value)
end
}, "Slider")
sections.MainSection1:Toggle({
Name = "Toggle",
Default = false,
Callback = function(value)
Window:Notify({
Title = Window.Settings.Title,
Description = (value and "Enabled " or "Disabled ") .. "Toggle"
})
end,
}, "Toggle")
sections.MainSection1:Keybind({
Name = "Keybind",
Blacklist = false,
Callback = function(binded)
Window:Notify({
Title = "Demo Window",
Description = "Pressed keybind - "..tostring(binded.Name),
Lifetime = 3
})
end,
onBinded = function(bind)
Window:Notify({
Title = "Demo Window",
Description = "Successfully Binded Keybind to - "..tostring(bind.Name),
Lifetime = 3
})
end,
}, "Keybind")
sections.MainSection1:Colorpicker({
Name = "Colorpicker",
Default = Color3.fromRGB(0, 255, 255),
Callback = function(color)
print("Color: ", color)
end,
}, "Colorpicker")
local alphaColorPicker = sections.MainSection1:Colorpicker({
Name = "Transparency Colorpicker",
Default = Color3.fromRGB(255,0,0),
Alpha = 0,
Callback = function(color, alpha)
print("Color: ", color, " Alpha: ", alpha)
end,
}, "TransparencyColorpicker")
local rainbowActive
local rainbowConnection
local hue = 0
sections.MainSection1:Toggle({
Name = "Rainbow",
Default = false,
Callback = function(value)
rainbowActive = value
if rainbowActive then
rainbowConnection = game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
hue = (hue + deltaTime * 0.1) % 1
alphaColorPicker:SetColor(Color3.fromHSV(hue, 1, 1))
end)
elseif rainbowConnection then
rainbowConnection:Disconnect()
rainbowConnection = nil
end
end,
}, "RainbowToggle")
local optionTable = {
"Apple",
"Banana",
"Orange",
"Grapes",
"Pineapple",
"Mango",
"Strawberry",
"Blueberry",
"Watermelon",
"Peach"
}
local Dropdown = sections.MainSection1:Dropdown({
Name = "Dropdown",
Multi = false,
Required = true,
Options = optionTable,
Default = 1,
Callback = function(Value)
print("Dropdown changed: ".. Value)
end,
}, "Dropdown")
local MultiDropdown = sections.MainSection1:Dropdown({
Name = "Multi Dropdown",
Search = true,
Multi = true,
Required = false,
Options = optionTable,
Default = {"Apple", "Orange"},
Callback = function(Value)
local Values = {}
for Value, State in next, Value do
table.insert(Values, Value)
end
print("Mutlidropdown changed:", table.concat(Values, ", "))
end,
}, "MultiDropdown")
sections.MainSection1:Button({
Name = "Update Selection",
Callback = function()
Dropdown:UpdateSelection("Grapes")
MultiDropdown:UpdateSelection({"Banana", "Pineapple"})
end,
})
sections.MainSection1:Divider()
sections.MainSection1:Header({
Text = "Header #2"
})
sections.MainSection1:Paragraph({
Header = "Paragraph",
Body = "Paragraph body. Lorem ipsum odor amet, consectetuer adipiscing elit. Morbi tempus netus aliquet per velit est gravida."
})
sections.MainSection1:Label({
Text = "Label. Lorem ipsum odor amet, consectetuer adipiscing elit."
})
sections.MainSection1:SubLabel({
Text = "Sub-Label. Lorem ipsum odor amet, consectetuer adipiscing elit."
})
MacLib:SetFolder("Maclib")
tabs.Settings:InsertConfigSection("Left")
Window.onUnloaded(function()
print("Unloaded!")
end)
tabs.Main:Select()
MacLib:LoadAutoLoadConfig()