aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRémi Verschelde2016-09-17 18:39:56 +0200
committerGitHub2016-09-17 18:39:56 +0200
commit0e962311be7fa5565a456ecd328202c2d6f6ca13 (patch)
tree5a0c319f720d1bdff8b5f36338cd9b9411d9e889 /tools
parent1830b807192bd02ba6ba13c06616cab41a5bea24 (diff)
parent98e7c1edbab6605a7578643485e1e88b61fd83d7 (diff)
downloadgodot-0e962311be7fa5565a456ecd328202c2d6f6ca13.tar.gz
godot-0e962311be7fa5565a456ecd328202c2d6f6ca13.tar.zst
godot-0e962311be7fa5565a456ecd328202c2d6f6ca13.zip
Merge pull request #6516 from vnen/plugin-main-screen
Add a function to plugin get the main screen parent
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/editor_node.cpp2
-rw-r--r--tools/editor/editor_plugin.cpp6
-rw-r--r--tools/editor/editor_plugin.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 3b1e90a90..0e4a2fe30 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -3016,7 +3016,7 @@ void EditorNode::remove_editor_plugin(EditorPlugin *p_editor) {
for(int i=0;i<singleton->main_editor_buttons.size();i++) {
- if (p_editor->get_name()==singleton->main_editor_buttons[i]->get_name()) {
+ if (p_editor->get_name()==singleton->main_editor_buttons[i]->get_text()) {
memdelete( singleton->main_editor_buttons[i] );
singleton->main_editor_buttons.remove(i);
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);
diff --git a/tools/editor/editor_plugin.h b/tools/editor/editor_plugin.h
index 5b944cc27..b4cf82188 100644
--- a/tools/editor/editor_plugin.h
+++ b/tools/editor/editor_plugin.h
@@ -100,6 +100,7 @@ public:
void add_control_to_dock(DockSlot p_slot,Control *p_control);
void remove_control_from_docks(Control *p_control);
void remove_control_from_bottom_panel(Control *p_control);
+ Control* get_editor_viewport();
virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial* p_spatial);
virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform, const InputEvent& p_event);