From b59b57f67e3d04f45887c088d21e6ae33670a716 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 14 Jun 2016 20:10:57 +0100 Subject: [PATCH] Hide checkboxes if no matching trait exists. --- OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index 182f09c3f5..c8e203e1aa 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -355,6 +355,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic var option = new CachedTransform( gs => gs.LobbyOptions[kv.Value]); + var visible = new CachedTransform( + gs => gs.LobbyOptions.ContainsKey(kv.Value)); + + checkbox.IsVisible = () => visible.Update(orderManager.LobbyInfo.GlobalSettings); checkbox.IsChecked = () => option.Update(orderManager.LobbyInfo.GlobalSettings).Enabled; checkbox.IsDisabled = () => configurationDisabled() || option.Update(orderManager.LobbyInfo.GlobalSettings).Locked;