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
@@ -6,8 +6,8 @@
#include "GlobalSaveGameData.h"
#include "ItemSaveRecord.h"
#include "StartingSaveData.h"
#include "NakedDesire/Clothing/ClothingItem.h"
#include "NakedDesire/Clothing/ClothingItemInstance.h"
#include "NakedDesire/Items/ItemDefinition.h"
#include "NakedDesire/Items/ItemInstance.h"
#include "NakedDesire/Global/NakedDesireGameInstance.h"
void USaveSubsystem::LoadGame(const FString& SlotName)
@@ -62,14 +62,15 @@ void USaveSubsystem::PopulateStartingData(UGlobalSaveGameData* Save) const
if (!GameInstance || !GameInstance->StartingSaveData)
return;
for (UClothingItem* ClothingDef : GameInstance->StartingSaveData->StartingClothing)
for (UItemDefinition* Definition : GameInstance->StartingSaveData->StartingItems)
{
if (!ClothingDef)
if (!Definition)
continue;
UItemInstance* Instance = Definition->CreateInstance(Save);
if (!Instance)
continue;
// TODO: Refactor. Skip converting to ClothingItemInstance
UClothingItemInstance* Instance = NewObject<UClothingItemInstance>(Save);
Instance->Init(ClothingDef);
Save->AddEquippedItem(Instance);
}
}