From b5c387774c564cb6c9197bf86493fe687d4c619e Mon Sep 17 00:00:00 2001 From: teinarss Date: Tue, 23 Jul 2019 19:37:35 +0200 Subject: [PATCH] Fixed selecting none in spec dropdown should set none as active panel --- .../Widgets/Logic/Ingame/ObserverStatsLogic.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs index f47eac2d8a..d6acaa3f79 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs @@ -50,7 +50,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly WorldRenderer worldRenderer; readonly string clickSound = ChromeMetrics.Get("ClickSound"); - bool noneSelected = true; ObserverStatsPanel activePanel; [ObjectCreator.UseCtor] @@ -113,7 +112,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic IsSelected = () => activePanel == panel, OnClick = () => { - noneSelected = false; ClearStats(); playerStatsPanel.Visible = true; statsDropDown.GetText = () => title; @@ -132,13 +130,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic new StatsDropDownOption { Title = "Information: None", - IsSelected = () => noneSelected, + IsSelected = () => activePanel == ObserverStatsPanel.None, OnClick = () => { - noneSelected = true; statsDropDown.GetText = () => "Information: None"; playerStatsPanel.Visible = false; ClearStats(); + activePanel = ObserverStatsPanel.None; } }, createStatsOption("Basic", ObserverStatsPanel.Basic, basicPlayerTemplate, () => DisplayStats(BasicStats)),