I want to create a small strategic game and want to create an interface elements that displays a abstract ressource, for example military power, and gives the player an explanatory tooltip when hovering over the display.
For that I have created an Overlying Node named "Tooltip Display", a child node named "Simple Display" and a Panel called "Tooltip". The Tooltip display is the whole 2d element, the simple display is just displaying the ressource value and sends a signlal to the tooltip display when the mouse enters or leaves it. This then makes the tooltip visible or invisible.
The thing is that I have created multiple versions of "Simple Display", all inheriting from "Simple Display" that display different textures and labels based on what ressource is being displayed. The are named "Simple Military Display", "Simple Diplomatic Display" and so on.
I thought these would be interchangable with the standart "Simple Display", since they are it's children, based on how inheritance generally works in object oriented programming languages. So that if I had a scene that needs a "Simple Display", I could also give it a "Simple Military Display".
But when I try to create a child of the "Tooltip Display" to create a specific "Military Tooltip Display" and exchange the "Simple Display" for a "Simple Military Display", I can't seem to. I am guessing that's because the new child inherits from "Tooltip Display and can thus only add nodes, not remove them. Is there a way to override a node with a node that inherits from it in a situation like this?
I know I can just not create the "Simple Display" scenes and manage any changes to it for different ressources from the parent "Tooltip Display" instead, but I am learning godot, so I would like to ask, just to better understand how this node inheritance works.
Can someone tell me if this is possible?