Added ClothingItemInstance and cleanup the project
This commit is contained in:
@@ -2,9 +2,8 @@
|
||||
|
||||
|
||||
#include "EquipClothingRestriction.h"
|
||||
|
||||
#include "NakedDesire/Clothing/ClothingItem.h"
|
||||
#include "NakedDesire/Clothing/ClothingItemData.h"
|
||||
#include "NakedDesire/Clothing/ClothingItemInstance.h"
|
||||
#include "NakedDesire/Clothing/ClothingManager.h"
|
||||
#include "NakedDesire/Player/NakedDesireCharacter.h"
|
||||
|
||||
@@ -64,11 +63,11 @@ FText UEquipClothingRestriction::GetDescription() const
|
||||
});
|
||||
}
|
||||
|
||||
void UEquipClothingRestriction::OnClothingEquipped(const UClothingItemData* ClothingData)
|
||||
void UEquipClothingRestriction::OnClothingEquipped(const UClothingItemInstance* ClothingItemInstance)
|
||||
{
|
||||
const bool IsTargetClothing = ClothingItems.FindByPredicate([&ClothingData](const UClothingItem* Item)
|
||||
const bool IsTargetClothing = ClothingItems.FindByPredicate([&ClothingItemInstance](const UClothingItem* Item)
|
||||
{
|
||||
return Item && Item->Name.EqualTo(ClothingData->Info->Name);
|
||||
return Item && Item->Name.EqualTo(ClothingItemInstance->GetClothingItem()->Name);
|
||||
}) != nullptr;
|
||||
if (IsTargetClothing)
|
||||
{
|
||||
@@ -76,11 +75,11 @@ void UEquipClothingRestriction::OnClothingEquipped(const UClothingItemData* Clot
|
||||
}
|
||||
}
|
||||
|
||||
void UEquipClothingRestriction::OnClothingUnequipped(const UClothingItemData* ClothingData)
|
||||
void UEquipClothingRestriction::OnClothingUnequipped(const UClothingItemInstance* ClothingItemInstance)
|
||||
{
|
||||
const bool IsTargetClothing = ClothingItems.FindByPredicate([&ClothingData](const UClothingItem* Item)
|
||||
const bool IsTargetClothing = ClothingItems.FindByPredicate([&ClothingItemInstance](const UClothingItem* Item)
|
||||
{
|
||||
return Item && Item->Name.EqualTo(ClothingData->Info->Name);
|
||||
return Item && Item->Name.EqualTo(ClothingItemInstance->GetClothingItem()->Name);
|
||||
}) != nullptr;
|
||||
if (IsTargetClothing)
|
||||
{
|
||||
@@ -92,14 +91,14 @@ void UEquipClothingRestriction::CheckClothing()
|
||||
{
|
||||
for (const FClothingSlotData& ClothingSlot : Player->ClothingManager->ClothingSlots)
|
||||
{
|
||||
if (!ClothingSlot.ClothingData)
|
||||
if (!ClothingSlot.ClothingItemInstance)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const bool IsTargetClothing = ClothingItems.FindByPredicate([&ClothingSlot](const UClothingItem* Item)
|
||||
{
|
||||
return Item && Item->Name.EqualTo(ClothingSlot.ClothingData->Info->Name);
|
||||
return Item && Item->Name.EqualTo(ClothingSlot.ClothingItemInstance->GetClothingItem()->Name);
|
||||
}) != nullptr;
|
||||
if (IsTargetClothing)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user