diff options
author | peter1138 <peter1138@openttd.org> | 2005-11-09 07:25:55 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2005-11-09 07:25:55 +0000 |
commit | 350f0f2cdb66364ca1b6116b77ef249b54f58421 (patch) | |
tree | a7f0501f9d8bbcd2a5ff4e4033261f870d1164ca | |
parent | 5e278b7ec3adfa6f0b65f3cff5769943166bef22 (diff) | |
download | openttd-350f0f2cdb66364ca1b6116b77ef249b54f58421.tar.xz |
(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.
-rw-r--r-- | airport_gui.c | 5 | ||||
-rw-r--r-- | dock_gui.c | 5 | ||||
-rw-r--r-- | lang/english.txt | 1 | ||||
-rw-r--r-- | rail_gui.c | 5 | ||||
-rw-r--r-- | road_gui.c | 5 | ||||
-rw-r--r-- | settings.c | 1 | ||||
-rw-r--r-- | settings_gui.c | 2 | ||||
-rw-r--r-- | variables.h | 1 |
8 files changed, 25 insertions, 0 deletions
diff --git a/airport_gui.c b/airport_gui.c index a7e35823c..e219df930 100644 --- a/airport_gui.c +++ b/airport_gui.c @@ -107,6 +107,10 @@ static void BuildAirToolbWndProc(Window *w, WindowEvent *e) 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) diff --git a/dock_gui.c b/dock_gui.c index 02942d203..12d07606b 100644 --- a/dock_gui.c +++ b/dock_gui.c @@ -180,6 +180,10 @@ static void BuildDocksToolbWndProc(Window *w, WindowEvent *e) } 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) diff --git a/lang/english.txt b/lang/english.txt index e078a9cb0..32bb0737b 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -997,6 +997,7 @@ STR_CONFIG_PATCHES_INVISIBLE_TREES :{LTBLUE}Invisib 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} diff --git a/rail_gui.c b/rail_gui.c index 8fbf0e00a..8fee0cfbd 100644 --- a/rail_gui.c +++ b/rail_gui.c @@ -480,6 +480,10 @@ static void BuildRailToolbWndProc(Window *w, WindowEvent *e) 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 railtype, int button) _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! diff --git a/road_gui.c b/road_gui.c index 18b685e68..0fc5c383d 100644 --- a/road_gui.c +++ b/road_gui.c @@ -281,6 +281,10 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) { 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[] = { diff --git a/settings.c b/settings.c index 9014900af..6a92e948a 100644 --- a/settings.c +++ b/settings.c @@ -853,6 +853,7 @@ static const SettingDesc patch_player_settings[] = { {"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} }; diff --git a/settings_gui.c b/settings_gui.c index 223517890..c12dd3e0e 100644 --- a/settings_gui.c +++ b/settings_gui.c @@ -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[] = { diff --git a/variables.h b/variables.h index 0eede15e5..ae1c3b61f 100644 --- a/variables.h +++ b/variables.h @@ -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 |