Example #1
0
 public string GetDialogue(MissionNPC npc, Stage stage)
 {
     try
     {
         XmlDocument xdoc = new XmlDocument();
         xdoc.Load(filepath);
         string key = parseKey(npc.GetName(), npc.GetMissionType(), stage);
         if (xdoc.SelectSingleNode(key) == null)
         {
             return "Can't find dialogue for key:\n     "+key;
         }
         return xdoc.SelectSingleNode(key).InnerText;
     }
     catch (FileNotFoundException e)
     {
         UI.Notify(e.Message);
         UI.ShowSubtitle(e.StackTrace + "\n" + e.Message, 7000);
     }
     catch (Exception e)
     {
         UI.Notify(e.Message);
         UI.ShowSubtitle(e.StackTrace+"\n"+ e.Message, 7000);
     }
     return "Can't find key";
 }