Esempio n. 1
0
        /// <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();
        }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
        /// <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);
            }
        }
Esempio n. 4
0
        /// <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);
        }
Esempio n. 5
0
        /// <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);
            }
        }
Esempio n. 6
0
        /// <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();
        }