-
Notifications
You must be signed in to change notification settings - Fork 489
move filtering of armok keybindings into cpp #4674
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
Conversation
| void Core::setMortalMode(bool value) { | ||
| mortal_mode = value; | ||
| } | ||
|
|
||
| void Core::setArmokTools(const std::vector<std::string> &tool_names) { | ||
| armok_tools.clear(); | ||
| armok_tools.insert(tool_names.begin(), tool_names.end()); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a mutex guarding all of these accesses (not exclusive to these two functions) because SelectHotkey is called from the input thread. (I haven't looked to see if there is an existing appropriate mutex)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding that (07ad3a2)
| dfhack.HIDE_CONSOLE_ON_STARTUP = value | ||
| end | ||
|
|
||
| dfhack.HIDE_ARMOK_TOOLS = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this intended to be publicly accessible? If not, I would make it local instead of a member of dfhack. If you do want it publicly accessible, you should be aware that it is possible to set this variable without calling setMortalMode(), which would lead to an inconsistent state.
Same goes for HIDE_CONSOLE_ON_STARTUP, although I think the effects are more limited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was intended to be publicly accessible, but this change makes it unwise to access directly. Now that I've removed references to it (gui/control-panel, docs), it's good to make it local. will make that change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in #4679
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right - I knew it was previously public - was meaning to ask "is this still intended"
fixes poor execution of #4664