Mercurial > hg > openttd
changeset 2619:c542c86e7cb2 draft
(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.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Wed, 09 Nov 2005 07:25:55 +0000 |
parents | b1e91f4dc17f |
children | 57d212c58b86 |
files | airport_gui.c dock_gui.c lang/english.txt rail_gui.c road_gui.c settings.c settings_gui.c variables.h |
diffstat | 8 files changed, 25 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/airport_gui.c +++ b/airport_gui.c @@ -107,6 +107,10 @@ 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 @@ 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)
--- a/dock_gui.c +++ b/dock_gui.c @@ -180,6 +180,10 @@ } 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 @@ 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)
--- a/lang/english.txt +++ b/lang/english.txt @@ -997,6 +997,7 @@ 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}
--- a/rail_gui.c +++ b/rail_gui.c @@ -480,6 +480,10 @@ 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 @@ _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!
--- a/road_gui.c +++ b/road_gui.c @@ -281,6 +281,10 @@ 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 @@ 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[] = {
--- a/settings.c +++ b/settings.c @@ -853,6 +853,7 @@ {"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} };
--- a/settings_gui.c +++ b/settings_gui.c @@ -679,6 +679,8 @@ {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[] = {
--- a/variables.h +++ b/variables.h @@ -119,6 +119,7 @@ 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