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: Remove self argument on *mod_main.gd* _init #324

Merged
merged 2 commits into from
Jul 3, 2023

Conversation

otDan
Copy link
Member

@otDan otDan commented Jul 3, 2023

Actually implement what is proposed by @KANAjetzt in #319 in a non breaking way



Edit by @KANAjetzt:

  • This PR removes and deprecates the self argument when initializing a mod's mod_main.gd script. Previously, it was used to call methods in the ModLoader class. However, with the introduction of v6.0.0, these methods have been relocated outside of ModLoader.

⚠️ Breaking Changes:

Please note that this change may break mods that still rely on the modLoader argument in their _init() function. To mitigate this, a fallback has been implemented that passes self as an argument if any arguments are detected in the mod_main.gd _init() function.


closes #318

@otDan otDan changed the base branch from main to development July 3, 2023 11:52
@otDan otDan requested review from KANAjetzt and Qubus0 and removed request for KANAjetzt July 3, 2023 11:52
@otDan
Copy link
Member Author

otDan commented Jul 3, 2023

also let me know a cleared way to tell the user to not use the argument as it's deprecated, currently it doesn't look right

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.

yep that is safer

addons/mod_loader/mod_loader.gd Outdated Show resolved Hide resolved
addons/mod_loader/mod_loader.gd Outdated Show resolved Hide resolved
@otDan otDan mentioned this pull request Jul 3, 2023
@KANAjetzt KANAjetzt added refactor / cleanup Improves readability or maintainability breaking Breaking change labels Jul 3, 2023
@KANAjetzt KANAjetzt added this to the v6.1.0 milestone Jul 3, 2023
@Qubus0 Qubus0 added deprecation and removed breaking Breaking change labels Jul 3, 2023
@otDan otDan added this pull request to the merge queue Jul 3, 2023
Merged via the queue into GodotModding:development with commit f90f798 Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation refactor / cleanup Improves readability or maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants