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: ♻️ 4.1 support #508

Open
wants to merge 17 commits into
base: 4.x
Choose a base branch
from

Conversation

KANAjetzt
Copy link
Member

@KANAjetzt KANAjetzt commented Jan 4, 2025

supersedes #441

Original PR Description:

Changes made:

  • Removed typed for...in variables because Godot 4.1 doesn't support them
  • Downgraded some .tres to format version 3, because format version 4 isn't supported in Godot 4.1
  • Used custom function instead of type_string, which does not exist in Godot 4.1

I did a proper test in Godot 4.1 and encountered no issues.

I did not test in later versions of Godot, but I don't think there's anything here that could break.

Todos

  • _ModLoaderModHookPreProcessor.fix_method_super() erases everything after the function body, leaving only the first function in a script.
    func fix_method_super(method_name: String, func_body: RegExMatch, text: String) -> String:
    return regex_super_call.sub(
    text, "super.%s" % method_name,
    true, func_body.get_start(), func_body.get_end()
    )
  • Change the ´.fix_method_super()` fix to use Regex.sub again, and just add the rest of the string back after sub replaced the super calls.

Todos

  • Godot 4.2 Test (Tested with Dome Keeper)
  • Godot 4.3 Test (Tested with flashit)

@KANAjetzt KANAjetzt added refactor / cleanup Improves readability or maintainability 4.x 4.1 labels Jan 4, 2025
@KANAjetzt KANAjetzt added this to the 4.x - 7.0.0 milestone Jan 4, 2025
@KANAjetzt KANAjetzt requested a review from Qubus0 January 4, 2025 13:54
@KANAjetzt KANAjetzt self-assigned this Jan 4, 2025
@KANAjetzt KANAjetzt changed the title Refactor 4.1 support refactor: ♻️ 4.1 support Jan 4, 2025
@Alexejhero Alexejhero mentioned this pull request Jan 19, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.1 refactor / cleanup Improves readability or maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants