Optimize WB_SelectGoalMenu

This commit is contained in:
martinluckyrobots 2025-04-17 11:49:17 +08:00
parent 38a91fb2e7
commit ced6e40acd
5 changed files with 5 additions and 1 deletions

View File

@ -24,7 +24,8 @@ void USelectGoalUserWidget::NativeConstruct()
{ {
if (AllGoalListData->bIsActive) if (AllGoalListData->bIsActive)
{ {
FString GoalTypeString = UEnum::GetValueAsString<EGoalType>(AllGoalListData->GoalType); UEnum* GoalTypeEnum = StaticEnum<EGoalType>();
FString GoalTypeString = GoalTypeEnum->GetDisplayNameTextByIndex(int(AllGoalListData->GoalType)).ToString();
GetComboBoxString()->AddOption(GoalTypeString); GetComboBoxString()->AddOption(GoalTypeString);
bInitAddOption = true; bInitAddOption = true;
break; break;

View File

@ -14,4 +14,7 @@ class LUCKYWORLDV2_API UPathfindingSelectorUserWidget : public UUserWidget
{ {
GENERATED_BODY() GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
void BPClickSelectObjectBtn();
}; };