Skip to content

global_data

anthony.samms edited this page May 28, 2026 · 1 revision

The global_data struct is used to store data that persists between scenes.

int songs_played

Counts the number of songs played since opening the game. This resets when reaching the config.

Config* config

This is the way to access the config options; this is initialized at main() runtime.

std::vector<int> hit_sound

This contains a vector of hitsound indexes per player.

std::vector<Modifiers> modifiers

This contains a vector of modifier options per player. Here are the supported modifiers:

  • auto_play: whether the chart plays automatically
  • speed: stored as an integer. Changes the speed of the chart
  • bool: whether the notes are displayed (doron)
  • inverse: change the color of the notes (abekobe)
  • random: randomize the color of the notes
    • 0: None
    • 1: 25% randomization rate (Kimagure)
    • 2: 50% randomization rate (Detarame)
  • subdiff: Sets the sub difficulty used for AI Battle and Enso Battle.
std::vector<SessionData> session_data = std::vector<SessionData>(3)

This contains a vector of session data information per player. In this case, a session is the time between song select, and the results screen. Here is what is stored in session data:

  • fs::path selected_song the path to the song loaded in the gameplay
  • std::string song_hash the hash for the song loaded in the gameplay
  • std::vector<DanSongEntry> the songs loaded in a dan course (dan mode only)
  • std::vector<Exam> selected_dan_exam the exam conditions for a dan course (dan mode only)
  • int dan_color the color of the dan plate (dan mode only)
  • int selected_difficulty the difficulty of the song loaded in gameplay
  • std::string song_title the string displayed as a title during transition between song select and gameplay
  • std::string song_subtitle the string displayed as a subtitle during transition between song select and gameplay
  • int genre_index the index of the genre displayed in the song info during gameplay
  • ResultData result_data the information transferred between gameplay and result
  • DanResultData dan_result_data the information transferred between dan gameplay and dan result
void reset_session();

Resets the modifiers and session data.

Clone this wiki locally