Skip to content

Menu functions

Both functions are available in the content and menu parsers.

zDExt_Menu_GetItemText

Returns the text at the specified line of a menu item. The line argument is required; pass 0 for the first line.

func string zDExt_Menu_GetItemText(var string menuItemName, var int line) {};
  • menuItemName – name of the menu item (case-insensitive)
  • line – index of text lines array
  • return – text value of menu item
Example usage
1
2
3
4
5
6
7
var string playerGuild;
playerGuild = zDExt_Menu_GetItemText("MENU_ITEM_PLAYERGUILD", 0);

if (Hlp_StrCmp(playerGuild, "Necromancer"))
{
    //...
};

zDExt_Menu_SetItemText

Sets value of specified menu item.

func void zDExt_Menu_SetItemText(var string menuItemName, var string value, var int line, var int drawNow) {};
  • menuItemName – name of the menu item (case-insensitive)
  • value – text value to set
  • line – index of text lines array
  • drawNow – TRUE to request immediate drawing, FALSE otherwise
Example usage
zDExt_Menu_SetItemText("MENU_ITEM_PLAYERGUILD", "Necromancer", 0, TRUE);