-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppleGUI
More file actions
5440 lines (4633 loc) · 144 KB
/
Copy pathAppleGUI
File metadata and controls
5440 lines (4633 loc) · 144 KB
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
local CONFIG_FOLDER = "AppleGUI"
local CONFIG_FILE_NAME = "config.json"
local URL = "https://raw.githubusercontent.com/snwmdd114514-lang/Script/bbcb624f25e1a7bf9a3632a3c60c03b6f25c910d/AppleGUI"
local function plainReplace(source, oldText, newText, label)
local s, e = string.find(source, oldText, 1, true)
if not s then
error("[AppleGUI Frost Patch] patch target missing: " .. tostring(label))
end
return string.sub(source, 1, s - 1) .. newText .. string.sub(source, e + 1)
end
local function replaceBetween(source, startMarker, endMarker, replacement, label)
local s = string.find(source, startMarker, 1, true)
if not s then
error("[AppleGUI Frost Patch] start marker missing: " .. tostring(label))
end
local e = string.find(source, endMarker, s + #startMarker, true)
if not e then
error("[AppleGUI Frost Patch] end marker missing: " .. tostring(label))
end
return string.sub(source, 1, s - 1) .. replacement .. string.sub(source, e)
end
local okHttp, source = pcall(function()
return game:HttpGet(URL)
end)
if not okHttp then
error("[AppleGUI Frost Patch] HttpGet failed: " .. tostring(source))
end
if type(source) ~= "string" or #source < 1000 then
error("[AppleGUI Frost Patch] invalid source")
end
source = string.gsub(source, 'local AssetService = game:GetService%("AssetService"%)\n', "")
source = string.gsub(source, 'local CaptureService = game:GetService%("CaptureService"%)\n', "")
source = string.gsub(source, 'local GuiService = game:GetService%("GuiService"%)\n', "")
source = plainReplace(
source,
[[local TextService = game:GetService("TextService")]],
[[local TextService = game:GetService("TextService")
local HttpService = game:GetService("HttpService")]],
"HttpService"
)
source = plainReplace(
source,
"local LocalPlayer = Players.LocalPlayer\n",
[[local LocalPlayer = Players.LocalPlayer
local scriptStartedAt = os.clock()
local scriptStartedText = os.date("%H:%M:%S")
local DEFAULT_GUI_CONFIG = {
-- 内置 GUI设置 分类
ShowGUISettings = true,
-- 主题
Theme = "Light",
-- 全局透明 / 磨砂
TransparencyEnabled = true,
FrostEnabled = true,
FrostStrength = 1.00,
-- 左侧分类栏
SidebarTranslucent = true,
SidebarTransparency = 0.22,
-- 主窗口
WindowTransparent = false,
WindowTransparency = 0.08,
ContentTransparency = 0.10,
-- 下拉菜单默认保持不透明
DropdownTransparent = false,
DropdownTransparency = 0.34,
DropdownFrost = 0.86,
-- 灵动岛
ShowDynamicIsland = true,
IslandText = "点击打开",
IslandTextSize = 11,
IslandFPSTextSize = 11,
IslandIcon = "rbxassetid://8997386997",
IslandIconSize = 16,
IslandShowIcon = true,
IslandWidth = 196,
IslandHeight = 36,
-- 窗口大小
-- 拖动右下角时,宽和高独立变化;窗口保持中心不动,
-- 所以横向会向左右两边同时变长,纵向会向上下两边同时变高。
WindowWidth = 820,
WindowHeight = 650,
MinWindowWidth = 560,
MinWindowHeight = 430,
MaxWindowWidth = 1380,
MaxWindowHeight = 980,
ShowResizeHandle = true,
-- 兼容旧调用:window:SetScale(x) 仍可用,但拖拽不再使用等比缩放。
WindowScale = 1.00,
-- 配置文件
ConfigFolder = "__APPLEGUI_CONFIG_FOLDER__",
ConfigFileName = "__APPLEGUI_CONFIG_FILE__",
ConfigPath = "__APPLEGUI_CONFIG_FOLDER__/__APPLEGUI_CONFIG_FILE__",
UseConfigFile = true,
AutoSaveConfig = true,
}
local function cloneTable(source)
local out = {}
for key, value in pairs(source or {}) do
if type(value) == "table" then
out[key] = cloneTable(value)
else
out[key] = value
end
end
return out
end
local function mergeConfig(target, source)
if type(source) ~= "table" then
return target
end
for key, value in pairs(source) do
if value ~= nil then
target[key] = value
end
end
return target
end
local function normalizeTheme(value)
value = string.lower(tostring(value or "Light"))
if value == "dark" or value == "深色" then
return "Dark"
end
return "Light"
end
local function readConfigFile(path)
if
type(path) ~= "string"
or path == ""
or typeof(isfile) ~= "function"
or typeof(readfile) ~= "function"
then
return nil
end
local okExists, exists =
pcall(isfile, path)
if not okExists or not exists then
return nil
end
local okRead, raw =
pcall(readfile, path)
if
not okRead
or type(raw) ~= "string"
or raw == ""
then
return nil
end
local okDecode, decoded =
pcall(function()
return HttpService:JSONDecode(raw)
end)
if okDecode and type(decoded) == "table" then
return decoded
end
return nil
end
local function saveConfigFile(config)
if
type(config) ~= "table"
or typeof(writefile) ~= "function"
then
return false
end
local path =
tostring(
config.ConfigPath
or DEFAULT_GUI_CONFIG.ConfigPath
)
if path == "" then
return false
end
local folder =
string.match(path, "^(.*)/[^/]+$")
if
folder
and folder ~= ""
and typeof(makefolder) == "function"
then
local shouldCreate = true
if typeof(isfolder) == "function" then
local okFolder, exists =
pcall(isfolder, folder)
shouldCreate =
not okFolder
or not exists
end
if shouldCreate then
pcall(makefolder, folder)
end
end
local copy = cloneTable(config)
local okEncode, encoded =
pcall(function()
return HttpService:JSONEncode(copy)
end)
if not okEncode then
return false
end
local okWrite =
pcall(writefile, path, encoded)
return okWrite
end
local function buildConfigPath(folder, fileName)
folder =
tostring(
folder
or DEFAULT_GUI_CONFIG.ConfigFolder
or "AppleGUI"
)
fileName =
tostring(
fileName
or DEFAULT_GUI_CONFIG.ConfigFileName
or "config.json"
)
folder =
string.gsub(
folder,
"/+$",
""
)
fileName =
string.gsub(
fileName,
"^/+",
""
)
if folder == "" then
return fileName
end
return folder .. "/" .. fileName
end
local function resolveGUIConfig(config)
local explicit =
type(config) == "table"
and config
or {}
local result =
cloneTable(DEFAULT_GUI_CONFIG)
local requestedPath
if type(config) == "string" then
requestedPath = config
elseif
type(explicit.ConfigPath) == "string"
and explicit.ConfigPath ~= ""
then
requestedPath = explicit.ConfigPath
else
requestedPath =
buildConfigPath(
explicit.ConfigFolder
or result.ConfigFolder,
explicit.ConfigFileName
or result.ConfigFileName
)
end
result.ConfigPath = requestedPath
local useFile =
explicit.UseConfigFile
if useFile == nil then
useFile = result.UseConfigFile
end
if useFile ~= false then
local fileConfig =
readConfigFile(requestedPath)
if fileConfig then
mergeConfig(result, fileConfig)
end
end
mergeConfig(result, explicit)
result.ConfigFolder =
tostring(
result.ConfigFolder
or DEFAULT_GUI_CONFIG.ConfigFolder
or "AppleGUI"
)
result.ConfigFileName =
tostring(
result.ConfigFileName
or DEFAULT_GUI_CONFIG.ConfigFileName
or "config.json"
)
if
type(config) ~= "string"
and not (
type(explicit.ConfigPath) == "string"
and explicit.ConfigPath ~= ""
)
then
result.ConfigPath =
buildConfigPath(
result.ConfigFolder,
result.ConfigFileName
)
else
result.ConfigPath =
tostring(
result.ConfigPath
or buildConfigPath(
result.ConfigFolder,
result.ConfigFileName
)
)
end
result.Theme =
normalizeTheme(result.Theme)
return result
end
lib.DEFAULT_CONFIG =
cloneTable(DEFAULT_GUI_CONFIG)
]],
"script start"
)
source = plainReplace(
source,
[[function lib:init(ti, dosplash, visiblekey, deleteprevious)
local guiParent = getGuiParent()]],
[[function lib:init(ti, dosplash, visiblekey, deleteprevious, config)
local appConfig = resolveGUIConfig(config)
local guiParent = getGuiParent()]],
"init config argument"
)
source = plainReplace(
source,
[[ Black = Color3.fromRGB(0, 0, 0),
}]],
[[ Black = Color3.fromRGB(0, 0, 0),
-- Theme-aware colors used by navigation / specular highlights.
Highlight = Color3.fromRGB(255, 255, 255),
NavButton = Color3.fromRGB(255, 255, 255),
NavIcon = Color3.fromRGB(175, 175, 179),
}]],
"theme color keys"
)
source = plainReplace(
source,
[[ h.BackgroundColor3 = C.White]],
[[ h.BackgroundColor3 = C.Highlight]],
"theme-aware top highlight"
)
local frostEngine = [[ ------------------------------------------------------------------------
-- Lightweight frosted-glass surfaces
--
-- No screenshot capture / EditableImage / per-pixel reconstruction.
-- Every styled GuiObject gets two live attributes:
-- Transparency : 0 opaque -> 1 transparent
-- Frost : 0 none -> 1 strongest frosted tint
------------------------------------------------------------------------
local frostRefreshers = {}
local configRefreshers = {}
local function styleNumber(style, key, fallback)
if type(style) == "table" and tonumber(style[key]) ~= nil then
return math.clamp(tonumber(style[key]), 0, 1)
end
return fallback
end
local function childStyle(style, key)
if type(style) == "table" and type(style[key]) == "table" then
return style[key]
end
return nil
end
local function applyFrostedSurface(obj, style, z, defaultTransparency, defaultFrost)
defaultTransparency = defaultTransparency or 0
defaultFrost = defaultFrost or 0
local initialTransparency = styleNumber(style, "Transparency", defaultTransparency)
local initialFrost = styleNumber(style, "Frost", defaultFrost)
obj:SetAttribute("Transparency", initialTransparency)
obj:SetAttribute("Frost", initialFrost)
local frostLayer = Instance.new("Frame")
frostLayer.Name = "FrostLayer"
frostLayer.Parent = obj
frostLayer.Size = UDim2.fromScale(1, 1)
frostLayer.BackgroundColor3 = Color3.fromRGB(248, 250, 255)
frostLayer.BorderSizePixel = 0
frostLayer.Active = false
frostLayer.ZIndex = z or obj.ZIndex
local objectCorner =
obj:FindFirstChildOfClass("UICorner")
if objectCorner then
local frostCorner =
Instance.new("UICorner")
frostCorner.CornerRadius =
objectCorner.CornerRadius
frostCorner.Parent =
frostLayer
end
local frostGradient = Instance.new("UIGradient")
frostGradient.Parent = frostLayer
frostGradient.Rotation = 115
frostGradient.Color = ColorSequence.new({
ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)),
ColorSequenceKeypoint.new(0.46, Color3.fromRGB(232, 239, 249)),
ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 255, 255)),
})
local highlight = Instance.new("Frame")
highlight.Name = "FrostHighlight"
highlight.Parent = obj
highlight.AnchorPoint = Vector2.new(0.5, 0)
highlight.Position = UDim2.new(0.5, 0, 0, 1)
highlight.Size = UDim2.new(1, -18, 0, 1)
highlight.BackgroundColor3 = C.Highlight
highlight.BorderSizePixel = 0
highlight.Active = false
highlight.ZIndex = (z or obj.ZIndex) + 1
local function refresh()
local transparency = tonumber(obj:GetAttribute("Transparency"))
local frost = tonumber(obj:GetAttribute("Frost"))
transparency = math.clamp(
transparency ~= nil and transparency or defaultTransparency,
0,
1
)
frost = math.clamp(
frost ~= nil and frost or defaultFrost,
0,
1
)
local effectiveTransparency =
appConfig.TransparencyEnabled ~= false
and transparency
or 0
local globalFrostStrength =
math.clamp(
tonumber(appConfig.FrostStrength)
or 1,
0,
1
)
local effectiveFrost =
appConfig.FrostEnabled ~= false
and frost * globalFrostStrength
or 0
obj.BackgroundTransparency =
effectiveTransparency
if appConfig.Theme == "Dark" then
frostLayer.BackgroundColor3 =
Color3.fromRGB(74, 78, 88)
frostGradient.Color =
ColorSequence.new({
ColorSequenceKeypoint.new(
0,
Color3.fromRGB(118, 124, 136)
),
ColorSequenceKeypoint.new(
0.46,
Color3.fromRGB(62, 68, 78)
),
ColorSequenceKeypoint.new(
1,
Color3.fromRGB(96, 102, 114)
),
})
else
frostLayer.BackgroundColor3 =
Color3.fromRGB(248, 250, 255)
frostGradient.Color =
ColorSequence.new({
ColorSequenceKeypoint.new(
0,
Color3.fromRGB(255, 255, 255)
),
ColorSequenceKeypoint.new(
0.46,
Color3.fromRGB(232, 239, 249)
),
ColorSequenceKeypoint.new(
1,
Color3.fromRGB(255, 255, 255)
),
})
end
frostLayer.Visible =
effectiveFrost > 0.001
frostLayer.BackgroundTransparency =
1 - effectiveFrost * 0.22
frostGradient.Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(
0,
math.clamp(0.18 + (1 - effectiveFrost) * 0.72, 0, 1)
),
NumberSequenceKeypoint.new(
0.50,
math.clamp(0.42 + (1 - effectiveFrost) * 0.50, 0, 1)
),
NumberSequenceKeypoint.new(
1,
math.clamp(0.22 + (1 - effectiveFrost) * 0.68, 0, 1)
),
})
highlight.Visible =
effectiveFrost > 0.001
highlight.BackgroundTransparency =
math.clamp(
1 - effectiveFrost * 0.48,
0,
1
)
end
obj:GetAttributeChangedSignal("Transparency"):Connect(refresh)
obj:GetAttributeChangedSignal("Frost"):Connect(refresh)
table.insert(frostRefreshers, refresh)
refresh()
return {
Overlay = frostLayer,
Highlight = highlight,
Set = function(_, transparency, frost)
if transparency ~= nil then
obj:SetAttribute(
"Transparency",
math.clamp(tonumber(transparency) or defaultTransparency, 0, 1)
)
end
if frost ~= nil then
obj:SetAttribute(
"Frost",
math.clamp(tonumber(frost) or defaultFrost, 0, 1)
)
end
end,
}
end
]]
source = replaceBetween(
source,
[[ ------------------------------------------------------------------------
-- Event-driven Snapshot Liquid Glass]],
[[ ------------------------------------------------------------------------
-- Dynamic Island launcher]],
frostEngine,
"liquid engine"
)
source = replaceBetween(
source,
[[ ------------------------------------------------------------------------
-- Dynamic Island launcher]],
[[ ------------------------------------------------------------------------
-- Window shell + real nine-slice shadow image]],
[[ ------------------------------------------------------------------------
-- Dynamic Island launcher
------------------------------------------------------------------------
local islandShadowHolder = Instance.new("Frame")
islandShadowHolder.Name = "DynamicIslandShadow"
islandShadowHolder.Parent = scrgui
islandShadowHolder.AnchorPoint = Vector2.new(0.5, 0)
islandShadowHolder.Position = UDim2.new(0.5, 0, 0, 10)
islandShadowHolder.Size = UDim2.fromOffset(196, 36)
islandShadowHolder.BackgroundTransparency = 1
islandShadowHolder.BorderSizePixel = 0
islandShadowHolder.ZIndex = 898
local islandShadow = addShadow(
islandShadowHolder,
898,
24,
18,
0.80,
true
)
local island = Instance.new("Frame")
island.Name = "DynamicIsland"
island.Parent = scrgui
island.AnchorPoint = Vector2.new(0.5, 0)
island.Position = UDim2.new(0.5, 0, 0, 8)
island.BackgroundColor3 = C.Black
island.BorderSizePixel = 0
island.ZIndex = 900
island.ClipsDescendants = true
circle(island)
local islandIcon = Instance.new("ImageLabel")
islandIcon.Name = "Icon"
islandIcon.Parent = island
islandIcon.AnchorPoint = Vector2.new(0, 0.5)
islandIcon.BackgroundTransparency = 1
islandIcon.ImageColor3 = C.White
islandIcon.ScaleType = Enum.ScaleType.Fit
islandIcon.ZIndex = 901
local islandAction = Instance.new("TextLabel")
islandAction.Name = "Action"
islandAction.Parent = island
islandAction.AnchorPoint = Vector2.new(0, 0.5)
islandAction.BackgroundTransparency = 1
islandAction.TextColor3 = C.White
islandAction.Font = Enum.Font.GothamMedium
islandAction.TextXAlignment = Enum.TextXAlignment.Left
islandAction.TextTruncate = Enum.TextTruncate.AtEnd
islandAction.ZIndex = 901
local islandFPS = Instance.new("TextLabel")
islandFPS.Name = "FPS"
islandFPS.Parent = island
islandFPS.AnchorPoint = Vector2.new(1, 0.5)
islandFPS.BackgroundTransparency = 1
islandFPS.Text = "60 FPS"
islandFPS.TextColor3 = Color3.fromRGB(142, 142, 147)
islandFPS.Font = Enum.Font.GothamMedium
islandFPS.TextXAlignment = Enum.TextXAlignment.Right
islandFPS.ZIndex = 901
local islandButton = Instance.new("TextButton")
islandButton.Parent = island
islandButton.Size = UDim2.fromScale(1, 1)
islandButton.BackgroundTransparency = 1
islandButton.Text = ""
islandButton.AutoButtonColor = false
islandButton.ZIndex = 902
local function refreshIslandAppearance()
local width =
math.clamp(
tonumber(appConfig.IslandWidth)
or 196,
130,
360
)
local height =
math.clamp(
tonumber(appConfig.IslandHeight)
or 36,
30,
58
)
local iconSize =
math.clamp(
tonumber(appConfig.IslandIconSize)
or 16,
10,
28
)
local textSize =
math.clamp(
tonumber(appConfig.IslandTextSize)
or 11,
8,
20
)
local fpsTextSize =
math.clamp(
tonumber(appConfig.IslandFPSTextSize)
or 11,
8,
20
)
island.Size =
UDim2.fromOffset(
width,
height
)
islandShadowHolder.Size =
UDim2.fromOffset(
width,
height
)
islandIcon.Visible =
appConfig.IslandShowIcon ~= false
islandIcon.Image =
tostring(
appConfig.IslandIcon
or ASSET.Settings
)
islandIcon.Size =
UDim2.fromOffset(
iconSize,
iconSize
)
islandIcon.Position =
UDim2.new(
0,
12,
0.5,
0
)
local actionX =
appConfig.IslandShowIcon ~= false
and (18 + iconSize)
or 14
islandAction.Position =
UDim2.new(
0,
actionX,
0.5,
0
)
islandAction.Size =
UDim2.new(
1,
-(actionX + 66),
1,
0
)
islandAction.Text =
tostring(
appConfig.IslandText
or "点击打开"
)
islandAction.TextSize =
textSize
islandFPS.Position =
UDim2.new(
1,
-12,
0.5,
0
)
islandFPS.Size =
UDim2.fromOffset(
58,
height
)
islandFPS.TextSize =
fpsTextSize
end
table.insert(
configRefreshers,
refreshIslandAppearance
)
refreshIslandAppearance()
local fpsFrames, fpsElapsed = 0, 0
local fpsConnection =
RunService.RenderStepped:Connect(
function(dt)
if not island.Visible then
fpsFrames = 0
fpsElapsed = 0
return
end
fpsFrames += 1
fpsElapsed += dt
if fpsElapsed >= 0.25 then
local fps =
math.max(
1,
math.floor(
(
fpsFrames
/ fpsElapsed
)
+ 0.5
)
)
islandFPS.Text =
tostring(fps)
.. " FPS"
fpsFrames, fpsElapsed =
0, 0
end
end
)
local islandBusy = false
local function islandJelly()
if islandBusy then
return
end
islandBusy = true
local baseW =
island.Size.X.Offset
local baseH =
island.Size.Y.Offset
local growSize =
UDim2.fromOffset(
math.floor(baseW * 1.055 + 0.5),
math.floor(baseH * 1.075 + 0.5)
)
local t1 = tw(
island,
TweenInfo.new(
0.075,
Enum.EasingStyle.Quad,
Enum.EasingDirection.Out
),
{Size = growSize}
)
tw(
islandShadowHolder,
TweenInfo.new(
0.075,
Enum.EasingStyle.Quad,
Enum.EasingDirection.Out
),
{Size = growSize}
)
t1.Completed:Wait()
local squashSize =
UDim2.fromOffset(
math.floor(baseW * 0.985 + 0.5),
math.floor(baseH * 0.97 + 0.5)
)
local t2 = tw(
island,
TweenInfo.new(
0.085,
Enum.EasingStyle.Quad,
Enum.EasingDirection.InOut
),
{Size = squashSize}
)
tw(
islandShadowHolder,
TweenInfo.new(
0.085,
Enum.EasingStyle.Quad,
Enum.EasingDirection.InOut
),
{Size = squashSize}
)
t2.Completed:Wait()
local baseSize =
UDim2.fromOffset(
baseW,
baseH
)
local t3 = tw(
island,
TweenInfo.new(
0.22,
Enum.EasingStyle.Back,
Enum.EasingDirection.Out
),
{Size = baseSize}
)
tw(
islandShadowHolder,
TweenInfo.new(
0.22,
Enum.EasingStyle.Back,
Enum.EasingDirection.Out
),
{Size = baseSize}
)
t3.Completed:Wait()
islandBusy = false
end
------------------------------------------------------------------------
-- Window shell + real nine-slice shadow image
]],
"configurable Dynamic Island"
)