Hello everyone ! So here is the problem :
I’m trying to show a list of possible FString for an UProperty of a custom structure
I’ve seen you can use the GetOptions = "FuncName"
meta specifier to obtain that effect which I did successfully outside of a structure. But I’d like to use a static function.
As read on this website All UPROPERTY Specifiers · ben🌱ui :
GetOptions
also supports external static function references viaModule.Class.Function
syntax. If the function name contains a.
, it is assumed to be static and the editor will crash if it is not.
I tried using that technique but that doesn’t work (List is empty on selection of UProperty)
USTRUCT(BlueprintType)
struct PROJECT_S_API FSkills : public FTableRowBase
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (GetOptions = "Project_S.UDBHelper.GetAllDebuffs"))
TArray<FString> names;
};
UCLASS()
class PROJECT_S_API UDBHelper : public UObject {
GENERATED_BODY()
public:
UFUNCTION(CallInEditor, BlueprintCallable, Category = "DBManagement")
static TArray<FString> GetAllDebuffs() {
FString name = FString("wow");
FString name1 = FString("wow2");
FString name2 = FString("wow3");
TArray<FString> names = TArray<FString>();
names.Add(name);
names.Add(name1);
names.Add(name2);
return names;
}
};
The final goal would be to provide a list for an entry in a data table
Thanks a lot !