Add majority lock and unlock voting for T5 and T6

This commit is contained in:
2026-10-18 16:01:57 -04:00
parent caaaa102a4
commit 9ef5932d36
10 changed files with 816 additions and 78 deletions
+15 -1
View File
@@ -162,7 +162,7 @@ function assertTextOnly(e) {
'service elements are private, non-archived text with no background shaders');
}
for (const game of ['t5', 't6']) {
check(`${game} installed HUD joins all nine commands in one view`, () => {
check(`${game} core and bank commands fit in one view without extra modules`, () => {
const e = engine(game, 8, true);
e.help();
assert.deepEqual(e.helpCommands,
@@ -180,6 +180,20 @@ for (const game of ['t5', 't6']) {
withoutHud.help();
assert(!withoutHud.state.commands.some(entry => entry.command === '.hud'));
});
check(`${game} lock module registrations appear on the second help page`, () => {
const e = engine(game, 8, true);
const source = readFileSync(new URL(`${game}/scripts/tws_${game}_lock.gsc`, root), 'utf8');
for (const [, command, description] of source.matchAll(/register_help_command\("([^"]+)", "([^"]+)"\)/g))
e.c.register_help_command(command, description);
e.help();
assert.equal(e.state.help.pages, 2);
e.advance(12000);
assert.deepEqual(e.helpCommands, ['.lock', '.unlock']);
assert.deepEqual(e.helpDescriptions, ['Vote to lock (6+)', 'Vote to unlock']);
e.advance(12000);
assert.equal(e.state.help, undefined);
assert.equal(e.live.length, 0);
});
check(`${game} core toggle preserves desired opacity and leaves services and other players alone`, () => {
const e = engine(game);
const track = e.c.make_core_overlay_shader(e.self, 242, 466, 156, 4, [0, 0, 0], 0.8, 10);