|
@@ -0,0 +1,186 @@
|
|
|
+// Copyright (c) Extra Life Studios, LLC. All rights reserved.
|
|
|
+
|
|
|
+#include "EzAbilityTimelinePanel.h"
|
|
|
+
|
|
|
+#include "EdGraph/EdGraph.h"
|
|
|
+#include "Fonts/FontMeasure.h"
|
|
|
+#include "Framework/Application/MenuStack.h"
|
|
|
+#include "Framework/Application/SlateApplication.h"
|
|
|
+#include "Framework/Text/RichTextLayoutMarshaller.h"
|
|
|
+#include "Styling/AppStyle.h"
|
|
|
+#include "Rendering/SlateRenderer.h"
|
|
|
+#include "Widgets/Layout/SBorder.h"
|
|
|
+#include "Widgets/Layout/SBox.h"
|
|
|
+#include "Widgets/Layout/SSpacer.h"
|
|
|
+#include "Widgets/Images/SImage.h"
|
|
|
+#include "Widgets/Input/SButton.h"
|
|
|
+#include "Widgets/Input/SEditableText.h"
|
|
|
+#include "Widgets/Input/SNumericEntryBox.h"
|
|
|
+#include "Widgets/Text/STextBlock.h"
|
|
|
+#include "Widgets/Text/SRichTextBlock.h"
|
|
|
+#include "Widgets/SWindow.h"
|
|
|
+#include "EzAbilityTimelineScrubPanel.h"
|
|
|
+
|
|
|
+#define LOCTEXT_NAMESPACE "AblAbilityEditor"
|
|
|
+
|
|
|
+SEzAbilityTimelinePanel::SEzAbilityTimelinePanel()
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void SEzAbilityTimelinePanel::Construct(const FArguments& InArgs)
|
|
|
+{
|
|
|
+ ChildSlot
|
|
|
+ [
|
|
|
+ SNew(SBorder)
|
|
|
+ .BorderImage(FCoreStyle::Get().GetBrush("ToolPanel.GroupBorder"))
|
|
|
+ [
|
|
|
+ SNew(SVerticalBox)
|
|
|
+ + SVerticalBox::Slot()
|
|
|
+ .AutoHeight()
|
|
|
+ .VAlign(VAlign_Top)
|
|
|
+ [
|
|
|
+ SNew(SHorizontalBox)
|
|
|
+ + SHorizontalBox::Slot()
|
|
|
+ .FillWidth(0.26f)
|
|
|
+ .HAlign(HAlign_Fill)
|
|
|
+ [
|
|
|
+ BuildTimelineControls()
|
|
|
+ ]
|
|
|
+ + SHorizontalBox::Slot()
|
|
|
+ .FillWidth(0.74f)
|
|
|
+ .HAlign(EHorizontalAlignment::HAlign_Fill)
|
|
|
+ [
|
|
|
+ SNew(SEzAbilityTimelineScrubPanel)
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+}
|
|
|
+
|
|
|
+void SEzAbilityTimelinePanel::Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime)
|
|
|
+{
|
|
|
+ SCompoundWidget::Tick(AllottedGeometry, InCurrentTime, InDeltaTime);
|
|
|
+}
|
|
|
+
|
|
|
+TSharedRef<SWidget> SEzAbilityTimelinePanel::BuildTimelineControls()
|
|
|
+{
|
|
|
+ return
|
|
|
+ SNew(SBorder)
|
|
|
+ .BorderImage(FCoreStyle::Get().GetBrush("ToolPanel.GroupBorder"))
|
|
|
+ [
|
|
|
+ SNew(SHorizontalBox)
|
|
|
+ + SHorizontalBox::Slot()
|
|
|
+ .Padding(1.0f, 2.0f)
|
|
|
+ .HAlign(HAlign_Left)
|
|
|
+ .AutoWidth()
|
|
|
+ [
|
|
|
+ SNew(SButton)
|
|
|
+ .ButtonStyle(FAppStyle::Get(), "NoBorder")
|
|
|
+ .ToolTipText(LOCTEXT("StepBack", "Step Back"))
|
|
|
+ .ContentPadding(2.0f)
|
|
|
+ [
|
|
|
+ SNew(SImage)
|
|
|
+ .Image(FAppStyle::GetBrush("WhiteBrush"))
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ + SHorizontalBox::Slot()
|
|
|
+ .Padding(1.0f, 2.0f)
|
|
|
+ .HAlign(HAlign_Left)
|
|
|
+ .AutoWidth()
|
|
|
+ [
|
|
|
+ SNew(SButton)
|
|
|
+ .ButtonStyle(FAppStyle::Get(), "NoBorder")
|
|
|
+ .ToolTipText(LOCTEXT("Stop", "Stop"))
|
|
|
+ .ContentPadding(2.0f)
|
|
|
+ [
|
|
|
+ SNew(SImage)
|
|
|
+ .Image(FAppStyle::GetBrush("WhiteBrush"))
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ + SHorizontalBox::Slot()
|
|
|
+ .Padding(1.0f, 2.0f)
|
|
|
+ .HAlign(HAlign_Left)
|
|
|
+ .AutoWidth()
|
|
|
+ [
|
|
|
+ SNew(SButton)
|
|
|
+ .ButtonStyle(FAppStyle::Get(), "NoBorder")
|
|
|
+ //.OnClicked(this, &SAblAbilityTimelinePanel::OnPlayOrPause)
|
|
|
+ //.ToolTipText(this, &SAblAbilityTimelinePanel::GetPlayPauseToolTip)
|
|
|
+ .ContentPadding(2.0f)
|
|
|
+ [
|
|
|
+ SNew(SImage)
|
|
|
+ .Image(FAppStyle::GetBrush("WhiteBrush"))
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ + SHorizontalBox::Slot()
|
|
|
+ .Padding(1.0f, 2.0f)
|
|
|
+ .HAlign(HAlign_Left)
|
|
|
+ .AutoWidth()
|
|
|
+ [
|
|
|
+ SNew(SButton)
|
|
|
+ .ButtonStyle(FAppStyle::Get(), "NoBorder")
|
|
|
+ //.OnClicked(this, &SAblAbilityTimelinePanel::OnStepForwards)
|
|
|
+ .ToolTipText(LOCTEXT("StepForward", "Step Forward"))
|
|
|
+ .ContentPadding(2.0f)
|
|
|
+ [
|
|
|
+ SNew(SImage)
|
|
|
+ .Image(FAppStyle::GetBrush("WhiteBrush"))
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+
|
|
|
+ + SHorizontalBox::Slot()
|
|
|
+ .HAlign(HAlign_Left)
|
|
|
+ .AutoWidth()
|
|
|
+ [
|
|
|
+ SNew(SSpacer)
|
|
|
+ .Size(FVector2D(16.0f, 1.0f))
|
|
|
+ ]
|
|
|
+
|
|
|
+ + SHorizontalBox::Slot()
|
|
|
+ .HAlign(HAlign_Left)
|
|
|
+ .VAlign(VAlign_Center)
|
|
|
+ .AutoWidth()
|
|
|
+ [
|
|
|
+ SNew(SNumericEntryBox<float>)
|
|
|
+ .Font(FAppStyle::GetFontStyle(TEXT("PropertyWindow.NormalFont")))
|
|
|
+ .AllowSpin(false)
|
|
|
+ //.MinValue(this, &SAblAbilityTimelinePanel::GetTimeMin)
|
|
|
+ //.MaxValue(this, &SAblAbilityTimelinePanel::GetTimeMax)
|
|
|
+ //.Value(this, &SAblAbilityTimelinePanel::GetCurrentTime)
|
|
|
+ //.OnValueCommitted(this, &SAblAbilityTimelinePanel::OnTimeValueCommitted)
|
|
|
+ //.ToolTipText(this, &SAblAbilityTimelinePanel::GetTimeTooltipText)
|
|
|
+ .Label()
|
|
|
+ [
|
|
|
+ SNumericEntryBox<float>::BuildLabel(LOCTEXT("AblTimelineTimeLabel", "Time"), FLinearColor::White, FLinearColor(0.2f, 0.2f, 0.2f))
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+
|
|
|
+ + SHorizontalBox::Slot()
|
|
|
+ .HAlign(HAlign_Left)
|
|
|
+ .AutoWidth()
|
|
|
+ [
|
|
|
+ SNew(SSpacer)
|
|
|
+ .Size(FVector2D(16.0f, 1.0f))
|
|
|
+ ]
|
|
|
+
|
|
|
+ + SHorizontalBox::Slot()
|
|
|
+ .HAlign(HAlign_Left)
|
|
|
+ .VAlign(VAlign_Center)
|
|
|
+ .AutoWidth()
|
|
|
+ [
|
|
|
+ SNew(SNumericEntryBox<int>)
|
|
|
+ .Font(FAppStyle::GetFontStyle(TEXT("PropertyWindow.NormalFont")))
|
|
|
+ .AllowSpin(true)
|
|
|
+ //.MinValue(this, &SAblAbilityTimelinePanel::GetFrameMin)
|
|
|
+ //.MaxValue(this, &SAblAbilityTimelinePanel::GetFrameMax)
|
|
|
+ //.Value(this, &SAblAbilityTimelinePanel::GetCurrentFrame)
|
|
|
+ //.OnValueCommitted(this, &SAblAbilityTimelinePanel::OnFrameValueCommitted)
|
|
|
+ //.ToolTipText(this, &SAblAbilityTimelinePanel::GetFramesTooltipText)
|
|
|
+ .Label()
|
|
|
+ [
|
|
|
+ SNumericEntryBox<float>::BuildLabel(LOCTEXT("AblTimelineFrameLabel", "Frame"), FLinearColor::White, FLinearColor(0.2f, 0.2f, 0.2f))
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+}
|