1
0
Fork 0

(svn r16991) -Change: make 'remove waypoint' draggable

release/1.0
rubidium 2009-07-30 15:16:19 +00:00
parent 37e6f6a003
commit de99f212dc
1 changed files with 14 additions and 7 deletions

View File

@ -149,7 +149,7 @@ static void PlaceRail_Depot(TileIndex tile)
static void PlaceRail_Waypoint(TileIndex tile) static void PlaceRail_Waypoint(TileIndex tile)
{ {
if (_remove_button_clicked) { if (_remove_button_clicked) {
DoCommandP(tile, 0, 0, CMD_REMOVE_FROM_RAIL_WAYPOINT | CMD_MSG(STR_CANT_REMOVE_TRAIN_WAYPOINT), CcPlaySound1E); VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_REMOVE_STATION);
} else { } else {
DoCommandP(tile, _cur_waypoint_type, 0, CMD_BUILD_RAIL_WAYPOINT | CMD_MSG(STR_CANT_BUILD_TRAIN_WAYPOINT), CcPlaySound1E); DoCommandP(tile, _cur_waypoint_type, 0, CMD_BUILD_RAIL_WAYPOINT | CMD_MSG(STR_CANT_BUILD_TRAIN_WAYPOINT), CcPlaySound1E);
} }
@ -167,8 +167,7 @@ void CcStation(bool success, TileIndex tile, uint32 p1, uint32 p2)
static void PlaceRail_Station(TileIndex tile) static void PlaceRail_Station(TileIndex tile)
{ {
if (_remove_button_clicked) { if (_remove_button_clicked) {
VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED, DDSP_REMOVE_STATION); VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_REMOVE_STATION);
VpSetPlaceSizingLimit(-1);
} else if (_settings_client.gui.station_dragdrop) { } else if (_settings_client.gui.station_dragdrop) {
VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED, DDSP_BUILD_STATION); VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED, DDSP_BUILD_STATION);
VpSetPlaceSizingLimit(_settings_game.station.station_spread); VpSetPlaceSizingLimit(_settings_game.station.station_spread);
@ -750,11 +749,19 @@ struct BuildRailToolbarWindow : Window {
case DDSP_REMOVE_STATION: case DDSP_REMOVE_STATION:
case DDSP_BUILD_STATION: case DDSP_BUILD_STATION:
if (_remove_button_clicked) { if (this->IsWidgetLowered(RTW_BUILD_STATION)) {
DoCommandP(end_tile, start_tile, 0, CMD_REMOVE_FROM_RAIL_STATION | CMD_MSG(STR_CANT_REMOVE_PART_OF_STATION), CcPlaySound1E); /* Station */
break; if (_remove_button_clicked) {
DoCommandP(end_tile, start_tile, 0, CMD_REMOVE_FROM_RAIL_STATION | CMD_MSG(STR_CANT_REMOVE_PART_OF_STATION), CcPlaySound1E);
} else {
HandleStationPlacement(start_tile, end_tile);
}
} else {
/* Waypoint */
if (_remove_button_clicked) {
DoCommandP(end_tile, start_tile, 0, CMD_REMOVE_FROM_RAIL_WAYPOINT | CMD_MSG(STR_CANT_REMOVE_TRAIN_WAYPOINT), CcPlaySound1E);
}
} }
HandleStationPlacement(start_tile, end_tile);
break; break;
} }
} }