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

Save and reselect recently refreshed plugin #3

Merged

Conversation

Xrayez
Copy link
Contributor

@Xrayez Xrayez commented Jul 28, 2019

Closes #2.

This allows developers to stay on the recently reloaded plugin during and between editor sessions by making use of plugin custom configuration file which is saved at project settings directory.

Also updated project settings to match with Godot 3.1-stable.
Also works with Godot 3.2-dev.

Disabled non-existing plugin which was used for testing apparently.

@willnationsdev
Copy link
Member

Wow, these look like great changes, thanks! I'm curious whether storing the data in EditorSettings is better/worse than ProjectSettings since, after all, plugins themselves (including the plugin refresher) are installed per-project, so 1) the refresher's settings might continue to exist even if the user deletes the only project using that data (clutter) and 2) the recently used plugin will have the same value between projects. Not only does that mean that modifying data in project could affect the editor in a different project, but it also could even end up as invalid data since 2 different projects might not have the same plugins installed, resulting in the "recent" one being non-existent.

Thoughts?

@willnationsdev
Copy link
Member

If you end up switching it to the project settings, then all you should have to do is use ProjectSettings.add_property_info to add the new setting and then get_setting and set_setting to access it.

@Xrayez
Copy link
Contributor Author

Xrayez commented Jul 28, 2019

Yeah, I think there could be a separation between plugin settings and cached data which could be temporary in nature. If recently used plugin is stored in project settings, then it could create noise in VCS if dealing with ProjectSettings itself.

It doesn't fail if a recent plugin doesn't exist in other projects anyway because it actually searches through the available plugins to match against.

It haven't occurred to me that those temporary settings could be stored per project indeed, so yeah I could look into that later.

This allows developers to stay on the recently reloaded plugin
during and between editor sessions by making use of plugin
custom configuration file which is saved at project settings directory.

Also updated project settings to match with Godot 3.1-stable.
Also works with Godot 3.2-dev.

Disabled non-existing plugin which was used for testing apparently.
@Xrayez
Copy link
Contributor Author

Xrayez commented Jul 28, 2019

Well the change was simple actually:

var dir = get_editor_interface().get_editor_settings().get_project_settings_dir()

instead of:

var dir = get_editor_interface().get_editor_settings().get_settings_dir()

It saves the config at path like this per project now:
C:\Users\Xrayez\AppData\Roaming/Godot/projects/my-project-8bc1742e6224b66a45cc2da4138d7ee7/plugins/plugin_refresher/settings.cfg

So seems ok as I see there are other project settings related configs there.

If this was a plugin which had something to do with the actual game project, then it would make sense to store these kind of settings inside ProjectSettings, but this is only for development purposes. Settings/cache is stored per project now anyways.

@willnationsdev
Copy link
Member

Alright. Looks good to me, afaik. Thanks so much!

@willnationsdev willnationsdev merged commit 47faab6 into godot-extended-libraries:master Jul 28, 2019
@Xrayez Xrayez deleted the reselect-recent branch July 28, 2019 21:06
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.

Interaction Improvement
2 participants