Skip to content

Game.UI.ConfirmationDialog

Assembly: Assembly-CSharp
Namespace: Game.UI

Type: class

Base: ConfirmationDialogBase

Summary:
A lightweight concrete confirmation dialog used by the game's UI. This class provides two convenience constructors that forward parameters to ConfirmationDialogBase. The first constructor is a common short form (no details, no copy button). The second constructor allows specifying details and whether to show a copy button. This dialog is intended to be used by mods to display simple confirm/cancel (and optional extra) action dialogs using localized text (LocalizedString).


Fields

This class declares no private or public fields.

Properties

This class declares no additional properties beyond those inherited from ConfirmationDialogBase.

Constructors

  • public ConfirmationDialog(LocalizedString? title, LocalizedString message, LocalizedString confirmAction, LocalizedString? cancelAction, [CanBeNull] params LocalizedString[] otherActions)
    Creates a confirmation dialog with:
  • optional title,
  • a required message,
  • a required confirm action label,
  • an optional cancel action label,
  • optional additional action labels (params). This constructor forwards to the base with details = null and copyButton = false.

  • public ConfirmationDialog(LocalizedString? title, LocalizedString message, LocalizedString? details, bool copyButton, LocalizedString confirmAction, LocalizedString? cancelAction, [CanBeNull] params LocalizedString[] otherActions)
    Creates a confirmation dialog where you can also provide:

  • optional details text,
  • whether a "copy" button is shown (copyButton), and the same confirm/cancel/other action labels. This constructor forwards all parameters to the base constructor.

Methods

This class does not declare its own methods; it relies on behavior implemented in ConfirmationDialogBase.

Usage Example

// Example assumes you have LocalizedString instances ready (constructed or fetched from your localization system).
LocalizedString title = new LocalizedString("Dialog.Title.Key");
LocalizedString message = new LocalizedString("Dialog.Message.Key");
LocalizedString confirm = new LocalizedString("Dialog.Confirm.Key");
LocalizedString cancel = new LocalizedString("Dialog.Cancel.Key");

// Simple confirmation dialog (no details, no copy button)
var dlg = new ConfirmationDialog(title, message, confirm, cancel);

// More advanced dialog with details and a copy button, plus an extra action
LocalizedString details = new LocalizedString("Dialog.Details.Key");
LocalizedString other = new LocalizedString("Dialog.OtherAction.Key");
var dlg2 = new ConfirmationDialog(title, message, details, copyButton: true, confirm, cancel, other);

// How to display depends on the game's UI framework / base class API.
// Typically you'd pass this dialog to the UI manager or call the appropriate show method provided by ConfirmationDialogBase.

Notes: - Parameters are LocalizedString to support the game's localization pipeline. - The [CanBeNull] attribute indicates the params array may contain null entries (or that the parameter can be omitted). - Use these constructors when you only need to show standard confirmation dialogs; override or extend ConfirmationDialogBase if you need custom behavior or layout.