Table of Contents

Class Gui

Namespace
SharpPluginLoader.Core
Assembly
SharpPluginLoader.Core.dll

Exposes functionality related to the game's GUI.

public static class Gui
Inheritance
Gui
Inherited Members

Properties

ActiveObjects

Gets the list of currently active GUI objects.

public static MtArray<Unit> ActiveObjects { get; }

Property Value

MtArray<Unit>

CurrentLanguage

The current game language.

public static Language CurrentLanguage { get; }

Property Value

Language

SingletonInstance

The singleton instance of the sMhGUI class.

public static MtObject SingletonInstance { get; }

Property Value

MtObject

Methods

DisplayAlert(string)

Displays an alert with the given message. The alert disappears automatically after a few seconds.

public static void DisplayAlert(string message)

Parameters

message string

The alert to display

DisplayMessage(string, bool)

Displays a blue/purple message in the chat box.

public static void DisplayMessage(string message, bool isImportant = false)

Parameters

message string

The message to display

isImportant bool

Whether the message should be displayed in purple

DisplayMessage(string, TimeSpan, bool)

Displays a blue/purple message in the chat box.

public static void DisplayMessage(string message, TimeSpan delay, bool isImportant = false)

Parameters

message string

The message to display

delay TimeSpan

The delay before the message is displayed

isImportant bool

Whether the message should be displayed in purple

DisplayMessageWindow(string, Vector2)

Displays a message window with the specified message and offset.

public static void DisplayMessageWindow(string message, Vector2 offset = default)

Parameters

message string

The message to display

offset Vector2

The offset to apply to the window. By default it is in the center of the screen

DisplayPopup(string, float, float)

Displays a popup message on the screen.

public static void DisplayPopup(string message, float xOff = 0, float yOff = 0)

Parameters

message string

The message to display

xOff float

The horizontal offset from the center of the screen

yOff float

The vertical offset from the center of the screen

DisplayPopup(string, TimeSpan, float, float)

Displays a popup message on the screen.

public static void DisplayPopup(string message, TimeSpan duration, float xOff = 0, float yOff = 0)

Parameters

message string

The message to display

duration TimeSpan

The duration for which the popup should be displayed

xOff float

The horizontal offset from the center of the screen

yOff float

The vertical offset from the center of the screen

DisplayPopup(string, TimeSpan, TimeSpan, float, float)

Displays a popup message on the screen.

public static void DisplayPopup(string message, TimeSpan duration, TimeSpan delay, float xOff = 0, float yOff = 0)

Parameters

message string

The message to display

duration TimeSpan

The duration for which the popup should be displayed

delay TimeSpan

The delay before the popup is displayed

xOff float

The horizontal offset from the center of the screen

yOff float

The vertical offset from the center of the screen

DisplayYesNoDialog(string, DialogCallback)

Displays a prompt with a yes/no/cancel button. The callback will be called when the user clicks a button. Note: The user is responsible for keeping the callback alive.

public static void DisplayYesNoDialog(string message, DialogCallback callback)

Parameters

message string

The message to display

callback DialogCallback

The callback to call when the user clicks a button

FindObject(MtDti)

Finds a GUI object by its DTI.

public static Unit? FindObject(MtDti dti)

Parameters

dti MtDti

The DTI of the GUI object to find

Returns

Unit

The GUI object, or null if it wasn't found

FindObject(string)

Finds a GUI object by its name.

public static Unit? FindObject(string name)

Parameters

name string

The name of the GUI object to find

Returns

Unit

The GUI object, or null if it wasn't found