Skip to content

costume_menu

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

The CostumeMenu lets a player customise their character appearance from the entry screen. It operates in two stages: first the player selects a menu item (costume slot, default, head/body toggle, presets, or random), then — if the item requires it — they scroll through available costume icons.

CostumeMenuItem

An enum for the items in the menu list.

Value Description
COSTUME Opens the icon carousel to pick a specific costume
DEFAULT Resets the character to the default appearance
HEAD_BODY Toggles independent head/body costume selection
PRESET_1 Applies saved preset 1
PRESET_2 Applies saved preset 2
PRESET_3 Applies saved preset 3
RANDOM_ITEM Picks a random costume from the available icons

CostumeMenu

CostumeMenu(PlayerNum player_num, bool is_2p);

Loads all costume icon PNG files from Models/costume_icon/ in the active skin, initialises the blue-arrow fade and move animations, and sets the initial selected index to COSTUME.

Members

Member Type Description
player_num PlayerNum Which player this menu belongs to
is_2p bool Draws the 2P-side box variant when true
selected_index int Currently highlighted menu item (0–6)
icon_index int Currently centred costume icon in the icon carousel
in_icon_select bool Whether the player is in the second stage (icon carousel)
confirmed bool Set to true once the player finalises a selection
icons vector<Texture> Loaded costume icon textures
arrow_fade_anim Animation* Opacity pulse on the blue selection arrow
arrow_move_anim Animation* Vertical bounce of the blue selection arrow

Input Handling

bool handle_input();

In menu-item stage: up/down moves selected_index; Don confirms the item and either sets confirmed (for DEFAULT, HEAD_BODY, PRESET_*, RANDOM_ITEM) or enters icon-select stage (for COSTUME). Kat cancels and closes the menu.

In icon-select stage: left/right scrolls icon_index through the available icons using modulo arithmetic; Don confirms the selection, saves the costume to config, triggers the character animation, and sets confirmed; Kat returns to the menu-item stage.

Returns true when the menu should be closed (confirmed or cancelled).

Update

void update(double current_time);

Advances the arrow_fade_anim and arrow_move_anim.

Draw

void draw();

In menu-item stage: draws the menu box (1P or 2P variant), a five-item visible window of the seven menu items centred on selected_index, and the blue arrow with its fade and bounce animations.

In icon-select stage: draws the icon carousel with five icons visible, the centre icon highlighted, and animated scrolling as icon_index changes.

Clone this wiki locally