Changeset - r10611:8c42f79c312e
[Not reviewed]
master
0 10 0
frosch - 15 years ago 2009-01-07 17:40:17
frosch@openttd.org
(svn r14902) -Feature: Advanced setting to keep various building tools active, which are usually closed after placing an object. (planetmaker)
10 files changed with 17 insertions and 13 deletions:
0 comments (0 inline, 0 general)
src/airport_gui.cpp
Show inline comments
 
@@ -34,7 +34,7 @@ void CcBuildAirport(bool success, TileIn
 
{
 
	if (success) {
 
		SndPlayTileFx(SND_1F_SPLAT, tile);
 
		ResetObjectToPlace();
 
		if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
 
	}
 
}
 

	
src/dock_gui.cpp
Show inline comments
 
@@ -35,7 +35,7 @@ void CcBuildDocks(bool success, TileInde
 
{
 
	if (success) {
 
		SndPlayTileFx(SND_02_SPLAT, tile);
 
		ResetObjectToPlace();
 
		if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
 
	}
 
}
 

	
 
@@ -215,7 +215,7 @@ struct BuildDocksToolbarWindow : Window 
 
		if (pt.x != -1) {
 
			switch (select_proc) {
 
				case DDSP_BUILD_BRIDGE:
 
					ResetObjectToPlace();
 
					if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
 
					extern void CcBuildBridge(bool success, TileIndex tile, uint32 p1, uint32 p2);
 
					DoCommandP(end_tile, start_tile, TRANSPORT_WATER << 15, CMD_BUILD_BRIDGE | CMD_MSG(STR_CAN_T_BUILD_AQUEDUCT_HERE), CcBuildBridge);
 

	
src/industry_gui.cpp
Show inline comments
 
@@ -375,7 +375,7 @@ public:
 
		}
 

	
 
		/* If an industry has been built, just reset the cursor and the system */
 
		if (success) ResetObjectToPlace();
 
		if (success && !_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
 
	}
 

	
 
	virtual void OnTick()
src/lang/english.txt
Show inline comments
 
@@ -1139,6 +1139,7 @@ STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_FIR
 
STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_LAST                       :Last available
 
STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MOST_USED                  :Most used
 
STR_CONFIG_PATCHES_SHOW_TRACK_RESERVATION                       :{LTBLUE}Show reserved tracks: {ORANGE}{STRING1}
 
STR_CONFIG_PATCHES_PERSISTENT_BUILDINGTOOLS                     :{LTBLUE}Keep building tools active after usage: {ORANGE}{STRING1}
 

	
 
STR_CONFIG_PATCHES_ALWAYS_BUILD_INFRASTRUCTURE                  :{LTBLUE}Show building tools when no suitable vehicles are available: {ORANGE}{STRING1}
 
STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Max trains per player: {ORANGE}{STRING1}
src/rail_gui.cpp
Show inline comments
 
@@ -142,7 +142,7 @@ void CcRailDepot(bool success, TileIndex
 
		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 t
 
{
 
	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, Til
 
{
 
	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;
 

	
src/road_gui.cpp
Show inline comments
 
@@ -118,7 +118,7 @@ void CcBuildRoadTunnel(bool success, Til
 
{
 
	if (success) {
 
		SndPlayTileFx(SND_20_SPLAT_2, tile);
 
		ResetObjectToPlace();
 
		if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
 
	} else {
 
		SetRedErrorSquare(_build_tunnel_endtile);
 
	}
 
@@ -191,7 +191,7 @@ void CcRoadDepot(bool success, TileIndex
 
	if (success) {
 
		DiagDirection dir = (DiagDirection)GB(p1, 0, 2);
 
		SndPlayTileFx(SND_1F_SPLAT, tile);
 
		ResetObjectToPlace();
 
		if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
 
		BuildRoadOutsideStation(tile, dir);
 
		/* For a drive-through road stop build connecting road for other entrance */
 
		if (HasBit(p2, 1)) BuildRoadOutsideStation(tile, ReverseDiagDir(dir));
 
@@ -579,7 +579,7 @@ struct BuildRoadToolbarWindow : 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_ROAD, RoadTypeToRoadTypes(_cur_roadtype));
 
					break;
 

	
src/settings.cpp
Show inline comments
 
@@ -1466,6 +1466,7 @@ const SettingDesc _patch_settings[] = {
 
 	  SDTC_VAR(gui.station_platlength,        SLE_UINT8, S,  0,     5,        1,        7, 0, STR_NULL,                                       NULL),
 
 	 SDTC_BOOL(gui.station_dragdrop,                     S,  0,  true,                        STR_NULL,                                       NULL),
 
	 SDTC_BOOL(gui.station_show_coverage,                S,  0, false,                        STR_NULL,                                       NULL),
 
	 SDTC_BOOL(gui.persistent_buildingtools,             S,  0, false,                        STR_CONFIG_PATCHES_PERSISTENT_BUILDINGTOOLS,    NULL),
 

	
 
	  SDTC_VAR(gui.console_backlog_timeout,  SLE_UINT16, S,  0,   100,       10,    65500, 0, STR_NULL,                                       NULL),
 
	  SDTC_VAR(gui.console_backlog_length,   SLE_UINT16, S,  0,   100,       10,    65500, 0, STR_NULL,                                       NULL),
src/settings_gui.cpp
Show inline comments
 
@@ -639,6 +639,7 @@ static const char *_patches_ui[] = {
 
	"gui.quick_goto",
 
	"gui.default_rail_type",
 
	"gui.always_build_infrastructure",
 
	"gui.persistent_buildingtools",
 
	"gui.show_track_reservation",
 
	"gui.left_mouse_btn_scrolling",
 
};
src/settings_type.h
Show inline comments
 
@@ -89,6 +89,7 @@ struct GUISettings {
 
	byte   station_platlength;               ///< the platform length, in tiles, for rail stations
 
	bool   station_dragdrop;                 ///< whether drag and drop is enabled for stations
 
	bool   station_show_coverage;            ///< whether to highlight coverage area
 
	bool   persistent_buildingtools;            ///< keep the building tools active after usage
 

	
 
	uint16 console_backlog_timeout;          ///< the minimum amount of time items should be in the console backlog before they will be removed in ~3 seconds granularity.
 
	uint16 console_backlog_length;           ///< the minimum amount of items in the console backlog before items will be removed.
src/town_gui.cpp
Show inline comments
 
@@ -658,7 +658,7 @@ void CcBuildTown(bool success, TileIndex
 
{
 
	if (success) {
 
		SndPlayTileFx(SND_1F_SPLAT, tile);
 
		ResetObjectToPlace();
 
		if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
 
	}
 
}
 

	
0 comments (0 inline, 0 general)