-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add settings_changed
signal to ProjectSettings
#62038
Conversation
Would it make sense to modify #45956 at the same time, and use the name If we have decided that having such a signal available outside the editor is more useful than editor only, it might be prudent to remove the EditorNode signal (and maybe EditorPlugin, not sure on how this works) and keep a single consistent way of using this (for less confusion in the future). Better to break compatibility here before 4.0 imo. Something to check with @reduz ? |
It is probably crashing BTW because of See #53296 (comment) |
The main problem with this IMO is that we don't want people writing plugins using this signal because it can be called a ton of times per frame by some of the editors that store their data there, as this endangers running into very inefficient updates. We already have one that saves the project settings and calls a signal a small amount of time after the last edit, so we should most likely expose this to EditorPlugin than adding a singal to ProjectSettings, which has little use. |
@reduz The signal is limited to emit up to once per frame. |
This PR could be helpful to implement godotengine/godot-proposals#2455 and other project settings to impact all BaseMaterial3Ds at run-time, as I don't see another way to do it without large changes to RenderingServer. User-provided shaders could also benefit from this to offer run-time settings that users can change in options menus. |
settings_changed
signal to ProjectSettings
Is the crash mentioned in the OP still happening with this PR? Should likely be a draft if so. |
Doesn't seem to crash anymore. I think I fixed it and forgot to comment. |
It looks fine to me. 👍 My only remaining thoughts are that the resulting situation is a little messy: #45956 still causes the editor node to have a signal called One slight alternative would be to call them both That's more an architectural decision though. EDIT : Also - probably needs running by @reduz again to make sure he is ok with this approach, as he voiced concerns above. |
Don't think there is a point in that. When emitted by
The concern was that it could be called multiple times a frame, but that's not the case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but may be worth updating EditorPlugin
to rely on this and removing the signal from EditorNode
as discussed above.
Should |
In plugins? Yeah, I guess we can mark it as deprecated and suggest using the new signal. |
I looked into changes required to remove the EditorNode signal and it seems to be used a lot. I think it can be done in a separate PR; I'll make a follow-up soon. |
Thanks! |
Closes #62020
This is done differently than in 3.x and the signal is named
settings_changed
for consistency with EditorSettings.For some reason I get a crash when closing though:
Not sure why.