GUI functions

class GUIFunctions

Public Static Functions

void _MessageBox(unsigned short pid, int id, const char *label)

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.

Return
void
Parameters
  • pid: The player ID for whom the messagebox should appear.
  • id: The numerical ID of the messagebox.
  • label: The text in the messagebox.

void CustomMessageBox(unsigned short pid, int id, const char *label, const char *buttons)

Display an interactive messagebox at the center of the screen that vanishes only when one of its buttons is clicked.

Return
void
Parameters
  • pid: The player ID for whom the messagebox should appear.
  • id: The numerical ID of the messagebox.
  • label: The text in the messagebox. buttons The captions of the buttons, separated by semicolons (e.g. “Yes;No;Maybe”).

void InputDialog(unsigned short pid, int id, const char *label, const char *note)

Display an input dialog at the center of the screen.

Return
void
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. note The text at the bottom of the input dialog.

void PasswordDialog(unsigned short pid, int id, const char *label, const char *note)

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.

Return
void
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. note The text at the bottom of the password dialog.

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.

Return
void
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. items The items in the listbox, separated by newlines (e.g. “Item 1\nItem 2”).

void ClearQuickKeyChanges(unsigned short pid)

Clear the last recorded quick key changes for a player.

This is used to initialize the sending of new PlayerQuickKeys packets.

Return
void
Parameters
  • pid: The player ID whose quick key changes should be used.

unsigned int GetQuickKeyChangesSize(unsigned short pid)

Get the number of indexes in a player’s latest quick key changes.

Return
The number of indexes.
Parameters
  • pid: The player ID whose quick key changes should be used.

void AddQuickKey(unsigned short pid, unsigned short slot, int type, const char *itemId = "")

Add a new quick key to the quick key changes for a player.

Return
void
Parameters
  • pid: The player ID whose quick key changes should be used.
  • slot: The slot to be used.
  • slot: 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.

int GetQuickKeySlot(unsigned short pid, unsigned int index)

Get the slot of the quick key at a certain index in a player’s latest quick key changes.

Return
The slot.
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.

int GetQuickKeyType(unsigned short pid, unsigned int index)

Get the type of the quick key at a certain index in a player’s latest quick key changes.

Return
The quick key type.
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.

const char *GetQuickKeyItemId(unsigned short pid, unsigned int index)

Get the itemId at a certain index in a player’s latest quick key changes.

Return
The itemId.
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.

void SendQuickKeyChanges(unsigned short pid)

Send a PlayerQuickKeys packet with a player’s recorded quick key changes.

Return
void
Parameters
  • pid: The player ID whose quick key changes should be used.

void SetMapVisibility(unsigned short targetPid, unsigned short affectedPid, unsigned short state)

Determine whether a player can see the map marker of another player.

Note: This currently has no effect, and is just an unimplemented stub.

Return
void
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).

void SetMapVisibilityAll(unsigned short targetPid, unsigned short state)

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.

Return
void
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).