Announcement

Collapse
No announcement yet.

EvaluateCurveTableRow - how does RowName, display list of rows from selected asset ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    EvaluateCurveTableRow - how does RowName, display list of rows from selected asset ?

    So there is this function:

    Code:
    	UFUNCTION(BlueprintCallable, Category = "DataTable", meta = (ExpandEnumAsExecs="OutResult", DataTablePin="CurveTable"))
    	static void EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY, TEnumAsByte<EEvaluateCurveTableResult::Type>& OutResult, float& OutXY);
    And when you plug some asset into CurveTable parameter, magic happens! There is small widget constructed for RowName, which allow you to select row name from selected asset. That's so awesome.

    So I went, to search how it is done, and my only guess would be this:
    Code:
        DECLARE_FUNCTION(execGetDataTableRowFromName)
        {
            P_GET_OBJECT(UDataTable, Table);
            P_GET_PROPERTY(UNameProperty, RowName);
            
            Stack.StepCompiledIn<UStructProperty>(NULL);
            void* OutRowPtr = Stack.MostRecentPropertyAddress;
            
            P_FINISH;
            
    		*(bool*)Result = Generic_GetDataTableRowFromName(Table, RowName, OutRowPtr);
        }
    It's thunk for other function.

    I'm to assume that this code automatically looks for properties named RowName (??), and then it try to display some widget ? It can't be that easy.
    https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.
Working...
X