// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "AsyncStateTreeDiff.h" #include "DiffUtils.h" #include "Editor/Kismet/Private/DiffControl.h" #include "Internationalization/Text.h" #include "UObject/ObjectKey.h" #include "UObject/StrongObjectPtr.h" class FBlueprintDifferenceTreeEntry; class FStateTreeViewModel; class FUICommandList; class SLinkableScrollBar; class SStateTreeView; class SWidget; class UStateTree; namespace UE::StateTree::Diff { struct FSingleDiffEntry; class STATETREEEDITORMODULE_API FDiffWidgets { public: explicit FDiffWidgets(const UStateTree* InStateTree); /** Returns actual widget that is used to display trees */ TSharedRef GetStateTreeWidget() const; private: TSharedPtr StateTreeTreeView; TSharedPtr StateTreeViewModel; }; DECLARE_MULTICAST_DELEGATE_OneParam(FOnStateDiffEntryFocused, const FSingleDiffEntry&) class STATETREEEDITORMODULE_API FDiffControl : public TSharedFromThis { public: FDiffControl() = delete; FDiffControl(const FDiffControl& Other) = delete; FDiffControl(const FDiffControl&& Other) = delete; FDiffControl(const UStateTree* InOldObject, const UStateTree* InNewObject, const FOnDiffEntryFocused& InSelectionCallback); ~FDiffControl(); TSharedRef GetDetailsWidget(const UStateTree* Object) const; FOnStateDiffEntryFocused& GetOnStateDiffEntryFocused() { return OnStateDiffEntryFocused; }; void GenerateTreeEntries(TArray>& OutDifferences); TConstArrayView GetBindingDifferences() const { return BindingDiffs; } protected: static FText RightRevision; static TSharedRef GenerateSingleEntryWidget(FSingleDiffEntry DiffEntry, FText ObjectName); TSharedRef InsertObject(TNotNull StateTree); void OnSelectDiffEntry(const FSingleDiffEntry StateDiff); FOnDiffEntryFocused OnDiffEntryFocused; FOnStateDiffEntryFocused OnStateDiffEntryFocused; TArray> DisplayedAssets; struct FStateTreeTreeDiffPairs { TSharedPtr Left; TSharedPtr Right; }; TMap StateTreeDifferences; TArray BindingDiffs; TMap StateTreeDiffWidgets; }; } // UE::StateTree::Diff