Files
UnrealEngineUWP/Engine/Source/Runtime/EngineSettings/Private/EngineSettingsModule.cpp
Michael Schoell 9fd1163ee6 Can now modify the Game Mode for the Project Settings from the Blueprints menu on the editor toolbar as well as for the World Settings.
Will help the user checkout/force writable on required config file for editing.

[CL 2299487 by Michael Schoell in Main branch]
2014-09-16 10:40:34 -04:00

111 lines
2.8 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "EngineSettingsPrivatePCH.h"
/**
* Implements the EngineSettings module.
*/
class FEngineSettingsModule
: public IModuleInterface
{
public:
// IModuleInterface interface
virtual void StartupModule( ) override { }
virtual void ShutdownModule( ) override { }
virtual bool SupportsDynamicReloading( ) override
{
return true;
}
};
/* Class constructors
*****************************************************************************/
UConsoleSettings::UConsoleSettings( const class FPostConstructInitializeProperties& PCIP )
: Super(PCIP)
{ }
UGameMapsSettings::UGameMapsSettings( const class FPostConstructInitializeProperties& PCIP )
: Super(PCIP)
, bUseSplitscreen(true)
, TwoPlayerSplitscreenLayout(ETwoPlayerSplitScreenType::Horizontal)
, ThreePlayerSplitscreenLayout(EThreePlayerSplitScreenType::FavorTop)
{ }
UGameNetworkManagerSettings::UGameNetworkManagerSettings( const class FPostConstructInitializeProperties& PCIP )
: Super(PCIP)
{ }
UGameSessionSettings::UGameSessionSettings( const class FPostConstructInitializeProperties& PCIP )
: Super(PCIP)
{ }
UGeneralEngineSettings::UGeneralEngineSettings( const class FPostConstructInitializeProperties& PCIP )
: Super(PCIP)
{ }
UGeneralProjectSettings::UGeneralProjectSettings( const class FPostConstructInitializeProperties& PCIP )
: Super(PCIP)
{ }
UHudSettings::UHudSettings( const class FPostConstructInitializeProperties& PCIP )
: Super(PCIP)
{ }
/* Static functions
*****************************************************************************/
const FString& UGameMapsSettings::GetGameDefaultMap( )
{
return IsRunningDedicatedServer()
? GetDefault<UGameMapsSettings>()->ServerDefaultMap
: GetDefault<UGameMapsSettings>()->GameDefaultMap;
}
const FString& UGameMapsSettings::GetGlobalDefaultGameMode( )
{
UGameMapsSettings* GameMapsSettings = Cast<UGameMapsSettings>(UGameMapsSettings::StaticClass()->GetDefaultObject());
return IsRunningDedicatedServer() && GameMapsSettings->GlobalDefaultServerGameMode.IsValid()
? GameMapsSettings->GlobalDefaultServerGameMode.ToString()
: GameMapsSettings->GlobalDefaultGameMode.ToString();
}
void UGameMapsSettings::SetGameDefaultMap( const FString& NewMap )
{
UGameMapsSettings* GameMapsSettings = Cast<UGameMapsSettings>(UGameMapsSettings::StaticClass()->GetDefaultObject());
if (IsRunningDedicatedServer())
{
GameMapsSettings->ServerDefaultMap = NewMap;
}
else
{
GameMapsSettings->GameDefaultMap = NewMap;
}
}
void UGameMapsSettings::SetGlobalDefaultGameMode( const FString& NewGameMode )
{
UGameMapsSettings* GameMapsSettings = Cast<UGameMapsSettings>(UGameMapsSettings::StaticClass()->GetDefaultObject());
GameMapsSettings->GlobalDefaultGameMode = NewGameMode;
}
IMPLEMENT_MODULE(FEngineSettingsModule, EngineSettings);