Rerendering after scroll

  • Sets listy to listlow to indicate the list has been scrolled.
  • If this is a new ItemList, Initializes the static fields: listmax to listammount, listlow to 0, option to 0, listcursor to 0, inlist to 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 questboardobj if 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 listvar prepended with |color,4||center||sort,20|. This effectively changes the line to match the selected language.
  • If listlow is above 0 and maxoptions is higher than listammount (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 listsell is 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 multiselect or 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 BubblegumSans font 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:
      • |size,0.6,0.8| when unpaused
      • Nothing if paused and listtype is not the current medals list
      • otherwise.
  • 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.