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

Transition messages are mistimed and possibly incomplete #96

Closed
dri-richard opened this issue Aug 3, 2023 · 2 comments · Fixed by #97
Closed

Transition messages are mistimed and possibly incomplete #96

dri-richard opened this issue Aug 3, 2023 · 2 comments · Fixed by #97

Comments

@dri-richard
Copy link

When registering a listener with add_listener(url), the full set of messages is not received during transitions, and some of them are received early.

To reproduce:

  • add a listener in init() of about.gui_script:
    monarch.add_listener(msg.url())
  • add logging to on_message in the same file:
if message.screen and message.next_screen then
	print(message_id .. " screen: " .. message.screen .. " next screen: " .. message.next_screen)
elseif message.screen and message.previous_screen then
	print(message_id .. " screen: " .. message.screen .. " prev screen: " .. message.previous_screen)
else
	print(message_id)
end
  • Run the example and click 'ABOUT'
  • Note that the following is printed immediately:
[monarch_screen_transition_in_finished] screen: [about] prev screen: [menu]
[monarch_screen_transition_out_started] screen: [menu] next screen: [about]
[monarch_screen_transition_out_finished] screen: [menu] next screen: [about]
  • Click 'OK' to go back, and note that this is printed immediately:
[monarch_screen_transition_out_started] screen: [about] next screen: [menu]
hash: [transition_show_out]

Presumably, monarch_screen_transition_out_finished can't be received by [about] as it's been unloaded but perhaps it should receive monarch_screen_transition_in_started.

@britzl
Copy link
Owner

britzl commented Aug 8, 2023

@dri-richard could you please try this branch and let me know what you think: https://github.com/britzl/monarch/archive/refs/heads/Issue-96-transition-messages-are-inaccurate.zip

@dri-richard
Copy link
Author

Thanks, that works as expected.

@britzl britzl closed this as completed in #97 Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants