82 lines
2.7 KiB
C++
82 lines
2.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "DataSource/GameSettingDataSourceDynamic.h" // IWYU pragma: keep
|
|
#include "GameSettingRegistry.h"
|
|
#include "Logging/LogMacros.h"
|
|
#include "Misc/AssertionMacros.h"
|
|
#include "Settings/LyraSettingsLocal.h" // IWYU pragma: keep
|
|
#include "UObject/UObjectGlobals.h"
|
|
|
|
#include "LyraGameSettingRegistry.generated.h"
|
|
|
|
class ULocalPlayer;
|
|
class UObject;
|
|
|
|
//--------------------------------------
|
|
// ULyraGameSettingRegistry
|
|
//--------------------------------------
|
|
|
|
class UGameSettingCollection;
|
|
class ULyraLocalPlayer;
|
|
|
|
DECLARE_LOG_CATEGORY_EXTERN(LogLyraGameSettingRegistry, Log, Log);
|
|
|
|
#define GET_SHARED_SETTINGS_FUNCTION_PATH(FunctionOrPropertyName) \
|
|
MakeShared<FGameSettingDataSourceDynamic>(TArray<FString>({ \
|
|
GET_FUNCTION_NAME_STRING_CHECKED(ULyraLocalPlayer, GetSharedSettings), \
|
|
GET_FUNCTION_NAME_STRING_CHECKED(ULyraSettingsShared, FunctionOrPropertyName) \
|
|
}))
|
|
|
|
#define GET_LOCAL_SETTINGS_FUNCTION_PATH(FunctionOrPropertyName) \
|
|
MakeShared<FGameSettingDataSourceDynamic>(TArray<FString>({ \
|
|
GET_FUNCTION_NAME_STRING_CHECKED(ULyraLocalPlayer, GetLocalSettings), \
|
|
GET_FUNCTION_NAME_STRING_CHECKED(ULyraSettingsLocal, FunctionOrPropertyName) \
|
|
}))
|
|
|
|
/**
|
|
*
|
|
*/
|
|
UCLASS()
|
|
class ULyraGameSettingRegistry : public UGameSettingRegistry
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
ULyraGameSettingRegistry();
|
|
|
|
static ULyraGameSettingRegistry* Get(ULyraLocalPlayer* InLocalPlayer);
|
|
|
|
virtual void SaveChanges() override;
|
|
|
|
protected:
|
|
virtual void OnInitialize(ULocalPlayer* InLocalPlayer) override;
|
|
virtual bool IsFinishedInitializing() const override;
|
|
|
|
UGameSettingCollection* InitializeVideoSettings(ULyraLocalPlayer* InLocalPlayer);
|
|
void InitializeVideoSettings_FrameRates(UGameSettingCollection* Screen, ULyraLocalPlayer* InLocalPlayer);
|
|
void AddPerformanceStatPage(UGameSettingCollection* Screen, ULyraLocalPlayer* InLocalPlayer);
|
|
|
|
UGameSettingCollection* InitializeAudioSettings(ULyraLocalPlayer* InLocalPlayer);
|
|
UGameSettingCollection* InitializeGameplaySettings(ULyraLocalPlayer* InLocalPlayer);
|
|
|
|
UGameSettingCollection* InitializeMouseAndKeyboardSettings(ULyraLocalPlayer* InLocalPlayer);
|
|
UGameSettingCollection* InitializeGamepadSettings(ULyraLocalPlayer* InLocalPlayer);
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UGameSettingCollection> VideoSettings;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UGameSettingCollection> AudioSettings;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UGameSettingCollection> GameplaySettings;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UGameSettingCollection> MouseAndKeyboardSettings;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UGameSettingCollection> GamepadSettings;
|
|
};
|