Skip to content

Commit

Permalink
chore: rename event to sceneEnter
Browse files Browse the repository at this point in the history
  • Loading branch information
lajbel committed Oct 6, 2024
1 parent a327c84 commit f451c99
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/game/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const initGame = () => {
frameEnd: [];
resize: [];
sceneLeave: [string];
sceneEnter: [string];
}>(),

// object events
Expand Down
2 changes: 1 addition & 1 deletion src/game/make.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ export function make<T>(comps: CompList<T> = []): GameObj<T> {
inputEvents.push(ev);

obj.onDestroy(() => ev.cancel());
obj.on("sceneLeave", () => {
obj.on("sceneEnter", () => {
ev.cancel();
inputEvents.splice(inputEvents.indexOf(ev), 1);
app[e]?.(...args);
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function go(name: SceneName, ...args: unknown[]) {
game.root.remove(obj);
}
else {
obj.trigger("sceneLeave", name);
obj.trigger("sceneEnter", name);
}
});

Expand Down

0 comments on commit f451c99

Please sign in to comment.