Skip to content

Add Godot 4.7 autoload compatability, fix automatic autoload creation, and fix other plugin installation/uninstallation bugs - #240

Open
rjanke wants to merge 5 commits into
blackears:masterfrom
rjanke:autoload-fix
Open

Add Godot 4.7 autoload compatability, fix automatic autoload creation, and fix other plugin installation/uninstallation bugs#240
rjanke wants to merge 5 commits into
blackears:masterfrom
rjanke:autoload-fix

Conversation

@rjanke

@rjanke rjanke commented Jul 2, 2026

Copy link
Copy Markdown

This PR mainly addresses this issue of not being able to manually name new autoloads in Godot 4.7.

Also included in this PR are various other fixes/improvements related to installation and uninstallation of the plugin. The main one being that automatic autoload creation is now working. I've broken each change up into isolated commits for cherry-picking convenience.

All of my changes and testing were conducted against the current master branch running Godot 4.7-stable.

Fixes

Fix 1 - get manual autoload creation working in Godot 4.7
commit

  • Simply renaming cyclops_global_scene.tscn to cyclops_autoload.tscn allows the manual autoload creation process to succeed. Errors are thrown, but the window can be reloaded and the plugin enabled.
  • As far as I can tell, renaming this file didn't cause any issues and may have actually been a blessing in disguise, because it lead to Fix 2.

Fix 2 - get automatic autoload creation working
commit

  • With this change, the plugin just needs to be enabled and the autoload will be created automatically.
  • Before, the autoload would fail to be created automatically. I'm not totally sure why it's working now, but I think it partly has to do with the parser not erroring out on the main EditorPlugin file, cyclops_level_builder.gd.

Fix 3 - move automatic autoload creation and deletion to dedicated virtual methods
commit

  • This moves autoload creation and deletion from _enter_tree() and _exit_tree(), respectively, to their own dedicated virtual methods _enable_plugin() and _disable_plugin(). This follows the pattern outlined in the latest docs.

Fix 4 - fix parse errors related to direct references to CyclopsAutoload
commit

  • When the plugin files are first added to the /addons folder, the parser throws a bunch of errors because the autoload isn't available yet. This issue has mostly been eliminated, but there's still one file with these references.
  • I've read that you're reworking the system to do away with the need for the autoload, but here's an attempt at a short term solution to prevent this parsing error.
  • This change should now fully resolve this issue.

Fix 5 - fix tool docks not being removed properly when plugin is disabled
commit

  • When the plugin is disabled, there are a few tool docks left behind and an error is thrown.
ERROR: res://addons/cyclops_level_builder/cyclops_level_builder.gd:335 - Cannot call method 'queue_free' on a null value.
image

After enabling and disabling the plugin a few times:
image

  • Reloading the window does make them go away, but this fix prevents it all together.

Combined result

Plugin installation is now much easier and more reliable. After the files are added to /addons, the plugin just needs to be enabled and that's it. Cyclops is ready to use, even without a window reload. The plugin can be enabled/disabled at will and no errors should be thrown in the console... except for one explained below.

Remaining issues

When the files are first added to /addons, there is still one parse error (which was existing). I looked into it a little, but didn't get anywhere. The error shows up twice:

ERROR: scene/resources/resource_format_text.cpp:293 - Parse Error: Busy. [Resource file res://addons/cyclops_level_builder/gui/configuration.tscn:219]
ERROR: Failed loading resource: res://addons/cyclops_level_builder/gui/configuration.tscn.
ERROR: scene/resources/resource_format_text.cpp:293 - Parse Error: Busy. [Resource file res://addons/cyclops_level_builder/gui/configuration.tscn:219]
ERROR: Failed loading resource: res://addons/cyclops_level_builder/gui/configuration.tscn.

This parse error is not seen again after the files are initially added to /addons, even after disabling/enabling the plugin.

Testing

I've tried to do as much testing as I can, but it's been admittedly light. All of the main brushes and brush operations seem to work, but I haven't tested everything. I've also only tested this PR in Godot 4.7.

I last used Cyclops in Godot 4.1, so I'm getting used to the new toolbars and new features still.

btw: not having to use a parent CyclopsBlocks anymore and having the toolbar always up is awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant