Ejemplo n.º 1
0
        void ExportSelectedPage_Click(object sender, EventArgs e)
        {
            var dialog = new Minge.FolderSelect.FolderSelectDialog();

            dialog.Title            = "Export VT Page To...";
            dialog.InitialDirectory = Properties.Settings.Default.LastExportDirectory;
            var result = dialog.ShowDialog();

            if (result)
            {
                if (Directory.Exists(dialog.FileName))
                {
                    Properties.Settings.Default.LastExportDirectory = dialog.FileName;
                    Properties.Settings.Default.Save();
                    List <crVTMapEntry> entries = null;
                    if (PageType.SelectedItem == "Diffuse")
                    {
                        entries = DiffuseMap.Entries;
                    }
                    else if (PageType.SelectedItem == "Specular")
                    {
                        entries = SpecularMap.Entries;
                    }
                    else if (PageType.SelectedItem == "Normal")
                    {
                        entries = NormalMap.Entries;
                    }
                    crVTPage vtPage = (crVTPage)PageNumSelect.SelectedItem;

                    int numTextures = 0;
                    foreach (var entry in entries)
                    {
                        SaveTexture(entry, Path.Combine(dialog.FileName, Path.GetFileNameWithoutExtension(entry.FileName) + ".png"), vtPage);
                        numTextures++;
                    }

                    MessageBox.Show(numTextures + " Textures Saved!", "Save Complete", MessageBoxButtons.OK);
                }
            }
        }
Ejemplo n.º 2
0
        void ExportSelectedPage_Click(object sender, EventArgs e)
        {
            var dialog = new Minge.FolderSelect.FolderSelectDialog();
            dialog.Title = "Export VT Page To...";
            dialog.InitialDirectory = Properties.Settings.Default.LastExportDirectory;
            var result = dialog.ShowDialog();
            if (result)
            {
                if (Directory.Exists(dialog.FileName))
                {
                    Properties.Settings.Default.LastExportDirectory = dialog.FileName;
                    Properties.Settings.Default.Save();
                    List<crVTMapEntry> entries = null;
                    if (PageType.SelectedItem == "Diffuse") entries = DiffuseMap.Entries;
                    else if (PageType.SelectedItem == "Specular") entries = SpecularMap.Entries;
                    else if (PageType.SelectedItem == "Normal") entries = NormalMap.Entries;
                    crVTPage vtPage = (crVTPage)PageNumSelect.SelectedItem;

                    int numTextures = 0;
                    foreach (var entry in entries)
                    {
                        SaveTexture(entry, Path.Combine(dialog.FileName, Path.GetFileNameWithoutExtension(entry.FileName) + ".png"), vtPage);
                        numTextures++;
                    }

                    MessageBox.Show(numTextures + " Textures Saved!", "Save Complete", MessageBoxButtons.OK);
                }
            }
        }