Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace play mode with isEditing state #9071

Merged
merged 3 commits into from Oct 23, 2023
Merged

Conversation

HexaField
Copy link
Member

@HexaField HexaField commented Oct 17, 2023

Summary

馃 Generated by Copilot at fdce981

Refactored the editor and engine state to use a new isEditing property to track the play mode status. Added a feature to save and restore the scene state using the history state when switching between play and edit modes. Removed or deprecated unused or redundant properties from the state schemas.

References

closes #insert number here

Explanation

馃 Generated by Copilot at fdce981

  • Refactored the play mode state from the helper state to the engine state (link, link, link, link, link, link, link, link, link)
  • Added a feature to preserve the scene changes made in the edit mode when switching to the play mode and back (link)
  • Added a feature to prevent adding history actions when in play mode (link)

馃 Generated by Copilot at fdce981

We are the masters of the engine state
We switch between play and edit modes
We save and restore the scene with grace
We track the history of our codes

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

Checklist

  • If this PR is still a WIP, convert to a draft
  • When this PR is ready, mark it as "Ready for review"
  • ensure all checks pass
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewers

@HexaField HexaField marked this pull request as ready for review October 20, 2023 06:06
@anselm
Copy link
Collaborator

anselm commented Oct 20, 2023

I did test this branch and I do still see the same reset issue... basically it's just that if I do the following I get unexpected behavior:

  1. Make something in studio (in my case I tend to make a gltf duck)
  2. Drag it / translate it using the widget in any direction
  3. Hit play
  4. Hit pause

The artifact moves when I hit pause.

@HexaField
Copy link
Member Author

I did test this branch and I do still see the same reset issue... basically it's just that if I do the following I get unexpected behavior:

  1. Make something in studio (in my case I tend to make a gltf duck)
  2. Drag it / translate it using the widget in any direction
  3. Hit play
  4. Hit pause

The artifact moves when I hit pause.

That's a different issue with the gizmo not creating snapshots

Copy link
Member

@SYBIOTE SYBIOTE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great we can now make editor specific features, directly in the engine package, a welcome change as the engine doesn't reference the editor,
we should look over the code base where we use .isinPlaymode, in the components
and migrate those as well to avoid errors

@anselm
Copy link
Collaborator

anselm commented Oct 23, 2023

I did test this branch and I do still see the same reset issue... basically it's just that if I do the following I get unexpected behavior:

  1. Make something in studio (in my case I tend to make a gltf duck)
  2. Drag it / translate it using the widget in any direction
  3. Hit play
  4. Hit pause

The artifact moves when I hit pause.

That's a different issue with the gizmo not creating snapshots

Ok, but this is why I didn't push a similar change earlier. I'm happy however with decoupling these issues. I think we should get this in and I tested it and it works fine otherwise.

@speigg speigg added this pull request to the merge queue Oct 23, 2023
Merged via the queue into dev with commit 9361150 Oct 23, 2023
12 of 13 checks passed
@speigg speigg deleted the replace-play-mode-isEditing-state branch October 23, 2023 19:02
@anselm
Copy link
Collaborator

anselm commented Oct 23, 2023

Oh there's a small bug in the test suites in general - with .scss being passed to a javascript compiler - so everything is failing tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants