2014-03-14 14:13:41 -04:00
|
|
|
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*=============================================================================
|
|
|
|
|
SDeviceProfileDetailsPanel.cpp: Implements the SDeviceProfileDetailsPanel class.
|
|
|
|
|
=============================================================================*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "DeviceProfileEditorPCH.h"
|
2014-05-29 17:11:10 -04:00
|
|
|
#include "DeviceProfiles/DeviceProfile.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#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 )
|
2014-04-23 18:06:41 -04:00
|
|
|
.Text( LOCTEXT("CVarsLabel", "Console Variables") )
|
2014-03-14 14:13:41 -04:00
|
|
|
.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() )
|
|
|
|
|
{
|
2014-06-05 12:13:44 -04:00
|
|
|
const FSlateBrush* DeviceProfileTypeIcon = FEditorStyle::GetDefaultBrush();
|
2014-03-14 14:13:41 -04:00
|
|
|
TArray<ITargetPlatform*> TargetPlatforms = GetTargetPlatformManager()->GetTargetPlatforms();
|
2014-06-05 12:13:44 -04:00
|
|
|
if (TargetPlatforms.Num())
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-06-05 12:13:44 -04:00
|
|
|
DeviceProfileTypeIcon = FEditorStyle::GetBrush(TargetPlatforms[0]->GetPlatformInfo().GetIconStyleName(PlatformInfo::EPlatformIconSize::Normal));
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
2014-06-05 12:13:44 -04:00
|
|
|
.Image(DeviceProfileTypeIcon)
|
2014-03-14 14:13:41 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
+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 )
|
2014-04-23 18:06:41 -04:00
|
|
|
.Text( LOCTEXT("SelectAProfile", "Select a device profile above...") )
|
2014-03-14 14:13:41 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
]
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|