Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the addon should update only when changes happens in the addons folder #21

Open
WhalesState opened this issue Jan 24, 2022 · 1 comment

Comments

@WhalesState
Copy link

WhalesState commented Jan 24, 2022

We are listing the addons directory and running a while loop to get each folder and we check if it has a plugin.cfg file and we update the options button and we save cfg file

the problem is, FileSystem emits filesystem_changed whenever any file changes like when you save your project or importing assets .. etc, we need to make it only check if the changes happens inside the addons folder.

i was thinking about many ways , to check if files size changed ? last modified date ?

then how ?

the only way i can find since directories don't have last modified date is that we list the addons directory and we check the names of the folders if it doesn't exist in our plugins dictionary then we refresh, if the folders are the same, then we return.

this will produce only one issue, if someone removed an addon folder from the OS filesystem and added another folder with the same name but different contents and returned back to godot. because godot will not emit the signal until the user focus the godot window. and the while loop will not recognize any changes so it will keep the old addon information.

if we made this enhancement then we should add this as a warning in the README file.

@WhalesState
Copy link
Author

WhalesState commented Jan 24, 2022

a better approach is to wait one frame when the filesystem signal emits and we get the plugins information from the project settings instead of listing the addons directory, since godot already do it in the same frame.

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

No branches or pull requests

1 participant