aboutsummaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorBruno Ortiz2017-01-02 10:37:22 -0200
committerRémi Verschelde2017-01-12 19:15:30 +0100
commit4f35fdd1e341ed60ebda7a8ed912fcbf2361f572 (patch)
tree5895e9a85ab5fd3cea36405fba2e5550b83691e1 /tools/editor
parent0b6d4e92b549d60c1e319e663de3c0af16e27b37 (diff)
downloadgodot-4f35fdd1e341ed60ebda7a8ed912fcbf2361f572.tar.gz
godot-4f35fdd1e341ed60ebda7a8ed912fcbf2361f572.tar.zst
godot-4f35fdd1e341ed60ebda7a8ed912fcbf2361f572.zip
Exposing edit_resource method of EditorNode in the EditorPlugin (#7355)
(cherry picked from commit 7e0d0d0bb912fbb774f5890792840a1a62485773)
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/editor_plugin.cpp6
-rw-r--r--tools/editor/editor_plugin.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/tools/editor/editor_plugin.cpp b/tools/editor/editor_plugin.cpp
index 1c7d9f14a..31ca9db76 100644
--- a/tools/editor/editor_plugin.cpp
+++ b/tools/editor/editor_plugin.cpp
@@ -75,6 +75,11 @@ Control * EditorPlugin::get_editor_viewport() {
return EditorNode::get_singleton()->get_viewport();
}
+void EditorPlugin::edit_resource(const Ref<Resource>& p_resource){
+
+ EditorNode::get_singleton()->edit_resource(p_resource);
+}
+
void EditorPlugin::add_control_to_container(CustomControlContainer p_location,Control *p_control) {
switch(p_location) {
@@ -327,6 +332,7 @@ void EditorPlugin::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_selection:EditorSelection"),&EditorPlugin::get_selection);
ObjectTypeDB::bind_method(_MD("get_editor_settings:EditorSettings"),&EditorPlugin::get_editor_settings);
ObjectTypeDB::bind_method(_MD("queue_save_layout"),&EditorPlugin::queue_save_layout);
+ ObjectTypeDB::bind_method(_MD("edit_resource"),&EditorPlugin::edit_resource);
ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"forward_input_event",PropertyInfo(Variant::INPUT_EVENT,"event")));
ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"forward_spatial_input_event",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera"),PropertyInfo(Variant::INPUT_EVENT,"event")));
diff --git a/tools/editor/editor_plugin.h b/tools/editor/editor_plugin.h
index d53cb04f4..bb3347040 100644
--- a/tools/editor/editor_plugin.h
+++ b/tools/editor/editor_plugin.h
@@ -98,6 +98,7 @@ public:
void remove_control_from_docks(Control *p_control);
void remove_control_from_bottom_panel(Control *p_control);
Control* get_editor_viewport();
+ void edit_resource(const Ref<Resource>& p_resource);
virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial* p_spatial);
virtual bool forward_input_event(const InputEvent& p_event);