From 8d68bd026d74cd76b29cb86cbbef7535b53c5b5e Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 10 Jul 2010 15:07:29 +1200 Subject: [PATCH] add 'lock teams' feature backend -- still needs UI --- OpenRA.FileFormats/Session.cs | 1 + OpenRA.Game/Widgets/Delegates/DiplomacyDelegate.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/OpenRA.FileFormats/Session.cs b/OpenRA.FileFormats/Session.cs index 3536732637..c07eaf3dd5 100644 --- a/OpenRA.FileFormats/Session.cs +++ b/OpenRA.FileFormats/Session.cs @@ -53,6 +53,7 @@ namespace OpenRA.FileFormats public string[] Mods = { "ra" }; // mod names public int OrderLatency = 3; public int RandomSeed = 0; + public bool LockTeams = false; // don't allow team changes after game start. } } diff --git a/OpenRA.Game/Widgets/Delegates/DiplomacyDelegate.cs b/OpenRA.Game/Widgets/Delegates/DiplomacyDelegate.cs index c32fe8154e..1f633e9582 100644 --- a/OpenRA.Game/Widgets/Delegates/DiplomacyDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/DiplomacyDelegate.cs @@ -116,6 +116,9 @@ namespace OpenRA.Widgets.Delegates void CycleStance(Player p, ButtonWidget bw) { + if (Game.LobbyInfo.GlobalSettings.LockTeams) + return; // team changes are banned + var nextStance = GetNextStance((Stance)Enum.Parse(typeof(Stance), bw.Text)); Game.IssueOrder(new Order("SetStance", Game.world.LocalPlayer.PlayerActor,