src/airport_gui.cpp
changeset 9338 3d6f9ddd431d
parent 9334 28ac6c8e0795
child 9354 845e07db4549
equal deleted inserted replaced
9337:ab6e0234bacc 9338:3d6f9ddd431d
    24 #include "table/sprites.h"
    24 #include "table/sprites.h"
    25 #include "table/strings.h"
    25 #include "table/strings.h"
    26 
    26 
    27 static byte _selected_airport_type;
    27 static byte _selected_airport_type;
    28 
    28 
    29 static void ShowBuildAirportPicker();
    29 static void ShowBuildAirportPicker(Window *parent);
    30 
    30 
    31 
    31 
    32 void CcBuildAirport(bool success, TileIndex tile, uint32 p1, uint32 p2)
    32 void CcBuildAirport(bool success, TileIndex tile, uint32 p1, uint32 p2)
    33 {
    33 {
    34 	if (success) {
    34 	if (success) {
    49 };
    49 };
    50 
    50 
    51 
    51 
    52 static void BuildAirClick_Airport(Window *w)
    52 static void BuildAirClick_Airport(Window *w)
    53 {
    53 {
    54 	if (HandlePlacePushButton(w, ATW_AIRPORT, SPR_CURSOR_AIRPORT, VHM_RECT, PlaceAirport)) ShowBuildAirportPicker();
    54 	if (HandlePlacePushButton(w, ATW_AIRPORT, SPR_CURSOR_AIRPORT, VHM_RECT, PlaceAirport)) ShowBuildAirportPicker(w);
    55 }
    55 }
    56 
    56 
    57 static void BuildAirClick_Demolish(Window *w)
    57 static void BuildAirClick_Demolish(Window *w)
    58 {
    58 {
    59 	HandlePlacePushButton(w, ATW_DEMOLISH, ANIMCURSOR_DEMOLISH, VHM_RECT, PlaceProc_DemolishArea);
    59 	HandlePlacePushButton(w, ATW_DEMOLISH, ANIMCURSOR_DEMOLISH, VHM_RECT, PlaceProc_DemolishArea);
   170 		BAW_BTN_DOHILIGHT,
   170 		BAW_BTN_DOHILIGHT,
   171 	};
   171 	};
   172 
   172 
   173 public:
   173 public:
   174 
   174 
   175 	AirportPickerWindow(const WindowDesc *desc) : PickerWindowBase(desc)
   175 	AirportPickerWindow(const WindowDesc *desc, Window *parent) : PickerWindowBase(desc, parent)
   176 	{
   176 	{
   177 		this->SetWidgetLoweredState(BAW_BTN_DONTHILIGHT, !_station_show_coverage);
   177 		this->SetWidgetLoweredState(BAW_BTN_DONTHILIGHT, !_station_show_coverage);
   178 		this->SetWidgetLoweredState(BAW_BTN_DOHILIGHT, _station_show_coverage);
   178 		this->SetWidgetLoweredState(BAW_BTN_DOHILIGHT, _station_show_coverage);
   179 		this->LowerWidget(_selected_airport_type + BAW_SMALL_AIRPORT);
   179 		this->LowerWidget(_selected_airport_type + BAW_SMALL_AIRPORT);
   180 
   180 
   296 	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
   296 	WC_BUILD_STATION, WC_BUILD_TOOLBAR,
   297 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
   297 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
   298 	_build_airport_picker_widgets,
   298 	_build_airport_picker_widgets,
   299 };
   299 };
   300 
   300 
   301 static void ShowBuildAirportPicker()
   301 static void ShowBuildAirportPicker(Window *parent)
   302 {
   302 {
   303 	new AirportPickerWindow(&_build_airport_desc);
   303 	new AirportPickerWindow(&_build_airport_desc, parent);
   304 }
   304 }
   305 
   305 
   306 void InitializeAirportGui()
   306 void InitializeAirportGui()
   307 {
   307 {
   308 	_selected_airport_type = AT_SMALL;
   308 	_selected_airport_type = AT_SMALL;