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

[FEATURE] UI utilities for tutorial-like dialog windows #7

Open
ReveredRedHood opened this issue Dec 27, 2023 · 1 comment
Open

[FEATURE] UI utilities for tutorial-like dialog windows #7

ReveredRedHood opened this issue Dec 27, 2023 · 1 comment
Labels
common Related to the SOD.Common library. feature New feature implementation.

Comments

@ReveredRedHood
Copy link
Collaborator

ReveredRedHood commented Dec 27, 2023

Introduction
Add UI utilities that show in-game dialog windows. These should be similar to the prompts seen during the tutorial section of the game.

Description of the feature
image
image
image

Feature usage
Would provide a basic method for mod authors to get input from the player. One example is when a mod needs to get the player's confirmation before doing something. Another would be when a mod needs to show the player a message that is worth pausing the game for (when GameMessage.Broadcast isn't enough).

Dependencies and Prerequisites
Does this feature require any new dependencies? No.

Implementation details
My gut feeling is that it is going to be difficult to use the game's tutorial dialog system for this... that code is probably coupled to the "case" and "objectives" systems. We'll probably have to create a hacky solution using the game's interface system.

Two possible approaches below, but we can discuss other ideas also.

// Idea 1: Create dialog objects
var dlg = new Dialog("Title", "Question");
var noBtn = dlg.AddResponse(buttonText: "No", Dialog.LeftButtonPosition);
var yesBtn = dlg.AddResponse(buttonText: "Yes", Dialog.RightButtonPosition);
noBtn.OnClicked += SomeAction;
Lib.Interface.ShowDialog(dialog: dlg, pauseWhileShowing: true, destroyAfterResponse: true);
// Idea 2: Create one helper function that handles everything
ShowDialog(string title, string question, string leftButtonText, Action leftButtonClicked, string centerButtonText, Action ...)

Note: Not a priority for v1.1.0

@ReveredRedHood ReveredRedHood added the feature New feature implementation. label Dec 27, 2023
@Ven0maus
Copy link
Owner

Ven0maus commented Dec 27, 2023

Should also look into: PopupMessageController.PopupMessage

@Ven0maus Ven0maus added this to the stable v1.2.0 milestone Dec 27, 2023
@Ven0maus Ven0maus removed this from the stable v1.2.0 milestone Apr 28, 2024
@Ven0maus Ven0maus added the common Related to the SOD.Common library. label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Related to the SOD.Common library. feature New feature implementation.
Projects
None yet
Development

No branches or pull requests

2 participants