From fe95c91759c33d4012aa536ca86ed153777f921f Mon Sep 17 00:00:00 2001 From: Perfare Date: Thu, 9 Dec 2021 19:00:59 +0800 Subject: [PATCH] Add net6.0 target framework --- .../AssetStudio.PInvoke.csproj | 2 +- AssetStudio/AssetStudio.csproj | 2 +- .../AssetStudioFBXWrapper.csproj | 2 +- AssetStudioGUI/AssetStudioGUI.csproj | 4 +-- AssetStudioGUI/Components/OpenFolderDialog.cs | 25 ++++++++++++------- AssetStudioUtility/AssetStudioUtility.csproj | 2 +- .../Texture2DDecoderWrapper.csproj | 2 +- 7 files changed, 23 insertions(+), 16 deletions(-) diff --git a/AssetStudio.PInvoke/AssetStudio.PInvoke.csproj b/AssetStudio.PInvoke/AssetStudio.PInvoke.csproj index b24e386..6e6b75f 100644 --- a/AssetStudio.PInvoke/AssetStudio.PInvoke.csproj +++ b/AssetStudio.PInvoke/AssetStudio.PInvoke.csproj @@ -1,7 +1,7 @@ - net472;netstandard2.0;net5.0 + net472;netstandard2.0;net5.0;net6.0 true 0.16.0.0 0.16.0.0 diff --git a/AssetStudio/AssetStudio.csproj b/AssetStudio/AssetStudio.csproj index 04a419c..afb240b 100644 --- a/AssetStudio/AssetStudio.csproj +++ b/AssetStudio/AssetStudio.csproj @@ -1,7 +1,7 @@ - net472;netstandard2.0;net5.0 + net472;netstandard2.0;net5.0;net6.0 0.16.0.0 0.16.0.0 0.16.0.0 diff --git a/AssetStudioFBXWrapper/AssetStudioFBXWrapper.csproj b/AssetStudioFBXWrapper/AssetStudioFBXWrapper.csproj index 9622f56..ea984fe 100644 --- a/AssetStudioFBXWrapper/AssetStudioFBXWrapper.csproj +++ b/AssetStudioFBXWrapper/AssetStudioFBXWrapper.csproj @@ -1,7 +1,7 @@ - net472;netstandard2.0;net5.0 + net472;netstandard2.0;net5.0;net6.0 true 0.16.0.0 0.16.0.0 diff --git a/AssetStudioGUI/AssetStudioGUI.csproj b/AssetStudioGUI/AssetStudioGUI.csproj index f08bfbb..3ace84a 100644 --- a/AssetStudioGUI/AssetStudioGUI.csproj +++ b/AssetStudioGUI/AssetStudioGUI.csproj @@ -2,7 +2,7 @@ WinExe - net472;net5.0-windows + net472;net5.0-windows;net6.0-windows true Resources\as.ico 0.16.0.0 @@ -51,7 +51,7 @@ - + Libraries\OpenTK.WinForms.dll diff --git a/AssetStudioGUI/Components/OpenFolderDialog.cs b/AssetStudioGUI/Components/OpenFolderDialog.cs index 3ffab13..cd8dcea 100644 --- a/AssetStudioGUI/Components/OpenFolderDialog.cs +++ b/AssetStudioGUI/Components/OpenFolderDialog.cs @@ -1,5 +1,4 @@ using System; -using System.IO; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows.Forms; @@ -15,12 +14,13 @@ namespace AssetStudioGUI internal DialogResult ShowDialog(IWin32Window owner = null) { +#if NETFRAMEWORK if (Environment.OSVersion.Version.Major >= 6) { return ShowVistaDialog(owner); } - - return ShowLegacyDialog(owner); +#endif + return ShowFolderBrowserDialog(owner); } private DialogResult ShowVistaDialog(IWin32Window owner) @@ -74,7 +74,7 @@ namespace AssetStudioGUI return DialogResult.Cancel; } - private DialogResult ShowLegacyDialog(IWin32Window owner) + private DialogResult ShowFolderBrowserDialog(IWin32Window owner) { using (var frm = new FolderBrowserDialog()) { @@ -82,13 +82,20 @@ namespace AssetStudioGUI { frm.SelectedPath = InitialFolder; } - if ((owner == null ? frm.ShowDialog() : frm.ShowDialog(owner)) == DialogResult.OK) +#if !NETFRAMEWORK + if (Title != null) { - Folder = Path.GetDirectoryName(frm.SelectedPath); - return DialogResult.OK; + frm.Description = Title; + frm.UseDescriptionForTitle = true; } - - return DialogResult.Cancel; +#endif + var result = owner == null ? frm.ShowDialog() : frm.ShowDialog(owner); + if (result == DialogResult.OK) + { + Folder = frm.SelectedPath; + return result; + } + return result; } } } diff --git a/AssetStudioUtility/AssetStudioUtility.csproj b/AssetStudioUtility/AssetStudioUtility.csproj index 9f39058..49bb7dc 100644 --- a/AssetStudioUtility/AssetStudioUtility.csproj +++ b/AssetStudioUtility/AssetStudioUtility.csproj @@ -1,7 +1,7 @@ - net472;netstandard2.0;net5.0 + net472;netstandard2.0;net5.0;net6.0 0.16.0.0 0.16.0.0 0.16.0.0 diff --git a/Texture2DDecoderWrapper/Texture2DDecoderWrapper.csproj b/Texture2DDecoderWrapper/Texture2DDecoderWrapper.csproj index 3dd9c79..c4f8839 100644 --- a/Texture2DDecoderWrapper/Texture2DDecoderWrapper.csproj +++ b/Texture2DDecoderWrapper/Texture2DDecoderWrapper.csproj @@ -1,7 +1,7 @@ - net472;netstandard2.0;net5.0 + net472;netstandard2.0;net5.0;net6.0 true 0.16.0.0 0.16.0.0