src/engine_gui.cpp
changeset 5919 2b58160d667d
parent 5838 9c3129cb019b
child 6074 e70d63ef4d62
equal deleted inserted replaced
5918:602e158900a2 5919:2b58160d667d
    44 { WWT_PUSHTXTBTN,   RESIZE_NONE,     5,    85,   144,   172,   183, STR_00C9_NO,                               STR_NULL},
    44 { WWT_PUSHTXTBTN,   RESIZE_NONE,     5,    85,   144,   172,   183, STR_00C9_NO,                               STR_NULL},
    45 { WWT_PUSHTXTBTN,   RESIZE_NONE,     5,   155,   214,   172,   183, STR_00C8_YES,                              STR_NULL},
    45 { WWT_PUSHTXTBTN,   RESIZE_NONE,     5,   155,   214,   172,   183, STR_00C8_YES,                              STR_NULL},
    46 {   WIDGETS_END},
    46 {   WIDGETS_END},
    47 };
    47 };
    48 
    48 
    49 typedef void DrawEngineProc(int x, int y, EngineID engine, uint32 image_ormod);
    49 typedef void DrawEngineProc(int x, int y, EngineID engine, SpriteID pal);
    50 typedef void DrawEngineInfoProc(EngineID, int x, int y, int maxw);
    50 typedef void DrawEngineInfoProc(EngineID, int x, int y, int maxw);
    51 
    51 
    52 typedef struct DrawEngineInfo {
    52 typedef struct DrawEngineInfo {
    53 	DrawEngineProc *engine_proc;
    53 	DrawEngineProc *engine_proc;
    54 	DrawEngineInfoProc *info_proc;
    54 	DrawEngineInfoProc *info_proc;
   154 
   154 
   155 	SetDParam(0, GetCustomEngineName(engine));
   155 	SetDParam(0, GetCustomEngineName(engine));
   156 	DrawStringMultiCenter(w->width >> 1, 57, STR_885A, w->width - 2);
   156 	DrawStringMultiCenter(w->width >> 1, 57, STR_885A, w->width - 2);
   157 
   157 
   158 	DrawTrainEngine(w->width >> 1, 88, engine, 0);
   158 	DrawTrainEngine(w->width >> 1, 88, engine, 0);
   159 	GfxFillRect(25, 56, w->width - 56, 112, 0x323 | USE_COLORTABLE);
   159 	GfxFillRect(25, 56, w->width - 56, 112, PALETTE_TO_STRUCT_GREY | (1 << USE_COLORTABLE));
   160 	DrawTrainEngineInfo(engine, w->width >> 1, 129, w->width - 52);
   160 	DrawTrainEngineInfo(engine, w->width >> 1, 129, w->width - 52);
   161 }
   161 }
   162 
   162 
   163 StringID GetNewsStringNewTrainAvail(const NewsItem *ni)
   163 StringID GetNewsStringNewTrainAvail(const NewsItem *ni)
   164 {
   164 {
   194 
   194 
   195 	SetDParam(0, GetCustomEngineName(engine));
   195 	SetDParam(0, GetCustomEngineName(engine));
   196 	DrawStringMultiCenter(w->width >> 1, 57, STR_A02D, w->width - 2);
   196 	DrawStringMultiCenter(w->width >> 1, 57, STR_A02D, w->width - 2);
   197 
   197 
   198 	DrawAircraftEngine(w->width >> 1, 93, engine, 0);
   198 	DrawAircraftEngine(w->width >> 1, 93, engine, 0);
   199 	GfxFillRect(25, 56, w->width - 56, 110, 0x323 | USE_COLORTABLE);
   199 	GfxFillRect(25, 56, w->width - 56, 110, PALETTE_TO_STRUCT_GREY | (1 << USE_COLORTABLE));
   200 	DrawAircraftEngineInfo(engine, w->width >> 1, 131, w->width - 52);
   200 	DrawAircraftEngineInfo(engine, w->width >> 1, 131, w->width - 52);
   201 }
   201 }
   202 
   202 
   203 StringID GetNewsStringNewAircraftAvail(const NewsItem *ni)
   203 StringID GetNewsStringNewAircraftAvail(const NewsItem *ni)
   204 {
   204 {
   233 
   233 
   234 	SetDParam(0, GetCustomEngineName(engine));
   234 	SetDParam(0, GetCustomEngineName(engine));
   235 	DrawStringMultiCenter(w->width >> 1, 57, STR_9029, w->width - 2);
   235 	DrawStringMultiCenter(w->width >> 1, 57, STR_9029, w->width - 2);
   236 
   236 
   237 	DrawRoadVehEngine(w->width >> 1, 88, engine, 0);
   237 	DrawRoadVehEngine(w->width >> 1, 88, engine, 0);
   238 	GfxFillRect(25, 56, w->width - 56, 112, 0x323 | USE_COLORTABLE);
   238 	GfxFillRect(25, 56, w->width - 56, 112, PALETTE_TO_STRUCT_GREY | (1 << USE_COLORTABLE));
   239 	DrawRoadVehEngineInfo(engine, w->width >> 1, 129, w->width - 52);
   239 	DrawRoadVehEngineInfo(engine, w->width >> 1, 129, w->width - 52);
   240 }
   240 }
   241 
   241 
   242 StringID GetNewsStringNewRoadVehAvail(const NewsItem *ni)
   242 StringID GetNewsStringNewRoadVehAvail(const NewsItem *ni)
   243 {
   243 {
   271 
   271 
   272 	SetDParam(0, GetCustomEngineName(engine));
   272 	SetDParam(0, GetCustomEngineName(engine));
   273 	DrawStringMultiCenter(w->width >> 1, 57, STR_982D, w->width - 2);
   273 	DrawStringMultiCenter(w->width >> 1, 57, STR_982D, w->width - 2);
   274 
   274 
   275 	DrawShipEngine(w->width >> 1, 93, engine, 0);
   275 	DrawShipEngine(w->width >> 1, 93, engine, 0);
   276 	GfxFillRect(25, 56, w->width - 56, 110, 0x323 | USE_COLORTABLE);
   276 	GfxFillRect(25, 56, w->width - 56, 110, PALETTE_TO_STRUCT_GREY | (1 << USE_COLORTABLE));
   277 	DrawShipEngineInfo(engine, w->width >> 1, 131, w->width - 52);
   277 	DrawShipEngineInfo(engine, w->width >> 1, 131, w->width - 52);
   278 }
   278 }
   279 
   279 
   280 StringID GetNewsStringNewShipAvail(const NewsItem *ni)
   280 StringID GetNewsStringNewShipAvail(const NewsItem *ni)
   281 {
   281 {