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

README about programatically toggle the menu isn't correct #15

Closed
d10sfan opened this issue Sep 15, 2023 · 3 comments · Fixed by #16
Closed

README about programatically toggle the menu isn't correct #15

d10sfan opened this issue Sep 15, 2023 · 3 comments · Fixed by #16
Labels

Comments

@d10sfan
Copy link
Contributor

d10sfan commented Sep 15, 2023

Using the latest in the master branch, the toggle code examples don't work (https://github.com/godot-extended-libraries/godot-debug-menu#usage).

If I do that, I get errors that the Canvas does not have those properties.

If I instead do this:

var debug_menu = DebugMenu.get_node("DebugMenu")
debug_menu.style = debug_menu.Style.VISIBLE_COMPACT

Then as well the NONE should be HIDDEN instead

var debug_menu = DebugMenu.get_node("DebugMenu")
debug_menu.style = debug_menu.Style.HIDDEN

I'm not sure if this is expected behavior or not, if it is I could open a PR for some README changes.

@Calinou
Copy link
Member

Calinou commented Sep 15, 2023

This was likely changed by 2d1bf27, and is an unintended consequence.

The correct fix is to put the script on the CanvasLayer instead of a child Control node, so that you can set properties directly on DebugMenu instead of having to use get_node(). Feel free to open a pull request for this 🙂

@Calinou Calinou added the bug label Sep 15, 2023
@d10sfan
Copy link
Contributor Author

d10sfan commented Sep 15, 2023

Ah gotcha, I'll see if I can make that work locally and if so provide a PR soon.

@d10sfan
Copy link
Contributor Author

d10sfan commented Sep 15, 2023

Created a PR in #16

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

Successfully merging a pull request may close this issue.

2 participants