diff --git a/AssetStudio/CustomOptions/ImportOptions.cs b/AssetStudio/CustomOptions/ImportOptions.cs index f01e6fb..1d3a566 100644 --- a/AssetStudio/CustomOptions/ImportOptions.cs +++ b/AssetStudio/CustomOptions/ImportOptions.cs @@ -14,6 +14,8 @@ namespace AssetStudio.CustomOptions private static string fileName = "ImportOptions"; private UnityVersion _customUnityVer; + public event EventHandler UnityVersionChanged; + public CustomBundleOptions BundleOptions { get; set; } public UnityVersion CustomUnityVersion { get => _customUnityVer; set => SetUnityVersion(value); } @@ -77,6 +79,7 @@ namespace AssetStudio.CustomOptions if (value == null) { _customUnityVer = null; + UnityVersionChanged?.Invoke(this, EventArgs.Empty); Logger.Info("- Specified Unity version: None"); return; } @@ -87,6 +90,7 @@ namespace AssetStudio.CustomOptions "Example: 2017.4.39f1"); } _customUnityVer = value; + UnityVersionChanged?.Invoke(this, EventArgs.Empty); Logger.Info($"- Specified Unity version: {_customUnityVer}"); } diff --git a/AssetStudioGUI/AssetStudioGUIForm.Designer.cs b/AssetStudioGUI/AssetStudioGUIForm.Designer.cs index ed408e0..c9bdd0c 100644 --- a/AssetStudioGUI/AssetStudioGUIForm.Designer.cs +++ b/AssetStudioGUI/AssetStudioGUIForm.Designer.cs @@ -152,6 +152,7 @@ this.dumpTextBox = new System.Windows.Forms.TextBox(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.unityVersionStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.sceneContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.shShowRelatedAssetsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.shToolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); @@ -1425,9 +1426,11 @@ // this.statusStrip1.BackColor = System.Drawing.SystemColors.MenuBar; this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripStatusLabel1}); + this.toolStripStatusLabel1, + this.unityVersionStatusLabel}); this.statusStrip1.Location = new System.Drawing.Point(0, 633); this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.ShowItemToolTips = true; this.statusStrip1.Size = new System.Drawing.Size(776, 22); this.statusStrip1.TabIndex = 2; this.statusStrip1.Text = "statusStrip1"; @@ -1437,11 +1440,28 @@ this.toolStripStatusLabel1.BackColor = System.Drawing.Color.Transparent; this.toolStripStatusLabel1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; - this.toolStripStatusLabel1.Size = new System.Drawing.Size(761, 17); + this.toolStripStatusLabel1.Size = new System.Drawing.Size(715, 17); this.toolStripStatusLabel1.Spring = true; this.toolStripStatusLabel1.Text = "Ready to go"; this.toolStripStatusLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // + // unityVersionStatusLabel + // + this.unityVersionStatusLabel.BackColor = System.Drawing.Color.Transparent; + this.unityVersionStatusLabel.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) + | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) + | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); + this.unityVersionStatusLabel.BorderStyle = System.Windows.Forms.Border3DStyle.Etched; + this.unityVersionStatusLabel.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.unityVersionStatusLabel.DoubleClickEnabled = true; + this.unityVersionStatusLabel.Margin = new System.Windows.Forms.Padding(0, 3, 6, 0); + this.unityVersionStatusLabel.Name = "unityVersionStatusLabel"; + this.unityVersionStatusLabel.Size = new System.Drawing.Size(40, 19); + this.unityVersionStatusLabel.Text = "None"; + this.unityVersionStatusLabel.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.unityVersionStatusLabel.ToolTipText = "Custom Unity version\r\n- Double click to reset"; + this.unityVersionStatusLabel.DoubleClick += new System.EventHandler(this.unityVersionStatusLabel_DoubleClick); + // // sceneContextMenuStrip // this.sceneContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -1861,6 +1881,7 @@ private System.Windows.Forms.ToolStripMenuItem tvCopyNameToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator importOptionsToolStripSeparator; private System.Windows.Forms.ToolStripMenuItem moreOptionsToolStripMenuItem; + private System.Windows.Forms.ToolStripStatusLabel unityVersionStatusLabel; } } diff --git a/AssetStudioGUI/AssetStudioGUIForm.cs b/AssetStudioGUI/AssetStudioGUIForm.cs index 74ed895..572abc5 100644 --- a/AssetStudioGUI/AssetStudioGUIForm.cs +++ b/AssetStudioGUI/AssetStudioGUIForm.cs @@ -154,6 +154,8 @@ namespace AssetStudioGUI meshLazyLoadToolStripMenuItem.Checked = Properties.Settings.Default.meshLazyLoad; assetsManager.Options.BundleOptions.DecompressToDisk = Properties.Settings.Default.decompressToDisk; assetsManager.Options.BundleOptions.CustomCachePath = GetCachePath(); + assetsManager.Options.UnityVersionChanged += OnUnityVersionChanged; + unityVersionStatusLabel.Visible = false; FMODinit(); listSearchFilterMode.SelectedIndex = 0; FbxInitOptions(Properties.Settings.Default.fbxSettings); @@ -2542,6 +2544,7 @@ namespace AssetStudioGUI if (isDarkMode) { assetListView.GridLines = false; + unityVersionStatusLabel.BorderStyle = Border3DStyle.SunkenInner; } else { @@ -2710,6 +2713,26 @@ namespace AssetStudioGUI } } + private void OnUnityVersionChanged(object s, EventArgs e) + { + if (assetsManager.Options.CustomUnityVersion == null) + { + specifyUnityVersionTextBox.Text = ""; + unityVersionStatusLabel.Text = ""; + unityVersionStatusLabel.Visible = false; + } + else + { + unityVersionStatusLabel.Text = assetsManager.Options.CustomUnityVersion.FullVersion; + unityVersionStatusLabel.Visible = true; + } + } + + private void unityVersionStatusLabel_DoubleClick(object sender, EventArgs e) + { + assetsManager.Options.CustomUnityVersion = null; + } + #region FMOD private void FMODinit() {