@h-rig/cli 0.0.6-alpha.81 → 0.0.6-alpha.83
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/dist/bin/build-rig-binaries.js +40 -8
- package/dist/bin/rig.js +2807 -1443
- package/dist/src/app/board.js +62 -13
- package/dist/src/app-opentui/adapters/command.d.ts +2 -0
- package/dist/src/app-opentui/adapters/command.js +329 -0
- package/dist/src/app-opentui/adapters/common.js +2 -2
- package/dist/src/app-opentui/adapters/doctor.js +63 -14
- package/dist/src/app-opentui/adapters/fleet.js +84 -20
- package/dist/src/app-opentui/adapters/inbox.js +83 -19
- package/dist/src/app-opentui/adapters/init.js +87 -23
- package/dist/src/app-opentui/adapters/pi-attach.js +102 -36
- package/dist/src/app-opentui/adapters/run-detail.js +83 -19
- package/dist/src/app-opentui/adapters/server.js +100 -23
- package/dist/src/app-opentui/adapters/tasks.d.ts +11 -0
- package/dist/src/app-opentui/adapters/tasks.js +742 -94
- package/dist/src/app-opentui/bootstrap.d.ts +1 -6
- package/dist/src/app-opentui/bootstrap.js +13776 -12369
- package/dist/src/app-opentui/command-pty-host.d.ts +62 -0
- package/dist/src/app-opentui/command-pty-host.js +248 -0
- package/dist/src/app-opentui/events.js +1 -1
- package/dist/src/app-opentui/focus-manager.d.ts +14 -0
- package/dist/src/app-opentui/focus-manager.js +24 -0
- package/dist/src/app-opentui/index.js +3806 -2878
- package/dist/src/app-opentui/intent.js +154 -48
- package/dist/src/app-opentui/keymap.d.ts +20 -0
- package/dist/src/app-opentui/keymap.js +707 -0
- package/dist/src/app-opentui/launch-routing.d.ts +16 -0
- package/dist/src/app-opentui/launch-routing.js +55 -0
- package/dist/src/app-opentui/layout.js +2 -2
- package/dist/src/app-opentui/pi-host-child.js +66 -16
- package/dist/src/app-opentui/pi-pty-host.d.ts +9 -0
- package/dist/src/app-opentui/pi-pty-host.js +15 -13
- package/dist/src/app-opentui/registry.js +3228 -2396
- package/dist/src/app-opentui/render/ascii-fleet.d.ts +15 -0
- package/dist/src/app-opentui/render/ascii-fleet.js +82 -0
- package/dist/src/app-opentui/render/graphics.d.ts +1 -1
- package/dist/src/app-opentui/render/graphics.js +131 -16
- package/dist/src/app-opentui/render/image-visual-layer-worker.js +413 -958
- package/dist/src/app-opentui/render/image-visual-layer.d.ts +19 -10
- package/dist/src/app-opentui/render/image-visual-layer.js +391 -357
- package/dist/src/app-opentui/render/panel-layout.d.ts +38 -0
- package/dist/src/app-opentui/render/panel-layout.js +48 -0
- package/dist/src/app-opentui/render/panels.d.ts +2 -0
- package/dist/src/app-opentui/render/panels.js +62 -29
- package/dist/src/app-opentui/render/preloader.d.ts +10 -0
- package/dist/src/app-opentui/render/preloader.js +163 -0
- package/dist/src/app-opentui/render/scene.d.ts +3 -0
- package/dist/src/app-opentui/render/scene.js +12 -0
- package/dist/src/app-opentui/render/text.js +5 -1
- package/dist/src/app-opentui/render/type-bar.d.ts +2 -1
- package/dist/src/app-opentui/render/type-bar.js +51 -16
- package/dist/src/app-opentui/runtime-resources.d.ts +16 -0
- package/dist/src/app-opentui/runtime-resources.js +62 -0
- package/dist/src/app-opentui/runtime.js +2329 -1512
- package/dist/src/app-opentui/scenes/command.d.ts +3 -0
- package/dist/src/app-opentui/scenes/command.js +103 -0
- package/dist/src/app-opentui/scenes/doctor.d.ts +2 -1
- package/dist/src/app-opentui/scenes/doctor.js +53 -14
- package/dist/src/app-opentui/scenes/error.js +44 -14
- package/dist/src/app-opentui/scenes/fleet.js +40 -21
- package/dist/src/app-opentui/scenes/handoff.js +142 -27
- package/dist/src/app-opentui/scenes/help.js +63 -48
- package/dist/src/app-opentui/scenes/inbox.d.ts +2 -1
- package/dist/src/app-opentui/scenes/inbox.js +64 -17
- package/dist/src/app-opentui/scenes/init.d.ts +2 -1
- package/dist/src/app-opentui/scenes/init.js +62 -21
- package/dist/src/app-opentui/scenes/main.d.ts +2 -1
- package/dist/src/app-opentui/scenes/main.js +80 -24
- package/dist/src/app-opentui/scenes/run-detail.d.ts +2 -1
- package/dist/src/app-opentui/scenes/run-detail.js +39 -25
- package/dist/src/app-opentui/scenes/server.d.ts +2 -1
- package/dist/src/app-opentui/scenes/server.js +71 -20
- package/dist/src/app-opentui/scenes/tasks.js +44 -22
- package/dist/src/app-opentui/state.js +70 -30
- package/dist/src/app-opentui/terminal-capabilities.d.ts +7 -0
- package/dist/src/app-opentui/terminal-capabilities.js +15 -0
- package/dist/src/app-opentui/types.d.ts +10 -2
- package/dist/src/commands/_doctor-checks.js +62 -13
- package/dist/src/commands/_operator-view.js +63 -13
- package/dist/src/commands/_pi-frontend.js +63 -13
- package/dist/src/commands/_preflight.js +64 -14
- package/dist/src/commands/_server-client.js +82 -18
- package/dist/src/commands/_snapshot-upload.js +62 -13
- package/dist/src/commands/connect.js +7 -1
- package/dist/src/commands/doctor.js +62 -13
- package/dist/src/commands/github.js +144 -23
- package/dist/src/commands/inbox.js +62 -13
- package/dist/src/commands/init.js +82 -18
- package/dist/src/commands/inspect.js +62 -13
- package/dist/src/commands/run.js +66 -13
- package/dist/src/commands/server.js +69 -14
- package/dist/src/commands/setup.js +62 -13
- package/dist/src/commands/stats.js +62 -13
- package/dist/src/commands/task-run-driver.js +62 -13
- package/dist/src/commands/task.js +65 -14
- package/dist/src/commands.js +227 -92
- package/dist/src/index.js +234 -99
- package/package.json +8 -9
- package/dist/src/app-opentui/render/image-visual-layer-native-canvas.d.ts +0 -2
- package/dist/src/app-opentui/render/image-visual-layer-native-canvas.js +0 -1480
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const FLEET_GRID_WIDTH = 52;
|
|
2
|
+
export declare const FLEET_GRID_HEIGHT = 27;
|
|
3
|
+
export type FleetSprite = {
|
|
4
|
+
readonly art: readonly string[];
|
|
5
|
+
readonly x: number;
|
|
6
|
+
readonly y: number;
|
|
7
|
+
readonly amp: number;
|
|
8
|
+
readonly speed: number;
|
|
9
|
+
readonly phase: number;
|
|
10
|
+
readonly dx: number;
|
|
11
|
+
readonly driftSpeed: number;
|
|
12
|
+
};
|
|
13
|
+
export declare function fleetRows(tick: number, options?: {
|
|
14
|
+
readonly animate?: boolean;
|
|
15
|
+
}): string[];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/cli/src/app-opentui/render/ascii-fleet.ts
|
|
3
|
+
var LEAD_DRONE = [
|
|
4
|
+
" .-=-. .-=-. ",
|
|
5
|
+
" ( !!! ) ( !!! ) ",
|
|
6
|
+
" '-=-'._ _.'-=-' ",
|
|
7
|
+
" '._ _.' ",
|
|
8
|
+
" '=$$$$$$$=.' ",
|
|
9
|
+
" =$$$$$$$$$$$= ",
|
|
10
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
11
|
+
" $$$@@ @@$$$ ",
|
|
12
|
+
" $$@ ? @$$$ ",
|
|
13
|
+
" $$$@ '-' @$$$ ",
|
|
14
|
+
" $$$@@ @@$$$ ",
|
|
15
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
16
|
+
" =$$$$$$$$$$$= ",
|
|
17
|
+
" '=$$$$$$$=.' ",
|
|
18
|
+
" _.' '._ ",
|
|
19
|
+
" .-=-.' '.-=-. ",
|
|
20
|
+
" ( !!! ) ( !!! ) ",
|
|
21
|
+
" '-=-' '-=-' "
|
|
22
|
+
];
|
|
23
|
+
var MINI_DRONE = [
|
|
24
|
+
"(!!!) (!!!)",
|
|
25
|
+
" \\%==%/ ",
|
|
26
|
+
" %%?%% ",
|
|
27
|
+
" /%==%\\ ",
|
|
28
|
+
"(!!!) (!!!)"
|
|
29
|
+
];
|
|
30
|
+
var ROTORS = ["---", "\\\\\\", "|||", "///"];
|
|
31
|
+
var FLEET_GRID_WIDTH = 52;
|
|
32
|
+
var FLEET_GRID_HEIGHT = 27;
|
|
33
|
+
var FLEET = [
|
|
34
|
+
{ art: MINI_DRONE, x: 0, y: 2, amp: 1, speed: 0.05, phase: 0, dx: 1, driftSpeed: 0.02 },
|
|
35
|
+
{ art: MINI_DRONE, x: 39, y: 2, amp: 1, speed: 0.044, phase: 2.1, dx: 1, driftSpeed: 0.017 },
|
|
36
|
+
{ art: MINI_DRONE, x: 1, y: 20, amp: 1, speed: 0.048, phase: 4.2, dx: 1, driftSpeed: 0.023 },
|
|
37
|
+
{ art: MINI_DRONE, x: 38, y: 20, amp: 1, speed: 0.041, phase: 1.3, dx: 1, driftSpeed: 0.015 },
|
|
38
|
+
{ art: LEAD_DRONE, x: 10, y: 5, amp: 2, speed: 0.04, phase: 0, dx: 0, driftSpeed: 0.011 }
|
|
39
|
+
];
|
|
40
|
+
function fleetRows(tick, options = {}) {
|
|
41
|
+
const animate = options.animate ?? true;
|
|
42
|
+
const t = animate ? tick : 0;
|
|
43
|
+
const blade = ROTORS[Math.floor(t / 4) % ROTORS.length];
|
|
44
|
+
const pulse = Math.sin(t * 0.07);
|
|
45
|
+
const eye = pulse > 0.45 ? "@" : pulse > -0.1 ? "o" : ".";
|
|
46
|
+
const grid = Array.from({ length: FLEET_GRID_HEIGHT }, () => Array.from({ length: FLEET_GRID_WIDTH }, () => " "));
|
|
47
|
+
for (const drone of FLEET) {
|
|
48
|
+
const yOffset = drone.y + Math.round(drone.amp * Math.sin(t * drone.speed + drone.phase));
|
|
49
|
+
const xOffset = drone.x + Math.round(drone.dx * Math.sin(t * drone.driftSpeed + drone.phase));
|
|
50
|
+
for (let row = 0;row < drone.art.length; row += 1) {
|
|
51
|
+
const source = drone.art[row];
|
|
52
|
+
const targetY = yOffset + row;
|
|
53
|
+
if (targetY < 0 || targetY >= FLEET_GRID_HEIGHT)
|
|
54
|
+
continue;
|
|
55
|
+
for (let col = 0;col < source.length; col += 1) {
|
|
56
|
+
let char = source[col];
|
|
57
|
+
if (char === " ")
|
|
58
|
+
continue;
|
|
59
|
+
const targetX = xOffset + col;
|
|
60
|
+
if (targetX < 0 || targetX >= FLEET_GRID_WIDTH)
|
|
61
|
+
continue;
|
|
62
|
+
if (source.slice(col, col + 3) === "!!!") {
|
|
63
|
+
for (let rotorIndex = 0;rotorIndex < 3; rotorIndex += 1) {
|
|
64
|
+
if (targetX + rotorIndex < FLEET_GRID_WIDTH)
|
|
65
|
+
grid[targetY][targetX + rotorIndex] = blade[rotorIndex];
|
|
66
|
+
}
|
|
67
|
+
col += 2;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (char === "?")
|
|
71
|
+
char = eye;
|
|
72
|
+
grid[targetY][targetX] = char;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return grid.map((row) => row.join("").replace(/\s+$/, ""));
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
fleetRows,
|
|
80
|
+
FLEET_GRID_WIDTH,
|
|
81
|
+
FLEET_GRID_HEIGHT
|
|
82
|
+
};
|
|
@@ -34,6 +34,6 @@ export declare function createGraphicsLayer(renderer: CliRenderer, layout: Stage
|
|
|
34
34
|
export declare function resizeGraphicsLayer(layer: RigGraphicsLayer, layout: StageLayout): void;
|
|
35
35
|
export declare function clearGraphicsLayer(layer: RigGraphicsLayer): void;
|
|
36
36
|
export declare function drawPanelChrome(layer: RigGraphicsLayer, layout: StageLayout, panels: readonly AppScenePanel[]): void;
|
|
37
|
-
export declare function drawAmbientField(layer: RigGraphicsLayer, layout: StageLayout,
|
|
37
|
+
export declare function drawAmbientField(layer: RigGraphicsLayer, layout: StageLayout, _tick: number, scene?: AppSceneId): void;
|
|
38
38
|
export declare function drawSparkline(layer: RigGraphicsLayer, x: number, y: number, values: readonly number[], color?: RGBA): void;
|
|
39
39
|
export {};
|
|
@@ -40,6 +40,99 @@ var styles = {
|
|
|
40
40
|
magenta: otuiFg(RIG_UI.magenta)
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
// packages/cli/src/app-opentui/render/ascii-fleet.ts
|
|
44
|
+
var LEAD_DRONE = [
|
|
45
|
+
" .-=-. .-=-. ",
|
|
46
|
+
" ( !!! ) ( !!! ) ",
|
|
47
|
+
" '-=-'._ _.'-=-' ",
|
|
48
|
+
" '._ _.' ",
|
|
49
|
+
" '=$$$$$$$=.' ",
|
|
50
|
+
" =$$$$$$$$$$$= ",
|
|
51
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
52
|
+
" $$$@@ @@$$$ ",
|
|
53
|
+
" $$@ ? @$$$ ",
|
|
54
|
+
" $$$@ '-' @$$$ ",
|
|
55
|
+
" $$$@@ @@$$$ ",
|
|
56
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
57
|
+
" =$$$$$$$$$$$= ",
|
|
58
|
+
" '=$$$$$$$=.' ",
|
|
59
|
+
" _.' '._ ",
|
|
60
|
+
" .-=-.' '.-=-. ",
|
|
61
|
+
" ( !!! ) ( !!! ) ",
|
|
62
|
+
" '-=-' '-=-' "
|
|
63
|
+
];
|
|
64
|
+
var MINI_DRONE = [
|
|
65
|
+
"(!!!) (!!!)",
|
|
66
|
+
" \\%==%/ ",
|
|
67
|
+
" %%?%% ",
|
|
68
|
+
" /%==%\\ ",
|
|
69
|
+
"(!!!) (!!!)"
|
|
70
|
+
];
|
|
71
|
+
var ROTORS = ["---", "\\\\\\", "|||", "///"];
|
|
72
|
+
var FLEET_GRID_WIDTH = 52;
|
|
73
|
+
var FLEET_GRID_HEIGHT = 27;
|
|
74
|
+
var FLEET = [
|
|
75
|
+
{ art: MINI_DRONE, x: 0, y: 2, amp: 1, speed: 0.05, phase: 0, dx: 1, driftSpeed: 0.02 },
|
|
76
|
+
{ art: MINI_DRONE, x: 39, y: 2, amp: 1, speed: 0.044, phase: 2.1, dx: 1, driftSpeed: 0.017 },
|
|
77
|
+
{ art: MINI_DRONE, x: 1, y: 20, amp: 1, speed: 0.048, phase: 4.2, dx: 1, driftSpeed: 0.023 },
|
|
78
|
+
{ art: MINI_DRONE, x: 38, y: 20, amp: 1, speed: 0.041, phase: 1.3, dx: 1, driftSpeed: 0.015 },
|
|
79
|
+
{ art: LEAD_DRONE, x: 10, y: 5, amp: 2, speed: 0.04, phase: 0, dx: 0, driftSpeed: 0.011 }
|
|
80
|
+
];
|
|
81
|
+
function fleetRows(tick, options = {}) {
|
|
82
|
+
const animate = options.animate ?? true;
|
|
83
|
+
const t2 = animate ? tick : 0;
|
|
84
|
+
const blade = ROTORS[Math.floor(t2 / 4) % ROTORS.length];
|
|
85
|
+
const pulse = Math.sin(t2 * 0.07);
|
|
86
|
+
const eye = pulse > 0.45 ? "@" : pulse > -0.1 ? "o" : ".";
|
|
87
|
+
const grid = Array.from({ length: FLEET_GRID_HEIGHT }, () => Array.from({ length: FLEET_GRID_WIDTH }, () => " "));
|
|
88
|
+
for (const drone of FLEET) {
|
|
89
|
+
const yOffset = drone.y + Math.round(drone.amp * Math.sin(t2 * drone.speed + drone.phase));
|
|
90
|
+
const xOffset = drone.x + Math.round(drone.dx * Math.sin(t2 * drone.driftSpeed + drone.phase));
|
|
91
|
+
for (let row = 0;row < drone.art.length; row += 1) {
|
|
92
|
+
const source = drone.art[row];
|
|
93
|
+
const targetY = yOffset + row;
|
|
94
|
+
if (targetY < 0 || targetY >= FLEET_GRID_HEIGHT)
|
|
95
|
+
continue;
|
|
96
|
+
for (let col = 0;col < source.length; col += 1) {
|
|
97
|
+
let char = source[col];
|
|
98
|
+
if (char === " ")
|
|
99
|
+
continue;
|
|
100
|
+
const targetX = xOffset + col;
|
|
101
|
+
if (targetX < 0 || targetX >= FLEET_GRID_WIDTH)
|
|
102
|
+
continue;
|
|
103
|
+
if (source.slice(col, col + 3) === "!!!") {
|
|
104
|
+
for (let rotorIndex = 0;rotorIndex < 3; rotorIndex += 1) {
|
|
105
|
+
if (targetX + rotorIndex < FLEET_GRID_WIDTH)
|
|
106
|
+
grid[targetY][targetX + rotorIndex] = blade[rotorIndex];
|
|
107
|
+
}
|
|
108
|
+
col += 2;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (char === "?")
|
|
112
|
+
char = eye;
|
|
113
|
+
grid[targetY][targetX] = char;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return grid.map((row) => row.join("").replace(/\s+$/, ""));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// packages/cli/src/app-opentui/render/panel-layout.ts
|
|
121
|
+
function panelCellRect(layout, panel) {
|
|
122
|
+
const left = Math.max(0, Math.min(layout.width - 1, layout.centerLeft + (panel.left ?? 0)));
|
|
123
|
+
const desiredWidth = panel.width ?? layout.centerWidth;
|
|
124
|
+
const width = Math.max(1, Math.min(layout.width - left, desiredWidth));
|
|
125
|
+
const top = Math.max(0, Math.min(layout.height - 1, layout.centerTop + panel.top));
|
|
126
|
+
const height = Math.max(1, Math.min(layout.height - top, panel.height));
|
|
127
|
+
if (width <= 3 || height <= 3)
|
|
128
|
+
return null;
|
|
129
|
+
const right = left + width - 1;
|
|
130
|
+
const bottom = top + height - 1;
|
|
131
|
+
const headerHeight = panel.chrome === "ad-terminal" ? Math.max(3, Math.min(height - 2, panel.headerHeight ?? 3)) : 0;
|
|
132
|
+
const dividerY = headerHeight ? Math.min(bottom - 1, top + headerHeight) : top;
|
|
133
|
+
return { left, top, width, height, right, bottom, headerHeight, dividerY };
|
|
134
|
+
}
|
|
135
|
+
|
|
43
136
|
// packages/cli/src/app-opentui/render/graphics.ts
|
|
44
137
|
var TRANSPARENT = RGBA.fromValues(0, 0, 0, 0);
|
|
45
138
|
var BACKDROP = RGBA.fromHex(RIG_UI.bg);
|
|
@@ -461,14 +554,6 @@ function resizeGraphicsLayer(layer, layout) {
|
|
|
461
554
|
function clearGraphicsLayer(layer) {
|
|
462
555
|
layer.frameBuffer.clear(BACKDROP);
|
|
463
556
|
}
|
|
464
|
-
function panelRect(layout, panel) {
|
|
465
|
-
const left = Math.max(0, Math.min(layout.width - 1, layout.centerLeft + (panel.left ?? 0)));
|
|
466
|
-
const desiredWidth = panel.width ?? layout.centerWidth;
|
|
467
|
-
const width = Math.max(1, Math.min(layout.width - left, desiredWidth));
|
|
468
|
-
const top = Math.max(0, Math.min(layout.height - 1, layout.centerTop + panel.top));
|
|
469
|
-
const height = Math.max(1, Math.min(layout.height - top, panel.height));
|
|
470
|
-
return width > 3 && height > 3 ? { left, top, width, height } : null;
|
|
471
|
-
}
|
|
472
557
|
function writeCell(layer, x, y, char, fg, bg) {
|
|
473
558
|
layer.frameBuffer.setCellWithAlphaBlending(x, y, char, fg, bg);
|
|
474
559
|
}
|
|
@@ -491,14 +576,10 @@ function drawRoundedFill(layer, left, top, right, bottom, dividerY) {
|
|
|
491
576
|
drawCornerCut(layer, right, bottom, "\u2598", PANEL_BG);
|
|
492
577
|
}
|
|
493
578
|
function drawAdTerminalPanel(layer, layout, panel) {
|
|
494
|
-
const rect =
|
|
579
|
+
const rect = panelCellRect(layout, panel);
|
|
495
580
|
if (!rect)
|
|
496
581
|
return;
|
|
497
|
-
const { left, top, width,
|
|
498
|
-
const right = left + width - 1;
|
|
499
|
-
const bottom = top + height - 1;
|
|
500
|
-
const headerHeight = Math.max(3, Math.min(height - 2, panel.headerHeight ?? 3));
|
|
501
|
-
const dividerY = Math.min(bottom - 1, top + headerHeight);
|
|
582
|
+
const { left, top, width, right, bottom, headerHeight, dividerY } = rect;
|
|
502
583
|
drawRoundedFill(layer, left, top, right, bottom, dividerY);
|
|
503
584
|
if (dividerY > top && dividerY < bottom) {
|
|
504
585
|
for (let x = left + 2;x < right - 1; x += 1) {
|
|
@@ -517,8 +598,42 @@ function drawPanelChrome(layer, layout, panels) {
|
|
|
517
598
|
drawAdTerminalPanel(layer, layout, panel);
|
|
518
599
|
}
|
|
519
600
|
}
|
|
520
|
-
function
|
|
521
|
-
|
|
601
|
+
function staticFleetTick(scene) {
|
|
602
|
+
let hash = 0;
|
|
603
|
+
for (let index = 0;index < scene.length; index += 1)
|
|
604
|
+
hash = hash * 33 + scene.charCodeAt(index) >>> 0;
|
|
605
|
+
return 11 + hash % 97;
|
|
606
|
+
}
|
|
607
|
+
function asciiFleetColor(char, row) {
|
|
608
|
+
if (char === "@" || char === "$" || char === "o")
|
|
609
|
+
return RGBA.fromHex(RIG_UI.lime);
|
|
610
|
+
if (char === "%" || char === "!" || char === "/" || char === "\\" || char === "|")
|
|
611
|
+
return RGBA.fromHex(RIG_UI.cyan);
|
|
612
|
+
if (char === "." || char === "'" || char === "_" || row < 3 || row > FLEET_GRID_HEIGHT - 4)
|
|
613
|
+
return RGBA.fromInts(108, 110, 121, 170);
|
|
614
|
+
return RGBA.fromHex(RIG_UI.limeDim);
|
|
615
|
+
}
|
|
616
|
+
function drawAmbientField(layer, layout, _tick, scene = "fleet") {
|
|
617
|
+
const fb = layer.frameBuffer;
|
|
618
|
+
fb.clear(BACKDROP);
|
|
619
|
+
const rows = fleetRows(staticFleetTick(scene), { animate: true });
|
|
620
|
+
const left = Math.floor((layout.width - FLEET_GRID_WIDTH) / 2);
|
|
621
|
+
const top = Math.floor((layout.height - FLEET_GRID_HEIGHT) / 2);
|
|
622
|
+
for (let row = 0;row < rows.length; row += 1) {
|
|
623
|
+
const y = top + row;
|
|
624
|
+
if (y < 0 || y >= layout.height)
|
|
625
|
+
continue;
|
|
626
|
+
const line = rows[row];
|
|
627
|
+
for (let col = 0;col < line.length; col += 1) {
|
|
628
|
+
const x = left + col;
|
|
629
|
+
if (x < 0 || x >= layout.width)
|
|
630
|
+
continue;
|
|
631
|
+
const char = line[col];
|
|
632
|
+
if (char === " ")
|
|
633
|
+
continue;
|
|
634
|
+
fb.setCellWithAlphaBlending(x, y, char, asciiFleetColor(char, row), TRANSPARENT);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
522
637
|
}
|
|
523
638
|
function drawSparkline(layer, x, y, values, color = RGBA.fromHex(RIG_UI.cyan)) {
|
|
524
639
|
const chars = ["\u2581", "\u2582", "\u2583", "\u2584", "\u2585", "\u2586", "\u2587", "\u2588"];
|