-
Notifications
You must be signed in to change notification settings - Fork 14
/
source.lua
1975 lines (1642 loc) · 61.2 KB
/
source.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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- Source code here!
local Library = {Count = 0, Tab = nil}
local Themes = {
Light = {
Main = Color3.fromRGB(190, 190, 190),
TabsBackground = Color3.fromRGB(54, 57, 63),
ScrollBar = Color3.fromRGB(50, 50, 50),
QuitText = Color3.fromRGB(220, 220, 220),
TabDefault = Color3.fromRGB(150, 150, 160),
TabHovered = Color3.fromRGB(50, 150, 170),
TabSelected = Color3.fromRGB(45, 190, 220),
DividerBackground = Color3.fromRGB(210, 210, 210),
DividerText = Color3.fromRGB(50, 50, 50),
OptionBackground = Color3.fromRGB(255, 255, 255),
OptionHover = Color3.fromRGB(240, 240, 240),
OptionClick = Color3.fromRGB(225, 225, 225),
OptionText = Color3.fromRGB(50, 50, 50),
OptionDescription = Color3.fromRGB(100, 100, 100),
OptionImage = Color3.fromRGB(50, 50, 50),
ToggleTrue = Color3.fromRGB(125, 230, 155),
ToggleFalse = Color3.fromRGB(205, 95, 95),
ToggleIndicator = Color3.fromRGB(50, 50, 50),
DropdownOptionsBackground = Color3.fromRGB(255, 255, 255),
DropdownScrollbar = Color3.fromRGB(200, 200, 200),
DropdownOption = Color3.fromRGB(255, 255, 255),
DropdownText = Color3.fromRGB(50, 50, 50),
DropdownOptionHover = Color3.fromRGB(240, 240, 240),
DropdownOptionClick = Color3.fromRGB(225, 225, 225),
ColourPickerBackground = Color3.fromRGB(255, 255, 255),
BoxOutline = Color3.fromRGB(150, 150, 150),
BoxHover = Color3.fromRGB(100, 100, 100),
BoxClick = Color3.fromRGB(50, 50, 50),
BoxPlaceholder = Color3.fromRGB(225, 225, 225)
},
Red = {
Main = Color3.fromRGB(130, 30, 30),
TabsBackground = Color3.fromRGB(122, 22, 22),
ScrollBar = Color3.fromRGB(250, 150, 150),
QuitText = Color3.fromRGB(240, 225, 225),
TabDefault = Color3.fromRGB(225, 125, 125),
TabHovered = Color3.fromRGB(240, 190, 190),
TabSelected = Color3.fromRGB(355, 255, 255),
DividerBackground = Color3.fromRGB(140, 40, 40),
DividerText = Color3.fromRGB(255, 255, 255),
OptionBackground = Color3.fromRGB(150, 50, 50),
OptionHover = Color3.fromRGB(165, 65, 65),
OptionClick = Color3.fromRGB(180, 80, 80),
OptionText = Color3.fromRGB(255, 255, 255),
OptionDescription = Color3.fromRGB(245, 205, 205),
OptionImage = Color3.fromRGB(255, 255, 255),
ToggleTrue = Color3.fromRGB(225, 230, 155),
ToggleFalse = Color3.fromRGB(195, 95, 95),
ToggleIndicator = Color3.fromRGB(255, 255, 255),
DropdownOptionsBackground = Color3.fromRGB(150, 50, 50),
DropdownScrollbar = Color3.fromRGB(130, 30, 30),
DropdownOption = Color3.fromRGB(150, 50, 50),
DropdownText = Color3.fromRGB(255, 255, 255),
DropdownOptionHover = Color3.fromRGB(165, 65, 65),
DropdownOptionClick = Color3.fromRGB(180, 80, 80),
ColourPickerBackground = Color3.fromRGB(150, 50, 50),
BoxOutline = Color3.fromRGB(225, 125, 125),
BoxHover = Color3.fromRGB(235, 175, 175),
BoxClick = Color3.fromRGB(245, 225, 225),
BoxPlaceholder = Color3.fromRGB(245, 225, 225)
},
Discord = {
Main = Color3.fromRGB(54, 57, 63),
TabsBackground = Color3.fromRGB(47, 49, 54),
ScrollBar = Color3.fromRGB(54, 57, 63),
QuitText = Color3.fromRGB(225, 225, 225),
TabDefault = Color3.fromRGB(125, 125, 125),
TabHovered = Color3.fromRGB(190, 190, 190),
TabSelected = Color3.fromRGB(255, 255, 255),
DividerBackground = Color3.fromRGB(64, 67, 73),
DividerText = Color3.fromRGB(255, 255, 255),
OptionBackground = Color3.fromRGB(88, 101, 242),
OptionHover = Color3.fromRGB(71, 82, 196),
OptionClick = Color3.fromRGB(75, 86, 203),
OptionText = Color3.fromRGB(255, 255, 255),
OptionDescription = Color3.fromRGB(205, 205, 205),
OptionImage = Color3.fromRGB(255, 255, 255),
ToggleTrue = Color3.fromRGB(22, 168, 76),
ToggleFalse = Color3.fromRGB(47, 49, 54),
ToggleIndicator = Color3.fromRGB(255, 255, 255),
DropdownOptionsBackground = Color3.fromRGB(47,49,54),
DropdownScrollbar = Color3.fromRGB(54, 57, 63),
DropdownOption = Color3.fromRGB(88, 101, 242),
DropdownText = Color3.fromRGB(255, 255, 255),
DropdownOptionHover = Color3.fromRGB(71, 82, 196),
DropdownOptionClick = Color3.fromRGB(75, 86, 203),
ColourPickerBackground = Color3.fromRGB(47, 49, 54),
BoxOutline = Color3.fromRGB(225, 225, 225),
BoxHover = Color3.fromRGB(175, 175, 175),
BoxClick = Color3.fromRGB(225, 225, 225),
BoxPlaceholder = Color3.fromRGB(225, 225, 225)
},
Dark = {
Main = Color3.fromRGB(30, 30, 30),
TabsBackground = Color3.fromRGB(22, 22, 22),
ScrollBar = Color3.fromRGB(150, 150, 150),
QuitText = Color3.fromRGB(225, 225, 225),
TabDefault = Color3.fromRGB(125, 125, 125),
TabHovered = Color3.fromRGB(190, 190, 190),
TabSelected = Color3.fromRGB(255, 255, 255),
DividerBackground = Color3.fromRGB(40, 40, 40),
DividerText = Color3.fromRGB(255, 255, 255),
OptionBackground = Color3.fromRGB(50, 50, 50),
OptionHover = Color3.fromRGB(65, 65, 65),
OptionClick = Color3.fromRGB(80, 80, 80),
OptionText = Color3.fromRGB(255, 255, 255),
OptionDescription = Color3.fromRGB(205, 205, 205),
OptionImage = Color3.fromRGB(255, 255, 255),
ToggleTrue = Color3.fromRGB(125, 230, 155),
ToggleFalse = Color3.fromRGB(205, 95, 95),
ToggleIndicator = Color3.fromRGB(255, 255, 255),
DropdownOptionsBackground = Color3.fromRGB(50, 50, 50),
DropdownScrollbar = Color3.fromRGB(30, 30, 30),
DropdownOption = Color3.fromRGB(50, 50, 50),
DropdownText = Color3.fromRGB(255, 255, 255),
DropdownOptionHover = Color3.fromRGB(65, 65, 65),
DropdownOptionClick = Color3.fromRGB(80, 80, 80),
ColourPickerBackground = Color3.fromRGB(50, 50, 50),
BoxOutline = Color3.fromRGB(125, 125, 125),
BoxHover = Color3.fromRGB(175, 175, 175),
BoxClick = Color3.fromRGB(225, 225, 225),
BoxPlaceholder = Color3.fromRGB(225, 225, 225)
}
}
local Objects = {
Shadow = {
Type = "ImageLabel",
Name = "Shadow",
AnchorPoint = Vector2.new(0.5, 0.5),
BackgroundTransparency = 1,
Position = UDim2.new(0.5, 0, 0.5, 0),
Size = UDim2.new(1, 12, 1, 12),
ImageTransparency = 0.5,
Image = "rbxassetid://1316045217",
ImageColor3 = Color3.fromRGB(22, 22, 22),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(10, 10, 118, 118),
},
Round = {
Type = "UICorner",
Name = "Rounding",
CornerRadius = UDim.new(0, 4)
},
MainOptionFrame = {
Type = "TextButton",
Name = "Button",
Size = UDim2.new(1, -10, 0, 30),
Text = "",
AutoButtonColor = false
},
OptionLabel = {
Type = "TextLabel",
Name = "ButtonLabel",
BackgroundTransparency = 1,
Size = UDim2.new(1, 0, 0, 30),
Font = Enum.Font.SourceSansSemibold,
TextSize = 16,
TextXAlignment = Enum.TextXAlignment.Left
},
OptionDescription = {
Type = "TextLabel",
Name = "ButtonDescription",
BackgroundTransparency = 1,
TextTransparency = 1,
Size = UDim2.new(1, 0, 0, 30),
Font = Enum.Font.SourceSansSemibold,
TextSize = 16,
TextXAlignment = Enum.TextXAlignment.Left
}
}
Library.Object = function(_, Type, Properties)
local Object = nil
if Objects[Type] and type(Objects[Type]) == "table" then
Object = Instance.new(Objects[Type].Type)
Object.Parent = Properties
table.foreach(Objects[Type], function(Property, Value)
if Property ~= "Type" then
local s, e = pcall(function() Object[Property] = Value end)
if not s then print(e) end
end
end)
else
Object = Instance.new(Type)
table.foreach(Properties, function(Property, Value)
local s, e = pcall(function() Object[Property] = Value end)
if not s then print(e) table.foreach(Properties, print) end
end)
end
return Object
end
--services and useful stuff
local Player = game:GetService("Players").LocalPlayer
local RS = game:GetService("RunService")
local TS = game:GetService("TweenService")
local UIS = game:GetService("UserInputService")
local Mouse = Player:GetMouse()
local TI = function(Time)
return TweenInfo.new(Time, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
end
--linoria's dragger
local AddDragger = function(Frame)
local S, Event = pcall(function()
return Frame.MouseEnter
end)
if S then
Frame.Active = true;
Event:connect(function()
local Input = Frame.InputBegan:connect(function(Key)
if Key.UserInputType == Enum.UserInputType.MouseButton1 then
local ObjectPosition = Vector2.new(Mouse.X - Frame.AbsolutePosition.X, Mouse.Y - Frame.AbsolutePosition.Y)
while RS.RenderStepped:wait() and UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
Frame:TweenPosition(UDim2.new(0, Mouse.X - ObjectPosition.X + (Frame.Size.X.Offset * Frame.AnchorPoint.X), 0, Mouse.Y - ObjectPosition.Y + (Frame.Size.Y.Offset * Frame.AnchorPoint.Y)), 'Out', 'Quad', 0.06, true)
end
end
end)
local Leave
Leave = Frame.MouseLeave:connect(function()
Input:disconnect()
Leave:disconnect()
end)
end)
end
end
Library.Create = function(_, LibraryOptions)
local self = Library
self.Dropdowns = {}
self.ColourPickers = {}
LibraryOptions = LibraryOptions or {}
LibraryOptions.Theme = LibraryOptions.Theme or "Dark"
LibraryOptions.Name = LibraryOptions.Name or "UI Library"
LibraryOptions.Size = LibraryOptions.Size or UDim2.new(0, 555, 0, 400)
LibraryOptions.Developer = LibraryOptions.Developer or false
local Theme = Themes[LibraryOptions.Theme] or Themes["Dark"]
local Gui = self:Object("ScreenGui", {
Name = "UILibrary",
Parent = (RS:IsStudio() and Player.PlayerGui) or game.CoreGui
})
local MainFrame = self:Object("Frame", {
Name = "MainFrame",
Parent = Gui,
AnchorPoint = Vector2.new(0.5, 0.5),
BackgroundTransparency = 1,
Position = UDim2.new(0.5, 0, 0.5, 0),
Size = UDim2.new(0, 0, 0, 0)
})
AddDragger(MainFrame)
self:Object("Shadow", MainFrame)
local OptionsContainer = self:Object("Frame", {
Name = "OptionsContainer",
Parent = MainFrame,
Position = UDim2.new(0, 100, 0, 0),
Size = UDim2.new(1, -100, 1, 0),
BackgroundColor3 = Theme.Main,
BorderSizePixel = 0
})
local OptionsContainerClips = self:Object("Frame", {
BackgroundTransparency = 1,
Parent = OptionsContainer,
Size = UDim2.new(1, 200, 1, 0),
ClipsDescendants = true
})
self:Object("Frame", {
Parent = OptionsContainer,
Size = UDim2.new(0, 4, 1, 0),
BorderSizePixel = 0,
BackgroundColor3 = Theme.Main
})
self:Object("Round", OptionsContainer)
local Tabs = self:Object("Frame", {
Name = "Tabs",
Parent = MainFrame,
BackgroundColor3 = Theme.TabsBackground,
Size = UDim2.new(1, 0, 1, 0),
ZIndex = 2
})
self:Object("Round", Tabs)
local TabsRoundFix = self:Object("Frame", {
Parent = MainFrame,
BorderSizePixel = 0,
BackgroundColor3 = Theme.TabsBackground,
Size = UDim2.new(0, 3, 1, 0),
Position = UDim2.new(0, 97, 0, 0)
})
local TabsLayout = self:Object("UIListLayout", {
Name = "TabsLayout",
Parent = Tabs,
HorizontalAlignment = Enum.HorizontalAlignment.Center
})
local TabsPadding = self:Object("UIPadding", {
Name = "TabsPadding",
Parent = Tabs,
PaddingTop = UDim.new(0, 6)
})
--tabs tween
Tabs.ChildAdded:connect(function(Child)
TS:Create(Child:WaitForChild("NameLabel"), TI(0.2), {TextTransparency = 0}):Play()
end)
--open animation
TS:Create(MainFrame, TI(0.3), {Size = LibraryOptions.Size}):Play()
wait(0.3)
TS:Create(Tabs, TI(0.3), {Size = UDim2.new(0, 100, 1, 0)}):Play()
local UIToggleState = true
UIS.InputEnded:connect(function(Input)
if Input.KeyCode == Enum.KeyCode.RightControl then
UIToggleState = not UIToggleState
--[[if UIToggleState then
TS:Create(Tabs, TI(0.2), {Size = UDim2.new(1, 0, 1, 0)}):Play()
for i, v in next, Tabs:GetChildren() do
spawn(function()
if v.ClassName == "TextButton" then
TS:Create(v.NameLabel, TI(0.15), {TextTransparency = 1}):Play()
end
end)
end
for i, v in next, OptionsContainerClips:GetChildren() do
if v.ClassName == "ScrollingFrame" then
v.CanvasSize = UDim2.new(0, 0, 0, 0)
end
end
wait(0.5)
MainFrame.ClipsDescendants = true
TS:Create(MainFrame, TI(0.2), {Size = UDim2.new(0, 0, 0, 0)}):Play()
else
TS:Create(MainFrame, TI(0.2), {Size = LibraryOptions.Size}):Play()
MainFrame.ClipsDescendants = false
wait(0.5)
TS:Create(Tabs, TI(0.2), {Size = UDim2.new(0, 100, 1, 0)}):Play()
for i, v in next, OptionsContainerClips:GetChildren() do
if v.ClassName == "ScrollingFrame" then
v.CanvasSize = UDim2.new(1, 0, 1, 0)
end
end
for i, v in next, Tabs:GetChildren() do
spawn(function()
if v.ClassName == "TextButton" then
TS:Create(v.NameLabel, TI(0.15), {TextTransparency = 0}):Play()
end
end)
end
end]]
local Old = MainFrame.Position
if UIToggleState then
MainFrame.Position = UDim2.new(0.5, 0 , 0.5, 0)
else
Old = MainFrame.Position
MainFrame.Position = UDim2.new(0.5, 0, 10000, 0)
end
end
end)
local TabsLibrary = {}
TabsLibrary.Quit = function(_, QuitOptions)
QuitOptions = QuitOptions or {}
QuitOptions.Message = QuitOptions.Message or "Goodbye..."
QuitOptions.Length = QuitOptions.Length or 1
TS:Create(Tabs, TI(0.2), {Size = UDim2.new(1, 0, 1, 0)}):Play()
for i, v in next, Tabs:GetChildren() do
spawn(function()
if v.ClassName == "TextButton" then
TS:Create(v.NameLabel, TI(0.15), {TextTransparency = 1}):Play()
wait(0.15)
v:Destroy()
end
end)
end
for i, v in next, OptionsContainerClips:GetChildren() do
if v.ClassName == "ScrollingFrame" then
v.CanvasSize = UDim2.new(0, 0, 0, 0)
end
end
wait(0.5)
MainFrame.ClipsDescendants = true
TS:Create(MainFrame, TI(0.2), {Size = UDim2.new(0, 200, 0, 75)}):Play()
wait(0.3)
local QuitMessage = self:Object("TextLabel", {
Parent = MainFrame,
AnchorPoint = Vector2.new(0.5, 1),
BackgroundTransparency = 1,
TextTransparency = 1,
Font = Enum.Font.SourceSansSemibold,
TextSize = 20,
Text = QuitOptions.Message,
TextColor3 = Theme.QuitText,
Position = UDim2.new(0.5, 0, 0.5, 0),
ZIndex = 5
})
TS:Create(QuitMessage, TI(0.2), {TextTransparency = 0}):Play()
wait(QuitOptions.Length)
TS:Create(QuitMessage, TI(0.15), {TextTransparency = 1}):Play()
TS:Create(MainFrame, TI(0.2), {Size = UDim2.new(0, 0, 0, 0)}):Play()
wait(0.2)
Gui:Destroy()
end
TabsLibrary.Tab = function(_, TabOptions)
local Initial = (self.Count == 0 and true) or false
TabOptions = TabOptions or {}
TabOptions.Name = TabOptions.Name or "Tab"
local Tab = self:Object("TextButton", {
Name = "Tab",
Parent = Tabs,
BackgroundTransparency = 1,
Size = UDim2.new(1, 0, 0, 28),
Text = "",
ZIndex = 3
})
self.Selected = (Initial and Tab) or self.Selected
local Label = self:Object("TextLabel", {
Name = "NameLabel",
Parent = Tab,
Text = TabOptions.Name,
BackgroundColor3 = Color3.new(1, 1, 1),
BackgroundTransparency = 1,
Position = UDim2.new(0, 6, 0, 0),
Size = UDim2.new(1, 0, 1, 0),
Font = Enum.Font.SourceSansSemibold,
TextColor3 = (Initial and Theme.TabSelected) or Theme.TabDefault,
TextSize = 18,
TextTransparency = 1,
TextXAlignment = Enum.TextXAlignment.Left,
ZIndex = 4
})
local TextPadding = self:Object("UIPadding", {
Name = "TabPadding",
Parent = Label,
PaddingLeft = UDim.new(0, 6)
})
local FunctionsContainer = self:Object("ScrollingFrame", {
Name = "Tab",
Parent = OptionsContainerClips,
Size = UDim2.new(1, -200, 1, 0),
Visible = Initial,
BorderSizePixel = 0,
BackgroundTransparency = 1,
CanvasSize = UDim2.new(0, 0, 0, 0),
ScrollBarThickness = 2,
ScrollingDirection = Enum.ScrollingDirection.Y,
ScrollBarImageColor3 = Theme.ScrollBar,
ClipsDescendants = false
})
local FunctionsLayout = self:Object("UIListLayout", {
Parent = FunctionsContainer,
HorizontalAlignment = Enum.HorizontalAlignment.Center,
Padding = UDim.new(0, 6)
})
local FunctionsContainerPadding = self:Object("UIPadding", {
Parent = FunctionsContainer,
PaddingTop = UDim.new(0, 10)
})
self.Count += 1
Tab.MouseEnter:connect(function()
if Tab ~= self.Selected then
TS:Create(Label, TI(0.1), {TextColor3 = Theme.TabHovered}):Play()
end
end)
Tab.MouseLeave:connect(function()
if Tab ~= self.Selected then
TS:Create(Label, TI(0.1), {TextColor3 = Theme.TabDefault}):Play()
end
end)
Tab.MouseButton1Click:connect(function()
for i, v in next, OptionsContainerClips:GetChildren() do
if v.Name == "Tab" then
v.Visible = false
end
end
for i, v in next, Tabs:GetChildren() do
if v.Name == "Tab" and v ~= Tab then
TS:Create(v.NameLabel, TI(0.1), {TextColor3 = Theme.TabDefault}):Play()
end
end
TS:Create(Label, TI(0.1), {TextColor3 = Theme.TabSelected}):Play()
self.Selected = Tab
FunctionsContainer.Visible = true
end)
local TabRefresh = function()
FunctionsContainer.CanvasSize = UDim2.new(0, 0, 0, FunctionsLayout.AbsoluteContentSize.Y + 20)
end
local DividerLibrary = {}
DividerLibrary.Divider = function(_, DividerOptions)
DividerOptions = DividerOptions or {}
DividerOptions.Name = DividerOptions.Name or ""
local Divider = self:Object("Frame", {
Name = "Divider",
Parent = FunctionsContainer,
BackgroundColor3 = Theme.DividerBackground,
Size = UDim2.new(1, -20, 0, 0)
})
self:Object("Round", Divider)
local DividerLayout = self:Object("UIListLayout", {
Parent = Divider,
HorizontalAlignment = Enum.HorizontalAlignment.Center,
SortOrder = Enum.SortOrder.LayoutOrder,
Padding = UDim.new(0, 6)
})
if DividerOptions.Name ~= "" then
local DividerNameLabel = self:Object("TextLabel", {
Parent = Divider,
BackgroundTransparency = 1,
Font = Enum.Font.SourceSansSemibold,
TextColor3 = Theme.DividerText,
Size = UDim2.new(1, -10, 0, 12),
TextSize = 18,
TextXAlignment = Enum.TextXAlignment.Left,
Text = DividerOptions.Name
})
end
local DividerPadding = self:Object("UIPadding", {
Parent = Divider,
PaddingTop = UDim.new(0, 5)
})
local DividerRefresh = function()
Divider.Size = UDim2.new(1, -20, 0, DividerLayout.AbsoluteContentSize.Y + 10)
TabRefresh()
end
local AddDescriptionTweens = function(Button, Description)
local ExpandSize = TS:Create(Button, TI(0.15), {Size = UDim2.new(1, -10, 0, 46)})
local CondenseSize = TS:Create(Button, TI(0.15), {Size = UDim2.new(1, -10, 0, 30)})
local ShowDescription = TS:Create(Description, TI(0.15), {Position = UDim2.new(0, 0, 0, 18), TextTransparency = 0})
local HideDescription = TS:Create(Description, TI(0.15), {Position = UDim2.new(0, 0, 0, 0), TextTransparency = 1})
Button.MouseEnter:connect(function()
ShowDescription:Play()
ExpandSize:Play()
while ShowDescription.PlaybackState ~= Enum.PlaybackState.Completed and ExpandSize.PlaybackState ~= Enum.PlaybackState.Completed and RS.RenderStepped:wait() do
DividerRefresh()
end
end)
Button.MouseLeave:connect(function()
HideDescription:Play()
CondenseSize:Play()
while RS.RenderStepped:wait() and HideDescription.PlaybackState ~= Enum.PlaybackState.Completed and CondenseSize.PlaybackState ~= Enum.PlaybackState.Completed do
DividerRefresh()
end
end)
end
local AddOptionHoverTweens = function(Button)
local ButtonHover = TS:Create(Button, TI(0.1), {BackgroundColor3 = Theme.OptionHover})
local ButtonClick = TS:Create(Button, TI(0.1), {BackgroundColor3 = Theme.OptionClick})
local ButtonDefault = TS:Create(Button, TI(0.1), {BackgroundColor3 = Theme.OptionBackground})
local Hovered = false
Button.MouseEnter:connect(function()
Hovered = true
ButtonHover:Play()
end)
Button.MouseLeave:connect(function()
Hovered = false
ButtonDefault:Play()
end)
Button.MouseButton1Down:connect(function()
ButtonClick:Play()
UIS.InputEnded:connect(function(inputType)
if inputType.UserInputType == Enum.UserInputType.MouseButton1 then
if Hovered then ButtonHover:Play() else ButtonDefault:Play() end
end
end)
end)
end
local OptionLibrary = {}
OptionLibrary.Button = function(_, ButtonOptions)
ButtonOptions = ButtonOptions or {}
ButtonOptions.Name = ButtonOptions.Name or "Button"
ButtonOptions.Callback = ButtonOptions.Callback or function() end
local Button = self:Object("MainOptionFrame", Divider)
Button.BackgroundColor3 = Theme.OptionBackground
self:Object("Round", Button)
local ButtonLabel = self:Object("OptionLabel", Button)
ButtonLabel.Text = ButtonOptions.Name
ButtonLabel.TextColor3 = Theme.OptionText
local ButtonPadding = self:Object("UIPadding", {
Parent = ButtonLabel,
PaddingLeft = UDim.new(0, 6)
})
local Click = self:Object("ImageLabel", {
Name = "Click",
Parent = Button,
AnchorPoint = Vector2.new(1, 0.5),
BackgroundTransparency = 1,
Position = UDim2.new(1, -1, 0, 14),
Size = UDim2.new(0, 28, 0, 28),
Image = "http://www.roblox.com/asset/?id=5837528348",
ImageColor3 = Theme.OptionImage
})
if ButtonOptions.Description then
local Description = self:Object("OptionDescription", Button)
Description.Text = ButtonOptions.Description
Description.TextColor3 = Theme.OptionDescription
local DescriptionPadding = self:Object("UIPadding", {
Parent = Description,
PaddingLeft = UDim.new(0, 6)
})
AddDescriptionTweens(Button, Description)
end
AddOptionHoverTweens(Button)
Button.MouseButton1Click:connect(function()
pcall(ButtonOptions.Callback)
end)
DividerRefresh()
local ButtonLibrary = {}
ButtonLibrary.HideElement = function()
Button.Visible = false
DividerRefresh()
end
ButtonLibrary.ShowElement = function()
Button.Visible = true
DividerRefresh()
end
ButtonLibrary.Fire = function()
pcall(ButtonOptions.Callback)
end
return ButtonLibrary
end
OptionLibrary.Toggle = function(_, ToggleOptions)
ToggleOptions = ToggleOptions or {}
ToggleOptions.Name = ToggleOptions.Name or "Toggle"
ToggleOptions.Style = ToggleOptions.Style or 1
ToggleOptions.State = ToggleOptions.State or false
ToggleOptions.Callback = ToggleOptions.Callback or function() end
local Toggle = self:Object("MainOptionFrame", Divider)
Toggle.BackgroundColor3 = Theme.OptionBackground
Toggle.Name = "Toggle"
self:Object("Round", Toggle)
local ToggleLabel = self:Object("OptionLabel", Toggle)
ToggleLabel.Text = ToggleOptions.Name
ToggleLabel.TextColor3 = Theme.OptionText
self:Object("UIPadding", {
Parent = ToggleLabel,
PaddingLeft = UDim.new(0, 6)
})
if ToggleOptions.Description then
local Description = self:Object("OptionDescription", Toggle)
Description.Text = ToggleOptions.Description
Description.TextColor3 = Theme.OptionDescription
local DescriptionPadding = self:Object("UIPadding", {
Parent = Description,
PaddingLeft = UDim.new(0, 6)
})
AddDescriptionTweens(Toggle, Description)
end
local ToggleFunction = nil
if ToggleOptions.Style == 1 then
local Colour = self:Object("Frame", {
Name = "Colour",
Parent = Toggle,
AnchorPoint = Vector2.new(1, 0),
BackgroundColor3 = (ToggleOptions.State and Theme.ToggleTrue) or Theme.ToggleFalse,
Position = UDim2.new(1, -4, 0, 4),
Size = UDim2.new(0, 40, 0, 22)
})
self:Object("Round", Colour)
local Sliding = self:Object("Frame", {
Parent = Colour,
AnchorPoint = Vector2.new(0, 0.5),
BackgroundColor3 = Theme.ToggleIndicator,
Position = (ToggleOptions.State and UDim2.new(1, -22, 0.5, 0)) or UDim2.new(0, 2, 0.5, 0),
Size = UDim2.new(0.5, -2, 1, -4),
ZIndex = 2
})
self:Object("Round", Sliding)
local SlidingToFalse = TS:Create(Sliding, TI(0.15), {Position = UDim2.new(0, 2, 0.5, 0)})
local ColourToFalse = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleFalse})
local SlidingToTrue = TS:Create(Sliding, TI(0.15), {Position = UDim2.new(1, -20, 0.5, 0)})
local ColourToTrue = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleTrue})
ToggleFunction = function(State)
spawn(function()
local S, E = pcall(ToggleOptions.Callback, State)
if not S then print(E) end
end)
if State then
SlidingToTrue:Play()
ColourToTrue:Play()
else
SlidingToFalse:Play()
ColourToFalse:Play()
end
end
Toggle.MouseButton1Click:connect(function()
ToggleOptions.State = not ToggleOptions.State
ToggleFunction(ToggleOptions.State)
end)
elseif ToggleOptions.Style == 2 then
local Colour = self:Object("Frame", {
Name = "Colour",
Parent = Toggle,
AnchorPoint = Vector2.new(1, 0),
BackgroundColor3 = ToggleOptions.State and Theme.ToggleTrue or Theme.ToggleFalse,
Position = UDim2.new(1, -4, 0, 4),
Size = UDim2.new(0, Toggle.AbsoluteSize.Y - 8, 0, 22)
})
self:Object("Round", Colour)
local Frame1 = self:Object("Frame", {
Parent = Colour,
Size = UDim2.new(0, 4, 0, 18),
BorderSizePixel = 0,
Rotation = 45,
AnchorPoint = Vector2.new(0.5, 0.5),
Position = UDim2.new(0.5, 0, 0.5, 0),
BackgroundColor3 = Theme.ToggleIndicator
})
local Frame1Round = self:Object("Round", Frame1)
Frame1Round.CornerRadius = UDim.new(0, 2)
local Frame2 = self:Object("Frame", {
Parent = Colour,
Size = UDim2.new(0, 4, 0, 18),
BorderSizePixel = 0,
Rotation = 135,
AnchorPoint = Vector2.new(0.5, 0.5),
Position = UDim2.new(0.5, 0, 0.5, 0),
BackgroundColor3 = Theme.ToggleIndicator
})
local Frame2Round = self:Object("Round", Frame2)
Frame2Round.CornerRadius = UDim.new(0, 2)
local ColourToFalse = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleFalse})
local ColourToTrue = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleTrue})
local Frame1ToFalse = TS:Create(Frame1, TI(0.15), {Position = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(0, 5, 0, 18)})
local Frame2ToFalse = TS:Create(Frame2, TI(0.15), {Position = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(0, 5, 0, 18)})
local Frame1ToTrue = TS:Create(Frame1, TI(0.15), {Position = UDim2.new(0.65, 0, 0.5, 0), Size = UDim2.new(0, 5, 0, 16)})
local Frame2ToTrue = TS:Create(Frame2, TI(0.15), {Position = UDim2.new(0.35, 0, 0.5, 2), Size = UDim2.new(0, 5, 0, 11)})
ToggleFunction = function(State)
spawn(function()
pcall(ToggleOptions.Callback, State)
end)
if State then
ColourToTrue:Play()
Frame1ToTrue:Play()
Frame2ToTrue:Play()
else
ColourToFalse:Play()
Frame1ToFalse:Play()
Frame2ToFalse:Play()
end
end
Toggle.MouseButton1Click:connect(function()
ToggleOptions.State = not ToggleOptions.State
ToggleFunction(ToggleOptions.State)
end)
end
AddOptionHoverTweens(Toggle)
DividerRefresh()
local ToggleLibrary = {}
ToggleLibrary.Toggle = function()
ToggleOptions.State = not ToggleOptions.State
ToggleFunction(ToggleOptions.State)
end
ToggleLibrary.SetState = function(_, State)
ToggleFunction(State)
ToggleOptions.State = State
end
ToggleLibrary.GetState = function()
return ToggleOptions.State
end
ToggleLibrary.HideElement = function()
Toggle.Visible = false
DividerRefresh()
end
ToggleLibrary.ShowElement = function()
Toggle.Visible = true
DividerRefresh()
end
return ToggleLibrary
end
OptionLibrary.ToggleDropdown = function(_, ToggleDropdownOptions)
ToggleDropdownOptions = ToggleDropdownOptions or {}
ToggleDropdownOptions.Name = ToggleDropdownOptions.Name or "Toggle"
ToggleDropdownOptions.Style = ToggleDropdownOptions.Style or 1
ToggleDropdownOptions.State = ToggleDropdownOptions.State or false
ToggleDropdownOptions.Callback = ToggleDropdownOptions.Callback or function() end
local Toggle = self:Object("MainOptionFrame", Divider)
Toggle.BackgroundColor3 = Theme.OptionBackground
Toggle.Name = "Toggle"
self:Object("Round", Toggle)
local ToggleLabel = self:Object("OptionLabel", Toggle)
ToggleLabel.Text = ToggleDropdownOptions.Name
ToggleLabel.TextColor3 = Theme.OptionText
self:Object("UIPadding", {
Parent = ToggleLabel,
PaddingLeft = UDim.new(0, 6)
})
if ToggleDropdownOptions.Description then
local Description = self:Object("OptionDescription", Toggle)
Description.Text = ToggleDropdownOptions.Description
Description.TextColor3 = Theme.OptionDescription
local DescriptionPadding = self:Object("UIPadding", {
Parent = Description,
PaddingLeft = UDim.new(0, 6)
})
AddDescriptionTweens(Toggle, Description)
end
local ToggleFunction = nil
if ToggleDropdownOptions.Style == 1 then
local Colour = self:Object("Frame", {
Name = "Colour",
Parent = Toggle,
AnchorPoint = Vector2.new(1, 0),
BackgroundColor3 = (ToggleDropdownOptions.State and Theme.ToggleTrue) or Theme.ToggleFalse,
Position = UDim2.new(1, -4, 0, 4),
Size = UDim2.new(0, 40, 0, 22)
})
self:Object("Round", Colour)
local Sliding = self:Object("Frame", {
Parent = Colour,
AnchorPoint = Vector2.new(0, 0.5),
BackgroundColor3 = Theme.ToggleIndicator,
Position = (ToggleDropdownOptions.State and UDim2.new(1, -22, 0.5, 0)) or UDim2.new(0, 2, 0.5, 0),
Size = UDim2.new(0.5, -2, 1, -4),
ZIndex = 2
})
self:Object("Round", Sliding)
local SlidingToFalse = TS:Create(Sliding, TI(0.15), {Position = UDim2.new(0, 2, 0.5, 0)})
local ColourToFalse = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleFalse})
local SlidingToTrue = TS:Create(Sliding, TI(0.15), {Position = UDim2.new(1, -20, 0.5, 0)})
local ColourToTrue = TS:Create(Colour, TI(0.15), {BackgroundColor3 = Theme.ToggleTrue})
ToggleFunction = function(State)
spawn(function()
pcall(ToggleDropdownOptions.Callback, State)
end)
if State then
SlidingToTrue:Play()
ColourToTrue:Play()
else
SlidingToFalse:Play()
ColourToFalse:Play()
end
end
Toggle.MouseButton1Click:connect(function()
ToggleDropdownOptions.State = not ToggleDropdownOptions.State
ToggleFunction(ToggleDropdownOptions.State)
end)
elseif ToggleDropdownOptions.Style == 2 then
local Colour = self:Object("Frame", {
Name = "Colour",
Parent = Toggle,
AnchorPoint = Vector2.new(1, 0),
BackgroundColor3 = ToggleDropdownOptions.State and Theme.ToggleTrue or Theme.ToggleFalse,
Position = UDim2.new(1, -4, 0, 4),
Size = UDim2.new(0, Toggle.AbsoluteSize.Y - 8, 0, 22)
})