OpenTTD Source: src/highscore_gui.cpp File Reference

OpenTTD Source 14.1

Data Structures | Functions | Variables
highscore_gui.cpp File Reference
`#include "stdafx.h"`
`#include "highscore.h"`
`#include "table/strings.h"`
`#include "gfx_func.h"`
`#include "table/sprites.h"`
`#include "window_gui.h"`
`#include "window_func.h"`
`#include "network/network.h"`
`#include "command_func.h"`
`#include "company_func.h"`
`#include "company_base.h"`
`#include "strings_func.h"`
`#include "hotkeys.h"`
`#include "zoom_func.h"`
`#include "misc_cmd.h"`
`#include "timer/timer.h"`
`#include "timer/timer_game_calendar.h"`
`#include "widgets/highscore_widget.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | EndGameHighScoreBaseWindow
struct | EndGameWindow
| End game window shown at the end of the game. More...
struct | HighScoreWindow

## Functions
void | ShowHighscoreTable (int difficulty, int8_t ranking)
| Show the highscore table for a given difficulty. More...
void | ShowEndGameChart ()
| Show the endgame victory screen in 2050. More...

## Variables
static constexpr NWidgetPart | _nested_highscore_widgets []
static WindowDesc | _highscore_desc (__FILE__, __LINE__, WDP_MANUAL, nullptr, 0, 0, WC_HIGHSCORE, WC_NONE, 0, std::begin(_nested_highscore_widgets), std::end(_nested_highscore_widgets))
static WindowDesc | _endgame_desc (__FILE__, __LINE__, WDP_MANUAL, nullptr, 0, 0, WC_ENDSCREEN, WC_NONE, 0, std::begin(_nested_highscore_widgets), std::end(_nested_highscore_widgets))
static IntervalTimer< TimerGameCalendar > | _check_end_game ({TimerGameCalendar::YEAR, TimerGameCalendar::Priority::NONE}, [](auto) { if(_settings_game.game_creation.ending_year==0) return;if(TimerGameCalendar::year==_settings_game.game_creation.ending_year+1) { ShowEndGameChart();} })

## Detailed Description

Definition of the HighScore and EndGame windows

Definition in file highscore_gui.cpp.

## Function Documentation

## ◆ ShowEndGameChart()

void ShowEndGameChart | ( |  | ) |

Show the endgame victory screen in 2050.

Update the new highscore if it was high enough

Definition at line 246 of file highscore_gui.cpp.

References _local_company, _network_dedicated, _networking, CloseWindowByClass(), HideVitalWindows(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), and WC_ENDSCREEN.

## ◆ ShowHighscoreTable()

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.

## Variable Documentation

## ◆ _nested_highscore_widgets

constexpr NWidgetPart _nested_highscore_widgets[]
| staticconstexpr

Initial value:
= {
NWidget(WWT_PANEL, COLOUR_BROWN, WID_H_BACKGROUND), SetResize(1, 1), EndContainer(),
}

Definition at line 213 of file highscore_gui.cpp.

WID_H_BACKGROUND
@ WID_H_BACKGROUND
Background of the window.
Definition: highscore_widget.h:15
EndContainer
constexpr NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
Definition: widget_type.h:1153
SetResize
constexpr NWidgetPart SetResize(int16_t dx, int16_t dy)
Widget part function for setting the resize step.
Definition: widget_type.h:1088
NWidget
constexpr NWidgetPart NWidget(WidgetType tp, Colours col, WidgetID idx=-1)
Widget part function for starting a new 'real' widget.
Definition: widget_type.h:1260
WWT_PANEL
@ WWT_PANEL
Simple depressed panel.
Definition: widget_type.h:52