diff --git a/Content/Blueprints/Data/ClothingSlots.uasset b/Content/Blueprints/Data/ClothingSlots.uasset new file mode 100644 index 00000000..c5fad8fb --- /dev/null +++ b/Content/Blueprints/Data/ClothingSlots.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:767bb4ab2bb65b32d76de6a7071198506253ceab93655254c6e4ecce72a4e8cc +size 6351 diff --git a/Content/Blueprints/GM_Main.uasset b/Content/Blueprints/GM_Main.uasset index 20d43e04..6cb1b85f 100644 --- a/Content/Blueprints/GM_Main.uasset +++ b/Content/Blueprints/GM_Main.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b6ef915d4020c0a547f8cea0ce8ea4fbdfddd14ba6b221aacdb0decd159af97a -size 134790 +oid sha256:a4ac8a4698ff09263764e55006eacda0a70cd08e512d34bfada781dcb07085f1 +size 121492 diff --git a/Content/Blueprints/Player/BP_Player.uasset b/Content/Blueprints/Player/BP_Player.uasset index bbb92836..9588fc1e 100644 --- a/Content/Blueprints/Player/BP_Player.uasset +++ b/Content/Blueprints/Player/BP_Player.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:82682b147aed95fa9e7c3e7c8fb82c6e4b201c1d4d9d3b60e4a5e260a9ea844e -size 68773 +oid sha256:60cfe543bba3c777c37c931de28a596db1c05814a4f93ad60f9b45a11311a1ba +size 67456 diff --git a/Content/Characters/Yumi/ABP_Yumi_PP.uasset b/Content/Characters/Yumi/ABP_Yumi_PP.uasset index 3a0cf47d..0ac8fe03 100644 --- a/Content/Characters/Yumi/ABP_Yumi_PP.uasset +++ b/Content/Characters/Yumi/ABP_Yumi_PP.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:92f9ef754154fd57c484690fc7b7a4654c388bbe9c299b55ef2cbbcb30eadf60 -size 174820 +oid sha256:1fd3a6616e658bcfe683c541021e81c8ac95a754681cd6ff1421dd77cf656038 +size 164425 diff --git a/Content/Characters/Yumi/Hair/Default/Materials/M_Hair_Master.uasset b/Content/Characters/Yumi/Hair/Default/Materials/M_Hair_Master.uasset index e1d1017b..0985825d 100644 --- a/Content/Characters/Yumi/Hair/Default/Materials/M_Hair_Master.uasset +++ b/Content/Characters/Yumi/Hair/Default/Materials/M_Hair_Master.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ad8b3f3b31f317f6c0b9e4f0d010a539b44009b357ce053e2833e2db0abd2a63 -size 82575 +oid sha256:6a9378635b9f225adf5f7162d6a2a7294d7b3c2b3de17aa9656aeb3fcdaee5fc +size 81966 diff --git a/Content/Characters/Yumi/Materials/MI_Censoring.uasset b/Content/Characters/Yumi/Materials/MI_Censoring.uasset index 1046f9fe..b58c16b3 100644 --- a/Content/Characters/Yumi/Materials/MI_Censoring.uasset +++ b/Content/Characters/Yumi/Materials/MI_Censoring.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:38b4797cf28169456ed0f149a00c1934b9f02cab201b39816d06a2f8734ae24b -size 7467 +oid sha256:a121676c2e3486bb5a0bbfd09f0a69a6d65c5e24768316241a756491d59b7110 +size 8141 diff --git a/Content/Characters/Yumi/Materials/M_Censoring.uasset b/Content/Characters/Yumi/Materials/M_Censoring.uasset index 6dad049a..385358b8 100644 --- a/Content/Characters/Yumi/Materials/M_Censoring.uasset +++ b/Content/Characters/Yumi/Materials/M_Censoring.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:252f954665f9338f9eb12b39981d57c10bfdc1501a27e728a5333bcb348d5748 -size 101665 +oid sha256:aee6e7f96dfd7693391cbbd508a7a66d1e4265c99e838845518ecc90d39a1f21 +size 29164 diff --git a/Content/Test/Maps/TestLevel.umap b/Content/Test/Maps/TestLevel.umap index a34e8fbc..e7f597a2 100644 --- a/Content/Test/Maps/TestLevel.umap +++ b/Content/Test/Maps/TestLevel.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b869e90cd761888424506269988687dd9d913e4fee1da3f525a396a9c6f91c9e +oid sha256:e191b583b26373269aaa340693ecfe4fbf1e32a3704bb1c2b3219885c16916f1 size 49583 diff --git a/Content/Translations/ClothingSlots.uasset b/Content/Translations/ClothingSlots.uasset index a1e8845d..9edc28b2 100644 --- a/Content/Translations/ClothingSlots.uasset +++ b/Content/Translations/ClothingSlots.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bd9b423779300a558f52550d66c54405d7bbf7738909aebca6c4d338fc0f5cce -size 3304 +oid sha256:9e187519519e0101778fadbb7179bb3701b692a2abed317ce5ad8ae8461f7122 +size 3744 diff --git a/Content/UI/RadialMenu/WBP_RadialMenu.uasset b/Content/UI/RadialMenu/WBP_RadialMenu.uasset index 37bb4945..401e8dc2 100644 --- a/Content/UI/RadialMenu/WBP_RadialMenu.uasset +++ b/Content/UI/RadialMenu/WBP_RadialMenu.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:169775f5e76ae2a13cb4bb0066c7d3d23ee71d1390046dead0dc2b6d885339a3 +oid sha256:f9e0ebc09e603cc75b5456a699dbb8a9b719048a42cc5258bb6fd3c56fad73fa size 24948 diff --git a/Content/UI/RadialMenu/WBP_RadialSlice.uasset b/Content/UI/RadialMenu/WBP_RadialSlice.uasset index 64b312c5..d758d75c 100644 --- a/Content/UI/RadialMenu/WBP_RadialSlice.uasset +++ b/Content/UI/RadialMenu/WBP_RadialSlice.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:340f214c0418b5e20db0781c90b0e87d62d725b24a42e7ba912698f6f0cc9804 -size 28648 +oid sha256:e6ddf50bc6ac448868ca3a39c72d9c960814402ee1f361678a4c0c0b519aaafb +size 31758 diff --git a/Source/NakedDesire/Clothing/ClothingItem.h b/Source/NakedDesire/Clothing/ClothingItem.h index 9e6397e7..f221a7ae 100644 --- a/Source/NakedDesire/Clothing/ClothingItem.h +++ b/Source/NakedDesire/Clothing/ClothingItem.h @@ -117,4 +117,7 @@ public: UPROPERTY(EditDefaultsOnly, BlueprintReadOnly) TArray Restrictions; + + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly) + TArray HiddenBodyParts; }; diff --git a/Source/NakedDesire/Clothing/ClothingManager.cpp b/Source/NakedDesire/Clothing/ClothingManager.cpp index d67f4f8a..9b99c4b7 100644 --- a/Source/NakedDesire/Clothing/ClothingManager.cpp +++ b/Source/NakedDesire/Clothing/ClothingManager.cpp @@ -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 UClothingManager::GetEquippedClothing() const +{ + TArray> 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 UClothingManager::GetEquippedClothing() -{ - TArray EquippedClothingItems; - - for (FClothingSlotData ClothingSlot : ClothingSlots) - { - if (ClothingSlot.ClothingItemInstance) - { - EquippedClothingItems.Add(ClothingSlot.ClothingItemInstance); - } - } - - return EquippedClothingItems; -} - void UClothingManager::HydrateClothing() { USaveSubsystem* SaveSubsystem = UGameplayStatics::GetGameInstance(GetWorld())->GetSubsystem(); @@ -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(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(); 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(); - 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); } diff --git a/Source/NakedDesire/Clothing/ClothingManager.h b/Source/NakedDesire/Clothing/ClothingManager.h index 21e39073..ccd6d566 100644 --- a/Source/NakedDesire/Clothing/ClothingManager.h +++ b/Source/NakedDesire/Clothing/ClothingManager.h @@ -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 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 GetEquippedClothing(); + TArray 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> EquippedClothing; }; diff --git a/Source/NakedDesire/Clothing/ClothingSlotData.h b/Source/NakedDesire/Clothing/ClothingSlotData.h deleted file mode 100644 index ed4e5f58..00000000 --- a/Source/NakedDesire/Clothing/ClothingSlotData.h +++ /dev/null @@ -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 ClothingItemInstance = nullptr; - - UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Clothing") - FText Name = FText::GetEmpty(); - - UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Clothing") - TObjectPtr Icon = nullptr; -}; - diff --git a/Source/NakedDesire/Clothing/ClothingSlotWidgetsInfo.cpp b/Source/NakedDesire/Clothing/ClothingSlotWidgetsInfo.cpp deleted file mode 100644 index 8f7021b0..00000000 --- a/Source/NakedDesire/Clothing/ClothingSlotWidgetsInfo.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// © 2025 Naked People Team. All Rights Reserved. - - -#include "ClothingSlotWidgetsInfo.h" - diff --git a/Source/NakedDesire/Clothing/ClothingSlotWidgetsInfo.h b/Source/NakedDesire/Clothing/ClothingSlotWidgetsInfo.h deleted file mode 100644 index 29b362b6..00000000 --- a/Source/NakedDesire/Clothing/ClothingSlotWidgetsInfo.h +++ /dev/null @@ -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 ClothingSlotsData; -}; diff --git a/Source/NakedDesire/Clothing/ClothingSlotsData.h b/Source/NakedDesire/Clothing/ClothingSlotsData.h index 6e56e943..62ede3e8 100644 --- a/Source/NakedDesire/Clothing/ClothingSlotsData.h +++ b/Source/NakedDesire/Clothing/ClothingSlotsData.h @@ -17,7 +17,7 @@ struct NAKEDDESIRE_API FClothingSlotData } UPROPERTY(EditDefaultsOnly, Category = "Clothing") - UTexture2D Icon; + TObjectPtr Icon; UPROPERTY(EditDefaultsOnly, Category = "Clothing") FText Name; @@ -30,5 +30,5 @@ class NAKEDDESIRE_API UClothingSlotsData : public UPrimaryDataAsset public: UPROPERTY(EditDefaultsOnly, Category = "Clothing") - TMap ClothingSlotsData; + TMap Slots; }; diff --git a/Source/NakedDesire/MissionBuilder/Restrictions/EquipClothingRestriction.cpp b/Source/NakedDesire/MissionBuilder/Restrictions/EquipClothingRestriction.cpp index 9acca0cc..696468e7 100644 --- a/Source/NakedDesire/MissionBuilder/Restrictions/EquipClothingRestriction.cpp +++ b/Source/NakedDesire/MissionBuilder/Restrictions/EquipClothingRestriction.cpp @@ -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; + // } + // } } diff --git a/Source/NakedDesire/MissionBuilder/Restrictions/ExposeBodyPartRestriction.cpp b/Source/NakedDesire/MissionBuilder/Restrictions/ExposeBodyPartRestriction.cpp index e08b5eed..6b8f0883 100644 --- a/Source/NakedDesire/MissionBuilder/Restrictions/ExposeBodyPartRestriction.cpp +++ b/Source/NakedDesire/MissionBuilder/Restrictions/ExposeBodyPartRestriction.cpp @@ -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(); + // } } diff --git a/Source/NakedDesire/Player/NakedDesireCharacter.cpp b/Source/NakedDesire/Player/NakedDesireCharacter.cpp index 8df492db..5e2673bb 100644 --- a/Source/NakedDesire/Player/NakedDesireCharacter.cpp +++ b/Source/NakedDesire/Player/NakedDesireCharacter.cpp @@ -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 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); } diff --git a/Source/NakedDesire/Player/NakedDesireCharacter.h b/Source/NakedDesire/Player/NakedDesireCharacter.h index 32246783..f9ee69da 100644 --- a/Source/NakedDesire/Player/NakedDesireCharacter.h +++ b/Source/NakedDesire/Player/NakedDesireCharacter.h @@ -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 SlotInfo; + TObjectPtr SlotsData; // Components UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Clothing") diff --git a/Source/NakedDesire/UI/Inventory/EquipmentSlotWidget.cpp b/Source/NakedDesire/UI/Inventory/EquipmentSlotWidget.cpp index 2abada19..3eb71108 100644 --- a/Source/NakedDesire/UI/Inventory/EquipmentSlotWidget.cpp +++ b/Source/NakedDesire/UI/Inventory/EquipmentSlotWidget.cpp @@ -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); } diff --git a/Source/NakedDesire/UI/Inventory/EquipmentSlotWidget.h b/Source/NakedDesire/UI/Inventory/EquipmentSlotWidget.h index 567c15b0..3ae5c490 100644 --- a/Source/NakedDesire/UI/Inventory/EquipmentSlotWidget.h +++ b/Source/NakedDesire/UI/Inventory/EquipmentSlotWidget.h @@ -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" diff --git a/Source/NakedDesire/UI/RadialMenu/RadialSliceWidget.cpp b/Source/NakedDesire/UI/RadialMenu/RadialSliceWidget.cpp index b57d7e6b..87cee3b0 100644 --- a/Source/NakedDesire/UI/RadialMenu/RadialSliceWidget.cpp +++ b/Source/NakedDesire/UI/RadialMenu/RadialSliceWidget.cpp @@ -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);