Live Config
Loading...
Searching...
No Matches
LiveConfigProfileSystem.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 "LiveConfigProfile.h"
9#include "LiveConfigProfileSystem.generated.h"
10
11DECLARE_LOG_CATEGORY_EXTERN(LogLiveConfigProfile, Log, All);
12
13DECLARE_MULTICAST_DELEGATE_OneParam(FOnLiveConfigProfileChanged, const FLiveConfigProfile&);
14
15UCLASS(BlueprintType)
16class LIVECONFIG_API ULiveConfigProfileSystem : public UEngineSubsystem
17{
18 GENERATED_BODY()
19
20public:
21 static ULiveConfigProfileSystem* Get();
22
23 virtual void Initialize(FSubsystemCollectionBase& Collection) override;
24
25 UFUNCTION(BlueprintCallable, Category = "Live Config|Profiles")
26 void SaveProfile(const FLiveConfigProfile& Profile);
27
28 UFUNCTION(BlueprintCallable, Category = "Live Config|Profiles")
29 bool LoadProfile(FName ProfileName, FLiveConfigProfile& OutProfile);
30
31 UFUNCTION(BlueprintCallable, Category = "Live Config|Profiles")
32 void DeleteProfile(FName ProfileName);
33
34 UFUNCTION(BlueprintCallable, Category = "Live Config|Profiles")
35 TArray<FName> GetAllProfileNames() const;
36
37 UFUNCTION(BlueprintCallable, Category = "Live Config|Profiles")
38 void SetActiveProfile(FName ProfileName);
39
44 void SetActiveProfileData(const FLiveConfigProfile& Profile);
45
46 void SetActiveProfileData_NoReplication(const FLiveConfigProfile& Profile);
47
48 UFUNCTION(BlueprintCallable, Category = "Live Config|Profiles")
49 const FLiveConfigProfile& GetActiveProfile() const { return ActiveProfile; }
50
51 FOnLiveConfigProfileChanged OnProfileChanged;
52
53 static FString GetProfilesDirectory();
54 static FString GetProfilePath(FName ProfileName);
55
56private:
57 void PopulateAutoCompleteEntries(TArray<struct FAutoCompleteCommand>& Entries);
58
59 FLiveConfigProfile ActiveProfile;
60};
Definition LiveConfigProfileSystem.h:17
Definition LiveConfigProfile.h:24