godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.81k stars 3.09k forks source link

Update ambiguous phrasing for connecting signals to a Callable #9959

Open beckymorley opened 1 week ago

beckymorley commented 1 week ago

Your Godot version: 4.2

Issue description: The highlighted wording below had me stumped for some time:

image

"A signal can only be connected once to the same Callable."

I read it as "A signal can only be connected once to each unique callable" (as in connecting to both NodeClass1._do_node1_things() and NodeClass2._do_node2_things() would be acceptable) as opposed to what I now understand it's real meaning to be which is "A signal can only be connected once to one Callable". With my erroneous interpretation, the next sentence "If the signal is already connected..." still makes sense to me, so the pin didn't drop even after I searched for why I was getting a "signal already connected" error.

I think using the word "same" introduces the ambiguity, so changing this to say "one" would probably be enough to clear up the meaning. Maybe also a brief clarification that the signal needs to be disconnected from one callable in order to connect to another, just to leave absolutely no room for interpretation?

I hope it doesn't sound like I'm nit picking, but it really had me confused for a few days and it wasn't clear that my assumption was wrong until it clicked, otherwise I probably would've asked somewhere.

URL to the documentation page (if already existing): https://docs.godotengine.org/en/4.2/classes/class_signal.html

AThousandShips commented 1 week ago

A signal can only be connected once to one Callable

This is wrong, a signal can be connected to many callables, not just once, it just can't be connected to the same callable, with the same one meaning the same object and method

So:

my_signal.connect(foo1.bar)
my_signal.connect(foo1.bar)
my_signal.connect(foo1.bar)
my_signal.connect(foo1.bar.bind(1))

Are not valid, but:

my_signal.connect(foo1.bar)
my_signal.connect(foo2.bar)

Is