Use Filepaths instead of IFolders where possible.
This commit is contained in:
@@ -85,10 +85,8 @@ namespace OpenRA
|
||||
public string Owner = null;
|
||||
}
|
||||
|
||||
public Map(string path) : this(FileSystem.OpenPackage(path, int.MaxValue)) {}
|
||||
public Map(MapStub stub) : this(stub.Container) {}
|
||||
public Map(IFolder package)
|
||||
: base(package)
|
||||
public Map(string path)
|
||||
: base(path)
|
||||
{
|
||||
var yaml = new MiniYaml( null, MiniYaml.FromStream( Container.GetContent( "map.yaml" ) ) );
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace OpenRA
|
||||
if (!AvailableMaps.ContainsKey(uid))
|
||||
throw new InvalidDataException("Invalid map uid: {0}".F(uid));
|
||||
|
||||
var map = new Map(AvailableMaps[uid]);
|
||||
var map = new Map(AvailableMaps[uid].Path);
|
||||
|
||||
// unload the previous map mount if we have one
|
||||
if (previousMapMount != null) FileSystem.Unmount(previousMapMount);
|
||||
@@ -85,11 +85,9 @@ namespace OpenRA
|
||||
// Adds the map its container to the FileSystem
|
||||
// allowing the map to use custom assets
|
||||
// Container should have the lowest priority of all (ie int max)
|
||||
FileSystem.Mount(map.Container);
|
||||
|
||||
// Store a reference so we can unload it next time
|
||||
previousMapMount = map.Container;
|
||||
|
||||
previousMapMount = FileSystem.OpenPackage(map.Path, int.MaxValue);
|
||||
FileSystem.Mount(previousMapMount);
|
||||
Rules.LoadRules(Manifest, map);
|
||||
|
||||
if (map.Tileset != cachedTileset
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Widgets
|
||||
public Func<MapStub> Map = () => null;
|
||||
public Action<int> OnSpawnClick = spawn => {};
|
||||
public Func<Dictionary<int2, Color>> SpawnColors = () => new Dictionary<int2, Color>();
|
||||
static Cache<MapStub,Bitmap> PreviewCache = new Cache<MapStub, Bitmap>(stub => Minimap.RenderMapPreview( new Map( stub )));
|
||||
static Cache<MapStub,Bitmap> PreviewCache = new Cache<MapStub, Bitmap>(stub => Minimap.RenderMapPreview( new Map( stub.Path )));
|
||||
|
||||
public MapPreviewWidget() : base() { }
|
||||
protected MapPreviewWidget(MapPreviewWidget other)
|
||||
|
||||
Reference in New Issue
Block a user