|
@@ -5,6 +5,7 @@
|
|
|
#include "SlateOptMacros.h"
|
|
|
#include "SPositiveActionButton.h"
|
|
|
#include "Widgets/Layout/SScrollBox.h"
|
|
|
+#include "SEzAbleTreeViewRowWidget.h"
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "AbleStateTreeEditor"
|
|
|
|
|
@@ -19,6 +20,9 @@ void SEzAbleTreeViewWidget::Construct(const FArguments& InArgs)
|
|
|
.Orientation(Orient_Vertical)
|
|
|
.Thickness(FVector2D(12.0f, 12.0f));
|
|
|
|
|
|
+ TreeView = SNew(STreeView<TWeakObjectPtr<UEzAbilityState>>)
|
|
|
+ .OnGenerateRow(this, &SEzAbleTreeViewWidget::HandleGenerateRow);
|
|
|
+
|
|
|
ChildSlot
|
|
|
[
|
|
|
SNew(SVerticalBox)
|
|
@@ -43,7 +47,7 @@ void SEzAbleTreeViewWidget::Construct(const FArguments& InArgs)
|
|
|
.ToolTipText(LOCTEXT("AddStateToolTip", "Add New State"))
|
|
|
.Icon(FAppStyle::Get().GetBrush("Icons.Plus"))
|
|
|
.Text(LOCTEXT("AddState", "Add State"))
|
|
|
- //.OnClicked(this, &SStateTreeView::HandleAddStateButton)
|
|
|
+ .OnClicked(this, &SEzAbleTreeViewWidget::HandleAddStateButton)
|
|
|
]
|
|
|
]
|
|
|
]
|
|
@@ -60,10 +64,10 @@ void SEzAbleTreeViewWidget::Construct(const FArguments& InArgs)
|
|
|
.Orientation(Orient_Horizontal)
|
|
|
.ExternalScrollbar(HorizontalScrollBar)
|
|
|
+ SScrollBox::Slot()
|
|
|
-// .FillSize(1.0f)
|
|
|
-// [
|
|
|
-// TreeView.ToSharedRef()
|
|
|
-// ]
|
|
|
+ .FillSize(1.0f)
|
|
|
+ [
|
|
|
+ TreeView.ToSharedRef()
|
|
|
+ ]
|
|
|
]
|
|
|
|
|
|
+ SHorizontalBox::Slot()
|
|
@@ -87,4 +91,15 @@ void SEzAbleTreeViewWidget::Construct(const FArguments& InArgs)
|
|
|
}
|
|
|
END_SLATE_FUNCTION_BUILD_OPTIMIZATION
|
|
|
|
|
|
+FReply SEzAbleTreeViewWidget::HandleAddStateButton()
|
|
|
+{
|
|
|
+ UE_LOG(LogTemp, Log, TEXT("SEzAbleTreeViewWidget::HandleAddStateButton"));
|
|
|
+ return FReply::Handled();
|
|
|
+}
|
|
|
+
|
|
|
+TSharedRef<ITableRow> SEzAbleTreeViewWidget::HandleGenerateRow(TWeakObjectPtr<UEzAbilityState> InState, const TSharedRef<STableViewBase>& InOwnerTableView)
|
|
|
+{
|
|
|
+ return SNew(SEzAbleTreeViewRowWidget, InOwnerTableView, InState, ViewBox);
|
|
|
+}
|
|
|
+
|
|
|
#undef LOCTEXT_NAMESPACE
|