utopia-rise / godot-kotlin-jvm

Godot Kotlin JVM Module
MIT License
576 stars 39 forks source link

Improve registration files #529

Closed chippmann closed 9 months ago

chippmann commented 10 months ago

Resolves #500 Note: depends on #528

This registers classes by their registered name instead of their relative path. This lifts the restriction on where registration files can be placed. This thus also updates the registration file generation:

This allows a user to freely move registration files inside the godot project.

Note: This approach has one limitation: When a class is renamed, it essentially is a "new" class to godot. Hence an existing registration file is deleted and a new one is created in the registration out directory. It will not be generated into the directory the previous registration file was present if it was moved manually!

This problem can be circumvented by using our idea plugin which should automatically rename a corresponding gdj file if a class is renamed.

As per request of @CedNaru, this additionally adds new information to KtClass:

This PR contains one breaking change: Before the registration file directory structure inside dependencies was defined by the settings of the library author. Now it follows the users configuration instead.