Jazz2::UI::Menu::HighscoresSection class

Highscores menu section.

Displays the saved highscore tables per series and lets the player enter a name when a completed run qualifies for a new entry. Built on top of WidgetSection with each entry drawn through a CanvasWidget; the series switching, inline name entry and serialization are driven by the section.

Base classes

class WidgetSection
Base class of a declarative menu section.

Public static functions

static auto TryGetSeriesIndex(StringView episodeName, bool playerDied) -> std::int32_t
Returns the highscore series index for the specified episode, or -1 if it has none.

Constructors, destructors, conversion operators

HighscoresSection()
Creates a new instance.
HighscoresSection(std::int32_t seriesIndex, GameDifficulty difficulty, bool isReforged, bool cheatsUsed, std::uint64_t elapsedMilliseconds, const PlayerCarryOver& itemToAdd)
Creates a new instance and adds a new highscore from a completed run.

Public functions

void OnShow(IMenuContainer* root) override
Called when the section is shown.
void OnUpdate(float timeMult) override
Called when the section should be updated.
void OnDraw(Canvas* canvas) override
Called when the section should be drawn — the bottom background layer.
void OnDrawOverlay(Canvas* canvas) override
Called when the section should be drawn — the top overlay layer.
void OnKeyPressed(const nCine::KeyboardEvent& event) override
Called when a key is pressed.
void OnTextInput(const nCine::TextInputEvent& event) override
Called when a text input is detected.
void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override
Called when a touch event is triggered.
auto GetNavigationFlags() const -> NavigationFlags override
Allows to override navigation behavior.

Protected functions

void OnBackPressed() override
Called when the back button is pressed; leaves the section by default.

Function documentation

Jazz2::UI::Menu::HighscoresSection::HighscoresSection(std::int32_t seriesIndex, GameDifficulty difficulty, bool isReforged, bool cheatsUsed, std::uint64_t elapsedMilliseconds, const PlayerCarryOver& itemToAdd)

Creates a new instance and adds a new highscore from a completed run.

Parameters
seriesIndex Index of the highscore series the new item belongs to
difficulty Difficulty the run was played on
isReforged Whether the run used the Reforged ruleset
cheatsUsed Whether any cheats were used during the run
elapsedMilliseconds Total time spent playing the run
itemToAdd Player state carried over from the completed run