And just in case anyone interested wants to see the code making the changes and serializing the values, here are the (most pertinent) chunks of the C++
(Note, this is taken from the AActor class, which works as expected. But the code is basically the same in the UWidget/UUserWidget class):
// Header
class TESTIT_API ATestActor : public AActor
{
public:
ATestActor();
UPROPERTY(EditAnywhere, Category="Testing")
FString SomeText;
int32 ANumber = 0;
FString AnotherString = TEXT("Default String Value");
TArray<uint8> AnArray = {1, 2, 3, 4, 5, 6, 7, 8};
virtual void Serialize(FArchive& Ar) override;
#if WITH_EDITOR
public:
UFUNCTION(CallInEditor, Category="Testing")
void Process();
#endif
};
// CPP File
void ATestActor::Serialize(FArchive& Ar)
{
Super::Serialize(Ar);
Ar << ANumber;
Ar << AnotherString;
Ar << AnArray;
}
void ATestActor::Process()
{
Modify();
ANumber = 2345;
AnotherString = TEXT("XXXXXXXXX");
AnArray.Empty();
for (uint8 i = 100; i < 110; ++i)
{
AnArray.Add(i);
}
}