diff --git a/AssetStudioGUI/AssetStudioGUIForm.Designer.cs b/AssetStudioGUI/AssetStudioGUIForm.Designer.cs index a8c732a5..f928b17b 100644 --- a/AssetStudioGUI/AssetStudioGUIForm.Designer.cs +++ b/AssetStudioGUI/AssetStudioGUIForm.Designer.cs @@ -44,6 +44,7 @@ private void InitializeComponent() this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripMenuItem(); this.specifyUnityVersion = new System.Windows.Forms.ToolStripTextBox(); this.showExpOpt = new System.Windows.Forms.ToolStripMenuItem(); + this.decompileLua = new System.Windows.Forms.ToolStripMenuItem(); this.modelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportAllObjectssplitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.exportSelectedObjectsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -218,7 +219,8 @@ private void InitializeComponent() this.enablePreview, this.displayInfo, this.toolStripMenuItem14, - this.showExpOpt}); + this.showExpOpt, + this.decompileLua}); this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; this.optionsToolStripMenuItem.Size = new System.Drawing.Size(66, 21); this.optionsToolStripMenuItem.Text = "Options"; @@ -278,6 +280,15 @@ private void InitializeComponent() this.showExpOpt.Text = "Export options"; this.showExpOpt.Click += new System.EventHandler(this.showExpOpt_Click); // + // decompileLua + // + this.decompileLua.CheckOnClick = true; + this.decompileLua.Name = "decompileLua"; + this.decompileLua.Size = new System.Drawing.Size(223, 22); + this.decompileLua.Text = "Decompile Lua"; + this.decompileLua.ToolTipText = "Toggle decompilation of Lua while preview and export"; + this.decompileLua.CheckedChanged += new System.EventHandler(this.decompileLua_CheckedChanged); + // // modelToolStripMenuItem // this.modelToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -1239,6 +1250,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem aboutAssetStudioToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem donateAssetStudioToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem decompileLua; } } diff --git a/AssetStudioGUI/AssetStudioGUIForm.cs b/AssetStudioGUI/AssetStudioGUIForm.cs index 56399ac7..f543d49f 100644 --- a/AssetStudioGUI/AssetStudioGUIForm.cs +++ b/AssetStudioGUI/AssetStudioGUIForm.cs @@ -109,6 +109,7 @@ public AssetStudioGUIForm(string[] args) displayAll.Checked = Properties.Settings.Default.displayAll; displayInfo.Checked = Properties.Settings.Default.displayInfo; enablePreview.Checked = Properties.Settings.Default.enablePreview; + decompileLua.Checked = Properties.Settings.Default.decompileLua; FMODinit(); logger = new GUILogger(StatusStripUpdate); @@ -405,6 +406,12 @@ private void displayAll_CheckedChanged(object sender, EventArgs e) Properties.Settings.Default.Save(); } + private void decompileLua_CheckedChanged(object sender, EventArgs e) + { + Properties.Settings.Default.decompileLua = decompileLua.Checked; + Properties.Settings.Default.Save(); + } + private void enablePreview_Check(object sender, EventArgs e) { if (lastSelectedItem != null) @@ -969,7 +976,8 @@ private void PreviewShader(Shader m_Shader) private void PreviewTextAsset(TextAsset m_TextAsset) { - var text = Encoding.UTF8.GetString(m_TextAsset.GetProcessedScript()); + byte[] textBytes = Properties.Settings.Default.decompileLua ? m_TextAsset.GetProcessedScript() : m_TextAsset.GetRawScript(); + var text = Encoding.UTF8.GetString(textBytes); text = text.Replace("\n", "\r\n").Replace("\0", ""); PreviewText(text); } diff --git a/AssetStudioGUI/Properties/Settings.Designer.cs b/AssetStudioGUI/Properties/Settings.Designer.cs index 2ecec40c..f8981e4b 100644 --- a/AssetStudioGUI/Properties/Settings.Designer.cs +++ b/AssetStudioGUI/Properties/Settings.Designer.cs @@ -274,5 +274,20 @@ public bool exportAllUvsAsDiffuseMaps { this["exportAllUvsAsDiffuseMaps"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool decompileLua + { + get + { + return ((bool)(this["decompileLua"])); + } + set + { + this["decompileLua"] = value; + } + } } } diff --git a/AssetStudioGUI/Properties/Settings.settings b/AssetStudioGUI/Properties/Settings.settings index d6eb751d..8af66196 100644 --- a/AssetStudioGUI/Properties/Settings.settings +++ b/AssetStudioGUI/Properties/Settings.settings @@ -65,5 +65,8 @@ False + + False + \ No newline at end of file