Fix IDE0028, IDE0300, IDE0301, IDE0302, IDE0303, IDE0304.

Silence IDE0305.
This commit is contained in:
RoosterDragon
2025-03-03 17:29:45 +00:00
committed by Pavel Penev
parent 0740991c12
commit 79454d8fd2
559 changed files with 1661 additions and 1751 deletions

View File

@@ -29,9 +29,9 @@ namespace OpenRA.Mods.Common.Widgets
public string MissionTemplate = "CHAT_LINE_TEMPLATE";
public string FeedbackTemplate = "TRANSIENT_LINE_TEMPLATE";
public string TransientsTemplate = "TRANSIENT_LINE_TEMPLATE";
readonly Dictionary<TextNotificationPool, Widget> templates = new();
readonly Dictionary<TextNotificationPool, Widget> templates = [];
readonly List<long> expirations = new();
readonly List<long> expirations = [];
Rectangle overflowDrawBounds = Rectangle.Empty;
public override Rectangle EventBounds => Rectangle.Empty;
@@ -40,11 +40,11 @@ namespace OpenRA.Mods.Common.Widgets
{
base.Initialize(args);
templates.Add(TextNotificationPool.Chat, Ui.LoadWidget(ChatTemplate, null, new WidgetArgs()));
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()));
templates.Add(TextNotificationPool.Chat, Ui.LoadWidget(ChatTemplate, null, []));
templates.Add(TextNotificationPool.System, Ui.LoadWidget(SystemTemplate, null, []));
templates.Add(TextNotificationPool.Mission, Ui.LoadWidget(MissionTemplate, null, []));
templates.Add(TextNotificationPool.Feedback, Ui.LoadWidget(FeedbackTemplate, null, []));
templates.Add(TextNotificationPool.Transients, Ui.LoadWidget(TransientsTemplate, null, []));
// HACK: Assume that all templates use the same font
var lineHeight = Game.Renderer.Fonts[templates[TextNotificationPool.Chat].Get<LabelWidget>("TEXT").Font].Measure("").Y;