You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ChickenStorm edited this page Aug 23, 2020
·
2 revisions
There is a node that manage the display of menus like shipyard or the fleet composition.
The node is in hud/menu_layer.gd and a node called MenuLayer can be found in hud/hud.tscn.
Menu Layer
For the moment the menus are instanced by this node (and free them when the MenuLayer exists the tree).
MenuLayer is used by dependency injection as a service that client (node that request menus on events) have a reference to.
It is advice be craful when the menuLayer is instanced ! In hud.tscn the variable is injected on ready, but the ready event propagate from the leafs toward the root meaning that the leafs call _ready() before the hud. It is advice to use a setget if the Reference to MenuLayer needs to climb through multiple scenes towards the leafs.
Creating a menu
It is advice to create a menu using MenuContainer or a class extending it.