From d088128b439d2fddf08f0b87090d756dd417b6e1 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Wed, 27 Apr 2022 15:26:46 +0800 Subject: [PATCH] Remove duplicate editor settings definitions --- core/os/input.cpp | 2 +- editor/editor_node.cpp | 2 -- editor/editor_settings.cpp | 6 ++++++ editor/fileserver/editor_file_server.cpp | 4 ++-- editor/plugins/mesh_library_editor_plugin.cpp | 1 - editor/plugins/script_editor_plugin.cpp | 7 +++---- editor/plugins/script_text_editor.cpp | 6 +++--- editor/plugins/shader_editor_plugin.cpp | 2 +- editor/plugins/spatial_editor_plugin.cpp | 16 ++++++++-------- editor/plugins/text_editor.cpp | 2 +- editor/spatial_editor_gizmos.cpp | 18 +++++++++--------- modules/gdscript/gdscript_editor.cpp | 12 ++++++------ .../language_server/gdscript_text_document.cpp | 2 +- modules/gridmap/grid_map_editor_plugin.cpp | 4 +--- modules/mono/csharp_script.cpp | 4 ++-- scene/animation/animation_player.cpp | 2 +- scene/gui/control.cpp | 2 +- scene/gui/line_edit.cpp | 6 ++---- scene/main/node.cpp | 2 +- scene/resources/material.cpp | 2 +- 20 files changed, 50 insertions(+), 52 deletions(-) diff --git a/core/os/input.cpp b/core/os/input.cpp index 2467d893831..0de0b781438 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -134,7 +134,7 @@ void Input::_bind_methods() { void Input::get_argument_options(const StringName &p_function, int p_idx, List *r_options) const { #ifdef TOOLS_ENABLED - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; String pf = p_function; if (p_idx == 0 && diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 99a718c7a8f..d1b05aeb5b0 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -6010,7 +6010,6 @@ EditorNode::EditorNode() { EDITOR_DEF("run/output/always_clear_output_on_play", true); EDITOR_DEF("run/output/always_open_output_on_play", true); EDITOR_DEF("run/output/always_close_output_on_stop", true); - EDITOR_DEF("run/auto_save/save_before_running", true); EDITOR_DEF("interface/editor/save_on_focus_loss", false); EDITOR_DEF_RST("interface/editor/save_each_scene_on_quit", true); EDITOR_DEF("interface/editor/quit_confirmation", true); @@ -6032,7 +6031,6 @@ EditorNode::EditorNode() { EDITOR_DEF("interface/inspector/resources_to_open_in_new_inspector", "Script,MeshLibrary,TileSet"); EDITOR_DEF("interface/inspector/default_color_picker_mode", 0); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "interface/inspector/default_color_picker_mode", PROPERTY_HINT_ENUM, "RGB,HSV,RAW", PROPERTY_USAGE_DEFAULT)); - EDITOR_DEF("run/auto_save/save_before_running", true); EDITOR_DEF("version_control/username", ""); EDITOR_DEF("version_control/ssh_public_key_path", ""); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "version_control/ssh_public_key_path", PROPERTY_HINT_GLOBAL_FILE)); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 2bfdeff8efc..186f19bcf70 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -460,6 +460,8 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { _initial_set("text_editor/files/trim_trailing_whitespace_on_save", false); _initial_set("text_editor/files/autosave_interval_secs", 0); _initial_set("text_editor/files/restore_scripts_on_load", true); + _initial_set("text_editor/files/auto_reload_and_parse_scripts_on_save", true); + _initial_set("text_editor/files/auto_reload_scripts_on_external_change", false); // Tools _initial_set("text_editor/tools/create_signal_callbacks", true); @@ -498,6 +500,7 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { // GridMap _initial_set("editors/grid_map/pick_distance", 5000.0); + _initial_set("editors/grid_map/preview_size", 64); // 3D _initial_set("editors/3d/primary_grid_color", Color(0.56, 0.56, 0.56, 0.5)); @@ -506,6 +509,9 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { // Use a similar color to the 2D editor selection. _initial_set("editors/3d/selection_box_color", Color(1.0, 0.5, 0)); hints["editors/3d/selection_box_color"] = PropertyInfo(Variant::COLOR, "editors/3d/selection_box_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + _initial_set("editors/3d_gizmos/gizmo_colors/instanced", Color(0.7, 0.7, 0.7, 0.6)); + _initial_set("editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1)); + _initial_set("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); // If a line is a multiple of this, it uses the primary grid color. // Use a power of 2 value by default as it's more common to use powers of 2 in level design. diff --git a/editor/fileserver/editor_file_server.cpp b/editor/fileserver/editor_file_server.cpp index fc8760f0e70..e43f60c28de 100644 --- a/editor/fileserver/editor_file_server.cpp +++ b/editor/fileserver/editor_file_server.cpp @@ -297,8 +297,8 @@ void EditorFileServer::_thread_start(void *s) { void EditorFileServer::start() { stop(); - port = EDITOR_DEF("filesystem/file_server/port", 6010); - password = EDITOR_DEF("filesystem/file_server/password", ""); + port = EDITOR_GET("filesystem/file_server/port"); + password = EDITOR_GET("filesystem/file_server/password"); cmd = CMD_ACTIVATE; } diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index a0c81a1ba6f..651522c8501 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -321,7 +321,6 @@ void MeshLibraryEditorPlugin::make_visible(bool p_visible) { } MeshLibraryEditorPlugin::MeshLibraryEditorPlugin(EditorNode *p_node) { - EDITOR_DEF("editors/grid_map/preview_size", 64); mesh_library_editor = memnew(MeshLibraryEditor(p_node)); p_node->get_viewport()->add_child(mesh_library_editor); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 664028894bc..88ac872534e 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -825,7 +825,7 @@ bool ScriptEditor::_test_script_times_on_disk(RES p_for_script) { bool need_ask = false; bool need_reload = false; - bool use_autoreload = bool(EDITOR_DEF("text_editor/files/auto_reload_scripts_on_external_change", false)); + bool use_autoreload = EDITOR_GET("text_editor/files/auto_reload_scripts_on_external_change"); for (int i = 0; i < tab_container->get_child_count(); i++) { ScriptEditorBase *se = Object::cast_to(tab_container->get_child(i)); @@ -2419,7 +2419,7 @@ void ScriptEditor::_editor_settings_changed() { _update_script_colors(); _update_script_names(); - ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/files/auto_reload_and_parse_scripts_on_save", true)); + ScriptServer::set_reload_scripts_on_save(EDITOR_GET("text_editor/files/auto_reload_and_parse_scripts_on_save")); } void ScriptEditor::_autosave_scripts() { @@ -3655,8 +3655,7 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { script_editor->hide(); - EDITOR_DEF("text_editor/files/auto_reload_scripts_on_external_change", true); - ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/files/auto_reload_and_parse_scripts_on_save", true)); + ScriptServer::set_reload_scripts_on_save(EDITOR_GET("text_editor/files/auto_reload_and_parse_scripts_on_save")); EDITOR_DEF("text_editor/files/open_dominant_script_on_scene_change", true); EDITOR_DEF("text_editor/external/use_external_editor", false); EDITOR_DEF("text_editor/external/exec_path", ""); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 63fb516c4e6..2b656c4b2c5 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -269,7 +269,7 @@ void ScriptTextEditor::_load_theme_settings() { text_edit->add_color_override("search_result_border_color", search_result_border_color); text_edit->add_color_override("symbol_color", symbol_color); - text_edit->add_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing", 6)); + text_edit->add_constant_override("line_spacing", EDITOR_GET("text_editor/theme/line_spacing")); colors_cache.symbol_color = symbol_color; colors_cache.keyword_color = keyword_color; @@ -1520,7 +1520,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data } if (d.has("type") && (String(d["type"]) == "files" || String(d["type"]) == "files_and_dirs")) { - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; Array files = d["files"]; String text_to_drop; @@ -1573,7 +1573,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data } if (d.has("type") && String(d["type"]) == "obj_property") { - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; const String text_to_drop = String(d["property"]).c_escape().quote(quote_style); te->cursor_set_line(row); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 1f39636fb4b..9d976763cae 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -432,7 +432,7 @@ void ShaderEditor::_check_for_external_edit() { return; } - bool use_autoreload = bool(EDITOR_DEF("text_editor/files/auto_reload_scripts_on_external_change", false)); + bool use_autoreload = EDITOR_GET("text_editor/files/auto_reload_scripts_on_external_change"); if (shader->get_last_modified_time() != FileAccess::get_modified_time(shader->get_path())) { if (use_autoreload) { _reload_shader_from_disk(); diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index eabab2e2d6f..335acbf65fd 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -6529,9 +6529,9 @@ void SpatialEditor::_bind_methods() { } void SpatialEditor::clear() { - settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov", 70.0)); - settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near", 0.05)); - settings_zfar->set_value(EDITOR_DEF("editors/3d/default_z_far", 1500.0)); + settings_fov->set_value(EDITOR_GET("editors/3d/default_fov")); + settings_znear->set_value(EDITOR_GET("editors/3d/default_z_near")); + settings_zfar->set_value(EDITOR_GET("editors/3d/default_z_far")); for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) { viewports[i]->reset(); @@ -6852,21 +6852,21 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { settings_fov->set_max(MAX_FOV); settings_fov->set_min(MIN_FOV); settings_fov->set_step(0.01); - settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov", 70.0)); + settings_fov->set_value(EDITOR_GET("editors/3d/default_fov")); settings_vbc->add_margin_child(TTR("Perspective FOV (deg.):"), settings_fov); settings_znear = memnew(SpinBox); settings_znear->set_max(MAX_Z); settings_znear->set_min(MIN_Z); settings_znear->set_step(0.01); - settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near", 0.05)); + settings_znear->set_value(EDITOR_GET("editors/3d/default_z_near")); settings_vbc->add_margin_child(TTR("View Z-Near:"), settings_znear); settings_zfar = memnew(SpinBox); settings_zfar->set_max(MAX_Z); settings_zfar->set_min(MIN_Z); settings_zfar->set_step(0.01); - settings_zfar->set_value(EDITOR_DEF("editors/3d/default_z_far", 1500)); + settings_zfar->set_value(EDITOR_GET("editors/3d/default_z_far")); settings_vbc->add_margin_child(TTR("View Z-Far:"), settings_zfar); for (uint32_t i = 0; i < VIEWPORTS_COUNT; ++i) { @@ -7085,7 +7085,7 @@ SpatialEditorPlugin::~SpatialEditorPlugin() { } void EditorSpatialGizmoPlugin::create_material(const String &p_name, const Color &p_color, bool p_billboard, bool p_on_top, bool p_use_vertex_color) { - Color instanced_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/instanced", Color(0.7, 0.7, 0.7, 0.6)); + Color instanced_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/instanced"); Vector> mats; @@ -7126,7 +7126,7 @@ void EditorSpatialGizmoPlugin::create_material(const String &p_name, const Color } void EditorSpatialGizmoPlugin::create_icon_material(const String &p_name, const Ref &p_texture, bool p_on_top, const Color &p_albedo) { - Color instanced_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/instanced", Color(0.7, 0.7, 0.7, 0.6)); + Color instanced_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/instanced"); Vector> icons; diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 2d8ae8c8628..438f3ddb5d8 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -135,7 +135,7 @@ void TextEditor::_load_theme_settings() { text_edit->add_color_override("search_result_border_color", search_result_border_color); text_edit->add_color_override("symbol_color", symbol_color); - text_edit->add_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing", 6)); + text_edit->add_constant_override("line_spacing", EDITOR_GET("text_editor/theme/line_spacing")); colors_cache.font_color = text_color; colors_cache.symbol_color = symbol_color; diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index 19b3265c972..30b8fa30c80 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -1798,7 +1798,7 @@ void SkeletonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { //// PhysicalBoneSpatialGizmoPlugin::PhysicalBoneSpatialGizmoPlugin() { - create_material("joint_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1))); + create_material("joint_material", EDITOR_GET("editors/3d_gizmos/gizmo_colors/joint")); } bool PhysicalBoneSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { @@ -1931,7 +1931,7 @@ void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { ///// RayCastSpatialGizmoPlugin::RayCastSpatialGizmoPlugin() { - const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); + const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); create_material("shape_material", gizmo_color); const float gizmo_value = gizmo_color.get_v(); const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65); @@ -1985,7 +1985,7 @@ void SpringArmSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { } SpringArmSpatialGizmoPlugin::SpringArmSpatialGizmoPlugin() { - Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); + Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); create_material("shape_material", gizmo_color); } @@ -2004,7 +2004,7 @@ int SpringArmSpatialGizmoPlugin::get_priority() const { ///// VehicleWheelSpatialGizmoPlugin::VehicleWheelSpatialGizmoPlugin() { - Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); + Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); create_material("shape_material", gizmo_color); } @@ -2075,7 +2075,7 @@ void VehicleWheelSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { /////////// SoftBodySpatialGizmoPlugin::SoftBodySpatialGizmoPlugin() { - Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); + Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); create_material("shape_material", gizmo_color); create_handle_material("handles"); } @@ -2994,7 +2994,7 @@ void BakedIndirectLightGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { //// CollisionObjectGizmoPlugin::CollisionObjectGizmoPlugin() { - const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); + const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); create_material("shape_material", gizmo_color); const float gizmo_value = gizmo_color.get_v(); const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65); @@ -3045,7 +3045,7 @@ void CollisionObjectGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { //// CollisionShapeSpatialGizmoPlugin::CollisionShapeSpatialGizmoPlugin() { - const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); + const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); create_material("shape_material", gizmo_color); const float gizmo_value = gizmo_color.get_v(); const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65); @@ -3643,7 +3643,7 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { ///// CollisionPolygonSpatialGizmoPlugin::CollisionPolygonSpatialGizmoPlugin() { - const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); + const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); create_material("shape_material", gizmo_color); const float gizmo_value = gizmo_color.get_v(); const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65); @@ -4042,7 +4042,7 @@ void JointGizmosDrawer::draw_cone(const Transform &p_offset, const Basis &p_base //// JointSpatialGizmoPlugin::JointSpatialGizmoPlugin() { - create_material("joint_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1))); + create_material("joint_material", EDITOR_GET("editors/3d_gizmos/gizmo_colors/joint")); create_material("joint_body_a_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint_body_a", Color(0.6, 0.8, 1))); create_material("joint_body_b_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint_body_b", Color(0.6, 0.9, 1))); diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 4ffca497819..e93f6bd12cc 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -493,7 +493,7 @@ struct GDScriptCompletionIdentifier { }; static void _get_directory_contents(EditorFileSystemDirectory *p_dir, Map &r_list, String p_ends_with = "") { - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; for (int i = 0; i < p_dir->get_file_count(); i++) { ScriptCodeCompletionOption option(p_dir->get_file_path(i), ScriptCodeCompletionOption::KIND_FILE_PATH); @@ -2239,7 +2239,7 @@ static void _find_call_arguments(const GDScriptCompletionContext &p_context, con Variant base = p_base.value; GDScriptParser::DataType base_type = p_base.type; - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; #define IS_METHOD_SIGNAL(m_method) (m_method == "connect" || m_method == "disconnect" || m_method == "is_connected" || m_method == "emit_signal") @@ -2408,7 +2408,7 @@ static void _find_call_arguments(const GDScriptCompletionContext &p_context, con } static void _find_call_arguments(GDScriptCompletionContext &p_context, const GDScriptParser::Node *p_node, int p_argidx, Map &r_result, bool &r_forced, String &r_arghint) { - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; if (!p_node || p_node->type != GDScriptParser::Node::TYPE_OPERATOR) { return; @@ -2536,7 +2536,7 @@ static void _find_call_arguments(GDScriptCompletionContext &p_context, const GDS } Error GDScriptLanguage::complete_code(const String &p_code, const String &p_path, Object *p_owner, List *r_options, bool &r_forced, String &r_call_hint) { - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; GDScriptParser parser; @@ -3032,10 +3032,10 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_path String GDScriptLanguage::_get_indentation() const { #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint()) { - bool use_space_indentation = EDITOR_DEF("text_editor/indent/type", false); + bool use_space_indentation = EDITOR_GET("text_editor/indent/type"); if (use_space_indentation) { - int indent_size = EDITOR_DEF("text_editor/indent/size", 4); + int indent_size = EDITOR_GET("text_editor/indent/size"); String space_indent = ""; for (int i = 0; i < indent_size; i++) { diff --git a/modules/gdscript/language_server/gdscript_text_document.cpp b/modules/gdscript/language_server/gdscript_text_document.cpp index d1456da379b..1412ad0e5de 100644 --- a/modules/gdscript/language_server/gdscript_text_document.cpp +++ b/modules/gdscript/language_server/gdscript_text_document.cpp @@ -285,7 +285,7 @@ Dictionary GDScriptTextDocument::resolve(const Dictionary &p_params) { } } else if (item.kind == lsp::CompletionItemKind::Event) { if (params.context.triggerKind == lsp::CompletionTriggerKind::TriggerCharacter && (params.context.triggerCharacter == "(")) { - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; item.insertText = quote_style + item.label + quote_style; } } diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index a5f1f7c7e33..c92d731e264 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -833,7 +833,7 @@ void GridMapEditor::_icon_size_changed(float p_value) { void GridMapEditor::update_palette() { int selected = mesh_library_palette->get_current(); - float min_size = EDITOR_DEF("editors/grid_map/preview_size", 64); + float min_size = EDITOR_GET("editors/grid_map/preview_size"); min_size *= EDSCALE; mesh_library_palette->clear(); @@ -1315,8 +1315,6 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { size_slider->connect("value_changed", this, "_icon_size_changed"); add_child(size_slider); - EDITOR_DEF("editors/grid_map/preview_size", 64); - display_mode = DISPLAY_THUMBNAIL; mesh_library_palette = memnew(ItemList); diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 524249b89a0..c492a8c24a3 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -506,10 +506,10 @@ String CSharpLanguage::make_function(const String &, const String &, const PoolS String CSharpLanguage::_get_indentation() const { #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint()) { - bool use_space_indentation = EDITOR_DEF("text_editor/indent/type", 0); + bool use_space_indentation = EDITOR_GET("text_editor/indent/type"); if (use_space_indentation) { - int indent_size = EDITOR_DEF("text_editor/indent/size", 4); + int indent_size = EDITOR_GET("text_editor/indent/size"); String space_indent = ""; for (int i = 0; i < indent_size; i++) { diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 99845ab5cb2..7c0b6e0441b 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1495,7 +1495,7 @@ NodePath AnimationPlayer::get_root() const { void AnimationPlayer::get_argument_options(const StringName &p_function, int p_idx, List *r_options) const { #ifdef TOOLS_ENABLED - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", 0) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; #else const String quote_style = "\""; #endif diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 023a45e54c7..cfe7e7a73d0 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2546,7 +2546,7 @@ bool Control::is_visibility_clip_disabled() const { void Control::get_argument_options(const StringName &p_function, int p_idx, List *r_options) const { #ifdef TOOLS_ENABLED - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", 0) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; #else const String quote_style = "\""; #endif diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 98062feeaa5..e17d008ca84 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -751,9 +751,8 @@ void LineEdit::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint() && !get_tree()->is_node_being_edited(this)) { - EDITOR_DEF("text_editor/cursor/caret_blink", false); cursor_set_blink_enabled(EditorSettings::get_singleton()->is_caret_blink_active()); - cursor_set_blink_speed(EDITOR_DEF("text_editor/cursor/caret_blink_speed", 0.65)); + cursor_set_blink_speed(EDITOR_GET("text_editor/cursor/caret_blink_speed")); if (!EditorSettings::get_singleton()->is_connected("settings_changed", this, "_editor_settings_changed")) { EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed"); @@ -1777,9 +1776,8 @@ PopupMenu *LineEdit::get_menu() const { void LineEdit::_editor_settings_changed() { #ifdef TOOLS_ENABLED - EDITOR_DEF("text_editor/cursor/caret_blink", false); cursor_set_blink_enabled(EditorSettings::get_singleton()->is_caret_blink_active()); - cursor_set_blink_speed(EDITOR_DEF("text_editor/cursor/caret_blink_speed", 0.65)); + cursor_set_blink_speed(EDITOR_GET("text_editor/cursor/caret_blink_speed")); #endif } diff --git a/scene/main/node.cpp b/scene/main/node.cpp index d16a65f9362..462f0011c19 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2728,7 +2728,7 @@ NodePath Node::get_import_path() const { static void _add_nodes_to_options(const Node *p_base, const Node *p_node, List *r_options) { #ifdef TOOLS_ENABLED - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", 0) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; #else const String quote_style = "\""; #endif diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index e0b51367e0e..6ee4610ce6d 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -233,7 +233,7 @@ void ShaderMaterial::_bind_methods() { void ShaderMaterial::get_argument_options(const StringName &p_function, int p_idx, List *r_options) const { #ifdef TOOLS_ENABLED - const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", 0) ? "'" : "\""; + const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\""; #else const String quote_style = "\""; #endif