Prevent unnecessary blinking of the options button in non-mission type games

The options button starts blinking when a new objective is added, which happens in all game modes, even skirmish and koth.  This change prevents the button from blinking in the latter two cases.

This prevents 1) confusion on part of the players, and 2) an unnecessary announcement of the objective since in skirmish and koth it is always the same.
This commit is contained in:
Oliver Brakmann
2015-03-04 18:52:38 +01:00
parent f27d010535
commit 34f382ec57
5 changed files with 8 additions and 8 deletions

View File

@@ -72,13 +72,13 @@ namespace OpenRA.Mods.Common.Traits
world.ObserveAfterWinOrLose = !info.EarlyGameOver;
}
public int Add(Player player, string description, ObjectiveType type = ObjectiveType.Primary)
public int Add(Player player, string description, ObjectiveType type = ObjectiveType.Primary, bool inhibitAnnouncement = false)
{
var newID = objectives.Count;
objectives.Insert(newID, new MissionObjective(type, description));
ObjectiveAdded(player);
ObjectiveAdded(player, inhibitAnnouncement);
foreach (var inou in player.PlayerActor.TraitsImplementing<INotifyObjectivesUpdated>())
inou.OnObjectiveAdded(player, newID);
@@ -231,7 +231,7 @@ namespace OpenRA.Mods.Common.Traits
MarkFailed(player, id);
}
public event Action<Player> ObjectiveAdded = player => { player.HasObjectives = true; };
public event Action<Player, bool> ObjectiveAdded = (player, inhibitAnnouncement) => { player.HasObjectives = true; };
public void OnObjectiveAdded(Player player, int id) { }
public void OnObjectiveCompleted(Player player, int id) { }