12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- // Fill out your copyright notice in the Description page of Project Settings.
- #pragma once
- #include "CoreMinimal.h"
- #include "Widgets/SCompoundWidget.h"
- #include "Widgets/Layout/SScrollBox.h"
- #include "EzAbilityState.h"
- #include "EzAbleTreeViewOperationMode.h"
- /**
- *
- */
- class EZABILITYEDITOR_API SEzAbleTreeViewWidget : public SCompoundWidget
- {
- public:
- SLATE_BEGIN_ARGS(SEzAbleTreeViewWidget)
- {}
- SLATE_END_ARGS()
- /** Constructs this widget with InArgs */
- void Construct(const FArguments& InArgs, TSharedPtr<FEzAbleTreeViewOperationMode> InAbleTreeViewOperationMode);
- FReply HandleAddStateButton();
- // Treeview handlers
- TSharedRef<ITableRow> HandleGenerateRow(TWeakObjectPtr<UEzAbilityState> InState, const TSharedRef<STableViewBase>& InOwnerTableView);
- void HandleGetChildren(TWeakObjectPtr<UEzAbilityState> InParent, TArray<TWeakObjectPtr<UEzAbilityState>>& OutChildren);
- void UpdateTree(bool bExpandPersistent = false);
- void HandleTreeSelectionChanged(TWeakObjectPtr<UEzAbilityState> InSelectedItem, ESelectInfo::Type SelectionType);
- void HandleTreeExpansionChanged(TWeakObjectPtr<UEzAbilityState> InSelectedItem, bool bExpanded);
- TSharedPtr<SWidget> HandleContextMenuOpening();
- void HandleModelStateAdded(UEzAbilityState* ParentState, UEzAbilityState* NewState);
- bool HasSelection() const;
- void BindCommands();
- //Action Handlers
- UEzAbilityState* GetFirstSelectedState() const;
- void HandleDeleteStates();
- void HandleAddChildState();
- void HandleAddSiblingState();
- private:
- virtual FReply OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent) override;
- public:
- TSharedPtr<FEzAbleTreeViewOperationMode> AbleTreeViewOperationMode;
- TSharedPtr<STreeView<TWeakObjectPtr<UEzAbilityState>>> TreeView;
- TSharedPtr<SScrollBox> ViewBox;
- TArray<TWeakObjectPtr<UEzAbilityState>> Subtrees;
- TSharedPtr<FUICommandList> CommandList;
- bool bUpdatingSelection;
- // TArray<TWeakObjectPtr<UEzAbilityState>> TestState;
- // TArray<TObjectPtr<UEzAbilityState>> TestStrongState;
- //
- // TObjectPtr<UEzAbilityState> TestAddState;
- };
|