Esempio n. 1
0
 public static void WriteExternalFiles(ResFile resFile, TreeNode EditorRoot)
 {
     resFile.ExternalFiles.Clear();
     if (EditorRoot.Nodes.ContainsKey("EXT"))
     {
         foreach (TreeNode node in EditorRoot.Nodes["EXT"].Nodes)
         {
             ExternalFile ext = new ExternalFile();
             if (node is BinaryTextureContainer)
             {
                 BinaryTextureContainer bntx = (BinaryTextureContainer)node;
                 ext.Data = bntx.Save();
             }
             else if (node is BfshaFileData)
             {
                 ext.Data = ((BfshaFileData)node).Data;
             }
             else
             {
                 ext.Data = ((ExternalFileData)node).Data;
             }
             resFile.ExternalFiles.Add(node.Text, ext);
         }
     }
 }
Esempio n. 2
0
        public void Load()
        {
            IsActive    = true;
            UseEditMenu = true;
            CanSave     = true;

            bntx       = new BinaryTextureContainer(Data, FileName, "", this);
            EditorRoot = bntx;
        }
        public void LoadSetting(TextureImporterSettings setting, BinaryTextureContainer b)
        {
            settings = new List <TextureImporterSettings>();
            settings.Add(setting);
            bntx = b;

            listViewCustom1.Items.Add(setting.TexName).SubItems.Add(setting.Format.ToString());
            listViewCustom1.Items[0].Selected = true;
            listViewCustom1.Select();
        }
        public void LoadSettings(List <TextureImporterSettings> s, BinaryTextureContainer b)
        {
            settings = s;
            bntx     = b;

            foreach (var setting in settings)
            {
                listViewCustom1.Items.Add(setting.TexName).SubItems.Add(setting.Format.ToString());
            }
            listViewCustom1.Items[0].Selected = true;
            listViewCustom1.Select();
        }
        public void LoadSettings(List <TextureImporterSettings> s, BinaryTextureContainer b)
        {
            settings = s;
            bntx     = b;

            foreach (var setting in settings)
            {
                ListViewItem item = new ListViewItem();
                item.Text = setting.TexName;
                listViewCustom1.Items.Add(item);
            }
        }
Esempio n. 6
0
        private void AddTexture(BinaryTextureContainer bntx)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "Supported Formats|*.bftex;*.dds; *.png;*.tga;*.jpg;*.tiff|" +
                         "Binary Texture |*.bftex|" +
                         "Microsoft DDS |*.dds|" +
                         "Portable Network Graphics |*.png|" +
                         "Joint Photographic Experts Group |*.jpg|" +
                         "Bitmap Image |*.bmp|" +
                         "Tagged Image File Format |*.tiff|" +
                         "All files(*.*)|*.*";
            ofd.DefaultExt  = "bftex";
            ofd.Multiselect = true;

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                foreach (string name in ofd.FileNames)
                {
                    bntx.AddTexture(name);
                    listView1.Items.Add(System.IO.Path.GetFileNameWithoutExtension(name));
                }
            }
        }