From 04266251aa2c6ea7f6fc88b4b60644979ad066b2 Mon Sep 17 00:00:00 2001 From: VaDiM Date: Mon, 27 Jul 2020 23:22:53 +0300 Subject: [PATCH] add "Dump with PathID as filename" feature --- AssetStudio/Properties/AssemblyInfo.cs | 4 +- AssetStudioGUI/ExportOptions.Designer.cs | 47 ++++++++++++------- AssetStudioGUI/ExportOptions.cs | 9 +--- AssetStudioGUI/Exporter.cs | 10 +++- AssetStudioGUI/Properties/AssemblyInfo.cs | 4 +- .../Properties/Settings.Designer.cs | 12 +++++ AssetStudioGUI/Properties/Settings.settings | 3 ++ AssetStudioGUI/app.config | 3 ++ AssetStudioUtility/Properties/AssemblyInfo.cs | 4 +- 9 files changed, 66 insertions(+), 30 deletions(-) diff --git a/AssetStudio/Properties/AssemblyInfo.cs b/AssetStudio/Properties/AssemblyInfo.cs index ec4ebff..8bbb5fd 100644 --- a/AssetStudio/Properties/AssemblyInfo.cs +++ b/AssetStudio/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.14.38.3")] -[assembly: AssemblyFileVersion("0.14.38.3")] +[assembly: AssemblyVersion("0.14.38.4")] +[assembly: AssemblyFileVersion("0.14.38.4")] diff --git a/AssetStudioGUI/ExportOptions.Designer.cs b/AssetStudioGUI/ExportOptions.Designer.cs index 26cece0..4f0a8fb 100644 --- a/AssetStudioGUI/ExportOptions.Designer.cs +++ b/AssetStudioGUI/ExportOptions.Designer.cs @@ -31,6 +31,8 @@ this.OKbutton = new System.Windows.Forms.Button(); this.Cancel = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.pathIDAsDumpName = new System.Windows.Forms.CheckBox(); + this.pathIDAsImageName = new System.Windows.Forms.CheckBox(); this.openAfterExport = new System.Windows.Forms.CheckBox(); this.restoreExtensionName = new System.Windows.Forms.CheckBox(); this.assetGroupOptions = new System.Windows.Forms.ComboBox(); @@ -59,7 +61,6 @@ this.castToBone = new System.Windows.Forms.CheckBox(); this.exportAllNodes = new System.Windows.Forms.CheckBox(); this.eulerFilter = new System.Windows.Forms.CheckBox(); - this.pathIDAsImageName = new System.Windows.Forms.CheckBox(); this.groupBox1.SuspendLayout(); this.panel1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -92,6 +93,7 @@ // groupBox1 // this.groupBox1.AutoSize = true; + this.groupBox1.Controls.Add(this.pathIDAsDumpName); this.groupBox1.Controls.Add(this.pathIDAsImageName); this.groupBox1.Controls.Add(this.openAfterExport); this.groupBox1.Controls.Add(this.restoreExtensionName); @@ -102,11 +104,35 @@ this.groupBox1.Controls.Add(this.converttexture); this.groupBox1.Location = new System.Drawing.Point(12, 13); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(232, 327); + this.groupBox1.Size = new System.Drawing.Size(246, 327); this.groupBox1.TabIndex = 9; this.groupBox1.TabStop = false; this.groupBox1.Text = "Export"; // + // pathIDAsDumpName + // + this.pathIDAsDumpName.AutoSize = true; + this.pathIDAsDumpName.Checked = true; + this.pathIDAsDumpName.CheckState = System.Windows.Forms.CheckState.Checked; + this.pathIDAsDumpName.Location = new System.Drawing.Point(6, 217); + this.pathIDAsDumpName.Name = "pathIDAsDumpName"; + this.pathIDAsDumpName.Size = new System.Drawing.Size(201, 17); + this.pathIDAsDumpName.TabIndex = 12; + this.pathIDAsDumpName.Text = "Dump assets with PathID as filename"; + this.pathIDAsDumpName.UseVisualStyleBackColor = true; + // + // pathIDAsImageName + // + this.pathIDAsImageName.AutoSize = true; + this.pathIDAsImageName.Checked = true; + this.pathIDAsImageName.CheckState = System.Windows.Forms.CheckState.Checked; + this.pathIDAsImageName.Location = new System.Drawing.Point(6, 196); + this.pathIDAsImageName.Name = "pathIDAsImageName"; + this.pathIDAsImageName.Size = new System.Drawing.Size(234, 17); + this.pathIDAsImageName.TabIndex = 11; + this.pathIDAsImageName.Text = "Export image assets with PathID as filename"; + this.pathIDAsImageName.UseVisualStyleBackColor = true; + // // openAfterExport // this.openAfterExport.AutoSize = true; @@ -250,9 +276,9 @@ this.groupBox2.Controls.Add(this.castToBone); this.groupBox2.Controls.Add(this.exportAllNodes); this.groupBox2.Controls.Add(this.eulerFilter); - this.groupBox2.Location = new System.Drawing.Point(250, 13); + this.groupBox2.Location = new System.Drawing.Point(258, 13); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(214, 327); + this.groupBox2.Size = new System.Drawing.Size(206, 327); this.groupBox2.TabIndex = 11; this.groupBox2.TabStop = false; this.groupBox2.Text = "Fbx"; @@ -449,18 +475,6 @@ this.eulerFilter.Text = "EulerFilter"; this.eulerFilter.UseVisualStyleBackColor = true; // - // pathIDAsImageName - // - this.pathIDAsImageName.AutoSize = true; - this.pathIDAsImageName.Checked = true; - this.pathIDAsImageName.CheckState = System.Windows.Forms.CheckState.Checked; - this.pathIDAsImageName.Location = new System.Drawing.Point(6, 196); - this.pathIDAsImageName.Name = "pathIDAsImageName"; - this.pathIDAsImageName.Size = new System.Drawing.Size(212, 17); - this.pathIDAsImageName.TabIndex = 11; - this.pathIDAsImageName.Text = "Use PathID as a name for image assets"; - this.pathIDAsImageName.UseVisualStyleBackColor = true; - // // ExportOptions // this.AcceptButton = this.OKbutton; @@ -527,5 +541,6 @@ private System.Windows.Forms.CheckBox restoreExtensionName; private System.Windows.Forms.CheckBox openAfterExport; private System.Windows.Forms.CheckBox pathIDAsImageName; + private System.Windows.Forms.CheckBox pathIDAsDumpName; } } \ No newline at end of file diff --git a/AssetStudioGUI/ExportOptions.cs b/AssetStudioGUI/ExportOptions.cs index 05ef2f6..da9bb01 100644 --- a/AssetStudioGUI/ExportOptions.cs +++ b/AssetStudioGUI/ExportOptions.cs @@ -1,11 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Text; using System.Windows.Forms; namespace AssetStudioGUI @@ -41,6 +34,7 @@ namespace AssetStudioGUI fbxVersion.SelectedIndex = Properties.Settings.Default.fbxVersion; fbxFormat.SelectedIndex = Properties.Settings.Default.fbxFormat; pathIDAsImageName.Checked = Properties.Settings.Default.pathIDAsImageName; + pathIDAsDumpName.Checked = Properties.Settings.Default.pathIDAsDumpName; } private void OKbutton_Click(object sender, EventArgs e) @@ -70,6 +64,7 @@ namespace AssetStudioGUI Properties.Settings.Default.fbxVersion = fbxVersion.SelectedIndex; Properties.Settings.Default.fbxFormat = fbxFormat.SelectedIndex; Properties.Settings.Default.pathIDAsImageName = pathIDAsImageName.Checked; + Properties.Settings.Default.pathIDAsDumpName = pathIDAsDumpName.Checked; Properties.Settings.Default.Save(); DialogResult = DialogResult.OK; Close(); diff --git a/AssetStudioGUI/Exporter.cs b/AssetStudioGUI/Exporter.cs index 62ef4a2..8a3c19b 100644 --- a/AssetStudioGUI/Exporter.cs +++ b/AssetStudioGUI/Exporter.cs @@ -375,7 +375,15 @@ namespace AssetStudioGUI public static bool ExportDumpFile(AssetItem item, string exportPath) { - var exportFullName = exportPath + item.Text + ".txt"; + string exportFullName; + if (Properties.Settings.Default.pathIDAsDumpName) + { + exportFullName = exportPath + item.m_PathID.ToString() + ".txt"; + } + else + { + exportFullName = exportPath + item.Text + ".txt"; + } if (ExportFileExists(exportFullName)) return false; var str = item.Asset.Dump(); diff --git a/AssetStudioGUI/Properties/AssemblyInfo.cs b/AssetStudioGUI/Properties/AssemblyInfo.cs index 83e1106..8dadd58 100644 --- a/AssetStudioGUI/Properties/AssemblyInfo.cs +++ b/AssetStudioGUI/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.14.38.3")] -[assembly: AssemblyFileVersion("0.14.38.3")] +[assembly: AssemblyVersion("0.14.38.4")] +[assembly: AssemblyFileVersion("0.14.38.4")] diff --git a/AssetStudioGUI/Properties/Settings.Designer.cs b/AssetStudioGUI/Properties/Settings.Designer.cs index 9827144..27f94de 100644 --- a/AssetStudioGUI/Properties/Settings.Designer.cs +++ b/AssetStudioGUI/Properties/Settings.Designer.cs @@ -274,5 +274,17 @@ namespace AssetStudioGUI.Properties { this["pathIDAsImageName"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool pathIDAsDumpName { + get { + return ((bool)(this["pathIDAsDumpName"])); + } + set { + this["pathIDAsDumpName"] = value; + } + } } } diff --git a/AssetStudioGUI/Properties/Settings.settings b/AssetStudioGUI/Properties/Settings.settings index eeba0c0..bfa4925 100644 --- a/AssetStudioGUI/Properties/Settings.settings +++ b/AssetStudioGUI/Properties/Settings.settings @@ -65,5 +65,8 @@ False + + False + \ No newline at end of file diff --git a/AssetStudioGUI/app.config b/AssetStudioGUI/app.config index 3865947..fb835c0 100644 --- a/AssetStudioGUI/app.config +++ b/AssetStudioGUI/app.config @@ -73,6 +73,9 @@ False + + False + \ No newline at end of file diff --git a/AssetStudioUtility/Properties/AssemblyInfo.cs b/AssetStudioUtility/Properties/AssemblyInfo.cs index be5646a..75dc529 100644 --- a/AssetStudioUtility/Properties/AssemblyInfo.cs +++ b/AssetStudioUtility/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.14.38.3")] -[assembly: AssemblyFileVersion("0.14.38.3")] +[assembly: AssemblyVersion("0.14.38.4")] +[assembly: AssemblyFileVersion("0.14.38.4")]