예제 #1
0
        private void NewCharacterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmRace frmRace = new frmRace();

            frmRace.ShowDialog();
            Player player = frmRace.getPlayer();

            if (frmRace.DialogResult == DialogResult.OK)
            {
                frmSpecial Special = new frmSpecial(player);
                Special.ShowDialog();

                if (Special.DialogResult == DialogResult.OK)
                {
                    frmTag Tag = new frmTag(player);
                    Tag.ShowDialog();

                    if (Tag.DialogResult == DialogResult.OK)
                    {
                        this.player    = player;
                        player.Created = true;

                        FrmCareer career = new FrmCareer(player)
                        {
                            MdiParent   = this,
                            WindowState = FormWindowState.Maximized
                        };

                        career.Show();
                        closeCharacterToolStripMenuItem.Visible = true;
                    }
                }
            }
        }
예제 #2
0
        private void LoadCharacterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog()
            {
                Filter = "G.E.C.K Files (*.geck)|*.geck|All Files (*.*)|*.*"
            };

            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                LoadCharacter(openFileDialog.FileName);
            }

            FrmCareer career = new FrmCareer(player);
        }
예제 #3
0
        private void LoadCharacter(string fileName)
        {
            if (File.Exists(fileName) && fileName.EndsWith("geck"))
            {
                Player player = new Player()
                {
                    FileName = fileName
                };
                player.Load();
                this.player = player;

                FrmCareer career = new FrmCareer(player)
                {
                    MdiParent   = this,
                    WindowState = FormWindowState.Maximized
                };

                if (player.Created)
                {
                    career.Show();
                }
                closeCharacterToolStripMenuItem.Visible = true;
            }
        }