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

Different behaviour after monarch update to 3.4.0 #81

Closed
EvoTeamDevelop opened this issue Sep 2, 2021 · 6 comments
Closed

Different behaviour after monarch update to 3.4.0 #81

EvoTeamDevelop opened this issue Sep 2, 2021 · 6 comments
Labels
more info More information is needed before any action can be taken

Comments

@EvoTeamDevelop
Copy link

Previously I showed popup and during popup initialisation I paused the animation of main collection by sending:

msg.post(mainCollectionUrl, "set_time_step", { factor = 0, mode = 1 })

After updating library from 3.3.0 to 3.4.0 I see that pausing does not works.
Tested with only using dependency version change, with 3.3.0 works without issues as expected.

@EvoTeamDevelop
Copy link
Author

EvoTeamDevelop commented Sep 6, 2021

Any guesstimates, when someone can take a look at this? :)

@britzl
Copy link
Owner

britzl commented Sep 19, 2021

After updating library from 3.3.0 to 3.4.0 I see that pausing does not works.
Tested with only using dependency version change, with 3.3.0 works without issues as expected.

When exactly are you calling set_time_step? Are you waiting until the popup is shown (via callback to monarch.show()) or are you calling the function immediately after monarch.show()?

@britzl britzl added the more info More information is needed before any action can be taken label Sep 19, 2021
@EvoTeamDevelop
Copy link
Author

EvoTeamDevelop commented Sep 20, 2021

I call monarch.show without a callback and in popup collection:

  1. In the init method I call - msg.post('.', 'pause')
  2. Then in the on_message() - msg.post(url, "set_time_step", { factor = factor, mode = 1 })

@EvoTeamDevelop
Copy link
Author

Also I have noticed that if send set_time_step x2 times, then pausing works.

@britzl
Copy link
Owner

britzl commented Sep 20, 2021

Well, the thing is that the timestep of the screen below the popup is set by Monarch when the screen below the popup has been disabled (release input, focus lost etc). This happens after the code in your script has run, so whatever you put there will be replaced by the timestep set by Monarch.

My recommendation is that you set the timestep in the callback to monarch.show():

monarch.show("screen2", nil, nil, function()
	-- the screen is now completely shown
	-- modify timestep etc here
end)

But why aren't you using the "Timestep below popup" option to pause anything under the popup?

@EvoTeamDevelop
Copy link
Author

Show callback did the trick! As I remember I have already tried that approach and it did not worked for me, maybe I was doing something wrong.

Regarding "Timestep below popup" thanks for suggestion, I would like to control, when it needs to pause the scene or not for specific popups. As I understand with this option enabled all popups will be paused.
Thanks for the help!

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