OpenTTD Source
20241121-master-g67a0fccfad
|
Definition of the HighScore and EndGame windows. More...
#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 (WDP_MANUAL, nullptr, 0, 0, WC_HIGHSCORE, WC_NONE, 0, _nested_highscore_widgets) |
static WindowDesc | _endgame_desc (WDP_MANUAL, nullptr, 0, 0, WC_ENDSCREEN, WC_NONE, 0, _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();} }) |
Definition of the HighScore and EndGame windows.
Definition in file highscore_gui.cpp.
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.
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.
|
staticconstexpr |
Definition at line 213 of file highscore_gui.cpp.