Update to 12.0-beta1
This commit is contained in:
@@ -64,7 +64,7 @@ struct EndGameHighScoreBaseWindow : Window {
|
||||
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
{
|
||||
delete this;
|
||||
this->Close();
|
||||
}
|
||||
|
||||
EventState OnKeyPress(WChar key, uint16 keycode) override
|
||||
@@ -79,7 +79,7 @@ struct EndGameHighScoreBaseWindow : Window {
|
||||
case WKC_RETURN:
|
||||
case WKC_ESC:
|
||||
case WKC_SPACE:
|
||||
delete this;
|
||||
this->Close();
|
||||
return ES_HANDLED;
|
||||
|
||||
default:
|
||||
@@ -122,10 +122,11 @@ struct EndGameWindow : EndGameHighScoreBaseWindow {
|
||||
MarkWholeScreenDirty();
|
||||
}
|
||||
|
||||
~EndGameWindow()
|
||||
void Close() override
|
||||
{
|
||||
if (!_networking) DoCommandP(0, PM_PAUSED_NORMAL, 0, CMD_PAUSE); // unpause
|
||||
ShowHighscoreTable(this->window_number, this->rank);
|
||||
this->EndGameHighScoreBaseWindow::Close();
|
||||
}
|
||||
|
||||
void OnPaint() override
|
||||
@@ -169,11 +170,13 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow {
|
||||
this->rank = ranking;
|
||||
}
|
||||
|
||||
~HighScoreWindow()
|
||||
void Close() override
|
||||
{
|
||||
if (_game_mode != GM_MENU) ShowVitalWindows();
|
||||
|
||||
if (!_networking && !this->game_paused_by_player) DoCommandP(0, PM_PAUSED_NORMAL, 0, CMD_PAUSE); // unpause
|
||||
|
||||
this->EndGameHighScoreBaseWindow::Close();
|
||||
}
|
||||
|
||||
void OnPaint() override
|
||||
@@ -205,7 +208,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow {
|
||||
};
|
||||
|
||||
static const NWidgetPart _nested_highscore_widgets[] = {
|
||||
NWidget(WWT_PANEL, COLOUR_BROWN, WID_H_BACKGROUND), SetMinimalSize(641, 481), SetResize(1, 1), EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_BROWN, WID_H_BACKGROUND), SetResize(1, 1), EndContainer(),
|
||||
};
|
||||
|
||||
static WindowDesc _highscore_desc(
|
||||
@@ -229,7 +232,7 @@ static WindowDesc _endgame_desc(
|
||||
*/
|
||||
void ShowHighscoreTable(int difficulty, int8 ranking)
|
||||
{
|
||||
DeleteWindowByClass(WC_HIGHSCORE);
|
||||
CloseWindowByClass(WC_HIGHSCORE);
|
||||
new HighScoreWindow(&_highscore_desc, difficulty, ranking);
|
||||
}
|
||||
|
||||
@@ -243,6 +246,6 @@ void ShowEndGameChart()
|
||||
if (_network_dedicated || (!_networking && !Company::IsValidID(_local_company))) return;
|
||||
|
||||
HideVitalWindows();
|
||||
DeleteWindowByClass(WC_ENDSCREEN);
|
||||
CloseWindowByClass(WC_ENDSCREEN);
|
||||
new EndGameWindow(&_endgame_desc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user