2016-12-08 08:52:44 -05:00
|
|
|
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
|
2014-08-05 09:04:35 -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 "SlateFwd.h"
|
|
|
|
|
#include "Layout/Visibility.h"
|
|
|
|
|
#include "Widgets/DeclarativeSyntaxSupport.h"
|
|
|
|
|
#include "Input/Reply.h"
|
|
|
|
|
#include "Widgets/SCompoundWidget.h"
|
|
|
|
|
#include "Widgets/Views/STableViewBase.h"
|
|
|
|
|
#include "Widgets/Views/STableRow.h"
|
|
|
|
|
#include "IIntroTutorials.h"
|
|
|
|
|
|
|
|
|
|
class FAssetData;
|
|
|
|
|
class FTutorialListEntry_Category;
|
|
|
|
|
class SWindow;
|
2014-08-05 09:04:35 -04:00
|
|
|
class UEditorTutorial;
|
|
|
|
|
|
2015-04-02 16:56:18 -04:00
|
|
|
DECLARE_DELEGATE_FiveParams(FOnLaunchTutorial, UEditorTutorial* /** InTutorialToLaunch */, IIntroTutorials::ETutorialStartType /* InStartType */, TWeakPtr<SWindow> /* InFromWindow */, FSimpleDelegate /* InOnTutorialClosed */, FSimpleDelegate /* InOnTutorialExited */);
|
2014-08-05 09:04:35 -04:00
|
|
|
|
|
|
|
|
/** Abstract base class for list entries in the tutorial menu */
|
|
|
|
|
struct ITutorialListEntry
|
|
|
|
|
{
|
|
|
|
|
/** Generate content for a tree entry */
|
|
|
|
|
virtual TSharedRef<ITableRow> OnGenerateTutorialRow(const TSharedRef<STableViewBase>& OwnerTable) const = 0;
|
|
|
|
|
|
|
|
|
|
/** Whether this entry passes the current filter criteria */
|
|
|
|
|
virtual bool PassesFilter(const FString& InCategoryFilter, const FString& InFilter) const = 0;
|
2014-09-18 16:43:17 -04:00
|
|
|
|
2014-09-29 05:28:46 -04:00
|
|
|
/** Get the text representation of this item's title */
|
|
|
|
|
virtual FText GetTitleText() const = 0;
|
|
|
|
|
|
2015-02-02 10:16:37 -05:00
|
|
|
/** Get a priority value to override alphabetical sorting */
|
|
|
|
|
virtual int32 GetSortOrder() const = 0;
|
|
|
|
|
|
2014-09-18 16:43:17 -04:00
|
|
|
/**
|
|
|
|
|
* Sort this entry against another entry
|
|
|
|
|
* @return true if this < OtherEntry
|
|
|
|
|
*/
|
|
|
|
|
virtual bool SortAgainst(TSharedRef<ITutorialListEntry> OtherEntry) const = 0;
|
2015-03-23 10:08:21 -04:00
|
|
|
|
|
|
|
|
/** Return true if this entry should show up as completed (currently used to hide/show green check mark) */
|
|
|
|
|
virtual EVisibility GetCompletedVisibility() const = 0;
|
2014-08-05 09:04:35 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FTutorialListEntry_Category;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The widget which holds all available tutorials
|
|
|
|
|
*/
|
|
|
|
|
class STutorialsBrowser : public SCompoundWidget
|
|
|
|
|
{
|
|
|
|
|
SLATE_BEGIN_ARGS( STutorialsBrowser ) {}
|
|
|
|
|
|
|
|
|
|
SLATE_ARGUMENT(FSimpleDelegate, OnClosed)
|
|
|
|
|
SLATE_ARGUMENT(FOnLaunchTutorial, OnLaunchTutorial)
|
|
|
|
|
SLATE_ARGUMENT(TWeakPtr<SWindow>, ParentWindow)
|
|
|
|
|
|
|
|
|
|
SLATE_END_ARGS()
|
|
|
|
|
|
|
|
|
|
void Construct(const FArguments& Args);
|
|
|
|
|
|
---- Merging with SlateDev branch ----
Introduces the concept of "Active Ticking" to allow Slate to go to sleep when there is no need to update the UI.
While asleep, Slate will skip the Tick & Paint pass for that frame entirely.
- There are TWO ways to "wake" Slate and cause a Tick/Paint pass:
1. Provide some sort of input (mouse movement, clicks, and key presses). Slate will always tick when the user is active.
- Therefore, if the logic in a given widget's Tick is only relevant in response to user action, there is no need to register an active tick.
2. Register an Active Tick. Currently this is an all-or-nothing situation, so if a single active tick needs to execute, all of Slate will be ticked.
- The purpose of an Active Tick is to allow a widget to "drive" Slate and guarantee a Tick/Paint pass in the absence of any user action.
- Examples include animation, async operations that update periodically, progress updates, loading bars, etc.
- An empty active tick is registered for viewports when they are real-time, so game project widgets are unaffected by this change and should continue to work as before.
- An Active Tick is registered by creating an FWidgetActiveTickDelegate and passing it to SWidget::RegisterActiveTick()
- There are THREE ways to unregister an active tick:
1. Return EActiveTickReturnType::StopTicking from the active tick function
2. Pass the FActiveTickHandle returned by RegisterActiveTick() to SWidget::UnregisterActiveTick()
3. Destroy the widget responsible for the active tick
- Sleeping is currently disabled, can be enabled with Slate.AllowSlateToSleep cvar
- There is currently a little buffer time during which Slate continues to tick following any input. Long-term, this is planned to be removed.
- The duration of the buffer can be adjusted using Slate.SleepBufferPostInput cvar (defaults to 1.0f)
- The FCurveSequence API has been updated to work with the active tick system
- Playing a curve sequence now requires that you pass the widget being animated by the sequence
- The active tick will automatically be registered on behalf of the widget and unregister when the sequence is complete
- GetLerpLooping() has been removed. Instead, pass true as the second param to Play() to indicate that the animation will loop. This causes the active tick to be registered indefinitely until paused or jumped to the start/end.
[CL 2391669 by Dan Hertzka in Main branch]
2014-12-17 16:07:57 -05:00
|
|
|
/** Set the current filter string. Filters are used to only show the specified category of tutorials (e.g. only Blueprint tutorials) */
|
2014-08-05 09:04:35 -04:00
|
|
|
void SetFilter(const FString& InFilter);
|
|
|
|
|
|
2014-09-18 08:32:42 -04:00
|
|
|
/** Reload all tutorials that we know about */
|
|
|
|
|
void ReloadTutorials();
|
|
|
|
|
|
2014-08-05 09:04:35 -04:00
|
|
|
protected:
|
|
|
|
|
/** Handle generating a table row in the browser */
|
|
|
|
|
TSharedRef<ITableRow> OnGenerateTutorialRow(TSharedPtr<ITutorialListEntry> InItem, const TSharedRef<STableViewBase>& OwnerTable) const;
|
|
|
|
|
|
|
|
|
|
/** Handle closing the browser */
|
|
|
|
|
FReply OnCloseButtonClicked();
|
|
|
|
|
|
|
|
|
|
/** Handle traversing back up the browser hierarchy */
|
|
|
|
|
FReply OnBackButtonClicked();
|
|
|
|
|
|
|
|
|
|
/** Handle whether the back button can be clicked */
|
|
|
|
|
bool IsBackButtonEnabled() const;
|
|
|
|
|
|
|
|
|
|
/** Delegate handler fired when a tutorial is selected form the browser */
|
|
|
|
|
void OnTutorialSelected(UEditorTutorial* InTutorial, bool bRestart);
|
|
|
|
|
|
|
|
|
|
/** Delegate handler fired when a category is selected form the browser */
|
|
|
|
|
void OnCategorySelected(const FString& InCategory);
|
|
|
|
|
|
|
|
|
|
/** Filter displayed tutorials - regenerates the displayed items */
|
|
|
|
|
void FilterTutorials();
|
|
|
|
|
|
|
|
|
|
/** Rebuild the displayed categories */
|
|
|
|
|
TSharedPtr<FTutorialListEntry_Category> RebuildCategories();
|
|
|
|
|
|
|
|
|
|
/** Rebuild the displayed tutorials */
|
|
|
|
|
void RebuildTutorials(TSharedPtr<FTutorialListEntry_Category> InRootCategory);
|
|
|
|
|
|
|
|
|
|
/** Recursive helper function used to find a category given the current NavigationFilter */
|
|
|
|
|
TSharedPtr<FTutorialListEntry_Category> FindCategory_Recursive(TSharedPtr<FTutorialListEntry_Category> InCategory) const;
|
|
|
|
|
|
|
|
|
|
/** Handle rebuilding the browser display when the filter text changes */
|
|
|
|
|
void OnSearchTextChanged(const FText& InText);
|
|
|
|
|
|
|
|
|
|
/** Supplies the text to display in the filter box */
|
|
|
|
|
FText GetSearchText() const;
|
|
|
|
|
|
2014-09-29 05:28:46 -04:00
|
|
|
/** Handle clicking the breadcrumb trail */
|
|
|
|
|
void OnBreadcrumbClicked(const TSharedPtr<ITutorialListEntry>& InEntry);
|
|
|
|
|
|
|
|
|
|
/** Rebuild the breadcrumb trail according to the current category */
|
|
|
|
|
void RebuildCrumbs();
|
|
|
|
|
|
2014-10-13 06:46:06 -04:00
|
|
|
/** Handle an asset being added - rebuild our list if required */
|
|
|
|
|
void HandleAssetAdded(const FAssetData& InAssetData);
|
|
|
|
|
|
2014-08-05 09:04:35 -04:00
|
|
|
private:
|
|
|
|
|
|
---- Merging with SlateDev branch ----
Introduces the concept of "Active Ticking" to allow Slate to go to sleep when there is no need to update the UI.
While asleep, Slate will skip the Tick & Paint pass for that frame entirely.
- There are TWO ways to "wake" Slate and cause a Tick/Paint pass:
1. Provide some sort of input (mouse movement, clicks, and key presses). Slate will always tick when the user is active.
- Therefore, if the logic in a given widget's Tick is only relevant in response to user action, there is no need to register an active tick.
2. Register an Active Tick. Currently this is an all-or-nothing situation, so if a single active tick needs to execute, all of Slate will be ticked.
- The purpose of an Active Tick is to allow a widget to "drive" Slate and guarantee a Tick/Paint pass in the absence of any user action.
- Examples include animation, async operations that update periodically, progress updates, loading bars, etc.
- An empty active tick is registered for viewports when they are real-time, so game project widgets are unaffected by this change and should continue to work as before.
- An Active Tick is registered by creating an FWidgetActiveTickDelegate and passing it to SWidget::RegisterActiveTick()
- There are THREE ways to unregister an active tick:
1. Return EActiveTickReturnType::StopTicking from the active tick function
2. Pass the FActiveTickHandle returned by RegisterActiveTick() to SWidget::UnregisterActiveTick()
3. Destroy the widget responsible for the active tick
- Sleeping is currently disabled, can be enabled with Slate.AllowSlateToSleep cvar
- There is currently a little buffer time during which Slate continues to tick following any input. Long-term, this is planned to be removed.
- The duration of the buffer can be adjusted using Slate.SleepBufferPostInput cvar (defaults to 1.0f)
- The FCurveSequence API has been updated to work with the active tick system
- Playing a curve sequence now requires that you pass the widget being animated by the sequence
- The active tick will automatically be registered on behalf of the widget and unregister when the sequence is complete
- GetLerpLooping() has been removed. Instead, pass true as the second param to Play() to indicate that the animation will loop. This causes the active tick to be registered indefinitely until paused or jumped to the start/end.
[CL 2391669 by Dan Hertzka in Main branch]
2014-12-17 16:07:57 -05:00
|
|
|
/** Triggers a reload of the tutorials */
|
2014-12-19 17:44:49 -05:00
|
|
|
EActiveTimerReturnType TriggerReloadTutorials( double InCurrentTime, float InDeltaTime );
|
---- Merging with SlateDev branch ----
Introduces the concept of "Active Ticking" to allow Slate to go to sleep when there is no need to update the UI.
While asleep, Slate will skip the Tick & Paint pass for that frame entirely.
- There are TWO ways to "wake" Slate and cause a Tick/Paint pass:
1. Provide some sort of input (mouse movement, clicks, and key presses). Slate will always tick when the user is active.
- Therefore, if the logic in a given widget's Tick is only relevant in response to user action, there is no need to register an active tick.
2. Register an Active Tick. Currently this is an all-or-nothing situation, so if a single active tick needs to execute, all of Slate will be ticked.
- The purpose of an Active Tick is to allow a widget to "drive" Slate and guarantee a Tick/Paint pass in the absence of any user action.
- Examples include animation, async operations that update periodically, progress updates, loading bars, etc.
- An empty active tick is registered for viewports when they are real-time, so game project widgets are unaffected by this change and should continue to work as before.
- An Active Tick is registered by creating an FWidgetActiveTickDelegate and passing it to SWidget::RegisterActiveTick()
- There are THREE ways to unregister an active tick:
1. Return EActiveTickReturnType::StopTicking from the active tick function
2. Pass the FActiveTickHandle returned by RegisterActiveTick() to SWidget::UnregisterActiveTick()
3. Destroy the widget responsible for the active tick
- Sleeping is currently disabled, can be enabled with Slate.AllowSlateToSleep cvar
- There is currently a little buffer time during which Slate continues to tick following any input. Long-term, this is planned to be removed.
- The duration of the buffer can be adjusted using Slate.SleepBufferPostInput cvar (defaults to 1.0f)
- The FCurveSequence API has been updated to work with the active tick system
- Playing a curve sequence now requires that you pass the widget being animated by the sequence
- The active tick will automatically be registered on behalf of the widget and unregister when the sequence is complete
- GetLerpLooping() has been removed. Instead, pass true as the second param to Play() to indicate that the animation will loop. This causes the active tick to be registered indefinitely until paused or jumped to the start/end.
[CL 2391669 by Dan Hertzka in Main branch]
2014-12-17 16:07:57 -05:00
|
|
|
|
2014-08-05 09:04:35 -04:00
|
|
|
/** Root entry of the tutorials tree */
|
|
|
|
|
TSharedPtr<FTutorialListEntry_Category> RootEntry;
|
|
|
|
|
|
|
|
|
|
/** Current filtered entries */
|
|
|
|
|
TArray<TSharedPtr<ITutorialListEntry>> FilteredEntries;
|
|
|
|
|
|
|
|
|
|
/** List of tutorials widget */
|
|
|
|
|
TSharedPtr<SListView<TSharedPtr<ITutorialListEntry>>> TutorialList;
|
|
|
|
|
|
|
|
|
|
/** Delegate fired when the close button is clicked */
|
|
|
|
|
FSimpleDelegate OnClosed;
|
|
|
|
|
|
|
|
|
|
/** Delegate fired when a tutorial is selected */
|
|
|
|
|
FOnLaunchTutorial OnLaunchTutorial;
|
|
|
|
|
|
|
|
|
|
/** Current search string */
|
|
|
|
|
FText SearchFilter;
|
|
|
|
|
|
|
|
|
|
/** Current category navigation string */
|
|
|
|
|
FString NavigationFilter;
|
|
|
|
|
|
|
|
|
|
/** Static category filter for this browser */
|
|
|
|
|
FString CategoryFilter;
|
|
|
|
|
|
|
|
|
|
/** Cached current category */
|
|
|
|
|
TWeakPtr<FTutorialListEntry_Category> CurrentCategoryPtr;
|
|
|
|
|
|
|
|
|
|
/** Parent window of this browser */
|
|
|
|
|
TWeakPtr<SWindow> ParentWindow;
|
2014-09-29 05:28:46 -04:00
|
|
|
|
|
|
|
|
/** Breadcrumb trail for path display */
|
|
|
|
|
TSharedPtr<SBreadcrumbTrail<TSharedPtr<ITutorialListEntry>>> BreadcrumbTrail;
|
2014-10-13 06:46:06 -04:00
|
|
|
|
|
|
|
|
/** Whether we need to refresh the content in the browser */
|
|
|
|
|
bool bNeedsRefresh;
|
|
|
|
|
|
|
|
|
|
/** Prevent us from refreshing too often */
|
|
|
|
|
float RefreshTimer;
|
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
|
|
|
};
|