You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
There's no way for a plugin to know if a project's settings have been changed. Currently the best way to use project settings is to re-fetch them at the point the setting is used. It's not feasible to do this for all types of settings, for example, a toggle for an operation that happens in the background. In my plugins I'm getting around this by polling settings on a timer, but that solution feels a bit ugly.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
An extra signal called emitted through EditorPlugin (?) called settings_changed. Optionally we could include the key of the setting that was changed, but having the signal at all would be a great start.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If this enhancement will not be used often, can it be worked around with a few lines of script?
You could work around this by implementing polling yourself. It's reasonably trivial, but this very much feels like functionality that should already be there. We already have methods for plugins to get and set the settings.
Is there a reason why this should be core and not an add-on in the asset library?
Fixes a gap in existing core functionality.
The text was updated successfully, but these errors were encountered:
What about ProjectSettings.settings_changed signal (instead of EditorPlugin one)?
I also think some info on "what setting was changed" would be useful as well, so it could be setting_changed instead of settings_changed:
String ProjectSetings.setting_changed()
This would allow to do something like:
funcon_setting_changed(setting:String):
...
Calinou
changed the title
Signal for changes in project settings
Emit a signal when a setting is changed in the Project Settings
Jan 20, 2021
Apparently, godotengine/godot#45956 added a project_settings_changed signal to EditorPlugin API. Should probably be manually backported to 3.x, because I don't think that this PR itself can be backported.
Describe the project you are working on
Plugin
Describe the problem or limitation you are having in your project
There's no way for a plugin to know if a project's settings have been changed. Currently the best way to use project settings is to re-fetch them at the point the setting is used. It's not feasible to do this for all types of settings, for example, a toggle for an operation that happens in the background. In my plugins I'm getting around this by polling settings on a timer, but that solution feels a bit ugly.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
An extra signal called emitted through
EditorPlugin
(?) calledsettings_changed
. Optionally we could include the key of the setting that was changed, but having the signal at all would be a great start.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If this enhancement will not be used often, can it be worked around with a few lines of script?
You could work around this by implementing polling yourself. It's reasonably trivial, but this very much feels like functionality that should already be there. We already have methods for plugins to get and set the settings.
Is there a reason why this should be core and not an add-on in the asset library?
Fixes a gap in existing core functionality.
The text was updated successfully, but these errors were encountered: