@rbxts/centurion-ui 1.0.0-dev-d5e9351 → 1.0.0-dev-e01f578
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.
package/out/app/init.lua
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v2.3.0-dev-26ec859
|
|
2
2
|
local TS = _G[script]
|
|
3
|
+
local CenturionType = TS.import(script, TS.getModule(script, "@rbxts", "centurion").out).CenturionType
|
|
3
4
|
local _services = TS.import(script, TS.getModule(script, "@rbxts", "services"))
|
|
4
5
|
local ContentProvider = _services.ContentProvider
|
|
5
6
|
local Players = _services.Players
|
|
6
7
|
local mount = TS.import(script, TS.getModule(script, "@rbxts", "vide").src).mount
|
|
7
8
|
local DEFAULT_INTERFACE_OPTIONS = TS.import(script, script.Parent, "constants", "options").DEFAULT_INTERFACE_OPTIONS
|
|
9
|
+
local DefaultPalette = TS.import(script, script.Parent, "palette").DefaultPalette
|
|
8
10
|
local interfaceOptions = TS.import(script, script.Parent, "store").interfaceOptions
|
|
9
11
|
local CenturionApp = TS.import(script, script, "centurion-app").CenturionApp
|
|
10
12
|
local CenturionUI = {}
|
|
@@ -23,11 +25,35 @@ do
|
|
|
23
25
|
end)
|
|
24
26
|
end
|
|
25
27
|
_container.updateOptions = updateOptions
|
|
28
|
+
local function registerCommands(registry)
|
|
29
|
+
registry:registerCommand({
|
|
30
|
+
name = "theme",
|
|
31
|
+
description = "Change the terminal's theme",
|
|
32
|
+
arguments = { {
|
|
33
|
+
name = "name",
|
|
34
|
+
description = "The name of the theme",
|
|
35
|
+
type = CenturionType.String,
|
|
36
|
+
suggestions = { "mocha", "macchiato", "frappe", "latte" },
|
|
37
|
+
} },
|
|
38
|
+
}, function(ctx, theme)
|
|
39
|
+
if not (DefaultPalette[theme] ~= nil) then
|
|
40
|
+
ctx:error("Invalid theme")
|
|
41
|
+
return nil
|
|
42
|
+
end
|
|
43
|
+
updateOptions({
|
|
44
|
+
palette = DefaultPalette[theme],
|
|
45
|
+
})
|
|
46
|
+
ctx:reply(`Set theme to '{theme}'`)
|
|
47
|
+
end, { "centurion" })
|
|
48
|
+
end
|
|
26
49
|
local function create(options)
|
|
27
50
|
if options == nil then
|
|
28
51
|
options = {}
|
|
29
52
|
end
|
|
30
53
|
return function(api)
|
|
54
|
+
if api.options.registerBuiltInCommands then
|
|
55
|
+
registerCommands(api.registry)
|
|
56
|
+
end
|
|
31
57
|
updateOptions(options)
|
|
32
58
|
-- Attempt to preload font
|
|
33
59
|
task.spawn(function()
|
|
@@ -85,6 +85,7 @@ local function Suggestions()
|
|
|
85
85
|
suggestionSizeMotion:spring(UDim2.fromOffset(windowWidth, windowHeight), springs.responsive)
|
|
86
86
|
end)
|
|
87
87
|
return Vide.jsx(Group, {
|
|
88
|
+
size = UDim2.fromScale(1, 1),
|
|
88
89
|
visible = currentSuggestion ~= nil,
|
|
89
90
|
}, Vide.jsx(MainSuggestion, {
|
|
90
91
|
suggestion = suggestion,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rbxts/centurion-ui",
|
|
3
3
|
"description": "Terminal UI for the Centurion command framework",
|
|
4
|
-
"version": "1.0.0-dev-
|
|
4
|
+
"version": "1.0.0-dev-e01f578",
|
|
5
5
|
"author": "paradoxuum",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "out/init.lua",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dev": "shx rm -rf out && rbxtsc -w"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@rbxts/centurion": "^1.0.0-dev-
|
|
35
|
+
"@rbxts/centurion": "^1.0.0-dev-e01f578",
|
|
36
36
|
"@rbxts/compiler-types": "2.3.0-types.1",
|
|
37
37
|
"@rbxts/types": "^1.0.790",
|
|
38
38
|
"roblox-ts": "2.3.0-dev-26ec859",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@rbxts/vide": "^0.4.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@rbxts/centurion": "^1.0.0-dev-
|
|
50
|
+
"@rbxts/centurion": "^1.0.0-dev-e01f578"
|
|
51
51
|
},
|
|
52
52
|
"stableVersion": "1.0.0"
|
|
53
53
|
}
|