Exemplo n.º 1
0
 bool key( const input_context &ctxt, const input_event &event, int /*idx*/,
           uimenu * /*menu*/ ) override {
     const std::string action = ctxt.input_to_action( event );
     // 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 true;
     }
     return false;
 }
Exemplo n.º 2
0
 bool key( int ch, int /*num*/, uimenu * /*menu*/ ) override {
     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 = am.find( action );
     if( itemless_action != am.end() ) {
         popup( _( "You do not have an item that can perform this action." ) );
     }
     return false;
 }