private void btnSave_Click(object sender, EventArgs e)
{
World world = null;
SaveFileDialog dialog = new SaveFileDialog();
if (tabMain.SelectedTab != null)
{
foreach (Control c in tabMain.SelectedTab.Controls)
{
if (c is MapViewer)
{
world = Assets.Assets.GetWorld(((MapViewer)c).WorldID);
if (world != null)
{
dialog.FileName = world.Name + ".wld";
dialog.Filter = "World File (*.wld) | *.wld";
if(dialog.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
{
SaveWorld(world, dialog.FileName);
}
}
break;
}
}
}
}