Remove unnecessary Map usage from MainMenuLogic.

This commit is contained in:
Paul Chote
2016-02-05 21:31:17 +00:00
parent d5e3fbf452
commit e13e0792f6

View File

@@ -167,7 +167,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var onSelect = new Action<string>(uid => var onSelect = new Action<string>(uid =>
{ {
RemoveShellmapUI(); RemoveShellmapUI();
LoadMapIntoEditor(Game.ModData.MapCache[uid].Map); LoadMapIntoEditor(Game.ModData.MapCache[uid].Uid);
}); });
var newMapButton = widget.Get<ButtonWidget>("NEW_MAP_BUTTON"); var newMapButton = widget.Get<ButtonWidget>("NEW_MAP_BUTTON");
@@ -242,12 +242,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}); });
} }
void LoadMapIntoEditor(Map map) void LoadMapIntoEditor(string uid)
{ {
ConnectionLogic.Connect(IPAddress.Loopback.ToString(), ConnectionLogic.Connect(IPAddress.Loopback.ToString(),
Game.CreateLocalServer(map.Uid), Game.CreateLocalServer(uid),
"", "",
() => { Game.LoadEditor(map.Uid); }, () => { Game.LoadEditor(uid); },
() => { Game.CloseServer(); SwitchMenu(MenuType.MapEditor); }); () => { Game.CloseServer(); SwitchMenu(MenuType.MapEditor); });
} }