Support for updating objectives without flashing the objectives button. Added a secondary objective: lose fewer than 100 units.

This commit is contained in:
Scott_NZ
2012-10-11 22:55:02 +13:00
parent d44d9f67f2
commit 8c3aabb215
4 changed files with 37 additions and 17 deletions

View File

@@ -40,7 +40,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
objectivesButton.OnClick += () => objectivesButton.Highlighted = false;
objectives.OnObjectivesUpdated += UpdateObjectives;
UpdateObjectives();
UpdateObjectives(true);
Game.ConnectionStateChanged += RemoveHandlers;
}
@@ -53,9 +53,12 @@ namespace OpenRA.Mods.RA.Widgets.Logic
}
}
public void UpdateObjectives()
public void UpdateObjectives(bool notify)
{
objectivesButton.Highlighted = true;
if (notify)
{
objectivesButton.Highlighted = true;
}
primaryPanel.RemoveChildren();
secondaryPanel.RemoveChildren();
foreach (var o in objectives.Objectives.Where(o => o.Status != ObjectiveStatus.Inactive))