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");
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);
}
}