Hello.
I have a class AMySettings in c ++ with int32 SomeInt. In the editor I created a child BP_AMySettings , in which I set SomeInt = 15. I also have class FCustomMenu in another module, which is used only to edit the appearance of BP_AMySettings content. I only have a reference to class AMySettings with the default value of SomeInt.
How do I get the SomeInt value from BP_AMySettings to c ++ to class FCustomMenu?
The value must be taken while the editor is running, without starting the game. It is possible that SomeInt will not be changed in BP_AMySettings from the last run and in this case class FCustomMenu should know its value right after the editor is started.
Some code for better understanding:
MyGameSettings.h
UCLASS()
class MYGAME_API AMySettings : public AActor
{
GENERATED_BODY()
public:
int32 SomeInt;
};
CustomMenu.h
class FCustomMenu : public IDetailCustomization
{
public:
static TSharedRef<IDetailCustomization> MakeInstance();
virtual void CustomizeDetails(IDetailLayoutBuilder& DetailBuilder) override;
private:
int32 SomeIntFromBP;
};
CustomMenu.cpp
void FCustomMenu ::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)
{
SomeIntFromBP = (here I want value from BP_AMySettings not from AMySettings )
}