azriel91 / autexousious

Main repository for Will -- 2.5D moddable action adventure game
https://azriel.im/will
Apache License 2.0
44 stars 3 forks source link

Session Host / Session Join UI Improvements #203

Open azriel91 opened 4 years ago

azriel91 commented 4 years ago

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:


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.