Added PlatformInfo to DesktopPlatform and improved the editors Supported Platform UI

TTP# 337136 - SETTINGS: Target Platform settings polish
TTP# 337652 - EDITOR: Limit Project supported Android icons down to 1
TTP# 337650 - EDITOR: There is only 1 icon for Apple for Project Supported Platforms

DesktopPlatform now contains a static array of FPlatformInfo. This can be used to query UE4 about its available platforms, even when they're not available as a target platform.

FPlatformInfo contains the information required by the editor (such as a localized display name and icon), as well as whether a platform is a variation ("flavor") of another, and if so, whether the flavor affects the build output (eg, Win32 or Win64), or the cook output (eg, Android_XYZ). This lets the editor build up nested menus for the "Package Project" and "Cook Project" options, rather than just showing everything as a flat list.

ReviewedBy Thomas.Sarkanen, Max.Preussner

[CL 2095796 by Jamie Dale in Main branch]
This commit is contained in:
Jamie Dale
2014-06-05 12:13:44 -04:00
committed by UnrealBot
parent 6f4b862468
commit 0cfe5f0651
106 changed files with 1094 additions and 788 deletions
@@ -17,7 +17,7 @@ public class EditorStyle : ModuleRules
PrivateDependencyModuleNames.AddRange(
new string[] {
"SlateCore",
"TargetPlatform",
"DesktopPlatform",
}
);
@@ -17,7 +17,7 @@
#include "Settings.h"
#include "Slate.h"
#include "SlateStyle.h"
#include "TargetPlatform.h"
#include "PlatformInfo.h"
/* Private includes
@@ -5033,25 +5033,15 @@ void FSlateEditorStyle::FStyle::SetupAutomationStyles()
Set( "Launcher.Platform.Warning", new IMAGE_BRUSH( "Icons/alert", Icon24x24) );
#if (WITH_EDITOR || (IS_PROGRAM && PLATFORM_DESKTOP))
const TArray<ITargetPlatform*>& TargetPlatforms = GetTargetPlatformManager()->GetTargetPlatforms();
for (int32 PlatformIdx = 0; PlatformIdx < TargetPlatforms.Num(); PlatformIdx++)
Set( "Launcher.Platform.AllPlatforms", new IMAGE_BRUSH( "Launcher/All_Platforms_24x", Icon24x24) );
Set( "Launcher.Platform.AllPlatforms.Large", new IMAGE_BRUSH( "Launcher/All_Platforms_128x", Icon64x64) );
Set( "Launcher.Platform.AllPlatforms.XLarge", new IMAGE_BRUSH( "Launcher/All_Platforms_128x", Icon128x128) );
for(const PlatformInfo::FPlatformInfo& PlatformInfo : PlatformInfo::EnumeratePlatformInfoArray())
{
ITargetPlatform* TargetPlatform = TargetPlatforms[PlatformIdx];
if (TargetPlatform)
{
// Grab each icon name
FString PropertyName = FString::Printf(TEXT("Launcher.Platform_%s"), *(TargetPlatform->PlatformName()));
FString IconPath = TargetPlatform->GetIconPath(ETargetPlatformIcons::Normal);
Set( *PropertyName, new IMAGE_BRUSH( *IconPath, Icon24x24 ) );
PropertyName = FString::Printf(TEXT("Launcher.Platform_%s.Large"), *(TargetPlatform->PlatformName()));
IconPath = TargetPlatform->GetIconPath(ETargetPlatformIcons::Large);
Set( *PropertyName, new IMAGE_BRUSH( *IconPath, Icon64x64 ) );
PropertyName = FString::Printf(TEXT("Launcher.Platform_%s.XLarge"), *(TargetPlatform->PlatformName()));
IconPath = TargetPlatform->GetIconPath(ETargetPlatformIcons::XLarge);
Set( *PropertyName, new IMAGE_BRUSH( *IconPath, Icon128x128 ) );
}
Set( PlatformInfo.GetIconStyleName(PlatformInfo::EPlatformIconSize::Normal), new IMAGE_BRUSH( *PlatformInfo.GetIconPath(PlatformInfo::EPlatformIconSize::Normal), Icon24x24 ) );
Set( PlatformInfo.GetIconStyleName(PlatformInfo::EPlatformIconSize::Large), new IMAGE_BRUSH( *PlatformInfo.GetIconPath(PlatformInfo::EPlatformIconSize::Large), Icon64x64 ) );
Set( PlatformInfo.GetIconStyleName(PlatformInfo::EPlatformIconSize::XLarge), new IMAGE_BRUSH( *PlatformInfo.GetIconPath(PlatformInfo::EPlatformIconSize::XLarge), Icon128x128 ) );
}
#endif
}