Example #1
0
        bool LoadFile()
        {
            try
            {
                XDocument doc = XDocument.Load(activeFilePath);

                if (!doc.Root.Elements("Asset").Attributes().Any(a => a.ToString().Contains("CutsceneScreenLibrary.Cue"))) throw new Exception("Must load a cutscene xml file.");

                //MessageBox.Show(doc.Root.FirstAttribute.Name.ToString());

                foreach (XElement element in doc.Root.Elements("Asset").Elements("Item"))
                {
                    Cue cue = new Cue();
                    cue.CueType = element.Element("CueType").Value;
                    foreach (XElement data in element.Element("CueData").Elements("Item")) cue.CueData.Add(data.Value);
                    cues.Add(cue);
                }

                cueListBox.SelectedIndex = -1;
                cmbCueType.SelectedIndex = -1;
                RefreshCueList();

                fileHasChanged = false;

                return true;
            }
            catch (Exception e)
            {
                MessageBox.Show("Failed to load file...\n" + e.ToString());
            }

            return false;
        }
Example #2
0
 public DialogCue(Cue cue)
     : this(cue.CueType, cue.CueData)
 {
 }