GUI functions¶
-
class GUIFunctions¶
Public Static Functions
-
static void _MessageBox(unsigned short pid, int id, const char *label) noexcept¶
Display a simple messagebox at the bottom of the screen that vanishes after a few seconds.
Note for C++ programmers: do not rename into MessageBox so as to not conflict with WINAPI’s MessageBox.
- Parameters
pid – The player ID for whom the messagebox should appear.
id – The numerical ID of the messagebox.
label – The text in the messagebox.
- Returns
void
-
static void CustomMessageBox(unsigned short pid, int id, const char *label, const char *buttons) noexcept¶
Display an interactive messagebox at the center of the screen that vanishes only when one of its buttons is clicked.
- Parameters
pid – The player ID for whom the messagebox should appear.
id – The numerical ID of the messagebox.
label – The text in the messagebox. \parm buttons The captions of the buttons, separated by semicolons (e.g. “Yes;No;Maybe”).
- Returns
void
-
static void InputDialog(unsigned short pid, int id, const char *label, const char *note) noexcept¶
Display an input dialog at the center of the screen.
- Parameters
pid – The player ID for whom the input dialog should appear.
id – The numerical ID of the input dialog.
label – The text at the top of the input dialog. \parm note The text at the bottom of the input dialog.
- Returns
void
-
static void PasswordDialog(unsigned short pid, int id, const char *label, const char *note) noexcept¶
Display a password dialog at the center of the screen.
Although similar to an input dialog, the password dialog replaces all input characters with asterisks.
- Parameters
pid – The player ID for whom the password dialog should appear.
id – The numerical ID of the password dialog.
label – The text at the top of the password dialog. \parm note The text at the bottom of the password dialog.
- Returns
void
-
static void ListBox(unsigned short pid, int id, const char *label, const char *items)¶
Display a listbox at the center of the screen where each item takes up a row and is selectable, with the listbox only vanishing once the Ok button is pressed.
- Parameters
pid – The player ID for whom the listbox should appear.
id – The numerical ID of the listbox.
label – The text at the top of the listbox. \parm items The items in the listbox, separated by newlines (e.g. “Item 1\nItem 2”).
- Returns
void
-
static void ClearQuickKeyChanges(unsigned short pid) noexcept¶
Clear the last recorded quick key changes for a player.
This is used to initialize the sending of new PlayerQuickKeys packets.
- Parameters
pid – The player ID whose quick key changes should be used.
- Returns
void
-
static unsigned int GetQuickKeyChangesSize(unsigned short pid) noexcept¶
Get the number of indexes in a player’s latest quick key changes.
- Parameters
pid – The player ID whose quick key changes should be used.
- Returns
The number of indexes.
-
static void AddQuickKey(unsigned short pid, unsigned short slot, int type, const char *itemId = "") noexcept¶
Add a new quick key to the quick key changes for a player.
- Parameters
pid – The player ID whose quick key changes should be used.
slot – The slot to be used.
type – The type of the quick key (0 for ITEM, 1 for ITEM_MAGIC, 2 for MAGIC, 3 for UNASSIGNED).
itemId – The itemId of the item.
- Returns
void
-
static int GetQuickKeySlot(unsigned short pid, unsigned int index) noexcept¶
Get the slot of the quick key at a certain index in a player’s latest quick key changes.
- Parameters
pid – The player ID whose quick key changes should be used.
index – The index of the quick key in the quick key changes vector.
- Returns
The slot.
-
static int GetQuickKeyType(unsigned short pid, unsigned int index) noexcept¶
Get the type of the quick key at a certain index in a player’s latest quick key changes.
- Parameters
pid – The player ID whose quick key changes should be used.
index – The index of the quick key in the quick key changes vector.
- Returns
The quick key type.
-
static const char *GetQuickKeyItemId(unsigned short pid, unsigned int index) noexcept¶
Get the itemId at a certain index in a player’s latest quick key changes.
- Parameters
pid – The player ID whose quick key changes should be used.
index – The index of the quick key in the quick key changes vector.
- Returns
The itemId.
-
static void SendQuickKeyChanges(unsigned short pid) noexcept¶
Send a PlayerQuickKeys packet with a player’s recorded quick key changes.
- Parameters
pid – The player ID whose quick key changes should be used.
- Returns
void
-
static void SetMapVisibility(unsigned short targetPid, unsigned short affectedPid, unsigned short state) noexcept¶
Determine whether a player can see the map marker of another player.
Note: This currently has no effect, and is just an unimplemented stub.
- Parameters
targetPid – The player ID whose map marker should be hidden or revealed.
affectedPid – The player ID for whom the map marker will be hidden or revealed.
state – The state of the map marker (false to hide, true to reveal).
- Returns
void
-
static void SetMapVisibilityAll(unsigned short targetPid, unsigned short state) noexcept¶
Determine whether a player’s map marker can be seen by all other players.
Note: This currently has no effect, and is just an unimplemented stub.
- Parameters
targetPid – The player ID whose map marker should be hidden or revealed.
state – The state of the map marker (false to hide, true to reveal).
- Returns
void
-
static void _MessageBox(unsigned short pid, int id, const char *label) noexcept¶