Example #1
0
        // Loading Mat
        private void button2_Click(object sender, EventArgs e)
        {
            MaterialSelector m = new MaterialSelector();

            m.ShowDialog();
            if (m.exitStatus == MaterialSelector.Opened)
            {
                FileData f = new FileData(m.path);

                int soff = f.readInt();

                NUD._s_Poly pol = new NUD._s_Poly()
                {
                    texprop1 = f.readInt(),
                    texprop2 = f.readInt(),
                    texprop3 = f.readInt(),
                    texprop4 = f.readInt()
                };

                int texid = poly.materials[0].textures[0].hash;
                poly.materials = NUD.readMaterial(f, pol, soff);
                poly.materials[0].textures[0].hash = texid;
                material = poly.materials;
                Console.WriteLine(material.Count);
                current = 0;
                Init();
                FillForm();
            }

            /*using (var ofd = new OpenFileDialog())
             * {
             *  ofd.Filter = "Namco Material (NMT)|*.nmt|" +
             *               "All files(*.*)|*.*";
             *
             *  if (ofd.ShowDialog() == DialogResult.OK)
             *  {
             *      if (ofd.FileName.EndsWith(".nmt"))
             *      {
             *          FileData f = new FileData(ofd.FileName);
             *
             *          int soff = f.readInt();
             *
             *          NUD._s_Poly pol = new NUD._s_Poly()
             *          {
             *              texprop1 = f.readInt(),
             *              texprop2 = f.readInt(),
             *              texprop3 = f.readInt(),
             *              texprop4 = f.readInt()
             *          };
             *
             *          poly.materials = NUD.readMaterial(f, pol, soff);
             *          material = poly.materials;
             *          Console.WriteLine(material.Count);
             *          current = 0;
             *          Init();
             *          FillForm();
             *      }
             *  }
             * }*/
        }