From 7e0d0d0bb912fbb774f5890792840a1a62485773 Mon Sep 17 00:00:00 2001 From: Bruno Ortiz Date: Mon, 2 Jan 2017 10:37:22 -0200 Subject: Exposing edit_resource method of EditorNode in the EditorPlugin (#7355) --- tools/editor/editor_plugin.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/editor/editor_plugin.cpp') diff --git a/tools/editor/editor_plugin.cpp b/tools/editor/editor_plugin.cpp index 3e0eb8be3..106e91348 100644 --- a/tools/editor/editor_plugin.cpp +++ b/tools/editor/editor_plugin.cpp @@ -76,6 +76,11 @@ Control * EditorPlugin::get_editor_viewport() { return EditorNode::get_singleton()->get_viewport(); } +void EditorPlugin::edit_resource(const Ref& p_resource){ + + EditorNode::get_singleton()->edit_resource(p_resource); +} + void EditorPlugin::add_control_to_container(CustomControlContainer p_location,Control *p_control) { switch(p_location) { @@ -370,6 +375,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_canvas_input_event",PropertyInfo(Variant::MATRIX32,"canvas_xform"),PropertyInfo(Variant::INPUT_EVENT,"event"))); ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("forward_draw_over_canvas",PropertyInfo(Variant::MATRIX32,"canvas_xform"),PropertyInfo(Variant::OBJECT,"canvas:Control"))); -- cgit v1.2.3-70-g09d2