diff --git a/CUE4Parse b/CUE4Parse index 7772c6cc..d2f6ce6e 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 7772c6ccf0f6f195876d20d4b5d49fe533fc564e +Subproject commit d2f6ce6e618576dbbe7f6dd9ed3171f14513182a diff --git a/FModel/App.xaml b/FModel/App.xaml index f35316c1..fd1ca58e 100644 --- a/FModel/App.xaml +++ b/FModel/App.xaml @@ -1,4 +1,4 @@ - + + + + + + + + #206BD4 diff --git a/FModel/Constants.cs b/FModel/Constants.cs index bccfa2aa..af4c4a51 100644 --- a/FModel/Constants.cs +++ b/FModel/Constants.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.IO; using System.Numerics; @@ -13,6 +13,7 @@ public static class Constants public static readonly string APP_VERSION = FileVersionInfo.GetVersionInfo(APP_PATH).FileVersion; public static readonly string APP_COMMIT_ID = FileVersionInfo.GetVersionInfo(APP_PATH).ProductVersion?.SubstringAfter('+'); public static readonly string APP_SHORT_COMMIT_ID = APP_COMMIT_ID[..7]; + public static readonly DateTime APP_BUILD_DATE = File.GetLastWriteTime(APP_PATH); public const string ZERO_64_CHAR = "0000000000000000000000000000000000000000000000000000000000000000"; public static readonly FGuid ZERO_GUID = new(0U); diff --git a/FModel/Creator/CreatorPackage.cs b/FModel/Creator/CreatorPackage.cs index a72f265f..b54d6f2f 100644 --- a/FModel/Creator/CreatorPackage.cs +++ b/FModel/Creator/CreatorPackage.cs @@ -33,6 +33,7 @@ public class CreatorPackage : IDisposable [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool TryConstructCreator([MaybeNullWhen(false)] out UCreator creator) { + // TODO: convert to a type based system switch (_exportType) { // Fortnite @@ -51,7 +52,7 @@ public class CreatorPackage : IDisposable case "CosmeticCompanionReactFXItemDefinition": case "AthenaPickaxeItemDefinition": case "AthenaGadgetItemDefinition": - case "AthenaGliderItemDefinition": + case "AthenaGliderItemDefinition": case "AthenaHatItemDefinition": case "AthenaSprayItemDefinition": case "AthenaDanceItemDefinition": diff --git a/FModel/Enums.cs b/FModel/Enums.cs index f59efb9d..0713bd58 100644 --- a/FModel/Enums.cs +++ b/FModel/Enums.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel; +using FModel.Extensions; namespace FModel; @@ -65,16 +66,6 @@ public enum ELoadingMode AllButPatched, } -// public enum EUpdateMode -// { -// [Description("Stable")] -// Stable, -// [Description("Beta")] -// Beta, -// [Description("QA Testing")] -// Qa -// } - public enum ECompressedAudio { [Description("Play the decompressed data")] @@ -117,3 +108,43 @@ public enum EBulkType Animations = 1 << 5, Audio = 1 << 6 } + +public enum EAssetCategory : uint +{ + All = AssetCategoryExtensions.CategoryBase + (0 << 16), + Blueprints = AssetCategoryExtensions.CategoryBase + (1 << 16), + BlueprintGeneratedClass = Blueprints + 1, + WidgetBlueprintGeneratedClass = Blueprints + 2, + AnimBlueprintGeneratedClass = Blueprints + 3, + RigVMBlueprintGeneratedClass = Blueprints + 4, + UserDefinedEnum = Blueprints + 5, + UserDefinedStruct = Blueprints + 6, + //Metadata + Blueprint = Blueprints + 8, + CookedMetaData = Blueprints + 9, + Mesh = AssetCategoryExtensions.CategoryBase + (2 << 16), + StaticMesh = Mesh + 1, + SkeletalMesh = Mesh + 2, + Skeleton = Mesh + 3, + Texture = AssetCategoryExtensions.CategoryBase + (3 << 16), + Materials = AssetCategoryExtensions.CategoryBase + (4 << 16), + Material = Materials + 1, + MaterialEditorData = Materials + 2, + MaterialFunction = Materials + 3, + MaterialParameterCollection = Materials + 4, + Animation = AssetCategoryExtensions.CategoryBase + (5 << 16), + Level = AssetCategoryExtensions.CategoryBase + (6 << 16), + World = Level + 1, + BuildData = Level + 2, + LevelSequence = Level + 3, + Foliage = Level + 4, + Data = AssetCategoryExtensions.CategoryBase + (7 << 16), + ItemDefinitionBase = Data + 1, + CurveBase = Data + 2, + PhysicsAsset = Data + 3, + Media = AssetCategoryExtensions.CategoryBase + (8 << 16), + Audio = Media + 1, + Video = Media + 2, + Font = Media + 3, + Particle = AssetCategoryExtensions.CategoryBase + (9 << 16), +} diff --git a/FModel/Extensions/AssetCategoryExtensions.cs b/FModel/Extensions/AssetCategoryExtensions.cs new file mode 100644 index 00000000..561db386 --- /dev/null +++ b/FModel/Extensions/AssetCategoryExtensions.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace FModel.Extensions; + +public static class AssetCategoryExtensions +{ + public const uint CategoryBase = 0x00010000; + + public static EAssetCategory GetBaseCategory(this EAssetCategory category) + { + return (EAssetCategory) ((uint) category & 0xFFFF0000); + } + + public static bool IsOfCategory(this EAssetCategory item, EAssetCategory category) + { + return item.GetBaseCategory() == category.GetBaseCategory(); + } + + public static bool IsBaseCategory(this EAssetCategory category) + { + return category == category.GetBaseCategory(); + } + + public static IEnumerable GetBaseCategories() + { + return Enum.GetValues().Where(c => c.IsBaseCategory()); + } +} diff --git a/FModel/FModel.csproj b/FModel/FModel.csproj index 552ce20d..4ca717cf 100644 --- a/FModel/FModel.csproj +++ b/FModel/FModel.csproj @@ -168,8 +168,9 @@ - + + diff --git a/FModel/Framework/FakeCUE4Parse.cs b/FModel/Framework/FakeCUE4Parse.cs index 43e53edd..13a88aad 100644 --- a/FModel/Framework/FakeCUE4Parse.cs +++ b/FModel/Framework/FakeCUE4Parse.cs @@ -1,26 +1,22 @@ using System; using CUE4Parse.Compression; using CUE4Parse.FileProvider.Objects; +using CUE4Parse.UE4.Assets.Objects; using CUE4Parse.UE4.Readers; namespace FModel.Framework; -public class FakeGameFile : GameFile +public class FakeGameFile(string path) : GameFile(path, 0) { - public FakeGameFile(string path) : base(path, 0) - { - - } - public override bool IsEncrypted => false; public override CompressionMethod CompressionMethod => CompressionMethod.None; - public override byte[] Read() + public override byte[] Read(FByteBulkDataHeader? header = null) { throw new NotImplementedException(); } - public override FArchive CreateReader() + public override FArchive CreateReader(FByteBulkDataHeader? header = null) { throw new NotImplementedException(); } diff --git a/FModel/Helper.cs b/FModel/Helper.cs index c7a43c50..58d51545 100644 --- a/FModel/Helper.cs +++ b/FModel/Helper.cs @@ -38,7 +38,7 @@ public static class Helper else { var w = GetOpenedWindow(windowName); - if (windowName == "Search View") w.WindowState = WindowState.Normal; + if (windowName == "Search For Packages") w.WindowState = WindowState.Normal; w.Focus(); } } diff --git a/FModel/MainWindow.xaml b/FModel/MainWindow.xaml index f70fc5af..816ed7ff 100644 --- a/FModel/MainWindow.xaml +++ b/FModel/MainWindow.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:FModel" xmlns:controls="clr-namespace:FModel.Views.Resources.Controls" + xmlns:inputs="clr-namespace:FModel.Views.Resources.Controls.Inputs" xmlns:converters="clr-namespace:FModel.Views.Resources.Converters" xmlns:settings="clr-namespace:FModel.Settings" xmlns:services="clr-namespace:FModel.Services" @@ -10,8 +11,18 @@ xmlns:adonisControls="clr-namespace:AdonisUI.Controls;assembly=AdonisUI" xmlns:adonisExtensions="clr-namespace:AdonisUI.Extensions;assembly=AdonisUI" WindowStartupLocation="CenterScreen" Closing="OnClosing" Loaded="OnLoaded" PreviewKeyDown="OnWindowKeyDown" - Height="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenHeight}, Converter={converters:RatioConverter}, ConverterParameter='0.85'}" - Width="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenWidth}, Converter={converters:RatioConverter}, ConverterParameter='0.75'}"> + Height="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenHeight}, Converter={converters:RatioConverter}, ConverterParameter='0.95'}" + Width="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenWidth}, Converter={converters:RatioConverter}, ConverterParameter='0.90'}"> + + + + + + + + + + - - - - - - - - + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + @@ -191,8 +223,8 @@ - + Padding="0" Background="Transparent"> + @@ -257,7 +289,8 @@ - + @@ -315,94 +348,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -437,32 +387,11 @@ Header="{Binding SelectedItem.AssetsList.Assets.Count, FallbackValue=0, ElementName=AssetsFolderName}" HeaderStringFormat="{}{0} Packages"> - - - - - - - - - - - - - - - - - + + @@ -471,217 +400,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -697,15 +424,15 @@ - + - + - + - + - + @@ -720,14 +447,154 @@ Background="{DynamicResource {x:Static adonisUi:Brushes.Layer0BackgroundBrush}}" /> + Padding="0" Background="Transparent"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -740,7 +607,7 @@