airport_gui.c
changeset 568 b0d0df062880
parent 543 946badd71033
child 606 da90c837064c
equal deleted inserted replaced
567:e63b977925f7 568:b0d0df062880
   132 	AllocateWindowDescFront(&_air_toolbar_desc, 0);
   132 	AllocateWindowDescFront(&_air_toolbar_desc, 0);
   133 }
   133 }
   134 
   134 
   135 static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
   135 static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
   136 {
   136 {
       
   137 	int rad;
       
   138 	
   137 	switch(e->event) {
   139 	switch(e->event) {
   138 	case WE_PAINT: {
   140 	case WE_PAINT: {
   139 		int sel;
   141 		int sel;
   140 
   142 
   141 		if (WP(w,def_d).close)
   143 		if (WP(w,def_d).close)
   153 		if (_date < 25568) {w->disabled_state |= (1<<7);}	// international airport 1990
   155 		if (_date < 25568) {w->disabled_state |= (1<<7);}	// international airport 1990
   154 		_selected_airport_type = sel;
   156 		_selected_airport_type = sel;
   155 		// select default the coverage area to 'Off' (8)
   157 		// select default the coverage area to 'Off' (8)
   156 		w->click_state = ((1<<3) << sel) | ((1<<8) << _station_show_coverage);
   158 		w->click_state = ((1<<3) << sel) | ((1<<8) << _station_show_coverage);
   157 		SetTileSelectSize(_airport_size_x[sel],_airport_size_y[sel]);
   159 		SetTileSelectSize(_airport_size_x[sel],_airport_size_y[sel]);
   158 		if (_station_show_coverage)	SetTileSelectBigSize(-4, -4, 8, 8);
   160 
       
   161      if (_patches.modified_catchment) {
       
   162        switch (sel) {
       
   163          case AT_OILRIG: rad = CA_AIR_OILPAD; break;
       
   164          case AT_HELIPORT: rad = CA_AIR_HELIPORT; break;
       
   165          case AT_SMALL:    rad = CA_AIR_SMALL; break;
       
   166          case AT_LARGE:    rad = CA_AIR_LARGE; break;
       
   167          case AT_METROPOLITAN: rad = CA_AIR_METRO; break;
       
   168          case AT_INTERNATIONAL: rad = CA_AIR_INTER; break;
       
   169        }
       
   170      } else {
       
   171        rad = 4;
       
   172      }
       
   173 
       
   174 	
       
   175 		if (_station_show_coverage)	SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
   159 
   176 
   160 		DrawWindowWidgets(w);
   177 		DrawWindowWidgets(w);
   161     // strings such as 'Size' and 'Coverage Area'
   178     // strings such as 'Size' and 'Coverage Area'
   162 		DrawStringCentered(74, 16, STR_305B_SIZE, 0);
   179 		DrawStringCentered(74, 16, STR_305B_SIZE, 0);
   163 		DrawStringCentered(74, 78, STR_3066_COVERAGE_AREA_HIGHLIGHT, 0);
   180 		DrawStringCentered(74, 78, STR_3066_COVERAGE_AREA_HIGHLIGHT, 0);
   164 		DrawStationCoverageAreaText(2, 104, (uint)-1);
   181 		DrawStationCoverageAreaText(2, 104, (uint)-1, rad);
   165 		break;
   182 		break;
   166 	}
   183 	}
   167 
   184 
   168 	case WE_CLICK: {
   185 	case WE_CLICK: {
   169 		switch(e->click.widget) {
   186 		switch(e->click.widget) {