Move the editor's script text editor into the new code_editor module.

This commit is contained in:
Relintai 2023-02-17 20:57:16 +01:00
parent 5dc5aea278
commit 9cd2927fcc
29 changed files with 147 additions and 27 deletions

View File

@ -58,7 +58,6 @@
#include "editor_node.h"
#include "editor_scale.h"
#include "editor_settings.h"
#include "plugins/script_editor_plugin.h"
#include "scene/gui/button.h"
#include "scene/gui/check_box.h"
#include "scene/gui/check_button.h"
@ -73,6 +72,12 @@
#include "scene/main/scene_tree.h"
#include "scene/resources/texture.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_editor_plugin.h"
#endif
static Node *_find_first_script(Node *p_root, Node *p_node) {
if (p_node != p_root && p_node->get_owner() != p_root) {
return nullptr;

View File

@ -39,11 +39,16 @@
#include "core/os/memory.h"
#include "core/config/project_settings.h"
#include "editor/editor_plugin.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor_node.h"
#include "scene/main/node.h"
#include "scene/resources/packed_scene.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_editor_plugin.h"
#endif
class Resource;
void EditorHistory::cleanup_history() {

View File

@ -32,7 +32,6 @@
#include "core/object/object.h"
#include "editor/plugins/script_editor_plugin.h"
#include "scene/resources/texture.h"
#include "core/containers/list.h"
@ -53,6 +52,12 @@
#include "core/variant/variant.h"
#include "core/containers/vector.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_editor_plugin.h"
#endif
class ConfigFile;
class EditorPlugin;
class Node;

View File

@ -46,7 +46,6 @@
#include "core/version.h"
#include "core/version_generated.gen.h"
#include "editor/editor_file_system.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor_node.h"
#include "editor_scale.h"
#include "editor_settings.h"
@ -58,6 +57,12 @@
#include "thirdparty/minizip/zip.h"
#include "zlib.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_editor_plugin.h"
#endif
static int _get_pad(int p_alignment, int p_n) {
int rest = p_n % p_alignment;
int pad = 0;

View File

@ -34,7 +34,6 @@
#include "core/os/keyboard.h"
#include "core/version_generated.gen.h"
#include "doc_data_compressed.gen.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor_node.h"
#include "editor_scale.h"
#include "editor_settings.h"
@ -64,6 +63,12 @@
#include "scene/resources/style_box.h"
#include "scene/resources/texture.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_editor_plugin.h"
#endif
#define CONTRIBUTE_URL vformat("%s/community/contributing/updating_the_class_reference.html", VERSION_DOCS_URL)
DocData *EditorHelp::doc = nullptr;

View File

@ -134,14 +134,10 @@
#include "editor/plugins/resource_preloader_editor_plugin.h"
#include "editor/plugins/room_manager_editor_plugin.h"
#include "editor/plugins/root_motion_editor_plugin.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor/plugins/script_text_editor.h"
#include "editor/plugins/shader_editor_plugin.h"
#include "editor/plugins/spatial_editor_plugin.h"
#include "editor/plugins/sprite_editor_plugin.h"
#include "editor/plugins/sprite_frames_editor_plugin.h"
#include "editor/plugins/style_box_editor_plugin.h"
#include "editor/plugins/text_editor.h"
#include "editor/plugins/texture_editor_plugin.h"
#include "editor/plugins/texture_region_editor_plugin.h"
#include "editor/plugins/theme_editor_plugin.h"
@ -193,6 +189,15 @@
#include "servers/physics_server.h"
#include "servers/rendering_server.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_text_editor.h"
#include "modules/code_editor/shader_editor_plugin.h"
#include "modules/code_editor/text_editor.h"
#include "modules/code_editor/script_editor_plugin.h"
#endif
class Camera;
EditorNode *EditorNode::singleton = nullptr;

View File

@ -57,7 +57,6 @@
#include "editor/filesystem_dock.h"
#include "editor/import/editor_import_plugin.h"
#include "editor/import/resource_importer_scene.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor/project_settings_editor.h"
#include "editor/script_create_dialog.h"
#include "editor_resource_preview.h"
@ -75,6 +74,12 @@
#include "scene/resources/texture.h"
#include "servers/rendering_server.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_editor_plugin.h"
#endif
class ConfigFile;
class ScriptCreateDialog;
class ToolButton;

View File

@ -54,7 +54,6 @@
#include "editor/editor_data.h"
#include "editor/editor_file_dialog.h"
#include "editor/editor_file_system.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor/property_editor.h"
#include "editor/quick_open.h"
#include "editor/scene_tree_dock.h"
@ -70,6 +69,12 @@
#include "scene/resources/style_box.h"
#include "scene/resources/texture.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_editor_plugin.h"
#endif
HashMap<StringName, List<StringName>> EditorResourcePicker::allowed_types_cache;
void EditorResourcePicker::clear_caches() {

View File

@ -40,9 +40,14 @@
#include "core/math/vector2.h"
#include "core/variant/variant.h"
#include "editor_settings.h"
#include "plugins/script_editor_plugin.h"
#include "script_editor_debugger.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_editor_plugin.h"
#endif
EditorRun::Status EditorRun::get_status() const {
return status;
}

View File

@ -62,7 +62,6 @@
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
#include "editor/plugins/animation_player_editor_plugin.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor/scene_tree_dock.h"
#include "editor/script_editor_debugger.h"
#include "scene/2d/light_2d.h"
@ -101,6 +100,12 @@
#include "scene/resources/theme.h"
#include "servers/rendering_server.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_editor_plugin.h"
#endif
// Min and Max are power of two in order to play nicely with successive increment.
// That way, we can naturally reach a 100% zoom from boundaries.
#define MIN_ZOOM 1. / 128

View File

@ -62,7 +62,6 @@
#include "editor/editor_settings.h"
#include "editor/inspector_dock.h"
#include "editor/plugins/animation_player_editor_plugin.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor/scene_tree_dock.h"
#include "editor/scene_tree_editor.h"
#include "editor/script_editor_debugger.h"
@ -100,6 +99,12 @@
#include "scene/resources/world_3d.h"
#include "servers/physics_server.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_editor_plugin.h"
#endif
#define DISTANCE_DEFAULT 4
#define GIZMO_ARROW_SIZE 0.35

View File

@ -66,7 +66,6 @@
#include "editor/multi_node_edit.h"
#include "editor/plugins/animation_player_editor_plugin.h"
#include "editor/plugins/canvas_item_editor_plugin.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor/plugins/spatial_editor_plugin.h"
#include "editor/quick_open.h"
#include "editor/rename_dialog.h"
@ -97,6 +96,12 @@
#include "scene/resources/packed_scene.h"
#include "scene/resources/texture.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_editor_plugin.h"
#endif
void SceneTreeDock::_nodes_drag_begin() {
pending_click_select = nullptr;
}

View File

@ -51,7 +51,6 @@
#include "editor/node_dock.h"
#include "editor/plugins/animation_player_editor_plugin.h"
#include "editor/plugins/canvas_item_editor_plugin.h"
#include "editor/plugins/script_editor_plugin.h"
#include "scene/2d/canvas_item.h"
#include "scene/animation/animation_player.h"
#include "scene/gui/box_container.h"
@ -65,6 +64,12 @@
#include "scene/resources/packed_scene.h"
#include "scene/resources/texture.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_editor_plugin.h"
#endif
Node *SceneTreeEditor::get_scene_node() {
ERR_FAIL_COND_V(!is_inside_tree(), nullptr);

View File

@ -52,7 +52,6 @@
#include "core/variant/variant.h"
#include "editor/editor_inspector.h"
#include "editor/editor_sectioned_inspector.h"
#include "editor/plugins/script_editor_plugin.h"
#include "scene/gui/box_container.h"
#include "scene/gui/button.h"
#include "scene/gui/control.h"
@ -68,6 +67,12 @@
#include "scene/main/node.h"
#include "scene/main/timer.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_CODE_EDITOR_ENABLED
#include "modules/code_editor/script_editor_plugin.h"
#endif
void EditorSettingsDialog::ok_pressed() {
if (!EditorSettings::get_singleton()) {
return;

View File

@ -14,7 +14,7 @@
#include "scene/gui/text_edit.h"
#include "scene/gui/texture_rect.h"
#include "editor/code_editor.h"
#include "modules/code_editor/code_editor.h"
#include "scene/resources/dynamic_font.h"

16
modules/code_editor/SCsub Normal file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env python
Import("env")
env_mlp = env.Clone()
sources = [
"register_types.cpp",
"code_editor.cpp",
"script_editor_plugin.cpp",
"script_text_editor.cpp",
"shader_editor_plugin.cpp",
"text_editor.cpp",
]
env_mlp.add_source_files(env.modules_sources, sources)

View File

@ -45,9 +45,9 @@
#include "core/typedefs.h"
#include "core/containers/vector.h"
#include "editor/editor_scale.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor_node.h"
#include "editor_settings.h"
#include "script_editor_plugin.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "scene/2d/canvas_item.h"
#include "scene/gui/button.h"
#include "scene/gui/check_box.h"

View File

@ -0,0 +1,15 @@
def can_build(env, platform):
return True
def configure(env):
pass
def get_doc_classes():
return [
]
def get_doc_path():
return "doc_classes"

View File

@ -0,0 +1,11 @@
#include "register_types.h"
void register_code_editor_types(ModuleRegistrationLevel p_level) {
if (p_level == MODULE_REGISTRATION_LEVEL_SCENE) {
//ClassDB::register_class<>();
}
}
void unregister_code_editor_types(ModuleRegistrationLevel p_level) {
}

View File

@ -0,0 +1,9 @@
#ifndef CODE_EDITOR_REGISTER_TYPES_H
#define CODE_EDITOR_REGISTER_TYPES_H
#include "modules/register_module_types.h"
void register_code_editor_types(ModuleRegistrationLevel p_level);
void unregister_code_editor_types(ModuleRegistrationLevel p_level);
#endif

View File

@ -43,7 +43,7 @@
#include "editor/filesystem_dock.h"
#include "editor/find_in_files.h"
#include "editor/node_dock.h"
#include "editor/plugins/shader_editor_plugin.h"
#include "shader_editor_plugin.h"
#include "editor/script_editor_debugger.h"
#include "scene/main/viewport.h"
#include "scene/scene_string_names.h"

View File

@ -53,7 +53,7 @@
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
#include "editor/plugins/script_editor_plugin.h"
#include "script_editor_plugin.h"
#include "editor/script_editor_debugger.h"
#include "scene/gui/box_container.h"
#include "scene/gui/color_picker.h"

View File

@ -44,7 +44,7 @@
#include "core/object/resource.h"
#include "core/string/ustring.h"
#include "core/variant/variant.h"
#include "editor/code_editor.h"
#include "code_editor.h"
class ColorPicker;
class Control;

View File

@ -30,7 +30,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "editor/code_editor.h"
#include "code_editor.h"
#include "editor/editor_plugin.h"
#include "scene/gui/margin_container.h"

View File

@ -42,7 +42,6 @@
#include "core/os/memory.h"
#include "core/typedefs.h"
#include "editor/editor_settings.h"
#include "editor/plugins/script_editor_plugin.h"
#include "scene/gui/box_container.h"
#include "scene/gui/control.h"
#include "scene/gui/menu_button.h"

View File

@ -41,7 +41,7 @@
#include "core/string/ustring.h"
#include "core/variant/variant.h"
#include "core/containers/vector.h"
#include "editor/code_editor.h"
#include "code_editor.h"
class Control;
class HBoxContainer;