Added commissions system

This commit is contained in:
2026-06-01 00:27:56 +03:00
parent a3e23393dc
commit 003d9992e2
81 changed files with 2418 additions and 1065 deletions
@@ -0,0 +1,49 @@
// © 2025 Naked People Team. All Rights Reserved.
#include "WearingSlotConstraint.h"
#include "NakedDesire/Clothing/ClothingManager.h"
#include "NakedDesire/Player/NakedDesireCharacter.h"
#define LOCTEXT_NAMESPACE "Commissions.Constraints.WearingSlot"
void UWearingSlotConstraint::OnActivate()
{
if (Player && Player->ClothingManager)
{
Player->ClothingManager->OnClothingEquip.AddUniqueDynamic(this, &UWearingSlotConstraint::HandleClothingChanged);
Player->ClothingManager->OnClothingUnequip.AddUniqueDynamic(this, &UWearingSlotConstraint::HandleClothingChanged);
}
}
void UWearingSlotConstraint::OnDeactivate()
{
if (Player && Player->ClothingManager)
{
Player->ClothingManager->OnClothingEquip.RemoveDynamic(this, &UWearingSlotConstraint::HandleClothingChanged);
Player->ClothingManager->OnClothingUnequip.RemoveDynamic(this, &UWearingSlotConstraint::HandleClothingChanged);
}
}
bool UWearingSlotConstraint::IsMet() const
{
if (!Player || !Player->ClothingManager)
return false;
return Player->ClothingManager->IsClothingTypeOn(Slot) == bMustBeWorn;
}
void UWearingSlotConstraint::HandleClothingChanged(UClothingItemInstance* ClothingItemInstance)
{
NotifyChanged();
}
FText UWearingSlotConstraint::GetDescription() const
{
return bMustBeWorn
? LOCTEXT("Wearing", "while dressed in the required item")
: LOCTEXT("NotWearing", "while that slot is bare");
}
#undef LOCTEXT_NAMESPACE