diff --git a/Mods/SML/SML.uplugin b/Mods/SML/SML.uplugin index e645ff3a1f..253f58e0b9 100644 --- a/Mods/SML/SML.uplugin +++ b/Mods/SML/SML.uplugin @@ -1,8 +1,8 @@ { "FileVersion": 3, "Version": 3, - "VersionName": "3.7.0", - "SemVersion": "3.7.0", + "VersionName": "3.8.0-robb-dev", + "SemVersion": "3.8.0-robb-dev", "GameVersion": ">=269772", "FriendlyName": "Satisfactory Mod Loader", "Description": "Mod loading and compatibility API for Satisfactory", diff --git a/Mods/SML/Source/SML/Private/Registry/ContentTagRegistry.cpp b/Mods/SML/Source/SML/Private/Registry/ContentTagRegistry.cpp index b03aa9d257..a2677b49d1 100644 --- a/Mods/SML/Source/SML/Private/Registry/ContentTagRegistry.cpp +++ b/Mods/SML/Source/SML/Private/Registry/ContentTagRegistry.cpp @@ -118,7 +118,17 @@ void UContentTagRegistry::RegisterTagAdditionTable(FName ModReference, UDataTabl return; } - UE_LOG(LogContentTagRegistry, Verbose, TEXT("TODO Registering tag addition table '%s' from mod %s"), *TagTable->GetPathName(), *ModReference.ToString()); + ApplyTagsFromTable(ModReference, TagTable); +} + +void UContentTagRegistry::ApplyTagsFromTable(FName ModReference, UDataTable* TagTable) { + UE_LOG(LogContentTagRegistry, Verbose, TEXT("Registering tag addition table '%s' from mod %s"), *TagTable->GetPathName(), *ModReference.ToString()); + TArray rows; + TagTable->GetAllRows(TEXT("ContentTagRegistry"), rows); + for (auto row : rows) { + UE_LOG(LogContentTagRegistry, Verbose, TEXT("Processing row. Class '%s' value: %s"), *GetFullNameSafe(row->Class), *row->TagContainer.ToString()); + InternalAddGameplayTagsTo(row->Class, row->TagContainer); + } } void UContentTagRegistry::FreezeRegistry() { diff --git a/Mods/SML/Source/SML/Public/Registry/ContentTagRegistry.h b/Mods/SML/Source/SML/Public/Registry/ContentTagRegistry.h index 4a4e39ca6c..c793a65238 100644 --- a/Mods/SML/Source/SML/Public/Registry/ContentTagRegistry.h +++ b/Mods/SML/Source/SML/Public/Registry/ContentTagRegistry.h @@ -3,6 +3,7 @@ #include "CoreMinimal.h" #include "Subsystems/WorldSubsystem.h" #include "GameplayTagContainer.h" +#include "Engine/DataTable.h" #include "ContentTagRegistry.generated.h" DECLARE_LOG_CATEGORY_EXTERN(LogContentTagRegistry, All, All); // TODO set arg2 to Log once done with feature @@ -15,12 +16,12 @@ struct SML_API FContentTagRegistryAddition : public FTableRowBase { GENERATED_BODY() FContentTagRegistryAddition() : - ItemClass(nullptr), + Class(nullptr), TagContainer(FGameplayTagContainer::EmptyContainer) {} UPROPERTY(EditAnywhere, BlueprintReadWrite) - TSubclassOf ItemClass; + TSubclassOf Class; UPROPERTY(EditAnywhere, BlueprintReadWrite) FGameplayTagContainer TagContainer; @@ -102,6 +103,8 @@ class SML_API UContentTagRegistry : public UWorldSubsystem bool CanModifyTagsOf(const UClass* content, FString& OutMessage); + void ApplyTagsFromTable(FName ModReference, UDataTable* TagTable); + /** * Since tags init is delayed until the first add/fetch operation on that class, * the registry itself must be able to add tags disregarding the freeze.