149 } |
149 } |
150 |
150 |
151 static void PlaceRail_Station(TileIndex tile) |
151 static void PlaceRail_Station(TileIndex tile) |
152 { |
152 { |
153 if (_remove_button_clicked) { |
153 if (_remove_button_clicked) { |
154 DoCommandP(tile, 0, 0, CcPlaySound1E, CMD_REMOVE_FROM_RAILROAD_STATION | CMD_MSG(STR_CANT_REMOVE_PART_OF_STATION)); |
154 VpStartPlaceSizing(tile, VPM_X_AND_Y | GUI_PlaceProc_RemoveFromStation); |
155 } else if (_railstation.dragdrop) { |
155 } else if (_railstation.dragdrop) { |
156 VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED); |
156 VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED); |
157 VpSetPlaceSizingLimit(_patches.station_spread); |
157 VpSetPlaceSizingLimit(_patches.station_spread); |
158 } else { |
158 } else { |
159 DoCommandP(tile, |
159 DoCommandP(tile, |
512 } else if (e->we.place.userdata == VPM_SIGNALDIRS) { |
512 } else if (e->we.place.userdata == VPM_SIGNALDIRS) { |
513 HandleAutoSignalPlacement(); |
513 HandleAutoSignalPlacement(); |
514 } else if ((e->we.place.userdata & 0xF) == VPM_X_AND_Y) { |
514 } else if ((e->we.place.userdata & 0xF) == VPM_X_AND_Y) { |
515 if (GUIPlaceProcDragXY(e)) break; |
515 if (GUIPlaceProcDragXY(e)) break; |
516 |
516 |
517 if ((e->we.place.userdata >> 4) == GUI_PlaceProc_ConvertRailArea >> 4) |
517 if ((e->we.place.userdata >> 4) == GUI_PlaceProc_RemoveFromStation >> 4) { |
|
518 DoCommandP(end_tile, start_tile, 0, CcPlaySound1E, CMD_REMOVE_FROM_RAILROAD_STATION | CMD_MSG(STR_CANT_REMOVE_PART_OF_STATION)); |
|
519 } |
|
520 |
|
521 if ((e->we.place.userdata >> 4) == GUI_PlaceProc_ConvertRailArea >> 4) { |
518 DoCommandP(end_tile, start_tile, _cur_railtype, CcPlaySound10, CMD_CONVERT_RAIL | CMD_MSG(STR_CANT_CONVERT_RAIL)); |
522 DoCommandP(end_tile, start_tile, _cur_railtype, CcPlaySound10, CMD_CONVERT_RAIL | CMD_MSG(STR_CANT_CONVERT_RAIL)); |
|
523 } |
519 } else if (e->we.place.userdata == VPM_X_AND_Y_LIMITED) { |
524 } else if (e->we.place.userdata == VPM_X_AND_Y_LIMITED) { |
520 HandleStationPlacement(start_tile, end_tile); |
525 HandleStationPlacement(start_tile, end_tile); |
521 } else { |
526 } else { |
522 DoRailroadTrack(e->we.place.userdata & 1); |
527 DoRailroadTrack(e->we.place.userdata & 1); |
523 } |
528 } |