Files
Naked-Desire/Source/NakedDesire/Clothing/ClothingManager.h
T
2026-06-03 15:16:27 +03:00

60 lines
1.8 KiB
C++

// © 2025 Naked People Team. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "BodyPart.h"
#include "ClothingSlotType.h"
#include "Components/ActorComponent.h"
#include "ClothingManager.generated.h"
class UGlobalSaveGameData;
class AClothingPickup;
class UClothingItemInstance;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnClothingChangeSignature, const UClothingItemInstance*, ClothingItemInstance);
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class NAKEDDESIRE_API UClothingManager : public UActorComponent
{
GENERATED_BODY()
public:
UClothingManager();
virtual void BeginPlay() override;
UPROPERTY(BlueprintReadWrite, Category = "Clothing Manager|Clothing")
USkeletalMeshComponent* RootMesh = nullptr;
UPROPERTY(BlueprintAssignable)
FOnClothingChangeSignature OnClothingEquip;
UPROPERTY(BlueprintAssignable)
FOnClothingChangeSignature OnClothingUnequip;
UPROPERTY(BlueprintAssignable)
FOnClothingChangeSignature OnClothingDropped;
void PutOnClothing(UClothingItemInstance* ClothingItemInstance);
void DropClothing(const EClothingSlotType ClothingType);
bool IsClothingTypeOn(const EClothingSlotType ClothingType);
void TakeClothing(UClothingItemInstance* ClothingItemInstance);
UClothingItemInstance* RemoveClothing(EClothingSlotType ClothingSlotType);
void SetClothingSlotItem(const EClothingSlotType ClothingSlotType, UClothingItemInstance* ClothingItemInstance);
TArray<UClothingItemInstance*> GetEquippedClothing() const;
UClothingItemInstance* GetSlotClothing(EClothingSlotType SlotType);
bool IsBodyPartExposed(EBodyPart BodyPart);
void HydrateClothing();
UFUNCTION(BlueprintPure)
float GetHeelHeight();
private:
USkeletalMeshComponent* GetMeshComponent(EClothingSlotType SlotType) const;
UPROPERTY()
TMap<EClothingSlotType, TObjectPtr<UClothingItemInstance>> EquippedClothing;
};