Skip to content

Commit 1b5793b

Browse files
committed
release 1.2.2
1 parent fe602d0 commit 1b5793b

4 files changed

Lines changed: 35 additions & 3 deletions

File tree

DataConfig/Source/DataConfigCore/Private/DataConfig/Automation/DcAutomationUtils.cpp

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,34 @@ int DebugGetEnumPropertyIndex(const FDcPropertyDatum& Datum, const FName& Name)
701701
return Enum->GetIndexByValue(Value);
702702
}
703703

704+
double DebugGetRealPropertyValue(const FDcPropertyDatum& Datum, const FName& Name)
705+
{
706+
union {
707+
uint64 _U64Nan;
708+
double _DoubleNan;
709+
} _NaNUnino;
710+
_NaNUnino._U64Nan = 0x7ff8000000000000ull;
711+
const double NaNRet = _NaNUnino._DoubleNan;
712+
check(FMath::IsNaN(NaNRet));
713+
714+
UStruct* Struct = DcPropertyUtils::TryGetStruct(Datum);
715+
if (!Struct)
716+
return NaNRet;
717+
718+
FProperty* Property = PropertyAccessUtil::FindPropertyByName(Name, Struct);
719+
if (!Property)
720+
return NaNRet;
721+
722+
if (FFloatProperty* FloatProperty = CastField<FFloatProperty>(Property))
723+
return FloatProperty->GetPropertyValue(Property->ContainerPtrToValuePtr<void*>(Datum.DataPtr));
724+
else if (FDoubleProperty* DoubleProperty = CastField<FDoubleProperty>(Property))
725+
return DoubleProperty->GetPropertyValue(Property->ContainerPtrToValuePtr<void*>(Datum.DataPtr));
726+
else
727+
return NaNRet;
728+
}
729+
704730
FDcResult DeserializeFrom(FDcReader* Reader, FDcPropertyDatum Datum,
705-
TFunctionRef<void(FDcDeserializeContext&)> Func, EDefaultSetupType SetupType)
731+
TFunctionRef<void(FDcDeserializeContext&)> Func, EDefaultSetupType SetupType)
706732
{
707733
FDcDeserializer Deserializer;
708734
if (SetupType == EDefaultSetupType::SetupJSONHandlers)

DataConfig/Source/DataConfigCore/Public/DataConfig/Automation/DcAutomationUtils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ T DebugGetScalarPropertyValue(const FDcPropertyDatum& Datum, const FName& Name)
7676
}
7777

7878
DATACONFIGCORE_API int DebugGetEnumPropertyIndex(const FDcPropertyDatum& Datum, const FName& Name);
79+
DATACONFIGCORE_API double DebugGetRealPropertyValue(const FDcPropertyDatum& Datum, const FName& Name);
7980

8081
enum class EDefaultSetupType
8182
{
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#pragma once
22

3-
#define DATA_CONFIG_CORE_VERSION "1.2.1"
4-
#define DATA_CONFIG_CORE_VERSION_NUMBER 10201
3+
#define DATA_CONFIG_CORE_VERSION "1.2.2"
4+
#define DATA_CONFIG_CORE_VERSION_NUMBER 10202

Misc/Docs/Source/Changes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## 1.2.2 - 2022-4-5
6+
7+
- Support for [UE 5.0.0](https://docs.unrealengine.com/5.0/en-US/unreal-engine-5-0-release-notes/)
8+
- Add `DebugGetRealPropertyValue` for double BP fields.
9+
510
## 1.2.1 - 2022-2-23
611

712
- Support for [UE5 Preview 1](https://www.unrealengine.com/en-US/blog/unreal-engine-5-is-now-available-in-preview).

0 commit comments

Comments
 (0)