Files
UnrealEngineUWP/Engine/Source/Runtime/DeveloperSettings/Private/DeveloperSettingsModule.cpp

23 lines
486 B
C++
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
#include "Modules/ModuleManager.h"
Project Settings - Adding a way to easily introduce per platform settings objects that are correctly saved outside the game ini, and instead store their configuration to each platform's NDA'ed location, if they're a confidential platform. These platform options are kept in sync with what platforms you have enabled for your project (though a restart is required to see that reflected in the settings). The base class of any per platform settings. The pattern for using these is as follows. Step 1) Subclass UPlatformSettings, UMyPerPlatformSettings : public UPlatformSettings. Step 2) For your system should already have a UDeveloperSettings that you created so that users can customize other properties for your system in the project. On that class you need to create a property of type FPerPlatformSettings, e.g. UPROPERTY(EditAnywhere, Category=Platform) FPerPlatformSettings PlatformOptions Step 3) In your UDeveloperSettings subclasses construct, there should be a line like this, PlatformOptions.Settings = UPlatformSettings::GetAllPlatformSettings<UMyPerPlatformSettings>(); This will actually ensure that you initialize the settings exposed in the editor to whatever the current platform configuration is for them. Step 4) Nothing else needed. In your system code, you will just call UMyPerPlatformSettings* MySettings = UPlatformSettings::GetSettingsForPlatform<UMyPerPlatformSettings>() that will get you the current settings for the active platform, or the simulated platform in the editor. #review-16603960 Josh.Adams, Michael.Noland, Daren.Cheng #fyi Josh.Adams, Michael.Noland, Daren.Cheng [CL 16603959 by Nick Darnell in ue5-main branch]
2021-06-09 09:14:21 -04:00
#include "Modules/ModuleInterface.h"
Project Settings - Adding a way to easily introduce per platform settings objects that are correctly saved outside the game ini, and instead store their configuration to each platform's NDA'ed location, if they're a confidential platform. These platform options are kept in sync with what platforms you have enabled for your project (though a restart is required to see that reflected in the settings). The base class of any per platform settings. The pattern for using these is as follows. Step 1) Subclass UPlatformSettings, UMyPerPlatformSettings : public UPlatformSettings. Step 2) For your system should already have a UDeveloperSettings that you created so that users can customize other properties for your system in the project. On that class you need to create a property of type FPerPlatformSettings, e.g. UPROPERTY(EditAnywhere, Category=Platform) FPerPlatformSettings PlatformOptions Step 3) In your UDeveloperSettings subclasses construct, there should be a line like this, PlatformOptions.Settings = UPlatformSettings::GetAllPlatformSettings<UMyPerPlatformSettings>(); This will actually ensure that you initialize the settings exposed in the editor to whatever the current platform configuration is for them. Step 4) Nothing else needed. In your system code, you will just call UMyPerPlatformSettings* MySettings = UPlatformSettings::GetSettingsForPlatform<UMyPerPlatformSettings>() that will get you the current settings for the active platform, or the simulated platform in the editor. #review-16603960 Josh.Adams, Michael.Noland, Daren.Cheng #fyi Josh.Adams, Michael.Noland, Daren.Cheng [CL 16603959 by Nick Darnell in ue5-main branch]
2021-06-09 09:14:21 -04:00
class FDeveloperSettingsModule : public IModuleInterface
{
public:
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
};
void FDeveloperSettingsModule::StartupModule()
{
}
void FDeveloperSettingsModule::ShutdownModule()
{
}
IMPLEMENT_MODULE(FDeveloperSettingsModule, DeveloperSettings );