Files
UnrealEngineUWP/Engine/Source/Editor/IntroTutorials/Private/STutorialButton.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

52 lines
1.6 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
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;
virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override;
private:
void HandleMainFrameLoad(TSharedPtr<SWindow> InRootWindow, bool bIsNewProjectWindow);
FReply HandleButtonClicked();
EVisibility GetVisibility() const;
void DismissAlert();
private:
/** Flag to defer tutorial open until the first Tick() */
bool bDeferTutorialOpen;
/** 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;
/** 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;
};