src/airport_gui.cpp
branchgamebalance
changeset 9910 0b2aebc8283e
parent 9895 7bd07f43b0e3
child 7165 37eb253f3c06
child 9624 b71483f2330f
equal deleted inserted replaced
9909:dce9a6923bb7 9910:0b2aebc8283e
   103 	case WE_ABORT_PLACE_OBJ:
   103 	case WE_ABORT_PLACE_OBJ:
   104 		RaiseWindowButtons(w);
   104 		RaiseWindowButtons(w);
   105 
   105 
   106 		w = FindWindowById(WC_BUILD_STATION, 0);
   106 		w = FindWindowById(WC_BUILD_STATION, 0);
   107 		if (w != 0)
   107 		if (w != 0)
   108 			WP(w,def_d).close = true;
   108 			WP(w, def_d).close = true;
   109 		break;
   109 		break;
   110 
   110 
   111 	case WE_DESTROY:
   111 	case WE_DESTROY:
   112 		if (_patches.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0);
   112 		if (_patches.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0);
   113 		break;
   113 		break;
   153 	case WE_PAINT: {
   153 	case WE_PAINT: {
   154 		int i; // airport enabling loop
   154 		int i; // airport enabling loop
   155 		uint32 avail_airports;
   155 		uint32 avail_airports;
   156 		const AirportFTAClass *airport;
   156 		const AirportFTAClass *airport;
   157 
   157 
   158 		if (WP(w,def_d).close) return;
   158 		if (WP(w, def_d).close) return;
   159 
   159 
   160 		avail_airports = GetValidAirports();
   160 		avail_airports = GetValidAirports();
   161 
   161 
   162 		RaiseWindowWidget(w, _selected_airport_type + 7);
   162 		RaiseWindowWidget(w, _selected_airport_type + 7);
   163 		if (!HASBIT(avail_airports, 0) && _selected_airport_type == AT_SMALL) _selected_airport_type = AT_LARGE;
   163 		if (!HASBIT(avail_airports, 0) && _selected_airport_type == AT_SMALL) _selected_airport_type = AT_LARGE;
   205 			break;
   205 			break;
   206 		}
   206 		}
   207 	} break;
   207 	} break;
   208 
   208 
   209 	case WE_MOUSELOOP: {
   209 	case WE_MOUSELOOP: {
   210 		if (WP(w,def_d).close) {
   210 		if (WP(w, def_d).close) {
   211 			DeleteWindow(w);
   211 			DeleteWindow(w);
   212 			return;
   212 			return;
   213 		}
   213 		}
   214 
   214 
   215 		CheckRedrawStationCoverage(w);
   215 		CheckRedrawStationCoverage(w);
   216 	} break;
   216 	} break;
   217 
   217 
   218 	case WE_DESTROY:
   218 	case WE_DESTROY:
   219 		if (!WP(w,def_d).close) ResetObjectToPlace();
   219 		if (!WP(w, def_d).close) ResetObjectToPlace();
   220 		break;
   220 		break;
   221 	}
   221 	}
   222 }
   222 }
   223 
   223 
   224 static const Widget _build_airport_picker_widgets[] = {
   224 static const Widget _build_airport_picker_widgets[] = {