Load and save maps using packages.

This commit is contained in:
Paul Chote
2016-02-20 17:23:49 +00:00
parent 9c3b967a47
commit 573e26c887
6 changed files with 48 additions and 43 deletions

View File

@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
ValidateMapFormat(format);
var tileset = GetTileset(mapSection);
Map = new Map(Rules.TileSets[tileset], MapSize, MapSize)
Map = new Map(modData, Rules.TileSets[tileset], MapSize, MapSize)
{
Title = basic.GetValue("Name", Path.GetFileNameWithoutExtension(filename)),
Author = "Westwood Studios"

View File

@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var maxTerrainHeight = world.Map.Grid.MaximumTerrainHeight;
var tileset = modRules.TileSets[tilesetDropDown.Text];
var map = new Map(tileset, width + 2, height + maxTerrainHeight + 2);
var map = new Map(Game.ModData, tileset, width + 2, height + maxTerrainHeight + 2);
var tl = new PPos(1, 1);
var br = new PPos(width, height + maxTerrainHeight);

View File

@@ -168,7 +168,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
// Update the map cache so it can be loaded without restarting the game
var classification = mapDirectories[directoryDropdown.Text];
modData.MapCache[map.Uid].UpdateFromMap(map.Container, classification, null, map.Grid.Type);
modData.MapCache[map.Uid].UpdateFromMap(map.Package, classification, null, map.Grid.Type);
Console.WriteLine("Saved current map at {0}", combinedPath);
Ui.CloseWindow();