Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to get list of editor settings changed when saving editor settings. Optimised settings changed notification. #53839

Merged

Conversation

EricEzaM
Copy link
Contributor

Getting the settings which were changed has been a common request. This also allows for some optimisation.

Debug build time savings
Saving settings 'hitch' before: 1000ms
Saving settings 'hitch' after: 350ms

There is still time to be gained, for example in EditorInspector, update_tree() takes 0.25ms to run, but I am not sure why this is called when editor settings are changed. What changes is it responding to? Once we know that, then a check can be added to only conditionally run that method (e.g. if it is only changing due to theme changes)

godothing.mp4

@EricEzaM EricEzaM added this to the 4.0 milestone Oct 15, 2021
@EricEzaM EricEzaM force-pushed the editor-settings-changed-settings branch from 0a5d899 to a76b6b0 Compare October 15, 2021 13:27
@YuriSizov YuriSizov requested a review from a team October 15, 2021 13:36
editor/editor_node.cpp Outdated Show resolved Hide resolved
@YuriSizov YuriSizov requested a review from a team October 15, 2021 13:40
@EricEzaM EricEzaM force-pushed the editor-settings-changed-settings branch from a76b6b0 to 1baa072 Compare October 17, 2021 00:59
@EricEzaM EricEzaM force-pushed the editor-settings-changed-settings branch from 1baa072 to ce9941b Compare October 17, 2021 01:49
@EricEzaM
Copy link
Contributor Author

Also it turns out when you change a shortcut, set is not actually called in editor settings. The shortcut's memory is changed directly, and then when the settings are saved, get is called and the new shortcut is read. So for shortcuts, I have just added a generic shortcuts and builtin_action_overrides strings which will be added to the changed_settings array when those are changed.

editor/editor_settings.h Outdated Show resolved Hide resolved
editor/editor_settings.cpp Outdated Show resolved Hide resolved
@KoBeWi
Copy link
Member

KoBeWi commented Dec 25, 2021

Looks good overall. We should probably go over all uses of NOTIFICATION_EDITOR_SETTINGS_CHANGED and only update when necessary, but this can be done in a follow-up PR.

@akien-mga
Copy link
Member

The new methods should be synced in the class reference (and documented): https://github.com/godotengine/godot/runs/3916673006?check_suite_focus=true

@KoBeWi
Copy link
Member

KoBeWi commented Mar 2, 2022

@EricEzaM It would be nice to have this finished and merged. Aside from speed ups, it helps to fix some annoying issues.

@EricEzaM EricEzaM force-pushed the editor-settings-changed-settings branch from ce9941b to 66cd988 Compare March 3, 2022 12:05
@EricEzaM EricEzaM requested a review from a team as a code owner March 3, 2022 12:05
@EricEzaM
Copy link
Contributor Author

EricEzaM commented Mar 3, 2022

Made changes as per request, added documentation.

editor/editor_settings.cpp Outdated Show resolved Hide resolved
@KoBeWi
Copy link
Member

KoBeWi commented Mar 3, 2022

This error appears when changing actions:

Cannot mark nonexistent setting as changed: builtin_action_overrides

And this when changing shortcuts:

Cannot mark nonexistent setting as changed: shortcuts

Everything else looks ok.

@EricEzaM
Copy link
Contributor Author

EricEzaM commented Mar 4, 2022

This error appears when changing actions:

Cannot mark nonexistent setting as changed: builtin_action_overrides

And this when changing shortcuts:

Cannot mark nonexistent setting as changed: shortcuts

Everything else looks ok.

Ah bugger, I added that last minute for validation that the setting passed to the mark as changed method actually exists. I guess I will remove it, I was uncertain about adding it in the first place anyway.

@EricEzaM EricEzaM force-pushed the editor-settings-changed-settings branch from 66cd988 to daceae7 Compare March 5, 2022 09:26
@akien-mga akien-mga merged commit cdd63fa into godotengine:master Mar 5, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants