• RhythmGameQml
  • StandardSelectState
  • StandardSelectState QML Type

    Tracks browsing, focus and saved choices for a song selector. More...

    Import Statement: import RhythmGameQml
    Inherited By:

    StandardSelectController

    Properties

    Signals

    Methods

    Detailed Description

    Use StandardSelectController for a selector with standard input, shortcuts and audio. Use this component when you want the same browsing behavior with your own controls. It loads and sorts entries, remembers folder history, and opens charts, courses, replays and saved results.

    Connect browsing and focus

    The root folder opens automatically unless autoInitialize is false. Display entries and handle focusRequested to position your view. Call setFocused with the row's data when the user selects another row.

    Call goForward to open an entry, goBack to return through folder history, and exit to leave selection or its Arena room. openResult opens the correct screen for a saved chart or course score. An unsuccessful search leaves the current list in place.

    Save player choices

    sortMode, keymodeFilter and replayType follow the active profile. They are read-only: use setSortMode, setKeymodeFilter and setReplayType to save a choice. cycleSortMode and cycleReplayType advance through the choices. View options such as difficultyFilter do not change profile settings.

    openReplay chooses a recording using replayType. Bind a replay button's enabled state to replayAvailable. Use resultForReplayType when you need to choose a saved result without opening it.

    Read data as it arrives

    results contains cached score summaries. Use ScoreDetails for replay events or gauge history. Preview paths and folder clear statistics load asynchronously; bind to their properties to follow updates. The state refreshes them when it becomes enabled again or the main profile changes.

    The arrays and maps in entries, folderContents, historyStack, results and previewFiles are copies. Editing them does not change the controller. Objects inside them, such as charts, are shared.

    Property Documentation

    actions : alias [read-only]

    Shared play, saved-result and exit actions.


    autoInitialize : bool

    Controls whether construction automatically opens the root selection folder.


    autoplayAvailable : bool [read-only]

    Whether the focused chart or complete course supports standard autoplay.


    cycleReplayTypeAction : var

    Calls cycleReplayTypeAction() instead of cycling the profile's replay choice.


    difficultyFilter : int

    Additional difficulty filter for this view. Zero shows all difficulties. Does not save a profile choice.


    entries : var [read-only]

    Filtered and sorted entries before presentation adaptation. Entries can be folder-path strings, ChartData objects, or entry, table, level and course values. An entry value describes a table chart missing from the song database. The list is empty before initialization and when browsing or filtering produces no entries. It never adds presentation placeholders. See the entry type table in lesson 5.


    exitAction : alias

    Calls exitAction() in place of leaving selection.


    focusedIndex : int [read-only]

    Index of focusedItem in entries, or -1 when no entry is selected.


    focusedItem : var [read-only]

    Current entry used by selection actions. Updated by browsing or setFocused. Null when no entry is selected, including when the view shows a presentation placeholder.


    folderClearStatsEnabled : bool

    Controls whether per-folder clear-statistic loading is active.


    folderContents : var [read-only]

    Raw contents of the current folder, table, level, or search.


    historyStack : var [read-only]

    Navigation history for the current selection session.


    keymodeFilter : int [read-only]

    Active profile's SelectKeymodeFilter value. Change it with setKeymodeFilter. Single includes 5K and 7K; Double includes 10K and 14K. Folders, tables and courses remain visible.


    openSelectedFolderAction : var

    Calls openSelectedFolderAction() instead of opening the system file browser.


    openSettingsAction : var

    Calls openSettingsAction() instead of opening Settings.


    previewFiles : var [read-only]

    Preview-file data loaded for the current folder contents.


    previewFilesEnabled : bool

    Controls whether standard preview-file discovery is active.


    reloadAction : var

    Calls reloadAction() instead of reloading the current folder or table.


    replayAvailable : bool [read-only]

    Whether the standard replay action is available for the focused entry.


    replayOptions : var [read-only]

    Replay choices with stable value and translated text roles.


    replayResult : var [read-only]

    The saved run chosen for playback, or null if no usable recording is available.


    replayType : int [read-only]

    The active profile's replay choice: 0 for Newest, 1 for BestScore, 2 for BestClear and 3 for BestCombo. Change it with setReplayType or cycleReplayType. Named values such as StandardSelectState.BestScore can be used instead of numbers.


    replayTypeText : string [read-only]

    Optional translated label for the current replay choice.


    results : var [read-only]

    Map of chart MD5s and course identifiers to BmsResult or BmsResultCourse lists, newest first. Results contain no recordings or gauge histories. Use ScoreDetails to load one full score for statistics or graphs. Child folders and table levels use separate clear-statistic requests.


    sortMode : int [read-only]

    Active profile's sort choice. Change it with setSortMode() or cycleSortMode().


    sortModeText : string [read-only]

    Optional translated label for the current sort mode.


    sortModes : list<int>

    Modes listed in sortOptions and visited by cycleSortMode(). Does not restrict setSortMode().


    sortOptions : var [read-only]

    Sort choices in sortModes order, with stable value and translated text roles.


    tryAutoplayAction : var

    Calls tryAutoplayAction(). Return true when handled, or false for standard playback.


    tryCycleSortModeAction : var

    Calls tryCycleSortModeAction(delta). Return true when handled, or false to cycle normally.


    tryOpenPlayableAction : var

    Called as tryOpenPlayableAction(item,autoplay,replay,replayScore). Return true to handle the request, or false to continue with the standard action.


    tryReplayAction : var

    Called as tryReplayAction(type) before standard playback. Return true when handled, or false to use the standard action. Both buttons calling openReplay and bound replay input use this hook.


    unscoredItemsLast : bool

    Controls whether items without scores sort after scored items.


    Signal Documentation

    enteredFolder()

    Emitted after entering a selection-history item.

    Note: The corresponding handler is onEnteredFolder.


    focusRequested(int index)

    Requests that the theme make index in entries current in its view. The index is -1 when no entry is selected. focusedItem is already updated when this signal is emitted. The theme chooses how to position its list or wheel.

    Note: The corresponding handler is onFocusRequested.


    leftFolder()

    Emitted after leaving a selection-history item.

    Note: The corresponding handler is onLeftFolder.


    openedFolder()

    Emitted after a folder or table has been opened.

    Note: The corresponding handler is onOpenedFolder.


    Method Documentation

    cycleReplayType()

    Cycles newest, best score, best clear and best combo, or calls the replacement action.


    cycleSortMode(delta = 1)

    Moves through sortModes by the integer delta and saves the choice, or calls the custom action. Wraps at either end. Returns false when inactive or delta is not an integer. The default action also returns false if the list is empty or the next value is unsupported.


    exit()

    Leaves selection or its Arena room. Use goBack() for folder history.


    folderClearStatsFor(item)

    Returns loaded clear statistics for folder-like item, or null.


    goBack()

    Leaves the current history entry. Returns whether navigation occurred.


    goForward(item)

    Opens item as a folder or playable item.


    initialize()

    Initializes history from the configured song folders and tables.


    isChartItem(item)

    Returns true when item is an installed ChartData or a missing table entry. This identifies chart-like rows; it does not guarantee they can play.


    openAutoplay()

    Starts autoplay for the focused chart or course, or calls the custom action.


    openChartDirectory(directory, initialItem)

    Opens directory and initially focuses initialItem.


    openPlayable(item, autoplay = false, replay = false, replayScore = null)

    Opens chart or course item with the requested autoplay, replay and replayScore options. See StandardSelectActions::openPlayable for the score types and return-value contract.


    openReplay(type = replayType)

    Opens the focused entry's replay using type, which defaults to replayType. Returns false when no usable recording is available. Replay playback uses the main profile alone, even in battle mode. Arena and inactive screens cannot start replay playback.


    openResult(item, score)

    Opens the saved score for the chart or course item. Both arguments are required. See StandardSelectActions::openResult for accepted score types and loading behavior.


    openSelectedFolder()

    Opens the focused chart's directory in the system file browser.


    openSelectedReadme()

    Opens the README associated with the focused item, if one exists.


    openSettings()

    Opens Settings, or calls the replacement action.


    refresh()

    Refreshes preview paths and folder clear statistics. To reload the folder's entries or request a library scan, use reloadCurrentFolderOrTable.


    reloadCurrentFolderOrTable()

    Reloads the current local folder or online table.


    resultForReplayType(type = replayType, requireReplayData = true)

    Returns a saved run for the focused chart or course using type. Defaults to replayType. When requireReplayData is true, ignores runs without recordings and courses without a recording for every stage. Pass false when choosing a saved result to display. Best score compares points divided by maximum points. Ties use the newer run.


    search(query)

    Searches for query and returns the number of matches before view filtering. With matches, replaces the list and records the search in history. With no matches, returns zero and keeps the current list.


    setFocused(item)

    Records item from entries as focusedItem after the theme changes its current entry. Pass the row's data, not its QML delegate. Repeated rows in StandardSelectController::presentationEntries refer to the same entries and can be selected normally. Passing null or an item outside entries clears the selection. focusedItem becomes null and focusedIndex becomes -1.


    setKeymodeFilter(filter)

    Saves filter in the active profile and updates keymodeFilter. Returns false for an unknown value or inactive screen, without changing the choice.


    setReplayType(type)

    Saves type in the active profile and updates replayType. Returns false for an unknown value or inactive screen, without changing the choice. Use cycleReplayType to advance to the next option and wrap at the end.


    setSortMode(mode)

    Saves mode in the active profile and updates sortMode. Accepts any supported SelectSortMode value, regardless of sortModes. Returns false for an unknown value or inactive screen, without changing the choice.


    showAllChartsForCurrentSong()

    Shows every chart that belongs to the currently focused song.