You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Graph Editor node menus converted to ToolMenus
#rb none #rnx [CL 7900622 by Rex Hill in Dev-Editor branch]
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include "EdGraph/EdGraphPin.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "Framework/Commands/UIAction.h"
|
||||
#include "Framework/MultiBox/MultiBoxBuilder.h"
|
||||
#include "ToolMenus.h"
|
||||
#include "EdGraphSchema_K2.h"
|
||||
#include "EdGraph/EdGraphNodeUtils.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
@@ -72,31 +72,33 @@ FSlateIcon UK2Node_MakeArray::GetIconAndTint(FLinearColor& OutColor) const
|
||||
return Icon;
|
||||
}
|
||||
|
||||
void UK2Node_MakeArray::GetContextMenuActions(const FGraphNodeContextMenuBuilder& Context) const
|
||||
void UK2Node_MakeArray::GetNodeContextMenuActions(UToolMenu* Menu, UGraphNodeContextMenuContext* Context) const
|
||||
{
|
||||
Super::GetContextMenuActions(Context);
|
||||
Super::GetNodeContextMenuActions(Menu, Context);
|
||||
|
||||
if (!Context.bIsDebugging)
|
||||
if (!Context->bIsDebugging)
|
||||
{
|
||||
Context.MenuBuilder->BeginSection("K2NodeMakeArray", NSLOCTEXT("K2Nodes", "MakeArrayHeader", "MakeArray"));
|
||||
FToolMenuSection& Section = Menu->AddSection("K2NodeMakeArray", NSLOCTEXT("K2Nodes", "MakeArrayHeader", "MakeArray"));
|
||||
|
||||
if (Context.Pin != NULL)
|
||||
if (Context->Pin != NULL)
|
||||
{
|
||||
if (Context.Pin->Direction == EGPD_Input && Context.Pin->ParentPin == nullptr)
|
||||
if (Context->Pin->Direction == EGPD_Input && Context->Pin->ParentPin == nullptr)
|
||||
{
|
||||
Context.MenuBuilder->AddMenuEntry(
|
||||
Section.AddMenuEntry(
|
||||
"RemovePin",
|
||||
LOCTEXT("RemovePin", "Remove array element pin"),
|
||||
LOCTEXT("RemovePinTooltip", "Remove this array element pin"),
|
||||
FSlateIcon(),
|
||||
FUIAction(
|
||||
FExecuteAction::CreateUObject(const_cast<UK2Node_MakeArray*>(this), &UK2Node_MakeArray::RemoveInputPin, const_cast<UEdGraphPin*>(Context.Pin))
|
||||
FExecuteAction::CreateUObject(const_cast<UK2Node_MakeArray*>(this), &UK2Node_MakeArray::RemoveInputPin, const_cast<UEdGraphPin*>(Context->Pin))
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Context.MenuBuilder->AddMenuEntry(
|
||||
Section.AddMenuEntry(
|
||||
"AddPin",
|
||||
LOCTEXT("AddPin", "Add array element pin"),
|
||||
LOCTEXT("AddPinTooltip", "Add another array element pin"),
|
||||
FSlateIcon(),
|
||||
@@ -106,7 +108,8 @@ void UK2Node_MakeArray::GetContextMenuActions(const FGraphNodeContextMenuBuilder
|
||||
);
|
||||
}
|
||||
|
||||
Context.MenuBuilder->AddMenuEntry(
|
||||
Section.AddMenuEntry(
|
||||
"ResetToWildcard",
|
||||
LOCTEXT("ResetToWildcard", "Reset to wildcard"),
|
||||
LOCTEXT("ResetToWildcardTooltip", "Reset the node to have wildcard input/outputs. Requires no pins are connected."),
|
||||
FSlateIcon(),
|
||||
@@ -115,8 +118,6 @@ void UK2Node_MakeArray::GetContextMenuActions(const FGraphNodeContextMenuBuilder
|
||||
FCanExecuteAction::CreateUObject(this, &UK2Node_MakeArray::CanResetToWildcard)
|
||||
)
|
||||
);
|
||||
|
||||
Context.MenuBuilder->EndSection();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user