Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加一个是否反编译lua的开关 #10

Merged
merged 1 commit into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Loading