Esempio n. 1
0
 public void GenerateGraph(int n)
 {
     graphEditor.nodeLayer.RemoveAllChildren();
     graphEditor.edgeLayer.RemoveAllChildren();
     Sequence seq = new Sequence(pcc, n);
     StartPosEvents = 0;
     StartPosActions = 0;
     StartPosVars = 0;
     Objects = new List<SObj>();
     if (CurrentObjects != null)
     {
         for (int i = 0; i < CurrentObjects.Count(); i++)
         {
             LoadObjects(CurrentObjects[i]);
         }
         CreateConnections();
     }
     foreach (SObj o in Objects)
     {
         o.refreshView = RefreshView;
         o.MouseDown += new PInputEventHandler(node_MouseDown);
     }
     if (SavedPositions.Count == 0 && CurrentFile.Contains("_LOC_INT"))
     {
         LoadDialogueObjects();
     }
 }
Esempio n. 2
0
 public void GetObjects(int n)
 {
     CurrentObjects = new List<int>();
     listBox1.Items.Clear();
     Sequence seq = new Sequence(pcc, n);
     if (seq.SequenceObjects != null)
         for (int i = 0; i < seq.SequenceObjects.Count(); i++)
         {
             int m = seq.SequenceObjects[i] - 1;
             CurrentObjects.Add(m);
             listBox1.Items.Add("#" + m.ToString() + " :" + pcc.Exports[m].ObjectName + " class: " + pcc.Exports[m].ClassName);
         }
 }
Esempio n. 3
0
 public TreeNode FindSequences(PCCObject pcc, int index, bool wantFullName = false, bool refSeq = false)
 {
     string objectName = "";
     if (refSeq)
     {
         List<SaltPropertyReader.Property> p = SaltPropertyReader.getPropList(pcc, pcc.Exports[index].Data);
         for (int i = 0; i < p.Count(); i++)
             if (p[i].Name == "ObjName")
             {
                 objectName = p[i].Value.StringValue;
                 break;
             }
     }
     else
     {
         objectName = pcc.Exports[index].ObjectName;
     }
     TreeNode ret = new TreeNode("#" + index.ToString() + ": " + (wantFullName ? pcc.Exports[index].GetFullPath : objectName));
     ret.Name = index.ToString();
     Sequence seq = new Sequence(pcc, index);
     if (seq.SequenceObjects != null)
         for (int i = 0; i < seq.SequenceObjects.Count(); i++)
             if (pcc.Exports[seq.SequenceObjects[i] - 1].ClassName == "Sequence" || pcc.Exports[seq.SequenceObjects[i] - 1].ClassName.StartsWith("PrefabSequence"))
             {
                 TreeNode t = FindSequences(pcc, seq.SequenceObjects[i] - 1, wantFullName);
                 ret.Nodes.Add(t);
             }
             else if (pcc.Exports[seq.SequenceObjects[i] - 1].ClassName == "SequenceReference")
             {
                 var props = SaltPropertyReader.getPropList(pcc, pcc.Exports[seq.SequenceObjects[i] - 1].Data);
                 var propSequenceReference = props.FirstOrDefault(p => p.Name.Equals("oSequenceReference"));
                 if (propSequenceReference != null)
                 {
                     TreeNode t = FindSequences(pcc, propSequenceReference.Value.IntValue - 1, wantFullName, true);
                     ret.Nodes.Add(t);
                 }
             }
     return ret;
 }