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

MenuBar node's get_menu_title method is confusing #100660

Closed
jan-kapoli opened this issue Dec 20, 2024 · 1 comment · Fixed by #100671
Closed

MenuBar node's get_menu_title method is confusing #100660

jan-kapoli opened this issue Dec 20, 2024 · 1 comment · Fixed by #100671

Comments

@jan-kapoli
Copy link

Tested versions

Godot version: 4.3.stable

System information

Debian 12 Bookworm

Issue description

Given a scene with a MenuBar node and a PopupMenu child node the method get_menu_title returns the child node's name. This is confusing, since a PopupMenu has a property called title (inherited from the Window node).

This is also problematic, because when running the project, the menu items' labels reflect their respective node's name, not title. Thus it is impossible to create the following menu bar from the editor:
[File] [Edit] [View] [View]
since names have to be unique.
It is generally undesired for node names to have an effect on the game.

Steps to reproduce

Create a scene with a MenuBar node as root. Create a PopupMenu child node and name it "NAME". In the editor (under the window category) set the title property to "TITLE".

Run get_menu_title(0) on the root node. Notice the result is "NAME" instead of the expected "TITLE".

Minimal reproduction project (MRP)

Minimal reproduction project.zip

@bruvzg
Copy link
Member

bruvzg commented Dec 20, 2024

Thus it is impossible to create the following menu bar from the editor

You can use set_menu_title method to set custom titles.

But since title exist in all Windows and is not doing anything for the borderless PopupMenu window, we probably should support it as a menu title as well.

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

Successfully merging a pull request may close this issue.

4 participants