|
@@ -61,13 +61,13 @@ struct EndGameHighScoreBaseWindow : Wind
|
|
|
Point pt = {std::max(0, (_screen.width / 2) - (x / 2)), std::max(0, (_screen.height / 2) - (y / 2))};
|
|
|
return pt;
|
|
|
}
|
|
|
|
|
|
void OnClick(Point pt, int widget, int click_count) override
|
|
|
{
|
|
|
delete this;
|
|
|
this->Close();
|
|
|
}
|
|
|
|
|
|
EventState OnKeyPress(WChar key, uint16 keycode) override
|
|
|
{
|
|
|
/* All keys are 'handled' by this window but we want to make
|
|
|
* sure that 'quit' still works correctly. Not handling the
|
|
@@ -76,13 +76,13 @@ struct EndGameHighScoreBaseWindow : Wind
|
|
|
|
|
|
switch (keycode) {
|
|
|
/* Keys for telling we want to go on */
|
|
|
case WKC_RETURN:
|
|
|
case WKC_ESC:
|
|
|
case WKC_SPACE:
|
|
|
delete this;
|
|
|
this->Close();
|
|
|
return ES_HANDLED;
|
|
|
|
|
|
default:
|
|
|
/* We want to handle all keys; we don't want windows in
|
|
|
* the background to open. Especially the ones that do
|
|
|
* locate themselves based on the status-/toolbars. */
|
|
@@ -119,16 +119,17 @@ struct EndGameWindow : EndGameHighScoreB
|
|
|
this->rank = SaveHighScoreValue(c);
|
|
|
}
|
|
|
|
|
|
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
|
|
|
{
|
|
|
this->SetupHighScoreEndWindow();
|
|
|
Point pt = this->GetTopLeft(ScaleGUITrad(640), ScaleGUITrad(480));
|
|
@@ -166,17 +167,19 @@ struct HighScoreWindow : EndGameHighScor
|
|
|
MarkWholeScreenDirty();
|
|
|
this->window_number = difficulty; // show highscore chart for difficulty...
|
|
|
this->background_img = SPR_HIGHSCORE_CHART_BEGIN; // which background to show
|
|
|
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
|
|
|
{
|
|
|
const HighScore *hs = _highscore_table[this->window_number];
|
|
|
|