/// <summary> /// Creates an EditMapForm. /// </summary> /// <param name="map">The map to be edited.</param> void CreateEditMapForm(IMapTable map) { var editorFrm = new EditMapForm(); editorFrm.MapScreenControl.ChangeMap(map.ID); editorFrm.Text = "[" + map.ID + "] " + map.Name; editorFrm.Show(dockPanel); var settings = EditorSettings.Default; settings.InitialMapId = (int)map.ID; settings.Save(); }
/// <summary> /// Handles the Click event of the <see cref="newMapToolStripMenuItem"/> control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> void newMapToolStripMenuItem_Click(object sender, EventArgs e) { var id = MapHelper.CreateNewMap(true); if (!id.HasValue) { return; } var editorFrm = new EditMapForm(); editorFrm.MapScreenControl.ChangeMap(id.Value); editorFrm.Show(dockPanel); }
/// <summary> /// Handles the Click event of the <see cref="loadMapToolStripMenuItem"/> control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> void loadMapToolStripMenuItem_Click(object sender, EventArgs e) { using (var uiFrm = new MapUITypeEditorForm(null)) { var result = uiFrm.ShowDialog(this); if (result != DialogResult.OK && result != DialogResult.Yes) { return; } var map = uiFrm.SelectedItem; if (map == null) { return; } var editorFrm = new EditMapForm(); editorFrm.MapScreenControl.ChangeMap(map.ID); editorFrm.Text = "[" + map.ID + "] " + map.Name; editorFrm.Show(dockPanel); } }
/// <summary> /// Handles the Click event of the <see cref="newMapToolStripMenuItem"/> control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> void newMapToolStripMenuItem_Click(object sender, EventArgs e) { var id = MapHelper.CreateNewMap(true); if (!id.HasValue) return; var editorFrm = new EditMapForm(); editorFrm.MapScreenControl.ChangeMap(id.Value); editorFrm.Show(dockPanel); }
/// <summary> /// Handles the Click event of the <see cref="loadMapToolStripMenuItem"/> control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> void loadMapToolStripMenuItem_Click(object sender, EventArgs e) { using (var uiFrm = new MapUITypeEditorForm(null)) { var result = uiFrm.ShowDialog(this); if (result != DialogResult.OK && result != DialogResult.Yes) return; var map = uiFrm.SelectedItem; if (map == null) return; var editorFrm = new EditMapForm(); editorFrm.MapScreenControl.ChangeMap(map.ID); editorFrm.Text = "[" + map.ID + "] " + map.Name; editorFrm.Show(dockPanel); } }