283 HandlePlacePushButton(w, 15, GetRailTypeInfo(_cur_railtype)->cursor.tunnel, 3, PlaceRail_Tunnel); |
283 HandlePlacePushButton(w, 15, GetRailTypeInfo(_cur_railtype)->cursor.tunnel, 3, PlaceRail_Tunnel); |
284 } |
284 } |
285 |
285 |
286 static void BuildRailClick_Remove(Window *w) |
286 static void BuildRailClick_Remove(Window *w) |
287 { |
287 { |
288 if (w->disabled_state & (1<<16)) |
288 if (HASBIT(w->disabled_state, 16)) return; |
289 return; |
|
290 SetWindowDirty(w); |
289 SetWindowDirty(w); |
291 SndPlayFx(SND_15_BEEP); |
290 SndPlayFx(SND_15_BEEP); |
292 |
291 |
293 w->click_state ^= (1 << 16); |
292 TOGGLEBIT(w->click_state, 16); |
294 _remove_button_clicked = (w->click_state & (1 << 16)) != 0; |
293 _remove_button_clicked = HASBIT(w->click_state, 16) != 0; |
295 SetSelectionRed((w->click_state & (1 << 16)) != 0); |
294 SetSelectionRed(HASBIT(w->click_state, 16) != 0); |
296 |
295 |
297 // handle station builder |
296 // handle station builder |
298 if( w->click_state & (1 << 16) ) |
297 if (HASBIT(w->click_state, 16)) { |
299 { |
|
300 if(_remove_button_clicked) |
298 if(_remove_button_clicked) |
301 SetTileSelectSize(1, 1); |
299 SetTileSelectSize(1, 1); |
302 else |
300 else |
303 BringWindowToFrontById(WC_BUILD_STATION, 0); |
301 BringWindowToFrontById(WC_BUILD_STATION, 0); |
304 } |
302 } |