#pragma once

#include "CoreMinimal.h"
#include "CommonUserWidget.h"
#include "UIPlayerStatus_BonusRow.generated.h"

class UTextBlock;

/**
 *  Linha de um stat derivado (ATK/DEF/HIT/etc.) na janela de Status.
 *  Layout: nome + valor base + (separador + bônus). Sem botão.
 *
 *  Três modos de valor:
 *    - SetValues(base, bonus)              "10 + 2"
 *    - SetRangeValues(min, max, bonus)     "10~15 + 2"   (MATK pre-renewal)
 *    - SetValuesX10(baseX10, bonusX10)     "1.5 + 0.0"   (CRIT armazenado ×10)
 *
 *  Pareada com o WBP UI_PlayerStatus_BonusRow.
 */
UCLASS(Abstract, Blueprintable)
class ZMMO_API UUIPlayerStatus_BonusRow : public UCommonUserWidget
{
	GENERATED_BODY()

public:
	UFUNCTION(BlueprintCallable, Category = "Zeus|Status")
	void SetStatName(FText DisplayName);

	UFUNCTION(BlueprintCallable, Category = "Zeus|Status")
	void SetValues(int32 Base, int32 Bonus);

	UFUNCTION(BlueprintCallable, Category = "Zeus|Status")
	void SetRangeValues(int32 MinBase, int32 MaxBase, int32 Bonus);

	UFUNCTION(BlueprintCallable, Category = "Zeus|Status")
	void SetValuesX10(int32 BaseX10, int32 BonusX10);

protected:
	UPROPERTY(meta = (BindWidgetOptional)) TObjectPtr<UTextBlock> Text_StatName;
	UPROPERTY(meta = (BindWidgetOptional)) TObjectPtr<UTextBlock> Text_BasePart;
	UPROPERTY(meta = (BindWidgetOptional)) TObjectPtr<UTextBlock> Text_SplitOp;
	UPROPERTY(meta = (BindWidgetOptional)) TObjectPtr<UTextBlock> Text_BonusPart;

private:
	void SetBonusVisibility(bool bShow);
};
