PokéRogue
    Preparing search index...

    Generic handler for a menu with several options to choose from with a cursor.

    Given the proper OptionSelectModeConfig the handler will:

    • Measure the size of all elements in the menu, including the size of any icon.
    • Apply the required BBCode if an elements asks for a specific color.
    • Create the window of the appropriate size to hold all elements.
    • Handle scrolling through the menu items, resizing as needed.
    • Handle selecting the menu items, or cancelling out of the menu.

    At initialization the size of the first NUM_PRE_COMPUTED_OPTIONS is measured.
    Then the window's size is updated as needed when a non initialized option needs to be displayed.

    Hierarchy (View Summary)

    Index
    active: boolean = false
    appVersionText: Text
    awaitingActionInput: boolean
    blockInput: boolean
    cursor: number = 0
    cursorObj: Image | null
    eventDisplay: TimedEventDisplay
    fullyInitialized: boolean
    message: Text
    mode: UiMode

    Used to set the name of optionSelectContainer

    nameBoxContainer?: Container

    The container for the name box

    This will be undefined unless this.initNameBox() was called

    onActionInput: AnyFn<any> | null
    optionSelectBg: NineSlice
    optionSelectContainer: Container
    optionSelectIcons: Sprite[] = []
    optionSelectText: BBCodeText
    pendingPrompt: boolean = false
    playerCountLabel: Text
    prompt: Sprite
    scale: number = 0.1666666667
    scrollBar: ScrollBar | null
    scrollCursor: number = 0
    splashMessage: string
    splashMessageText: Text
    textCallbackTimer: TimerEvent | null
    textTimer: TimerEvent | null
    titleContainer: Container
    titleStatsTimer: Timeout | null
    tutorialActive: boolean = false
    tutorialOverlay: Rectangle
    usernameLabel: Text
    wordWrapWidth: number = 1780
    • Returns string

      The username of the logged in user, or the trainer name (based on currently selected gender) if the "Hide Username" setting is enabled

    • Add the name box shown by showDialogue to the given message container.

      Parameters

      • container: Container

        The container holding the message text

      • x: number = 0

        The x position of the name box

      • y: number = -16

        The y position of the name box

      Returns void

      If this method is not called, the name box will not be displayed.

    • Parameters

      • text: string
      • Optionalname: string
      • Optionaldelay: number | null
      • Optionalcallback: (() => void) | null
      • OptionalcallbackDelay: number | null
      • Optionalprompt: boolean | null
      • OptionalpromptDelay: number | null

      Returns void

    • Parameters

      • text: string
      • Optionaldelay: number | null
      • Optionalcallback: (() => void) | null
      • OptionalcallbackDelay: number | null
      • Optionalprompt: boolean | null
      • OptionalpromptDelay: number | null

      Returns void