private void searchAndReplaceTilesToolStripMenuItem_Click(object sender, EventArgs e) { if (currentSector == null) { return; } int oldId; try { oldId = int.Parse(slTileId.Text); } catch (Exception) { oldId = 0; } int newId = currentTileId; TileSearchDialog tsd = new TileSearchDialog(oldId, newId); if (tsd.ShowDialog() == DialogResult.OK) { foreach (Tilemap tilemap in currentSector.tilemaps) { tilemap.Replace(tsd.OldId, tsd.NewId); } cbSector_SelectedIndexChanged(sender, e); } }
private void searchAndReplaceTilesToolStripMenuItem_Click(object sender, EventArgs e) { if (currentSector == null) return; int oldId; try { oldId = int.Parse(slTileId.Text); } catch(Exception) { oldId = 0; } int newId = currentTileId; TileSearchDialog tsd = new TileSearchDialog(oldId, newId); if (tsd.ShowDialog() == DialogResult.OK) { foreach (Tilemap tilemap in currentSector.tilemaps) { tilemap.Replace(tsd.OldId, tsd.NewId); } cbSector_SelectedIndexChanged(sender, e); } }