Skip to content
Version 2.35.0
↓ Get the launcher

ConfirmController class

The state of one window’s modal confirm (framework 2.33.0). Create one per window, hand it to a ConfirmHostElement wrapped around the content it must cover, and call Show.

While a request is open the framework draws a dark scrim over the host’s content with a centred card (icon tile, title, subtitle, message, Cancel + confirm pills) and the content underneath takes NO input — clicks, hover, wheel and drags are all swallowed. Whatever is outside the host (the title bar, its ✕, window dragging) keeps working. Esc = Cancel; Enter does nothing. Hiding the window (✕) or the host cancels the open request.

Main thread only (call it from UI callbacks / OnUpdate). Callbacks run after the dialog has closed, so one may open the next confirm.

public sealed class ConfirmController
name description
ConfirmController() The default constructor.
Current { get; } The open request, or null.
DontAskChecked { get; set; } The “Don’t ask again” checkbox; reset to false whenever a request opens.
DontAskStore { get; set; } Where “Don’t ask again” choices persist — pass a section of your own plugin config (e.g. Config.GetSection("ui")), so they are per plugin. Null = the choice lasts for this session only.
IsOpen { get; } A request is open (the scrim + card are shown).
Cancel() Closes without confirming, then runs OnCancel. No-op when closed.
Confirm() The player confirmed: closes, stores “Don’t ask again” when ticked, then runs OnConfirm. No-op when closed.
IsDontAsk(…) True when the player chose “Don’t ask again” for key.
SetDontAsk(…) Sets or clears a “Don’t ask again” choice (e.g. a settings “Reset confirmations” button passes false).
Show(…) Opens request. Returns false when it did not open because the player chose “Don’t ask again” for its key earlier — OnConfirm has then already run. A request still open is cancelled first (its OnCancel runs).