Add MVP crafting HUD
This commit is contained in:
@@ -133,6 +133,27 @@ bool UAgrarianCraftingComponent::FindRecipe(FName RecipeId, FAgrarianRecipe& Out
|
||||
return false;
|
||||
}
|
||||
|
||||
void UAgrarianCraftingComponent::GetKnownRecipes(TArray<FAgrarianRecipe>& OutRecipes) const
|
||||
{
|
||||
OutRecipes.Reset();
|
||||
|
||||
for (const UAgrarianRecipeDataAsset* RecipeAsset : KnownRecipeAssets)
|
||||
{
|
||||
if (RecipeAsset && RecipeAsset->Recipe.RecipeId != NAME_None)
|
||||
{
|
||||
OutRecipes.Add(RecipeAsset->Recipe);
|
||||
}
|
||||
}
|
||||
|
||||
for (const FAgrarianRecipe& Recipe : KnownRecipes)
|
||||
{
|
||||
if (Recipe.RecipeId != NAME_None)
|
||||
{
|
||||
OutRecipes.Add(Recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UAgrarianInventoryComponent* UAgrarianCraftingComponent::GetInventory() const
|
||||
{
|
||||
return GetOwner() ? GetOwner()->FindComponentByClass<UAgrarianInventoryComponent>() : nullptr;
|
||||
|
||||
Reference in New Issue
Block a user