road_gui.c
changeset 568 b0d0df062880
parent 543 946badd71033
child 606 da90c837064c
equal deleted inserted replaced
567:e63b977925f7 568:b0d0df062880
     5 #include "gui.h"
     5 #include "gui.h"
     6 #include "viewport.h"
     6 #include "viewport.h"
     7 #include "gfx.h"
     7 #include "gfx.h"
     8 #include "sound.h"
     8 #include "sound.h"
     9 #include "command.h"
     9 #include "command.h"
       
    10 //needed for catchments
       
    11 #include "station.h"
       
    12 
    10 
    13 
    11 static void ShowBusStationPicker();
    14 static void ShowBusStationPicker();
    12 static void ShowTruckStationPicker();
    15 static void ShowTruckStationPicker();
    13 static void ShowRoadDepotPicker();
    16 static void ShowRoadDepotPicker();
    14 
    17 
   398 {
   401 {
   399 	AllocateWindowDesc(&_build_road_depot_desc);
   402 	AllocateWindowDesc(&_build_road_depot_desc);
   400 }
   403 }
   401 
   404 
   402 static void RoadStationPickerWndProc(Window *w, WindowEvent *e) {
   405 static void RoadStationPickerWndProc(Window *w, WindowEvent *e) {
       
   406 
       
   407 	int rad;
       
   408 	
   403 	switch(e->event) {
   409 	switch(e->event) {
   404 	case WE_PAINT: {
   410 	case WE_PAINT: {
   405 		int image;
   411 		int image;
   406 
   412 
   407 		w->click_state = ((1<<3) << _road_station_picker_orientation)	|
   413 		w->click_state = ((1<<3) << _road_station_picker_orientation)	|
   408 										 ((1<<7) << _station_show_coverage);
   414 										 ((1<<7) << _station_show_coverage);
   409 		DrawWindowWidgets(w);
   415 		DrawWindowWidgets(w);
   410 
   416 
   411 		SetTileSelectSize(1, 1);
   417 		SetTileSelectSize(1, 1);
       
   418 		
       
   419 		if (_patches.modified_catchment) {
       
   420 			rad = CA_TRUCK; // = CA_BUS
       
   421 		} else {
       
   422 			rad = 4;
       
   423 		}
       
   424 		
   412 		if (_station_show_coverage)
   425 		if (_station_show_coverage)
   413 			SetTileSelectBigSize(-4, -4, 8, 8);
   426 			SetTileSelectBigSize(-rad, -rad, 2*rad, 2*rad);
   414 
   427 
   415 		image = (w->window_class == WC_BUS_STATION) ? 0x47 : 0x43;
   428 		image = (w->window_class == WC_BUS_STATION) ? 0x47 : 0x43;
   416 
   429 
   417 		StationPickerDrawSprite(103, 35, 0, image);
   430 		StationPickerDrawSprite(103, 35, 0, image);
   418 		StationPickerDrawSprite(103, 85, 0, image+1);
   431 		StationPickerDrawSprite(103, 85, 0, image+1);
   419 		StationPickerDrawSprite(35, 85, 0, image+2);
   432 		StationPickerDrawSprite(35, 85, 0, image+2);
   420 		StationPickerDrawSprite(35, 35, 0, image+3);
   433 		StationPickerDrawSprite(35, 35, 0, image+3);
   421 
   434 
   422 		DrawStringCentered(70, 120, STR_3066_COVERAGE_AREA_HIGHLIGHT, 0);
   435 		DrawStringCentered(70, 120, STR_3066_COVERAGE_AREA_HIGHLIGHT, 0);
   423 		DrawStationCoverageAreaText(2, 146,
   436 		DrawStationCoverageAreaText(2, 146,
   424 			((w->window_class == WC_BUS_STATION) ? (1<<CT_PASSENGERS) : ~(1<<CT_PASSENGERS))
   437 			((w->window_class == WC_BUS_STATION) ? (1<<CT_PASSENGERS) : ~(1<<CT_PASSENGERS)),
   425 		);
   438 			3);
   426 
   439 
   427 	} break;
   440 	} break;
   428 
   441 
   429 	case WE_CLICK: {
   442 	case WE_CLICK: {
   430 		switch(e->click.widget) {
   443 		switch(e->click.widget) {