Files
UnrealEngineUWP/Engine/Source/Editor/DeviceProfileEditor/Private/DetailsPanel/SDeviceProfileDetailsPanel.cpp
Jamie Dale 0cfe5f0651 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]
2014-06-05 12:13:44 -04:00

182 lines
4.3 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
SDeviceProfileDetailsPanel.cpp: Implements the SDeviceProfileDetailsPanel class.
=============================================================================*/
#include "DeviceProfileEditorPCH.h"
#include "DeviceProfiles/DeviceProfile.h"
#define LOCTEXT_NAMESPACE "DeviceProfileDetailsPanel"
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
void SDeviceProfileDetailsPanel::Construct( const FArguments& InArgs )
{
// Generate our details panel.
DetailsViewBox = SNew( SVerticalBox );
RefreshUI();
ChildSlot
[
SNew( SBorder )
.BorderImage( FEditorStyle::GetBrush( "Docking.Tab.ContentAreaBrush" ) )
[
SNew( SVerticalBox )
+ SVerticalBox::Slot()
.AutoHeight()
.Padding( FMargin( 2.0f ) )
.VAlign( VAlign_Bottom )
[
SNew( SHorizontalBox )
+ SHorizontalBox::Slot()
.AutoWidth()
.Padding( 0.0f, 0.0f, 4.0f, 0.0f )
[
SNew( SImage )
.Image( FEditorStyle::GetBrush( "LevelEditor.Tabs.Details" ) )
]
+ SHorizontalBox::Slot()
.VAlign( VAlign_Center )
[
SNew( STextBlock )
.Text( LOCTEXT("CVarsLabel", "Console Variables") )
.TextStyle( FEditorStyle::Get(), "Docking.TabFont" )
]
]
+ SVerticalBox::Slot()
[
SNew( SHorizontalBox )
+ SHorizontalBox::Slot()
[
DetailsViewBox.ToSharedRef()
]
]
]
];
}
END_SLATE_FUNCTION_BUILD_OPTIMIZATION
void SDeviceProfileDetailsPanel::UpdateUIForProfile( const TWeakObjectPtr< UDeviceProfile > InProfile )
{
ViewingProfile = InProfile;
RefreshUI();
}
void SDeviceProfileDetailsPanel::RefreshUI()
{
DetailsViewBox->ClearChildren();
// initialize settings view
FDetailsViewArgs DetailsViewArgs;
{
DetailsViewArgs.bAllowSearch = true;
DetailsViewArgs.bHideSelectionTip = true;
DetailsViewArgs.bLockable = false;
DetailsViewArgs.bObjectsUseNameArea = false;
DetailsViewArgs.bSearchInitialKeyFocus = true;
DetailsViewArgs.bUpdatesFromSelection = false;
DetailsViewArgs.bShowOptions = false;
}
SettingsView = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor").CreateDetailView(DetailsViewArgs);
if( ViewingProfile.IsValid() )
{
const FSlateBrush* DeviceProfileTypeIcon = FEditorStyle::GetDefaultBrush();
TArray<ITargetPlatform*> TargetPlatforms = GetTargetPlatformManager()->GetTargetPlatforms();
if (TargetPlatforms.Num())
{
DeviceProfileTypeIcon = FEditorStyle::GetBrush(TargetPlatforms[0]->GetPlatformInfo().GetIconStyleName(PlatformInfo::EPlatformIconSize::Normal));
}
SettingsView->SetObject(&*ViewingProfile);
// If a profile is provided, show the details for this profile.
DetailsViewBox->AddSlot()
[
SNew( SBorder )
.BorderImage( FEditorStyle::GetBrush( "ToolBar.Background" ) )
[
SNew( SVerticalBox )
+ SVerticalBox::Slot()
.HAlign( HAlign_Left )
.AutoHeight()
[
SNew( SHorizontalBox )
+ SHorizontalBox::Slot()
.AutoWidth()
.Padding(4.0f, 0.0f, 2.0f, 0.0f)
[
SNew(SImage)
.Image(DeviceProfileTypeIcon)
]
+SHorizontalBox::Slot()
[
SNew(SVerticalBox)
+SVerticalBox::Slot()
.VAlign(VAlign_Center)
[
SNew( STextBlock )
.Text( FString::Printf( TEXT( "%s selected" ), *ViewingProfile->GetName() ) )
]
]
]
/**
* CVars part of the details panel
*/
+ SVerticalBox::Slot()
.Padding(4.0f)
.FillHeight(1.0f)
[
SNew(SScrollBox)
+ SScrollBox::Slot()
[
SNew( SBorder )
.BorderImage( FEditorStyle::GetBrush( "Docking.Tab.ContentAreaBrush" ) )
[
SNew( SVerticalBox )
+ SVerticalBox::Slot()
.FillHeight(1.0f)
.Padding( FMargin( 4.0f ) )
[
SettingsView.ToSharedRef()
]
]
]
]
]
];
}
else
{
// No profile was selected, so the panel should reflect this
DetailsViewBox->AddSlot()
[
SNew( SBorder )
.BorderImage( FEditorStyle::GetBrush( "ToolBar.Background" ) )
[
SNew(SVerticalBox)
+SVerticalBox::Slot()
.VAlign( VAlign_Top )
.HAlign( HAlign_Center )
.Padding( 4.0f )
[
SNew( STextBlock )
.Text( LOCTEXT("SelectAProfile", "Select a device profile above...") )
]
]
];
}
}
#undef LOCTEXT_NAMESPACE