コード例 #1
0
    std::string get_action_name( const item_location &loc ) const {
        const auto &uses = loc->type->use_methods;

        if( uses.empty() ) {
            if( loc->is_food() || loc->is_food_container() ) {
                return _( "Consume" );
            } else if( loc->is_book() ) {
                return _( "Read" );
            } else if( loc->is_bionic() ) {
                return _( "Install bionic" );
            }
        } else if( uses.size() == 1 ) {
            return uses.begin()->second.get_name();
        } else {
            return _( "..." );
        }

        return std::string();
    }
コード例 #2
0
 bool is_shown( const item_location &loc ) const override {
     return loc->is_book();
 }