diff --git a/Source/StevesUEHelpers/Private/StevesUI/OptionWidgetBase.cpp b/Source/StevesUEHelpers/Private/StevesUI/OptionWidgetBase.cpp index af5152e..7352430 100644 --- a/Source/StevesUEHelpers/Private/StevesUI/OptionWidgetBase.cpp +++ b/Source/StevesUEHelpers/Private/StevesUI/OptionWidgetBase.cpp @@ -16,7 +16,6 @@ void UOptionWidgetBase::NativeConstruct() { GS->OnInputModeChanged.AddDynamic(this, &UOptionWidgetBase::InputModeChanged); UpdateFromInputMode(GS->GetLastInputModeUsed()); - ClearOptions(); } else UE_LOG(LogStevesUI, Error, TEXT("StevesGameSubsystem is missing!")); @@ -44,6 +43,8 @@ void UOptionWidgetBase::NativeConstruct() UE_LOG(LogStevesUI, Error, TEXT("%s should have a GamepadDownImage instance."), *this->GetClass()->GetName()); + // To support option set up in designer + SetSelectedIndex(SelectedIndex); } diff --git a/Source/StevesUEHelpers/Public/StevesUI/OptionWidgetBase.h b/Source/StevesUEHelpers/Public/StevesUI/OptionWidgetBase.h index 0794e1d..2fd51f9 100644 --- a/Source/StevesUEHelpers/Public/StevesUI/OptionWidgetBase.h +++ b/Source/StevesUEHelpers/Public/StevesUI/OptionWidgetBase.h @@ -118,7 +118,9 @@ public: protected: + UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Content) TArray Options; + UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Content) int SelectedIndex; virtual void SyncButtonProperties(UButton* Button) const;