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

[4.x] The node signal preview box does not show the type of the signal parameter. #65809

Closed
Life4gal opened this issue Sep 15, 2022 · 2 comments · May be fixed by #65812
Closed

[4.x] The node signal preview box does not show the type of the signal parameter. #65809

Life4gal opened this issue Sep 15, 2022 · 2 comments · May be fixed by #65812

Comments

@Life4gal
Copy link
Contributor

Life4gal commented Sep 15, 2022

Godot version

v4.0.alpha.custom_build [d9e974c]

System information

Windows 11 & OpenGL ES 3.0 & Renderer: NVIDIA GeForce RTX 3060/PCIe/SSE2

Issue description

Since 4.0 (or since this commit?), GDScript supports setting types for signal parameters, which is great, and I think setting types for parameters somehow makes the code easier to understand.

However, after reading some code about signal, I found that this type is not actually used, and the setting type is only supported because the parameter handling of signal is consistent with the normal function parameter handling.

This leads to the result shown in the picture below.
no_signal_type

It can be seen that the type of the parameter shows a var, which is too puzzling.

Steps to reproduce

To attach a GDScript to any node, add a custom signal, such as:

signal test_signal(arg1: int, arg2, arg3: float)

Click on the node to view the signal preview box of the node.

Minimal reproduction project

Not very necessary.

@Life4gal Life4gal changed the title The node signal preview box does not show the type of the signal parameter. [4.x] The node signal preview box does not show the type of the signal parameter. Sep 15, 2022
@Chaosus Chaosus added this to the 4.0 milestone Sep 15, 2022
@Chaosus Chaosus moved this to To Assess in 4.x Priority Issues Sep 15, 2022
@Chaosus Chaosus moved this from To Assess to In Progress in 4.x Priority Issues Sep 15, 2022
@vnen vnen modified the milestones: 4.0, 4.1 Feb 20, 2023
@Rindbee
Copy link
Contributor

Rindbee commented Mar 16, 2023

In fact, until in e01b828, the parameters of custom signals do not support typed parameters. Maybe it could be written in that way, but the parameter type doesn't resolve to the specified type. You can emit other Variant values for the parameter specified as int.

extends Control

signal test(number : int)

func _ready() -> void:
	test.connect(_test)
	test.emit("test!")

func _test(arg):
	print(arg) # Prints "test!" with no error.

@YuriSizov YuriSizov modified the milestones: 4.1, 4.x Jun 23, 2023
@KoBeWi
Copy link
Member

KoBeWi commented Oct 30, 2024

Looks fixed in 4.4
image

@KoBeWi KoBeWi closed this as completed Oct 30, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in 4.x Priority Issues Oct 30, 2024
@KoBeWi KoBeWi modified the milestones: 4.x, 4.4 Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
6 participants