Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
UE5.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lucoiso committed May 24, 2024
1 parent ea63ca8 commit 9469bed
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 25 deletions.
4 changes: 2 additions & 2 deletions ElementusInventory.uplugin
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand All @@ -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;
Expand All @@ -129,8 +129,6 @@ void UElementusInventoryComponent::SortInventory(const EElementusInventorySortin
default:
return false;
}

return false;
};

switch (Mode)
Expand Down Expand Up @@ -522,31 +520,31 @@ 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)
{
UE_LOG(LogElementusInventory_Internal, Warning, TEXT("Tag: %s"), *Tag.ToString());
}
}

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;
Expand Down Expand Up @@ -677,7 +675,7 @@ void UElementusInventoryComponent::UpdateElementusItems(const TArray<FElementusI
FElementusItemInfo LastCheckedItem;
for (const FElementusItemInfo& Iterator : Modifiers)
{
UE_LOG(LogElementusInventory_Internal, Display, TEXT("%s: %s %d item(s) with name '%s' %s inventory"), *FString(__func__), *OpStr,
UE_LOG(LogElementusInventory_Internal, Display, TEXT("%s: %s %d item(s) with name '%s' %s inventory"), *FString(__FUNCTION__), *OpStr,
Iterator.Quantity, *Iterator.ItemId.ToString(), *OpPred);

if (Iterator != LastCheckedItem)
Expand Down Expand Up @@ -753,7 +751,7 @@ void UElementusInventoryComponent::Server_ProcessInventoryRemoval_Internal_Imple
{
if (Iterator.Index == INDEX_NONE || Iterator.Index > 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ TArray<UElementusItemData*> 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;
Expand All @@ -133,7 +133,7 @@ TArray<UElementusItemData*> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ TSharedRef<SWidget> 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<FString>& InStr, [[maybe_unused]] ESelectInfo::Type)
{
ItemType = ItemTypesArr.Find(InStr);
})
Expand Down Expand Up @@ -208,7 +208,7 @@ TSharedRef<SWidget> SElementusItemCreator::ConstructContent()
+ SHorizontalBox::Slot()
[
SNew(STextComboBox).OptionsSource(&AssetFoldersArr).OnSelectionChanged_Lambda(
[this](const FTextDisplayStringPtr& InStr, [[maybe_unused]] ESelectInfo::Type)
[this](const TSharedPtr<FString>& InStr, [[maybe_unused]] ESelectInfo::Type)
{
AssetFolder = FName(*InStr.Get());
})
Expand Down Expand Up @@ -357,9 +357,9 @@ bool SElementusItemCreator::IsCreateEnabled() const
return false;
}

TArray<FTextDisplayStringPtr> SElementusItemCreator::GetEnumValuesAsStringArray() const
TArray<TSharedPtr<FString>> SElementusItemCreator::GetEnumValuesAsStringArray() const
{
TArray<FTextDisplayStringPtr> EnumValues;
TArray<TSharedPtr<FString>> EnumValues;
for (uint32 Iterator = 0; Iterator < static_cast<uint32>(EElementusItemType::MAX); Iterator++)
{
EnumValues.Add(MakeShared<FString>(UElementusInventoryFunctions::ElementusItemEnumTypeToString(static_cast<EElementusItemType>(Iterator))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ class SElementusItemCreator final : public SCompoundWidget
FReply HandleCreateItemButtonClicked() const;
bool IsCreateEnabled() const;

TArray<FTextDisplayStringPtr> GetEnumValuesAsStringArray() const;
TArray<TSharedPtr<FString>> GetEnumValuesAsStringArray() const;

TMap<int32, TWeakObjectPtr<class UObject>> ObjectMap;
TSharedPtr<class FAssetThumbnailPool> ImageIcon_ThumbnailPool;
TArray<FTextDisplayStringPtr> ItemTypesArr;
TArray<FTextDisplayStringPtr> AssetFoldersArr;
TArray<TSharedPtr<FString>> ItemTypesArr;
TArray<TSharedPtr<FString>> AssetFoldersArr;

FName AssetName;
FName AssetFolder;
Expand Down

0 comments on commit 9469bed

Please sign in to comment.