Repository: godot
Issue: Signal Connection Window: No way to pass "self" as Extra Call Argument, broken NodePath to self
Labels: enhancement,discussion,topic:core,topic:editor,confirmed,documentation

### Godot version

v4.2.beta2.official [f8818f85e]

### System information

Windows 10

### Issue description

I'm trying to pass a reference to the button that is clicked with the `pressed` signal using the Editor's Signal Connection Window. It would be easiest if there was an option to just pass "self" but I don't see one, so the next best idea I could think of was to pass in the node's own NodePath.

So I added a NodePath as an Extra Call Argument, selected the button, smirked at my ingenuity, and pressed connect.

![Godot Button Node Signal Self Reference](https://github.com/godotengine/godot/assets/227734/1a20ac29-289a-4398-9f18-457a99ae58ea)

But it doesn't work as expected.

(Ignore that the above screenshot shows the node connecting to itself. it's actually connecting to the "player" node shown in the list. I just forgot that I clicked the "Go to Source" button when trying to figure out what went wrong, before I took the screenshot.)

One of two things happen:

## The NodePath is relative, but local to itself instead of to the receiving node.
The NodePath passed in is "." which means whatever receives the signal will get a NodePath that refers to itself rather than the button.

![Godot Engine Signal Connection NodePath Local Reference](https://github.com/godotengine/godot/assets/227734/27fab06c-0dcf-45c1-bf32-fcc56761dd80)

This is not useful. If the NodePath is relative, it should be in the direction from the receiver to the node whose path we're getting.

## The NodePath is absolute, but includes the Editor UI SceneTree.
I'm not sure how to reproduce this 100% of the time. It seems to happen on its own when I go away from the Editor for a while (such as to look for answers in my web browser for what went wrong) and then click back on it and try again. But when it happens, it seems to get stuck doing this and at that point I can't figure out how to get it to go back to using the relative path.

Sometimes the NodePath gets set to the absolute path in the Editor SceneTree, in the form of something like: `/root/@EditorNode@17151/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9493/@VSplitContainer@9312/@HSplitContainer@9314/@HSplitContainer@9316/@Control@9317/@SubViewportContainer@9318/@SubViewport@9319/Main/Canvas Layer/Control/Button`

![Godot Engine Signal Connection NodePath Absolute to Editor](https://github.com/godotengine/godot/assets/227734/641123aa-0b02-4343-b1e7-3162bd5bea30)

This is not useful because this path is not valid at runtime. In addition to that, even if the path were valid (`/root/Main/Canvas Layer/Control/Button`) at runtime in this specific example, for virtually any other scene there's no guarantee where it will be in the SceneTree, so we can't use an absolute path.

### Steps to reproduce

1. Open MRP attached below or recreate a simple (or complex!) SceneTree with at least a few nodes and which includes a Button.
2. Attach a script to a node other than the Button.
3. Double click the Button's `pressed()` signal to open the Signal Connection Window.
4. The node with a script attached should be selected by default, but select it if not.
5. Enable the Advanced switch and add a NodePath as an Extra Call Argument.
6. Select the Button for the NodePath and click Connect.
7. Observe the result in the Signals section of the Node tab.
8. Use the following code for the connected signal:

```
func _on_button_pressed(button_path: NodePath) -> void:
	print(button_path)
```

9. Run the project and click the Button. Observe the path which is printed to the Output window.

### Minimal reproduction project

[signal-nodepath-mrp.zip](https://github.com/godotengine/godot/files/13058726/signal-nodepath-mrp.zip)