Added ClothingItemInstance and cleanup the project
This commit is contained in:
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,25 +0,0 @@
|
|||||||
// © 2025 Naked People Team. All Rights Reserved.
|
|
||||||
|
|
||||||
|
|
||||||
#include "ClothingItemData.h"
|
|
||||||
#include "../SaveGame/ClothingItemSaveData.h"
|
|
||||||
|
|
||||||
FClothingItemSaveData UClothingItemData::ToSaveData() const
|
|
||||||
{
|
|
||||||
FClothingItemSaveData SaveData;
|
|
||||||
|
|
||||||
SaveData.ClothingItem = Info;
|
|
||||||
|
|
||||||
return SaveData;
|
|
||||||
}
|
|
||||||
|
|
||||||
UClothingItemData* UClothingItemData::CreateFromSaveData(const FClothingItemSaveData& SaveData)
|
|
||||||
{
|
|
||||||
|
|
||||||
UClothingItem* ClothingItem = SaveData.ClothingItem.LoadSynchronous();
|
|
||||||
|
|
||||||
UClothingItemData* ClothingItemData = NewObject<UClothingItemData>();
|
|
||||||
ClothingItemData->Info = ClothingItem;
|
|
||||||
|
|
||||||
return ClothingItemData;
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
// © 2025 Naked People Team. All Rights Reserved.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "ClothingItem.h"
|
|
||||||
#include "ClothingItemData.generated.h"
|
|
||||||
|
|
||||||
struct FClothingItemSaveData;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
UCLASS(EditInlineNew, BlueprintType)
|
|
||||||
class NAKEDDESIRE_API UClothingItemData : public UObject
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
|
|
||||||
public:
|
|
||||||
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
|
|
||||||
UClothingItem* Info = nullptr;
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
|
||||||
FClothingItemSaveData ToSaveData() const;
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
|
||||||
static UClothingItemData* CreateFromSaveData(const FClothingItemSaveData& SaveData);
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "ClothingItemInstance.h"
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "NakedDesire/Items/ItemInstance.h"
|
||||||
|
#include "ClothingItemInstance.generated.h"
|
||||||
|
|
||||||
|
class UClothingItem;
|
||||||
|
|
||||||
|
UCLASS(BlueprintType)
|
||||||
|
class NAKEDDESIRE_API UClothingItemInstance : public UItemInstance
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category = "Clothing Item")
|
||||||
|
float Condition = 1.0f;
|
||||||
|
|
||||||
|
UClothingItem* GetClothingItem() const { return ClothingItem; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
UPROPERTY(BlueprintReadOnly, Category = "Clothing Item")
|
||||||
|
TObjectPtr<UClothingItem> ClothingItem;
|
||||||
|
};
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
// © 2025 Naked People Team. All Rights Reserved.
|
|
||||||
|
|
||||||
|
|
||||||
#include "ClothingList.h"
|
|
||||||
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
// © 2025 Naked People Team. All Rights Reserved.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "Engine/DataAsset.h"
|
|
||||||
#include "ClothingList.generated.h"
|
|
||||||
|
|
||||||
class UClothingItemData;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
UCLASS()
|
|
||||||
class NAKEDDESIRE_API UClothingList : public UPrimaryDataAsset
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
|
|
||||||
public:
|
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Instanced)
|
|
||||||
TArray<UClothingItemData*> ClothingItems;
|
|
||||||
};
|
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "ClothingManager.h"
|
#include "ClothingManager.h"
|
||||||
#include "ClothingItemData.h"
|
#include "ClothingItem.h"
|
||||||
|
#include "ClothingItemInstance.h"
|
||||||
#include "GameFramework/Character.h"
|
#include "GameFramework/Character.h"
|
||||||
#include "NakedDesire/SaveGame/GlobalSaveGameData.h"
|
|
||||||
|
|
||||||
UClothingManager::UClothingManager()
|
UClothingManager::UClothingManager()
|
||||||
{
|
{
|
||||||
@@ -15,7 +15,7 @@ bool UClothingManager::IsBodyTypeExposed(const EPrivateBodyPartType PrivateBodyP
|
|||||||
{
|
{
|
||||||
for (const auto& ClothingSlot : ClothingSlots)
|
for (const auto& ClothingSlot : ClothingSlots)
|
||||||
{
|
{
|
||||||
if (ClothingSlot.ClothingData && ClothingSlot.ClothingData->Info->CoveredBodyParts.Contains(PrivateBodyPartType))
|
if (ClothingSlot.ClothingItemInstance && ClothingSlot.ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(PrivateBodyPartType))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -37,26 +37,26 @@ bool UClothingManager::GetClothingSlotData(const EClothingSlotType ClothingSlotT
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
void UClothingManager::SetClothingSlotItem(const EClothingSlotType ClothingSlotType, UClothingItemData* ClothingItem)
|
void UClothingManager::SetClothingSlotItem(const EClothingSlotType ClothingSlotType, UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
for (FClothingSlotData& ClothingSlot : ClothingSlots)
|
for (FClothingSlotData& ClothingSlot : ClothingSlots)
|
||||||
{
|
{
|
||||||
if (ClothingSlot.ClothingSlotType == ClothingSlotType)
|
if (ClothingSlot.ClothingSlotType == ClothingSlotType)
|
||||||
{
|
{
|
||||||
ClothingSlot.ClothingData = ClothingItem;
|
ClothingSlot.ClothingItemInstance = ClothingItemInstance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray<UClothingItemData*> UClothingManager::GetEquippedClothing()
|
TArray<UClothingItemInstance*> UClothingManager::GetEquippedClothing()
|
||||||
{
|
{
|
||||||
TArray<UClothingItemData*> EquippedClothingItems;
|
TArray<UClothingItemInstance*> EquippedClothingItems;
|
||||||
|
|
||||||
for (FClothingSlotData ClothingSlot : ClothingSlots)
|
for (FClothingSlotData ClothingSlot : ClothingSlots)
|
||||||
{
|
{
|
||||||
if (ClothingSlot.ClothingData)
|
if (ClothingSlot.ClothingItemInstance)
|
||||||
{
|
{
|
||||||
EquippedClothingItems.Add(ClothingSlot.ClothingData);
|
EquippedClothingItems.Add(ClothingSlot.ClothingItemInstance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,110 +65,101 @@ TArray<UClothingItemData*> UClothingManager::GetEquippedClothing()
|
|||||||
|
|
||||||
void UClothingManager::HydrateClothing(UGlobalSaveGameData* SaveGameData)
|
void UClothingManager::HydrateClothing(UGlobalSaveGameData* SaveGameData)
|
||||||
{
|
{
|
||||||
for (const FClothingItemSaveData& ClothingItemSaveData : SaveGameData->PlayerClothing)
|
// for (const FClothingItemSaveData& ClothingItemSaveData : SaveGameData->PlayerClothing)
|
||||||
{
|
// {
|
||||||
UClothingItemData* ClothingItemData = UClothingItemData::CreateFromSaveData(ClothingItemSaveData);
|
// UClothingItemData* ClothingItemData = UClothingItemData::CreateFromSaveData(ClothingItemSaveData);
|
||||||
PutOnClothing(ClothingItemData);
|
// PutOnClothing(ClothingItemData);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
float UClothingManager::GetHeelHeight()
|
float UClothingManager::GetHeelHeight()
|
||||||
{
|
{
|
||||||
if (FClothingSlotData ClothingSlotData; GetClothingSlotData(EClothingSlotType::Shoes, ClothingSlotData))
|
if (FClothingSlotData ClothingSlotData; GetClothingSlotData(EClothingSlotType::Shoes, ClothingSlotData))
|
||||||
{
|
{
|
||||||
if (ClothingSlotData.ClothingData)
|
if (ClothingSlotData.ClothingItemInstance)
|
||||||
{
|
{
|
||||||
return ClothingSlotData.ClothingData->Info->ShoesOffset;
|
return ClothingSlotData.ClothingItemInstance->GetClothingItem()->ShoesOffset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UClothingManager::PutOnClothing(UClothingItemData* ClothingData)
|
void UClothingManager::PutOnClothing(UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
if (!ClothingData)
|
if (!ClothingItemInstance)
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
const EClothingSlotType ClothingSlotType = ClothingData->Info->SlotType;
|
const EClothingSlotType ClothingSlotType = ClothingItemInstance->GetClothingItem()->SlotType;
|
||||||
|
|
||||||
FClothingSlotData ClothingSlotData;
|
FClothingSlotData ClothingSlotData;
|
||||||
GetClothingSlotData(ClothingSlotType, ClothingSlotData);
|
GetClothingSlotData(ClothingSlotType, ClothingSlotData);
|
||||||
|
|
||||||
ClothingSlotData.MeshComponent->SetSkeletalMesh(ClothingData->Info->SkeletalMesh);
|
ClothingSlotData.MeshComponent->SetSkeletalMesh(ClothingItemInstance->GetClothingItem()->SkeletalMesh);
|
||||||
if (!ClothingData->Info->Materials.IsEmpty())
|
if (!ClothingItemInstance->GetClothingItem()->Materials.IsEmpty())
|
||||||
{
|
{
|
||||||
for (const TPair<FName, UMaterialInstance*>& Material : ClothingData->Info->Materials)
|
for (const TPair<FName, UMaterialInstance*>& Material : ClothingItemInstance->GetClothingItem()->Materials)
|
||||||
{
|
{
|
||||||
ClothingSlotData.MeshComponent->SetMaterialByName(Material.Key, Material.Value);
|
ClothingSlotData.MeshComponent->SetMaterialByName(Material.Key, Material.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetClothingSlotItem(ClothingSlotType, ClothingData);
|
SetClothingSlotItem(ClothingSlotType, ClothingItemInstance);
|
||||||
if (ClothingData->Info->UseLeaderPose)
|
if (ClothingItemInstance->GetClothingItem()->UseLeaderPose)
|
||||||
{
|
{
|
||||||
ClothingSlotData.MeshComponent->SetLeaderPoseComponent(Cast<ACharacter>(GetOwner())->GetMesh());
|
ClothingSlotData.MeshComponent->SetLeaderPoseComponent(Cast<ACharacter>(GetOwner())->GetMesh());
|
||||||
}
|
}
|
||||||
|
|
||||||
OnClothingEquip.Broadcast(ClothingData);
|
OnClothingEquip.Broadcast(ClothingItemInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UClothingManager::TakeClothing(UClothingItemData* ClothingData)
|
void UClothingManager::TakeClothing(UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
if (!ClothingData->Info)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
FClothingSlotData ClothingSlotData;
|
FClothingSlotData ClothingSlotData;
|
||||||
GetClothingSlotData(ClothingData->Info->SlotType, ClothingSlotData);
|
GetClothingSlotData(ClothingItemInstance->GetClothingItem()->SlotType, ClothingSlotData);
|
||||||
|
|
||||||
if (ClothingSlotData.ClothingData->Info)
|
if (ClothingSlotData.ClothingItemInstance->GetClothingItem())
|
||||||
{
|
{
|
||||||
DropClothing(ClothingData->Info->SlotType);
|
DropClothing(ClothingItemInstance->GetClothingItem()->SlotType);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClothingSlotData.ClothingData = ClothingData;
|
ClothingSlotData.ClothingItemInstance = ClothingItemInstance;
|
||||||
|
|
||||||
PutOnClothing(ClothingData);
|
PutOnClothing(ClothingItemInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
UClothingItemData* UClothingManager::RemoveClothing(const EClothingSlotType ClothingSlotType)
|
UClothingItemInstance* UClothingManager::RemoveClothing(const EClothingSlotType ClothingSlotType)
|
||||||
{
|
{
|
||||||
FClothingSlotData ClothingSlotData;
|
FClothingSlotData ClothingSlotData;
|
||||||
if (!GetClothingSlotData(ClothingSlotType, ClothingSlotData) || !ClothingSlotData.ClothingData)
|
if (!GetClothingSlotData(ClothingSlotType, ClothingSlotData) || !ClothingSlotData.ClothingItemInstance)
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Error, TEXT("Couldn't find clothing slot"));
|
UE_LOG(LogTemp, Error, TEXT("Couldn't find clothing slot"));
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
UClothingItemData* ClothingData = ClothingSlotData.ClothingData;
|
UClothingItemInstance* ClothingItemInstance = ClothingSlotData.ClothingItemInstance;
|
||||||
SetClothingSlotItem(ClothingSlotType, nullptr);
|
SetClothingSlotItem(ClothingSlotType, nullptr);
|
||||||
|
|
||||||
USkeletalMeshComponent* MeshComponent = ClothingSlotData.MeshComponent;
|
USkeletalMeshComponent* MeshComponent = ClothingSlotData.MeshComponent;
|
||||||
MeshComponent->SetSkeletalMesh(nullptr);
|
MeshComponent->SetSkeletalMesh(nullptr);
|
||||||
|
|
||||||
if (ClothingData->Info->UseLeaderPose)
|
if (ClothingItemInstance->GetClothingItem()->UseLeaderPose)
|
||||||
{
|
{
|
||||||
ClothingSlotData.MeshComponent->SetLeaderPoseComponent(nullptr);
|
ClothingSlotData.MeshComponent->SetLeaderPoseComponent(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
OnClothingUnequip.Broadcast(ClothingData);
|
OnClothingUnequip.Broadcast(ClothingItemInstance);
|
||||||
|
|
||||||
return ClothingData;
|
return ClothingItemInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UClothingManager::DropClothing(const EClothingSlotType ClothingType)
|
void UClothingManager::DropClothing(const EClothingSlotType ClothingType)
|
||||||
{
|
{
|
||||||
const UClothingItemData* ClothingData = RemoveClothing(ClothingType);
|
const UClothingItemInstance* ClothingItemInstance = RemoveClothing(ClothingType);
|
||||||
if (!ClothingData)
|
if (!ClothingItemInstance)
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
OnClothingDropped.Broadcast(ClothingData);
|
OnClothingDropped.Broadcast(ClothingItemInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UClothingManager::IsClothingTypeOn(const EClothingSlotType ClothingType)
|
bool UClothingManager::IsClothingTypeOn(const EClothingSlotType ClothingType)
|
||||||
@@ -176,7 +167,7 @@ bool UClothingManager::IsClothingTypeOn(const EClothingSlotType ClothingType)
|
|||||||
FClothingSlotData ClothingSlotData;
|
FClothingSlotData ClothingSlotData;
|
||||||
GetClothingSlotData(ClothingType, ClothingSlotData);
|
GetClothingSlotData(ClothingType, ClothingSlotData);
|
||||||
|
|
||||||
const bool IsTypeOn = ClothingSlotData.ClothingData != nullptr;
|
const bool IsTypeOn = ClothingSlotData.ClothingItemInstance != nullptr;
|
||||||
return IsTypeOn;
|
return IsTypeOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
|
|
||||||
class UGlobalSaveGameData;
|
class UGlobalSaveGameData;
|
||||||
class AClothingPickup;
|
class AClothingPickup;
|
||||||
class UClothingItemData;
|
class UClothingItemInstance;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnClothingChangeSignature, const UClothingItemData*, ClothingData);
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnClothingChangeSignature, const UClothingItemInstance*, ClothingItemInstance);
|
||||||
|
|
||||||
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
|
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
|
||||||
class NAKEDDESIRE_API UClothingManager : public UActorComponent
|
class NAKEDDESIRE_API UClothingManager : public UActorComponent
|
||||||
@@ -29,9 +29,7 @@ public:
|
|||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, Category = "Clothing Manager|Clothing")
|
UPROPERTY(BlueprintReadWrite, Category = "Clothing Manager|Clothing")
|
||||||
TArray<FClothingSlotData> ClothingSlots;
|
TArray<FClothingSlotData> ClothingSlots;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UPROPERTY(BlueprintAssignable)
|
UPROPERTY(BlueprintAssignable)
|
||||||
FOnClothingChangeSignature OnClothingEquip;
|
FOnClothingChangeSignature OnClothingEquip;
|
||||||
|
|
||||||
@@ -43,7 +41,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void PutOnClothing(UClothingItemData* ClothingData);
|
void PutOnClothing(UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void DropClothing(const EClothingSlotType ClothingType);
|
void DropClothing(const EClothingSlotType ClothingType);
|
||||||
@@ -58,19 +56,19 @@ public:
|
|||||||
bool IsBodyTypeExposed(EPrivateBodyPartType PrivateBodyPartType);
|
bool IsBodyTypeExposed(EPrivateBodyPartType PrivateBodyPartType);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void TakeClothing(UClothingItemData* ClothingData);
|
void TakeClothing(UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
UClothingItemData* RemoveClothing(EClothingSlotType ClothingSlotType);
|
UClothingItemInstance* RemoveClothing(EClothingSlotType ClothingSlotType);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
bool GetClothingSlotData(EClothingSlotType ClothingSlotType, FClothingSlotData& OutClothingSlotData);
|
bool GetClothingSlotData(EClothingSlotType ClothingSlotType, FClothingSlotData& OutClothingSlotData);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetClothingSlotItem(const EClothingSlotType ClothingSlotType, UClothingItemData* ClothingItem);
|
void SetClothingSlotItem(const EClothingSlotType ClothingSlotType, UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
TArray<UClothingItemData*> GetEquippedClothing();
|
TArray<UClothingItemInstance*> GetEquippedClothing();
|
||||||
|
|
||||||
void HydrateClothing(UGlobalSaveGameData* SaveGameData);
|
void HydrateClothing(UGlobalSaveGameData* SaveGameData);
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
#include "ClothingSlotType.h"
|
#include "ClothingSlotType.h"
|
||||||
#include "ClothingSlotData.generated.h"
|
#include "ClothingSlotData.generated.h"
|
||||||
|
|
||||||
|
class UClothingItemInstance;
|
||||||
enum class EClothingSlotType : uint8;
|
enum class EClothingSlotType : uint8;
|
||||||
class UClothingItemData;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -18,26 +18,26 @@ struct NAKEDDESIRE_API FClothingSlotData
|
|||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
FClothingSlotData()
|
FClothingSlotData()
|
||||||
: MeshComponent(nullptr), ClothingSlotType(EClothingSlotType::Anal), ClothingData(nullptr), Name(FText::GetEmpty())
|
: MeshComponent(nullptr), ClothingSlotType(EClothingSlotType::Anal), ClothingItemInstance(nullptr), Name(FText::GetEmpty())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
FClothingSlotData(USkeletalMeshComponent* MeshComponent, const EClothingSlotType ClothingSlotType, UClothingItemData* ClothingData, const FText& Name)
|
FClothingSlotData(USkeletalMeshComponent* MeshComponent, const EClothingSlotType ClothingSlotType, UClothingItemInstance* ClothingItemInstance, const FText& Name)
|
||||||
{
|
{
|
||||||
this->MeshComponent = MeshComponent;
|
this->MeshComponent = MeshComponent;
|
||||||
this->ClothingSlotType = ClothingSlotType;
|
this->ClothingSlotType = ClothingSlotType;
|
||||||
this->ClothingData = ClothingData;
|
this->ClothingItemInstance = ClothingItemInstance;
|
||||||
this->Name = Name;
|
this->Name = Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, Category = "Clothing")
|
UPROPERTY(BlueprintReadWrite, Category = "Clothing")
|
||||||
USkeletalMeshComponent* MeshComponent = nullptr;
|
TObjectPtr<USkeletalMeshComponent> MeshComponent = nullptr;
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, Category = "Clothing")
|
UPROPERTY(BlueprintReadWrite, Category = "Clothing")
|
||||||
EClothingSlotType ClothingSlotType = EClothingSlotType::Anal;
|
EClothingSlotType ClothingSlotType = EClothingSlotType::Anal;
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, Category = "Clothing")
|
UPROPERTY(BlueprintReadWrite, Category = "Clothing")
|
||||||
UClothingItemData* ClothingData = nullptr;
|
TObjectPtr<UClothingItemInstance> ClothingItemInstance = nullptr;
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, Category = "Clothing")
|
UPROPERTY(BlueprintReadWrite, Category = "Clothing")
|
||||||
FText Name = FText::GetEmpty();
|
FText Name = FText::GetEmpty();
|
||||||
|
|||||||
@@ -4,9 +4,6 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
UENUM(BlueprintType)
|
UENUM(BlueprintType)
|
||||||
enum class EClothingSlotType : uint8
|
enum class EClothingSlotType : uint8
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
// © 2025 Naked People Team. All Rights Reserved.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "ClothingSlotWidgetData.generated.h"
|
|
||||||
|
|
||||||
USTRUCT(BlueprintType)
|
|
||||||
struct NAKEDDESIRE_API FClothingSlotWidgetData
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly)
|
|
||||||
UTexture2D* PlaceholderIcon = nullptr;
|
|
||||||
};
|
|
||||||
@@ -3,14 +3,19 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "ClothingSlotWidgetData.h"
|
|
||||||
#include "ClothingSlotType.h"
|
#include "ClothingSlotType.h"
|
||||||
#include "Engine/DataAsset.h"
|
#include "Engine/DataAsset.h"
|
||||||
#include "ClothingSlotWidgetsInfo.generated.h"
|
#include "ClothingSlotWidgetsInfo.generated.h"
|
||||||
|
|
||||||
/**
|
USTRUCT(BlueprintType)
|
||||||
*
|
struct NAKEDDESIRE_API FClothingSlotWidgetData
|
||||||
*/
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly)
|
||||||
|
UTexture2D* PlaceholderIcon = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class NAKEDDESIRE_API UClothingSlotInfo : public UPrimaryDataAsset
|
class NAKEDDESIRE_API UClothingSlotInfo : public UPrimaryDataAsset
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
#include "NakedDesireGameMode.h"
|
#include "NakedDesireGameMode.h"
|
||||||
#include "Kismet/GameplayStatics.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 "UObject/ConstructorHelpers.h"
|
||||||
#include "NakedDesire/Interactables/Wardrobe.h"
|
#include "NakedDesire/Interactables/Wardrobe.h"
|
||||||
#include "NakedDesire/MissionBuilder/MissionsConfig.h"
|
#include "NakedDesire/MissionBuilder/MissionsConfig.h"
|
||||||
@@ -19,7 +20,7 @@ AWardrobe* ANakedDesireGameMode::GetWardrobe() const
|
|||||||
return Wardrobe;
|
return Wardrobe;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ANakedDesireGameMode::BuyItem(UClothingItemData* ClothingItem)
|
void ANakedDesireGameMode::BuyItem(UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
ANakedDesireCharacter* Player = Cast<ANakedDesireCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
|
ANakedDesireCharacter* Player = Cast<ANakedDesireCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
|
||||||
if (!Player)
|
if (!Player)
|
||||||
@@ -27,13 +28,13 @@ void ANakedDesireGameMode::BuyItem(UClothingItemData* ClothingItem)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Player->Money < ClothingItem->Info->BasePrice)
|
if (Player->Money < ClothingItemInstance->GetClothingItem()->BasePrice)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Player->Money -= ClothingItem->Info->BasePrice;
|
Player->Money -= ClothingItemInstance->GetClothingItem()->BasePrice;
|
||||||
Wardrobe->ClothingItems.Add(ClothingItem);
|
Wardrobe->ClothingItems.Add(ClothingItemInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ANakedDesireGameMode::OnHourChanged(int32 Hour)
|
void ANakedDesireGameMode::OnHourChanged(int32 Hour)
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
#include "GameFramework/GameModeBase.h"
|
#include "GameFramework/GameModeBase.h"
|
||||||
#include "NakedDesireGameMode.generated.h"
|
#include "NakedDesireGameMode.generated.h"
|
||||||
|
|
||||||
|
class UClothingItemInstance;
|
||||||
class UMissionsConfig;
|
class UMissionsConfig;
|
||||||
class AWardrobe;
|
class AWardrobe;
|
||||||
class UClothingItemData;
|
|
||||||
|
|
||||||
UCLASS(minimalapi)
|
UCLASS(minimalapi)
|
||||||
class ANakedDesireGameMode : public AGameModeBase
|
class ANakedDesireGameMode : public AGameModeBase
|
||||||
@@ -25,8 +25,6 @@ class ANakedDesireGameMode : public AGameModeBase
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
int NoticeCount = 0;
|
int NoticeCount = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void RestartGame();
|
void RestartGame();
|
||||||
|
|
||||||
@@ -46,7 +44,7 @@ public:
|
|||||||
void EndGameEmbarrassed();
|
void EndGameEmbarrassed();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void BuyItem(UClothingItemData* ClothingItem);
|
void BuyItem(UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void OnHourChanged(int32 Hour);
|
void OnHourChanged(int32 Hour);
|
||||||
|
|||||||
@@ -8,9 +8,6 @@
|
|||||||
|
|
||||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSettingsChanged, class UNakedDesireUserSettings*, Settings);
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSettingsChanged, class UNakedDesireUserSettings*, Settings);
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class NAKEDDESIRE_API UNakedDesireUserSettings : public UGameUserSettings
|
class NAKEDDESIRE_API UNakedDesireUserSettings : public UGameUserSettings
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include "GameFramework/Actor.h"
|
#include "GameFramework/Actor.h"
|
||||||
#include "Wardrobe.generated.h"
|
#include "Wardrobe.generated.h"
|
||||||
|
|
||||||
class UClothingItemData;
|
class UClothingItemInstance;
|
||||||
|
|
||||||
UCLASS(Blueprintable)
|
UCLASS(Blueprintable)
|
||||||
class NAKEDDESIRE_API AWardrobe : public AInteractableBase
|
class NAKEDDESIRE_API AWardrobe : public AInteractableBase
|
||||||
@@ -16,5 +16,5 @@ class NAKEDDESIRE_API AWardrobe : public AInteractableBase
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
|
||||||
TArray<UClothingItemData*> ClothingItems;
|
TArray<TObjectPtr<UClothingItemInstance>> ClothingItems;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "EquipClothingRestriction.h"
|
#include "EquipClothingRestriction.h"
|
||||||
|
|
||||||
#include "NakedDesire/Clothing/ClothingItem.h"
|
#include "NakedDesire/Clothing/ClothingItem.h"
|
||||||
#include "NakedDesire/Clothing/ClothingItemData.h"
|
#include "NakedDesire/Clothing/ClothingItemInstance.h"
|
||||||
#include "NakedDesire/Clothing/ClothingManager.h"
|
#include "NakedDesire/Clothing/ClothingManager.h"
|
||||||
#include "NakedDesire/Player/NakedDesireCharacter.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;
|
}) != nullptr;
|
||||||
if (IsTargetClothing)
|
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;
|
}) != nullptr;
|
||||||
if (IsTargetClothing)
|
if (IsTargetClothing)
|
||||||
{
|
{
|
||||||
@@ -92,14 +91,14 @@ void UEquipClothingRestriction::CheckClothing()
|
|||||||
{
|
{
|
||||||
for (const FClothingSlotData& ClothingSlot : Player->ClothingManager->ClothingSlots)
|
for (const FClothingSlotData& ClothingSlot : Player->ClothingManager->ClothingSlots)
|
||||||
{
|
{
|
||||||
if (!ClothingSlot.ClothingData)
|
if (!ClothingSlot.ClothingItemInstance)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool IsTargetClothing = ClothingItems.FindByPredicate([&ClothingSlot](const UClothingItem* Item)
|
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;
|
}) != nullptr;
|
||||||
if (IsTargetClothing)
|
if (IsTargetClothing)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,11 +6,9 @@
|
|||||||
#include "NakedDesire/MissionBuilder/GoalRestriction.h"
|
#include "NakedDesire/MissionBuilder/GoalRestriction.h"
|
||||||
#include "EquipClothingRestriction.generated.h"
|
#include "EquipClothingRestriction.generated.h"
|
||||||
|
|
||||||
|
class UClothingItemInstance;
|
||||||
class UClothingItem;
|
class UClothingItem;
|
||||||
class UClothingItemData;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
UCLASS(EditInlineNew)
|
UCLASS(EditInlineNew)
|
||||||
class NAKEDDESIRE_API UEquipClothingRestriction : public UGoalRestriction
|
class NAKEDDESIRE_API UEquipClothingRestriction : public UGoalRestriction
|
||||||
{
|
{
|
||||||
@@ -30,10 +28,10 @@ private:
|
|||||||
FDelegateHandle ClothingUnequippedDelegateHandle;
|
FDelegateHandle ClothingUnequippedDelegateHandle;
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnClothingEquipped(const UClothingItemData* ClothingData);
|
void OnClothingEquipped(const UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnClothingUnequipped(const UClothingItemData* ClothingData);
|
void OnClothingUnequipped(const UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
void CheckClothing();
|
void CheckClothing();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
#include "ExposeBodyPartRestriction.h"
|
#include "ExposeBodyPartRestriction.h"
|
||||||
|
|
||||||
#include "NakedDesire/Clothing/ClothingItemData.h"
|
#include "NakedDesire/Clothing/ClothingItem.h"
|
||||||
|
#include "NakedDesire/Clothing/ClothingItemInstance.h"
|
||||||
#include "NakedDesire/Player/NakedDesireCharacter.h"
|
#include "NakedDesire/Player/NakedDesireCharacter.h"
|
||||||
#include "NakedDesire/Clothing/ClothingManager.h"
|
#include "NakedDesire/Clothing/ClothingManager.h"
|
||||||
|
|
||||||
@@ -40,20 +41,18 @@ FText UExposeBodyPartRestriction::GetDescription() const
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void UExposeBodyPartRestriction::EquipClothing(const UClothingItemData* ClothingData)
|
void UExposeBodyPartRestriction::EquipClothing(const UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
if (IsSuccess && ClothingData->Info->CoveredBodyParts.Contains(BodyPart))
|
if (IsSuccess && ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(BodyPart))
|
||||||
{
|
{
|
||||||
Init(Player);
|
Init(Player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UExposeBodyPartRestriction::UnequipClothing(const UClothingItemData* ClothingData)
|
void UExposeBodyPartRestriction::UnequipClothing(const UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
if (IsSuccess)
|
if (IsSuccess)
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
CheckClothing();
|
CheckClothing();
|
||||||
}
|
}
|
||||||
@@ -67,9 +66,9 @@ void UExposeBodyPartRestriction::CheckClothing()
|
|||||||
|
|
||||||
const FClothingSlotData* TargetClothingItem = Player->ClothingManager->ClothingSlots.FindByPredicate([this](const FClothingSlotData& ClothingSlot)
|
const FClothingSlotData* TargetClothingItem = Player->ClothingManager->ClothingSlots.FindByPredicate([this](const FClothingSlotData& ClothingSlot)
|
||||||
{
|
{
|
||||||
if (ClothingSlot.ClothingData)
|
if (ClothingSlot.ClothingItemInstance)
|
||||||
{
|
{
|
||||||
return ClothingSlot.ClothingData->Info->CoveredBodyParts.Contains(BodyPart);
|
return ClothingSlot.ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(BodyPart);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -7,10 +7,8 @@
|
|||||||
#include "NakedDesire/MissionBuilder/GoalRestriction.h"
|
#include "NakedDesire/MissionBuilder/GoalRestriction.h"
|
||||||
#include "ExposeBodyPartRestriction.generated.h"
|
#include "ExposeBodyPartRestriction.generated.h"
|
||||||
|
|
||||||
class UClothingItemData;
|
class UClothingItemInstance;
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
UCLASS(EditInlineNew)
|
UCLASS(EditInlineNew)
|
||||||
class NAKEDDESIRE_API UExposeBodyPartRestriction : public UGoalRestriction
|
class NAKEDDESIRE_API UExposeBodyPartRestriction : public UGoalRestriction
|
||||||
{
|
{
|
||||||
@@ -29,10 +27,10 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void EquipClothing(const UClothingItemData* ClothingData);
|
void EquipClothing(const UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void UnequipClothing(const UClothingItemData* ClothingData);
|
void UnequipClothing(const UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
void CheckClothing();
|
void CheckClothing();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,10 +13,10 @@
|
|||||||
#include "EnhancedInputSubsystems.h"
|
#include "EnhancedInputSubsystems.h"
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
#include "Internationalization/Text.h"
|
#include "Internationalization/Text.h"
|
||||||
#include "NakedDesire/Clothing/ClothingItemData.h"
|
#include "NakedDesire/Clothing/ClothingItem.h"
|
||||||
|
#include "NakedDesire/Clothing/ClothingItemInstance.h"
|
||||||
#include "NakedDesire/Global/Constants.h"
|
#include "NakedDesire/Global/Constants.h"
|
||||||
#include "NakedDesire/Global/NakedDesireUserSettings.h"
|
#include "NakedDesire/Global/NakedDesireUserSettings.h"
|
||||||
#include "NakedDesire/SaveGame/GlobalSaveGameData.h"
|
|
||||||
#include "Perception/AIPerceptionStimuliSourceComponent.h"
|
#include "Perception/AIPerceptionStimuliSourceComponent.h"
|
||||||
#include "Perception/AISense_Sight.h"
|
#include "Perception/AISense_Sight.h"
|
||||||
|
|
||||||
@@ -152,12 +152,12 @@ void ANakedDesireCharacter::BeginPlay()
|
|||||||
StimuliSourceComponent->RegisterForSense(TSubclassOf<UAISense_Sight>());
|
StimuliSourceComponent->RegisterForSense(TSubclassOf<UAISense_Sight>());
|
||||||
StimuliSourceComponent->RegisterWithPerceptionSystem();
|
StimuliSourceComponent->RegisterWithPerceptionSystem();
|
||||||
|
|
||||||
UGlobalSaveGameData* SaveGameData = UGlobalSaveGameData::LoadOrCreateSaveGame(DefaultPlayerClothing, DefaultWardrobeClothing);
|
// UGlobalSaveGameData* SaveGameData = UGlobalSaveGameData::LoadOrCreateSaveGame(DefaultPlayerClothing, DefaultWardrobeClothing);
|
||||||
|
|
||||||
if (SaveGameData)
|
// if (SaveGameData)
|
||||||
{
|
// {
|
||||||
Money = FMath::RoundToInt(SaveGameData->Money);
|
// Money = FMath::RoundToInt(SaveGameData->Money);
|
||||||
}
|
// }
|
||||||
|
|
||||||
SetupClothingSlots();
|
SetupClothingSlots();
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ void ANakedDesireCharacter::BeginPlay()
|
|||||||
|
|
||||||
UNakedDesireUserSettings::GetNakedDesireUserSettings()->OnSettingsChanged.AddUniqueDynamic(this, &ANakedDesireCharacter::OnSettingsChanged);
|
UNakedDesireUserSettings::GetNakedDesireUserSettings()->OnSettingsChanged.AddUniqueDynamic(this, &ANakedDesireCharacter::OnSettingsChanged);
|
||||||
|
|
||||||
ClothingManager->HydrateClothing(SaveGameData);
|
// ClothingManager->HydrateClothing(SaveGameData);
|
||||||
}
|
}
|
||||||
|
|
||||||
UAISense_Sight::EVisibilityResult ANakedDesireCharacter::CanBeSeenFrom(const FCanBeSeenFromContext& Context,
|
UAISense_Sight::EVisibilityResult ANakedDesireCharacter::CanBeSeenFrom(const FCanBeSeenFromContext& Context,
|
||||||
@@ -257,29 +257,27 @@ void ANakedDesireCharacter::OnEndOverlap(UPrimitiveComponent* OverlappedComponen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ANakedDesireCharacter::OnClothingEquip(const UClothingItemData* ClothingItemData)
|
void ANakedDesireCharacter::OnClothingEquip(const UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
if (ClothingItemData->Info->CoveredBodyParts.Contains(EPrivateBodyPartType::BackBottom))
|
if (ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(EPrivateBodyPartType::BackBottom))
|
||||||
{
|
{
|
||||||
BackBottomCensorship->SetVisibility(false);
|
BackBottomCensorship->SetVisibility(false);
|
||||||
}
|
}
|
||||||
if (ClothingItemData->Info->CoveredBodyParts.Contains(EPrivateBodyPartType::FrontBottom))
|
if (ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(EPrivateBodyPartType::FrontBottom))
|
||||||
{
|
{
|
||||||
FrontBottomCensorship->SetVisibility(false);
|
FrontBottomCensorship->SetVisibility(false);
|
||||||
}
|
}
|
||||||
if (ClothingItemData->Info->CoveredBodyParts.Contains(EPrivateBodyPartType::FrontTop))
|
if (ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(EPrivateBodyPartType::FrontTop))
|
||||||
{
|
{
|
||||||
BoobLCensorship->SetVisibility(false);
|
BoobLCensorship->SetVisibility(false);
|
||||||
BoobRCensorship->SetVisibility(false);
|
BoobRCensorship->SetVisibility(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ANakedDesireCharacter::OnClothingUnequip(const UClothingItemData* ClothingItemData)
|
void ANakedDesireCharacter::OnClothingUnequip(const UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
if (!UNakedDesireUserSettings::GetNakedDesireUserSettings()->GetIsCensorshipEnabled() && !IS_DEMO)
|
if (!UNakedDesireUserSettings::GetNakedDesireUserSettings()->GetIsCensorshipEnabled() && !IS_DEMO)
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (ClothingManager->IsBodyTypeExposed(EPrivateBodyPartType::BackBottom))
|
if (ClothingManager->IsBodyTypeExposed(EPrivateBodyPartType::BackBottom))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#include "NakedDesireCharacter.generated.h"
|
#include "NakedDesireCharacter.generated.h"
|
||||||
|
|
||||||
class UAIPerceptionStimuliSourceComponent;
|
class UAIPerceptionStimuliSourceComponent;
|
||||||
class UClothingItemData;
|
|
||||||
class UClothingList;
|
class UClothingList;
|
||||||
struct FClothingSlotData;
|
struct FClothingSlotData;
|
||||||
class UInteractionManager;
|
class UInteractionManager;
|
||||||
@@ -52,12 +51,6 @@ public:
|
|||||||
UInputAction* CrouchAction;
|
UInputAction* CrouchAction;
|
||||||
|
|
||||||
// Clothing
|
// Clothing
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Clothing Manager|Clothing")
|
|
||||||
UClothingList* DefaultPlayerClothing = nullptr;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Clothing Manager|Clothing")
|
|
||||||
UClothingList* DefaultWardrobeClothing = nullptr;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Clothing")
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Clothing")
|
||||||
USkeletalMeshComponent* NipplesMeshComponent;
|
USkeletalMeshComponent* NipplesMeshComponent;
|
||||||
|
|
||||||
@@ -157,13 +150,12 @@ public:
|
|||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
EStance GetStance() const;
|
EStance GetStance() const;
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void Tick(float DeltaTime) override;
|
virtual void Tick(float DeltaTime) override;
|
||||||
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
|
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
|
||||||
virtual void NotifyControllerChanged() override;
|
virtual void NotifyControllerChanged() override;
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
virtual UAISense_Sight::EVisibilityResult CanBeSeenFrom(const FCanBeSeenFromContext& Context, FVector& OutSeenLocation, int32& OutNumberOfLoSChecksPerformed, int32& OutNumberOfAsyncLosCheckRequested, float& OutSightStrength, int32* UserData = nullptr, const FOnPendingVisibilityQueryProcessedDelegate* Delegate = nullptr) override;
|
virtual UAISense_Sight::EVisibilityResult CanBeSeenFrom(const FCanBeSeenFromContext& Context, FVector& OutSeenLocation, int32& OutNumberOfLoSChecksPerformed, int32& OutNumberOfAsyncLosCheckRequested, float& OutSightStrength, int32* UserData = nullptr, const FOnPendingVisibilityQueryProcessedDelegate* Delegate = nullptr) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EGait Gait = EGait::Walk;
|
EGait Gait = EGait::Walk;
|
||||||
EStance Stance = EStance::Stand;
|
EStance Stance = EStance::Stand;
|
||||||
@@ -177,10 +169,10 @@ private:
|
|||||||
int32 OtherBodyIndex);
|
int32 OtherBodyIndex);
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnClothingEquip(const UClothingItemData* ClothingItemData);
|
void OnClothingEquip(const UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnClothingUnequip(const UClothingItemData* ClothingItemData);
|
void OnClothingUnequip(const UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnSettingsChanged(UNakedDesireUserSettings* Settings);
|
void OnSettingsChanged(UNakedDesireUserSettings* Settings);
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
#include "PlayerCinematic.h"
|
||||||
|
|
||||||
|
|
||||||
#include "PlayerCinematic.h"
|
|
||||||
|
|
||||||
#include "NakedDesireCharacter.h"
|
#include "NakedDesireCharacter.h"
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
#include "NakedDesire/Clothing/ClothingItemData.h"
|
#include "NakedDesire/Clothing/ClothingItem.h"
|
||||||
|
#include "NakedDesire/Clothing/ClothingItemInstance.h"
|
||||||
#include "NakedDesire/Clothing/ClothingManager.h"
|
#include "NakedDesire/Clothing/ClothingManager.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -57,20 +54,20 @@ void APlayerCinematic::BeginPlay()
|
|||||||
Player->ClothingManager->OnClothingEquip.AddUniqueDynamic(this, &APlayerCinematic::OnClothingEquip);
|
Player->ClothingManager->OnClothingEquip.AddUniqueDynamic(this, &APlayerCinematic::OnClothingEquip);
|
||||||
Player->ClothingManager->OnClothingUnequip.AddUniqueDynamic(this, &APlayerCinematic::OnClothingUnequip);
|
Player->ClothingManager->OnClothingUnequip.AddUniqueDynamic(this, &APlayerCinematic::OnClothingUnequip);
|
||||||
|
|
||||||
for (const UClothingItemData* ClothingItemData : Player->ClothingManager->GetEquippedClothing())
|
for (const UClothingItemInstance* ClothingItemInstance : Player->ClothingManager->GetEquippedClothing())
|
||||||
{
|
{
|
||||||
EquipClothing(ClothingItemData);
|
EquipClothing(ClothingItemInstance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerCinematic::OnClothingEquip(const UClothingItemData* ClothingData)
|
void APlayerCinematic::OnClothingEquip(const UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
EquipClothing(ClothingData);
|
EquipClothing(ClothingItemInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerCinematic::OnClothingUnequip(const UClothingItemData* ClothingData)
|
void APlayerCinematic::OnClothingUnequip(const UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
UnequipClothing(ClothingData);
|
UnequipClothing(ClothingItemInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
USkeletalMeshComponent* APlayerCinematic::GetMeshByType(const EClothingSlotType SlotType) const
|
USkeletalMeshComponent* APlayerCinematic::GetMeshByType(const EClothingSlotType SlotType) const
|
||||||
@@ -110,27 +107,27 @@ USkeletalMeshComponent* APlayerCinematic::GetMeshByType(const EClothingSlotType
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerCinematic::EquipClothing(const UClothingItemData* ClothingData)
|
void APlayerCinematic::EquipClothing(const UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
USkeletalMeshComponent* MeshComponent = GetMeshByType(ClothingData->Info->SlotType);
|
USkeletalMeshComponent* MeshComponent = GetMeshByType(ClothingItemInstance->GetClothingItem()->SlotType);
|
||||||
MeshComponent->SetSkeletalMesh(ClothingData->Info->SkeletalMesh);
|
MeshComponent->SetSkeletalMesh(ClothingItemInstance->GetClothingItem()->SkeletalMesh);
|
||||||
if (ClothingData->Info->UseLeaderPose)
|
if (ClothingItemInstance->GetClothingItem()->UseLeaderPose)
|
||||||
{
|
{
|
||||||
MeshComponent->SetLeaderPoseComponent(GetMesh());
|
MeshComponent->SetLeaderPoseComponent(GetMesh());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ClothingData->Info->Materials.IsEmpty())
|
if (!ClothingItemInstance->GetClothingItem()->Materials.IsEmpty())
|
||||||
{
|
{
|
||||||
for (const TPair<FName, UMaterialInstance*>& Material : ClothingData->Info->Materials)
|
for (const TPair<FName, UMaterialInstance*>& Material : ClothingItemInstance->GetClothingItem()->Materials)
|
||||||
{
|
{
|
||||||
MeshComponent->SetMaterialByName(Material.Key, Material.Value);
|
MeshComponent->SetMaterialByName(Material.Key, Material.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerCinematic::UnequipClothing(const UClothingItemData* ClothingData)
|
void APlayerCinematic::UnequipClothing(const UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
USkeletalMeshComponent* MeshComponent = GetMeshByType(ClothingData->Info->SlotType);
|
USkeletalMeshComponent* MeshComponent = GetMeshByType(ClothingItemInstance->GetClothingItem()->SlotType);
|
||||||
MeshComponent->SetSkeletalMesh(nullptr);
|
MeshComponent->SetSkeletalMesh(nullptr);
|
||||||
MeshComponent->SetLeaderPoseComponent(nullptr);
|
MeshComponent->SetLeaderPoseComponent(nullptr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
#pragma once
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "GameFramework/Character.h"
|
#include "GameFramework/Character.h"
|
||||||
#include "NakedDesire/Clothing/ClothingSlotType.h"
|
#include "NakedDesire/Clothing/ClothingSlotType.h"
|
||||||
#include "PlayerCinematic.generated.h"
|
#include "PlayerCinematic.generated.h"
|
||||||
|
|
||||||
class UClothingItemData;
|
class UClothingItemInstance;
|
||||||
class ANakedDesireCharacter;
|
class ANakedDesireCharacter;
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
@@ -68,12 +66,12 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnClothingEquip(const UClothingItemData* ClothingData);
|
void OnClothingEquip(const UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnClothingUnequip(const UClothingItemData* ClothingData);
|
void OnClothingUnequip(const UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
USkeletalMeshComponent* GetMeshByType(const EClothingSlotType SlotType) const;
|
USkeletalMeshComponent* GetMeshByType(const EClothingSlotType SlotType) const;
|
||||||
void EquipClothing(const UClothingItemData* ClothingData);
|
void EquipClothing(const UClothingItemInstance* ClothingItemInstance);
|
||||||
void UnequipClothing(const UClothingItemData* ClothingData);
|
void UnequipClothing(const UClothingItemInstance* ClothingItemInstance);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
#include "PlayerImpostor.h"
|
||||||
|
|
||||||
|
|
||||||
#include "PlayerImpostor.h"
|
|
||||||
|
|
||||||
#include "NakedDesireCharacter.h"
|
#include "NakedDesireCharacter.h"
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
|
#include "NakedDesire/Clothing/ClothingItem.h"
|
||||||
|
#include "NakedDesire/Clothing/ClothingItemInstance.h"
|
||||||
#include "NakedDesire/Clothing/ClothingManager.h"
|
#include "NakedDesire/Clothing/ClothingManager.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -48,14 +46,14 @@ APlayerImpostor::APlayerImpostor()
|
|||||||
ShoesMeshComponent->SetupAttachment(GetMesh());
|
ShoesMeshComponent->SetupAttachment(GetMesh());
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerImpostor::OnClothingEquip(const UClothingItemData* ClothingData)
|
void APlayerImpostor::OnClothingEquip(const UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
EquipClothing(ClothingData);
|
EquipClothing(ClothingItemInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerImpostor::OnClothingUnequip(const UClothingItemData* ClothingData)
|
void APlayerImpostor::OnClothingUnequip(const UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
UnequipClothing(ClothingData);
|
UnequipClothing(ClothingItemInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerImpostor::BeginPlay()
|
void APlayerImpostor::BeginPlay()
|
||||||
@@ -71,9 +69,9 @@ void APlayerImpostor::BeginPlay()
|
|||||||
Player->ClothingManager->OnClothingEquip.AddUniqueDynamic(this, &APlayerImpostor::OnClothingEquip);
|
Player->ClothingManager->OnClothingEquip.AddUniqueDynamic(this, &APlayerImpostor::OnClothingEquip);
|
||||||
Player->ClothingManager->OnClothingUnequip.AddUniqueDynamic(this, &APlayerImpostor::OnClothingUnequip);
|
Player->ClothingManager->OnClothingUnequip.AddUniqueDynamic(this, &APlayerImpostor::OnClothingUnequip);
|
||||||
|
|
||||||
for (const UClothingItemData* ClothingItemData : Player->ClothingManager->GetEquippedClothing())
|
for (const UClothingItemInstance* ClothingItemInstance : Player->ClothingManager->GetEquippedClothing())
|
||||||
{
|
{
|
||||||
EquipClothing(ClothingItemData);
|
EquipClothing(ClothingItemInstance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,27 +112,27 @@ USkeletalMeshComponent* APlayerImpostor::GetMeshByType(const EClothingSlotType S
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerImpostor::EquipClothing(const UClothingItemData* ClothingData)
|
void APlayerImpostor::EquipClothing(const UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
USkeletalMeshComponent* MeshComponent = GetMeshByType(ClothingData->Info->SlotType);
|
USkeletalMeshComponent* MeshComponent = GetMeshByType(ClothingItemInstance->GetClothingItem()->SlotType);
|
||||||
MeshComponent->SetSkeletalMesh(ClothingData->Info->SkeletalMesh);
|
MeshComponent->SetSkeletalMesh(ClothingItemInstance->GetClothingItem()->SkeletalMesh);
|
||||||
if (ClothingData->Info->UseLeaderPose)
|
if (ClothingItemInstance->GetClothingItem()->UseLeaderPose)
|
||||||
{
|
{
|
||||||
MeshComponent->SetLeaderPoseComponent(GetMesh());
|
MeshComponent->SetLeaderPoseComponent(GetMesh());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ClothingData->Info->Materials.IsEmpty())
|
if (!ClothingItemInstance->GetClothingItem()->Materials.IsEmpty())
|
||||||
{
|
{
|
||||||
for (const TPair<FName, UMaterialInstance*>& Material : ClothingData->Info->Materials)
|
for (const TPair<FName, UMaterialInstance*>& Material : ClothingItemInstance->GetClothingItem()->Materials)
|
||||||
{
|
{
|
||||||
MeshComponent->SetMaterialByName(Material.Key, Material.Value);
|
MeshComponent->SetMaterialByName(Material.Key, Material.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerImpostor::UnequipClothing(const UClothingItemData* ClothingData)
|
void APlayerImpostor::UnequipClothing(const UClothingItemInstance* ClothingItemInstance)
|
||||||
{
|
{
|
||||||
USkeletalMeshComponent* MeshComponent = GetMeshByType(ClothingData->Info->SlotType);
|
USkeletalMeshComponent* MeshComponent = GetMeshByType(ClothingItemInstance->GetClothingItem()->SlotType);
|
||||||
MeshComponent->SetSkeletalMesh(nullptr);
|
MeshComponent->SetSkeletalMesh(nullptr);
|
||||||
MeshComponent->SetLeaderPoseComponent(nullptr);
|
MeshComponent->SetLeaderPoseComponent(nullptr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
#pragma once
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "GameFramework/Actor.h"
|
#include "GameFramework/Actor.h"
|
||||||
#include "NakedDesire/Clothing/ClothingItemData.h"
|
|
||||||
#include "NakedDesire/Clothing/ClothingSlotType.h"
|
#include "NakedDesire/Clothing/ClothingSlotType.h"
|
||||||
#include "PlayerImpostor.generated.h"
|
#include "PlayerImpostor.generated.h"
|
||||||
|
|
||||||
|
class UClothingItemInstance;
|
||||||
class ANakedDesireCharacter;
|
class ANakedDesireCharacter;
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
@@ -69,18 +67,17 @@ class NAKEDDESIRE_API APlayerImpostor : public APawn
|
|||||||
public:
|
public:
|
||||||
APlayerImpostor();
|
APlayerImpostor();
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnClothingEquip(const UClothingItemData* ClothingData);
|
void OnClothingEquip(const UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnClothingUnequip(const UClothingItemData* ClothingData);
|
void OnClothingUnequip(const UClothingItemInstance* ClothingItemInstance);
|
||||||
|
|
||||||
USkeletalMeshComponent* GetMesh() const { return Mesh; };
|
USkeletalMeshComponent* GetMesh() const { return Mesh; };
|
||||||
USkeletalMeshComponent* GetMeshByType(const EClothingSlotType SlotType) const;
|
USkeletalMeshComponent* GetMeshByType(const EClothingSlotType SlotType) const;
|
||||||
void EquipClothing(const UClothingItemData* ClothingData);
|
void EquipClothing(const UClothingItemInstance* ClothingItemInstance);
|
||||||
void UnequipClothing(const UClothingItemData* ClothingData);
|
void UnequipClothing(const UClothingItemInstance* ClothingItemInstance);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
// © 2025 Naked People Team. All Rights Reserved.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "UObject/Object.h"
|
|
||||||
#include "ClothingItemSaveData.generated.h"
|
|
||||||
|
|
||||||
class UClothingItem;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
USTRUCT(BlueprintType)
|
|
||||||
struct FClothingItemSaveData
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
|
|
||||||
UPROPERTY()
|
|
||||||
TSoftObjectPtr<UClothingItem> ClothingItem;
|
|
||||||
};
|
|
||||||
@@ -2,13 +2,10 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "GlobalSaveGameData.h"
|
#include "GlobalSaveGameData.h"
|
||||||
|
|
||||||
#include "NakedDesire/Global/Constants.h"
|
#include "NakedDesire/Global/Constants.h"
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
#include "NakedDesire/Clothing/ClothingItemData.h"
|
|
||||||
#include "NakedDesire/Clothing/ClothingList.h"
|
|
||||||
|
|
||||||
UGlobalSaveGameData* UGlobalSaveGameData::CreateNewSaveGame(TArray<UClothingItemData*> CurrentWardrobeClothing, TArray<UClothingItemData*> CurrentPlayerClothing, float InMoney)
|
UGlobalSaveGameData* UGlobalSaveGameData::CreateNewSaveGame()
|
||||||
{
|
{
|
||||||
UGlobalSaveGameData* NewSave = Cast<UGlobalSaveGameData>(
|
UGlobalSaveGameData* NewSave = Cast<UGlobalSaveGameData>(
|
||||||
UGameplayStatics::CreateSaveGameObject(UGlobalSaveGameData::StaticClass())
|
UGameplayStatics::CreateSaveGameObject(UGlobalSaveGameData::StaticClass())
|
||||||
@@ -19,22 +16,22 @@ UGlobalSaveGameData* UGlobalSaveGameData::CreateNewSaveGame(TArray<UClothingItem
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
NewSave->Money = InMoney;
|
// NewSave->Money = InMoney;
|
||||||
|
|
||||||
for (const UClothingItemData* Item : CurrentWardrobeClothing)
|
// for (const UClothingItemData* Item : CurrentWardrobeClothing)
|
||||||
{
|
// {
|
||||||
NewSave->WardrobeClothing.Add(Item->ToSaveData());
|
// NewSave->WardrobeClothing.Add(Item->ToSaveData());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
for (const UClothingItemData* Item : CurrentPlayerClothing)
|
// for (const UClothingItemData* Item : CurrentPlayerClothing)
|
||||||
{
|
// {
|
||||||
NewSave->PlayerClothing.Add(Item->ToSaveData());
|
// NewSave->PlayerClothing.Add(Item->ToSaveData());
|
||||||
}
|
// }
|
||||||
|
|
||||||
return NewSave;
|
return NewSave;
|
||||||
}
|
}
|
||||||
|
|
||||||
UGlobalSaveGameData* UGlobalSaveGameData::LoadOrCreateSaveGame(UClothingList* DefaultPlayerClothing, UClothingList* DefaultWardrobeClothing)
|
UGlobalSaveGameData* UGlobalSaveGameData::LoadOrCreateSaveGame()
|
||||||
{
|
{
|
||||||
if (UGameplayStatics::DoesSaveGameExist(SLOT_NAME, SLOT_PLAYER))
|
if (UGameplayStatics::DoesSaveGameExist(SLOT_NAME, SLOT_PLAYER))
|
||||||
{
|
{
|
||||||
@@ -44,10 +41,10 @@ UGlobalSaveGameData* UGlobalSaveGameData::LoadOrCreateSaveGame(UClothingList* De
|
|||||||
}
|
}
|
||||||
|
|
||||||
UGlobalSaveGameData* NewSave = nullptr;
|
UGlobalSaveGameData* NewSave = nullptr;
|
||||||
if (DefaultWardrobeClothing && DefaultPlayerClothing)
|
// if (DefaultWardrobeClothing && DefaultPlayerClothing)
|
||||||
{
|
// {
|
||||||
NewSave = CreateNewSaveGame(DefaultWardrobeClothing->ClothingItems, DefaultPlayerClothing->ClothingItems, STARTING_MONEY);
|
// NewSave = CreateNewSaveGame(DefaultWardrobeClothing->ClothingItems, DefaultPlayerClothing->ClothingItems, STARTING_MONEY);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (NewSave)
|
if (NewSave)
|
||||||
{
|
{
|
||||||
@@ -57,13 +54,12 @@ UGlobalSaveGameData* UGlobalSaveGameData::LoadOrCreateSaveGame(UClothingList* De
|
|||||||
return NewSave;
|
return NewSave;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UGlobalSaveGameData::SaveGame(const TArray<UClothingItemData*> CurrentWardrobeClothing,
|
bool UGlobalSaveGameData::SaveGame()
|
||||||
const TArray<UClothingItemData*> CurrentPlayerClothing, int32 InMoney)
|
|
||||||
{
|
{
|
||||||
if (UGlobalSaveGameData* Save = CreateNewSaveGame(CurrentWardrobeClothing, CurrentPlayerClothing, (float)InMoney))
|
// if (UGlobalSaveGameData* Save = CreateNewSaveGame(CurrentWardrobeClothing, CurrentPlayerClothing, (float)InMoney))
|
||||||
{
|
// {
|
||||||
return UGameplayStatics::SaveGameToSlot(Save, SLOT_NAME, SLOT_PLAYER);
|
// return UGameplayStatics::SaveGameToSlot(Save, SLOT_NAME, SLOT_PLAYER);
|
||||||
}
|
// }
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "ClothingItemSaveData.h"
|
|
||||||
#include "GameFramework/SaveGame.h"
|
#include "GameFramework/SaveGame.h"
|
||||||
#include "GlobalSaveGameData.generated.h"
|
#include "GlobalSaveGameData.generated.h"
|
||||||
|
|
||||||
class UClothingList;
|
class UClothingList;
|
||||||
class UClothingItemData;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class NAKEDDESIRE_API UGlobalSaveGameData : public USaveGame
|
class NAKEDDESIRE_API UGlobalSaveGameData : public USaveGame
|
||||||
{
|
{
|
||||||
@@ -24,18 +20,12 @@ public:
|
|||||||
UPROPERTY(BlueprintReadWrite, SaveGame)
|
UPROPERTY(BlueprintReadWrite, SaveGame)
|
||||||
float Money = 0;
|
float Money = 0;
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite)
|
|
||||||
TArray<FClothingItemSaveData> WardrobeClothing;
|
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite)
|
|
||||||
TArray<FClothingItemSaveData> PlayerClothing;
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
static UGlobalSaveGameData* LoadOrCreateSaveGame(UClothingList* DefaultPlayerClothing, UClothingList* DefaultWardrobeClothing);
|
static UGlobalSaveGameData* LoadOrCreateSaveGame();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
static bool SaveGame(TArray<UClothingItemData*> CurrentWardrobeClothing, TArray<UClothingItemData*> CurrentPlayerClothing, int32 InMoney);
|
static bool SaveGame();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static UGlobalSaveGameData* CreateNewSaveGame(TArray<UClothingItemData*> CurrentWardrobeClothing, TArray<UClothingItemData*> CurrentPlayerClothing, float InMoney);
|
static UGlobalSaveGameData* CreateNewSaveGame();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user