2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-08-28 06:22:40 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2015-01-27 14:54:15 -05:00
|
|
|
#include "STutorialLoading.h"
|
|
|
|
|
|
2014-08-28 06:22:40 -04:00
|
|
|
class STutorialButton : public SCompoundWidget
|
|
|
|
|
{
|
|
|
|
|
SLATE_BEGIN_ARGS(STutorialButton) {}
|
|
|
|
|
|
|
|
|
|
SLATE_ARGUMENT(FName, Context)
|
|
|
|
|
|
|
|
|
|
SLATE_ARGUMENT(TWeakPtr<SWindow>, ContextWindow)
|
|
|
|
|
|
|
|
|
|
SLATE_END_ARGS()
|
|
|
|
|
|
|
|
|
|
/** Widget constructor */
|
|
|
|
|
void Construct(const FArguments& Args);
|
|
|
|
|
|
|
|
|
|
virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyClippingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override;
|
|
|
|
|
virtual FReply OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
|
---- 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-28 06:22:40 -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
|
|
|
/** Opens the tutorial post-construct */
|
2014-12-19 17:44:49 -05:00
|
|
|
EActiveTimerReturnType OpenTutorialPostConstruct( 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-09-10 08:09:10 -04:00
|
|
|
/** Handle clicking the tutorial button */
|
2014-08-28 06:22:40 -04:00
|
|
|
FReply HandleButtonClicked();
|
|
|
|
|
|
2015-01-24 15:00:16 -05:00
|
|
|
/** After the initial click is processed, go here, wait for the asset registry to load, and complete the action once we're ready */
|
|
|
|
|
EActiveTimerReturnType HandleButtonClicked_AssetRegistryChecker(double InCurrentTime, float InDeltaTime);
|
|
|
|
|
|
2014-09-10 08:09:10 -04:00
|
|
|
/** Dismiss the pulsing alert */
|
2014-08-28 06:22:40 -04:00
|
|
|
void DismissAlert();
|
|
|
|
|
|
2015-03-20 11:54:33 -04:00
|
|
|
/** Dismiss all pulsing alerts */
|
|
|
|
|
void DismissAllAlerts();
|
|
|
|
|
|
2014-09-10 08:09:10 -04:00
|
|
|
/** Launch the tutorials browser */
|
|
|
|
|
void LaunchBrowser();
|
|
|
|
|
|
|
|
|
|
/** Check whether we should launch the browser in this context */
|
|
|
|
|
bool ShouldLaunchBrowser() const;
|
|
|
|
|
|
|
|
|
|
/** Check whether we should show the alert in this context */
|
|
|
|
|
bool ShouldShowAlert() const;
|
|
|
|
|
|
|
|
|
|
/** Get the tooltip for the tutorials button */
|
|
|
|
|
FText GetButtonToolTip() const;
|
|
|
|
|
|
2014-09-18 08:32:42 -04:00
|
|
|
/** Launch tutorial from the context menu */
|
|
|
|
|
void LaunchTutorial();
|
|
|
|
|
|
2014-09-18 10:28:16 -04:00
|
|
|
/** Refresh internal status of flags, tutorials, filters etc.*/
|
|
|
|
|
void RefreshStatus();
|
|
|
|
|
|
|
|
|
|
/** Handle tutorial exiting/finishing */
|
|
|
|
|
void HandleTutorialExited();
|
|
|
|
|
|
2014-08-28 06:22:40 -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
|
|
|
|
2014-08-28 06:22:40 -04:00
|
|
|
/** Whether we have a tutorial for this context */
|
|
|
|
|
bool bTutorialAvailable;
|
|
|
|
|
|
|
|
|
|
/** Whether we have completed the tutorial for this content */
|
|
|
|
|
bool bTutorialCompleted;
|
|
|
|
|
|
|
|
|
|
/** Whether we have dismissed the tutorial for this content */
|
|
|
|
|
bool bTutorialDismissed;
|
|
|
|
|
|
2014-09-22 09:42:41 -04:00
|
|
|
/** Flag to force alerts to appear in internal builds (caches command line -TestTutorialAlerts) */
|
|
|
|
|
bool bTestAlerts;
|
|
|
|
|
|
2014-08-28 06:22:40 -04:00
|
|
|
/** Context that this widget was created for (i.e. what part of the editor) */
|
|
|
|
|
FName Context;
|
|
|
|
|
|
|
|
|
|
/** Window that the tutorial should be launched in */
|
|
|
|
|
TWeakPtr<SWindow> ContextWindow;
|
|
|
|
|
|
|
|
|
|
/** Animation curve for displaying pulse */
|
|
|
|
|
FCurveSequence PulseAnimation;
|
2014-09-18 08:10:29 -04:00
|
|
|
|
|
|
|
|
/** Start time we began playing the alert animation */
|
|
|
|
|
float AlertStartTime;
|
2014-09-18 08:32:42 -04:00
|
|
|
|
|
|
|
|
/** The name of the tutorial we will launch */
|
|
|
|
|
FText TutorialTitle;
|
2014-09-18 10:28:16 -04:00
|
|
|
|
|
|
|
|
/** Cached attract tutorial */
|
|
|
|
|
UEditorTutorial* CachedAttractTutorial;
|
|
|
|
|
|
|
|
|
|
/** Cached launch tutorial */
|
|
|
|
|
UEditorTutorial* CachedLaunchTutorial;
|
|
|
|
|
|
|
|
|
|
/** Cached browser filter */
|
|
|
|
|
FString CachedBrowserFilter;
|
2015-01-24 15:00:16 -05:00
|
|
|
|
2015-01-27 14:54:15 -05:00
|
|
|
TSharedPtr<SWidget> LoadingWidget;
|
|
|
|
|
|
2015-01-24 15:00:16 -05:00
|
|
|
/** True if we're waiting for asset registry to load in response to a click */
|
|
|
|
|
bool bPendingClickAction;
|
2014-08-28 06:22:40 -04:00
|
|
|
};
|