2016-12-08 08:52:44 -05:00
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
2014-03-14 14:13:41 -04:00
# pragma once
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
# include "CoreMinimal.h"
# include "Layout/Visibility.h"
# include "Widgets/DeclarativeSyntaxSupport.h"
# include "Input/Reply.h"
# include "Widgets/SWidget.h"
# include "Widgets/SCompoundWidget.h"
# include "HardwareTargetingSettings.h"
# include "Widgets/Views/STileView.h"
2014-03-14 14:13:41 -04:00
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
class SWizard ;
struct FTemplateItem ;
2014-03-14 14:13:41 -04:00
/**
* A wizard to create a new game project
*/
class SNewProjectWizard : public SCompoundWidget
{
public :
SLATE_BEGIN_ARGS ( SNewProjectWizard ) { }
SLATE_EVENT ( FOnClicked , OnBackRequested )
SLATE_END_ARGS ( )
/** Constructs this widget with InArgs */
void Construct ( const FArguments & InArgs ) ;
2014-06-13 06:14:46 -04:00
virtual void Tick ( const FGeometry & AllottedGeometry , const double InCurrentTime , const float InDeltaTime ) override ;
2014-03-14 14:13:41 -04:00
2015-06-29 08:27:10 -04:00
/** Populates TemplateItemsSource with templates found on disk */
TMap < FName , TArray < TSharedPtr < FTemplateItem > > > & FindTemplateProjects ( ) ;
2014-03-14 14:13:41 -04:00
private :
2014-08-18 06:48:04 -04:00
/** Build the set of template category tabs */
TSharedRef < SWidget > BuildCategoryTabs ( ) ;
2014-03-14 14:13:41 -04:00
/** Accessor for the currently selected template item */
TSharedPtr < FTemplateItem > GetSelectedTemplateItem ( ) const ;
2014-08-18 06:48:04 -04:00
/** Helper function to allow direct lookup of the selected item's properties on a delegate */
2014-08-19 06:13:33 -04:00
/** TRet should be defaulted but VS2012 doesn't allow default template arguments on non-class templates */
template < typename T >
T GetSelectedTemplateProperty ( T FTemplateItem : : * Prop ) const
2014-08-18 06:48:04 -04:00
{
TSharedPtr < FTemplateItem > SelectedItem = GetSelectedTemplateItem ( ) ;
if ( SelectedItem . IsValid ( ) )
{
return ( * SelectedItem ) . * Prop ;
}
2014-08-19 06:13:33 -04:00
return T ( ) ;
2014-08-18 06:48:04 -04:00
}
2014-03-14 14:13:41 -04:00
/** Accessor for the project name text */
FText GetCurrentProjectFileName ( ) const ;
/** Accessor for the project filename string with the extension */
FString GetCurrentProjectFileNameStringWithExtension ( ) const ;
/** Handler for when the project name string was changed */
void OnCurrentProjectFileNameChanged ( const FText & InValue ) ;
/** Accessor for the project path text */
FText GetCurrentProjectFilePath ( ) const ;
/** Accessor for the project ParentFolder string */
FString GetCurrentProjectFileParentFolder ( ) const ;
/** Handler for when the project path string was changed */
void OnCurrentProjectFilePathChanged ( const FText & InValue ) ;
/** Accessor for the label to preview the current filename with path */
FString GetProjectFilenameWithPathLabelText ( ) const ;
/** Accessor for the label to show the currently selected template */
FText GetSelectedTemplateName ( ) const ;
2014-08-18 06:48:04 -04:00
/** Get the images for the selected template preview and category */
const FSlateBrush * GetSelectedTemplatePreviewImage ( ) const ;
const FSlateBrush * GetSelectedTemplateTypeImage ( ) const ;
2014-09-09 12:16:36 -04:00
/** Get the visibility for the selected template preview image */
EVisibility GetSelectedTemplatePreviewVisibility ( ) const ;
2014-10-30 10:27:56 -04:00
/** Get a string that details the class types referenced in the selected template */
2015-01-07 09:52:40 -05:00
FText GetSelectedTemplateClassTypes ( ) const ;
2014-10-30 10:27:56 -04:00
/** Get a visiblity of the class types display. If the string is empty this return Collapsed otherwise it will return Visible */
2014-10-30 10:23:07 -04:00
EVisibility GetSelectedTemplateClassVisibility ( ) const ;
2014-10-30 10:27:56 -04:00
/** Get a string that details the class types referenced in the selected template */
2015-01-07 09:52:40 -05:00
FText GetSelectedTemplateAssetTypes ( ) const ;
2014-10-30 10:27:56 -04:00
/** Get a visiblity of the asset types display. If the string is empty this return Collapsed otherwise it will return Visible */
EVisibility GetSelectedTemplateAssetVisibility ( ) const ;
2014-10-30 10:23:07 -04:00
2014-03-14 14:13:41 -04:00
/** Gets the assembled project filename with path */
FString GetProjectFilenameWithPath ( ) const ;
/** Opens a web browser to the specified IDE url */
void OnDownloadIDEClicked ( FString URL ) ;
/** Returns true if the user is allowed to specify a project with the supplied name and path */
bool IsCreateProjectEnabled ( ) const ;
// Handles checking whether the specified page can be shown.
bool HandlePageCanShow ( FName PageName ) const ;
/** Fired when the page changes in the wizard */
void OnPageVisited ( FName NewPageName ) ;
/** Gets the visibility of the error label */
EVisibility GetGlobalErrorLabelVisibility ( ) const ;
/** Gets the visibility of the error label close button. Only visible when displaying a persistent error */
EVisibility GetGlobalErrorLabelCloseButtonVisibility ( ) const ;
/** Gets the visibility of the IDE link in the error label */
EVisibility GetGlobalErrorLabelIDELinkVisibility ( ) const ;
/** Gets the text to display in the error label */
FText GetGlobalErrorLabelText ( ) const ;
/** Handler for when the close button on the error label is clicked */
FReply OnCloseGlobalErrorLabelClicked ( ) ;
/** Gets the visibility of the error label */
EVisibility GetNameAndLocationErrorLabelVisibility ( ) const ;
/** Gets the text to display in the error label */
FText GetNameAndLocationErrorLabelText ( ) const ;
/** Handler for when the "copy starter content" checkbox changes state */
2014-10-01 06:07:53 -04:00
void OnSetCopyStarterContent ( int32 InCopyStarterContent ) ;
/** Get whether we are copying starter content or not */
int32 GetCopyStarterContentIndex ( ) const { return bCopyStarterContent ? 1 : 0 ; } ;
2014-03-14 14:13:41 -04:00
2014-09-25 22:44:16 -04:00
/** Returns the visibility of the starter content warning */
EVisibility GetStarterContentWarningVisibility ( ) const ;
/** Returns the tooltip text (actual warning) of the starter content warning */
FText GetStarterContentWarningTooltip ( ) const ;
2015-06-29 08:27:10 -04:00
2014-09-09 12:16:36 -04:00
private :
2014-03-14 14:13:41 -04:00
2014-09-09 12:16:36 -04:00
EHardwareClass : : Type SelectedHardwareClassTarget ;
void SetHardwareClassTarget ( EHardwareClass : : Type InHardwareClass ) ;
EHardwareClass : : Type GetHardwareClassTarget ( ) const { return SelectedHardwareClassTarget ; }
EGraphicsPreset : : Type SelectedGraphicsPreset ;
void SetGraphicsPreset ( EGraphicsPreset : : Type InGraphicsPreset ) ;
EGraphicsPreset : : Type GetGraphicsPreset ( ) const { return SelectedGraphicsPreset ; }
2014-03-14 14:13:41 -04:00
/** Sets the default project name and path */
void SetDefaultProjectLocation ( ) ;
/** Checks the current project path an name for validity and updates cached values accordingly */
void UpdateProjectFileValidity ( ) ;
/** Returns true if we have a code template selected */
bool IsCompilerRequired ( ) const ;
/** Begins the creation process for the configured project */
void CreateAndOpenProject ( ) ;
/** Opens the specified project file */
2014-12-11 16:39:39 -05:00
bool OpenProject ( const FString & ProjectFile ) ;
2014-03-14 14:13:41 -04:00
/** Opens the solution for the specified project */
2014-12-11 16:39:39 -05:00
bool OpenCodeIDE ( const FString & ProjectFile ) ;
2014-03-14 14:13:41 -04:00
/** Creates a project with the supplied project filename */
bool CreateProject ( const FString & ProjectFile ) ;
/** Closes the containing window, but only if summoned via the editor so the non-game version doesn't just close to desktop. */
void CloseWindowIfAppropriate ( bool ForceClose = false ) ;
/** Displays an error to the user */
void DisplayError ( const FText & ErrorText ) ;
private :
/** Handler for when the Browse button is clicked */
FReply HandleBrowseButtonClicked ( ) ;
/** Checks whether the 'Create Project' wizard can finish. */
bool HandleCreateProjectWizardCanFinish ( ) const ;
/** Handler for when the Create button is clicked */
void HandleCreateProjectWizardFinished ( ) ;
/** Called when a user double-clicks a template item in the template project list. */
void HandleTemplateListViewDoubleClick ( TSharedPtr < FTemplateItem > TemplateItem ) ;
/** Handler for when the selection changes in the template list */
void HandleTemplateListViewSelectionChanged ( TSharedPtr < FTemplateItem > TemplateItem , ESelectInfo : : Type SelectInfo ) ;
2014-08-18 06:48:04 -04:00
/** Handle choosing a different category tab */
2014-12-10 14:24:09 -05:00
void HandleCategoryChanged ( ECheckBoxState Checked , FName Category ) ;
2014-03-14 14:13:41 -04:00
2014-08-18 06:48:04 -04:00
/** Get the check state for the specified categories tab */
2014-12-10 14:24:09 -05:00
ECheckBoxState GetCategoryTabCheckState ( FName Category ) const ;
2014-03-14 14:13:41 -04:00
private :
/** The wizard widget */
2014-08-27 21:25:34 -04:00
TSharedPtr < class SWizard > MainWizard ;
2014-03-14 14:13:41 -04:00
FString LastBrowsePath ;
FString CurrentProjectFileName ;
FString CurrentProjectFilePath ;
FText PersistentGlobalErrorLabelText ;
/** The last time that the selected project file path was checked for validity. This is used to throttle I/O requests to a reasonable frequency */
double LastValidityCheckTime ;
/** The frequency in seconds for validity checks while the dialog is idle. Changes to the path immediately update the validity. */
double ValidityCheckFrequency ;
/** Periodic checks for validity will not occur while this flag is true. Used to prevent a frame of "this project already exists" while exiting after a successful creation. */
bool bPreventPeriodicValidityChecksUntilNextChange ;
/** The global error text from the last validity check */
FText LastGlobalValidityErrorText ;
/** The global error text from the last validity check */
FText LastNameAndLocationValidityErrorText ;
/** True if the last global validity check returned that the project path is valid for creation */
bool bLastGlobalValidityCheckSuccessful ;
/** True if the last NameAndLocation validity check returned that the project path is valid for creation */
bool bLastNameAndLocationValidityCheckSuccessful ;
/** The name of the page that is currently in view */
FName CurrentPageName ;
/** True if user has selected to copy starter content. */
bool bCopyStarterContent ;
2014-08-18 06:48:04 -04:00
/** Name of the currently selected category */
FName ActiveCategory ;
2014-03-14 14:13:41 -04:00
2014-08-18 06:48:04 -04:00
/** A map of category name to array of templates available for that category */
TMap < FName , TArray < TSharedPtr < FTemplateItem > > > Templates ;
/** The filtered array of templates we are currently showing */
TArray < TSharedPtr < FTemplateItem > > FilteredTemplateList ;
/** The slate widget representing the list of templates */
TSharedPtr < STileView < TSharedPtr < FTemplateItem > > > TemplateListView ;
2014-03-14 14:13:41 -04:00
/** Names for pages */
static FName TemplatePageName ;
static FName NameAndLocationPageName ;
} ;