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

Custom nodes don't have their parents' icon #90367

Open
denis-efimov opened this issue Apr 7, 2024 · 2 comments
Open

Custom nodes don't have their parents' icon #90367

denis-efimov opened this issue Apr 7, 2024 · 2 comments

Comments

@denis-efimov
Copy link

Tested versions

  • Reproducible in v4.2.1.stable.official [b09f793]

System information

Windows 11 - Godot v4.2.1.stable

Issue description

Custom nodes made in C++ have the node's icon instead of the parent's node icon.

According to the documentation when a new class is created and exposed to scripting, the editor's interface will display it with a default icon representing the base class it inherits from. This seems to be not the case.

Example of C++ code:

using BasePanelContainer = godot::PanelContainer;

class ChartPanel: public BasePanelContainer
{
    GDCLASS(ChartPanel, BasePanelContainer)

The icon in the editor is wrong either in the "create new node" window or in the "scene tree":
image

Steps to reproduce

  • Create a C++ class inherited from godot::PanelContainer
  • Add the created node in a scene

Minimal reproduction project (MRP)

N/A

@sylbeth
Copy link

sylbeth commented Dec 12, 2024

Would this help ease the problem? #100298

@sylbeth
Copy link

sylbeth commented Dec 12, 2024

Another two ways to solve this problem I can think of are:

  • Each Node in the engine adds a function to be inherited by the GDExtension classes that returns their name, thus, it would only be a matter of calling that function to retrieve the name of the base class.
  • The GDExtension provides Godot with pairings of Custom Node and builtin node it inherits from (or, at least, node outside of the GDExtension). That would also make the check trivial.

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

No branches or pull requests

4 participants