Add transient notifications pool

This commit is contained in:
Ivaylo Draganov
2022-04-29 15:01:33 +03:00
committed by Paul Chote
parent e22b6de4e8
commit a1e6ac85dc
5 changed files with 17 additions and 5 deletions

View File

@@ -28,6 +28,7 @@ namespace OpenRA.Mods.Common.Widgets
public string SystemTemplate = "SYSTEM_LINE_TEMPLATE";
public string MissionTemplate = "CHAT_LINE_TEMPLATE";
public string FeedbackTemplate = "TRANSIENT_LINE_TEMPLATE";
public string TransientsTemplate = "TRANSIENT_LINE_TEMPLATE";
readonly Dictionary<TextNotificationPool, Widget> templates = new Dictionary<TextNotificationPool, Widget>();
readonly List<int> expirations = new List<int>();
@@ -43,6 +44,7 @@ namespace OpenRA.Mods.Common.Widgets
templates.Add(TextNotificationPool.System, Ui.LoadWidget(SystemTemplate, null, new WidgetArgs()));
templates.Add(TextNotificationPool.Mission, Ui.LoadWidget(MissionTemplate, null, new WidgetArgs()));
templates.Add(TextNotificationPool.Feedback, Ui.LoadWidget(FeedbackTemplate, null, new WidgetArgs()));
templates.Add(TextNotificationPool.Transients, Ui.LoadWidget(TransientsTemplate, null, new WidgetArgs()));
// HACK: Assume that all templates use the same font
var lineHeight = Game.Renderer.Fonts[templates[TextNotificationPool.Chat].Get<LabelWidget>("TEXT").Font].Measure("").Y;