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

Add UI buttons and modal dialog boxes. #26

Merged
merged 1 commit into from
May 18, 2024
Merged

Add UI buttons and modal dialog boxes. #26

merged 1 commit into from
May 18, 2024

Conversation

0mdc
Copy link
Owner

@0mdc 0mdc commented May 15, 2024

This changeset adds networked UI elements.

  • Modal dialogue boxes.
  • Buttons.
dialogue-2024-05-15_09.46.42.mp4

UI elements follow the immediate mode GUI pattern. They are both keyframe consumers and message producers.

How buttons work:

  1. Server creates a button named X and sends it to the client.
  2. Client receives it, renders it, and stores whether it was clicked.
  3. Client sends back X's state.
  4. Server checks whether X was clicked.

Dialogue boxes are simply containers of UI elements (right now only supporting buttons).

Depends on:

@0mdc 0mdc requested review from jturner65 and aclegg3 May 15, 2024 13:53
Copy link
Owner Author

@0mdc 0mdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments for reviewers.

@@ -15,6 +15,9 @@ public class LoadProgressTracker
uint _successCount = 0;
uint _failureCount = 0;

// TODO: Refactor.
public bool _modalDialogueShown = false;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These global states will be refactored in a later pass.

GUILayout.BeginHorizontal();
GUI.color = Color.white;
GUILayout.Window(
9, // TODO
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ImGUI IDs will be taken care of in a later pass.

@0mdc 0mdc changed the title Add UI buttons and modal dialogues. Add UI buttons and modal dialog boxes. May 15, 2024
@0mdc 0mdc force-pushed the 0mdc/ui_elements branch from e6bb099 to ed7281c Compare May 18, 2024 17:13
@0mdc 0mdc merged commit d61d201 into main May 18, 2024
@0mdc 0mdc deleted the 0mdc/ui_elements branch May 18, 2024 17:13
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 this pull request may close these issues.

2 participants