Changeset - r17531:9dd97c4db158
[Not reviewed]
master
0 2 0
frosch - 13 years ago 2011-04-09 20:27:34
frosch@openttd.org
(svn r22305) -Add: One digit for the fractional part of train lengths in the depot view.
2 files changed with 8 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/depot_gui.cpp
Show inline comments
 
@@ -285,9 +285,10 @@ struct DepotWindow : Window {
 
				DrawTrainImage(u, image_left + (rtl ? 0 : x_space), image_right - (rtl ? x_space : 0), sprite_y - 1,
 
						this->sel, free_wagon ? 0 : this->hscroll->GetPosition(), this->vehicle_over);
 

	
 
				/* Length of consist in tiles (rounded up) */
 
				SetDParam(0, CeilDiv(u->gcache.cached_total_length, TILE_SIZE));
 
				DrawString(rtl ? left + WD_FRAMERECT_LEFT : right - this->count_width, rtl ? left + this->count_width : right - WD_FRAMERECT_RIGHT, y + (this->resize.step_height - FONT_HEIGHT_SMALL) / 2, STR_TINY_BLACK_COMA, TC_FROMSTRING, SA_RIGHT); // Draw the counter
 
				/* Length of consist in tiles with 1 fractional digit (rounded up) */
 
				SetDParam(0, CeilDiv(u->gcache.cached_total_length * 10, TILE_SIZE));
 
				SetDParam(1, 1);
 
				DrawString(rtl ? left + WD_FRAMERECT_LEFT : right - this->count_width, rtl ? left + this->count_width : right - WD_FRAMERECT_RIGHT, y + (this->resize.step_height - FONT_HEIGHT_SMALL) / 2, STR_TINY_BLACK_DECIMAL, TC_FROMSTRING, SA_RIGHT); // Draw the counter
 
				break;
 
			}
 

	
 
@@ -598,8 +599,9 @@ struct DepotWindow : Window {
 
				uint min_height = 0;
 

	
 
				if (this->type == VEH_TRAIN) {
 
					SetDParam(0, 100);
 
					this->count_width = GetStringBoundingBox(STR_TINY_BLACK_COMA).width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
 
					SetDParam(0, 1000);
 
					SetDParam(1, 1);
 
					this->count_width = GetStringBoundingBox(STR_TINY_BLACK_DECIMAL).width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
 
				} else {
 
					this->count_width = 0;
 
				}
src/lang/english.txt
Show inline comments
 
@@ -4228,6 +4228,7 @@ STR_TINY_BLACK_COMA                     
 
STR_TINY_COMMA                                                  :{TINYFONT}{COMMA}
 
STR_BLUE_COMMA                                                  :{BLUE}{COMMA}
 
STR_RED_COMMA                                                   :{RED}{COMMA}
 
STR_TINY_BLACK_DECIMAL                                          :{TINYFONT}{BLACK}{DECIMAL}
 
STR_COMPANY_MONEY                                               :{WHITE}{CURRENCY}
 
STR_BLACK_DATE_LONG                                             :{BLACK}{DATE_LONG}
 
STR_BLACK_CROSS                                                 :{BLACK}{CROSS}
0 comments (0 inline, 0 general)