Files
UnrealEngineUWP/Engine/Source/Runtime/EngineSettings/Private/EngineSettingsModule.cpp
Max Preussner a823aecff7 Settings: code cleanup
[CL 2067722 by Max Preussner in Main branch]
2014-05-08 21:34:16 -04:00

104 lines
2.6 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
EngineSettingsModule.cpp: Implements the FEngineSettingsModule class.
=============================================================================*/
#include "EngineSettingsPrivatePCH.h"
/**
* Implements the EngineSettings module.
*/
class FEngineSettingsModule
: public IModuleInterface
{
public:
// Begin IModuleInterface interface
virtual void StartupModule( ) OVERRIDE { }
virtual void ShutdownModule( ) OVERRIDE { }
virtual bool SupportsDynamicReloading( ) OVERRIDE
{
return true;
}
// End IModuleInterface interface
};
/* Class constructors
*****************************************************************************/
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( )
{
return IsRunningDedicatedServer()
? GetDefault<UGameMapsSettings>()->GlobalDefaultServerGameMode.ClassName
: GetDefault<UGameMapsSettings>()->GlobalDefaultGameMode.ClassName;
}
void UGameMapsSettings::SetGameDefaultMap( const FString& NewMap )
{
UGameMapsSettings* GameMapsSettings = Cast<UGameMapsSettings>(UGameMapsSettings::StaticClass()->GetDefaultObject());
if (IsRunningDedicatedServer())
{
GameMapsSettings->ServerDefaultMap = NewMap;
}
else
{
GameMapsSettings->GameDefaultMap = NewMap;
}
}
IMPLEMENT_MODULE(FEngineSettingsModule, EngineSettings);