private static void LoadAllDialog()
 {
     Nodes.Clear();
     Object[] array = Resources.LoadAll("Dialog", typeof(TextAsset));
     Log.Message(">>" + "Dialog");
     foreach (Object @object in array)
     {
         TextAsset ass = @object as TextAsset;
         if (@object.name == "BaseEncounters" || @object.name == "GeneratedDialogs")
         {
             LayerLoader.LoadFileIntoList(ass, Nodes, NodeLists, DiaNodeType.BaseEncounters);
         }
         if (@object.name == "InsanityBattles")
         {
             LayerLoader.LoadFileIntoList(ass, Nodes, NodeLists, DiaNodeType.InsanityBattles);
         }
         if (@object.name == "SpecialEncounters")
         {
             LayerLoader.LoadFileIntoList(ass, Nodes, NodeLists, DiaNodeType.Special);
         }
     }
     foreach (DiaNodeMold node in Nodes)
     {
         node.PostLoad();
     }
     LayerLoader.MarkNonRootNodes(Nodes);
 }
 public static void MarkNonRootNodes(List <DiaNodeMold> NodeList)
 {
     foreach (DiaNodeMold current in NodeList)
     {
         LayerLoader.RecursiveSetIsRootFalse(current);
     }
     foreach (DiaNodeMold current2 in NodeList)
     {
         foreach (DiaNodeMold current3 in NodeList)
         {
             foreach (DiaOptionMold current4 in current3.optionList)
             {
                 bool flag = false;
                 foreach (string current5 in current4.ChildNodeNames)
                 {
                     if (current5 == current2.name)
                     {
                         flag = true;
                     }
                 }
                 if (flag)
                 {
                     current2.isRoot = false;
                 }
             }
         }
     }
 }
Exemple #3
0
 private static void LoadAllDialog()
 {
     DialogDatabase.Nodes.Clear();
     UnityEngine.Object[] array = Resources.LoadAll("Dialog", typeof(TextAsset));
     foreach (UnityEngine.Object @object in array)
     {
         TextAsset ass = @object as TextAsset;
         if (@object.name == "BaseEncounters" || @object.name == "GeneratedDialogs")
         {
             LayerLoader.LoadFileIntoList(ass, DialogDatabase.Nodes, DialogDatabase.NodeLists, DiaNodeType.BaseEncounters);
         }
         if (@object.name == "InsanityBattles")
         {
             LayerLoader.LoadFileIntoList(ass, DialogDatabase.Nodes, DialogDatabase.NodeLists, DiaNodeType.InsanityBattles);
         }
         if (@object.name == "SpecialEncounters")
         {
             LayerLoader.LoadFileIntoList(ass, DialogDatabase.Nodes, DialogDatabase.NodeLists, DiaNodeType.Special);
         }
     }
     foreach (DiaNodeMold diaNodeMold in DialogDatabase.Nodes)
     {
         diaNodeMold.PostLoad();
     }
     LayerLoader.MarkNonRootNodes(DialogDatabase.Nodes);
 }
 public static void MarkNonRootNodes(List <DiaNodeMold> NodeList)
 {
     foreach (DiaNodeMold d in NodeList)
     {
         LayerLoader.RecursiveSetIsRootFalse(d);
     }
     foreach (DiaNodeMold diaNodeMold in NodeList)
     {
         foreach (DiaNodeMold diaNodeMold2 in NodeList)
         {
             foreach (DiaOptionMold diaOptionMold in diaNodeMold2.optionList)
             {
                 bool flag = false;
                 foreach (string a in diaOptionMold.ChildNodeNames)
                 {
                     if (a == diaNodeMold.name)
                     {
                         flag = true;
                     }
                 }
                 if (flag)
                 {
                     diaNodeMold.isRoot = false;
                 }
             }
         }
     }
 }
 public static void MarkNonRootNodes(List <DiaNodeMold> NodeList)
 {
     foreach (DiaNodeMold Node in NodeList)
     {
         LayerLoader.RecursiveSetIsRootFalse(Node);
     }
     foreach (DiaNodeMold Node2 in NodeList)
     {
         foreach (DiaNodeMold Node3 in NodeList)
         {
             foreach (DiaOptionMold option in Node3.optionList)
             {
                 bool flag = false;
                 foreach (string childNodeName in option.ChildNodeNames)
                 {
                     if (childNodeName == Node2.name)
                     {
                         flag = true;
                     }
                 }
                 if (flag)
                 {
                     Node2.isRoot = false;
                 }
             }
         }
     }
 }
 private static void RecursiveSetIsRootFalse(DiaNodeMold d)
 {
     foreach (DiaOptionMold current in d.optionList)
     {
         foreach (DiaNodeMold current2 in current.ChildNodes)
         {
             current2.isRoot = false;
             LayerLoader.RecursiveSetIsRootFalse(current2);
         }
     }
 }
 private static void RecursiveSetIsRootFalse(DiaNodeMold d)
 {
     foreach (DiaOptionMold diaOptionMold in d.optionList)
     {
         foreach (DiaNodeMold diaNodeMold in diaOptionMold.ChildNodes)
         {
             diaNodeMold.isRoot = false;
             LayerLoader.RecursiveSetIsRootFalse(diaNodeMold);
         }
     }
 }
 private static void RecursiveSetIsRootFalse(DiaNodeMold d)
 {
     foreach (DiaOptionMold option in d.optionList)
     {
         foreach (DiaNodeMold childNode in option.ChildNodes)
         {
             childNode.isRoot = false;
             LayerLoader.RecursiveSetIsRootFalse(childNode);
         }
     }
 }