Support setting up Options widget content in design view

This commit is contained in:
Steve Streeting 2020-10-26 17:40:02 +00:00
parent 526b2fed1b
commit 7baf07f29b
2 changed files with 4 additions and 1 deletions

View File

@ -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);
}

View File

@ -118,7 +118,9 @@ public:
protected:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Content)
TArray<FText> Options;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Content)
int SelectedIndex;
virtual void SyncButtonProperties(UButton* Button) const;