Files
UnrealEngineUWP/Engine/Source/Developer/ProjectLauncher/Private/Widgets/Shared/SProjectLauncherProfileNameDescEditor.h
T
Josh Adams 94f4be4de1 - Renamed PlatformInfo::FPlatformInfo to PlatformInfo::FTargetPlatformInfo
- Renamed FDataDrivenPlatformRegistry::FPlatformInfo to FDataDrivenPlatformInfo
- Moved some fields from PlatformInfo::FTargetPlatformInfo to FDataDrivenPlatformInfo, and cleaned them up in the process
- Fixed the DataDrivePlatformInfo.ini files to match the previous items
- Removed FVanillaPlatformEntry, and now just using FTargetPlatformInfo to manage flavors under a vanilla PlatformInfo (see PlatformInfo::GetVanillaPlatformInfoArray())
- Cleaned up TPerPlatformValue, as it was often misused (took a group and platform name, but we can get the group from the platform name) [AnimationSharingManager.cpp, *Engine.cpp, Runtime\Engine\*, ]
- Fixed FBlueprintNativeCodeGenPaths::GetDefaultCodeGenPaths() to use IniPlatformName instead of some hacky code [BlueprintNativeCodeGenManifest.cpp]
- Fixed various Turnkey bugs that recent testing exposed
- Enabled AUTOSDKS_ENABLED in both Mac and Linux on the Editor side (not that there are much set up to use it)
- Using Turnkey to get the SDK status instead of ValidatePlatforms (gives more detailed information - may want to go back to ValidatePlatforms so only UBT is needed, but change it to give more info)
- Moved OnDeviceDiscovered and Lost delegates from each platform's TargetPlatform class to a static in ITargetPlatform - there was no need for per-platform implementations
- Started working on allowing for SDK to be installed with editor running and not need to restart editor - Work in Progress! It is not usable yet.
#fyi jack.porter
#rb pete.sauerbrei

[CL 13816905 by Josh Adams in ue5-main branch]
2020-07-01 17:07:12 -04:00

121 lines
3.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "SlateFwd.h"
#include "Misc/Attribute.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Widgets/SCompoundWidget.h"
#include "Models/ProjectLauncherModel.h"
#include "EditorStyleSet.h"
/**
* Implements a build configuration selector widget.
*/
class SProjectLauncherProfileNameDescEditor
: public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SProjectLauncherProfileNameDescEditor) { }
SLATE_ATTRIBUTE(ILauncherProfilePtr, LaunchProfile)
SLATE_ATTRIBUTE(ILauncherProfileManagerPtr, InModel)
SLATE_END_ARGS()
public:
/**
* Constructs the widget.
*
* @param InArgs The Slate argument list.
* @param InModel The data model.
*/
void Construct(const FArguments& InArgs, const TSharedRef<FProjectLauncherModel>& InModel, bool InShowAddDescriptionText);
/**
* Triggers a name edit for the profile.
*/
void TriggerNameEdit();
private:
// Callback for getting the icon image of the profile.
const FSlateBrush* HandleProfileImage() const
{
//const PlatformInfo::FTargetPlatformInfo* const PlatformInfo = PlatformInfo::FindPlatformInfo(*DeviceProxy->GetTargetPlatformName(SimpleProfile->GetDeviceVariant()));
//return (PlatformInfo) ? FEditorStyle::GetBrush(PlatformInfo->GetIconStyleName(PlatformInfo::EPlatformIconSize::Large)) : FStyleDefaults::GetNoBrush();
return FEditorStyle::GetBrush("LauncherCommand.QuickLaunch");
}
// Callback to get the name of the launch profile.
FText OnGetNameText() const
{
ILauncherProfilePtr LaunchProfile = LaunchProfileAttr.Get();
if (LaunchProfile.IsValid())
{
return FText::FromString(LaunchProfile->GetName());
}
return FText();
}
// Callback to set the name of the launch profile.
void OnNameTextCommitted(const FText& NewText, ETextCommit::Type InTextCommit)
{
ILauncherProfilePtr LaunchProfile = LaunchProfileAttr.Get();
if (LaunchProfile.IsValid())
{
Model->GetProfileManager()->ChangeProfileName(LaunchProfile.ToSharedRef(), NewText.ToString());
}
}
// Callback to get the description of the launch profile.
FText OnGetDescriptionText() const
{
ILauncherProfilePtr LaunchProfile = LaunchProfileAttr.Get();
if (LaunchProfile.IsValid())
{
FString Desc = LaunchProfile->GetDescription();
if (!bShowAddDescriptionText || !Desc.IsEmpty())
{
return FText::FromString(Desc);
}
}
return EnterTextDescription;
}
// Callback to set the description of the launch profile.
void OnDescriptionTextCommitted(const FText& NewText, ETextCommit::Type InTextCommit)
{
ILauncherProfilePtr LaunchProfile = LaunchProfileAttr.Get();
if (LaunchProfile.IsValid())
{
if (NewText.EqualTo(EnterTextDescription))
{
LaunchProfile->SetDescription("");
}
else
{
LaunchProfile->SetDescription(NewText.ToString());
}
}
}
private:
/** Holds a pointer to the data model. */
TSharedPtr<FProjectLauncherModel> Model;
// Attribute for the launch profile this widget edits.
TAttribute<ILauncherProfilePtr> LaunchProfileAttr;
// Cache the no description enter suggestion text
FText EnterTextDescription;
// Whether we show an add description blurb when the profile has no description.
bool bShowAddDescriptionText;
TSharedPtr<SInlineEditableTextBlock> NameEditableTextBlock;
};