92 HandlePlacePushButton(w, DTW_DEMOLISH, ANIMCURSOR_DEMOLISH, 1, PlaceDocks_DemolishArea); |
92 HandlePlacePushButton(w, DTW_DEMOLISH, ANIMCURSOR_DEMOLISH, 1, PlaceDocks_DemolishArea); |
93 } |
93 } |
94 |
94 |
95 static void BuildDocksClick_Depot(Window *w) |
95 static void BuildDocksClick_Depot(Window *w) |
96 { |
96 { |
|
97 if (!CanBuildVehicleInfrastructure(VEH_SHIP)) return; |
97 if (HandlePlacePushButton(w, DTW_DEPOT, SPR_CURSOR_SHIP_DEPOT, 1, PlaceDocks_Depot)) ShowBuildDocksDepotPicker(); |
98 if (HandlePlacePushButton(w, DTW_DEPOT, SPR_CURSOR_SHIP_DEPOT, 1, PlaceDocks_Depot)) ShowBuildDocksDepotPicker(); |
98 } |
99 } |
99 |
100 |
100 static void BuildDocksClick_Dock(Window *w) |
101 static void BuildDocksClick_Dock(Window *w) |
101 { |
102 { |
|
103 if (!CanBuildVehicleInfrastructure(VEH_SHIP)) return; |
102 if (HandlePlacePushButton(w, DTW_STATION, SPR_CURSOR_DOCK, 3, PlaceDocks_Dock)) ShowBuildDockStationPicker(); |
104 if (HandlePlacePushButton(w, DTW_STATION, SPR_CURSOR_DOCK, 3, PlaceDocks_Dock)) ShowBuildDockStationPicker(); |
103 } |
105 } |
104 |
106 |
105 static void BuildDocksClick_Buoy(Window *w) |
107 static void BuildDocksClick_Buoy(Window *w) |
106 { |
108 { |
|
109 if (!CanBuildVehicleInfrastructure(VEH_SHIP)) return; |
107 HandlePlacePushButton(w, DTW_BUOY, SPR_CURSOR_BOUY, 1, PlaceDocks_Buoy); |
110 HandlePlacePushButton(w, DTW_BUOY, SPR_CURSOR_BOUY, 1, PlaceDocks_Buoy); |
108 } |
111 } |
109 |
112 |
110 |
113 |
111 typedef void OnButtonClick(Window *w); |
114 typedef void OnButtonClick(Window *w); |
122 static void BuildDocksToolbWndProc(Window *w, WindowEvent *e) |
125 static void BuildDocksToolbWndProc(Window *w, WindowEvent *e) |
123 { |
126 { |
124 switch (e->event) { |
127 switch (e->event) { |
125 case WE_PAINT: |
128 case WE_PAINT: |
126 DrawWindowWidgets(w); |
129 DrawWindowWidgets(w); |
|
130 SetWindowWidgetsDisabledState(w, !CanBuildVehicleInfrastructure(VEH_SHIP), 7, 8, 9, WIDGET_LIST_END); |
127 break; |
131 break; |
128 |
132 |
129 case WE_CLICK: |
133 case WE_CLICK: |
130 if (e->we.click.widget - 3 >= 0 && e->we.click.widget != 5) _build_docks_button_proc[e->we.click.widget - 3](w); |
134 if (e->we.click.widget - 3 >= 0 && e->we.click.widget != 5) _build_docks_button_proc[e->we.click.widget - 3](w); |
131 break; |
135 break; |