Skip to content

Get Sansar

Script API

ModalDialog

Where: Client
More page actions

For the complete documentation index, see llms.txt. This page is also available as Markdown.

Manages a modal dialog which can be presented to the user.

public class ModalDialog : Sansar.Script.InstanceInterface

Remarks

Set the message and the button text.

Members at a glance

KindMembers
PropertiesMessage · Response
MethodsCancel · Show · ToString

Properties

Message

public string Message { get; }

The message displayed on the dialog.

Value: string — The string displayed on the dialog.

Remarks

This is set by the ModalDialog.Show method upon creation.

Response

public string Response { get; }

The response from the last ModalDialog.Show call.

Value: string — String response from the last show call.

Remarks

This value will be valid after the event occurs.

Methods

Cancel

public void Cancel()

Cancels any existing dialog.

Remarks

Does not generate an event.

Show

public void Show(     string message,     string leftButton,     string rightButton )

Shows a Modal Dialog on the screen.

ParameterTypeDescription
messagestringText of the dialog.
leftButtonstringText of the left button.
rightButtonstringText of the right button.
Remarks

Call this with ScriptBase.WaitFor in a coroutine to block until the event is generated.

Deprecated
[System.Obsolete("Deprecated. Use the Action<> overload", false)] public ulong Show(     string message,     string leftButton,     string rightButton,     Sansar.Script.ScriptBase.OperationComplete handler )

Shows a Modal Dialog on the screen.

ParameterTypeDescription
messagestringText of the dialog.
leftButtonstringText of the left button.
rightButtonstringText of the right button.
handlerSansar.Script.ScriptBase.OperationCompleteHandler to be called when the event completes.

Returns: ulong — The internal event id for the completion event.

Remarks

Call this with ScriptBase.WaitFor in a coroutine to block until the event is generated.

public void Show(     string message,     string leftButton,     string rightButton,     Action<Sansar.Script.OperationCompleteEvent> handler )

Shows a Modal Dialog on the screen.

ParameterTypeDescription
messagestringText of the dialog.
leftButtonstringText of the left button.
rightButtonstringText of the right button.
handlerAction<Sansar.Script.OperationCompleteEvent>Handler to be called when the event completes.
Remarks

Call this with ScriptBase.WaitFor in a coroutine to block until the event is generated.

ToString

public override string ToString()

A string representation of this object.

Returns: string — A string representation of this object.

Remarks

The format of this string may change between releases.

Used in examples

Generated from the Sansar 47.10.0 client ScriptApi snapshot.