This commit is contained in:
Razmoth
2023-01-06 22:33:59 +04:00
parent a3cf868dfb
commit 2b31232b30
178 changed files with 5213 additions and 23780 deletions

View File

@@ -2,12 +2,12 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>Resources\as.ico</ApplicationIcon>
<Version>0.18.60</Version>
<AssemblyVersion>0.18.60</AssemblyVersion>
<FileVersion>0.18.60</FileVersion>
<Version>0.80.30</Version>
<AssemblyVersion>0.80.30</AssemblyVersion>
<FileVersion>0.80.30</FileVersion>
<Copyright>Copyright © Razmoth 2022; Copyright © Perfare 2018-2022</Copyright>
<DebugType>embedded</DebugType>
</PropertyGroup>
@@ -17,18 +17,6 @@
<ProjectReference Include="..\AssetStudio\AssetStudio.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Update="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
@@ -39,6 +27,11 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
@@ -75,13 +68,20 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2-beta2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="OpenTK" Version="5.0.0-pre.8" />
<Reference Include="OpenTK.WinForms">
<HintPath>Libraries\OpenTK.WinForms.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<Target Name="CopyExtraFiles" AfterTargets="AfterBuild">
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\Win32\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)x86" ContinueOnError="true" />
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\x64\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)x64" ContinueOnError="true" />

View File

@@ -1,4 +1,6 @@
namespace AssetStudioGUI
using System;
namespace AssetStudioGUI
{
partial class AssetStudioGUIForm
{
@@ -37,17 +39,21 @@
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.extractFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.extractFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.resetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.abortStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.displayAll = new System.Windows.Forms.ToolStripMenuItem();
this.enablePreview = new System.Windows.Forms.ToolStripMenuItem();
this.enableResolveDependencies = new System.Windows.Forms.ToolStripMenuItem();
this.enablePreview = new System.Windows.Forms.ToolStripMenuItem();
this.displayInfo = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripMenuItem();
this.specifyUnityVersion = new System.Windows.Forms.ToolStripTextBox();
this.toolStripMenuItem17 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem18 = new System.Windows.Forms.ToolStripMenuItem();
this.specifyGame = new System.Windows.Forms.ToolStripComboBox();
this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem19 = new System.Windows.Forms.ToolStripMenuItem();
this.specifyAIVersion = new System.Windows.Forms.ToolStripComboBox();
this.toolStripMenuItem23 = new System.Windows.Forms.ToolStripMenuItem();
this.showExpOpt = new System.Windows.Forms.ToolStripMenuItem();
this.modelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportAllObjectssplitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
@@ -71,6 +77,10 @@
this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem17 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem24 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem25 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem10 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripMenuItem();
@@ -81,10 +91,20 @@
this.debugMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem15 = new System.Windows.Forms.ToolStripMenuItem();
this.exportClassStructuresMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.console = new System.Windows.Forms.ToolStripMenuItem();
this.enableConsole = new System.Windows.Forms.ToolStripMenuItem();
this.clearConsoleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.miscToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.buildCABMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.buildAssetMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.assetHelpersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.cABMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.CABMapNameComboBox = new System.Windows.Forms.ToolStripComboBox();
this.toolStripMenuItem20 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem21 = new System.Windows.Forms.ToolStripMenuItem();
this.assetMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.assetMapNameTextBox = new System.Windows.Forms.ToolStripTextBox();
this.toolStripMenuItem22 = new System.Windows.Forms.ToolStripMenuItem();
this.assetMapTypeComboBox = new System.Windows.Forms.ToolStripComboBox();
this.loadAIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
@@ -92,16 +112,16 @@
this.treeSearch = new System.Windows.Forms.TextBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.assetListView = new System.Windows.Forms.ListView();
this.columnHeaderName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeaderContainer = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeaderType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeaderPathID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeaderSize = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeaderName = new System.Windows.Forms.ColumnHeader();
this.columnHeaderContainer = new System.Windows.Forms.ColumnHeader();
this.columnHeaderType = new System.Windows.Forms.ColumnHeader();
this.columnHeaderPathID = new System.Windows.Forms.ColumnHeader();
this.columnHeaderSize = new System.Windows.Forms.ColumnHeader();
this.listSearch = new System.Windows.Forms.TextBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.classesListView = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.progressbarPanel = new System.Windows.Forms.Panel();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.tabControl2 = new System.Windows.Forms.TabControl();
@@ -179,7 +199,10 @@
this.loadFolderToolStripMenuItem,
this.toolStripMenuItem1,
this.extractFileToolStripMenuItem,
this.extractFolderToolStripMenuItem});
this.extractFolderToolStripMenuItem,
this.toolStripSeparator6,
this.resetToolStripMenuItem,
this.abortStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "File";
@@ -217,16 +240,36 @@
this.extractFolderToolStripMenuItem.Text = "Extract folder";
this.extractFolderToolStripMenuItem.Click += new System.EventHandler(this.extractFolderToolStripMenuItem_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(141, 6);
//
// resetToolStripMenuItem
//
this.resetToolStripMenuItem.Name = "resetToolStripMenuItem";
this.resetToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
this.resetToolStripMenuItem.Text = "Reset";
this.resetToolStripMenuItem.Click += new System.EventHandler(this.resetToolStripMenuItem_Click);
//
// abortStripMenuItem
//
this.abortStripMenuItem.Name = "abortStripMenuItem";
this.abortStripMenuItem.Size = new System.Drawing.Size(144, 22);
this.abortStripMenuItem.Text = "Abort";
this.abortStripMenuItem.Click += new System.EventHandler(this.abortStripMenuItem_Click);
//
// optionsToolStripMenuItem
//
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.displayAll,
this.enablePreview,
this.enableResolveDependencies,
this.enablePreview,
this.displayInfo,
this.toolStripMenuItem14,
this.toolStripMenuItem17,
this.toolStripMenuItem16,
this.toolStripMenuItem18,
this.toolStripMenuItem19,
this.toolStripMenuItem23,
this.showExpOpt});
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
@@ -242,6 +285,18 @@
"t the RAW file.";
this.displayAll.CheckedChanged += new System.EventHandler(this.displayAll_CheckedChanged);
//
// enableResolveDependencies
//
this.enableResolveDependencies.Checked = true;
this.enableResolveDependencies.CheckOnClick = true;
this.enableResolveDependencies.CheckState = System.Windows.Forms.CheckState.Checked;
this.enableResolveDependencies.Name = "enableResolveDependencies";
this.enableResolveDependencies.Size = new System.Drawing.Size(225, 22);
this.enableResolveDependencies.Text = "Enable resolve dependencies";
this.enableResolveDependencies.ToolTipText = "Toggle the behaviour of loading assets.\nDisable to load file(s) without its depen" +
"dencies.";
this.enableResolveDependencies.CheckedChanged += new System.EventHandler(this.enableResolveDependencies_CheckedChanged);
//
// enablePreview
//
this.enablePreview.Checked = true;
@@ -254,17 +309,6 @@
"etc.\r\nDisable preview if you have performance or compatibility issues.";
this.enablePreview.CheckedChanged += new System.EventHandler(this.enablePreview_Check);
//
// enableResolveDependencies
//
this.enableResolveDependencies.Checked = true;
this.enableResolveDependencies.CheckOnClick = true;
this.enableResolveDependencies.CheckState = System.Windows.Forms.CheckState.Checked;
this.enableResolveDependencies.Name = "enableResolveDependencies";
this.enableResolveDependencies.Size = new System.Drawing.Size(225, 22);
this.enableResolveDependencies.Text = "Enable resolve dependencies";
this.enableResolveDependencies.ToolTipText = "Toggle the behaviour of loading assets.\nDisable to load file(s) without its dependencies.";
this.enableResolveDependencies.CheckedChanged += new System.EventHandler(this.enableResolveDependencies_CheckedChanged);
//
// displayInfo
//
this.displayInfo.Checked = true;
@@ -287,17 +331,17 @@
//
// specifyUnityVersion
//
this.specifyUnityVersion.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.specifyUnityVersion.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.specifyUnityVersion.Name = "specifyUnityVersion";
this.specifyUnityVersion.Size = new System.Drawing.Size(100, 23);
//
// toolStripMenuItem17
// toolStripMenuItem18
//
this.toolStripMenuItem17.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem18.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.specifyGame});
this.toolStripMenuItem17.Name = "toolStripMenuItem17";
this.toolStripMenuItem17.Size = new System.Drawing.Size(225, 22);
this.toolStripMenuItem17.Text = "Specify Game";
this.toolStripMenuItem18.Name = "toolStripMenuItem18";
this.toolStripMenuItem18.Size = new System.Drawing.Size(225, 22);
this.toolStripMenuItem18.Text = "Specify Game";
//
// specifyGame
//
@@ -305,14 +349,14 @@
this.specifyGame.Name = "specifyGame";
this.specifyGame.Size = new System.Drawing.Size(121, 23);
//
// toolStripMenuItem16
// toolStripMenuItem19
//
this.toolStripMenuItem16.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem19.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.specifyAIVersion});
this.toolStripMenuItem16.Name = "toolStripMenuItem16";
this.toolStripMenuItem16.Size = new System.Drawing.Size(225, 22);
this.toolStripMenuItem16.Text = "Specify AI version";
this.toolStripMenuItem16.DropDownOpening += new System.EventHandler(this.toolStripMenuItem16_DropDownOpening);
this.toolStripMenuItem19.Name = "toolStripMenuItem19";
this.toolStripMenuItem19.Size = new System.Drawing.Size(225, 22);
this.toolStripMenuItem19.Text = "Specify AI version";
this.toolStripMenuItem19.DropDownOpening += new System.EventHandler(this.toolStripMenuItem19_DropDownOpening);
//
// specifyAIVersion
//
@@ -321,7 +365,13 @@
"None"});
this.specifyAIVersion.Name = "specifyAIVersion";
this.specifyAIVersion.Size = new System.Drawing.Size(121, 23);
this.specifyAIVersion.SelectedIndexChanged += new System.EventHandler(this.toolStripComboBox1_SelectedIndexChanged);
//
// toolStripMenuItem23
//
this.toolStripMenuItem23.Name = "toolStripMenuItem23";
this.toolStripMenuItem23.Size = new System.Drawing.Size(225, 22);
this.toolStripMenuItem23.Text = "Specify CNUnity Key";
this.toolStripMenuItem23.Click += new System.EventHandler(this.toolStripMenuItem23_Click);
//
// showExpOpt
//
@@ -394,6 +444,7 @@
this.toolStripSeparator4,
this.toolStripMenuItem2,
this.toolStripMenuItem3,
this.toolStripMenuItem16,
this.toolStripSeparator2,
this.toolStripMenuItem10});
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
@@ -482,24 +533,55 @@
// toolStripMenuItem7
//
this.toolStripMenuItem7.Name = "toolStripMenuItem7";
this.toolStripMenuItem7.Size = new System.Drawing.Size(152, 22);
this.toolStripMenuItem7.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem7.Text = "All assets";
this.toolStripMenuItem7.Click += new System.EventHandler(this.toolStripMenuItem7_Click);
//
// toolStripMenuItem8
//
this.toolStripMenuItem8.Name = "toolStripMenuItem8";
this.toolStripMenuItem8.Size = new System.Drawing.Size(152, 22);
this.toolStripMenuItem8.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem8.Text = "Selected assets";
this.toolStripMenuItem8.Click += new System.EventHandler(this.toolStripMenuItem8_Click);
//
// toolStripMenuItem9
//
this.toolStripMenuItem9.Name = "toolStripMenuItem9";
this.toolStripMenuItem9.Size = new System.Drawing.Size(152, 22);
this.toolStripMenuItem9.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem9.Text = "Filtered assets";
this.toolStripMenuItem9.Click += new System.EventHandler(this.toolStripMenuItem9_Click);
//
// toolStripMenuItem16
//
this.toolStripMenuItem16.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem17,
this.toolStripMenuItem24,
this.toolStripMenuItem25});
this.toolStripMenuItem16.Name = "toolStripMenuItem16";
this.toolStripMenuItem16.Size = new System.Drawing.Size(266, 22);
this.toolStripMenuItem16.Text = "JSON";
//
// toolStripMenuItem17
//
this.toolStripMenuItem17.Name = "toolStripMenuItem17";
this.toolStripMenuItem17.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem17.Text = "All assets";
this.toolStripMenuItem17.Click += new System.EventHandler(this.toolStripMenuItem17_Click);
//
// toolStripMenuItem24
//
this.toolStripMenuItem24.Name = "toolStripMenuItem24";
this.toolStripMenuItem24.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem24.Text = "Selected assets";
this.toolStripMenuItem24.Click += new System.EventHandler(this.toolStripMenuItem24_Click);
//
// toolStripMenuItem25
//
this.toolStripMenuItem25.Name = "toolStripMenuItem25";
this.toolStripMenuItem25.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem25.Text = "Filtered assets";
this.toolStripMenuItem25.Click += new System.EventHandler(this.toolStripMenuItem25_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
@@ -550,7 +632,7 @@
this.allToolStripMenuItem.CheckOnClick = true;
this.allToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.allToolStripMenuItem.Name = "allToolStripMenuItem";
this.allToolStripMenuItem.Size = new System.Drawing.Size(88, 22);
this.allToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.allToolStripMenuItem.Text = "All";
this.allToolStripMenuItem.Click += new System.EventHandler(this.typeToolStripMenuItem_Click);
//
@@ -559,7 +641,8 @@
this.debugMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem15,
this.exportClassStructuresMenuItem,
this.console});
this.enableConsole,
this.clearConsoleToolStripMenuItem});
this.debugMenuItem.Name = "debugMenuItem";
this.debugMenuItem.Size = new System.Drawing.Size(54, 20);
this.debugMenuItem.Text = "Debug";
@@ -581,39 +664,113 @@
this.exportClassStructuresMenuItem.Text = "Export class structures";
this.exportClassStructuresMenuItem.Click += new System.EventHandler(this.exportClassStructuresMenuItem_Click);
//
// console
// enableConsole
//
this.console.Checked = true;
this.console.CheckOnClick = true;
this.console.CheckState = System.Windows.Forms.CheckState.Checked;
this.console.Name = "console";
this.console.Size = new System.Drawing.Size(191, 22);
this.console.Text = "Enable Console";
this.console.ToolTipText = "Check this option to log all events on a debug console.";
this.console.CheckedChanged += new System.EventHandler(this.console_CheckedChanged);
this.enableConsole.Checked = true;
this.enableConsole.CheckOnClick = true;
this.enableConsole.CheckState = System.Windows.Forms.CheckState.Checked;
this.enableConsole.Name = "enableConsole";
this.enableConsole.Size = new System.Drawing.Size(191, 22);
this.enableConsole.Text = "Enable Console";
this.enableConsole.CheckedChanged += new System.EventHandler(this.enableConsole_CheckedChanged);
//
// clearConsoleToolStripMenuItem
//
this.clearConsoleToolStripMenuItem.Name = "clearConsoleToolStripMenuItem";
this.clearConsoleToolStripMenuItem.Size = new System.Drawing.Size(191, 22);
this.clearConsoleToolStripMenuItem.Text = "Clear Console";
this.clearConsoleToolStripMenuItem.Click += new System.EventHandler(this.clearConsoleToolStripMenuItem_Click);
//
// miscToolStripMenuItem
//
this.miscToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.buildCABMapToolStripMenuItem,
this.buildAssetMapToolStripMenuItem});
this.assetHelpersToolStripMenuItem,
this.loadAIToolStripMenuItem});
this.miscToolStripMenuItem.Name = "miscToolStripMenuItem";
this.miscToolStripMenuItem.Size = new System.Drawing.Size(47, 20);
this.miscToolStripMenuItem.Text = "Misc.";
//
// buildCABMapToolStripMenuItem
// assetHelpersToolStripMenuItem
//
this.buildCABMapToolStripMenuItem.Name = "buildCABMapToolStripMenuItem";
this.buildCABMapToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
this.buildCABMapToolStripMenuItem.Text = "Build CABMap";
this.buildCABMapToolStripMenuItem.Click += new System.EventHandler(this.buildCABMapToolStripMenuItem_Click);
this.assetHelpersToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cABMapToolStripMenuItem,
this.assetMapToolStripMenuItem});
this.assetHelpersToolStripMenuItem.Name = "assetHelpersToolStripMenuItem";
this.assetHelpersToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.assetHelpersToolStripMenuItem.Text = "Asset Helpers";
this.assetHelpersToolStripMenuItem.DropDownOpening += new System.EventHandler(this.assetHelpersToolStripMenuItem_DropDownOpening);
//
// buildAssetMapToolStripMenuItem
// cABMapToolStripMenuItem
//
this.buildAssetMapToolStripMenuItem.Name = "buildAssetMapToolStripMenuItem";
this.buildAssetMapToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
this.buildAssetMapToolStripMenuItem.Text = "Build AssetMap";
this.buildAssetMapToolStripMenuItem.Click += new System.EventHandler(this.buildAssetMapToolStripMenuItem_Click);
this.cABMapToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.CABMapNameComboBox,
this.toolStripMenuItem20,
this.toolStripMenuItem21});
this.cABMapToolStripMenuItem.Name = "cABMapToolStripMenuItem";
this.cABMapToolStripMenuItem.Size = new System.Drawing.Size(126, 22);
this.cABMapToolStripMenuItem.Text = "CABMap";
//
// CABMapNameComboBox
//
this.CABMapNameComboBox.Name = "CABMapNameComboBox";
this.CABMapNameComboBox.Size = new System.Drawing.Size(121, 23);
this.CABMapNameComboBox.ToolTipText = "Enter name of CABMap here";
//
// toolStripMenuItem20
//
this.toolStripMenuItem20.Name = "toolStripMenuItem20";
this.toolStripMenuItem20.Size = new System.Drawing.Size(181, 22);
this.toolStripMenuItem20.Text = "Build CABMap";
this.toolStripMenuItem20.Click += new System.EventHandler(this.toolStripMenuItem20_Click);
//
// toolStripMenuItem21
//
this.toolStripMenuItem21.Name = "toolStripMenuItem21";
this.toolStripMenuItem21.Size = new System.Drawing.Size(181, 22);
this.toolStripMenuItem21.Text = "Clear CABMap";
this.toolStripMenuItem21.Click += new System.EventHandler(this.toolStripMenuItem21_Click);
//
// assetMapToolStripMenuItem
//
this.assetMapToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.assetMapNameTextBox,
this.toolStripMenuItem22,
this.assetMapTypeComboBox});
this.assetMapToolStripMenuItem.Name = "assetMapToolStripMenuItem";
this.assetMapToolStripMenuItem.Size = new System.Drawing.Size(126, 22);
this.assetMapToolStripMenuItem.Text = "AssetMap";
//
// assetMapNameTextBox
//
this.assetMapNameTextBox.Name = "assetMapNameTextBox";
this.assetMapNameTextBox.Size = new System.Drawing.Size(100, 23);
this.assetMapNameTextBox.ToolTipText = "Enter name of AssetMap here";
//
// toolStripMenuItem22
//
this.toolStripMenuItem22.Name = "toolStripMenuItem22";
this.toolStripMenuItem22.Size = new System.Drawing.Size(181, 22);
this.toolStripMenuItem22.Text = "Build AssetMap";
this.toolStripMenuItem22.Click += new System.EventHandler(this.toolStripMenuItem22_Click);
//
// assetMapTypeComboBox
//
this.assetMapTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.assetMapTypeComboBox.Name = "assetMapTypeComboBox";
this.assetMapTypeComboBox.Size = new System.Drawing.Size(121, 23);
this.assetMapTypeComboBox.SelectedIndexChanged += new System.EventHandler(this.assetMapTypeComboBox_SelectedIndexChanged);
//
// loadAIToolStripMenuItem
//
this.loadAIToolStripMenuItem.Name = "loadAIToolStripMenuItem";
this.loadAIToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.loadAIToolStripMenuItem.Text = "Load AI";
this.loadAIToolStripMenuItem.Click += new System.EventHandler(this.loadAIToolStripMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(178, 6);
//
// splitContainer1
//
@@ -657,9 +814,9 @@
//
this.tabPage1.Controls.Add(this.sceneTreeView);
this.tabPage1.Controls.Add(this.treeSearch);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Location = new System.Drawing.Point(4, 24);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(472, 609);
this.tabPage1.Size = new System.Drawing.Size(472, 607);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Scene Hierarchy";
this.tabPage1.UseVisualStyleBackColor = true;
@@ -669,9 +826,9 @@
this.sceneTreeView.CheckBoxes = true;
this.sceneTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.sceneTreeView.HideSelection = false;
this.sceneTreeView.Location = new System.Drawing.Point(0, 20);
this.sceneTreeView.Location = new System.Drawing.Point(0, 23);
this.sceneTreeView.Name = "sceneTreeView";
this.sceneTreeView.Size = new System.Drawing.Size(472, 589);
this.sceneTreeView.Size = new System.Drawing.Size(472, 584);
this.sceneTreeView.TabIndex = 1;
this.sceneTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.sceneTreeView_AfterCheck);
//
@@ -681,7 +838,7 @@
this.treeSearch.ForeColor = System.Drawing.SystemColors.GrayText;
this.treeSearch.Location = new System.Drawing.Point(0, 0);
this.treeSearch.Name = "treeSearch";
this.treeSearch.Size = new System.Drawing.Size(472, 20);
this.treeSearch.Size = new System.Drawing.Size(472, 23);
this.treeSearch.TabIndex = 0;
this.treeSearch.Text = " Search ";
this.treeSearch.TextChanged += new System.EventHandler(this.treeSearch_TextChanged);
@@ -693,9 +850,9 @@
//
this.tabPage2.Controls.Add(this.assetListView);
this.tabPage2.Controls.Add(this.listSearch);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Location = new System.Drawing.Point(4, 24);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Size = new System.Drawing.Size(472, 609);
this.tabPage2.Size = new System.Drawing.Size(472, 607);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Asset List";
this.tabPage2.UseVisualStyleBackColor = true;
@@ -711,10 +868,9 @@
this.assetListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.assetListView.FullRowSelect = true;
this.assetListView.GridLines = true;
this.assetListView.HideSelection = false;
this.assetListView.Location = new System.Drawing.Point(0, 20);
this.assetListView.Location = new System.Drawing.Point(0, 23);
this.assetListView.Name = "assetListView";
this.assetListView.Size = new System.Drawing.Size(472, 589);
this.assetListView.Size = new System.Drawing.Size(472, 584);
this.assetListView.TabIndex = 1;
this.assetListView.UseCompatibleStateImageBehavior = false;
this.assetListView.View = System.Windows.Forms.View.Details;
@@ -754,7 +910,7 @@
this.listSearch.ForeColor = System.Drawing.SystemColors.GrayText;
this.listSearch.Location = new System.Drawing.Point(0, 0);
this.listSearch.Name = "listSearch";
this.listSearch.Size = new System.Drawing.Size(472, 20);
this.listSearch.Size = new System.Drawing.Size(472, 23);
this.listSearch.TabIndex = 0;
this.listSearch.Text = " Filter ";
this.listSearch.TextChanged += new System.EventHandler(this.ListSearchTextChanged);
@@ -764,9 +920,9 @@
// tabPage3
//
this.tabPage3.Controls.Add(this.classesListView);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Location = new System.Drawing.Point(4, 24);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(472, 609);
this.tabPage3.Size = new System.Drawing.Size(472, 607);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Asset Classes";
this.tabPage3.UseVisualStyleBackColor = true;
@@ -778,11 +934,10 @@
this.columnHeader2});
this.classesListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.classesListView.FullRowSelect = true;
this.classesListView.HideSelection = false;
this.classesListView.Location = new System.Drawing.Point(0, 0);
this.classesListView.MultiSelect = false;
this.classesListView.Name = "classesListView";
this.classesListView.Size = new System.Drawing.Size(472, 609);
this.classesListView.Size = new System.Drawing.Size(472, 607);
this.classesListView.TabIndex = 0;
this.classesListView.UseCompatibleStateImageBehavior = false;
this.classesListView.View = System.Windows.Forms.View.Details;
@@ -834,9 +989,9 @@
// tabPage4
//
this.tabPage4.Controls.Add(this.previewPanel);
this.tabPage4.Location = new System.Drawing.Point(4, 22);
this.tabPage4.Location = new System.Drawing.Point(4, 24);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(768, 607);
this.tabPage4.Size = new System.Drawing.Size(768, 605);
this.tabPage4.TabIndex = 0;
this.tabPage4.Text = "Preview";
this.tabPage4.UseVisualStyleBackColor = true;
@@ -855,7 +1010,7 @@
this.previewPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.previewPanel.Location = new System.Drawing.Point(0, 0);
this.previewPanel.Name = "previewPanel";
this.previewPanel.Size = new System.Drawing.Size(768, 607);
this.previewPanel.Size = new System.Drawing.Size(768, 605);
this.previewPanel.TabIndex = 1;
this.previewPanel.Resize += new System.EventHandler(this.preview_Resize);
//
@@ -866,7 +1021,7 @@
this.assetInfoLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.assetInfoLabel.Location = new System.Drawing.Point(4, 7);
this.assetInfoLabel.Name = "assetInfoLabel";
this.assetInfoLabel.Size = new System.Drawing.Size(0, 13);
this.assetInfoLabel.Size = new System.Drawing.Size(0, 15);
this.assetInfoLabel.TabIndex = 0;
//
// FMODpanel
@@ -885,7 +1040,7 @@
this.FMODpanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.FMODpanel.Location = new System.Drawing.Point(0, 0);
this.FMODpanel.Name = "FMODpanel";
this.FMODpanel.Size = new System.Drawing.Size(768, 607);
this.FMODpanel.Size = new System.Drawing.Size(768, 605);
this.FMODpanel.TabIndex = 2;
this.FMODpanel.Visible = false;
//
@@ -895,7 +1050,7 @@
this.FMODcopyright.ForeColor = System.Drawing.SystemColors.ControlLight;
this.FMODcopyright.Location = new System.Drawing.Point(214, 337);
this.FMODcopyright.Name = "FMODcopyright";
this.FMODcopyright.Size = new System.Drawing.Size(283, 13);
this.FMODcopyright.Size = new System.Drawing.Size(316, 15);
this.FMODcopyright.TabIndex = 9;
this.FMODcopyright.Text = "Audio Engine supplied by FMOD by Firelight Technologies.";
//
@@ -905,7 +1060,7 @@
this.FMODinfoLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FMODinfoLabel.Location = new System.Drawing.Point(269, 235);
this.FMODinfoLabel.Name = "FMODinfoLabel";
this.FMODinfoLabel.Size = new System.Drawing.Size(0, 13);
this.FMODinfoLabel.Size = new System.Drawing.Size(0, 15);
this.FMODinfoLabel.TabIndex = 8;
//
// FMODtimerLabel
@@ -914,7 +1069,7 @@
this.FMODtimerLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FMODtimerLabel.Location = new System.Drawing.Point(460, 235);
this.FMODtimerLabel.Name = "FMODtimerLabel";
this.FMODtimerLabel.Size = new System.Drawing.Size(78, 13);
this.FMODtimerLabel.Size = new System.Drawing.Size(78, 15);
this.FMODtimerLabel.TabIndex = 7;
this.FMODtimerLabel.Text = "0:00.0 / 0:00.0";
//
@@ -924,7 +1079,7 @@
this.FMODstatusLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FMODstatusLabel.Location = new System.Drawing.Point(213, 235);
this.FMODstatusLabel.Name = "FMODstatusLabel";
this.FMODstatusLabel.Size = new System.Drawing.Size(47, 13);
this.FMODstatusLabel.Size = new System.Drawing.Size(51, 15);
this.FMODstatusLabel.TabIndex = 6;
this.FMODstatusLabel.Text = "Stopped";
//
@@ -1001,14 +1156,14 @@
this.fontPreviewBox.Location = new System.Drawing.Point(0, 0);
this.fontPreviewBox.Name = "fontPreviewBox";
this.fontPreviewBox.ReadOnly = true;
this.fontPreviewBox.Size = new System.Drawing.Size(768, 607);
this.fontPreviewBox.Size = new System.Drawing.Size(768, 605);
this.fontPreviewBox.TabIndex = 0;
this.fontPreviewBox.Text = resources.GetString("fontPreviewBox.Text");
this.fontPreviewBox.Visible = false;
this.fontPreviewBox.WordWrap = false;
//
// glControl1
//
// glControl
//
this.glControl.API = OpenTK.Windowing.Common.ContextAPI.OpenGL;
this.glControl.APIVersion = new System.Version(4, 6, 0, 0);
this.glControl.BackColor = System.Drawing.SystemColors.ControlDarkDark;
@@ -1016,27 +1171,28 @@
this.glControl.Flags = OpenTK.Windowing.Common.ContextFlags.Default;
this.glControl.IsEventDriven = true;
this.glControl.Location = new System.Drawing.Point(0, 0);
this.glControl.Name = "glControl1";
this.glControl.Size = new System.Drawing.Size(768, 607);
this.glControl.Name = "glControl";
this.glControl.Profile = OpenTK.Windowing.Common.ContextProfile.Core;
this.glControl.Size = new System.Drawing.Size(768, 605);
this.glControl.TabIndex = 4;
this.glControl.Visible = false;
this.glControl.Load += new System.EventHandler(this.glControl1_Load);
this.glControl.Paint += new System.Windows.Forms.PaintEventHandler(this.glControl1_Paint);
this.glControl.MouseDown += new System.Windows.Forms.MouseEventHandler(this.glControl1_MouseDown);
this.glControl.MouseMove += new System.Windows.Forms.MouseEventHandler(this.glControl1_MouseMove);
this.glControl.MouseUp += new System.Windows.Forms.MouseEventHandler(this.glControl1_MouseUp);
this.glControl.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.glControl1_MouseWheel);
this.glControl.Load += new System.EventHandler(this.glControl_Load);
this.glControl.Paint += new System.Windows.Forms.PaintEventHandler(this.glControl_Paint);
this.glControl.MouseDown += new System.Windows.Forms.MouseEventHandler(this.glControl_MouseDown);
this.glControl.MouseMove += new System.Windows.Forms.MouseEventHandler(this.glControl_MouseMove);
this.glControl.MouseUp += new System.Windows.Forms.MouseEventHandler(this.glControl_MouseUp);
this.glControl.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.glControl_MouseWheel);
//
// textPreviewBox
//
this.textPreviewBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.textPreviewBox.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textPreviewBox.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.textPreviewBox.Location = new System.Drawing.Point(0, 0);
this.textPreviewBox.Multiline = true;
this.textPreviewBox.Name = "textPreviewBox";
this.textPreviewBox.ReadOnly = true;
this.textPreviewBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textPreviewBox.Size = new System.Drawing.Size(768, 607);
this.textPreviewBox.Size = new System.Drawing.Size(768, 605);
this.textPreviewBox.TabIndex = 2;
this.textPreviewBox.Visible = false;
this.textPreviewBox.WordWrap = false;
@@ -1049,7 +1205,7 @@
this.classTextBox.Name = "classTextBox";
this.classTextBox.ReadOnly = true;
this.classTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.classTextBox.Size = new System.Drawing.Size(768, 607);
this.classTextBox.Size = new System.Drawing.Size(768, 605);
this.classTextBox.TabIndex = 3;
this.classTextBox.Visible = false;
this.classTextBox.WordWrap = false;
@@ -1057,9 +1213,9 @@
// tabPage5
//
this.tabPage5.Controls.Add(this.dumpTextBox);
this.tabPage5.Location = new System.Drawing.Point(4, 22);
this.tabPage5.Location = new System.Drawing.Point(4, 24);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Size = new System.Drawing.Size(768, 607);
this.tabPage5.Size = new System.Drawing.Size(768, 605);
this.tabPage5.TabIndex = 1;
this.tabPage5.Text = "Dump";
this.tabPage5.UseVisualStyleBackColor = true;
@@ -1072,7 +1228,7 @@
this.dumpTextBox.Name = "dumpTextBox";
this.dumpTextBox.ReadOnly = true;
this.dumpTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.dumpTextBox.Size = new System.Drawing.Size(768, 607);
this.dumpTextBox.Size = new System.Drawing.Size(768, 605);
this.dumpTextBox.TabIndex = 0;
this.dumpTextBox.WordWrap = false;
//
@@ -1303,15 +1459,33 @@
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem14;
private System.Windows.Forms.ToolStripTextBox specifyUnityVersion;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem15;
private System.Windows.Forms.ToolStripMenuItem miscToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem buildCABMapToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem console;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem16;
private System.Windows.Forms.ToolStripComboBox specifyAIVersion;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem17;
private System.Windows.Forms.ToolStripComboBox specifyGame;
private System.Windows.Forms.ToolStripMenuItem buildAssetMapToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem enableResolveDependencies;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem18;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem19;
private System.Windows.Forms.ToolStripComboBox specifyGame;
private System.Windows.Forms.ToolStripComboBox specifyAIVersion;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem16;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem17;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem24;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem25;
private System.Windows.Forms.ToolStripMenuItem enableConsole;
private System.Windows.Forms.ToolStripMenuItem miscToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem assetHelpersToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem20;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem22;
private System.Windows.Forms.ToolStripComboBox CABMapNameComboBox;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem23;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
private System.Windows.Forms.ToolStripMenuItem resetToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem abortStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem21;
private System.Windows.Forms.ToolStripMenuItem cABMapToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem assetMapToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem loadAIToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem clearConsoleToolStripMenuItem;
private System.Windows.Forms.ToolStripTextBox assetMapNameTextBox;
private System.Windows.Forms.ToolStripComboBox assetMapTypeComboBox;
}
}

View File

@@ -1,6 +1,5 @@
using AssetStudio;
using Newtonsoft.Json;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
using System;
using System.Collections.Generic;
@@ -11,9 +10,7 @@ using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
@@ -23,8 +20,9 @@ using Font = AssetStudio.Font;
using Vector3 = OpenTK.Mathematics.Vector3;
using Vector4 = OpenTK.Mathematics.Vector4;
using Matrix4 = OpenTK.Mathematics.Matrix4;
using OpenTK.Graphics;
using OpenTK.Mathematics;
using SpirV;
using Newtonsoft.Json.Converters;
namespace AssetStudioGUI
{
@@ -89,9 +87,6 @@ namespace AssetStudioGUI
private GUILogger logger;
[DllImport("gdi32.dll")]
private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, uint cbFont, IntPtr pdv, [In] ref uint pcFonts);
public AssetStudioGUIForm()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
@@ -99,26 +94,34 @@ namespace AssetStudioGUI
Text = $"Studio v{Application.ProductVersion}";
delayTimer = new System.Timers.Timer(800);
delayTimer.Elapsed += new ElapsedEventHandler(delayTimer_Elapsed);
console.Checked = Properties.Settings.Default.console;
InitializeExportOptions();
InitializeProgressBar();
InitializeLogger();
InitalizeOptions();
FMODinit();
}
private void InitializeExportOptions()
{
enableConsole.Checked = Properties.Settings.Default.enableConsole;
displayAll.Checked = Properties.Settings.Default.displayAll;
displayInfo.Checked = Properties.Settings.Default.displayInfo;
enablePreview.Checked = Properties.Settings.Default.enablePreview;
enableResolveDependencies.Checked = Properties.Settings.Default.enableResolveDependencies;
assetsManager.ResolveDependancies = enableResolveDependencies.Checked;
AssetBundle.Exportable = Properties.Settings.Default.exportAssetBundle;
IndexObject.Exportable = Properties.Settings.Default.exportIndexObject;
Renderer.Parsable = !Properties.Settings.Default.disableRndrr;
Shader.Parsable = !Properties.Settings.Default.disableShader;
MiHoYoBinData.doXOR = Properties.Settings.Default.enableXor;
assetsManager.ResolveDependencies = enableResolveDependencies.Checked;
Renderer.Skipped = Properties.Settings.Default.skipRenderer;
MiHoYoBinData.Exportable = Properties.Settings.Default.exportMiHoYoBinData;
MiHoYoBinData.Encrypted = Properties.Settings.Default.encrypted;
MiHoYoBinData.Key = Properties.Settings.Default.key;
FMODinit();
}
private void InitializeLogger()
{
logger = new GUILogger(StatusStripUpdate);
ConsoleHelper.AllocConsole();
ConsoleHelper.SetConsoleTitle("Debug Console");
var handle = ConsoleHelper.GetConsoleWindow();
if (console.Checked)
if (enableConsole.Checked)
{
Logger.Default = new ConsoleLogger();
ConsoleHelper.ShowWindow(handle, ConsoleHelper.SW_SHOW);
@@ -128,16 +131,28 @@ namespace AssetStudioGUI
Logger.Default = logger;
ConsoleHelper.ShowWindow(handle, ConsoleHelper.SW_HIDE);
}
Progress.Default = new Progress<int>(SetProgressBarValue);
Studio.StatusStripUpdate = StatusStripUpdate;
specifyGame.Items.AddRange(GameManager.GetGames());
Studio.Game = GameManager.GetGame(Properties.Settings.Default.selectedGame);
specifyGame.SelectedIndex = Properties.Settings.Default.selectedGame;
specifyGame.SelectedIndexChanged += new EventHandler(toolStripComboBox2_SelectedIndexChanged);
Logger.Info($"Target Game is {Studio.Game.Name}");
CABManager.LoadMap(Studio.Game);
}
private void InitializeProgressBar()
{
Progress.Default = new Progress<int>(SetProgressBarValue);
Studio.StatusStripUpdate = StatusStripUpdate;
}
private void InitalizeOptions()
{
assetMapTypeComboBox.Items.AddRange(Enum.GetValues<ExportListType>().Cast<object>().ToArray());
assetMapTypeComboBox.SelectedIndex = Properties.Settings.Default.selectedAssetMapType;
specifyGame.Items.AddRange(GameManager.GetGames());
specifyGame.SelectedIndex = Properties.Settings.Default.selectedGame;
specifyGame.SelectedIndexChanged += new EventHandler(specifyGame_SelectedIndexChanged);
Studio.Game = GameManager.GetGame(Properties.Settings.Default.selectedGame);
Logger.Info($"Target Game type is {Studio.Game.Type}");
CABMapNameComboBox.SelectedIndexChanged += new EventHandler(specifyNameComboBox_SelectedIndexChanged);
CNUnityKeyManager.SetKey(Properties.Settings.Default.selectedCNUnityKey);
}
private void AssetStudioGUIForm_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
@@ -160,6 +175,10 @@ namespace AssetStudioGUI
}
else
{
if (paths.Length == 1 && File.Exists(paths[0]) && Path.GetExtension(paths[0]) == ".txt")
{
paths = File.ReadAllLines(paths[0]);
}
await Task.Run(() => assetsManager.LoadFiles(paths));
}
BuildAssetStructures();
@@ -174,7 +193,6 @@ namespace AssetStudioGUI
ResetForm();
openDirectoryBackup = Path.GetDirectoryName(openFileDialog1.FileNames[0]);
assetsManager.SpecifyUnityVersion = specifyUnityVersion.Text;
assetsManager.Game = Studio.Game;
await Task.Run(() => assetsManager.LoadFiles(openFileDialog1.FileNames));
BuildAssetStructures();
}
@@ -236,17 +254,22 @@ namespace AssetStudioGUI
return;
}
(var productName, var treeNodeCollection) = await Task.Run(() => BuildAssetData());
var typeMap = await Task.Run(() => BuildClassStructure());
(var productName, var treeNodeCollection) = await Task.Run(BuildAssetData);
var typeMap = await Task.Run(BuildClassStructure);
if (!string.IsNullOrEmpty(productName))
if (string.IsNullOrEmpty(productName))
{
Text = $"Studio v{Application.ProductVersion} - {productName} - {Path.GetFileName(assetsManager.assetsFileList[0].originalPath)} - {assetsManager.assetsFileList[0].unityVersion} - {assetsManager.assetsFileList[0].m_TargetPlatform}";
}
else
{
Text = $"Studio v{Application.ProductVersion} - {Studio.Game.Name} - {Path.GetFileName(assetsManager.assetsFileList[0].originalPath)} - {assetsManager.assetsFileList[0].unityVersion} - {assetsManager.assetsFileList[0].m_TargetPlatform}";
}
if (!Studio.Game.Type.IsNormal())
{
productName = Studio.Game.Name;
}
else
{
productName = "no productName";
}
}
Text = $"Studio v{Application.ProductVersion} - {productName} - {assetsManager.assetsFileList[0].unityVersion} - {assetsManager.assetsFileList[0].m_TargetPlatform}";
assetListView.VirtualListSize = visibleAssets.Count;
@@ -402,24 +425,6 @@ namespace AssetStudioGUI
}
}
private void console_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.console = console.Checked;
Properties.Settings.Default.Save();
var handle = ConsoleHelper.GetConsoleWindow();
if (console.Checked)
{
Logger.Default = new ConsoleLogger();
ConsoleHelper.ShowWindow(handle, ConsoleHelper.SW_SHOW);
}
else
{
Logger.Default = logger;
ConsoleHelper.ShowWindow(handle, ConsoleHelper.SW_HIDE);
}
}
private void displayAll_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.displayAll = displayAll.Checked;
@@ -449,6 +454,7 @@ namespace AssetStudioGUI
case ClassIDType.Shader:
case ClassIDType.TextAsset:
case ClassIDType.MonoBehaviour:
case ClassIDType.MiHoYoBinData:
textPreviewBox.Visible = !textPreviewBox.Visible;
break;
case ClassIDType.Font:
@@ -492,7 +498,7 @@ namespace AssetStudioGUI
Properties.Settings.Default.enableResolveDependencies = enableResolveDependencies.Checked;
Properties.Settings.Default.Save();
assetsManager.ResolveDependancies = enableResolveDependencies.Checked;
assetsManager.ResolveDependencies = enableResolveDependencies.Checked;
}
private void displayAssetInfo_Check(object sender, EventArgs e)
@@ -786,19 +792,21 @@ namespace AssetStudioGUI
break;
case Animator _:
StatusStripUpdate("Can be exported to FBX file.");
goto default;
break;
case AnimationClip _:
StatusStripUpdate("Can be exported with Animator or Objects or .anim file.");
StatusStripUpdate("Can be exported with Animator or Objects");
break;
case MiHoYoBinData m_MiHoYoBinData:
PreviewText(m_MiHoYoBinData.Str);
PreviewText(m_MiHoYoBinData.AsString);
StatusStripUpdate("Can be exported/previewed as JSON if data is a valid JSON (check XOR).");
break;
default:
var str = assetItem.Asset.Dump();
if (string.IsNullOrEmpty(str))
if (Properties.Settings.Default.displayAll || string.IsNullOrEmpty(str))
{
str = JsonConvert.SerializeObject(assetItem.Asset, Formatting.Indented);
var settings = new JsonSerializerSettings();
settings.Converters.Add(new StringEnumConverter());
str = JsonConvert.SerializeObject(assetItem.Asset, Formatting.Indented, settings);
}
if (str != null)
{
@@ -1002,7 +1010,7 @@ namespace AssetStudioGUI
{
if (m_Shader.byteSize > 0xFFFFFFF)
{
PreviewText("Serialized Shader can't be read");
PreviewText("Shader is too large to parse");
return;
}
@@ -1037,8 +1045,8 @@ namespace AssetStudioGUI
Marshal.Copy(m_Font.m_FontData, 0, data, m_Font.m_FontData.Length);
uint cFonts = 0;
var re = AddFontMemResourceEx(data, (uint)m_Font.m_FontData.Length, IntPtr.Zero, ref cFonts);
if (re != IntPtr.Zero)
var re = FontHelper.AddFontMemResourceEx(data, (uint)m_Font.m_FontData.Length, nint.Zero, ref cFonts);
if (re != nint.Zero)
{
using (var pfc = new PrivateFontCollection())
{
@@ -1319,6 +1327,7 @@ namespace AssetStudioGUI
}
FMODreset();
StatusStripUpdate("Reset successfully !!");
}
private void assetListView_MouseClick(object sender, MouseEventArgs e)
@@ -1534,6 +1543,20 @@ namespace AssetStudioGUI
{
ExportAssets(ExportFilter.Filtered, ExportType.Dump);
}
private void toolStripMenuItem17_Click(object sender, EventArgs e)
{
ExportAssets(ExportFilter.All, ExportType.JSON);
}
private void toolStripMenuItem24_Click(object sender, EventArgs e)
{
ExportAssets(ExportFilter.Selected, ExportType.JSON);
}
private void toolStripMenuItem25_Click(object sender, EventArgs e)
{
ExportAssets(ExportFilter.Filtered, ExportType.JSON);
}
private void toolStripMenuItem11_Click(object sender, EventArgs e)
{
@@ -1678,6 +1701,337 @@ namespace AssetStudioGUI
}
}
private void toolStripMenuItem15_Click(object sender, EventArgs e)
{
logger.ShowErrorMessage = toolStripMenuItem15.Checked;
}
private async void toolStripMenuItem19_DropDownOpening(object sender, EventArgs e)
{
if (specifyAIVersion.Enabled && await AIVersionManager.FetchVersions())
{
UpdateVersionList();
}
}
private void assetHelpersToolStripMenuItem_DropDownOpening(object sender, EventArgs e)
{
if (assetHelpersToolStripMenuItem.Enabled)
{
CABMapNameComboBox.Items.Clear();
CABMapNameComboBox.Items.AddRange(AssetsHelper.GetMaps());
}
}
private async void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (specifyAIVersion.SelectedIndex == 0)
{
return;
}
optionsToolStripMenuItem.DropDown.Visible = false;
var version = specifyAIVersion.SelectedItem.ToString();
if (version.Contains(' '))
{
version = version.Split(' ')[0];
}
Logger.Info($"Loading AI v{version}");
InvokeUpdate(specifyAIVersion, false);
var path = await AIVersionManager.FetchAI(version);
await Task.Run(() => ResourceIndex.FromFile(path));
UpdateContainers();
UpdateVersionList();
InvokeUpdate(specifyAIVersion, true);
}
private void UpdateVersionList()
{
var selectedIndex = specifyAIVersion.SelectedIndex;
specifyAIVersion.Items.Clear();
specifyAIVersion.Items.Add("None");
var versions = AIVersionManager.GetVersions();
foreach (var version in versions)
{
specifyAIVersion.Items.Add(version.Item1 + (version.Item2 ? " (cached)" : ""));
}
specifyAIVersion.SelectedIndexChanged -= new EventHandler(toolStripComboBox1_SelectedIndexChanged);
specifyAIVersion.SelectedIndex = selectedIndex;
specifyAIVersion.SelectedIndexChanged += new EventHandler(toolStripComboBox1_SelectedIndexChanged);
}
private void UpdateContainers()
{
if (exportableAssets.Count > 0)
{
Logger.Info("Updating Containers...");
assetListView.BeginUpdate();
foreach (var asset in exportableAssets)
{
if (int.TryParse(asset.Container, out var value))
{
var last = unchecked((uint)value);
var path = ResourceIndex.GetAssetPath(last);
if (!string.IsNullOrEmpty(path))
{
asset.Container = path;
asset.SubItems[1].Text = path;
if (asset.Type == ClassIDType.MiHoYoBinData)
{
asset.Text = Path.GetFileNameWithoutExtension(path);
}
}
}
}
assetListView.EndUpdate();
Logger.Info("Updated !!");
}
}
private void InvokeUpdate(ToolStripItem item, bool value)
{
if (InvokeRequired)
{
BeginInvoke(new Action(() => { item.Enabled = value; }));
}
else
{
item.Enabled = value;
}
}
private void tabControl2_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabControl2.SelectedIndex == 1 && lastSelectedItem != null)
{
dumpTextBox.Text = DumpAsset(lastSelectedItem.Asset);
}
}
private void assetMapTypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
Properties.Settings.Default.selectedAssetMapType = assetMapTypeComboBox.SelectedIndex;
Properties.Settings.Default.Save();
}
private void specifyGame_SelectedIndexChanged(object sender, EventArgs e)
{
optionsToolStripMenuItem.DropDown.Visible = false;
Properties.Settings.Default.selectedGame = specifyGame.SelectedIndex;
Properties.Settings.Default.Save();
Studio.Game = GameManager.GetGame(Properties.Settings.Default.selectedGame);
Logger.Info($"Target Game is {Studio.Game.Name}");
ResetForm();
assetsManager.SpecifyUnityVersion = specifyUnityVersion.Text;
assetsManager.Game = Studio.Game;
}
private async void specifyNameComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
miscToolStripMenuItem.DropDown.Visible = false;
InvokeUpdate(miscToolStripMenuItem, false);
var name = CABMapNameComboBox.SelectedItem.ToString();
await Task.Run(() => AssetsHelper.LoadMap(name));
ResetForm();
assetsManager.SpecifyUnityVersion = specifyUnityVersion.Text;
assetsManager.Game = Studio.Game;
InvokeUpdate(miscToolStripMenuItem, true);
}
private async void toolStripMenuItem20_Click(object sender, EventArgs e)
{
miscToolStripMenuItem.DropDown.Visible = false;
InvokeUpdate(miscToolStripMenuItem, false);
var input = CABMapNameComboBox.Text;
var selectedText = CABMapNameComboBox.SelectedText;
var name = "";
if (!string.IsNullOrEmpty(selectedText))
{
name = selectedText;
}
else if (!string.IsNullOrEmpty(input))
{
if (input.IndexOfAny(Path.GetInvalidFileNameChars()) != -1)
{
Logger.Warning("Name has invalid characters !!");
InvokeUpdate(miscToolStripMenuItem, true);
return;
}
name = input;
}
else
{
Logger.Error("CABMap name is empty, please enter any name in ComboBox above");
InvokeUpdate(miscToolStripMenuItem, true);
return;
}
if (File.Exists(Path.Combine(AssetsHelper.CABMapName, $"{name}.bin")))
{
var acceptOverride = MessageBox.Show("CABMap already exist, Do you want to override it ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (acceptOverride != DialogResult.Yes)
{
InvokeUpdate(miscToolStripMenuItem, true);
return;
}
}
var openFolderDialog = new OpenFolderDialog();
openFolderDialog.Title = "Select Game Folder";
if (openFolderDialog.ShowDialog(this) == DialogResult.OK)
{
Logger.Info("Scanning for files");
var files = Directory.GetFiles(openFolderDialog.Folder, "*.*", SearchOption.AllDirectories).ToArray();
Logger.Info($"Found {files.Length} files");
await Task.Run(() => AssetsHelper.BuildCABMap(files, name, openFolderDialog.Folder, Studio.Game));
}
InvokeUpdate(miscToolStripMenuItem, true);
}
private void toolStripMenuItem21_Click(object sender, EventArgs e)
{
miscToolStripMenuItem.DropDown.Visible = false;
InvokeUpdate(miscToolStripMenuItem, false);
var acceptDelete = MessageBox.Show("CABMap will be deleted, this can't be undone, continue ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (acceptDelete != DialogResult.Yes)
{
InvokeUpdate(miscToolStripMenuItem, true);
return;
}
var name = CABMapNameComboBox.Text.ToString();
var path = Path.Combine(AssetsHelper.CABMapName, $"{name}.bin");
if (File.Exists(path))
{
File.Delete(path);
Logger.Info($"{name} deleted successfully !!");
CABMapNameComboBox.SelectedIndexChanged -= new EventHandler(specifyNameComboBox_SelectedIndexChanged);
CABMapNameComboBox.SelectedIndex = 0;
CABMapNameComboBox.SelectedIndexChanged += new EventHandler(specifyNameComboBox_SelectedIndexChanged);
}
InvokeUpdate(miscToolStripMenuItem, true);
}
private void toolStripMenuItem23_Click(object sender, EventArgs e)
{
var form = new CNUnityForm();
form.Show();
}
private void resetToolStripMenuItem_Click(object sender, EventArgs e)
{
ResetForm();
AssetsHelper.Clear();
}
private void enableConsole_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.enableConsole = enableConsole.Checked;
Properties.Settings.Default.Save();
var handle = ConsoleHelper.GetConsoleWindow();
if (enableConsole.Checked)
{
Logger.Default = new ConsoleLogger();
ConsoleHelper.ShowWindow(handle, ConsoleHelper.SW_SHOW);
}
else
{
Logger.Default = logger;
ConsoleHelper.ShowWindow(handle, ConsoleHelper.SW_HIDE);
}
}
private void abortStripMenuItem_Click(object sender, EventArgs e)
{
Logger.Info("Aborting....");
assetsManager.tokenSource.Cancel();
AssetsHelper.tokenSource.Cancel();
}
private async void loadAIToolStripMenuItem_Click(object sender, EventArgs e)
{
miscToolStripMenuItem.DropDown.Visible = false;
var openFileDialog = new OpenFileDialog() { Multiselect = false, Filter = "Asset Index JSON File|*.json" };
if (openFileDialog.ShowDialog(this) == DialogResult.OK)
{
var path = openFileDialog.FileName;
Logger.Info($"Loading AI...");
InvokeUpdate(loadAIToolStripMenuItem, false);
await Task.Run(() => ResourceIndex.FromFile(path));
UpdateContainers();
InvokeUpdate(loadAIToolStripMenuItem, true);
}
}
private void clearConsoleToolStripMenuItem_Click(object sender, EventArgs e)
{
Console.Clear();
}
private async void toolStripMenuItem22_Click(object sender, EventArgs e)
{
miscToolStripMenuItem.DropDown.Visible = false;
InvokeUpdate(miscToolStripMenuItem, false);
var input = assetMapNameTextBox.Text;
var exportListType = (ExportListType)assetMapTypeComboBox.SelectedItem;
var name = "assets_map";
if (!string.IsNullOrEmpty(input))
{
if (input.IndexOfAny(Path.GetInvalidFileNameChars()) != -1)
{
Logger.Warning("Name has invalid characters !!");
InvokeUpdate(miscToolStripMenuItem, true);
return;
}
name = input;
}
var openFolderDialog = new OpenFolderDialog();
openFolderDialog.Title = $"Select Game Folder";
if (openFolderDialog.ShowDialog(this) == DialogResult.OK)
{
Logger.Info("Scanning for files");
var files = Directory.GetFiles(openFolderDialog.Folder, "*.*", SearchOption.AllDirectories).ToArray();
Logger.Info($"Found {files.Length} files");
var saveFolderDialog = new OpenFolderDialog();
saveFolderDialog.InitialFolder = saveDirectoryBackup;
saveFolderDialog.Title = "Select Output Folder";
if (saveFolderDialog.ShowDialog(this) == DialogResult.OK)
{
if (File.Exists(Path.Combine(saveFolderDialog.Folder, $"{name}{exportListType.GetExtension()}")))
{
var acceptOverride = MessageBox.Show("AssetMap already exist, Do you want to override it ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (acceptOverride != DialogResult.Yes)
{
InvokeUpdate(miscToolStripMenuItem, true);
return;
}
}
saveDirectoryBackup = saveFolderDialog.Folder;
var toExportAssets = await Task.Run(() => AssetsHelper.BuildAssetMap(files, Studio.Game));
AssetsHelper.ExportAssetsMap(toExportAssets, name, saveFolderDialog.Folder, exportListType);
}
}
InvokeUpdate(miscToolStripMenuItem, true);
}
#region FMOD
private void FMODinit()
{
@@ -1694,7 +2048,7 @@ namespace AssetStudioGUI
Application.Exit();
}
result = system.init(2, FMOD.INITFLAGS.NORMAL, IntPtr.Zero);
result = system.init(2, FMOD.INITFLAGS.NORMAL, nint.Zero);
if (ERRCHECK(result)) { return; }
result = system.getMasterSoundGroup(out masterSoundGroup);
@@ -1952,10 +2306,10 @@ namespace AssetStudioGUI
private void InitOpenTK()
{
ChangeGLSize(glControl.Size);
GL.ClearColor(Color4.Dimgray);
GL.ClearColor(Color4.Darkgray);
pgmID = GL.CreateProgram();
LoadShader("vs", ShaderType.VertexShader, pgmID, out var vsID);
LoadShader("fs", ShaderType.FragmentShader, pgmID, out var fsID);
LoadShader("vs", ShaderType.VertexShader, pgmID, out ShaderHandle vsID);
LoadShader("fs", ShaderType.FragmentShader, pgmID, out ShaderHandle fsID);
GL.LinkProgram(pgmID);
pgmColorID = GL.CreateProgram();
@@ -2011,7 +2365,7 @@ namespace AssetStudioGUI
private static void CreateVBO(out BufferHandle vboAddress, Matrix4 data, int address)
{
GL.CreateBuffer(out vboAddress);
GL.UniformMatrix4f(address, false, data);
GL.UniformMatrix4f(address, false, in data);
}
private static void CreateEBO(out BufferHandle address, int[] data)
@@ -2063,13 +2417,13 @@ namespace AssetStudioGUI
}
}
private void glControl1_Load(object sender, EventArgs e)
private void glControl_Load(object sender, EventArgs e)
{
InitOpenTK();
glControlLoaded = true;
}
private void glControl1_Paint(object sender, PaintEventArgs e)
private void glControl_Paint(object sender, PaintEventArgs e)
{
glControl.MakeCurrent();
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
@@ -2079,9 +2433,9 @@ namespace AssetStudioGUI
if (wireFrameMode == 0 || wireFrameMode == 2)
{
GL.UseProgram(shadeMode == 0 ? pgmID : pgmColorID);
GL.UniformMatrix4f(uniformModelMatrix, false, modelMatrixData);
GL.UniformMatrix4f(uniformViewMatrix, false, viewMatrixData);
GL.UniformMatrix4f(uniformProjMatrix, false, projMatrixData);
GL.UniformMatrix4f(uniformModelMatrix, false, in modelMatrixData);
GL.UniformMatrix4f(uniformViewMatrix, false, in viewMatrixData);
GL.UniformMatrix4f(uniformProjMatrix, false, in projMatrixData);
GL.PolygonMode(TriangleFace.FrontAndBack, PolygonMode.Fill);
GL.DrawElements(PrimitiveType.Triangles, indiceData.Length, DrawElementsType.UnsignedInt, 0);
}
@@ -2091,9 +2445,9 @@ namespace AssetStudioGUI
GL.Enable(EnableCap.PolygonOffsetLine);
GL.PolygonOffset(-1, -1);
GL.UseProgram(pgmBlackID);
GL.UniformMatrix4f(uniformModelMatrix, false, modelMatrixData);
GL.UniformMatrix4f(uniformViewMatrix, false, viewMatrixData);
GL.UniformMatrix4f(uniformProjMatrix, false, projMatrixData);
GL.UniformMatrix4f(uniformModelMatrix, false, in modelMatrixData);
GL.UniformMatrix4f(uniformViewMatrix, false, in viewMatrixData);
GL.UniformMatrix4f(uniformProjMatrix, false, in projMatrixData);
GL.PolygonMode(TriangleFace.FrontAndBack, PolygonMode.Line);
GL.DrawElements(PrimitiveType.Triangles, indiceData.Length, DrawElementsType.UnsignedInt, 0);
GL.Disable(EnableCap.PolygonOffsetLine);
@@ -2103,130 +2457,7 @@ namespace AssetStudioGUI
glControl.SwapBuffers();
}
private void tabControl2_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabControl2.SelectedIndex == 1 && lastSelectedItem != null)
{
dumpTextBox.Text = DumpAsset(lastSelectedItem.Asset);
}
}
private void toolStripMenuItem15_Click(object sender, EventArgs e)
{
logger.ShowErrorMessage = toolStripMenuItem15.Checked;
}
private async void buildCABMapToolStripMenuItem_Click(object sender, EventArgs e)
{
var openFolderDialog = new OpenFolderDialog();
openFolderDialog.Title = $"Select {Studio.Game.Path} Folder";
if (openFolderDialog.ShowDialog(this) == DialogResult.OK)
{
Logger.Info("scanning for files");
var files = Directory.GetFiles(openFolderDialog.Folder, $"*{Studio.Game.Extension}", SearchOption.AllDirectories).ToList();
Logger.Info(string.Format("found {0} files", files.Count()));
await Task.Run(() => CABManager.BuildMap(files, Studio.Game));
}
}
private async void buildAssetMapToolStripMenuItem_Click(object sender, EventArgs e)
{
var openFolderDialog = new OpenFolderDialog();
openFolderDialog.Title = $"Select {Studio.Game.Path} Folder";
if (openFolderDialog.ShowDialog(this) == DialogResult.OK)
{
Logger.Info("scanning for files");
var files = Directory.GetFiles(openFolderDialog.Folder, $"*{Studio.Game.Extension}", SearchOption.AllDirectories).ToList();
Logger.Info(string.Format("found {0} files", files.Count()));
var saveFolderDialog = new OpenFolderDialog();
saveFolderDialog.InitialFolder = saveDirectoryBackup;
saveFolderDialog.Title = "Select Output Folder";
if (saveFolderDialog.ShowDialog(this) == DialogResult.OK)
{
timer.Stop();
saveDirectoryBackup = saveFolderDialog.Folder;
List<AssetEntry> toExportAssets = await Task.Run(() => BuildAssetMap(files));
ExportAssetsMap(saveFolderDialog.Folder, toExportAssets, ExportListType.XML);
}
}
}
private async void toolStripMenuItem16_DropDownOpening(object sender, EventArgs e)
{
if (specifyAIVersion.Enabled && await AIVersionManager.FetchVersions())
{
UpdateVersionList();
}
}
private async void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (specifyAIVersion.SelectedIndex == 0)
{
return;
}
optionsToolStripMenuItem.DropDown.Visible = false;
var version = specifyAIVersion.SelectedItem.ToString();
if (version.Contains(" "))
{
version = version.Split(' ')[0];
}
Logger.Info($"Loading AI v{version}");
SpecifyAIVersionUpdate(false);
var path = await AIVersionManager.FetchAI(version);
await Task.Run(() => ResourceIndex.FromFile(path));
UpdateVersionList();
SpecifyAIVersionUpdate(true);
}
private void UpdateVersionList()
{
var selectedIndex = specifyAIVersion.SelectedIndex;
specifyAIVersion.Items.Clear();
specifyAIVersion.Items.Add("None");
var versions = AIVersionManager.GetVersions();
foreach (var version in versions)
{
specifyAIVersion.Items.Add(version.Item1 + (version.Item2 ? " (cached)" : ""));
}
specifyAIVersion.SelectedIndexChanged -= new EventHandler(toolStripComboBox1_SelectedIndexChanged);
specifyAIVersion.SelectedIndex = selectedIndex;
specifyAIVersion.SelectedIndexChanged += new EventHandler(toolStripComboBox1_SelectedIndexChanged);
}
private void toolStripComboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
optionsToolStripMenuItem.DropDown.Visible = false;
Properties.Settings.Default.selectedGame = specifyGame.SelectedIndex;
Properties.Settings.Default.Save();
Studio.Game = GameManager.GetGame(Properties.Settings.Default.selectedGame);
Logger.Info($"Target Game is {Studio.Game.Name}");
ResetForm();
assetsManager.SpecifyUnityVersion = specifyUnityVersion.Text;
assetsManager.Game = Studio.Game;
CABManager.LoadMap(Studio.Game);
}
private void SpecifyAIVersionUpdate(bool value)
{
if (InvokeRequired)
{
BeginInvoke(new Action(() => { specifyAIVersion.Enabled = value; }));
}
else
{
specifyAIVersion.Enabled = value;
}
}
private void glControl1_MouseWheel(object sender, MouseEventArgs e)
private void glControl_MouseWheel(object sender, MouseEventArgs e)
{
if (glControl.Visible)
{
@@ -2235,7 +2466,7 @@ namespace AssetStudioGUI
}
}
private void glControl1_MouseDown(object sender, MouseEventArgs e)
private void glControl_MouseDown(object sender, MouseEventArgs e)
{
mdx = e.X;
mdy = e.Y;
@@ -2249,7 +2480,7 @@ namespace AssetStudioGUI
}
}
private void glControl1_MouseMove(object sender, MouseEventArgs e)
private void glControl_MouseMove(object sender, MouseEventArgs e)
{
if (lmdown || rmdown)
{
@@ -2274,7 +2505,7 @@ namespace AssetStudioGUI
}
}
private void glControl1_MouseUp(object sender, MouseEventArgs e)
private void glControl_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{

View File

@@ -1,64 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">

123
AssetStudioGUI/CNUnityForm.Designer.cs generated Normal file
View File

@@ -0,0 +1,123 @@
namespace AssetStudioGUI
{
partial class CNUnityForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.specifyCNUnityList = new System.Windows.Forms.DataGridView();
this.NameField = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.KeyField = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Cancel = new System.Windows.Forms.Button();
this.OKbutton = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.specifyCNUnityList)).BeginInit();
this.SuspendLayout();
//
// specifyCNUnityList
//
this.specifyCNUnityList.AllowUserToResizeColumns = false;
this.specifyCNUnityList.AllowUserToResizeRows = false;
this.specifyCNUnityList.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
this.specifyCNUnityList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.specifyCNUnityList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.NameField,
this.KeyField});
this.specifyCNUnityList.Location = new System.Drawing.Point(12, 12);
this.specifyCNUnityList.MultiSelect = false;
this.specifyCNUnityList.Name = "specifyCNUnityList";
this.specifyCNUnityList.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
this.specifyCNUnityList.RowTemplate.Height = 25;
this.specifyCNUnityList.Size = new System.Drawing.Size(332, 171);
this.specifyCNUnityList.TabIndex = 0;
//
// NameField
//
this.NameField.HeaderText = "Name";
this.NameField.Name = "NameField";
this.NameField.Width = 140;
//
// KeyField
//
this.KeyField.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.KeyField.HeaderText = "Key";
this.KeyField.Name = "KeyField";
//
// Cancel
//
this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Cancel.Location = new System.Drawing.Point(255, 190);
this.Cancel.Margin = new System.Windows.Forms.Padding(4);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(88, 26);
this.Cancel.TabIndex = 9;
this.Cancel.Text = "Cancel";
this.Cancel.UseVisualStyleBackColor = true;
this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
//
// OKbutton
//
this.OKbutton.Location = new System.Drawing.Point(159, 190);
this.OKbutton.Margin = new System.Windows.Forms.Padding(4);
this.OKbutton.Name = "OKbutton";
this.OKbutton.Size = new System.Drawing.Size(88, 26);
this.OKbutton.TabIndex = 8;
this.OKbutton.Text = "OK";
this.OKbutton.UseVisualStyleBackColor = true;
this.OKbutton.Click += new System.EventHandler(this.OKbutton_Click);
//
// CNUnityForm
//
this.AcceptButton = this.OKbutton;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(356, 229);
this.Controls.Add(this.Cancel);
this.Controls.Add(this.OKbutton);
this.Controls.Add(this.specifyCNUnityList);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "CNUnityForm";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "CNUnityForm";
this.TopMost = true;
((System.ComponentModel.ISupportInitialize)(this.specifyCNUnityList)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView specifyCNUnityList;
private System.Windows.Forms.Button Cancel;
private System.Windows.Forms.Button OKbutton;
private System.Windows.Forms.DataGridViewTextBoxColumn NameField;
private System.Windows.Forms.DataGridViewTextBoxColumn KeyField;
}
}

View File

@@ -0,0 +1,83 @@
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using AssetStudio;
using System.Linq;
namespace AssetStudioGUI
{
public partial class CNUnityForm : Form
{
public CNUnityForm()
{
InitializeComponent();
var keys = CNUnityKeyManager.GetEntries();
for (int i = 0; i < keys.Length; i++)
{
var key = keys[i];
var rowIdx = specifyCNUnityList.Rows.Add();
specifyCNUnityList.Rows[rowIdx].Cells["NameField"].Value = key.Name;
specifyCNUnityList.Rows[rowIdx].Cells["KeyField"].Value = key.Key;
}
var index = Properties.Settings.Default.selectedCNUnityKey;
if (index >= specifyCNUnityList.RowCount)
{
index = 0;
}
specifyCNUnityList.CurrentCell = specifyCNUnityList.Rows[index].Cells[0];
}
private void OKbutton_Click(object sender, EventArgs e)
{
var keys = new List<CNUnity.Entry>();
for (int i = specifyCNUnityList.Rows.Count - 1; i >= 0; i--)
{
var row = specifyCNUnityList.Rows[i];
var name = row.Cells["NameField"].Value as string;
var key = row.Cells["KeyField"].Value as string;
if (!(string.IsNullOrEmpty(name) || string.IsNullOrEmpty(key)))
{
var cnunity = new CNUnity.Entry(name, key);
if (cnunity.Validate())
{
keys.Add(cnunity);
continue;
}
}
if (specifyCNUnityList.CurrentCell.RowIndex == row.Index)
{
var previousRow = specifyCNUnityList.Rows.Cast<DataGridViewRow>().ElementAtOrDefault(i - 1);
if (previousRow != null)
{
specifyCNUnityList.CurrentCell = previousRow.Cells[0];
}
}
if (i != specifyCNUnityList.RowCount - 1)
{
specifyCNUnityList.Rows.RemoveAt(i);
}
}
CNUnityKeyManager.SaveEntries(keys.Reverse<CNUnity.Entry>().ToList());
CNUnityKeyManager.SetKey(specifyCNUnityList.CurrentRow.Index);
Properties.Settings.Default.selectedCNUnityKey = specifyCNUnityList.CurrentRow.Index;
Properties.Settings.Default.Save();
DialogResult = DialogResult.OK;
Close();
}
private void Cancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}

View File

@@ -0,0 +1,66 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="NameField.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="KeyField.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@@ -34,7 +34,7 @@ namespace AssetStudioGUI
if (!string.IsNullOrEmpty(InitialFolder))
{
var riid = new Guid("43826D1E-E718-42EE-BC55-A1E261C37BFE"); //IShellItem
if (NativeMethods.SHCreateItemFromParsingName(InitialFolder, IntPtr.Zero, ref riid, out var directoryShellItem) == NativeMethods.S_OK)
if (NativeMethods.SHCreateItemFromParsingName(InitialFolder, nint.Zero, ref riid, out var directoryShellItem) == NativeMethods.S_OK)
{
frm.SetFolder(directoryShellItem);
}
@@ -42,7 +42,7 @@ namespace AssetStudioGUI
if (!string.IsNullOrEmpty(DefaultFolder))
{
var riid = new Guid("43826D1E-E718-42EE-BC55-A1E261C37BFE"); //IShellItem
if (NativeMethods.SHCreateItemFromParsingName(DefaultFolder, IntPtr.Zero, ref riid, out var directoryShellItem) == NativeMethods.S_OK)
if (NativeMethods.SHCreateItemFromParsingName(DefaultFolder, nint.Zero, ref riid, out var directoryShellItem) == NativeMethods.S_OK)
{
frm.SetDefaultFolder(directoryShellItem);
}
@@ -54,7 +54,7 @@ namespace AssetStudioGUI
{
if (shellItem.GetDisplayName(NativeMethods.SIGDN_FILESYSPATH, out var pszString) == NativeMethods.S_OK)
{
if (pszString != IntPtr.Zero)
if (pszString != nint.Zero)
{
try
{
@@ -127,11 +127,11 @@ namespace AssetStudioGUI
{
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[PreserveSig()]
uint Show([In, Optional] IntPtr hwndOwner); //IModalWindow
uint Show([In, Optional] nint hwndOwner); //IModalWindow
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetFileTypes([In] uint cFileTypes, [In, MarshalAs(UnmanagedType.LPArray)] IntPtr rgFilterSpec);
uint SetFileTypes([In] uint cFileTypes, [In, MarshalAs(UnmanagedType.LPArray)] nint rgFilterSpec);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetFileTypeIndex([In] uint iFileType);
@@ -140,7 +140,7 @@ namespace AssetStudioGUI
uint GetFileTypeIndex(out uint piFileType);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint Advise([In, MarshalAs(UnmanagedType.Interface)] IntPtr pfde, out uint pdwCookie);
uint Advise([In, MarshalAs(UnmanagedType.Interface)] nint pfde, out uint pdwCookie);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint Unadvise([In] uint dwCookie);
@@ -197,7 +197,7 @@ namespace AssetStudioGUI
uint ClearClientData();
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetFilter([MarshalAs(UnmanagedType.Interface)] IntPtr pFilter);
uint SetFilter([MarshalAs(UnmanagedType.Interface)] nint pFilter);
}
@@ -205,13 +205,13 @@ namespace AssetStudioGUI
internal interface IShellItem
{
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint BindToHandler([In] IntPtr pbc, [In] ref Guid rbhid, [In] ref Guid riid, [Out, MarshalAs(UnmanagedType.Interface)] out IntPtr ppvOut);
uint BindToHandler([In] nint pbc, [In] ref Guid rbhid, [In] ref Guid riid, [Out, MarshalAs(UnmanagedType.Interface)] out nint ppvOut);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint GetParent([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint GetDisplayName([In] uint sigdnName, out IntPtr ppszName);
uint GetDisplayName([In] uint sigdnName, out nint ppszName);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint GetAttributes([In] uint sfgaoMask, out uint psfgaoAttribs);
@@ -224,6 +224,6 @@ namespace AssetStudioGUI
[DllImport("shell32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
internal static extern int SHCreateItemFromParsingName([MarshalAs(UnmanagedType.LPWStr)] string pszPath, IntPtr pbc, ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out IShellItem ppv);
internal static extern int SHCreateItemFromParsingName([MarshalAs(UnmanagedType.LPWStr)] string pszPath, nint pbc, ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out IShellItem ppv);
}
}

View File

@@ -32,11 +32,8 @@
this.OKbutton = new System.Windows.Forms.Button();
this.Cancel = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.disableShader = new System.Windows.Forms.CheckBox();
this.ignoreController = new System.Windows.Forms.CheckBox();
this.disableRndrr = new System.Windows.Forms.CheckBox();
this.exportIndexObject = new System.Windows.Forms.CheckBox();
this.exportAssetBundle = new System.Windows.Forms.CheckBox();
this.skipRenderer = new System.Windows.Forms.CheckBox();
this.exportMiHoYoBinData = 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();
@@ -48,6 +45,7 @@
this.topng = new System.Windows.Forms.RadioButton();
this.tobmp = new System.Windows.Forms.RadioButton();
this.converttexture = new System.Windows.Forms.CheckBox();
this.collectAnimations = new System.Windows.Forms.CheckBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.exportAllUvsAsDiffuseMaps = new System.Windows.Forms.CheckBox();
this.exportBlendShape = new System.Windows.Forms.CheckBox();
@@ -68,9 +66,10 @@
this.eulerFilter = new System.Windows.Forms.CheckBox();
this.exportUvsTooltip = new System.Windows.Forms.ToolTip(this.components);
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.enableXor = new System.Windows.Forms.CheckBox();
this.encrypted = new System.Windows.Forms.CheckBox();
this.key = new System.Windows.Forms.NumericUpDown();
this.label7 = new System.Windows.Forms.Label();
this.keyToolTip = new System.Windows.Forms.ToolTip(this.components);
this.groupBox1.SuspendLayout();
this.panel1.SuspendLayout();
this.groupBox2.SuspendLayout();
@@ -83,9 +82,10 @@
//
// OKbutton
//
this.OKbutton.Location = new System.Drawing.Point(318, 380);
this.OKbutton.Location = new System.Drawing.Point(371, 439);
this.OKbutton.Margin = new System.Windows.Forms.Padding(4);
this.OKbutton.Name = "OKbutton";
this.OKbutton.Size = new System.Drawing.Size(75, 23);
this.OKbutton.Size = new System.Drawing.Size(88, 26);
this.OKbutton.TabIndex = 6;
this.OKbutton.Text = "OK";
this.OKbutton.UseVisualStyleBackColor = true;
@@ -94,9 +94,10 @@
// Cancel
//
this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Cancel.Location = new System.Drawing.Point(399, 380);
this.Cancel.Location = new System.Drawing.Point(465, 439);
this.Cancel.Margin = new System.Windows.Forms.Padding(4);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(75, 23);
this.Cancel.Size = new System.Drawing.Size(88, 26);
this.Cancel.TabIndex = 7;
this.Cancel.Text = "Cancel";
this.Cancel.UseVisualStyleBackColor = true;
@@ -105,11 +106,8 @@
// groupBox1
//
this.groupBox1.AutoSize = true;
this.groupBox1.Controls.Add(this.disableShader);
this.groupBox1.Controls.Add(this.ignoreController);
this.groupBox1.Controls.Add(this.disableRndrr);
this.groupBox1.Controls.Add(this.exportIndexObject);
this.groupBox1.Controls.Add(this.exportAssetBundle);
this.groupBox1.Controls.Add(this.skipRenderer);
this.groupBox1.Controls.Add(this.exportMiHoYoBinData);
this.groupBox1.Controls.Add(this.openAfterExport);
this.groupBox1.Controls.Add(this.restoreExtensionName);
this.groupBox1.Controls.Add(this.assetGroupOptions);
@@ -117,77 +115,48 @@
this.groupBox1.Controls.Add(this.convertAudio);
this.groupBox1.Controls.Add(this.panel1);
this.groupBox1.Controls.Add(this.converttexture);
this.groupBox1.Location = new System.Drawing.Point(12, 13);
this.groupBox1.Location = new System.Drawing.Point(14, 15);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(232, 277);
this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
this.groupBox1.Size = new System.Drawing.Size(271, 293);
this.groupBox1.TabIndex = 9;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Export";
//
// disableShader
// skipRenderer
//
this.disableShader.AutoSize = true;
this.disableShader.Location = new System.Drawing.Point(97, 219);
this.disableShader.Name = "disableShader";
this.disableShader.Size = new System.Drawing.Size(98, 17);
this.disableShader.TabIndex = 22;
this.disableShader.Text = "Disable Shader";
this.disableShader.UseVisualStyleBackColor = true;
this.skipRenderer.AutoSize = true;
this.skipRenderer.Location = new System.Drawing.Point(7, 226);
this.skipRenderer.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.skipRenderer.Name = "skipRenderer";
this.skipRenderer.Size = new System.Drawing.Size(98, 19);
this.skipRenderer.TabIndex = 23;
this.skipRenderer.Text = "Skip Renderer";
this.skipRenderer.UseVisualStyleBackColor = true;
//
// ignoreController
// exportMiHoYoBinData
//
this.ignoreController.AutoSize = true;
this.ignoreController.Checked = true;
this.ignoreController.CheckState = System.Windows.Forms.CheckState.Checked;
this.ignoreController.Location = new System.Drawing.Point(6, 241);
this.ignoreController.Name = "ignoreController";
this.ignoreController.Size = new System.Drawing.Size(152, 17);
this.ignoreController.TabIndex = 21;
this.ignoreController.Text = "Ignore Controller Animation";
this.ignoreController.UseVisualStyleBackColor = true;
//
// disableRndrr
//
this.disableRndrr.AutoSize = true;
this.disableRndrr.Location = new System.Drawing.Point(97, 196);
this.disableRndrr.Name = "disableRndrr";
this.disableRndrr.Size = new System.Drawing.Size(113, 17);
this.disableRndrr.TabIndex = 13;
this.disableRndrr.Text = "Disable Renderers";
this.disableRndrr.UseVisualStyleBackColor = true;
//
// exportIndexObject
//
this.exportIndexObject.AutoSize = true;
this.exportIndexObject.Checked = true;
this.exportIndexObject.CheckState = System.Windows.Forms.CheckState.Checked;
this.exportIndexObject.Location = new System.Drawing.Point(6, 219);
this.exportIndexObject.Name = "exportIndexObject";
this.exportIndexObject.Size = new System.Drawing.Size(83, 17);
this.exportIndexObject.TabIndex = 12;
this.exportIndexObject.Text = "IndexObject";
this.exportIndexObject.UseVisualStyleBackColor = true;
//
// exportAssetBundle
//
this.exportAssetBundle.AutoSize = true;
this.exportAssetBundle.Checked = true;
this.exportAssetBundle.CheckState = System.Windows.Forms.CheckState.Checked;
this.exportAssetBundle.Location = new System.Drawing.Point(6, 196);
this.exportAssetBundle.Name = "exportAssetBundle";
this.exportAssetBundle.Size = new System.Drawing.Size(85, 17);
this.exportAssetBundle.TabIndex = 11;
this.exportAssetBundle.Text = "AssetBundle";
this.exportAssetBundle.UseVisualStyleBackColor = true;
this.exportMiHoYoBinData.AutoSize = true;
this.exportMiHoYoBinData.Checked = true;
this.exportMiHoYoBinData.CheckState = System.Windows.Forms.CheckState.Checked;
this.exportMiHoYoBinData.Location = new System.Drawing.Point(7, 251);
this.exportMiHoYoBinData.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.exportMiHoYoBinData.Name = "exportMiHoYoBinData";
this.exportMiHoYoBinData.Size = new System.Drawing.Size(147, 19);
this.exportMiHoYoBinData.TabIndex = 22;
this.exportMiHoYoBinData.Text = "Export MiHoYoBinData";
this.exportMiHoYoBinData.UseVisualStyleBackColor = true;
//
// openAfterExport
//
this.openAfterExport.AutoSize = true;
this.openAfterExport.Checked = true;
this.openAfterExport.CheckState = System.Windows.Forms.CheckState.Checked;
this.openAfterExport.Location = new System.Drawing.Point(6, 173);
this.openAfterExport.Location = new System.Drawing.Point(7, 200);
this.openAfterExport.Margin = new System.Windows.Forms.Padding(4);
this.openAfterExport.Name = "openAfterExport";
this.openAfterExport.Size = new System.Drawing.Size(137, 17);
this.openAfterExport.Size = new System.Drawing.Size(153, 19);
this.openAfterExport.TabIndex = 10;
this.openAfterExport.Text = "Open folder after export";
this.openAfterExport.UseVisualStyleBackColor = true;
@@ -197,9 +166,10 @@
this.restoreExtensionName.AutoSize = true;
this.restoreExtensionName.Checked = true;
this.restoreExtensionName.CheckState = System.Windows.Forms.CheckState.Checked;
this.restoreExtensionName.Location = new System.Drawing.Point(6, 63);
this.restoreExtensionName.Location = new System.Drawing.Point(7, 72);
this.restoreExtensionName.Margin = new System.Windows.Forms.Padding(4);
this.restoreExtensionName.Name = "restoreExtensionName";
this.restoreExtensionName.Size = new System.Drawing.Size(190, 17);
this.restoreExtensionName.Size = new System.Drawing.Size(204, 19);
this.restoreExtensionName.TabIndex = 9;
this.restoreExtensionName.Text = "Restore TextAsset extension name";
this.restoreExtensionName.UseVisualStyleBackColor = true;
@@ -213,17 +183,19 @@
"container path",
"source file name",
"do not group"});
this.assetGroupOptions.Location = new System.Drawing.Point(6, 35);
this.assetGroupOptions.Location = new System.Drawing.Point(7, 40);
this.assetGroupOptions.Margin = new System.Windows.Forms.Padding(4);
this.assetGroupOptions.Name = "assetGroupOptions";
this.assetGroupOptions.Size = new System.Drawing.Size(149, 21);
this.assetGroupOptions.Size = new System.Drawing.Size(173, 23);
this.assetGroupOptions.TabIndex = 8;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(6, 18);
this.label6.Location = new System.Drawing.Point(7, 21);
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(127, 13);
this.label6.Size = new System.Drawing.Size(140, 15);
this.label6.TabIndex = 7;
this.label6.Text = "Group exported assets by";
//
@@ -232,9 +204,10 @@
this.convertAudio.AutoSize = true;
this.convertAudio.Checked = true;
this.convertAudio.CheckState = System.Windows.Forms.CheckState.Checked;
this.convertAudio.Location = new System.Drawing.Point(6, 150);
this.convertAudio.Location = new System.Drawing.Point(7, 172);
this.convertAudio.Margin = new System.Windows.Forms.Padding(4);
this.convertAudio.Name = "convertAudio";
this.convertAudio.Size = new System.Drawing.Size(179, 17);
this.convertAudio.Size = new System.Drawing.Size(200, 19);
this.convertAudio.TabIndex = 6;
this.convertAudio.Text = "Convert AudioClip to WAV(PCM)";
this.convertAudio.UseVisualStyleBackColor = true;
@@ -245,17 +218,19 @@
this.panel1.Controls.Add(this.tojpg);
this.panel1.Controls.Add(this.topng);
this.panel1.Controls.Add(this.tobmp);
this.panel1.Location = new System.Drawing.Point(20, 111);
this.panel1.Location = new System.Drawing.Point(23, 128);
this.panel1.Margin = new System.Windows.Forms.Padding(4);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(202, 32);
this.panel1.Size = new System.Drawing.Size(236, 38);
this.panel1.TabIndex = 5;
//
// totga
//
this.totga.AutoSize = true;
this.totga.Location = new System.Drawing.Point(150, 6);
this.totga.Location = new System.Drawing.Point(175, 8);
this.totga.Margin = new System.Windows.Forms.Padding(4);
this.totga.Name = "totga";
this.totga.Size = new System.Drawing.Size(44, 17);
this.totga.Size = new System.Drawing.Size(43, 19);
this.totga.TabIndex = 2;
this.totga.Text = "Tga";
this.totga.UseVisualStyleBackColor = true;
@@ -263,9 +238,10 @@
// tojpg
//
this.tojpg.AutoSize = true;
this.tojpg.Location = new System.Drawing.Point(97, 6);
this.tojpg.Location = new System.Drawing.Point(113, 8);
this.tojpg.Margin = new System.Windows.Forms.Padding(4);
this.tojpg.Name = "tojpg";
this.tojpg.Size = new System.Drawing.Size(48, 17);
this.tojpg.Size = new System.Drawing.Size(49, 19);
this.tojpg.TabIndex = 4;
this.tojpg.Text = "Jpeg";
this.tojpg.UseVisualStyleBackColor = true;
@@ -274,9 +250,10 @@
//
this.topng.AutoSize = true;
this.topng.Checked = true;
this.topng.Location = new System.Drawing.Point(50, 6);
this.topng.Location = new System.Drawing.Point(58, 8);
this.topng.Margin = new System.Windows.Forms.Padding(4);
this.topng.Name = "topng";
this.topng.Size = new System.Drawing.Size(44, 17);
this.topng.Size = new System.Drawing.Size(46, 19);
this.topng.TabIndex = 3;
this.topng.TabStop = true;
this.topng.Text = "Png";
@@ -285,9 +262,10 @@
// tobmp
//
this.tobmp.AutoSize = true;
this.tobmp.Location = new System.Drawing.Point(3, 6);
this.tobmp.Location = new System.Drawing.Point(4, 8);
this.tobmp.Margin = new System.Windows.Forms.Padding(4);
this.tobmp.Name = "tobmp";
this.tobmp.Size = new System.Drawing.Size(46, 17);
this.tobmp.Size = new System.Drawing.Size(50, 19);
this.tobmp.TabIndex = 2;
this.tobmp.Text = "Bmp";
this.tobmp.UseVisualStyleBackColor = true;
@@ -297,16 +275,31 @@
this.converttexture.AutoSize = true;
this.converttexture.Checked = true;
this.converttexture.CheckState = System.Windows.Forms.CheckState.Checked;
this.converttexture.Location = new System.Drawing.Point(6, 87);
this.converttexture.Location = new System.Drawing.Point(7, 100);
this.converttexture.Margin = new System.Windows.Forms.Padding(4);
this.converttexture.Name = "converttexture";
this.converttexture.Size = new System.Drawing.Size(116, 17);
this.converttexture.Size = new System.Drawing.Size(123, 19);
this.converttexture.TabIndex = 1;
this.converttexture.Text = "Convert Texture2D";
this.converttexture.UseVisualStyleBackColor = true;
//
// collectAnimations
//
this.collectAnimations.AutoSize = true;
this.collectAnimations.Checked = true;
this.collectAnimations.CheckState = System.Windows.Forms.CheckState.Checked;
this.collectAnimations.Location = new System.Drawing.Point(8, 122);
this.collectAnimations.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.collectAnimations.Name = "collectAnimations";
this.collectAnimations.Size = new System.Drawing.Size(125, 19);
this.collectAnimations.TabIndex = 24;
this.collectAnimations.Text = "Collect animations";
this.collectAnimations.UseVisualStyleBackColor = true;
//
// groupBox2
//
this.groupBox2.AutoSize = true;
this.groupBox2.Controls.Add(this.collectAnimations);
this.groupBox2.Controls.Add(this.exportAllUvsAsDiffuseMaps);
this.groupBox2.Controls.Add(this.exportBlendShape);
this.groupBox2.Controls.Add(this.exportAnimations);
@@ -324,9 +317,11 @@
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(292, 15);
this.groupBox2.Margin = new System.Windows.Forms.Padding(4);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(224, 362);
this.groupBox2.Padding = new System.Windows.Forms.Padding(4);
this.groupBox2.Size = new System.Drawing.Size(261, 419);
this.groupBox2.TabIndex = 11;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Fbx";
@@ -335,9 +330,10 @@
//
this.exportAllUvsAsDiffuseMaps.AccessibleDescription = "";
this.exportAllUvsAsDiffuseMaps.AutoSize = true;
this.exportAllUvsAsDiffuseMaps.Location = new System.Drawing.Point(6, 185);
this.exportAllUvsAsDiffuseMaps.Location = new System.Drawing.Point(8, 226);
this.exportAllUvsAsDiffuseMaps.Margin = new System.Windows.Forms.Padding(4);
this.exportAllUvsAsDiffuseMaps.Name = "exportAllUvsAsDiffuseMaps";
this.exportAllUvsAsDiffuseMaps.Size = new System.Drawing.Size(168, 17);
this.exportAllUvsAsDiffuseMaps.Size = new System.Drawing.Size(183, 19);
this.exportAllUvsAsDiffuseMaps.TabIndex = 23;
this.exportAllUvsAsDiffuseMaps.Text = "Export all UVs as diffuse maps";
this.exportUvsTooltip.SetToolTip(this.exportAllUvsAsDiffuseMaps, "Unchecked: UV1 exported as normal map. Check this if your export is missing a UV " +
@@ -349,9 +345,10 @@
this.exportBlendShape.AutoSize = true;
this.exportBlendShape.Checked = true;
this.exportBlendShape.CheckState = System.Windows.Forms.CheckState.Checked;
this.exportBlendShape.Location = new System.Drawing.Point(6, 138);
this.exportBlendShape.Location = new System.Drawing.Point(8, 172);
this.exportBlendShape.Margin = new System.Windows.Forms.Padding(4);
this.exportBlendShape.Name = "exportBlendShape";
this.exportBlendShape.Size = new System.Drawing.Size(114, 17);
this.exportBlendShape.Size = new System.Drawing.Size(124, 19);
this.exportBlendShape.TabIndex = 22;
this.exportBlendShape.Text = "Export blendshape";
this.exportBlendShape.UseVisualStyleBackColor = true;
@@ -361,9 +358,10 @@
this.exportAnimations.AutoSize = true;
this.exportAnimations.Checked = true;
this.exportAnimations.CheckState = System.Windows.Forms.CheckState.Checked;
this.exportAnimations.Location = new System.Drawing.Point(6, 114);
this.exportAnimations.Location = new System.Drawing.Point(8, 147);
this.exportAnimations.Margin = new System.Windows.Forms.Padding(4);
this.exportAnimations.Name = "exportAnimations";
this.exportAnimations.Size = new System.Drawing.Size(109, 17);
this.exportAnimations.Size = new System.Drawing.Size(122, 19);
this.exportAnimations.TabIndex = 21;
this.exportAnimations.Text = "Export animations";
this.exportAnimations.UseVisualStyleBackColor = true;
@@ -376,9 +374,10 @@
0,
0,
131072});
this.scaleFactor.Location = new System.Drawing.Point(83, 243);
this.scaleFactor.Location = new System.Drawing.Point(98, 292);
this.scaleFactor.Margin = new System.Windows.Forms.Padding(4);
this.scaleFactor.Name = "scaleFactor";
this.scaleFactor.Size = new System.Drawing.Size(60, 20);
this.scaleFactor.Size = new System.Drawing.Size(70, 23);
this.scaleFactor.TabIndex = 20;
this.scaleFactor.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.scaleFactor.Value = new decimal(new int[] {
@@ -390,9 +389,10 @@
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(6, 245);
this.label5.Location = new System.Drawing.Point(8, 294);
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(64, 13);
this.label5.Size = new System.Drawing.Size(67, 15);
this.label5.TabIndex = 19;
this.label5.Text = "ScaleFactor";
//
@@ -403,17 +403,19 @@
this.fbxFormat.Items.AddRange(new object[] {
"Binary",
"Ascii"});
this.fbxFormat.Location = new System.Drawing.Point(77, 275);
this.fbxFormat.Location = new System.Drawing.Point(91, 330);
this.fbxFormat.Margin = new System.Windows.Forms.Padding(4);
this.fbxFormat.Name = "fbxFormat";
this.fbxFormat.Size = new System.Drawing.Size(61, 21);
this.fbxFormat.Size = new System.Drawing.Size(70, 23);
this.fbxFormat.TabIndex = 18;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(6, 280);
this.label4.Location = new System.Drawing.Point(8, 334);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(59, 13);
this.label4.Size = new System.Drawing.Size(65, 15);
this.label4.TabIndex = 17;
this.label4.Text = "FBXFormat";
//
@@ -428,25 +430,28 @@
"7.3",
"7.4",
"7.5"});
this.fbxVersion.Location = new System.Drawing.Point(77, 308);
this.fbxVersion.Location = new System.Drawing.Point(91, 367);
this.fbxVersion.Margin = new System.Windows.Forms.Padding(4);
this.fbxVersion.Name = "fbxVersion";
this.fbxVersion.Size = new System.Drawing.Size(47, 21);
this.fbxVersion.Size = new System.Drawing.Size(54, 23);
this.fbxVersion.TabIndex = 16;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(6, 311);
this.label3.Location = new System.Drawing.Point(8, 371);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(62, 13);
this.label3.Size = new System.Drawing.Size(65, 15);
this.label3.TabIndex = 15;
this.label3.Text = "FBXVersion";
//
// boneSize
//
this.boneSize.Location = new System.Drawing.Point(65, 213);
this.boneSize.Location = new System.Drawing.Point(77, 258);
this.boneSize.Margin = new System.Windows.Forms.Padding(4);
this.boneSize.Name = "boneSize";
this.boneSize.Size = new System.Drawing.Size(46, 20);
this.boneSize.Size = new System.Drawing.Size(54, 23);
this.boneSize.TabIndex = 11;
this.boneSize.Value = new decimal(new int[] {
10,
@@ -457,9 +462,10 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(6, 216);
this.label2.Location = new System.Drawing.Point(8, 260);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(52, 13);
this.label2.Size = new System.Drawing.Size(54, 15);
this.label2.TabIndex = 10;
this.label2.Text = "BoneSize";
//
@@ -468,9 +474,10 @@
this.exportSkins.AutoSize = true;
this.exportSkins.Checked = true;
this.exportSkins.CheckState = System.Windows.Forms.CheckState.Checked;
this.exportSkins.Location = new System.Drawing.Point(6, 90);
this.exportSkins.Location = new System.Drawing.Point(8, 96);
this.exportSkins.Margin = new System.Windows.Forms.Padding(4);
this.exportSkins.Name = "exportSkins";
this.exportSkins.Size = new System.Drawing.Size(83, 17);
this.exportSkins.Size = new System.Drawing.Size(89, 19);
this.exportSkins.TabIndex = 8;
this.exportSkins.Text = "Export skins";
this.exportSkins.UseVisualStyleBackColor = true;
@@ -478,9 +485,10 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(26, 42);
this.label1.Location = new System.Drawing.Point(31, 41);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 13);
this.label1.Size = new System.Drawing.Size(81, 15);
this.label1.TabIndex = 7;
this.label1.Text = "FilterPrecision";
//
@@ -492,9 +500,10 @@
0,
0,
131072});
this.filterPrecision.Location = new System.Drawing.Point(127, 40);
this.filterPrecision.Location = new System.Drawing.Point(149, 38);
this.filterPrecision.Margin = new System.Windows.Forms.Padding(4);
this.filterPrecision.Name = "filterPrecision";
this.filterPrecision.Size = new System.Drawing.Size(51, 20);
this.filterPrecision.Size = new System.Drawing.Size(59, 23);
this.filterPrecision.TabIndex = 6;
this.filterPrecision.Value = new decimal(new int[] {
25,
@@ -505,9 +514,10 @@
// castToBone
//
this.castToBone.AutoSize = true;
this.castToBone.Location = new System.Drawing.Point(6, 161);
this.castToBone.Location = new System.Drawing.Point(8, 198);
this.castToBone.Margin = new System.Windows.Forms.Padding(4);
this.castToBone.Name = "castToBone";
this.castToBone.Size = new System.Drawing.Size(131, 17);
this.castToBone.Size = new System.Drawing.Size(143, 19);
this.castToBone.TabIndex = 5;
this.castToBone.Text = "All nodes cast to bone";
this.castToBone.UseVisualStyleBackColor = true;
@@ -517,9 +527,10 @@
this.exportAllNodes.AutoSize = true;
this.exportAllNodes.Checked = true;
this.exportAllNodes.CheckState = System.Windows.Forms.CheckState.Checked;
this.exportAllNodes.Location = new System.Drawing.Point(6, 66);
this.exportAllNodes.Location = new System.Drawing.Point(8, 68);
this.exportAllNodes.Margin = new System.Windows.Forms.Padding(4);
this.exportAllNodes.Name = "exportAllNodes";
this.exportAllNodes.Size = new System.Drawing.Size(101, 17);
this.exportAllNodes.Size = new System.Drawing.Size(110, 19);
this.exportAllNodes.TabIndex = 4;
this.exportAllNodes.Text = "Export all nodes";
this.exportAllNodes.UseVisualStyleBackColor = true;
@@ -529,9 +540,10 @@
this.eulerFilter.AutoSize = true;
this.eulerFilter.Checked = true;
this.eulerFilter.CheckState = System.Windows.Forms.CheckState.Checked;
this.eulerFilter.Location = new System.Drawing.Point(6, 22);
this.eulerFilter.Location = new System.Drawing.Point(8, 17);
this.eulerFilter.Margin = new System.Windows.Forms.Padding(4);
this.eulerFilter.Name = "eulerFilter";
this.eulerFilter.Size = new System.Drawing.Size(72, 17);
this.eulerFilter.Size = new System.Drawing.Size(78, 19);
this.eulerFilter.TabIndex = 3;
this.eulerFilter.Text = "EulerFilter";
this.eulerFilter.UseVisualStyleBackColor = true;
@@ -539,62 +551,69 @@
// groupBox3
//
this.groupBox3.AutoSize = true;
this.groupBox3.Controls.Add(this.enableXor);
this.groupBox3.Controls.Add(this.encrypted);
this.groupBox3.Controls.Add(this.key);
this.groupBox3.Controls.Add(this.label7);
this.groupBox3.Location = new System.Drawing.Point(12, 296);
this.groupBox3.Location = new System.Drawing.Point(158, 315);
this.groupBox3.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(232, 79);
this.groupBox3.TabIndex = 11;
this.groupBox3.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.groupBox3.Size = new System.Drawing.Size(126, 118);
this.groupBox3.TabIndex = 12;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "MiHoYoBinData";
//
// enableXor
// encrypted
//
this.enableXor.AutoSize = true;
this.enableXor.Checked = true;
this.enableXor.CheckState = System.Windows.Forms.CheckState.Checked;
this.enableXor.Location = new System.Drawing.Point(9, 24);
this.enableXor.Name = "enableXor";
this.enableXor.Size = new System.Drawing.Size(85, 17);
this.enableXor.TabIndex = 12;
this.enableXor.Text = "Enable XOR";
this.enableXor.UseVisualStyleBackColor = true;
this.encrypted.AutoSize = true;
this.encrypted.Checked = true;
this.encrypted.CheckState = System.Windows.Forms.CheckState.Checked;
this.encrypted.Location = new System.Drawing.Point(20, 35);
this.encrypted.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.encrypted.Name = "encrypted";
this.encrypted.Size = new System.Drawing.Size(79, 19);
this.encrypted.TabIndex = 12;
this.encrypted.Text = "Encrypted";
this.encrypted.UseVisualStyleBackColor = true;
//
// key
//
this.key.Hexadecimal = true;
this.key.Location = new System.Drawing.Point(124, 21);
this.key.Location = new System.Drawing.Point(54, 72);
this.key.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.key.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.key.Name = "key";
this.key.Size = new System.Drawing.Size(61, 20);
this.key.Size = new System.Drawing.Size(55, 23);
this.key.TabIndex = 8;
this.keyToolTip.SetToolTip(this.key, "Key in hex");
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(97, 25);
this.label7.Location = new System.Drawing.Point(20, 74);
this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(25, 13);
this.label7.Size = new System.Drawing.Size(26, 15);
this.label7.TabIndex = 7;
this.label7.Text = "Key";
//
// ExportOptions
//
this.AcceptButton = this.OKbutton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(486, 416);
this.ClientSize = new System.Drawing.Size(567, 480);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.Cancel);
this.Controls.Add(this.OKbutton);
this.Margin = new System.Windows.Forms.Padding(4);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ExportOptions";
@@ -654,14 +673,13 @@
private System.Windows.Forms.CheckBox openAfterExport;
private System.Windows.Forms.CheckBox exportAllUvsAsDiffuseMaps;
private System.Windows.Forms.ToolTip exportUvsTooltip;
private System.Windows.Forms.CheckBox exportIndexObject;
private System.Windows.Forms.CheckBox exportAssetBundle;
private System.Windows.Forms.CheckBox collectAnimations;
private System.Windows.Forms.CheckBox skipRenderer;
private System.Windows.Forms.CheckBox exportMiHoYoBinData;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.CheckBox encrypted;
private System.Windows.Forms.NumericUpDown key;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.CheckBox enableXor;
private System.Windows.Forms.CheckBox disableRndrr;
private System.Windows.Forms.CheckBox ignoreController;
private System.Windows.Forms.CheckBox disableShader;
private System.Windows.Forms.ToolTip keyToolTip;
}
}

View File

@@ -23,13 +23,6 @@ namespace AssetStudioGUI
}
}
openAfterExport.Checked = Properties.Settings.Default.openAfterExport;
exportAssetBundle.Checked = Properties.Settings.Default.exportAssetBundle;
exportIndexObject.Checked = Properties.Settings.Default.exportIndexObject;
disableRndrr.Checked = Properties.Settings.Default.disableRndrr;
disableShader.Checked = Properties.Settings.Default.disableShader;
key.Value = Properties.Settings.Default.key;
enableXor.Checked = Properties.Settings.Default.enableXor;
ignoreController.Checked = Properties.Settings.Default.ignoreController;
eulerFilter.Checked = Properties.Settings.Default.eulerFilter;
filterPrecision.Value = Properties.Settings.Default.filterPrecision;
exportAllNodes.Checked = Properties.Settings.Default.exportAllNodes;
@@ -42,6 +35,11 @@ namespace AssetStudioGUI
scaleFactor.Value = Properties.Settings.Default.scaleFactor;
fbxVersion.SelectedIndex = Properties.Settings.Default.fbxVersion;
fbxFormat.SelectedIndex = Properties.Settings.Default.fbxFormat;
skipRenderer.Checked = Properties.Settings.Default.skipRenderer;
exportMiHoYoBinData.Checked = Properties.Settings.Default.exportMiHoYoBinData;
collectAnimations.Checked = Properties.Settings.Default.collectAnimations;
encrypted.Checked = Properties.Settings.Default.encrypted;
key.Value = Properties.Settings.Default.key;
}
private void OKbutton_Click(object sender, EventArgs e)
@@ -59,19 +57,6 @@ namespace AssetStudioGUI
}
}
Properties.Settings.Default.openAfterExport = openAfterExport.Checked;
Properties.Settings.Default.exportAssetBundle = exportAssetBundle.Checked;
AssetBundle.Exportable = Properties.Settings.Default.exportAssetBundle;
Properties.Settings.Default.exportIndexObject = exportIndexObject.Checked;
IndexObject.Exportable = Properties.Settings.Default.exportAssetBundle;
Properties.Settings.Default.disableRndrr = disableRndrr.Checked;
Renderer.Parsable = !Properties.Settings.Default.disableRndrr;
Properties.Settings.Default.disableShader = disableShader.Checked;
Shader.Parsable = !Properties.Settings.Default.disableShader;
Properties.Settings.Default.key = (byte)key.Value;
Properties.Settings.Default.enableXor = enableXor.Checked;
MiHoYoBinData.Key = (byte)key.Value;
MiHoYoBinData.doXOR = enableXor.Checked;
Properties.Settings.Default.ignoreController = ignoreController.Checked;
Properties.Settings.Default.eulerFilter = eulerFilter.Checked;
Properties.Settings.Default.filterPrecision = filterPrecision.Value;
Properties.Settings.Default.exportAllNodes = exportAllNodes.Checked;
@@ -84,7 +69,15 @@ namespace AssetStudioGUI
Properties.Settings.Default.scaleFactor = scaleFactor.Value;
Properties.Settings.Default.fbxVersion = fbxVersion.SelectedIndex;
Properties.Settings.Default.fbxFormat = fbxFormat.SelectedIndex;
Properties.Settings.Default.skipRenderer = skipRenderer.Checked;
Properties.Settings.Default.exportMiHoYoBinData = exportMiHoYoBinData.Checked;
Properties.Settings.Default.collectAnimations = collectAnimations.Checked;
Properties.Settings.Default.encrypted = encrypted.Checked;
Properties.Settings.Default.key = (byte)key.Value;
Properties.Settings.Default.Save();
Renderer.Skipped = !Properties.Settings.Default.skipRenderer;
MiHoYoBinData.Key = (byte)key.Value;
MiHoYoBinData.Encrypted = encrypted.Checked;
DialogResult = DialogResult.OK;
Close();
}

View File

@@ -1,64 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
@@ -120,4 +60,13 @@
<metadata name="exportUvsTooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="exportUvsTooltip.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="keyToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>162, 17</value>
</metadata>
</root>

View File

@@ -1,6 +1,6 @@
using AssetStudio;
using Newtonsoft.Json;
using System;
using Newtonsoft.Json.Converters;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -25,7 +25,7 @@ namespace AssetStudioGUI
{
using (var file = File.OpenWrite(exportFullPath))
{
image.WriteToStream(file, type);
image.WriteToStream(file, type);
}
return true;
}
@@ -115,6 +115,7 @@ namespace AssetStudioGUI
switch (m_MiHoYoBinData.Type)
{
case MiHoYoBinDataType.JSON:
if (!TryExportFile(exportPath, item, ".json", out exportFullPath))
return false;
var json = m_MiHoYoBinData.Dump() as string;
@@ -125,10 +126,18 @@ namespace AssetStudioGUI
}
break;
case MiHoYoBinDataType.Bytes:
if (!TryExportFile(exportPath, item, ".bin", out exportFullPath))
var extension = ".bin";
if (Properties.Settings.Default.restoreExtensionName)
{
if (!string.IsNullOrEmpty(item.Container))
{
extension = Path.GetExtension(item.Container);
}
}
if (!TryExportFile(exportPath, item, extension, out exportFullPath))
return false;
var bytes = m_MiHoYoBinData.Dump() as byte[];
if (bytes.Length != 0)
if (!bytes.IsNullOrEmpty())
{
File.WriteAllBytes(exportFullPath, bytes);
return true;
@@ -281,22 +290,6 @@ namespace AssetStudioGUI
return false;
}
public static bool ExportJsonFile(AssetItem item, string exportPath)
{
if (!TryExportFile(exportPath, item, ".json", out var exportFullPath))
return false;
var str = JsonConvert.SerializeObject(item.Asset, Formatting.Indented);
if (!string.IsNullOrEmpty(str) && str != "{}")
{
File.WriteAllText(exportFullPath, str);
return true;
}
else
{
return ExportRawFile(item, exportPath);
}
}
public static bool ExportRawFile(AssetItem item, string exportPath)
{
if (!TryExportFile(exportPath, item, ".dat", out var exportFullPath))
@@ -323,16 +316,6 @@ namespace AssetStudioGUI
return false;
}
public static bool ExportAnimationClip(AssetItem item, string exportPath)
{
if (!TryExportFile(exportPath, item, ".anim", out var exportFullPath))
return false;
var m_AnimationClip = (AnimationClip)item.Asset;
var str = m_AnimationClip.Convert(Studio.Game);
File.WriteAllText(exportFullPath, str);
return true;
}
public static bool ExportAnimator(AssetItem item, string exportPath, List<AssetItem> animationList = null)
{
var exportFullPath = Path.Combine(exportPath, item.Text, item.Text + ".fbx");
@@ -342,8 +325,8 @@ namespace AssetStudioGUI
}
var m_Animator = (Animator)item.Asset;
var convert = animationList != null
? new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Studio.Game, animationList.Select(x => (AnimationClip)x.Asset).ToArray(), Properties.Settings.Default.ignoreController)
: new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Studio.Game, ignoreController: Properties.Settings.Default.ignoreController);
? new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
: new ModelConverter(m_Animator, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations);
ExportFbx(convert, exportFullPath);
return true;
}
@@ -351,8 +334,8 @@ namespace AssetStudioGUI
public static void ExportGameObject(GameObject gameObject, string exportPath, List<AssetItem> animationList = null)
{
var convert = animationList != null
? new ModelConverter(gameObject, Properties.Settings.Default.convertType, Studio.Game, animationList.Select(x => (AnimationClip)x.Asset).ToArray(), Properties.Settings.Default.ignoreController)
: new ModelConverter(gameObject, Properties.Settings.Default.convertType, Studio.Game, ignoreController: Properties.Settings.Default.ignoreController);
? new ModelConverter(gameObject, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
: new ModelConverter(gameObject, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations);
exportPath = exportPath + FixFileName(gameObject.m_Name) + ".fbx";
ExportFbx(convert, exportPath);
}
@@ -361,8 +344,8 @@ namespace AssetStudioGUI
{
var rootName = Path.GetFileNameWithoutExtension(exportPath);
var convert = animationList != null
? new ModelConverter(rootName, gameObject, Properties.Settings.Default.convertType, Studio.Game, animationList.Select(x => (AnimationClip)x.Asset).ToArray(), Properties.Settings.Default.ignoreController)
: new ModelConverter(rootName, gameObject, Properties.Settings.Default.convertType, Studio.Game, ignoreController: Properties.Settings.Default.ignoreController);
? new ModelConverter(rootName, gameObject, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations, animationList.Select(x => (AnimationClip)x.Asset).ToArray())
: new ModelConverter(rootName, gameObject, Properties.Settings.Default.convertType, Studio.Game, Properties.Settings.Default.collectAnimations);
ExportFbx(convert, exportPath);
}
@@ -429,14 +412,26 @@ namespace AssetStudioGUI
case ClassIDType.Animator:
return ExportAnimator(item, exportPath);
case ClassIDType.AnimationClip:
return ExportAnimationClip(item, exportPath);
return false;
case ClassIDType.MiHoYoBinData:
return ExportMiHoYoBinData(item, exportPath);
default:
return ExportJsonFile(item, exportPath);
return ExportRawFile(item, exportPath);
}
}
public static bool ExportJSONFile(AssetItem item, string exportPath)
{
if (!TryExportFile(exportPath, item, ".json", out var exportFullPath))
return false;
var settings = new JsonSerializerSettings();
settings.Converters.Add(new StringEnumConverter());
var str = JsonConvert.SerializeObject(item.Asset, Formatting.Indented, settings);
File.WriteAllText(exportFullPath, str);
return true;
}
public static string FixFileName(string str)
{
if (str.Length >= 260) return Path.GetRandomFileName();

View File

@@ -14,8 +14,11 @@ namespace AssetStudioGUI
this.action = action;
}
public void Log(LoggerEvent loggerEvent, string message)
public void Log(LoggerEvent loggerEvent, string message, bool silent = false)
{
if (silent)
return;
switch (loggerEvent)
{
case LoggerEvent.Error:

View File

@@ -14,9 +14,7 @@ namespace AssetStudioGUI
[STAThread]
static void Main()
{
#if !NETFRAMEWORK
Application.SetHighDpiMode(HighDpiMode.SystemAware);
#endif
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new AssetStudioGUIForm());

View File

@@ -1,73 +1,48 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AssetStudioGUI.Properties
{
namespace AssetStudioGUI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool console
{
get
{
return ((bool)(this["console"]));
}
set
{
this["console"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool displayAll
{
get
{
public bool displayAll {
get {
return ((bool)(this["displayAll"]));
}
set
{
set {
this["displayAll"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool enablePreview
{
get
{
public bool enablePreview {
get {
return ((bool)(this["enablePreview"]));
}
set
{
set {
this["enablePreview"] = value;
}
}
@@ -75,421 +50,349 @@ namespace AssetStudioGUI.Properties
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool enableResolveDependencies
{
get
{
return ((bool)(this["enableResolveDependencies"]));
}
set
{
this["enableResolveDependencies"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool displayInfo
{
get
{
public bool displayInfo {
get {
return ((bool)(this["displayInfo"]));
}
set
{
set {
this["displayInfo"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool openAfterExport
{
get
{
return ((bool)(this["openAfterExport"]));
}
set
{
this["openAfterExport"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int selectedGame
{
get
{
return ((int)(this["selectedGame"]));
}
set
{
this["selectedGame"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int assetGroupOption
{
get
{
return ((int)(this["assetGroupOption"]));
}
set
{
this["assetGroupOption"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool convertTexture
{
get
{
return ((bool)(this["convertTexture"]));
}
set
{
this["convertTexture"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool convertAudio
{
get
{
return ((bool)(this["convertAudio"]));
}
set
{
this["convertAudio"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Png")]
public global::AssetStudio.ImageFormat convertType
{
get
{
return ((global::AssetStudio.ImageFormat)(this["convertType"]));
}
set
{
this["convertType"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportAssetBundle
{
get
{
return ((bool)(this["exportAssetBundle"]));
}
set
{
this["exportAssetBundle"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportIndexObject
{
get
{
return ((bool)(this["exportIndexObject"]));
}
set
{
this["exportIndexObject"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool disableRndrr
{
get
{
return ((bool)(this["disableRndrr"]));
}
set
{
this["disableRndrr"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool disableShader
{
get
{
return ((bool)(this["disableShader"]));
}
set
{
this["disableShader"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("147")]
public byte key
{
get
{
return ((byte)(this["key"]));
}
set
{
this["key"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool enableXor
{
get
{
return ((bool)(this["enableXor"]));
}
set
{
this["enableXor"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool ignoreController
{
get
{
return ((bool)(this["ignoreController"]));
public bool openAfterExport {
get {
return ((bool)(this["openAfterExport"]));
}
set
{
this["ignoreController"] = value;
set {
this["openAfterExport"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool eulerFilter
{
get
{
return ((bool)(this["eulerFilter"]));
}
set
{
this["eulerFilter"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0.25")]
public decimal filterPrecision
{
get
{
return ((decimal)(this["filterPrecision"]));
}
set
{
this["filterPrecision"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportAllNodes
{
get
{
return ((bool)(this["exportAllNodes"]));
}
set
{
this["exportAllNodes"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportSkins
{
get
{
return ((bool)(this["exportSkins"]));
}
set
{
this["exportSkins"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportAnimations
{
get
{
return ((bool)(this["exportAnimations"]));
}
set
{
this["exportAnimations"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("10")]
public decimal boneSize
{
get
{
return ((decimal)(this["boneSize"]));
}
set
{
this["boneSize"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("3")]
public int fbxVersion
{
get
{
return ((int)(this["fbxVersion"]));
}
set
{
this["fbxVersion"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int fbxFormat
{
get
{
public int assetGroupOption {
get {
return ((int)(this["assetGroupOption"]));
}
set {
this["assetGroupOption"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool convertTexture {
get {
return ((bool)(this["convertTexture"]));
}
set {
this["convertTexture"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool convertAudio {
get {
return ((bool)(this["convertAudio"]));
}
set {
this["convertAudio"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Png")]
public global::AssetStudio.ImageFormat convertType {
get {
return ((global::AssetStudio.ImageFormat)(this["convertType"]));
}
set {
this["convertType"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool eulerFilter {
get {
return ((bool)(this["eulerFilter"]));
}
set {
this["eulerFilter"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0.25")]
public decimal filterPrecision {
get {
return ((decimal)(this["filterPrecision"]));
}
set {
this["filterPrecision"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportAllNodes {
get {
return ((bool)(this["exportAllNodes"]));
}
set {
this["exportAllNodes"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportSkins {
get {
return ((bool)(this["exportSkins"]));
}
set {
this["exportSkins"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportAnimations {
get {
return ((bool)(this["exportAnimations"]));
}
set {
this["exportAnimations"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("10")]
public decimal boneSize {
get {
return ((decimal)(this["boneSize"]));
}
set {
this["boneSize"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("3")]
public int fbxVersion {
get {
return ((int)(this["fbxVersion"]));
}
set {
this["fbxVersion"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int fbxFormat {
get {
return ((int)(this["fbxFormat"]));
}
set
{
set {
this["fbxFormat"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1")]
public decimal scaleFactor
{
get
{
public decimal scaleFactor {
get {
return ((decimal)(this["scaleFactor"]));
}
set
{
set {
this["scaleFactor"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportBlendShape
{
get
{
public bool exportBlendShape {
get {
return ((bool)(this["exportBlendShape"]));
}
set
{
set {
this["exportBlendShape"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool castToBone
{
get
{
public bool castToBone {
get {
return ((bool)(this["castToBone"]));
}
set
{
set {
this["castToBone"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool restoreExtensionName
{
get
{
public bool restoreExtensionName {
get {
return ((bool)(this["restoreExtensionName"]));
}
set
{
set {
this["restoreExtensionName"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool exportAllUvsAsDiffuseMaps
{
get
{
public bool exportAllUvsAsDiffuseMaps {
get {
return ((bool)(this["exportAllUvsAsDiffuseMaps"]));
}
set
{
set {
this["exportAllUvsAsDiffuseMaps"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("147")]
public byte key {
get {
return ((byte)(this["key"]));
}
set {
this["key"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool enableConsole {
get {
return ((bool)(this["enableConsole"]));
}
set {
this["enableConsole"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool encrypted {
get {
return ((bool)(this["encrypted"]));
}
set {
this["encrypted"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool skipRenderer {
get {
return ((bool)(this["skipRenderer"]));
}
set {
this["skipRenderer"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int selectedGame {
get {
return ((int)(this["selectedGame"]));
}
set {
this["selectedGame"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool enableResolveDependencies {
get {
return ((bool)(this["enableResolveDependencies"]));
}
set {
this["enableResolveDependencies"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int selectedCNUnityKey {
get {
return ((int)(this["selectedCNUnityKey"]));
}
set {
this["selectedCNUnityKey"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int selectedAssetMapType {
get {
return ((int)(this["selectedAssetMapType"]));
}
set {
this["selectedAssetMapType"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportMiHoYoBinData {
get {
return ((bool)(this["exportMiHoYoBinData"]));
}
set {
this["exportMiHoYoBinData"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool collectAnimations {
get {
return ((bool)(this["collectAnimations"]));
}
set {
this["collectAnimations"] = value;
}
}
}
}

View File

@@ -68,31 +68,31 @@
<Setting Name="key" Type="System.Byte" Scope="User">
<Value Profile="(Default)">147</Value>
</Setting>
<Setting Name="console" Type="System.Boolean" Scope="User">
<Setting Name="enableConsole" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="eanbleXor" Type="System.Boolean" Scope="User">
<Setting Name="encrypted" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="disableRndrr" Type="System.Boolean" Scope="User">
<Setting Name="skipRenderer" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="exportAssetBundle" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="exportIndexObject" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="selectedGame" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="ignoreController" Type="System.Boolean" Scope="User">
<Setting Name="enableResolveDependencies" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="disableShader" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
<Setting Name="selectedCNUnityKey" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="enableResolveDependencies" Type="System.Boolean" Scope="User">
<Setting Name="selectedAssetMapType" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="exportMiHoYoBinData" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="collectAnimations" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>

View File

@@ -8,6 +8,7 @@ using System.Linq;
using System.Threading;
using System.Windows.Forms;
using System.Xml.Linq;
using static AssetStudio.ImportHelper;
using static AssetStudioGUI.Exporter;
using Object = AssetStudio.Object;
@@ -17,7 +18,8 @@ namespace AssetStudioGUI
{
Convert,
Raw,
Dump
Dump,
JSON
}
internal enum ExportFilter
@@ -27,27 +29,14 @@ namespace AssetStudioGUI
Filtered
}
internal enum AssetGroupOption
{
ByType,
ByContainer,
BySource,
None
}
internal enum ExportListType
{
XML
}
internal static class Studio
{
public static Game Game;
public static AssetsManager assetsManager = new AssetsManager();
public static AssemblyLoader assemblyLoader = new AssemblyLoader();
public static List<AssetItem> exportableAssets = new List<AssetItem>();
public static List<AssetItem> visibleAssets = new List<AssetItem>();
internal static Action<string> StatusStripUpdate = x => { };
public static Game Game;
public static int ExtractFolder(string path, string savePath)
{
@@ -81,13 +70,16 @@ namespace AssetStudioGUI
public static int ExtractFile(string fileName, string savePath)
{
int extractedCount = 0;
var reader = new FileReader(fileName, Game);
var reader = new FileReader(fileName);
reader = reader.PreProcessing(Game);
if (reader.FileType == FileType.BundleFile)
extractedCount += ExtractBundleFile(reader, savePath);
else if (reader.FileType == FileType.WebFile)
extractedCount += ExtractWebDataFile(reader, savePath);
else if (reader.FileType == FileType.GameFile)
extractedCount += ExtractGameFile(reader, savePath);
else if (reader.FileType == FileType.BlkFile)
extractedCount += ExtractBlkFile(reader, savePath);
else if (reader.FileType == FileType.BlockFile)
extractedCount += ExtractBlockFile(reader, savePath);
else
reader.Dispose();
return extractedCount;
@@ -96,12 +88,19 @@ namespace AssetStudioGUI
private static int ExtractBundleFile(FileReader reader, string savePath)
{
StatusStripUpdate($"Decompressing {reader.FileName} ...");
var bundleFile = new BundleFile(reader);
reader.Dispose();
if (bundleFile.FileList.Length > 0)
try
{
var extractPath = Path.Combine(savePath, reader.FileName + "_unpacked");
return ExtractStreamFile(extractPath, bundleFile.FileList);
var bundleFile = new BundleFile(reader, Game);
reader.Dispose();
if (bundleFile.fileList.Length > 0)
{
var extractPath = Path.Combine(savePath, reader.FileName + "_unpacked");
return ExtractStreamFile(extractPath, bundleFile.fileList);
}
}
catch (InvalidCastException)
{
Logger.Error($"Game type mismatch, Expected {nameof(Mr0k)} but got {Game.Name} ({Game.GetType().Name}) !!");
}
return 0;
}
@@ -119,16 +118,69 @@ namespace AssetStudioGUI
return 0;
}
private static int ExtractGameFile(FileReader reader, string savePath)
private static int ExtractBlkFile(FileReader reader, string savePath)
{
StatusStripUpdate($"Decompressing {reader.FileName}...");
var gameFile = new GameFile(reader);
reader.Dispose();
var fileList = gameFile.Bundles.SelectMany(x => x.Value).ToList();
if (fileList.Count > 0)
int total = 0;
StatusStripUpdate($"Decompressing {reader.FileName} ...");
try
{
var extractPath = Path.Combine(savePath, Path.GetFileNameWithoutExtension(reader.FileName));
return ExtractStreamFile(extractPath, fileList.ToArray());
using var stream = BlkUtils.Decrypt(reader, (Blk)Game);
do
{
stream.Offset = stream.RelativePosition;
var dummyPath = Path.Combine(reader.FullPath, stream.RelativePosition.ToString("X8"));
var subReader = new FileReader(dummyPath, stream, true);
var subSavePath = Path.Combine(savePath, reader.FileName + "_unpacked");
switch (subReader.FileType)
{
case FileType.BundleFile:
total += ExtractBundleFile(subReader, subSavePath);
break;
case FileType.Mhy0File:
total += ExtractMhy0File(subReader, subSavePath);
break;
}
} while (stream.Remaining > 0);
}
catch (InvalidCastException)
{
Logger.Error($"Game type mismatch, Expected {nameof(Blk)} but got {Game.Name} ({Game.GetType().Name}) !!");
}
return total;
}
private static int ExtractBlockFile(FileReader reader, string savePath)
{
int total = 0;
StatusStripUpdate($"Decompressing {reader.FileName} ...");
using var stream = new BlockStream(reader.BaseStream, 0);
do
{
stream.Offset = stream.RelativePosition;
var subSavePath = Path.Combine(savePath, reader.FileName + "_unpacked");
var dummyPath = Path.Combine(reader.FullPath, stream.RelativePosition.ToString("X8"));
var subReader = new FileReader(dummyPath, stream, true);
total += ExtractBundleFile(subReader, subSavePath);
} while (stream.Remaining > 0);
return total;
}
private static int ExtractMhy0File(FileReader reader, string savePath)
{
StatusStripUpdate($"Decompressing {reader.FileName} ...");
try
{
var mhy0File = new Mhy0File(reader, reader.FullPath, (Mhy0)Game);
reader.Dispose();
if (mhy0File.fileList.Length > 0)
{
var extractPath = Path.Combine(savePath, reader.FileName + "_unpacked");
return ExtractStreamFile(extractPath, mhy0File.fileList);
}
}
catch (InvalidCastException)
{
Logger.Error($"Game type mismatch, Expected {nameof(Mhy0)} but got {Game.Name} ({Game.GetType().Name}) !!");
}
return 0;
}
@@ -157,155 +209,29 @@ namespace AssetStudioGUI
return extractedCount;
}
public static List<AssetEntry> BuildAssetMap(List<string> files)
public static void UpdateContainers()
{
var assets = new List<AssetEntry>();
for (int i = 0; i < files.Count; i++)
if (exportableAssets.Count > 0)
{
var file = files[i];
var reader = new FileReader(file, Game);
var gameFile = new GameFile(reader);
reader.Dispose();
foreach (var bundle in gameFile.Bundles)
Logger.Info("Updating Containers...");
foreach (var asset in exportableAssets)
{
foreach (var cab in bundle.Value)
if (int.TryParse(asset.Container, out var value))
{
var dummyPath = Path.Combine(Path.GetDirectoryName(file), cab.fileName);
using (var cabReader = new FileReader(dummyPath, cab.stream, Game))
var last = unchecked((uint)value);
var path = ResourceIndex.GetAssetPath(last);
if (!string.IsNullOrEmpty(path))
{
if (cabReader.FileType == FileType.AssetsFile)
asset.Container = path;
if (asset.Type == ClassIDType.MiHoYoBinData)
{
var assetsFile = new SerializedFile(cabReader, assetsManager, file);
assetsManager.assetsFileList.Add(assetsFile);
assetsFile.m_Objects = assetsFile.m_Objects.Where(x => x.HasExportableType()).ToList();
IndexObject indexObject = null;
var containers = new List<(PPtr<Object>, string)>(assetsFile.m_Objects.Count);
var animators = new List<(PPtr<GameObject>, AssetEntry)>(assetsFile.m_Objects.Count);
var objectAssetItemDic = new Dictionary<Object, AssetEntry>(assetsFile.m_Objects.Count);
foreach (var objInfo in assetsFile.m_Objects)
{
var objectReader = new ObjectReader(assetsFile.reader, assetsFile, objInfo);
var obj = new Object(objectReader);
var asset = new AssetEntry()
{
Source = file,
PathID = objectReader.m_PathID,
Type = objectReader.type,
Container = ""
};
var exportable = true;
switch (objectReader.type)
{
case ClassIDType.AssetBundle:
var assetBundle = new AssetBundle(objectReader);
foreach (var m_Container in assetBundle.Container)
{
var preloadIndex = m_Container.Value.preloadIndex;
var preloadSize = m_Container.Value.preloadSize;
var preloadEnd = preloadIndex + preloadSize;
for (int k = preloadIndex; k < preloadEnd; k++)
{
if (Game.Name == "GI" || Game.Name == "GI_CB2" || Game.Name == "GI_CB3")
{
if (long.TryParse(m_Container.Key, out var containerValue))
{
var last = unchecked((uint)containerValue);
var path = ResourceIndex.GetBundlePath(last);
if (!string.IsNullOrEmpty(path))
{
containers.Add((assetBundle.PreloadTable[k], path));
continue;
}
}
}
containers.Add((assetBundle.PreloadTable[k], m_Container.Key));
}
}
obj = null;
asset.Name = assetBundle.m_Name;
exportable = AssetBundle.Exportable;
break;
case ClassIDType.GameObject:
var gameObject = new GameObject(objectReader);
obj = gameObject;
asset.Name = gameObject.m_Name;
exportable = false;
break;
case ClassIDType.Shader:
asset.Name = objectReader.ReadAlignedString();
if (string.IsNullOrEmpty(asset.Name))
{
var m_parsedForm = new SerializedShader(objectReader);
asset.Name = m_parsedForm.m_Name;
}
break;
case ClassIDType.Animator:
var component = new PPtr<GameObject>(objectReader);
animators.Add((component, asset));
break;
case ClassIDType.MiHoYoBinData:
if (indexObject.Names.TryGetValue(objectReader.m_PathID, out var binName))
{
var path = ResourceIndex.GetContainerFromBinName(file, binName);
asset.Container = path;
asset.Name = !string.IsNullOrEmpty(path) ? Path.GetFileName(path) : binName;
}
exportable = IndexObject.Exportable;
break;
case ClassIDType.IndexObject:
indexObject = new IndexObject(objectReader);
obj = null;
asset.Name = "IndexObject";
exportable = IndexObject.Exportable;
break;
default:
asset.Name = objectReader.ReadAlignedString();
break;
}
if (obj != null)
{
objectAssetItemDic.Add(obj, asset);
assetsFile.AddObject(obj);
}
if (exportable)
{
assets.Add(asset);
}
}
foreach (var pair in animators)
{
if (pair.Item1.TryGet(out var gameObject))
{
pair.Item2.Name = gameObject.m_Name;
}
else
{
Logger.Warning($"Unable to find GameObject with PathID {pair.Item1.m_PathID}, removing...");
assets.Remove(pair.Item2);
}
}
foreach ((var pptr, var container) in containers)
{
if (pptr.TryGet(out var obj))
{
objectAssetItemDic[obj].Container = container;
}
}
assetsManager.assetsFileList.Clear();
asset.Text = Path.GetFileNameWithoutExtension(path);
}
}
}
}
Logger.Info($"[{i + 1}/{files.Count}] Processed {Path.GetFileName(file)}");
Progress.Report(i + 1, files.Count);
Logger.Info("Updated !!");
}
return assets;
}
public static (string, List<TreeNode>) BuildAssetData()
@@ -315,6 +241,7 @@ namespace AssetStudioGUI
string productName = null;
var objectCount = assetsManager.assetsFileList.Sum(x => x.Objects.Count);
var objectAssetItemDic = new Dictionary<Object, AssetItem>(objectCount);
var mihoyoBinDataNames = new List<(PPtr<Object>, string)>();
var containers = new List<(PPtr<Object>, string)>();
int i = 0;
Progress.Reset();
@@ -322,9 +249,14 @@ namespace AssetStudioGUI
{
foreach (var asset in assetsFile.Objects)
{
if (assetsManager.tokenSource.IsCancellationRequested)
{
Logger.Info("Building asset list has been cancelled !!");
return (string.Empty, Array.Empty<TreeNode>().ToList());
}
var assetItem = new AssetItem(asset);
objectAssetItemDic.Add(asset, assetItem);
assetItem.UniqueID = "#" + i;
assetItem.UniqueID = " #" + i;
var exportable = false;
switch (asset)
{
@@ -359,7 +291,6 @@ namespace AssetStudioGUI
case Font _:
case MovieTexture _:
case Sprite _:
case Material _:
assetItem.Text = ((NamedObject)asset).m_Name;
exportable = true;
break;
@@ -385,35 +316,27 @@ namespace AssetStudioGUI
productName = m_PlayerSettings.productName;
break;
case AssetBundle m_AssetBundle:
foreach (var m_Container in m_AssetBundle.Container)
foreach (var m_Container in m_AssetBundle.m_Container)
{
var preloadIndex = m_Container.Value.preloadIndex;
var preloadSize = m_Container.Value.preloadSize;
var preloadEnd = preloadIndex + preloadSize;
for (int k = preloadIndex; k < preloadEnd; k++)
{
if (Game.Name == "GI" || Game.Name == "GI_CB2" || Game.Name == "GI_CB3")
{
if (long.TryParse(m_Container.Key, out var containerValue))
{
var last = unchecked((uint)containerValue);
var path = ResourceIndex.GetBundlePath(last);
if (!string.IsNullOrEmpty(path))
{
containers.Add((m_AssetBundle.PreloadTable[k], path));
continue;
}
}
}
containers.Add((m_AssetBundle.PreloadTable[k], m_Container.Key));
containers.Add((m_AssetBundle.m_PreloadTable[k], m_Container.Key));
}
}
assetItem.Text = m_AssetBundle.m_Name;
exportable = AssetBundle.Exportable;
break;
case IndexObject m_IndexObject:
foreach(var index in m_IndexObject.AssetMap)
{
mihoyoBinDataNames.Add((index.Value.Object, index.Key));
}
assetItem.Text = "IndexObject";
exportable = IndexObject.Exportable;
break;
case MiHoYoBinData m_MiHoYoBinData:
exportable = MiHoYoBinData.Exportable;
break;
case ResourceManager m_ResourceManager:
foreach (var m_Container in m_ResourceManager.m_Container)
@@ -421,29 +344,6 @@ namespace AssetStudioGUI
containers.Add((m_Container.Value, m_Container.Key));
}
break;
case MiHoYoBinData m_MiHoYoBinData:
if (m_MiHoYoBinData.assetsFile.ObjectsDic.TryGetValue(2, out var obj) && obj is IndexObject indexObject)
{
if (indexObject.Names.TryGetValue(m_MiHoYoBinData.m_PathID, out var binName))
{
string path = "";
var game = GameManager.GetGame("GI");
if (Path.GetExtension(assetsFile.originalPath) == game.Extension)
{
path = ResourceIndex.GetContainerFromBinName(assetsFile.originalPath, binName);
}
else
{
var last = Convert.ToUInt32(binName, 16);
path = ResourceIndex.GetBundlePath(last) ?? "";
}
assetItem.Container = path;
assetItem.Text = !string.IsNullOrEmpty(path) ? Path.GetFileName(path) : binName;
}
}
else assetItem.Text = string.Format("BinFile #{0}", assetItem.m_PathID);
exportable = true;
break;
case NamedObject m_NamedObject:
assetItem.Text = m_NamedObject.m_Name;
break;
@@ -459,20 +359,32 @@ namespace AssetStudioGUI
Progress.Report(++i, objectCount);
}
}
StatusStripUpdate("Building container list...");
i = 0;
Progress.Reset();
var containersCount = containers.Count;
foreach((var pptr, var name) in mihoyoBinDataNames)
{
if (pptr.TryGet<MiHoYoBinData>(out var obj))
{
var assetItem = objectAssetItemDic[obj];
if (int.TryParse(name, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out var hash))
{
assetItem.Text = name;
assetItem.Container = hash.ToString();
}
else assetItem.Text = $"BinFile #{assetItem.m_PathID}";
}
}
foreach ((var pptr, var container) in containers)
{
if (pptr.TryGet(out var obj))
{
objectAssetItemDic[obj].Container = container;
}
Progress.Report(++i, containersCount);
}
if (Game.Type.IsGISubGroup())
{
UpdateContainers();
}
foreach (var tmp in exportableAssets)
{
tmp.SetSubItems();
@@ -494,6 +406,12 @@ namespace AssetStudioGUI
foreach (var obj in assetsFile.Objects)
{
if (assetsManager.tokenSource.IsCancellationRequested)
{
Logger.Info("Building tree structure been cancelled !!");
return (string.Empty, Array.Empty<TreeNode>().ToList());
}
if (obj is GameObject m_GameObject)
{
if (!treeNodeDictionary.TryGetValue(m_GameObject, out var currentNode))
@@ -617,11 +535,11 @@ namespace AssetStudioGUI
case AssetGroupOption.ByContainer: //container path
if (!string.IsNullOrEmpty(asset.Container))
{
exportPath = Path.HasExtension(asset.Container) ? Path.Combine(savePath, Path.GetDirectoryName(asset.Container)) : Path.Combine(savePath, asset.Container);
exportPath = Path.Combine(savePath, Path.GetDirectoryName(asset.Container));
}
else
{
exportPath = Path.Combine(savePath, asset.TypeString);
exportPath = savePath;
}
break;
case AssetGroupOption.BySource: //source file
@@ -662,6 +580,12 @@ namespace AssetStudioGUI
exportedCount++;
}
break;
case ExportType.JSON:
if (ExportJSONFile(asset, exportPath))
{
exportedCount++;
}
break;
}
}
catch (Exception ex)
@@ -688,51 +612,6 @@ namespace AssetStudioGUI
});
}
public static void ExportAssetsMap(string savePath, List<AssetEntry> toExportAssets, ExportListType exportListType)
{
ThreadPool.QueueUserWorkItem(state =>
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Progress.Reset();
string filename;
switch (exportListType)
{
case ExportListType.XML:
filename = Path.Combine(savePath, $"assets_map_{Game.Name}.xml");
var doc = new XDocument(
new XElement("Assets",
new XAttribute("filename", filename),
new XAttribute("createdAt", DateTime.UtcNow.ToString("s")),
toExportAssets.Select(
asset => new XElement("Asset",
new XElement("Name", asset.Name),
new XElement("Container", asset.Container),
new XElement("Type", new XAttribute("id", (int)asset.Type), asset.Type.ToString()),
new XElement("PathID", asset.PathID),
new XElement("Source", asset.Source)
)
)
)
);
doc.Save(filename);
break;
}
var statusText = $"Finished exporting asset list with {toExportAssets.Count()} items.";
StatusStripUpdate(statusText);
Logger.Info($"AssetMap build successfully !!");
if (Properties.Settings.Default.openAfterExport && toExportAssets.Count() > 0)
{
OpenFolderInExplorer(savePath);
}
});
}
public static void ExportAssetsList(string savePath, List<AssetItem> toExportAssets, ExportListType exportListType)
{
ThreadPool.QueueUserWorkItem(state =>
@@ -756,7 +635,6 @@ namespace AssetStudioGUI
new XElement("Type", new XAttribute("id", (int)asset.Type), asset.TypeString),
new XElement("PathID", asset.m_PathID),
new XElement("Source", asset.SourceFile.fullName),
new XElement("OriginalPath", asset.SourceFile.originalPath),
new XElement("Size", asset.FullSize)
)
)