Reorganize interface/editor setttings
This commit is contained in:
parent
95535167b3
commit
1b543e85cf
29 changed files with 365 additions and 286 deletions
|
|
@ -457,7 +457,7 @@ void EditorNode::shortcut_input(const Ref<InputEvent> &p_event) {
|
|||
}
|
||||
|
||||
void EditorNode::_update_vsync_mode() {
|
||||
const DisplayServer::VSyncMode window_vsync_mode = DisplayServer::VSyncMode(int(EDITOR_GET("interface/editor/vsync_mode")));
|
||||
const DisplayServer::VSyncMode window_vsync_mode = DisplayServer::VSyncMode(int(EDITOR_GET("interface/editor/display/vsync_mode")));
|
||||
DisplayServer::get_singleton()->window_set_vsync_mode(window_vsync_mode);
|
||||
}
|
||||
|
||||
|
|
@ -929,7 +929,7 @@ void EditorNode::_notification(int p_what) {
|
|||
// Theme has already been created in the constructor, so we can skip that step.
|
||||
_update_theme(true);
|
||||
|
||||
OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/low_processor_mode_sleep_usec")));
|
||||
OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/timers/low_processor_mode_sleep_usec")));
|
||||
get_tree()->get_root()->set_as_audio_listener_3d(false);
|
||||
get_tree()->get_root()->set_as_audio_listener_2d(false);
|
||||
get_tree()->get_root()->set_snap_2d_transforms_to_pixel(false);
|
||||
|
|
@ -1000,7 +1000,7 @@ void EditorNode::_notification(int p_what) {
|
|||
|
||||
RenderingServer::get_singleton()->viewport_set_disable_2d(get_scene_root()->get_viewport_rid(), true);
|
||||
RenderingServer::get_singleton()->viewport_set_environment_mode(get_viewport()->get_viewport_rid(), RSE::VIEWPORT_ENVIRONMENT_DISABLED);
|
||||
DisplayServer::get_singleton()->screen_set_keep_on(EDITOR_GET("interface/editor/keep_screen_on"));
|
||||
DisplayServer::get_singleton()->screen_set_keep_on(EDITOR_GET("interface/editor/display/keep_screen_on"));
|
||||
|
||||
feature_profile_manager->notify_changed();
|
||||
|
||||
|
|
@ -1040,7 +1040,7 @@ void EditorNode::_notification(int p_what) {
|
|||
|
||||
case NOTIFICATION_APPLICATION_FOCUS_IN: {
|
||||
// Restore the original FPS cap after focusing back on the editor.
|
||||
OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/low_processor_mode_sleep_usec")));
|
||||
OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/timers/low_processor_mode_sleep_usec")));
|
||||
|
||||
if (_is_project_data_missing()) {
|
||||
project_data_missing->popup_centered();
|
||||
|
|
@ -1055,13 +1055,13 @@ void EditorNode::_notification(int p_what) {
|
|||
|
||||
case NOTIFICATION_APPLICATION_FOCUS_OUT: {
|
||||
// Save on focus loss before applying the FPS limit to avoid slowing down the saving process.
|
||||
if (EDITOR_GET("interface/editor/save_on_focus_loss")) {
|
||||
if (EDITOR_GET("interface/editor/behavior/save_on_focus_loss")) {
|
||||
_save_scene_silently();
|
||||
}
|
||||
|
||||
// Set a low FPS cap to decrease CPU/GPU usage while the editor is unfocused.
|
||||
if (unfocused_low_processor_usage_mode_enabled) {
|
||||
OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/unfocused_low_processor_mode_sleep_usec")));
|
||||
OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/timers/unfocused_low_processor_mode_sleep_usec")));
|
||||
}
|
||||
} break;
|
||||
|
||||
|
|
@ -1079,9 +1079,9 @@ void EditorNode::_notification(int p_what) {
|
|||
FileDialog::set_default_display_mode(EDITOR_GET("filesystem/file_dialog/display_mode"));
|
||||
}
|
||||
|
||||
if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/tablet_driver")) {
|
||||
if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/input/tablet_driver")) {
|
||||
String tablet_driver = GLOBAL_GET("input_devices/pen_tablet/driver");
|
||||
int tablet_driver_idx = EDITOR_GET("interface/editor/tablet_driver");
|
||||
int tablet_driver_idx = EDITOR_GET("interface/editor/input/tablet_driver");
|
||||
if (tablet_driver_idx != -1) {
|
||||
tablet_driver = DisplayServer::get_singleton()->tablet_get_driver_name(tablet_driver_idx);
|
||||
}
|
||||
|
|
@ -1092,7 +1092,7 @@ void EditorNode::_notification(int p_what) {
|
|||
print_verbose("Using \"" + DisplayServer::get_singleton()->tablet_get_current_driver() + "\" pen tablet driver...");
|
||||
}
|
||||
|
||||
if (EDITOR_GET("interface/editor/import_resources_when_unfocused")) {
|
||||
if (EDITOR_GET("interface/editor/behavior/import_resources_when_unfocused")) {
|
||||
scan_changes_timer->start();
|
||||
} else {
|
||||
scan_changes_timer->stop();
|
||||
|
|
@ -1108,12 +1108,12 @@ void EditorNode::_notification(int p_what) {
|
|||
recent_scenes->reset_size();
|
||||
}
|
||||
|
||||
if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/dragging_")) {
|
||||
theme->set_constant("dragging_unfold_wait_msec", "Tree", (float)EDITOR_GET("interface/editor/dragging_hover_wait_seconds") * 1000);
|
||||
theme->set_constant("hover_switch_wait_msec", "TabBar", (float)EDITOR_GET("interface/editor/dragging_hover_wait_seconds") * 1000);
|
||||
if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/timers/dragging_")) {
|
||||
theme->set_constant("dragging_unfold_wait_msec", "Tree", (float)EDITOR_GET("interface/editor/timers/dragging_hover_wait_seconds") * 1000);
|
||||
theme->set_constant("hover_switch_wait_msec", "TabBar", (float)EDITOR_GET("interface/editor/timers/dragging_hover_wait_seconds") * 1000);
|
||||
}
|
||||
|
||||
if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor")) {
|
||||
if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/docks")) {
|
||||
editor_dock_manager->update_tab_styles();
|
||||
}
|
||||
|
||||
|
|
@ -1147,11 +1147,13 @@ void EditorNode::_notification(int p_what) {
|
|||
}
|
||||
}
|
||||
|
||||
if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor")) {
|
||||
if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/appearance")) {
|
||||
_update_update_spinner();
|
||||
_update_vsync_mode();
|
||||
_update_main_menu_type();
|
||||
DisplayServer::get_singleton()->screen_set_keep_on(EDITOR_GET("interface/editor/keep_screen_on"));
|
||||
}
|
||||
if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/display")) {
|
||||
_update_vsync_mode();
|
||||
DisplayServer::get_singleton()->screen_set_keep_on(EDITOR_GET("interface/editor/display/keep_screen_on"));
|
||||
}
|
||||
|
||||
#if defined(MODULE_GDSCRIPT_ENABLED) || defined(MODULE_MONO_ENABLED)
|
||||
|
|
@ -1176,12 +1178,12 @@ void EditorNode::_update_update_spinner() {
|
|||
#else
|
||||
const bool in_dev = false;
|
||||
#endif
|
||||
const int show_update_spinner_setting = EDITOR_GET("interface/editor/show_update_spinner");
|
||||
const int show_update_spinner_setting = EDITOR_GET("interface/editor/appearance/show_update_spinner");
|
||||
should_display_spinner = (show_update_spinner_setting == 0 && in_dev) || show_update_spinner_setting == 1;
|
||||
}
|
||||
update_spinner->set_visible(should_display_spinner);
|
||||
|
||||
const bool update_continuously = EDITOR_GET("interface/editor/update_continuously");
|
||||
const bool update_continuously = EDITOR_GET("interface/editor/display/update_continuously");
|
||||
OS::get_singleton()->set_low_processor_usage_mode(!update_continuously);
|
||||
|
||||
if (!update_spinner->is_visible()) {
|
||||
|
|
@ -3709,7 +3711,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|||
break;
|
||||
}
|
||||
|
||||
bool save_each = EDITOR_GET("interface/editor/save_each_scene_on_quit");
|
||||
bool save_each = EDITOR_GET("interface/editor/behavior/save_each_scene_on_quit");
|
||||
if (_next_unsaved_scene(!save_each) == -1) {
|
||||
if (EditorUndoRedoManager::get_singleton()->is_history_unsaved(EditorUndoRedoManager::GLOBAL_HISTORY)) {
|
||||
if (p_option == PROJECT_RELOAD_CURRENT_PROJECT) {
|
||||
|
|
@ -3781,16 +3783,16 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|||
_discard_changes();
|
||||
} break;
|
||||
case SPINNER_UPDATE_CONTINUOUSLY: {
|
||||
EditorSettings::get_singleton()->set("interface/editor/update_continuously", true);
|
||||
EditorSettings::get_singleton()->set("interface/editor/display/update_continuously", true);
|
||||
_update_update_spinner();
|
||||
show_accept(TTR("This option is deprecated. Situations where refresh must be forced are now considered a bug. Please report."), TTR("OK"));
|
||||
} break;
|
||||
case SPINNER_UPDATE_WHEN_CHANGED: {
|
||||
EditorSettings::get_singleton()->set("interface/editor/update_continuously", false);
|
||||
EditorSettings::get_singleton()->set("interface/editor/display/update_continuously", false);
|
||||
_update_update_spinner();
|
||||
} break;
|
||||
case SPINNER_UPDATE_SPINNER_HIDE: {
|
||||
EditorSettings::get_singleton()->set("interface/editor/show_update_spinner", 2); // Disabled
|
||||
EditorSettings::get_singleton()->set("interface/editor/appearance/show_update_spinner", 2); // Disabled
|
||||
_update_update_spinner();
|
||||
} break;
|
||||
case EDITOR_OPEN_SETTINGS: {
|
||||
|
|
@ -3960,7 +3962,7 @@ void EditorNode::_save_screenshot_with_embedded_process(int64_t p_w, int64_t p_h
|
|||
Error error = img->save_png(p_path);
|
||||
ERR_FAIL_COND_MSG(error != OK, "Cannot save screenshot to file '" + p_path + "'.");
|
||||
|
||||
if (EDITOR_GET("interface/editor/automatically_open_screenshots")) {
|
||||
if (EDITOR_GET("interface/editor/behavior/automatically_open_screenshots")) {
|
||||
OS::get_singleton()->shell_show_in_file_manager(ProjectSettings::get_singleton()->globalize_path(p_path), true);
|
||||
}
|
||||
}
|
||||
|
|
@ -3977,7 +3979,7 @@ void EditorNode::_save_screenshot(const String &p_path) {
|
|||
Error error = img->save_png(p_path);
|
||||
ERR_FAIL_COND_MSG(error != OK, "Cannot save screenshot to file '" + p_path + "'.");
|
||||
|
||||
if (EDITOR_GET("interface/editor/automatically_open_screenshots")) {
|
||||
if (EDITOR_GET("interface/editor/behavior/automatically_open_screenshots")) {
|
||||
OS::get_singleton()->shell_show_in_file_manager(ProjectSettings::get_singleton()->globalize_path(p_path), true);
|
||||
}
|
||||
}
|
||||
|
|
@ -4738,7 +4740,7 @@ bool EditorNode::is_scene_open(const String &p_path) {
|
|||
}
|
||||
|
||||
bool EditorNode::is_multi_window_enabled() const {
|
||||
return !SceneTree::get_singleton()->get_root()->is_embedding_subwindows() && !EDITOR_GET("interface/editor/single_window_mode") && EDITOR_GET("interface/multi_window/enable");
|
||||
return !SceneTree::get_singleton()->get_root()->is_embedding_subwindows() && !EDITOR_GET("interface/editor/display/single_window_mode") && EDITOR_GET("interface/multi_window/enable");
|
||||
}
|
||||
|
||||
int EditorNode::new_scene() {
|
||||
|
|
@ -5336,7 +5338,7 @@ String EditorNode::get_multiwindow_support_tooltip_text() const {
|
|||
} else {
|
||||
return TTR("Multi-window support is not available because the current platform doesn't support multiple windows.");
|
||||
}
|
||||
} else if (EDITOR_GET("interface/editor/single_window_mode")) {
|
||||
} else if (EDITOR_GET("interface/editor/display/single_window_mode")) {
|
||||
return TTR("Multi-window support is not available because Interface > Editor > Single Window Mode is enabled in the editor settings.");
|
||||
}
|
||||
|
||||
|
|
@ -6737,7 +6739,7 @@ void EditorNode::_prepare_save_confirmation_popup() {
|
|||
}
|
||||
|
||||
void EditorNode::_toggle_distraction_free_mode() {
|
||||
if (EDITOR_GET("interface/editor/separate_distraction_mode")) {
|
||||
if (EDITOR_GET("interface/editor/behavior/separate_distraction_mode")) {
|
||||
int screen = editor_main_screen->get_selected_index();
|
||||
|
||||
if (screen == EditorMainScreen::EDITOR_SCRIPT) {
|
||||
|
|
@ -6753,7 +6755,7 @@ void EditorNode::_toggle_distraction_free_mode() {
|
|||
}
|
||||
|
||||
void EditorNode::update_distraction_free_mode() {
|
||||
if (!EDITOR_GET("interface/editor/separate_distraction_mode")) {
|
||||
if (!EDITOR_GET("interface/editor/behavior/separate_distraction_mode")) {
|
||||
return;
|
||||
}
|
||||
int screen = editor_main_screen->get_selected_index();
|
||||
|
|
@ -8078,9 +8080,9 @@ void EditorNode::_add_to_main_menu(const String &p_name, PopupMenu *p_menu) {
|
|||
}
|
||||
|
||||
void EditorNode::_update_main_menu_type() {
|
||||
bool can_expand = bool(EDITOR_GET("interface/editor/expand_to_title")) && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_EXTEND_TO_TITLE);
|
||||
bool use_menu_button = EDITOR_GET("interface/editor/collapse_main_menu");
|
||||
bool global_menu = !bool(EDITOR_GET("interface/editor/use_embedded_menu")) && NativeMenu::get_singleton()->has_feature(NativeMenu::FEATURE_GLOBAL_MENU);
|
||||
bool can_expand = bool(EDITOR_GET("interface/editor/appearance/expand_to_title")) && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_EXTEND_TO_TITLE);
|
||||
bool use_menu_button = EDITOR_GET("interface/editor/appearance/collapse_main_menu");
|
||||
bool global_menu = !bool(EDITOR_GET("interface/editor/appearance/use_embedded_menu")) && NativeMenu::get_singleton()->has_feature(NativeMenu::FEATURE_GLOBAL_MENU);
|
||||
MenuType new_menu_type;
|
||||
if (global_menu) {
|
||||
new_menu_type = MENU_TYPE_GLOBAL;
|
||||
|
|
@ -8334,7 +8336,7 @@ EditorNode::EditorNode() {
|
|||
}
|
||||
|
||||
{
|
||||
int display_scale = EDITOR_GET("interface/editor/display_scale");
|
||||
int display_scale = EDITOR_GET("interface/editor/appearance/display_scale");
|
||||
|
||||
switch (display_scale) {
|
||||
case 0:
|
||||
|
|
@ -8360,7 +8362,7 @@ EditorNode::EditorNode() {
|
|||
EditorScale::set_scale(2.0);
|
||||
break;
|
||||
default:
|
||||
EditorScale::set_scale(EDITOR_GET("interface/editor/custom_display_scale"));
|
||||
EditorScale::set_scale(EDITOR_GET("interface/editor/appearance/custom_display_scale"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -8376,13 +8378,13 @@ EditorNode::EditorNode() {
|
|||
FileDialog::set_default_show_hidden_files(EDITOR_GET("filesystem/file_dialog/show_hidden_files"));
|
||||
FileDialog::set_default_display_mode(EDITOR_GET("filesystem/file_dialog/display_mode"));
|
||||
|
||||
int swap_cancel_ok = EDITOR_GET("interface/editor/accept_dialog_cancel_ok_buttons");
|
||||
int swap_cancel_ok = EDITOR_GET("interface/editor/appearance/accept_dialog_cancel_ok_buttons");
|
||||
if (swap_cancel_ok != 0) { // 0 is auto, set in register_scene based on DisplayServer.
|
||||
// Swap on means OK first.
|
||||
AcceptDialog::set_swap_cancel_ok(swap_cancel_ok == 2);
|
||||
}
|
||||
|
||||
int ed_root_dir = EDITOR_GET("interface/editor/ui_layout_direction");
|
||||
int ed_root_dir = EDITOR_GET("interface/editor/localization/ui_layout_direction");
|
||||
Control::set_root_layout_direction(ed_root_dir);
|
||||
Window::set_root_layout_direction(ed_root_dir);
|
||||
|
||||
|
|
@ -8713,7 +8715,7 @@ EditorNode::EditorNode() {
|
|||
|
||||
scan_changes_timer = memnew(Timer);
|
||||
scan_changes_timer->set_wait_time(0.5);
|
||||
scan_changes_timer->set_autostart(EDITOR_GET("interface/editor/import_resources_when_unfocused"));
|
||||
scan_changes_timer->set_autostart(EDITOR_GET("interface/editor/behavior/import_resources_when_unfocused"));
|
||||
scan_changes_timer->connect("timeout", callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan_changes));
|
||||
add_child(scan_changes_timer);
|
||||
|
||||
|
|
@ -8897,7 +8899,7 @@ EditorNode::EditorNode() {
|
|||
ED_SHORTCUT_AND_COMMAND("editor/editor_prev", TTRC("Open the previous Editor"));
|
||||
|
||||
// Editor menu and toolbar.
|
||||
bool can_expand = bool(EDITOR_GET("interface/editor/expand_to_title")) && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_EXTEND_TO_TITLE);
|
||||
bool can_expand = bool(EDITOR_GET("interface/editor/appearance/expand_to_title")) && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_EXTEND_TO_TITLE);
|
||||
|
||||
#ifdef MACOS_ENABLED
|
||||
if (NativeMenu::get_singleton()->has_system_menu(NativeMenu::APPLICATION_MENU_ID)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue