engine_gui.c
changeset 534 306bc86eb23e
parent 507 04b5403aaf6b
child 867 dffd33233237
equal deleted inserted replaced
533:404f9e37bff1 534:306bc86eb23e
    69 	switch(e->event) {
    69 	switch(e->event) {
    70 	case WE_PAINT:
    70 	case WE_PAINT:
    71 		DrawWindowWidgets(w);
    71 		DrawWindowWidgets(w);
    72 		engine = w->window_number;
    72 		engine = w->window_number;
    73 
    73 
    74 		SET_DPARAM16(0, GetEngineCategoryName(engine));
    74 		SetDParam(0, GetEngineCategoryName(engine));
    75 		DrawStringMultiCenter(150, 44, STR_8101_WE_HAVE_JUST_DESIGNED_A, 296);
    75 		DrawStringMultiCenter(150, 44, STR_8101_WE_HAVE_JUST_DESIGNED_A, 296);
    76 
    76 
    77 		DrawStringCentered(w->width >> 1, 80, GetCustomEngineName(engine), 0x10);
    77 		DrawStringCentered(w->width >> 1, 80, GetCustomEngineName(engine), 0x10);
    78 
    78 
    79 		eng = (byte)engine;
    79 		eng = (byte)engine;
   121 	int engine;
   121 	int engine;
   122 
   122 
   123 	DrawNewsBorder(w);
   123 	DrawNewsBorder(w);
   124 
   124 
   125 	engine = WP(w,news_d).ni->string_id;
   125 	engine = WP(w,news_d).ni->string_id;
   126 	SET_DPARAM16(0, GetEngineCategoryName(engine));
   126 	SetDParam(0, GetEngineCategoryName(engine));
   127 	DrawStringMultiCenter(w->width >> 1, 20, STR_8859_NEW_NOW_AVAILABLE, w->width - 2);
   127 	DrawStringMultiCenter(w->width >> 1, 20, STR_8859_NEW_NOW_AVAILABLE, w->width - 2);
   128 
   128 
   129 	GfxFillRect(25, 56, w->width - 25, w->height - 2, 10);
   129 	GfxFillRect(25, 56, w->width - 25, w->height - 2, 10);
   130 
   130 
   131 	SET_DPARAM16(0, GetCustomEngineName(engine));
   131 	SetDParam(0, GetCustomEngineName(engine));
   132 	DrawStringMultiCenter(w->width >> 1, 57, STR_885A, w->width - 2);
   132 	DrawStringMultiCenter(w->width >> 1, 57, STR_885A, w->width - 2);
   133 
   133 
   134 	DrawTrainEngine(w->width >> 1, 88, engine, 0);
   134 	DrawTrainEngine(w->width >> 1, 88, engine, 0);
   135 	GfxFillRect(25, 56, w->width - 56, 112, 0x4323);
   135 	GfxFillRect(25, 56, w->width - 56, 112, 0x4323);
   136 	DrawTrainEngineInfo(engine, w->width >> 1, 129, w->width - 52);
   136 	DrawTrainEngineInfo(engine, w->width >> 1, 129, w->width - 52);
   137 }
   137 }
   138 
   138 
   139 StringID GetNewsStringNewTrainAvail(NewsItem *ni)
   139 StringID GetNewsStringNewTrainAvail(NewsItem *ni)
   140 {
   140 {
   141 	int engine = ni->string_id;
   141 	int engine = ni->string_id;
   142 	SET_DPARAM16(0, STR_8859_NEW_NOW_AVAILABLE);
   142 	SetDParam(0, STR_8859_NEW_NOW_AVAILABLE);
   143 	SET_DPARAM16(1, GetEngineCategoryName(engine));
   143 	SetDParam(1, GetEngineCategoryName(engine));
   144 	SET_DPARAM16(2, GetCustomEngineName(engine));
   144 	SetDParam(2, GetCustomEngineName(engine));
   145 	return STR_02B6;
   145 	return STR_02B6;
   146 }
   146 }
   147 
   147 
   148 void DrawNewsNewAircraftAvail(Window *w)
   148 void DrawNewsNewAircraftAvail(Window *w)
   149 {
   149 {
   154 	engine = WP(w,news_d).ni->string_id;
   154 	engine = WP(w,news_d).ni->string_id;
   155 
   155 
   156 	DrawStringMultiCenter(w->width >> 1, 20, STR_A02C_NEW_AIRCRAFT_NOW_AVAILABLE, w->width - 2);
   156 	DrawStringMultiCenter(w->width >> 1, 20, STR_A02C_NEW_AIRCRAFT_NOW_AVAILABLE, w->width - 2);
   157 	GfxFillRect(25, 56, w->width - 25, w->height - 2, 10);
   157 	GfxFillRect(25, 56, w->width - 25, w->height - 2, 10);
   158 
   158 
   159 	SET_DPARAM16(0, GetCustomEngineName(engine));
   159 	SetDParam(0, GetCustomEngineName(engine));
   160 	DrawStringMultiCenter(w->width >> 1, 57, STR_A02D, w->width - 2);
   160 	DrawStringMultiCenter(w->width >> 1, 57, STR_A02D, w->width - 2);
   161 
   161 
   162 	DrawAircraftEngine(w->width >> 1, 93, engine, 0);
   162 	DrawAircraftEngine(w->width >> 1, 93, engine, 0);
   163 	GfxFillRect(25, 56, w->width - 56, 110, 0x4323);
   163 	GfxFillRect(25, 56, w->width - 56, 110, 0x4323);
   164 	DrawAircraftEngineInfo(engine, w->width >> 1, 131, w->width - 52);
   164 	DrawAircraftEngineInfo(engine, w->width >> 1, 131, w->width - 52);
   165 }
   165 }
   166 
   166 
   167 StringID GetNewsStringNewAircraftAvail(NewsItem *ni)
   167 StringID GetNewsStringNewAircraftAvail(NewsItem *ni)
   168 {
   168 {
   169 	int engine = ni->string_id;
   169 	int engine = ni->string_id;
   170 	SET_DPARAM16(0, STR_A02C_NEW_AIRCRAFT_NOW_AVAILABLE);
   170 	SetDParam(0, STR_A02C_NEW_AIRCRAFT_NOW_AVAILABLE);
   171 	SET_DPARAM16(1, GetCustomEngineName(engine));
   171 	SetDParam(1, GetCustomEngineName(engine));
   172 	return STR_02B6;
   172 	return STR_02B6;
   173 }
   173 }
   174 
   174 
   175 void DrawNewsNewRoadVehAvail(Window *w)
   175 void DrawNewsNewRoadVehAvail(Window *w)
   176 {
   176 {
   180 
   180 
   181 	engine = WP(w,news_d).ni->string_id;
   181 	engine = WP(w,news_d).ni->string_id;
   182 	DrawStringMultiCenter(w->width >> 1, 20, STR_9028_NEW_ROAD_VEHICLE_NOW_AVAILABLE, w->width - 2);
   182 	DrawStringMultiCenter(w->width >> 1, 20, STR_9028_NEW_ROAD_VEHICLE_NOW_AVAILABLE, w->width - 2);
   183 	GfxFillRect(25, 56, w->width - 25, w->height - 2, 10);
   183 	GfxFillRect(25, 56, w->width - 25, w->height - 2, 10);
   184 
   184 
   185 	SET_DPARAM16(0, GetCustomEngineName(engine));
   185 	SetDParam(0, GetCustomEngineName(engine));
   186 	DrawStringMultiCenter(w->width >> 1, 57, STR_9029, w->width - 2);
   186 	DrawStringMultiCenter(w->width >> 1, 57, STR_9029, w->width - 2);
   187 
   187 
   188 	DrawRoadVehEngine(w->width >> 1, 88, engine, 0);
   188 	DrawRoadVehEngine(w->width >> 1, 88, engine, 0);
   189 	GfxFillRect(25, 56, w->width - 56, 112, 0x4323);
   189 	GfxFillRect(25, 56, w->width - 56, 112, 0x4323);
   190 	DrawRoadVehEngineInfo(engine, w->width >> 1, 129, w->width - 52);
   190 	DrawRoadVehEngineInfo(engine, w->width >> 1, 129, w->width - 52);
   191 }
   191 }
   192 
   192 
   193 StringID GetNewsStringNewRoadVehAvail(NewsItem *ni)
   193 StringID GetNewsStringNewRoadVehAvail(NewsItem *ni)
   194 {
   194 {
   195 	int engine = ni->string_id;
   195 	int engine = ni->string_id;
   196 	SET_DPARAM16(0, STR_9028_NEW_ROAD_VEHICLE_NOW_AVAILABLE);
   196 	SetDParam(0, STR_9028_NEW_ROAD_VEHICLE_NOW_AVAILABLE);
   197 	SET_DPARAM16(1, GetCustomEngineName(engine));
   197 	SetDParam(1, GetCustomEngineName(engine));
   198 	return STR_02B6;
   198 	return STR_02B6;
   199 }
   199 }
   200 
   200 
   201 void DrawNewsNewShipAvail(Window *w)
   201 void DrawNewsNewShipAvail(Window *w)
   202 {
   202 {
   207 	engine = WP(w,news_d).ni->string_id;
   207 	engine = WP(w,news_d).ni->string_id;
   208 
   208 
   209 	DrawStringMultiCenter(w->width >> 1, 20, STR_982C_NEW_SHIP_NOW_AVAILABLE, w->width - 2);
   209 	DrawStringMultiCenter(w->width >> 1, 20, STR_982C_NEW_SHIP_NOW_AVAILABLE, w->width - 2);
   210 	GfxFillRect(25, 56, w->width - 25, w->height - 2, 10);
   210 	GfxFillRect(25, 56, w->width - 25, w->height - 2, 10);
   211 
   211 
   212 	SET_DPARAM16(0, GetCustomEngineName(engine));
   212 	SetDParam(0, GetCustomEngineName(engine));
   213 	DrawStringMultiCenter(w->width >> 1, 57, STR_982D, w->width - 2);
   213 	DrawStringMultiCenter(w->width >> 1, 57, STR_982D, w->width - 2);
   214 
   214 
   215 	DrawShipEngine(w->width >> 1, 93, engine, 0);
   215 	DrawShipEngine(w->width >> 1, 93, engine, 0);
   216 	GfxFillRect(25, 56, w->width - 56, 110, 0x4323);
   216 	GfxFillRect(25, 56, w->width - 56, 110, 0x4323);
   217 	DrawShipEngineInfo(engine, w->width >> 1, 131, w->width - 52);
   217 	DrawShipEngineInfo(engine, w->width >> 1, 131, w->width - 52);
   218 }
   218 }
   219 
   219 
   220 StringID GetNewsStringNewShipAvail(NewsItem *ni)
   220 StringID GetNewsStringNewShipAvail(NewsItem *ni)
   221 {
   221 {
   222 	int engine = ni->string_id;
   222 	int engine = ni->string_id;
   223 	SET_DPARAM16(0, STR_982C_NEW_SHIP_NOW_AVAILABLE);
   223 	SetDParam(0, STR_982C_NEW_SHIP_NOW_AVAILABLE);
   224 	SET_DPARAM16(1, GetCustomEngineName(engine));
   224 	SetDParam(1, GetCustomEngineName(engine));
   225 	return STR_02B6;
   225 	return STR_02B6;
   226 }
   226 }