Place station when releasing the mouse.
This commit is contained in:
@@ -189,15 +189,7 @@ static void PlaceRail_Station(TileIndex tile)
|
||||
VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED, DDSP_BUILD_STATION);
|
||||
VpSetPlaceSizingLimit(_settings_game.station.station_spread);
|
||||
} else {
|
||||
uint32 p1 = _cur_railtype | _railstation.orientation << 4 | _settings_client.gui.station_numtracks << 8 | _settings_client.gui.station_platlength << 16 | _ctrl_pressed << 24;
|
||||
uint32 p2 = _railstation.station_class | _railstation.station_type << 8 | INVALID_STATION << 16;
|
||||
|
||||
int w = _settings_client.gui.station_numtracks;
|
||||
int h = _settings_client.gui.station_platlength;
|
||||
if (!_railstation.orientation) Swap(w, h);
|
||||
|
||||
CommandContainer cmdcont = { tile, p1, p2, CMD_BUILD_RAIL_STATION | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_STATION), CcStation, "" };
|
||||
ShowSelectStationIfNeeded(cmdcont, TileArea(tile, w, h));
|
||||
VpStartPlaceSizing(tile, VPM_SINGLE_TILE, DDSP_BUILD_STATION);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -701,8 +693,22 @@ struct BuildRailToolbarWindow : Window {
|
||||
DoCommandP(end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? 0x10 : 0), CMD_CONVERT_RAIL | CMD_MSG(STR_ERROR_CAN_T_CONVERT_RAIL), CcPlaySound10);
|
||||
break;
|
||||
|
||||
case DDSP_REMOVE_STATION:
|
||||
case DDSP_BUILD_STATION:
|
||||
if (!_remove_button_clicked && !_settings_client.gui.station_dragdrop) {
|
||||
uint32 p1 = _cur_railtype | _railstation.orientation << 4 | _settings_client.gui.station_numtracks << 8 | _settings_client.gui.station_platlength << 16 | _ctrl_pressed << 24;
|
||||
uint32 p2 = _railstation.station_class | _railstation.station_type << 8 | INVALID_STATION << 16;
|
||||
|
||||
int w = _settings_client.gui.station_numtracks;
|
||||
int h = _settings_client.gui.station_platlength;
|
||||
if (!_railstation.orientation) Swap(w, h);
|
||||
|
||||
CommandContainer cmdcont = { end_tile, p1, p2, CMD_BUILD_RAIL_STATION | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_STATION), CcStation, "" };
|
||||
ShowSelectStationIfNeeded(cmdcont, TileArea(end_tile, w, h));
|
||||
break;
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case DDSP_REMOVE_STATION:
|
||||
if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) {
|
||||
/* Station */
|
||||
if (_remove_button_clicked) {
|
||||
|
||||
Reference in New Issue
Block a user