(Feat) Add Craft Systeme

This commit is contained in:
2026-07-30 23:08:33 +02:00
parent 9b5ad7c8a4
commit 3f3ae1f5fa
57 changed files with 2276 additions and 127 deletions
@@ -0,0 +1,41 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "CraftingIngredientRowWidget.h"
#include "Components/Image.h"
#include "Components/TextBlock.h"
#include "ItemDataAsset.h"
void UCraftingIngredientRowWidget::SetIngredient(const FCraftIngredientStatus& Status)
{
if (IngredientIcon)
{
UTexture2D* Icon = Status.Item ? Status.Item->Icon : nullptr;
if (Icon)
{
IngredientIcon->SetBrushFromTexture(Icon);
IngredientIcon->SetVisibility(ESlateVisibility::HitTestInvisible);
}
else
{
// Sans ca, un objet sans icone afficherait le carre blanc du brush
// par defaut au milieu de la liste.
IngredientIcon->SetVisibility(ESlateVisibility::Hidden);
}
}
if (IngredientNameText)
{
IngredientNameText->SetText(Status.Item ? Status.Item->DisplayName : FText::GetEmpty());
}
if (IngredientCountText)
{
IngredientCountText->SetText(FText::Format(CountFormat,
FText::AsNumber(Status.OwnedQuantity),
FText::AsNumber(Status.RequiredQuantity)));
IngredientCountText->SetColorAndOpacity(FSlateColor(Status.IsSatisfied() ? EnoughColor : MissingColor));
}
}