roadveh_gui.c
changeset 4000 4009d092b306
parent 3990 a317e665fb77
child 4012 62bea6a7f948
equal deleted inserted replaced
3999:69dfaadb5c3c 4000:4009d092b306
   413 		DeleteWindowById(WC_VEHICLE_DETAILS, w->window_number);
   413 		DeleteWindowById(WC_VEHICLE_DETAILS, w->window_number);
   414 		break;
   414 		break;
   415 
   415 
   416 	case WE_MOUSELOOP:
   416 	case WE_MOUSELOOP:
   417 		{
   417 		{
   418 			Vehicle *v;
   418 			const Vehicle* v = GetVehicle(w->window_number);
   419 			uint32 h;
   419 			uint32 h = IsRoadVehInDepotStopped(v) ? 1 << 7 | 1 << 8 : 1 << 11 | 1 << 12;
   420 			v = GetVehicle(w->window_number);
   420 
   421 			h = IsRoadVehInDepotStopped(v) ? (1 << 7) | (1 << 8) : (1 << 11) | (1 << 12);
       
   422 			if (h != w->hidden_state) {
   421 			if (h != w->hidden_state) {
   423 				w->hidden_state = h;
   422 				w->hidden_state = h;
   424 				SetWindowDirty(w);
   423 				SetWindowDirty(w);
   425 			}
   424 			}
   426 		}
   425 		}
  1005 
  1004 
  1006 			DrawRoadVehImage(v, x + 22, y + 6, INVALID_VEHICLE);
  1005 			DrawRoadVehImage(v, x + 22, y + 6, INVALID_VEHICLE);
  1007 			DrawVehicleProfitButton(v, x, y + 13);
  1006 			DrawVehicleProfitButton(v, x, y + 13);
  1008 
  1007 
  1009 			SetDParam(0, v->unitnumber);
  1008 			SetDParam(0, v->unitnumber);
  1010 			if (IsRoadVehInDepot(v))
  1009 			if (IsRoadVehInDepot(v)) {
  1011 				str = STR_021F;
  1010 				str = STR_021F;
  1012 			else
  1011 			} else {
  1013 				str = v->age > v->max_age - 366 ? STR_00E3 : STR_00E2;
  1012 				str = v->age > v->max_age - 366 ? STR_00E3 : STR_00E2;
       
  1013 			}
  1014 			DrawString(x, y + 2, str, 0);
  1014 			DrawString(x, y + 2, str, 0);
  1015 
  1015 
  1016 			SetDParam(0, v->profit_this_year);
  1016 			SetDParam(0, v->profit_this_year);
  1017 			SetDParam(1, v->profit_last_year);
  1017 			SetDParam(1, v->profit_last_year);
  1018 			DrawString(x + 24, y + 18, STR_0198_PROFIT_THIS_YEAR_LAST_YEAR, 0);
  1018 			DrawString(x + 24, y + 18, STR_0198_PROFIT_THIS_YEAR_LAST_YEAR, 0);