diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-31 13:15:58 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-31 13:15:58 +0100 |
commit | 5947f22be9441b3b4d41604af8301515558d0f03 (patch) | |
tree | 7323e3023e0519d23bcf4ca23b8990c3363d6a99 /editor | |
parent | 9cfcc9131fc03693893e0ed2ac19878c392a0125 (diff) | |
parent | e48c5daddfa70172c0eab57b8045a7087eec6e2c (diff) |
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
Diffstat (limited to 'editor')
66 files changed, 382 insertions, 382 deletions
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index 604758300d..4c7ebca299 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -211,11 +211,11 @@ void AnimationBezierTrackEdit::_draw_line_clipped(const Vector2 &p_from, const V void AnimationBezierTrackEdit::_notification(int p_what) { switch (p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); + panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); } break; case NOTIFICATION_ENTER_TREE: { - panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); + panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); [[fallthrough]]; } case NOTIFICATION_THEME_CHANGED: { diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 8a2d23d32d..44ecda103e 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1487,7 +1487,7 @@ void AnimationTimelineEdit::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); + panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); add_track->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); loop->set_icon(get_theme_icon(SNAME("Loop"), SNAME("EditorIcons"))); time_icon->set_texture(get_theme_icon(SNAME("Time"), SNAME("EditorIcons"))); @@ -1505,7 +1505,7 @@ void AnimationTimelineEdit::_notification(int p_what) { } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); + panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); } break; case NOTIFICATION_RESIZED: { @@ -4753,11 +4753,11 @@ MenuButton *AnimationTrackEditor::get_edit_menu() { void AnimationTrackEditor::_notification(int p_what) { switch (p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); + panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); } break; case NOTIFICATION_ENTER_TREE: { - panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); + panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/animation_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); [[fallthrough]]; } case NOTIFICATION_THEME_CHANGED: { diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index e328f76545..212a46cb62 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1009,50 +1009,50 @@ void CodeTextEditor::update_editor_settings() { completion_comment_color = EDITOR_GET("text_editor/theme/highlighting/comment_color"); // Appearance: Caret - text_editor->set_caret_type((TextEdit::CaretType)EditorSettings::get_singleton()->get("text_editor/appearance/caret/type").operator int()); - text_editor->set_caret_blink_enabled(EditorSettings::get_singleton()->get("text_editor/appearance/caret/caret_blink")); - text_editor->set_caret_blink_interval(EditorSettings::get_singleton()->get("text_editor/appearance/caret/caret_blink_interval")); - text_editor->set_highlight_current_line(EditorSettings::get_singleton()->get("text_editor/appearance/caret/highlight_current_line")); - text_editor->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/appearance/caret/highlight_all_occurrences")); + text_editor->set_caret_type((TextEdit::CaretType)EDITOR_GET("text_editor/appearance/caret/type").operator int()); + text_editor->set_caret_blink_enabled(EDITOR_GET("text_editor/appearance/caret/caret_blink")); + text_editor->set_caret_blink_interval(EDITOR_GET("text_editor/appearance/caret/caret_blink_interval")); + text_editor->set_highlight_current_line(EDITOR_GET("text_editor/appearance/caret/highlight_current_line")); + text_editor->set_highlight_all_occurrences(EDITOR_GET("text_editor/appearance/caret/highlight_all_occurrences")); // Appearance: Gutters - text_editor->set_draw_line_numbers(EditorSettings::get_singleton()->get("text_editor/appearance/gutters/show_line_numbers")); - text_editor->set_line_numbers_zero_padded(EditorSettings::get_singleton()->get("text_editor/appearance/gutters/line_numbers_zero_padded")); - text_editor->set_draw_bookmarks_gutter(EditorSettings::get_singleton()->get("text_editor/appearance/gutters/show_bookmark_gutter")); + text_editor->set_draw_line_numbers(EDITOR_GET("text_editor/appearance/gutters/show_line_numbers")); + text_editor->set_line_numbers_zero_padded(EDITOR_GET("text_editor/appearance/gutters/line_numbers_zero_padded")); + text_editor->set_draw_bookmarks_gutter(EDITOR_GET("text_editor/appearance/gutters/show_bookmark_gutter")); // Appearance: Minimap - text_editor->set_draw_minimap(EditorSettings::get_singleton()->get("text_editor/appearance/minimap/show_minimap")); - text_editor->set_minimap_width((int)EditorSettings::get_singleton()->get("text_editor/appearance/minimap/minimap_width") * EDSCALE); + text_editor->set_draw_minimap(EDITOR_GET("text_editor/appearance/minimap/show_minimap")); + text_editor->set_minimap_width((int)EDITOR_GET("text_editor/appearance/minimap/minimap_width") * EDSCALE); // Appearance: Lines - text_editor->set_line_folding_enabled(EditorSettings::get_singleton()->get("text_editor/appearance/lines/code_folding")); - text_editor->set_draw_fold_gutter(EditorSettings::get_singleton()->get("text_editor/appearance/lines/code_folding")); - text_editor->set_line_wrapping_mode((TextEdit::LineWrappingMode)EditorSettings::get_singleton()->get("text_editor/appearance/lines/word_wrap").operator int()); + text_editor->set_line_folding_enabled(EDITOR_GET("text_editor/appearance/lines/code_folding")); + text_editor->set_draw_fold_gutter(EDITOR_GET("text_editor/appearance/lines/code_folding")); + text_editor->set_line_wrapping_mode((TextEdit::LineWrappingMode)EDITOR_GET("text_editor/appearance/lines/word_wrap").operator int()); // Appearance: Whitespace - text_editor->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/appearance/whitespace/draw_tabs")); - text_editor->set_draw_spaces(EditorSettings::get_singleton()->get("text_editor/appearance/whitespace/draw_spaces")); + text_editor->set_draw_tabs(EDITOR_GET("text_editor/appearance/whitespace/draw_tabs")); + text_editor->set_draw_spaces(EDITOR_GET("text_editor/appearance/whitespace/draw_spaces")); // Behavior: Navigation - text_editor->set_scroll_past_end_of_file_enabled(EditorSettings::get_singleton()->get("text_editor/behavior/navigation/scroll_past_end_of_file")); - text_editor->set_smooth_scroll_enabled(EditorSettings::get_singleton()->get("text_editor/behavior/navigation/smooth_scrolling")); - text_editor->set_v_scroll_speed(EditorSettings::get_singleton()->get("text_editor/behavior/navigation/v_scroll_speed")); - text_editor->set_drag_and_drop_selection_enabled(EditorSettings::get_singleton()->get("text_editor/behavior/navigation/drag_and_drop_selection")); + text_editor->set_scroll_past_end_of_file_enabled(EDITOR_GET("text_editor/behavior/navigation/scroll_past_end_of_file")); + text_editor->set_smooth_scroll_enabled(EDITOR_GET("text_editor/behavior/navigation/smooth_scrolling")); + text_editor->set_v_scroll_speed(EDITOR_GET("text_editor/behavior/navigation/v_scroll_speed")); + text_editor->set_drag_and_drop_selection_enabled(EDITOR_GET("text_editor/behavior/navigation/drag_and_drop_selection")); // Behavior: indent - text_editor->set_indent_using_spaces(EditorSettings::get_singleton()->get("text_editor/behavior/indent/type")); - text_editor->set_indent_size(EditorSettings::get_singleton()->get("text_editor/behavior/indent/size")); - text_editor->set_auto_indent_enabled(EditorSettings::get_singleton()->get("text_editor/behavior/indent/auto_indent")); + text_editor->set_indent_using_spaces(EDITOR_GET("text_editor/behavior/indent/type")); + text_editor->set_indent_size(EDITOR_GET("text_editor/behavior/indent/size")); + text_editor->set_auto_indent_enabled(EDITOR_GET("text_editor/behavior/indent/auto_indent")); // Completion - text_editor->set_auto_brace_completion_enabled(EditorSettings::get_singleton()->get("text_editor/completion/auto_brace_complete")); + text_editor->set_auto_brace_completion_enabled(EDITOR_GET("text_editor/completion/auto_brace_complete")); // Appearance: Guidelines - if (EditorSettings::get_singleton()->get("text_editor/appearance/guidelines/show_line_length_guidelines")) { + if (EDITOR_GET("text_editor/appearance/guidelines/show_line_length_guidelines")) { TypedArray<int> guideline_cols; - guideline_cols.append(EditorSettings::get_singleton()->get("text_editor/appearance/guidelines/line_length_guideline_hard_column")); - if (EditorSettings::get_singleton()->get("text_editor/appearance/guidelines/line_length_guideline_soft_column") != guideline_cols[0]) { - guideline_cols.append(EditorSettings::get_singleton()->get("text_editor/appearance/guidelines/line_length_guideline_soft_column")); + guideline_cols.append(EDITOR_GET("text_editor/appearance/guidelines/line_length_guideline_hard_column")); + if (EDITOR_GET("text_editor/appearance/guidelines/line_length_guideline_soft_column") != guideline_cols[0]) { + guideline_cols.append(EDITOR_GET("text_editor/appearance/guidelines/line_length_guideline_soft_column")); } text_editor->set_line_length_guidelines(guideline_cols); } else { @@ -1126,7 +1126,7 @@ void CodeTextEditor::insert_final_newline() { } void CodeTextEditor::convert_indent_to_spaces() { - int indent_size = EditorSettings::get_singleton()->get("text_editor/behavior/indent/size"); + int indent_size = EDITOR_GET("text_editor/behavior/indent/size"); String indent = ""; for (int i = 0; i < indent_size; i++) { @@ -1178,7 +1178,7 @@ void CodeTextEditor::convert_indent_to_spaces() { } void CodeTextEditor::convert_indent_to_tabs() { - int indent_size = EditorSettings::get_singleton()->get("text_editor/behavior/indent/size"); + int indent_size = EDITOR_GET("text_editor/behavior/indent/size"); indent_size -= 1; Vector<int> cursor_columns; @@ -1848,8 +1848,8 @@ void CodeTextEditor::_on_settings_change() { void CodeTextEditor::_apply_settings_change() { _update_text_editor_theme(); - font_size = EditorSettings::get_singleton()->get("interface/editor/code_font_size"); - int ot_mode = EditorSettings::get_singleton()->get("interface/editor/code_font_contextual_ligatures"); + font_size = EDITOR_GET("interface/editor/code_font_size"); + int ot_mode = EDITOR_GET("interface/editor/code_font_contextual_ligatures"); Ref<FontVariation> fc = text_editor->get_theme_font(SNAME("font")); if (fc.is_valid()) { @@ -1860,7 +1860,7 @@ void CodeTextEditor::_apply_settings_change() { fc->set_opentype_features(ftrs); } break; case 2: { // Custom. - Vector<String> subtag = String(EditorSettings::get_singleton()->get("interface/editor/code_font_custom_opentype_features")).split(","); + Vector<String> subtag = String(EDITOR_GET("interface/editor/code_font_custom_opentype_features")).split(","); Dictionary ftrs; for (int i = 0; i < subtag.size(); i++) { Vector<String> subtag_a = subtag[i].split("="); @@ -2084,7 +2084,7 @@ CodeTextEditor::CodeTextEditor() { add_child(text_editor); text_editor->set_v_size_flags(SIZE_EXPAND_FILL); - int ot_mode = EditorSettings::get_singleton()->get("interface/editor/code_font_contextual_ligatures"); + int ot_mode = EDITOR_GET("interface/editor/code_font_contextual_ligatures"); Ref<FontVariation> fc = text_editor->get_theme_font(SNAME("font")); if (fc.is_valid()) { switch (ot_mode) { @@ -2094,7 +2094,7 @@ CodeTextEditor::CodeTextEditor() { fc->set_opentype_features(ftrs); } break; case 2: { // Custom. - Vector<String> subtag = String(EditorSettings::get_singleton()->get("interface/editor/code_font_custom_opentype_features")).split(","); + Vector<String> subtag = String(EDITOR_GET("interface/editor/code_font_custom_opentype_features")).split(","); Dictionary ftrs; for (int i = 0; i < subtag.size(); i++) { Vector<String> subtag_a = subtag[i].split("="); @@ -2202,7 +2202,7 @@ CodeTextEditor::CodeTextEditor() { code_complete_timer->connect("timeout", callable_mp(this, &CodeTextEditor::_code_complete_timer_timeout)); font_resize_val = 0; - font_size = EditorSettings::get_singleton()->get("interface/editor/code_font_size"); + font_size = EDITOR_GET("interface/editor/code_font_size"); font_resize_timer = memnew(Timer); add_child(font_resize_timer); font_resize_timer->set_one_shot(true); diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 7a4e58c6f9..6142856f75 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -307,7 +307,7 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String // Don't collapse the root node or an abstract node on the first tree level. bool should_collapse = p_type != base_type && (r_item->get_parent()->get_text(0) != base_type || can_instantiate); - if (should_collapse && bool(EditorSettings::get_singleton()->get("docks/scene_tree/start_create_dialog_fully_expanded"))) { + if (should_collapse && bool(EDITOR_GET("docks/scene_tree/start_create_dialog_fully_expanded"))) { should_collapse = false; // Collapse all nodes anyway. } r_item->set_collapsed(should_collapse); diff --git a/editor/debugger/debug_adapter/debug_adapter_server.cpp b/editor/debugger/debug_adapter/debug_adapter_server.cpp index 37da64beae..2e2361889d 100644 --- a/editor/debugger/debug_adapter/debug_adapter_server.cpp +++ b/editor/debugger/debug_adapter/debug_adapter_server.cpp @@ -62,8 +62,8 @@ void DebugAdapterServer::_notification(int p_what) { } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - protocol._request_timeout = EditorSettings::get_singleton()->get("network/debug_adapter/request_timeout"); - protocol._sync_breakpoints = EditorSettings::get_singleton()->get("network/debug_adapter/sync_breakpoints"); + protocol._request_timeout = EDITOR_GET("network/debug_adapter/request_timeout"); + protocol._sync_breakpoints = EDITOR_GET("network/debug_adapter/sync_breakpoints"); int port = (int)_EDITOR_GET("network/debug_adapter/remote_port"); if (port != remote_port) { stop(); diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index ecd8fcb2ba..edcbcaf963 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -278,7 +278,7 @@ void EditorDebuggerNode::_notification(int p_what) { // Remote scene tree update remote_scene_tree_timeout -= get_process_delta_time(); if (remote_scene_tree_timeout < 0) { - remote_scene_tree_timeout = EditorSettings::get_singleton()->get("debugger/remote_scene_tree_refresh_interval"); + remote_scene_tree_timeout = EDITOR_GET("debugger/remote_scene_tree_refresh_interval"); if (remote_scene_tree->is_visible_in_tree()) { get_current_debugger()->request_remote_tree(); } @@ -287,7 +287,7 @@ void EditorDebuggerNode::_notification(int p_what) { // Remote inspector update inspect_edited_object_timeout -= get_process_delta_time(); if (inspect_edited_object_timeout < 0) { - inspect_edited_object_timeout = EditorSettings::get_singleton()->get("debugger/remote_inspect_refresh_interval"); + inspect_edited_object_timeout = EDITOR_GET("debugger/remote_inspect_refresh_interval"); if (EditorDebuggerRemoteObject *obj = get_inspected_remote_object()) { get_current_debugger()->request_remote_object(obj->remote_object_id); } @@ -314,7 +314,7 @@ void EditorDebuggerNode::_notification(int p_what) { EditorNode::get_singleton()->get_pause_button()->set_disabled(false); // Switch to remote tree view if so desired. - auto_switch_remote_scene_tree = (bool)EditorSettings::get_singleton()->get("debugger/auto_switch_to_remote_scene_tree"); + auto_switch_remote_scene_tree = (bool)EDITOR_GET("debugger/auto_switch_to_remote_scene_tree"); if (auto_switch_remote_scene_tree) { SceneTreeDock::get_singleton()->show_remote_tree(); } diff --git a/editor/debugger/editor_debugger_server.cpp b/editor/debugger/editor_debugger_server.cpp index 63390825c6..dba0491cfc 100644 --- a/editor/debugger/editor_debugger_server.cpp +++ b/editor/debugger/editor_debugger_server.cpp @@ -72,8 +72,8 @@ String EditorDebuggerServerTCP::get_uri() const { Error EditorDebuggerServerTCP::start(const String &p_uri) { // Default host and port - String bind_host = (String)EditorSettings::get_singleton()->get("network/debug/remote_host"); - int bind_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port"); + String bind_host = (String)EDITOR_GET("network/debug/remote_host"); + int bind_port = (int)EDITOR_GET("network/debug/remote_port"); // Optionally override if (!p_uri.is_empty() && p_uri != "tcp://") { diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index dfa2b8e70f..35666a5566 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -85,7 +85,7 @@ void EditorProfiler::add_frame_metric(const Metric &p_metric, bool p_final) { } void EditorProfiler::clear() { - int metric_size = EditorSettings::get_singleton()->get("debugger/profiler_frame_history_size"); + int metric_size = EDITOR_GET("debugger/profiler_frame_history_size"); metric_size = CLAMP(metric_size, 60, 10000); frame_metrics.clear(); frame_metrics.resize(metric_size); diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 8552c8e9ef..b8bc712ba6 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -92,7 +92,7 @@ void EditorVisualProfiler::add_frame_metric(const Metric &p_metric) { } void EditorVisualProfiler::clear() { - int metric_size = EditorSettings::get_singleton()->get("debugger/profiler_frame_history_size"); + int metric_size = EDITOR_GET("debugger/profiler_frame_history_size"); metric_size = CLAMP(metric_size, 60, 10000); frame_metrics.clear(); frame_metrics.resize(metric_size); diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index f1fc1019b9..f1f34b8ebb 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -995,7 +995,7 @@ void ScriptEditorDebugger::_profiler_activate(bool p_enable, int p_type) { profiler_signature.clear(); // Add max funcs options to request. Array opts; - int max_funcs = EditorSettings::get_singleton()->get("debugger/profiler_frame_max_functions"); + int max_funcs = EDITOR_GET("debugger/profiler_frame_max_functions"); opts.push_back(CLAMP(max_funcs, 16, 512)); msg_data.push_back(opts); } diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index 9064329d1f..959c4ab92c 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -430,7 +430,7 @@ void DependencyRemoveDialog::_find_localization_remaps_of_removed_files(Vector<R // Look for dependencies in the translation remaps. if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/translation_remaps")) { - Dictionary remaps = ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps"); + Dictionary remaps = GLOBAL_GET("internationalization/locale/translation_remaps"); if (remaps.has(path)) { RemovedDependency dep; @@ -544,28 +544,28 @@ void DependencyRemoveDialog::ok_pressed() { // If the file we are deleting for e.g. the main scene, default environment, // or audio bus layout, we must clear its definition in Project Settings. - if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("application/config/icon"))) { + if (files_to_delete[i] == String(GLOBAL_GET("application/config/icon"))) { ProjectSettings::get_singleton()->set("application/config/icon", ""); } - if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("application/run/main_scene"))) { + if (files_to_delete[i] == String(GLOBAL_GET("application/run/main_scene"))) { ProjectSettings::get_singleton()->set("application/run/main_scene", ""); } - if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("application/boot_splash/image"))) { + if (files_to_delete[i] == String(GLOBAL_GET("application/boot_splash/image"))) { ProjectSettings::get_singleton()->set("application/boot_splash/image", ""); } - if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("rendering/environment/defaults/default_environment"))) { + if (files_to_delete[i] == String(GLOBAL_GET("rendering/environment/defaults/default_environment"))) { ProjectSettings::get_singleton()->set("rendering/environment/defaults/default_environment", ""); } - if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("display/mouse_cursor/custom_image"))) { + if (files_to_delete[i] == String(GLOBAL_GET("display/mouse_cursor/custom_image"))) { ProjectSettings::get_singleton()->set("display/mouse_cursor/custom_image", ""); } - if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("gui/theme/custom"))) { + if (files_to_delete[i] == String(GLOBAL_GET("gui/theme/custom"))) { ProjectSettings::get_singleton()->set("gui/theme/custom", ""); } - if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("gui/theme/custom_font"))) { + if (files_to_delete[i] == String(GLOBAL_GET("gui/theme/custom_font"))) { ProjectSettings::get_singleton()->set("gui/theme/custom_font", ""); } - if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("audio/buses/default_bus_layout"))) { + if (files_to_delete[i] == String(GLOBAL_GET("audio/buses/default_bus_layout"))) { ProjectSettings::get_singleton()->set("audio/buses/default_bus_layout", ""); } diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 0ff2227fed..46df618d57 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -1208,7 +1208,7 @@ void EditorAudioBuses::_load_layout() { } void EditorAudioBuses::_load_default_layout() { - String layout_path = ProjectSettings::get_singleton()->get("audio/buses/default_bus_layout"); + String layout_path = GLOBAL_GET("audio/buses/default_bus_layout"); Ref<AudioBusLayout> state = ResourceLoader::load(layout_path, "", ResourceFormatLoader::CACHE_MODE_IGNORE); if (state.is_null()) { @@ -1273,7 +1273,7 @@ EditorAudioBuses::EditorAudioBuses() { add_child(top_hb); file = memnew(Label); - String layout_path = ProjectSettings::get_singleton()->get("audio/buses/default_bus_layout"); + String layout_path = GLOBAL_GET("audio/buses/default_bus_layout"); file->set_text(String(TTR("Layout:")) + " " + layout_path.get_file()); file->set_clip_text(true); file->set_h_size_flags(SIZE_EXPAND_FILL); @@ -1328,7 +1328,7 @@ EditorAudioBuses::EditorAudioBuses() { set_v_size_flags(SIZE_EXPAND_FILL); - edited_path = ProjectSettings::get_singleton()->get("audio/buses/default_bus_layout"); + edited_path = GLOBAL_GET("audio/buses/default_bus_layout"); file_dialog = memnew(EditorFileDialog); List<String> ext; diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index acdf41c078..90310bb43c 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -222,7 +222,7 @@ void EditorAutoloadSettings::_autoload_edited() { name = "autoload/" + name; int order = ProjectSettings::get_singleton()->get_order(selected_autoload); - String scr_path = ProjectSettings::get_singleton()->get(selected_autoload); + String scr_path = GLOBAL_GET(selected_autoload); undo_redo->create_action(TTR("Rename Autoload")); @@ -250,7 +250,7 @@ void EditorAutoloadSettings::_autoload_edited() { String base = "autoload/" + ti->get_text(0); int order = ProjectSettings::get_singleton()->get_order(base); - String scr_path = ProjectSettings::get_singleton()->get(base); + String scr_path = GLOBAL_GET(base); if (scr_path.begins_with("*")) { scr_path = scr_path.substr(1, scr_path.length()); @@ -264,7 +264,7 @@ void EditorAutoloadSettings::_autoload_edited() { undo_redo->create_action(TTR("Toggle Autoload Globals")); undo_redo->add_do_property(ProjectSettings::get_singleton(), base, scr_path); - undo_redo->add_undo_property(ProjectSettings::get_singleton(), base, ProjectSettings::get_singleton()->get(base)); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), base, GLOBAL_GET(base)); undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", base, order); undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", base, order); @@ -337,7 +337,7 @@ void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_colu undo_redo->add_do_property(ProjectSettings::get_singleton(), name, Variant()); - undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, ProjectSettings::get_singleton()->get(name)); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, GLOBAL_GET(name)); undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_persisting", name, true); undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", order); @@ -453,7 +453,7 @@ void EditorAutoloadSettings::update_autoload() { } String name = pi.name.get_slice("/", 1); - String scr_path = ProjectSettings::get_singleton()->get(pi.name); + String scr_path = GLOBAL_GET(pi.name); if (name.is_empty()) { continue; @@ -764,7 +764,7 @@ bool EditorAutoloadSettings::autoload_add(const String &p_name, const String &p_ undo_redo->add_do_property(ProjectSettings::get_singleton(), name, "*" + p_path); if (ProjectSettings::get_singleton()->has_setting(name)) { - undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, ProjectSettings::get_singleton()->get(name)); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, GLOBAL_GET(name)); } else { undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, Variant()); } @@ -791,7 +791,7 @@ void EditorAutoloadSettings::autoload_remove(const String &p_name) { undo_redo->add_do_property(ProjectSettings::get_singleton(), name, Variant()); - undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, ProjectSettings::get_singleton()->get(name)); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, GLOBAL_GET(name)); undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_persisting", name, true); undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", order); @@ -828,7 +828,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() { } String name = pi.name.get_slice("/", 1); - String scr_path = ProjectSettings::get_singleton()->get(pi.name); + String scr_path = GLOBAL_GET(pi.name); if (name.is_empty()) { continue; diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index d1ea0f2814..6d8f0df452 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -1008,7 +1008,7 @@ void EditorData::script_class_save_icon_paths() { Dictionary old; if (ProjectSettings::get_singleton()->has_setting("_global_script_class_icons")) { - old = ProjectSettings::get_singleton()->get("_global_script_class_icons"); + old = GLOBAL_GET("_global_script_class_icons"); } if ((!old.is_empty() || d.is_empty()) && d.hash() == old.hash()) { return; @@ -1028,7 +1028,7 @@ void EditorData::script_class_load_icon_paths() { script_class_clear_icon_paths(); if (ProjectSettings::get_singleton()->has_setting("_global_script_class_icons")) { - Dictionary d = ProjectSettings::get_singleton()->get("_global_script_class_icons"); + Dictionary d = GLOBAL_GET("_global_script_class_icons"); List<Variant> keys; d.get_key_list(&keys); diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp index f464ca3b3c..0c5c15a0ed 100644 --- a/editor/editor_dir_dialog.cpp +++ b/editor/editor_dir_dialog.cpp @@ -57,7 +57,7 @@ void EditorDirDialog::_update_dir(TreeItem *p_item, EditorFileSystemDirectory *p } //this should be handled by EditorFileSystem already - //bool show_hidden = EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"); + //bool show_hidden = EDITOR_GET("filesystem/file_dialog/show_hidden_files"); updating = false; for (int i = 0; i < p_dir->get_subdir_count(); i++) { TreeItem *ti = tree->create_item(p_item); diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index ab252a7ff1..ee02916a5f 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -131,11 +131,11 @@ void EditorFileDialog::_notification(int p_what) { } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - bool is_showing_hidden = EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"); + bool is_showing_hidden = EDITOR_GET("filesystem/file_dialog/show_hidden_files"); if (show_hidden_files != is_showing_hidden) { set_show_hidden_files(is_showing_hidden); } - set_display_mode((DisplayMode)EditorSettings::get_singleton()->get("filesystem/file_dialog/display_mode").operator int()); + set_display_mode((DisplayMode)EDITOR_GET("filesystem/file_dialog/display_mode").operator int()); // DO NOT CALL UPDATE FILE LIST HERE, ALL HUNDREDS OF HIDDEN DIALOGS WILL RESPOND, CALL INVALIDATE INSTEAD invalidate(); @@ -740,7 +740,7 @@ void EditorFileDialog::update_file_name() { // DO NOT USE THIS FUNCTION UNLESS NEEDED, CALL INVALIDATE() INSTEAD. void EditorFileDialog::update_file_list() { - int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); + int thumbnail_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); thumbnail_size *= EDSCALE; Ref<Texture2D> folder_thumbnail; Ref<Texture2D> file_thumbnail; diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index c28bb18891..ce06631fdd 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1888,7 +1888,7 @@ void EditorFileSystem::_reimport_file(const String &p_file, const HashMap<String if (load_default && ProjectSettings::get_singleton()->has_setting("importer_defaults/" + importer->get_importer_name())) { //use defaults if exist - Dictionary d = ProjectSettings::get_singleton()->get("importer_defaults/" + importer->get_importer_name()); + Dictionary d = GLOBAL_GET("importer_defaults/" + importer->get_importer_name()); List<Variant> v; d.get_key_list(&v); @@ -2388,7 +2388,7 @@ void EditorFileSystem::_update_extensions() { valid_extensions.insert(E); } - const Vector<String> textfile_ext = ((String)(EditorSettings::get_singleton()->get("docks/filesystem/textfile_extensions"))).split(",", false); + const Vector<String> textfile_ext = ((String)(EDITOR_GET("docks/filesystem/textfile_extensions"))).split(",", false); for (const String &E : textfile_ext) { if (valid_extensions.has(E)) { continue; diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 0262284cdf..90f3f8d2f5 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -91,9 +91,9 @@ Ref<FontVariation> make_bold_font(const Ref<Font> &p_font, double p_embolden, Ty void editor_register_fonts(Ref<Theme> p_theme) { Ref<DirAccess> dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - TextServer::FontAntialiasing font_antialiasing = (TextServer::FontAntialiasing)(int)EditorSettings::get_singleton()->get("interface/editor/font_antialiasing"); - int font_hinting_setting = (int)EditorSettings::get_singleton()->get("interface/editor/font_hinting"); - TextServer::SubpixelPositioning font_subpixel_positioning = (TextServer::SubpixelPositioning)(int)EditorSettings::get_singleton()->get("interface/editor/font_subpixel_positioning"); + TextServer::FontAntialiasing font_antialiasing = (TextServer::FontAntialiasing)(int)EDITOR_GET("interface/editor/font_antialiasing"); + int font_hinting_setting = (int)EDITOR_GET("interface/editor/font_hinting"); + TextServer::SubpixelPositioning font_subpixel_positioning = (TextServer::SubpixelPositioning)(int)EDITOR_GET("interface/editor/font_subpixel_positioning"); TextServer::Hinting font_hinting; TextServer::Hinting font_mono_hinting; @@ -173,9 +173,9 @@ void editor_register_fonts(Ref<Theme> p_theme) { default_font_mono->set_fallbacks(fallbacks); // Init base font configs and load custom fonts. - String custom_font_path = EditorSettings::get_singleton()->get("interface/editor/main_font"); - String custom_font_path_bold = EditorSettings::get_singleton()->get("interface/editor/main_font_bold"); - String custom_font_path_source = EditorSettings::get_singleton()->get("interface/editor/code_font"); + String custom_font_path = EDITOR_GET("interface/editor/main_font"); + String custom_font_path_bold = EDITOR_GET("interface/editor/main_font_bold"); + String custom_font_path_source = EDITOR_GET("interface/editor/code_font"); Ref<FontVariation> default_fc; default_fc.instantiate(); @@ -283,7 +283,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { Ref<FontVariation> mono_other_fc = mono_fc->duplicate(); // Enable contextual alternates (coding ligatures) and custom features for the source editor font. - int ot_mode = EditorSettings::get_singleton()->get("interface/editor/code_font_contextual_ligatures"); + int ot_mode = EDITOR_GET("interface/editor/code_font_contextual_ligatures"); switch (ot_mode) { case 1: { // Disable ligatures. Dictionary ftrs; @@ -291,7 +291,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { mono_fc->set_opentype_features(ftrs); } break; case 2: { // Custom. - Vector<String> subtag = String(EditorSettings::get_singleton()->get("interface/editor/code_font_custom_opentype_features")).split(","); + Vector<String> subtag = String(EDITOR_GET("interface/editor/code_font_custom_opentype_features")).split(","); Dictionary ftrs; for (int i = 0; i < subtag.size(); i++) { Vector<String> subtag_a = subtag[i].split("="); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 6df73dc8ba..ddb9bb30f1 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -948,7 +948,7 @@ void EditorHelp::_update_doc() { bool constructor_descriptions = false; bool method_descriptions = false; bool operator_descriptions = false; - bool sort_methods = EditorSettings::get_singleton()->get("text_editor/help/sort_functions_alphabetically"); + bool sort_methods = EDITOR_GET("text_editor/help/sort_functions_alphabetically"); Vector<DocData::MethodDoc> methods; diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 1d1970ee5f..94dd4d0606 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -3872,7 +3872,7 @@ void EditorInspector::_notification(int p_what) { update_scroll_request = -1; } if (update_tree_pending) { - refresh_countdown = float(EditorSettings::get_singleton()->get("docks/property_editor/auto_refresh_interval")); + refresh_countdown = float(EDITOR_GET("docks/property_editor/auto_refresh_interval")); } else if (refresh_countdown > 0) { refresh_countdown -= get_process_delta_time(); if (refresh_countdown <= 0) { @@ -3885,7 +3885,7 @@ void EditorInspector::_notification(int p_what) { } } } - refresh_countdown = float(EditorSettings::get_singleton()->get("docks/property_editor/auto_refresh_interval")); + refresh_countdown = float(EDITOR_GET("docks/property_editor/auto_refresh_interval")); } } @@ -4091,7 +4091,7 @@ EditorInspector::EditorInspector() { get_v_scroll_bar()->connect("value_changed", callable_mp(this, &EditorInspector::_vscroll_changed)); update_scroll_request = -1; if (EditorSettings::get_singleton()) { - refresh_countdown = float(EditorSettings::get_singleton()->get("docks/property_editor/auto_refresh_interval")); + refresh_countdown = float(EDITOR_GET("docks/property_editor/auto_refresh_interval")); } else { //used when class is created by the docgen to dump default values of everything bindable, editorsettings may not be created refresh_countdown = 0.33; diff --git a/editor/editor_locale_dialog.cpp b/editor/editor_locale_dialog.cpp index 953358b23e..106cc61947 100644 --- a/editor/editor_locale_dialog.cpp +++ b/editor/editor_locale_dialog.cpp @@ -123,7 +123,7 @@ void EditorLocaleDialog::_filter_lang_option_changed() { Array f_lang_all; if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/language_filter")) { - f_lang_all = ProjectSettings::get_singleton()->get("internationalization/locale/language_filter"); + f_lang_all = GLOBAL_GET("internationalization/locale/language_filter"); prev = f_lang_all; } @@ -156,7 +156,7 @@ void EditorLocaleDialog::_filter_script_option_changed() { Array f_script_all; if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/script_filter")) { - f_script_all = ProjectSettings::get_singleton()->get("internationalization/locale/script_filter"); + f_script_all = GLOBAL_GET("internationalization/locale/script_filter"); prev = f_script_all; } @@ -189,7 +189,7 @@ void EditorLocaleDialog::_filter_cnt_option_changed() { Array f_cnt_all; if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/country_filter")) { - f_cnt_all = ProjectSettings::get_singleton()->get("internationalization/locale/country_filter"); + f_cnt_all = GLOBAL_GET("internationalization/locale/country_filter"); prev = f_cnt_all; } @@ -218,7 +218,7 @@ void EditorLocaleDialog::_filter_mode_changed(int p_mode) { Variant prev; if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/locale_filter_mode")) { - prev = ProjectSettings::get_singleton()->get("internationalization/locale/locale_filter_mode"); + prev = GLOBAL_GET("internationalization/locale/locale_filter_mode"); } undo_redo->create_action(TTR("Changed Locale Filter Mode")); @@ -238,19 +238,19 @@ void EditorLocaleDialog::_update_tree() { int filter = SHOW_ALL_LOCALES; if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/locale_filter_mode")) { - filter = ProjectSettings::get_singleton()->get("internationalization/locale/locale_filter_mode"); + filter = GLOBAL_GET("internationalization/locale/locale_filter_mode"); } Array f_lang_all; if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/language_filter")) { - f_lang_all = ProjectSettings::get_singleton()->get("internationalization/locale/language_filter"); + f_lang_all = GLOBAL_GET("internationalization/locale/language_filter"); } Array f_cnt_all; if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/country_filter")) { - f_cnt_all = ProjectSettings::get_singleton()->get("internationalization/locale/country_filter"); + f_cnt_all = GLOBAL_GET("internationalization/locale/country_filter"); } Array f_script_all; if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/script_filter")) { - f_script_all = ProjectSettings::get_singleton()->get("internationalization/locale/script_filter"); + f_script_all = GLOBAL_GET("internationalization/locale/script_filter"); } bool is_edit_mode = edit_filters->is_pressed(); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 1a5d1131bf..bbb7fb384a 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -335,7 +335,7 @@ void EditorNode::disambiguate_filenames(const Vector<String> p_full_paths, Vecto // TODO: This REALLY should be done in a better way than replacing all tabs after almost EVERY action. void EditorNode::_update_scene_tabs() { - bool show_rb = EditorSettings::get_singleton()->get("interface/scene_tabs/show_script_button"); + bool show_rb = EDITOR_GET("interface/scene_tabs/show_script_button"); if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) { DisplayServer::get_singleton()->global_menu_clear("_dock"); @@ -428,7 +428,7 @@ void EditorNode::_version_control_menu_option(int p_idx) { } void EditorNode::_update_title() { - const String appname = ProjectSettings::get_singleton()->get("application/config/name"); + const String appname = GLOBAL_GET("application/config/name"); String title = (appname.is_empty() ? TTR("Unnamed Project") : appname); const String edited = editor_data.get_edited_scene_root() ? editor_data.get_edited_scene_root()->get_scene_file_path() : String(); if (!edited.is_empty()) { @@ -635,7 +635,7 @@ void EditorNode::_notification(int p_what) { update_spinner_step_frame = frame + 1; // Update the icon itself only when the spinner is visible. - if (EditorSettings::get_singleton()->get("interface/editor/show_update_spinner")) { + if (EDITOR_GET("interface/editor/show_update_spinner")) { update_spinner->set_icon(gui_base->get_theme_icon("Progress" + itos(update_spinner_step + 1), SNAME("EditorIcons"))); } } @@ -700,7 +700,7 @@ void EditorNode::_notification(int p_what) { _initializing_plugins = true; Vector<String> addons; if (ProjectSettings::get_singleton()->has_setting("editor_plugins/enabled")) { - addons = ProjectSettings::get_singleton()->get("editor_plugins/enabled"); + addons = GLOBAL_GET("editor_plugins/enabled"); } for (int i = 0; i < addons.size(); i++) { @@ -847,7 +847,7 @@ void EditorNode::_notification(int p_what) { HashSet<String> updated_textfile_extensions; bool extensions_match = true; - const Vector<String> textfile_ext = ((String)(EditorSettings::get_singleton()->get("docks/filesystem/textfile_extensions"))).split(",", false); + const Vector<String> textfile_ext = ((String)(EDITOR_GET("docks/filesystem/textfile_extensions"))).split(",", false); for (const String &E : textfile_ext) { updated_textfile_extensions.insert(E); if (extensions_match && !textfile_extensions.has(E)) { @@ -866,9 +866,9 @@ void EditorNode::_notification(int p_what) { } void EditorNode::_update_update_spinner() { - update_spinner->set_visible(EditorSettings::get_singleton()->get("interface/editor/show_update_spinner")); + update_spinner->set_visible(EDITOR_GET("interface/editor/show_update_spinner")); - const bool update_continuously = EditorSettings::get_singleton()->get("interface/editor/update_continuously"); + const bool update_continuously = EDITOR_GET("interface/editor/update_continuously"); PopupMenu *update_popup = update_spinner->get_popup(); update_popup->set_item_checked(update_popup->get_item_index(SETTINGS_UPDATE_CONTINUOUSLY), update_continuously); update_popup->set_item_checked(update_popup->get_item_index(SETTINGS_UPDATE_WHEN_CHANGED), !update_continuously); @@ -1273,7 +1273,7 @@ void EditorNode::edit_node(Node *p_node) { void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const String &p_path) { editor_data.apply_changes_in_editors(); int flg = 0; - if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources")) { + if (EDITOR_GET("filesystem/on_save/compress_binary_resources")) { flg |= ResourceSaver::FLAG_COMPRESS; } @@ -1640,7 +1640,7 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) { save.step(TTR("Creating Thumbnail"), 2); save.step(TTR("Creating Thumbnail"), 3); - int preview_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); + int preview_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); preview_size *= EDSCALE; // Consider a square region. @@ -1701,7 +1701,7 @@ int EditorNode::_save_external_resources() { // Save external resources and its subresources if any was modified. int flg = 0; - if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources")) { + if (EDITOR_GET("filesystem/on_save/compress_binary_resources")) { flg |= ResourceSaver::FLAG_COMPRESS; } flg |= ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS; @@ -1807,7 +1807,7 @@ void EditorNode::_save_scene(String p_file, int idx) { } int flg = 0; - if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources")) { + if (EDITOR_GET("filesystem/on_save/compress_binary_resources")) { flg |= ResourceSaver::FLAG_COMPRESS; } flg |= ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS; @@ -2407,7 +2407,7 @@ void EditorNode::_edit_current(bool p_skip_foreign) { if (main_plugin && !skip_main_plugin) { // Special case if use of external editor is true. Resource *current_res = Object::cast_to<Resource>(current_obj); - if (main_plugin->get_name() == "Script" && !current_obj->is_class("VisualScript") && current_res && !current_res->is_built_in() && (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor")) || overrides_external_editor(current_obj))) { + if (main_plugin->get_name() == "Script" && !current_obj->is_class("VisualScript") && current_res && !current_res->is_built_in() && (bool(EDITOR_GET("text_editor/external/use_external_editor")) || overrides_external_editor(current_obj))) { if (!changing_scene) { main_plugin->edit(current_obj); } @@ -3105,7 +3105,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } String EditorNode::adjust_scene_name_casing(const String &root_name) { - switch (ProjectSettings::get_singleton()->get("editor/scene/scene_naming").operator int()) { + switch (GLOBAL_GET("editor/scene/scene_naming").operator int()) { case SCENE_NAME_CASING_AUTO: // Use casing of the root node. break; @@ -3125,7 +3125,7 @@ void EditorNode::_screenshot(bool p_use_utc) { String name = "editor_screenshot_" + Time::get_singleton()->get_datetime_string_from_system(p_use_utc).replace(":", "") + ".png"; NodePath path = String("user://") + name; _save_screenshot(path); - if (EditorSettings::get_singleton()->get("interface/editor/automatically_open_screenshots")) { + if (EDITOR_GET("interface/editor/automatically_open_screenshots")) { OS::get_singleton()->shell_open(String("file://") + ProjectSettings::get_singleton()->globalize_path(path)); } } @@ -3370,7 +3370,7 @@ void EditorNode::editor_select(int p_which) { editor_data.get_editor_plugin(i)->notify_main_screen_changed(editor_plugin_screen->get_name()); } - if (EditorSettings::get_singleton()->get("interface/editor/separate_distraction_mode")) { + if (EDITOR_GET("interface/editor/separate_distraction_mode")) { if (p_which == EDITOR_SCRIPT) { set_distraction_free_mode(script_distraction_free); } else { @@ -5559,7 +5559,7 @@ bool EditorNode::get_docks_visible() const { } void EditorNode::_toggle_distraction_free_mode() { - if (EditorSettings::get_singleton()->get("interface/editor/separate_distraction_mode")) { + if (EDITOR_GET("interface/editor/separate_distraction_mode")) { int screen = -1; for (int i = 0; i < editor_table.size(); i++) { if (editor_plugin_screen == editor_table[i]) { @@ -6168,7 +6168,7 @@ EditorNode::EditorNode() { FileAccess::set_backup_save(EDITOR_GET("filesystem/on_save/safe_save_on_backup_then_rename")); { - int display_scale = EditorSettings::get_singleton()->get("interface/editor/display_scale"); + int display_scale = EDITOR_GET("interface/editor/display_scale"); switch (display_scale) { case 0: @@ -6194,7 +6194,7 @@ EditorNode::EditorNode() { editor_set_scale(2.0); break; default: - editor_set_scale(EditorSettings::get_singleton()->get("interface/editor/custom_display_scale")); + editor_set_scale(EDITOR_GET("interface/editor/custom_display_scale")); break; } } @@ -6202,9 +6202,9 @@ EditorNode::EditorNode() { // Define a minimum window size to prevent UI elements from overlapping or being cut off. DisplayServer::get_singleton()->window_set_min_size(Size2(1024, 600) * EDSCALE); - FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files")); - EditorFileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files")); - EditorFileDialog::set_default_display_mode((EditorFileDialog::DisplayMode)EditorSettings::get_singleton()->get("filesystem/file_dialog/display_mode").operator int()); + FileDialog::set_default_show_hidden_files(EDITOR_GET("filesystem/file_dialog/show_hidden_files")); + EditorFileDialog::set_default_show_hidden_files(EDITOR_GET("filesystem/file_dialog/show_hidden_files")); + EditorFileDialog::set_default_display_mode((EditorFileDialog::DisplayMode)EDITOR_GET("filesystem/file_dialog/display_mode").operator int()); int swap_cancel_ok = EDITOR_GET("interface/editor/accept_dialog_cancel_ok_buttons"); if (swap_cancel_ok != 0) { // 0 is auto, set in register_scene based on DisplayServer. @@ -6373,7 +6373,7 @@ EditorNode::EditorNode() { ED_SHORTCUT("canvas_item_editor/pan_view", TTR("Pan View"), Key::SPACE); - const Vector<String> textfile_ext = ((String)(EditorSettings::get_singleton()->get("docks/filesystem/textfile_extensions"))).split(",", false); + const Vector<String> textfile_ext = ((String)(EDITOR_GET("docks/filesystem/textfile_extensions"))).split(",", false); for (const String &E : textfile_ext) { textfile_extensions.insert(E); } diff --git a/editor/editor_paths.cpp b/editor/editor_paths.cpp index 54d4660cb6..f55c530ffb 100644 --- a/editor/editor_paths.cpp +++ b/editor/editor_paths.cpp @@ -83,7 +83,7 @@ String EditorPaths::get_script_templates_dir() const { } String EditorPaths::get_project_script_templates_dir() const { - return ProjectSettings::get_singleton()->get("editor/script/templates_search_path"); + return GLOBAL_GET("editor/script/templates_search_path"); } String EditorPaths::get_feature_profiles_dir() const { diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 388bf4f4be..84caed9db5 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -1242,7 +1242,7 @@ void EditorPropertyLayers::setup(LayerType p_layer_type) { String name; if (ProjectSettings::get_singleton()->has_setting(basename + vformat("/layer_%d", i + 1))) { - name = ProjectSettings::get_singleton()->get(basename + vformat("/layer_%d", i + 1)); + name = GLOBAL_GET(basename + vformat("/layer_%d", i + 1)); } if (name.is_empty()) { @@ -1270,7 +1270,7 @@ void EditorPropertyLayers::set_layer_name(int p_index, const String &p_name) { String EditorPropertyLayers::get_layer_name(int p_index) const { const String property_name = basename + vformat("/layer_%d", p_index + 1); if (ProjectSettings::get_singleton()->has_setting(property_name)) { - return ProjectSettings::get_singleton()->get(property_name); + return GLOBAL_GET(property_name); } return String(); } diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index dac5753c90..7c1e3e63ef 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -111,7 +111,7 @@ void EditorResourcePicker::_update_resource_preview(const String &p_path, const assign_button->set_custom_minimum_size(assign_button_min_size); } else { preview_rect->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_CENTERED); - int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); + int thumbnail_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); thumbnail_size *= EDSCALE; assign_button->set_custom_minimum_size(Size2(MAX(1, assign_button_min_size.x), MAX(thumbnail_size, assign_button_min_size.y))); } diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 31d1117d7a..083b382521 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -142,7 +142,7 @@ void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref< return; //could not guess type } - int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); + int thumbnail_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); thumbnail_size *= EDSCALE; r_texture = Ref<ImageTexture>(); @@ -226,7 +226,7 @@ void EditorResourcePreview::_iterate() { Ref<ImageTexture> texture; Ref<ImageTexture> small_texture; - int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); + int thumbnail_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); thumbnail_size *= EDSCALE; if (item.resource.is_valid()) { diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp index 99c8481d33..599df12bd3 100644 --- a/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -88,7 +88,7 @@ Error EditorRun::run(const String &p_scene, const String &p_write_movie) { } } - int screen = EditorSettings::get_singleton()->get("run/window_placement/screen"); + int screen = EDITOR_GET("run/window_placement/screen"); if (screen == 0) { // Same as editor screen = DisplayServer::get_singleton()->window_get_current_screen(); @@ -114,21 +114,21 @@ Error EditorRun::run(const String &p_scene, const String &p_write_movie) { screen_rect.position = DisplayServer::get_singleton()->screen_get_position(screen); screen_rect.size = DisplayServer::get_singleton()->screen_get_size(screen); - int window_placement = EditorSettings::get_singleton()->get("run/window_placement/rect"); + int window_placement = EDITOR_GET("run/window_placement/rect"); if (screen_rect != Rect2()) { Size2 window_size; - window_size.x = ProjectSettings::get_singleton()->get("display/window/size/viewport_width"); - window_size.y = ProjectSettings::get_singleton()->get("display/window/size/viewport_height"); + window_size.x = GLOBAL_GET("display/window/size/viewport_width"); + window_size.y = GLOBAL_GET("display/window/size/viewport_height"); Size2 desired_size; - desired_size.x = ProjectSettings::get_singleton()->get("display/window/size/window_width_override"); - desired_size.y = ProjectSettings::get_singleton()->get("display/window/size/window_height_override"); + desired_size.x = GLOBAL_GET("display/window/size/window_width_override"); + desired_size.y = GLOBAL_GET("display/window/size/window_height_override"); if (desired_size.x > 0 && desired_size.y > 0) { window_size = desired_size; } if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_HIDPI)) { - bool hidpi_proj = ProjectSettings::get_singleton()->get("display/window/dpi/allow_hidpi"); + bool hidpi_proj = GLOBAL_GET("display/window/dpi/allow_hidpi"); int display_scale = 1; if (OS::get_singleton()->is_hidpi_allowed()) { @@ -159,7 +159,7 @@ Error EditorRun::run(const String &p_scene, const String &p_write_movie) { args.push_back(itos(pos.x) + "," + itos(pos.y)); } break; case 2: { // custom pos - Vector2 pos = EditorSettings::get_singleton()->get("run/window_placement/rect_custom_position"); + Vector2 pos = EDITOR_GET("run/window_placement/rect_custom_position"); pos += screen_rect.position; args.push_back("--position"); args.push_back(itos(pos.x) + "," + itos(pos.y)); @@ -215,7 +215,7 @@ Error EditorRun::run(const String &p_scene, const String &p_write_movie) { String exec = OS::get_singleton()->get_executable_path(); - const String raw_custom_args = ProjectSettings::get_singleton()->get("editor/run/main_run_args"); + const String raw_custom_args = GLOBAL_GET("editor/run/main_run_args"); if (!raw_custom_args.is_empty()) { // Allow the user to specify a command to run, similar to Steam's launch options. // In this case, Godot will no longer be run directly; it's up to the underlying command diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 6421183e56..409ef95fb0 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -1060,7 +1060,7 @@ Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default, bool p_re Variant ret = p_default; if (EditorSettings::get_singleton()->has_setting(p_setting)) { - ret = EditorSettings::get_singleton()->get(p_setting); + ret = EDITOR_GET(p_setting); } else { EditorSettings::get_singleton()->set_manually(p_setting, p_default); EditorSettings::get_singleton()->set_restart_if_changed(p_setting, p_restart_if_changed); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 225d767163..17b5eb3314 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -1907,7 +1907,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { Ref<Theme> create_custom_theme(const Ref<Theme> p_theme) { Ref<Theme> theme = create_editor_theme(p_theme); - const String custom_theme_path = EditorSettings::get_singleton()->get("interface/theme/custom_theme"); + const String custom_theme_path = EDITOR_GET("interface/theme/custom_theme"); if (!custom_theme_path.is_empty()) { Ref<Theme> custom_theme = ResourceLoader::load(custom_theme_path); if (custom_theme.is_valid()) { diff --git a/editor/export/editor_export.cpp b/editor/export/editor_export.cpp index 29b6a5e546..c2aa27b34d 100644 --- a/editor/export/editor_export.cpp +++ b/editor/export/editor_export.cpp @@ -124,7 +124,7 @@ void EditorExport::add_export_preset(const Ref<EditorExportPreset> &p_preset, in } String EditorExportPlatform::test_etc2() const { - const bool etc2_supported = ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_etc2"); + const bool etc2_supported = GLOBAL_GET("rendering/textures/vram_compression/import_etc2"); if (!etc2_supported) { return TTR("Target platform requires 'ETC2' texture compression. Enable 'Import Etc 2' in Project Settings."); diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index c86114a140..7c5c7da2ef 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -136,16 +136,16 @@ bool EditorExportPlatform::fill_log_messages(RichTextLabel *p_log, Error p_err) } void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags) { - String host = EditorSettings::get_singleton()->get("network/debug/remote_host"); - int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port"); + String host = EDITOR_GET("network/debug/remote_host"); + int remote_port = (int)EDITOR_GET("network/debug/remote_port"); if (p_flags & DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST) { host = "localhost"; } if (p_flags & DEBUG_FLAG_DUMB_CLIENT) { - int port = EditorSettings::get_singleton()->get("filesystem/file_server/port"); - String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password"); + int port = EDITOR_GET("filesystem/file_server/port"); + String passwd = EDITOR_GET("filesystem/file_server/password"); r_flags.push_back("--remote-fs"); r_flags.push_back(host + ":" + itos(port)); if (!passwd.is_empty()) { @@ -813,7 +813,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & continue; } - String autoload_path = ProjectSettings::get_singleton()->get(pi.name); + String autoload_path = GLOBAL_GET(pi.name); if (autoload_path.begins_with("*")) { autoload_path = autoload_path.substr(1); @@ -1241,8 +1241,8 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & } // Store icon and splash images directly, they need to bypass the import system and be loaded as images - String icon = ProjectSettings::get_singleton()->get("application/config/icon"); - String splash = ProjectSettings::get_singleton()->get("application/boot_splash/image"); + String icon = GLOBAL_GET("application/config/icon"); + String splash = GLOBAL_GET("application/boot_splash/image"); if (!icon.is_empty() && FileAccess::exists(icon)) { Vector<uint8_t> array = FileAccess::get_file_as_array(icon); err = p_func(p_udata, icon, array, idx, total, enc_in_filters, enc_ex_filters, key); @@ -1277,7 +1277,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & // Store text server data if it is supported. if (TS->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA)) { - bool use_data = ProjectSettings::get_singleton()->get("internationalization/locale/include_text_server_data"); + bool use_data = GLOBAL_GET("internationalization/locale/include_text_server_data"); if (use_data) { // Try using user provided data file. String ts_data = "res://" + TS->get_support_data_filename(); @@ -1569,16 +1569,16 @@ Error EditorExportPlatform::export_zip(const Ref<EditorExportPreset> &p_preset, } void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags) { - String host = EditorSettings::get_singleton()->get("network/debug/remote_host"); - int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port"); + String host = EDITOR_GET("network/debug/remote_host"); + int remote_port = (int)EDITOR_GET("network/debug/remote_port"); if (p_flags & DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST) { host = "localhost"; } if (p_flags & DEBUG_FLAG_DUMB_CLIENT) { - int port = EditorSettings::get_singleton()->get("filesystem/file_server/port"); - String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password"); + int port = EDITOR_GET("filesystem/file_server/port"); + String passwd = EDITOR_GET("filesystem/file_server/password"); r_flags.push_back("--remote-fs"); r_flags.push_back(host + ":" + itos(port)); if (!passwd.is_empty()) { diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index 9b5e76bcd7..6ff3539708 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -1290,7 +1290,7 @@ ProjectExportDialog::ProjectExportDialog() { // If no default set, use project name if (default_filename.is_empty()) { // If no project name defined, use a sane default - default_filename = ProjectSettings::get_singleton()->get("application/config/name"); + default_filename = GLOBAL_GET("application/config/name"); if (default_filename.is_empty()) { default_filename = "UnnamedProject"; } diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index d37f2aab43..608e7ce3cb 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -106,7 +106,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory // Create all items for the files in the subdirectory. if (display_mode == DISPLAY_MODE_TREE_ONLY) { - String main_scene = ProjectSettings::get_singleton()->get("application/run/main_scene"); + String main_scene = GLOBAL_GET("application/run/main_scene"); // Build the list of the files to display. List<FileInfo> file_list; @@ -383,7 +383,7 @@ void FileSystemDock::_notification(int p_what) { current_path->connect("text_submitted", callable_mp(this, &FileSystemDock::_navigate_to_path).bind(false)); - always_show_folders = bool(EditorSettings::get_singleton()->get("docks/filesystem/always_show_folders")); + always_show_folders = bool(EDITOR_GET("docks/filesystem/always_show_folders")); set_file_list_display_mode(FileSystemDock::FILE_LIST_DISPLAY_LIST); @@ -464,7 +464,7 @@ void FileSystemDock::_notification(int p_what) { file_list_button_sort->set_icon(get_theme_icon(SNAME("Sort"), SNAME("EditorIcons"))); // Update always show folders. - bool new_always_show_folders = bool(EditorSettings::get_singleton()->get("docks/filesystem/always_show_folders")); + bool new_always_show_folders = bool(EDITOR_GET("docks/filesystem/always_show_folders")); if (new_always_show_folders != always_show_folders) { always_show_folders = new_always_show_folders; _update_file_list(true); @@ -743,7 +743,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { String directory = path; String file = ""; - int thumbnail_size = EditorSettings::get_singleton()->get("docks/filesystem/thumbnail_size"); + int thumbnail_size = EDITOR_GET("docks/filesystem/thumbnail_size"); thumbnail_size *= EDSCALE; Ref<Texture2D> folder_thumbnail; Ref<Texture2D> file_thumbnail; @@ -893,7 +893,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { _sort_file_info_list(file_list); // Fills the ItemList control node from the FileInfos. - String main_scene = ProjectSettings::get_singleton()->get("application/run/main_scene"); + String main_scene = GLOBAL_GET("application/run/main_scene"); for (FileInfo &E : file_list) { FileInfo *finfo = &(E); String fname = finfo->name; @@ -2500,7 +2500,7 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str if (filenames.size() == 1) { p_popup->add_icon_item(get_theme_icon(SNAME("Load"), SNAME("EditorIcons")), TTR("Open Scene"), FILE_OPEN); p_popup->add_icon_item(get_theme_icon(SNAME("CreateNewSceneFrom"), SNAME("EditorIcons")), TTR("New Inherited Scene"), FILE_INHERIT); - if (ProjectSettings::get_singleton()->get("application/run/main_scene") != filenames[0]) { + if (GLOBAL_GET("application/run/main_scene") != filenames[0]) { p_popup->add_icon_item(get_theme_icon(SNAME("PlayScene"), SNAME("EditorIcons")), TTR("Set As Main Scene"), FILE_MAIN_SCENE); } } else { diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index fd110cea4f..a2bd1223a9 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -466,7 +466,7 @@ void FindInFilesDialog::_notification(int p_what) { for (int i = 0; i < _filters_container->get_child_count(); i++) { _filters_container->get_child(i)->queue_free(); } - Array exts = ProjectSettings::get_singleton()->get("editor/script/search_in_file_extensions"); + Array exts = GLOBAL_GET("editor/script/search_in_file_extensions"); for (int i = 0; i < exts.size(); ++i) { CheckBox *cb = memnew(CheckBox); cb->set_text(exts[i]); diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp index 2acb3a6b4e..ab15aa4fdc 100644 --- a/editor/import/resource_importer_layered_texture.cpp +++ b/editor/import/resource_importer_layered_texture.cpp @@ -418,7 +418,7 @@ String ResourceImporterLayeredTexture::get_import_settings_string() const { int index = 0; while (compression_formats[index]) { String setting_path = "rendering/textures/vram_compression/import_" + String(compression_formats[index]); - bool test = ProjectSettings::get_singleton()->get(setting_path); + bool test = GLOBAL_GET(setting_path); if (test) { s += String(compression_formats[index]); } @@ -450,7 +450,7 @@ bool ResourceImporterLayeredTexture::are_import_settings_valid(const String &p_p bool valid = true; while (compression_formats[index]) { String setting_path = "rendering/textures/vram_compression/import_" + String(compression_formats[index]); - bool test = ProjectSettings::get_singleton()->get(setting_path); + bool test = GLOBAL_GET(setting_path); if (test) { if (!formats_imported.has(compression_formats[index])) { valid = false; @@ -484,7 +484,7 @@ void ResourceImporterLayeredTexture::_check_compress_ctex(const String &p_source // Must import in all formats, in order of priority (so platform choses the best supported one. IE, etc2 over etc). // Android, GLES 2.x - bool can_bptc = ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_bptc"); + bool can_bptc = GLOBAL_GET("rendering/textures/vram_compression/import_bptc"); if (can_bptc) { r_texture_import->formats_imported.push_back("bptc"); // BPTC needs to be added anyway. } @@ -492,7 +492,7 @@ void ResourceImporterLayeredTexture::_check_compress_ctex(const String &p_source ERR_FAIL_NULL(r_texture_import->image); bool is_hdr = (r_texture_import->image->get_format() >= Image::FORMAT_RF && r_texture_import->image->get_format() <= Image::FORMAT_RGBE9995); bool is_ldr = (r_texture_import->image->get_format() >= Image::FORMAT_L8 && r_texture_import->image->get_format() <= Image::FORMAT_RGB565); - bool can_s3tc = ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_s3tc"); + bool can_s3tc = GLOBAL_GET("rendering/textures/vram_compression/import_s3tc"); ERR_FAIL_NULL(r_texture_import->slices); // Can compress hdr, but hdr with alpha is not compressible. if (r_texture_import->hdr_compression == 2) { @@ -530,7 +530,7 @@ void ResourceImporterLayeredTexture::_check_compress_ctex(const String &p_source } } if (!(r_texture_import->used_channels == Image::USED_CHANNELS_LA || r_texture_import->used_channels == Image::USED_CHANNELS_RGBA)) { - if (ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_etc2")) { + if (GLOBAL_GET("rendering/textures/vram_compression/import_etc2")) { _save_tex(*r_texture_import->slices, r_texture_import->save_path + ".etc2." + extension, r_texture_import->compress_mode, r_texture_import->lossy, Image::COMPRESS_ETC2, *r_texture_import->csource, r_texture_import->used_channels, r_texture_import->mipmaps, true); r_texture_import->platform_variants->push_back("etc2"); r_texture_import->formats_imported.push_back("etc2"); diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index ed3f1ff489..54ad840f3d 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -192,7 +192,7 @@ bool ResourceImporterTexture::get_option_visibility(const String &p_path, const if (compress_mode < COMPRESS_VRAM_COMPRESSED) { return false; } - if (!ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_bptc")) { + if (!GLOBAL_GET("rendering/textures/vram_compression/import_bptc")) { return false; } } @@ -246,7 +246,7 @@ void ResourceImporterTexture::get_import_options(const String &p_path, List<Impo void ResourceImporterTexture::save_to_ctex_format(Ref<FileAccess> f, const Ref<Image> &p_image, CompressMode p_compress_mode, Image::UsedChannels p_channels, Image::CompressMode p_compress_format, float p_lossy_quality) { switch (p_compress_mode) { case COMPRESS_LOSSLESS: { - bool lossless_force_png = ProjectSettings::get_singleton()->get("rendering/textures/lossless_compression/force_png") || + bool lossless_force_png = GLOBAL_GET("rendering/textures/lossless_compression/force_png") || !Image::_webp_mem_loader_func; // WebP module disabled. bool use_webp = !lossless_force_png && p_image->get_width() <= 16383 && p_image->get_height() <= 16383; // WebP has a size limit f->store_32(use_webp ? CompressedTexture2D::DATA_FORMAT_WEBP : CompressedTexture2D::DATA_FORMAT_PNG); @@ -599,8 +599,8 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String const bool is_hdr = (image->get_format() >= Image::FORMAT_RF && image->get_format() <= Image::FORMAT_RGBE9995); bool is_ldr = (image->get_format() >= Image::FORMAT_L8 && image->get_format() <= Image::FORMAT_RGB565); - const bool can_bptc = ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_bptc"); - const bool can_s3tc = ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_s3tc"); + const bool can_bptc = GLOBAL_GET("rendering/textures/vram_compression/import_bptc"); + const bool can_s3tc = GLOBAL_GET("rendering/textures/vram_compression/import_s3tc"); if (can_bptc) { // Add to the list anyway. @@ -645,13 +645,13 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String formats_imported.push_back("s3tc"); } - if (ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_etc2")) { + if (GLOBAL_GET("rendering/textures/vram_compression/import_etc2")) { _save_ctex(image, p_save_path + ".etc2.ctex", compress_mode, lossy, Image::COMPRESS_ETC2, mipmaps, stream, detect_3d, detect_roughness, detect_normal, force_normal, srgb_friendly_pack, true, mipmap_limit, normal_image, roughness_channel); r_platform_variants->push_back("etc2"); formats_imported.push_back("etc2"); } - if (ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_etc")) { + if (GLOBAL_GET("rendering/textures/vram_compression/import_etc")) { _save_ctex(image, p_save_path + ".etc.ctex", compress_mode, lossy, Image::COMPRESS_ETC, mipmaps, stream, detect_3d, detect_roughness, detect_normal, force_normal, srgb_friendly_pack, true, mipmap_limit, normal_image, roughness_channel); r_platform_variants->push_back("etc"); formats_imported.push_back("etc"); @@ -704,7 +704,7 @@ String ResourceImporterTexture::get_import_settings_string() const { int index = 0; while (compression_formats[index]) { String setting_path = "rendering/textures/vram_compression/import_" + String(compression_formats[index]); - bool test = ProjectSettings::get_singleton()->get(setting_path); + bool test = GLOBAL_GET(setting_path); if (test) { s += String(compression_formats[index]); } @@ -745,7 +745,7 @@ bool ResourceImporterTexture::are_import_settings_valid(const String &p_path) co bool valid = true; while (compression_formats[index]) { String setting_path = "rendering/textures/vram_compression/import_" + String(compression_formats[index]); - bool test = ProjectSettings::get_singleton()->get(setting_path); + bool test = GLOBAL_GET(setting_path); if (test) { if (!formats_imported.has(compression_formats[index])) { valid = false; diff --git a/editor/import_defaults_editor.cpp b/editor/import_defaults_editor.cpp index a70f5225e9..a801a678fc 100644 --- a/editor/import_defaults_editor.cpp +++ b/editor/import_defaults_editor.cpp @@ -140,7 +140,7 @@ void ImportDefaultsEditor::_update_importer() { importer->get_import_options("", &options); Dictionary d; if (ProjectSettings::get_singleton()->has_setting("importer_defaults/" + importer->get_importer_name())) { - d = ProjectSettings::get_singleton()->get("importer_defaults/" + importer->get_importer_name()); + d = GLOBAL_GET("importer_defaults/" + importer->get_importer_name()); } for (const ResourceImporter::ImportOption &E : options) { diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index 4732268256..e6ba19172f 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -384,7 +384,7 @@ void ImportDock::_preset_selected(int p_idx) { case ITEM_LOAD_DEFAULT: { ERR_FAIL_COND(!ProjectSettings::get_singleton()->has_setting("importer_defaults/" + params->importer->get_importer_name())); - Dictionary d = ProjectSettings::get_singleton()->get("importer_defaults/" + params->importer->get_importer_name()); + Dictionary d = GLOBAL_GET("importer_defaults/" + params->importer->get_importer_name()); List<Variant> v; d.get_key_list(&v); diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index d8b75db30f..27b261f320 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -227,7 +227,7 @@ void InspectorDock::_load_resource(const String &p_type) { load_resource_dialog->add_filter("*." + extensions[i], extensions[i].to_upper()); } - const Vector<String> textfile_ext = ((String)(EditorSettings::get_singleton()->get("docks/filesystem/textfile_extensions"))).split(",", false); + const Vector<String> textfile_ext = ((String)(EDITOR_GET("docks/filesystem/textfile_extensions"))).split(",", false); for (int i = 0; i < textfile_ext.size(); i++) { load_resource_dialog->add_filter("*." + textfile_ext[i], textfile_ext[i].to_upper()); } @@ -240,7 +240,7 @@ void InspectorDock::_resource_file_selected(String p_file) { if (ResourceLoader::exists(p_file, "")) { res = ResourceLoader::load(p_file); } else { - const Vector<String> textfile_ext = ((String)(EditorSettings::get_singleton()->get("docks/filesystem/textfile_extensions"))).split(",", false); + const Vector<String> textfile_ext = ((String)(EDITOR_GET("docks/filesystem/textfile_extensions"))).split(",", false); if (textfile_ext.has(p_file.get_extension())) { res = ScriptEditor::get_singleton()->open_file(p_file); } diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp index 683481ecc1..7727ff31e4 100644 --- a/editor/localization_editor.cpp +++ b/editor/localization_editor.cpp @@ -73,7 +73,7 @@ void LocalizationEditor::add_translation(const String &p_translation) { } void LocalizationEditor::_translation_add(const PackedStringArray &p_paths) { - PackedStringArray translations = ProjectSettings::get_singleton()->get("internationalization/locale/translations"); + PackedStringArray translations = GLOBAL_GET("internationalization/locale/translations"); for (int i = 0; i < p_paths.size(); i++) { if (!translations.has(p_paths[i])) { // Don't add duplicate translation paths. @@ -83,7 +83,7 @@ void LocalizationEditor::_translation_add(const PackedStringArray &p_paths) { undo_redo->create_action(vformat(TTR("Add %d Translations"), p_paths.size())); undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translations", translations); - undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translations", ProjectSettings::get_singleton()->get("internationalization/locale/translations")); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translations", GLOBAL_GET("internationalization/locale/translations")); undo_redo->add_do_method(this, "update_translations"); undo_redo->add_undo_method(this, "update_translations"); undo_redo->add_do_method(this, "emit_signal", localization_changed); @@ -105,7 +105,7 @@ void LocalizationEditor::_translation_delete(Object *p_item, int p_column, int p int idx = ti->get_metadata(0); - PackedStringArray translations = ProjectSettings::get_singleton()->get("internationalization/locale/translations"); + PackedStringArray translations = GLOBAL_GET("internationalization/locale/translations"); ERR_FAIL_INDEX(idx, translations.size()); @@ -113,7 +113,7 @@ void LocalizationEditor::_translation_delete(Object *p_item, int p_column, int p undo_redo->create_action(TTR("Remove Translation")); undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translations", translations); - undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translations", ProjectSettings::get_singleton()->get("internationalization/locale/translations")); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translations", GLOBAL_GET("internationalization/locale/translations")); undo_redo->add_do_method(this, "update_translations"); undo_redo->add_undo_method(this, "update_translations"); undo_redo->add_do_method(this, "emit_signal", localization_changed); @@ -130,7 +130,7 @@ void LocalizationEditor::_translation_res_add(const PackedStringArray &p_paths) Dictionary remaps; if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/translation_remaps")) { - remaps = ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps"); + remaps = GLOBAL_GET("internationalization/locale/translation_remaps"); prev = remaps; } @@ -158,7 +158,7 @@ void LocalizationEditor::_translation_res_option_file_open() { void LocalizationEditor::_translation_res_option_add(const PackedStringArray &p_paths) { ERR_FAIL_COND(!ProjectSettings::get_singleton()->has_setting("internationalization/locale/translation_remaps")); - Dictionary remaps = ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps"); + Dictionary remaps = GLOBAL_GET("internationalization/locale/translation_remaps"); TreeItem *k = translation_remap->get_selected(); ERR_FAIL_COND(!k); @@ -174,7 +174,7 @@ void LocalizationEditor::_translation_res_option_add(const PackedStringArray &p_ undo_redo->create_action(vformat(TTR("Translation Resource Remap: Add %d Remap(s)"), p_paths.size())); undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translation_remaps", remaps); - undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translation_remaps", ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps")); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translation_remaps", GLOBAL_GET("internationalization/locale/translation_remaps")); undo_redo->add_do_method(this, "update_translations"); undo_redo->add_undo_method(this, "update_translations"); undo_redo->add_do_method(this, "emit_signal", localization_changed); @@ -216,7 +216,7 @@ void LocalizationEditor::_translation_res_option_changed() { return; } - Dictionary remaps = ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps"); + Dictionary remaps = GLOBAL_GET("internationalization/locale/translation_remaps"); TreeItem *k = translation_remap->get_selected(); ERR_FAIL_COND(!k); @@ -236,7 +236,7 @@ void LocalizationEditor::_translation_res_option_changed() { updating_translations = true; undo_redo->create_action(TTR("Change Resource Remap Language")); undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translation_remaps", remaps); - undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translation_remaps", ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps")); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translation_remaps", GLOBAL_GET("internationalization/locale/translation_remaps")); undo_redo->add_do_method(this, "update_translations"); undo_redo->add_undo_method(this, "update_translations"); undo_redo->add_do_method(this, "emit_signal", localization_changed); @@ -258,7 +258,7 @@ void LocalizationEditor::_translation_res_delete(Object *p_item, int p_column, i return; } - Dictionary remaps = ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps"); + Dictionary remaps = GLOBAL_GET("internationalization/locale/translation_remaps"); TreeItem *k = Object::cast_to<TreeItem>(p_item); @@ -269,7 +269,7 @@ void LocalizationEditor::_translation_res_delete(Object *p_item, int p_column, i undo_redo->create_action(TTR("Remove Resource Remap")); undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translation_remaps", remaps); - undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translation_remaps", ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps")); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translation_remaps", GLOBAL_GET("internationalization/locale/translation_remaps")); undo_redo->add_do_method(this, "update_translations"); undo_redo->add_undo_method(this, "update_translations"); undo_redo->add_do_method(this, "emit_signal", localization_changed); @@ -290,7 +290,7 @@ void LocalizationEditor::_translation_res_option_delete(Object *p_item, int p_co return; } - Dictionary remaps = ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps"); + Dictionary remaps = GLOBAL_GET("internationalization/locale/translation_remaps"); TreeItem *k = translation_remap->get_selected(); ERR_FAIL_COND(!k); @@ -308,7 +308,7 @@ void LocalizationEditor::_translation_res_option_delete(Object *p_item, int p_co undo_redo->create_action(TTR("Remove Resource Remap Option")); undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translation_remaps", remaps); - undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translation_remaps", ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps")); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translation_remaps", GLOBAL_GET("internationalization/locale/translation_remaps")); undo_redo->add_do_method(this, "update_translations"); undo_redo->add_undo_method(this, "update_translations"); undo_redo->add_do_method(this, "emit_signal", localization_changed); @@ -317,7 +317,7 @@ void LocalizationEditor::_translation_res_option_delete(Object *p_item, int p_co } void LocalizationEditor::_pot_add(const PackedStringArray &p_paths) { - PackedStringArray pot_translations = ProjectSettings::get_singleton()->get("internationalization/locale/translations_pot_files"); + PackedStringArray pot_translations = GLOBAL_GET("internationalization/locale/translations_pot_files"); for (int i = 0; i < p_paths.size(); i++) { if (!pot_translations.has(p_paths[i])) { pot_translations.push_back(p_paths[i]); @@ -326,7 +326,7 @@ void LocalizationEditor::_pot_add(const PackedStringArray &p_paths) { undo_redo->create_action(vformat(TTR("Add %d file(s) for POT generation"), p_paths.size())); undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translations_pot_files", pot_translations); - undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translations_pot_files", ProjectSettings::get_singleton()->get("internationalization/locale/translations_pot_files")); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translations_pot_files", GLOBAL_GET("internationalization/locale/translations_pot_files")); undo_redo->add_do_method(this, "update_translations"); undo_redo->add_undo_method(this, "update_translations"); undo_redo->add_do_method(this, "emit_signal", localization_changed); @@ -344,7 +344,7 @@ void LocalizationEditor::_pot_delete(Object *p_item, int p_column, int p_button, int idx = ti->get_metadata(0); - PackedStringArray pot_translations = ProjectSettings::get_singleton()->get("internationalization/locale/translations_pot_files"); + PackedStringArray pot_translations = GLOBAL_GET("internationalization/locale/translations_pot_files"); ERR_FAIL_INDEX(idx, pot_translations.size()); @@ -352,7 +352,7 @@ void LocalizationEditor::_pot_delete(Object *p_item, int p_column, int p_button, undo_redo->create_action(TTR("Remove file from POT generation")); undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translations_pot_files", pot_translations); - undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translations_pot_files", ProjectSettings::get_singleton()->get("internationalization/locale/translations_pot_files")); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), "internationalization/locale/translations_pot_files", GLOBAL_GET("internationalization/locale/translations_pot_files")); undo_redo->add_do_method(this, "update_translations"); undo_redo->add_undo_method(this, "update_translations"); undo_redo->add_do_method(this, "emit_signal", localization_changed); @@ -392,7 +392,7 @@ void LocalizationEditor::_filesystem_files_moved(const String &p_old_file, const bool remaps_changed = false; if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/translation_remaps")) { - remaps = ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps"); + remaps = GLOBAL_GET("internationalization/locale/translation_remaps"); } // Check for the keys. @@ -442,7 +442,7 @@ void LocalizationEditor::_filesystem_file_removed(const String &p_file) { Dictionary remaps; if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/translation_remaps")) { - remaps = ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps"); + remaps = GLOBAL_GET("internationalization/locale/translation_remaps"); } bool remaps_changed = remaps.has(p_file); @@ -481,7 +481,7 @@ void LocalizationEditor::update_translations() { TreeItem *root = translation_list->create_item(nullptr); translation_list->set_hide_root(true); if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/translations")) { - PackedStringArray translations = ProjectSettings::get_singleton()->get("internationalization/locale/translations"); + PackedStringArray translations = GLOBAL_GET("internationalization/locale/translations"); for (int i = 0; i < translations.size(); i++) { TreeItem *t = translation_list->create_item(root); t->set_editable(0, false); @@ -507,7 +507,7 @@ void LocalizationEditor::update_translations() { translation_res_option_add_button->set_disabled(true); if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/translation_remaps")) { - Dictionary remaps = ProjectSettings::get_singleton()->get("internationalization/locale/translation_remaps"); + Dictionary remaps = GLOBAL_GET("internationalization/locale/translation_remaps"); List<Variant> rk; remaps.get_key_list(&rk); Vector<String> keys; @@ -568,7 +568,7 @@ void LocalizationEditor::update_translations() { root = translation_pot_list->create_item(nullptr); translation_pot_list->set_hide_root(true); if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/translations_pot_files")) { - PackedStringArray pot_translations = ProjectSettings::get_singleton()->get("internationalization/locale/translations_pot_files"); + PackedStringArray pot_translations = GLOBAL_GET("internationalization/locale/translations_pot_files"); for (int i = 0; i < pot_translations.size(); i++) { TreeItem *t = translation_pot_list->create_item(root); t->set_editable(0, false); diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index 067730a87a..60a7627887 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -273,9 +273,9 @@ void AnimationNodeBlendTreeEditor::update_graph() { graph->connect_node(from, 0, to, to_idx); } - float graph_minimap_opacity = EditorSettings::get_singleton()->get("editors/visual_editors/minimap_opacity"); + float graph_minimap_opacity = EDITOR_GET("editors/visual_editors/minimap_opacity"); graph->set_minimap_opacity(graph_minimap_opacity); - float graph_lines_curvature = EditorSettings::get_singleton()->get("editors/visual_editors/lines_curvature"); + float graph_lines_curvature = EDITOR_GET("editors/visual_editors/lines_curvature"); graph->set_connection_lines_curvature(graph_lines_curvature); } @@ -795,8 +795,8 @@ void AnimationNodeBlendTreeEditor::_removed_from_graph() { } void AnimationNodeBlendTreeEditor::_update_editor_settings() { - graph->get_panner()->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); - graph->set_warped_panning(bool(EditorSettings::get_singleton()->get("editors/panning/warped_mouse_panning"))); + graph->get_panner()->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); + graph->set_warped_panning(bool(EDITOR_GET("editors/panning/warped_mouse_panning"))); } void AnimationNodeBlendTreeEditor::_update_theme() { @@ -1048,9 +1048,9 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() { graph->connect("popup_request", callable_mp(this, &AnimationNodeBlendTreeEditor::_popup_request)); graph->connect("connection_to_empty", callable_mp(this, &AnimationNodeBlendTreeEditor::_connection_to_empty)); graph->connect("connection_from_empty", callable_mp(this, &AnimationNodeBlendTreeEditor::_connection_from_empty)); - float graph_minimap_opacity = EditorSettings::get_singleton()->get("editors/visual_editors/minimap_opacity"); + float graph_minimap_opacity = EDITOR_GET("editors/visual_editors/minimap_opacity"); graph->set_minimap_opacity(graph_minimap_opacity); - float graph_lines_curvature = EditorSettings::get_singleton()->get("editors/visual_editors/lines_curvature"); + float graph_lines_curvature = EDITOR_GET("editors/visual_editors/lines_curvature"); graph->set_connection_lines_curvature(graph_lines_curvature); VSeparator *vs = memnew(VSeparator); diff --git a/editor/plugins/bone_map_editor_plugin.cpp b/editor/plugins/bone_map_editor_plugin.cpp index 60e8f5b44b..c834e0e93e 100644 --- a/editor/plugins/bone_map_editor_plugin.cpp +++ b/editor/plugins/bone_map_editor_plugin.cpp @@ -63,16 +63,16 @@ StringName BoneMapperButton::get_profile_bone_name() const { void BoneMapperButton::set_state(BoneMapState p_state) { switch (p_state) { case BONE_MAP_STATE_UNSET: { - circle->set_modulate(EditorSettings::get_singleton()->get("editors/bone_mapper/handle_colors/unset")); + circle->set_modulate(EDITOR_GET("editors/bone_mapper/handle_colors/unset")); } break; case BONE_MAP_STATE_SET: { - circle->set_modulate(EditorSettings::get_singleton()->get("editors/bone_mapper/handle_colors/set")); + circle->set_modulate(EDITOR_GET("editors/bone_mapper/handle_colors/set")); } break; case BONE_MAP_STATE_MISSING: { - circle->set_modulate(EditorSettings::get_singleton()->get("editors/bone_mapper/handle_colors/missing")); + circle->set_modulate(EDITOR_GET("editors/bone_mapper/handle_colors/missing")); } break; case BONE_MAP_STATE_ERROR: { - circle->set_modulate(EditorSettings::get_singleton()->get("editors/bone_mapper/handle_colors/error")); + circle->set_modulate(EDITOR_GET("editors/bone_mapper/handle_colors/error")); } break; default: { } break; diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 9cbdd35c93..291b939fe9 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2542,7 +2542,7 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { Ref<InputEventMouseButton> mb = p_event; bool release_lmb = (mb.is_valid() && !mb->is_pressed() && mb->get_button_index() == MouseButton::LEFT); // Required to properly release some stuff (e.g. selection box) while panning. - if (EditorSettings::get_singleton()->get("editors/panning/simple_panning") || !pan_pressed || release_lmb) { + if (EDITOR_GET("editors/panning/simple_panning") || !pan_pressed || release_lmb) { accepted = true; if (_gui_input_rulers_and_guides(p_event)) { // print_line("Rulers and guides"); @@ -2730,7 +2730,7 @@ void CanvasItemEditor::_draw_focus() { } void CanvasItemEditor::_draw_guides() { - Color guide_color = EditorSettings::get_singleton()->get("editors/2d/guides_color"); + Color guide_color = EDITOR_GET("editors/2d/guides_color"); Transform2D xform = viewport_scrollable->get_transform() * transform; // Guides already there. @@ -2779,7 +2779,7 @@ void CanvasItemEditor::_draw_guides() { } void CanvasItemEditor::_draw_smart_snapping() { - Color line_color = EditorSettings::get_singleton()->get("editors/2d/smart_snapping_line_color"); + Color line_color = EDITOR_GET("editors/2d/smart_snapping_line_color"); if (snap_target[0] != SNAP_TARGET_NONE && snap_target[0] != SNAP_TARGET_GRID) { viewport->draw_set_transform_matrix(viewport->get_transform() * transform * snap_transform); viewport->draw_line(Point2(0, -1.0e+10F), Point2(0, 1.0e+10F), line_color); @@ -2897,7 +2897,7 @@ void CanvasItemEditor::_draw_grid() { // Draw a "primary" line every several lines to make measurements easier. // The step is configurable in the Configure Snap dialog. - const Color secondary_grid_color = EditorSettings::get_singleton()->get("editors/2d/grid_color"); + const Color secondary_grid_color = EDITOR_GET("editors/2d/grid_color"); const Color primary_grid_color = Color(secondary_grid_color.r, secondary_grid_color.g, secondary_grid_color.b, secondary_grid_color.a * 2.5); @@ -3573,9 +3573,9 @@ void CanvasItemEditor::_draw_axis() { if (show_viewport) { RID ci = viewport->get_canvas_item(); - Color area_axis_color = EditorSettings::get_singleton()->get("editors/2d/viewport_border_color"); + Color area_axis_color = EDITOR_GET("editors/2d/viewport_border_color"); - Size2 screen_size = Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height")); + Size2 screen_size = Size2(GLOBAL_GET("display/window/size/viewport_width"), GLOBAL_GET("display/window/size/viewport_height")); Vector2 screen_endpoints[4] = { transform.xform(Vector2(0, 0)), @@ -3879,9 +3879,9 @@ void CanvasItemEditor::_update_editor_settings() { context_menu_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("ContextualToolbar"), SNAME("EditorStyles"))); - panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/2d_editor_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); - pan_speed = int(EditorSettings::get_singleton()->get("editors/panning/2d_editor_pan_speed")); - warped_panning = bool(EditorSettings::get_singleton()->get("editors/panning/warped_mouse_panning")); + panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/2d_editor_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); + pan_speed = int(EDITOR_GET("editors/panning/2d_editor_pan_speed")); + warped_panning = bool(EDITOR_GET("editors/panning/warped_mouse_panning")); } void CanvasItemEditor::_notification(int p_what) { @@ -4027,7 +4027,7 @@ void CanvasItemEditor::_update_scrollbars() { Size2 vmin = v_scroll->get_minimum_size(); // Get the visible frame. - Size2 screen_rect = Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height")); + Size2 screen_rect = Size2(GLOBAL_GET("display/window/size/viewport_width"), GLOBAL_GET("display/window/size/viewport_height")); Rect2 local_rect = Rect2(Point2(), viewport->get_size() - Size2(vmin.width, hmin.height)); // Calculate scrollable area. @@ -4044,7 +4044,7 @@ void CanvasItemEditor::_update_scrollbars() { Size2 size = viewport->get_size(); Point2 begin = canvas_item_rect.position; Point2 end = canvas_item_rect.position + canvas_item_rect.size - local_rect.size / zoom; - bool constrain_editor_view = bool(EditorSettings::get_singleton()->get("editors/2d/constrain_editor_view")); + bool constrain_editor_view = bool(EDITOR_GET("editors/2d/constrain_editor_view")); if (canvas_item_rect.size.height <= (local_rect.size.y / zoom)) { real_t centered = -(size.y / 2) / zoom + screen_rect.y / 2; diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 434e6a92e3..4aee9b879e 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -799,7 +799,7 @@ Ref<Texture2D> CurvePreviewGenerator::generate(const Ref<Resource> &p_from, cons Curve &curve = **curve_ref; // FIXME: Should be ported to use p_size as done in b2633a97 - int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); + int thumbnail_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); thumbnail_size *= EDSCALE; Ref<Image> img_ref; img_ref.instantiate(); diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 836f76ac4f..997dc0b2b5 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -484,12 +484,12 @@ Ref<Texture2D> EditorScriptPreviewPlugin::generate(const Ref<Resource> &p_from, int thumbnail_size = MAX(p_size.x, p_size.y); Ref<Image> img = Image::create_empty(thumbnail_size, thumbnail_size, false, Image::FORMAT_RGBA8); - Color bg_color = EditorSettings::get_singleton()->get("text_editor/theme/highlighting/background_color"); - Color keyword_color = EditorSettings::get_singleton()->get("text_editor/theme/highlighting/keyword_color"); - Color control_flow_keyword_color = EditorSettings::get_singleton()->get("text_editor/theme/highlighting/control_flow_keyword_color"); - Color text_color = EditorSettings::get_singleton()->get("text_editor/theme/highlighting/text_color"); - Color symbol_color = EditorSettings::get_singleton()->get("text_editor/theme/highlighting/symbol_color"); - Color comment_color = EditorSettings::get_singleton()->get("text_editor/theme/highlighting/comment_color"); + Color bg_color = EDITOR_GET("text_editor/theme/highlighting/background_color"); + Color keyword_color = EDITOR_GET("text_editor/theme/highlighting/keyword_color"); + Color control_flow_keyword_color = EDITOR_GET("text_editor/theme/highlighting/control_flow_keyword_color"); + Color text_color = EDITOR_GET("text_editor/theme/highlighting/text_color"); + Color symbol_color = EDITOR_GET("text_editor/theme/highlighting/symbol_color"); + Color comment_color = EDITOR_GET("text_editor/theme/highlighting/comment_color"); if (bg_color.a == 0) { bg_color = Color(0, 0, 0, 0); diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index 420ebe5942..6654b03a0d 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -191,7 +191,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, } } - Vector<Ref<Texture2D>> textures = EditorInterface::get_singleton()->make_mesh_previews(meshes, &transforms, EditorSettings::get_singleton()->get("editors/grid_map/preview_size")); + Vector<Ref<Texture2D>> textures = EditorInterface::get_singleton()->make_mesh_previews(meshes, &transforms, EDITOR_GET("editors/grid_map/preview_size")); int j = 0; for (int i = 0; i < ids.size(); i++) { if (mesh_instances.find(ids[i])) { diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 2258646bce..675f27f1f6 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -939,7 +939,7 @@ void Node3DEditorViewport::_compute_edit(const Point2 &p_point) { } static Key _get_key_modifier_setting(const String &p_property) { - switch (EditorSettings::get_singleton()->get(p_property).operator int()) { + switch (EDITOR_GET(p_property).operator int()) { case 0: return Key::NONE; case 1: @@ -1401,7 +1401,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { } } break; case MouseButton::RIGHT: { - NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation/navigation_scheme").operator int(); + NavigationScheme nav_scheme = (NavigationScheme)EDITOR_GET("editors/3d/navigation/navigation_scheme").operator int(); if (b->is_pressed() && _edit.gizmo.is_valid()) { //restore @@ -1481,7 +1481,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { commit_transform(); break; // just commit the edit, stop processing the event so we don't deselect the object } - NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation/navigation_scheme").operator int(); + NavigationScheme nav_scheme = (NavigationScheme)EDITOR_GET("editors/3d/navigation/navigation_scheme").operator int(); if ((nav_scheme == NAVIGATION_MAYA || nav_scheme == NAVIGATION_MODO) && b->is_alt_pressed()) { break; } @@ -1709,7 +1709,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { _transform_gizmo_select(_edit.mouse_pos, true); } - NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation/navigation_scheme").operator int(); + NavigationScheme nav_scheme = (NavigationScheme)EDITOR_GET("editors/3d/navigation/navigation_scheme").operator int(); NavigationMode nav_mode = NAVIGATION_NONE; if (_edit.gizmo.is_valid()) { @@ -1782,7 +1782,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { nav_mode = NAVIGATION_PAN; } } - } else if (EditorSettings::get_singleton()->get("editors/3d/navigation/emulate_3_button_mouse")) { + } else if (EDITOR_GET("editors/3d/navigation/emulate_3_button_mouse")) { // Handle trackpad (no external mouse) use case const Key mod = _get_key_modifier(m); @@ -1835,7 +1835,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { Ref<InputEventPanGesture> pan_gesture = p_event; if (pan_gesture.is_valid()) { - NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation/navigation_scheme").operator int(); + NavigationScheme nav_scheme = (NavigationScheme)EDITOR_GET("editors/3d/navigation/navigation_scheme").operator int(); NavigationMode nav_mode = NAVIGATION_NONE; if (nav_scheme == NAVIGATION_GODOT) { @@ -1889,7 +1889,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { return; } - if (EditorSettings::get_singleton()->get("editors/3d/navigation/emulate_numpad")) { + if (EDITOR_GET("editors/3d/navigation/emulate_numpad")) { const Key code = k->get_physical_keycode(); if (code >= Key::KEY_0 && code <= Key::KEY_9) { k->set_keycode(code - Key::KEY_0 + Key::KP_0); @@ -2086,7 +2086,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { } void Node3DEditorViewport::_nav_pan(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) { - const NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation/navigation_scheme").operator int(); + const NavigationScheme nav_scheme = (NavigationScheme)EDITOR_GET("editors/3d/navigation/navigation_scheme").operator int(); real_t pan_speed = 1 / 150.0; if (nav_scheme == NAVIGATION_MAYA && p_event->is_shift_pressed()) { @@ -2098,8 +2098,8 @@ void Node3DEditorViewport::_nav_pan(Ref<InputEventWithModifiers> p_event, const camera_transform.translate_local(cursor.pos); camera_transform.basis.rotate(Vector3(1, 0, 0), -cursor.x_rot); camera_transform.basis.rotate(Vector3(0, 1, 0), -cursor.y_rot); - const bool invert_x_axis = EditorSettings::get_singleton()->get("editors/3d/navigation/invert_x_axis"); - const bool invert_y_axis = EditorSettings::get_singleton()->get("editors/3d/navigation/invert_y_axis"); + const bool invert_x_axis = EDITOR_GET("editors/3d/navigation/invert_x_axis"); + const bool invert_y_axis = EDITOR_GET("editors/3d/navigation/invert_y_axis"); Vector3 translation( (invert_x_axis ? -1 : 1) * -p_relative.x * pan_speed, (invert_y_axis ? -1 : 1) * p_relative.y * pan_speed, @@ -2110,14 +2110,14 @@ void Node3DEditorViewport::_nav_pan(Ref<InputEventWithModifiers> p_event, const } void Node3DEditorViewport::_nav_zoom(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) { - const NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation/navigation_scheme").operator int(); + const NavigationScheme nav_scheme = (NavigationScheme)EDITOR_GET("editors/3d/navigation/navigation_scheme").operator int(); real_t zoom_speed = 1 / 80.0; if (nav_scheme == NAVIGATION_MAYA && p_event->is_shift_pressed()) { zoom_speed *= 10; } - NavigationZoomStyle zoom_style = (NavigationZoomStyle)EditorSettings::get_singleton()->get("editors/3d/navigation/zoom_style").operator int(); + NavigationZoomStyle zoom_style = (NavigationZoomStyle)EDITOR_GET("editors/3d/navigation/zoom_style").operator int(); if (zoom_style == NAVIGATION_ZOOM_HORIZONTAL) { if (p_relative.x > 0) { scale_cursor_distance(1 - p_relative.x * zoom_speed); @@ -2143,10 +2143,10 @@ void Node3DEditorViewport::_nav_orbit(Ref<InputEventWithModifiers> p_event, cons _menu_option(VIEW_PERSPECTIVE); } - const real_t degrees_per_pixel = EditorSettings::get_singleton()->get("editors/3d/navigation_feel/orbit_sensitivity"); + const real_t degrees_per_pixel = EDITOR_GET("editors/3d/navigation_feel/orbit_sensitivity"); const real_t radians_per_pixel = Math::deg_to_rad(degrees_per_pixel); - const bool invert_y_axis = EditorSettings::get_singleton()->get("editors/3d/navigation/invert_y_axis"); - const bool invert_x_axis = EditorSettings::get_singleton()->get("editors/3d/navigation/invert_x_axis"); + const bool invert_y_axis = EDITOR_GET("editors/3d/navigation/invert_y_axis"); + const bool invert_x_axis = EDITOR_GET("editors/3d/navigation/invert_x_axis"); if (invert_y_axis) { cursor.x_rot -= p_relative.y * radians_per_pixel; @@ -2176,9 +2176,9 @@ void Node3DEditorViewport::_nav_look(Ref<InputEventWithModifiers> p_event, const } // Scale mouse sensitivity with camera FOV scale when zoomed in to make it easier to point at things. - const real_t degrees_per_pixel = real_t(EditorSettings::get_singleton()->get("editors/3d/freelook/freelook_sensitivity")) * MIN(1.0, cursor.fov_scale); + const real_t degrees_per_pixel = real_t(EDITOR_GET("editors/3d/freelook/freelook_sensitivity")) * MIN(1.0, cursor.fov_scale); const real_t radians_per_pixel = Math::deg_to_rad(degrees_per_pixel); - const bool invert_y_axis = EditorSettings::get_singleton()->get("editors/3d/navigation/invert_y_axis"); + const bool invert_y_axis = EDITOR_GET("editors/3d/navigation/invert_y_axis"); // Note: do NOT assume the camera has the "current" transform, because it is interpolated and may have "lag". const Transform3D prev_camera_transform = to_camera_transform(cursor); @@ -2215,9 +2215,9 @@ void Node3DEditorViewport::set_freelook_active(bool active_now) { // Also sync the camera cursor, otherwise switching to freelook will be trippy if inertia is active camera_cursor.eye_pos = cursor.eye_pos; - if (EditorSettings::get_singleton()->get("editors/3d/freelook/freelook_speed_zoom_link")) { + if (EDITOR_GET("editors/3d/freelook/freelook_speed_zoom_link")) { // Re-adjust freelook speed from the current zoom level - real_t base_speed = EditorSettings::get_singleton()->get("editors/3d/freelook/freelook_base_speed"); + real_t base_speed = EDITOR_GET("editors/3d/freelook/freelook_base_speed"); freelook_speed = base_speed * cursor.distance; } @@ -2299,7 +2299,7 @@ void Node3DEditorViewport::_update_freelook(real_t delta) { return; } - const FreelookNavigationScheme navigation_scheme = (FreelookNavigationScheme)EditorSettings::get_singleton()->get("editors/3d/freelook/freelook_navigation_scheme").operator int(); + const FreelookNavigationScheme navigation_scheme = (FreelookNavigationScheme)EDITOR_GET("editors/3d/freelook/freelook_navigation_scheme").operator int(); Vector3 forward; if (navigation_scheme == FREELOOK_FULLY_AXIS_LOCKED) { @@ -2375,12 +2375,12 @@ void Node3DEditorPlugin::edited_scene_changed() { void Node3DEditorViewport::_project_settings_changed() { //update shadow atlas if changed - int shadowmap_size = ProjectSettings::get_singleton()->get("rendering/lights_and_shadows/positional_shadow/atlas_size"); - bool shadowmap_16_bits = ProjectSettings::get_singleton()->get("rendering/lights_and_shadows/positional_shadow/atlas_16_bits"); - int atlas_q0 = ProjectSettings::get_singleton()->get("rendering/lights_and_shadows/positional_shadow/atlas_quadrant_0_subdiv"); - int atlas_q1 = ProjectSettings::get_singleton()->get("rendering/lights_and_shadows/positional_shadow/atlas_quadrant_1_subdiv"); - int atlas_q2 = ProjectSettings::get_singleton()->get("rendering/lights_and_shadows/positional_shadow/atlas_quadrant_2_subdiv"); - int atlas_q3 = ProjectSettings::get_singleton()->get("rendering/lights_and_shadows/positional_shadow/atlas_quadrant_3_subdiv"); + int shadowmap_size = GLOBAL_GET("rendering/lights_and_shadows/positional_shadow/atlas_size"); + bool shadowmap_16_bits = GLOBAL_GET("rendering/lights_and_shadows/positional_shadow/atlas_16_bits"); + int atlas_q0 = GLOBAL_GET("rendering/lights_and_shadows/positional_shadow/atlas_quadrant_0_subdiv"); + int atlas_q1 = GLOBAL_GET("rendering/lights_and_shadows/positional_shadow/atlas_quadrant_1_subdiv"); + int atlas_q2 = GLOBAL_GET("rendering/lights_and_shadows/positional_shadow/atlas_quadrant_2_subdiv"); + int atlas_q3 = GLOBAL_GET("rendering/lights_and_shadows/positional_shadow/atlas_quadrant_3_subdiv"); viewport->set_positional_shadow_atlas_size(shadowmap_size); viewport->set_positional_shadow_atlas_16_bits(shadowmap_16_bits); @@ -2393,7 +2393,7 @@ void Node3DEditorViewport::_project_settings_changed() { // Update MSAA, screen-space AA and debanding if changed - const int msaa_mode = ProjectSettings::get_singleton()->get("rendering/anti_aliasing/quality/msaa_3d"); + const int msaa_mode = GLOBAL_GET("rendering/anti_aliasing/quality/msaa_3d"); viewport->set_msaa_3d(Viewport::MSAA(msaa_mode)); const int ssaa_mode = GLOBAL_GET("rendering/anti_aliasing/quality/screen_space_aa"); viewport->set_screen_space_aa(Viewport::ScreenSpaceAA(ssaa_mode)); @@ -2445,7 +2445,7 @@ void Node3DEditorViewport::_notification(int p_what) { set_freelook_active(false); } call_deferred(SNAME("update_transform_gizmo_view")); - rotation_control->set_visible(EditorSettings::get_singleton()->get("editors/3d/navigation/show_viewport_rotation_gizmo")); + rotation_control->set_visible(EDITOR_GET("editors/3d/navigation/show_viewport_rotation_gizmo")); } break; case NOTIFICATION_RESIZED: { @@ -2821,7 +2821,7 @@ void Node3DEditorViewport::_draw() { Math::round(2 * EDSCALE)); } if (previewing) { - Size2 ss = Size2(ProjectSettings::get_singleton()->get("display/window/size/viewport_width"), ProjectSettings::get_singleton()->get("display/window/size/viewport_height")); + Size2 ss = Size2(GLOBAL_GET("display/window/size/viewport_width"), GLOBAL_GET("display/window/size/viewport_height")); float aspect = ss.aspect(); Size2 s = get_size(); @@ -3464,7 +3464,7 @@ void Node3DEditorViewport::update_transform_gizmo_view() { const real_t d1 = camera->unproject_position(camera_xform.origin + camz * gizmo_d + camy).y; const real_t dd = MAX(Math::abs(d0 - d1), CMP_EPSILON); - const real_t gizmo_size = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_size"); + const real_t gizmo_size = EDITOR_GET("editors/3d/manipulator_gizmo_size"); // At low viewport heights, multiply the gizmo scale based on the viewport height. // This prevents the gizmo from growing very large and going outside the viewport. const int viewport_base_height = 400 * MAX(1, EDSCALE); @@ -4938,7 +4938,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p accept = nullptr; freelook_active = false; - freelook_speed = EditorSettings::get_singleton()->get("editors/3d/freelook/freelook_base_speed"); + freelook_speed = EDITOR_GET("editors/3d/freelook/freelook_base_speed"); selection_menu = memnew(PopupMenu); add_child(selection_menu); @@ -6191,9 +6191,9 @@ void fragment() { grid_mat[i]->set_shader(grid_shader); } - grid_enable[0] = EditorSettings::get_singleton()->get("editors/3d/grid_xy_plane"); - grid_enable[1] = EditorSettings::get_singleton()->get("editors/3d/grid_yz_plane"); - grid_enable[2] = EditorSettings::get_singleton()->get("editors/3d/grid_xz_plane"); + grid_enable[0] = EDITOR_GET("editors/3d/grid_xy_plane"); + grid_enable[1] = EDITOR_GET("editors/3d/grid_yz_plane"); + grid_enable[2] = EDITOR_GET("editors/3d/grid_xz_plane"); grid_visible[0] = grid_enable[0]; grid_visible[1] = grid_enable[1]; grid_visible[2] = grid_enable[2]; @@ -6243,7 +6243,7 @@ void fragment() { break; } - col.a = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_opacity"); + col.a = EDITOR_GET("editors/3d/manipulator_gizmo_opacity"); move_gizmo[i] = Ref<ArrayMesh>(memnew(ArrayMesh)); move_plane_gizmo[i] = Ref<ArrayMesh>(memnew(ArrayMesh)); @@ -6659,23 +6659,23 @@ void Node3DEditor::_init_grid() { Vector<Vector3> grid_points[3]; Vector<Vector3> grid_normals[3]; - Color primary_grid_color = EditorSettings::get_singleton()->get("editors/3d/primary_grid_color"); - Color secondary_grid_color = EditorSettings::get_singleton()->get("editors/3d/secondary_grid_color"); - int grid_size = EditorSettings::get_singleton()->get("editors/3d/grid_size"); - int primary_grid_steps = EditorSettings::get_singleton()->get("editors/3d/primary_grid_steps"); + Color primary_grid_color = EDITOR_GET("editors/3d/primary_grid_color"); + Color secondary_grid_color = EDITOR_GET("editors/3d/secondary_grid_color"); + int grid_size = EDITOR_GET("editors/3d/grid_size"); + int primary_grid_steps = EDITOR_GET("editors/3d/primary_grid_steps"); // Which grid planes are enabled? Which should we generate? - grid_enable[0] = grid_visible[0] = EditorSettings::get_singleton()->get("editors/3d/grid_xy_plane"); - grid_enable[1] = grid_visible[1] = EditorSettings::get_singleton()->get("editors/3d/grid_yz_plane"); - grid_enable[2] = grid_visible[2] = EditorSettings::get_singleton()->get("editors/3d/grid_xz_plane"); + grid_enable[0] = grid_visible[0] = EDITOR_GET("editors/3d/grid_xy_plane"); + grid_enable[1] = grid_visible[1] = EDITOR_GET("editors/3d/grid_yz_plane"); + grid_enable[2] = grid_visible[2] = EDITOR_GET("editors/3d/grid_xz_plane"); // Offsets division_level for bigger or smaller grids. // Default value is -0.2. -1.0 gives Blender-like behavior, 0.5 gives huge grids. - real_t division_level_bias = EditorSettings::get_singleton()->get("editors/3d/grid_division_level_bias"); + real_t division_level_bias = EDITOR_GET("editors/3d/grid_division_level_bias"); // Default largest grid size is 8^2 when primary_grid_steps is 8 (64m apart, so primary grid lines are 512m apart). - int division_level_max = EditorSettings::get_singleton()->get("editors/3d/grid_division_level_max"); + int division_level_max = EDITOR_GET("editors/3d/grid_division_level_max"); // Default smallest grid size is 1cm, 10^-2 (default value is -2). - int division_level_min = EditorSettings::get_singleton()->get("editors/3d/grid_division_level_min"); + int division_level_min = EDITOR_GET("editors/3d/grid_division_level_min"); ERR_FAIL_COND_MSG(division_level_max < division_level_min, "The 3D grid's maximum division level cannot be lower than its minimum division level."); if (primary_grid_steps != 10) { // Log10 of 10 is 1. diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 58a3a07c43..3f8ca825c0 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -67,7 +67,7 @@ void Polygon2DEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - uv_panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); + uv_panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); } break; case NOTIFICATION_READY: { @@ -299,7 +299,7 @@ void Polygon2DEditor::_menu_option(int p_option) { } if (EditorSettings::get_singleton()->has_setting("interface/dialogs/uv_editor_bounds")) { - uv_edit->popup(EditorSettings::get_singleton()->get("interface/dialogs/uv_editor_bounds")); + uv_edit->popup(EDITOR_GET("interface/dialogs/uv_editor_bounds")); } else { uv_edit->popup_centered_ratio(0.85); } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 6266ec97e4..e4f0192c64 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -401,7 +401,7 @@ String ScriptEditor::_get_debug_tooltip(const String &p_text, Node *_se) { } void ScriptEditor::_breaked(bool p_breaked, bool p_can_debug) { - if (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) { + if (bool(EDITOR_GET("text_editor/external/use_external_editor"))) { return; } @@ -1484,7 +1484,7 @@ void ScriptEditor::_show_save_theme_as_dialog() { file_dialog_option = THEME_SAVE_AS; file_dialog->clear_filters(); file_dialog->add_filter("*.tet"); - file_dialog->set_current_path(EditorPaths::get_singleton()->get_text_editor_themes_dir().path_join(EditorSettings::get_singleton()->get("text_editor/theme/color_theme"))); + file_dialog->set_current_path(EditorPaths::get_singleton()->get_text_editor_themes_dir().path_join(EDITOR_GET("text_editor/theme/color_theme"))); file_dialog->popup_file_dialog(); file_dialog->set_title(TTR("Save Theme As...")); } @@ -1819,7 +1819,7 @@ void ScriptEditor::_update_members_overview() { } Vector<String> functions = se->get_functions(); - if (EditorSettings::get_singleton()->get("text_editor/script_list/sort_members_outline_alphabetically")) { + if (EDITOR_GET("text_editor/script_list/sort_members_outline_alphabetically")) { functions.sort(); } @@ -1886,9 +1886,9 @@ void ScriptEditor::_update_help_overview() { } void ScriptEditor::_update_script_colors() { - bool script_temperature_enabled = EditorSettings::get_singleton()->get("text_editor/script_list/script_temperature_enabled"); + bool script_temperature_enabled = EDITOR_GET("text_editor/script_list/script_temperature_enabled"); - int hist_size = EditorSettings::get_singleton()->get("text_editor/script_list/script_temperature_history_size"); + int hist_size = EDITOR_GET("text_editor/script_list/script_temperature_history_size"); Color hot_color = get_theme_color(SNAME("accent_color"), SNAME("Editor")); hot_color.set_s(hot_color.get_s() * 0.9); Color cold_color = get_theme_color(SNAME("font_color"), SNAME("Editor")); @@ -1932,9 +1932,9 @@ void ScriptEditor::_update_script_names() { } script_list->clear(); - bool split_script_help = EditorSettings::get_singleton()->get("text_editor/script_list/group_help_pages"); - ScriptSortBy sort_by = (ScriptSortBy)(int)EditorSettings::get_singleton()->get("text_editor/script_list/sort_scripts_by"); - ScriptListName display_as = (ScriptListName)(int)EditorSettings::get_singleton()->get("text_editor/script_list/list_script_names_as"); + bool split_script_help = EDITOR_GET("text_editor/script_list/group_help_pages"); + ScriptSortBy sort_by = (ScriptSortBy)(int)EDITOR_GET("text_editor/script_list/sort_scripts_by"); + ScriptListName display_as = (ScriptListName)(int)EDITOR_GET("text_editor/script_list/list_script_names_as"); Vector<_ScriptEditorItemData> sedata; @@ -2002,7 +2002,7 @@ void ScriptEditor::_update_script_names() { Vector<String> full_script_paths; for (int j = 0; j < sedata.size(); j++) { String name = sedata[j].name.replace("(*)", ""); - ScriptListName script_display = (ScriptListName)(int)EditorSettings::get_singleton()->get("text_editor/script_list/list_script_names_as"); + ScriptListName script_display = (ScriptListName)(int)EDITOR_GET("text_editor/script_list/list_script_names_as"); switch (script_display) { case DISPLAY_NAME: { name = name.get_file(); @@ -2184,10 +2184,10 @@ bool ScriptEditor::edit(const Ref<Resource> &p_resource, int p_line, int p_col, // Don't open dominant script if using an external editor. bool use_external_editor = - EditorSettings::get_singleton()->get("text_editor/external/use_external_editor") || + EDITOR_GET("text_editor/external/use_external_editor") || (scr.is_valid() && scr->get_language()->overrides_external_editor()); use_external_editor = use_external_editor && !(scr.is_valid() && scr->is_built_in()); // Ignore external editor for built-in scripts. - const bool open_dominant = EditorSettings::get_singleton()->get("text_editor/behavior/files/open_dominant_script_on_scene_change"); + const bool open_dominant = EDITOR_GET("text_editor/behavior/files/open_dominant_script_on_scene_change"); const bool should_open = (open_dominant && !use_external_editor) || !EditorNode::get_singleton()->is_changing_scene(); @@ -2205,8 +2205,8 @@ bool ScriptEditor::edit(const Ref<Resource> &p_resource, int p_line, int p_col, (EditorDebuggerNode::get_singleton()->get_dump_stack_script() != p_resource || EditorDebuggerNode::get_singleton()->get_debug_with_external_editor()) && p_resource->get_path().is_resource_file() && !p_resource->is_class("VisualScript")) { - String path = EditorSettings::get_singleton()->get("text_editor/external/exec_path"); - String flags = EditorSettings::get_singleton()->get("text_editor/external/exec_flags"); + String path = EDITOR_GET("text_editor/external/exec_path"); + String flags = EDITOR_GET("text_editor/external/exec_flags"); List<String> args; bool has_file_flag = false; @@ -2654,26 +2654,26 @@ void ScriptEditor::_save_layout() { void ScriptEditor::_editor_settings_changed() { textfile_extensions.clear(); - const Vector<String> textfile_ext = ((String)(EditorSettings::get_singleton()->get("docks/filesystem/textfile_extensions"))).split(",", false); + const Vector<String> textfile_ext = ((String)(EDITOR_GET("docks/filesystem/textfile_extensions"))).split(",", false); for (const String &E : textfile_ext) { textfile_extensions.insert(E); } - trim_trailing_whitespace_on_save = EditorSettings::get_singleton()->get("text_editor/behavior/files/trim_trailing_whitespace_on_save"); - convert_indent_on_save = EditorSettings::get_singleton()->get("text_editor/behavior/files/convert_indent_on_save"); - use_space_indentation = EditorSettings::get_singleton()->get("text_editor/behavior/indent/type"); + trim_trailing_whitespace_on_save = EDITOR_GET("text_editor/behavior/files/trim_trailing_whitespace_on_save"); + convert_indent_on_save = EDITOR_GET("text_editor/behavior/files/convert_indent_on_save"); + use_space_indentation = EDITOR_GET("text_editor/behavior/indent/type"); - members_overview_enabled = EditorSettings::get_singleton()->get("text_editor/script_list/show_members_overview"); - help_overview_enabled = EditorSettings::get_singleton()->get("text_editor/help/show_help_index"); + members_overview_enabled = EDITOR_GET("text_editor/script_list/show_members_overview"); + help_overview_enabled = EDITOR_GET("text_editor/help/show_help_index"); _update_members_overview_visibility(); _update_help_overview_visibility(); _update_autosave_timer(); if (current_theme.is_empty()) { - current_theme = EditorSettings::get_singleton()->get("text_editor/theme/color_theme"); - } else if (current_theme != String(EditorSettings::get_singleton()->get("text_editor/theme/color_theme"))) { - current_theme = EditorSettings::get_singleton()->get("text_editor/theme/color_theme"); + current_theme = EDITOR_GET("text_editor/theme/color_theme"); + } else if (current_theme != String(EDITOR_GET("text_editor/theme/color_theme"))) { + current_theme = EDITOR_GET("text_editor/theme/color_theme"); EditorSettings::get_singleton()->load_text_editor_theme(); } @@ -2756,7 +2756,7 @@ void ScriptEditor::_update_autosave_timer() { return; } - float autosave_time = EditorSettings::get_singleton()->get("text_editor/behavior/files/autosave_interval_secs"); + float autosave_time = EDITOR_GET("text_editor/behavior/files/autosave_interval_secs"); if (autosave_time > 0) { autosave_timer->set_wait_time(autosave_time); autosave_timer->start(); @@ -3434,10 +3434,10 @@ TypedArray<ScriptEditorBase> ScriptEditor::_get_open_script_editors() const { void ScriptEditor::set_scene_root_script(Ref<Script> p_script) { // Don't open dominant script if using an external editor. bool use_external_editor = - EditorSettings::get_singleton()->get("text_editor/external/use_external_editor") || + EDITOR_GET("text_editor/external/use_external_editor") || (p_script.is_valid() && p_script->get_language()->overrides_external_editor()); use_external_editor = use_external_editor && !(p_script.is_valid() && p_script->is_built_in()); // Ignore external editor for built-in scripts. - const bool open_dominant = EditorSettings::get_singleton()->get("text_editor/behavior/files/open_dominant_script_on_scene_change"); + const bool open_dominant = EDITOR_GET("text_editor/behavior/files/open_dominant_script_on_scene_change"); if (open_dominant && !use_external_editor && p_script.is_valid()) { edit(p_script); @@ -3628,8 +3628,8 @@ ScriptEditor::ScriptEditor() { waiting_update_names = false; pending_auto_reload = false; auto_reload_running_scripts = true; - members_overview_enabled = EditorSettings::get_singleton()->get("text_editor/script_list/show_members_overview"); - help_overview_enabled = EditorSettings::get_singleton()->get("text_editor/help/show_help_index"); + members_overview_enabled = EDITOR_GET("text_editor/script_list/show_members_overview"); + help_overview_enabled = EDITOR_GET("text_editor/help/show_help_index"); VBoxContainer *main_container = memnew(VBoxContainer); add_child(main_container); @@ -3688,7 +3688,7 @@ ScriptEditor::ScriptEditor() { members_overview_alphabeta_sort_button->set_flat(true); members_overview_alphabeta_sort_button->set_tooltip_text(TTR("Toggle alphabetical sorting of the method list.")); members_overview_alphabeta_sort_button->set_toggle_mode(true); - members_overview_alphabeta_sort_button->set_pressed(EditorSettings::get_singleton()->get("text_editor/script_list/sort_members_outline_alphabetically")); + members_overview_alphabeta_sort_button->set_pressed(EDITOR_GET("text_editor/script_list/sort_members_outline_alphabetically")); members_overview_alphabeta_sort_button->connect("toggled", callable_mp(this, &ScriptEditor::_toggle_members_overview_alpha_sort)); buttons_hbox->add_child(members_overview_alphabeta_sort_button); @@ -3930,9 +3930,9 @@ ScriptEditor::ScriptEditor() { history_pos = -1; edit_pass = 0; - trim_trailing_whitespace_on_save = EditorSettings::get_singleton()->get("text_editor/behavior/files/trim_trailing_whitespace_on_save"); - convert_indent_on_save = EditorSettings::get_singleton()->get("text_editor/behavior/files/convert_indent_on_save"); - use_space_indentation = EditorSettings::get_singleton()->get("text_editor/behavior/indent/type"); + trim_trailing_whitespace_on_save = EDITOR_GET("text_editor/behavior/files/trim_trailing_whitespace_on_save"); + convert_indent_on_save = EDITOR_GET("text_editor/behavior/files/convert_indent_on_save"); + use_space_indentation = EDITOR_GET("text_editor/behavior/indent/type"); ScriptServer::edit_request_func = _open_script_request; diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index e54a338c09..0d12d07aa7 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -325,7 +325,7 @@ bool ScriptTextEditor::show_members_overview() { } void ScriptTextEditor::update_settings() { - code_editor->get_text_editor()->set_gutter_draw(connection_gutter, EditorSettings::get_singleton()->get("text_editor/appearance/gutters/show_info_gutter")); + code_editor->get_text_editor()->set_gutter_draw(connection_gutter, EDITOR_GET("text_editor/appearance/gutters/show_info_gutter")); code_editor->update_editor_settings(); } @@ -698,7 +698,7 @@ static void _find_changed_scripts_for_external_editor(Node *p_base, Node *p_curr } void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_for_script) { - if (!bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) { + if (!bool(EDITOR_GET("text_editor/external/use_external_editor"))) { return; } @@ -1793,7 +1793,7 @@ void ScriptTextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { int row = pos.y; int col = pos.x; - tx->set_move_caret_on_right_click_enabled(EditorSettings::get_singleton()->get("text_editor/behavior/navigation/move_caret_on_right_click")); + tx->set_move_caret_on_right_click_enabled(EDITOR_GET("text_editor/behavior/navigation/move_caret_on_right_click")); if (tx->is_move_caret_on_right_click_enabled()) { tx->remove_secondary_carets(); if (tx->has_selection()) { @@ -2139,7 +2139,7 @@ ScriptTextEditor::ScriptTextEditor() { update_settings(); - code_editor->get_text_editor()->set_code_hint_draw_below(EditorSettings::get_singleton()->get("text_editor/completion/put_callhint_tooltip_below_current_line")); + code_editor->get_text_editor()->set_code_hint_draw_below(EDITOR_GET("text_editor/completion/put_callhint_tooltip_below_current_line")); code_editor->get_text_editor()->set_symbol_lookup_on_click_enabled(true); code_editor->get_text_editor()->set_context_menu_enabled(false); diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index f2e84aec13..7922a768ec 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -1355,10 +1355,10 @@ void Skeleton3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { selected = se->get_selected_bone(); } - Color bone_color = EditorSettings::get_singleton()->get("editors/3d_gizmos/gizmo_colors/skeleton"); - Color selected_bone_color = EditorSettings::get_singleton()->get("editors/3d_gizmos/gizmo_colors/selected_bone"); - real_t bone_axis_length = EditorSettings::get_singleton()->get("editors/3d_gizmos/gizmo_settings/bone_axis_length"); - int bone_shape = EditorSettings::get_singleton()->get("editors/3d_gizmos/gizmo_settings/bone_shape"); + Color bone_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/skeleton"); + Color selected_bone_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/selected_bone"); + real_t bone_axis_length = EDITOR_GET("editors/3d_gizmos/gizmo_settings/bone_axis_length"); + int bone_shape = EDITOR_GET("editors/3d_gizmos/gizmo_settings/bone_shape"); LocalVector<Color> axis_colors; axis_colors.push_back(Node3DEditor::get_singleton()->get_theme_color(SNAME("axis_x_color"), SNAME("Editor"))); diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 0c12b03447..03cff74bdb 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -449,7 +449,7 @@ void TextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { int row = pos.y; int col = pos.x; - tx->set_move_caret_on_right_click_enabled(EditorSettings::get_singleton()->get("text_editor/behavior/navigation/move_caret_on_right_click")); + tx->set_move_caret_on_right_click_enabled(EDITOR_GET("text_editor/behavior/navigation/move_caret_on_right_click")); bool can_fold = tx->can_fold_line(row); bool is_folded = tx->is_line_folded(row); diff --git a/editor/plugins/text_shader_editor.cpp b/editor/plugins/text_shader_editor.cpp index 48086bf235..767eeaefc5 100644 --- a/editor/plugins/text_shader_editor.cpp +++ b/editor/plugins/text_shader_editor.cpp @@ -724,7 +724,7 @@ void TextShaderEditor::_notification(int p_what) { void TextShaderEditor::_editor_settings_changed() { shader_editor->update_editor_settings(); - shader_editor->get_text_editor()->add_theme_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/appearance/whitespace/line_spacing")); + shader_editor->get_text_editor()->add_theme_constant_override("line_spacing", EDITOR_GET("text_editor/appearance/whitespace/line_spacing")); shader_editor->get_text_editor()->set_draw_breakpoints_gutter(false); shader_editor->get_text_editor()->set_draw_executing_lines_gutter(false); } @@ -955,7 +955,7 @@ void TextShaderEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { Point2i pos = tx->get_line_column_at_pos(mb->get_global_position() - tx->get_global_position()); int row = pos.y; int col = pos.x; - tx->set_move_caret_on_right_click_enabled(EditorSettings::get_singleton()->get("text_editor/behavior/navigation/move_caret_on_right_click")); + tx->set_move_caret_on_right_click_enabled(EDITOR_GET("text_editor/behavior/navigation/move_caret_on_right_click")); if (tx->is_move_caret_on_right_click_enabled()) { tx->remove_secondary_carets(); @@ -1068,7 +1068,7 @@ TextShaderEditor::TextShaderEditor() { EditorSettings::get_singleton()->connect("settings_changed", callable_mp(this, &TextShaderEditor::_editor_settings_changed)); ProjectSettingsEditor::get_singleton()->connect("confirmed", callable_mp(this, &TextShaderEditor::_project_settings_changed)); - shader_editor->get_text_editor()->set_code_hint_draw_below(EditorSettings::get_singleton()->get("text_editor/completion/put_callhint_tooltip_below_current_line")); + shader_editor->get_text_editor()->set_code_hint_draw_below(EDITOR_GET("text_editor/completion/put_callhint_tooltip_below_current_line")); shader_editor->get_text_editor()->set_symbol_lookup_on_click_enabled(true); shader_editor->get_text_editor()->set_context_menu_enabled(false); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 8e04391a94..f0a08cb4f5 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -835,7 +835,7 @@ void TextureRegionEditor::_notification(int p_what) { [[fallthrough]]; } case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); + panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); } break; case NOTIFICATION_VISIBILITY_CHANGED: { if (snap_mode == SNAP_AUTOSLICE && is_visible() && autoslice_is_dirty) { diff --git a/editor/plugins/tiles/tile_atlas_view.cpp b/editor/plugins/tiles/tile_atlas_view.cpp index 502c34459a..69104cadec 100644 --- a/editor/plugins/tiles/tile_atlas_view.cpp +++ b/editor/plugins/tiles/tile_atlas_view.cpp @@ -298,7 +298,7 @@ void TileAtlasView::_draw_base_tiles_texture_grid() { void TileAtlasView::_draw_base_tiles_shape_grid() { // Draw the shapes. - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Vector2i tile_shape_size = tile_set->get_tile_size(); for (int i = 0; i < tile_set_atlas_source->get_tiles_count(); i++) { Vector2i tile_id = tile_set_atlas_source->get_tile_id(i); @@ -509,7 +509,7 @@ void TileAtlasView::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); + panner->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); } break; case NOTIFICATION_READY: { diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp index e760c84f7d..a7d90856ac 100644 --- a/editor/plugins/tiles/tile_data_editors.cpp +++ b/editor/plugins/tiles/tile_data_editors.cpp @@ -128,7 +128,7 @@ void GenericTilePolygonEditor::_base_control_draw() { real_t grab_threshold = EDITOR_GET("editors/polygon_editor/point_grab_radius"); - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); const Ref<Texture2D> handle = get_theme_icon(SNAME("EditorPathSharpHandle"), SNAME("EditorIcons")); const Ref<Texture2D> add_handle = get_theme_icon(SNAME("EditorHandleAdd"), SNAME("EditorIcons")); const Ref<StyleBox> focus_stylebox = get_theme_stylebox(SNAME("Focus"), SNAME("EditorStyles")); @@ -885,7 +885,7 @@ void TileDataDefaultEditor::_setup_undo_redo_action(TileSetAtlasSource *p_tile_s void TileDataDefaultEditor::forward_draw_over_atlas(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_set_atlas_source, CanvasItem *p_canvas_item, Transform2D p_transform) { if (drag_type == DRAG_TYPE_PAINT_RECT) { - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); p_canvas_item->draw_set_transform_matrix(p_transform); @@ -1117,7 +1117,7 @@ void TileDataDefaultEditor::draw_over_tile(CanvasItem *p_canvas_item, Transform2 Color color = Color(1, 1, 1); if (p_selected) { - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); selection_color.set_v(0.9); color = selection_color; @@ -1211,7 +1211,7 @@ void TileDataTextureOffsetEditor::draw_over_tile(CanvasItem *p_canvas_item, Tran Vector2i tile_set_tile_size = tile_set->get_tile_size(); Color color = Color(1.0, 0.0, 0.0); if (p_selected) { - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); color = selection_color; } @@ -1233,7 +1233,7 @@ void TileDataPositionEditor::draw_over_tile(CanvasItem *p_canvas_item, Transform Color color = Color(1.0, 1.0, 1.0); if (p_selected) { - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); color = selection_color; } @@ -1247,7 +1247,7 @@ void TileDataYSortEditor::draw_over_tile(CanvasItem *p_canvas_item, Transform2D Color color = Color(1.0, 1.0, 1.0); if (p_selected) { - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); color = selection_color; } @@ -1259,7 +1259,7 @@ void TileDataOcclusionShapeEditor::draw_over_tile(CanvasItem *p_canvas_item, Tra TileData *tile_data = _get_tile_data(p_cell); ERR_FAIL_COND(!tile_data); - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); Color color = grid_color.darkened(0.2); if (p_selected) { @@ -1578,7 +1578,7 @@ void TileDataCollisionEditor::draw_over_tile(CanvasItem *p_canvas_item, Transfor // Draw all shapes. Vector<Color> color; if (p_selected) { - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); selection_color.a = 0.7; color.push_back(selection_color); @@ -1751,7 +1751,7 @@ void TileDataTerrainsEditor::forward_draw_over_atlas(TileAtlasView *p_tile_atlas if (drag_type == DRAG_TYPE_PAINT_TERRAIN_SET_RECT) { // Draw selection rectangle. - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); p_canvas_item->draw_set_transform_matrix(p_transform); @@ -2753,7 +2753,7 @@ void TileDataNavigationEditor::draw_over_tile(CanvasItem *p_canvas_item, Transfo color = NavigationServer3D::get_singleton()->get_debug_navigation_geometry_face_color(); #endif // DEBUG_ENABLED if (p_selected) { - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); selection_color.a = 0.7; color = selection_color; diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index b9436e17f0..57416ff55f 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -396,7 +396,7 @@ void TileMapEditorTilesPlugin::_update_scenes_collection_view() { } // Icon size update. - int int_size = int(EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size")) * EDSCALE; + int int_size = int(EDITOR_GET("filesystem/file_dialog/thumbnail_size")) * EDSCALE; scene_tiles_list->set_fixed_icon_size(Vector2(int_size, int_size)); } @@ -739,7 +739,7 @@ void TileMapEditorTilesPlugin::forward_canvas_draw_over_viewport(Control *p_over if (drag_type == DRAG_TYPE_MOVE || (drag_type == DRAG_TYPE_SELECT && !Input::get_singleton()->is_key_pressed(Key::CTRL) && !Input::get_singleton()->is_key_pressed(Key::SHIFT))) { // Do nothing } else { - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); tile_map->draw_cells_outline(p_overlay, tile_map_selection, selection_color, xform); } @@ -844,9 +844,9 @@ void TileMapEditorTilesPlugin::forward_canvas_draw_over_viewport(Control *p_over const int fading = 5; // Draw the lines of the grid behind the preview. - bool display_grid = EditorSettings::get_singleton()->get("editors/tiles_editor/display_grid"); + bool display_grid = EDITOR_GET("editors/tiles_editor/display_grid"); if (display_grid) { - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); if (drawn_grid_rect.size.x > 0 && drawn_grid_rect.size.y > 0) { drawn_grid_rect = drawn_grid_rect.grow(fading); for (int x = drawn_grid_rect.position.x; x < (drawn_grid_rect.position.x + drawn_grid_rect.size.x); x++) { @@ -1682,7 +1682,7 @@ void TileMapEditorTilesPlugin::_tile_atlas_control_draw() { } // Draw the selection. - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); for (const TileMapCell &E : tile_set_selection) { if (E.source_id == source_id && E.alternative_tile == 0) { @@ -3023,9 +3023,9 @@ void TileMapEditorTerrainsPlugin::forward_canvas_draw_over_viewport(Control *p_o const int fading = 5; // Draw the lines of the grid behind the preview. - bool display_grid = EditorSettings::get_singleton()->get("editors/tiles_editor/display_grid"); + bool display_grid = EDITOR_GET("editors/tiles_editor/display_grid"); if (display_grid) { - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); if (drawn_grid_rect.size.x > 0 && drawn_grid_rect.size.y > 0) { drawn_grid_rect = drawn_grid_rect.grow(fading); for (int x = drawn_grid_rect.position.x; x < (drawn_grid_rect.position.x + drawn_grid_rect.size.x); x++) { @@ -3420,7 +3420,7 @@ void TileMapEditor::_notification(int p_what) { warning_pattern_texture = get_theme_icon(SNAME("WarningPattern"), SNAME("EditorIcons")); advanced_menu_button->set_icon(get_theme_icon(SNAME("Tools"), SNAME("EditorIcons"))); toggle_grid_button->set_icon(get_theme_icon(SNAME("Grid"), SNAME("EditorIcons"))); - toggle_grid_button->set_pressed(EditorSettings::get_singleton()->get("editors/tiles_editor/display_grid")); + toggle_grid_button->set_pressed(EDITOR_GET("editors/tiles_editor/display_grid")); toggle_highlight_selected_layer_button->set_icon(get_theme_icon(SNAME("TileMapHighlightSelected"), SNAME("EditorIcons"))); } break; @@ -3435,7 +3435,7 @@ void TileMapEditor::_notification(int p_what) { } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - toggle_grid_button->set_pressed(EditorSettings::get_singleton()->get("editors/tiles_editor/display_grid")); + toggle_grid_button->set_pressed(EDITOR_GET("editors/tiles_editor/display_grid")); } break; case NOTIFICATION_VISIBILITY_CHANGED: { @@ -3878,9 +3878,9 @@ void TileMapEditor::forward_canvas_draw_over_viewport(Control *p_overlay) { } // Draw the grid. - bool display_grid = EditorSettings::get_singleton()->get("editors/tiles_editor/display_grid"); + bool display_grid = EDITOR_GET("editors/tiles_editor/display_grid"); if (display_grid) { - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); for (int x = displayed_rect.position.x; x < (displayed_rect.position.x + displayed_rect.size.x); x++) { for (int y = displayed_rect.position.y; y < (displayed_rect.position.y + displayed_rect.size.y); y++) { Vector2i pos_in_rect = Vector2i(x, y) - displayed_rect.position; diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 874057b7b9..f1dfba6f35 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -1667,7 +1667,7 @@ Array TileSetAtlasSourceEditor::_get_selection_as_array() { void TileSetAtlasSourceEditor::_tile_atlas_control_draw() { // Colors. - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); // Draw the selected tile. @@ -1958,7 +1958,7 @@ void TileSetAtlasSourceEditor::_tile_alternatives_control_mouse_exited() { } void TileSetAtlasSourceEditor::_tile_alternatives_control_draw() { - Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); + Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); // Update the hovered alternative tile. diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp index f7622e68ab..ef69326686 100644 --- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp @@ -323,7 +323,7 @@ void TileSetScenesCollectionSourceEditor::_update_scenes_list() { } // Icon size update. - int int_size = int(EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size")) * EDSCALE; + int int_size = int(EDITOR_GET("filesystem/file_dialog/thumbnail_size")) * EDSCALE; scene_tiles_list->set_fixed_icon_size(Vector2(int_size, int_size)); } diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp index 3937187e38..5b54062632 100644 --- a/editor/plugins/tiles/tiles_editor_plugin.cpp +++ b/editor/plugins/tiles/tiles_editor_plugin.cpp @@ -73,7 +73,7 @@ void TilesEditorPlugin::_thread() { pattern_preview_queue.pop_front(); pattern_preview_mutex.unlock(); - int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); + int thumbnail_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); thumbnail_size *= EDSCALE; Vector2 thumbnail_size2 = Vector2(thumbnail_size, thumbnail_size); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index eee0ea6b7d..9b6ff894b9 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -1356,7 +1356,7 @@ void VisualShaderEditor::_update_options_menu() { Color unsupported_color = get_theme_color(SNAME("error_color"), SNAME("Editor")); Color supported_color = get_theme_color(SNAME("warning_color"), SNAME("Editor")); - static bool low_driver = ProjectSettings::get_singleton()->get("rendering/renderer/rendering_method") == "gl_compatibility"; + static bool low_driver = GLOBAL_GET("rendering/renderer/rendering_method") == "gl_compatibility"; HashMap<String, TreeItem *> folders; @@ -1731,9 +1731,9 @@ void VisualShaderEditor::_update_graph() { graph->connect_node(itos(from), from_idx, itos(to), to_idx); } - float graph_minimap_opacity = EditorSettings::get_singleton()->get("editors/visual_editors/minimap_opacity"); + float graph_minimap_opacity = EDITOR_GET("editors/visual_editors/minimap_opacity"); graph->set_minimap_opacity(graph_minimap_opacity); - float graph_lines_curvature = EditorSettings::get_singleton()->get("editors/visual_editors/lines_curvature"); + float graph_lines_curvature = EDITOR_GET("editors/visual_editors/lines_curvature"); graph->set_connection_lines_curvature(graph_lines_curvature); } @@ -3677,10 +3677,10 @@ void VisualShaderEditor::_sbox_input(const Ref<InputEvent> &p_ie) { void VisualShaderEditor::_notification(int p_what) { switch (p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - graph->get_panner()->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); - graph->set_warped_panning(bool(EditorSettings::get_singleton()->get("editors/panning/warped_mouse_panning"))); - graph->set_minimap_opacity(EditorSettings::get_singleton()->get("editors/visual_editors/minimap_opacity")); - graph->set_connection_lines_curvature(EditorSettings::get_singleton()->get("editors/visual_editors/lines_curvature")); + graph->get_panner()->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); + graph->set_warped_panning(bool(EDITOR_GET("editors/panning/warped_mouse_panning"))); + graph->set_minimap_opacity(EDITOR_GET("editors/visual_editors/minimap_opacity")); + graph->set_connection_lines_curvature(EDITOR_GET("editors/visual_editors/lines_curvature")); _update_graph(); } break; @@ -3700,8 +3700,8 @@ void VisualShaderEditor::_notification(int p_what) { category = category->get_next(); } - graph->get_panner()->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning"))); - graph->set_warped_panning(bool(EditorSettings::get_singleton()->get("editors/panning/warped_mouse_panning"))); + graph->get_panner()->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning"))); + graph->set_warped_panning(bool(EDITOR_GET("editors/panning/warped_mouse_panning"))); [[fallthrough]]; } case NOTIFICATION_THEME_CHANGED: { @@ -4684,9 +4684,9 @@ VisualShaderEditor::VisualShaderEditor() { graph->set_show_zoom_label(true); add_child(graph); graph->set_drag_forwarding(this); - float graph_minimap_opacity = EditorSettings::get_singleton()->get("editors/visual_editors/minimap_opacity"); + float graph_minimap_opacity = EDITOR_GET("editors/visual_editors/minimap_opacity"); graph->set_minimap_opacity(graph_minimap_opacity); - float graph_lines_curvature = EditorSettings::get_singleton()->get("editors/visual_editors/lines_curvature"); + float graph_lines_curvature = EDITOR_GET("editors/visual_editors/lines_curvature"); graph->set_connection_lines_curvature(graph_lines_curvature); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_SCALAR); graph->add_valid_right_disconnect_type(VisualShaderNode::PORT_TYPE_SCALAR_INT); @@ -6269,7 +6269,7 @@ void VisualShaderNodePortPreview::setup(const Ref<VisualShader> &p_shader, Visua } Size2 VisualShaderNodePortPreview::get_minimum_size() const { - int port_preview_size = EditorSettings::get_singleton()->get("editors/visual_editors/visual_shader/port_preview_size"); + int port_preview_size = EDITOR_GET("editors/visual_editors/visual_shader/port_preview_size"); return Size2(port_preview_size, port_preview_size) * EDSCALE; } diff --git a/editor/pot_generator.cpp b/editor/pot_generator.cpp index a00df0ef40..d6b69e10db 100644 --- a/editor/pot_generator.cpp +++ b/editor/pot_generator.cpp @@ -63,7 +63,7 @@ void POTGenerator::generate_pot(const String &p_file) { // Clear all_translation_strings of the previous round. all_translation_strings.clear(); - Vector<String> files = ProjectSettings::get_singleton()->get("internationalization/locale/translations_pot_files"); + Vector<String> files = GLOBAL_GET("internationalization/locale/translations_pot_files"); // Collect all translatable strings according to files order in "POT Generation" setting. for (int i = 0; i < files.size(); i++) { @@ -99,8 +99,8 @@ void POTGenerator::_write_to_pot(const String &p_file) { return; } - String project_name = ProjectSettings::get_singleton()->get("application/config/name"); - Vector<String> files = ProjectSettings::get_singleton()->get("internationalization/locale/translations_pot_files"); + String project_name = GLOBAL_GET("application/config/name"); + Vector<String> files = GLOBAL_GET("internationalization/locale/translations_pot_files"); String extracted_files = ""; for (int i = 0; i < files.size(); i++) { extracted_files += "# " + files[i] + "\n"; diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 5a1eedd8a2..588746bf64 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -714,7 +714,7 @@ public: create_dir->hide(); } else { - fav_dir = EditorSettings::get_singleton()->get("filesystem/directories/default_project_path"); + fav_dir = EDITOR_GET("filesystem/directories/default_project_path"); if (!fav_dir.is_empty()) { project_path->set_text(fav_dir); fdialog->set_current_dir(fav_dir); @@ -1265,7 +1265,7 @@ void ProjectList::migrate_config() { continue; } - String path = EditorSettings::get_singleton()->get(property_key); + String path = EDITOR_GET(property_key); String favoriteKey = "favorite_projects/" + property_key.get_slice("/", 1); bool favorite = EditorSettings::get_singleton()->has_setting(favoriteKey); add_project(path, favorite); @@ -1916,7 +1916,7 @@ void ProjectManager::_notification(int p_what) { } break; case NOTIFICATION_READY: { - int default_sorting = (int)EditorSettings::get_singleton()->get("project_manager/sorting_order"); + int default_sorting = (int)EDITOR_GET("project_manager/sorting_order"); filter_option->select(default_sorting); _project_list->set_order_option(default_sorting); @@ -2561,7 +2561,7 @@ ProjectManager::ProjectManager() { EditorSettings::get_singleton()->set_optimize_save(false); //just write settings as they came { - int display_scale = EditorSettings::get_singleton()->get("interface/editor/display_scale"); + int display_scale = EDITOR_GET("interface/editor/display_scale"); switch (display_scale) { case 0: @@ -2587,7 +2587,7 @@ ProjectManager::ProjectManager() { editor_set_scale(2.0); break; default: - editor_set_scale(EditorSettings::get_singleton()->get("interface/editor/custom_display_scale")); + editor_set_scale(EDITOR_GET("interface/editor/custom_display_scale")); break; } EditorFileDialog::get_icon_func = &ProjectManager::_file_dialog_get_icon; @@ -2596,7 +2596,7 @@ ProjectManager::ProjectManager() { // TRANSLATORS: This refers to the application where users manage their Godot projects. DisplayServer::get_singleton()->window_set_title(VERSION_NAME + String(" - ") + TTR("Project Manager", "Application")); - EditorFileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files")); + EditorFileDialog::set_default_show_hidden_files(EDITOR_GET("filesystem/file_dialog/show_hidden_files")); int swap_cancel_ok = EDITOR_GET("interface/editor/accept_dialog_cancel_ok_buttons"); if (swap_cancel_ok != 0) { // 0 is auto, set in register_scene based on DisplayServer. @@ -2815,7 +2815,7 @@ ProjectManager::ProjectManager() { } } - String current_lang = EditorSettings::get_singleton()->get("interface/editor/editor_language"); + String current_lang = EDITOR_GET("interface/editor/editor_language"); language_btn->set_text(current_lang); for (int i = 0; i < editor_languages.size(); i++) { @@ -2854,7 +2854,7 @@ ProjectManager::ProjectManager() { scan_dir->set_access(EditorFileDialog::ACCESS_FILESYSTEM); scan_dir->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_DIR); scan_dir->set_title(TTR("Select a Folder to Scan")); // must be after mode or it's overridden - scan_dir->set_current_dir(EditorSettings::get_singleton()->get("filesystem/directories/default_project_path")); + scan_dir->set_current_dir(EDITOR_GET("filesystem/directories/default_project_path")); add_child(scan_dir); scan_dir->connect("dir_selected", callable_mp(this, &ProjectManager::_scan_begin)); @@ -2936,7 +2936,7 @@ ProjectManager::ProjectManager() { Ref<DirAccess> dir_access = DirAccess::create(DirAccess::AccessType::ACCESS_FILESYSTEM); - String default_project_path = EditorSettings::get_singleton()->get("filesystem/directories/default_project_path"); + String default_project_path = EDITOR_GET("filesystem/directories/default_project_path"); if (!dir_access->dir_exists(default_project_path)) { Error error = dir_access->make_dir_recursive(default_project_path); if (error != OK) { @@ -2944,7 +2944,7 @@ ProjectManager::ProjectManager() { } } - String autoscan_path = EditorSettings::get_singleton()->get("filesystem/directories/autoscan_project_path"); + String autoscan_path = EDITOR_GET("filesystem/directories/autoscan_project_path"); if (!autoscan_path.is_empty()) { if (dir_access->dir_exists(autoscan_path)) { _scan_begin(autoscan_path); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 8175f356c7..f23b08409e 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -352,7 +352,7 @@ void ProjectSettingsEditor::_action_added(const String &p_name) { void ProjectSettingsEditor::_action_edited(const String &p_name, const Dictionary &p_action) { const String property_name = "input/" + p_name; - Dictionary old_val = ProjectSettings::get_singleton()->get(property_name); + Dictionary old_val = GLOBAL_GET(property_name); if (old_val["deadzone"] != p_action["deadzone"]) { // Deadzone Changed @@ -387,7 +387,7 @@ void ProjectSettingsEditor::_action_edited(const String &p_name, const Dictionar void ProjectSettingsEditor::_action_removed(const String &p_name) { const String property_name = "input/" + p_name; - Dictionary old_val = ProjectSettings::get_singleton()->get(property_name); + Dictionary old_val = GLOBAL_GET(property_name); int order = ProjectSettings::get_singleton()->get_order(property_name); undo_redo->create_action(TTR("Erase Input Action")); @@ -410,7 +410,7 @@ void ProjectSettingsEditor::_action_renamed(const String &p_old_name, const Stri "An action with this name already exists."); int order = ProjectSettings::get_singleton()->get_order(old_property_name); - Dictionary action = ProjectSettings::get_singleton()->get(old_property_name); + Dictionary action = GLOBAL_GET(old_property_name); undo_redo->create_action(TTR("Rename Input Action Event")); // Do: clear old, set new @@ -505,7 +505,7 @@ void ProjectSettingsEditor::_update_action_map_editor() { // Strip the "input/" from the left. String display_name = property_name.substr(String("input/").size() - 1); - Dictionary action = ProjectSettings::get_singleton()->get(property_name); + Dictionary action = GLOBAL_GET(property_name); ActionMapEditor::ActionInfo action_info; action_info.action = action; diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index ba3be55386..6a935b4f7b 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -946,7 +946,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT); } break; case TOOL_AUTO_EXPAND: { - scene_tree->set_auto_expand_selected(!EditorSettings::get_singleton()->get("docks/scene_tree/auto_expand_to_selected"), true); + scene_tree->set_auto_expand_selected(!EDITOR_GET("docks/scene_tree/auto_expand_to_selected"), true); } break; case TOOL_SCENE_EDITABLE_CHILDREN: { if (!profile_allow_editing) { @@ -1325,7 +1325,7 @@ void SceneTreeDock::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { clear_inherit_confirm->connect("confirmed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_SCENE_CLEAR_INHERITANCE_CONFIRM, false)); - scene_tree->set_auto_expand_selected(EditorSettings::get_singleton()->get("docks/scene_tree/auto_expand_to_selected"), false); + scene_tree->set_auto_expand_selected(EDITOR_GET("docks/scene_tree/auto_expand_to_selected"), false); } break; case NOTIFICATION_EXIT_TREE: { @@ -1333,7 +1333,7 @@ void SceneTreeDock::_notification(int p_what) { } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - scene_tree->set_auto_expand_selected(EditorSettings::get_singleton()->get("docks/scene_tree/auto_expand_to_selected"), false); + scene_tree->set_auto_expand_selected(EDITOR_GET("docks/scene_tree/auto_expand_to_selected"), false); button_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); button_instance->set_icon(get_theme_icon(SNAME("Instance"), SNAME("EditorIcons"))); button_create_script->set_icon(get_theme_icon(SNAME("ScriptCreate"), SNAME("EditorIcons"))); @@ -2448,7 +2448,7 @@ void SceneTreeDock::_new_scene_from(String p_file) { } int flg = 0; - if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources")) { + if (EDITOR_GET("filesystem/on_save/compress_binary_resources")) { flg |= ResourceSaver::FLAG_COMPRESS; } @@ -2895,7 +2895,7 @@ void SceneTreeDock::_update_tree_menu() { tree_menu->add_separator(); tree_menu->add_check_item(TTR("Auto Expand to Selected"), TOOL_AUTO_EXPAND); - tree_menu->set_item_checked(tree_menu->get_item_index(TOOL_AUTO_EXPAND), EditorSettings::get_singleton()->get("docks/scene_tree/auto_expand_to_selected")); + tree_menu->set_item_checked(tree_menu->get_item_index(TOOL_AUTO_EXPAND), EDITOR_GET("docks/scene_tree/auto_expand_to_selected")); } void SceneTreeDock::_update_filter_menu() { diff --git a/editor/shader_globals_editor.cpp b/editor/shader_globals_editor.cpp index 473bbd69d9..6967536692 100644 --- a/editor/shader_globals_editor.cpp +++ b/editor/shader_globals_editor.cpp @@ -107,7 +107,7 @@ protected: String path = "shader_globals/" + String(p_name); undo_redo->add_do_property(ProjectSettings::get_singleton(), path, gv); - undo_redo->add_undo_property(ProjectSettings::get_singleton(), path, ProjectSettings::get_singleton()->get(path)); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), path, GLOBAL_GET(path)); undo_redo->add_do_method(this, "_var_changed"); undo_redo->add_undo_method(this, "_var_changed"); block_update = true; @@ -420,7 +420,7 @@ void ShaderGlobalsEditor::_variable_deleted(const String &p_variable) { undo_redo->add_undo_method(RS::get_singleton(), "global_shader_parameter_add", p_variable, RS::get_singleton()->global_shader_parameter_get_type(p_variable), RS::get_singleton()->global_shader_parameter_get(p_variable)); undo_redo->add_do_property(ProjectSettings::get_singleton(), "shader_globals/" + p_variable, Variant()); - undo_redo->add_undo_property(ProjectSettings::get_singleton(), "shader_globals/" + p_variable, ProjectSettings::get_singleton()->get("shader_globals/" + p_variable)); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), "shader_globals/" + p_variable, GLOBAL_GET("shader_globals/" + p_variable)); undo_redo->add_do_method(this, "_changed"); undo_redo->add_undo_method(this, "_changed"); undo_redo->commit_action(); |