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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset timestamp after popup transition is done #84

Closed
MinchukSergei opened this issue Feb 4, 2022 · 4 comments
Closed

Reset timestamp after popup transition is done #84

MinchukSergei opened this issue Feb 4, 2022 · 4 comments
Labels
more info More information is needed before any action can be taken

Comments

@MinchukSergei
Copy link

There are no possibility to set timestamp to 0 using monarch because it resets it each time.

  1. Popup transition is started
  2. Timestamp almost instantly reset to 1
  3. Game continued
  4. Popup transition is done

In that case game run 0.5 - 1 sec (depending on popup back transition duration) and I don't know how to avoid this.

@britzl
Copy link
Owner

britzl commented Feb 19, 2022

Thank you for the report. Could you please describe the scenario in more detail?

  • Is both the game and the popup a monarch screen?
  • Is this when the popup is shown or hidden?
  • You want the game to pause while the popup is show? (if yes, have you seen the "timestep below popup" setting?

@britzl britzl added the more info More information is needed before any action can be taken label Feb 19, 2022
@MinchukSergei
Copy link
Author

@britzl, Hi.

Yes, both are monarch screen. Let me describe in details:

A - this is the simple screen
B - is popup

Set in A "timestep below popup" to 0 to make it paused when B is opened.

  1. A - is opened and we are playing the game
  2. B - starts opening. Monarch immediately set timestep to 0 - It's OK
  3. B - animation show in is playing (e.g. 1 sec) - It's OK
  4. B - is opened, show animation is finished - It's OK
  5. We are closing B
  6. B - starts playing the hiding animation (e.g. 1 sec)
  7. Monarch immediately set timestep to 1 (we are not able to avoid this immediate logic) - It's NOT OK
  8. A - is unpaused but B is not completely finished its hiding animation. - It's NOT OK
  9. B - finished animation

So, game is unpaused 1 second earlier than we expect (or maybe only me :) )

I found the workaround:
5. We are closing B
6. We create timer.delay(0, true, msg.post(set_time_stemp 0) - to extend the pause duration
7. When B hide animation is finished we msg.post(set_time_stemp 1) - to unpause the A

@britzl
Copy link
Owner

britzl commented Feb 21, 2022

Thank you. That clarifies the issue. It seems to me that I should change the logic in Monarch to reset the timestep after the animation has finished.

@MinchukSergei
Copy link
Author

Yes, I think it's more natural and intuitive/correct. Thank you!

@britzl britzl closed this as completed in 1dec704 Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info More information is needed before any action can be taken
Projects
None yet
Development

No branches or pull requests

2 participants