-
Notifications
You must be signed in to change notification settings - Fork 9
/
RoStrapPriorityUI.lua
93 lines (75 loc) · 2.33 KB
/
RoStrapPriorityUI.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
-- Abstract UI ReplicatedPseudoInstance
-- @author Validark
local Players = game:GetService("Players")
local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Resources = require(ReplicatedStorage:WaitForChild("Resources"))
local Color = Resources:LoadLibrary("Color")
local Debug = Resources:LoadLibrary("Debug")
local Tween = Resources:LoadLibrary("Tween")
local Typer = Resources:LoadLibrary("Typer")
local Enumeration = Resources:LoadLibrary("Enumeration")
local PseudoInstance = Resources:LoadLibrary("PseudoInstance")
local ReplicatedPseudoInstance = Resources:LoadLibrary("ReplicatedPseudoInstance")
local InBack = Enumeration.EasingFunction.InBack.Value
local OutBack = Enumeration.EasingFunction.OutBack.Value
local LocalPlayer, PlayerGui do
if RunService:IsClient() then
if RunService:IsServer() then
PlayerGui = game:GetService("CoreGui")
else
repeat LocalPlayer = Players.LocalPlayer until LocalPlayer or not wait()
repeat PlayerGui = LocalPlayer:FindFirstChildOfClass("PlayerGui") until PlayerGui or not wait()
end
end
end
local Screen = Instance.new("ScreenGui", PlayerGui)
Screen.Name = "RoStrapPriorityUIs"
Screen.DisplayOrder = 2^31 - 2
local DialogBlur = Instance.new("BlurEffect")
DialogBlur.Size = 0
DialogBlur.Name = "RoStrapBlur"
local function SetDialogBlurParentToNil()
DialogBlur.Parent = nil
end
-- NOTE: Enter()s automatically when Parented
return PseudoInstance:Register("RoStrapPriorityUI", {
Storage = {};
Internals = {
Blur = function(self)
DialogBlur.Parent = Lighting
Tween(DialogBlur, "Size", 56, OutBack, self.ENTER_TIME, true)
end;
Unblur = function(self)
Tween(DialogBlur, "Size", 0, InBack, self.ENTER_TIME, true, SetDialogBlurParentToNil)
end;
DISMISS_TIME = 75 / 1000 * 2;
ENTER_TIME = 150 / 1000 * 2;
SCREEN = Screen;
};
Events = { };
Methods = {
Enter = 0;
Dismiss = 0;
Destroy = function(self)
self:Dismiss()
self:super("Destroy")
end;
};
Properties = {
Parent = function(self, Parent)
if Parent and PlayerGui then
self:Enter()
if self.SHOULD_BLUR then
self:Blur()
end
end
self:rawset("Parent", Parent)
end;
Dismissed = Typer.Boolean;
};
Init = function(self, ...)
self:superinit(...)
end;
}, ReplicatedPseudoInstance)