2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "IEnvironmentQueryEditor.h"
|
|
|
|
|
#include "Toolkits/AssetEditorToolkit.h"
|
2015-02-23 10:30:16 -05:00
|
|
|
#include "AIGraphEditor.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-02-23 10:30:16 -05:00
|
|
|
class FEnvironmentQueryEditor : public IEnvironmentQueryEditor, public FAIGraphEditor
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void RegisterTabSpawners(const TSharedRef<class FTabManager>& TabManager) override;
|
|
|
|
|
virtual void UnregisterTabSpawners(const TSharedRef<class FTabManager>& TabManager) override;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
void InitEnvironmentQueryEditor( const EToolkitMode::Type Mode, const TSharedPtr< class IToolkitHost >& InitToolkitHost, UEnvQuery* Script );
|
|
|
|
|
|
|
|
|
|
// Begin IToolkit interface
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual FName GetToolkitFName() const override;
|
|
|
|
|
virtual FText GetBaseToolkitName() const override;
|
|
|
|
|
virtual FString GetWorldCentricTabPrefix() const override;
|
|
|
|
|
virtual FLinearColor GetWorldCentricTabColorScale() const override;
|
2014-03-14 14:13:41 -04:00
|
|
|
// End IToolkit interface
|
|
|
|
|
|
2015-02-23 17:44:01 -05:00
|
|
|
// Begin IEnvironmentQueryEditor interface
|
|
|
|
|
virtual uint32 GetSelectedNodesCount() const override { return SelectedNodesCount; }
|
|
|
|
|
// End IEnvironmentQueryEditor interface
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
void OnFinishedChangingProperties(const FPropertyChangedEvent& PropertyChangedEvent);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
/** Called when "Save" is clicked for this asset */
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void SaveAsset_Execute() override;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
/** Create widget for graph editing */
|
|
|
|
|
TSharedRef<class SGraphEditor> CreateGraphEditorWidget(UEdGraph* InGraph);
|
|
|
|
|
|
|
|
|
|
/** Creates all internal widgets for the tabs to point at */
|
|
|
|
|
void CreateInternalWidgets();
|
|
|
|
|
|
|
|
|
|
/** Called when the selection changes in the GraphEditor */
|
2015-04-01 07:20:55 -04:00
|
|
|
void OnSelectedNodesChanged(const TSet<class UObject*>& NewSelection) override;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/** Spawns the tab with the update graph inside */
|
|
|
|
|
TSharedRef<SDockTab> SpawnTab_UpdateGraph(const FSpawnTabArgs& Args);
|
|
|
|
|
TSharedRef<SDockTab> SpawnTab_Properties(const FSpawnTabArgs& Args);
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
/* Query being edited */
|
|
|
|
|
UEnvQuery* Query;
|
|
|
|
|
|
|
|
|
|
/** Property View */
|
|
|
|
|
TSharedPtr<class IDetailsView> DetailsView;
|
|
|
|
|
|
2015-02-23 15:58:14 -05:00
|
|
|
uint32 SelectedNodesCount;
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
/** Graph editor tab */
|
|
|
|
|
static const FName EQSUpdateGraphTabId;
|
|
|
|
|
static const FName EQSPropertiesTabId;
|
|
|
|
|
};
|