Added ClothingItemInstance and cleanup the project

This commit is contained in:
koritsa
2026-05-20 23:26:26 +03:00
parent 1b2d9f9098
commit 8434d11b37
49 changed files with 252 additions and 391 deletions
@@ -2,7 +2,8 @@
#include "NakedDesireGameMode.h"
#include "Kismet/GameplayStatics.h"
#include "NakedDesire/Clothing/ClothingItemData.h"
#include "NakedDesire/Clothing/ClothingItem.h"
#include "NakedDesire/Clothing/ClothingItemInstance.h"
#include "UObject/ConstructorHelpers.h"
#include "NakedDesire/Interactables/Wardrobe.h"
#include "NakedDesire/MissionBuilder/MissionsConfig.h"
@@ -19,7 +20,7 @@ AWardrobe* ANakedDesireGameMode::GetWardrobe() const
return Wardrobe;
}
void ANakedDesireGameMode::BuyItem(UClothingItemData* ClothingItem)
void ANakedDesireGameMode::BuyItem(UClothingItemInstance* ClothingItemInstance)
{
ANakedDesireCharacter* Player = Cast<ANakedDesireCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
if (!Player)
@@ -27,13 +28,13 @@ void ANakedDesireGameMode::BuyItem(UClothingItemData* ClothingItem)
return;
}
if (Player->Money < ClothingItem->Info->BasePrice)
if (Player->Money < ClothingItemInstance->GetClothingItem()->BasePrice)
{
return;
}
Player->Money -= ClothingItem->Info->BasePrice;
Wardrobe->ClothingItems.Add(ClothingItem);
Player->Money -= ClothingItemInstance->GetClothingItem()->BasePrice;
Wardrobe->ClothingItems.Add(ClothingItemInstance);
}
void ANakedDesireGameMode::OnHourChanged(int32 Hour)