bool craft_command::query_continue( const std::vector<comp_selection<item_comp>> &missing_items, const std::vector<comp_selection<tool_comp>> &missing_tools ) { std::stringstream ss; ss << _( "Some components used previously are missing. Continue?" ); if( !missing_items.empty() ) { ss << std::endl << _( "Item(s): " ); component_list_string( ss, missing_items ); } if( !missing_tools.empty() ) { ss << std::endl << _( "Tool(s): " ); component_list_string( ss, missing_tools ); } std::vector<std::string> options; options.push_back( _( "Yes" ) ); options.push_back( _( "No" ) ); // We NEED a copy. const std::string str = ss.str(); int selection = menu_vec( true, str.c_str(), options ); return selection == 1; }
bool craft_command::query_continue( const std::vector<comp_selection<item_comp>> &missing_items, const std::vector<comp_selection<tool_comp>> &missing_tools ) { std::stringstream ss; ss << _( "Some components used previously are missing. Continue?" ); if( !missing_items.empty() ) { ss << std::endl << _( "Item(s): " ); component_list_string( ss, missing_items ); } if( !missing_tools.empty() ) { ss << std::endl << _( "Tool(s): " ); component_list_string( ss, missing_tools ); } return query_yn( ss.str() ); }