Added ClothingItemInstance and cleanup the project
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#include "GameFramework/GameModeBase.h"
|
||||
#include "NakedDesireGameMode.generated.h"
|
||||
|
||||
class UClothingItemInstance;
|
||||
class UMissionsConfig;
|
||||
class AWardrobe;
|
||||
class UClothingItemData;
|
||||
|
||||
UCLASS(minimalapi)
|
||||
class ANakedDesireGameMode : public AGameModeBase
|
||||
@@ -25,8 +25,6 @@ class ANakedDesireGameMode : public AGameModeBase
|
||||
|
||||
public:
|
||||
int NoticeCount = 0;
|
||||
|
||||
|
||||
|
||||
void RestartGame();
|
||||
|
||||
@@ -46,7 +44,7 @@ public:
|
||||
void EndGameEmbarrassed();
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void BuyItem(UClothingItemData* ClothingItem);
|
||||
void BuyItem(UClothingItemInstance* ClothingItemInstance);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void OnHourChanged(int32 Hour);
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSettingsChanged, class UNakedDesireUserSettings*, Settings);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class NAKEDDESIRE_API UNakedDesireUserSettings : public UGameUserSettings
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user