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

Changing node's type that has an attached script does not update node icon. #81757

Closed
beamer159 opened this issue Sep 16, 2023 · 2 comments
Closed
Labels

Comments

@beamer159
Copy link

beamer159 commented Sep 16, 2023

Godot version

4.1.1.stable

System information

Windows 11

Issue description

When a node has a script attached, changing that node's type does not update the node's icon in the Scene dock. The icon seems to be tied to the scripts extends [NODE_TYPE] line, where the icon will be NODE_TYPE's icon. Even then, changing this line to reflect the new type and saving the script does not updating the node icon. The scene must then be closed and reopened to update the node's icon.

Expected behavior: When a node's type is changed in the Scene dock, the icon will change immediately to reflect this new type. If this type does not match the type extended by an attached script, a warning icon could appear next to this node in the Scene dock notifying the user about this discrepancy.

Steps to reproduce

  1. Create a new 2D scene (new scene with a root Node2D node). The node icon is a blue ring, denoting a Node2D node.
  2. Attach a script to the Node2D node.
  3. Right-click the Node2D node in the scene dock, choose "Change Type", and change the type to a Node node. Expected behavior is that the icon changes to a white ring, denoting a Node node type. Actual behavior is that the icon remains a blue ring.

Even changing the script to extends Node and saving the project does not change the node's icon. However, closing and reopening the scene does change the node's icon, after changing the script as described above. Note that you can change the script to extend any arbitrary node type, and the node's icon will change to reflect this arbitrary node after reopening the scene.

Minimal reproduction project

A project cannot show this issue since it's fixed when the project is closed and reopened. Instead, I attached a video displaying the issue in a minimal project.

Untitled.mp4
@Deozaan
Copy link

Deozaan commented Sep 18, 2023

Probably a duplicate of one of these: #76983 #79226 #81276

Which I think means it has been fixed for the upcoming 4.2 release by #79203

@akien-mga
Copy link
Member

Indeed, this is fixed in 4.2. Thanks for the report!

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

No branches or pull requests

3 participants