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:
@@ -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 = () =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user