diff --git a/src/veh_interact.cpp b/src/veh_interact.cpp index 9b38547a64c14..511429a6bad11 100644 --- a/src/veh_interact.cpp +++ b/src/veh_interact.cpp @@ -391,7 +391,7 @@ shared_ptr_fast veh_interact::create_or_get_ui_adaptor() werase( w_parts ); veh->print_part_list( w_parts, 0, getmaxy( w_parts ) - 1, getmaxx( w_parts ), cpart, highlight_part, - true ); + true, false ); wnoutrefresh( w_parts ); werase( w_msg ); @@ -2502,8 +2502,8 @@ void veh_interact::display_veh() std::vector structural_parts = veh->all_parts_at_location( "structure" ); for( auto &structural_part : structural_parts ) { const int p = structural_part; - int sym = veh->part_sym( p ); - nc_color col = veh->part_color( p ); + int sym = veh->part_sym( p, false, false ); + nc_color col = veh->part_color( p, false, false ); const point q = ( veh->part( p ).mount + dd ).rotate( 3 ); @@ -2525,8 +2525,8 @@ void veh_interact::display_veh() if( ovp && &ovp->vehicle() != veh ) { obstruct = true; } - nc_color col = cpart >= 0 ? veh->part_color( cpart ) : c_black; - int sym = cpart >= 0 ? veh->part_sym( cpart ) : ' '; + nc_color col = cpart >= 0 ? veh->part_color( cpart, false, false ) : c_black; + int sym = cpart >= 0 ? veh->part_sym( cpart, false, false ) : ' '; mvwputch( w_disp, point( hw, hh ), obstruct ? red_background( col ) : hilite( col ), special_symbol( sym ) ); wnoutrefresh( w_disp ); diff --git a/src/vehicle.h b/src/vehicle.h index 2bba9e9671371..f4496307ba549 100644 --- a/src/vehicle.h +++ b/src/vehicle.h @@ -861,7 +861,7 @@ class vehicle void deserialize( const JsonObject &data ); // Vehicle parts list - all the parts on a single tile int print_part_list( const catacurses::window &win, int y1, int max_y, int width, int p, - int hl = -1, bool detail = false ) const; + int hl = -1, bool detail = false, bool include_fakes = true ) const; // Vehicle parts descriptions - descriptions for all the parts on a single tile void print_vparts_descs( const catacurses::window &win, int max_y, int width, int p, @@ -1168,11 +1168,11 @@ class vehicle int index_of_part( const vehicle_part *part, bool check_removed = false ) const; // get symbol for map - char part_sym( int p, bool exact = false ) const; + char part_sym( int p, bool exact = false, bool include_fake = true ) const; std::string part_id_string( int p, char &part_mod ) const; // get color for map - nc_color part_color( int p, bool exact = false ) const; + nc_color part_color( int p, bool exact = false, bool include_fake = true ) const; // Get all printable fuel types std::vector get_printable_fuel_types() const; diff --git a/src/vehicle_display.cpp b/src/vehicle_display.cpp index af8f0cd8084b3..924c67a58fe4a 100644 --- a/src/vehicle_display.cpp +++ b/src/vehicle_display.cpp @@ -34,13 +34,13 @@ std::string vehicle::disp_name() const return string_format( _( "the %s" ), name ); } -char vehicle::part_sym( const int p, const bool exact ) const +char vehicle::part_sym( const int p, const bool exact, const bool include_fake ) const { if( p < 0 || p >= static_cast( parts.size() ) || parts[p].removed ) { return ' '; } - int displayed_part = exact ? p : part_displayed_at( parts[p].mount, true ); + int displayed_part = exact ? p : part_displayed_at( parts[p].mount, include_fake ); if( displayed_part == -1 ) { displayed_part = p; } @@ -96,7 +96,7 @@ std::string vehicle::part_id_string( const int p, char &part_mod ) const return vp.id.str() + ( vp.variant.empty() ? "" : "_" + vp.variant ); } -nc_color vehicle::part_color( const int p, const bool exact ) const +nc_color vehicle::part_color( const int p, const bool exact, const bool include_fake ) const { if( p < 0 || p >= static_cast( parts.size() ) ) { return c_black; @@ -114,7 +114,7 @@ nc_color vehicle::part_color( const int p, const bool exact ) const if( parm >= 0 ) { col = part_info( parm ).color; } else { - const int displayed_part = exact ? p : part_displayed_at( parts[p].mount, true ); + const int displayed_part = exact ? p : part_displayed_at( parts[p].mount, include_fake ); if( displayed_part < 0 || displayed_part >= static_cast( parts.size() ) ) { return c_black; @@ -164,12 +164,12 @@ nc_color vehicle::part_color( const int p, const bool exact ) const * @param detail Whether or not to show detailed contents for fuel components. */ int vehicle::print_part_list( const catacurses::window &win, int y1, const int max_y, int width, - int p, int hl /*= -1*/, bool detail ) const + int p, int hl /*= -1*/, bool detail, bool include_fakes ) const { if( p < 0 || p >= static_cast( parts.size() ) ) { return y1; } - std::vector pl = this->parts_at_relative( parts[p].mount, true, true ); + std::vector pl = this->parts_at_relative( parts[p].mount, true, include_fakes ); int y = y1; for( size_t i = 0; i < pl.size(); i++ ) { const vehicle_part &vp = parts[ pl [ i ] ];