imjp94 / gd-plug

Minimal plugin manager for Godot
MIT License
217 stars 15 forks source link

Support .plugged in user:// #40

Open Tattomoosa opened 1 month ago

Tattomoosa commented 1 month ago

Seems there continues to be issues with Godot parsing plugins even within the addons folder and even with .gdignore (see https://github.com/imjp94/gd-plug/pull/37#issuecomment-2345269071, #32 ). gd-plug already supports addons outside of the project directory (eg res://../.plugged works fine) but it does not support .plugged in the user:// directory, since Godot has built-in protection against this in DirAccess. Since this directory is kept in-sync with projects for other engine uses, it seems like a natural place to keep .plugged (although certainly less preferable than easiily visible in the project folder, but at least until Godot plays nice with that it's a decent workaround)

This is a draft pull request to support user://.plugged, it is only lightly tested and has two temporary changes included to facilitate testing this functionality:

Seems to work great so far, and no errors from Godot parsing any files it shouldn't.

There's another approach that would work - to globalize all paths before opening anything, but I think this way seems a bit safer.

I would like to merge this (with those temporary changes removed) as well as #37 which means we'll support .plugged everywhere, then after that we can figure out how/if we want to migrate its default location.