You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
ProjectSettings add dirty flag and project_settings_changed signal
Most frames there will be no change in project settings, and it makes no sense to read settings every frame in case of changes, as a large number of string compares are involved. This PR adds a signal to ProjectSettings that can be subscribed to in order to keep local settings up to date with ProjectSettings. In addition a function `ProjectSettings::has_changes()` is provided for objects outside the signal system (e.g. Rasterizers).
This commit is contained in:
@@ -143,7 +143,16 @@ void ProjectSettingsEditor::_notification(int p_what) {
|
||||
restart_icon->set_texture(get_icon("StatusWarning", "EditorIcons"));
|
||||
restart_label->add_color_override("font_color", get_color("warning_color", "Editor"));
|
||||
|
||||
// The ImportDefaultsEditor changes settings which must be read by this object when changed
|
||||
ProjectSettings::get_singleton()->connect("project_settings_changed", this, "_settings_changed");
|
||||
|
||||
} break;
|
||||
case NOTIFICATION_EXIT_TREE: {
|
||||
if (ProjectSettings::get_singleton()) {
|
||||
ProjectSettings::get_singleton()->disconnect("project_settings_changed", this, "_settings_changed");
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_POPUP_HIDE: {
|
||||
EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "project_settings", get_rect());
|
||||
set_process_unhandled_input(false);
|
||||
@@ -2141,7 +2150,6 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
|
||||
import_defaults_editor = memnew(ImportDefaultsEditor);
|
||||
import_defaults_editor->set_name(TTR("Import Defaults"));
|
||||
tab_container->add_child(import_defaults_editor);
|
||||
import_defaults_editor->connect("project_settings_changed", this, "_settings_changed");
|
||||
|
||||
timer = memnew(Timer);
|
||||
timer->set_wait_time(1.5);
|
||||
|
||||
Reference in New Issue
Block a user