-
Notifications
You must be signed in to change notification settings - Fork 0
feat(core-editor): implement events #369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2b813f6
feat(core-editor): stop game event, hot reload only needed component …
Tchips46 74dd33c
feat(core-editor): stop game event, hot reload only needed component …
Tchips46 8e70920
feat(core-editor): stop game event, hot reload only needed component …
Tchips46 8a382aa
feat(core-editor): stop game event, hot reload only needed component …
Tchips46 a52a043
feat(core-editor): all events
Tchips46 b50dad0
fix: merge
Tchips46 c62a97b
fix: merge
Tchips46 72fd65e
feat: new save for hard reload
Tchips46 d543814
feat(core-editor): hot reload save param
Tchips46 aae3d1f
feat(core-editor): hot reload save param
Tchips46 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/core-editor/src/common/context/events/core-events.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { type Save } from "../save.type"; | ||
|
|
||
| /** | ||
| * Events that the NanoForge editor can emit to the running engine. | ||
| */ | ||
| export enum CoreEvents { | ||
| /** Reload only changed entity components params (live-patch) */ | ||
| HOT_RELOAD = "hot-reload", | ||
| /** Reload all entities component params */ | ||
| HARD_RELOAD = "hard-reload", | ||
| /** Don't execute the run function until UNPAUSE_GAME */ | ||
| PAUSE_GAME = "pause-game", | ||
| /** End main loop and clear */ | ||
| STOP_GAME = "stop-game", | ||
| /** resume executing the run function */ | ||
| UNPAUSE_GAME = "unpause-game", | ||
| } | ||
|
|
||
| export interface CoreEventsMap { | ||
| [CoreEvents.HOT_RELOAD]: [save: Save]; | ||
| [CoreEvents.HARD_RELOAD]: [save: Save]; | ||
| [CoreEvents.PAUSE_GAME]: []; | ||
| [CoreEvents.STOP_GAME]: []; | ||
| [CoreEvents.UNPAUSE_GAME]: []; | ||
| } |
9 changes: 9 additions & 0 deletions
9
packages/core-editor/src/common/context/events/editor-events.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // ! Please do not remove this event unless a new one replaces it, it causes types issues | ||
|
|
||
| export enum EditorEvents { | ||
| EMPTY = "empty", | ||
| } | ||
|
|
||
| export interface EditorEventsMap { | ||
| [EditorEvents.EMPTY]: []; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.