NeoSettingsDocsNeo Async Loading Screen
Menus and screensDialogs and Toasts

Dialogs and Toasts

Themed questions and notifications for any player, anywhere: over gameplay, over your own UMG, over the plugin's menus, in split-screen and in multiplayer. No setup: the nodes work as soon as the plugin is enabled. The plugin uses the same dialogs and toasts for its own questions (reset, leave with changes waiting, restart needed, import results, connection lost), so your game has one look.

On this page
  1. Confirm dialog (Blueprint)
  2. Choice dialog (Blueprint)
  3. Dialogs in C++
  4. How dialogs behave
  5. Toasts
  6. Your own look
  7. Style

Confirm dialog (Blueprint)

Show Confirm Dialog (async node, category Neo Settings > Dialogs): Title, Message, Confirm Label, Cancel Label, Destructive, Timeout Seconds, Player. Exactly one output fires: On Confirmed or On Cancelled.

  • Empty labels use the plugin's "Confirm" and "Cancel", in the player's language.
  • Destructive draws the confirm button in the style's destructive look and puts the focus on Cancel; no hold is needed to confirm.
  • Timeout Seconds > 0 shows a countdown, then answers Cancel by itself.
  • On Cancelled also fires on Back (Escape, B), when a map change or Close Dialogs closes it, and when it could not be shown (no local player, a dedicated server).
  • Canceling the node's async action (its Cancel function) closes the dialog.

Example: your own Quit button. On Clicked > Show Confirm Dialog (Title "Quit the game?", Destructive ticked) > On Confirmed > the engine's Quit Game.

Choice dialog (Blueprint)

Show Choice Dialog takes a Neo Dialog Spec: Title, Message, one to three Buttons (Id, Label, Style: Normal, Primary or Destructive), Default Button (focused first; empty: the first that is not destructive), Cancel Button (the answer to Back and to a map change; empty: the last button), Timeout Seconds and Timeout Button. On Chosen fires once with the id of the answer.

Dialogs in C++

C++
#include "NeoSettingsPlayerSubsystem.h"

void AskToOverwriteSave(APlayerController* Player, TFunction<void()> Overwrite)
{
    UNeoSettingsPlayerSubsystem* Settings = UNeoSettingsPlayerSubsystem::Get(Player);
    if (Settings == nullptr)
    {
        return; // no local player (dedicated server)
    }

    FNeoDialogButton OverwriteButton;
    OverwriteButton.Id = TEXT("overwrite");
    OverwriteButton.Label = NSLOCTEXT("MyGame", "Overwrite", "Overwrite");
    OverwriteButton.Style = ENeoDialogButtonStyle::Destructive; // never focused first

    FNeoDialogButton KeepButton;
    KeepButton.Id = TEXT("keep");
    KeepButton.Label = NSLOCTEXT("MyGame", "KeepSave", "Keep");

    FNeoDialogSpec Spec;
    Spec.Title = NSLOCTEXT("MyGame", "OverwriteTitle", "Overwrite this save?");
    Spec.Message = NSLOCTEXT("MyGame", "OverwriteMessage", "The progress saved in this slot will be lost.");
    Spec.Buttons = {KeepButton, OverwriteButton};
    Spec.CancelButton = TEXT("keep"); // the answer to Back and to a map change

    Settings->ShowDialog(Spec, [Overwrite](FName ButtonId)
    {
        if (ButtonId == FName(TEXT("overwrite")))
        {
            Overwrite();
        }
    });
}

ShowDialog returns the dialog's id (INDEX_NONE when it cannot be shown; the callback is then never called). CloseDialog(Id) and CloseAllDialogs() answer the Cancel Button.

How dialogs behave

  • One dialog at a time per player; the next ones wait their turn, first asked, first shown.
  • A dialog takes the player's input while it is up and gives it back after; if your UI is already in a UI-only input mode, it keeps your mode and only takes the focus.
  • Buttons grow to fit their text (translations can be two or three times longer); a row that does not fit is stacked.
  • A hard map change answers every dialog's Cancel Button; seamless travel keeps them.
  • Each player's dialogs open in that player's part of the screen and take only that player's controller.

Toasts

Show Toast (Message, Kind, Duration Seconds, Player) shows a short message in a corner of the player's screen. It never takes the focus and never blocks input.

  • Kind: Info, Success, Warning or Error, each with its own icon and color (never the color alone).
  • Duration 0: from the length of the text, 3 to 10 seconds.
  • At most Max Visible Toasts (default 3, 1 to 5) per player; the others wait.
  • Inside the screen's safe zone, in the corner the style chooses; silent unless your style gives the toast event a sound.
C++
#include "NeoSettingsLibrary.h"

void TellCheckpointReached(APlayerController* Player)
{
    // Duration 0: from the length of the text (3 to 10 seconds). The toast never takes the focus.
    UNeoSettingsLibrary::ShowToast(Player, NSLOCTEXT("MyGame", "Checkpoint", "Checkpoint reached"),
                                   ENeoToastKind::Success, 0.0f, Player);
}

The player subsystem's Show Toast takes a Neo Toast struct (Message, Kind, Duration Seconds).

Your own look

Project Settings > Dialogs:

FieldMeaning
Dialog Widget ClassA Widget Blueprint based on Neo Dialog Widget: draw the spec given by On Dialog Shown, call Answer with the button's id. Back answers the Cancel Button by itself; On Countdown gives the seconds left. Every dialog of the plugin uses it too.
Toast Widget ClassA Widget Blueprint based on Neo Toast Widget: draw the toast of On Toast Shown; play your exit in On Toast Hidden (the widget is removed about 0.2 s later). The plugin places, stacks and times it.
Max Visible ToastsToasts visible at once per player

Style

Selectors modal, modal.dim, modal.title, modal.body, button, button.primary, button.destructive and focus dress the dialogs; toast (with its states info, success, warning, error and its corner) and toast.icon the toasts. See Styles.

Something not as described? Every code the editor shows has its own entry in Troubleshooting.