Skip to content

Commit

Permalink
fix: loosen Engine.start('scene', {loader}) signature
Browse files Browse the repository at this point in the history
  • Loading branch information
eonarheim committed Jul 22, 2024
1 parent 1a13e28 commit 70a6be3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ are doing mtv adjustments during precollision.

### Fixed

- Fixed issue where you were required to provide a transition if you provided a loader in the `ex.Engine.start('scene', { loader })`
- Fixed issue where `ex.Scene.onPreLoad(loader: ex.DefaultLoader)` would lock up the engine if there was an empty loader
- Fixed issue where `ex.Scene` scoped input events would preserve state and get stuck causing issues when switching back to the original scene.
- Fixed issue where not all physical keys from the spec were present in `ex.Keys` including the reported `ex.Keys.Tab`
Expand Down
6 changes: 3 additions & 3 deletions src/engine/Director/Director.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ export type SceneMap<TKnownScenes extends string = any> = Record<TKnownScenes, S

export interface StartOptions {
/**
* First transition from the game start screen
* Optionally provide first transition from the game start screen
*/
inTransition: Transition;
inTransition?: Transition;
/**
* Optionally provide a main loader to run before the game starts
*/
Expand Down Expand Up @@ -215,7 +215,7 @@ export class Director<TKnownScenes extends string = any> {

let maybeStartTransition: Transition;

if (options) {
if (options?.inTransition) {
const { inTransition } = options;
maybeStartTransition = inTransition;
}
Expand Down

0 comments on commit 70a6be3

Please sign in to comment.