fix some dumb (nonfatal) crashes in the editor with nothing loaded

This commit is contained in:
Chris Forbes
2010-10-11 18:21:41 +13:00
parent 0df9815d2c
commit a2205e9031
3 changed files with 13 additions and 7 deletions

View File

@@ -35,7 +35,13 @@ namespace OpenRA.Editor
Rules.LoadRules(Game.modData.Manifest, new Map());
surface1.AfterChange += MakeDirty;
surface1.AfterChange += OnMapChanged;
}
void OnMapChanged()
{
MakeDirty();
pmMiniMap.Image = Minimap.AddStaticResources(surface1.Map, Minimap.TerrainBitmap(surface1.Map, true));
}
void MakeDirty() { dirty = true; }
@@ -390,11 +396,6 @@ namespace OpenRA.Editor
pb.Show();
}
private void OnSurfaceClicked(object sender, EventArgs e)
{
pmMiniMap.Image = Minimap.AddStaticResources(surface1.Map, Minimap.TerrainBitmap(surface1.Map, true));
}
private void mnuMinimapToPNG_Click(object sender, EventArgs e)
{
try