Replies: 2 comments 3 replies
-
Be aware that you can do a deferred call like this: |
Beta Was this translation helpful? Give feedback.
-
Ideally, String/StringNames should be reserved for dynamic calls when "the thing they refer to" is not guaranteed to exist. But at the same time, |
Beta Was this translation helpful? Give feedback.
-
I wanted to quickly to go the source code / definition of a custom method passed as a StringName &"my_method", but since it's not directly referenced as a symbol, the hyperlink won't work.
To do so, we could parse StringNames to see if they fit an existing symbol.
However, I can understand the challenge of this because:
object.call_deferred(&"my_method")
hints us thatmy_method
belongs toobject
, but we must knowobject
's typeBecause of these uncertainties I'm opening a discussion rather than a proposal.
Also, it's not critical to me right now as I noticed that Godot 4 is favoring direct symbol (method as first-class citizen) usage of StringName function parameters: signal connection with
connect
,call_deferred
, etc. now have a version that you call directly on the Signal or Callable, and you can pass a Callable too, replacing the need for a first argument StringName containing the signal callback. And those symbols are compatible with Ctrl+click.Beta Was this translation helpful? Give feedback.
All reactions