diff options
| author | Rémi Verschelde | 2018-03-23 11:08:03 +0100 |
|---|---|---|
| committer | GitHub | 2018-03-23 11:08:03 +0100 |
| commit | 74382dbfbb15c19bd1302e7eb6e0f8943ad43b14 (patch) | |
| tree | 5d5307f724c9fd3a3fe9443c681754b249223bac /editor/editor_plugin.cpp | |
| parent | c537107af9b27f328b25a631149a19f937d301f6 (diff) | |
| parent | 9da18f3974a374318ab10b4080c8d00e890669d2 (diff) | |
| download | godot-74382dbfbb15c19bd1302e7eb6e0f8943ad43b14.tar.gz godot-74382dbfbb15c19bd1302e7eb6e0f8943ad43b14.tar.zst godot-74382dbfbb15c19bd1302e7eb6e0f8943ad43b14.zip | |
Merge pull request #17576 from Mr-Slurpy/master
Allow users to add items to Tool menu
Diffstat (limited to 'editor/editor_plugin.cpp')
| -rw-r--r-- | editor/editor_plugin.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 31d0bfa8a..4f38c0188 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -429,21 +429,18 @@ void EditorPlugin::remove_control_from_container(CustomControlContainer p_locati } void EditorPlugin::add_tool_menu_item(const String &p_name, Object *p_handler, const String &p_callback, const Variant &p_ud) { - - //EditorNode::get_singleton()->add_tool_menu_item(p_name, p_handler, p_callback, p_ud); + EditorNode::get_singleton()->add_tool_menu_item(p_name, p_handler, p_callback, p_ud); } void EditorPlugin::add_tool_submenu_item(const String &p_name, Object *p_submenu) { - ERR_FAIL_NULL(p_submenu); PopupMenu *submenu = Object::cast_to<PopupMenu>(p_submenu); ERR_FAIL_NULL(submenu); - //EditorNode::get_singleton()->add_tool_submenu_item(p_name, submenu); + EditorNode::get_singleton()->add_tool_submenu_item(p_name, submenu); } void EditorPlugin::remove_tool_menu_item(const String &p_name) { - - //EditorNode::get_singleton()->remove_tool_menu_item(p_name); + EditorNode::get_singleton()->remove_tool_menu_item(p_name); } void EditorPlugin::set_input_event_forwarding_always_enabled() { @@ -707,9 +704,9 @@ void EditorPlugin::_bind_methods() { ClassDB::bind_method(D_METHOD("remove_control_from_docks", "control"), &EditorPlugin::remove_control_from_docks); ClassDB::bind_method(D_METHOD("remove_control_from_bottom_panel", "control"), &EditorPlugin::remove_control_from_bottom_panel); ClassDB::bind_method(D_METHOD("remove_control_from_container", "container", "control"), &EditorPlugin::remove_control_from_container); - //ClassDB::bind_method(D_METHOD("add_tool_menu_item", "name", "handler", "callback", "ud"),&EditorPlugin::add_tool_menu_item,DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("add_tool_menu_item", "name", "handler", "callback", "ud"), &EditorPlugin::add_tool_menu_item, DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("add_tool_submenu_item", "name", "submenu"), &EditorPlugin::add_tool_submenu_item); - //ClassDB::bind_method(D_METHOD("remove_tool_menu_item", "name"),&EditorPlugin::remove_tool_menu_item); + ClassDB::bind_method(D_METHOD("remove_tool_menu_item", "name"), &EditorPlugin::remove_tool_menu_item); ClassDB::bind_method(D_METHOD("add_custom_type", "type", "base", "script", "icon"), &EditorPlugin::add_custom_type); ClassDB::bind_method(D_METHOD("remove_custom_type", "type"), &EditorPlugin::remove_custom_type); |
