diff --git a/CUE4Parse b/CUE4Parse index 6c4d60ae..fd8613ad 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 6c4d60ae069da87a6b39e7bba2fde2e65db57a1c +Subproject commit fd8613ad06bef127764c05634bf0e49a57786e63 diff --git a/FModel/Creator/Utils.cs b/FModel/Creator/Utils.cs index 3be4a495..5e90fe9e 100644 --- a/FModel/Creator/Utils.cs +++ b/FModel/Creator/Utils.cs @@ -78,18 +78,18 @@ namespace FModel.Creator { while (true) { - if (!TryGetPackageIndexExport(packageIndex, out UExport export)) return null; + if (!TryGetPackageIndexExport(packageIndex, out UObject export)) return null; switch (export) { case UTexture2D texture: return GetBitmap(texture); case UMaterialInstanceConstant material: return GetBitmap(material); - case UObject uObject: + default: { - if (uObject.TryGetValue(out FSoftObjectPath previewImage, "LargePreviewImage", "SmallPreviewImage")) return GetBitmap(previewImage); - if (uObject.TryGetValue(out string largePreview, "LargePreviewImage")) return GetBitmap(largePreview); - if (uObject.TryGetValue(out FPackageIndex smallPreview, "SmallPreviewImage")) + if (export.TryGetValue(out FSoftObjectPath previewImage, "LargePreviewImage", "SmallPreviewImage")) return GetBitmap(previewImage); + if (export.TryGetValue(out string largePreview, "LargePreviewImage")) return GetBitmap(largePreview); + if (export.TryGetValue(out FPackageIndex smallPreview, "SmallPreviewImage")) { packageIndex = smallPreview; continue; @@ -97,8 +97,6 @@ namespace FModel.Creator return null; } - default: - return null; } } } @@ -139,7 +137,7 @@ namespace FModel.Creator return bmp; } - public static bool TryGetPackageIndexExport(FPackageIndex packageIndex, out T export) where T : UExport + public static bool TryGetPackageIndexExport(FPackageIndex packageIndex, out T export) where T : UObject { if (packageIndex.ResolvedObject == null) { @@ -172,19 +170,19 @@ namespace FModel.Creator } // fullpath must be either without any extension or with the export objectname - public static bool TryLoadObject(string fullPath, out T export) where T : UExport + public static bool TryLoadObject(string fullPath, out T export) where T : UObject { return _applicationView.CUE4Parse.Provider.TryLoadObject(fullPath, out export); } - public static IEnumerable LoadExports(string fullPath) + public static IEnumerable LoadExports(string fullPath) { return _applicationView.CUE4Parse.Provider.LoadObjectExports(fullPath); } - public static string GetLocalizedResource(string namespacee, string key, string defaultValue) + public static string GetLocalizedResource(string @namespace, string key, string defaultValue) { - return _applicationView.CUE4Parse.Provider.GetLocalizedString(namespacee, key, defaultValue); + return _applicationView.CUE4Parse.Provider.GetLocalizedString(@namespace, key, defaultValue); } public static string GetFullPath(string partialPath) diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index a160b863..14da3bd8 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -19,7 +19,6 @@ using CUE4Parse.UE4.Assets.Exports.Sound; using CUE4Parse.UE4.Assets.Exports.Texture; using CUE4Parse.UE4.Assets.Exports.Wwise; using CUE4Parse.UE4.Localization; -using CUE4Parse.UE4.Objects.UObject; using CUE4Parse.UE4.Oodle.Objects; using CUE4Parse.UE4.Wwise; using CUE4Parse_Conversion.Materials; @@ -533,7 +532,7 @@ namespace FModel.ViewModels ExportData(fullPath); } - private bool CheckExport(UExport export) // return if this loads an image + private bool CheckExport(UObject export) // return if this loads an image { switch (export) { @@ -574,9 +573,9 @@ namespace FModel.ViewModels return false; } - case UObject uObject: + default: { - using var package = new CreatorPackage(uObject, UserSettings.Default.CosmeticStyle); + using var package = new CreatorPackage(export, UserSettings.Default.CosmeticStyle); if (!package.TryConstructCreator(out var creator)) return false; creator.ParseForInfo(); @@ -584,8 +583,6 @@ namespace FModel.ViewModels return true; } } - - return false; } private void SetImage(SKImage img) diff --git a/README.md b/README.md index ccd46bd9..231c93e3 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,13 @@ To use FModel, you need to have **[.NET 5](https://dotnet.microsoft.com/download - [@GMatrix](https://github.com/GMatrixGames) - [@Tiger](https://github.com/XTigerHyperX) +## Support + [![Donate](https://img.shields.io/badge/Paypal-Donate-00457C.svg?logo=paypal)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EP9SSWG8MW4UC&source=url) + +

This project is supported by:

+

+ + + +

\ No newline at end of file