File diff r5867:de68577800e6 → r5868:bc3e720ec5f7
src/train_gui.cpp
Show inline comments
 
@@ -149,25 +149,25 @@ static void TrainViewWndProc(Window *w, 
 
		SetWindowWidgetDisabledState(w,  7, !is_localplayer);
 
		SetWindowWidgetDisabledState(w,  8, !is_localplayer);
 
		SetWindowWidgetDisabledState(w,  9, !is_localplayer);
 
		SetWindowWidgetDisabledState(w, 13, !is_localplayer);
 

	
 
		/* Disable cargo refit button, until we know we can enable it below. */
 
		DisableWindowWidget(w, 12);
 

	
 
		if (is_localplayer) {
 
			/* See if any vehicle can be refitted */
 
			for (u = v; u != NULL; u = u->next) {
 
				if (EngInfo(u->engine_type)->refit_mask != 0 ||
 
						(!(RailVehInfo(v->engine_type)->flags & RVI_WAGON) && v->cargo_cap != 0)) {
 
						(RailVehInfo(v->engine_type)->railveh_type != RAILVEH_WAGON && v->cargo_cap != 0)) {
 
					EnableWindowWidget(w, 12);
 
					/* We have a refittable carriage, bail out */
 
					break;
 
				}
 
			}
 
		}
 

	
 
		/* draw widgets & caption */
 
		SetDParam(0, v->string_id);
 
		SetDParam(1, v->unitnumber);
 
		DrawWindowWidgets(w);
 

	
 
@@ -332,25 +332,25 @@ static void TrainDetailsCargoTab(const V
 
			SetDParam(0, v->cargo_type);
 
			SetDParam(1, num);
 
			SetDParam(2, v->cargo_source);
 
			SetDParam(3, _patches.freight_trains);
 
			str = FreightWagonMult(v->cargo_type) > 1 ? STR_FROM_MULT : STR_8813_FROM;
 
		}
 
		DrawString(x, y, str, 0);
 
	}
 
}
 

	
 
static void TrainDetailsInfoTab(const Vehicle *v, int x, int y)
 
{
 
	if (RailVehInfo(v->engine_type)->flags & RVI_WAGON) {
 
	if (RailVehInfo(v->engine_type)->railveh_type == RAILVEH_WAGON) {
 
		SetDParam(0, GetCustomEngineName(v->engine_type));
 
		SetDParam(1, v->value);
 
		DrawString(x, y, STR_882D_VALUE, 0x10);
 
	} else {
 
		SetDParam(0, GetCustomEngineName(v->engine_type));
 
		SetDParam(1, v->build_year);
 
		SetDParam(2, v->value);
 
		DrawString(x, y, STR_882C_BUILT_VALUE, 0x10);
 
	}
 
}
 

	
 
static void TrainDetailsCapacityTab(const Vehicle *v, int x, int y)