Skip to content

Commit 8575da0

Browse files
committed
fix: exports
1 parent 5295e5a commit 8575da0

4 files changed

Lines changed: 11 additions & 26 deletions

File tree

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@
4545
"@rbxts/flamework-binary-serializer": "^0.6.0",
4646
"@rbxts/flamework-meta-utils": "^1.0.1",
4747
"@rbxts/gamejoy": "^1.1.4",
48+
"@rbxts/id": "^1.0.0",
4849
"@rbxts/instance-utility": "^1.0.1",
4950
"@rbxts/iris": "^2.2.0-ts.0",
5051
"@rbxts/janitor": "^1.15.7-ts.0",
5152
"@rbxts/lazy": "^1.0.1",
5253
"@rbxts/lazy-iterator": "^1.0.1",
54+
"@rbxts/mechanism": "^1.0.0",
5355
"@rbxts/object-utils": "^1.0.4",
5456
"@rbxts/quaternion": "^1.0.0",
5557
"@rbxts/runit": "^1.1.1",
@@ -61,4 +63,4 @@
6163
"@rbxts/wave": "^1.0.0",
6264
"node": "^18.20.1"
6365
}
64-
}
66+
}

src/client/classes/procedural-animation-host.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ export class ProceduralAnimationHost<I extends Camera | Model = Camera | Model>
4242
require(animationModule);
4343

4444
for (const [ProceduralAnimation, args] of Object.values(animationClassMap))
45-
processDependency(ProceduralAnimation, animation => {
46-
this.animations.push([animation, args])
47-
});
45+
processDependency(ProceduralAnimation, animation => this.animations.push([animation, args]));
4846
}
4947

5048
public update(dt: number): CFrame {

src/client/controllers/input.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Controller } from "@flamework/core";
33
import type { LogStart } from "shared/hooks";
44
import { OnInput, OnInputRelease } from "client/decorators";
55

6+
67
/** Handles all game input */
78
@Controller()
89
export class InputController implements LogStart {

src/client/decorators.ts

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,21 @@
11
import { Modding } from "@flamework/core";
2-
import { Context } from "@rbxts/gamejoy";
3-
import { Action, Axis, Union } from "@rbxts/gamejoy/out/Actions";
4-
import { BaseAction } from "@rbxts/gamejoy/out/Class/BaseAction";
2+
import { InputManager } from "@rbxts/mechanism";
3+
import { BaseAction } from "@rbxts/mechanism/out/base-action";
54
import { callMethodOnDependency } from "@rbxts/flamework-meta-utils";
6-
import type { ActionLike, ActionOptions, AxisActionEntry, RawActionEntry } from "@rbxts/gamejoy/out/Definitions/Types";
75
import type { ClientReceiver as ClientEventReceiver } from "@flamework/networking/out/events/types";
86
import type { ClientReceiver as ClientFunctionReceiver } from "@flamework/networking/out/functions/types";
97
import type { Serializer } from "@rbxts/flamework-binary-serializer";
108

119
import { FlameworkIgnited } from "shared/constants";
1210
import Log from "shared/log";
1311

14-
const inputContext = new Context({ Process: false });
15-
const processedContext = new Context({ Process: true });
16-
export const inputActions: Record<string, BaseAction> = {};
12+
const inputManager = new InputManager;
1713

18-
export const OnInput = Modding.createDecorator<[binding: (RawActionEntry | BaseAction) | (RawActionEntry | BaseAction)[], actionName?: string, process?: boolean, options?: ActionOptions]>(
14+
export const OnInput = Modding.createDecorator<[binding: BaseAction]>(
1915
"Method",
20-
(descriptor, [rawAction, actionName, process, options]) => {
21-
const action: BaseAction = typeOf(rawAction) === "string" ?
22-
new Action(<RawActionEntry>rawAction, options)
23-
: rawAction instanceof BaseAction ?
24-
rawAction
25-
: new Union(<RawActionEntry[]>rawAction);
26-
27-
if (action instanceof Union && options !== undefined)
28-
Log.warn(`Action options given to @OnInput decorator on "${descriptor.property}" method were ignored because it is a union action`);
29-
30-
if (actionName !== undefined)
31-
inputActions[actionName] = action;
32-
16+
(descriptor, [action]) => {
3317
FlameworkIgnited.Once(() => {
34-
const context = process ? processedContext : inputContext;
18+
inputManager.bind(action)
3519
context.Bind(<ActionLike<RawActionEntry>>action, () => {
3620
const object = <Record<string, Callback>>Modding.resolveSingleton(descriptor.constructor!);
3721
void task.spawn(object[descriptor.property], object, action);

0 commit comments

Comments
 (0)