-
Notifications
You must be signed in to change notification settings - Fork 6
result
The result screen displays a player's performance summary after a song ends. There are three variants: ResultScreen (single player), Result2PScreen (two-player), and DanResultScreen (dan/ranking challenge mode). All three are constructed with a screen name that the base Screen class uses to load the correct skin textures and sounds.
The single-player result screen. Inherits from Screen. Constructed with the name "result".
| Member | Type | Description |
|---|---|---|
song_info |
unique_ptr<OutlinedText> |
Outlined text displaying the song title |
fade_out |
FadeAnimation* |
Fade-to-black animation played when exiting the screen |
allnet_indicator |
AllNetIcon |
Online connectivity indicator |
coin_overlay |
CoinOverlay |
Global coin display |
background |
optional<ResultBackground> |
Tiled background graphic; absent when a custom Loading.png is present |
loading_graphic |
optional<ray::Texture2D> |
Song-specific Loading.png used as a full-screen background when present |
start_ms |
double |
Timestamp (ms) when the screen started; used to gate input for 5 seconds |
skipped_time |
double |
Timestamp of the first skip press; a second press 5 s later triggers exit |
player_1 |
optional<ResultPlayer> |
The player's score display object |
fade_in |
optional<FadeIn> |
Entry fade-in animation drawn over the background |
song_num |
unique_ptr<SongNum> |
Song-count display |
void on_screen_start() override;Calls Screen::on_screen_start(), starts BGM, initialises animations, and creates all member objects. If a Loading.png file exists next to the selected song, it is loaded as a full-screen texture instead of ResultBackground.
Screens on_screen_end(Screens next_screen) override;Unloads loading_graphic if present, resets the session with reset_session(), then delegates to Screen::on_screen_end.
std::optional<Screens> update() override;Each frame:
- Calls
Screen::update(). - Advances
fade_inandplayer_1. - After 5 seconds, begins accepting input via
handle_input(). - When
fade_outfinishes, exits toScreens::GAME_OVERif the configured song limit has been reached; otherwise returns toScreens::SONG_SELECT.
Returns std::nullopt while the screen is still running.
void handle_input(); // protectedRequires the fade-in to have finished before accepting any input. The first don press records skipped_time. A second press at least 5 s after skipped_time starts fade_out.
void draw() override;Renders in this order:
-
background->draw()or theloading_graphicstretched to fill the screen. -
draw_song_info()— song number and title. -
player_1->draw(). -
draw_overlay()— fade-in panel, fade-out black rectangle, coin overlay, allnet indicator.
Two-player result screen. Inherits from ResultScreen. Constructed with the same "result" name so it shares the single-player skin.
| Member | Type | Description |
|---|---|---|
player_2 |
optional<ResultPlayer> |
Score display for player 2 (2P) |
-
on_screen_start()calls the parent, then discards anyloading_graphicand always constructsResultBackgroundwithPlayerNum::TWO_PLAYER.player_1is rebuilt withhas_2p = true, andplayer_2is created withis_2p = true. -
update()advances bothplayer_1andplayer_2together. Always exits toScreens::SONG_SELECT_2P. -
draw()draws both players sequentially afterbackground.
Dan-mode result screen. Inherits from Screen. Constructed with the name "dan_result". Displays two pages: a per-song breakdown (page 1) and a cumulative summary with exam results and pass/fail verdict (page 2).
| Member | Type | Description |
|---|---|---|
allnet_indicator |
AllNetIcon |
Online connectivity indicator |
coin_overlay |
CoinOverlay |
Global coin display |
fade_out |
FadeAnimation* |
Fade-to-black when exiting |
page2_fade |
FadeAnimation* |
Fade animation that reveals page 2 |
background |
optional<ResultBackground> |
Background drawn with PlayerNum::DAN
|
gauge |
unique_ptr<ResultGauge> |
Dan gauge (currently disabled in source) |
hori_name |
unique_ptr<OutlinedText> |
Outlined text of the dan course title |
song_names |
vector<unique_ptr<OutlinedText>> |
Outlined text for each song in the dan course |
is_page2 |
bool |
Whether the screen is showing page 2 |
void on_screen_start() override;Starts BGM, grabs both fade animations, creates the background, and builds hori_name and song_names from the session's dan_result_data.
Screens on_screen_end(Screens next_screen) override;Calls reset_session(), then delegates to Screen::on_screen_end. Always returns Screens::DAN_SELECT.
std::optional<Screens> update() override;Calls handle_input() every frame (input is always active on this screen). Advances both fade animations. Returns to Screens::DAN_SELECT when fade_out completes.
void handle_input(); // privateA don press on the first page starts page2_fade and sets is_page2 = true. A don press on the second page starts fade_out.
void draw() override;Renders in this order:
-
background->draw(). -
draw_page1()— always visible. -
draw_page2(page2_fade->attribute)— fades in over page 1 whenpage2_fadeis running. - Black rectangle keyed to
fade_out->attribute. -
coin_overlayandallnet_indicator.
Iterates over each DanResultSong in the session. For each song it draws:
- Genre banner.
- Song name (right-aligned outlined text).
- Song number, difficulty badge, difficulty star/× symbols, and difficulty level digits.
- Good, OK, Bad, and drumroll counters drawn using the
RESULT_INFO::COUNTERtexture.
Draws the full-page summary: background panels, column dividers, pull-out graphic, and the dan emblem. Shows totals for Good, OK, Bad, drumroll, max combo, and total hit count across all songs. Also shows the score box and calls draw_exam_info().
After computing exam results it draws one of three verdict textures:
-
EXAM_INFO::FAIL— any exam failed. -
EXAM_INFO::GOLD_CLEAR— all exams passed and all reached the gold threshold. -
EXAM_INFO::RED_CLEAR— all exams passed but at least one did not reach gold.
Renders each exam row: background panel, progress bar (red/gold/max texture chosen from DanResultExam.bar_texture), exam-type icon, required value, comparison operator (more/less), current value, and a FAILED overlay when the exam was not passed.
Building
libs
- animation
- audio
- config
- filesystem
- global_data
- input
- logging
- ray
- scores
- screen
- script
- song_parser
- text
- texture
- video
- webcam
libs/parsers
objects
objects/game
- player
- background
- gauge
- judgment
- combo
- branch_indicator
- ending_animations
- gogo_time
- fireworks
- song_info
- transition
- result_transition
- judge_counter
- score_counter
- score_counter_animation
- balloon_counter
- drumroll_counter
- kusudama_counter
- drum_hit_effect
- lane_hit_effect
- gauge_hit_effect
- combo_announce
- note_arc
objects/global
objects/title
objects/entry
objects/settings
objects/result
objects/song_select
- player
- navigator
- box_base
- box_song
- box_folder
- neiro
- modifier
- ura_switch
- diff_sort
- search_box
- dan_transition
- genre_bg
- score_history
- song_select_script
scenes