Example #1
0
        private void ImportButton_Click(object sender, EventArgs e)
        {
            string Path = string.Empty;

            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "Text File|*.txt";
            ofd.ShowDialog();

            if (ofd.FileName == string.Empty)
            {
                return;
            }

            Path = ofd.FileName;

            string data;

            using (var sr = new StreamReader(Path))
            {
                data = sr.ReadToEnd();
            }

            var quests = data.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var m in quests)
            {
                QuestInfo.FromText(m);
            }

            UpdateInterface();
            MessageBox.Show("Quest Import complete");
        }