|
@@ -145,58 +145,58 @@ struct HighScoreWindow : EndGameHighScor
|
|
|
DrawStringMultiCenter(x + (640 / 2), y + 62, !_networking ? STR_0211_TOP_COMPANIES_WHO_REACHED : STR_TOP_COMPANIES_NETWORK_GAME, 500);
|
|
|
|
|
|
/* Draw Highscore peepz */
|
|
|
for (uint8 i = 0; i < lengthof(_highscore_table[0]); i++) {
|
|
|
SetDParam(0, i + 1);
|
|
|
DrawString(x + 40, y + 140 + (i * 55), STR_0212, TC_BLACK);
|
|
|
|
|
|
if (hs[i].company[0] != '\0') {
|
|
|
TextColour colour = (this->rank == i) ? TC_RED : TC_BLACK; // draw new highscore in red
|
|
|
|
|
|
DoDrawString(hs[i].company, x + 71, y + 140 + (i * 55), colour);
|
|
|
SetDParam(0, hs[i].title);
|
|
|
SetDParam(1, hs[i].score);
|
|
|
DrawString(x + 71, y + 160 + (i * 55), STR_HIGHSCORE_STATS, colour);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
|
|
|
static const Widget _highscore_widgets[] = {
|
|
|
{ WWT_PANEL, RESIZE_NONE, COLOUR_END, 0, 640, 0, 480, 0x0, STR_NULL},
|
|
|
{ WIDGETS_END},
|
|
|
};
|
|
|
|
|
|
static const WindowDesc _highscore_desc = {
|
|
|
static const WindowDesc _highscore_desc(
|
|
|
0, 0, 641, 481, 641, 481,
|
|
|
WC_HIGHSCORE, WC_NONE,
|
|
|
0,
|
|
|
_highscore_widgets,
|
|
|
};
|
|
|
_highscore_widgets
|
|
|
);
|
|
|
|
|
|
static const WindowDesc _endgame_desc = {
|
|
|
static const WindowDesc _endgame_desc(
|
|
|
0, 0, 641, 481, 641, 481,
|
|
|
WC_ENDSCREEN, WC_NONE,
|
|
|
0,
|
|
|
_highscore_widgets,
|
|
|
};
|
|
|
_highscore_widgets
|
|
|
);
|
|
|
|
|
|
/** 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 */
|
|
|
void ShowHighscoreTable(int difficulty, int8 ranking)
|
|
|
{
|
|
|
DeleteWindowByClass(WC_HIGHSCORE);
|
|
|
new HighScoreWindow(&_highscore_desc, difficulty, ranking);
|
|
|
}
|
|
|
|
|
|
/** Show the endgame victory screen in 2050. Update the new highscore
|
|
|
* if it was high enough */
|
|
|
void ShowEndGameChart()
|
|
|
{
|
|
|
/* Dedicated server doesn't need the highscore window and neither does -v null. */
|
|
|
if (_network_dedicated || (!_networking && !IsValidCompanyID(_local_company))) return;
|
|
|
|
|
|
HideVitalWindows();
|
|
|
DeleteWindowByClass(WC_ENDSCREEN);
|
|
|
new EndGameWindow(&_endgame_desc);
|
|
|
}
|