diff --git a/simtool.cc b/simtool.cc index 906143bb4..1c2ca3a70 100644 --- a/simtool.cc +++ b/simtool.cc @@ -161,6 +161,23 @@ char *tooltip_with_price(const char * tip, sint64 price) + +/** + * Creates a tooltip from tip text, money value and way/object length + * @author captain crunch + */ +char *tooltip_with_price_length(const char * tip, sint64 price, sint64 length) +{ + int n; + n = sprintf(tool_t::toolstr, translator::translate("length: %d"), length); + n += sprintf(tool_t::toolstr+n, ", %s: ", translator::translate(tip)); + money_to_string(tool_t::toolstr+n, (double)price/-100.0); + return tool_t::toolstr; +} + + + + /** * Creates a tooltip from tip text and money value * @author Hj. Malthaner @@ -2444,7 +2461,7 @@ void tool_build_way_t::mark_tiles( player_t *player, const koord3d &start, cons if( bauigel.get_count()>1 ) { // Set tooltip first (no dummygrounds, if bauigel.calc_casts() is called). - win_set_static_tooltip( tooltip_with_price("Building costs estimates", bauigel.calc_costs() ) ); + win_set_static_tooltip( tooltip_with_price_length("Building costs estimates", bauigel.calc_costs(), bauigel.get_count() ) ); // make dummy route from bauigel for( uint32 j=0; j1 ) { // Set tooltip first (no dummygrounds, if bauigel.calc_casts() is called). - win_set_static_tooltip( tooltip_with_price("Building costs estimates", -bauigel.calc_costs() ) ); + win_set_static_tooltip( tooltip_with_price_length("Building costs estimates", -bauigel.calc_costs(), bauigel.get_count() ) ); // make dummy route from bauigel for( uint32 j=0; j