Live Config
Loading...
Searching...
No Matches
LiveConfigJson.h
1// Copyright (c) 2026 Nicholas Arthur
2// Licensed under the MIT License
3
4#pragma once
5
6#include "CoreMinimal.h"
7#include "Subsystems/EngineSubsystem.h"
8#include "LiveConfigSystem.h"
9#include "LiveConfigJson.generated.h"
10
14UCLASS(BlueprintType)
15class LIVECONFIG_API ULiveConfigJsonSystem : public UEngineSubsystem
16{
17 GENERATED_BODY()
18public:
19 static ULiveConfigJsonSystem* Get();
20
21 virtual void Initialize(FSubsystemCollectionBase& Collection) override;
22
23 void LoadJsonFromFiles();
24
25 UFUNCTION(Exec)
26 void VerifyJsonIntegrity();
27
28 void SavePropertyToFile(const FLiveConfigPropertyDefinition& PropertyDefinition);
29 void DeletePropertyFile(FName PropertyName);
30 void RenamePropertyOnDisk(FName OldPropertyName, FName NewPropertyName);
31
32 static FString GetPropertyPath(FName PropertyName);
33 static FString GetLiveConfigDirectory();
34
35 // for testing
36 bool bDisableFileOperations = false;
37private:
38 void LoadJsonFromDirectory(const FString& Dir);
39 void LoadJsonFromFile(const FString& Path, const FString& FileName);
40
41 void QueueSave();
42 bool OnTick(float DeltaTime);
43
44 TMap<FName, FLiveConfigPropertyDefinition> QueuedSaves;
45 TSet<FName> QueuedDeletions;
46 FTSTicker::FDelegateHandle TickHandle;
47};
Definition LiveConfigJson.h:16
Definition LiveConfigTypes.h:34