Add transient notifications pool
This commit is contained in:
committed by
Paul Chote
parent
e22b6de4e8
commit
a1e6ac85dc
@@ -37,7 +37,8 @@ namespace OpenRA
|
||||
public enum TextNotificationPoolFilters
|
||||
{
|
||||
None = 0,
|
||||
Feedback = 1
|
||||
Feedback = 1,
|
||||
Transients = 2
|
||||
}
|
||||
|
||||
public enum WorldViewport { Native, Close, Medium, Far }
|
||||
@@ -273,7 +274,7 @@ namespace OpenRA
|
||||
[Desc("Allow mods to enable the Discord service that can interact with a local Discord client.")]
|
||||
public bool EnableDiscordService = true;
|
||||
|
||||
public TextNotificationPoolFilters TextNotificationPoolFilters = TextNotificationPoolFilters.Feedback;
|
||||
public TextNotificationPoolFilters TextNotificationPoolFilters = TextNotificationPoolFilters.Feedback | TextNotificationPoolFilters.Transients;
|
||||
}
|
||||
|
||||
public class Settings
|
||||
|
||||
@@ -14,7 +14,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
public enum TextNotificationPool { System, Chat, Mission, Feedback }
|
||||
public enum TextNotificationPool { System, Chat, Mission, Feedback, Transients }
|
||||
|
||||
public class TextNotification : IEquatable<TextNotification>
|
||||
{
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA
|
||||
|
||||
public bool CanIncrementOnDuplicate()
|
||||
{
|
||||
return Pool == TextNotificationPool.Feedback || Pool == TextNotificationPool.System;
|
||||
return Pool == TextNotificationPool.Feedback || Pool == TextNotificationPool.System || Pool == TextNotificationPool.Transients;
|
||||
}
|
||||
|
||||
public static bool operator ==(TextNotification me, TextNotification other) { return me.GetHashCode() == other.GetHashCode(); }
|
||||
|
||||
@@ -26,6 +26,14 @@ namespace OpenRA
|
||||
SystemMessageLabel = "Battlefield Control";
|
||||
}
|
||||
|
||||
public static void AddTransientLine(string text)
|
||||
{
|
||||
if (string.IsNullOrEmpty(text))
|
||||
return;
|
||||
|
||||
AddTextNotification(TextNotificationPool.Transients, SystemMessageLabel, text);
|
||||
}
|
||||
|
||||
public static void AddFeedbackLine(string text)
|
||||
{
|
||||
AddTextNotification(TextNotificationPool.Feedback, SystemMessageLabel, text);
|
||||
@@ -69,6 +77,7 @@ namespace OpenRA
|
||||
return pool == TextNotificationPool.Chat ||
|
||||
pool == TextNotificationPool.System ||
|
||||
pool == TextNotificationPool.Mission ||
|
||||
(pool == TextNotificationPool.Transients && filters.HasFlag(TextNotificationPoolFilters.Transients)) ||
|
||||
(pool == TextNotificationPool.Feedback && filters.HasFlag(TextNotificationPoolFilters.Feedback));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user