Different behaviour after monarch update to 3.4.0
EvoTeamDevelop opened this issue · 6 comments
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.
Any guesstimates, when someone can take a look at this? :)
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()?
I call monarch.show without a callback and in popup collection:
- In the init method I call - msg.post('.', 'pause')
- Then in the on_message() - msg.post(url, "set_time_step", { factor = factor, mode = 1 })
Also I have noticed that if send set_time_step x2 times, then pausing works.
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?
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!