Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions UAssetAPI/ExportTypes/FunctionExport.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.IO;
using UAssetAPI.UnrealTypes;
using System.Reflection.PortableExecutable;
using UAssetAPI.ExportTypes;
using UAssetAPI.UnrealTypes;

namespace UAssetAPI.ExportTypes
{
Expand All @@ -9,7 +10,11 @@ namespace UAssetAPI.ExportTypes
/// </summary>
public class FunctionExport : StructExport
{
public EFunctionFlags FunctionFlags;
public EFunctionFlags FunctionFlags;
public short RepOffset;
public FPackageIndex EventGraphFunction;
public int EventGraphCallOffset;

public FunctionExport(Export super) : base(super)
{
Asset = super.Asset;
Expand All @@ -30,14 +35,43 @@ public override void Read(AssetBinaryReader reader, int nextStarting)
{
base.Read(reader, nextStarting);
FunctionFlags = (EFunctionFlags)reader.ReadUInt32();
// TODO

if (FunctionFlags.HasFlag(EFunctionFlags.FUNC_Net))
{
RepOffset = reader.ReadInt16();
}
else
{
RepOffset = 0;
}

if (reader.Asset.ObjectVersion >= ObjectVersion.VER_UE4_SERIALIZE_BLUEPRINT_EVENTGRAPH_FASTCALLS_IN_UFUNCTION)
{
EventGraphFunction = new(reader.ReadInt32());
EventGraphCallOffset = reader.ReadInt32();
}
else
{
EventGraphFunction = null;
EventGraphCallOffset = 0;
}
}

public override void Write(AssetBinaryWriter writer)
{
base.Write(writer);
writer.Write((uint)FunctionFlags);
// TODO
}

if (FunctionFlags.HasFlag(EFunctionFlags.FUNC_Net))
{
writer.Write(RepOffset);
}

if (writer.Asset.ObjectVersion >= ObjectVersion.VER_UE4_SERIALIZE_BLUEPRINT_EVENTGRAPH_FASTCALLS_IN_UFUNCTION)
{
writer.Write(EventGraphFunction.Index);
writer.Write(EventGraphCallOffset);
}
}
}
}
2 changes: 1 addition & 1 deletion UAssetAPI/PropertyTypes/Objects/PropertyData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void Initialize(AncestryInfo ancestors, FName dad, FName modulePath = nul

public void SetAsParent(FName dad, FName modulePath = null)
{
if (dad != null) Ancestors.Add(string.IsNullOrEmpty(modulePath?.Value?.Value) ? dad : FName.DefineDummy(null, modulePath.Value.Value + "." + dad.Value.Value));
if (dad?.Value != null) Ancestors.Add(string.IsNullOrEmpty(modulePath?.Value?.Value) ? dad : FName.DefineDummy(null, modulePath.Value.Value + "." + dad.Value.Value));
}
}

Expand Down