Idea/QOL-Enhancement: Dragging properties from inspector into code without "Quotation marks" #8012
nosdregamon
started this conversation in
Editor
Replies: 1 comment 1 reply
-
You seem to have everything you need to write a proper proposal. Addendum: I think I can do that change, the only thing giving me pause is considering if CTRL could do something else. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I just noticed, that I can drag properties from the inspector into code. Just search for the the property I want, say Node2d->Position, drag the name and I got "position" in my script - that's awesome (and I feel silly for not trying that earlier).
However, this always ends up "quoted". However, they are always in quotation marks, so it's "position" not just position and in scripts in need the latter. So I remove the quotation marks by hand. Would be a small but "nice to have" improvement to implement an option to drag without quotes.
Ideally it would be it's own modifier shortcut (say "CTRL+Drag&Drop" to get the desired result). But currently nothing in that direction exists.
Someone more savvy in the Godot sources pointed me to...
https://github.com/godotengine/godot/blob/6916349697a4339216469e9bf5899b983d78db07/editor/plugins/script_text_editor.cpp#L1917-L1927
... which boils down to: it's currently always quoting.
I think the addition would be minimal such as replacing 'const String text_to_drop = _quote_drop_data(String(d["property"]));' with
const String text_to_drop = drop_modifier_pressed ? String(d["property"]) : _quote_drop_data(String(d["property"]));
But it looks pretty ugly, and I can't get Godot to compile on my cheap notebook.
Beta Was this translation helpful? Give feedback.
All reactions