-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
More freedom in Loop state, add Loop:setWorlds()
#118
Merged
Merged
Conversation
This file contains 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
Loop:setWorlds()
Ukendio
previously approved these changes
Sep 16, 2024
Ukendio
approved these changes
Sep 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Right now, there's a few issues with how the
Loop
andDebugger
handleWorld
s.Loop
naively looks at its state to determine which values areWorlds
, so it can buffer commands from systems.Debugger
naively looks at theLoop
's state to determine which values areWorlds
, so it can render the appropriate widget. Additionally, it only supports oneWorld
which is stored indebugWorld
for use cases like hover inspect and entity inspect.In my game, I'd like to have a single loop parameter which is a class that contains both the world and other states. This is impossible due to the problems mentioned above, and it would break both the debugger, and Loop command buffering.
I propose an API
Loop:setWorlds(worlds: {World} | {[string]: World})
. This would be a breaking change-users would need to call this before callingLoop:begin(...)
, though it is a very easy change for users.worlds
can be either an array of Worlds, or a dictionary (if they want to call the Worlds something else in the debugger). This allows both the Debugger and the Loop to know exactly what Worlds it can use without further introspection.