Manually add game speeds to the linter.

This commit is contained in:
Matthias Mailänder
2022-11-17 21:51:14 +01:00
committed by Gustas
parent 8297fcff30
commit 9ba51c6b51
2 changed files with 10 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ namespace OpenRA
{ {
public class GameSpeed public class GameSpeed
{ {
[TranslationReference]
[FieldLoader.Require] [FieldLoader.Require]
public readonly string Name; public readonly string Name;

View File

@@ -58,6 +58,15 @@ namespace OpenRA.Mods.Common.Lint
} }
} }
var gameSpeeds = modData.Manifest.Get<GameSpeeds>();
foreach (var speed in gameSpeeds.Speeds.Values)
{
if (!translation.HasMessage(speed.Name))
emitError($"{speed.Name} not present in {language} translation.");
referencedKeys.Add(speed.Name);
}
foreach (var modType in modData.ObjectCreator.GetTypes()) foreach (var modType in modData.ObjectCreator.GetTypes())
{ {
foreach (var fieldInfo in modType.GetFields(Binding).Where(m => m.HasAttribute<TranslationReferenceAttribute>())) foreach (var fieldInfo in modType.GetFields(Binding).Where(m => m.HasAttribute<TranslationReferenceAttribute>()))