Hi,
Are there any unreal Headers to quickly test the validation of a variable?
For example:
UPROPERTY(CannotBeNull)
FName NameOfWhatever;
This header would prevent compilation and log an error warning.
Pretty much like what DataValidation does, but without the hassle of having to write functions.
ie of how its currently handled:
EDataValidationResult AActor::IsDataValid(TArray<FText>& ValidationErrors)
{
bool isValid = Super::IsDataValid(ValidationErrors) != EDataValidationResult::Invalid;
if (NameOfWhatever == "") {
ValidationErrors.Add(FText::FromString("Is missing field NameOfWhatever"));
isValid = false;
}
return isValid ? EDataValidationResult::Valid : EDataValidationResult::Invalid;
}
Also: same question but for fields/variables on instanced actors; ie.: actors placed in the level. I dont care if the field is null in the project, but the field cannot be null in the level.
Thanks <3