1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +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:
lawnjelly
2021-10-01 11:47:28 +01:00
parent 4ed2c8ee08
commit f0af29346b
8 changed files with 132 additions and 36 deletions

View File

@@ -99,8 +99,8 @@ void ImportDefaultsEditor::_save() {
} else {
ProjectSettings::get_singleton()->set("importer_defaults/" + settings->importer->get_importer_name(), Variant());
}
emit_signal("project_settings_changed");
// Calling ProjectSettings::set() causes the signal "project_settings_changed" to be sent to ProjectSettings.
// ProjectSettingsEditor subscribes to this and can reads the settings updated here.
}
}