Author: mir3x Date: Fri Sep 16 12:00:33 2016 New Revision: 33816 URL: http://svn.gna.org/viewcvs/freeciv?rev=33816&view=rev Log: Qt client - Fuel not shown in new sidebar unit display
Reported by Jacob Nevins <jtn> See bug #25038 Modified: branches/S2_6/client/gui-qt/dialogs.cpp branches/S2_6/client/gui-qt/mapview.cpp Modified: branches/S2_6/client/gui-qt/dialogs.cpp URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/dialogs.cpp?rev=33816&r1=33815&r2=33816&view=diff ============================================================================== --- branches/S2_6/client/gui-qt/dialogs.cpp (original) +++ branches/S2_6/client/gui-qt/dialogs.cpp Fri Sep 16 12:00:33 2016 @@ -2506,11 +2506,10 @@ } else { p.drawPixmap(x, y, *tmp_pix); } - + str = QString(move_points_text(punit->moves_left, false)); if (utype_fuel(unit_type_get(punit))) { - str = QString(move_points_text((rate * f) + punit->moves_left, false)); - } else { - str = QString(move_points_text(punit->moves_left, false)); + str = str + "(" + QString(move_points_text((rate * f) + + punit->moves_left, false)) + ")"; } /* TRANS: MP = Movement points */ str = QString(_("MP:")) + str; Modified: branches/S2_6/client/gui-qt/mapview.cpp URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/mapview.cpp?rev=33816&r1=33815&r2=33816&view=diff ============================================================================== --- branches/S2_6/client/gui-qt/mapview.cpp (original) +++ branches/S2_6/client/gui-qt/mapview.cpp Fri Sep 16 12:00:33 2016 @@ -1000,6 +1000,7 @@ gui()->sw_cunit->set_tooltip(QString()); return; } else { + QString mp; struct unit *punit; struct canvas *unit_pixmap; struct canvas *tile_pixmap; @@ -1034,11 +1035,17 @@ gui()->sw_cunit->height()); qtg_canvas_free(unit_pixmap); gui()->sw_cunit->set_label(get_unit_info_label_text1(punitlist)); + mp = QString(move_points_text(punit->moves_left, false)); + if (utype_fuel(unit_type_get(punit))) { + mp = mp + QString("(") + QString(move_points_text(( + unit_type_get(punit)->move_rate * ((punit->fuel) - 1) + + punit->moves_left), false)) + QString(")"); + } + /* TRANS: MP = Movement points */ + mp = QString(_("MP: ")) + mp; labels = QString(_("HP: %1/%2")).arg(QString::number(punit->hp), QString::number(unit_type_get(punit)->hp)) - + '\n' - + QString("MP: %1").arg(move_points_text( - unit_list_get(punitlist, 0)->moves_left, FALSE)); + + '\n' + mp; gui()->sw_cunit->set_custom_labels(labels); gui()->sw_cunit->update_final_pixmap(); gui()->sw_cunit->set_tooltip(popup_info_text(punit->tile)); @@ -1046,6 +1053,7 @@ } } } + /**************************************************************************** Update the mouse cursor. Cursor type depends on what user is doing and _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits