OpenTTD
Data Structures | Functions | Variables
highscore.h File Reference

Declaration of functions and types defined in highscore.h and highscore_gui.h. More...

#include "strings_type.h"
#include "company_type.h"
#include "settings_type.h"

Go to the source code of this file.

Data Structures

struct  HighScore

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 SaveHighScoreValue (const Company *c)
 Save the highscore for the company.
int8 SaveHighScoreValueNetwork ()
 Save the highscores in a network game when it has ended.
StringID EndGameGetPerformanceTitleFromValue (uint value)
void ShowHighscoreTable (int difficulty=SP_CUSTOM, int8 rank=-1)
 Show the highscore table for a given difficulty.

Variables

HighScore _highscore_table [SP_HIGHSCORE_END][5]
 various difficulty-settings; top 5

Detailed Description

Declaration of functions and types defined in highscore.h and highscore_gui.h.

Definition in file highscore.h.

Function Documentation

int8 SaveHighScoreValueNetwork ( )

Save the highscores in a network game when it has ended.

Returns
Position of the local company in the highscore list.

Definition at line 91 of file highscore.cpp.

References _local_company, HighScore::company, HighScoreSorter(), lastof, lengthof, MAX_COMPANIES, CompanyProperties::old_economy, CompanyEconomyEntry::performance_history, QSortT(), HighScore::score, SetDParam(), SP_MULTIPLAYER, and HighScore::title.

void ShowHighscoreTable ( int  difficulty,
int8  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 231 of file highscore_gui.cpp.

References DeleteWindowByClass(), and WC_HIGHSCORE.

Referenced by MenuClickLeague(), and SelectGameWindow::OnClick().