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
CurrentLanguage
The current game language.
public static Language CurrentLanguage { get; }
Property Value
SingletonInstance
The singleton instance of the sMhGUI class.
public static MtObject SingletonInstance { get; }
Property Value
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
messagestringThe 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
messagestringThe message to display
isImportantboolWhether 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
messagestringThe message to display
delayTimeSpanThe delay before the message is displayed
isImportantboolWhether 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
messagestringThe message to display
offsetVector2The 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
messagestringThe message to display
xOfffloatThe horizontal offset from the center of the screen
yOfffloatThe 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
messagestringThe message to display
durationTimeSpanThe duration for which the popup should be displayed
xOfffloatThe horizontal offset from the center of the screen
yOfffloatThe 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
messagestringThe message to display
durationTimeSpanThe duration for which the popup should be displayed
delayTimeSpanThe delay before the popup is displayed
xOfffloatThe horizontal offset from the center of the screen
yOfffloatThe 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
messagestringThe message to display
callbackDialogCallbackThe 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
dtiMtDtiThe DTI of the GUI object to find
Returns
FindObject(string)
Finds a GUI object by its name.
public static Unit? FindObject(string name)
Parameters
namestringThe name of the GUI object to find