aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/editor_plugin.cpp
diff options
context:
space:
mode:
authorGeorge Marques2016-09-16 15:02:01 -0300
committerGeorge Marques2016-09-16 15:02:01 -0300
commit98e7c1edbab6605a7578643485e1e88b61fd83d7 (patch)
tree33b5be5d27c5aa92dcc8a34f80f66fc73098d5de /tools/editor/editor_plugin.cpp
parentc05ff0577fd9cc39a6968e65743f7d7da711bfe2 (diff)
downloadgodot-98e7c1edbab6605a7578643485e1e88b61fd83d7.tar.gz
godot-98e7c1edbab6605a7578643485e1e88b61fd83d7.tar.zst
godot-98e7c1edbab6605a7578643485e1e88b61fd83d7.zip
Add a function to plugin get the main screen parent
- Fix a bug where the main screen button did not disappear when the plugin was deactivated.
Diffstat (limited to 'tools/editor/editor_plugin.cpp')
-rw-r--r--tools/editor/editor_plugin.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/editor/editor_plugin.cpp b/tools/editor/editor_plugin.cpp
index 55f0e52c8..42403cdb3 100644
--- a/tools/editor/editor_plugin.cpp
+++ b/tools/editor/editor_plugin.cpp
@@ -71,6 +71,11 @@ void EditorPlugin::remove_control_from_bottom_panel(Control *p_control) {
}
+Control * EditorPlugin::get_editor_viewport() {
+
+ return EditorNode::get_singleton()->get_viewport();
+}
+
void EditorPlugin::add_control_to_container(CustomControlContainer p_location,Control *p_control) {
switch(p_location) {
@@ -333,6 +338,7 @@ void EditorPlugin::_bind_methods() {
ObjectTypeDB::bind_method(_MD("remove_control_from_bottom_panel","control:Control"),&EditorPlugin::remove_control_from_bottom_panel);
ObjectTypeDB::bind_method(_MD("add_custom_type","type","base","script:Script","icon:Texture"),&EditorPlugin::add_custom_type);
ObjectTypeDB::bind_method(_MD("remove_custom_type","type"),&EditorPlugin::remove_custom_type);
+ ObjectTypeDB::bind_method(_MD("get_editor_viewport:Control"), &EditorPlugin::get_editor_viewport);
ObjectTypeDB::bind_method(_MD("add_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::add_import_plugin);
ObjectTypeDB::bind_method(_MD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::remove_import_plugin);