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

refactor: ♻️ Add / Remove ModToolStore as a singleton/autoload #23

Merged
merged 3 commits into from
Feb 28, 2023

Conversation

KANAjetzt
Copy link
Member

Adding the ModToolStore as a singleton on _enter_tree() in plugin.gd allows easy access from any where in the plugin. Refactored every store reference to use the new singleton. The singleton get's removed in _exit_tree() in plugin.gd.

Adding the ModToolStore as a singleton on `_enter_tree()` in *plugin.gd* allows easy access from any where in the plugin. Refactored every store reference to use the new singleton. The singleton get's removed in `_exit_tree()` in *plugin.gd*.
@KANAjetzt KANAjetzt added the enhancement New feature or request label Feb 28, 2023
@KANAjetzt KANAjetzt requested a review from Qubus0 February 28, 2023 08:09
Copy link
Collaborator

@Qubus0 Qubus0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'd like it to be saved again though

addons/mod_tool/plugin.gd Show resolved Hide resolved
Before `save_store()` was called in `_exit_tree()` in *dock.gd*. Resulting in an error, because the autoload is removed before `_exit_tree()` was executed.
Copy link
Collaborator

@Qubus0 Qubus0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good 👍

@KANAjetzt KANAjetzt added this pull request to the merge queue Feb 28, 2023
Merged via the queue into main with commit 86804b7 Feb 28, 2023
@Qubus0 Qubus0 deleted the autoload_store branch February 28, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants