godot-nim icon indicating copy to clipboard operation
godot-nim copied to clipboard

gdexport on method exports without transforming

Open geekrelief opened this issue 4 years ago • 2 comments

Fixes https://github.com/pragmagic/godot-nim/issues/87 Now adding gdExport on a method exports it like proc. So method doIt() {.gdExport.} exports as do_it instead of _do_it. So godot can find our virtual methods that don't begin with underscores.

geekrelief avatar Feb 04 '21 17:02 geekrelief

As I mentioned in #87, this would break method process and most other methods. The proper fix, in my opinion, would be to allow to override the exported name, like this: method doIt() {.gdExport: "do_it".}.

endragor avatar Feb 04 '21 17:02 endragor

I've tested it in my code base with classes that have method process, enter_tree, init etc. Everything seems to be working fine. This doesn't change their existing behavior and brings method inline how gdExport works on proc and var, as far as I can tell.

geekrelief avatar Feb 04 '21 17:02 geekrelief