Add hold and special inputs to combos
All checks were successful
Deploy Sokko G / deploy (push) Successful in 6s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 6s
This commit is contained in:
parent
9b72f4934c
commit
1a35dcae7b
15 changed files with 575 additions and 26 deletions
|
|
@ -189,6 +189,8 @@ export function validateSiteContent(site) {
|
|||
"toolboxes.modules.combos.simultaneousModeTitle",
|
||||
"toolboxes.modules.combos.successiveModeLabel",
|
||||
"toolboxes.modules.combos.simultaneousModeLabel",
|
||||
"toolboxes.modules.combos.holdLabel",
|
||||
"toolboxes.modules.combos.holdToggleLabel",
|
||||
"toolboxes.modules.combos.removeStepTitle",
|
||||
"toolboxes.modules.combos.removeLastInputTitle",
|
||||
"toolboxes.modules.combos.addComboButton",
|
||||
|
|
|
|||
|
|
@ -75,6 +75,14 @@ test("style entrypoint and theme layers are wired", async () => {
|
|||
assert.match(styleIcons, /ui-icon-remove-column/);
|
||||
assert.match(styleIcons, /ui-icon-table/);
|
||||
assert.match(styleIcons, /ui-icon-map/);
|
||||
assert.match(styleIcons, /ui-icon-grab/);
|
||||
assert.match(styleIcons, /ui-icon-shield/);
|
||||
assert.match(styleIcons, /ui-icon-gun/);
|
||||
assert.match(styleToolboxes, /\.combo-hold-controls/);
|
||||
assert.match(styleToolboxes, /\.combo-input-direction/);
|
||||
assert.match(styleToolboxes, /\.combo-device-n64\.combo-value-stick-up/);
|
||||
assert.match(styleToolboxes, /\.combo-device-n64\.combo-value-up/);
|
||||
assert.match(styleToolboxes, /\.combo-value-grab \.ui-icon/);
|
||||
assert.match(styleGames, /\.game-home-card/);
|
||||
assert.match(styleGames, /\.game-layout/);
|
||||
assert.match(styleGames, /\.game-grid/);
|
||||
|
|
|
|||
|
|
@ -159,6 +159,13 @@ test("toolbox module registry and modules expose expected behavior", async () =>
|
|||
assert.match(combosModule, /ComboSequence/);
|
||||
assert.match(combosModule, /keyboardLayout/);
|
||||
assert.match(combosModule, /simultaneousMode/);
|
||||
assert.match(combosModule, /SPECIAL_INPUT_GROUP/);
|
||||
assert.match(combosModule, /grab/);
|
||||
assert.match(combosModule, /protect/);
|
||||
assert.match(combosModule, /shoot/);
|
||||
assert.match(combosModule, /holdMs/);
|
||||
assert.match(combosModule, /toggleSelectedInputHold/);
|
||||
assert.match(combosModule, /combo-hold-field/);
|
||||
assert.match(combosModule, /useInlineEdit/);
|
||||
assert.match(combosModule, /useGroupedReorder/);
|
||||
assert.match(combosModule, /reorderFeatures/);
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ test("combos storage normalizes devices, steps and compact export ids", () => {
|
|||
id: "rootCombo",
|
||||
name: "Root",
|
||||
device: "switch",
|
||||
inputs: [[{ kind: "button", value: "triangle" }]]
|
||||
inputs: [[{ kind: "button", value: "triangle", hold: true }]]
|
||||
},
|
||||
{
|
||||
id: "combo1",
|
||||
|
|
@ -267,7 +267,8 @@ test("combos storage normalizes devices, steps and compact export ids", () => {
|
|||
inputs: [
|
||||
[
|
||||
{ kind: "direction", value: "down" },
|
||||
{ kind: "button", value: "cross" },
|
||||
{ kind: "button", value: "cross", hold: false, holdMs: 2000.4 },
|
||||
{ kind: "button", value: "circle", holdMs: 100 },
|
||||
{ kind: "bad", value: "ignored" }
|
||||
],
|
||||
[],
|
||||
|
|
@ -281,6 +282,7 @@ test("combos storage normalizes devices, steps and compact export ids", () => {
|
|||
assert.equal(normalized.device, "playstation");
|
||||
assert.equal(normalized.combos.length, 2);
|
||||
assert.equal(normalized.combos[0].device, "switch");
|
||||
assert.equal(normalized.combos[0].inputs[0][0].hold, true);
|
||||
assert.equal(normalized.combos[1].category.length, 80);
|
||||
assert.equal(normalized.combos[1].name.length, 80);
|
||||
assert.equal("note" in normalized.combos[1], false);
|
||||
|
|
@ -289,7 +291,8 @@ test("combos storage normalizes devices, steps and compact export ids", () => {
|
|||
assert.deepEqual(normalized.combos[1].inputs, [
|
||||
[
|
||||
{ kind: "direction", value: "down" },
|
||||
{ kind: "button", value: "cross" }
|
||||
{ kind: "button", value: "cross", hold: true, holdMs: 2000 },
|
||||
{ kind: "button", value: "circle" }
|
||||
],
|
||||
[{ kind: "key", value: "space" }]
|
||||
]);
|
||||
|
|
@ -300,9 +303,12 @@ test("combos storage normalizes devices, steps and compact export ids", () => {
|
|||
assert.deepEqual(compact.collapsedCategories, [longText.slice(0, 80)]);
|
||||
assert.equal(compact.combos[0].id, "rootCombo");
|
||||
assert.equal(compact.combos[0].device, "switch");
|
||||
assert.equal(compact.combos[0].inputs[0][0].hold, true);
|
||||
assert.equal(compact.combos[1].device, "n64");
|
||||
assert.equal(compact.combos[1].id, "combo1");
|
||||
assert.equal(compact.combos[1].category.length, 80);
|
||||
assert.equal(compact.combos[1].inputs[0][1].holdMs, 2000);
|
||||
assert.equal(compact.combos[1].inputs[0][1].hold, true);
|
||||
|
||||
const exported = createToolboxExportPayload(
|
||||
{ id: "toolbox1", name: "Combos", modules: [{ id: "module1", type: "combos" }], updatedAt: "2026-01-01T00:00:00.000Z" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue