train_gui.c
changeset 4000 4009d092b306
parent 3948 a09379beffd5
child 4012 62bea6a7f948
equal deleted inserted replaced
3999:69dfaadb5c3c 4000:4009d092b306
   338 	w->window_number = tile;
   338 	w->window_number = tile;
   339 	w->vscroll.cap = 8;
   339 	w->vscroll.cap = 8;
   340 	w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
   340 	w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
   341 
   341 
   342 	w->resize.step_height = 14;
   342 	w->resize.step_height = 14;
   343 	w->resize.height = w->height - 14 * 4; /* Minimum of 4 vehicles in the display */
   343 	w->resize.height = w->height - 14 * 4; // Minimum of 4 vehicles in the display
   344 
   344 
   345 	if (tile != 0) {
   345 	if (tile != 0) {
   346 		w->caption_color = GetTileOwner(tile);
   346 		w->caption_color = GetTileOwner(tile);
   347 		WP(w,buildtrain_d).railtype = GetRailType(tile);
   347 		WP(w,buildtrain_d).railtype = GetRailType(tile);
   348 	} else {
   348 	} else {
  1047 		DeleteWindowById(WC_VEHICLE_ORDERS, w->window_number);
  1047 		DeleteWindowById(WC_VEHICLE_ORDERS, w->window_number);
  1048 		DeleteWindowById(WC_VEHICLE_DETAILS, w->window_number);
  1048 		DeleteWindowById(WC_VEHICLE_DETAILS, w->window_number);
  1049 		break;
  1049 		break;
  1050 
  1050 
  1051 	case WE_MOUSELOOP: {
  1051 	case WE_MOUSELOOP: {
  1052 		Vehicle *v;
  1052 		const Vehicle* v = GetVehicle(w->window_number);
  1053 		uint32 h;
  1053 		uint32 h;
  1054 
  1054 
  1055 		v = GetVehicle(w->window_number);
       
  1056 		assert(v->type == VEH_Train);
  1055 		assert(v->type == VEH_Train);
  1057 		h = CheckTrainStoppedInDepot(v) >= 0 ? (1 << 9)| (1 << 7) : (1 << 12) | (1 << 13);
  1056 		h = CheckTrainStoppedInDepot(v) >= 0 ? (1 << 9)| (1 << 7) : (1 << 12) | (1 << 13);
  1058 		if (h != w->hidden_state) {
  1057 		if (h != w->hidden_state) {
  1059 			w->hidden_state = h;
  1058 			w->hidden_state = h;
  1060 			SetWindowDirty(w);
  1059 			SetWindowDirty(w);