onready
attribute when deriving GodotClass
[feature request]
#447
Labels
status: duplicate
This issue or pull request already exists
Hey folks!
GDScript has an
onready
annotation you can apply when declaring a variable that allows you to define how the value should be initialized when_ready
is called (as opposed toinit
). In this library, when using the derive macro forGodotClass
, the attribute#[init(default = ... )]
can be used to set a default value for thestruct
field it tags. Would it be possible to add something like#[init(onready = ...)]
for object initialization atready
time? Based on how this library currently works, this would require the tagged field to beOption<T>
(so that atinit
time the field can be initialized in some way). Maybe the attribute could apply thatOption
wrapper itself?I'm not super familiar with the internals of this library (yet), so I'm not entirely sure if this is even possible/how exactly one would go about implementing it. However, it is a feature I'd love to see implemented!
Thanks for taking the time to read this :)
The text was updated successfully, but these errors were encountered: