UIMenuListItem
This item requires a list of values to be given, the menu will then scroll the items left/right. This item has 2 events, OnListChange called everytime the user goes left/right and OnListSelect called when the user selects the item after highlighting it. The item inherits all the UIMenuItem functions and adds some of his.
⚠️ Warning
This item is sheduled to become obsolete and legacy in future updates of the library. It will be replaced by the more runtime friendly UIMenuDynamicListItem.
Constructor
UIMenuListItem(string text, List<dynamic> items, int index)
UIMenuListItem(string text, List<dynamic> items, int index, string description)
UIMenuListItem(string text, List<dynamic> items, int index, string description, HudColor mainColor, HudColor higlightColor)
Parameters
Items
The values given in constructor are saved in the Items list.
List<object> Items { get; }
var values = listItem.Items;
Index
Gets or Sets the current item index to show the corresponding value in the given Items list
int Index { get; set; }
Functions
ChangeList
This functions updates the current list of values with a new one. A new starting index can be optionally specified.
public void ChangeList(List<dynamic> list, int index)
Events
OnListChange
Triggered everytime the player goes left or right
public event ListChangedEvent OnListChange;
OnListSelect
Triggered everytime the player selects the item after highlighting it.
public event ListSelectedEvent OnListSelect;