OpenTTD Source
20241109-master-g5e4f8db7d6
|
Declaration of functions and types defined in highscore.h and highscore_gui.h. More...
Go to the source code of this file.
Data Structures | |
struct | HighScore |
Typedefs | |
using | HighScores = std::array< HighScore, 5 > |
Record 5 high scores. | |
using | HighScoresTable = std::array< HighScores, SP_HIGHSCORE_END > |
Record high score for each of the difficulty levels. | |
Functions | |
void | SaveToHighScore () |
Save HighScore table to file. | |
void | LoadFromHighScore () |
Initialize the highscore table to 0 and if any file exists, load in values. | |
int8_t | SaveHighScoreValue (const Company *c) |
Save the highscore for the company. More... | |
int8_t | SaveHighScoreValueNetwork () |
Save the highscores in a network game when it has ended. More... | |
StringID | EndGameGetPerformanceTitleFromValue (uint value) |
void | ShowHighscoreTable (int difficulty=SP_CUSTOM, int8_t rank=-1) |
Show the highscore table for a given difficulty. More... | |
Variables | |
HighScoresTable | _highscore_table |
Table with all the high scores. | |
Declaration of functions and types defined in highscore.h and highscore_gui.h.
Definition in file highscore.h.
int8_t SaveHighScoreValue | ( | const Company * | c | ) |
Save the highscore for the company.
c | The company to insert. |
Definition at line 57 of file highscore.cpp.
References _highscore_table, and SP_CUSTOM.
int8_t SaveHighScoreValueNetwork | ( | ) |
Save the highscores in a network game when it has ended.
Definition at line 89 of file highscore.cpp.
References _highscore_table, GetString(), HighScoreSorter(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Iterate(), MAX_COMPANIES, CompanyProperties::old_economy, CompanyEconomyEntry::performance_history, SetDParam(), and SP_MULTIPLAYER.
void ShowHighscoreTable | ( | int | difficulty, |
int8_t | ranking | ||
) |
Show the highscore table for a given difficulty.
When called from endgame ranking is set to the top5 element that was newly added and is thus highlighted
Definition at line 236 of file highscore_gui.cpp.
References CloseWindowByClass(), and WC_HIGHSCORE.