Files
UnrealEngineUWP/Engine/Source/Editor/GameProjectGeneration/Private/GameProjectGenerationModule.cpp
Jamie Dale c730fdef83 Added support for choosing which platforms your project will target
TTP# 332489 - TOOLS FEATURE: Editor: Allow user to designate which platforms a project is designed for; warn user when deploying to platforms that will result in a bad time

There is now a "Target Platforms" tab in the project settings which allows you to choose which platforms your project will target. This information is stored inside the .uproject file.

If you try and launch, cook, or package for a project that isn't on the supported list, then you'll see a suppressible warning notifying you that the project may not run as expected. This is also conveyed to you via a warning icon next to platforms which aren't set as a target.

Additionally the target platform icons are shown in the tooltip on the "Open Project" dialog, as well as in the tab area of the level editor.

ReviewedBy Thomas.Sarkanen, Max.Preussner

[CL 2088161 by Jamie Dale in Main branch]
2014-05-29 17:37:19 -04:00

93 lines
2.5 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "GameProjectGenerationPrivatePCH.h"
#include "ModuleManager.h"
#include "GameProjectGenerationModule.h"
IMPLEMENT_MODULE( FGameProjectGenerationModule, GameProjectGeneration );
DEFINE_LOG_CATEGORY(LogGameProjectGeneration);
#define LOCTEXT_NAMESPACE "GameProjectGeneration"
void FGameProjectGenerationModule::StartupModule()
{
}
void FGameProjectGenerationModule::ShutdownModule()
{
}
TSharedRef<class SWidget> FGameProjectGenerationModule::CreateGameProjectDialog(bool bAllowProjectOpening, bool bAllowProjectCreate)
{
return SNew(SGameProjectDialog)
.AllowProjectOpening(bAllowProjectOpening)
.AllowProjectCreate(bAllowProjectCreate);
}
TSharedRef<class SWidget> FGameProjectGenerationModule::CreateNewClassDialog(class UClass* InClass)
{
return SNew(SNewClassDialog).Class(InClass);
}
void FGameProjectGenerationModule::OpenAddCodeToProjectDialog()
{
GameProjectUtils::OpenAddCodeToProjectDialog();
AddCodeToProjectDialogOpenedEvent.Broadcast();
}
void FGameProjectGenerationModule::CheckForOutOfDateGameProjectFile()
{
GameProjectUtils::CheckForOutOfDateGameProjectFile();
}
bool FGameProjectGenerationModule::UpdateGameProject(const FString& EngineIdentifier)
{
return GameProjectUtils::UpdateGameProject(EngineIdentifier);
}
bool FGameProjectGenerationModule::UpdateCodeProject(FText& OutFailReason)
{
const bool bAllowNewSlowTask = true;
FStatusMessageContext SlowTaskMessage( LOCTEXT( "UpdatingCodeProject", "Updating code project..." ), bAllowNewSlowTask );
return GameProjectUtils::GenerateCodeProjectFiles(FPaths::GetProjectFilePath(), OutFailReason);
}
int32 FGameProjectGenerationModule::GetProjectCodeFileCount()
{
return GameProjectUtils::GetProjectCodeFileCount();
}
bool FGameProjectGenerationModule::UpdateCodeResourceFiles(TArray<FString>& OutCreatedFiles, FText& OutFailReason)
{
const FString GameModuleSourcePath = FPaths::GetPath(FPaths::GetProjectFilePath()) / TEXT("Source") / FApp::GetGameName();
return GameProjectUtils::GenerateGameResourceFiles(GameModuleSourcePath, FApp::GetGameName(), OutCreatedFiles, OutFailReason);
}
void FGameProjectGenerationModule::CheckAndWarnProjectFilenameValid()
{
GameProjectUtils::CheckAndWarnProjectFilenameValid();
}
void FGameProjectGenerationModule::UpdateSupportedTargetPlatforms(const FName& InPlatformName, const bool bIsSupported)
{
GameProjectUtils::UpdateSupportedTargetPlatforms(InPlatformName, bIsSupported);
}
#undef LOCTEXT_NAMESPACE