Clothings lots config rework

This commit is contained in:
2026-05-26 23:24:53 +03:00
parent 878060d7ac
commit 9792ede1e8
25 changed files with 159 additions and 279 deletions
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.
@@ -117,4 +117,7 @@ public:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly) UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
TArray<FClothingRestriction> Restrictions; TArray<FClothingRestriction> Restrictions;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
TArray<EBodyPart> HiddenBodyParts;
}; };
+50 -86
View File
@@ -23,58 +23,40 @@ void UClothingManager::BeginPlay()
HydrateClothing(); HydrateClothing();
} }
bool UClothingManager::IsBodyTypeExposed(const EBodyPart BodyPart) void UClothingManager::SetClothingSlotItem(const EClothingSlotType ClothingSlotType, UClothingItemInstance* ClothingItemInstance)
{ {
for (const auto& ClothingSlot : ClothingSlots) if (ClothingItemInstance)
EquippedClothing.Add(ClothingSlotType, ClothingItemInstance);
else
EquippedClothing.Remove(ClothingSlotType);
}
TArray<UClothingItemInstance*> UClothingManager::GetEquippedClothing() const
{
TArray<TObjectPtr<UClothingItemInstance>> Items;
EquippedClothing.GenerateValueArray(Items);
return Items;
}
UClothingItemInstance* UClothingManager::GetSlotClothing(const EClothingSlotType SlotType)
{
if (EquippedClothing.Contains(SlotType))
return EquippedClothing[SlotType];
return nullptr;
}
bool UClothingManager::IsBodyPartExposed(const EBodyPart BodyPart)
{
for (const auto& [Key, Value] : EquippedClothing)
{ {
if (ClothingSlot.ClothingItemInstance) // TODO: Add covered body part resolution if (Value->GetClothingItem()->HiddenBodyParts.Contains(BodyPart))
{
return false; return false;
}
} }
return true; return true;
} }
bool UClothingManager::GetClothingSlotData(const EClothingSlotType ClothingSlotType, FClothingSlotData& OutClothingSlotData)
{
for (const auto& ClothingSlot : ClothingSlots)
{
if (ClothingSlot.ClothingSlotType == ClothingSlotType)
{
OutClothingSlotData = ClothingSlot;
return true;
}
}
return false;
}
void UClothingManager::SetClothingSlotItem(const EClothingSlotType ClothingSlotType, UClothingItemInstance* ClothingItemInstance)
{
for (FClothingSlotData& ClothingSlot : ClothingSlots)
{
if (ClothingSlot.ClothingSlotType == ClothingSlotType)
{
ClothingSlot.ClothingItemInstance = ClothingItemInstance;
}
}
}
TArray<UClothingItemInstance*> UClothingManager::GetEquippedClothing()
{
TArray<UClothingItemInstance*> EquippedClothingItems;
for (FClothingSlotData ClothingSlot : ClothingSlots)
{
if (ClothingSlot.ClothingItemInstance)
{
EquippedClothingItems.Add(ClothingSlot.ClothingItemInstance);
}
}
return EquippedClothingItems;
}
void UClothingManager::HydrateClothing() void UClothingManager::HydrateClothing()
{ {
USaveSubsystem* SaveSubsystem = UGameplayStatics::GetGameInstance(GetWorld())->GetSubsystem<USaveSubsystem>(); USaveSubsystem* SaveSubsystem = UGameplayStatics::GetGameInstance(GetWorld())->GetSubsystem<USaveSubsystem>();
@@ -87,15 +69,12 @@ void UClothingManager::HydrateClothing()
float UClothingManager::GetHeelHeight() float UClothingManager::GetHeelHeight()
{ {
if (FClothingSlotData ClothingSlotData; GetClothingSlotData(EClothingSlotType::Footwear, ClothingSlotData)) if (!EquippedClothing.Contains(EClothingSlotType::Footwear))
{ return 0;
if (ClothingSlotData.ClothingItemInstance)
{ const UClothingItemInstance* Footwear = EquippedClothing[EClothingSlotType::Footwear];
return ClothingSlotData.ClothingItemInstance->GetClothingItem()->ShoesOffset;
} return Footwear->GetClothingItem()->ShoesOffset;
}
return 0;
} }
USkeletalMeshComponent* UClothingManager::GetMeshComponent(const EClothingSlotType SlotType) const USkeletalMeshComponent* UClothingManager::GetMeshComponent(const EClothingSlotType SlotType) const
@@ -135,9 +114,6 @@ void UClothingManager::PutOnClothing(UClothingItemInstance* ClothingItemInstance
return; return;
const EClothingSlotType ClothingSlotType = ClothingItemInstance->GetClothingItem()->SlotType; const EClothingSlotType ClothingSlotType = ClothingItemInstance->GetClothingItem()->SlotType;
FClothingSlotData ClothingSlotData;
GetClothingSlotData(ClothingSlotType, ClothingSlotData);
USkeletalMeshComponent* MeshComponent = GetMeshComponent(ClothingSlotType); USkeletalMeshComponent* MeshComponent = GetMeshComponent(ClothingSlotType);
MeshComponent->SetSkeletalMesh(ClothingItemInstance->GetClothingItem()->SkeletalMesh); MeshComponent->SetSkeletalMesh(ClothingItemInstance->GetClothingItem()->SkeletalMesh);
@@ -154,8 +130,8 @@ void UClothingManager::PutOnClothing(UClothingItemInstance* ClothingItemInstance
{ {
MeshComponent->SetLeaderPoseComponent(Cast<ACharacter>(GetOwner())->GetMesh()); MeshComponent->SetLeaderPoseComponent(Cast<ACharacter>(GetOwner())->GetMesh());
} }
UClothingItem* ClothingItem = ClothingItemInstance->GetClothingItem(); const UClothingItem* ClothingItem = ClothingItemInstance->GetClothingItem();
if (ClothingItem->SlotType == EClothingSlotType::Bodysuit) if (ClothingItem->SlotType == EClothingSlotType::Bodysuit)
{ {
DropClothing(EClothingSlotType::Top); DropClothing(EClothingSlotType::Top);
@@ -176,15 +152,13 @@ void UClothingManager::PutOnClothing(UClothingItemInstance* ClothingItemInstance
void UClothingManager::TakeClothing(UClothingItemInstance* ClothingItemInstance) void UClothingManager::TakeClothing(UClothingItemInstance* ClothingItemInstance)
{ {
FClothingSlotData ClothingSlotData; const EClothingSlotType SlotType = ClothingItemInstance->GetClothingItem()->SlotType;
GetClothingSlotData(ClothingItemInstance->GetClothingItem()->SlotType, ClothingSlotData); if (const UClothingItemInstance* ExistingClothing = *EquippedClothing.Find(SlotType))
if (ClothingSlotData.ClothingItemInstance->GetClothingItem())
{ {
DropClothing(ClothingItemInstance->GetClothingItem()->SlotType); DropClothing(SlotType);
} }
ClothingSlotData.ClothingItemInstance = ClothingItemInstance; SetClothingSlotItem(SlotType, ClothingItemInstance);
USaveSubsystem* SaveSubsystem = UGameplayStatics::GetGameInstance(GetWorld())->GetSubsystem<USaveSubsystem>(); USaveSubsystem* SaveSubsystem = UGameplayStatics::GetGameInstance(GetWorld())->GetSubsystem<USaveSubsystem>();
FItemSaveRecord ItemSaveRecord; FItemSaveRecord ItemSaveRecord;
@@ -201,33 +175,32 @@ void UClothingManager::TakeClothing(UClothingItemInstance* ClothingItemInstance)
UClothingItemInstance* UClothingManager::RemoveClothing(const EClothingSlotType ClothingSlotType) UClothingItemInstance* UClothingManager::RemoveClothing(const EClothingSlotType ClothingSlotType)
{ {
FClothingSlotData ClothingSlotData; UClothingItemInstance* ExistingItem = *EquippedClothing.Find(ClothingSlotType);
if (!GetClothingSlotData(ClothingSlotType, ClothingSlotData) || !ClothingSlotData.ClothingItemInstance) if (!ExistingItem)
{ {
UE_LOG(LogTemp, Error, TEXT("Couldn't find clothing slot")); UE_LOG(LogTemp, Warning, TEXT("UClothingManager::RemoveClothing No clothing found"));
return nullptr; return nullptr;
} }
UClothingItemInstance* ClothingItemInstance = ClothingSlotData.ClothingItemInstance;
SetClothingSlotItem(ClothingSlotType, nullptr); SetClothingSlotItem(ClothingSlotType, nullptr);
USkeletalMeshComponent* MeshComponent = GetMeshComponent(ClothingSlotType); USkeletalMeshComponent* MeshComponent = GetMeshComponent(ClothingSlotType);
MeshComponent->SetSkeletalMesh(nullptr); MeshComponent->SetSkeletalMesh(nullptr);
if (ClothingItemInstance->GetClothingItem()->UseLeaderPose) if (ExistingItem->GetClothingItem()->UseLeaderPose)
{ {
MeshComponent->SetLeaderPoseComponent(nullptr); MeshComponent->SetLeaderPoseComponent(nullptr);
} }
OnClothingUnequip.Broadcast(ClothingItemInstance); OnClothingUnequip.Broadcast(ExistingItem);
USaveSubsystem* SaveSubsystem = UGameplayStatics::GetGameInstance(GetWorld())->GetSubsystem<USaveSubsystem>(); USaveSubsystem* SaveSubsystem = UGameplayStatics::GetGameInstance(GetWorld())->GetSubsystem<USaveSubsystem>();
SaveSubsystem->GetCurrentSave()->EquippedItems.RemoveAll([ClothingItemInstance](const FItemSaveRecord& Item) SaveSubsystem->GetCurrentSave()->EquippedItems.RemoveAll([ExistingItem](const FItemSaveRecord& Item)
{ {
return Item.InstanceId == ClothingItemInstance->GetInstanceId(); return Item.InstanceId == ExistingItem->GetInstanceId();
}); });
return ClothingItemInstance; return ExistingItem;
} }
void UClothingManager::DropClothing(const EClothingSlotType ClothingType) void UClothingManager::DropClothing(const EClothingSlotType ClothingType)
@@ -246,14 +219,5 @@ void UClothingManager::DropClothing(const EClothingSlotType ClothingType)
bool UClothingManager::IsClothingTypeOn(const EClothingSlotType ClothingType) bool UClothingManager::IsClothingTypeOn(const EClothingSlotType ClothingType)
{ {
FClothingSlotData ClothingSlotData; return EquippedClothing.Contains(ClothingType);
GetClothingSlotData(ClothingType, ClothingSlotData);
const bool IsTypeOn = ClothingSlotData.ClothingItemInstance != nullptr;
return IsTypeOn;
}
bool UClothingManager::IsPartiallyNaked()
{
return IsBodyTypeExposed(EBodyPart::Ass) || IsBodyTypeExposed(EBodyPart::Genitals) || IsBodyTypeExposed(EBodyPart::Boobs);
} }
+7 -27
View File
@@ -4,7 +4,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "BodyPart.h" #include "BodyPart.h"
#include "ClothingSlotData.h" #include "ClothingSlotType.h"
#include "Components/ActorComponent.h" #include "Components/ActorComponent.h"
#include "ClothingManager.generated.h" #include "ClothingManager.generated.h"
@@ -26,9 +26,6 @@ public:
UPROPERTY(BlueprintReadWrite, Category = "Clothing Manager|Clothing") UPROPERTY(BlueprintReadWrite, Category = "Clothing Manager|Clothing")
USkeletalMeshComponent* RootMesh = nullptr; USkeletalMeshComponent* RootMesh = nullptr;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Clothing Manager|Clothing")
TArray<FClothingSlotData> ClothingSlots;
UPROPERTY(BlueprintAssignable) UPROPERTY(BlueprintAssignable)
FOnClothingChangeSignature OnClothingEquip; FOnClothingChangeSignature OnClothingEquip;
@@ -39,35 +36,15 @@ public:
UPROPERTY(BlueprintAssignable) UPROPERTY(BlueprintAssignable)
FOnClothingChangeSignature OnClothingDropped; FOnClothingChangeSignature OnClothingDropped;
UFUNCTION(BlueprintCallable)
void PutOnClothing(UClothingItemInstance* ClothingItemInstance); void PutOnClothing(UClothingItemInstance* ClothingItemInstance);
UFUNCTION(BlueprintCallable)
void DropClothing(const EClothingSlotType ClothingType); void DropClothing(const EClothingSlotType ClothingType);
UFUNCTION(BlueprintCallable)
bool IsClothingTypeOn(const EClothingSlotType ClothingType); bool IsClothingTypeOn(const EClothingSlotType ClothingType);
UFUNCTION(BlueprintCallable)
bool IsPartiallyNaked();
UFUNCTION(BlueprintCallable)
bool IsBodyTypeExposed(EBodyPart BodyPart);
UFUNCTION(BlueprintCallable)
void TakeClothing(UClothingItemInstance* ClothingItemInstance); void TakeClothing(UClothingItemInstance* ClothingItemInstance);
UFUNCTION(BlueprintCallable)
UClothingItemInstance* RemoveClothing(EClothingSlotType ClothingSlotType); UClothingItemInstance* RemoveClothing(EClothingSlotType ClothingSlotType);
UFUNCTION(BlueprintCallable)
bool GetClothingSlotData(EClothingSlotType ClothingSlotType, FClothingSlotData& OutClothingSlotData);
UFUNCTION(BlueprintCallable)
void SetClothingSlotItem(const EClothingSlotType ClothingSlotType, UClothingItemInstance* ClothingItemInstance); void SetClothingSlotItem(const EClothingSlotType ClothingSlotType, UClothingItemInstance* ClothingItemInstance);
TArray<UClothingItemInstance*> GetEquippedClothing() const;
UFUNCTION(BlueprintCallable) UClothingItemInstance* GetSlotClothing(EClothingSlotType SlotType);
TArray<UClothingItemInstance*> GetEquippedClothing(); bool IsBodyPartExposed(EBodyPart BodyPart);
void HydrateClothing(); void HydrateClothing();
@@ -76,4 +53,7 @@ public:
private: private:
USkeletalMeshComponent* GetMeshComponent(EClothingSlotType SlotType) const; USkeletalMeshComponent* GetMeshComponent(EClothingSlotType SlotType) const;
UPROPERTY()
TMap<EClothingSlotType, TObjectPtr<UClothingItemInstance>> EquippedClothing;
}; };
@@ -1,40 +0,0 @@
// © 2025 Naked People Team. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "ClothingSlotType.h"
#include "ClothingSlotData.generated.h"
class UClothingItemInstance;
enum class EClothingSlotType : uint8;
USTRUCT(BlueprintType)
struct NAKEDDESIRE_API FClothingSlotData
{
GENERATED_BODY()
FClothingSlotData()
{
}
FClothingSlotData(const EClothingSlotType ClothingSlotType, const FText& Name, UTexture2D* Icon = nullptr)
{
this->ClothingSlotType = ClothingSlotType;
this->Name = Name;
this->Icon = Icon;
}
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Clothing")
EClothingSlotType ClothingSlotType = EClothingSlotType::Anal;
UPROPERTY(BlueprintReadOnly, Category = "Clothing")
TObjectPtr<UClothingItemInstance> ClothingItemInstance = nullptr;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Clothing")
FText Name = FText::GetEmpty();
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Clothing")
TObjectPtr<UTexture2D> Icon = nullptr;
};
@@ -1,5 +0,0 @@
// © 2025 Naked People Team. All Rights Reserved.
#include "ClothingSlotWidgetsInfo.h"
@@ -1,27 +0,0 @@
// © 2025 Naked People Team. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "ClothingSlotType.h"
#include "Engine/DataAsset.h"
#include "ClothingSlotWidgetsInfo.generated.h"
USTRUCT(BlueprintType)
struct NAKEDDESIRE_API FClothingSlotWidgetData
{
GENERATED_BODY()
UPROPERTY(EditDefaultsOnly)
UTexture2D* PlaceholderIcon = nullptr;
};
UCLASS()
class NAKEDDESIRE_API UClothingSlotInfo : public UPrimaryDataAsset
{
GENERATED_BODY()
public:
UPROPERTY(EditDefaultsOnly)
TMap<EClothingSlotType, FClothingSlotWidgetData> ClothingSlotsData;
};
@@ -17,7 +17,7 @@ struct NAKEDDESIRE_API FClothingSlotData
} }
UPROPERTY(EditDefaultsOnly, Category = "Clothing") UPROPERTY(EditDefaultsOnly, Category = "Clothing")
UTexture2D Icon; TObjectPtr<UTexture2D> Icon;
UPROPERTY(EditDefaultsOnly, Category = "Clothing") UPROPERTY(EditDefaultsOnly, Category = "Clothing")
FText Name; FText Name;
@@ -30,5 +30,5 @@ class NAKEDDESIRE_API UClothingSlotsData : public UPrimaryDataAsset
public: public:
UPROPERTY(EditDefaultsOnly, Category = "Clothing") UPROPERTY(EditDefaultsOnly, Category = "Clothing")
TMap<EClothingSlotType, FClothingSlotData> ClothingSlotsData; TMap<EClothingSlotType, FClothingSlotData> Slots;
}; };
@@ -89,21 +89,21 @@ void UEquipClothingRestriction::OnClothingUnequipped(const UClothingItemInstance
void UEquipClothingRestriction::CheckClothing() void UEquipClothingRestriction::CheckClothing()
{ {
for (const FClothingSlotData& ClothingSlot : Player->ClothingManager->ClothingSlots) // for (const FClothingSlotData& ClothingSlot : Player->ClothingManager->ClothingSlots)
{ // {
if (!ClothingSlot.ClothingItemInstance) // 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.ClothingItemInstance->GetClothingItem()->Name); // return Item && Item->Name.EqualTo(ClothingSlot.ClothingItemInstance->GetClothingItem()->Name);
}) != nullptr; // }) != nullptr;
if (IsTargetClothing) // if (IsTargetClothing)
{ // {
Complete(); // Complete();
return; // return;
} // }
} // }
} }
@@ -74,22 +74,22 @@ void UExposeBodyPartRestriction::UnequipClothing(const UClothingItemInstance* Cl
void UExposeBodyPartRestriction::CheckClothing() void UExposeBodyPartRestriction::CheckClothing()
{ {
if (!Player || !Player->ClothingManager || Player->ClothingManager->ClothingSlots.IsEmpty()) // if (!Player || !Player->ClothingManager || Player->ClothingManager->ClothingSlots.IsEmpty())
{ // {
return; // return;
} // }
//
const FClothingSlotData* TargetClothingItem = Player->ClothingManager->ClothingSlots.FindByPredicate([this](const FClothingSlotData& ClothingSlot) // const FClothingSlotData* TargetClothingItem = Player->ClothingManager->ClothingSlots.FindByPredicate([this](const FClothingSlotData& ClothingSlot)
{ // {
if (ClothingSlot.ClothingItemInstance) // if (ClothingSlot.ClothingItemInstance)
{ // {
return true; // TODO: Add exposed body part resolution // return true; // TODO: Add exposed body part resolution
} // }
//
return false; // return false;
}); // });
if (!TargetClothingItem) // if (!TargetClothingItem)
{ // {
Complete(); // Complete();
} // }
} }
@@ -15,10 +15,10 @@
#include "Internationalization/Text.h" #include "Internationalization/Text.h"
#include "NakedDesire/Clothing/ClothingItem.h" #include "NakedDesire/Clothing/ClothingItem.h"
#include "NakedDesire/Clothing/ClothingItemInstance.h" #include "NakedDesire/Clothing/ClothingItemInstance.h"
#include "NakedDesire/Clothing/ClothingSlotsData.h"
#include "NakedDesire/Global/Constants.h" #include "NakedDesire/Global/Constants.h"
#include "NakedDesire/Global/NakedDesireUserSettings.h" #include "NakedDesire/Global/NakedDesireUserSettings.h"
#include "NakedDesire/UI/RadialMenu/RadialMenuController.h" #include "NakedDesire/UI/RadialMenu/RadialMenuController.h"
#include "NakedDesire/Clothing/ClothingSlotWidgetsInfo.h"
#include "Perception/AIPerceptionStimuliSourceComponent.h" #include "Perception/AIPerceptionStimuliSourceComponent.h"
#include "Perception/AISense_Sight.h" #include "Perception/AISense_Sight.h"
@@ -186,7 +186,7 @@ UAISense_Sight::EVisibilityResult ANakedDesireCharacter::CanBeSeenFrom(const FCa
FHitResult PelvisHitResult; FHitResult PelvisHitResult;
const bool PelvisHit = CheckSight(StartLocation, PelvisBoneLocation, PelvisHitResult, Context.IgnoreActor); const bool PelvisHit = CheckSight(StartLocation, PelvisBoneLocation, PelvisHitResult, Context.IgnoreActor);
if ((!BoobsHit || BoobsHitResult.GetActor() == this) && ClothingManager->IsBodyTypeExposed(EBodyPart::Boobs)) if ((!BoobsHit || BoobsHitResult.GetActor() == this) && ClothingManager->IsBodyPartExposed(EBodyPart::Boobs))
{ {
UE_LOG(LogTemp, Warning, TEXT("Boobs hit")); UE_LOG(LogTemp, Warning, TEXT("Boobs hit"));
OutSeenLocation = BoobsBoneLocation; OutSeenLocation = BoobsBoneLocation;
@@ -195,7 +195,7 @@ UAISense_Sight::EVisibilityResult ANakedDesireCharacter::CanBeSeenFrom(const FCa
} }
if ((!PelvisHit || PelvisHitResult.GetActor() == this) && if ((!PelvisHit || PelvisHitResult.GetActor() == this) &&
(ClothingManager->IsBodyTypeExposed(EBodyPart::Ass) || ClothingManager->IsBodyTypeExposed(EBodyPart::Genitals))) (ClothingManager->IsBodyPartExposed(EBodyPart::Ass) || ClothingManager->IsBodyPartExposed(EBodyPart::Genitals)))
{ {
UE_LOG(LogTemp, Warning, TEXT("Pelvis hit")); UE_LOG(LogTemp, Warning, TEXT("Pelvis hit"));
OutSeenLocation = PelvisBoneLocation; OutSeenLocation = PelvisBoneLocation;
@@ -260,20 +260,19 @@ void ANakedDesireCharacter::OnEndOverlap(UPrimitiveComponent* OverlappedComponen
void ANakedDesireCharacter::OnClothingEquip(const UClothingItemInstance* ClothingItemInstance) void ANakedDesireCharacter::OnClothingEquip(const UClothingItemInstance* ClothingItemInstance)
{ {
// TODO: Add covered body part resolution if (ClothingItemInstance->GetClothingItem()->HiddenBodyParts.Contains(EBodyPart::Ass))
// if (ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(EBodyPart::Ass)) {
// { AnalCensorship->SetVisibility(false);
// AnalCensorship->SetVisibility(false); }
// } if (ClothingItemInstance->GetClothingItem()->HiddenBodyParts.Contains(EBodyPart::Genitals))
// if (ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(EBodyPart::Genitals)) {
// { VaginaCensorship->SetVisibility(false);
// VaginaCensorship->SetVisibility(false); }
// } if (ClothingItemInstance->GetClothingItem()->HiddenBodyParts.Contains(EBodyPart::Boobs))
// if (ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(EBodyPart::Boobs)) {
// { BoobLCensorship->SetVisibility(false);
// BoobLCensorship->SetVisibility(false); BoobRCensorship->SetVisibility(false);
// BoobRCensorship->SetVisibility(false); }
// }
} }
void ANakedDesireCharacter::OnClothingUnequip(const UClothingItemInstance* ClothingItemInstance) void ANakedDesireCharacter::OnClothingUnequip(const UClothingItemInstance* ClothingItemInstance)
@@ -281,15 +280,15 @@ void ANakedDesireCharacter::OnClothingUnequip(const UClothingItemInstance* Cloth
if (!UNakedDesireUserSettings::GetNakedDesireUserSettings()->GetIsCensorshipEnabled() && !IS_DEMO) if (!UNakedDesireUserSettings::GetNakedDesireUserSettings()->GetIsCensorshipEnabled() && !IS_DEMO)
return; return;
if (ClothingManager->IsBodyTypeExposed(EBodyPart::Ass)) if (ClothingManager->IsBodyPartExposed(EBodyPart::Ass))
{ {
AnalCensorship->SetVisibility(true); AnalCensorship->SetVisibility(true);
} }
if (ClothingManager->IsBodyTypeExposed(EBodyPart::Genitals)) if (ClothingManager->IsBodyPartExposed(EBodyPart::Genitals))
{ {
VaginaCensorship->SetVisibility(true); VaginaCensorship->SetVisibility(true);
} }
if (ClothingManager->IsBodyTypeExposed(EBodyPart::Boobs)) if (ClothingManager->IsBodyPartExposed(EBodyPart::Boobs))
{ {
BoobLCensorship->SetVisibility(true); BoobLCensorship->SetVisibility(true);
BoobRCensorship->SetVisibility(true); BoobRCensorship->SetVisibility(true);
@@ -300,15 +299,15 @@ void ANakedDesireCharacter::OnSettingsChanged(UNakedDesireUserSettings* Settings
{ {
if (Settings->GetIsCensorshipEnabled()) if (Settings->GetIsCensorshipEnabled())
{ {
if (ClothingManager->IsBodyTypeExposed(EBodyPart::Ass)) if (ClothingManager->IsBodyPartExposed(EBodyPart::Ass))
{ {
AnalCensorship->SetVisibility(true); AnalCensorship->SetVisibility(true);
} }
if (ClothingManager->IsBodyTypeExposed(EBodyPart::Genitals)) if (ClothingManager->IsBodyPartExposed(EBodyPart::Genitals))
{ {
VaginaCensorship->SetVisibility(true); VaginaCensorship->SetVisibility(true);
} }
if (ClothingManager->IsBodyTypeExposed(EBodyPart::Boobs)) if (ClothingManager->IsBodyPartExposed(EBodyPart::Boobs))
{ {
BoobLCensorship->SetVisibility(true); BoobLCensorship->SetVisibility(true);
BoobRCensorship->SetVisibility(true); BoobRCensorship->SetVisibility(true);
@@ -373,15 +372,22 @@ void ANakedDesireCharacter::OnEquipmentPress(const FInputActionValue& Value)
void ANakedDesireCharacter::BuildRadialMenuEntries() void ANakedDesireCharacter::BuildRadialMenuEntries()
{ {
if (!SlotsData)
{
UE_LOG(LogTemp, Warning, TEXT("ANakedDesireCharacter::BuildRadialMenuEntries SlotsData not defined"));
return;
}
TArray<FRadialMenuEntry> Entries; TArray<FRadialMenuEntry> Entries;
for (const FClothingSlotData& SlotData : ClothingManager->ClothingSlots) for (const auto& [Key, Value] : SlotsData->Slots)
{ {
FRadialMenuEntry Entry; FRadialMenuEntry Entry;
Entry.bEnabled = SlotData.ClothingItemInstance != nullptr; const UClothingItemInstance* EquippedItem = ClothingManager->GetSlotClothing(Key);
Entry.DisplayName = SlotData.Name; Entry.bEnabled = true;
Entry.Icon = SlotData.ClothingItemInstance ? SlotData.ClothingItemInstance->GetClothingItem()->Icon : SlotData.Icon; Entry.DisplayName = Value.Name;
Entry.ItemId = FName(SlotData.Name.ToString()); Entry.Icon = EquippedItem ? EquippedItem->GetClothingItem()->Icon : Value.Icon;
Entry.ItemId = FName(Value.Name.ToString());
Entries.Push(Entry); Entries.Push(Entry);
} }
@@ -13,14 +13,11 @@
#include "Perception/AISightTargetInterface.h" #include "Perception/AISightTargetInterface.h"
#include "NakedDesireCharacter.generated.h" #include "NakedDesireCharacter.generated.h"
class UClothingSlotsData;
class URadialMenuController; class URadialMenuController;
class UAIPerceptionStimuliSourceComponent; class UAIPerceptionStimuliSourceComponent;
class UClothingList;
struct FClothingSlotData;
class UInteractionManager; class UInteractionManager;
class UClothingPickerWidget;
class UClothingManager; class UClothingManager;
class UClothingSlotInfo;
class UStatsManager; class UStatsManager;
class UMissionsManager; class UMissionsManager;
class ANPCAIController; class ANPCAIController;
@@ -124,7 +121,7 @@ public:
UStaticMeshComponent* AnalCensorship; UStaticMeshComponent* AnalCensorship;
UPROPERTY(EditDefaultsOnly, Category = "Clothing") UPROPERTY(EditDefaultsOnly, Category = "Clothing")
TObjectPtr<UClothingSlotInfo> SlotInfo; TObjectPtr<UClothingSlotsData> SlotsData;
// Components // Components
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Clothing") UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Clothing")
@@ -27,9 +27,9 @@ void UEquipmentSlotWidget::NativePreConstruct()
{ {
Super::NativePreConstruct(); Super::NativePreConstruct();
if (!ClothingSlotsData->ClothingSlotsData.Contains(SlotType)) // if (!ClothingSlotsData->Slots.Contains(SlotType))
return; // return;
FClothingSlotData& SlotData = ClothingSlotsData->ClothingSlotsData[SlotType]; // FClothingSlotData& SlotData = ClothingSlotsData->Slots[SlotType];
PlaceholderImage->SetBrushFromTexture(&SlotData.Icon); // PlaceholderImage->SetBrushFromTexture(&SlotData.Icon);
} }
@@ -5,7 +5,6 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "CommonButtonBase.h" #include "CommonButtonBase.h"
#include "Components/Image.h" #include "Components/Image.h"
#include "NakedDesire/Clothing/BodyPart.h"
#include "NakedDesire/Clothing/ClothingSlotType.h" #include "NakedDesire/Clothing/ClothingSlotType.h"
#include "EquipmentSlotWidget.generated.h" #include "EquipmentSlotWidget.generated.h"
@@ -57,7 +57,7 @@ void URadialSliceWidget::Setup(UMaterialInterface* InSliceMaterial,
void URadialSliceWidget::UpdateHighlight(bool bIsHovered, float UndilatedDelta) void URadialSliceWidget::UpdateHighlight(bool bIsHovered, float UndilatedDelta)
{ {
const float Target = (bIsHovered && bSliceEnabled) ? 1.f : 0.f; const float Target = bIsHovered && bSliceEnabled ? 1.f : 0.f;
CurrentHighlight = FMath::FInterpTo(CurrentHighlight, Target, CurrentHighlight = FMath::FInterpTo(CurrentHighlight, Target,
UndilatedDelta, HighlightInterpSpeed); UndilatedDelta, HighlightInterpSpeed);