Example #1
0
 public void load_chr(string path)
 {
     this.listBox.Items.Clear();
     BinaryReader binaryReader = new BinaryReader(File.Open(path, FileMode.Open), Encoding.GetEncoding("EUC-KR"));
     int num = (int)binaryReader.ReadInt16();
     for (int num2 = 0; num2 != num; num2++)
     {
         Mesh mesh = new Mesh();
         mesh.read(ref binaryReader);
         this.list_mesh.Add(mesh);
     }
     int num3 = (int)binaryReader.ReadInt16();
     for (int num2 = 0; num2 != num3; num2++)
     {
         Motion motion = new Motion();
         motion.read(ref binaryReader);
         this.list_motion.Add(motion);
     }
     int num4 = (int)binaryReader.ReadInt16();
     for (int num2 = 0; num2 != num4; num2++)
     {
         Effect effect = new Effect();
         effect.read(ref binaryReader);
         this.list_effect.Add(effect);
     }
     int num5 = (int)binaryReader.ReadInt16();
     for (int num2 = 0; num2 != num5; num2++)
     {
         Character character = new Character();
         character.read(ref binaryReader);
         if (character.is_active == 1)
         {
             this.listBox.Items.Add(string.Concat(new object[]
             {
                 "[",
                 num2,
                 "]",
                 character.name
             }));
         }
         else
         {
             this.listBox.Items.Add("[" + num2 + "] Inactivate");
         }
         this.list_character.Add(character);
     }
     binaryReader.Close();
 }
Example #2
0
 public void load_chr(string path)
 {
     this.treeView.Nodes.Clear();
     this.list_mesh.Clear();
     this.list_character.Clear();
     this.list_effect.Clear();
     this.list_motion.Clear();
     BinaryReader binaryReader = new BinaryReader(File.Open(path, FileMode.Open), Encoding.GetEncoding("EUC-KR"));
     int num = (int)binaryReader.ReadInt16();
     this.treeView.Nodes.Add("Skeleton-ZMD [" + num + "]");
     for (int num2 = 0; num2 != num; num2++)
     {
         Mesh mesh = new Mesh();
         mesh.read(ref binaryReader);
         this.treeView.Nodes[0].Nodes.Add(string.Concat(new object[]
         {
             "[",
             num2,
             "]",
             mesh.path
         }));
         this.list_mesh.Add(mesh);
     }
     int num3 = (int)binaryReader.ReadInt16();
     this.treeView.Nodes.Add("Motion-ZMO [" + num3 + "]");
     for (int num2 = 0; num2 != num3; num2++)
     {
         Motion motion = new Motion();
         motion.read(ref binaryReader);
         this.treeView.Nodes[1].Nodes.Add(string.Concat(new object[]
         {
             "[",
             num2,
             "]",
             motion.path
         }));
         this.list_motion.Add(motion);
     }
     int num4 = (int)binaryReader.ReadInt16();
     this.treeView.Nodes.Add("Effect-eft [" + num4 + "]");
     for (int num2 = 0; num2 != num4; num2++)
     {
         Effect effect = new Effect();
         effect.read(ref binaryReader);
         this.treeView.Nodes[2].Nodes.Add(string.Concat(new object[]
         {
             "[",
             num2,
             "]",
             effect.path
         }));
         this.list_effect.Add(effect);
     }
     int num5 = (int)binaryReader.ReadInt16();
     for (int num2 = 0; num2 != num5; num2++)
     {
         Character character = new Character();
         character.read(ref binaryReader);
         if (character.is_active == 1)
         {
             this.treeViewCharacter.Nodes.Add(string.Concat(new object[]
             {
                 "Mob [",
                 num2,
                 "] : \"",
                 character.name,
                 "\""
             }));
             this.treeViewCharacter.Nodes[num2].Nodes.Add("Parts [" + character.List_Mesh.Count + "]");
             for (int num6 = 0; num6 != character.List_Mesh.Count; num6++)
             {
                 this.treeViewCharacter.Nodes[num2].Nodes[0].Nodes.Add(Convert.ToString(character.List_Mesh[num6].zscobjid));
             }
             this.treeViewCharacter.Nodes[num2].Nodes.Add("Animations [" + character.List_Motion.Count + "]");
             for (int num6 = 0; num6 != character.List_Motion.Count; num6++)
             {
                 this.treeViewCharacter.Nodes[num2].Nodes[1].Nodes.Add(Convert.ToString((CHRForm.type_action)character.List_Motion[num6].id));
             }
             this.treeViewCharacter.Nodes[num2].Nodes.Add("Effects [" + character.List_Effect.Count + "]");
             for (int num6 = 0; num6 != character.List_Effect.Count; num6++)
             {
                 this.treeViewCharacter.Nodes[num2].Nodes[2].Nodes.Add(Convert.ToString((CHRForm.type_action)character.List_Effect[num6].id));
             }
         }
         else
         {
             this.treeViewCharacter.Nodes.Add("Mob [" + num2 + "] : inactivate");
         }
         this.list_character.Add(character);
     }
     binaryReader.Close();
 }
Example #3
0
 private void addPathToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.treeView.SelectedNode.Level == 1)
     {
         TreeNode treeNode = this.treeView.SelectedNode.Parent;
         if (treeNode.Index == 0)
         {
             this.treeView.Nodes[0].Nodes.Add("[" + this.list_mesh.Count + "]New Mesh link");
             Mesh mesh = new Mesh();
             mesh.path = "path";
             this.list_mesh.Add(mesh);
             this.treeView.Nodes[0].Text = "Skeleton-ZMD [" + this.list_mesh.Count + "]";
         }
         else if (treeNode.Index == 1)
         {
             this.treeView.Nodes[1].Nodes.Add("[" + this.list_motion.Count + "]New Motion link");
             Motion motion = new Motion();
             motion.path = "path";
             this.list_motion.Add(motion);
             this.treeView.Nodes[1].Text = "Motion-ZMO [" + this.list_motion.Count + "]";
         }
         else if (treeNode.Index == 2)
         {
             this.treeView.Nodes[2].Nodes.Add("[" + this.list_effect.Count + "]New Effect link");
             Effect effect = new Effect();
             effect.path = "path";
             this.list_effect.Add(effect);
             this.treeView.Nodes[2].Text = "Effect-eft [" + this.list_effect.Count + "]";
         }
     }
     else
     {
         TreeNode treeNode = this.treeView.SelectedNode;
         if (treeNode.Index == 0)
         {
             this.treeView.Nodes[0].Nodes.Add("[" + this.list_mesh.Count + "]New Mesh link");
             Mesh mesh = new Mesh();
             mesh.path = "path";
             this.list_mesh.Add(mesh);
             this.treeView.Nodes[0].Text = "Skeleton-ZMD [" + this.list_mesh.Count + "]";
         }
         else if (treeNode.Index == 1)
         {
             this.treeView.Nodes[1].Nodes.Add("[" + this.list_motion.Count + "]New Motion link");
             Motion motion = new Motion();
             motion.path = "path";
             this.list_motion.Add(motion);
             this.treeView.Nodes[1].Text = "Motion-ZMO [" + this.list_motion.Count + "]";
         }
         else if (treeNode.Index == 2)
         {
             this.treeView.Nodes[2].Nodes.Add("[" + this.list_effect.Count + "]New Effect link");
             Effect effect = new Effect();
             effect.path = "path";
             this.list_effect.Add(effect);
             this.treeView.Nodes[2].Text = "Effect-eft [" + this.list_effect.Count + "]";
         }
     }
 }