Files
Naked-Desire/Source/NakedDesire/MissionBuilder/Restrictions/ExposeBodyPartRestriction.cpp
T
2026-06-03 15:16:27 +03:00

96 lines
2.5 KiB
C++

// © 2025 Naked People Team. All Rights Reserved.
#include "ExposeBodyPartRestriction.h"
#include "NakedDesire/Clothing/ClothingItem.h"
#include "NakedDesire/Clothing/ClothingItemInstance.h"
#include "NakedDesire/Player/NakedDesireCharacter.h"
#include "NakedDesire/Clothing/ClothingManager.h"
#define LOCTEXT_NAMESPACE "Missions.Restrictions.ExposeBodyPart"
const FText RestrictionsExposeBodyPartDescription = LOCTEXT("Description", "Expose {BodyPart}");
#undef LOCTEXT_NAMESPACE
void UExposeBodyPartRestriction::Init(ANakedDesireCharacter* PlayerCharacter)
{
Super::Init(PlayerCharacter);
PlayerCharacter->ClothingManager->OnClothingEquip.AddUniqueDynamic(this, &UExposeBodyPartRestriction::EquipClothing);
PlayerCharacter->ClothingManager->OnClothingUnequip.AddUniqueDynamic(this, &UExposeBodyPartRestriction::UnequipClothing);
CheckClothing();
}
void UExposeBodyPartRestriction::Stop()
{
Super::Stop();
Player->ClothingManager->OnClothingEquip.Remove(this, TEXT("ClothingEquip"));
Player->ClothingManager->OnClothingUnequip.Remove(this, TEXT("ClothingUnequip"));
}
FText UExposeBodyPartRestriction::GetDescription() const
{
FText BodyPartString;
switch (BodyPart)
{
case EBodyPart::Ass:
BodyPartString = FText::FromString("Ass");
break;
case EBodyPart::Boobs:
BodyPartString = FText::FromString("Boobs");
break;
case EBodyPart::Genitals:
BodyPartString = FText::FromString("Genitals");
break;
default:
BodyPartString = FText::FromString("None");
break;
}
return FText::Format(RestrictionsExposeBodyPartDescription,
FFormatNamedArguments
{
{TEXT("BodyPart"), BodyPartString}
});
}
void UExposeBodyPartRestriction::EquipClothing(const UClothingItemInstance* ClothingItemInstance)
{
if (IsSuccess) // TODO: Add covered body part resolution
{
Init(Player);
}
}
void UExposeBodyPartRestriction::UnequipClothing(const UClothingItemInstance* ClothingItemInstance)
{
if (IsSuccess)
return;
CheckClothing();
}
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();
// }
}