3.3 KiB
3.3 KiB
- Sets
listytolistlowto indicate the list has been scrolled. - If this is a new ItemList, Initializes the static fields:
listmaxtolistammount,listlowto 0, option to 0,listcursorto 0,inlistto true and create the cursor. - If this is a refresh, free all the letter slots used in ItemList and itself.
- Resets ItemList to a new GameObject, set its parent to the GUICamera or to the
questboardobjif it isn't null and set its localPosition to (position.x,position.y, 10.0). - If listtype is the language selection list, Call SetText in non Dialogue mode where the text is set to the language selection prompt using the index of option of
listvarprepended with |color,4||center||sort,20|. This effectively changes the line to match the selected language. - If
listlowis above 0 andmaxoptionsis higher thanlistammount(which means that there are more items than visible at once and we have scrolled below the top):- Setup the up arrow GUI sprite to appear at the top of the list as child of ItemList. The exact setup depends on listtype and if we are in the pause menu.
- If we had a list in
overridedlist, restore it and clear it. - If we allow multi select
listsellis true OR listtype is storage items OR (listtype is standard items and flags 349 is on), then setup the UI to instruct how to operate multiple selection. - For each index in the visible part of the ItemList that does not exceed
maxoptions(this means an empty ItemList will have no iteration):- Setup the SpriteRenderer that will contain the option as child of the ItemList. A 75% opaque rectangle will be rendered as background if we aren't paused and the listtype isn't one about quests, settings, language list or input lists (color is green if it is in
multiselector white otherwise). The layer is set to 5, scaled by 1.15 in x when not paused and the position is relative to its index. - Set the default rendering param to send to SetText that can be overridden by listtype: x is -2, y is -0.15 and size is (0.75, 0.75).
- Obtain the text of the option according to listtype.
- Calls SetText in non Dialogue mode using the
BubblegumSansfont in non tridimensional at the position and size determined earlier without a Camoffset with the SpriteRenderer as the parent and without a caller with the text prepended with:
- Setup the SpriteRenderer that will contain the option as child of the ItemList. A 75% opaque rectangle will be rendered as background if we aren't paused and the listtype isn't one about quests, settings, language list or input lists (color is green if it is in
- If the ItemList isn't scrolled such that the bottom is visible:
- Setup the down arrow GUI sprite to appear at the bottom of the ItemList as child of the
ItemList. The exact setup depends on listtype and if we are in the pause menu.
- Setup the down arrow GUI sprite to appear at the bottom of the ItemList as child of the