Refactor clothing visuals

This commit is contained in:
2026-05-29 22:54:28 +03:00
parent 69ec356f16
commit 95a823908e
11 changed files with 187 additions and 481 deletions
@@ -81,37 +81,6 @@ float UClothingManager::GetHeelHeight()
return Footwear->GetClothingItemDefinition()->ShoesOffset;
}
USkeletalMeshComponent* UClothingManager::GetMeshComponent(const EClothingSlotType SlotType) const
{
const ANakedDesireCharacter* Player = Cast<ANakedDesireCharacter>(GetOwner());
if (!Player)
{
return nullptr;
}
switch (SlotType)
{
case EClothingSlotType::Nipples: return Player->NipplesMeshComponent;
case EClothingSlotType::Anal: return Player->AnalMeshComponent;
case EClothingSlotType::Vagina: return Player->VaginaMeshComponent;
case EClothingSlotType::Head: return Player->HeadMeshComponent;
case EClothingSlotType::Neck: return Player->NeckMeshComponent;
case EClothingSlotType::Face: return Player->FaceMeshComponent;
case EClothingSlotType::Eyes: return Player->EyesMeshComponent;
case EClothingSlotType::Bodysuit: return Player->BodySuitMeshComponent;
case EClothingSlotType::Top: return Player->TopMeshComponent;
case EClothingSlotType::Bottom: return Player->BottomMeshComponent;
case EClothingSlotType::UnderwearTop: return Player->UnderwearTopMeshComponent;
case EClothingSlotType::UnderwearBottom:return Player->UnderwearBottomMeshComponent;
case EClothingSlotType::Socks: return Player->SocksMeshComponent;
case EClothingSlotType::Footwear: return Player->FootwearMeshComponent;
case EClothingSlotType::Outerwear: return Player->OuterwearMeshComponent;
case EClothingSlotType::WristRestraint: return Player->WristRestraintMeshComponent;
case EClothingSlotType::AnkleRestraint: return Player->AnkleRestraintMeshComponent;
case EClothingSlotType::NeckRestraint: return Player->NeckRestraintMeshComponent;
default: return nullptr;
}
}
void UClothingManager::SpawnClothingPickup(UClothingItemInstance* ItemInstance)
{
if (!ItemPickupActor)
@@ -139,22 +108,8 @@ void UClothingManager::PutOnClothing(UClothingItemInstance* ClothingItemInstance
return;
const EClothingSlotType ClothingSlotType = ClothingItemInstance->GetClothingItemDefinition()->SlotType;
USkeletalMeshComponent* MeshComponent = GetMeshComponent(ClothingSlotType);
MeshComponent->SetSkeletalMesh(ClothingItemInstance->GetClothingItemDefinition()->SkeletalMesh);
if (!ClothingItemInstance->GetClothingItemDefinition()->Materials.IsEmpty())
{
for (const TPair<FName, UMaterialInstance*>& Material : ClothingItemInstance->GetClothingItemDefinition()->Materials)
{
MeshComponent->SetMaterialByName(Material.Key, Material.Value);
}
}
SetClothingSlotItem(ClothingSlotType, ClothingItemInstance);
if (ClothingItemInstance->GetClothingItemDefinition()->UseLeaderPose)
{
MeshComponent->SetLeaderPoseComponent(Cast<ACharacter>(GetOwner())->GetMesh());
}
const UClothingItemDefinition* ClothingItem = ClothingItemInstance->GetClothingItemDefinition();
if (ClothingItem->SlotType == EClothingSlotType::Bodysuit)
@@ -200,14 +155,6 @@ UClothingItemInstance* UClothingManager::RemoveClothing(const EClothingSlotType
SetClothingSlotItem(ClothingSlotType, nullptr);
USkeletalMeshComponent* MeshComponent = GetMeshComponent(ClothingSlotType);
MeshComponent->SetSkeletalMesh(nullptr);
if (ExistingItem->GetClothingItemDefinition()->UseLeaderPose)
{
MeshComponent->SetLeaderPoseComponent(nullptr);
}
OnClothingUnequip.Broadcast(ExistingItem);
USaveSubsystem* SaveSubsystem = UGameplayStatics::GetGameInstance(GetWorld())->GetSubsystem<USaveSubsystem>();