Hello !
I want to implement FGraphEditorCommands::Get().RemoveExecutionPin like in this file. I think I could do this using FGraphEditorModule.GetAllGraphEditorContextMenuExtender() and FGraphEditorMenuExtender_SelectedNode. So I successfully added my own Delegate to the MenuExtenders array at my module’s startup, but I can not remove it : I get a weird error (see below).
What am I doing wrong ? Am I missing another way to ‘override’ RemovExecutionPin ?
Simplified version of my code :
class FQuestEditor : public IQuestEditor
{
FGraphEditorModule::FGraphEditorMenuExtender_SelectedNode EditorDelegate;
virtual void StartupModule() override
{
//** bind delegate **//
FGraphEditorModule& GraphEditorModule = FModuleManager::GetModuleChecked<FGraphEditorModule>( TEXT("GraphEditor") );
GraphEditorModule.GetAllGraphEditorContextMenuExtender().Add(EditorDelegate);
}
virtual void ShutdownModule() override
{
FGraphEditorModule& GraphEditorModule = FModuleManager::GetModuleChecked<FGraphEditorModule>( TEXT("GraphEditor") );
// here I get the error :
GraphEditorModule.GetAllGraphEditorContextMenuExtender().Remove(EditorDelegate);
}
};
Error:
invalid operands to binary expression (‘ElementType’ (aka ‘TBaseDelegate, const TSharedRef, const UEdGraph *, const UEdGraphNode *, const UEdGraphPin *, bool>’) and ‘const ElementType’ (aka ‘const TBaseDelegate, const TSharedRef, const UEdGraph *, const UEdGraphNode *, const UEdGraphPin *, bool>’))
Error thrown here