Display a validation window when validating a graph, and also a message stating that auto-arrange does not currently work.
This commit is contained in:
parent
6261a7eddc
commit
b7d299f8b1
@ -2,28 +2,26 @@
|
|||||||
|
|
||||||
#include "AssetEditor_ComboActionGraph.h"
|
#include "AssetEditor_ComboActionGraph.h"
|
||||||
|
|
||||||
#include "GraphEditorActions.h"
|
|
||||||
#include "Framework/Commands/GenericCommands.h"
|
|
||||||
#include "Kismet2/BlueprintEditorUtils.h"
|
|
||||||
#include "HAL/PlatformApplicationMisc.h"
|
|
||||||
#include "EdGraphUtilities.h"
|
|
||||||
|
|
||||||
#include "ComboInputEditor.h"
|
|
||||||
#include "ComboActionGraph.h"
|
#include "ComboActionGraph.h"
|
||||||
#include "Nodes/ComboActionGraphNode.h"
|
#include "ComboActionGraphSchema.h"
|
||||||
|
#include "ComboInputEditor.h"
|
||||||
|
#include "EdGraphUtilities.h"
|
||||||
|
#include "GraphEditorActions.h"
|
||||||
|
|
||||||
#include "Ed/EdComboActionGraph.h"
|
#include "Ed/EdComboActionGraph.h"
|
||||||
#include "Ed/EdComboActionGraphEdge.h"
|
#include "Ed/EdComboActionGraphEdge.h"
|
||||||
#include "Ed/EdComboActionGraphNode.h"
|
#include "Ed/EdComboActionGraphNode.h"
|
||||||
#include "Ed/FAssetEditorToolbarComboActionGraph.h"
|
#include "Ed/FAssetEditorToolbarComboActionGraph.h"
|
||||||
#include "Ed/FComboActionGraphEditorCommands.h"
|
#include "Ed/FComboActionGraphEditorCommands.h"
|
||||||
#include "ComboActionGraphSchema.h"
|
#include "Framework/Commands/GenericCommands.h"
|
||||||
//#include "Helpers/ComboActionGraphHelpers.h"
|
#include "HAL/PlatformApplicationMisc.h"
|
||||||
//#include "Helpers/ComboActionSystemEditorBFC.h"
|
#include "Kismet2/BlueprintEditorUtils.h"
|
||||||
#include "Layout/AssetEditorTabs.h"
|
#include "Layout/AssetEditorTabs.h"
|
||||||
#include "Layout/ComboActionGraphLayoutStrategy.h"
|
#include "Layout/ComboActionGraphLayoutStrategy.h"
|
||||||
#include "Layout/ComboActionForceDirectedSolveLayoutStrategy.h"
|
#include "Layout/ComboActionForceDirectedSolveLayoutStrategy.h"
|
||||||
#include "Layout/ComboActionTreeSolveLayoutStrategy.h"
|
#include "Layout/ComboActionTreeSolveLayoutStrategy.h"
|
||||||
//#include "Popups/MDSPopup_GraphValidation.h"
|
#include "Nodes/ComboActionGraphNode.h"
|
||||||
|
#include "Popups/ComboInputPopup_GraphValidation.h"
|
||||||
#include "Search/ComboActionSearchUtils.h"
|
#include "Search/ComboActionSearchUtils.h"
|
||||||
#include "Search/SComboActionSearch.h"
|
#include "Search/SComboActionSearch.h"
|
||||||
#include "Settings/ComboActionGraphEditorSettings.h"
|
#include "Settings/ComboActionGraphEditorSettings.h"
|
||||||
@ -742,35 +740,41 @@ bool FAssetEditor_ComboActionGraph::CanPasteNodes() const
|
|||||||
|
|
||||||
void FAssetEditor_ComboActionGraph::AutoArrange()
|
void FAssetEditor_ComboActionGraph::AutoArrange()
|
||||||
{
|
{
|
||||||
UEdComboActionGraph *EdGraph = Cast<UEdComboActionGraph>(this->EditingGraph->EdGraph);
|
// For now, auto-arrange is broken. Just in case it can be activated by accident,
|
||||||
check(EdGraph != nullptr);
|
// show a popup saying as much if an auto-arrange is attempted.
|
||||||
|
TArray<FText> ValidationMessages;
|
||||||
|
ValidationMessages.Add(LOCTEXT("AssetEditor_ComboActionGraph_AutoArrangeDisabled", "Auto-arrange is currently broken."));
|
||||||
|
ComboInputPopup_GraphValidation::Open(ValidationMessages);
|
||||||
|
|
||||||
const FScopedTransaction Transaction(LOCTEXT("ComboActionGraphEditorAutoArrange", "Combo Action Graph Editor: Auto Arrange all Nodes"));
|
//UEdComboActionGraph *EdGraph = Cast<UEdComboActionGraph>(this->EditingGraph->EdGraph);
|
||||||
|
//check(EdGraph != nullptr);
|
||||||
|
|
||||||
EdGraph->Modify(true);
|
//const FScopedTransaction Transaction(LOCTEXT("ComboActionGraphEditorAutoArrange", "Combo Action Graph Editor: Auto Arrange all Nodes"));
|
||||||
|
|
||||||
UComboActionGraphLayoutStrategy *LayoutStrategy = nullptr;
|
//EdGraph->Modify(true);
|
||||||
switch (this->ComboActionGraphEditorSettings->GetAutoLayoutStrategy())
|
|
||||||
{
|
|
||||||
case EComboActionAutoLayoutStrategyType::Tree:
|
|
||||||
LayoutStrategy = NewObject<UComboActionGraphLayoutStrategy>(EdGraph, UComboActionTreeSolveLayoutStrategy::StaticClass());
|
|
||||||
break;
|
|
||||||
case EComboActionAutoLayoutStrategyType::ForceDirected:
|
|
||||||
LayoutStrategy = NewObject<UComboActionGraphLayoutStrategy>(EdGraph, UComboActionForceDirectedSolveLayoutStrategy::StaticClass());
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LayoutStrategy != nullptr)
|
//UComboActionGraphLayoutStrategy *LayoutStrategy = nullptr;
|
||||||
{
|
//switch (this->ComboActionGraphEditorSettings->GetAutoLayoutStrategy())
|
||||||
LayoutStrategy->Layout(EdGraph);
|
//{
|
||||||
LayoutStrategy->ConditionalBeginDestroy();
|
// case EComboActionAutoLayoutStrategyType::Tree:
|
||||||
}
|
// LayoutStrategy = NewObject<UComboActionGraphLayoutStrategy>(EdGraph, UComboActionTreeSolveLayoutStrategy::StaticClass());
|
||||||
else
|
// break;
|
||||||
{
|
// case EComboActionAutoLayoutStrategyType::ForceDirected:
|
||||||
UE_LOG(LogAssetEditorComboActionGraph, Error, TEXT("[AutoArrange] LayoutStrategy is null."));
|
// LayoutStrategy = NewObject<UComboActionGraphLayoutStrategy>(EdGraph, UComboActionForceDirectedSolveLayoutStrategy::StaticClass());
|
||||||
}
|
// break;
|
||||||
|
// default:
|
||||||
|
// break;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (LayoutStrategy != nullptr)
|
||||||
|
//{
|
||||||
|
// LayoutStrategy->Layout(EdGraph);
|
||||||
|
// LayoutStrategy->ConditionalBeginDestroy();
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// UE_LOG(LogAssetEditorComboActionGraph, Error, TEXT("[AutoArrange] LayoutStrategy is null."));
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FAssetEditor_ComboActionGraph::CanAutoArrange() const
|
bool FAssetEditor_ComboActionGraph::CanAutoArrange() const
|
||||||
@ -798,12 +802,12 @@ void FAssetEditor_ComboActionGraph::ValidateGraph()
|
|||||||
TArray<FText> ValidationMessages;
|
TArray<FText> ValidationMessages;
|
||||||
if (ComboActionGraph->ValidateGraph(ValidationMessages, true) == false)
|
if (ComboActionGraph->ValidateGraph(ValidationMessages, true) == false)
|
||||||
{
|
{
|
||||||
//ValidationWindow = MDSPopup_GraphValidation::Open(ValidationMessages);
|
this->ValidationWindow = ComboInputPopup_GraphValidation::Open(ValidationMessages);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ValidationMessages.Empty();
|
ValidationMessages.Empty();
|
||||||
//ValidationWindow = MDSPopup_GraphValidation::Open(ValidationMessages);
|
this->ValidationWindow = ComboInputPopup_GraphValidation::Open(ValidationMessages);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user