You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Removed redundant private include paths from build.cs files. Fixed include paths to be relative to the private or public folders. Hid or removed includes that reached into other private module folders. Updated PublicInclude paths when necessary. #jira #preflight 631e281694758d0bf2ea1399 [CL 21960082 by bryan sefcik in ue5-main branch]
191 lines
5.4 KiB
C++
191 lines
5.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "Widgets/Cook/SProjectLauncherCookPage.h"
|
|
|
|
#include "Framework/Commands/UIAction.h"
|
|
#include "Framework/MultiBox/MultiBoxBuilder.h"
|
|
#include "Textures/SlateIcon.h"
|
|
#include "Widgets/SBoxPanel.h"
|
|
#include "Widgets/Input/SComboButton.h"
|
|
#include "Widgets/Text/STextBlock.h"
|
|
|
|
#include "Widgets/Cook/SProjectLauncherCookByTheBookSettings.h"
|
|
#include "Widgets/Cook/SProjectLauncherCookOnTheFlySettings.h"
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "SProjectLauncherCookPage"
|
|
|
|
|
|
/* SProjectLauncherCookPage structors
|
|
*****************************************************************************/
|
|
|
|
SProjectLauncherCookPage::~SProjectLauncherCookPage()
|
|
{
|
|
if (Model.IsValid())
|
|
{
|
|
Model->OnProfileSelected().RemoveAll(this);
|
|
}
|
|
}
|
|
|
|
|
|
/* SProjectLauncherCookPage interface
|
|
*****************************************************************************/
|
|
|
|
void SProjectLauncherCookPage::Construct(const FArguments& InArgs, const TSharedRef<FProjectLauncherModel>& InModel)
|
|
{
|
|
Model = InModel;
|
|
|
|
// create cook modes menu
|
|
FMenuBuilder CookModeMenuBuilder(true, NULL);
|
|
{
|
|
FUIAction ByTheBookAction(FExecuteAction::CreateSP(this, &SProjectLauncherCookPage::HandleCookModeMenuEntryClicked, ELauncherProfileCookModes::ByTheBook));
|
|
CookModeMenuBuilder.AddMenuEntry(LOCTEXT("ByTheBookAction", "By the book"), LOCTEXT("ByTheBookActionHint", "Specify which content should be cooked and cook everything in advance prior to launching the game."), FSlateIcon(), ByTheBookAction);
|
|
|
|
FUIAction OnTheFlyAction(FExecuteAction::CreateSP(this, &SProjectLauncherCookPage::HandleCookModeMenuEntryClicked, ELauncherProfileCookModes::OnTheFly));
|
|
CookModeMenuBuilder.AddMenuEntry(LOCTEXT("OnTheFlyAction", "On the fly"), LOCTEXT("OnTheFlyActionHint", "Cook the content at run-time before it is being sent to the device."), FSlateIcon(), OnTheFlyAction);
|
|
|
|
FUIAction DoNotCookAction(FExecuteAction::CreateSP(this, &SProjectLauncherCookPage::HandleCookModeMenuEntryClicked, ELauncherProfileCookModes::DoNotCook));
|
|
CookModeMenuBuilder.AddMenuEntry(LOCTEXT("DoNotCookAction", "Do not cook"), LOCTEXT("DoNotCookActionHint", "Do not cook the content at this time."), FSlateIcon(), DoNotCookAction);
|
|
}
|
|
|
|
ChildSlot
|
|
[
|
|
SNew(SVerticalBox)
|
|
|
|
+ SVerticalBox::Slot()
|
|
.AutoHeight()
|
|
[
|
|
SNew(SHorizontalBox)
|
|
|
|
+ SHorizontalBox::Slot()
|
|
.FillWidth(1.0)
|
|
.VAlign(VAlign_Center)
|
|
[
|
|
SNew(STextBlock)
|
|
.Text(LOCTEXT("HowToCookText", "How would you like to cook the content?"))
|
|
]
|
|
|
|
+ SHorizontalBox::Slot()
|
|
.AutoWidth()
|
|
.Padding(8.0, 0.0, 0.0, 0.0)
|
|
[
|
|
// cooking mode menu
|
|
SNew(SComboButton)
|
|
.ButtonContent()
|
|
[
|
|
SNew(STextBlock)
|
|
.Text(this, &SProjectLauncherCookPage::HandleCookModeComboButtonContentText)
|
|
]
|
|
.ContentPadding(FMargin(6.0, 2.0))
|
|
.MenuContent()
|
|
[
|
|
CookModeMenuBuilder.MakeWidget()
|
|
]
|
|
]
|
|
]
|
|
|
|
+ SVerticalBox::Slot()
|
|
.AutoHeight()
|
|
.Padding(0.0, 8.0, 0.0, 0.0)
|
|
[
|
|
SNew(SProjectLauncherCookOnTheFlySettings, InModel)
|
|
.Visibility(this, &SProjectLauncherCookPage::HandleCookOnTheFlySettingsVisibility)
|
|
]
|
|
|
|
+ SVerticalBox::Slot()
|
|
.AutoHeight()
|
|
.Padding(0.0, 8.0, 0.0, 0.0)
|
|
[
|
|
SNew(SProjectLauncherCookByTheBookSettings, InModel)
|
|
.Visibility(this, &SProjectLauncherCookPage::HandleCookByTheBookSettingsVisibility)
|
|
]
|
|
];
|
|
|
|
Model->OnProfileSelected().AddSP(this, &SProjectLauncherCookPage::HandleProfileManagerProfileSelected);
|
|
}
|
|
|
|
|
|
/* SProjectLauncherCookPage callbacks
|
|
*****************************************************************************/
|
|
|
|
EVisibility SProjectLauncherCookPage::HandleCookByTheBookSettingsVisibility() const
|
|
{
|
|
ILauncherProfilePtr SelectedProfile = Model->GetSelectedProfile();
|
|
|
|
if (SelectedProfile.IsValid())
|
|
{
|
|
if (SelectedProfile->GetCookMode() == ELauncherProfileCookModes::ByTheBook)
|
|
{
|
|
return EVisibility::Visible;
|
|
}
|
|
}
|
|
|
|
return EVisibility::Collapsed;
|
|
}
|
|
|
|
|
|
FText SProjectLauncherCookPage::HandleCookModeComboButtonContentText() const
|
|
{
|
|
ILauncherProfilePtr SelectedProfile = Model->GetSelectedProfile();
|
|
|
|
if (SelectedProfile.IsValid())
|
|
{
|
|
ELauncherProfileCookModes::Type CookMode = SelectedProfile->GetCookMode();
|
|
|
|
if (CookMode == ELauncherProfileCookModes::ByTheBook)
|
|
{
|
|
return LOCTEXT("CookModeComboButton_ByTheBook", "By the book");
|
|
}
|
|
|
|
if (CookMode == ELauncherProfileCookModes::DoNotCook)
|
|
{
|
|
return LOCTEXT("CookModeComboButton_DoNotCook", "Do not cook");
|
|
}
|
|
|
|
if (CookMode == ELauncherProfileCookModes::OnTheFly)
|
|
{
|
|
return LOCTEXT("CookModeComboButton_OnTheFly", "On the fly");
|
|
}
|
|
|
|
return LOCTEXT("CookModeComboButtonDefaultText", "Select...");
|
|
}
|
|
|
|
return FText();
|
|
}
|
|
|
|
|
|
void SProjectLauncherCookPage::HandleCookModeMenuEntryClicked(ELauncherProfileCookModes::Type CookMode)
|
|
{
|
|
ILauncherProfilePtr SelectedProfile = Model->GetSelectedProfile();
|
|
|
|
if (SelectedProfile.IsValid())
|
|
{
|
|
SelectedProfile->SetCookMode(CookMode);
|
|
}
|
|
}
|
|
|
|
|
|
EVisibility SProjectLauncherCookPage::HandleCookOnTheFlySettingsVisibility() const
|
|
{
|
|
ILauncherProfilePtr SelectedProfile = Model->GetSelectedProfile();
|
|
|
|
if (SelectedProfile.IsValid())
|
|
{
|
|
if (SelectedProfile->GetCookMode() == ELauncherProfileCookModes::OnTheFly)
|
|
{
|
|
return EVisibility::Visible;
|
|
}
|
|
}
|
|
|
|
return EVisibility::Collapsed;
|
|
}
|
|
|
|
|
|
void SProjectLauncherCookPage::HandleProfileManagerProfileSelected(const ILauncherProfilePtr& SelectedProfile, const ILauncherProfilePtr& PreviousProfile)
|
|
{
|
|
// reload settings
|
|
}
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|