From f47595b780cb72ce0f68c826fa264d96e3b50198 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Sat, 10 Mar 2018 16:41:05 +0000 Subject: [PATCH] Hide map preview when no replay is selected. This prevents interaction with the widget than can cause crashes as no replay is selected yet. --- OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs index 157c06db21..9b65b36519 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs @@ -72,9 +72,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic watch.IsDisabled = () => selectedReplay == null || map.Status != MapStatus.Available; watch.OnClick = () => { WatchReplay(); }; + var mapPreviewRoot = panel.Get("MAP_PREVIEW_ROOT"); + mapPreviewRoot.IsVisible = () => selectedReplay != null; panel.Get("REPLAY_INFO").IsVisible = () => selectedReplay != null; - Ui.LoadWidget("MAP_PREVIEW", panel.Get("MAP_PREVIEW_ROOT"), new WidgetArgs + Ui.LoadWidget("MAP_PREVIEW", mapPreviewRoot, new WidgetArgs { { "orderManager", null }, { "getMap", (Func)(() => map) },