From 0284727e7bc6337ebcd98e61eacf0d095d74a094 Mon Sep 17 00:00:00 2001 From: George Marques Date: Wed, 15 Nov 2017 13:57:24 -0200 Subject: Create API to add and remove VisualScript custom nodes This makes a VisualScriptEditor singleton, which gives plugins the ability to register their own custom nodes. Those will be available for insertion in the Visual Script editor, under the "Custom Nodes" category. --- modules/visual_script/visual_script.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/visual_script/visual_script.cpp') diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 765fe4c2f2..0834bc81d9 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -2644,6 +2644,11 @@ void VisualScriptLanguage::add_register_func(const String &p_name, VisualScriptN register_funcs[p_name] = p_func; } +void VisualScriptLanguage::remove_register_func(const String &p_name) { + ERR_FAIL_COND(!register_funcs.has(p_name)); + register_funcs.erase(p_name); +} + Ref VisualScriptLanguage::create_node_from_name(const String &p_name) { ERR_FAIL_COND_V(!register_funcs.has(p_name), Ref()); -- cgit v1.2.3