You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Example usage added to Windows platform, allowing Windows platform extensions to override the default save system. ``` [PlatformFeatures] SaveGameSystemModule=MySaveModule ``` #jira UE-143574, UE-179187 #rb Wojciech.Krywult #preflight 6447ee14864f15ebf5c5bd01 [CL 25181389 by David Harvey in ue5-main branch]
61 lines
1.6 KiB
C++
61 lines
1.6 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "WindowsPlatformFeatures.h"
|
|
#include "WmfPrivate.h"
|
|
#include "WindowsVideoRecordingSystem.h"
|
|
#include "SaveGameSystem.h"
|
|
#include "Misc/CommandLine.h"
|
|
#include "Misc/ConfigCacheIni.h"
|
|
|
|
IMPLEMENT_MODULE(FWindowsPlatformFeaturesModule, WindowsPlatformFeatures);
|
|
|
|
FWindowsPlatformFeaturesModule::FWindowsPlatformFeaturesModule()
|
|
{
|
|
}
|
|
|
|
IVideoRecordingSystem* FWindowsPlatformFeaturesModule::GetVideoRecordingSystem()
|
|
{
|
|
static FWindowsVideoRecordingSystem VideoRecordingSystem;
|
|
return &VideoRecordingSystem;
|
|
}
|
|
|
|
ISaveGameSystem* FWindowsPlatformFeaturesModule::GetSaveGameSystem()
|
|
{
|
|
static ISaveGameSystem* SaveGameSystem = nullptr;
|
|
static bool bIniChecked = false;
|
|
if (!SaveGameSystem || !bIniChecked)
|
|
{
|
|
ISaveGameSystemModule* SaveGameSystemModule = nullptr;
|
|
if (!GEngineIni.IsEmpty())
|
|
{
|
|
FString SaveGameModule;
|
|
GConfig->GetString(TEXT("PlatformFeatures"), TEXT("SaveGameSystemModule"), SaveGameModule, GEngineIni);
|
|
|
|
if (!SaveGameModule.IsEmpty())
|
|
{
|
|
SaveGameSystemModule = FModuleManager::LoadModulePtr<ISaveGameSystemModule>(*SaveGameModule);
|
|
if (SaveGameSystemModule != nullptr)
|
|
{
|
|
// Attempt to grab the save game system
|
|
SaveGameSystem = SaveGameSystemModule->GetSaveGameSystem();
|
|
}
|
|
}
|
|
bIniChecked = true;
|
|
}
|
|
|
|
if (SaveGameSystem == nullptr)
|
|
{
|
|
// Placeholder/default instance
|
|
SaveGameSystem = IPlatformFeaturesModule::GetSaveGameSystem();
|
|
}
|
|
}
|
|
|
|
return SaveGameSystem;
|
|
}
|
|
|
|
|
|
void FWindowsPlatformFeaturesModule::StartupModule()
|
|
{
|
|
FModuleManager::Get().LoadModule(TEXT("GameplayMediaEncoder"));
|
|
}
|