bool key( const input_event &event, int /*num*/, uimenu * /*menu*/ ) override {
     const std::string action = ctxt.input_to_action( event );
     if( action == "HELP_KEYBINDINGS" ) {
         ctxt.display_help();
         return true;
     }
     // Don't write a message if unknown command was sent
     // Only when an inexistent tool was selected
     auto itemless_action = am.find( action );
     if( itemless_action != am.end() ) {
         popup( _( "You do not have an item that can perform this action." ) );
     }
     return false;
 }
Beispiel #2
0
 bool key(int ch, int /*num*/, uimenu * /*menu*/) {
     input_event wrap = input_event( ch, CATA_INPUT_KEYBOARD );
     const std::string action = ctxt.input_to_action( wrap );
     if( action == "HELP_KEYBINDINGS" ) {
         ctxt.display_help();
         return true;
     }
     // Don't write a message if unknown command was sent
     // Only when an inexistent tool was selected
     auto itemless_action = item_actions.find( action );
     if( itemless_action != item_actions.end() ) {
         popup( _("You do not have an item that can perform this action.") );
     }
     return false;
 }