Add stats button to end game dialog

Also adds the statistics window to TD.  There is no button for it in
observer mode, though, but it is available from the end game dialog.

Fixes #6312.
This commit is contained in:
Oliver Brakmann
2014-08-25 18:25:47 +02:00
parent 49adf023bb
commit c61516c55e
7 changed files with 525 additions and 23 deletions

View File

@@ -29,10 +29,22 @@ namespace OpenRA.Mods.RA.Widgets
if (showObjectives)
panelName = "LEAVE_RESTART_FULL";
var showStats = false;
var dialog = widget.Get<ContainerWidget>(panelName);
dialog.IsVisible = () => true;
dialog.IsVisible = () => !showStats;
widget.IsVisible = () => Ui.CurrentWindow() == null;
var statsButton = dialog.Get<ButtonWidget>("STATS_BUTTON");
statsButton.OnClick = () =>
{
showStats = true;
Game.LoadWidget(world, "INGAME_OBSERVERSTATS_BG", Ui.Root, new WidgetArgs()
{
{ "onExit", () => showStats = false }
});
};
var leaveButton = dialog.Get<ButtonWidget>("LEAVE_BUTTON");
leaveButton.OnClick = () =>
{