@benev/nubs
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "@benev/nubs", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "user-input system for web games", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -12,4 +12,4 @@ | ||
stick: { | ||
move: {causes: ["Stick", "Stickpad"]}, | ||
look: {causes: ["Stick2", "Stickpad2"]}, | ||
move: {causes: ["Stick"]}, | ||
look: {causes: ["Stick2"]}, | ||
}, | ||
@@ -16,0 +16,0 @@ key: { |
@@ -8,8 +8,4 @@ | ||
export type EffectLookups = { | ||
[P in NubDetail.Kind]: (effect: string) => NubDetail.Effect<NubDetail.Any> | ||
} | ||
export type EffectReports<D extends NubDetail.Any = NubDetail.Any> = { | ||
[effect: string]: NubDetail.Effect<D> | ||
} |
@@ -13,4 +13,4 @@ | ||
import {setup_effects_and_lookups} from "./setups/setup_effects_and_lookups.js" | ||
import {setup_modes_and_handle_changes} from "./setups/setup_modes_and_handle_changes.js" | ||
import {setup_effects_and_readable_proxy} from "./setups/setup_effects_and_readable_proxy.js" | ||
import {setup_cause_and_effect_translation} from "./setups/setup_cause_and_effect_translation.js" | ||
@@ -30,3 +30,3 @@ | ||
get effects() { | ||
return this.#effects.lookups | ||
return this.#effects.readable | ||
} | ||
@@ -61,3 +61,3 @@ | ||
#effects = setup_effects_and_lookups() | ||
#effects = setup_effects_and_readable_proxy() | ||
@@ -64,0 +64,0 @@ #translate = setup_cause_and_effect_translation({ |
@@ -10,4 +10,4 @@ | ||
return radius !== undefined | ||
? [(x * radius), (y * radius)] | ||
? [(x * radius), -(y * radius)] | ||
: [0, 0] | ||
} |
@@ -21,3 +21,3 @@ | ||
const [x, y] = new_vector | ||
return [(x / radius), (y / radius)] | ||
return [(x / radius), -(y / radius)] | ||
} |
@@ -8,4 +8,4 @@ export const default_mode = "humanoid"; | ||
stick: { | ||
move: { causes: ["Stick", "Stickpad"] }, | ||
look: { causes: ["Stick2", "Stickpad2"] }, | ||
move: { causes: ["Stick"] }, | ||
look: { causes: ["Stick2"] }, | ||
}, | ||
@@ -12,0 +12,0 @@ key: { |
@@ -5,7 +5,4 @@ import { NubDetail } from "../../../../events/types/detail.js"; | ||
}; | ||
export type EffectLookups = { | ||
[P in NubDetail.Kind]: (effect: string) => NubDetail.Effect<NubDetail.Any>; | ||
}; | ||
export type EffectReports<D extends NubDetail.Any = NubDetail.Any> = { | ||
[effect: string]: NubDetail.Effect<D>; | ||
}; |
@@ -8,7 +8,7 @@ import { LitElement } from "lit"; | ||
modes: string; | ||
get effects(): Readonly<{ | ||
key: (effect: string) => import("../../index.js").NubDetail.Effect<import("../../index.js").NubDetail.Key>; | ||
pointer: (effect: string) => import("../../index.js").NubDetail.Effect<import("../../index.js").NubDetail.Pointer>; | ||
stick: (effect: string) => import("../../index.js").NubDetail.Effect<import("../../index.js").NubDetail.Stick>; | ||
}>; | ||
get effects(): { | ||
key: import("./bindings/types/effects.js").EffectReports<import("../../index.js").NubDetail.Key>; | ||
pointer: import("./bindings/types/effects.js").EffectReports<import("../../index.js").NubDetail.Pointer>; | ||
stick: import("./bindings/types/effects.js").EffectReports<import("../../index.js").NubDetail.Stick>; | ||
}; | ||
get bindings(): Bindings; | ||
@@ -15,0 +15,0 @@ set bindings(b: Bindings); |
@@ -20,4 +20,4 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
import { NubBindingsEvent } from "../../events/bindings.js"; | ||
import { setup_effects_and_lookups } from "./setups/setup_effects_and_lookups.js"; | ||
import { setup_modes_and_handle_changes } from "./setups/setup_modes_and_handle_changes.js"; | ||
import { setup_effects_and_readable_proxy } from "./setups/setup_effects_and_readable_proxy.js"; | ||
import { setup_cause_and_effect_translation } from "./setups/setup_cause_and_effect_translation.js"; | ||
@@ -42,3 +42,3 @@ export class NubContext extends LitElement { | ||
})); | ||
_NubContext_effects.set(this, setup_effects_and_lookups()); | ||
_NubContext_effects.set(this, setup_effects_and_readable_proxy()); | ||
_NubContext_translate.set(this, setup_cause_and_effect_translation({ | ||
@@ -54,3 +54,3 @@ modes: this.modes_set.readable, | ||
get effects() { | ||
return __classPrivateFieldGet(this, _NubContext_effects, "f").lookups; | ||
return __classPrivateFieldGet(this, _NubContext_effects, "f").readable; | ||
} | ||
@@ -57,0 +57,0 @@ get bindings() { |
export function stick_vector_to_pixels(radius, [x, y]) { | ||
return radius !== undefined | ||
? [(x * radius), (y * radius)] | ||
? [(x * radius), -(y * radius)] | ||
: [0, 0]; | ||
} | ||
//# sourceMappingURL=stick_vector_to_pixels.js.map |
@@ -10,4 +10,4 @@ import { within_radius } from "./within_radius.js"; | ||
const [x, y] = new_vector; | ||
return [(x / radius), (y / radius)]; | ||
return [(x / radius), -(y / radius)]; | ||
} | ||
//# sourceMappingURL=calculate_new_vector_from_pointer_position.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6352
317226