1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +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

@@ -243,6 +243,7 @@ public:
private:
int index;
bool _project_settings_change_pending;
ViewType view_type;
void _menu_option(int p_option);
void _set_auto_orthogonal();
@@ -458,6 +459,8 @@ private:
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
void _project_settings_changed();
protected:
void _notification(int p_what);
static void _bind_methods();