You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Added support for native FProperty setters and getters.
Setters and getters are native functions called by FProperties when setting property values with *_InContainer functions. Setters and getter function names can be manually specified with Setter = Func and Getter = Func keywords inside of UPROEPRTY macro but they will also be automatically parsed if the name is not explicitly specified if the setter or getter function name matches SetPropertyName and GetPropertyName pattern. The latter behavior can be disabled in UHT's DefaultEngine.ini by setting AutomaticSettersAndGetters=False. ImportText and ExportTextItem functions have been deprecated and should be replaced with *_InContainer or *_Direct variants. #rb Steve.Robb #preflight 6210a377a83e0bcefd03d9e1 #ROBOMERGE-OWNER: marc.audy #ROBOMERGE-AUTHOR: robert.manuszewski #ROBOMERGE-SOURCE: CL 19070318 via CL 19098059 via CL 19104650 via CL 19104661 via CL 19110012 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845) [CL 19147839 by marc audy in ue5-main branch]
This commit is contained in:
@@ -1440,6 +1440,11 @@ public:
|
||||
*/
|
||||
uint8* GetPropertyDefaultAddress() const { return PropertyDefaultAddress; }
|
||||
|
||||
/**
|
||||
* @return The address of the property's owner object.
|
||||
*/
|
||||
uint8* GetPropertyRootAddress() const { return PropertyValueRoot.ValueAddress; }
|
||||
|
||||
private:
|
||||
/**
|
||||
* Determines whether the property bound to this struct exists in the owning object's archetype.
|
||||
@@ -2077,7 +2082,7 @@ FString FPropertyNode::GetDefaultValueAsStringForObject( FPropertyItemValueDataT
|
||||
else
|
||||
{
|
||||
// Port flags will cause enums to display correctly
|
||||
InProperty->ExportTextItem( DefaultValue, ValueTracker.GetPropertyDefaultAddress(), ValueTracker.GetPropertyDefaultAddress(), nullptr, PortFlags, nullptr );
|
||||
InProperty->ExportTextItem_InContainer( DefaultValue, ValueTracker.GetPropertyRootAddress(), ValueTracker.GetPropertyDefaultAddress(), nullptr, PortFlags, nullptr );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3329,15 +3334,15 @@ void FPropertyNode::PropagatePropertyChange( UObject* ModifiedObject, const TCHA
|
||||
// This ensures that shared state keeps the correct value, even if the destination property itself isn't imported (or only partly imported, as is the case with arrays/maps/sets)
|
||||
FString CurrentValue;
|
||||
ComplexProperty->ExportText_Direct(CurrentValue, ModifiedComplexPropAddr, ModifiedComplexPropAddr, ModifiedObject, PPF_None);
|
||||
ComplexProperty->ImportText(*PreviousValue, TempComplexPropAddr, PPF_None, ModifiedObject);
|
||||
ComplexProperty->ImportText_Direct(*PreviousValue, TempComplexPropAddr, ModifiedObject, PPF_None);
|
||||
bShouldImport = ComplexProperty->Identical(DestComplexPropAddr, TempComplexPropAddr, PPF_DeepComparison);
|
||||
ComplexProperty->ImportText(*CurrentValue, TempComplexPropAddr, PPF_None, ModifiedObject);
|
||||
ComplexProperty->ImportText_Direct(*CurrentValue, TempComplexPropAddr, ModifiedObject, PPF_None);
|
||||
}
|
||||
|
||||
// Only import if the value matches the previous value of the property that changed
|
||||
if (bShouldImport)
|
||||
{
|
||||
Prop->ImportText(NewValue, DestSimplePropAddr, PPF_InstanceSubobjects, ActualObjToChange);
|
||||
Prop->ImportText_Direct(NewValue, DestSimplePropAddr, ActualObjToChange, PPF_InstanceSubobjects);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user