private void newToolStripMenuItem_Click(object sender, System.EventArgs e) { NewMapDialog dialog = new NewMapDialog(); if (dialog.ShowDialog() == DialogResult.OK) { monoGameEditor1.CreateMap( dialog.Details.MapWidth, dialog.Details.MapHeight, dialog.Details.TileWidth, dialog.Details.TileHeight ); } }
/// <summary> /// newToolStripMenuItem_Click(object, EventArgs) /// Handler for when the 'New' option is chosen from the toolbar. /// Opens NewMapDialog for creating new game Map. /// </summary> /// <param name="sender">(object) - The object signaling the event.</param> /// <param name="e">(EventArgs) - The type of event being sent.</param> private void newToolStripMenuItem_Click(object sender, EventArgs e) { // Create instance of NewMapDialog NewMapDialog dialog = new NewMapDialog(); // Open dialog and wait for submitted results. if (dialog.ShowDialog() == DialogResult.OK) { // Once dialog reterns results create a new Map based on given dimensions. monoGameEditor.CreateMap( dialog.creationDetails.MapWidth, dialog.creationDetails.MapHeight, dialog.creationDetails.TileWidth, dialog.creationDetails.TileHeight ); } }