Skip to content

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
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, ty.
the resources might get annoying since they will always want to be saved in the newer format version.
we might also want to consider an engine version test that just runs --check-only on each of our scripts for every version we want to support in order to avoid accidentally using things like typed loop variables.

@KANAjetzt KANAjetzt added this pull request to the merge queue Jan 30, 2025
Merged via the queue into GodotModding:4.x with commit c29ac0d Jan 30, 2025
1 check passed
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.

3 participants