Esempio n. 1
0
//generates the string that show how much power a bionic uses
std::string build_bionic_powerdesc_string( bionic const &bio )
{
    std::ostringstream power_desc;
    const std::string power_string = build_bionic_poweronly_string( bio );
    power_desc << bio.id->name;
    if( !power_string.empty() ) {
        power_desc << ", " << power_string;
    }
    return power_desc.str();
}
void draw_description( WINDOW *win, bionic const &bio )
{
    werase( win );
    const int width = getmaxx( win );
    const std::string poweronly_string = build_bionic_poweronly_string( bio );
    int ypos = fold_and_print( win, 0, 0, width, c_white, bionic_info( bio.id ).name );
    if( !poweronly_string.empty() ) {
        ypos += fold_and_print( win, ypos, 0, width, c_ltgray,
                                _( "Power usage: %s" ), poweronly_string.c_str() );
    }
    ypos += 1 + fold_and_print( win, ypos, 0, width, c_ltblue, bionic_info( bio.id ).description );

    const bool each_bp_on_new_line = ypos + ( int )num_bp + 1 < getmaxy( win );
    ypos += fold_and_print( win, ypos, 0, width, c_ltgray,
                            list_occupied_bps( bio.id, _( "This bionic occupies the following body parts:" ),
                                    each_bp_on_new_line ) );
    wrefresh( win );
}
Esempio n. 3
0
void draw_description( const catacurses::window &win, bionic const &bio )
{
    werase( win );
    const int width = getmaxx( win );
    const std::string poweronly_string = build_bionic_poweronly_string( bio );
    int ypos = fold_and_print( win, 0, 0, width, c_white, bio.id->name );
    if( !poweronly_string.empty() ) {
        ypos += fold_and_print( win, ypos, 0, width, c_light_gray,
                                _( "Power usage: %s" ), poweronly_string.c_str() );
    }
    ypos += 1 + fold_and_print( win, ypos, 0, width, c_light_blue, bio.id->description );

    // @todo: Unhide when enforcing limits
    if( g->u.has_trait( trait_id( "DEBUG_CBM_SLOTS" ) ) ) {
        const bool each_bp_on_new_line = ypos + ( int )num_bp + 1 < getmaxy( win );
        ypos += fold_and_print( win, ypos, 0, width, c_light_gray,
                                list_occupied_bps( bio.id, _( "This bionic occupies the following body parts:" ),
                                        each_bp_on_new_line ) );
    }
    wrefresh( win );
}
Esempio n. 4
0
void draw_description( const catacurses::window &win, const bionic &bio )
{
    werase( win );
    const int width = getmaxx( win );
    const std::string poweronly_string = build_bionic_poweronly_string( bio );
    int ypos = fold_and_print( win, 0, 0, width, c_white, bio.id->name );
    if( !poweronly_string.empty() ) {
        ypos += fold_and_print( win, ypos, 0, width, c_light_gray,
                                _( "Power usage: %s" ), poweronly_string );
    }
    ypos += 1 + fold_and_print( win, ypos, 0, width, c_light_blue, bio.id->description );

    // TODO: Unhide when enforcing limits
    if( get_option < bool >( "CBM_SLOTS_ENABLED" ) ) {
        const bool each_bp_on_new_line = ypos + static_cast<int>( num_bp ) + 1 < getmaxy( win );
        ypos += fold_and_print( win, ypos, 0, width, c_light_gray,
                                list_occupied_bps( bio.id, _( "This bionic occupies the following body parts:" ),
                                        each_bp_on_new_line ) );
    }
    wrefresh( win );
}