Files
UnrealEngineUWP/Engine/Source/Editor/IntroTutorials/Private/STutorialRoot.h
Thomas Sarkanen 8dc16308f3 Added tutorials button in top bar of editor & sub-editors
Icon is only visible if content is available for the editor in question.
Split editor settings into two groups - one is persistent settings and one is progress/state.
Tutorials record their dismissed state, so users can permenantly disable the 'nag' for a particular tutorial.
Tutorial content now solidifies when the mouse is hovered over it, so it can be made easier to read.
Fixed crash on startup if an intro tutorial was displaying rich text.
Also fixed crash for TTP# 345094, where a zero-length tutorial was being accessed.

[CL 2275934 by Thomas Sarkanen in Main branch]
2014-08-28 06:22:40 -04:00

76 lines
2.4 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
class UEditorTutorial;
class SEditorTutorials;
/**
* The widget which simply monitors windows in its tick function to see if we need to attach
* a tutorial overlay.
*/
class STutorialRoot : public SCompoundWidget, public FGCObject
{
public:
SLATE_BEGIN_ARGS( STutorialRoot )
{
_Visibility = EVisibility::HitTestInvisible;
}
SLATE_END_ARGS()
void Construct(const FArguments& InArgs);
/** SWidget implementation */
virtual void Tick( const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime ) override;
/** FGCObject implementation */
virtual void AddReferencedObjects( FReferenceCollector& Collector ) override;
/** Launch the specified tutorial from the specified window */
void LaunchTutorial(UEditorTutorial* InTutorial, bool bInRestart, TWeakPtr<SWindow> InNavigationWindow, FSimpleDelegate InOnTutorialClosed, FSimpleDelegate InOnTutorialExited);
/** Close all tutorial content */
void CloseAllTutorialContent();
/** Summon the browser widget for the specified window */
void SummonTutorialBrowser(TSharedRef<SWindow> InWindow, const FString& InFilter = TEXT(""));
/** Reload tutorials that we know about */
void ReloadTutorials();
/** Got to the previous stage in the current tutorial */
void GoToPreviousStage();
/** Got to the next stage in the current tutorial */
void GoToNextStage(TWeakPtr<SWindow> InNavigationWindow);
private:
/** Handle when the next button is clicked - forward navigation to other overlays */
void HandleNextClicked(TWeakPtr<SWindow> InNavigationWindow);
/** Handle when the back button is clicked - forward navigation to other overlays */
void HandleBackClicked();
/** Handle when the home button is clicked - forward navigation to other overlays */
void HandleHomeClicked();
/** Handle retrieving the current tutorial */
UEditorTutorial* HandleGetCurrentTutorial();
/** Handle retrieving the current tutorial stage */
int32 HandleGetCurrentTutorialStage();
/** Function called on Tick() to check active windows for whether they need an overlay adding */
void MaybeAddOverlay(TSharedRef<SWindow> InWindow);
private:
/** Container widgets, inserted into window overlays */
TMap<TWeakPtr<SWindow>, TWeakPtr<SEditorTutorials>> TutorialWidgets;
/** Tutorial we are currently viewing */
UEditorTutorial* CurrentTutorial;
/** Current stage of tutorial */
int32 CurrentTutorialStage;
};