@el4cteo/rbx-studio-mcp 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,147 +1,161 @@
1
- --!strict
2
- --[[
3
- Aurora -- load as an amplitude.
4
-
5
- A curtain of vertical rays whose height follows a travelling wave. The wave
6
- is always there; what the session changes is how violent it is. Idle, it is
7
- a shallow ripple you have to look at to notice. Under load it becomes a
8
- curtain that fills the cell. Nothing here counts or ranks anything, which is
9
- the point: it answers "how hard is this working" continuously, where Lattice
10
- answers it in four steps and Orbit in six.
11
-
12
- Two waves at different rates are summed rather than one, because a single
13
- sine is a loading bar lying on its side -- the interference is what makes it
14
- read as something physical rather than as an animation on a loop.
15
-
16
- Colour runs green at the base to violet at the tips, which is the actual
17
- emission order of a real aurora and, more usefully here, means the height of
18
- a ray is legible from its colour alone at four pixels wide.
19
- ]]
20
-
21
- local Draw = require(script.Parent.Draw)
22
- local Theme = require(script.Parent.Theme)
23
-
24
- local RAYS = 15
25
-
26
- local Aurora = {}
27
-
28
- Aurora.id = "aurora"
29
- Aurora.label = "Aurora"
30
- Aurora.blurb = "Rising curtain"
31
-
32
- Aurora.palette = {
33
- background = Color3.fromRGB(9, 14, 28),
34
- surface = Color3.fromRGB(16, 23, 44),
35
- rule = Color3.fromRGB(108, 226, 178),
36
- text = Color3.fromRGB(206, 220, 238),
37
- dim = Color3.fromRGB(86, 100, 130),
38
- green = Color3.fromRGB(108, 232, 172),
39
- red = Color3.fromRGB(246, 126, 146),
40
- amber = Color3.fromRGB(244, 196, 128),
41
- cyan = Color3.fromRGB(114, 214, 236),
42
- violet = Color3.fromRGB(162, 146, 240),
43
- }
44
-
45
- local rays: { Frame } = {}
46
-
47
- function Aurora.mount(cell: Frame)
48
- rays = {}
49
- for index = 1, RAYS do
50
- local ray = Instance.new("Frame")
51
- ray.Name = string.format("Ray%02d", index)
52
- -- Anchored at the bottom so height grows upward from a fixed baseline,
53
- -- which is what makes the curtain rise rather than expand about its
54
- -- middle.
55
- ray.AnchorPoint = Vector2.new(0.5, 1)
56
- ray.BorderSizePixel = 0
57
- ray.Parent = cell
58
- local corner = Instance.new("UICorner")
59
- corner.CornerRadius = UDim.new(0, 1)
60
- corner.Parent = ray
61
- rays[index] = ray
62
- end
63
- end
64
-
65
- function Aurora.unmount()
66
- rays = {}
67
- end
68
-
69
- function Aurora.paint(ctx: Theme.Context, _delta: number)
70
- local width = ctx.size
71
- local spacing = width / (RAYS + 1)
72
-
73
- --[[
74
- The floor is what keeps an idle panel alive.
75
-
76
- Amplitude driven purely by activity would flatten the curtain to nothing
77
- between commands, and a flat line is indistinguishable from a plugin
78
- that has crashed. A tenth of the range is always moving.
79
- ]]
80
- local amplitude = 0.1 + math.clamp(ctx.activity, 0, 1) * 0.62 + ctx.energy * 0.16
81
- local pace = if ctx.quiet > 20 then 0.35 else 1
82
-
83
- for index = 1, RAYS do
84
- local ray = rays[index]
85
- if ray == nil then
86
- continue
87
- end
88
- local across = index / RAYS
89
-
90
- -- Two travelling waves, incommensurate rates. Their beat is slow enough
91
- -- that the curtain visibly reshapes over several seconds instead of
92
- -- repeating on a cycle the eye can learn.
93
- local wave = math.sin(across * 5.2 - ctx.clock * 1.6 * pace)
94
- + 0.6 * math.sin(across * 2.7 + ctx.clock * 0.9 * pace)
95
- local normalised = (wave + 1.6) / 3.2
96
-
97
- local height = math.max(2, math.floor(width * (0.12 + normalised * amplitude) * ctx.scale))
98
- local reach = math.clamp(height / width, 0, 1)
99
-
100
- ray.Size = UDim2.fromOffset(3, height)
101
- ray.Position = UDim2.fromOffset(spacing * index, width - 2)
102
- -- Green low, violet high: the ray's own height is readable from its
103
- -- colour, which a three-pixel column badly needs.
104
- ray.BackgroundColor3 = ctx.palette.green
105
- :Lerp(ctx.palette.violet, reach)
106
- :Lerp(Color3.new(1, 1, 1), ctx.flare * 0.45)
107
- ray.BackgroundTransparency = math.clamp(0.74 - reach * 0.45 - ctx.flare * 0.3, 0, 1)
108
- end
109
- end
110
-
111
- --[[
112
- The trace as a continuation of the curtain: same rays, same colour rule, but
113
- their heights are history rather than a wave.
114
- ]]
115
- function Aurora.paintSlot(slot: Theme.Slot, ctx: Theme.Context)
116
- local frame = slot.frame
117
- local recency = 1 - slot.age
118
- local height = math.max(2, math.floor(2 + slot.weight * 21))
119
-
120
- frame.AnchorPoint = Vector2.new(0.5, 1)
121
- frame.Size = UDim2.fromOffset(3, height)
122
- frame.Position = UDim2.new(frame.Position.X.Scale, frame.Position.X.Offset, 1, 0)
123
- frame.BackgroundColor3 = if slot.ok
124
- then ctx.palette.green:Lerp(ctx.palette.violet, slot.weight)
125
- else ctx.palette.red
126
- frame.BackgroundTransparency = math.clamp(0.66 - recency * 0.56, 0, 1)
127
- frame.Rotation = 0
128
- end
129
-
130
- function Aurora.swatch(frame: Frame, palette: Theme.Palette)
131
- for index = 1, 12 do
132
- local ray = Instance.new("Frame")
133
- ray.AnchorPoint = Vector2.new(0.5, 1)
134
- ray.BorderSizePixel = 0
135
- local across = index / 12
136
- local wave = math.sin(across * 5.2) + 0.6 * math.sin(across * 2.7)
137
- local reach = (wave + 1.6) / 3.2
138
- local height = math.max(2, math.floor(4 + reach * 17))
139
- ray.Size = UDim2.fromOffset(2, height)
140
- ray.Position = UDim2.fromOffset(3 + index * 3, 23)
141
- ray.BackgroundColor3 = palette.green:Lerp(palette.violet, reach)
142
- ray.BackgroundTransparency = 0.35
143
- ray.Parent = frame
144
- end
145
- end
146
-
147
- return Aurora
1
+ --!strict
2
+ --[[
3
+ Aurora -- load as an amplitude.
4
+
5
+ A curtain of vertical rays whose height follows a travelling wave. The wave
6
+ is always there; what the session changes is how violent it is. Idle, it is
7
+ a shallow ripple you have to look at to notice. Under load it becomes a
8
+ curtain that fills the cell. Nothing here counts or ranks anything, which is
9
+ the point: it answers "how hard is this working" continuously, where Lattice
10
+ answers it in four steps and Orbit in six.
11
+
12
+ Two waves at different rates are summed rather than one, because a single
13
+ sine is a loading bar lying on its side -- the interference is what makes it
14
+ read as something physical rather than as an animation on a loop.
15
+
16
+ Colour runs green at the base to violet at the tips, which is the actual
17
+ emission order of a real aurora and, more usefully here, means the height of
18
+ a ray is legible from its colour alone at four pixels wide.
19
+ ]]
20
+
21
+ local Draw = require(script.Parent.Draw)
22
+ local Theme = require(script.Parent.Theme)
23
+
24
+ local RAYS = 15
25
+
26
+ local Aurora = {}
27
+
28
+ Aurora.id = "aurora"
29
+ Aurora.label = "Aurora"
30
+ Aurora.blurb = "Rising curtain"
31
+
32
+ Aurora.palette = {
33
+ background = Color3.fromRGB(9, 14, 28),
34
+ surface = Color3.fromRGB(16, 23, 44),
35
+ rule = Color3.fromRGB(108, 226, 178),
36
+ text = Color3.fromRGB(206, 220, 238),
37
+ dim = Color3.fromRGB(86, 100, 130),
38
+ green = Color3.fromRGB(108, 232, 172),
39
+ red = Color3.fromRGB(246, 126, 146),
40
+ amber = Color3.fromRGB(244, 196, 128),
41
+ cyan = Color3.fromRGB(114, 214, 236),
42
+ violet = Color3.fromRGB(162, 146, 240),
43
+ }
44
+
45
+ local rays: { Frame } = {}
46
+
47
+ --[[
48
+ Accumulated wave phase, rather than wall time times a rate.
49
+
50
+ `ctx.clock * 1.6 * pace` looks harmless and is not: `pace` drops to 0.35 the
51
+ moment the session goes quiet, and multiplying a clock in the thousands by a
52
+ rate that changes RESHAPES the whole curtain in one frame -- the same class
53
+ of fault as Void's disc, just rarer, because this rate only moves twice per
54
+ idle cycle instead of every frame. Integrating it means going quiet slows the
55
+ curtain, which is what was meant.
56
+ ]]
57
+ local phase = 0
58
+
59
+ function Aurora.mount(cell: Frame)
60
+ rays = {}
61
+ for index = 1, RAYS do
62
+ local ray = Instance.new("Frame")
63
+ ray.Name = string.format("Ray%02d", index)
64
+ -- Anchored at the bottom so height grows upward from a fixed baseline,
65
+ -- which is what makes the curtain rise rather than expand about its
66
+ -- middle.
67
+ ray.AnchorPoint = Vector2.new(0.5, 1)
68
+ ray.BorderSizePixel = 0
69
+ ray.Parent = cell
70
+ local corner = Instance.new("UICorner")
71
+ corner.CornerRadius = UDim.new(0, 1)
72
+ corner.Parent = ray
73
+ rays[index] = ray
74
+ end
75
+ end
76
+
77
+ function Aurora.unmount()
78
+ phase = 0
79
+ rays = {}
80
+ end
81
+
82
+ function Aurora.paint(ctx: Theme.Context, delta: number)
83
+ local width = ctx.size
84
+ local spacing = width / (RAYS + 1)
85
+
86
+ --[[
87
+ The floor is what keeps an idle panel alive.
88
+
89
+ Amplitude driven purely by activity would flatten the curtain to nothing
90
+ between commands, and a flat line is indistinguishable from a plugin
91
+ that has crashed. A tenth of the range is always moving.
92
+ ]]
93
+ local amplitude = 0.1 + math.clamp(ctx.activity, 0, 1) * 0.62 + ctx.energy * 0.16
94
+ local pace = if ctx.quiet > 20 then 0.35 else 1
95
+ phase += delta * pace
96
+
97
+ for index = 1, RAYS do
98
+ local ray = rays[index]
99
+ if ray == nil then
100
+ continue
101
+ end
102
+ local across = index / RAYS
103
+
104
+ -- Two travelling waves, incommensurate rates. Their beat is slow enough
105
+ -- that the curtain visibly reshapes over several seconds instead of
106
+ -- repeating on a cycle the eye can learn.
107
+ local wave = math.sin(across * 5.2 - phase * 1.6)
108
+ + 0.6 * math.sin(across * 2.7 + phase * 0.9)
109
+ local normalised = (wave + 1.6) / 3.2
110
+
111
+ local height = math.max(2, math.floor(width * (0.12 + normalised * amplitude) * ctx.scale))
112
+ local reach = math.clamp(height / width, 0, 1)
113
+
114
+ ray.Size = UDim2.fromOffset(3, height)
115
+ ray.Position = UDim2.fromOffset(spacing * index, width - 2)
116
+ -- Green low, violet high: the ray's own height is readable from its
117
+ -- colour, which a three-pixel column badly needs.
118
+ ray.BackgroundColor3 = ctx.palette.green
119
+ :Lerp(ctx.palette.violet, reach)
120
+ :Lerp(Color3.new(1, 1, 1), ctx.flare * 0.45)
121
+ ray.BackgroundTransparency = math.clamp(0.74 - reach * 0.45 - ctx.flare * 0.3, 0, 1)
122
+ end
123
+ end
124
+
125
+ --[[
126
+ The trace as a continuation of the curtain: same rays, same colour rule, but
127
+ their heights are history rather than a wave.
128
+ ]]
129
+ function Aurora.paintSlot(slot: Theme.Slot, ctx: Theme.Context)
130
+ local frame = slot.frame
131
+ local recency = 1 - slot.age
132
+ local height = math.max(2, math.floor(2 + slot.weight * 21))
133
+
134
+ frame.AnchorPoint = Vector2.new(0.5, 1)
135
+ frame.Size = UDim2.fromOffset(3, height)
136
+ frame.Position = UDim2.new(frame.Position.X.Scale, frame.Position.X.Offset, 1, 0)
137
+ frame.BackgroundColor3 = if slot.ok
138
+ then ctx.palette.green:Lerp(ctx.palette.violet, slot.weight)
139
+ else ctx.palette.red
140
+ frame.BackgroundTransparency = math.clamp(0.66 - recency * 0.56, 0, 1)
141
+ frame.Rotation = 0
142
+ end
143
+
144
+ function Aurora.swatch(frame: Frame, palette: Theme.Palette)
145
+ for index = 1, 12 do
146
+ local ray = Instance.new("Frame")
147
+ ray.AnchorPoint = Vector2.new(0.5, 1)
148
+ ray.BorderSizePixel = 0
149
+ local across = index / 12
150
+ local wave = math.sin(across * 5.2) + 0.6 * math.sin(across * 2.7)
151
+ local reach = (wave + 1.6) / 3.2
152
+ local height = math.max(2, math.floor(4 + reach * 17))
153
+ ray.Size = UDim2.fromOffset(2, height)
154
+ ray.Position = UDim2.fromOffset(3 + index * 3, 23)
155
+ ray.BackgroundColor3 = palette.green:Lerp(palette.violet, reach)
156
+ ray.BackgroundTransparency = 0.35
157
+ ray.Parent = frame
158
+ end
159
+ end
160
+
161
+ return Aurora