Skip to content

Commit

Permalink
Fixed Value not being updated on instanced objects
Browse files Browse the repository at this point in the history
Fixes #5
  • Loading branch information
muit committed Dec 5, 2019
1 parent d31da1e commit 727e6c0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AttributesExtension.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 5,
"VersionName": "1.3b",
"Version": 6,
"VersionName": "1.3c",
"FriendlyName": "Attributes Extension",
"Description": "A lightweight attributes system for Unreal Engine 4",
"MarketplaceURL": "com.epicgames.launcher://ue/marketplace/content/1f0ba37099a14e228a1ce5e4891ed70a",
Expand Down
11 changes: 11 additions & 0 deletions Source/Attributes/Public/FloatAttr.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ struct ATTRIBUTES_API FFloatAttr : public FBaseAttr

bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess);

void PostSerialize(const FArchive& Ar);
void PostScriptConstruct();

FFloatModifiedMCDelegate& GetOnModified() { return OnModified; }
Expand All @@ -71,6 +72,7 @@ struct TStructOpsTypeTraits<FFloatAttr> : public TStructOpsTypeTraitsBase2<FFloa
enum {
WithNetSerializer = true,
WithNetSharedSerialization = true,
WithPostSerialize = true,
WithPostScriptConstruct = true
};
};
Expand All @@ -88,3 +90,12 @@ inline bool FFloatAttr::NetSerialize(FArchive& Ar, UPackageMap* Map, bool& bOutS
bOutSuccess = true;
return true;
}

inline void FFloatAttr::PostSerialize(const FArchive& Ar)
{
// We refresh serialized value for overrided properties or instanced objects
if(Ar.IsLoading())
{
RefreshValue();
}
}
11 changes: 11 additions & 0 deletions Source/Attributes/Public/Int32Attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ struct ATTRIBUTES_API FInt32Attr : public FBaseAttr

bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess);

void PostSerialize(const FArchive& Ar);
void PostScriptConstruct();

FInt32ModifiedMCDelegate& GetOnModified() { return OnModified; }
Expand All @@ -70,6 +71,7 @@ struct TStructOpsTypeTraits<FInt32Attr> : public TStructOpsTypeTraitsBase2<FInt3
enum {
WithNetSerializer = true,
WithNetSharedSerialization = true,
WithPostSerialize = true,
WithPostScriptConstruct = true
};
};
Expand All @@ -87,3 +89,12 @@ inline bool FInt32Attr::NetSerialize(FArchive& Ar, UPackageMap* Map, bool& bOutS
bOutSuccess = true;
return true;
}

inline void FInt32Attr::PostSerialize(const FArchive& Ar)
{
// We refresh serialized value for overrided properties or instanced objects
if(Ar.IsLoading())
{
RefreshValue();
}
}

0 comments on commit 727e6c0

Please sign in to comment.