From 9469bed75081d5cb8fab83bf4455bb5eadff6db5 Mon Sep 17 00:00:00 2001 From: lucoiso Date: Fri, 24 May 2024 23:00:24 +0100 Subject: [PATCH] UE5.4.1 --- ElementusInventory.uplugin | 4 ++-- .../Actors/ElementusInventoryPackage.cpp | 2 +- .../ElementusInventoryComponent.cpp | 24 +++++++++---------- .../ElementusInventoryFunctions.cpp | 4 ++-- .../Private/SElementusItemCreator.cpp | 8 +++---- .../Private/SElementusItemCreator.h | 6 ++--- 6 files changed, 23 insertions(+), 25 deletions(-) diff --git a/ElementusInventory.uplugin b/ElementusInventory.uplugin index 421bb3c..d546a91 100644 --- a/ElementusInventory.uplugin +++ b/ElementusInventory.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, - "Version": 8, - "VersionName": "1.1.10", + "Version": 9, + "VersionName": "1.1.11", "FriendlyName": "Elementus Inventory", "Description": "Plugin that provides a Data-Driven Inventory & Items system based on FPrimaryAssetIds and the Asset Manager.", "Category": "Game Features", diff --git a/Source/ElementusInventory/Private/Actors/ElementusInventoryPackage.cpp b/Source/ElementusInventory/Private/Actors/ElementusInventoryPackage.cpp index babdea2..093c419 100644 --- a/Source/ElementusInventory/Private/Actors/ElementusInventoryPackage.cpp +++ b/Source/ElementusInventory/Private/Actors/ElementusInventoryPackage.cpp @@ -106,6 +106,6 @@ void AElementusInventoryPackage::BeginPackageDestruction_Implementation() { UE_LOG(LogElementusInventory_Internal, Warning, TEXT("ElementusInventory - %s: Package %s was not destroyed because the " "option 'bDestroyWhenInventoryIsEmpty' was disabled"), - *FString(__func__), *GetName()); + *FString(__FUNCTION__), *GetName()); } } diff --git a/Source/ElementusInventory/Private/Components/ElementusInventoryComponent.cpp b/Source/ElementusInventory/Private/Components/ElementusInventoryComponent.cpp index 4b3f5b6..ac1ea8f 100644 --- a/Source/ElementusInventory/Private/Components/ElementusInventoryComponent.cpp +++ b/Source/ElementusInventory/Private/Components/ElementusInventoryComponent.cpp @@ -83,7 +83,7 @@ bool UElementusInventoryComponent::CanReceiveItem(const FElementusItemInfo InIte if (!bOutput) { - UE_LOG(LogElementusInventory, Warning, TEXT("%s: Actor %s cannot receive %d item(s) with name '%s'"), *FString(__func__), + UE_LOG(LogElementusInventory, Warning, TEXT("%s: Actor %s cannot receive %d item(s) with name '%s'"), *FString(__FUNCTION__), *GetOwner()->GetName(), InItemInfo.Quantity, *InItemInfo.ItemId.ToString()); } @@ -108,7 +108,7 @@ bool UElementusInventoryComponent::CanGiveItem(const FElementusItemInfo InItemIn return Quantity >= InItemInfo.Quantity; } - UE_LOG(LogElementusInventory, Warning, TEXT("%s: Actor %s cannot give %d item(s) with name '%s'"), *FString(__func__), *GetOwner()->GetName(), + UE_LOG(LogElementusInventory, Warning, TEXT("%s: Actor %s cannot give %d item(s) with name '%s'"), *FString(__FUNCTION__), *GetOwner()->GetName(), InItemInfo.Quantity, *InItemInfo.ItemId.ToString()); return false; @@ -129,8 +129,6 @@ void UElementusInventoryComponent::SortInventory(const EElementusInventorySortin default: return false; } - - return false; }; switch (Mode) @@ -522,17 +520,17 @@ bool UElementusInventoryComponent::IsInventoryEmpty() const void UElementusInventoryComponent::DebugInventory() { #if !UE_BUILD_SHIPPING - UE_LOG(LogElementusInventory_Internal, Warning, TEXT("%s"), *FString(__func__)); + UE_LOG(LogElementusInventory_Internal, Warning, TEXT("%s"), *FString(__FUNCTION__)); UE_LOG(LogElementusInventory_Internal, Warning, TEXT("Owning Actor: %s"), *GetOwner()->GetName()); - UE_LOG(LogElementusInventory_Internal, Warning, TEXT("Weight: %d"), CurrentWeight); - UE_LOG(LogElementusInventory_Internal, Warning, TEXT("Num: %d"), ElementusItems.Num()); - UE_LOG(LogElementusInventory_Internal, Warning, TEXT("Size: %d"), ElementusItems.GetAllocatedSize()); + UE_LOG(LogElementusInventory_Internal, Warning, TEXT("Weight: %f"), CurrentWeight); + UE_LOG(LogElementusInventory_Internal, Warning, TEXT("Num: %i"), ElementusItems.Num()); + UE_LOG(LogElementusInventory_Internal, Warning, TEXT("Size: %i"), ElementusItems.GetAllocatedSize()); for (const FElementusItemInfo& Iterator : ElementusItems) { UE_LOG(LogElementusInventory_Internal, Warning, TEXT("Item: %s"), *Iterator.ItemId.ToString()); - UE_LOG(LogElementusInventory_Internal, Warning, TEXT("Quantity: %d"), Iterator.Quantity); + UE_LOG(LogElementusInventory_Internal, Warning, TEXT("Quantity: %i"), Iterator.Quantity); for (const FGameplayTag& Tag : Iterator.Tags) { @@ -540,13 +538,13 @@ void UElementusInventoryComponent::DebugInventory() } } - UE_LOG(LogElementusInventory_Internal, Warning, TEXT("Component Memory Size: %d"), GetResourceSizeBytes(EResourceSizeMode::EstimatedTotal)); + UE_LOG(LogElementusInventory_Internal, Warning, TEXT("Component Memory Size: %ull"), GetResourceSizeBytes(EResourceSizeMode::EstimatedTotal)); #endif } void UElementusInventoryComponent::ClearInventory_Implementation() { - UE_LOG(LogElementusInventory, Display, TEXT("%s: Cleaning %s's inventory"), *FString(__func__), *GetOwner()->GetName()); + UE_LOG(LogElementusInventory, Display, TEXT("%s: Cleaning %s's inventory"), *FString(__FUNCTION__), *GetOwner()->GetName()); ElementusItems.Empty(); CurrentWeight = 0.f; @@ -677,7 +675,7 @@ void UElementusInventoryComponent::UpdateElementusItems(const TArray ElementusItems.Num()) { - UE_LOG(LogElementusInventory_Internal, Warning, TEXT("%s: Item with name '%s' not found in inventory"), *FString(__func__), + UE_LOG(LogElementusInventory_Internal, Warning, TEXT("%s: Item with name '%s' not found in inventory"), *FString(__FUNCTION__), *Iterator.ItemInfo.ItemId.ToString()); continue; diff --git a/Source/ElementusInventory/Private/Management/ElementusInventoryFunctions.cpp b/Source/ElementusInventory/Private/Management/ElementusInventoryFunctions.cpp index a55e7dc..c2f3f00 100644 --- a/Source/ElementusInventory/Private/Management/ElementusInventoryFunctions.cpp +++ b/Source/ElementusInventory/Private/Management/ElementusInventoryFunctions.cpp @@ -108,7 +108,7 @@ TArray UElementusInventoryFunctions::SearchElementusItemDat for (UElementusItemData* const& Iterator : ReturnedValues) { - UE_LOG(LogElementusInventory_Internal, Display, TEXT("%s: Filtering items. Current iteration: id %s and name %s"), *FString(__func__), + UE_LOG(LogElementusInventory_Internal, Display, TEXT("%s: Filtering items. Current iteration: id %s and name %s"), *FString(__FUNCTION__), *FString::FromInt(Iterator->ItemId), *Iterator->ItemName.ToString()); bool bAddItem = false; @@ -133,7 +133,7 @@ TArray UElementusInventoryFunctions::SearchElementusItemDat if (bAddItem) { UE_LOG(LogElementusInventory_Internal, Display, TEXT("%s: Item with id %s and name %s matches the search parameters"), - *FString(__func__), *FString::FromInt(Iterator->ItemId), *Iterator->ItemName.ToString()); + *FString(__FUNCTION__), *FString::FromInt(Iterator->ItemId), *Iterator->ItemName.ToString()); Output.Add(Iterator); } diff --git a/Source/ElementusInventoryEditor/Private/SElementusItemCreator.cpp b/Source/ElementusInventoryEditor/Private/SElementusItemCreator.cpp index a341c7f..9081db7 100644 --- a/Source/ElementusInventoryEditor/Private/SElementusItemCreator.cpp +++ b/Source/ElementusInventoryEditor/Private/SElementusItemCreator.cpp @@ -124,7 +124,7 @@ TSharedRef SElementusItemCreator::ConstructContent() + SGridPanel::Slot(1, 5).Padding(SlotPadding) [ SNew(STextComboBox).OptionsSource(&ItemTypesArr).OnSelectionChanged_Lambda( - [this](const FTextDisplayStringPtr& InStr, [[maybe_unused]] ESelectInfo::Type) + [this](const TSharedPtr& InStr, [[maybe_unused]] ESelectInfo::Type) { ItemType = ItemTypesArr.Find(InStr); }) @@ -208,7 +208,7 @@ TSharedRef SElementusItemCreator::ConstructContent() + SHorizontalBox::Slot() [ SNew(STextComboBox).OptionsSource(&AssetFoldersArr).OnSelectionChanged_Lambda( - [this](const FTextDisplayStringPtr& InStr, [[maybe_unused]] ESelectInfo::Type) + [this](const TSharedPtr& InStr, [[maybe_unused]] ESelectInfo::Type) { AssetFolder = FName(*InStr.Get()); }) @@ -357,9 +357,9 @@ bool SElementusItemCreator::IsCreateEnabled() const return false; } -TArray SElementusItemCreator::GetEnumValuesAsStringArray() const +TArray> SElementusItemCreator::GetEnumValuesAsStringArray() const { - TArray EnumValues; + TArray> EnumValues; for (uint32 Iterator = 0; Iterator < static_cast(EElementusItemType::MAX); Iterator++) { EnumValues.Add(MakeShared(UElementusInventoryFunctions::ElementusItemEnumTypeToString(static_cast(Iterator)))); diff --git a/Source/ElementusInventoryEditor/Private/SElementusItemCreator.h b/Source/ElementusInventoryEditor/Private/SElementusItemCreator.h index 337df06..e62cff6 100644 --- a/Source/ElementusInventoryEditor/Private/SElementusItemCreator.h +++ b/Source/ElementusInventoryEditor/Private/SElementusItemCreator.h @@ -31,12 +31,12 @@ class SElementusItemCreator final : public SCompoundWidget FReply HandleCreateItemButtonClicked() const; bool IsCreateEnabled() const; - TArray GetEnumValuesAsStringArray() const; + TArray> GetEnumValuesAsStringArray() const; TMap> ObjectMap; TSharedPtr ImageIcon_ThumbnailPool; - TArray ItemTypesArr; - TArray AssetFoldersArr; + TArray> ItemTypesArr; + TArray> AssetFoldersArr; FName AssetName; FName AssetFolder;