pause: Refer to title scene by path, not as a PackedScene #1833
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The pause overlay is an autoload so it is initialised early in the
project setup.
Previously pause_overlay.gd referenced the title screen as a
PackedScene. The title screen transitively refers to credits lists
imported from CSV with the threadbare_credits plugin. This means that
before all scripts can be parsed and the class database initialised, the
import plugin must be able to import the CSV. However the import plugin
previously referred to the CreditsTeam and CreditsTeamRoster resource
subclasses by name, which requires the class database to be initialised:
a circular dependency. This is apparently broken by Godot failing to
load the import plugin, which causes the CSV files to instead be
imported as translation files using the built in CSV translation
importer, breaking the project.
The problem goes away once the project has been imported once because
.godot/global_script_class_cache.cfg has been initialised, so the
resource types can be found by name. This is why I didn't hit it when
writing the plugin.
Refer to the title screen as a string path, not PackedScene. Move these
definitions to the scene file so that the real path can be seen in the
editor.
I debugged this with Claude (but wrote this fix myself). What's annoying
is that I have previously debugged and fixed an equivalent bug by hand:
this is the same change as made in commit
8d10acd to the title and splash
screens, for the same reason, just a different import plugin.
Claude initially fixed the bug by changing
threadbare_credit/import_plugin.gd to refer to CreditsTeam and
CreditsTeamRoster via
preload(), but making that change - with orwithout this one - sometimes causes Godot to segfault during first
import; sometimes does not fix the problem; and sometimes works. I
cannot understand why and now need to move on.
Resolves #1832