Skip to content

Commit

Permalink
Finish tag additions from table, tested in SMLFeatureTests. Registry …
Browse files Browse the repository at this point in the history
…freezing still not working
  • Loading branch information
budak7273 committed Aug 10, 2024
1 parent 45b07d8 commit ade51ad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Mods/SML/SML.uplugin
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
12 changes: 11 additions & 1 deletion Mods/SML/Source/SML/Private/Registry/ContentTagRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<FContentTagRegistryAddition*> 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() {
Expand Down
7 changes: 5 additions & 2 deletions Mods/SML/Source/SML/Public/Registry/ContentTagRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -15,12 +16,12 @@ struct SML_API FContentTagRegistryAddition : public FTableRowBase {
GENERATED_BODY()

FContentTagRegistryAddition() :
ItemClass(nullptr),
Class(nullptr),
TagContainer(FGameplayTagContainer::EmptyContainer)
{}

UPROPERTY(EditAnywhere, BlueprintReadWrite)
TSubclassOf<UObject> ItemClass;
TSubclassOf<UObject> Class;

UPROPERTY(EditAnywhere, BlueprintReadWrite)
FGameplayTagContainer TagContainer;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit ade51ad

Please sign in to comment.