diff --git a/AssetStudio.PInvoke/AssetStudio.PInvoke.csproj b/AssetStudio.PInvoke/AssetStudio.PInvoke.csproj index a82caf1..f54933d 100644 --- a/AssetStudio.PInvoke/AssetStudio.PInvoke.csproj +++ b/AssetStudio.PInvoke/AssetStudio.PInvoke.csproj @@ -1,7 +1,7 @@ - net472;netstandard2.0 + net472;netstandard2.0;net5.0 true 0.16.8.1 0.16.8.1 diff --git a/AssetStudio/AssetStudio.csproj b/AssetStudio/AssetStudio.csproj index e36370b..e8d51d3 100644 --- a/AssetStudio/AssetStudio.csproj +++ b/AssetStudio/AssetStudio.csproj @@ -1,7 +1,7 @@ - net472;netstandard2.0 + net472;netstandard2.0;net5.0 0.16.8.1 0.16.8.1 0.16.8.1 diff --git a/AssetStudio/AssetsManager.cs b/AssetStudio/AssetsManager.cs index 6bfbeec..5a4d9c4 100644 --- a/AssetStudio/AssetsManager.cs +++ b/AssetStudio/AssetsManager.cs @@ -21,7 +21,7 @@ namespace AssetStudio public void LoadFiles(params string[] files) { - var path = Path.GetDirectoryName(files[0]); + var path = Path.GetDirectoryName(Path.GetFullPath(files[0])); MergeSplitAssets(path); var toReadFile = ProcessingSplitFiles(files.ToList()); Load(toReadFile); @@ -424,6 +424,10 @@ namespace AssetStudio } else if (obj is SpriteAtlas m_SpriteAtlas) { + if (m_SpriteAtlas.m_IsVariant) + { + continue; + } foreach (var m_PackedSprite in m_SpriteAtlas.m_PackedSprites) { if (m_PackedSprite.TryGet(out var m_Sprite)) diff --git a/AssetStudio/Classes/Sprite.cs b/AssetStudio/Classes/Sprite.cs index 32e2f04..6e3c653 100644 --- a/AssetStudio/Classes/Sprite.cs +++ b/AssetStudio/Classes/Sprite.cs @@ -197,7 +197,7 @@ namespace AssetStudio public Vector2 m_Offset; public Vector4 m_Border; public float m_PixelsToUnits; - public Vector2 m_Pivot; + public Vector2 m_Pivot = new Vector2(0.5f, 0.5f); public uint m_Extrude; public bool m_IsPolygon; public KeyValuePair m_RenderDataKey; diff --git a/AssetStudio/Classes/SpriteAtlas.cs b/AssetStudio/Classes/SpriteAtlas.cs index 2a71c30..c1a97c5 100644 --- a/AssetStudio/Classes/SpriteAtlas.cs +++ b/AssetStudio/Classes/SpriteAtlas.cs @@ -46,6 +46,7 @@ namespace AssetStudio { public PPtr[] m_PackedSprites; public Dictionary, SpriteAtlasData> m_RenderDataMap; + public bool m_IsVariant; public SpriteAtlas(ObjectReader reader) : base(reader) { @@ -67,8 +68,9 @@ namespace AssetStudio var value = new SpriteAtlasData(reader); m_RenderDataMap.Add(new KeyValuePair(first, second), value); } - //string m_Tag - //bool m_IsVariant + var m_Tag = reader.ReadAlignedString(); + m_IsVariant = reader.ReadBoolean(); + reader.AlignStream(); } } } diff --git a/AssetStudioFBXWrapper/AssetStudioFBXWrapper.csproj b/AssetStudioFBXWrapper/AssetStudioFBXWrapper.csproj index 0b2e2f8..50fba39 100644 --- a/AssetStudioFBXWrapper/AssetStudioFBXWrapper.csproj +++ b/AssetStudioFBXWrapper/AssetStudioFBXWrapper.csproj @@ -1,7 +1,7 @@ - net472;netstandard2.0 + net472;netstandard2.0;net5.0 true 0.16.8.1 0.16.8.1 diff --git a/AssetStudioGUI/AssetStudioGUI.csproj b/AssetStudioGUI/AssetStudioGUI.csproj index 10ee87c..068275e 100644 --- a/AssetStudioGUI/AssetStudioGUI.csproj +++ b/AssetStudioGUI/AssetStudioGUI.csproj @@ -2,7 +2,7 @@ WinExe - net472 + net472;net5.0-windows true Resources\as.ico AssetStudio Mod by VaDiM @@ -57,16 +57,33 @@ - - + + + + Libraries\OpenTK.WinForms.dll + + + + - + + + + + + + + + + + + \ No newline at end of file diff --git a/AssetStudioGUI/AssetStudioGUIForm.Designer.cs b/AssetStudioGUI/AssetStudioGUIForm.Designer.cs index 5b2dc98..fbe39d5 100644 --- a/AssetStudioGUI/AssetStudioGUIForm.Designer.cs +++ b/AssetStudioGUI/AssetStudioGUIForm.Designer.cs @@ -820,20 +820,21 @@ // // FMODtimerLabel // + this.FMODtimerLabel.AutoSize = true; this.FMODtimerLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight; - this.FMODtimerLabel.Location = new System.Drawing.Point(404, 255); + this.FMODtimerLabel.Location = new System.Drawing.Point(457, 253); this.FMODtimerLabel.Name = "FMODtimerLabel"; - this.FMODtimerLabel.Size = new System.Drawing.Size(155, 13); + this.FMODtimerLabel.Size = new System.Drawing.Size(102, 13); this.FMODtimerLabel.TabIndex = 7; - this.FMODtimerLabel.Text = "0:00.0 / 0:00.0"; - this.FMODtimerLabel.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.FMODtimerLabel.Text = "00:00.00 / 00:00.00"; // // FMODstatusLabel // + this.FMODstatusLabel.AutoSize = true; this.FMODstatusLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight; this.FMODstatusLabel.Location = new System.Drawing.Point(213, 255); this.FMODstatusLabel.Name = "FMODstatusLabel"; - this.FMODstatusLabel.Size = new System.Drawing.Size(50, 13); + this.FMODstatusLabel.Size = new System.Drawing.Size(47, 13); this.FMODstatusLabel.TabIndex = 6; this.FMODstatusLabel.Text = "Stopped"; // @@ -1024,7 +1025,7 @@ this.goToSceneHierarchyToolStripMenuItem, this.showOriginalFileToolStripMenuItem}); this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(304, 158); + this.contextMenuStrip1.Size = new System.Drawing.Size(304, 136); // // copyToolStripMenuItem // @@ -1074,8 +1075,6 @@ // AssetStudioGUIForm // this.AllowDrop = true; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1264, 681); this.Controls.Add(this.splitContainer1); this.Controls.Add(this.menuStrip1); diff --git a/AssetStudioGUI/AssetStudioGUIForm.cs b/AssetStudioGUI/AssetStudioGUIForm.cs index a667c48..fe11359 100644 --- a/AssetStudioGUI/AssetStudioGUIForm.cs +++ b/AssetStudioGUI/AssetStudioGUIForm.cs @@ -21,8 +21,14 @@ using static AssetStudioGUI.Studio; using Font = AssetStudio.Font; using ImageFormat = AssetStudio.ImageFormat; using PixelFormat = System.Drawing.Imaging.PixelFormat; +#if NET472 using Vector3 = OpenTK.Vector3; using Vector4 = OpenTK.Vector4; +#else +using Vector3 = OpenTK.Mathematics.Vector3; +using Vector4 = OpenTK.Mathematics.Vector4; +using Matrix4 = OpenTK.Mathematics.Matrix4; +#endif namespace AssetStudioGUI { @@ -944,7 +950,7 @@ namespace AssetStudioGUI if (ERRCHECK(result)) return; FMODinfoLabel.Text = frequency + " Hz"; - FMODtimerLabel.Text = $"0:0.0 / {FMODlenms / 1000 / 60}:{FMODlenms / 1000 % 60}.{FMODlenms / 10 % 100}"; + FMODtimerLabel.Text = $"00:00.00 / {(FMODlenms / 1000 / 60):00}:{(FMODlenms / 1000 % 60):00}.{(FMODlenms / 10 % 100):00}"; } private void PreviewShader(Shader m_Shader) diff --git a/AssetStudioGUI/Libraries/OpenTK.WinForms.dll b/AssetStudioGUI/Libraries/OpenTK.WinForms.dll new file mode 100644 index 0000000..6b12706 Binary files /dev/null and b/AssetStudioGUI/Libraries/OpenTK.WinForms.dll differ diff --git a/AssetStudioGUI/Studio.cs b/AssetStudioGUI/Studio.cs index cf242bc..ab7caae 100644 --- a/AssetStudioGUI/Studio.cs +++ b/AssetStudioGUI/Studio.cs @@ -457,7 +457,7 @@ namespace AssetStudioGUI if (Properties.Settings.Default.openAfterExport && exportedCount > 0) { - Process.Start(savePath); + OpenFolderInExplorer(savePath); } }); } @@ -502,7 +502,7 @@ namespace AssetStudioGUI if (Properties.Settings.Default.openAfterExport && toExportAssets.Count() > 0) { - Process.Start(savePath); + OpenFolderInExplorer(savePath); } }); } @@ -562,7 +562,7 @@ namespace AssetStudioGUI } if (Properties.Settings.Default.openAfterExport) { - Process.Start(savePath); + OpenFolderInExplorer(savePath); } StatusStripUpdate("Finished"); }); @@ -588,7 +588,7 @@ namespace AssetStudioGUI ExportAnimator(animator, exportPath, animationList); if (Properties.Settings.Default.openAfterExport) { - Process.Start(exportPath); + OpenFolderInExplorer(exportPath); } Progress.Report(1, 1); StatusStripUpdate($"Finished exporting {animator.Text}"); @@ -630,7 +630,7 @@ namespace AssetStudioGUI } if (Properties.Settings.Default.openAfterExport) { - Process.Start(exportPath); + OpenFolderInExplorer(exportPath); } } else @@ -660,7 +660,7 @@ namespace AssetStudioGUI } if (Properties.Settings.Default.openAfterExport) { - Process.Start(Path.GetDirectoryName(exportPath)); + OpenFolderInExplorer(Path.GetDirectoryName(exportPath)); } }); } @@ -708,5 +708,12 @@ namespace AssetStudioGUI } return str; } + + public static void OpenFolderInExplorer(string path) + { + var info = new ProcessStartInfo(path); + info.UseShellExecute = true; + Process.Start(info); + } } } diff --git a/AssetStudioUtility/AssetStudioUtility.csproj b/AssetStudioUtility/AssetStudioUtility.csproj index 932e8ea..d6d420d 100644 --- a/AssetStudioUtility/AssetStudioUtility.csproj +++ b/AssetStudioUtility/AssetStudioUtility.csproj @@ -1,7 +1,7 @@ - net472;netstandard2.0 + net472;netstandard2.0;net5.0 0.16.8.1 0.16.8.1 0.16.8.1 diff --git a/Texture2DDecoderWrapper/Texture2DDecoderWrapper.csproj b/Texture2DDecoderWrapper/Texture2DDecoderWrapper.csproj index cae24d6..407e50a 100644 --- a/Texture2DDecoderWrapper/Texture2DDecoderWrapper.csproj +++ b/Texture2DDecoderWrapper/Texture2DDecoderWrapper.csproj @@ -1,7 +1,7 @@ - net472;netstandard2.0 + net472;netstandard2.0;net5.0 true 0.16.8.1 0.16.8.1