@adatechnology/game-weapons-three 0.27.5 → 0.27.6
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/{chunk-6L7CAZIF.js → chunk-GXZM4CE6.js} +5 -4
- package/dist/chunk-GXZM4CE6.js.map +1 -0
- package/dist/index.global.js +19 -18
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/testing.js +1 -1
- package/package.json +7 -7
- package/dist/chunk-6L7CAZIF.js.map +0 -1
|
@@ -96,6 +96,8 @@ function createAccessoryBench(options) {
|
|
|
96
96
|
if (result?.reason === "busy") return;
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
+
const hasKind = (kind) => (host.tool().attachments ?? []).some((candidate) => arsenal.attachments.get(candidate.id)?.kind === kind);
|
|
100
|
+
const hasLauncher = () => (host.tool().attachments ?? []).some((part) => arsenal.attachments.get(part.id)?.launcher !== void 0);
|
|
99
101
|
const toggleKind = (kind) => {
|
|
100
102
|
const part = (host.tool().attachments ?? []).find((candidate) => arsenal.attachments.get(candidate.id)?.kind === kind);
|
|
101
103
|
if (!part) host.log(kind === "light" ? text.noLight : text.noLaser);
|
|
@@ -110,8 +112,7 @@ function createAccessoryBench(options) {
|
|
|
110
112
|
};
|
|
111
113
|
const switchUnderbarrel = () => {
|
|
112
114
|
const tool = host.tool();
|
|
113
|
-
|
|
114
|
-
if (!hasLauncher) host.log(text.noLauncher);
|
|
115
|
+
if (!hasLauncher()) host.log(text.noLauncher);
|
|
115
116
|
else host.command?.({ type: "underbarrel", on: tool.underbarrelActive !== true });
|
|
116
117
|
};
|
|
117
118
|
const act = (id) => {
|
|
@@ -148,7 +149,7 @@ function createAccessoryBench(options) {
|
|
|
148
149
|
const onKeyDown = (event) => {
|
|
149
150
|
if (host.playerHeld?.()) return;
|
|
150
151
|
if (event.repeat || event.ctrlKey || event.metaKey || event.altKey || TEXT_FIELDS.has(event.target?.tagName ?? "")) return;
|
|
151
|
-
const handled2 = event.code === ACCESSORY_KEYS.light ? act(ACTION_IDS.light) : event.code === ACCESSORY_KEYS.laser ? act(ACTION_IDS.laser) : event.code === ACCESSORY_KEYS.underbarrel ? act(ACTION_IDS.underbarrel) : event.code === ACCESSORY_KEYS.stock && toggleStock();
|
|
152
|
+
const handled2 = event.code === ACCESSORY_KEYS.light ? hasKind("light") && act(ACTION_IDS.light) : event.code === ACCESSORY_KEYS.laser ? hasKind("laser") && act(ACTION_IDS.laser) : event.code === ACCESSORY_KEYS.underbarrel ? hasLauncher() && act(ACTION_IDS.underbarrel) : event.code === ACCESSORY_KEYS.stock && toggleStock();
|
|
152
153
|
if (!handled2) return;
|
|
153
154
|
event.preventDefault();
|
|
154
155
|
event.stopImmediatePropagation();
|
|
@@ -16059,4 +16060,4 @@ export {
|
|
|
16059
16060
|
DEFAULT_EXPLOSIVES_SCENE,
|
|
16060
16061
|
createExplosivesTestModule
|
|
16061
16062
|
};
|
|
16062
|
-
//# sourceMappingURL=chunk-
|
|
16063
|
+
//# sourceMappingURL=chunk-GXZM4CE6.js.map
|