diff --git a/FModel/MainWindow.xaml b/FModel/MainWindow.xaml index b574a4f2..e46eac51 100644 --- a/FModel/MainWindow.xaml +++ b/FModel/MainWindow.xaml @@ -349,7 +349,7 @@ - + @@ -517,7 +517,7 @@ - + diff --git a/FModel/MainWindow.xaml.cs b/FModel/MainWindow.xaml.cs index 7714cd4e..c267e199 100644 --- a/FModel/MainWindow.xaml.cs +++ b/FModel/MainWindow.xaml.cs @@ -83,9 +83,9 @@ public partial class MainWindow ).ConfigureAwait(false); #if DEBUG - // await _threadWorkerView.Begin(cancellationToken => - // _applicationView.CUE4Parse.Extract(cancellationToken, - // "fortnitegame/Content/Characters/Player/Female/Large/Bodies/F_LRG_BunnyBR/Meshes/F_LRG_BunnyBR.uasset")); + await _threadWorkerView.Begin(cancellationToken => + _applicationView.CUE4Parse.Extract(cancellationToken, + "FortniteGame/Content/Athena/Apollo/Maps/UI/Apollo_Terrain_Minimap.uasset")); // await _threadWorkerView.Begin(cancellationToken => // _applicationView.CUE4Parse.Extract(cancellationToken, // "FortniteGame/Content/Environments/Helios/Props/GlacierHotel/GlacierHotel_Globe_A/Meshes/SM_GlacierHotel_Globe_A.uasset")); diff --git a/FModel/ViewModels/TabControlViewModel.cs b/FModel/ViewModels/TabControlViewModel.cs index 63aed8a9..ac83a10a 100644 --- a/FModel/ViewModels/TabControlViewModel.cs +++ b/FModel/ViewModels/TabControlViewModel.cs @@ -81,6 +81,7 @@ public class TabImage : ViewModel } private SKBitmap _bmp; + public SKBitmap ToSkBitmap() => _bmp; private void ResetImage() => SetImage(_bmp); } @@ -301,7 +302,15 @@ public class TabItem : ViewModel private void SaveImage(TabImage image, bool updateUi) { if (image == null) return; - var fileName = $"{image.ExportName}.png"; + + var ext = UserSettings.Default.TextureExportFormat switch + { + ETextureFormat.Png => ".png", + ETextureFormat.Tga => ".tga", + _ => ".png" + }; + + var fileName = image.ExportName + ext; var path = Path.Combine(UserSettings.Default.TextureDirectory, UserSettings.Default.KeepDirectoryStructure ? Directory : "", fileName!).Replace('\\', '/'); @@ -318,8 +327,10 @@ public class TabItem : ViewModel private void SaveImage(TabImage image, string path) { - using var fs = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read); - fs.Write(image.ImageBuffer, 0, image.ImageBuffer.Length); + var skImage = image.ToSkBitmap(); + + var encodedImage = skImage.Encode(UserSettings.Default.TextureExportFormat, 100); + File.WriteAllBytes(path, encodedImage.ToArray()); } public void SaveProperty(bool updateUi) diff --git a/FModel/Views/SearchView.xaml b/FModel/Views/SearchView.xaml index c038c114..340b2584 100644 --- a/FModel/Views/SearchView.xaml +++ b/FModel/Views/SearchView.xaml @@ -185,7 +185,7 @@ - +