@antha/input 0.1.2 → 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.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "An Antha mod for handling inputs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vir",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"test:docs": "virmator docs check"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@antha/gamepad-type": "^0.
|
|
37
|
-
"@augment-vir/assert": "^32.2.
|
|
38
|
-
"@augment-vir/common": "^32.2.
|
|
39
|
-
"date-vir": "^9.1.
|
|
40
|
-
"device-navigation": "^4.
|
|
36
|
+
"@antha/gamepad-type": "^0.2.0",
|
|
37
|
+
"@augment-vir/assert": "^32.2.3",
|
|
38
|
+
"@augment-vir/common": "^32.2.3",
|
|
39
|
+
"date-vir": "^9.1.1",
|
|
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.
|
|
43
|
+
"vira": "^31.31.4"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@augment-vir/test": "^32.2.
|
|
46
|
+
"@augment-vir/test": "^32.2.3",
|
|
47
47
|
"@web/dev-server-esbuild": "^2.0.0",
|
|
48
48
|
"@web/test-runner": "^1.0.0",
|
|
49
49
|
"@web/test-runner-playwright": "^1.0.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"istanbul-smart-text-reporter": "^1.1.5"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@antha/engine": "^0.
|
|
54
|
+
"@antha/engine": "^0.2.0",
|
|
55
55
|
"element-vir": ">=26"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|