summaryrefslogtreecommitdiff
path: root/src/rail_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-01-07 17:40:17 +0000
committerfrosch <frosch@openttd.org>2009-01-07 17:40:17 +0000
commitcf1e926e371f91628a6048adc0d62f129a0d84ab (patch)
tree8a7545f4055397f47b4529fff6d0dc744e67dabe /src/rail_gui.cpp
parent84dee1e7389aa359ce802f5fca3f167771c44005 (diff)
downloadopenttd-cf1e926e371f91628a6048adc0d62f129a0d84ab.tar.xz
(svn r14902) -Feature: Advanced setting to keep various building tools active, which are usually closed after placing an object. (planetmaker)
Diffstat (limited to 'src/rail_gui.cpp')
-rw-r--r--src/rail_gui.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 9161bf5f2..862707b1a 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -142,7 +142,7 @@ void CcRailDepot(bool success, TileIndex tile, uint32 p1, uint32 p2)
DiagDirection dir = (DiagDirection)p2;
SndPlayTileFx(SND_20_SPLAT_2, tile);
- ResetObjectToPlace();
+ if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
tile += TileOffsByDiagDir(dir);
@@ -174,8 +174,8 @@ void CcStation(bool success, TileIndex tile, uint32 p1, uint32 p2)
{
if (success) {
SndPlayTileFx(SND_20_SPLAT_2, tile);
- /* Only close the station builder window if the default station is chosen. */
- if (_railstation.station_class == STAT_CLASS_DFLT && _railstation.station_type == 0) ResetObjectToPlace();
+ /* Only close the station builder window if the default station and non persistent building is chosen. */
+ if (_railstation.station_class == STAT_CLASS_DFLT && _railstation.station_type == 0 && !_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
}
}
@@ -256,7 +256,7 @@ void CcBuildRailTunnel(bool success, TileIndex tile, uint32 p1, uint32 p2)
{
if (success) {
SndPlayTileFx(SND_20_SPLAT_2, tile);
- ResetObjectToPlace();
+ if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
} else {
SetRedErrorSquare(_build_tunnel_endtile);
}
@@ -707,7 +707,7 @@ struct BuildRailToolbarWindow : Window {
switch (select_proc) {
default: NOT_REACHED();
case DDSP_BUILD_BRIDGE:
- ResetObjectToPlace();
+ if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
ShowBuildBridgeWindow(start_tile, end_tile, TRANSPORT_RAIL, _cur_railtype);
break;