-
-
Notifications
You must be signed in to change notification settings - Fork 3
Description
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:
-
ui_dialogue_modelprovidesUiDialogItemComponent. -
Call
IrsLoader::loadorinput_reactions_loaded_handle(make itpub). See asset_sequence_component_loader_ui.rs:263 -
Attach that to the button entities created by the
UiDialog.When creating the
UiDialog, we need to have theInputReactionsHandlealready, and pass it in to the constructor. Then theItemComponentimplementation will attach it when the entities are created. -
Store the common dialog texture in
Theme, andUiDialogcanReadExpect<'s, Theme>to get the texture handle. -
Send event to open dialog.