Remove save dialog when creating a new map.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
1707dbd92b
commit
9913ecb42f
@@ -11,6 +11,7 @@
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.FileSystem;
|
||||
using OpenRA.Mods.Common.Terrain;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
@@ -69,24 +70,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (map.Rules.TerrainInfo is ITerrainInfoNotifyMapCreated notifyMapCreated)
|
||||
notifyMapCreated.MapCreated(map);
|
||||
|
||||
Action<string> afterSave = uid =>
|
||||
{
|
||||
map.Dispose();
|
||||
Game.LoadEditor(uid);
|
||||
|
||||
Ui.CloseWindow();
|
||||
onSelect(uid);
|
||||
};
|
||||
|
||||
Ui.OpenWindow("SAVE_MAP_PANEL", new WidgetArgs()
|
||||
{
|
||||
{ "onSave", afterSave },
|
||||
{ "onExit", () => { Ui.CloseWindow(); onExit(); } },
|
||||
{ "map", map },
|
||||
{ "world", world },
|
||||
{ "playerDefinitions", map.PlayerDefinitions },
|
||||
{ "actorDefinitions", map.ActorDefinitions }
|
||||
});
|
||||
var package = new ZipFileLoader.ReadWriteZipFile();
|
||||
map.Save(package);
|
||||
map = new Map(modData, package);
|
||||
Game.LoadEditor(map);
|
||||
Ui.CloseWindow();
|
||||
onSelect(map.Uid);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user