add "Dump with PathID as filename" feature

This commit is contained in:
VaDiM 2020-07-27 23:22:53 +03:00
parent c5f7ef6e91
commit 04266251aa
9 changed files with 66 additions and 30 deletions

View File

@ -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")]

View File

@ -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;
}
}

View File

@ -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();

View File

@ -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();

View File

@ -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")]

View File

@ -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;
}
}
}
}

View File

@ -65,5 +65,8 @@
<Setting Name="pathIDAsImageName" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="pathIDAsDumpName" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@ -73,6 +73,9 @@
<setting name="pathIDAsImageName" serializeAs="String">
<value>False</value>
</setting>
<setting name="pathIDAsDumpName" serializeAs="String">
<value>False</value>
</setting>
</AssetStudioGUI.Properties.Settings>
</userSettings>
</configuration>

View File

@ -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")]