@antha/input 0.1.3 → 0.2.0

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.
@@ -64,6 +64,13 @@ export type MenuNavOptions = Readonly<Partial<{
64
64
  * @default true
65
65
  */
66
66
  allowWrapping: boolean;
67
+ /**
68
+ * Prevent a one-dimensional nav tree from using its available axis for perpendicular
69
+ * navigation.
70
+ *
71
+ * @default false
72
+ */
73
+ blockPerpendicularNavigation: boolean;
67
74
  }>>;
68
75
  /**
69
76
  * State for {@link createAnthaMenuNavMod}.
@@ -224,6 +224,7 @@ export const defaultMenuNavOptions = {
224
224
  milliseconds: 60,
225
225
  },
226
226
  allowWrapping: true,
227
+ blockPerpendicularNavigation: false,
227
228
  };
228
229
  /**
229
230
  * A pre-built mod that enables menu navigation. Set `isInMenu` on your game state to true to
@@ -300,6 +301,7 @@ export function createAnthaMenuNavMod(options = {}) {
300
301
  if (sectionDirection) {
301
302
  state.navController.navigatePibling({
302
303
  allowWrapping: state.menuNavOptions.allowWrapping,
304
+ blockPerpendicularNavigation: state.menuNavOptions.blockPerpendicularNavigation,
303
305
  direction: sectionDirection,
304
306
  });
305
307
  return;
@@ -319,12 +321,14 @@ export function createAnthaMenuNavMod(options = {}) {
319
321
  if (vertical) {
320
322
  state.navController.navigate({
321
323
  allowWrapping: state.menuNavOptions.allowWrapping,
324
+ blockPerpendicularNavigation: state.menuNavOptions.blockPerpendicularNavigation,
322
325
  direction: vertical,
323
326
  });
324
327
  }
325
328
  if (horizontal) {
326
329
  state.navController.navigate({
327
330
  allowWrapping: state.menuNavOptions.allowWrapping,
331
+ blockPerpendicularNavigation: state.menuNavOptions.blockPerpendicularNavigation,
328
332
  direction: horizontal,
329
333
  });
330
334
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antha/input",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "description": "An Antha mod for handling inputs.",
5
5
  "keywords": [
6
6
  "vir",
@@ -33,14 +33,14 @@
33
33
  "test:docs": "virmator docs check"
34
34
  },
35
35
  "dependencies": {
36
- "@antha/gamepad-type": "^0.1.3",
36
+ "@antha/gamepad-type": "^0.2.0",
37
37
  "@augment-vir/assert": "^32.2.3",
38
38
  "@augment-vir/common": "^32.2.3",
39
39
  "date-vir": "^9.1.1",
40
- "device-navigation": "^4.7.3",
40
+ "device-navigation": "^4.8.0",
41
41
  "input-device-handler": "^9.0.4",
42
42
  "object-shape-tester": "^6.15.0",
43
- "vira": "^31.31.2"
43
+ "vira": "^31.31.4"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@augment-vir/test": "^32.2.3",
@@ -51,7 +51,7 @@
51
51
  "istanbul-smart-text-reporter": "^1.1.5"
52
52
  },
53
53
  "peerDependencies": {
54
- "@antha/engine": "^0.1.3",
54
+ "@antha/engine": "^0.2.0",
55
55
  "element-vir": ">=26"
56
56
  },
57
57
  "engines": {