Stop passing around partially constructed ModData instances.

This commit is contained in:
Paul Chote
2025-12-06 21:36:34 +00:00
committed by Gustas Kažukauskas
parent 2b6977d53f
commit 31607bd0cf
15 changed files with 82 additions and 77 deletions

View File

@@ -23,11 +23,11 @@ namespace OpenRA
static FluentBundle modFluentBundle;
static FluentBundle mapFluentBundle;
public static void Initialize(ModData modData, IReadOnlyFileSystem fileSystem)
public static void Initialize(Manifest manifest, IReadOnlyFileSystem fileSystem)
{
lock (SyncObject)
{
modFluentBundle = new FluentBundle(modData.Manifest.FluentCulture, modData.Manifest.FluentMessages, fileSystem);
modFluentBundle = new FluentBundle(manifest.FluentCulture, manifest.FluentMessages, fileSystem);
if (fileSystem is Map map && map.FluentMessageDefinitions != null)
{
var files = ImmutableArray<string>.Empty;
@@ -45,7 +45,7 @@ namespace OpenRA
text = builder.ToString();
}
mapFluentBundle = new FluentBundle(modData.Manifest.FluentCulture, files, fileSystem, text);
mapFluentBundle = new FluentBundle(manifest.FluentCulture, files, fileSystem, text);
}
}
}