Ejemplo n.º 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++)
     {
         Materiel materiel = new Materiel();
         materiel.read(ref binaryReader);
         this.list_materiel.Add(materiel);
     }
     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++)
     {
         Object @object = new Object();
         @object.read(ref binaryReader);
         this.list_object.Add(@object);
         this.listBox.Items.Add("Entry [" + num2 + "] : ");
     }
     binaryReader.Close();
 }
Ejemplo n.º 2
0
 public void load_zsc(string path)
 {
     this.treeView.Nodes.Clear();
     this.treeViewObject.Nodes.Clear();
     this.list_mesh.Clear();
     this.list_effect.Clear();
     this.list_materiel.Clear();
     this.list_object.Clear();
     BinaryReader binaryReader = new BinaryReader(File.Open(path, FileMode.Open));
     int num = (int)binaryReader.ReadInt16();
     this.treeView.Nodes.Add("Mesh-ZMS [" + 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("Materiel-DDS [" + num3 + "]");
     for (int num2 = 0; num2 != num3; num2++)
     {
         Materiel materiel = new Materiel();
         materiel.read(ref binaryReader);
         this.treeView.Nodes[1].Nodes.Add(string.Concat(new object[]
         {
             "[",
             num2,
             "]",
             materiel.path
         }));
         this.list_materiel.Add(materiel);
     }
     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++)
     {
         Object @object = new Object();
         @object.read(ref binaryReader);
         this.list_object.Add(@object);
         this.treeViewObject.Nodes.Add("Entry [" + num2 + "] : ");
         this.treeViewObject.Nodes[num2].Nodes.Add("Meshs [" + @object.list_mesh.Count + "]");
         for (int num6 = 0; num6 != @object.list_mesh.Count; num6++)
         {
             this.treeViewObject.Nodes[num2].Nodes[0].Nodes.Add(string.Concat(new object[]
             {
                 "Model [",
                 @object.list_mesh[num6].mesh_id,
                 "] with Texture [",
                 @object.list_mesh[num6].material_id,
                 "]"
             }));
         }
         this.treeViewObject.Nodes[num2].Nodes.Add("Effects [" + @object.list_effect.Count + "]");
         for (int num6 = 0; num6 != @object.list_effect.Count; num6++)
         {
             this.treeViewObject.Nodes[num2].Nodes[1].Nodes.Add("Effect[" + @object.list_effect[num6].effect_id + "]");
         }
     }
     binaryReader.Close();
 }
Ejemplo n.º 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 = "Mesh-ZMS [" + this.list_mesh.Count + "]";
         }
         else if (treeNode.Index == 1)
         {
             this.treeView.Nodes[1].Nodes.Add("[" + this.list_materiel.Count + "]New Materiel link");
             Materiel materiel = new Materiel();
             materiel.path = "path";
             this.list_materiel.Add(materiel);
             this.treeView.Nodes[1].Text = "Materiel-DDS [" + this.list_materiel.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 = "Mesh-ZMS [" + this.list_mesh.Count + "]";
         }
         else if (treeNode.Index == 1)
         {
             this.treeView.Nodes[1].Nodes.Add("[" + this.list_materiel.Count + "]New Materiel link");
             Materiel materiel = new Materiel();
             materiel.path = "path";
             this.list_materiel.Add(materiel);
             this.treeView.Nodes[1].Text = "Materiel-DDS [" + this.list_materiel.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 + "]";
         }
     }
 }
Ejemplo n.º 4
0
        public void load_zsc(string path)
        {
            this.treeView.Nodes.Clear();
            this.treeViewObject.Nodes.Clear();
            this.list_mesh.Clear();
            this.list_effect.Clear();
            this.list_materiel.Clear();
            this.list_object.Clear();
            BinaryReader binaryReader = new BinaryReader(File.Open(path, FileMode.Open));
            int          num          = (int)binaryReader.ReadInt16();

            this.treeView.Nodes.Add("Mesh-ZMS [" + 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("Materiel-DDS [" + num3 + "]");
            for (int num2 = 0; num2 != num3; num2++)
            {
                Materiel materiel = new Materiel();
                materiel.read(ref binaryReader);
                this.treeView.Nodes[1].Nodes.Add(string.Concat(new object[]
                {
                    "[",
                    num2,
                    "]",
                    materiel.path
                }));
                this.list_materiel.Add(materiel);
            }
            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++)
            {
                Object @object = new Object();
                @object.read(ref binaryReader);
                this.list_object.Add(@object);
                this.treeViewObject.Nodes.Add("Entry [" + num2 + "] : ");
                this.treeViewObject.Nodes[num2].Nodes.Add("Meshs [" + @object.list_mesh.Count + "]");
                for (int num6 = 0; num6 != @object.list_mesh.Count; num6++)
                {
                    this.treeViewObject.Nodes[num2].Nodes[0].Nodes.Add(string.Concat(new object[]
                    {
                        "Model [",
                        @object.list_mesh[num6].mesh_id,
                        "] with Texture [",
                        @object.list_mesh[num6].material_id,
                        "]"
                    }));
                }
                this.treeViewObject.Nodes[num2].Nodes.Add("Effects [" + @object.list_effect.Count + "]");
                for (int num6 = 0; num6 != @object.list_effect.Count; num6++)
                {
                    this.treeViewObject.Nodes[num2].Nodes[1].Nodes.Add("Effect[" + @object.list_effect[num6].effect_id + "]");
                }
            }
            binaryReader.Close();
        }