Make the diplomacy panel consistent with cheats and menu.

This commit is contained in:
Paul Chote
2014-07-17 16:13:48 +12:00
parent 9e2b3ce0b8
commit fda3ae2fb0
4 changed files with 42 additions and 8 deletions

View File

@@ -8,6 +8,7 @@
*/
#endregion
using System.Linq;
using OpenRA.Mods.RA.Orders;
using OpenRA.Widgets;
@@ -62,6 +63,14 @@ namespace OpenRA.Mods.RA.Widgets.Logic
options.OnClick = () => OpenMenuPanel(options);
}
var diplomacy = widget.GetOrNull<MenuButtonWidget>("DIPLOMACY_BUTTON");
if (diplomacy != null)
{
diplomacy.Visible = world.Players.Any(a => a != world.LocalPlayer && !a.NonCombatant);
diplomacy.IsDisabled = () => disableSystemButtons;
diplomacy.OnClick = () => OpenMenuPanel(diplomacy);
}
var debug = widget.GetOrNull<MenuButtonWidget>("DEBUG_BUTTON");
if (debug != null)
{