Changeset - r2619:14b1b02e2787
[Not reviewed]
master
0 8 0
peter1138 - 18 years ago 2005-11-09 07:25:55
peter1138@openttd.org
(svn r3157) - Feature: Added patch option to link the terraform toolbar to the rail, road, water and airport toolbars. If enabled, the terraform toolbar will open and close with those toolbars.
8 files changed with 25 insertions and 0 deletions:
0 comments (0 inline, 0 general)
airport_gui.c
Show inline comments
 
@@ -107,6 +107,10 @@ static void BuildAirToolbWndProc(Window 
 
		if (w != 0)
 
			WP(w,def_d).close = true;
 
		break;
 

	
 
	case WE_DESTROY:
 
		if (_patches.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0);
 
		break;
 
	}
 
}
 

	
 
@@ -134,6 +138,7 @@ void ShowBuildAirToolbar(void)
 
	if (_current_player == OWNER_SPECTATOR) return;
 
	DeleteWindowById(WC_BUILD_TOOLBAR, 0);
 
	AllocateWindowDescFront(&_air_toolbar_desc, 0);
 
	if (_patches.link_terraform_toolbar) ShowTerraformToolbar();
 
}
 

	
 
static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
dock_gui.c
Show inline comments
 
@@ -180,6 +180,10 @@ static void BuildDocksToolbWndProc(Windo
 
		}
 
		VpSetPresizeRange(tile_from, tile_to);
 
	} break;
 

	
 
	case WE_DESTROY:
 
		if (_patches.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0);
 
		break;
 
	}
 
}
 

	
 
@@ -213,6 +217,7 @@ void ShowBuildDocksToolbar(void)
 
	if (_current_player == OWNER_SPECTATOR) return;
 
	DeleteWindowById(WC_BUILD_TOOLBAR, 0);
 
	AllocateWindowDesc(&_build_docks_toolbar_desc);
 
	if (_patches.link_terraform_toolbar) ShowTerraformToolbar();
 
}
 

	
 
static void BuildDockStationWndProc(Window *w, WindowEvent *e)
lang/english.txt
Show inline comments
 
@@ -997,6 +997,7 @@ STR_CONFIG_PATCHES_INVISIBLE_TREES      
 
STR_CONFIG_PATCHES_SNOWLINE_HEIGHT                              :{LTBLUE}Snow line height: {ORANGE}{STRING1}
 
STR_CONFIG_PATCHES_STATION_SPREAD                               :{LTBLUE}Max station spread: {ORANGE}{STRING1} {RED}Warning: High setting slows game
 
STR_CONFIG_PATCHES_SERVICEATHELIPAD                             :{LTBLUE}Service helicopters at helipads automatically: {ORANGE}{STRING1}
 
STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR                       :{LTBLUE}Link landscape toolbar to rail/road/water/airport toolbars: {ORANGE}{STRING1}
 

	
 
STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Max trains per player: {ORANGE}{STRING1}
 
STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Max road vehicles per player: {ORANGE}{STRING1}
rail_gui.c
Show inline comments
 
@@ -480,6 +480,10 @@ static void BuildRailToolbWndProc(Window
 
		DoCommandByTile(tile, 0, 0, DC_AUTO, CMD_BUILD_TUNNEL);
 
		VpSetPresizeRange(tile, _build_tunnel_endtile==0?tile:_build_tunnel_endtile);
 
	} break;
 

	
 
	case WE_DESTROY:
 
		if (_patches.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0);
 
		break;
 
	}
 
}
 

	
 
@@ -571,6 +575,7 @@ void ShowBuildRailToolbar(RailType railt
 

	
 
	_remove_button_clicked = false;
 
	if (w != NULL && button >= 0) _build_railroad_button_proc[button](w);
 
	if (_patches.link_terraform_toolbar) ShowTerraformToolbar();
 
}
 

	
 
/* TODO: For custom stations, respect their allowed platforms/lengths bitmasks!
road_gui.c
Show inline comments
 
@@ -281,6 +281,10 @@ static void BuildRoadToolbWndProc(Window
 
		VpSetPresizeRange(tile, _build_tunnel_endtile==0?tile:_build_tunnel_endtile);
 
		break;
 
	}
 

	
 
	case WE_DESTROY:
 
		if (_patches.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0);
 
		break;
 
	}
 
}
 

	
 
@@ -315,6 +319,7 @@ void ShowBuildRoadToolbar(void)
 
	if (_current_player == OWNER_SPECTATOR) return;
 
	DeleteWindowById(WC_BUILD_TOOLBAR, 0);
 
	AllocateWindowDesc(&_build_road_desc);
 
	if (_patches.link_terraform_toolbar) ShowTerraformToolbar();
 
}
 

	
 
static const Widget _build_road_scen_widgets[] = {
settings.c
Show inline comments
 
@@ -853,6 +853,7 @@ static const SettingDesc patch_player_se
 
	{"autorenew_money",			SDT_INT32,	(void*)100000,&_patches.autorenew_money,			NULL},
 

	
 
	{"population_in_label",	SDT_BOOL,		(void*)true,	&_patches.population_in_label,	NULL},
 
	{"link_terraform_toolbar",       SDT_BOOL,   (void*)false, &_patches.link_terraform_toolbar,       NULL},
 

	
 
	{NULL,									0,					NULL,					NULL,																						NULL}
 
};
settings_gui.c
Show inline comments
 
@@ -679,6 +679,8 @@ static const PatchEntry _patches_ui[] = 
 

	
 
	{PE_INT32, 0, STR_CONFIG_PATCHES_MAP_X, "map_x", &_patches.map_x, 6, 11, 1, NULL},
 
	{PE_INT32, 0, STR_CONFIG_PATCHES_MAP_Y, "map_y", &_patches.map_y, 6, 11, 1, NULL},
 

	
 
	{PE_BOOL,   PF_PLAYERBASED, STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR, "link_terraform_toolbar", &_patches.link_terraform_toolbar, 0, 1, 1, NULL},
 
};
 

	
 
static const PatchEntry _patches_construction[] = {
variables.h
Show inline comments
 
@@ -119,6 +119,7 @@ typedef struct Patches {
 
	bool forbid_90_deg; // forbid trains to make 90 deg turns
 
	bool invisible_trees; // don't show trees when buildings are transparent
 
	bool no_servicing_if_no_breakdowns; // dont send vehicles to depot when breakdowns are disabled
 
	bool link_terraform_toolbar; // display terraform toolbar when displaying rail, road, water and airport toolbars
 

	
 
	uint8 toolbar_pos;			// position of toolbars, 0=left, 1=center, 2=right
 
	uint8 window_snap_radius; // Windows snap at each other if closer than this
0 comments (0 inline, 0 general)