engine_gui.c
changeset 2639 eeaefdabfdfd
parent 2549 5587f9a38563
child 2725 775e3e14ca46
equal deleted inserted replaced
2638:0811adaec525 2639:eeaefdabfdfd
    63 	{DrawAircraftEngine,DrawAircraftEngineInfo},
    63 	{DrawAircraftEngine,DrawAircraftEngineInfo},
    64 };
    64 };
    65 
    65 
    66 static void EnginePreviewWndProc(Window *w, WindowEvent *e)
    66 static void EnginePreviewWndProc(Window *w, WindowEvent *e)
    67 {
    67 {
    68 	const DrawEngineInfo *dei;
    68 	switch (e->event) {
    69 	int width;
       
    70 
       
    71 	switch(e->event) {
       
    72 	case WE_PAINT: {
    69 	case WE_PAINT: {
    73 		EngineID engine = w->window_number;
    70 		EngineID engine = w->window_number;
       
    71 		const DrawEngineInfo* dei;
       
    72 		int width;
    74 
    73 
    75 		DrawWindowWidgets(w);
    74 		DrawWindowWidgets(w);
    76 
    75 
    77 		SetDParam(0, GetEngineCategoryName(engine));
    76 		SetDParam(0, GetEngineCategoryName(engine));
    78 		DrawStringMultiCenter(150, 44, STR_8101_WE_HAVE_JUST_DESIGNED_A, 296);
    77 		DrawStringMultiCenter(150, 44, STR_8101_WE_HAVE_JUST_DESIGNED_A, 296);
    89 		dei->info_proc(engine, width >> 1, 130, width - 52);
    88 		dei->info_proc(engine, width >> 1, 130, width - 52);
    90 		break;
    89 		break;
    91 	}
    90 	}
    92 
    91 
    93 	case WE_CLICK:
    92 	case WE_CLICK:
    94 		switch(e->click.widget) {
    93 		switch (e->click.widget) {
    95 		case 3: DeleteWindow(w); break;
    94 			case 3:
    96 		case 4:
    95 				DeleteWindow(w);
    97 			DoCommandP(0, w->window_number, 0, NULL, CMD_WANT_ENGINE_PREVIEW);
    96 				break;
    98 			DeleteWindow(w);
    97 
    99 			break;
    98 			case 4:
       
    99 				DoCommandP(0, w->window_number, 0, NULL, CMD_WANT_ENGINE_PREVIEW);
       
   100 				DeleteWindow(w);
       
   101 				break;
   100 		}
   102 		}
   101 		break;
   103 		break;
   102 	}
   104 	}
   103 }
   105 }
   104 
   106