Remove inconsistencies w.r.t the Surrender order

* Surrendering is now possible even in maps that do not use
  ConquestVictoryConditions.
* The Surrender button is greyed out instead of hidden when it cannot be
  used.
This commit is contained in:
Oliver Brakmann
2014-08-04 00:34:38 +02:00
parent dc33e0e1b0
commit d673520d82
3 changed files with 12 additions and 4 deletions

View File

@@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA
public object Create(ActorInitializer init) { return new MissionObjectives(init.world, this); }
}
public class MissionObjectives : INotifyObjectivesUpdated, ISync
public class MissionObjectives : INotifyObjectivesUpdated, ISync, IResolveOrder
{
readonly MissionObjectivesInfo info;
readonly List<MissionObjective> objectives = new List<MissionObjective>();
@@ -202,6 +202,13 @@ namespace OpenRA.Mods.RA
public void OnObjectiveAdded(Player player, int id) {}
public void OnObjectiveCompleted(Player player, int id) {}
public void OnObjectiveFailed(Player player, int id) {}
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString == "Surrender")
for (var id = 0; id < objectives.Count; id++)
MarkFailed(self.Owner, id);
}
}
[Desc("Provides game mode progress information for players.",