Skip to content

Game.UI.MessageDialog

Assembly: Assembly-CSharp.dll
Namespace: Game.UI

Type: public class

Base: ConfirmationDialogBase

Summary:
MessageDialog is a lightweight convenience subclass of ConfirmationDialogBase used to present simple message dialogs to the player. It exposes two constructor overloads to create dialogs with a required message and confirm action, optional title, optional detailed text, an optional copy button, and zero or more extra action buttons (otherActions). This class simply forwards parameters to the base ConfirmationDialogBase and does not add additional state or behavior.


Fields

  • None
    There are no private or public fields declared in MessageDialog. It relies entirely on functionality provided by ConfirmationDialogBase.

Properties

  • None
    MessageDialog does not declare additional properties. Any dialog state (buttons, message text, etc.) is managed by the base class.

Constructors

  • public MessageDialog(LocalizedString? title, LocalizedString message, LocalizedString confirmAction, [CanBeNull] params LocalizedString[] otherActions)
    Creates a message dialog with an optional title, required message and confirm action. This overload does not include details text and disables the "copy" button (copyButton = false). Additional action buttons can be passed via otherActions.

  • public MessageDialog(LocalizedString? title, LocalizedString message, LocalizedString? details, bool copyButton, LocalizedString confirmAction, [CanBeNull] params LocalizedString[] otherActions)
    Creates a message dialog where you can also supply an optional details string and explicitly enable or disable the copy button. confirmAction is required; otherActions can supply zero or more additional action labels.

Methods

  • None (no methods declared)
    MessageDialog declares no methods of its own; it inherits dialog lifecycle and display methods from ConfirmationDialogBase.

Usage Example

// Simple message with single Confirm button
var dialog = new MessageDialog(
    title: new LocalizedString("Warning"),
    message: new LocalizedString("Operation completed successfully."),
    confirmAction: new LocalizedString("OK")
);

// Message with details and copy button enabled, plus an extra action
var detailedDialog = new MessageDialog(
    title: new LocalizedString("Report"),
    message: new LocalizedString("An issue occurred."),
    details: new LocalizedString("Error details: ..."),
    copyButton: true,
    confirmAction: new LocalizedString("Close"),
    new LocalizedString("Send Report")
);

// Displaying the dialog depends on the UI framework in use.
// If ConfirmationDialogBase exposes a Show() method, you can call:
dialog.Show();
detailedDialog.Show();

Notes: - LocalizedString is used for all visible text so dialogs are ready for localization. - The otherActions parameter is a params array and may be null or omitted; entries are added as additional action buttons. - MessageDialog only forwards parameters to the base class and does not modify behavior beyond selecting defaults (e.g., copyButton = false in the simpler overload).