|
OpenTTD Source 20251116-master-g21329071df
|
Definition of the HighScore and EndGame windows. More...
#include "stdafx.h"#include "highscore.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 "table/strings.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. | |
| void | ShowEndGameChart () |
| Show the endgame victory screen in 2050. | |
Variables | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_highscore_widgets |
| static WindowDesc | _highscore_desc (WDP_MANUAL, {}, 0, 0, WC_HIGHSCORE, WC_NONE, {}, _nested_highscore_widgets) |
| static WindowDesc | _endgame_desc (WDP_MANUAL, {}, 0, 0, WC_ENDSCREEN, WC_NONE, {}, _nested_highscore_widgets) |
| static const 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 253 of file highscore_gui.cpp.
References _local_company, _network_dedicated, _networking, CloseWindowByClass(), HideVitalWindows(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::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 243 of file highscore_gui.cpp.
References CloseWindowByClass(), and WC_HIGHSCORE.
Referenced by EndGameWindow::Close(), MenuClickGraphsOrLeague(), and SelectGameWindow::OnClick().
|
staticconstexpr |
Definition at line 220 of file highscore_gui.cpp.