migueldeicaza / SwiftGodot

New Godot bindings for Swift
https://migueldeicaza.github.io/SwiftGodotDocs/tutorials/swiftgodot-tutorials/
MIT License
987 stars 55 forks source link

Extend `initSwiftExtension` macro to expose all initialization levels (#464) #465

Closed sekimondre closed 2 months ago

sekimondre commented 2 months ago

closes #464

Allows registration of types to Godot at all GDExtension.InitializationLevel cases.

Originally, this was supposed to support exposing types only at .editor initialization level, but the solution was generalized to include all cases. Maybe some esoteric use cases might require exposing types at .core and .servers levels.

I was able to work out a way of keeping the original declaration intact, so no breaking changes were introduced to the macro API.

Also, I still have to add api documentation and make some little adjustments to the existing one. If the code's good to go already, I'll do it.

migueldeicaza commented 2 months ago

Brilliant! Thanks for sending this along!

migueldeicaza commented 2 months ago

I added some documentation, let me know if that works, and happy to take additional changes.