Skip to content

box_manager

Anthony Samms edited this page Jun 2, 2026 · 1 revision

The BoxManager owns and drives the four-item mode carousel on the entry screen. It handles left/right navigation, the selection fade-out animation, and the special costume-menu open state. In 2P mode it swaps the Song Select destination to its two-player variant.

BoxLocation

An enum identifying each box's destination.

Value Description
SONG_SELECT Proceeds to the 1P song select screen
SONG_SELECT_2P Proceeds to the 2P song select screen (active when both players have joined)
PRACTICE_SELECT Proceeds to the practice mode song select screen
ENTRY Opens the costume menu (does not leave the entry screen)
SETTINGS Proceeds to the settings screen

BoxManager

BoxManager();

Creates four Box objects — Game, Practice, Costume, and Settings — with OutlinedText labels in the configured language. Calculates centred carousel positions so boxes are evenly spaced across the screen.

Members

Member Type Description
boxes array<Box, 4> The four mode boxes
selected_index int Index of the currently highlighted box
costume_open bool Whether the costume menu is currently open

Navigation

void move_left();
void move_right();

Shift the carousel one position in either direction, triggering the slide animation on all boxes. Blocked while any box is already animating.

void select();

Marks the current box as selected and starts its fade-out animation. If the selected box is the Costume box, sets costume_open rather than routing to a new screen.

BoxLocation get_selected_location() const;

Returns the BoxLocation for the currently highlighted box, accounting for 2P mode substitution.

Update and Draw

void update(double current_time);

Advances all box slide and fade animations.

void draw();

Draws all four boxes. The highlighted box is drawn with left/right extension highlights; other boxes are drawn normally.

Clone this wiki locally