MCPcopy Create free account
hub / github.com/NetHack/NetHack / ok_for_command

Method ok_for_command

win/Qt/qt_main.cpp:1007–1024  ·  view source on GitHub ↗

used by doMenuItem() and for the toolbar buttons */

Source from the content-addressed store, hash-verified

1005
1006/* used by doMenuItem() and for the toolbar buttons */
1007bool NetHackQtMainWindow::ok_for_command()
1008{
1009 /*
1010 * If the core expects text to be entered (perhaps typing in a wish,
1011 * assigning a name to something, or answering a y/n prompt), or a
1012 * map position or a direction is being picked, don't accept commands
1013 * from the toolbar.
1014 *
1015 * FIXME: it would be much better to gray-out inapplicable entries
1016 * when popping up a command menu instead of needing this.
1017 */
1018 if (::program_state.input_state != commandInp) {
1019 NetHackQtBind::qt_nhbell();
1020 // possibly call doKeys("\033"); here?
1021 return false;
1022 }
1023 return true;
1024}
1025
1026void NetHackQtMainWindow::doMenuItem(QAction *action)
1027{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected