|
@@ -5,7 +5,9 @@
|
|
#include "SlateOptMacros.h"
|
|
#include "SlateOptMacros.h"
|
|
#include "SAbleTreeExpanderArrow.h"
|
|
#include "SAbleTreeExpanderArrow.h"
|
|
#include "AbleTreeEditorStyle.h"
|
|
#include "AbleTreeEditorStyle.h"
|
|
-//#include "SInlineEditableTextBlock.h"
|
|
|
|
|
|
+#include "Styling/SlateTypes.h"
|
|
|
|
+#include "Widgets/Text/SInlineEditableTextBlock.h"
|
|
|
|
+
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "AbleTreeViewRow"
|
|
#define LOCTEXT_NAMESPACE "AbleTreeViewRow"
|
|
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
|
|
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
|
|
@@ -126,7 +128,7 @@ void SEzAbleTreeViewRowWidget::Construct(const FArguments& InArgs, const TShared
|
|
.BaseIndentLevel(0)
|
|
.BaseIndentLevel(0)
|
|
.ImageSize(FVector2f(16, 16))
|
|
.ImageSize(FVector2f(16, 16))
|
|
.ImagePadding(FMargin(9, 14, 0, 0))
|
|
.ImagePadding(FMargin(9, 14, 0, 0))
|
|
- .Image(this, &SEzAbleTreeViewRowWidget::GetSelectorIcon) // SStateTreeViewRow::GetSelectorIcon
|
|
|
|
|
|
+ .Image(FAbleTreeEditorStyle::Get().GetBrush("StateTreeEditor.TryFollowTransitions")) // this, &SEzAbleTreeViewRowWidget::GetSelectorIcon
|
|
.ColorAndOpacity(FLinearColor(1, 1, 1, 0.2f))
|
|
.ColorAndOpacity(FLinearColor(1, 1, 1, 0.2f))
|
|
.WireColorAndOpacity(FLinearColor(1, 1, 1, 0.2f))
|
|
.WireColorAndOpacity(FLinearColor(1, 1, 1, 0.2f))
|
|
]
|
|
]
|
|
@@ -161,11 +163,11 @@ void SEzAbleTreeViewRowWidget::Construct(const FArguments& InArgs, const TShared
|
|
[
|
|
[
|
|
SNew(SBorder)
|
|
SNew(SBorder)
|
|
.BorderImage(FAbleTreeEditorStyle::Get().GetBrush("StateTree.State.Border"))
|
|
.BorderImage(FAbleTreeEditorStyle::Get().GetBrush("StateTree.State.Border"))
|
|
- //.BorderBackgroundColor(this, &SStateTreeViewRow::GetActiveStateColor)
|
|
|
|
|
|
+ .BorderBackgroundColor(FLinearColor(FColor(236, 134, 39)))//this, &SStateTreeViewRow::GetActiveStateColor //选择节点时上面的红色框体
|
|
[
|
|
[
|
|
SNew(SBorder)
|
|
SNew(SBorder)
|
|
.BorderImage(FAbleTreeEditorStyle::Get().GetBrush("StateTree.State"))
|
|
.BorderImage(FAbleTreeEditorStyle::Get().GetBrush("StateTree.State"))
|
|
- //.BorderBackgroundColor(this, &SStateTreeViewRow::GetTitleColor, 1.0f, 0.0f)
|
|
|
|
|
|
+ .BorderBackgroundColor(FLinearColor(FColor(31, 151, 167)))//this, &SStateTreeViewRow::GetTitleColor, 1.0f, 0.0f //节点的背景
|
|
.Padding(FMargin(0.f, 0.f, 12.f, 0.f))
|
|
.Padding(FMargin(0.f, 0.f, 12.f, 0.f))
|
|
.IsEnabled_Lambda([InState]
|
|
.IsEnabled_Lambda([InState]
|
|
{
|
|
{
|
|
@@ -222,7 +224,7 @@ void SEzAbleTreeViewRowWidget::Construct(const FArguments& InArgs, const TShared
|
|
.Padding(FMargin(4.f, 0.f, 0.f, 0.f))
|
|
.Padding(FMargin(4.f, 0.f, 0.f, 0.f))
|
|
[
|
|
[
|
|
SNew(SImage)
|
|
SNew(SImage)
|
|
- //.Image(this, &SStateTreeViewRow::GetSelectorIcon)
|
|
|
|
|
|
+ .Image(FAbleTreeEditorStyle::Get().GetBrush("StateTreeEditor.SelectNone"))//this, &SStateTreeViewRow::GetSelectorIcon 这里还不知道是哪个东西
|
|
.ColorAndOpacity(IconTint)
|
|
.ColorAndOpacity(IconTint)
|
|
//.ToolTipText(this, &SStateTreeViewRow::GetSelectorTooltip)
|
|
//.ToolTipText(this, &SStateTreeViewRow::GetSelectorTooltip)
|
|
]
|
|
]
|
|
@@ -247,16 +249,16 @@ void SEzAbleTreeViewRowWidget::Construct(const FArguments& InArgs, const TShared
|
|
+ SHorizontalBox::Slot()
|
|
+ SHorizontalBox::Slot()
|
|
.VAlign(VAlign_Center)
|
|
.VAlign(VAlign_Center)
|
|
.AutoWidth()
|
|
.AutoWidth()
|
|
-// [
|
|
|
|
-// SAssignNew(NameTextBlock, SInlineEditableTextBlock)
|
|
|
|
-// .Style(FAbleTreeEditorStyle::Get(), "StateTree.State.TitleInlineEditableText")
|
|
|
|
-// //.OnTextCommitted(this, &SStateTreeViewRow::HandleNodeLabelTextCommitted)
|
|
|
|
-// //.OnVerifyTextChanged(this, &SStateTreeViewRow::HandleVerifyNodeLabelTextChanged)
|
|
|
|
-// //.Text(this, &SStateTreeViewRow::GetStateDesc)
|
|
|
|
-// //.ToolTipText(this, &SStateTreeViewRow::GetStateTypeTooltip)
|
|
|
|
-// .Clipping(EWidgetClipping::ClipToBounds)
|
|
|
|
-// //.IsSelected(this, &SStateTreeViewRow::IsStateSelected)
|
|
|
|
-// ]
|
|
|
|
|
|
+ [
|
|
|
|
+ SAssignNew(NameTextBlock, SInlineEditableTextBlock)
|
|
|
|
+ //.Style(FAbleTreeEditorStyle::Get(), "StateTree.State.TitleInlineEditableText")
|
|
|
|
+ //.OnTextCommitted(this, &SStateTreeViewRow::HandleNodeLabelTextCommitted)
|
|
|
|
+ //.OnVerifyTextChanged(this, &SStateTreeViewRow::HandleVerifyNodeLabelTextChanged)
|
|
|
|
+ .Text(FText::FromName(FName(TEXT("AbleTree")))) // this, &SStateTreeViewRow::GetStateDesc
|
|
|
|
+ //.ToolTipText(this, &SStateTreeViewRow::GetStateTypeTooltip)
|
|
|
|
+ .Clipping(EWidgetClipping::ClipToBounds)
|
|
|
|
+ //.IsSelected(this, &SStateTreeViewRow::IsStateSelected)
|
|
|
|
+ ]
|
|
|
|
|
|
// Linked State
|
|
// Linked State
|
|
+ SHorizontalBox::Slot()
|
|
+ SHorizontalBox::Slot()
|
|
@@ -461,8 +463,7 @@ const FSlateBrush* SEzAbleTreeViewRowWidget::GetSelectorIcon() const
|
|
{
|
|
{
|
|
if (const UEzAbilityState* State = WeakState.Get())
|
|
if (const UEzAbilityState* State = WeakState.Get())
|
|
{
|
|
{
|
|
- FSlateBrush* SlateBrush = new FSlateBrush();
|
|
|
|
- return SlateBrush;
|
|
|
|
|
|
+ return FAbleTreeEditorStyle::GetBrushForSelectionBehaviorType();
|
|
//return FStateTreeEditorStyle::GetBrushForSelectionBehaviorType(State->SelectionBehavior, !State->Children.IsEmpty(), State->Type);
|
|
//return FStateTreeEditorStyle::GetBrushForSelectionBehaviorType(State->SelectionBehavior, !State->Children.IsEmpty(), State->Type);
|
|
}
|
|
}
|
|
|
|
|