2014-02-10 02:10:30 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* editor_plugin.cpp */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
|
|
|
/* http://www.godotengine.org */
|
|
|
|
/*************************************************************************/
|
2017-01-01 22:01:57 +01:00
|
|
|
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
2017-04-08 00:11:42 +02:00
|
|
|
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
|
2014-02-10 02:10:30 +01:00
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/*************************************************************************/
|
|
|
|
#include "editor_plugin.h"
|
2017-01-16 08:04:19 +01:00
|
|
|
|
2017-03-05 14:21:25 +01:00
|
|
|
#include "editor/editor_node.h"
|
|
|
|
#include "editor/editor_settings.h"
|
2016-09-10 20:32:17 +02:00
|
|
|
#include "editor_resource_preview.h"
|
2017-03-05 16:44:50 +01:00
|
|
|
#include "plugins/canvas_item_editor_plugin.h"
|
|
|
|
#include "plugins/spatial_editor_plugin.h"
|
|
|
|
#include "scene/3d/camera.h"
|
|
|
|
#include "scene/gui/popup_menu.h"
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void EditorPlugin::add_custom_type(const String &p_type, const String &p_base, const Ref<Script> &p_script, const Ref<Texture> &p_icon) {
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
EditorNode::get_editor_data().add_custom_type(p_type, p_base, p_script, p_icon);
|
2014-02-10 02:10:30 +01:00
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void EditorPlugin::remove_custom_type(const String &p_type) {
|
2014-02-10 02:10:30 +01:00
|
|
|
|
|
|
|
EditorNode::get_editor_data().remove_custom_type(p_type);
|
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
ToolButton *EditorPlugin::add_control_to_bottom_panel(Control *p_control, const String &p_title) {
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
return EditorNode::get_singleton()->add_bottom_panel_item(p_title, p_control);
|
2016-02-27 04:32:00 +01:00
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void EditorPlugin::add_control_to_dock(DockSlot p_slot, Control *p_control) {
|
2016-02-28 03:10:44 +01:00
|
|
|
|
|
|
|
ERR_FAIL_NULL(p_control);
|
2017-03-05 16:44:50 +01:00
|
|
|
EditorNode::get_singleton()->add_control_to_dock(EditorNode::DockSlot(p_slot), p_control);
|
2016-02-28 03:10:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void EditorPlugin::remove_control_from_docks(Control *p_control) {
|
|
|
|
|
|
|
|
ERR_FAIL_NULL(p_control);
|
|
|
|
EditorNode::get_singleton()->remove_control_from_dock(p_control);
|
|
|
|
}
|
2016-02-27 04:32:00 +01:00
|
|
|
|
2016-02-28 20:58:17 +01:00
|
|
|
void EditorPlugin::remove_control_from_bottom_panel(Control *p_control) {
|
|
|
|
|
|
|
|
ERR_FAIL_NULL(p_control);
|
|
|
|
EditorNode::get_singleton()->remove_bottom_panel_item(p_control);
|
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
Control *EditorPlugin::get_editor_viewport() {
|
2016-09-16 20:02:01 +02:00
|
|
|
|
|
|
|
return EditorNode::get_singleton()->get_viewport();
|
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void EditorPlugin::edit_resource(const Ref<Resource> &p_resource) {
|
2017-01-02 13:37:22 +01:00
|
|
|
|
|
|
|
EditorNode::get_singleton()->edit_resource(p_resource);
|
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void EditorPlugin::add_control_to_container(CustomControlContainer p_location, Control *p_control) {
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
switch (p_location) {
|
2014-02-10 02:10:30 +01:00
|
|
|
|
|
|
|
case CONTAINER_TOOLBAR: {
|
|
|
|
|
|
|
|
EditorNode::get_menu_hb()->add_child(p_control);
|
|
|
|
} break;
|
2016-02-27 04:32:00 +01:00
|
|
|
|
2014-02-10 02:10:30 +01:00
|
|
|
case CONTAINER_SPATIAL_EDITOR_MENU: {
|
|
|
|
|
|
|
|
SpatialEditor::get_singleton()->add_control_to_menu_panel(p_control);
|
|
|
|
|
|
|
|
} break;
|
|
|
|
case CONTAINER_SPATIAL_EDITOR_SIDE: {
|
|
|
|
|
|
|
|
SpatialEditor::get_singleton()->get_palette_split()->add_child(p_control);
|
2017-03-05 16:44:50 +01:00
|
|
|
SpatialEditor::get_singleton()->get_palette_split()->move_child(p_control, 0);
|
2014-02-10 02:10:30 +01:00
|
|
|
|
|
|
|
} break;
|
|
|
|
case CONTAINER_SPATIAL_EDITOR_BOTTOM: {
|
|
|
|
|
|
|
|
SpatialEditor::get_singleton()->get_shader_split()->add_child(p_control);
|
|
|
|
|
|
|
|
} break;
|
|
|
|
case CONTAINER_CANVAS_EDITOR_MENU: {
|
|
|
|
|
|
|
|
CanvasItemEditor::get_singleton()->add_control_to_menu_panel(p_control);
|
|
|
|
|
|
|
|
} break;
|
|
|
|
case CONTAINER_CANVAS_EDITOR_SIDE: {
|
|
|
|
|
2015-01-12 00:52:42 +01:00
|
|
|
CanvasItemEditor::get_singleton()->get_palette_split()->add_child(p_control);
|
2017-03-05 16:44:50 +01:00
|
|
|
CanvasItemEditor::get_singleton()->get_palette_split()->move_child(p_control, 0);
|
2015-01-12 00:52:42 +01:00
|
|
|
|
|
|
|
} break;
|
|
|
|
case CONTAINER_CANVAS_EDITOR_BOTTOM: {
|
|
|
|
|
|
|
|
CanvasItemEditor::get_singleton()->get_bottom_split()->add_child(p_control);
|
2014-02-10 02:10:30 +01:00
|
|
|
|
|
|
|
} break;
|
2016-05-23 22:10:26 +02:00
|
|
|
case CONTAINER_PROPERTY_EDITOR_BOTTOM: {
|
|
|
|
|
|
|
|
EditorNode::get_singleton()->get_property_editor_vb()->add_child(p_control);
|
|
|
|
|
|
|
|
} break;
|
2014-02-10 02:10:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void EditorPlugin::add_tool_menu_item(const String &p_name, Object *p_handler, const String &p_callback, const Variant &p_ud) {
|
2016-08-07 16:01:22 +02:00
|
|
|
|
2017-01-21 23:00:25 +01:00
|
|
|
//EditorNode::get_singleton()->add_tool_menu_item(p_name, p_handler, p_callback, p_ud);
|
2016-08-07 16:01:22 +02:00
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void EditorPlugin::add_tool_submenu_item(const String &p_name, Object *p_submenu) {
|
2016-08-07 16:01:22 +02:00
|
|
|
|
|
|
|
ERR_FAIL_NULL(p_submenu);
|
|
|
|
PopupMenu *submenu = p_submenu->cast_to<PopupMenu>();
|
|
|
|
ERR_FAIL_NULL(submenu);
|
2017-01-21 23:00:25 +01:00
|
|
|
//EditorNode::get_singleton()->add_tool_submenu_item(p_name, submenu);
|
2016-08-07 16:01:22 +02:00
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void EditorPlugin::remove_tool_menu_item(const String &p_name) {
|
2016-08-07 16:01:22 +02:00
|
|
|
|
2017-01-21 23:00:25 +01:00
|
|
|
//EditorNode::get_singleton()->remove_tool_menu_item(p_name);
|
2016-08-07 16:01:22 +02:00
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
Ref<SpatialEditorGizmo> EditorPlugin::create_spatial_gizmo(Spatial *p_spatial) {
|
2014-02-10 02:10:30 +01:00
|
|
|
//??
|
2016-02-28 03:10:44 +01:00
|
|
|
if (get_script_instance() && get_script_instance()->has_method("create_spatial_gizmo")) {
|
2017-03-05 16:44:50 +01:00
|
|
|
return get_script_instance()->call("create_spatial_gizmo", p_spatial);
|
2016-02-28 03:10:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return Ref<SpatialEditorGizmo>();
|
2014-02-10 02:10:30 +01:00
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
bool EditorPlugin::forward_canvas_gui_input(const Transform2D &p_canvas_xform, const InputEvent &p_event) {
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2017-01-08 20:28:12 +01:00
|
|
|
if (get_script_instance() && get_script_instance()->has_method("forward_canvas_gui_input")) {
|
2017-03-05 16:44:50 +01:00
|
|
|
return get_script_instance()->call("forward_canvas_gui_input", p_canvas_xform, p_event);
|
2014-02-10 02:10:30 +01:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2016-09-10 21:44:03 +02:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void EditorPlugin::forward_draw_over_canvas(const Transform2D &p_canvas_xform, Control *p_canvas) {
|
2016-09-10 21:44:03 +02:00
|
|
|
|
|
|
|
if (get_script_instance() && get_script_instance()->has_method("forward_draw_over_canvas")) {
|
2017-03-05 16:44:50 +01:00
|
|
|
get_script_instance()->call("forward_draw_over_canvas", p_canvas_xform, p_canvas);
|
2016-09-10 21:44:03 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void EditorPlugin::update_canvas() {
|
|
|
|
CanvasItemEditor::get_singleton()->get_viewport_control()->update();
|
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
bool EditorPlugin::forward_spatial_gui_input(Camera *p_camera, const InputEvent &p_event) {
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2017-01-08 20:28:12 +01:00
|
|
|
if (get_script_instance() && get_script_instance()->has_method("forward_spatial_gui_input")) {
|
2017-03-05 16:44:50 +01:00
|
|
|
return get_script_instance()->call("forward_spatial_gui_input", p_camera, p_event);
|
2014-02-10 02:10:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
String EditorPlugin::get_name() const {
|
|
|
|
|
|
|
|
if (get_script_instance() && get_script_instance()->has_method("get_name")) {
|
|
|
|
return get_script_instance()->call("get_name");
|
|
|
|
}
|
|
|
|
|
|
|
|
return String();
|
|
|
|
}
|
|
|
|
bool EditorPlugin::has_main_screen() const {
|
|
|
|
|
|
|
|
if (get_script_instance() && get_script_instance()->has_method("has_main_screen")) {
|
|
|
|
return get_script_instance()->call("has_main_screen");
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
void EditorPlugin::make_visible(bool p_visible) {
|
|
|
|
|
|
|
|
if (get_script_instance() && get_script_instance()->has_method("make_visible")) {
|
2017-03-05 16:44:50 +01:00
|
|
|
get_script_instance()->call("make_visible", p_visible);
|
2014-02-10 02:10:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void EditorPlugin::edit(Object *p_object) {
|
|
|
|
|
|
|
|
if (get_script_instance() && get_script_instance()->has_method("edit")) {
|
2017-03-05 16:44:50 +01:00
|
|
|
get_script_instance()->call("edit", p_object);
|
2014-02-10 02:10:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EditorPlugin::handles(Object *p_object) const {
|
|
|
|
|
|
|
|
if (get_script_instance() && get_script_instance()->has_method("handles")) {
|
2017-03-05 16:44:50 +01:00
|
|
|
return get_script_instance()->call("handles", p_object);
|
2014-02-10 02:10:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
Dictionary EditorPlugin::get_state() const {
|
|
|
|
|
|
|
|
if (get_script_instance() && get_script_instance()->has_method("get_state")) {
|
|
|
|
return get_script_instance()->call("get_state");
|
|
|
|
}
|
|
|
|
|
|
|
|
return Dictionary();
|
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void EditorPlugin::set_state(const Dictionary &p_state) {
|
2014-02-10 02:10:30 +01:00
|
|
|
|
|
|
|
if (get_script_instance() && get_script_instance()->has_method("set_state")) {
|
2017-03-05 16:44:50 +01:00
|
|
|
get_script_instance()->call("set_state", p_state);
|
2014-02-10 02:10:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void EditorPlugin::clear() {
|
|
|
|
|
|
|
|
if (get_script_instance() && get_script_instance()->has_method("clear")) {
|
|
|
|
get_script_instance()->call("clear");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-15 19:49:58 +02:00
|
|
|
// if editor references external resources/scenes, save them
|
|
|
|
void EditorPlugin::save_external_data() {
|
|
|
|
|
|
|
|
if (get_script_instance() && get_script_instance()->has_method("save_external_data")) {
|
|
|
|
get_script_instance()->call("save_external_data");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// if changes are pending in editor, apply them
|
2014-02-10 02:10:30 +01:00
|
|
|
void EditorPlugin::apply_changes() {
|
|
|
|
|
|
|
|
if (get_script_instance() && get_script_instance()->has_method("apply_changes")) {
|
|
|
|
get_script_instance()->call("apply_changes");
|
|
|
|
}
|
2016-08-15 19:49:58 +02:00
|
|
|
}
|
2014-02-10 02:10:30 +01:00
|
|
|
|
|
|
|
void EditorPlugin::get_breakpoints(List<String> *p_breakpoints) {
|
|
|
|
|
|
|
|
if (get_script_instance() && get_script_instance()->has_method("get_breakpoints")) {
|
2017-01-11 04:52:51 +01:00
|
|
|
PoolStringArray arr = get_script_instance()->call("get_breakpoints");
|
2017-03-05 16:44:50 +01:00
|
|
|
for (int i = 0; i < arr.size(); i++)
|
2014-02-10 02:10:30 +01:00
|
|
|
p_breakpoints->push_back(arr[i]);
|
|
|
|
}
|
|
|
|
}
|
2017-03-05 16:44:50 +01:00
|
|
|
bool EditorPlugin::get_remove_list(List<Node *> *p_list) {
|
2014-02-10 02:10:30 +01:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EditorPlugin::restore_global_state() {}
|
|
|
|
void EditorPlugin::save_global_state() {}
|
|
|
|
|
2015-06-22 05:03:19 +02:00
|
|
|
void EditorPlugin::set_window_layout(Ref<ConfigFile> p_layout) {
|
|
|
|
|
2016-08-15 19:49:58 +02:00
|
|
|
if (get_script_instance() && get_script_instance()->has_method("set_window_layout")) {
|
|
|
|
get_script_instance()->call("set_window_layout", p_layout);
|
|
|
|
}
|
2015-06-22 05:03:19 +02:00
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void EditorPlugin::get_window_layout(Ref<ConfigFile> p_layout) {
|
2015-06-22 05:03:19 +02:00
|
|
|
|
2016-08-15 19:49:58 +02:00
|
|
|
if (get_script_instance() && get_script_instance()->has_method("get_window_layout")) {
|
|
|
|
get_script_instance()->call("get_window_layout", p_layout);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void EditorPlugin::queue_save_layout() const {
|
|
|
|
|
|
|
|
EditorNode::get_singleton()->save_layout();
|
2015-06-22 05:03:19 +02:00
|
|
|
}
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
EditorSelection *EditorPlugin::get_selection() {
|
2016-02-27 04:32:00 +01:00
|
|
|
return EditorNode::get_singleton()->get_editor_selection();
|
|
|
|
}
|
|
|
|
|
|
|
|
EditorSettings *EditorPlugin::get_editor_settings() {
|
|
|
|
return EditorSettings::get_singleton();
|
|
|
|
}
|
|
|
|
|
2016-09-10 20:32:17 +02:00
|
|
|
EditorResourcePreview *EditorPlugin::get_resource_previewer() {
|
|
|
|
return EditorResourcePreview::get_singleton();
|
|
|
|
}
|
|
|
|
|
2016-02-28 03:10:44 +01:00
|
|
|
Control *EditorPlugin::get_base_control() {
|
|
|
|
|
|
|
|
return EditorNode::get_singleton()->get_gui_base();
|
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void EditorPlugin::make_bottom_panel_item_visible(Control *p_item) {
|
2016-09-17 16:59:12 +02:00
|
|
|
|
|
|
|
EditorNode::get_singleton()->make_bottom_panel_item_visible(p_item);
|
|
|
|
}
|
|
|
|
|
|
|
|
void EditorPlugin::hide_bottom_panel() {
|
|
|
|
|
|
|
|
EditorNode::get_singleton()->hide_bottom_panel();
|
|
|
|
}
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
void EditorPlugin::inspect_object(Object *p_obj, const String &p_for_property) {
|
2016-09-10 19:44:28 +02:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
EditorNode::get_singleton()->push_item(p_obj, p_for_property);
|
2016-09-10 19:44:28 +02:00
|
|
|
}
|
2016-02-28 03:10:44 +01:00
|
|
|
|
2016-09-10 22:34:27 +02:00
|
|
|
EditorFileSystem *EditorPlugin::get_resource_file_system() {
|
|
|
|
return EditorFileSystem::get_singleton();
|
|
|
|
}
|
|
|
|
|
2014-02-10 02:10:30 +01:00
|
|
|
void EditorPlugin::_bind_methods() {
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("add_control_to_container", "container", "control:Control"), &EditorPlugin::add_control_to_container);
|
|
|
|
ClassDB::bind_method(D_METHOD("add_control_to_bottom_panel:ToolButton", "control:Control", "title"), &EditorPlugin::add_control_to_bottom_panel);
|
|
|
|
ClassDB::bind_method(D_METHOD("add_control_to_dock", "slot", "control:Control"), &EditorPlugin::add_control_to_dock);
|
|
|
|
ClassDB::bind_method(D_METHOD("remove_control_from_docks", "control:Control"), &EditorPlugin::remove_control_from_docks);
|
|
|
|
ClassDB::bind_method(D_METHOD("remove_control_from_bottom_panel", "control:Control"), &EditorPlugin::remove_control_from_bottom_panel);
|
2017-02-13 12:47:24 +01:00
|
|
|
//ClassDB::bind_method(D_METHOD("add_tool_menu_item", "name", "handler", "callback", "ud"),&EditorPlugin::add_tool_menu_item,DEFVAL(Variant()));
|
2017-03-05 16:44:50 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("add_tool_submenu_item", "name", "submenu:PopupMenu"), &EditorPlugin::add_tool_submenu_item);
|
2017-02-13 12:47:24 +01:00
|
|
|
//ClassDB::bind_method(D_METHOD("remove_tool_menu_item", "name"),&EditorPlugin::remove_tool_menu_item);
|
2017-03-05 16:44:50 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("add_custom_type", "type", "base", "script:Script", "icon:Texture"), &EditorPlugin::add_custom_type);
|
|
|
|
ClassDB::bind_method(D_METHOD("remove_custom_type", "type"), &EditorPlugin::remove_custom_type);
|
2017-02-13 12:47:24 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("get_editor_viewport:Control"), &EditorPlugin::get_editor_viewport);
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("get_resource_previewer:EditorResourcePreview"), &EditorPlugin::get_resource_previewer);
|
|
|
|
ClassDB::bind_method(D_METHOD("get_resource_filesystem:EditorFileSystem"), &EditorPlugin::get_resource_file_system);
|
2017-02-13 12:47:24 +01:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("inspect_object", "object", "for_property"), &EditorPlugin::inspect_object, DEFVAL(String()));
|
|
|
|
ClassDB::bind_method(D_METHOD("update_canvas"), &EditorPlugin::update_canvas);
|
2017-02-13 12:47:24 +01:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("make_bottom_panel_item_visible", "item:Control"), &EditorPlugin::make_bottom_panel_item_visible);
|
2017-02-13 12:47:24 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("hide_bottom_panel"), &EditorPlugin::hide_bottom_panel);
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("get_base_control:Control"), &EditorPlugin::get_base_control);
|
|
|
|
ClassDB::bind_method(D_METHOD("get_undo_redo:UndoRedo"), &EditorPlugin::_get_undo_redo);
|
|
|
|
ClassDB::bind_method(D_METHOD("get_selection:EditorSelection"), &EditorPlugin::get_selection);
|
|
|
|
ClassDB::bind_method(D_METHOD("get_editor_settings:EditorSettings"), &EditorPlugin::get_editor_settings);
|
|
|
|
ClassDB::bind_method(D_METHOD("queue_save_layout"), &EditorPlugin::queue_save_layout);
|
|
|
|
ClassDB::bind_method(D_METHOD("edit_resource"), &EditorPlugin::edit_resource);
|
|
|
|
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_canvas_gui_input", PropertyInfo(Variant::TRANSFORM2D, "canvas_xform"), PropertyInfo(Variant::INPUT_EVENT, "event")));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_draw_over_canvas", PropertyInfo(Variant::TRANSFORM2D, "canvas_xform"), PropertyInfo(Variant::OBJECT, "canvas:Control")));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_spatial_gui_input", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera"), PropertyInfo(Variant::INPUT_EVENT, "event")));
|
|
|
|
MethodInfo gizmo = MethodInfo(Variant::OBJECT, "create_spatial_gizmo", PropertyInfo(Variant::OBJECT, "for_spatial:Spatial"));
|
|
|
|
gizmo.return_val.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
|
|
|
gizmo.return_val.hint_string = "EditorSpatialGizmo";
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), gizmo);
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_name"));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "has_main_screen"));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo("make_visible", PropertyInfo(Variant::BOOL, "visible")));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo("edit", PropertyInfo(Variant::OBJECT, "object")));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "handles", PropertyInfo(Variant::OBJECT, "object")));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::DICTIONARY, "get_state"));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo("set_state", PropertyInfo(Variant::DICTIONARY, "state")));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo("clear"));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo("save_external_data"));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo("apply_changes"));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::POOL_STRING_ARRAY, "get_breakpoints"));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo("set_window_layout", PropertyInfo(Variant::OBJECT, "layout", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile")));
|
|
|
|
ClassDB::add_virtual_method(get_class_static(), MethodInfo("get_window_layout", PropertyInfo(Variant::OBJECT, "layout", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile")));
|
|
|
|
|
|
|
|
BIND_CONSTANT(CONTAINER_TOOLBAR);
|
|
|
|
BIND_CONSTANT(CONTAINER_SPATIAL_EDITOR_MENU);
|
|
|
|
BIND_CONSTANT(CONTAINER_SPATIAL_EDITOR_SIDE);
|
|
|
|
BIND_CONSTANT(CONTAINER_SPATIAL_EDITOR_BOTTOM);
|
|
|
|
BIND_CONSTANT(CONTAINER_CANVAS_EDITOR_MENU);
|
|
|
|
BIND_CONSTANT(CONTAINER_CANVAS_EDITOR_SIDE);
|
|
|
|
BIND_CONSTANT(CONTAINER_PROPERTY_EDITOR_BOTTOM);
|
|
|
|
|
|
|
|
BIND_CONSTANT(DOCK_SLOT_LEFT_UL);
|
|
|
|
BIND_CONSTANT(DOCK_SLOT_LEFT_BL);
|
|
|
|
BIND_CONSTANT(DOCK_SLOT_LEFT_UR);
|
|
|
|
BIND_CONSTANT(DOCK_SLOT_LEFT_BR);
|
|
|
|
BIND_CONSTANT(DOCK_SLOT_RIGHT_UL);
|
|
|
|
BIND_CONSTANT(DOCK_SLOT_RIGHT_BL);
|
|
|
|
BIND_CONSTANT(DOCK_SLOT_RIGHT_UR);
|
|
|
|
BIND_CONSTANT(DOCK_SLOT_RIGHT_BR);
|
|
|
|
BIND_CONSTANT(DOCK_SLOT_MAX);
|
|
|
|
}
|
|
|
|
|
|
|
|
EditorPlugin::EditorPlugin() {
|
|
|
|
undo_redo = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
EditorPlugin::~EditorPlugin() {
|
2014-02-10 02:10:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
EditorPluginCreateFunc EditorPlugins::creation_funcs[MAX_CREATE_FUNCS];
|
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
int EditorPlugins::creation_func_count = 0;
|