Clothings lots config rework
This commit is contained in:
@@ -117,4 +117,7 @@ public:
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
|
||||
TArray<FClothingRestriction> Restrictions;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
|
||||
TArray<EBodyPart> HiddenBodyParts;
|
||||
};
|
||||
|
||||
@@ -23,58 +23,40 @@ void UClothingManager::BeginPlay()
|
||||
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 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()
|
||||
{
|
||||
USaveSubsystem* SaveSubsystem = UGameplayStatics::GetGameInstance(GetWorld())->GetSubsystem<USaveSubsystem>();
|
||||
@@ -87,15 +69,12 @@ void UClothingManager::HydrateClothing()
|
||||
|
||||
float UClothingManager::GetHeelHeight()
|
||||
{
|
||||
if (FClothingSlotData ClothingSlotData; GetClothingSlotData(EClothingSlotType::Footwear, ClothingSlotData))
|
||||
{
|
||||
if (ClothingSlotData.ClothingItemInstance)
|
||||
{
|
||||
return ClothingSlotData.ClothingItemInstance->GetClothingItem()->ShoesOffset;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (!EquippedClothing.Contains(EClothingSlotType::Footwear))
|
||||
return 0;
|
||||
|
||||
const UClothingItemInstance* Footwear = EquippedClothing[EClothingSlotType::Footwear];
|
||||
|
||||
return Footwear->GetClothingItem()->ShoesOffset;
|
||||
}
|
||||
|
||||
USkeletalMeshComponent* UClothingManager::GetMeshComponent(const EClothingSlotType SlotType) const
|
||||
@@ -135,9 +114,6 @@ void UClothingManager::PutOnClothing(UClothingItemInstance* ClothingItemInstance
|
||||
return;
|
||||
|
||||
const EClothingSlotType ClothingSlotType = ClothingItemInstance->GetClothingItem()->SlotType;
|
||||
|
||||
FClothingSlotData ClothingSlotData;
|
||||
GetClothingSlotData(ClothingSlotType, ClothingSlotData);
|
||||
|
||||
USkeletalMeshComponent* MeshComponent = GetMeshComponent(ClothingSlotType);
|
||||
MeshComponent->SetSkeletalMesh(ClothingItemInstance->GetClothingItem()->SkeletalMesh);
|
||||
@@ -154,8 +130,8 @@ void UClothingManager::PutOnClothing(UClothingItemInstance* ClothingItemInstance
|
||||
{
|
||||
MeshComponent->SetLeaderPoseComponent(Cast<ACharacter>(GetOwner())->GetMesh());
|
||||
}
|
||||
|
||||
UClothingItem* ClothingItem = ClothingItemInstance->GetClothingItem();
|
||||
|
||||
const UClothingItem* ClothingItem = ClothingItemInstance->GetClothingItem();
|
||||
if (ClothingItem->SlotType == EClothingSlotType::Bodysuit)
|
||||
{
|
||||
DropClothing(EClothingSlotType::Top);
|
||||
@@ -176,15 +152,13 @@ void UClothingManager::PutOnClothing(UClothingItemInstance* ClothingItemInstance
|
||||
|
||||
void UClothingManager::TakeClothing(UClothingItemInstance* ClothingItemInstance)
|
||||
{
|
||||
FClothingSlotData ClothingSlotData;
|
||||
GetClothingSlotData(ClothingItemInstance->GetClothingItem()->SlotType, ClothingSlotData);
|
||||
|
||||
if (ClothingSlotData.ClothingItemInstance->GetClothingItem())
|
||||
const EClothingSlotType SlotType = ClothingItemInstance->GetClothingItem()->SlotType;
|
||||
if (const UClothingItemInstance* ExistingClothing = *EquippedClothing.Find(SlotType))
|
||||
{
|
||||
DropClothing(ClothingItemInstance->GetClothingItem()->SlotType);
|
||||
DropClothing(SlotType);
|
||||
}
|
||||
|
||||
ClothingSlotData.ClothingItemInstance = ClothingItemInstance;
|
||||
|
||||
SetClothingSlotItem(SlotType, ClothingItemInstance);
|
||||
|
||||
USaveSubsystem* SaveSubsystem = UGameplayStatics::GetGameInstance(GetWorld())->GetSubsystem<USaveSubsystem>();
|
||||
FItemSaveRecord ItemSaveRecord;
|
||||
@@ -201,33 +175,32 @@ void UClothingManager::TakeClothing(UClothingItemInstance* ClothingItemInstance)
|
||||
|
||||
UClothingItemInstance* UClothingManager::RemoveClothing(const EClothingSlotType ClothingSlotType)
|
||||
{
|
||||
FClothingSlotData ClothingSlotData;
|
||||
if (!GetClothingSlotData(ClothingSlotType, ClothingSlotData) || !ClothingSlotData.ClothingItemInstance)
|
||||
UClothingItemInstance* ExistingItem = *EquippedClothing.Find(ClothingSlotType);
|
||||
if (!ExistingItem)
|
||||
{
|
||||
UE_LOG(LogTemp, Error, TEXT("Couldn't find clothing slot"));
|
||||
UE_LOG(LogTemp, Warning, TEXT("UClothingManager::RemoveClothing No clothing found"));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
UClothingItemInstance* ClothingItemInstance = ClothingSlotData.ClothingItemInstance;
|
||||
SetClothingSlotItem(ClothingSlotType, nullptr);
|
||||
|
||||
USkeletalMeshComponent* MeshComponent = GetMeshComponent(ClothingSlotType);
|
||||
MeshComponent->SetSkeletalMesh(nullptr);
|
||||
|
||||
if (ClothingItemInstance->GetClothingItem()->UseLeaderPose)
|
||||
if (ExistingItem->GetClothingItem()->UseLeaderPose)
|
||||
{
|
||||
MeshComponent->SetLeaderPoseComponent(nullptr);
|
||||
}
|
||||
|
||||
OnClothingUnequip.Broadcast(ClothingItemInstance);
|
||||
|
||||
OnClothingUnequip.Broadcast(ExistingItem);
|
||||
|
||||
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)
|
||||
@@ -246,14 +219,5 @@ void UClothingManager::DropClothing(const EClothingSlotType ClothingType)
|
||||
|
||||
bool UClothingManager::IsClothingTypeOn(const EClothingSlotType ClothingType)
|
||||
{
|
||||
FClothingSlotData ClothingSlotData;
|
||||
GetClothingSlotData(ClothingType, ClothingSlotData);
|
||||
|
||||
const bool IsTypeOn = ClothingSlotData.ClothingItemInstance != nullptr;
|
||||
return IsTypeOn;
|
||||
}
|
||||
|
||||
bool UClothingManager::IsPartiallyNaked()
|
||||
{
|
||||
return IsBodyTypeExposed(EBodyPart::Ass) || IsBodyTypeExposed(EBodyPart::Genitals) || IsBodyTypeExposed(EBodyPart::Boobs);
|
||||
return EquippedClothing.Contains(ClothingType);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "BodyPart.h"
|
||||
#include "ClothingSlotData.h"
|
||||
#include "ClothingSlotType.h"
|
||||
#include "Components/ActorComponent.h"
|
||||
#include "ClothingManager.generated.h"
|
||||
|
||||
@@ -26,9 +26,6 @@ public:
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, Category = "Clothing Manager|Clothing")
|
||||
USkeletalMeshComponent* RootMesh = nullptr;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Clothing Manager|Clothing")
|
||||
TArray<FClothingSlotData> ClothingSlots;
|
||||
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FOnClothingChangeSignature OnClothingEquip;
|
||||
@@ -39,35 +36,15 @@ public:
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FOnClothingChangeSignature OnClothingDropped;
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void PutOnClothing(UClothingItemInstance* ClothingItemInstance);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void DropClothing(const EClothingSlotType ClothingType);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
bool IsClothingTypeOn(const EClothingSlotType ClothingType);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
bool IsPartiallyNaked();
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
bool IsBodyTypeExposed(EBodyPart BodyPart);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void TakeClothing(UClothingItemInstance* ClothingItemInstance);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
UClothingItemInstance* RemoveClothing(EClothingSlotType ClothingSlotType);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
bool GetClothingSlotData(EClothingSlotType ClothingSlotType, FClothingSlotData& OutClothingSlotData);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void SetClothingSlotItem(const EClothingSlotType ClothingSlotType, UClothingItemInstance* ClothingItemInstance);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
TArray<UClothingItemInstance*> GetEquippedClothing();
|
||||
TArray<UClothingItemInstance*> GetEquippedClothing() const;
|
||||
UClothingItemInstance* GetSlotClothing(EClothingSlotType SlotType);
|
||||
bool IsBodyPartExposed(EBodyPart BodyPart);
|
||||
|
||||
void HydrateClothing();
|
||||
|
||||
@@ -76,4 +53,7 @@ public:
|
||||
|
||||
private:
|
||||
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")
|
||||
UTexture2D Icon;
|
||||
TObjectPtr<UTexture2D> Icon;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Clothing")
|
||||
FText Name;
|
||||
@@ -30,5 +30,5 @@ class NAKEDDESIRE_API UClothingSlotsData : public UPrimaryDataAsset
|
||||
|
||||
public:
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Clothing")
|
||||
TMap<EClothingSlotType, FClothingSlotData> ClothingSlotsData;
|
||||
TMap<EClothingSlotType, FClothingSlotData> Slots;
|
||||
};
|
||||
|
||||
@@ -89,21 +89,21 @@ void UEquipClothingRestriction::OnClothingUnequipped(const UClothingItemInstance
|
||||
|
||||
void UEquipClothingRestriction::CheckClothing()
|
||||
{
|
||||
for (const FClothingSlotData& ClothingSlot : Player->ClothingManager->ClothingSlots)
|
||||
{
|
||||
if (!ClothingSlot.ClothingItemInstance)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const bool IsTargetClothing = ClothingItems.FindByPredicate([&ClothingSlot](const UClothingItem* Item)
|
||||
{
|
||||
return Item && Item->Name.EqualTo(ClothingSlot.ClothingItemInstance->GetClothingItem()->Name);
|
||||
}) != nullptr;
|
||||
if (IsTargetClothing)
|
||||
{
|
||||
Complete();
|
||||
return;
|
||||
}
|
||||
}
|
||||
// for (const FClothingSlotData& ClothingSlot : Player->ClothingManager->ClothingSlots)
|
||||
// {
|
||||
// if (!ClothingSlot.ClothingItemInstance)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// const bool IsTargetClothing = ClothingItems.FindByPredicate([&ClothingSlot](const UClothingItem* Item)
|
||||
// {
|
||||
// return Item && Item->Name.EqualTo(ClothingSlot.ClothingItemInstance->GetClothingItem()->Name);
|
||||
// }) != nullptr;
|
||||
// if (IsTargetClothing)
|
||||
// {
|
||||
// Complete();
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -74,22 +74,22 @@ void UExposeBodyPartRestriction::UnequipClothing(const UClothingItemInstance* Cl
|
||||
|
||||
void UExposeBodyPartRestriction::CheckClothing()
|
||||
{
|
||||
if (!Player || !Player->ClothingManager || Player->ClothingManager->ClothingSlots.IsEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const FClothingSlotData* TargetClothingItem = Player->ClothingManager->ClothingSlots.FindByPredicate([this](const FClothingSlotData& ClothingSlot)
|
||||
{
|
||||
if (ClothingSlot.ClothingItemInstance)
|
||||
{
|
||||
return true; // TODO: Add exposed body part resolution
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
if (!TargetClothingItem)
|
||||
{
|
||||
Complete();
|
||||
}
|
||||
// if (!Player || !Player->ClothingManager || Player->ClothingManager->ClothingSlots.IsEmpty())
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// const FClothingSlotData* TargetClothingItem = Player->ClothingManager->ClothingSlots.FindByPredicate([this](const FClothingSlotData& ClothingSlot)
|
||||
// {
|
||||
// if (ClothingSlot.ClothingItemInstance)
|
||||
// {
|
||||
// return true; // TODO: Add exposed body part resolution
|
||||
// }
|
||||
//
|
||||
// return false;
|
||||
// });
|
||||
// if (!TargetClothingItem)
|
||||
// {
|
||||
// Complete();
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
#include "Internationalization/Text.h"
|
||||
#include "NakedDesire/Clothing/ClothingItem.h"
|
||||
#include "NakedDesire/Clothing/ClothingItemInstance.h"
|
||||
#include "NakedDesire/Clothing/ClothingSlotsData.h"
|
||||
#include "NakedDesire/Global/Constants.h"
|
||||
#include "NakedDesire/Global/NakedDesireUserSettings.h"
|
||||
#include "NakedDesire/UI/RadialMenu/RadialMenuController.h"
|
||||
#include "NakedDesire/Clothing/ClothingSlotWidgetsInfo.h"
|
||||
#include "Perception/AIPerceptionStimuliSourceComponent.h"
|
||||
#include "Perception/AISense_Sight.h"
|
||||
|
||||
@@ -186,7 +186,7 @@ UAISense_Sight::EVisibilityResult ANakedDesireCharacter::CanBeSeenFrom(const FCa
|
||||
FHitResult PelvisHitResult;
|
||||
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"));
|
||||
OutSeenLocation = BoobsBoneLocation;
|
||||
@@ -195,7 +195,7 @@ UAISense_Sight::EVisibilityResult ANakedDesireCharacter::CanBeSeenFrom(const FCa
|
||||
}
|
||||
|
||||
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"));
|
||||
OutSeenLocation = PelvisBoneLocation;
|
||||
@@ -260,20 +260,19 @@ void ANakedDesireCharacter::OnEndOverlap(UPrimitiveComponent* OverlappedComponen
|
||||
|
||||
void ANakedDesireCharacter::OnClothingEquip(const UClothingItemInstance* ClothingItemInstance)
|
||||
{
|
||||
// TODO: Add covered body part resolution
|
||||
// if (ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(EBodyPart::Ass))
|
||||
// {
|
||||
// AnalCensorship->SetVisibility(false);
|
||||
// }
|
||||
// if (ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(EBodyPart::Genitals))
|
||||
// {
|
||||
// VaginaCensorship->SetVisibility(false);
|
||||
// }
|
||||
// if (ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(EBodyPart::Boobs))
|
||||
// {
|
||||
// BoobLCensorship->SetVisibility(false);
|
||||
// BoobRCensorship->SetVisibility(false);
|
||||
// }
|
||||
if (ClothingItemInstance->GetClothingItem()->HiddenBodyParts.Contains(EBodyPart::Ass))
|
||||
{
|
||||
AnalCensorship->SetVisibility(false);
|
||||
}
|
||||
if (ClothingItemInstance->GetClothingItem()->HiddenBodyParts.Contains(EBodyPart::Genitals))
|
||||
{
|
||||
VaginaCensorship->SetVisibility(false);
|
||||
}
|
||||
if (ClothingItemInstance->GetClothingItem()->HiddenBodyParts.Contains(EBodyPart::Boobs))
|
||||
{
|
||||
BoobLCensorship->SetVisibility(false);
|
||||
BoobRCensorship->SetVisibility(false);
|
||||
}
|
||||
}
|
||||
|
||||
void ANakedDesireCharacter::OnClothingUnequip(const UClothingItemInstance* ClothingItemInstance)
|
||||
@@ -281,15 +280,15 @@ void ANakedDesireCharacter::OnClothingUnequip(const UClothingItemInstance* Cloth
|
||||
if (!UNakedDesireUserSettings::GetNakedDesireUserSettings()->GetIsCensorshipEnabled() && !IS_DEMO)
|
||||
return;
|
||||
|
||||
if (ClothingManager->IsBodyTypeExposed(EBodyPart::Ass))
|
||||
if (ClothingManager->IsBodyPartExposed(EBodyPart::Ass))
|
||||
{
|
||||
AnalCensorship->SetVisibility(true);
|
||||
}
|
||||
if (ClothingManager->IsBodyTypeExposed(EBodyPart::Genitals))
|
||||
if (ClothingManager->IsBodyPartExposed(EBodyPart::Genitals))
|
||||
{
|
||||
VaginaCensorship->SetVisibility(true);
|
||||
}
|
||||
if (ClothingManager->IsBodyTypeExposed(EBodyPart::Boobs))
|
||||
if (ClothingManager->IsBodyPartExposed(EBodyPart::Boobs))
|
||||
{
|
||||
BoobLCensorship->SetVisibility(true);
|
||||
BoobRCensorship->SetVisibility(true);
|
||||
@@ -300,15 +299,15 @@ void ANakedDesireCharacter::OnSettingsChanged(UNakedDesireUserSettings* Settings
|
||||
{
|
||||
if (Settings->GetIsCensorshipEnabled())
|
||||
{
|
||||
if (ClothingManager->IsBodyTypeExposed(EBodyPart::Ass))
|
||||
if (ClothingManager->IsBodyPartExposed(EBodyPart::Ass))
|
||||
{
|
||||
AnalCensorship->SetVisibility(true);
|
||||
}
|
||||
if (ClothingManager->IsBodyTypeExposed(EBodyPart::Genitals))
|
||||
if (ClothingManager->IsBodyPartExposed(EBodyPart::Genitals))
|
||||
{
|
||||
VaginaCensorship->SetVisibility(true);
|
||||
}
|
||||
if (ClothingManager->IsBodyTypeExposed(EBodyPart::Boobs))
|
||||
if (ClothingManager->IsBodyPartExposed(EBodyPart::Boobs))
|
||||
{
|
||||
BoobLCensorship->SetVisibility(true);
|
||||
BoobRCensorship->SetVisibility(true);
|
||||
@@ -373,15 +372,22 @@ void ANakedDesireCharacter::OnEquipmentPress(const FInputActionValue& Value)
|
||||
|
||||
void ANakedDesireCharacter::BuildRadialMenuEntries()
|
||||
{
|
||||
if (!SlotsData)
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("ANakedDesireCharacter::BuildRadialMenuEntries SlotsData not defined"));
|
||||
return;
|
||||
}
|
||||
|
||||
TArray<FRadialMenuEntry> Entries;
|
||||
|
||||
for (const FClothingSlotData& SlotData : ClothingManager->ClothingSlots)
|
||||
for (const auto& [Key, Value] : SlotsData->Slots)
|
||||
{
|
||||
FRadialMenuEntry Entry;
|
||||
Entry.bEnabled = SlotData.ClothingItemInstance != nullptr;
|
||||
Entry.DisplayName = SlotData.Name;
|
||||
Entry.Icon = SlotData.ClothingItemInstance ? SlotData.ClothingItemInstance->GetClothingItem()->Icon : SlotData.Icon;
|
||||
Entry.ItemId = FName(SlotData.Name.ToString());
|
||||
const UClothingItemInstance* EquippedItem = ClothingManager->GetSlotClothing(Key);
|
||||
Entry.bEnabled = true;
|
||||
Entry.DisplayName = Value.Name;
|
||||
Entry.Icon = EquippedItem ? EquippedItem->GetClothingItem()->Icon : Value.Icon;
|
||||
Entry.ItemId = FName(Value.Name.ToString());
|
||||
Entries.Push(Entry);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,14 +13,11 @@
|
||||
#include "Perception/AISightTargetInterface.h"
|
||||
#include "NakedDesireCharacter.generated.h"
|
||||
|
||||
class UClothingSlotsData;
|
||||
class URadialMenuController;
|
||||
class UAIPerceptionStimuliSourceComponent;
|
||||
class UClothingList;
|
||||
struct FClothingSlotData;
|
||||
class UInteractionManager;
|
||||
class UClothingPickerWidget;
|
||||
class UClothingManager;
|
||||
class UClothingSlotInfo;
|
||||
class UStatsManager;
|
||||
class UMissionsManager;
|
||||
class ANPCAIController;
|
||||
@@ -124,7 +121,7 @@ public:
|
||||
UStaticMeshComponent* AnalCensorship;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Clothing")
|
||||
TObjectPtr<UClothingSlotInfo> SlotInfo;
|
||||
TObjectPtr<UClothingSlotsData> SlotsData;
|
||||
|
||||
// Components
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Clothing")
|
||||
|
||||
@@ -27,9 +27,9 @@ void UEquipmentSlotWidget::NativePreConstruct()
|
||||
{
|
||||
Super::NativePreConstruct();
|
||||
|
||||
if (!ClothingSlotsData->ClothingSlotsData.Contains(SlotType))
|
||||
return;
|
||||
// if (!ClothingSlotsData->Slots.Contains(SlotType))
|
||||
// return;
|
||||
|
||||
FClothingSlotData& SlotData = ClothingSlotsData->ClothingSlotsData[SlotType];
|
||||
PlaceholderImage->SetBrushFromTexture(&SlotData.Icon);
|
||||
// FClothingSlotData& SlotData = ClothingSlotsData->Slots[SlotType];
|
||||
// PlaceholderImage->SetBrushFromTexture(&SlotData.Icon);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "CoreMinimal.h"
|
||||
#include "CommonButtonBase.h"
|
||||
#include "Components/Image.h"
|
||||
#include "NakedDesire/Clothing/BodyPart.h"
|
||||
#include "NakedDesire/Clothing/ClothingSlotType.h"
|
||||
#include "EquipmentSlotWidget.generated.h"
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ void URadialSliceWidget::Setup(UMaterialInterface* InSliceMaterial,
|
||||
|
||||
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,
|
||||
UndilatedDelta, HighlightInterpSpeed);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user