Commit Graph

6666 Commits

Author SHA1 Message Date
Gustas
a9a7777293 Report linguini parse errors
Reports duplicate keys
2023-04-22 19:23:41 +02:00
Matthias Mailänder
68eec52cef Add TranslationProvider 2023-04-22 19:23:41 +02:00
Gustas
a065e6a47c Fix map level lobby options not being translated 2023-04-22 19:23:41 +02:00
Gustas
efe135e38b Add Translations to MapPreview 2023-04-22 19:23:41 +02:00
Gustas
8f5d8de1c2 Allow empty translation keys 2023-04-22 19:23:41 +02:00
Matthias Mailänder
2867334c00 Less verbose logging for untranslated strings. 2023-04-22 19:23:41 +02:00
RoosterDragon
6362bbd176 Fix CA1846 2023-04-17 00:05:12 +02:00
RoosterDragon
25b8e7fefc Fix CA1834 2023-04-17 00:05:12 +02:00
RoosterDragon
ad4a443fc2 Fix CA1066 2023-04-17 00:05:12 +02:00
RoosterDragon
c442bd83f8 Fix CA1036 2023-04-17 00:05:12 +02:00
RoosterDragon
ff799303b0 Fix CA1018 2023-04-17 00:05:12 +02:00
RoosterDragon
f09241d263 Fix CA1010 2023-04-17 00:05:12 +02:00
RoosterDragon
0c3071b9c6 Adjust MiniYaml node merging when removals are present.
# Example Scenario
MockString:
	CollectionOfStrings:
		StringA: A

MockString:
	CollectionOfStrings:
		StringB: B

MockString:
	-CollectionOfStrings:

MockString:
	CollectionOfStrings:
		StringC: C

MockString:
	CollectionOfStrings:
		StringD: D

# Previous MergePartial result
# The CollectionOfStrings is merged into a single unit, so the C and D items are dragged upwards and jump ahead of the Removal
# When this is processed, the final result removes CollectionOfStrings entirely

MockString:
	CollectionOfStrings:
		StringA: A
		StringB: B
		StringC: C
		StringD: D
	-CollectionOfStrings:

# New MergePartial result
# When merging nodes, we no longer allow merges to jump an intervening removal node.
# This means we can have multiple of a certain key (CollectionOfStrings in this example) which was not the case previously.
# When this is processed, the final result includes C/D but not A/B.

MockString:
	CollectionOfStrings:
		StringA: A
		StringB: B
	-CollectionOfStrings:
	CollectionOfStrings:
		StringC: C
		StringD: D
2023-04-14 23:57:26 +03:00
RoosterDragon
595717fff0 Enable Code Quality Rules
Enforces a variety of CAxxxx rules that do not have existing violations.

For the benefit of dotnet_code_quality.CA2241.try_determine_additional_string_formatting_methods_automatically = true, rename parameters of methods that forward to string.Format so format issues will get detected automatically.
2023-04-08 23:15:40 +02:00
RoosterDragon
14c0d011ea Fix SA1414 2023-04-08 16:51:51 +03:00
RoosterDragon
a167f9680f Fix SA1316 2023-04-08 16:51:51 +03:00
RoosterDragon
062dc2bd40 Fix SA1141 2023-04-08 16:51:51 +03:00
RoosterDragon
1ce9acd442 Fix IDE0110 2023-04-08 16:51:51 +03:00
RoosterDragon
8a285f9b19 Fix IDE0090 2023-04-08 16:51:51 +03:00
RoosterDragon
164abfdae1 Fix IDE0083 2023-04-08 16:51:51 +03:00
RoosterDragon
bd2b3d9793 Fix IDE0074 2023-04-08 16:51:51 +03:00
RoosterDragon
cbd0583289 Fix IDE0062 2023-04-08 16:51:51 +03:00
RoosterDragon
023d80b94d Fix IDE0057 2023-04-08 16:51:51 +03:00
RoosterDragon
5254348819 Fix IDE0056 2023-04-08 16:51:51 +03:00
Gustas
e4ba9733fe Add sequences linting to ingame lobby 2023-04-07 16:23:30 +01:00
RoosterDragon
83561d639d Update LangVersion to C# 9.
mono was the bottleneck restricting our ability to use a newer C# version. mono 6.12 is currently available. Although poorly documented on their website, this supports C# 9. https://www.mono-project.com/docs/about-mono/versioning/#mono-source-versioning indicates mono 6.12 uses Roslyn 3.9.0. https://github.com/dotnet/roslyn/blob/main/docs/wiki/NuGet-packages.md#versioning indicates Roslyn 3.9.0 supports C# 9.

This unlocks C# 8 and C# 9 features previously unavailable to us.
- https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-version-history#c-version-80
- https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-version-history#c-version-9

A newer version of StyleCop is required to avoid rules tripping up on the new syntax. Currently only prerelease versions are available but their use is encouraged https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3420#issuecomment-994899135

Fix style rule violations on existing rules where the newer language version makes some existing casts redundant or allows use of the null coalescing assignment operator.
2023-04-05 15:27:41 +03:00
RoosterDragon
9dd4f938da Cache reflection calls when running utility lints and commands.
Reduces runtime of --check-yaml command to 70% of original.
2023-04-05 00:25:32 +02:00
RoosterDragon
95f675becd Improve performance of ActorInfo.TraitsInConstructOrder.
Avoid redundant enumerations of the more and unresolved enumerables. This gives an approx 3x speedup for this function.
2023-04-03 17:29:08 +03:00
RoosterDragon
dc40442118 Fix doc comment on CanKickClient. 2023-03-27 20:55:44 +02:00
Gustas
bf00577d33 Allow kicking dead players 2023-03-27 20:15:17 +02:00
RoosterDragon
8a4303cc94 Rework PriorityQueue for performance.
- Providing the comparer as a type argument that is a struct allows the calls to be devirtualised, leading to approx a 3x performance improvement.
- Use a single backing array, rather than a list of arrays.
2023-03-25 18:50:09 +01:00
RoosterDragon
bcfa0c9ae9 Review StyleCop rules.
- Enforce SA1604 ElementDocumentationShouldHaveSummary.
- Enforce SA1629 DocumentationTextShouldEndWithAPeriod.
- Turn off some rules covered by IDExxxx rules.
- Remaining rules are treated as part of OpenRA style.
2023-03-18 12:46:10 +02:00
RoosterDragon
98c4eaca83 Fix IDE0032 2023-03-14 13:41:25 +02:00
Paul Chote
f0cf728825 Dispose SequenceSet when we're done with it.
Utility rules that do something on a map and exit
are left without explicit disposing, as they will
be cleaned up immediately anyway.
2023-03-10 20:11:33 +02:00
Paul Chote
c35ab081ff Rewrite sequence loading logic.
Multiple layers of Lazy<T>ness are replaced with
an explicit two-part loading scheme.

Sequences are parsed immediately, without the need
for the sprite assets, and tell the SpriteCache
which frames they need. Use-cases that want the
actual sprites can then tell the SpriteCache to
load the frames and the sequences to resolve the
sprites.
2023-03-10 20:11:33 +02:00
Paul Chote
a6f3db0a45 Allow all sprites to use interpolated facings. 2023-03-10 20:11:33 +02:00
Paul Chote
b051211842 Remove internal state from ISpriteSequence API. 2023-03-10 20:11:33 +02:00
Paul Chote
7cd4272350 Access sequences from Map. 2023-03-10 20:11:33 +02:00
Gustas
dab3ca0025 Add support for dark player colors 2023-03-10 15:43:24 +02:00
RoosterDragon
939f715e3c Fix IDE0053 2023-03-07 13:18:13 +02:00
RoosterDragon
c916a00624 Remove workaround for old versions of mono. 2023-03-07 12:51:06 +02:00
RoosterDragon
53e9f44972 Spelling fixes 2023-03-02 20:11:54 +02:00
RoosterDragon
52fd564eac Fix some whitespace formatting issues: stray tabs or spaces.
Wrap some long lines on affected code.
2023-03-02 20:02:45 +02:00
Matthias Mailänder
edaf11cb89 Update thirdparty dependencies. 2023-03-01 23:52:59 +01:00
RoosterDragon
ad122c8e32 When running a server, don't load minimap previews into memory. 2023-03-02 00:13:46 +02:00
RoosterDragon
8ee6957e6a Fix IDE0048 2023-03-01 21:56:28 +02:00
Gustas
422a228cea Fix PlayerColorRemap expecting colors in linear space
PlayerColorRemap expected colors in linear space yet we provided them in gamma. We fix this by instead expecting gamma space colors and then converting them into linear space ourselves.
2023-02-28 23:26:37 +02:00
RoosterDragon
0b01b73111 Fix IDE0060 2023-02-28 21:21:40 +02:00
RoosterDragon
5b70d344cc Fix IDE0038 2023-02-28 21:21:40 +02:00
RoosterDragon
71ce515d6d Fix IDE0004 2023-02-28 21:21:40 +02:00