Skip to content

Commit

Permalink
加一个是否反编译lua的开关
Browse files Browse the repository at this point in the history
  • Loading branch information
hejingwen committed Dec 28, 2023
1 parent 56527bc commit 356f8f2
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
14 changes: 13 additions & 1 deletion AssetStudioGUI/AssetStudioGUIForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion AssetStudioGUI/AssetStudioGUIForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
Expand Down
15 changes: 15 additions & 0 deletions AssetStudioGUI/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions AssetStudioGUI/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,8 @@
<Setting Name="exportAllUvsAsDiffuseMaps" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="decompileLua" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

0 comments on commit 356f8f2

Please sign in to comment.