Skip to content
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

Allow connecting signals to existing methods without opening the script editor #89249

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

passivestar
Copy link
Contributor

@passivestar passivestar commented Mar 7, 2024

Closes godotengine/godot-proposals#8351

Adds an editor setting to prevent the script editor from opening when connecting a signal to an existing method

Screenshot 2024-03-08 at 03 40 27

Note that script editor opening when connecting to an existing method was a bug, but we're preserving that behavior by default

EDIT: Switched from doing this by holding Ctrl when pressing Connect to an editor setting

@Mickeon
Copy link
Contributor

Mickeon commented Mar 7, 2024

While I do find this to be a decent feature, the editor has a discoverability issue for these kinds of things and this additional CTRL shortcut does not help.

At least, if possible, what I would do is have the text on the change completely when holding the CTRL key. I've never seen something like this done by the editor before, but at least it makes the feature more noticeable.

In my opinion though, this could just as easily be an Editor Setting, or perhaps, a toggle on the Connect dialog itself, or both?

editor/connections_dialog.cpp Outdated Show resolved Hide resolved
scene/gui/dialogs.cpp Outdated Show resolved Hide resolved
@passivestar
Copy link
Contributor Author

At least, if possible, what I would do is have the text on the change completely when holding the CTRL key. I've never seen something like this done by the editor before, but at least it makes the feature more noticeable.

I've never seen anything like that either and I'm not sure it would help discoverability if you need to hold CTRL to discover it

In my opinion though, this could just as easily be an Editor Setting, or perhaps, a toggle on the Connect dialog itself, or both?

I'm 100% on board to make it an editor setting (with default being the current behavior) and nothing else. In my opinion it's all that's really needed here, especially considering that editor opening on existing methods was unintended

@KoBeWi
Copy link
Member

KoBeWi commented Mar 7, 2024

Seems like it breaks connecting to native methods:

godot.windows.editor.dev.x86_64_wtate8D6jD.mp4

I held Ctrl, but not only it opened the editor, it redefined queue_free().

@passivestar
Copy link
Contributor Author

Seems like it breaks connecting to native methods

Fixed that and also switched from the modifier key to an editor setting

Here's how it works now:

  1. If the method exists in an inherited class, either native or script, it creates a connection without adding anything or opening the editor (as it did before)
  2. If the method exists in the script on the target node itself it checks the editor setting to decide whether to open the editor or not

I put it into "Text Editor -> Behavior -> Navigation" (let me know if there's a better place)

Screenshot 2024-03-08 at 03 40 27

editor/connections_dialog.cpp Outdated Show resolved Hide resolved
@akien-mga akien-mga modified the milestones: 4.x, 4.3 Mar 12, 2024
@akien-mga akien-mga merged commit 9c99d4c into godotengine:master Mar 12, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an editor setting to disable switching to script editor after connecting a signal
5 participants