Hide checkboxes if no matching trait exists.

This commit is contained in:
Paul Chote
2016-06-14 20:10:57 +01:00
parent 6570e1b22e
commit b59b57f67e

View File

@@ -355,6 +355,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var option = new CachedTransform<Session.Global, Session.LobbyOptionState>(
gs => gs.LobbyOptions[kv.Value]);
var visible = new CachedTransform<Session.Global, bool>(
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;