forked from RigidStudios/roblox-discord-presence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DRPC.rbxmx
4357 lines (4225 loc) · 146 KB
/
DRPC.rbxmx
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
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<External>null</External>
<External>nil</External>
<Item class="Folder" referent="RBX4D5DAD9466534B3BABF81AFC88BF4125">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<string name="Name">DRPC</string>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
<Item class="Script" referent="RBX013DF0FAB5984E8088132AFAA31685DE">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="Disabled">false</bool>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">drpc_index</string>
<string name="ScriptGuid">{064A3310-9B61-4C9D-8BA8-1DA8E0BF37DD}</string>
<ProtectedString name="Source"><![CDATA[local DRPC = script:FindFirstAncestor("DRPC");
local env = {
["plugin"] = plugin
}
for i, object in ipairs(DRPC:GetDescendants()) do
if object:IsA("ModuleScript") then
local module = require(object)
setmetatable(module, { __index = env })
end
end
local Data = require(DRPC.src.dataHandler);
local UI = require(DRPC.src.ui.index);
local Client = require(DRPC.src.client.index);
local Plugin = require(DRPC.src.generators.pluginManager);
local Http = require(DRPC.src.httpClient).new("http://localhost:4455/");
local ClientObj = Client.new(Http, false);
Data:AttachChange("Enabled", function(isEnabled)
if isEnabled then ClientObj:Open() else ClientObj:Close() end;
end);
UI:Start();
Plugin:Init(plugin);
plugin.Unloading:Connect(function()
ClientObj.Enabled = false;
ClientObj.Terminated = true;
end);
ClientObj:login(function(success)
if success then
warn("DRPC v1 by RigidStudios#6315 - Launched.");
else
warn("DRPC v1 by RigidStudios#6315 - Launch failed, try toggling enabled after starting up your local server.");
ClientObj.Enabled = false;
end;
end);
]]></ProtectedString>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="Folder" referent="RBX12C9E90C3B8846F2BF40B5C9D0E51AC9">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<string name="Name">src</string>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
<Item class="ModuleScript" referent="RBX248FD333420749ADA7237C7691978DD9">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">util</string>
<string name="ScriptGuid">{90C586F7-0B93-4E6F-A73A-1DF10398A137}</string>
<ProtectedString name="Source"><![CDATA[local util = {};
local DRPC = script:FindFirstAncestor("DRPC");
local Data = require(DRPC.src.dataHandler);
-- Get place (Used for name later)
local success, place = pcall(function()
return game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId);
end);
-- If offline, above fetch will have failed, remedy that by just getting the game.
if not success then
place = game
end;
util.place = place;
function util.getPlaceName()
return util.place.Name;
end;
local lastEdit = tick();
local lastScript = game:GetService("StudioService").ActiveScript;
local lastLen = 0;
function util.hasChanges()
local s = game:GetService("StudioService").ActiveScript;
local changes = false;
if s then
local len = #s.Source:split("\n");
if s ~= lastScript or lastLen ~= len then
lastLen = len;
lastScript = s;
lastEdit = tick();
end;
if tick() - lastEdit > 180 then
changes = false;
else
changes = true;
end;
end;
return changes;
end;
return util;]]></ProtectedString>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="ModuleScript" referent="RBX7AD2542C81894966AF518A9C428B1A8F">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">activity</string>
<string name="ScriptGuid">{AB531CBF-B885-4F71-8FDF-45E2275E701E}</string>
<ProtectedString name="Source"><![CDATA[local activity = {};
local startTick = tick();
function activity.new()
-- Please don't remove this, I need jobs... :D
return setmetatable({ assets = { large_text = "RPC by RigidStudios#6315" } }, { __index = activity });
end;
function activity:clear()
self.buttons = nil;
self.timestamps = nil;
return self;
end;
function activity:addButton(buttonName, buttonValue)
if buttonName and buttonValue and buttonName ~= "" and buttonValue ~= "" then
if not self.buttons then self.buttons = {} end;
-- TODO?: Surplus buttons check.
self.buttons[#self.buttons + 1] = { label = buttonName, url = buttonValue };
end;
return self;
end;
function activity:setDescription(detailsValue)
self.details = detailsValue;
return self;
end;
function activity:setState(stateValue)
self.state = stateValue;
return self;
end;
function activity:setTimer()
if not self.timestamps then self.timestamps = {} end;
self.timestamps = {
start = startTick;
};
return self;
end;
function activity:setImage(imageName)
if not self.assets then self.assets = {} end;
self.assets.large_image = imageName;
return self;
end;
function activity:setThumbnail(imageName)
if not self.assets then self.assets = {} end;
self.assets.small_image = imageName;
return self;
end;
return activity;]]></ProtectedString>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="ModuleScript" referent="RBX38FA0546AC79478191BAE68A126CF707">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">httpClient</string>
<string name="ScriptGuid">{DA3EDF63-EE01-4AC0-8BCA-0FA25937B29F}</string>
<ProtectedString name="Source"><![CDATA[local httpClient = {};
local HTTP = game:GetService("HttpService");
function httpClient.new(url)
local self = setmetatable({ URL = url }, { __index = httpClient });
return self;
end;
function httpClient:Post(requestBody)
local success, reply = pcall(
HTTP.PostAsync,
HTTP, self.URL,
HTTP:JSONEncode(requestBody)
);
if not success then
warn("[Discord-RPC] HTTP Post failed.");
end;
return success, reply;
end;
return httpClient;
]]></ProtectedString>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="ModuleScript" referent="RBXA59F486DF2D14463A9BFD72D23E2B154">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">dataHandler</string>
<string name="ScriptGuid">{5FBF4B83-6435-4C6E-95EC-90F36CB39B8D}</string>
<ProtectedString name="Source"><![CDATA[local dataHandler = { data = {}, attachments = {} };
function dataHandler:Set(key, data)
self.data[key] = data;
if self.attachments[key] then
for _, func in pairs(self.attachments[key]) do
func(data);
end;
end;
return data;
end;
function dataHandler:Get(key)
local data = self.data[key];
if data == nil or data == "" then
data = self.plugin:GetSetting(key);
self.data[key] = data;
end;
return data;
end;
function dataHandler:AttachChange(key, func)
if not self.attachments[key] then self.attachments[key] = {} end;
table.insert(self.attachments[key], func);
end;
function dataHandler:Save()
for key, value in pairs(self.data) do
self.plugin:SetSetting(key, value);
end;
return dataHandler;
end;
return dataHandler;]]></ProtectedString>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="Folder" referent="RBXCB04267CAF5E43409A7E56C46951AF38">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<string name="Name">generators</string>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
<Item class="ModuleScript" referent="RBX06C433772C3047138236E60828FBAD63">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">activityCreator</string>
<string name="ScriptGuid"></string>
<ProtectedString name="Source"><![CDATA[local activityCreator = {};
local DRPC = script:FindFirstAncestor("DRPC");
local Activity = require(DRPC.src.activity).new();
local FormatString = require(DRPC.src.generators.formatString);
local Data = require(DRPC.src.dataHandler);
function eval(item)
if item == "" then return false end;
if item == nil then return false end;
if item == false then return false end;
if item == 0 then return false end;
if pcall(function() return #item end) and #item == 0 then return false end;
return true;
end;
function activityCreator:Get()
local savedDescription = Data:Get("Description");
local savedState = Data:Get("State");
Activity
:clear()
:setDescription(FormatString:process(eval(savedDescription) and savedDescription or "$ACTIVITY:Editing $SCRIPT_NAME ($SCRIPT_LINES lines)"))
:setState(FormatString:process(eval(savedState) and savedState or "Workspace: $WORKSPACE"))
:setImage("studio");
if eval(Data:Get("EnabledTS")) then
Activity:setTimer();
end;
for _, button in pairs(Data:Get("Buttons") or {}) do
-- Semi-Blank labels aren't allowed.
if not (eval(button.label) and eval(button.url)) then continue end;
Activity:addButton(FormatString:process(button.label), FormatString:process(button.url));
end;
return Activity;
end;
return activityCreator;
]]></ProtectedString>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="ModuleScript" referent="RBX0DAD4259C1B2451F9ACF244E573C0ACD">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">formatString</string>
<string name="ScriptGuid"></string>
<ProtectedString name="Source"><![CDATA[local formatString = {};
local DRPC = script:FindFirstAncestor("DRPC");
local Util = require(DRPC.src.util);
local StudioService = game:GetService("StudioService");
local Variables = {
["%$SCRIPT_NAME"] = {Description = "Name of the current script", Obtain = function(src)
if not src then return end;
return src.Name;
end};
["%$SCRIPT_LINES"] = {Description = "Line count of the current script", Obtain = function(src)
if not src then return end;
return #src.Source:split("\n");
end};
["%$SCRIPT_PARENT"] = {Description = "Name of the current script's parent", Obtain = function(src)
if not src then return end;
return src.Parent.Name;
end};
["%$WORKSPACE"] = {Description = "Name of the current place", Obtain = function(src)
return Util.getPlaceName();
end};
["%$PLACE_ID"] = {Description = "ID of the current place", Obtain = function(src)
return Util.place.PlaceId or "0";
end};
["%$PLACE_PUBLISHED:<>:<>"] = {Description = "If published, first setting, if not, second setting.", Obtain = function(src, publicStr, notPublicStr)
-- IsA: member of Instance (only usable when place was set to current game instead of placeInfo.
return formatString:process(Util.place.IsA and notPublicStr or publicStr);
end};
["%$ACTIVITY:<>"] = {Decription = "Away (No Script open), Idle (No Changes recently, <follow> (Editing)", Obtain = function(src, following)
return Util.hasChanges()
and formatString:process(following or "Editing $SCRIPT_NAME ($SCRIPT_LINES lines)")
or (not StudioService.ActiveScript and "Away" or "Idle...");
end};
};
function formatString:process(str)
for identifier, value in pairs(Variables) do
str = str:gsub(string.gsub(identifier, "<>", "(.*)"), function(...)
return value.Obtain(StudioService.ActiveScript, ...);
end);
end;
return str;
end;
return formatString;
]]></ProtectedString>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="ModuleScript" referent="RBX42D74F9C0FAB4F85B777C215029C5824">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">pluginManager</string>
<string name="ScriptGuid"></string>
<ProtectedString name="Source"><![CDATA[local pluginManager = {};
local DRPC = script:FindFirstAncestor("DRPC");
local Data = require(DRPC.src.dataHandler);
local UI = require(DRPC.src.ui.index);
function pluginManager:Init(plugin: Plugin)
local toolbar = plugin:CreateToolbar("DRPC by RigidStudios#6315");
local showButton = toolbar:CreateButton("Settings", "Set the parameters of your activity and toggle the plugin.", "rbxassetid://6540060106", "DRPC Settings");
local pEnabled = Data:Get("GUI_Open");
local enabled = pEnabled == nil and true or pEnabled;
UI.settingsGui.Enabled = enabled;
showButton.Click:Connect(function()
enabled = not enabled;
UI.settingsGui.Enabled = enabled;
Data:Set("GUI_Open", enabled);
end);
end;
return pluginManager;]]></ProtectedString>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
</Item>
<Item class="Folder" referent="RBX688AC80A76494700B6C819035353004D">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<string name="Name">client</string>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
<Item class="ModuleScript" referent="RBXE01CE9175F2D4AAF9A4A7E543FA0A9F5">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">index</string>
<string name="ScriptGuid"></string>
<ProtectedString name="Source"><![CDATA[local client = {};
local DRPC = script:FindFirstAncestor("DRPC");
local ActivityCreator = require(DRPC.src.generators.activityCreator);
local Data = require(DRPC.src.dataHandler);
function client.new(Http, _debug)
local self = setmetatable({ Http = Http, _debug = _debug }, { __index = client });
return self;
end;
function client:Close()
self.Enabled = false;
self.Http:Post({
updateType = "CLOSE";
});
end;
function client:SetActivity()
return self.Http:Post({
updateType = "SET_ACTIVITY";
activity = ActivityCreator:Get();
});
end;
function client:Open()
self.Enabled = true;
return self:SetActivity();
end;
-- Initiate with cb -> callback(success<bool>, response<string>);
function client:login(cb)
local enabled = Data:Get("Enabled");
local success, reply;
if enabled or enabled == nil then
success, reply = self:Open();
else
success = false;
end;
spawn(function()
while 1 do
wait(2.6); -- Accuracy un-necessary.
if self.Enabled then
self:SetActivity();
end;
if self.Terminated then
break;
end;
end;
end);
if cb then
cb(success, reply);
end;
self.plugin.Unloading:Connect(function()
self:Close();
end);
end;
return client;
]]></ProtectedString>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
</Item>
<Item class="Folder" referent="RBX638AB78E0F704C449DF777C958DEDBDA">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<string name="Name">ui</string>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
<Item class="ModuleScript" referent="RBXFC55737F087549B286DFF8932BA5FDC4">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">index</string>
<string name="ScriptGuid"></string>
<ProtectedString name="Source"><![CDATA[local DRPC = script:FindFirstAncestor("DRPC");
local Assets = DRPC.assets;
local Text = game:GetService("TextService");
local Data = require(DRPC.src.dataHandler);
local UI = {};
function UI:ProvidePlugin(plugin)
self.plugin = plugin;
end;
function UI:CreateControllers(settingsGui)
-- Window Controller Init.
require(DRPC.src.ui.windowController):Init(settingsGui);
-- Resize Controller Init.
require(DRPC.src.ui.resizeController):Init(settingsGui);
-- Toggles Init.
local toggleController = require(DRPC.src.ui.toggleController);
toggleController.new("Enabled"):Init(settingsGui.UI.Container.Enable.Container.Switch);
toggleController.new("EnabledTS"):Init(settingsGui.UI.Container.EnableTS.Container.Switch);
end;
function UI:CreateInputField(field, dataName, default)
field.Text = Data:Get(dataName) or default;
field.FocusLost:Connect(function()
Data:Set(dataName, field.Text);
end);
end;
function UI:CreateUI()
if not self.plugin then return error("[Discord-RPC] UI Launched before plugin apparition.") end;
local settingsGui: DockWidgetPluginGui = self.plugin:CreateDockWidgetPluginGui(
"settingsGui",
DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Float,
false,
false
)
);
Assets.UI:Clone().Parent = settingsGui;
settingsGui.Title = "DRPC Settings";
settingsGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
settingsGui:BindToClose(function()
settingsGui.Enabled = false;
Data:Set("GUI_Open", false);
end);
return settingsGui;
end;
function UI:CreateButtonInputController(dataButtons, buttonInput, index, subIndex)
buttonInput.Text = dataButtons[index] and dataButtons[index][subIndex] or "";
buttonInput.FocusLost:Connect(function()
if not dataButtons[index] then
dataButtons[index] = {};
end;
dataButtons[index][subIndex] = buttonInput.Text;
Data:Set("Buttons", dataButtons);
end);
end;
function UI:Start()
self.settingsGui = self:CreateUI();
-- Window Scroll/Field Resize/Toggle Handler
self:CreateControllers(self.settingsGui);
-- Input Fields
self:CreateInputField(self.settingsGui.UI.Container.DescriptionInput.Input, "Description", "$ACTIVITY:Editing $SCRIPT_NAME ($SCRIPT_LINES lines)");
self:CreateInputField(self.settingsGui.UI.Container.StateInput.Input, "State", "Workspace: $WORKSPACE");
-- Buttons
local savedButtons = Data:Get("Buttons") or {};
local button1 = self.settingsGui.UI.Container.Button1;
local button2 = self.settingsGui.UI.Container.Button2;
self:CreateButtonInputController(savedButtons, button1.First.Input, 1, "url");
self:CreateButtonInputController(savedButtons, button2.First.Input, 2, "url");
self:CreateButtonInputController(savedButtons, button1.Second.Input, 1, "label");
self:CreateButtonInputController(savedButtons, button2.Second.Input, 2, "label");
-- Version Indicator
local infoVersion = self.settingsGui.UI.Container.Info.Version;
infoVersion.Text = "v0.2.1-alpha";
end;
return UI;]]></ProtectedString>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="ModuleScript" referent="RBXB1975BD49C6741DCA1D0A7A9AA90EF2C">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">resizeController</string>
<string name="ScriptGuid"></string>
<ProtectedString name="Source"><![CDATA[local module = {}
local Text = game:GetService("TextService");
function module:Init(settingsGui)
for i, field in pairs(game:GetService("CollectionService"):GetTagged("DRPC_ExpandableVertical")) do
if not field:IsDescendantOf(settingsGui) then continue end;
field:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
if field.Name == "InputBoxLabel" then
local labSize = Text:GetTextSize(field.Text, 23, Enum.Font.Code, Vector2.new(field.AbsoluteSize.X, math.huge));
local urlSize = Text:GetTextSize(field.Parent.InputBoxURL.Text, 23, Enum.Font.Code, Vector2.new(field.AbsoluteSize.X, math.huge));
field.Parent.Size = UDim2.new(1, 0, 0, math.max(labSize.Y, urlSize.Y) + 2);
else
local size = Text:GetTextSize(field.Text, 23, Enum.Font.Code, Vector2.new(field.AbsoluteSize.X, math.huge));
field.Parent.Size = UDim2.new(1, 0, 0, size.Y + 2);
end
end)
end;
end
return module
]]></ProtectedString>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="ModuleScript" referent="RBXF15E51A0A0C84A56B1087AED5BDF852E">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">toggleController</string>
<string name="ScriptGuid"></string>
<ProtectedString name="Source"><![CDATA[local module = {};
local DRPC = script:FindFirstAncestor("DRPC");
local Data = require(DRPC.src.dataHandler);
local rs = game:GetService("RunService").RenderStepped;
function module.new(dataSave)
local self = setmetatable({ dataSave = dataSave, wasEnabled = nil }, { __index = module });
return self;
end
function module:onClick(element)
return function()
Data:Set(self.dataSave, module:Move(element, not Data:Get(self.dataSave)));
end;
end;
function module:Init(element)
local enabled = Data:Get(self.dataSave);
Data:Set(self.dataSave, self:Move(element.Value, enabled or enabled == nil));
Data:AttachChange(self.dataSave, function(newData)
if self.wasEnabled ~= newData then
self:Move(element.Value, newData);
end;
end);
element.MouseButton1Click:Connect(self:onClick(element.Value));
element.Value.MouseButton1Click:Connect(self:onClick(element.Value));
end;
function module:Move(element, enabled)
if enabled then
for i = 0, 1, .1 do
element.Position = UDim2.fromScale(i, 0);
element.Parent.BackgroundColor3 = Color3.fromRGB(13, 114, 232):Lerp(Color3.fromRGB(163, 162, 165), 1 - i);
rs:Wait();
end;
else
for i = 1, 0, -.1 do
element.Position = UDim2.fromScale(i, 0);
element.Parent.BackgroundColor3 = Color3.fromRGB(13, 114, 232):Lerp(Color3.fromRGB(163, 162, 165), 1 - i);
rs:Wait();
end;
end;
self.wasEnabled = enabled;
element.Parent.Parent.Text.Title.Text = enabled and "Enabled" or "Disabled";
return not not enabled;
end;
return module;
]]></ProtectedString>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="ModuleScript" referent="RBX55EB2EE29694431AA1D12524810AAECD">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">windowController</string>
<string name="ScriptGuid"></string>
<ProtectedString name="Source"><![CDATA[local module = {}
function module:Init(settingsGui)
settingsGui.UI.Container.UIListLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
settingsGui.UI.Container.CanvasSize = UDim2.new(0, 0, 0, math.ceil(settingsGui.UI.Container.UIListLayout.AbsoluteContentSize.Y) + 25)
settingsGui.UI.Scroller.Visible = settingsGui.UI.Container.UIListLayout.AbsoluteContentSize.Y + 25 > settingsGui.AbsoluteSize.Y
end)
end
return module
]]></ProtectedString>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
</Item>
</Item>
<Item class="Folder" referent="RBXFB48B44FF295423D9EA879148210D860">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<string name="Name">assets</string>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
<Item class="Frame" referent="RBXA8DD0450EB7C4264B4E2963B508C9012">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<token name="AutomaticSize">0</token>
<Color3 name="BackgroundColor3">
<R>0.113725498</R>
<G>0.113725498</G>
<B>0.113725498</B>
</Color3>
<float name="BackgroundTransparency">0</float>
<Color3 name="BorderColor3">
<R>0.105882354</R>
<G>0.164705887</G>
<B>0.20784314</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<int name="LayoutOrder">0</int>
<string name="Name">UI</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>0</XO>
<YS>0</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>1</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<int64 name="SourceAssetId">-1</int64>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">true</bool>
<int name="ZIndex">2</int>
</Properties>
<Item class="ScrollingFrame" referent="RBXA9BDB57B31144F79AAE0446EC061E302">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<token name="AutomaticCanvasSize">0</token>
<token name="AutomaticSize">0</token>
<Color3 name="BackgroundColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.105882362</R>
<G>0.164705887</G>
<B>0.207843155</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<Content name="BottomImage"><url>rbxasset://textures/ui/Scroll/scroll-bottom.png</url></Content>
<Vector2 name="CanvasPosition">
<X>0</X>
<Y>0</Y>
</Vector2>
<UDim2 name="CanvasSize">
<XS>0</XS>
<XO>0</XO>
<YS>0</YS>
<YO>0</YO>
</UDim2>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<token name="ElasticBehavior">0</token>
<token name="HorizontalScrollBarInset">0</token>
<int name="LayoutOrder">0</int>
<Content name="MidImage"><url>rbxasset://textures/ui/Scroll/scroll-middle.png</url></Content>
<string name="Name">Container</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>0</XO>
<YS>0</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<Color3 name="ScrollBarImageColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="ScrollBarImageTransparency">0</float>
<int name="ScrollBarThickness">4</int>
<token name="ScrollingDirection">4</token>
<bool name="ScrollingEnabled">true</bool>
<bool name="Selectable">false</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>1</XS>
<XO>0</XO>
<YS>1</YS>
<YO>0</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
<Content name="TopImage"><url>rbxasset://textures/ui/Scroll/scroll-top.png</url></Content>
<token name="VerticalScrollBarInset">0</token>
<token name="VerticalScrollBarPosition">0</token>
<bool name="Visible">true</bool>
<int name="ZIndex">2</int>
</Properties>
<Item class="UIListLayout" referent="RBX4E67DCB15502485ABBDCCC470722B5C3">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<token name="FillDirection">1</token>
<token name="HorizontalAlignment">0</token>
<string name="Name">UIListLayout</string>
<UDim name="Padding">
<S>0</S>
<O>0</O>
</UDim>
<token name="SortOrder">2</token>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
<token name="VerticalAlignment">1</token>
</Properties>
</Item>
<Item class="UIPadding" referent="RBXB488AB6594F94D3396FF3296C107015C">
<Properties>
<BinaryString name="AttributesSerialize"></BinaryString>
<string name="Name">UIPadding</string>
<UDim name="PaddingBottom">
<S>0</S>
<O>0</O>
</UDim>
<UDim name="PaddingLeft">
<S>0</S>
<O>0</O>
</UDim>
<UDim name="PaddingRight">
<S>0</S>
<O>0</O>
</UDim>
<UDim name="PaddingTop">
<S>0</S>
<O>0</O>
</UDim>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags"></BinaryString>
</Properties>
</Item>
<Item class="Frame" referent="RBX4DF2567331DF4A3F90D8342944596FB6">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>
<Y>0</Y>
</Vector2>
<BinaryString name="AttributesSerialize"></BinaryString>
<bool name="AutoLocalize">true</bool>
<token name="AutomaticSize">0</token>
<Color3 name="BackgroundColor3">
<R>1</R>
<G>1</G>
<B>1</B>
</Color3>
<float name="BackgroundTransparency">1</float>
<Color3 name="BorderColor3">
<R>0.105882362</R>
<G>0.164705887</G>
<B>0.207843155</B>
</Color3>
<token name="BorderMode">0</token>
<int name="BorderSizePixel">0</int>
<bool name="ClipsDescendants">false</bool>
<bool name="Draggable">false</bool>
<int name="LayoutOrder">1</int>
<string name="Name">Enable</string>
<Ref name="NextSelectionDown">null</Ref>
<Ref name="NextSelectionLeft">null</Ref>
<Ref name="NextSelectionRight">null</Ref>
<Ref name="NextSelectionUp">null</Ref>
<UDim2 name="Position">
<XS>0</XS>
<XO>0</XO>
<YS>0</YS>
<YO>0</YO>
</UDim2>
<Ref name="RootLocalizationTable">null</Ref>
<float name="Rotation">0</float>
<bool name="Selectable">true</bool>
<Ref name="SelectionImageObject">null</Ref>
<UDim2 name="Size">
<XS>1</XS>
<XO>-48</XO>
<YS>0</YS>
<YO>30</YO>
</UDim2>
<token name="SizeConstraint">0</token>
<int64 name="SourceAssetId">-1</int64>
<token name="Style">0</token>
<BinaryString name="Tags"></BinaryString>
<bool name="Visible">true</bool>
<int name="ZIndex">10</int>
</Properties>
<Item class="Frame" referent="RBX1122FF283D26475EABA64E115C55AEF0">
<Properties>
<bool name="Active">false</bool>
<Vector2 name="AnchorPoint">
<X>0</X>