/*************************************************************************/ /* script_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* 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 "script_editor_plugin.h" #include "core/config/project_settings.h" #include "core/containers/pair.h" #include "core/containers/rb_map.h" #include "core/error/error_macros.h" #include "core/input/input.h" #include "core/input/input_event.h" #include "core/io/config_file.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/math/color.h" #include "core/math/math_funcs.h" #include "core/math/transform_2d.h" #include "core/object/class_db.h" #include "core/object/undo_redo.h" #include "core/os/file_access.h" #include "core/os/keyboard.h" #include "core/os/main_loop.h" #include "core/os/memory.h" #include "core/os/os.h" #include "core/string/string_name.h" #include "core/variant/dictionary.h" #include "core/version_generated.gen.h" #include "editor/editor_data.h" #include "editor/editor_file_dialog.h" #include "editor/editor_file_system.h" #include "editor/editor_help.h" #include "editor/editor_help_search.h" #include "editor/editor_node.h" #include "editor/editor_run_script.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/filesystem_dock.h" #include "editor/find_in_files.h" #include "editor/inspector_dock.h" #include "editor/node_dock.h" #include "editor/script_create_dialog.h" #include "editor/script_editor_debugger.h" #include "scene/2d/canvas_item.h" #include "scene/gui/button.h" #include "scene/gui/control.h" #include "scene/gui/item_list.h" #include "scene/gui/label.h" #include "scene/gui/line_edit.h" #include "scene/gui/menu_button.h" #include "scene/gui/popup_menu.h" #include "scene/gui/separator.h" #include "scene/gui/split_container.h" #include "scene/gui/tab_container.h" #include "scene/gui/text_edit.h" #include "scene/gui/texture_rect.h" #include "scene/gui/tool_button.h" #include "scene/gui/tree.h" #include "scene/main/node.h" #include "scene/main/scene_tree.h" #include "scene/main/timer.h" #include "scene/main/viewport.h" #include "scene/resources/text_file.h" #include "scene/resources/texture.h" #include "scene/scene_string_names.h" #include "script_editor_quick_open.h" #include "script_text_editor.h" #include "text_editor.h" #include "script_editor.h" static bool _is_built_in_script(Script *p_script) { String path = p_script->get_path(); return path.find("::") != -1; } void ScriptEditorPlugin::edit(Object *p_object) { if (Object::cast_to