Пример #1
0
        private void resizeMapToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!activeMap.IsEditable)
            {
                MessageBox.Show(@"You can enable editability in the Edit menu or by pressing Ctrl+E.",
                                @"Map not editable.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            var          mapSizeDialog = new MapSizeDialog(activeMap.Size);
            DialogResult dialogResult  = mapSizeDialog.ShowDialog(this);

            if (dialogResult == DialogResult.Cancel)
            {
                return;
            }

            AddMapAction(new MapActionResize(activeMap.Size, mapSizeDialog.MapSize));

            activeMap.ResizeMap(mapSizeDialog.MapSize);
            changeSinceRender = true;
            this.ClientSize   = new System.Drawing.Size(mapSizeDialog.MapSize.Width * sizeModifier, mapSizeDialog.MapSize.Height * sizeModifier + System.Windows.Forms.SystemInformation.HorizontalScrollBarHeight + 5);
            pnlImage.Image    = activeMap.GetRenderedMap(showTiles, showObjects);
            pnlImage.Invalidate();
        }
Пример #2
0
        private void CreateNewMap()
        {
            var          mapSizeDialog = new MapSizeDialog(new Size(initialWidth, initialHeight));
            DialogResult dialogResult  = mapSizeDialog.ShowDialog(this);

            if (dialogResult == DialogResult.Cancel)
            {
                return;
            }

            CreateNewMapCore(mapSizeDialog.MapSize.Width, mapSizeDialog.MapSize.Height);
        }