1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Add an editor setting to import resources while unfocused

This can be used to speed up iteration by starting the import process
earlier when saving files in the project folder. This also allows getting
visual feedback on changes without having to click the editor window,
which is useful with multi-monitor setups.

The downside is that this increases idle CPU usage and may steal CPU
time from other applications when importing resources, so this is
disabled by default.
This commit is contained in:
Hugo Locurcio
2023-05-12 07:24:40 +02:00
parent 4728ff30c0
commit ed540964ee
4 changed files with 18 additions and 1 deletions

View File

@@ -771,6 +771,12 @@ void EditorNode::_notification(int p_what) {
EditorFileDialog::set_default_display_mode((EditorFileDialog::DisplayMode)EDITOR_GET("filesystem/file_dialog/display_mode").operator int());
}
if (EDITOR_GET("interface/editor/import_resources_when_unfocused")) {
scan_changes_timer->start();
} else {
scan_changes_timer->stop();
}
follow_system_theme = EDITOR_GET("interface/theme/follow_system_theme");
use_system_accent_color = EDITOR_GET("interface/theme/use_system_accent_color");
@@ -6577,6 +6583,12 @@ EditorNode::EditorNode() {
editor_layout_save_delay_timer->set_one_shot(true);
editor_layout_save_delay_timer->connect("timeout", callable_mp(this, &EditorNode::_save_editor_layout));
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->connect("timeout", callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan_changes));
add_child(scan_changes_timer);
top_split = memnew(VSplitContainer);
center_split->add_child(top_split);
top_split->set_v_size_flags(Control::SIZE_EXPAND_FILL);