Traits open files via the Map.
This commit is contained in:
@@ -1176,22 +1176,22 @@ namespace OpenRA
|
||||
}
|
||||
|
||||
// Placeholders for future implementation
|
||||
Stream IReadOnlyFileSystem.Open(string filename)
|
||||
public Stream Open(string filename)
|
||||
{
|
||||
return Game.ModData.DefaultFileSystem.Open(filename);
|
||||
}
|
||||
|
||||
bool IReadOnlyFileSystem.TryGetPackageContaining(string path, out IReadOnlyPackage package, out string filename)
|
||||
public bool TryGetPackageContaining(string path, out IReadOnlyPackage package, out string filename)
|
||||
{
|
||||
return Game.ModData.DefaultFileSystem.TryGetPackageContaining(path, out package, out filename);
|
||||
}
|
||||
|
||||
bool IReadOnlyFileSystem.TryOpen(string filename, out Stream s)
|
||||
public bool TryOpen(string filename, out Stream s)
|
||||
{
|
||||
return Game.ModData.DefaultFileSystem.TryOpen(filename, out s);
|
||||
}
|
||||
|
||||
bool IReadOnlyFileSystem.Exists(string filename)
|
||||
public bool Exists(string filename)
|
||||
{
|
||||
return Game.ModData.DefaultFileSystem.Exists(filename);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace OpenRA
|
||||
fontSheetBuilder.Dispose();
|
||||
fontSheetBuilder = new SheetBuilder(SheetType.BGRA);
|
||||
Fonts = modData.Manifest.Fonts.ToDictionary(x => x.Key,
|
||||
x => new SpriteFont(x.Value.First, modData.ModFiles.Open(x.Value.First).ReadAllBytes(), x.Value.Second, fontSheetBuilder)).AsReadOnly();
|
||||
x => new SpriteFont(x.Value.First, modData.DefaultFileSystem.Open(x.Value.First).ReadAllBytes(), x.Value.Second, fontSheetBuilder)).AsReadOnly();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace OpenRA.Scripting
|
||||
using (var loadScript = (LuaFunction)runtime.Globals["ExecuteSandboxedScript"])
|
||||
{
|
||||
foreach (var s in scripts)
|
||||
loadScript.Call(s, Game.ModData.ModFiles.Open(s).ReadAllText()).Dispose();
|
||||
loadScript.Call(s, world.Map.Open(s).ReadAllText()).Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user