mirror of
https://github.com/aelurum/AssetStudio.git
synced 2026-11-15 19:28:48 -05:00
Improve Import options
- Added Import options window - Changed cache logic: - single cache file instead of separate cache files for each bundle - program folder as a default cache folder - added an option to specify a custom cache folder
This commit is contained in:
+26
-68
@@ -52,12 +52,10 @@
|
||||
this.specifyUnityVersionTextBox = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.bundleDecompressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.alwaysDecompressToDiskToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.blockInfoCompressionTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.customBlockInfoCompressionComboBox = new System.Windows.Forms.ToolStripComboBox();
|
||||
this.blockCompressionTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.customBlockCompressionComboBox = new System.Windows.Forms.ToolStripComboBox();
|
||||
this.importOptionsToolStripSeparator = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.saveOptionsToDiskToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.importOptionsToolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.moreOptionsToolStripMenuItem = 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();
|
||||
@@ -384,12 +382,10 @@
|
||||
this.specifyUnityVersionTextBox,
|
||||
this.bundleDecompressionToolStripMenuItem,
|
||||
this.alwaysDecompressToDiskToolStripMenuItem,
|
||||
this.blockInfoCompressionTypeToolStripMenuItem,
|
||||
this.customBlockInfoCompressionComboBox,
|
||||
this.blockCompressionTypeToolStripMenuItem,
|
||||
this.customBlockCompressionComboBox,
|
||||
this.importOptionsToolStripSeparator,
|
||||
this.saveOptionsToDiskToolStripMenuItem});
|
||||
this.saveOptionsToDiskToolStripMenuItem,
|
||||
this.importOptionsToolStripSeparator2,
|
||||
this.moreOptionsToolStripMenuItem});
|
||||
this.importOptionsToolStripMenuItem.Name = "importOptionsToolStripMenuItem";
|
||||
this.importOptionsToolStripMenuItem.Size = new System.Drawing.Size(243, 22);
|
||||
this.importOptionsToolStripMenuItem.Text = "Import options";
|
||||
@@ -401,7 +397,7 @@
|
||||
this.customUnityVersionToolStripMenuItem.Enabled = false;
|
||||
this.customUnityVersionToolStripMenuItem.Name = "customUnityVersionToolStripMenuItem";
|
||||
this.customUnityVersionToolStripMenuItem.ShowShortcutKeys = false;
|
||||
this.customUnityVersionToolStripMenuItem.Size = new System.Drawing.Size(217, 22);
|
||||
this.customUnityVersionToolStripMenuItem.Size = new System.Drawing.Size(213, 22);
|
||||
this.customUnityVersionToolStripMenuItem.Text = "Custom Unity version";
|
||||
//
|
||||
// specifyUnityVersionTextBox
|
||||
@@ -417,7 +413,7 @@
|
||||
this.bundleDecompressionToolStripMenuItem.Enabled = false;
|
||||
this.bundleDecompressionToolStripMenuItem.Name = "bundleDecompressionToolStripMenuItem";
|
||||
this.bundleDecompressionToolStripMenuItem.ShowShortcutKeys = false;
|
||||
this.bundleDecompressionToolStripMenuItem.Size = new System.Drawing.Size(217, 22);
|
||||
this.bundleDecompressionToolStripMenuItem.Size = new System.Drawing.Size(213, 22);
|
||||
this.bundleDecompressionToolStripMenuItem.Text = "Bundle Decompression";
|
||||
//
|
||||
// alwaysDecompressToDiskToolStripMenuItem
|
||||
@@ -425,72 +421,36 @@
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.CheckOnClick = true;
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.Name = "alwaysDecompressToDiskToolStripMenuItem";
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.ShowShortcutKeys = false;
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.Size = new System.Drawing.Size(217, 22);
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.Size = new System.Drawing.Size(213, 22);
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.Text = "Always decompress to disk";
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.ToolTipText = "If not selected, any bundles less than 2GB will be decompressed to RAM";
|
||||
this.alwaysDecompressToDiskToolStripMenuItem.Click += new System.EventHandler(this.alwaysDecompressToDiskToolStripMenuItem_Click);
|
||||
//
|
||||
// blockInfoCompressionTypeToolStripMenuItem
|
||||
//
|
||||
this.blockInfoCompressionTypeToolStripMenuItem.Enabled = false;
|
||||
this.blockInfoCompressionTypeToolStripMenuItem.Name = "blockInfoCompressionTypeToolStripMenuItem";
|
||||
this.blockInfoCompressionTypeToolStripMenuItem.ShowShortcutKeys = false;
|
||||
this.blockInfoCompressionTypeToolStripMenuItem.Size = new System.Drawing.Size(217, 22);
|
||||
this.blockInfoCompressionTypeToolStripMenuItem.Text = "BlockInfo Compression Type";
|
||||
//
|
||||
// customBlockInfoCompressionComboBox
|
||||
//
|
||||
this.customBlockInfoCompressionComboBox.DropDownHeight = 80;
|
||||
this.customBlockInfoCompressionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.customBlockInfoCompressionComboBox.IntegralHeight = false;
|
||||
this.customBlockInfoCompressionComboBox.Items.AddRange(new object[] {
|
||||
"Auto",
|
||||
"Zstd",
|
||||
"Oodle",
|
||||
"Lz4/Lz4HC",
|
||||
"Lzma"});
|
||||
this.customBlockInfoCompressionComboBox.Name = "customBlockInfoCompressionComboBox";
|
||||
this.customBlockInfoCompressionComboBox.Size = new System.Drawing.Size(121, 23);
|
||||
this.customBlockInfoCompressionComboBox.ToolTipText = "Selected compression type will override detected type from asset bundle";
|
||||
this.customBlockInfoCompressionComboBox.SelectedIndexChanged += new System.EventHandler(this.customBlockInfoCompressionComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// blockCompressionTypeToolStripMenuItem
|
||||
//
|
||||
this.blockCompressionTypeToolStripMenuItem.Enabled = false;
|
||||
this.blockCompressionTypeToolStripMenuItem.Name = "blockCompressionTypeToolStripMenuItem";
|
||||
this.blockCompressionTypeToolStripMenuItem.ShowShortcutKeys = false;
|
||||
this.blockCompressionTypeToolStripMenuItem.Size = new System.Drawing.Size(217, 22);
|
||||
this.blockCompressionTypeToolStripMenuItem.Text = "Block Compression Type";
|
||||
//
|
||||
// customBlockCompressionComboBox
|
||||
//
|
||||
this.customBlockCompressionComboBox.DropDownHeight = 80;
|
||||
this.customBlockCompressionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.customBlockCompressionComboBox.IntegralHeight = false;
|
||||
this.customBlockCompressionComboBox.Items.AddRange(new object[] {
|
||||
"Auto",
|
||||
"Zstd",
|
||||
"Oodle",
|
||||
"Lz4/Lz4HC",
|
||||
"Lzma"});
|
||||
this.customBlockCompressionComboBox.Name = "customBlockCompressionComboBox";
|
||||
this.customBlockCompressionComboBox.Size = new System.Drawing.Size(121, 23);
|
||||
this.customBlockCompressionComboBox.ToolTipText = "Selected compression type will override detected type from asset bundle";
|
||||
this.customBlockCompressionComboBox.SelectedIndexChanged += new System.EventHandler(this.customBlockCompressionComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// importOptionsToolStripSeparator
|
||||
//
|
||||
this.importOptionsToolStripSeparator.Name = "importOptionsToolStripSeparator";
|
||||
this.importOptionsToolStripSeparator.Size = new System.Drawing.Size(214, 6);
|
||||
this.importOptionsToolStripSeparator.Size = new System.Drawing.Size(210, 6);
|
||||
//
|
||||
// saveOptionsToDiskToolStripMenuItem
|
||||
//
|
||||
this.saveOptionsToDiskToolStripMenuItem.Name = "saveOptionsToDiskToolStripMenuItem";
|
||||
this.saveOptionsToDiskToolStripMenuItem.ShowShortcutKeys = false;
|
||||
this.saveOptionsToDiskToolStripMenuItem.Size = new System.Drawing.Size(217, 22);
|
||||
this.saveOptionsToDiskToolStripMenuItem.Text = "Save options to disk";
|
||||
this.saveOptionsToDiskToolStripMenuItem.Size = new System.Drawing.Size(213, 22);
|
||||
this.saveOptionsToDiskToolStripMenuItem.Text = "Save current options to disk";
|
||||
this.saveOptionsToDiskToolStripMenuItem.Click += new System.EventHandler(this.saveOptionsToDiskToolStripMenuItem_Click);
|
||||
//
|
||||
// importOptionsToolStripSeparator2
|
||||
//
|
||||
this.importOptionsToolStripSeparator2.Name = "importOptionsToolStripSeparator2";
|
||||
this.importOptionsToolStripSeparator2.Size = new System.Drawing.Size(210, 6);
|
||||
//
|
||||
// moreOptionsToolStripMenuItem
|
||||
//
|
||||
this.moreOptionsToolStripMenuItem.Name = "moreOptionsToolStripMenuItem";
|
||||
this.moreOptionsToolStripMenuItem.Size = new System.Drawing.Size(213, 22);
|
||||
this.moreOptionsToolStripMenuItem.Text = "More options...";
|
||||
this.moreOptionsToolStripMenuItem.Click += new System.EventHandler(this.moreOptionsToolStripMenuItem_Click);
|
||||
//
|
||||
// showExpOpt
|
||||
//
|
||||
this.showExpOpt.Name = "showExpOpt";
|
||||
@@ -1892,15 +1852,13 @@
|
||||
private System.Windows.Forms.ToolStripTextBox specifyUnityVersionTextBox;
|
||||
private System.Windows.Forms.ToolStripMenuItem bundleDecompressionToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem alwaysDecompressToDiskToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem blockInfoCompressionTypeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripComboBox customBlockInfoCompressionComboBox;
|
||||
private System.Windows.Forms.ToolStripMenuItem blockCompressionTypeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripComboBox customBlockCompressionComboBox;
|
||||
private System.Windows.Forms.ToolStripMenuItem saveOptionsToDiskToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator importOptionsToolStripSeparator;
|
||||
private System.Windows.Forms.ToolStripSeparator importOptionsToolStripSeparator2;
|
||||
private System.Windows.Forms.ToolStripMenuItem meshLazyLoadToolStripMenuItem;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.ToolStripMenuItem tvCopyNameToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator importOptionsToolStripSeparator;
|
||||
private System.Windows.Forms.ToolStripMenuItem moreOptionsToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace AssetStudioGUI
|
||||
private DirectBitmap imageTexture;
|
||||
private string tempClipboard;
|
||||
private bool isDarkMode;
|
||||
private ImportOptionsForm importOptionsForm;
|
||||
|
||||
#region FMODControl
|
||||
private FMOD.System system;
|
||||
@@ -150,9 +151,8 @@ namespace AssetStudioGUI
|
||||
useDumpTreeViewToolStripMenuItem.Checked = Properties.Settings.Default.useDumpTreeView;
|
||||
autoPlayAudioAssetsToolStripMenuItem.Checked = Properties.Settings.Default.autoplayAudio;
|
||||
meshLazyLoadToolStripMenuItem.Checked = Properties.Settings.Default.meshLazyLoad;
|
||||
customBlockCompressionComboBox.SelectedIndex = 0;
|
||||
customBlockInfoCompressionComboBox.SelectedIndex = 0;
|
||||
assetsManager.Options.BundleOptions.DecompressToDisk = Properties.Settings.Default.decompressToDisk;
|
||||
assetsManager.Options.BundleOptions.CustomCachePath = GetCachePath();
|
||||
FMODinit();
|
||||
listSearchFilterMode.SelectedIndex = 0;
|
||||
FbxInitOptions(Properties.Settings.Default.fbxSettings);
|
||||
@@ -174,6 +174,17 @@ namespace AssetStudioGUI
|
||||
Studio.StatusStripUpdate = StatusStripUpdate;
|
||||
}
|
||||
|
||||
private static string GetCachePath()
|
||||
{
|
||||
var path = Properties.Settings.Default.cachePath;
|
||||
if (string.IsNullOrEmpty(path) || !Directory.Exists(path))
|
||||
{
|
||||
path = Path.Combine(Directory.GetCurrentDirectory(), "temp");
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
private void AssetStudioGUIForm_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
@@ -2476,53 +2487,10 @@ namespace AssetStudioGUI
|
||||
specifyUnityVersionTextBox.Text = assetsManager.Options.CustomUnityVersion.FullVersion;
|
||||
}
|
||||
alwaysDecompressToDiskToolStripMenuItem.Checked = assetsManager.Options.BundleOptions.DecompressToDisk;
|
||||
customBlockInfoCompressionComboBox.SelectedIndex = SetComboBoxIndex(assetsManager.Options.BundleOptions.CustomBlockInfoCompression);
|
||||
customBlockCompressionComboBox.SelectedIndex = SetComboBoxIndex(assetsManager.Options.BundleOptions.CustomBlockCompression);
|
||||
|
||||
//highDpi workaround
|
||||
var font = customUnityVersionToolStripMenuItem.Font;
|
||||
specifyUnityVersionTextBox.Font = font;
|
||||
customBlockInfoCompressionComboBox.Font = font;
|
||||
customBlockCompressionComboBox.Font = font;
|
||||
}
|
||||
|
||||
private static int SetComboBoxIndex(CompressionType compressionType)
|
||||
{
|
||||
switch (compressionType)
|
||||
{
|
||||
case CompressionType.Auto: return 0;
|
||||
case CompressionType.Lzma: return 4;
|
||||
case CompressionType.Lz4:
|
||||
case CompressionType.Lz4HC: return 3;
|
||||
case CompressionType.Zstd: return 1;
|
||||
case CompressionType.Oodle: return 2;
|
||||
default: throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
private void customBlockCompressionComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
var selectedTypeIndex = customBlockCompressionComboBox.SelectedIndex;
|
||||
assetsManager.Options.BundleOptions.CustomBlockCompression = GetCustomCompressionTypes(selectedTypeIndex);
|
||||
}
|
||||
|
||||
private void customBlockInfoCompressionComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
var selectedTypeIndex = customBlockInfoCompressionComboBox.SelectedIndex;
|
||||
assetsManager.Options.BundleOptions.CustomBlockInfoCompression = GetCustomCompressionTypes(selectedTypeIndex);
|
||||
}
|
||||
|
||||
private static CompressionType GetCustomCompressionTypes(int index)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0: return CompressionType.Auto;
|
||||
case 1: return CompressionType.Zstd;
|
||||
case 2: return CompressionType.Oodle;
|
||||
case 3: return CompressionType.Lz4HC;
|
||||
case 4: return CompressionType.Lzma;
|
||||
default: throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
private void alwaysDecompressToDiskToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -2745,6 +2713,19 @@ namespace AssetStudioGUI
|
||||
}
|
||||
}
|
||||
|
||||
private void moreOptionsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (importOptionsForm == null || importOptionsForm.IsDisposed)
|
||||
{
|
||||
importOptionsForm = new ImportOptionsForm(assetsManager);
|
||||
importOptionsForm.Show(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
importOptionsForm.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
#region FMOD
|
||||
private void FMODinit()
|
||||
{
|
||||
|
||||
@@ -120,6 +120,9 @@
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>312, 17</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>432, 17</value>
|
||||
</metadata>
|
||||
<data name="fontPreviewBox.Text" xml:space="preserve">
|
||||
<value>abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWYZ
|
||||
1234567890.:,;'\"(!?)+-*/=
|
||||
@@ -138,9 +141,6 @@ The quick brown fox jumps over the lazy dog. 1234567890
|
||||
|
||||
The quick brown fox jumps over the lazy dog. 1234567890</value>
|
||||
</data>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>432, 17</value>
|
||||
</metadata>
|
||||
<metadata name="sceneContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>775, 21</value>
|
||||
</metadata>
|
||||
|
||||
+432
@@ -0,0 +1,432 @@
|
||||
namespace AssetStudioGUI
|
||||
{
|
||||
partial class ImportOptionsForm
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.cachePathLabel = new System.Windows.Forms.Label();
|
||||
this.cachePathSelectButton = new System.Windows.Forms.Button();
|
||||
this.cachePathResetButton = new System.Windows.Forms.Button();
|
||||
this.unityVersionGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.customUnityVersionTextBox = new System.Windows.Forms.TextBox();
|
||||
this.customUnityVersionLabel = new System.Windows.Forms.Label();
|
||||
this.unityVerDetectionModePanel = new System.Windows.Forms.Panel();
|
||||
this.unityVerAutoRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.unityVerLegacy2RadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.unityVerLegacyRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.unityVerDetectionModeLabel = new System.Windows.Forms.Label();
|
||||
this.decompressionGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.customBlockCompressionComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.customBlockCompressionLabel = new System.Windows.Forms.Label();
|
||||
this.customBlockInfoCompressionComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.customBlockInfoCompressionLabel = new System.Windows.Forms.Label();
|
||||
this.cacheFreeSpaceLabel = new System.Windows.Forms.Label();
|
||||
this.alwaysDecompressToDiskCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.closeButton = new System.Windows.Forms.Button();
|
||||
this.saveToDiskButton = new System.Windows.Forms.Button();
|
||||
this.applyButton = new System.Windows.Forms.Button();
|
||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||
this.cacheGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.unityVersionGroupBox.SuspendLayout();
|
||||
this.unityVerDetectionModePanel.SuspendLayout();
|
||||
this.decompressionGroupBox.SuspendLayout();
|
||||
this.tabControl1.SuspendLayout();
|
||||
this.tabPage1.SuspendLayout();
|
||||
this.tabPage2.SuspendLayout();
|
||||
this.cacheGroupBox.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// cachePathLabel
|
||||
//
|
||||
this.cachePathLabel.AutoEllipsis = true;
|
||||
this.cachePathLabel.Location = new System.Drawing.Point(6, 19);
|
||||
this.cachePathLabel.Name = "cachePathLabel";
|
||||
this.cachePathLabel.Size = new System.Drawing.Size(348, 20);
|
||||
this.cachePathLabel.TabIndex = 0;
|
||||
this.cachePathLabel.Text = "Cache directory: <program folder>";
|
||||
//
|
||||
// cachePathSelectButton
|
||||
//
|
||||
this.cachePathSelectButton.Location = new System.Drawing.Point(9, 42);
|
||||
this.cachePathSelectButton.Name = "cachePathSelectButton";
|
||||
this.cachePathSelectButton.Size = new System.Drawing.Size(60, 25);
|
||||
this.cachePathSelectButton.TabIndex = 1;
|
||||
this.cachePathSelectButton.Text = "Select";
|
||||
this.cachePathSelectButton.UseVisualStyleBackColor = false;
|
||||
this.cachePathSelectButton.Click += new System.EventHandler(this.cachePathSelectButton_Click);
|
||||
//
|
||||
// cachePathResetButton
|
||||
//
|
||||
this.cachePathResetButton.Location = new System.Drawing.Point(75, 42);
|
||||
this.cachePathResetButton.Name = "cachePathResetButton";
|
||||
this.cachePathResetButton.Size = new System.Drawing.Size(60, 25);
|
||||
this.cachePathResetButton.TabIndex = 2;
|
||||
this.cachePathResetButton.Text = "Reset";
|
||||
this.cachePathResetButton.UseVisualStyleBackColor = false;
|
||||
this.cachePathResetButton.Click += new System.EventHandler(this.cachePathResetButton_Click);
|
||||
//
|
||||
// unityVersionGroupBox
|
||||
//
|
||||
this.unityVersionGroupBox.Controls.Add(this.customUnityVersionTextBox);
|
||||
this.unityVersionGroupBox.Controls.Add(this.customUnityVersionLabel);
|
||||
this.unityVersionGroupBox.Controls.Add(this.unityVerDetectionModePanel);
|
||||
this.unityVersionGroupBox.Controls.Add(this.unityVerDetectionModeLabel);
|
||||
this.unityVersionGroupBox.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.unityVersionGroupBox.Location = new System.Drawing.Point(3, 3);
|
||||
this.unityVersionGroupBox.Name = "unityVersionGroupBox";
|
||||
this.unityVersionGroupBox.Size = new System.Drawing.Size(357, 126);
|
||||
this.unityVersionGroupBox.TabIndex = 0;
|
||||
this.unityVersionGroupBox.TabStop = false;
|
||||
this.unityVersionGroupBox.Text = "Unity version";
|
||||
//
|
||||
// customUnityVersionTextBox
|
||||
//
|
||||
this.customUnityVersionTextBox.Location = new System.Drawing.Point(137, 20);
|
||||
this.customUnityVersionTextBox.Name = "customUnityVersionTextBox";
|
||||
this.customUnityVersionTextBox.Size = new System.Drawing.Size(121, 23);
|
||||
this.customUnityVersionTextBox.TabIndex = 1;
|
||||
this.toolTip1.SetToolTip(this.customUnityVersionTextBox, "Specify full Unity version, including letters at the end\r\nExample: 2017.4.39f1\r\n");
|
||||
//
|
||||
// customUnityVersionLabel
|
||||
//
|
||||
this.customUnityVersionLabel.AutoSize = true;
|
||||
this.customUnityVersionLabel.Location = new System.Drawing.Point(6, 23);
|
||||
this.customUnityVersionLabel.Name = "customUnityVersionLabel";
|
||||
this.customUnityVersionLabel.Size = new System.Drawing.Size(124, 15);
|
||||
this.customUnityVersionLabel.TabIndex = 0;
|
||||
this.customUnityVersionLabel.Text = "Custom Unity version:";
|
||||
this.toolTip1.SetToolTip(this.customUnityVersionLabel, "Specify full Unity version, including letters at the end\r\nExample: 2017.4.39f1\r\n");
|
||||
//
|
||||
// unityVerDetectionModePanel
|
||||
//
|
||||
this.unityVerDetectionModePanel.Controls.Add(this.unityVerAutoRadioButton);
|
||||
this.unityVerDetectionModePanel.Controls.Add(this.unityVerLegacy2RadioButton);
|
||||
this.unityVerDetectionModePanel.Controls.Add(this.unityVerLegacyRadioButton);
|
||||
this.unityVerDetectionModePanel.Location = new System.Drawing.Point(35, 75);
|
||||
this.unityVerDetectionModePanel.Name = "unityVerDetectionModePanel";
|
||||
this.unityVerDetectionModePanel.Size = new System.Drawing.Size(289, 34);
|
||||
this.unityVerDetectionModePanel.TabIndex = 3;
|
||||
//
|
||||
// unityVerAutoRadioButton
|
||||
//
|
||||
this.unityVerAutoRadioButton.AutoSize = true;
|
||||
this.unityVerAutoRadioButton.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.unityVerAutoRadioButton.Location = new System.Drawing.Point(152, 0);
|
||||
this.unityVerAutoRadioButton.Name = "unityVerAutoRadioButton";
|
||||
this.unityVerAutoRadioButton.Padding = new System.Windows.Forms.Padding(0, 0, 5, 0);
|
||||
this.unityVerAutoRadioButton.Size = new System.Drawing.Size(103, 34);
|
||||
this.unityVerAutoRadioButton.TabIndex = 2;
|
||||
this.unityVerAutoRadioButton.TabStop = true;
|
||||
this.unityVerAutoRadioButton.Text = "Auto/Custom";
|
||||
this.unityVerAutoRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// unityVerLegacy2RadioButton
|
||||
//
|
||||
this.unityVerLegacy2RadioButton.AutoSize = true;
|
||||
this.unityVerLegacy2RadioButton.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.unityVerLegacy2RadioButton.Enabled = false;
|
||||
this.unityVerLegacy2RadioButton.Location = new System.Drawing.Point(76, 0);
|
||||
this.unityVerLegacy2RadioButton.Name = "unityVerLegacy2RadioButton";
|
||||
this.unityVerLegacy2RadioButton.Padding = new System.Windows.Forms.Padding(0, 0, 5, 0);
|
||||
this.unityVerLegacy2RadioButton.Size = new System.Drawing.Size(76, 34);
|
||||
this.unityVerLegacy2RadioButton.TabIndex = 1;
|
||||
this.unityVerLegacy2RadioButton.TabStop = true;
|
||||
this.unityVerLegacy2RadioButton.Text = "Legacy 2";
|
||||
this.toolTip1.SetToolTip(this.unityVerLegacy2RadioButton, "WIP");
|
||||
this.unityVerLegacy2RadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// unityVerLegacyRadioButton
|
||||
//
|
||||
this.unityVerLegacyRadioButton.AutoSize = true;
|
||||
this.unityVerLegacyRadioButton.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.unityVerLegacyRadioButton.Enabled = false;
|
||||
this.unityVerLegacyRadioButton.Location = new System.Drawing.Point(0, 0);
|
||||
this.unityVerLegacyRadioButton.Name = "unityVerLegacyRadioButton";
|
||||
this.unityVerLegacyRadioButton.Padding = new System.Windows.Forms.Padding(0, 0, 5, 0);
|
||||
this.unityVerLegacyRadioButton.Size = new System.Drawing.Size(76, 34);
|
||||
this.unityVerLegacyRadioButton.TabIndex = 0;
|
||||
this.unityVerLegacyRadioButton.TabStop = true;
|
||||
this.unityVerLegacyRadioButton.Text = "Legacy 1";
|
||||
this.toolTip1.SetToolTip(this.unityVerLegacyRadioButton, "WIP");
|
||||
this.unityVerLegacyRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// unityVerDetectionModeLabel
|
||||
//
|
||||
this.unityVerDetectionModeLabel.AutoSize = true;
|
||||
this.unityVerDetectionModeLabel.Location = new System.Drawing.Point(6, 57);
|
||||
this.unityVerDetectionModeLabel.Name = "unityVerDetectionModeLabel";
|
||||
this.unityVerDetectionModeLabel.Size = new System.Drawing.Size(92, 15);
|
||||
this.unityVerDetectionModeLabel.TabIndex = 2;
|
||||
this.unityVerDetectionModeLabel.Text = "Detection mode";
|
||||
this.toolTip1.SetToolTip(this.unityVerDetectionModeLabel, "WIP");
|
||||
//
|
||||
// decompressionGroupBox
|
||||
//
|
||||
this.decompressionGroupBox.Controls.Add(this.customBlockCompressionComboBox);
|
||||
this.decompressionGroupBox.Controls.Add(this.customBlockCompressionLabel);
|
||||
this.decompressionGroupBox.Controls.Add(this.customBlockInfoCompressionComboBox);
|
||||
this.decompressionGroupBox.Controls.Add(this.customBlockInfoCompressionLabel);
|
||||
this.decompressionGroupBox.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.decompressionGroupBox.Location = new System.Drawing.Point(3, 126);
|
||||
this.decompressionGroupBox.Name = "decompressionGroupBox";
|
||||
this.decompressionGroupBox.Size = new System.Drawing.Size(357, 92);
|
||||
this.decompressionGroupBox.TabIndex = 1;
|
||||
this.decompressionGroupBox.TabStop = false;
|
||||
this.decompressionGroupBox.Text = "Decompression options";
|
||||
//
|
||||
// customBlockCompressionComboBox
|
||||
//
|
||||
this.customBlockCompressionComboBox.FormattingEnabled = true;
|
||||
this.customBlockCompressionComboBox.Items.AddRange(new object[] {
|
||||
"Auto",
|
||||
"Zstd",
|
||||
"Oodle",
|
||||
"Lz4/Lz4HC",
|
||||
"Lzma"});
|
||||
this.customBlockCompressionComboBox.Location = new System.Drawing.Point(166, 51);
|
||||
this.customBlockCompressionComboBox.Name = "customBlockCompressionComboBox";
|
||||
this.customBlockCompressionComboBox.Size = new System.Drawing.Size(121, 23);
|
||||
this.customBlockCompressionComboBox.TabIndex = 3;
|
||||
this.toolTip1.SetToolTip(this.customBlockCompressionComboBox, "Selected compression type will override detected type from an asset bundle");
|
||||
//
|
||||
// customBlockCompressionLabel
|
||||
//
|
||||
this.customBlockCompressionLabel.AutoSize = true;
|
||||
this.customBlockCompressionLabel.Location = new System.Drawing.Point(6, 54);
|
||||
this.customBlockCompressionLabel.Name = "customBlockCompressionLabel";
|
||||
this.customBlockCompressionLabel.Size = new System.Drawing.Size(133, 15);
|
||||
this.customBlockCompressionLabel.TabIndex = 2;
|
||||
this.customBlockCompressionLabel.Text = "Block compression type";
|
||||
//
|
||||
// customBlockInfoCompressionComboBox
|
||||
//
|
||||
this.customBlockInfoCompressionComboBox.FormattingEnabled = true;
|
||||
this.customBlockInfoCompressionComboBox.Items.AddRange(new object[] {
|
||||
"Auto",
|
||||
"Zstd",
|
||||
"Oodle",
|
||||
"Lz4/Lz4HC",
|
||||
"Lzma"});
|
||||
this.customBlockInfoCompressionComboBox.Location = new System.Drawing.Point(166, 22);
|
||||
this.customBlockInfoCompressionComboBox.Name = "customBlockInfoCompressionComboBox";
|
||||
this.customBlockInfoCompressionComboBox.Size = new System.Drawing.Size(121, 23);
|
||||
this.customBlockInfoCompressionComboBox.TabIndex = 1;
|
||||
this.toolTip1.SetToolTip(this.customBlockInfoCompressionComboBox, "Selected compression type will override detected type from an asset bundle");
|
||||
//
|
||||
// customBlockInfoCompressionLabel
|
||||
//
|
||||
this.customBlockInfoCompressionLabel.AutoSize = true;
|
||||
this.customBlockInfoCompressionLabel.Location = new System.Drawing.Point(6, 25);
|
||||
this.customBlockInfoCompressionLabel.Name = "customBlockInfoCompressionLabel";
|
||||
this.customBlockInfoCompressionLabel.Size = new System.Drawing.Size(154, 15);
|
||||
this.customBlockInfoCompressionLabel.TabIndex = 0;
|
||||
this.customBlockInfoCompressionLabel.Text = "BlockInfo compression type";
|
||||
//
|
||||
// cacheFreeSpaceLabel
|
||||
//
|
||||
this.cacheFreeSpaceLabel.AutoSize = true;
|
||||
this.cacheFreeSpaceLabel.Location = new System.Drawing.Point(160, 47);
|
||||
this.cacheFreeSpaceLabel.Name = "cacheFreeSpaceLabel";
|
||||
this.cacheFreeSpaceLabel.Size = new System.Drawing.Size(91, 15);
|
||||
this.cacheFreeSpaceLabel.TabIndex = 3;
|
||||
this.cacheFreeSpaceLabel.Text = "Available space:";
|
||||
//
|
||||
// alwaysDecompressToDiskCheckBox
|
||||
//
|
||||
this.alwaysDecompressToDiskCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.alwaysDecompressToDiskCheckBox.Location = new System.Drawing.Point(9, 82);
|
||||
this.alwaysDecompressToDiskCheckBox.Name = "alwaysDecompressToDiskCheckBox";
|
||||
this.alwaysDecompressToDiskCheckBox.Size = new System.Drawing.Size(345, 19);
|
||||
this.alwaysDecompressToDiskCheckBox.TabIndex = 4;
|
||||
this.alwaysDecompressToDiskCheckBox.Text = "Always decompress asset bundles to disk (cache dir)";
|
||||
this.toolTip1.SetToolTip(this.alwaysDecompressToDiskCheckBox, "If not selected, any bundles less than 2GB will be decompressed to RAM");
|
||||
this.alwaysDecompressToDiskCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// closeButton
|
||||
//
|
||||
this.closeButton.AutoSize = true;
|
||||
this.closeButton.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.closeButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.closeButton.Location = new System.Drawing.Point(294, 336);
|
||||
this.closeButton.Margin = new System.Windows.Forms.Padding(3, 6, 3, 6);
|
||||
this.closeButton.Name = "closeButton";
|
||||
this.closeButton.Size = new System.Drawing.Size(88, 27);
|
||||
this.closeButton.TabIndex = 3;
|
||||
this.closeButton.Text = "Close";
|
||||
this.closeButton.UseVisualStyleBackColor = false;
|
||||
this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
|
||||
//
|
||||
// saveToDiskButton
|
||||
//
|
||||
this.saveToDiskButton.AutoSize = true;
|
||||
this.saveToDiskButton.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.saveToDiskButton.Location = new System.Drawing.Point(12, 336);
|
||||
this.saveToDiskButton.Margin = new System.Windows.Forms.Padding(3, 6, 3, 6);
|
||||
this.saveToDiskButton.Name = "saveToDiskButton";
|
||||
this.saveToDiskButton.Size = new System.Drawing.Size(89, 27);
|
||||
this.saveToDiskButton.TabIndex = 1;
|
||||
this.saveToDiskButton.Text = "Save to disk";
|
||||
this.saveToDiskButton.UseVisualStyleBackColor = false;
|
||||
this.saveToDiskButton.Click += new System.EventHandler(this.saveToDiskButton_Click);
|
||||
//
|
||||
// applyButton
|
||||
//
|
||||
this.applyButton.AutoSize = true;
|
||||
this.applyButton.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.applyButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.applyButton.Location = new System.Drawing.Point(200, 336);
|
||||
this.applyButton.Margin = new System.Windows.Forms.Padding(3, 6, 3, 6);
|
||||
this.applyButton.Name = "applyButton";
|
||||
this.applyButton.Size = new System.Drawing.Size(88, 27);
|
||||
this.applyButton.TabIndex = 2;
|
||||
this.applyButton.Text = "Apply";
|
||||
this.applyButton.UseVisualStyleBackColor = false;
|
||||
this.applyButton.Click += new System.EventHandler(this.applyButton_Click);
|
||||
//
|
||||
// tabControl1
|
||||
//
|
||||
this.tabControl1.Controls.Add(this.tabPage1);
|
||||
this.tabControl1.Controls.Add(this.tabPage2);
|
||||
this.tabControl1.Location = new System.Drawing.Point(12, 12);
|
||||
this.tabControl1.Margin = new System.Windows.Forms.Padding(12);
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
this.tabControl1.Size = new System.Drawing.Size(371, 319);
|
||||
this.tabControl1.TabIndex = 0;
|
||||
//
|
||||
// tabPage1
|
||||
//
|
||||
this.tabPage1.BackColor = System.Drawing.SystemColors.Menu;
|
||||
this.tabPage1.Controls.Add(this.unityVersionGroupBox);
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 24);
|
||||
this.tabPage1.Name = "tabPage1";
|
||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage1.Size = new System.Drawing.Size(363, 291);
|
||||
this.tabPage1.TabIndex = 0;
|
||||
this.tabPage1.Text = "General";
|
||||
//
|
||||
// tabPage2
|
||||
//
|
||||
this.tabPage2.BackColor = System.Drawing.SystemColors.Menu;
|
||||
this.tabPage2.Controls.Add(this.decompressionGroupBox);
|
||||
this.tabPage2.Controls.Add(this.cacheGroupBox);
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 24);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage2.Size = new System.Drawing.Size(363, 291);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "Asset Bundles";
|
||||
//
|
||||
// cacheGroupBox
|
||||
//
|
||||
this.cacheGroupBox.AutoSize = true;
|
||||
this.cacheGroupBox.Controls.Add(this.alwaysDecompressToDiskCheckBox);
|
||||
this.cacheGroupBox.Controls.Add(this.cacheFreeSpaceLabel);
|
||||
this.cacheGroupBox.Controls.Add(this.cachePathLabel);
|
||||
this.cacheGroupBox.Controls.Add(this.cachePathSelectButton);
|
||||
this.cacheGroupBox.Controls.Add(this.cachePathResetButton);
|
||||
this.cacheGroupBox.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.cacheGroupBox.Location = new System.Drawing.Point(3, 3);
|
||||
this.cacheGroupBox.Name = "cacheGroupBox";
|
||||
this.cacheGroupBox.Size = new System.Drawing.Size(357, 123);
|
||||
this.cacheGroupBox.TabIndex = 0;
|
||||
this.cacheGroupBox.TabStop = false;
|
||||
this.cacheGroupBox.Text = "Disk cache";
|
||||
//
|
||||
// ImportOptionsForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.AutoSize = true;
|
||||
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.BackColor = System.Drawing.SystemColors.Menu;
|
||||
this.CancelButton = this.closeButton;
|
||||
this.ClientSize = new System.Drawing.Size(394, 372);
|
||||
this.Controls.Add(this.tabControl1);
|
||||
this.Controls.Add(this.applyButton);
|
||||
this.Controls.Add(this.saveToDiskButton);
|
||||
this.Controls.Add(this.closeButton);
|
||||
this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "ImportOptionsForm";
|
||||
this.ShowIcon = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Import options";
|
||||
this.unityVersionGroupBox.ResumeLayout(false);
|
||||
this.unityVersionGroupBox.PerformLayout();
|
||||
this.unityVerDetectionModePanel.ResumeLayout(false);
|
||||
this.unityVerDetectionModePanel.PerformLayout();
|
||||
this.decompressionGroupBox.ResumeLayout(false);
|
||||
this.decompressionGroupBox.PerformLayout();
|
||||
this.tabControl1.ResumeLayout(false);
|
||||
this.tabPage1.ResumeLayout(false);
|
||||
this.tabPage2.ResumeLayout(false);
|
||||
this.tabPage2.PerformLayout();
|
||||
this.cacheGroupBox.ResumeLayout(false);
|
||||
this.cacheGroupBox.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label cachePathLabel;
|
||||
private System.Windows.Forms.Button cachePathSelectButton;
|
||||
private System.Windows.Forms.Button cachePathResetButton;
|
||||
private System.Windows.Forms.GroupBox unityVersionGroupBox;
|
||||
private System.Windows.Forms.GroupBox decompressionGroupBox;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
private System.Windows.Forms.ComboBox customBlockInfoCompressionComboBox;
|
||||
private System.Windows.Forms.Label customBlockInfoCompressionLabel;
|
||||
private System.Windows.Forms.TextBox customUnityVersionTextBox;
|
||||
private System.Windows.Forms.Label customUnityVersionLabel;
|
||||
private System.Windows.Forms.ComboBox customBlockCompressionComboBox;
|
||||
private System.Windows.Forms.Label customBlockCompressionLabel;
|
||||
private System.Windows.Forms.CheckBox alwaysDecompressToDiskCheckBox;
|
||||
private System.Windows.Forms.Button closeButton;
|
||||
private System.Windows.Forms.Button saveToDiskButton;
|
||||
private System.Windows.Forms.Button applyButton;
|
||||
private System.Windows.Forms.Label cacheFreeSpaceLabel;
|
||||
private System.Windows.Forms.Panel unityVerDetectionModePanel;
|
||||
private System.Windows.Forms.RadioButton unityVerAutoRadioButton;
|
||||
private System.Windows.Forms.RadioButton unityVerLegacy2RadioButton;
|
||||
private System.Windows.Forms.RadioButton unityVerLegacyRadioButton;
|
||||
private System.Windows.Forms.Label unityVerDetectionModeLabel;
|
||||
private System.Windows.Forms.TabControl tabControl1;
|
||||
private System.Windows.Forms.TabPage tabPage1;
|
||||
private System.Windows.Forms.TabPage tabPage2;
|
||||
private System.Windows.Forms.GroupBox cacheGroupBox;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
using AssetStudio;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AssetStudioGUI
|
||||
{
|
||||
public partial class ImportOptionsForm : Form
|
||||
{
|
||||
private readonly AssetsManager _assetsManager;
|
||||
private string _cachePath;
|
||||
|
||||
public ImportOptionsForm(AssetsManager assetsManager)
|
||||
{
|
||||
InitializeComponent();
|
||||
_assetsManager = assetsManager;
|
||||
if (assetsManager.Options.CustomUnityVersion != null)
|
||||
{
|
||||
customUnityVersionTextBox.Text = assetsManager.Options.CustomUnityVersion.FullVersion;
|
||||
}
|
||||
unityVerAutoRadioButton.Checked = true;
|
||||
cachePathLabel.AutoSize = IsWine; //to disable AutoEllipsis in Wine
|
||||
_cachePath = _assetsManager.Options.BundleOptions.CustomCachePath;
|
||||
DisplayCachePath();
|
||||
alwaysDecompressToDiskCheckBox.Checked = assetsManager.Options.BundleOptions.DecompressToDisk;
|
||||
customBlockInfoCompressionComboBox.SelectedIndex = SetComboBoxIndex(assetsManager.Options.BundleOptions.CustomBlockInfoCompression);
|
||||
customBlockCompressionComboBox.SelectedIndex = SetComboBoxIndex(assetsManager.Options.BundleOptions.CustomBlockCompression);
|
||||
}
|
||||
|
||||
private void ApplyOptions()
|
||||
{
|
||||
if (string.IsNullOrEmpty(customUnityVersionTextBox.Text))
|
||||
{
|
||||
_assetsManager.Options.CustomUnityVersion = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
_assetsManager.Options.CustomUnityVersion = new UnityVersion(customUnityVersionTextBox.Text);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
_assetsManager.Options.BundleOptions.CustomCachePath = _cachePath;
|
||||
Properties.Settings.Default.cachePath = _cachePath;
|
||||
|
||||
var blockCompression = GetCustomCompressionTypes(customBlockCompressionComboBox.SelectedIndex);
|
||||
_assetsManager.Options.BundleOptions.CustomBlockCompression = blockCompression;
|
||||
var blockInfoCompression = GetCustomCompressionTypes(customBlockInfoCompressionComboBox.SelectedIndex);
|
||||
_assetsManager.Options.BundleOptions.CustomBlockInfoCompression = blockInfoCompression;
|
||||
|
||||
var decompressToDisk = alwaysDecompressToDiskCheckBox.Checked;
|
||||
_assetsManager.Options.BundleOptions.DecompressToDisk = decompressToDisk;
|
||||
Properties.Settings.Default.decompressToDisk = decompressToDisk;
|
||||
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
private static CompressionType GetCustomCompressionTypes(int index)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0: return CompressionType.Auto;
|
||||
case 1: return CompressionType.Zstd;
|
||||
case 2: return CompressionType.Oodle;
|
||||
case 3: return CompressionType.Lz4HC;
|
||||
case 4: return CompressionType.Lzma;
|
||||
default: throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
private static int SetComboBoxIndex(CompressionType compressionType)
|
||||
{
|
||||
switch (compressionType)
|
||||
{
|
||||
case CompressionType.Auto: return 0;
|
||||
case CompressionType.Lzma: return 4;
|
||||
case CompressionType.Lz4:
|
||||
case CompressionType.Lz4HC: return 3;
|
||||
case CompressionType.Zstd: return 1;
|
||||
case CompressionType.Oodle: return 2;
|
||||
default: throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
private void DisplayCachePath()
|
||||
{
|
||||
cachePathLabel.Text = $"Cache directory: {_cachePath}";
|
||||
toolTip1.SetToolTip(cachePathLabel, _cachePath);
|
||||
var driveInfo = new DriveInfo(Directory.GetDirectoryRoot(_cachePath));
|
||||
cacheFreeSpaceLabel.Text = $"Available space: {driveInfo.AvailableFreeSpace * 1.0f / 0x40000000:.00}GB";
|
||||
}
|
||||
|
||||
private void cachePathSelectButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var cachePathFolderDialog = new OpenFolderDialog();
|
||||
cachePathFolderDialog.Title = "Select the cache directory";
|
||||
if (cachePathFolderDialog.ShowDialog(this) != DialogResult.OK)
|
||||
return;
|
||||
|
||||
_cachePath = cachePathFolderDialog.Folder;
|
||||
DisplayCachePath();
|
||||
}
|
||||
|
||||
private void cachePathResetButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
_cachePath = Path.Combine(Directory.GetCurrentDirectory(), "temp");
|
||||
if (!Directory.Exists(_cachePath))
|
||||
Directory.CreateDirectory(_cachePath);
|
||||
DisplayCachePath();
|
||||
}
|
||||
|
||||
private void saveToDiskButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
ApplyOptions();
|
||||
var saveFolderDialog = new OpenFolderDialog();
|
||||
saveFolderDialog.Title = "Select the save folder";
|
||||
if (saveFolderDialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
var savePath = saveFolderDialog.Folder;
|
||||
_assetsManager.Options.SaveToFile(savePath);
|
||||
}
|
||||
}
|
||||
|
||||
private void closeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void applyButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
ApplyOptions();
|
||||
}
|
||||
|
||||
private static bool IsWine => Process.GetProcessesByName("winlogon").Length == 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
<?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.
|
||||
-->
|
||||
<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="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+12
@@ -370,5 +370,17 @@ namespace AssetStudioGUI.Properties {
|
||||
this["rawByteArrayFromMono"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string cachePath {
|
||||
get {
|
||||
return ((string)(this["cachePath"]));
|
||||
}
|
||||
set {
|
||||
this["cachePath"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,5 +89,8 @@
|
||||
<Setting Name="rawByteArrayFromMono" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="cachePath" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
Reference in New Issue
Block a user