Merge pull request #11555 from pchote/fix-editor-shellmap-ui

Use BeforeGameStart to remove shellmap UI on editor start.
This commit is contained in:
abcdefg30
2016-07-03 16:13:31 +02:00
committed by GitHub

View File

@@ -185,11 +185,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var mapEditorMenu = widget.Get("MAP_EDITOR_MENU");
mapEditorMenu.IsVisible = () => menuType == MenuType.MapEditor;
var onSelect = new Action<string>(uid =>
{
RemoveShellmapUI();
LoadMapIntoEditor(modData.MapCache[uid].Uid);
});
// Loading into the map editor
Game.BeforeGameStart += RemoveShellmapUI;
var onSelect = new Action<string>(uid => LoadMapIntoEditor(modData.MapCache[uid].Uid));
var newMapButton = widget.Get<ButtonWidget>("NEW_MAP_BUTTON");
newMapButton.OnClick = () =>
@@ -450,7 +449,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
protected override void Dispose(bool disposing)
{
if (disposing)
{
Game.OnRemoteDirectConnect -= OnRemoteDirectConnect;
Game.BeforeGameStart -= RemoveShellmapUI;
}
base.Dispose(disposing);
}
}