For some unknown reason, playing the project opens the initial godot screen (project selector), about 50% of the time on average. I only got it to happen once in the video, but sometimes it does it for a solid streak of 20 or more times and i'm just stuck with opening the project selector, and clicking run on my project there. I noticed this only happened after i made my own plugin, and when it's disabled, the issue doesn't occur anymore. Sometimes its after i've made a change and saved something, it seems to be random or has some causes which are super random. Any help would be nice, it's a pretty stupid and annoying bug.
#Playing the project opens the initial project selector.
1 messages · Page 1 of 1 (latest)
You have a race condition.
There are at least 2 possible issues:
- After incrementing version you call
ProjectSettings.save()what most likely triggersfilesystem_changedas well - "Run Project" button autosaves project. Your plugin increments project version multiple times while project exporter runs in another thread and accesses version, config or probably changes filesystem state, so you get undefined state here.
You can probably partially solve this by saving your subversion in another settings field, or implementing your own play button which would save, increment, then disable plugin and run project.
But I don' see much value in such versions, it's better to consider using VCS and base versions on tags or commit names.
You can also try to disconnect signal before saving project and re-enable it after. But there are still would be corner cases and this code is too easy to be broken, so it's a trap for future you.