-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GDScript: Support %
in shorthand for get_node
#61440
GDScript: Support %
in shorthand for get_node
#61440
Conversation
I don't know about allowing the lone |
Awesome! I tested it and it works great. This also closes godotengine/godot-proposals#4583 |
Actually, my reasoning goes further than that. I would personally hold off the lone That's also because, in GDScript,
Introducing a third, completely unrelated purpose for it, I find to really be too much. And that's not even mentioning, should godotengine/godot-proposals#4593 be implemented a certain way (and it really should, it'd be a massive usability improvement), autocompletion may display even if the context does not warrant it. |
@Mickeon I don't think it's that much of a problem. This context is quite different from the others where If there's a lot of the demand I could still change it, but for what I've seen most people are okay with the syntax I implemented here. |
Could you maybe add better support for dropping node path? The relevant code is here: godot/editor/plugins/script_text_editor.cpp Lines 1592 to 1617 in 8a21f72
|
@vnen This is awesome, you rock! |
The `%` is used in scene unique nodes. Now `%` can also be used instead of `$` for the shorthand, besides being allowed generally anywhere in the path as the prefix for a node name.
0c70a5f
to
eba3e0a
Compare
@KoBeWi I updated the code to improve the drag & drop. Not sure if this works well with instanced scenes, but it can be improved further in the future. |
Thanks! |
I agree. While it shouldn't be a problem in practical terms, it's starting to look too much like Perl and I find it ugly. "Ugly" being completely subjective, other people seem to like it and that's fine. Not a big problem for me, I can live with it. Just trying to publicly manifest how much I hate this new syntax ;) |
The
%
is used in scene unique nodes. Now%
can also be used instead of$
for the shorthand, besides being allowed generally anywhere in the path as the prefix for a node name.This is the syntax in GDScript to use the feature introduced in #60298.
Samples of the valid syntax:
A similar thing could be done for 3.x since it doesn't break compatibility.
Closes godotengine/godot-proposals#4583