- [GUI] Add option to reset settings.

- [GUI] Fix bug with texture mapping in `Export Options`.
This commit is contained in:
Razmoth
2024-01-28 21:50:59 +04:00
parent b64c915f3a
commit a0d8691331
10 changed files with 164 additions and 74 deletions

View File

@@ -21,8 +21,8 @@
<add key="enableFileLogging" value="False" />
<add key="minimalAssetMap" value="True" />
<add key="allowDuplicates" value="False" />
<add key="texs" value='' />
<add key="uvs" value='{"UV0":{"Item1":true,"Item2":0},"UV1":{"Item1":true,"Item2":1},"UV2":{"Item1":false,"Item2":0},"UV3":{"Item1":false,"Item2":0},"UV4":{"Item1":false,"Item2":0},"UV5":{"Item1":false,"Item2":0},"UV6":{"Item1":false,"Item2":0},"UV7":{"Item1":false,"Item2":0}}' />
<add key="texs" value='{"0": "", "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": ""}' />
<add key="types" value='{"Animation":{"Item1":true,"Item2":false},"AnimationClip":{"Item1":true,"Item2":true},"Animator":{"Item1":true,"Item2":true},"AnimatorController":{"Item1":true,"Item2":false},"AnimatorOverrideController":{"Item1":true,"Item2":false},"AssetBundle":{"Item1":true,"Item2":false},"AudioClip":{"Item1":true,"Item2":true},"Avatar":{"Item1":true,"Item2":false},"Font":{"Item1":true,"Item2":true},"GameObject":{"Item1":true,"Item2":false},"IndexObject":{"Item1":true,"Item2":false},"Material":{"Item1":true,"Item2":true},"Mesh":{"Item1":true,"Item2":true},"MeshFilter":{"Item1":true,"Item2":false},"MeshRenderer":{"Item1":true,"Item2":false},"MiHoYoBinData":{"Item1":true,"Item2":true},"MonoBehaviour":{"Item1":true,"Item2":true},"MonoScript":{"Item1":true,"Item2":false},"MovieTexture":{"Item1":true,"Item2":true},"PlayerSettings":{"Item1":true,"Item2":false},"RectTransform":{"Item1":true,"Item2":false},"Shader":{"Item1":true,"Item2":true},"SkinnedMeshRenderer":{"Item1":true,"Item2":false},"Sprite":{"Item1":true,"Item2":true},"SpriteAtlas":{"Item1":true,"Item2":false},"TextAsset":{"Item1":true,"Item2":true},"Texture2D":{"Item1":true,"Item2":true},"Transform":{"Item1":true,"Item2":false},"VideoClip":{"Item1":true,"Item2":true},"ResourceManager":{"Item1":true,"Item2":false}}' />
</appSettings>
</configuration>

View File

@@ -106,21 +106,21 @@
<setting name="enableFileLogging" serializeAs="String">
<value>True</value>
</setting>
<setting name="texs" serializeAs="String">
<value>{"0": "", "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": ""}</value>
</setting>
<setting name="uvs" serializeAs="String">
<value>{"UV0":{"Item1":true,"Item2":0},"UV1":{"Item1":true,"Item2":1},"UV2":{"Item1":false,"Item2":0},"UV3":{"Item1":false,"Item2":0},"UV4":{"Item1":false,"Item2":0},"UV5":{"Item1":false,"Item2":0},"UV6":{"Item1":false,"Item2":0},"UV7":{"Item1":false,"Item2":0}}</value>
</setting>
<setting name="types" serializeAs="String">
<value>{"Animation":{"Item1":true,"Item2":false},"AnimationClip":{"Item1":true,"Item2":true},"Animator":{"Item1":true,"Item2":true},"AnimatorController":{"Item1":true,"Item2":false},"AnimatorOverrideController":{"Item1":true,"Item2":false},"AssetBundle":{"Item1":true,"Item2":false},"AudioClip":{"Item1":true,"Item2":true},"Avatar":{"Item1":true,"Item2":false},"Font":{"Item1":true,"Item2":true},"GameObject":{"Item1":true,"Item2":false},"IndexObject":{"Item1":true,"Item2":false},"Material":{"Item1":true,"Item2":true},"Mesh":{"Item1":true,"Item2":true},"MeshFilter":{"Item1":true,"Item2":false},"MeshRenderer":{"Item1":true,"Item2":false},"MiHoYoBinData":{"Item1":true,"Item2":true},"MonoBehaviour":{"Item1":true,"Item2":true},"MonoScript":{"Item1":true,"Item2":false},"MovieTexture":{"Item1":true,"Item2":true},"PlayerSettings":{"Item1":true,"Item2":false},"RectTransform":{"Item1":true,"Item2":false},"Shader":{"Item1":true,"Item2":true},"SkinnedMeshRenderer":{"Item1":true,"Item2":false},"Sprite":{"Item1":true,"Item2":true},"SpriteAtlas":{"Item1":true,"Item2":false},"TextAsset":{"Item1":true,"Item2":true},"Texture2D":{"Item1":true,"Item2":true},"Transform":{"Item1":true,"Item2":false},"VideoClip":{"Item1":true,"Item2":true},"ResourceManager":{"Item1":true,"Item2":false}}</value>
</setting>
<setting name="allowDuplicates" serializeAs="String">
<value>False</value>
</setting>
<setting name="loggerEventType" serializeAs="String">
<value>30</value>
</setting>
<setting name="types" serializeAs="String">
<value>{"Animation":{"Item1":true,"Item2":false},"AnimationClip":{"Item1":true,"Item2":true},"Animator":{"Item1":true,"Item2":true},"AnimatorController":{"Item1":true,"Item2":false},"AnimatorOverrideController":{"Item1":true,"Item2":false},"AssetBundle":{"Item1":true,"Item2":false},"AudioClip":{"Item1":true,"Item2":true},"Avatar":{"Item1":true,"Item2":false},"Font":{"Item1":true,"Item2":true},"GameObject":{"Item1":true,"Item2":false},"IndexObject":{"Item1":true,"Item2":false},"Material":{"Item1":true,"Item2":true},"Mesh":{"Item1":true,"Item2":true},"MeshFilter":{"Item1":true,"Item2":false},"MeshRenderer":{"Item1":true,"Item2":false},"MiHoYoBinData":{"Item1":true,"Item2":true},"MonoBehaviour":{"Item1":true,"Item2":true},"MonoScript":{"Item1":true,"Item2":false},"MovieTexture":{"Item1":true,"Item2":true},"PlayerSettings":{"Item1":true,"Item2":false},"RectTransform":{"Item1":true,"Item2":false},"Shader":{"Item1":true,"Item2":true},"SkinnedMeshRenderer":{"Item1":true,"Item2":false},"Sprite":{"Item1":true,"Item2":true},"SpriteAtlas":{"Item1":true,"Item2":false},"TextAsset":{"Item1":true,"Item2":true},"Texture2D":{"Item1":true,"Item2":true},"Transform":{"Item1":true,"Item2":false},"VideoClip":{"Item1":true,"Item2":true},"ResourceManager":{"Item1":true,"Item2":false}}</value>
</setting>
<setting name="texs" serializeAs="String">
<value />
</setting>
</AssetStudio.GUI.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -37,7 +37,9 @@ namespace AssetStudio.GUI
OKbutton = new Button();
Cancel = new Button();
groupBox1 = new GroupBox();
texNameTextBox = new TextBox();
removeTexNameButton = new Button();
addTexNameButton = new Button();
texNameComboBox = new ComboBox();
label10 = new Label();
texTypeComboBox = new ComboBox();
uvTypesComboBox = new ComboBox();
@@ -81,6 +83,7 @@ namespace AssetStudio.GUI
exportAllNodes = new CheckBox();
eulerFilter = new CheckBox();
toolTip = new ToolTip(components);
Reset = new Button();
groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)key).BeginInit();
panel1.SuspendLayout();
@@ -116,7 +119,9 @@ namespace AssetStudio.GUI
// groupBox1
//
groupBox1.AutoSize = true;
groupBox1.Controls.Add(texNameTextBox);
groupBox1.Controls.Add(removeTexNameButton);
groupBox1.Controls.Add(addTexNameButton);
groupBox1.Controls.Add(texNameComboBox);
groupBox1.Controls.Add(label10);
groupBox1.Controls.Add(texTypeComboBox);
groupBox1.Controls.Add(uvTypesComboBox);
@@ -141,23 +146,44 @@ namespace AssetStudio.GUI
groupBox1.Margin = new Padding(4);
groupBox1.Name = "groupBox1";
groupBox1.Padding = new Padding(4);
groupBox1.Size = new System.Drawing.Size(271, 420);
groupBox1.Size = new System.Drawing.Size(271, 433);
groupBox1.TabIndex = 9;
groupBox1.TabStop = false;
groupBox1.Text = "Export";
//
// texNameTextBox
// removeTexNameButton
//
texNameTextBox.Location = new System.Drawing.Point(119, 374);
texNameTextBox.Name = "texNameTextBox";
texNameTextBox.Size = new System.Drawing.Size(141, 23);
texNameTextBox.TabIndex = 37;
texNameTextBox.LostFocus += TexNameTextBox_LostFocus;
removeTexNameButton.Location = new System.Drawing.Point(186, 387);
removeTexNameButton.Name = "removeTexNameButton";
removeTexNameButton.Size = new System.Drawing.Size(71, 23);
removeTexNameButton.TabIndex = 41;
removeTexNameButton.Text = "Remove";
removeTexNameButton.UseVisualStyleBackColor = true;
removeTexNameButton.Click += RemoveTexNameButton_Click;
//
// addTexNameButton
//
addTexNameButton.Location = new System.Drawing.Point(199, 358);
addTexNameButton.Name = "addTexNameButton";
addTexNameButton.Size = new System.Drawing.Size(42, 23);
addTexNameButton.TabIndex = 13;
addTexNameButton.Text = "Add";
addTexNameButton.UseVisualStyleBackColor = true;
addTexNameButton.Click += AddTexNameButton_Click;
//
// texNameComboBox
//
texNameComboBox.FormattingEnabled = true;
texNameComboBox.Location = new System.Drawing.Point(8, 373);
texNameComboBox.Name = "texNameComboBox";
texNameComboBox.Size = new System.Drawing.Size(81, 23);
texNameComboBox.TabIndex = 38;
texNameComboBox.SelectedIndexChanged += TexNameComboBox_SelectedIndexChanged;
//
// label10
//
label10.AutoSize = true;
label10.Location = new System.Drawing.Point(7, 356);
label10.Location = new System.Drawing.Point(9, 355);
label10.Margin = new Padding(4, 0, 4, 0);
label10.Name = "label10";
label10.Size = new System.Drawing.Size(142, 15);
@@ -169,9 +195,9 @@ namespace AssetStudio.GUI
texTypeComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
texTypeComboBox.FormattingEnabled = true;
texTypeComboBox.Items.AddRange(new object[] { "Diffuse", "NormalMap", "Specular", "Bump", "Ambient", "Emissive", "Reflection", "Displacement" });
texTypeComboBox.Location = new System.Drawing.Point(7, 374);
texTypeComboBox.Location = new System.Drawing.Point(95, 373);
texTypeComboBox.Name = "texTypeComboBox";
texTypeComboBox.Size = new System.Drawing.Size(106, 23);
texTypeComboBox.Size = new System.Drawing.Size(79, 23);
texTypeComboBox.TabIndex = 35;
texTypeComboBox.SelectedIndexChanged += TexTypeComboBox_SelectedIndexChanged;
texTypeComboBox.MouseHover += TexTypeComboBox_MouseHover;
@@ -181,7 +207,7 @@ namespace AssetStudio.GUI
uvTypesComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
uvTypesComboBox.FormattingEnabled = true;
uvTypesComboBox.Items.AddRange(new object[] { "Diffuse", "NormalMap", "Specular", "Bump", "Ambient", "Emissive", "Reflection", "Displacement" });
uvTypesComboBox.Location = new System.Drawing.Point(88, 330);
uvTypesComboBox.Location = new System.Drawing.Point(89, 329);
uvTypesComboBox.Name = "uvTypesComboBox";
uvTypesComboBox.Size = new System.Drawing.Size(106, 23);
uvTypesComboBox.TabIndex = 34;
@@ -190,7 +216,7 @@ namespace AssetStudio.GUI
// uvEnabledCheckBox
//
uvEnabledCheckBox.AutoSize = true;
uvEnabledCheckBox.Location = new System.Drawing.Point(200, 334);
uvEnabledCheckBox.Location = new System.Drawing.Point(201, 333);
uvEnabledCheckBox.Name = "uvEnabledCheckBox";
uvEnabledCheckBox.Size = new System.Drawing.Size(60, 19);
uvEnabledCheckBox.TabIndex = 33;
@@ -203,7 +229,7 @@ namespace AssetStudio.GUI
uvsComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
uvsComboBox.FormattingEnabled = true;
uvsComboBox.Items.AddRange(new object[] { "UV0", "UV1", "UV2", "UV3", "UV4", "UV5", "UV6", "UV7" });
uvsComboBox.Location = new System.Drawing.Point(7, 330);
uvsComboBox.Location = new System.Drawing.Point(8, 329);
uvsComboBox.Name = "uvsComboBox";
uvsComboBox.Size = new System.Drawing.Size(75, 23);
uvsComboBox.TabIndex = 32;
@@ -213,7 +239,7 @@ namespace AssetStudio.GUI
// canExportCheckBox
//
canExportCheckBox.AutoSize = true;
canExportCheckBox.Location = new System.Drawing.Point(200, 290);
canExportCheckBox.Location = new System.Drawing.Point(200, 287);
canExportCheckBox.Name = "canExportCheckBox";
canExportCheckBox.Size = new System.Drawing.Size(60, 19);
canExportCheckBox.TabIndex = 31;
@@ -224,7 +250,7 @@ namespace AssetStudio.GUI
// label8
//
label8.AutoSize = true;
label8.Location = new System.Drawing.Point(7, 268);
label8.Location = new System.Drawing.Point(8, 267);
label8.Margin = new Padding(4, 0, 4, 0);
label8.Name = "label8";
label8.Size = new System.Drawing.Size(132, 15);
@@ -234,7 +260,7 @@ namespace AssetStudio.GUI
// canParseCheckBox
//
canParseCheckBox.AutoSize = true;
canParseCheckBox.Location = new System.Drawing.Point(140, 290);
canParseCheckBox.Location = new System.Drawing.Point(140, 287);
canParseCheckBox.Name = "canParseCheckBox";
canParseCheckBox.Size = new System.Drawing.Size(54, 19);
canParseCheckBox.TabIndex = 29;
@@ -247,7 +273,7 @@ namespace AssetStudio.GUI
typesComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
typesComboBox.FormattingEnabled = true;
typesComboBox.Items.AddRange(new object[] { ClassIDType.Animation, ClassIDType.AnimationClip, ClassIDType.Animator, ClassIDType.AnimatorController, ClassIDType.AnimatorOverrideController, ClassIDType.AssetBundle, ClassIDType.AudioClip, ClassIDType.Avatar, ClassIDType.Font, ClassIDType.GameObject, ClassIDType.IndexObject, ClassIDType.Material, ClassIDType.Mesh, ClassIDType.MeshFilter, ClassIDType.MeshRenderer, ClassIDType.MiHoYoBinData, ClassIDType.MonoBehaviour, ClassIDType.MonoScript, ClassIDType.MovieTexture, ClassIDType.PlayerSettings, ClassIDType.RectTransform, ClassIDType.Shader, ClassIDType.SkinnedMeshRenderer, ClassIDType.Sprite, ClassIDType.SpriteAtlas, ClassIDType.TextAsset, ClassIDType.Texture2D, ClassIDType.Transform, ClassIDType.VideoClip, ClassIDType.ResourceManager });
typesComboBox.Location = new System.Drawing.Point(7, 286);
typesComboBox.Location = new System.Drawing.Point(7, 285);
typesComboBox.Name = "typesComboBox";
typesComboBox.Size = new System.Drawing.Size(127, 23);
typesComboBox.TabIndex = 28;
@@ -257,7 +283,7 @@ namespace AssetStudio.GUI
// label6
//
label6.AutoSize = true;
label6.Location = new System.Drawing.Point(9, 312);
label6.Location = new System.Drawing.Point(7, 311);
label6.Margin = new Padding(4, 0, 4, 0);
label6.Name = "label6";
label6.Size = new System.Drawing.Size(119, 15);
@@ -279,7 +305,7 @@ namespace AssetStudio.GUI
assetGroupOptions.DropDownStyle = ComboBoxStyle.DropDownList;
assetGroupOptions.FormattingEnabled = true;
assetGroupOptions.Items.AddRange(new object[] { "type name", "container path", "source file name", "do not group" });
assetGroupOptions.Location = new System.Drawing.Point(8, 241);
assetGroupOptions.Location = new System.Drawing.Point(7, 240);
assetGroupOptions.Margin = new Padding(4);
assetGroupOptions.Name = "assetGroupOptions";
assetGroupOptions.Size = new System.Drawing.Size(173, 23);
@@ -288,7 +314,7 @@ namespace AssetStudio.GUI
// label7
//
label7.AutoSize = true;
label7.Location = new System.Drawing.Point(8, 222);
label7.Location = new System.Drawing.Point(8, 221);
label7.Margin = new Padding(4, 0, 4, 0);
label7.Name = "label7";
label7.Size = new System.Drawing.Size(140, 15);
@@ -364,7 +390,7 @@ namespace AssetStudio.GUI
panel1.Controls.Add(tojpg);
panel1.Controls.Add(topng);
panel1.Controls.Add(tobmp);
panel1.Location = new System.Drawing.Point(18, 180);
panel1.Location = new System.Drawing.Point(24, 174);
panel1.Margin = new Padding(4);
panel1.Name = "panel1";
panel1.Size = new System.Drawing.Size(236, 38);
@@ -651,11 +677,22 @@ namespace AssetStudio.GUI
eulerFilter.Text = "EulerFilter";
eulerFilter.UseVisualStyleBackColor = true;
//
// typesToolTip
// toolTip
//
toolTip.AutomaticDelay = 1000;
toolTip.UseAnimation = false;
toolTip.UseFading = false;
//
// Reset
//
Reset.Location = new System.Drawing.Point(300, 428);
Reset.Name = "Reset";
Reset.Size = new System.Drawing.Size(88, 26);
Reset.TabIndex = 12;
Reset.Text = "Reset";
Reset.UseVisualStyleBackColor = true;
Reset.Click += Reset_Click;
//
// ExportOptions
//
AcceptButton = OKbutton;
@@ -663,6 +700,7 @@ namespace AssetStudio.GUI
AutoScaleMode = AutoScaleMode.Font;
CancelButton = Cancel;
ClientSize = new System.Drawing.Size(677, 467);
Controls.Add(Reset);
Controls.Add(groupBox2);
Controls.Add(groupBox1);
Controls.Add(Cancel);
@@ -737,7 +775,10 @@ namespace AssetStudio.GUI
private ComboBox uvsComboBox;
private Label label10;
private ComboBox texTypeComboBox;
private TextBox texNameTextBox;
private ToolTip toolTip;
private Button Reset;
private ComboBox texNameComboBox;
private Button addTexNameButton;
private Button removeTexNameButton;
}
}

View File

@@ -9,9 +9,10 @@ namespace AssetStudio.GUI
{
public partial class ExportOptions : Form
{
public bool Resetted = false;
private Dictionary<ClassIDType, (bool, bool)> types = new Dictionary<ClassIDType, (bool, bool)>();
private Dictionary<string, (bool, int)> uvs = new Dictionary<string, (bool, int)>();
private Dictionary<int, string> texs = new Dictionary<int, string>();
private Dictionary<string, int> texs = new Dictionary<string, int>();
public ExportOptions()
{
InitializeComponent();
@@ -46,10 +47,22 @@ namespace AssetStudio.GUI
minimalAssetMap.Checked = Properties.Settings.Default.minimalAssetMap;
types = JsonConvert.DeserializeObject<Dictionary<ClassIDType, (bool, bool)>>(Properties.Settings.Default.types);
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs);
texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs);
texTypeComboBox.SelectedIndex = 0;
if (!string.IsNullOrEmpty(Properties.Settings.Default.texs))
{
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs);
if (texs.Count > 0 )
{
texNameComboBox.Items.AddRange(texs.Keys.ToArray());
texNameComboBox.SelectedIndex = 0;
texTypeComboBox.SelectedIndex = texs.ElementAt(0).Value;
}
}
typesComboBox.SelectedIndex = 0;
uvsComboBox.SelectedIndex = 0;
texTypeComboBox.SelectedIndex = 0;
}
private void OKbutton_Click(object sender, EventArgs e)
@@ -148,19 +161,49 @@ namespace AssetStudio.GUI
}
}
private void TexTypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
private void TexNameComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (sender is ComboBox comboBox && texs.TryGetValue(comboBox.SelectedIndex, out var name))
if (!string.IsNullOrEmpty(texNameComboBox.SelectedItem?.ToString()) && texs.TryGetValue(texNameComboBox.SelectedItem?.ToString(), out var type))
{
texNameTextBox.Text = name;
texTypeComboBox.SelectedIndex = type;
}
}
private void TexNameTextBox_LostFocus(object sender, EventArgs e)
private void AddTexNameButton_Click(object sender, EventArgs e)
{
if (sender is TextBox textBox && texs.ContainsKey(texTypeComboBox.SelectedIndex))
if (!string.IsNullOrEmpty(texNameComboBox.Text) && !texs.ContainsKey(texNameComboBox.Text))
{
texs[texTypeComboBox.SelectedIndex] = textBox.Text;
texs[texNameComboBox.Text] = texTypeComboBox.SelectedIndex;
texNameComboBox.Items.Add(texNameComboBox.Text);
texNameComboBox.SelectedIndex = texNameComboBox.Items.Count - 1;
ActiveControl = null;
}
}
private void RemoveTexNameButton_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(texNameComboBox.SelectedItem?.ToString()) && texs.ContainsKey(texNameComboBox.SelectedItem?.ToString()))
{
texs.Remove(texNameComboBox.SelectedItem?.ToString());
texNameComboBox.Items.Remove(texNameComboBox.SelectedItem?.ToString());
ActiveControl = null;
if (texNameComboBox.Items.Count > 0)
{
texNameComboBox.SelectedIndex = 0;
}
else
{
texNameComboBox.Text = "";
texTypeComboBox.SelectedIndex = 0;
}
}
}
private void TexTypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (sender is ComboBox comboBox && !string.IsNullOrEmpty(texNameComboBox.SelectedItem?.ToString()) && texs.ContainsKey(texNameComboBox.SelectedItem?.ToString()))
{
texs[texNameComboBox.SelectedItem?.ToString()] = comboBox.SelectedIndex;
}
}
@@ -193,7 +236,7 @@ namespace AssetStudio.GUI
var sb = new StringBuilder();
foreach (var tex in texs)
{
sb.Append($"{texTypeComboBox.Items[tex.Key]}: {tex.Value}\n");
sb.Append($"{tex.Key}: {texTypeComboBox.Items[tex.Value]}\n");
}
toolTip.ToolTipTitle = "Texture options status:";
@@ -206,6 +249,14 @@ namespace AssetStudio.GUI
toolTip.SetToolTip(key, "Key in Hex");
}
private void Reset_Click(object sender, EventArgs e)
{
Properties.Settings.Default.Reset();
DialogResult = DialogResult.Cancel;
Resetted = true;
Close();
}
private void Cancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;

View File

@@ -117,15 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="exportUvsTooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="keyToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>162, 17</value>
</metadata>
<metadata name="typesToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>272, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>57</value>
</metadata>

View File

@@ -365,7 +365,7 @@ namespace AssetStudio.GUI
game = Studio.Game,
collectAnimations = Properties.Settings.Default.collectAnimations,
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs),
};
var convert = animationList != null
? new ModelConverter(m_Animator, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
@@ -391,7 +391,7 @@ namespace AssetStudio.GUI
game = Studio.Game,
collectAnimations = Properties.Settings.Default.collectAnimations,
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs),
};
var convert = animationList != null
? new ModelConverter(gameObject, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
@@ -416,7 +416,7 @@ namespace AssetStudio.GUI
game = Studio.Game,
collectAnimations = Properties.Settings.Default.collectAnimations,
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs),
};
var convert = animationList != null
? new ModelConverter(rootName, gameObject, options, animationList.Select(x => (AnimationClip)x.Asset).ToArray())

View File

@@ -550,7 +550,12 @@ namespace AssetStudio.GUI
private void showExpOpt_Click(object sender, EventArgs e)
{
var exportOpt = new ExportOptions();
exportOpt.ShowDialog(this);
if (exportOpt.ShowDialog(this) == DialogResult.OK && exportOpt.Resetted)
{
InitializeExportOptions();
InitializeLogger();
InitalizeOptions();
}
}
private void assetListView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
@@ -1308,7 +1313,7 @@ namespace AssetStudio.GUI
game = Studio.Game,
collectAnimations = Properties.Settings.Default.collectAnimations,
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs),
};
var model = new ModelConverter(m_GameObject, options, Array.Empty<AnimationClip>());
PreviewModel(model);
@@ -1321,7 +1326,7 @@ namespace AssetStudio.GUI
game = Studio.Game,
collectAnimations = Properties.Settings.Default.collectAnimations,
uvs = JsonConvert.DeserializeObject<Dictionary<string, (bool, int)>>(Properties.Settings.Default.uvs),
texs = JsonConvert.DeserializeObject<Dictionary<int, string>>(Properties.Settings.Default.texs),
texs = JsonConvert.DeserializeObject<Dictionary<string, int>>(Properties.Settings.Default.texs),
};
var model = new ModelConverter(m_Animator, options, Array.Empty<AnimationClip>());
PreviewModel(model);

View File

@@ -431,18 +431,6 @@ namespace AssetStudio.GUI.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("{}")]
public string texs {
get {
return ((string)(this["texs"]));
}
set {
this["texs"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("{\"UV0\":{\"Item1\":true,\"Item2\":0},\"UV1\":{\"Item1\":true,\"Item2\":1},\"UV2\":{\"Item1\":fal" +
@@ -493,5 +481,17 @@ namespace AssetStudio.GUI.Properties {
this["types"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string texs {
get {
return ((string)(this["texs"]));
}
set {
this["texs"] = value;
}
}
}
}

View File

@@ -104,9 +104,6 @@
<Setting Name="enableFileLogging" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="texs" Type="System.String" Scope="User">
<Value Profile="(Default)">{}</Value>
</Setting>
<Setting Name="uvs" Type="System.String" Scope="User">
<Value Profile="(Default)">{"UV0":{"Item1":true,"Item2":0},"UV1":{"Item1":true,"Item2":1},"UV2":{"Item1":false,"Item2":0},"UV3":{"Item1":false,"Item2":0},"UV4":{"Item1":false,"Item2":0},"UV5":{"Item1":false,"Item2":0},"UV6":{"Item1":false,"Item2":0},"UV7":{"Item1":false,"Item2":0}}</Value>
</Setting>
@@ -119,5 +116,8 @@
<Setting Name="types" Type="System.String" Scope="User">
<Value Profile="(Default)">{"Animation":{"Item1":true,"Item2":false},"AnimationClip":{"Item1":true,"Item2":true},"Animator":{"Item1":true,"Item2":true},"AnimatorController":{"Item1":true,"Item2":false},"AnimatorOverrideController":{"Item1":true,"Item2":false},"AssetBundle":{"Item1":true,"Item2":false},"AudioClip":{"Item1":true,"Item2":true},"Avatar":{"Item1":true,"Item2":false},"Font":{"Item1":true,"Item2":true},"GameObject":{"Item1":true,"Item2":false},"IndexObject":{"Item1":true,"Item2":false},"Material":{"Item1":true,"Item2":true},"Mesh":{"Item1":true,"Item2":true},"MeshFilter":{"Item1":true,"Item2":false},"MeshRenderer":{"Item1":true,"Item2":false},"MiHoYoBinData":{"Item1":true,"Item2":true},"MonoBehaviour":{"Item1":true,"Item2":true},"MonoScript":{"Item1":true,"Item2":false},"MovieTexture":{"Item1":true,"Item2":true},"PlayerSettings":{"Item1":true,"Item2":false},"RectTransform":{"Item1":true,"Item2":false},"Shader":{"Item1":true,"Item2":true},"SkinnedMeshRenderer":{"Item1":true,"Item2":false},"Sprite":{"Item1":true,"Item2":true},"SpriteAtlas":{"Item1":true,"Item2":false},"TextAsset":{"Item1":true,"Item2":true},"Texture2D":{"Item1":true,"Item2":true},"Transform":{"Item1":true,"Item2":false},"VideoClip":{"Item1":true,"Item2":true},"ResourceManager":{"Item1":true,"Item2":false}}</Value>
</Setting>
<Setting Name="texs" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

View File

@@ -712,9 +712,8 @@ namespace AssetStudio
iMat.Textures.Add(texture);
int dest = -1;
var entry = options.texs.FirstOrDefault(x => x.Value == texEnv.Key);
if (!entry.Equals(default))
dest = entry.Key;
if (options.texs.TryGetValue(texEnv.Key, out var target))
dest = target;
else if (texEnv.Key == "_MainTex")
dest = 0;
else if (texEnv.Key == "_BumpMap")
@@ -1174,7 +1173,7 @@ namespace AssetStudio
public Game game;
public bool collectAnimations;
public Dictionary<string, (bool, int)> uvs;
public Dictionary<int, string> texs;
public Dictionary<string, int> texs;
}
}
}