Clothing system refactor
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user