(Feat) Add Animation Fps Charater
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "CraftingRecipeSlotWidget.generated.h"
|
||||
|
||||
class UCraftingRecipeDataAsset;
|
||||
class UCraftingWidget;
|
||||
class UImage;
|
||||
class UTextBlock;
|
||||
|
||||
/**
|
||||
* Une case de la grille de craft : l'icone d'une recette, cliquable.
|
||||
*
|
||||
* Passive comme la case d'inventaire : elle n'interroge jamais le composant de
|
||||
* fabrication, c'est la page parente qui lui pousse son etat. Elle ne gere que
|
||||
* son propre clic, parce que c'est elle qui recoit l'evenement souris.
|
||||
*/
|
||||
UCLASS(Abstract)
|
||||
class EMBERWILD_API UCraftingRecipeSlotWidget : public UUserWidget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
/** Appele une fois a la creation : dit a la case quelle recette elle represente. */
|
||||
void InitSlot(UCraftingRecipeDataAsset* InRecipe, UCraftingWidget* InOwningGrid);
|
||||
|
||||
/** Affiche ou masque le cadre de selection. */
|
||||
UFUNCTION(BlueprintCallable, Category = "Crafting")
|
||||
void SetSelected(bool bSelected);
|
||||
|
||||
/**
|
||||
* Assombrit la case quand les ressources manquent.
|
||||
* La recette reste visible et cliquable : le joueur doit pouvoir consulter
|
||||
* ce qui lui manque, sinon il ne sait pas quoi aller chercher.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Crafting")
|
||||
void SetCraftable(bool bCraftable);
|
||||
|
||||
UCraftingRecipeDataAsset* GetRecipe() const { return Recipe; }
|
||||
|
||||
protected:
|
||||
virtual FReply NativeOnMouseButtonDown(const FGeometry& InGeometry, const FPointerEvent& InMouseEvent) override;
|
||||
|
||||
/** A nommer exactement "RecipeIcon" dans le Widget Blueprint. */
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<UImage> RecipeIcon;
|
||||
|
||||
/** Facultatif : le nom sous l'icone, si tu veux une grille legendee. */
|
||||
UPROPERTY(meta = (BindWidgetOptional))
|
||||
TObjectPtr<UTextBlock> RecipeNameText;
|
||||
|
||||
/** Facultatif : cadre affiche quand la case est selectionnee. */
|
||||
UPROPERTY(meta = (BindWidgetOptional))
|
||||
TObjectPtr<UWidget> SelectionBorder;
|
||||
|
||||
/** Teinte de l'icone quand la recette est realisable. */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Crafting")
|
||||
FLinearColor CraftableTint = FLinearColor::White;
|
||||
|
||||
/** Teinte quand il manque des ressources. */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Crafting")
|
||||
FLinearColor UncraftableTint = FLinearColor(0.3f, 0.3f, 0.3f, 1.f);
|
||||
|
||||
private:
|
||||
UPROPERTY(Transient)
|
||||
TObjectPtr<UCraftingRecipeDataAsset> Recipe;
|
||||
|
||||
/** La page parente, a prevenir du clic. */
|
||||
TWeakObjectPtr<UCraftingWidget> OwningGrid;
|
||||
};
|
||||
Reference in New Issue
Block a user