Menu Editing Reference

From PMDOWiki
(Redirected from MultiPageMenu Reference)

ILabeled

These properties and functions are included in every single Menu and MenuElement in the game, including SummaryMenus.

ILabeled.Label

An optional, read-only string identifier for this object. It is recommended to always use HasLabel before accessing it.


ILabeled:HasLabel()

Returns true if the object's Label is not an empty string. False otherwise.


ILabeled:LabelContains(System.String)

Returns true if the object's Label is not empty and it contains the provided string. False otherwise.

Arguments

  • substr: the string to look for.



MenuBase

These properties and functions are included in every single Menu in the game, including SummaryMenus.

MenuBase.Elements

The List of MenuElements inside this menu. This list can be interacted with directly to add or remove elements.


MenuBase.GetElementIndexByLabel(System.String)

Iterates through the Elements list and returns the index of the first element found whose Label matches the provided string. If no such element is found, it returns -1.

Arguments

  • label: the label to look for.


MenuBase.GetElementIndicesByLabel(params System.String[])

Iterates through the Elements list and returns a Dictionary containing all unique strings provided and the index of the first element found whose Label matches that specific string. Every string for which no such element is found will have its index set to -1.
You can retrieve a specific label's index with ret[label]. Keep in mind that these values do not update automatically if elements are removed.

Arguments

  • labels one or more labels or, alternatively, an array of labels to look for.



InteractableMenu

Any menu included in an AddMenu service message is an InteractableMenu, and will have all these properties and methods plus those described in the ILabeled and MenuBase sections.

InteractableMenu.SummaryMenus

The List of SummaryMenus used by this menu. This list can be interacted with directly to add or remove SummaryMenus.


InteractableMenu.GetSummaryIndexByLabel(System.String)

Iterates through the SummaryMenus list and returns the index of the first summary menu found whose Label matches the provided string. If no such summary menu is found, it returns -1.

Arguments

  • label: the label to look for.


InteractableMenu.GetSummaryIndicesByLabel(params System.String[])

Iterates through the SummaryMenus list and returns a Dictionary containing all unique strings provided and the index of the first summary menu found whose Label matches that specific string. Every string for which no such summary menu is found will have its index set to -1.
You can retrieve a specific label's index with ret[label]. Keep in mind that these values do not update automatically if summary menus are removed.

Arguments

  • labels one or more labels or, alternatively, an array of labels to look for.



ChoiceMenu

Any menu that has a list of choices to select from is a ChoiceMenu, and will have all these properties and methods plus those described in the ILabeled, MenuBase and InteractableMenu sections. Interacting with the Choices list directly can have inconsistent results, so it's recommended to use ImportChoices and ExportChoices instead.

ChoiceMenu.Choices

The list of MenuChoice elements that can be selected in this menu.

ChoiceMenu.NonChoices

The list of elements that are not choices, but are still part of this menu. An example is the title of the OthersMenu.

ChoiceMenu.Elements

This list is actually just an alias of NonChoices. You can use either and achieve the same result, but it is recommended to use NonChoices for better code clarity.


ChoiceMenu.ExportChoices()

Returns a copy of the current Choices list that can then be edited at will.


ChoiceMenu.ImportChoices(System.Collections.Generic.List<RogueEssence.Menu.IChoosable>)

Loads a list of IChoosables as the new Choices list and runs all of the necessary steps to fully reload the menu.

Arguments

  • choices: a list of IChoosable elements.


ChoiceMenu.ImportChoices(params RogueEssence.Menu.IChoosable[])

Loads an array or a parameter list of IChoosables as the new Choices list and runs all of the necessary steps to fully reload the menu.

Arguments

  • choices: an array or parameter list of IChoosable elements.


ChoiceMenu.GetChoiceIndexByLabel(System.String)

Iterates through the Choices list and returns the index of the first element found whose Label matches the provided string. If no such element is found, it returns -1.

Arguments

  • label: the label to look for.


ChoiceMenu.GetChoiceIndicesByLabel(params System.String[])

Iterates through the Choices list and returns a Dictionary containing all unique strings provided and the index of the first element found whose Label matches that specific string. Every string for which no such element is found will have its index set to -1.
You can retrieve a specific label's index with ret[label]. Keep in mind that these values do not update automatically if elements are removed.

Arguments

  • labels one or more labels or, alternatively, an array of labels to look for.


ChoiceMenu.GetNonChoiceIndexByLabel(System.String)

Iterates through the NonChoices list and returns the index of the first element found whose Label matches the provided string. If no such element is found, it returns -1.

Arguments

  • label: the label to look for.


ChoiceMenu.GetNonChoiceIndicesByLabel(params System.String[])

Iterates through the NonChoices list and returns a Dictionary containing all unique strings provided and the index of the first element found whose Label matches that specific string. Every string for which no such element is found will have its index set to -1.
You can retrieve a specific label's index with ret[label]. Keep in mind that these values do not update automatically if elements are removed.

Arguments

  • labels one or more labels or, alternatively, an array of labels to look for.



MultiPageMenu

Any ChoiceMenu whose list of choices takes up -or can take up- multiple pages is a MultiPageMenu, and will have all these properties and methods plus those described in the ILabeled, MenuBase, InteractableMenu and ChoiceMenu sections. Interacting with the Choice list is, however, highly discouraged, because it would only contain one page at a time. Use ImportChoices and ExportChoices instead.

MultiPageMenu.TotalChoices

The 2d matrix of IChoosables that contains all choices inside this menu, divided per page.


MultiPageMenu.ExportChoices()

Returns a List of all IChoosables contained by the menu in the order they appear in.


MultiPageMenu.ImportChoices(System.Collections.Generic.List<RogueEssence.Menu.IChoosable>)

Loads a list of IChoosables and registers it as the new TotalChoices matrix, running all of the necessary steps to fully reload the menu.

Arguments

  • choices: a list of IChoosable elements.