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

Hidden commands still appear in the directory #447

Open
VortixDev opened this Issue Jan 3, 2019 · 1 comment

Comments

Projects
None yet
1 participant
@VortixDev
Copy link
Contributor

VortixDev commented Jan 3, 2019

When a command is set to hidden, it still appears in the directory.

It appears this is caused by the fact that when the directory menu is built, the ClockworkDirectoryRebuilt hook is called, which goes through all commands and adds them to the help listing if the player has access to them, with no regard to whether it is hidden or not.

@VortixDev

This comment has been minimized.

Copy link
Contributor Author

VortixDev commented Jan 18, 2019

Update, having looked into the issue more.

I was mistaken regarding ClockworkDirectoryRebuilt being the cause of the issue. In the Clockwork.command.SetHidden implementation, the command is removed from the command table and added to the hidden table instead. The fact that the command is not present in the command table means that ClockworkDirectoryRebuilt does not even come across the hidden command when iterating over the command table.

The real cause for the issue is the Clockwork.command.Register function, which adds the command to the help listing upon registration. It is never removed.

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