Use BeforeGameStart to remove shellmap UI on editor start.

This commit is contained in:
Paul Chote
2016-07-01 21:54:25 +01:00
parent 641cb96dac
commit 9baee57443

View File

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