Exemple #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            file          = file ?? new SHNFile(txtFileName.Text + ".shn");
            file.FilePath = txtFileName.Text + (file.GetType() == typeof(ShineFile) ? ".txt" : ".shn");
            file.IsSaved  = false;

            if (cbFileType.SelectedIndex == 2)
            {
                using (var frm = new frmQuestDependencies())
                {
                    if (frm.ShowDialog(this) == DialogResult.OK)
                    {
                        file = new QuestFile(txtFileName.Text + ".shn", true, frm.MobInfoPath, frm.ItemInfoPath);
                    }
                }

                using (var frm = new frmChooseQuestVersion((QuestFile)file))
                {
                    if (frm.ShowDialog(this) != DialogResult.OK)
                    {
                        ((QuestFile)file).QuestFileVersion = QuestFileVersion.NA11;
                    }
                }
            }

            if (file.GetType() == typeof(SHNFile))
            {
                ((SHNFile)file).CreateFile();
            }

            Program.LoadedFiles.Add(file);
        }
Exemple #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            file = file ?? new SHNFile(txtFileName.Text + ".shn");
            file.FilePath = txtFileName.Text + (file.GetType() == typeof(ShineFile) ? ".txt" : ".shn");
            file.IsSaved = false;

            if (cbFileType.SelectedIndex == 2)
            {
                using (var frm = new frmQuestDependencies())
                {
                    if (frm.ShowDialog(this) == DialogResult.OK)
                    {
                        file = new QuestFile(txtFileName.Text + ".shn", true, frm.MobInfoPath, frm.ItemInfoPath);
                    }
                }

                using (var frm = new frmChooseQuestVersion((QuestFile)file))
                {
                    if (frm.ShowDialog(this) != DialogResult.OK)
                    {
                        ((QuestFile)file).QuestFileVersion = QuestFileVersion.NA11;
                    }
                }
            }

            if (file.GetType() == typeof(SHNFile))
                ((SHNFile)file).CreateFile();

            Program.LoadedFiles.Add(file);
        }