Split chat lines into pools

- Add a common class for passing around chat lines
- Add wrapper methods for adding chat lines
- Combine repeated chat lines in the display widget
This commit is contained in:
Ivaylo Draganov
2020-02-29 22:31:29 +02:00
committed by Paul Chote
parent 0a02bd524a
commit 6af354ff99
11 changed files with 175 additions and 88 deletions

View File

@@ -248,12 +248,12 @@ namespace OpenRA.Mods.Common.Widgets
// Check if selecting actors on the screen has selected new units
if (ownUnitsOnScreen.Count > World.Selection.Actors.Count())
TextNotificationsManager.AddSystemLine("Selected across screen");
TextNotificationsManager.AddFeedbackLine("Selected across screen");
else
{
// Select actors in the world that have highest selection priority
ownUnitsOnScreen = SelectActorsInWorld(World, null, eligiblePlayers).SubsetWithHighestSelectionPriority(e.Modifiers).ToList();
TextNotificationsManager.AddSystemLine("Selected across map");
TextNotificationsManager.AddFeedbackLine("Selected across map");
}
World.Selection.Combine(World, ownUnitsOnScreen, false, false);
@@ -280,12 +280,12 @@ namespace OpenRA.Mods.Common.Widgets
// Check if selecting actors on the screen has selected new units
if (newSelection.Count > World.Selection.Actors.Count())
TextNotificationsManager.AddSystemLine("Selected across screen");
TextNotificationsManager.AddFeedbackLine("Selected across screen");
else
{
// Select actors in the world that have the same selection class as one of the already selected actors
newSelection = SelectActorsInWorld(World, selectedClasses, eligiblePlayers).ToList();
TextNotificationsManager.AddSystemLine("Selected across map");
TextNotificationsManager.AddFeedbackLine("Selected across map");
}
World.Selection.Combine(World, newSelection, true, false);