コード例 #1
0
ファイル: MainForm.cs プロジェクト: thepirateclub/netgore
        /// <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();
        }
コード例 #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);
        }
コード例 #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);
            }
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: Vizzini/netgore
        /// <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);
        }
コード例 #5
0
ファイル: MainForm.cs プロジェクト: Vizzini/netgore
        /// <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);
            }
        }
コード例 #6
0
ファイル: MainForm.cs プロジェクト: Furt/netgore
        /// <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();
        }