Live Config
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ULiveConfigSystem Class Reference

#include <LiveConfigSystem.h>

Inheritance diagram for ULiveConfigSystem:

Public Member Functions

virtual void Initialize (FSubsystemCollectionBase &Collection) override
 
virtual void Deinitialize () override
 
virtual bool ShouldCreateSubsystem (UObject *Outer) const override
 
void SaveProperty (const FLiveConfigPropertyDefinition &PropertyDefinition)
 
bool UpdateStructProperties (const FLiveConfigPropertyDefinition &PropertyDefinition)
 
void SavePropertyDeferred (const FLiveConfigPropertyDefinition &PropertyDefinition)
 
void RenameProperty (FLiveConfigProperty OldName, FLiveConfigProperty NewName, bool bCreateRedirector=false)
 
void DeleteProperty (FLiveConfigProperty Property)
 
FString GetStringValue (FLiveConfigProperty Key) const
 
float GetFloatValue (FLiveConfigProperty Key) const
 
int32 GetIntValue (FLiveConfigProperty Key) const
 
bool GetBoolValue (FLiveConfigProperty Key) const
 
template<typename T >
GetLiveConfigStruct (FLiveConfigProperty StructProperty) const
 
template<typename T >
GetLiveConfigValue (FLiveConfigProperty Property) const
 
void GetLiveConfigStruct_Internal (class UScriptStruct *Struct, void *OutStructPtr, FLiveConfigProperty Prefix) const
 
void GetStructPropertyMembers (FLiveConfigProperty StructProperty, TArray< FLiveConfigProperty > &OutProperties)
 
void GetSubProperties (FName PropertyPath, TArray< FLiveConfigProperty > &OutProperties)
 
bool IsDataReady () const
 
void PatchEnvironmentOverrides (const FLiveConfigProfile &InProfile)
 
void SyncRemoteToLocal ()
 
TArray< FLiveConfigPropertyDefinitionGetProfileDiff (const FLiveConfigProfile &Profile)
 
const TArray< FLiveConfigPropertyDefinition > & SaveProperties (const TArray< FLiveConfigPropertyDefinition > &Properties)
 
FString GetDiffString (const TArray< FLiveConfigPropertyDefinition > &Diff)
 
FText GetDiffText (const TArray< FLiveConfigPropertyDefinition > &Diff)
 
void DownloadConfig ()
 
void RebuildConfigCache ()
 
void RebuildConfigCache (const FLiveConfigProfile &Profile)
 
const TMap< FLiveConfigProperty, FLiveConfigPropertyDefinition > & GetAllProperties () const
 
void RedirectPropertyName (FLiveConfigProperty &Property) const
 
void RemoveRedirect (FName OldPropertyName)
 
void HandleTagsChanged ()
 

Static Public Member Functions

static ULiveConfigSystemGet ()
 
static bool DoesPropertyNameExist (FLiveConfigProperty PropertyName)
 
static void GetActiveSource (ELiveConfigSourceType &OutSourceType, FString &OutSourcePath)
 

Public Attributes

FOnLiveConfigPropertiesUpdated OnPropertiesUpdated
 
FSimpleMulticastDelegate OnTagsChanged
 
FSimpleMulticastDelegate OnRemoteOverridesLoaded
 
FOnRemoteSyncDetected OnDataProviderSync
 
TMap< FLiveConfigProperty, FLiveConfigPropertyDefinitionPropertyDefinitions
 
TArray< FName > PropertyTags
 
TMap< FName, FName > PropertyRedirects
 

Detailed Description

A subsystem to download configuration data from a public Google Sheet URL (published as CSV). It populates a TMap which can be queried for string, float, or int values.

Member Function Documentation

◆ Get()

ULiveConfigSystem & ULiveConfigSystem::Get ( )
static

note - if using this very early during startup (eg from another UEngineSubsystem::Initialize) consider using GEngine->GetEngineSubsystem<ULiveConfigSystem>() to check

Returns
Checked reference to the live config engine subsystem

◆ GetActiveSource()

void ULiveConfigSystem::GetActiveSource ( ELiveConfigSourceType &  OutSourceType,
FString &  OutSourcePath 
)
static

Gets the active source type and path from user settings or project default

◆ GetAllProperties()

const TMap< FLiveConfigProperty, FLiveConfigPropertyDefinition > & ULiveConfigSystem::GetAllProperties ( ) const

Get all available row names (public for editor access)

◆ GetBoolValue()

bool ULiveConfigSystem::GetBoolValue ( FLiveConfigProperty  Key) const

Gets a configuration value as a boolean.

◆ GetDiffText()

FText ULiveConfigSystem::GetDiffText ( const TArray< FLiveConfigPropertyDefinition > &  Diff)
Parameters
DiffProperties which will be compared to base system values
Returns
Diff represented as "PropertyName: Old -> New" joined by line

◆ GetFloatValue()

float ULiveConfigSystem::GetFloatValue ( FLiveConfigProperty  Key) const

Gets a configuration value as a float.

◆ GetIntValue()

int32 ULiveConfigSystem::GetIntValue ( FLiveConfigProperty  Key) const

Gets a configuration value as an integer.

◆ GetLiveConfigStruct()

template<typename T >
T ULiveConfigSystem::GetLiveConfigStruct ( FLiveConfigProperty  StructProperty) const
inline

Look up values for a struct's properties using the property name as a prefix for its members. Each UProperty in the struct will be looked up as StructProperty.PropertyName.

◆ GetLiveConfigValue()

template<typename T >
T ULiveConfigSystem::GetLiveConfigValue ( FLiveConfigProperty  Property) const
inline
Template Parameters
TMust be a numeric type, bool, or string. Does NOT support structs
Parameters
PropertyProperty key to lookup - may be implicitly converted

◆ GetProfileDiff()

TArray< FLiveConfigPropertyDefinition > ULiveConfigSystem::GetProfileDiff ( const FLiveConfigProfile Profile)
Returns
Properties from @Profile that did not already match the base config

◆ GetStringValue()

FString ULiveConfigSystem::GetStringValue ( FLiveConfigProperty  Key) const

Gets a configuration value as a string.

Parameters
KeyThe CVar-like name to look up.
Returns
The found value or the default from property definition.

◆ GetSubProperties()

void ULiveConfigSystem::GetSubProperties ( FName  PropertyPath,
TArray< FLiveConfigProperty > &  OutProperties 
)
Parameters
PropertyPathPath to the property folder, with a trailing "." or not
OutPropertiesAll properties within PropertyPath

◆ IsDataReady()

bool ULiveConfigSystem::IsDataReady ( ) const
inline

Returns true if the data has been successfully downloaded and parsed.

◆ PatchEnvironmentOverrides()

void ULiveConfigSystem::PatchEnvironmentOverrides ( const FLiveConfigProfile InProfile)

Patch in environment overrides. This can be called at any time to update the environment layer.

◆ RebuildConfigCache()

void ULiveConfigSystem::RebuildConfigCache ( )

Refresh properties from editor settings

◆ RedirectPropertyName()

void ULiveConfigSystem::RedirectPropertyName ( FLiveConfigProperty Property) const

Redirects a property name based on the redirectors map

◆ RemoveRedirect()

void ULiveConfigSystem::RemoveRedirect ( FName  OldPropertyName)

Removes a specific redirect from the map and saves the config

Parameters
OldPropertyNameThe old property name to remove from redirects

◆ RenameProperty()

void ULiveConfigSystem::RenameProperty ( FLiveConfigProperty  OldName,
FLiveConfigProperty  NewName,
bool  bCreateRedirector = false 
)

Renames an existing property and its associated files on disk. If the property is a struct, it will also rename all its members.

Parameters
OldNameCurrent name of the property
NewNameNew name for the property
bCreateRedirectorWhether to create a redirector from the old name to the new name

◆ SaveProperties()

const TArray< FLiveConfigPropertyDefinition > & ULiveConfigSystem::SaveProperties ( const TArray< FLiveConfigPropertyDefinition > &  Properties)

Saves @Properties to files

Returns
Input for chaining

◆ SaveProperty()

void ULiveConfigSystem::SaveProperty ( const FLiveConfigPropertyDefinition PropertyDefinition)
Parameters
PropertyDefinitionProperty to be added or updated. Will be saved to file

◆ SavePropertyDeferred()

void ULiveConfigSystem::SavePropertyDeferred ( const FLiveConfigPropertyDefinition PropertyDefinition)

Like @SaveProperty, but don't rebuild the cache right away

◆ SyncRemoteToLocal()

void ULiveConfigSystem::SyncRemoteToLocal ( )

Fetches the latest remote config and updates local JSON files if changes are detected, regardless of the current SyncMode setting.

◆ UpdateStructProperties()

bool ULiveConfigSystem::UpdateStructProperties ( const FLiveConfigPropertyDefinition PropertyDefinition)

Updates the struct property represented by @PropertyDefinition, creating its subproperties and deleting any old ones

Parameters
PropertyDefinitionStruct property
Returns
True if anything changed

Member Data Documentation

◆ OnDataProviderSync

FOnRemoteSyncDetected ULiveConfigSystem::OnDataProviderSync

Broadcast when remote sync detects changes (for editor notification system)

◆ OnRemoteOverridesLoaded

FSimpleMulticastDelegate ULiveConfigSystem::OnRemoteOverridesLoaded

Broadcasted on the first load of external overrides


The documentation for this class was generated from the following files: