I have an EditorPlugin with a control that modifies a custom project setting. Sometimes lots of modifications are done in a short time period, so I’d like to mark the ProjectSettings as dirty rather than saving after every change to speed things up. How do I do this?
I looked at the source code for ProjectSettingsEditor and found that it simply uses a 1.5 second timer to delay saving. This way a number of settings changes can be queued up and will only be saved once. This can be done in GDScript as follows:
Then simply call queue_save() to save the ProjectSettings. Every time the timer is started, it will restart the countdown. This way the save will only happen after 1.5 seconds of no calls to queue_save().