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
    awaitingActionInput: boolean
    bgmBar: BgmBar
    blockInput: boolean
    communityConfig: OptionSelectModeConfig
    cursor: number = 0
    cursorObj: Image | null
    dialogueMessageBox: NineSlice

    Message box used by the dialogue test option

    excludedMenus: () => ConditionalMenu[]
    fullyInitialized: boolean
    manageDataConfig: OptionSelectModeConfig
    menuContainer: Container
    menuMessageBox: NineSlice
    menuMessageBoxContainer: Container
    menuOverlay: Rectangle
    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
    prompt: Sprite
    scale: number = 0.1666666667
    scrollBar: ScrollBar | null
    scrollCursor: number = 0
    textCallbackTimer: TimerEvent | null
    textPadding: 8
    textTimer: TimerEvent | null
    tutorialActive: boolean = false
    tutorialOverlay: Rectangle
    wordWrapWidth: number = 1780
    • 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
      • Optionalcallback: () => void
      • OptionalcallbackDelay: number
      • Optionalprompt: boolean
      • OptionalpromptDelay: number

      Returns void

    • Toggles the visibility of the dialogue box used for testing text/translations.

      Parameters

      • show: boolean

        Whether to show the dialogue box

      Returns void

      In "dialog test mode", the window takes the whole width of the screen and the text
      is set up to wrap around the same way as the dialogue during the game