Add setting to allow auto-fill signal dragging to skip over stations/waypoints

This commit is contained in:
Jonathan G Rennison
2023-12-19 22:25:05 +00:00
parent 55bac952a4
commit 540cec2af5
7 changed files with 38 additions and 10 deletions

View File

@@ -464,6 +464,7 @@ static void HandleAutodirPlacement()
static void HandleAutoSignalPlacement()
{
uint32 p2 = GB(_thd.drawstyle, 0, 3); // 0..5
uint64 p3 = 0;
if ((_thd.drawstyle & HT_DRAG_MASK) == HT_RECT) { // one tile case
GenericPlaceSignals(TileVirtXY(_thd.selend.x, _thd.selend.y));
@@ -489,10 +490,11 @@ static void HandleAutoSignalPlacement()
SB(p2, 24, 8, _settings_client.gui.drag_signals_density);
SB(p2, 10, 1, !_settings_client.gui.drag_signals_fixed_distance);
}
SB(p3, 0, 1, _settings_client.gui.drag_signals_skip_stations);
/* _settings_client.gui.drag_signals_density is given as a parameter such that each user
* in a network game can specify their own signal density */
DoCommandP(TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2,
DoCommandPEx(TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2, p3,
_remove_button_clicked ?
CMD_REMOVE_SIGNAL_TRACK | CMD_MSG(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM) :
CMD_BUILD_SIGNAL_TRACK | CMD_MSG(STR_ERROR_CAN_T_BUILD_SIGNALS_HERE),