OpenTTD Source: src/highscore.h File Reference

OpenTTD Source 1.11.0-RC1

Data Structures | Functions | Variables
highscore.h File Reference
`#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. More...
StringID | EndGameGetPerformanceTitleFromValue (uint value)
void | ShowHighscoreTable (int difficulty=SP_CUSTOM, int8 rank=-1)
| Show the highscore table for a given difficulty. More...

## 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

## ◆ SaveHighScoreValueNetwork()

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 88 of file highscore.cpp.

References _highscore_table, HighScoreSorter(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Iterate(), lengthof, MAX_COMPANIES, SetDParam(), and SP_MULTIPLAYER.

## ◆ ShowHighscoreTable()

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 230 of file highscore_gui.cpp.

References DeleteWindowByClass(), and WC_HIGHSCORE.