Example #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            try
            {
                var dialog = new MapAttrDialog();
                if (dialog.ShowDialog() != DialogResult.OK)
                {
                    throw new Exception();
                }

                var spriteDialog = new OpenFileDialog();
                spriteDialog.Filter = "PB Sprite files(*.pbs)|*.pbs";
                if (spriteDialog.ShowDialog() != DialogResult.OK)
                {
                    throw new Exception();
                }

                this.initialize(dialog.Rows, dialog.Columns, dialog.TileWidth, dialog.TileHeight, spriteDialog.FileName);
                this.updateStateView();
            }
            catch (Exception exc)
            {
                Application.Exit();
            }
        }
Example #2
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var dialog = new MapAttrDialog();

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var spriteDialog = new OpenFileDialog();

            spriteDialog.Filter = "PB Sprite files(*.pbs)|*.pbs";
            if (spriteDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            this.initialize(dialog.Columns, dialog.Rows, dialog.TileWidth, dialog.TileHeight, spriteDialog.FileName);
        }