src/vehicle_gui.cpp
changeset 6417 26acff62d001
parent 6382 d7afe52a2289
child 6439 99a5807852b1
equal deleted inserted replaced
6416:be4399248c60 6417:26acff62d001
    26 #include "ship.h"
    26 #include "ship.h"
    27 #include "aircraft.h"
    27 #include "aircraft.h"
    28 #include "roadveh.h"
    28 #include "roadveh.h"
    29 #include "depot.h"
    29 #include "depot.h"
    30 #include "helpers.hpp"
    30 #include "helpers.hpp"
       
    31 #include "cargotype.h"
    31 
    32 
    32 typedef struct Sorting {
    33 typedef struct Sorting {
    33 	Listing aircraft;
    34 	Listing aircraft;
    34 	Listing roadveh;
    35 	Listing roadveh;
    35 	Listing ship;
    36 	Listing ship;
   302 			colour = 12;
   303 			colour = 12;
   303 		}
   304 		}
   304 
   305 
   305 		if (i >= pos && i < pos + rows) {
   306 		if (i >= pos && i < pos + rows) {
   306 			/* Draw the cargo name */
   307 			/* Draw the cargo name */
   307 			int last_x = DrawString(2, y, _cargoc.names_s[refit[i].cargo], colour);
   308 			int last_x = DrawString(2, y, GetCargo(refit[i].cargo)->name, colour);
   308 
   309 
   309 			/* If the callback succeeded, draw the cargo suffix */
   310 			/* If the callback succeeded, draw the cargo suffix */
   310 			if (refit[i].value != CALLBACK_FAILED) {
   311 			if (refit[i].value != CALLBACK_FAILED) {
   311 				DrawString(last_x + 1, y, GetGRFStringID(GetEngineGRFID(refit[i].engine), 0xD000 + refit[i].value), colour);
   312 				DrawString(last_x + 1, y, GetGRFStringID(GetEngineGRFID(refit[i].engine), 0xD000 + refit[i].value), colour);
   312 			}
   313 			}
   519 
   520 
   520 		/* Add each cargo type to the list */
   521 		/* Add each cargo type to the list */
   521 		for (cid = 0; cmask != 0; cmask >>= 1, cid++) {
   522 		for (cid = 0; cmask != 0; cmask >>= 1, cid++) {
   522 			if (!HASBIT(cmask, 0)) continue;
   523 			if (!HASBIT(cmask, 0)) continue;
   523 
   524 
   524 			b = InlineString(b, _cargoc.names_s[_local_cargo_id_ctype[cid]]);
   525 			b = InlineString(b, GetCargo(_local_cargo_id_ctype[cid])->name);
   525 			if (cmask > 1) b = strecpy(b, ", ", lastof(_userstring));
   526 			if (cmask > 1) b = strecpy(b, ", ", lastof(_userstring));
   526 		}
   527 		}
   527 	}
   528 	}
   528 
   529 
   529 	/* Terminate and display the completed string */
   530 	/* Terminate and display the completed string */