-
Notifications
You must be signed in to change notification settings - Fork 6
dan_select
The dan select screen lets the player browse and choose a dan (ranking) challenge course. It uses the skin name "dan_select". Course entries are managed by a local DanNavigator helper class.
Manages the list of DanBox entries displayed on screen.
| Member | Type | Description |
|---|---|---|
boxes |
vector<unique_ptr<DanBox>> |
All loaded dan course boxes |
selected_index |
int |
Index of the currently focused course |
| Constant | Value | Description |
|---|---|---|
BOX_CENTER |
594 |
X position of the centre (focused) box |
BASE_SPACING |
150 |
Pixel spacing between adjacent boxes |
SIDE_OFFSET_L |
200 |
Additional left offset for non-centred boxes |
SIDE_OFFSET_R |
500 |
Additional right offset for non-centred boxes |
void init(const vector<fs::path>& song_paths);Loads a DanBox from each .json file found in song_paths, then calls set_positions(true, 0) to arrange them.
void move_left();
void move_right();Decrement or increment selected_index (clamped) and animate all boxes to their new positions.
void skip(int delta);Jump selected_index by delta and re-position all boxes.
DanBox* get_current();Returns a pointer to the currently selected DanBox.
void update(double current_ms);
void draw();Forward to each DanBox.
Inherits from Screen. Constructed with the name "dan_select".
| Member | Type | Description |
|---|---|---|
dan_navigator |
DanNavigator |
Manages course boxes |
coin_overlay |
CoinOverlay |
Global coin/free-play display |
allnet_indicator |
AllNetIcon |
Online connectivity indicator |
indicator |
unique_ptr<Indicator> |
Input prompt displayed to the player |
state |
SongSelectState |
BROWSING while navigating, SONG_SELECTED after confirming a course |
is_confirmed |
bool |
Set to true once the player has committed to a course |
confirm_fade |
FadeAnimation* |
Fade overlay drawn on confirmation before transitioning |
last_moved |
double |
Timestamp of the last navigation input; used to debounce |
void on_screen_start() override;Calls Screen::on_screen_start(), then initialises dan_navigator with the configured dan song paths and sets up the Indicator.
Screens on_screen_end(Screens next_screen) override;Delegates to Screen::on_screen_end, which unloads all skin assets.
std::optional<Screens> update() override;Each frame:
- Calls
Screen::update(). - Routes input to
handle_input_browsing()orhandle_input_selected()based onstate. - Updates
dan_navigator,indicator,coin_overlay, andallnet_indicator. - When
confirm_fadefinishes, loads the selected course intoSessionDataand returnsScreens::GAME_DAN.
Returns std::nullopt while the screen is active.
void handle_input_browsing(double current_ms);Left/right inputs navigate dan_navigator. A don press or confirm input sets state = SONG_SELECTED and calls handle_input_selected() immediately.
void handle_input_selected();A don press sets is_confirmed = true and starts confirm_fade. The back key resets state to BROWSING. Pressing back from BROWSING returns Screens::SONG_SELECT.
void draw() override;Renders in this order:
-
dan_navigator.draw()— all course boxes. -
draw_confirm_overlay()— the confirmation fade whenis_confirmedis true. -
indicator,coin_overlay, andallnet_indicator.
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