Simplify editor/importer map creation.

This commit is contained in:
Paul Chote
2015-07-04 18:49:57 +01:00
parent 41fa77d12a
commit 0dbbc00d0a
4 changed files with 60 additions and 68 deletions

View File

@@ -51,9 +51,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
panel.Get<ButtonWidget>("CREATE_BUTTON").OnClick = () =>
{
var tileset = modRules.TileSets[tilesetDropDown.Text];
var map = Map.FromTileset(tileset);
int width, height;
int.TryParse(widthTextField.Text, out width);
int.TryParse(heightTextField.Text, out height);
@@ -63,7 +60,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
width = Math.Max(2, width);
height = Math.Max(2, height);
map.Resize(width + 2, height + tileset.MaxGroundHeight + 2);
var tileset = modRules.TileSets[tilesetDropDown.Text];
var map = new Map(tileset, width + 2, height + tileset.MaxGroundHeight + 2);
var tl = new MPos(1, 1);
var br = new MPos(width, height + tileset.MaxGroundHeight);