// Copyright (C) 2024 Jordon Brooks #pragma once #include "CoreMinimal.h" #include "Enums/Profile.h" #include "Structs/SettingsProfile.h" #include "UObject/Object.h" #include "HarmonyLinkGraphics.generated.h" /** * */ UCLASS(Blueprintable, config="HarmonyLink") class HARMONYLINK_API UHarmonyLinkGraphics : public UObject { GENERATED_BODY() public: UHarmonyLinkGraphics(); UFUNCTION(BlueprintCallable, Category="HarmonyLink Settings") void LoadConfig(const bool bForceReload = false); UFUNCTION(BlueprintCallable, Category="HarmonyLink Settings") void SaveConfig() const; UFUNCTION(BlueprintCallable, Category="HarmonyLink Settings", meta=(bCheckForCommandLineOverrides=true)) void ApplySettings(bool bCheckForCommandLineOverrides = true); /** Returns the game local machine settings (resolution, windowing mode, scalability settings, etc...) */ UFUNCTION(BlueprintCallable, Category="HarmonyLink Settings") static UHarmonyLinkGraphics* GetSettings(); static void DestroySettings(); private: void CreateDefaultConfigFile(); bool LoadSettingsFromConfig(); bool LoadSection(const FConfigFile& ConfigFile, const TPair Profile); void SaveSection(FSettingsProfile& SettingsProfile, const bool bFlush = false) const; void LoadDefaults(); void DebugPrintProfiles() const; static void PrintDebugSection(FSettingsProfile& SettingsProfile); static void ResetInstance(); static FString IniLocation; TMap ProfileNames = { {EProfile::BATTERY, "Battery"}, {EProfile::CHARGING, "Charging"}, {EProfile::DOCKED, "Docked"}, }; TMap Profiles; static TMap> DefaultSettings; static UHarmonyLinkGraphics* Instance; };