From c84ecdf34f3ca06845b0cdedb4537ad56347ea97 Mon Sep 17 00:00:00 2001 From: Eliot Date: Sun, 28 Apr 2024 00:46:18 +0200 Subject: [PATCH] Fix UClass and UProperty for Borderlands https://github.com/UE-Explorer/UE-Explorer/issues/55 --- src/Core/Classes/Props/UProperty.cs | 12 ++++++++++++ src/Core/Classes/UClass.cs | 11 ++++++++++- src/UnrealPackage.cs | 9 +++++++-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/Core/Classes/Props/UProperty.cs b/src/Core/Classes/Props/UProperty.cs index c654122d..296e2236 100644 --- a/src/Core/Classes/Props/UProperty.cs +++ b/src/Core/Classes/Props/UProperty.cs @@ -129,6 +129,18 @@ protected override void Deserialize() Record(nameof(PropertyFlags), (PropertyFlagsLO)PropertyFlags); } #endif +#if BORDERLANDS + if (Package.Build == UnrealPackage.GameBuild.BuildName.Borderlands && + _Buffer.LicenseeVersion >= 2) + { + // Disassembled as two ReadObjects, but upon further inspection this HAS to be a FName read instead. + // Always the struct's name for struct properties. + // Always "Messaging" for message like properties. + // Also seen as "Action_SamePropertyName" + var v84 = _Buffer.ReadNameReference(); + Record(nameof(v84), v84); + } +#endif #if XCOM2 if (Package.Build == UnrealPackage.GameBuild.BuildName.XCOM2WotC) { diff --git a/src/Core/Classes/UClass.cs b/src/Core/Classes/UClass.cs index 2bf598dc..a980c031 100644 --- a/src/Core/Classes/UClass.cs +++ b/src/Core/Classes/UClass.cs @@ -330,7 +330,13 @@ protected override void Deserialize() } #endif } - +#if BORDERLANDS + // Back port of version 670? (No version specified). See also above + if (Package.Build == UnrealPackage.GameBuild.BuildName.Borderlands) + { + AutoCollapseCategories = DeserializeGroup("AutoCollapseCategories"); + } +#endif if (_Buffer.Version >= (uint)PackageObjectLegacyVersion.ForceScriptOrderAddedToUClass #if BIOSHOCK // Partially upgraded @@ -386,6 +392,9 @@ protected override void Deserialize() #endif #if TRANSFORMERS && Package.Build != BuildGeneration.HMS +#endif +#if BORDERLANDS + && Package.Build != UnrealPackage.GameBuild.BuildName.Borderlands #endif ) { diff --git a/src/UnrealPackage.cs b/src/UnrealPackage.cs index aafafcfb..c3c407d6 100644 --- a/src/UnrealPackage.cs +++ b/src/UnrealPackage.cs @@ -430,9 +430,14 @@ public enum BuildName MOH, /// - /// 584/058 + /// Borderlands + /// + /// 584/057-058 + /// 594/058 /// - [Build(584, 58)] Borderlands, + [Build(584, 584, 57, 58)] + [Build(594, 58)] + Borderlands, /// /// 584/126