Skip to content

Add global statistics screen#3818

Open
franciscogfsm wants to merge 1 commit into
SuperTux:masterfrom
franciscogfsm:feature/global-stats-screen
Open

Add global statistics screen#3818
franciscogfsm wants to merge 1 commit into
SuperTux:masterfrom
franciscogfsm:feature/global-stats-screen

Conversation

@franciscogfsm

Copy link
Copy Markdown
Contributor

This pull request introduces a new global statistics feature to SuperTux, allowing players to view aggregated statistics across all worlds and levels. The implementation includes new classes for statistics management, updates to the main menu, and localization support for new UI elements. It also refactors how level completion statistics are tracked and saved.

Global Statistics Feature:

  • Added a new GlobalStatsManager class to aggregate and provide summary statistics (coins, secrets, dolls, levels, time, etc.) across all worlds and levels. (src/supertux/global_stats_manager.cpp, src/supertux/global_stats_manager.hpp) [1] [2]
  • Introduced a new GlobalStatsMenu and GlobalStatsScreen, accessible from the main menu, to display these aggregated statistics to the player. (src/supertux/menu/global_stats_menu.cpp, src/supertux/menu/global_stats_menu.hpp) [1] [2]
  • Updated the main menu to include a "Statistics" submenu linking to the new global statistics screen. (src/supertux/menu/main_menu.cpp, src/supertux/menu/main_menu.hpp, src/supertux/menu/menu_storage.cpp) [1] [2] [3]

Level Statistics Tracking Improvements:

  • Refactored LevelsetScreen to track and update best statistics (coins, tuxdolls, secrets, time, perfect completion) for each level, and save these in the player's savegame. (src/supertux/levelset_screen.cpp, src/supertux/levelset_screen.hpp, src/supertux/game_session.cpp) [1] [2] [3] [4] [5] [6] [7] [8] [9]

Localization:

  • Added new strings for the statistics feature to the message template and provided translations for Portuguese and Brazilian Portuguese. (data/locale/messages.pot, data/locale/pt.po, data/locale/pt_BR.po) [1] [2] [3]

Build System:

  • Updated the CMake configuration to include new source files for the statistics screen and menu. (CMakeLists.txt)

Implement a global statistics view with menu integration and
persisted aggregation for worldmap and levelset progress.
For example, coins collected in a completed level now appear
in the global totals instead of showing zero.

Co-authored-by: João Moura <joaofsmoura@tecnico.ulisboa.pt>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant