UCommonNumericTextBlock’s CurrentNumericValue (from Common UI Plugin) is BlueprintReadOnly, despite there being a custom setter in the form of SetCurrentValue:
/**
* Numeric text block that provides interpolation, and some type support (numbers, percents, seconds, distance).
*/
UCLASS(BlueprintType)
class COMMONUI_API UCommonNumericTextBlock : public UCommonTextBlock
{
GENERATED_BODY()
public:
[...]
// Sets the current numeric value. NOTE: Cancels any ongoing interpolation!
UFUNCTION(BlueprintCallable, Category = "Numeric Text Block")
void SetCurrentValue(const float NewValue);
[...]
// The current numeric value being formatted for display, potentially being interpolated from. NOTE: The displayed text is very likely not identical to this value, due to formatting.
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Numeric Text Block")
float CurrentNumericValue;
[...]
I believe CurrentNumericValue should logically reference its setter, instead of being labelled read only, probably like so:
// The current numeric value being formatted for display, potentially being interpolated from. NOTE: The displayed text is very likely not identical to this value, due to formatting.
UPROPERTY(EditAnywhere, BlueprintReadWrite, Setter = "SetCurrentValue", BlueprintSetter = "SetCurrentValue", Category = "Numeric Text Block")
float CurrentNumericValue;
It being readonly also leads to problems, like not allowing you to bind the value to a float (using the UMG Viewmodel plugin), which instead results in this error on compilation:
This problem also seems to exist in other parts of the plugin, like UCommonNumericTextBlock.NumericType and UCommonRichTextBlock.bIsScrollingEnabled
In comparison, for example the baseline UTextBlock’s Text is BlueprintReadWrite with a custom setters:
UCLASS(meta=(DisplayName="Text"), MinimalAPI)
class UTextBlock : public UTextLayoutWidget
{
GENERATED_UCLASS_BODY()
public:
UE_DEPRECATED(5.1, "Direct access to Text is deprecated. Please use the getter or setter.")
/** The text to display */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, BlueprintGetter="GetText", BlueprintSetter="SetText", Category="Content", meta = (MultiLine = "true"))
FText Text;
[...]
P.S: With the UMG Viewmodel plugin, while a bit more difficult, one can still functionally bind the value by binding the function that sets it, like so: