Add batch export for lm2 textures
This commit is contained in:
parent
5582f31c38
commit
ab00bcd09a
@ -10,6 +10,56 @@ using System.Windows.Forms;
|
||||
|
||||
namespace FirstPlugin.LuigisMansion.DarkMoon
|
||||
{
|
||||
public class TextureFolder : TreeNodeCustom, IContextMenuNode
|
||||
{
|
||||
public TextureFolder(string text)
|
||||
{
|
||||
Text = text;
|
||||
}
|
||||
|
||||
public ToolStripItem[] GetContextMenuItems()
|
||||
{
|
||||
List<ToolStripItem> Items = new List<ToolStripItem>();
|
||||
Items.Add(new ToolStripMenuItem("Export", null, ExportAll, Keys.Control | Keys.E));
|
||||
return Items.ToArray();
|
||||
}
|
||||
|
||||
private void ExportAll(object sender, EventArgs args)
|
||||
{
|
||||
List<string> Formats = new List<string>();
|
||||
Formats.Add("Microsoft DDS (.dds)");
|
||||
Formats.Add("Portable Graphics Network (.png)");
|
||||
Formats.Add("Joint Photographic Experts Group (.jpg)");
|
||||
Formats.Add("Bitmap Image (.bmp)");
|
||||
Formats.Add("Tagged Image File Format (.tiff)");
|
||||
|
||||
FolderSelectDialog sfd = new FolderSelectDialog();
|
||||
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
string folderPath = sfd.SelectedPath;
|
||||
|
||||
BatchFormatExport form = new BatchFormatExport(Formats);
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
foreach (STGenericTexture tex in Nodes)
|
||||
{
|
||||
if (form.Index == 0)
|
||||
tex.SaveDDS(folderPath + '\\' + tex.Text + ".dds");
|
||||
else if (form.Index == 1)
|
||||
tex.SaveBitMap(folderPath + '\\' + tex.Text + ".png");
|
||||
else if (form.Index == 2)
|
||||
tex.SaveBitMap(folderPath + '\\' + tex.Text + ".jpg");
|
||||
else if (form.Index == 3)
|
||||
tex.SaveBitMap(folderPath + '\\' + tex.Text + ".bmp");
|
||||
else if (form.Index == 4)
|
||||
tex.SaveBitMap(folderPath + '\\' + tex.Text + ".tiff");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class TexturePOWE : STGenericTexture
|
||||
{
|
||||
public static readonly uint Identifier = 0xE977D350;
|
||||
|
Loading…
x
Reference in New Issue
Block a user