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

fix: 🐛 self setup chicken and egg problem #201

Merged

Conversation

KANAjetzt
Copy link
Member

@KANAjetzt KANAjetzt commented Mar 30, 2023

In #172 the ModLoaderUtils utility functions were updated to use the ModLoaderStore singleton.
However, this caused an issue with the self-setup script, as the setup was getting stuck in an infinite loop due to the ModLoaderStore not being initialized yet.
To resolve this issue, get_modloader_store() was added to mod_loader_utils.gd, which returns a reference to the ModLoaderStore singleton if it exists or null otherwise.

This functions use it now:

  • _get_verbosity()
  • get_path_to_mods()
  • get_path_to_configs()

Additionally, the autoload index check in the _init() function of mod_loader_setup.gd was updated to check for the right indexes of ModLoader and ModLoaderStore.

Tested with and without --setup-create-override-cfg .

closes #200

The ModLoader self setup script uses util function from ModLoaderUtils in GodotModding#172 ModLoaderStore was introduced into utility functions that where used by the self setup. Because the setup is run before the ModLoaderStore is initialized the setup was stuck in an infinite loop. To fix that `get_modloader_store()` was added and is now used in `_get_verbosity()`, `get_path_to_mods()` and `get_path_to_configs()`. Also updated the the autoload index check in the `_init()` of *mod_loader_setup.gd*.

closes GodotModding#200
@KANAjetzt KANAjetzt added the bug Something isn't working label Mar 30, 2023
@KANAjetzt KANAjetzt added this to the v6.0.0 milestone Mar 30, 2023
@KANAjetzt KANAjetzt requested review from Qubus0 and a team March 30, 2023 14:39
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.

YES! tested and works, thank you 🥳

@KANAjetzt KANAjetzt added this pull request to the merge queue Mar 30, 2023
Merged via the queue into GodotModding:development with commit 41b1801 Mar 30, 2023
@KANAjetzt KANAjetzt deleted the fix_mod_loader_setup_script branch March 30, 2023 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants