Clothing system refactor

This commit is contained in:
2026-05-29 22:13:09 +03:00
parent 6e44e9d4e8
commit fbca5dd1c0
59 changed files with 417 additions and 227 deletions
+16 -19
View File
@@ -1,12 +1,18 @@
// © 2025 Naked People Team. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "NakedDesire/Clothing/ClothingItemInstance.h"
#include "NakedDesire/Clothing/ClothingItem.h"
#include "StructUtils/InstancedStruct.h"
#include "ItemSaveRecord.generated.h"
class UClothingItemInstance;
class UItemDefinition;
/**
* Type-agnostic save record for any UItemInstance.
* Per-type mutable state lives in State as an FItemInstanceState subclass
* (e.g. FClothingInstanceState), so new item types add no fields here.
*/
USTRUCT()
struct NAKEDDESIRE_API FItemSaveRecord
{
@@ -14,25 +20,16 @@ struct NAKEDDESIRE_API FItemSaveRecord
UPROPERTY(SaveGame)
FGuid InstanceId;
UPROPERTY(SaveGame)
TSoftObjectPtr<UClothingItem> Definition;
TSoftObjectPtr<UItemDefinition> Definition;
UPROPERTY(SaveGame)
float Condition = 1.0f;
FInstancedStruct State;
UPROPERTY(SaveGame)
FGuid ParentId;
UPROPERTY(SaveGame)
FTransform WorldTransform;
void Init(const UClothingItemInstance* ClothingItemInstance);
};
inline void FItemSaveRecord::Init(const UClothingItemInstance* ClothingItemInstance)
{
InstanceId = ClothingItemInstance->GetInstanceId();
Definition = ClothingItemInstance->GetClothingItem();
Condition = ClothingItemInstance->Condition;
}
};