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

Session Host / Session Join UI Improvements #203

Open
azriel91 opened this issue Mar 12, 2020 · 0 comments
Open

Session Host / Session Join UI Improvements #203

azriel91 opened this issue Mar 12, 2020 · 0 comments
Labels
F: ui UI to choose settings / options for a game.
Milestone

Comments

@azriel91
Copy link
Owner

In GitLab by @azriel91 on Mar 4, 2020, 11:43

Currently after clicking Host or Join, the UI does not give any feedback what the application state is:

  • Requesting a session host code.
  • Requesting to join a session.
  • Whether the session server is actually contacted.
  • Ability to cancel the Host / Join request.

Solution Design:

The functionality that both of these use can be commonized to a dialog box ItemComponent, and the dialog box button entities may have an InputReactionsHandle attached to them to send the relevant events when clicked.

UiDialog is an ItemComponent, and dialogs are part of UiDefinition. Buttons on the dialog are optional, and need to receive UiEvents and turn that into the correct app event. We do this by attaching an InputReactionsHandle<InputReaction<IRR>>.

Steps:

  1. ui_dialogue_model provides UiDialog ItemComponent.

  2. Call IrsLoader::load or input_reactions_loaded_handle (make it pub). See asset_sequence_component_loader_ui.rs:263

  3. Attach that to the button entities created by the UiDialog.

    When creating the UiDialog, we need to have the InputReactionsHandle already, and pass it in to the constructor. Then the ItemComponent implementation will attach it when the entities are created.

  4. Store the common dialog texture in Theme, and UiDialog can ReadExpect<'s, Theme> to get the texture handle.

  5. Send event to open dialog.

@azriel91 azriel91 added the F: ui UI to choose settings / options for a game. label Mar 12, 2020
@azriel91 azriel91 added this to the Backlog milestone Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: ui UI to choose settings / options for a game.
Projects
None yet
Development

No branches or pull requests

1 participant