Traits open files via the Map.
This commit is contained in:
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Lint
|
||||
this.emitError = emitError;
|
||||
|
||||
var sequenceSource = map != null ? map.SequenceDefinitions : new List<MiniYamlNode>();
|
||||
sequenceDefinitions = MiniYaml.Merge(modData.Manifest.Sequences.Select(s => MiniYaml.FromStream(modData.ModFiles.Open(s))).Append(sequenceSource));
|
||||
sequenceDefinitions = MiniYaml.Merge(modData.Manifest.Sequences.Select(s => MiniYaml.FromStream(map.Open(s))).Append(sequenceSource));
|
||||
|
||||
var rules = map == null ? modData.DefaultRules : map.Rules;
|
||||
var factions = rules.Actors["world"].TraitInfos<FactionInfo>().Select(f => f.InternalName).ToArray();
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Drawing;
|
||||
using System.IO;
|
||||
using Eluant;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.FileSystem;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
@@ -165,7 +166,7 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
Stream s;
|
||||
try
|
||||
{
|
||||
s = Game.ModData.ModFiles.Open(movie);
|
||||
s = world.Map.Open(movie);
|
||||
}
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public void LoadPalettes(WorldRenderer wr)
|
||||
{
|
||||
wr.AddPalette(info.Name, new ImmutablePalette(Game.ModData.ModFiles.Open(world.TileSet.Palette), info.ShadowIndex), info.AllowModifiers);
|
||||
wr.AddPalette(info.Name, new ImmutablePalette(wr.World.Map.Open(world.TileSet.Palette), info.ShadowIndex), info.AllowModifiers);
|
||||
}
|
||||
|
||||
public IEnumerable<string> PaletteNames { get { yield return info.Name; } }
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public void LoadPalettes(WorldRenderer wr)
|
||||
{
|
||||
if (info.Tileset == null || info.Tileset.ToLowerInvariant() == world.Map.Tileset.ToLowerInvariant())
|
||||
wr.AddPalette(info.Name, new ImmutablePalette(Game.ModData.ModFiles.Open(info.Filename), info.ShadowIndex), info.AllowModifiers);
|
||||
wr.AddPalette(info.Name, new ImmutablePalette(world.Map.Open(info.Filename), info.ShadowIndex), info.AllowModifiers);
|
||||
}
|
||||
|
||||
public IEnumerable<string> PaletteNames
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public void LoadPalettes(WorldRenderer wr)
|
||||
{
|
||||
var filename = world.TileSet.PlayerPalette ?? world.TileSet.Palette;
|
||||
wr.AddPalette(info.Name, new ImmutablePalette(Game.ModData.ModFiles.Open(filename), info.ShadowIndex), info.AllowModifiers);
|
||||
wr.AddPalette(info.Name, new ImmutablePalette(wr.World.Map.Open(filename), info.ShadowIndex), info.AllowModifiers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user