(svn r11950) [NewGRF_ports] -Sync with trunk r11566:11949. NewGRF_ports
authorrubidium
Tue, 22 Jan 2008 21:00:30 +0000
branchNewGRF_ports
changeset 6872 1c4a4a609f85
parent 6871 5a9dc001e1ad
child 6873 86bf4ccb580d
(svn r11950) [NewGRF_ports] -Sync with trunk r11566:11949.
.gitignore
BUGS
Makefile.in
bin/data/chars.grf
bin/data/openttdd.grf
bin/data/openttdw.grf
bin/data/ottd_grf/split/chars.nfo
bin/data/ottd_grf/split/chars.pcx
bin/data/ottd_grf/split/openttd.nfo
bin/data/ottd_grf/split/shore.nfo
bin/data/ottd_grf/split/shore.pcx
changelog.txt
config.lib
configure
docs/landscape.html
docs/landscape_grid.html
known-bugs.txt
os/debian/changelog
os/win32/installer/install.nsi
projects/langs.vcproj
projects/langs_vs80.vcproj
projects/langs_vs90.vcproj
projects/openttd.vcproj
projects/openttd_vs80.vcproj
projects/openttd_vs90.vcproj
readme.txt
source.list
src/ai/ai.cpp
src/ai/ai.h
src/ai/default/default.cpp
src/ai/default/default.h
src/ai/trolly/build.cpp
src/ai/trolly/pathfinder.cpp
src/ai/trolly/shared.cpp
src/ai/trolly/trolly.cpp
src/ai/trolly/trolly.h
src/aircraft.h
src/aircraft_cmd.cpp
src/aircraft_gui.cpp
src/airport.cpp
src/airport_gui.cpp
src/articulated_vehicles.cpp
src/articulated_vehicles.h
src/autoreplace_base.h
src/autoreplace_cmd.cpp
src/autoreplace_func.h
src/autoreplace_gui.cpp
src/autoreplace_gui.h
src/autoreplace_type.h
src/autoslope.h
src/aystar.cpp
src/aystar.h
src/blitter/32bpp_anim.cpp
src/blitter/32bpp_base.cpp
src/blitter/32bpp_base.hpp
src/blitter/32bpp_optimized.cpp
src/blitter/32bpp_simple.cpp
src/blitter/8bpp_base.cpp
src/blitter/8bpp_debug.cpp
src/blitter/8bpp_optimized.cpp
src/blitter/8bpp_simple.cpp
src/blitter/base.hpp
src/blitter/factory.hpp
src/blitter/null.cpp
src/bmp.cpp
src/bmp.h
src/bridge.h
src/bridge_gui.cpp
src/bridge_map.cpp
src/bridge_map.h
src/build_vehicle_gui.cpp
src/callback_table.cpp
src/callback_table.h
src/cargo_type.h
src/cargopacket.h
src/cargotype.cpp
src/cargotype.h
src/clear_cmd.cpp
src/clear_map.h
src/cmd_helper.h
src/command.cpp
src/command.h
src/command_func.h
src/command_type.h
src/console.cpp
src/console.h
src/console_cmds.cpp
src/core/alloc_func.hpp
src/core/bitmath_func.cpp
src/core/bitmath_func.hpp
src/core/endian_func.hpp
src/core/enum_type.hpp
src/core/geometry_type.hpp
src/core/math_func.hpp
src/core/overflowsafe_type.hpp
src/core/random_func.cpp
src/core/random_func.hpp
src/currency.cpp
src/currency.h
src/date.cpp
src/date.h
src/date_func.h
src/date_type.h
src/debug.cpp
src/debug.h
src/depot.cpp
src/depot.h
src/depot_gui.cpp
src/direction.h
src/direction_func.h
src/direction_type.h
src/disaster_cmd.cpp
src/dock_gui.cpp
src/driver.cpp
src/driver.h
src/dummy_land.cpp
src/economy.cpp
src/economy.h
src/economy_func.h
src/economy_type.h
src/elrail.cpp
src/engine.cpp
src/engine.h
src/engine_gui.cpp
src/fileio.cpp
src/fileio.h
src/fios.cpp
src/fios.h
src/fontcache.cpp
src/fontcache.h
src/fsmport.h
src/functions.h
src/genworld.cpp
src/genworld.h
src/genworld_gui.cpp
src/gfx.cpp
src/gfx.h
src/gfx_func.h
src/gfx_type.h
src/gfxinit.cpp
src/gfxinit.h
src/graph_gui.cpp
src/group.h
src/group_cmd.cpp
src/group_gui.cpp
src/group_gui.h
src/gui.h
src/heightmap.cpp
src/helpers.hpp
src/industry.h
src/industry_cmd.cpp
src/industry_gui.cpp
src/industry_map.h
src/industry_type.h
src/intro_gui.cpp
src/landscape.cpp
src/landscape.h
src/lang/afrikaans.txt
src/lang/american.txt
src/lang/brazilian_portuguese.txt
src/lang/bulgarian.txt
src/lang/catalan.txt
src/lang/croatian.txt
src/lang/czech.txt
src/lang/danish.txt
src/lang/dutch.txt
src/lang/english.txt
src/lang/english_US.txt
src/lang/esperanto.txt
src/lang/estonian.txt
src/lang/finnish.txt
src/lang/french.txt
src/lang/galician.txt
src/lang/german.txt
src/lang/hungarian.txt
src/lang/icelandic.txt
src/lang/italian.txt
src/lang/japanese.txt
src/lang/korean.txt
src/lang/lithuanian.txt
src/lang/norwegian_bokmal.txt
src/lang/norwegian_nynorsk.txt
src/lang/piglatin.txt
src/lang/polish.txt
src/lang/portuguese.txt
src/lang/romanian.txt
src/lang/russian.txt
src/lang/simplified_chinese.txt
src/lang/slovak.txt
src/lang/slovenian.txt
src/lang/spanish.txt
src/lang/swedish.txt
src/lang/traditional_chinese.txt
src/lang/turkish.txt
src/lang/ukrainian.txt
src/lang/unfinished/frisian.txt
src/lang/unfinished/greek.txt
src/lang/unfinished/latvian.txt
src/livery.h
src/macros.h
src/main_gui.cpp
src/map.cpp
src/map.h
src/map_func.h
src/map_type.h
src/md5.cpp
src/md5.h
src/misc.cpp
src/misc/blob.hpp
src/misc/countedptr.hpp
src/misc/dbg_helpers.cpp
src/misc/fixedsizearray.hpp
src/misc_cmd.cpp
src/misc_gui.cpp
src/music/dmusic.cpp
src/music/extmidi.cpp
src/music/libtimidity.cpp
src/music/music_driver.hpp
src/music_gui.cpp
src/namegen.cpp
src/namegen.h
src/network/core/game.h
src/network/core/packet.cpp
src/network/core/tcp.cpp
src/network/core/tcp.h
src/network/core/udp.cpp
src/network/network.cpp
src/network/network.h
src/network/network_client.cpp
src/network/network_data.cpp
src/network/network_data.h
src/network/network_gamelist.cpp
src/network/network_gui.cpp
src/network/network_internal.h
src/network/network_server.cpp
src/network/network_udp.cpp
src/newgrf.cpp
src/newgrf.h
src/newgrf_callbacks.h
src/newgrf_canal.cpp
src/newgrf_canal.h
src/newgrf_cargo.h
src/newgrf_commons.cpp
src/newgrf_config.cpp
src/newgrf_config.h
src/newgrf_engine.cpp
src/newgrf_engine.h
src/newgrf_fsmports.cpp
src/newgrf_fsmports.h
src/newgrf_gui.cpp
src/newgrf_house.cpp
src/newgrf_house.h
src/newgrf_industries.cpp
src/newgrf_industries.h
src/newgrf_industrytiles.cpp
src/newgrf_sound.cpp
src/newgrf_sound.h
src/newgrf_spritegroup.cpp
src/newgrf_spritegroup.h
src/newgrf_station.cpp
src/newgrf_station.h
src/newgrf_storage.cpp
src/newgrf_storage.h
src/newgrf_string_type.h
src/newgrf_text.cpp
src/newgrf_town.cpp
src/newgrf_townname.cpp
src/newgrf_townname.h
src/news.h
src/news_gui.cpp
src/npf.cpp
src/npf.h
src/oldloader.cpp
src/oldpool.cpp
src/oldpool.h
src/openttd.cpp
src/openttd.h
src/order.h
src/order_cmd.cpp
src/order_gui.cpp
src/os/macosx/macos.mm
src/os/macosx/osx_stdafx.h
src/os/macosx/splash.cpp
src/os2.cpp
src/pathfind.cpp
src/pathfind.h
src/player.h
src/player_base.h
src/player_face.h
src/player_func.h
src/player_gui.cpp
src/player_gui.h
src/player_type.h
src/players.cpp
src/queue.cpp
src/rail.cpp
src/rail.h
src/rail_cmd.cpp
src/rail_gui.cpp
src/rail_gui.h
src/rail_map.h
src/rail_type.h
src/railtypes.h
src/road.cpp
src/road.h
src/road_cmd.cpp
src/road_cmd.h
src/road_func.h
src/road_gui.cpp
src/road_gui.h
src/road_internal.h
src/road_map.cpp
src/road_map.h
src/road_type.h
src/roadveh.h
src/roadveh_cmd.cpp
src/roadveh_gui.cpp
src/saveload.cpp
src/saveload.h
src/screenshot.cpp
src/settings.cpp
src/settings.h
src/settings_func.h
src/settings_gui.cpp
src/settings_internal.h
src/settings_type.h
src/ship.h
src/ship_cmd.cpp
src/ship_gui.cpp
src/signal.cpp
src/signal_func.h
src/signs.cpp
src/signs.h
src/signs_gui.cpp
src/slope.h
src/slope_func.h
src/slope_type.h
src/smallmap_gui.cpp
src/sound.cpp
src/sound.h
src/sound/cocoa_s.cpp
src/sound/sound_driver.hpp
src/sound/win32_s.cpp
src/sound_func.h
src/sound_type.h
src/sprite.h
src/spritecache.cpp
src/spritecache.h
src/spriteloader/grf.cpp
src/spriteloader/grf.hpp
src/spriteloader/png.cpp
src/spriteloader/png.hpp
src/spriteloader/spriteloader.hpp
src/station.cpp
src/station.h
src/station_cmd.cpp
src/station_gui.cpp
src/station_gui.h
src/station_map.h
src/stdafx.h
src/strgen/strgen.cpp
src/string.cpp
src/string.h
src/string_func.h
src/string_type.h
src/strings.cpp
src/strings.h
src/strings_func.h
src/strings_type.h
src/subsidy_gui.cpp
src/table/autorail.h
src/table/build_industry.h
src/table/cargo_const.h
src/table/engines.h
src/table/files.h
src/table/namegen.h
src/table/railtypes.h
src/table/road_land.h
src/table/sprites.h
src/table/station_land.h
src/table/town_land.h
src/table/unicode.h
src/terraform_cmd.cpp
src/terraform_gui.cpp
src/terraform_gui.h
src/textbuf_gui.h
src/texteff.cpp
src/tgp.cpp
src/thread.cpp
src/tile.cpp
src/tile.h
src/tile_cmd.h
src/tile_map.cpp
src/tile_map.h
src/tile_type.h
src/timetable_cmd.cpp
src/timetable_gui.cpp
src/town.h
src/town_cmd.cpp
src/town_gui.cpp
src/town_map.h
src/town_type.h
src/track_func.h
src/track_type.h
src/train.h
src/train_cmd.cpp
src/train_gui.cpp
src/transparency.h
src/transparency_gui.cpp
src/tree_cmd.cpp
src/tree_map.h
src/tunnel_map.cpp
src/tunnel_map.h
src/tunnelbridge_cmd.cpp
src/tunnelbridge_map.h
src/unix.cpp
src/unmovable_cmd.cpp
src/unmovable_map.h
src/variables.h
src/vehicle.cpp
src/vehicle.h
src/vehicle_base.h
src/vehicle_func.h
src/vehicle_gui.cpp
src/vehicle_gui.h
src/vehicle_type.h
src/video/cocoa/cocoa_v.h
src/video/cocoa/cocoa_v.mm
src/video/cocoa/event.mm
src/video/cocoa/fullscreen.mm
src/video/cocoa/wnd_quartz.mm
src/video/cocoa/wnd_quickdraw.mm
src/video/dedicated_v.cpp
src/video/dedicated_v.h
src/video/null_v.cpp
src/video/null_v.h
src/video/sdl_v.cpp
src/video/sdl_v.h
src/video/video_driver.hpp
src/video/win32_v.cpp
src/video/win32_v.h
src/viewport.cpp
src/viewport.h
src/viewport_func.h
src/viewport_type.h
src/void_map.h
src/water.h
src/water_cmd.cpp
src/water_map.h
src/waypoint.cpp
src/waypoint.h
src/widget.cpp
src/widgets/dropdown.cpp
src/widgets/dropdown_func.h
src/widgets/dropdown_type.h
src/win32.cpp
src/window.cpp
src/window.h
src/window_func.h
src/window_gui.h
src/window_type.h
src/yapf/follow_track.hpp
src/yapf/track_dir.hpp
src/yapf/yapf.hpp
src/yapf/yapf_costbase.hpp
src/yapf/yapf_costcache.hpp
src/yapf/yapf_destrail.hpp
src/yapf/yapf_rail.cpp
src/zoom.hpp
src/zoom_func.h
src/zoom_type.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,11 @@
+Makefile*
+bin/*
+!bin/data/chars.grf
+!bin/data/openttdd.grf
+!bin/data/openttdw.grf
+!bin/data/opntitle.grf
+!bin/scenario/README
+!bin/scripts*
+config.*
+objs/*
+src/rev.cpp
--- a/BUGS	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-/* $Id$ */
-
-KNOWN BUGS / PROBLEMS:
-
-bridges:
-- Clearing tiles which may not have a bridge above can cause random bridge pieces to appear, which leads to crash in the long run
-
-electrified rails:
-Normal and elrail depots look the same. Use 'X' (transparent buildings)
-   to distinguish between them
-Missing curors / icons for construction (currently using the conventional ones)
-
--- a/Makefile.in	Mon Dec 03 23:39:38 2007 +0000
+++ b/Makefile.in	Tue Jan 22 21:00:30 2008 +0000
@@ -81,7 +81,7 @@
 	@echo " Going to reconfigure with last known settings..."
 	@echo "----------------"
 # Make sure we don't lock config.cache
-	@$(shell cat config.cache) || exit 1
+	@$(shell cat config.cache | sed 's/\\ /\\\\ /g') || exit 1
 	@echo "----------------"
 	@echo "Reconfig done. Now compiling..."
 	@echo "----------------"
Binary file bin/data/chars.grf has changed
Binary file bin/data/openttdd.grf has changed
Binary file bin/data/openttdw.grf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/data/ottd_grf/split/chars.nfo	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,84 @@
+// Automatically generated by GRFCODEC. Do not modify!
+// (Info version 7)
+// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
+   -1 * 0	 12 03 00 01 AC 20 02 01 AC 20 01 01 AC 20 // All €
+   -1 sprites/chars.pcx 18 8 01 9 8 0 0
+   -1 sprites/chars.pcx 34 8 01 14 14 0 0
+   -1 sprites/chars.pcx 66 8 01 6 4 0 0
+   -1 * 0	 12 02 02 01 E6 00 02 01 C6 00 // Large æ Æ
+   -1 sprites/chars.pcx 82 8 09 10 20 0 5
+   -1 sprites/chars.pcx 114 8 09 14 24 0 1
+   -1 * 0	 12 02 02 01 F8 00 02 01 D8 00 // Large ø Ø
+   -1 sprites/chars.pcx 146 8 09 12 11 0 3
+   -1 sprites/chars.pcx 162 8 09 15 16 0 0
+   -1 * 0	 12 01 01 02 52 01 // Small Œ œ
+   -1 sprites/chars.pcx 194 8 01 5 4 0 1
+   -1 sprites/chars.pcx 210 8 01 5 4 0 1
+   -1 * 0	 12 01 00 02 52 01 // Medium Œ œ
+   -1 sprites/chars.pcx 226 8 01 9 12 0 0
+   -1 sprites/chars.pcx 258 8 01 7 9 0 2
+   -1 * 0	 12 01 02 02 52 01 // Large Œ œ
+   -1 sprites/chars.pcx 274 8 01 14 22 0 1
+   -1 sprites/chars.pcx 306 8 01 10 20 0 5
+   -1 * 0	 12 01 01 02 60 01 // Small Š š
+   -1 sprites/chars.pcx 338 8 01 6 3 0 0
+   -1 sprites/chars.pcx 354 8 01 6 3 0 0
+   -1 * 0	 12 01 00 02 60 01 // Medium Š š
+   -1 sprites/chars.pcx 370 8 01 9 7 0 0
+   -1 sprites/chars.pcx 386 8 01 9 6 0 0
+   -1 * 0	 12 01 02 02 60 01 // Large Š š
+   -1 sprites/chars.pcx 402 8 01 16 14 0 -1
+   -1 sprites/chars.pcx 434 8 01 14 10 0 1
+   -1 * 0	 12 02 02 01 D0 00 02 01 F0 00 // Large Ð ð
+   -1 sprites/chars.pcx 450 8 01 14 17 0 1
+   -1 sprites/chars.pcx 482 8 01 14 11 0 1
+   -1 * 0	 12 01 01 02 7D 01 // Small Ž ž
+   -1 sprites/chars.pcx 498 8 01 6 3 0 0
+   -1 sprites/chars.pcx 514 8 01 6 3 0 0
+   -1 * 0	 12 01 00 02 7D 01 // Medium Ž ž
+   -1 sprites/chars.pcx 530 8 01 9 7 0 0
+   -1 sprites/chars.pcx 546 8 01 9 6 0 0
+   -1 * 0	 12 01 02 02 7D 01 // Large Ž ž
+   -1 sprites/chars.pcx 562 8 01 16 14 0 -1
+   -1 sprites/chars.pcx 594 8 01 14 12 0 1
+   -1 * 0	 12 02 02 01 DE 00 02 01 FE 00 // Large Þ þ
+   -1 sprites/chars.pcx 626 8 01 14 14 0 1
+   -1 sprites/chars.pcx 658 8 01 18 14 0 1
+   -1 * 0	 12 03 01 01 BA 00 00 01 BA 00 02 01 BA 00 // All º
+   -1 sprites/chars.pcx 690 8 01 4 3 0 0
+   -1 sprites/chars.pcx 706 8 01 7 6 0 0
+   -1 sprites/chars.pcx 722 8 01 7 6 0 0
+   -1 * 0	 12 01 01 04 7B 00 // Small { | } ~
+   -1 sprites/chars.pcx 738 8 01 5 3 0 1
+   -1 sprites/chars.pcx 754 8 01 5 1 0 1
+   -1 sprites/chars.pcx 770 8 01 5 3 0 1
+   -1 sprites/chars.pcx 786 8 01 2 4 0 2
+   -1 * 0	 12 01 00 04 7B 00 // Medium { | } ~
+   -1 sprites/chars.pcx 2 40 01 10 5 0 0
+   -1 sprites/chars.pcx 18 40 01 10 3 0 0
+   -1 sprites/chars.pcx 34 40 01 10 5 0 0
+   -1 sprites/chars.pcx 50 40 01 3 8 0 3
+   -1 * 0	 12 01 02 04 7B 00 // Large { | } ~
+   -1 sprites/chars.pcx 66 40 01 18 7 0 0
+   -1 sprites/chars.pcx 82 40 01 18 3 0 0
+   -1 sprites/chars.pcx 98 40 01 18 7 0 0
+   -1 sprites/chars.pcx 114 40 01 3 12 0 6
+   -1 * 0	 12 01 02 01 A7 00 // Large §
+   -1 sprites/chars.pcx 146 40 01 17 9 0 -1
+   -1 * 0	 12 01 02 01 A9 00 // Large ©
+   -1 sprites/chars.pcx 162 40 01 14 16 0 1
+   -1 * 0	 12 01 02 01 AE 00 // Large ®
+   -1 sprites/chars.pcx 194 40 01 14 16 0 1
+   -1 * 0	 12 01 02 04 B0 00 // Large ° ± ² ³
+   -1 sprites/chars.pcx 226 40 01 7 7 0 0
+   -1 sprites/chars.pcx 242 40 01 10 9 0 2
+   -1 sprites/chars.pcx 258 40 01 8 6 0 0
+   -1 sprites/chars.pcx 274 40 01 8 5 0 0
+   -1 * 0	 12 01 02 01 D7 00 // Large ×
+   -1 sprites/chars.pcx 290 40 01 8 8 0 4
+   -1 * 0	 12 01 02 01 F7 00 // Large ÷
+   -1 sprites/chars.pcx 306 40 01 8 9 0 4
+   -1 * 0	 12 03 01 01 B7 00 00 01 B7 00 02 01 B7 00 // All ·
+   -1 sprites/chars.pcx 322 40 01 1 1 0 3
+   -1 sprites/chars.pcx 338 40 01 3 3 0 3
+   -1 sprites/chars.pcx 354 40 01 2 3 0 7
Binary file bin/data/ottd_grf/split/chars.pcx has changed
--- a/bin/data/ottd_grf/split/openttd.nfo	Mon Dec 03 23:39:38 2007 +0000
+++ b/bin/data/ottd_grf/split/openttd.nfo	Tue Jan 22 21:00:30 2008 +0000
@@ -103,8 +103,10 @@
 #include "canals.nfo"
 #include "oneway.nfo"
 #include "tramtracks.nfo"
+#include "shore.nfo"
 #include "airports.nfo"
 #include "roadstops.nfo"
 #include "autorail.nfo"
 #include "flags.nfo"
 #include "openttdgui.nfo"
+#include "chars.nfo"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/data/ottd_grf/split/shore.nfo	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,59 @@
+//
+// $Id$
+//
+   -1 * 6	 07 83 01 \7! 00 0C
+   -1 * 54	 0C "Missing shore tile graphics for "
+	 "the Temperate climate"
+   -1 * 3	 05 0D 0A
+   -1 sprites/shore.pcx 66 8 09 15 64 -31 0
+   -1 sprites/shore.pcx 146 8 09 31 64 -31 -8
+   -1 sprites/shore.pcx 226 8 09 23 64 -31 0
+   -1 sprites/shore.pcx 306 8 09 47 64 -31 -16
+   -1 sprites/shore.pcx 386 8 09 31 64 -31 -8
+   -1 sprites/shore.pcx 466 8 09 39 64 -31 -8
+   -1 sprites/shore.pcx 546 8 09 31 64 -31 -8
+   -1 sprites/shore.pcx 626 8 09 31 64 -31 -8
+   -1 sprites/shore.pcx 706 7 09 32 64 -31 -1
+   -1 sprites/shore.pcx 2 72 09 31 64 -31 -8
+   -1 * 6	 07 83 01 \7! 01 0C
+   -1 * 55	 0C "Missing shore tile graphics for "
+	 "the sub-arctic climate"
+   -1 * 3	 05 0D 0A
+   -1 sprites/shore.pcx 130 72 09 15 64 -31 0
+   -1 sprites/shore.pcx 210 72 09 31 64 -31 -8
+   -1 sprites/shore.pcx 290 72 09 23 64 -31 0
+   -1 sprites/shore.pcx 370 72 09 47 64 -31 -16
+   -1 sprites/shore.pcx 450 72 09 31 64 -31 -8
+   -1 sprites/shore.pcx 530 72 09 39 64 -31 -8
+   -1 sprites/shore.pcx 610 72 09 31 64 -31 -8
+   -1 sprites/shore.pcx 690 72 09 31 64 -31 -8
+   -1 sprites/shore.pcx 2 135 09 32 64 -31 -1
+   -1 sprites/shore.pcx 82 136 09 31 64 -31 -8
+   -1 * 6	 07 83 01 \7! 02 0C
+   -1 * 57	 0C "Missing shore tile graphics for "
+	 "the sub-tropical climate"
+   -1 * 3	 05 0D 0A
+   -1 sprites/shore.pcx 210 136 09 15 64 -31 0
+   -1 sprites/shore.pcx 290 136 09 31 64 -31 -8
+   -1 sprites/shore.pcx 370 136 09 23 64 -31 0
+   -1 sprites/shore.pcx 450 136 09 47 64 -31 -16
+   -1 sprites/shore.pcx 530 136 09 31 64 -31 -8
+   -1 sprites/shore.pcx 610 136 09 39 64 -31 -8
+   -1 sprites/shore.pcx 690 136 09 31 64 -31 -8
+   -1 sprites/shore.pcx 2 200 09 31 64 -31 -8
+   -1 sprites/shore.pcx 82 199 09 32 64 -31 -1
+   -1 sprites/shore.pcx 162 200 09 31 64 -31 -8
+   -1 * 6	 07 83 01 \7! 03 0C
+   -1 * 44	 0C "Missing shore tile graphics for "
+	 "the toyland"
+   -1 * 3	 05 0D 0A
+   -1 sprites/shore.pcx 290 200 09 15 64 -31 0
+   -1 sprites/shore.pcx 370 200 09 31 64 -31 -8
+   -1 sprites/shore.pcx 450 200 09 23 64 -31 0
+   -1 sprites/shore.pcx 530 200 09 47 64 -31 -16
+   -1 sprites/shore.pcx 610 200 09 31 64 -31 -8
+   -1 sprites/shore.pcx 690 200 09 39 64 -31 -8
+   -1 sprites/shore.pcx 2 264 09 31 64 -31 -8
+   -1 sprites/shore.pcx 82 264 09 31 64 -31 -8
+   -1 sprites/shore.pcx 162 263 09 32 64 -31 -1
+   -1 sprites/shore.pcx 242 264 09 31 64 -31 -8
Binary file bin/data/ottd_grf/split/shore.pcx has changed
--- a/changelog.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/changelog.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -1,3 +1,94 @@
+0.6.0-beta3 (2008-01-16)
+------------------------------------------------------------------------
+-Feature: Replaced fixed size custom name array. Names are now attached to their object directly and there is no limit to the amount of names (r11822)
+-Feature: Add drag-n-drop support to the raise/lower land tools. Land is raised/lowered at the start and the rest of the area levelled to match (r11759)
+-Feature: Add support for NewGRF's train 'tilt' flag. Trains with tilt capability (specific details are per NewGRF set) will be given a 20% speed limit bonus on curves (r11741)
+-Feature: Added sorting for cost, running costs and speed to road vehicles and ships build windows (r11710)
+-Feature: List neutral stations where the player has service in the station list too (r11670)
+-Feature: Check whether (some) characters are missing in the current 'font' for the 'currently' chosen language and give a warning when that does happen (r11646)
+-Feature: Support shore replacement via Action 5 (r11726)
+-Fix: When two NewGRFs 'fight' to define the same cargo it could happen that the strings are defined by one cargo and the 'action2' by another and when one assumes that both come from the same NewGRF [FS#1559] (r11862)
+-Fix: Recompute town population when removing a 'newhouses' grf, or when loading a game with missing 'newhouses' grfs [FS#1335] (r11855)
+-Fix: Road vehicle count was incorrect in network lobby window (r11844)
+-Fix: Mark dirty canal tile even in diagonal direction from flooded tile, draw correctly canal next to half flooded rail tile (r11843, r11838)
+-Fix: At least one instance of dmusic driver is needed for it to be registered and usable (r11826)
+-Fix: An articulated road vehicle could split up when it turned around at a corner and then would enter a drive through station at the next tile [FS#1627] (r11825)
+-Fix: Switch _screen to the output buffer and disable usage of 32bpp-anim animation buffer during giant screenshots [FS#1602] (r11813)
+-Fix: Do not crash trains when leaving depot to a very long track [FS#716] (r11802)
+-Fix: Take town rating into account when testing if a command can be executed [FS#1616] (r11795)
+-Fix: Reversing a train when loading at a station with an adjacent station in the same axis crashed [FS#1632] (r11794)
+-Fix: Group names got not deallocated in the command test run [FS#1614] (r11743)
+-Fix: Run window tick events when paused, so that news pop-ups and the about window still progress. For other windows the events are ignored when paused [FS#1319] (r11742)
+-Fix: Modify and possibly discard key events for code points in the unicode private use area [FS#1610] (r11740)
+-Fix: Set the new scroll position after zooming in instead of before, as the zoom will cancel it out [FS#1609] (r11739)
+-Fix: Do not reset loading indicator IDs when only reloading NewGRFs [FS#1574] (r11735)
+-Fix: Elrail merge gave elrail, monorail & maglev unintended speed bonuses for curves, as the bonus was based on the railtype index. The bonus is now specified by a property of the railtype (r11732)
+-Fix: Clear sprite override data before performing NewGRF wagon attach callback. This stopped the callback working for autoreplace and when moving wagons from train to train in a depot [FS#1582] (r11731)
+-Fix: If there are no houses that can be build in a specific year yet, force the houses with the earliest introduction year to be available [FS#1577] (r11727)
+-Fix: Make it impossible (for users) to circumvent the length checking of the NewGRF 'allow wagon attach' callback by moving several wagons at a time (r11724)
+-Fix: Do not put more than one Random() in function calls because parameter evaluation order is not guaranteed in the c++ standard [FS#1561] (r11716)
+-Fix: Do not allow player inauguration date on scenarios to be bigger than current year [FS#1569] (r11714)
+-Fix: Add more house string id ranges to MapGRFStringID so NewGRFs use the proper string ids (r11712)
+-Fix: Do not allow refitting flooded (destroyed) vehicles (r11707)
+-Fix: Trains could have sprites with wrong direction when reversing, also was inconsistent with save/load process [FS#1557] (r11705)
+-Fix: When removing buoys, return to water or canal depending on their owner (r11666)
+-Fix: Animation informations should not be copied from original industry tile spec, while doing an action 00, industry tile, prop 08 (r11665)
+-Fix: Do not allow modifying non-uniform stations when non-uniform stations are disabled [FS#1563] (r11659)
+-Fix: 'Initialised' NewGRFs could still be deactivated in the later 'activation' pass (r11650)
+-Fix: Vehicles were still followed when sold [FS#1541] (r11632)
+-Fix: Many viewports could crash the scenario editor [FS#1527] (r11629)
+-Fix: Popping from text reference stack must be done in a precise order. But some compiler (MSVC) over optimised it and inverted this order [FS#1532] (r11627)
+-Fix: There were still some cases where one could not build a tram track, but the tram could become blocked [FS#1525] (r11621)
+-Fix: Do not make crossing red behind depot the train is entering [FS#1531] (r11619)
+-Fix: Buoys are just waypoints, so don't allow load/unload/transfert for them (r11618)
+-Fix: Sometimes large values could go off the chart [FS#1526] (r11616)
+-Fix: Temperate banks can only be built in towns (over a house) (r11615)
+
+
+0.6.0-beta2 (2007-12-09)
+------------------------------------------------------------------------
+- Feature: Allow setting a default password for new companies in network games (r11556)
+- Feature: Signal selection GUI for the ones that really like to use that over CTRL (r11547)
+- Feature: Make the bridge selection window resizable (r11539)
+- Feature: [OSX] Added support for using Quartz instead of Quickdraw in windowed mode on OS X 10.4 and higher (r11496)
+- Feature: Allow to resize on creation the smallmap gui in order to show all the types industry available, allow to enable/disable individually or all at once, the industries shown on small map (r11474)
+- Codechange: Send and store the passwords a little more secure to/in the servers (r11557)
+- Fix: Wrong error messages were shown when trying to build some industries in the scenario editor [FS#1524] (r11609)
+- Fix: [NewGRF] Do not trigger industries, but only the industry's tiles (r11608)
+- Fix: Wrong count of Kirby trains when a ship was build [FS#1482] (r11605)
+- Fix: Tiles were not marked dirty in some cases when removing a lock or flooding (r11582, r11604)
+- Fix: Make price for railtype conversion more realistic; conversion should not be more expensive than removing and rebuilding [FS#1481] (r11603)
+- Fix: Do not allow changing network only patches settings from console when not in network game (r11594)
+- Fix: IsSlopeRefused() result was half wrong causing banks to be built on wrong places (r11590)
+- Fix: When ship depots got destroyed they always returned to water, even when it should have been canals [FS#1514] (r11589)
+- Fix: The one way road button wasn't reset on abort (r11587)
+- Fix: Windows could get completely missing when one resized the window to something very small [FS#1484] (r11583)
+- Fix: Invalidate 'list trains/roadvehs/ships/planes' widgets when station part is added/removed so it does not become glitchy (r11577)
+- Fix: Flood train stations when there are no trains on border tiles too (r11574, r11570)
+- Fix: Reinitialise windows system before loading a savegame because not doing so can cause crashes [FS#1494] (r11572)
+- Fix: Road vehicle getting to the wrong side of a station when trying to overtake in there [FS#1493] (r11571)
+- Fix: Full paths sometimes did not work correctly [FS#1480] (r11568)
+- Fix: Break the chain before moving a vehicle after another in the same chain instead of causing an infinite loop [FS#1512] (r11566)
+- Fix: Aircraft sometimes stopped mid-air when the airport got destroyed [FS#1503] (r11562)
+- Fix: Group list was not updated when removing the last group [FS#1504] (r11561)
+- Fix: Overflow when drawing graphics with high company values [FS#1505] (r11558)
+- Fix: If ever the air/heliport is suddenly not available while the "chopper" is descending, just go back into flying instead of stopping mid air [FS#1496] (r11546)
+- Fix: Cargo translation was sometimes done when it should not be done [FS#1501] (r11544)
+- Fix: [OSX] Detect statvfs at runtime (based on OSX version) instead of compile time. This should prevent a crash on OSX 10.3 with the precompiled binaries (in the load/save windows) (r11541)
+- Fix: [OSX] Do not try to compile the quartz video driver on OSX 10.3 as it will fail (r11540)
+- Fix: Do not do all kinds of 'updates' for town, waypoint, station and other signs when you have not converted the map to the 'current' format as that means you are going to read data in the 'old' format when you assume that it is in the 'current' format, which is eventually going to break (r11525)
+- Fix: Assertion when tram reversed at a station [FS#1485] (r11524)
+- Fix: The scrollbar of the network gui could run out of bounds (r11522)
+- Fix: [OSX] The cocoa video driver let the mouse cursor escape the window when using rmb scrolling (r11520)
+- Fix: Signs totally illegible when transparant signs is turned on and zoomed out more than one level [FS#1463] (r11507)
+- Fix: Selling vehicles could cause the window of others to scroll to that location [FS#1471] (r11506)
+- Fix: Do not do standard production change if callbacks 29/35 failed, disable smooth economy for industries using callbacks 29/35 (r11502)
+- Fix: Two small layout issues with the vehicle grouping GUI (r11478)
+- Fix: A road vehicle must not show that it is driving max speed when it is standing still waiting for the vehicle in from of it [FS#1451] (r11477)
+- Fix: OpenBSD has ALIGN already defined, causing compilation failures [FS#1450] (r11467)
+- Fix: Operator priority problem resulting in problematic autoroad placement in some cases (r11466)
+
+
 0.6.0-beta1 (2007-11-18)
 ------------------------------------------------------------------------
 - Feature: Make news messages related to the industry (production) changes better configurable; you can now disable news messages popping up for industries you are not servicing (r11442)
@@ -32,7 +123,7 @@
 - Feature: New sign editor features including switching to previous/next sign (r10401)
 - Feature: Disallow (in the GUI) the building of infrastructure you do not have available vehicles for. This means that the airport building button is disabled till you can actually build aircraft. The game itself will not disallow you to build the infrastructure and this "new" behaviour can be overridden with a patch setting [FS#669] (r10353)
 - Feature: Add the possibility of automatically filling in timetables based on the times from the first (or subsequent) run-throughs (r10331)
-- Feature: Option to select the "default" rail type when you start a new game or load a game. This is done either static, i.e. rail, electrified rail, monorail and maglev, or dynamic which takes either the first or last available railtype or the railtype that is used most on the map  [FS#812] (r10329)
+- Feature: Option to select the "default" rail type when you start a new game or load a game. This is done either static, i.e. rail, electrified rail, monorail and maglev, or dynamic which takes either the first or last available railtype or the railtype that is used most on the map [FS#812] (r10329)
 - Feature: Give a better explanation why the loading of a savegame failed and do not crash on loading savegames that were altered by patches or branches [FS#917] (r10300)
 - Feature: A sticky button for the client list window [FS#885] (r10293)
 - Feature: Allow double-clicking on certain places: add NewGRF window, build-vehicle and town-action (r10265, r10267)
@@ -384,7 +475,7 @@
 - Fix: Draw canal edges under buoys that are in a canal (r8635)
 - Fix: Buoys on canal tiles do not flood anymore (r8620)
 - Fix: Store the ownership of a water tile in the buoy tile and set the ownership of the water tile when the buoy is removed. Prevents certain abuses (r8619)
-- Fix: When the currently selected player in the performance details window is no longer active, choose the first active player instead of the first player as that may also be inactive  [FS#582] (r8612)
+- Fix: When the currently selected player in the performance details window is no longer active, choose the first active player instead of the first player as that may also be inactive [FS#582] (r8612)
 - Fix: Road vehicle very close after another (slower) road vehicle gets its speed reset to 0 when entering a tunnel, which causes a traffic jam outside of the tunnel (r8609)
 - Fix: Bridges do not get destroyed when the bridge head gets flooded and there is a vehicle on the bridge [FS#564] (r8593)
 - Fix: Road Vehicles now can obtain a slot even if the station is very spread out [FS#577] (r8536)
@@ -1028,7 +1119,7 @@
 - Feature: scrolling credits list (in  alphabetical order)
 - Feature: Train window now shows the number of vehicles per row (mpetrov)
 - Feature: [ 1039061 ] Swiss town-names (vulvulune)
-- Feature: [ 1090950 ] Adding 16:10 resolutions for mainly laptops  (doode)
+- Feature: [ 1090950 ] Adding 16:10 resolutions for mainly laptops (doode)
 - Feature: [ 1098254 ] (dis)Allow Shares. Add patch options to allow buying/selling of shares (Hackykid)
 - Fix: [ 1031451 ] Catchment area shows when buying sign
 - Fix: [ 1040119 ] Flood and wagons in depot
--- a/config.lib	Mon Dec 03 23:39:38 2007 +0000
+++ b/config.lib	Tue Jan 22 21:00:30 2008 +0000
@@ -30,20 +30,22 @@
 	data_dir="share/games/openttd"
 	icon_dir="share/pixmaps"
 	personal_dir="1"
+	shared_dir="1"
 	install_dir="/"
 	enable_debug="0"
+	enable_desync_debug="0"
 	enable_profiling="0"
 	enable_dedicated="0"
 	enable_network="1"
 	enable_static="1"
 	enable_translator="0"
+	enable_unicode="1"
 	enable_assert="1"
 	enable_strip="1"
 	enable_universal="1"
 	enable_osx_g5="0"
-	enable_unicode="1"
-	with_distcc="1"
-	with_ccache="1"
+	enable_cocoa_quartz="1"
+	enable_cocoa_quickdraw="1"
 	with_osx_sysroot="1"
 	with_application_bundle="1"
 	with_sdl="1"
@@ -61,8 +63,66 @@
 	with_fontconfig="1"
 	with_psp_config="1"
 	with_threads="1"
+	with_distcc="1"
+	with_ccache="1"
 
-	save_params_array="build host cc_build cc_host cxx_build cxx_host windres strip awk lipo os cpu_type revision endian config_log prefix_dir binary_dir data_dir icon_dir personal_dir install_dir enable_debug enable_profiling enable_dedicated enable_network enable_static enable_translator enable_assert enable_strip with_distcc with_osx_sysroot enable_universal enable_osx_g5 enable_unicode with_application_bundle with_sdl with_cocoa with_zlib with_png with_makedepend with_direct_music with_sort with_iconv with_midi with_midi_arg with_libtimidity with_freetype with_fontconfig with_psp_config with_threads CC CXX CFLAGS LDFLAGS"
+	save_params_array="
+		build
+		host
+		cc_build
+		cc_host
+		cxx_build
+		cxx_host
+		windres
+		strip
+		lipo
+		awk
+		os
+		endian
+		cpu_type
+		revision
+		config_log
+		prefix_dir
+		binary_dir
+		data_dir
+		icon_dir
+		personal_dir
+		shared_dir
+		install_dir
+		enable_debug
+		enable_desync_debug
+		enable_profiling
+		enable_dedicated
+		enable_network
+		enable_static
+		enable_translator
+		enable_unicode
+		enable_assert
+		enable_strip
+		enable_universal
+		enable_osx_g5
+		enable_cocoa_quartz
+		enable_cocoa_quickdraw
+		with_osx_sysroot
+		with_application_bundle
+		with_sdl
+		with_cocoa
+		with_zlib
+		with_png
+		with_makedepend
+		with_direct_music
+		with_sort
+		with_iconv
+		with_midi
+		with_midi_arg
+		with_libtimidity
+		with_freetype
+		with_fontconfig
+		with_psp_config
+		with_threads
+		with_distcc
+		with_ccache
+	CC CXX CFLAGS LDFLAGS"
 }
 
 detect_params() {
@@ -135,6 +195,10 @@
 			--personal-dir=*)             personal_dir="$optarg";;
 			--without-personal-dir)       personal_dir="";;
 
+			--shared-dir)                 prevp_p="shared-dir";;
+			--shared-dir=*)               shared_dir="$optarg";;
+			--without-shared-dir)         shared_dir="";;
+
 			--install-dir)                prevp_p="install-dir";;
 			--install-dir=*)              install_dir="$optarg";;
 
@@ -142,6 +206,8 @@
 
 			--enable-debug)               enable_debug="1";;
 			--enable-debug=*)             enable_debug="$optarg";;
+			--enable-desync-debug)        enable_desync_debug="1";;
+			--enable-desync-debug=*)      enable_desync_debug="$optarg";;
 			--enable-profiling)           enable_profiling="1";;
 			--enable-profiling=*)         enable_profiling="$optarg";;
 			--enable-dedicated)           enable_dedicated="1";;
@@ -170,6 +236,13 @@
 			--enable-unicode)             enable_unicode="2";;
 			--enable-unicode=*)           enable_unicode="$optarg";;
 
+			--disable-cocoa-quartz)       enable_cocoa_quartz="0";;
+			--enable-cocoa-quartz)        enable_cocoa_quartz="2";;
+			--enable-cocoa-quartz=*)      enable_cocoa_quartz="$optarg";;
+			--disable-cocoa-quickdraw)    enable_cocoa_quickdraw="0";;
+			--enable-cocoa-quickdraw)     enable_cocoa_quickdraw="2";;
+			--enable-cocoa-quickdraw=*)   enable_cocoa_quickdraw="$optarg";;
+
 			--with-sdl)                   with_sdl="2";;
 			--without-sdl)                with_sdl="0";;
 			--with-sdl=*)                 with_sdl="$optarg";;
@@ -337,6 +410,13 @@
 		exit 1
 	fi
 
+	# enable_desync_debug should be between 0 and 3
+	if [ -z "`echo $enable_desync_debug | egrep '^[012]$'`" ]; then
+		echo "configure: error: invalid option --enable-desync-debug=$enable_desync_debug"
+		echo " Available options are: --enable-desync-debug[=012]"
+		exit 1
+	fi
+
 	detect_awk
 
 	check_build
@@ -376,7 +456,7 @@
 	detect_cputype
 
 	if [ "$enable_static" = "1" ]; then
-		if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "OSX" ]; then
+		if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "MORPHOS" ]; then
 			enable_static="2"
 		else
 			enable_static="0"
@@ -419,6 +499,17 @@
 		log 1 "using debug level... level $enable_debug"
 	fi
 
+	if [ "$enable_desync_debug" = "0" ]; then
+		log 1 "using desync debug level... no"
+	else
+		log 1 "using desync debug level... level $enable_desync_debug"
+		log 1 "WARNING: desync debug functions slow down the game considerably."
+		log 1 "WARNING: use only when you are instructed to do so"
+		log 1 "         or when you know what you are doing."
+
+		sleep 5
+	fi
+
 	detect_sdl
 	detect_cocoa
 
@@ -729,6 +820,15 @@
 		fi
 	fi
 
+	if [ "$shared_dir" = "1" ]; then
+		# we are using default values
+		if [ "$os" = "OSX" ]; then
+			shared_dir="/Library/Application\\\\ Support/OpenTTD"
+		else
+			shared_dir=""
+		fi
+	fi
+
 	if [ -n "$personal_dir" ]
 	then
 		log 1 "personal home directory... $personal_dir"
@@ -736,6 +836,13 @@
 		log 1 "personal home directory... none"
 	fi
 
+	if [ -n "$shared_dir" ]
+	then
+		log 1 "shared data directory... $shared_dir"
+	else
+		log 1 "shared data directory... none"
+	fi
+
 	if [ -n "$install_dir" ]
 	then
 		log 1 "installation directory... $install_dir"
@@ -799,60 +906,76 @@
 		CFLAGS="$CFLAGS -DNO_THREADS"
 	fi
 
-	# Enable some things only for certain GCC versions
-	cc_version=`$cc_host -dumpversion | cut -c 1,3`
-
-	if [ $cc_version -ge 29 ]; then
-		CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
-		CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
-		CFLAGS="$CFLAGS -Wno-uninitialized"
-
-		CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
-	fi
-
-	gcc295=""
-	if [ "$cc_version" = 29 ]; then
-		# Make sure we mark GCC 2.95 flag for Makefile.src.in, as we
-		#  need a lovely hack there to make it compile correctly.
-		gcc295="1"
-	fi
-
-	if [ $cc_version -ge 30 ]; then
-		CFLAGS="$CFLAGS -W -Wno-unused-parameter"
-	fi
-
-	if [ $cc_version -ge 34 ]; then
-		CC_CFLAGS="$CC_CFLAGS -Wdeclaration-after-statement -Wold-style-definition"
-	fi
+	if [ `echo $cc_host | cut -c 1-3` = "icc" ]; then
+		# Enable some things only for certain ICC versions
+		cc_version=`$cc_host -dumpversion | cut -c 1-4`
 
-	if [ "$os" = "CYGWIN" ]; then
-		CFLAGS="$CFLAGS -mwin32"
-		LDFLAGS="$LDFLAGS -mwin32"
-	fi
-	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
-		CFLAGS="$CFLAGS -mno-cygwin"
-		LDFLAGS="$LDFLAGS -mno-cygwin"
-	fi
-
-	if [ "$os" = "CYGWIN" ] || [ "$os" = "MINGW" ]; then
-		LDFLAGS="$LDFLAGS -Wl,--subsystem,windows"
-		LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
-	fi
 
-	# GCC 4.0+ complains about that we break strict-aliasing.
-	#  On most places we don't see how to fix it, and it doesn't
-	#  break anything. So disable strict-aliasing to make the
-	#  compiler all happy.
-	if [ $cc_version -ge 40 ]; then
-		CFLAGS="$CFLAGS -fno-strict-aliasing"
-	fi
+		if [ "$cc_version" = "10.1" ]; then
+			CFLAGS="$CFLAGS -Wno-multichar"
+		fi
+	else
+		# Enable some things only for certain GCC versions
+		cc_version=`$cc_host -dumpversion | cut -c 1,3`
 
-	# GCC 4.2+ automatically assumes that signed overflows do
-	# not occur in signed arithmetics, whereas we are not
-	# sure that they will not happen. It furthermore complains
-	# about it's own optimized code in some places.
-	if [ $cc_version -ge 42 ]; then
-		CFLAGS="$CFLAGS -fno-strict-overflow"
+		if [ $cc_version -ge 29 ]; then
+			CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
+			CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
+			CFLAGS="$CFLAGS -Wno-uninitialized"
+
+			CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
+		fi
+
+		gcc295=""
+		if [ "$cc_version" = 29 ]; then
+			# Make sure we mark GCC 2.95 flag for Makefile.src.in, as we
+			#  need a lovely hack there to make it compile correctly.
+			gcc295="1"
+		fi
+
+		if [ $cc_version -ge 30 ]; then
+			CFLAGS="$CFLAGS -W -Wno-unused-parameter"
+		fi
+
+		if [ $cc_version -ge 34 ]; then
+			CC_CFLAGS="$CC_CFLAGS -Wdeclaration-after-statement -Wold-style-definition"
+		fi
+
+		if [ "$os" = "CYGWIN" ]; then
+			CFLAGS="$CFLAGS -mwin32"
+			LDFLAGS="$LDFLAGS -mwin32"
+		fi
+		if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
+			CFLAGS="$CFLAGS -mno-cygwin"
+			LDFLAGS="$LDFLAGS -mno-cygwin"
+		fi
+
+		if [ "$os" = "CYGWIN" ] || [ "$os" = "MINGW" ]; then
+			LDFLAGS="$LDFLAGS -Wl,--subsystem,windows"
+			LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
+		fi
+
+		# GCC 4.0+ complains about that we break strict-aliasing.
+		#  On most places we don't see how to fix it, and it doesn't
+		#  break anything. So disable strict-aliasing to make the
+		#  compiler all happy.
+		if [ $cc_version -ge 40 ]; then
+			CFLAGS="$CFLAGS -fno-strict-aliasing"
+		fi
+
+		# GCC 4.2+ automatically assumes that signed overflows do
+		# not occur in signed arithmetics, whereas we are not
+		# sure that they will not happen. It furthermore complains
+		# about it's own optimized code in some places.
+		if [ $cc_version -ge 42 ]; then
+			CFLAGS="$CFLAGS -fno-strict-overflow"
+		fi
+
+		# GCC 4.3+ gives a warning about empty body of
+		# loops and conditions
+		if [ $cc_version -ge 43 ]; then
+			CFLAGS="$CFLAGS -Wno-empty-body"
+		fi
 	fi
 
 	if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
@@ -922,6 +1045,14 @@
 	if [ "$with_cocoa" != "0" ]; then
 		CFLAGS="$CFLAGS -DWITH_COCOA"
 		LIBS="$LIBS -F/System/Library/Frameworks -framework Cocoa -framework Carbon -framework AudioUnit"
+
+		if [ "$enable_cocoa_quartz" != "0" ]; then
+			CFLAGS="$CFLAGS -DENABLE_COCOA_QUARTZ"
+		fi
+
+		if [ "$enable_cocoa_quickdraw" != "0" ]; then
+			CFLAGS="$CFLAGS -DENABLE_COCOA_QUICKDRAW"
+		fi
 	fi
 
 	if [ "$with_zlib" != "0" ]; then
@@ -1052,6 +1183,13 @@
 		CFLAGS="$CFLAGS -DNDEBUG"
 	fi
 
+	if [ "$enable_desync_debug" = "1" ]; then
+		CFLAGS="$CFLAGS -DDEBUG_DUMP_COMMANDS"
+	fi
+	if [ "$enable_desync_debug" = "2" ]; then
+		CFLAGS="$CFLAGS -DRANDOM_DEBUG"
+	fi
+
 	if [ "$enable_osx_g5" != "0" ]; then
 		CFLAGS="$CFLAGS -mtune=970 -mcpu=970 -mpowerpc-gpopt"
 	fi
@@ -1065,6 +1203,10 @@
 		CFLAGS="$CFLAGS -DWITH_PERSONAL_DIR -DPERSONAL_DIR=\\\\\"$personal_dir\\\\\""
 	fi
 
+	if [ -n "$shared_dir" ]; then
+		CFLAGS="$CFLAGS -DWITH_SHARED_DIR -DSHARED_DIR=\\\\\"$shared_dir\\\\\""
+	fi
+
 	CFLAGS="$CFLAGS -DGLOBAL_DATA_DIR=\\\\\"$prefix_dir/$data_dir\\\\\""
 
 	log 1 "using CFLAGS... $CFLAGS $CC_CFLAGS"
@@ -1524,6 +1666,19 @@
 	fi
 
 	log 1 "checking COCOA... found"
+
+
+	if [ "$enable_cocoa_quartz" != "0" ]; then
+		log 1 "checking whether to enable the Quartz window subdriver... yes"
+	else
+		log 1 "checking whether to enable the Quartz window subdriver... no"
+	fi
+
+	if [ "$enable_cocoa_quickdraw" != "0" ]; then
+		log 1 "checking whether to enable the Quickdraw window subdriver... yes"
+	else
+		log 1 "checking whether to enable the Quickdraw window subdriver... no"
+	fi
 }
 
 detect_library() {
@@ -1976,7 +2131,7 @@
 	ppc=`$cc_host -dumpmachine | egrep "powerpc|ppc"`
 	if [ -n "$ppc" ]; then
 		T_CFLAGS="$CFLAGS -DFOUR_BYTE_BOOL"
-		osx_sysroot_version=10.3.9
+		osx_sysroot_version=10.4u
 	else
 		T_CFLAGS="$CFLAGS"
 		osx_sysroot_version=10.4u
@@ -2022,6 +2177,7 @@
 		s#!!DATA_DIR!!#$prefix_dir/$data_dir#g;
 		s#!!ICON_DIR!!#$prefix_dir/$icon_dir#g;
 		s#!!PERSONAL_DIR!!#$personal_dir#g;
+		s#!!SHARED_DIR!!#$shared_dir#g;
 		s#!!INSTALL_DIR!!#$install_dir#g;
 		s#!!STRGEN!!#$STRGEN#g;
 		s#!!ENDIAN_CHECK!!#$ENDIAN_CHECK#g;
@@ -2162,12 +2318,16 @@
 	echo "                                 [share/games/openttd]"
 	echo "  --icon-dir=dir                 location of icons. Will be prefixed"
 	echo "                                 with the prefix-dir [share/pixmaps]"
-	echo "  --personal-dir=dir             location of the personal directory [.openttd]"
+	echo "  --personal-dir=dir             location of the personal directory"
+	echo "                                 [os-dependent default]"
+	echo "  --shared-dir=dir               location of shared data files"
+	echo "                                 [os-dependent default]"
 	echo "  --install-dir=dir              specifies the root to install to."
 	echo "                                 Useful to install into jails [/]"
 	echo ""
 	echo "Features and packages:"
 	echo "  --enable-debug[=LVL]           enable debug-mode (LVL=[0123], 0 is release)"
+	echo "  --enable_desync_debug=[LVL]    enable desync debug options (LVL=[012], 0 is none"
 	echo "  --enable-profiling             enables profiling"
 	echo "  --enable-dedicated             compile a dedicated server (without video)"
 	echo "  --enable-static                enable static compile (doesn't work for"
@@ -2175,6 +2335,10 @@
 	echo "  --enable-translator            enable extra output for translators"
 	echo "  --enable-universal             enable universal builds (OSX ONLY)"
 	echo "  --enable-osx-g5                enables optimalizations for G5 (OSX ONLY)"
+	echo "  --disable-cocoa-quartz         disable the quartz window mode driver for Cocoa (OSX ONLY)"
+	echo "  --disable-cocoa-quickdraw      disable the quickdraw window mode driver for Cocoa (OSX ONLY)"
+	echo "  --disable-unicode              disable unicode support to build win9x"
+	echo "                                 version (Win32 ONLY)"
 	echo "  --disable-network              disable network support"
 	echo "  --disable-assert               disable asserts (continue on errors)"
 	echo "  --disable-strip                disable any possible stripping"
--- a/configure	Mon Dec 03 23:39:38 2007 +0000
+++ b/configure	Tue Jan 22 21:00:30 2008 +0000
@@ -31,13 +31,13 @@
 MEDIA_DIR="$ROOT_DIR/media"
 SOURCE_LIST="$ROOT_DIR/source.list"
 
-if [ "$1" = "--reconfig" ]; then
+if [ "$1" = "--reconfig" ] || [ "$1" = "--reconfigure" ]; then
 	if ! [ -f "config.cache" ]; then
 		echo "can't reconfigure, because never configured before"
 		exit 1
 	fi
 	# Make sure we don't lock config.cache
-	cat config.cache > cache.tmp
+	cat config.cache | sed 's/\\ /\\\\ /g' > cache.tmp
 	sh cache.tmp
 	rm -f cache.tmp
 	exit $?
--- a/docs/landscape.html	Mon Dec 03 23:39:38 2007 +0000
+++ b/docs/landscape.html	Tue Jan 22 21:00:30 2008 +0000
@@ -866,6 +866,11 @@
        </tr>
 
        <tr>
+        <td noswap valign=top><tt>02</tt>&nbsp; </td>
+        <td align=left>river</td>
+       </tr>
+
+       <tr>
         <td nowrap valign=top><tt>10</tt>..<tt>1B</tt>&nbsp; </td>
         <td align=left>canal locks
          <table>
@@ -946,6 +951,8 @@
        </tr>
       </table>
      </li>
+     <li>m4: Owner of the water when ship depot</li>
+     <li>m4: Random data for canal or river tiles</li>
      <li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
      <li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
     </ul>
--- a/docs/landscape_grid.html	Mon Dec 03 23:39:38 2007 +0000
+++ b/docs/landscape_grid.html	Tue Jan 22 21:00:30 2008 +0000
@@ -194,8 +194,8 @@
       <td class="bits">XXXX XXXX</td>
       <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
       <td class="bits"><span class="free">OOOO OOOO</span></td>
-      <td class="bits"><span class="free">OOOO OOOO</span></td>
-      <td class="bits"><span class="free">OOOO OO</span>XX</td>
+      <td class="bits">XXXX XXXX</td>
+      <td class="bits">XXXX XXXX</td>
       <td class="bits">XX<span class="free">OO OO</span>XX</td>
       <td class="bits"><span class="free">OOOO OOOO</span></td>
     </tr>
--- a/known-bugs.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/known-bugs.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -11,20 +11,18 @@
 If the bug report is closed, it has been fixed, which then can be verified
 in the latest SVN version of /trunk.
 
-Bugs for 0.6.0-beta1
+Bugs for 0.6.0-beta3
 ------------------------------------------------------------------------
 URL: http://bugs.openttd.org
 
-- 1434	Network game crashes when player builds SH40
+- 1624	Autoreplace refit fails -> crash
+- 1549	Timetable + group ID are not backed up with orders
+- 1495	Long vehicles block multistop station
+- 1487	Ending_year is never written to
+- 1473	Train not going to available platform
 - 1404	Spinner widget interprets one click as many
-- 1401	Crash while scrolling screen
-- 1386	Mac OS X fails to compile out of the box on 10.5
 - 1264	Autoreplace for multiple NewGRF DMU sets fails
-- 1200	Illegal names skip comparisons for uniquity
-- 1141	[OSX] Not smooth moving map with touchpad
-- 1109	[OSX] Choppy mouse cursor movement in fullscreen mode
-- 1094	Foundations showing on 'build on slopes'
+- 1140	[OSX] Not smooth moving map with touchpad
 - 1074	Large slowdown when building tracks
 - 1072	Text overflows in several windows
--  716	Train crash in depot with long long tracks
 -  119	Clipping problems with vehicles on slopes
--- a/os/debian/changelog	Mon Dec 03 23:39:38 2007 +0000
+++ b/os/debian/changelog	Tue Jan 22 21:00:30 2008 +0000
@@ -4,6 +4,18 @@
 
  -- Matthijs Kooijman <m.kooijman@student.utwente.nl>  Mon, 26 Feb 2007 21:07:05 +0100
 
+openttd (0.6.0~beta3-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Matthijs Kooijman <m.kooijman@student.utwente.nl>  Tue, 16 Jan 2008 21:40:07 +0100
+
+openttd (0.6.0~beta2-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Matthijs Kooijman <m.kooijman@student.utwente.nl>  Sun, 09 Dec 2007 22:05:05 +0100
+
 openttd (0.6.0~beta1-1) unstable; urgency=low
 
   * New upstream release.
--- a/os/win32/installer/install.nsi	Mon Dec 03 23:39:38 2007 +0000
+++ b/os/win32/installer/install.nsi	Tue Jan 22 21:00:30 2008 +0000
@@ -1,9 +1,9 @@
 !define APPNAME "OpenTTD"   ; Define application name
 !define APPVERSION "0.6.0"  ; Define application version
-!define INSTALLERVERSION 39 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
+!define INSTALLERVERSION 41 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
 
 !define APPURLLINK "http://www.openttd.org"
-!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}-beta1"
+!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}-beta3"
 !define APPVERSIONINTERNAL "${APPVERSION}.0" ; Needs to be of the format X.X.X.X
 
 !define MUI_ICON "..\..\..\media\openttd.ico"
--- a/projects/langs.vcproj	Mon Dec 03 23:39:38 2007 +0000
+++ b/projects/langs.vcproj	Tue Jan 22 21:00:30 2008 +0000
@@ -52,19 +52,6 @@
 			</FileConfiguration>
 		</File>
 		<File
-			RelativePath="..\src\lang\american.txt">
-			<FileConfiguration
-				Name="Debug|Win32">
-				<Tool
-					Name="VCCustomBuildTool"
-					Description="Generating american language file"
-					CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
-"
-					AdditionalDependencies=""
-					Outputs="..\bin\lang\american.lng"/>
-			</FileConfiguration>
-		</File>
-		<File
 			RelativePath="..\src\lang\brazilian_portuguese.txt">
 			<FileConfiguration
 				Name="Debug|Win32">
@@ -169,6 +156,19 @@
 			</FileConfiguration>
 		</File>
 		<File
+			RelativePath="..\src\lang\english_US.txt">
+			<FileConfiguration
+				Name="Debug|Win32">
+				<Tool
+					Name="VCCustomBuildTool"
+					Description="Generating english_US language file"
+					CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;
+"
+					AdditionalDependencies=""
+					Outputs="..\bin\lang\english_US.lng"/>
+			</FileConfiguration>
+		</File>
+		<File
 			RelativePath="..\src\lang\esperanto.txt">
 			<FileConfiguration
 				Name="Debug|Win32">
--- a/projects/langs_vs80.vcproj	Mon Dec 03 23:39:38 2007 +0000
+++ b/projects/langs_vs80.vcproj	Tue Jan 22 21:00:30 2008 +0000
@@ -62,21 +62,6 @@
 			</FileConfiguration>
 		</File>
 		<File
-			RelativePath="..\src\lang\american.txt"
-			>
-			<FileConfiguration
-				Name="Debug|Win32"
-				>
-				<Tool
-					Name="VCCustomBuildTool"
-					Description="Generating american language file"
-					CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
-					AdditionalDependencies=""
-					Outputs="..\bin\lang\american.lng"
-				/>
-			</FileConfiguration>
-		</File>
-		<File
 			RelativePath="..\src\lang\brazilian_portuguese.txt"
 			>
 			<FileConfiguration
@@ -197,6 +182,21 @@
 			</FileConfiguration>
 		</File>
 		<File
+			RelativePath="..\src\lang\english_US.txt"
+			>
+			<FileConfiguration
+				Name="Debug|Win32"
+				>
+				<Tool
+					Name="VCCustomBuildTool"
+					Description="Generating english_US language file"
+					CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+					AdditionalDependencies=""
+					Outputs="..\bin\lang\english_US.lng"
+				/>
+			</FileConfiguration>
+		</File>
+		<File
 			RelativePath="..\src\lang\esperanto.txt"
 			>
 			<FileConfiguration
--- a/projects/langs_vs90.vcproj	Mon Dec 03 23:39:38 2007 +0000
+++ b/projects/langs_vs90.vcproj	Tue Jan 22 21:00:30 2008 +0000
@@ -63,21 +63,6 @@
 			</FileConfiguration>
 		</File>
 		<File
-			RelativePath="..\src\lang\american.txt"
-			>
-			<FileConfiguration
-				Name="Debug|Win32"
-				>
-				<Tool
-					Name="VCCustomBuildTool"
-					Description="Generating american language file"
-					CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
-					AdditionalDependencies=""
-					Outputs="..\bin\lang\american.lng"
-				/>
-			</FileConfiguration>
-		</File>
-		<File
 			RelativePath="..\src\lang\brazilian_portuguese.txt"
 			>
 			<FileConfiguration
@@ -198,6 +183,21 @@
 			</FileConfiguration>
 		</File>
 		<File
+			RelativePath="..\src\lang\english_US.txt"
+			>
+			<FileConfiguration
+				Name="Debug|Win32"
+				>
+				<Tool
+					Name="VCCustomBuildTool"
+					Description="Generating english_US language file"
+					CommandLine="..\objs\strgen\strgen.exe -s ..\src\lang -d ..\bin\lang &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+					AdditionalDependencies=""
+					Outputs="..\bin\lang\english_US.lng"
+				/>
+			</FileConfiguration>
+		</File>
+		<File
 			RelativePath="..\src\lang\esperanto.txt"
 			>
 			<FileConfiguration
--- a/projects/openttd.vcproj	Mon Dec 03 23:39:38 2007 +0000
+++ b/projects/openttd.vcproj	Tue Jan 22 21:00:30 2008 +0000
@@ -351,6 +351,9 @@
 				RelativePath=".\..\src\settings.cpp">
 			</File>
 			<File
+				RelativePath=".\..\src\signal.cpp">
+			</File>
+			<File
 				RelativePath=".\..\src\signs.cpp">
 			</File>
 			<File
@@ -378,7 +381,7 @@
 				RelativePath=".\..\src\thread.cpp">
 			</File>
 			<File
-				RelativePath=".\..\src\tile.cpp">
+				RelativePath=".\..\src\tile_map.cpp">
 			</File>
 			<File
 				RelativePath=".\..\src\vehicle.cpp">
@@ -393,6 +396,9 @@
 				RelativePath=".\..\src\widget.cpp">
 			</File>
 			<File
+				RelativePath=".\..\src\widgets\dropdown.cpp">
+			</File>
+			<File
 				RelativePath=".\..\src\win32.cpp">
 			</File>
 			<File
@@ -508,9 +514,6 @@
 				RelativePath=".\..\src\heightmap.h">
 			</File>
 			<File
-				RelativePath=".\..\src\helpers.hpp">
-			</File>
-			<File
 				RelativePath=".\..\src\industry.h">
 			</File>
 			<File
@@ -520,9 +523,6 @@
 				RelativePath=".\..\src\livery.h">
 			</File>
 			<File
-				RelativePath=".\..\src\macros.h">
-			</File>
-			<File
 				RelativePath=".\..\src\map.h">
 			</File>
 			<File
@@ -667,6 +667,9 @@
 				RelativePath=".\..\src\signs.h">
 			</File>
 			<File
+				RelativePath=".\..\src\signal_func.h">
+			</File>
+			<File
 				RelativePath=".\..\src\slope.h">
 			</File>
 			<File
@@ -682,6 +685,9 @@
 				RelativePath=".\..\src\station.h">
 			</File>
 			<File
+				RelativePath=".\..\src\station_gui.h">
+			</File>
+			<File
 				RelativePath=".\..\src\stdafx.h">
 			</File>
 			<File
@@ -742,6 +748,15 @@
 				RelativePath=".\..\src\window.h">
 			</File>
 			<File
+				RelativePath=".\..\src\widgets\dropdown.h">
+			</File>
+			<File
+				RelativePath=".\..\src\widgets\dropdown_type.h">
+			</File>
+			<File
+				RelativePath=".\..\src\widgets\dropdown_func.h">
+			</File>
+			<File
 				RelativePath=".\..\src\zoom.hpp">
 			</File>
 		</Filter>
@@ -900,6 +915,9 @@
 				RelativePath=".\..\src\station_cmd.cpp">
 			</File>
 			<File
+				RelativePath=".\..\src\terraform_cmd.cpp">
+			</File>
+			<File
 				RelativePath=".\..\src\timetable_cmd.cpp">
 			</File>
 			<File
@@ -1210,6 +1228,9 @@
 				RelativePath=".\..\src\tunnel_map.h">
 			</File>
 			<File
+				RelativePath=".\..\src\tunnelbridge_map.h">
+			</File>
+			<File
 				RelativePath=".\..\src\unmovable_map.h">
 			</File>
 			<File
--- a/projects/openttd_vs80.vcproj	Mon Dec 03 23:39:38 2007 +0000
+++ b/projects/openttd_vs80.vcproj	Tue Jan 22 21:00:30 2008 +0000
@@ -700,6 +700,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\signal.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\signs.cpp"
 				>
 			</File>
@@ -736,7 +740,7 @@
 				>
 			</File>
 			<File
-				RelativePath=".\..\src\tile.cpp"
+				RelativePath=".\..\src\tile_map.cpp"
 				>
 			</File>
 			<File
@@ -756,6 +760,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\widgets\dropdown.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\win32.cpp"
 				>
 			</File>
@@ -908,10 +916,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\..\src\helpers.hpp"
-				>
-			</File>
-			<File
 				RelativePath=".\..\src\industry.h"
 				>
 			</File>
@@ -924,10 +928,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\..\src\macros.h"
-				>
-			</File>
-			<File
 				RelativePath=".\..\src\map.h"
 				>
 			</File>
@@ -1120,6 +1120,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\signal_func.h"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\slope.h"
 				>
 			</File>
@@ -1140,6 +1144,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\station_gui.h"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\stdafx.h"
 				>
 			</File>
@@ -1220,6 +1228,18 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\widgets\dropdown.h"
+				>
+			</File>
+			<File
+				RelativePath=".\..\src\widgets\dropdown_type.h"
+				>
+			</File>
+			<File
+				RelativePath=".\..\src\widgets\dropdown_func.h"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\zoom.hpp"
 				>
 			</File>
@@ -1428,6 +1448,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\terraform_cmd.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\timetable_cmd.cpp"
 				>
 			</File>
@@ -1832,6 +1856,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\tunnelbridge_map.h"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\unmovable_map.h"
 				>
 			</File>
--- a/projects/openttd_vs90.vcproj	Mon Dec 03 23:39:38 2007 +0000
+++ b/projects/openttd_vs90.vcproj	Tue Jan 22 21:00:30 2008 +0000
@@ -689,6 +689,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\signal.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\signs.cpp"
 				>
 			</File>
@@ -725,7 +729,7 @@
 				>
 			</File>
 			<File
-				RelativePath=".\..\src\tile.cpp"
+				RelativePath=".\..\src\tile_map.cpp"
 				>
 			</File>
 			<File
@@ -745,6 +749,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\widgets\dropdown.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\win32.cpp"
 				>
 			</File>
@@ -893,10 +901,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\..\src\helpers.hpp"
-				>
-			</File>
-			<File
 				RelativePath=".\..\src\industry.h"
 				>
 			</File>
@@ -909,10 +913,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\..\src\macros.h"
-				>
-			</File>
-			<File
 				RelativePath=".\..\src\map.h"
 				>
 			</File>
@@ -1101,6 +1101,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\signal_func.h"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\slope.h"
 				>
 			</File>
@@ -1121,6 +1125,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\station_gui.h"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\stdafx.h"
 				>
 			</File>
@@ -1201,6 +1209,18 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\widgets\dropdown.h"
+				>
+			</File>
+			<File
+				RelativePath=".\..\src\widgets\dropdown_type.h"
+				>
+			</File>
+			<File
+				RelativePath=".\..\src\widgets\dropdown_func.h"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\zoom.hpp"
 				>
 			</File>
@@ -1409,6 +1429,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\terraform_cmd.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\timetable_cmd.cpp"
 				>
 			</File>
@@ -1809,6 +1833,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\tunnelbridge_map.h"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\unmovable_map.h"
 				>
 			</File>
--- a/readme.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/readme.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -1,6 +1,6 @@
 OpenTTD README
-Last updated:    2007-11-18
-Release version: 0.6.0-beta1
+Last updated:    2008-01-16
+Release version: 0.6.0-beta3
 ------------------------------------------------------------------------
 
 
@@ -282,31 +282,36 @@
 X.X) Credits:
 ---- --------
 The OpenTTD team (in alphabetical order):
-  Jean-Francois Claeys (Belugas) - In training, not yet specialized
-  Bjarni Corfitzen (Bjarni)      - Mac OS X port, coder
-  Matthijs Kooijman (blathijs)   - Pathfinder-guru
+  Jean-Francois Claeys (Belugas) - GUI, newindustries and more
+  Bjarni Corfitzen (Bjarni)      - MacOSX port, coder and vehicles
+  Matthijs Kooijman (blathijs)   - Pathfinder-guru, pool rework
+  Loïc Guilloux (glx)            - General coding
+  Jaroslav Mazanec (KUDr)        - YAPG (Yet Another Pathfinder God) ;)
+  Jonathan Coome (Maedhros)      - High priest of the newGRF Temple
+  Attila Bán (MiHaMiX)           - WebTranslator, Nightlies, Wiki and bugtracker host
+  Owen Rudge (orudge)            - Forum host, OS/2 port
+  Peter Nelson (peter1138)       - Spiritual descendant from newGRF gods
+  Remko Bijker (Rubidium)        - Lead coder and way more
+  Benedikt Brüggemeier (skidd13) - Bug fixer and code reworker
+  Zdenek Sojka (SmatZ)           - Bug finder and fixer
+
+Inactive Developers:
   Victor Fischer (Celestar)      - Programming everywhere you need him to
-  Tamás Faragó (Darkvater)       - Lead programmer
-  Loïc Guilloux (glx)            - In training, not yet specialized
-  Jaroslav Mazanec (KUDr)        - YAPG (Yet Another Pathfinder God) ;)
-  Kerekes Miham (MiHaMiX)        - Maintainer of translator service, and host of nightlies
-  Owen Rudge (orudge)            - Contributor, forum host, OS/2 port
-  Peter Nelson (peter1138)       - Spiritual descendant from newgrf gods
-  Remko Bijker (Rubidium)        - THE desync hunter
+  Tamás Faragó (Darkvater)       - Ex-Lead coder
   Christoph Mallon (Tron)        - Programmer, code correctness police
 
 Retired Developers:
+  Ludvig Strigeus (ludde)        - OpenTTD author, main coder (0.1 - 0.3.3)
+  Serge Paquet (vurlix)          - Assistant project manager, coder (0.1 - 0.3.3)
   Dominik Scherer (dominik81)    - Lead programmer, GUI expert (0.3.0 - 0.3.6)
   Patric Stout (TrueLight)       - Programmer, webhoster (0.3 - pre0.6)
-  Ludvig Strigeus (ludde)        - OpenTTD author, main coder (0.1 - 0.3.3)
-  Serge Paquet (vurlix)          - Assistant project manager, coder (0.1 - 0.3.3)
 
 Thanks to:
   Josef Drexler                  - For his great work on TTDPatch.
   Marcin Grzegorczyk             - For his TTDPatch work and documentation of TTD internals and graphics (signals and track foundations)
   Matthijs Kooijman (blathijs)   - For his many patches, suggestions and major work on maprewrite
   Petr Baudis (pasky)            - Many patches, newgrf support, etc.
-  Simon Sasburg (HackyKid)       - For the many bugfixes he has blessed us with (and future PBS)
+  Simon Sasburg (HackyKid)       - For the many bugfixes he has blessed us with
   Stefan Meißner (sign_de)       - For his work on the console
   Mike Ragsdale                  - OpenTTD installer
   Cian Duffy (MYOB)              - BeOS port / manual writing
--- a/source.list	Mon Dec 03 23:39:38 2007 +0000
+++ b/source.list	Tue Jan 22 21:00:30 2008 +0000
@@ -68,6 +68,7 @@
 	sdl.cpp
 #end
 settings.cpp
+signal.cpp
 signs.cpp
 sound.cpp
 spritecache.cpp
@@ -77,7 +78,7 @@
 texteff.cpp
 tgp.cpp
 thread.cpp
-tile.cpp
+tile_map.cpp
 #if WIN32
 #else
 	#if WINCE
@@ -94,6 +95,7 @@
 viewport.cpp
 waypoint.cpp
 widget.cpp
+widgets/dropdown.cpp
 #if WIN32
 	win32.cpp
 #end
@@ -135,11 +137,9 @@
 group.h
 gui.h
 heightmap.h
-helpers.hpp
 industry.h
 landscape.h
 livery.h
-macros.h
 map.h
 md5.h
 mixer.h
@@ -188,11 +188,13 @@
 video/sdl_v.h
 settings.h
 signs.h
+signal_func.h
 slope.h
 sound.h
 sprite.h
 spritecache.h
 station.h
+station_gui.h
 stdafx.h
 string.h
 texteff.hpp
@@ -213,6 +215,9 @@
 sound/win32_s.h
 video/win32_v.h
 window.h
+widgets/dropdown.h
+widgets/dropdown_type.h
+widgets/dropdown_func.h
 zoom.hpp
 
 # GUI Source Code
@@ -267,6 +272,7 @@
 roadveh_cmd.cpp
 ship_cmd.cpp
 station_cmd.cpp
+terraform_cmd.cpp
 timetable_cmd.cpp
 town_cmd.cpp
 train_cmd.cpp
@@ -377,6 +383,7 @@
 tree_map.h
 tunnel_map.cpp
 tunnel_map.h
+tunnelbridge_map.h
 unmovable_map.h
 void_map.h
 water_map.h
--- a/src/ai/ai.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/ai/ai.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,11 +3,17 @@
 #include "../stdafx.h"
 #include "../openttd.h"
 #include "../variables.h"
-#include "../command.h"
+#include "../command_func.h"
 #include "../network/network.h"
-#include "../helpers.hpp"
+#include "../core/alloc_func.hpp"
+#include "../player_func.h"
+#include "../player_base.h"
 #include "ai.h"
 #include "default/default.h"
+#include "../signal_func.h"
+
+AIStruct _ai;
+AIPlayer _ai_player[MAX_PLAYERS];
 
 /**
  * Dequeues commands put in the queue via AI_PutCommandInQueue.
@@ -45,7 +51,7 @@
  * Needed for SP; we need to delay DoCommand with 1 tick, because else events
  *  will make infinite loops (AIScript).
  */
-static void AI_PutCommandInQueue(PlayerID player, TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCallback* callback)
+static void AI_PutCommandInQueue(PlayerID player, TileIndex tile, uint32 p1, uint32 p2, uint32 procc, CommandCallback* callback)
 {
 	AICommand *com;
 
@@ -81,7 +87,7 @@
 /**
  * Executes a raw DoCommand for the AI.
  */
-CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc, CommandCallback* callback)
+CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc, CommandCallback* callback)
 {
 	PlayerID old_lp;
 	CommandCost res;
@@ -104,10 +110,6 @@
 	/* Restore _cmd_text */
 	_cmd_text = tmp_cmdtext;
 
-	/* If we did a DC_EXEC, and the command did not return an error, execute it
-	 * over the network */
-	if (flags & DC_NO_WATER) procc |= CMD_NO_WATER;
-
 	/* NetworkSend_Command needs _local_player to be set correctly, so
 	 * adjust it, and put it back right after the function */
 	old_lp = _local_player;
@@ -134,7 +136,7 @@
 }
 
 
-CommandCost AI_DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc)
+CommandCost AI_DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc)
 {
 	return AI_DoCommandCc(tile, p1, p2, flags, procc, NULL);
 }
@@ -158,6 +160,9 @@
 		AiDoGameLoop(p);
 		_is_old_ai_player = false;
 	}
+
+	/* AI could change some track, so update signals */
+	UpdateSignalsInBuffer();
 }
 
 
--- a/src/ai/ai.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/ai/ai.h	Tue Jan 22 21:00:30 2008 +0000
@@ -1,10 +1,12 @@
+/* $Id$ */
+
 #ifndef AI_H
 #define AI_H
 
-#include "../functions.h"
 #include "../network/network.h"
-#include "../player.h"
-#include "../command.h"
+#include "../command_type.h"
+#include "../core/random_func.hpp"
+#include "../settings_type.h"
 
 /* How DoCommands look like for an AI */
 struct AICommand {
@@ -12,7 +14,7 @@
 	uint32 p1;
 	uint32 p2;
 	uint32 procc;
-	CommandCallback* callback;
+	CommandCallback *callback;
 
 	char *text;
 	uint uid;
@@ -34,8 +36,8 @@
 	uint tick;              ///< The current tick (something like _frame_counter, only for AIs)
 };
 
-VARDEF AIStruct _ai;
-VARDEF AIPlayer _ai_player[MAX_PLAYERS];
+extern AIStruct _ai;
+extern AIPlayer _ai_player[MAX_PLAYERS];
 
 // ai.c
 void AI_StartNewAI(PlayerID player);
--- a/src/ai/default/default.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/ai/default/default.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,34 +4,39 @@
 #include "../../openttd.h"
 #include "../../aircraft.h"
 #include "../../bridge_map.h"
-#include "../../functions.h"
+#include "../../tile_cmd.h"
 #include "../../landscape.h"
-#include "../../map.h"
 #include "../../rail_map.h"
 #include "../../road_map.h"
 #include "../../roadveh.h"
 #include "../../station_map.h"
-#include "../../tile.h"
-#include "../../player.h"
 #include "../../tunnel_map.h"
-#include "../../vehicle.h"
 #include "../../engine.h"
-#include "../../command.h"
+#include "../../command_func.h"
 #include "../../town.h"
 #include "../../industry.h"
 #include "../../station.h"
 #include "../../pathfind.h"
-#include "../../economy.h"
 #include "../../airport.h"
 #include "../../depot.h"
 #include "../../variables.h"
 #include "../../bridge.h"
-#include "../../date.h"
-#include "../../helpers.hpp"
+#include "../../date_func.h"
+#include "../../tunnelbridge_map.h"
+#include "../../window_func.h"
+#include "../../vehicle_func.h"
+#include "../../functions.h"
+#include "../../saveload.h"
+#include "../../player_func.h"
+#include "../../player_base.h"
+#include "../../settings_type.h"
 #include "default.h"
 
+#include "../../table/ai_rail.h"
+
 // remove some day perhaps?
 static uint _ai_service_interval;
+PlayerAI _players_ai[MAX_PLAYERS];
 
 typedef void AiStateAction(Player *p);
 
@@ -63,8 +68,6 @@
 };
 
 
-#include "../../table/ai_rail.h"
-
 static TrackBits GetRailTrackStatus(TileIndex tile)
 {
 	uint32 r = GetTileTrackStatus(tile, TRANSPORT_RAIL, 0);
@@ -74,14 +77,14 @@
 
 static void AiCase0(Player *p)
 {
-	p->ai.state = AIS_REMOVE_TRACK;
-	p->ai.state_counter = 0;
+	_players_ai[p->index].state = AIS_REMOVE_TRACK;
+	_players_ai[p->index].state_counter = 0;
 }
 
 static void AiCase1(Player *p)
 {
-	p->ai.cur_veh = NULL;
-	p->ai.state = AIS_VEH_LOOP;
+	_players_ai[p->index].cur_veh = NULL;
+	_players_ai[p->index].state = AIS_VEH_LOOP;
 }
 
 static void AiStateVehLoop(Player *p)
@@ -89,7 +92,7 @@
 	Vehicle *v;
 	uint index;
 
-	index = (p->ai.cur_veh == NULL) ? 0 : p->ai.cur_veh->index + 1;
+	index = (_players_ai[p->index].cur_veh == NULL) ? 0 : _players_ai[p->index].cur_veh->index + 1;
 
 	FOR_ALL_VEHICLES_FROM(v, index) {
 		if (v->owner != _current_player) continue;
@@ -101,8 +104,8 @@
 			/* replace engine? */
 			if (v->type == VEH_TRAIN && v->engine_type < 3 &&
 					(_price.build_railvehicle >> 3) < p->player_money) {
-				p->ai.state = AIS_VEH_CHECK_REPLACE_VEHICLE;
-				p->ai.cur_veh = v;
+				_players_ai[p->index].state = AIS_VEH_CHECK_REPLACE_VEHICLE;
+				_players_ai[p->index].cur_veh = v;
 				return;
 			}
 
@@ -110,9 +113,9 @@
 			if (v->age >= 730 &&
 					v->profit_last_year < _price.station_value * 5 &&
 					v->profit_this_year < _price.station_value * 5) {
-				p->ai.state_counter = 0;
-				p->ai.state = AIS_SELL_VEHICLE;
-				p->ai.cur_veh = v;
+				_players_ai[p->index].state_counter = 0;
+				_players_ai[p->index].state = AIS_SELL_VEHICLE;
+				_players_ai[p->index].cur_veh = v;
 				return;
 			}
 
@@ -121,15 +124,15 @@
 						v->age != 0 &&
 						GetEngine(v->engine_type)->reliability < 35389
 					)) {
-				p->ai.state = AIS_VEH_CHECK_REPLACE_VEHICLE;
-				p->ai.cur_veh = v;
+				_players_ai[p->index].state = AIS_VEH_CHECK_REPLACE_VEHICLE;
+				_players_ai[p->index].cur_veh = v;
 				return;
 			}
 		}
 	}
 
-	p->ai.state = AIS_WANT_NEW_ROUTE;
-	p->ai.state_counter = 0;
+	_players_ai[p->index].state = AIS_WANT_NEW_ROUTE;
+	_players_ai[p->index].state_counter = 0;
 }
 
 static EngineID AiChooseTrainToBuild(RailType railtype, Money money, byte flag, TileIndex tile)
@@ -230,7 +233,7 @@
 	Money base = _price.station_value;
 
 	// adjust base price when more expensive vehicles are available
-	switch (p->ai.railtype_to_use) {
+	switch (_players_ai[p->index].railtype_to_use) {
 		default: NOT_REACHED();
 		case RAILTYPE_RAIL:     break;
 		case RAILTYPE_ELECTRIC: break;
@@ -277,26 +280,26 @@
 
 static void AiHandleGotoDepot(Player *p, int cmd)
 {
-	if (p->ai.cur_veh->current_order.type != OT_GOTO_DEPOT)
-		DoCommand(0, p->ai.cur_veh->index, 0, DC_EXEC, cmd);
-
-	if (++p->ai.state_counter <= 1387) {
-		p->ai.state = AIS_VEH_DO_REPLACE_VEHICLE;
+	if (_players_ai[p->index].cur_veh->current_order.type != OT_GOTO_DEPOT)
+		DoCommand(0, _players_ai[p->index].cur_veh->index, 0, DC_EXEC, cmd);
+
+	if (++_players_ai[p->index].state_counter <= 1387) {
+		_players_ai[p->index].state = AIS_VEH_DO_REPLACE_VEHICLE;
 		return;
 	}
 
-	if (p->ai.cur_veh->current_order.type == OT_GOTO_DEPOT) {
-		p->ai.cur_veh->current_order.type = OT_DUMMY;
-		p->ai.cur_veh->current_order.flags = 0;
-		InvalidateWindow(WC_VEHICLE_VIEW, p->ai.cur_veh->index);
+	if (_players_ai[p->index].cur_veh->current_order.type == OT_GOTO_DEPOT) {
+		_players_ai[p->index].cur_veh->current_order.type = OT_DUMMY;
+		_players_ai[p->index].cur_veh->current_order.flags = 0;
+		InvalidateWindow(WC_VEHICLE_VIEW, _players_ai[p->index].cur_veh->index);
 	}
 }
 
 static void AiRestoreVehicleOrders(Vehicle *v, BackuppedOrders *bak)
 {
-	uint i;
-
-	for (i = 0; bak->order[i].type != OT_NOTHING; i++) {
+	if (bak->order == NULL) return;
+
+	for (uint i = 0; bak->order[i].type != OT_NOTHING; i++) {
 		if (!DoCommandP(0, v->index + (i << 16), PackOrder(&bak->order[i]), NULL, CMD_INSERT_ORDER | CMD_NO_TEST_IF_IN_NETWORK))
 			break;
 	}
@@ -304,7 +307,7 @@
 
 static void AiHandleReplaceTrain(Player *p)
 {
-	const Vehicle* v = p->ai.cur_veh;
+	const Vehicle* v = _players_ai[p->index].cur_veh;
 	BackuppedOrders orderbak;
 	EngineID veh;
 
@@ -334,8 +337,8 @@
 
 static void AiHandleReplaceRoadVeh(Player *p)
 {
-	const Vehicle* v = p->ai.cur_veh;
-	BackuppedOrders orderbak[1];
+	const Vehicle* v = _players_ai[p->index].cur_veh;
+	BackuppedOrders orderbak;
 	EngineID veh;
 
 	if (!v->IsStoppedInDepot()) {
@@ -347,14 +350,14 @@
 	if (veh != INVALID_ENGINE) {
 		TileIndex tile;
 
-		BackupVehicleOrders(v, orderbak);
+		BackupVehicleOrders(v, &orderbak);
 		tile = v->tile;
 
 		if (CmdSucceeded(DoCommand(0, v->index, 0, DC_EXEC, CMD_SELL_ROAD_VEH)) &&
 				CmdSucceeded(DoCommand(tile, veh, 0, DC_EXEC, CMD_BUILD_ROAD_VEH))) {
 			VehicleID veh = _new_vehicle_id;
 
-			AiRestoreVehicleOrders(GetVehicle(veh), orderbak);
+			AiRestoreVehicleOrders(GetVehicle(veh), &orderbak);
 			DoCommand(0, veh, 0, DC_EXEC, CMD_START_STOP_ROADVEH);
 			DoCommand(0, veh, _ai_service_interval, DC_EXEC, CMD_CHANGE_SERVICE_INT);
 		}
@@ -363,8 +366,8 @@
 
 static void AiHandleReplaceAircraft(Player *p)
 {
-	const Vehicle* v = p->ai.cur_veh;
-	BackuppedOrders orderbak[1];
+	const Vehicle* v = _players_ai[p->index].cur_veh;
+	BackuppedOrders orderbak;
 	EngineID veh;
 
 	if (!v->IsStoppedInDepot()) {
@@ -376,13 +379,13 @@
 	if (veh != INVALID_ENGINE) {
 		TileIndex tile;
 
-		BackupVehicleOrders(v, orderbak);
+		BackupVehicleOrders(v, &orderbak);
 		tile = v->tile;
 
 		if (CmdSucceeded(DoCommand(0, v->index, 0, DC_EXEC, CMD_SELL_AIRCRAFT)) &&
 				CmdSucceeded(DoCommand(tile, veh, 0, DC_EXEC, CMD_BUILD_AIRCRAFT))) {
 			VehicleID veh = _new_vehicle_id;
-			AiRestoreVehicleOrders(GetVehicle(veh), orderbak);
+			AiRestoreVehicleOrders(GetVehicle(veh), &orderbak);
 			DoCommand(0, veh, 0, DC_EXEC, CMD_START_STOP_AIRCRAFT);
 
 			DoCommand(0, veh, _ai_service_interval, DC_EXEC, CMD_CHANGE_SERVICE_INT);
@@ -414,24 +417,24 @@
 
 static void AiStateCheckReplaceVehicle(Player *p)
 {
-	const Vehicle* v = p->ai.cur_veh;
+	const Vehicle* v = _players_ai[p->index].cur_veh;
 
 	if (!v->IsValid() ||
 			v->owner != _current_player ||
 			v->type > VEH_SHIP ||
 			_veh_check_replace_proc[v->type - VEH_TRAIN](p, v) == INVALID_ENGINE) {
-		p->ai.state = AIS_VEH_LOOP;
+		_players_ai[p->index].state = AIS_VEH_LOOP;
 	} else {
-		p->ai.state_counter = 0;
-		p->ai.state = AIS_VEH_DO_REPLACE_VEHICLE;
+		_players_ai[p->index].state_counter = 0;
+		_players_ai[p->index].state = AIS_VEH_DO_REPLACE_VEHICLE;
 	}
 }
 
 static void AiStateDoReplaceVehicle(Player *p)
 {
-	const Vehicle* v = p->ai.cur_veh;
-
-	p->ai.state = AIS_VEH_LOOP;
+	const Vehicle* v = _players_ai[p->index].cur_veh;
+
+	_players_ai[p->index].state = AIS_VEH_LOOP;
 	// vehicle is not owned by the player anymore, something went very wrong.
 	if (!v->IsValid() || v->owner != _current_player) return;
 	_veh_do_replace_proc[v->type - VEH_TRAIN](p);
@@ -641,8 +644,8 @@
 	/* Make sure distance to closest station is < min_distance tiles. */
 	if (dist != 0xFFFF && dist > min_distance) return false;
 
-	if (p->ai.route_type_mask != 0 &&
-			!(p->ai.route_type_mask & bitmask) &&
+	if (_players_ai[p->index].route_type_mask != 0 &&
+			!(_players_ai[p->index].route_type_mask & bitmask) &&
 			!Chance16(1, 5)) {
 		return false;
 	}
@@ -670,7 +673,7 @@
 		}
 	}
 
-	p->ai.route_type_mask |= bitmask;
+	_players_ai[p->index].route_type_mask |= bitmask;
 	return true;
 }
 
@@ -711,85 +714,85 @@
 	if (!AiCheckIfRouteIsGood(p, &fr, 1)) return;
 
 	// Fill the source field
-	p->ai.dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
-	p->ai.src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
-
-	p->ai.src.use_tile = 0;
-	p->ai.src.rand_rng = 9;
-	p->ai.src.cur_building_rule = 0xFF;
-	p->ai.src.unk6 = 1;
-	p->ai.src.unk7 = 0;
-	p->ai.src.buildcmd_a = 0x24;
-	p->ai.src.buildcmd_b = 0xFF;
-	p->ai.src.direction = AiGetDirectionBetweenTiles(
-		p->ai.src.spec_tile,
-		p->ai.dst.spec_tile
+	_players_ai[p->index].dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
+	_players_ai[p->index].src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
+
+	_players_ai[p->index].src.use_tile = 0;
+	_players_ai[p->index].src.rand_rng = 9;
+	_players_ai[p->index].src.cur_building_rule = 0xFF;
+	_players_ai[p->index].src.unk6 = 1;
+	_players_ai[p->index].src.unk7 = 0;
+	_players_ai[p->index].src.buildcmd_a = 0x24;
+	_players_ai[p->index].src.buildcmd_b = 0xFF;
+	_players_ai[p->index].src.direction = AiGetDirectionBetweenTiles(
+		_players_ai[p->index].src.spec_tile,
+		_players_ai[p->index].dst.spec_tile
 	);
-	p->ai.src.cargo = fr.cargo | 0x80;
+	_players_ai[p->index].src.cargo = fr.cargo | 0x80;
 
 	// Fill the dest field
 
-	p->ai.dst.use_tile = 0;
-	p->ai.dst.rand_rng = 9;
-	p->ai.dst.cur_building_rule = 0xFF;
-	p->ai.dst.unk6 = 1;
-	p->ai.dst.unk7 = 0;
-	p->ai.dst.buildcmd_a = 0x34;
-	p->ai.dst.buildcmd_b = 0xFF;
-	p->ai.dst.direction = AiGetDirectionBetweenTiles(
-		p->ai.dst.spec_tile,
-		p->ai.src.spec_tile
+	_players_ai[p->index].dst.use_tile = 0;
+	_players_ai[p->index].dst.rand_rng = 9;
+	_players_ai[p->index].dst.cur_building_rule = 0xFF;
+	_players_ai[p->index].dst.unk6 = 1;
+	_players_ai[p->index].dst.unk7 = 0;
+	_players_ai[p->index].dst.buildcmd_a = 0x34;
+	_players_ai[p->index].dst.buildcmd_b = 0xFF;
+	_players_ai[p->index].dst.direction = AiGetDirectionBetweenTiles(
+		_players_ai[p->index].dst.spec_tile,
+		_players_ai[p->index].src.spec_tile
 	);
-	p->ai.dst.cargo = fr.cargo;
+	_players_ai[p->index].dst.cargo = fr.cargo;
 
 	// Fill middle field 1
-	p->ai.mid1.spec_tile = AiGetPctTileBetween(
-		p->ai.src.spec_tile,
-		p->ai.dst.spec_tile,
+	_players_ai[p->index].mid1.spec_tile = AiGetPctTileBetween(
+		_players_ai[p->index].src.spec_tile,
+		_players_ai[p->index].dst.spec_tile,
 		0x55
 	);
-	p->ai.mid1.use_tile = 0;
-	p->ai.mid1.rand_rng = 6;
-	p->ai.mid1.cur_building_rule = 0xFF;
-	p->ai.mid1.unk6 = 2;
-	p->ai.mid1.unk7 = 1;
-	p->ai.mid1.buildcmd_a = 0x30;
-	p->ai.mid1.buildcmd_b = 0xFF;
-	p->ai.mid1.direction = p->ai.src.direction;
-	p->ai.mid1.cargo = fr.cargo;
+	_players_ai[p->index].mid1.use_tile = 0;
+	_players_ai[p->index].mid1.rand_rng = 6;
+	_players_ai[p->index].mid1.cur_building_rule = 0xFF;
+	_players_ai[p->index].mid1.unk6 = 2;
+	_players_ai[p->index].mid1.unk7 = 1;
+	_players_ai[p->index].mid1.buildcmd_a = 0x30;
+	_players_ai[p->index].mid1.buildcmd_b = 0xFF;
+	_players_ai[p->index].mid1.direction = _players_ai[p->index].src.direction;
+	_players_ai[p->index].mid1.cargo = fr.cargo;
 
 	// Fill middle field 2
-	p->ai.mid2.spec_tile = AiGetPctTileBetween(
-		p->ai.src.spec_tile,
-		p->ai.dst.spec_tile,
+	_players_ai[p->index].mid2.spec_tile = AiGetPctTileBetween(
+		_players_ai[p->index].src.spec_tile,
+		_players_ai[p->index].dst.spec_tile,
 		0xAA
 	);
-	p->ai.mid2.use_tile = 0;
-	p->ai.mid2.rand_rng = 6;
-	p->ai.mid2.cur_building_rule = 0xFF;
-	p->ai.mid2.unk6 = 2;
-	p->ai.mid2.unk7 = 1;
-	p->ai.mid2.buildcmd_a = 0xFF;
-	p->ai.mid2.buildcmd_b = 0xFF;
-	p->ai.mid2.direction = p->ai.dst.direction;
-	p->ai.mid2.cargo = fr.cargo;
+	_players_ai[p->index].mid2.use_tile = 0;
+	_players_ai[p->index].mid2.rand_rng = 6;
+	_players_ai[p->index].mid2.cur_building_rule = 0xFF;
+	_players_ai[p->index].mid2.unk6 = 2;
+	_players_ai[p->index].mid2.unk7 = 1;
+	_players_ai[p->index].mid2.buildcmd_a = 0xFF;
+	_players_ai[p->index].mid2.buildcmd_b = 0xFF;
+	_players_ai[p->index].mid2.direction = _players_ai[p->index].dst.direction;
+	_players_ai[p->index].mid2.cargo = fr.cargo;
 
 	// Fill common fields
-	p->ai.cargo_type = fr.cargo;
-	p->ai.num_wagons = 3;
-	p->ai.build_kind = 2;
-	p->ai.num_build_rec = 4;
-	p->ai.num_loco_to_build = 2;
-	p->ai.num_want_fullload = 2;
-	p->ai.wagon_list[0] = INVALID_VEHICLE;
-	p->ai.order_list_blocks[0] = 0;
-	p->ai.order_list_blocks[1] = 1;
-	p->ai.order_list_blocks[2] = 255;
-
-	p->ai.state = AIS_BUILD_DEFAULT_RAIL_BLOCKS;
-	p->ai.state_mode = UCHAR_MAX;
-	p->ai.state_counter = 0;
-	p->ai.timeout_counter = 0;
+	_players_ai[p->index].cargo_type = fr.cargo;
+	_players_ai[p->index].num_wagons = 3;
+	_players_ai[p->index].build_kind = 2;
+	_players_ai[p->index].num_build_rec = 4;
+	_players_ai[p->index].num_loco_to_build = 2;
+	_players_ai[p->index].num_want_fullload = 2;
+	_players_ai[p->index].wagon_list[0] = INVALID_VEHICLE;
+	_players_ai[p->index].order_list_blocks[0] = 0;
+	_players_ai[p->index].order_list_blocks[1] = 1;
+	_players_ai[p->index].order_list_blocks[2] = 255;
+
+	_players_ai[p->index].state = AIS_BUILD_DEFAULT_RAIL_BLOCKS;
+	_players_ai[p->index].state_mode = UCHAR_MAX;
+	_players_ai[p->index].state_counter = 0;
+	_players_ai[p->index].timeout_counter = 0;
 }
 
 static void AiWantMediumIndustryRoute(Player *p)
@@ -814,50 +817,50 @@
 	if (!AiCheckIfRouteIsGood(p, &fr, 1)) return;
 
 	// Fill the source field
-	p->ai.src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
-	p->ai.src.use_tile = 0;
-	p->ai.src.rand_rng = 9;
-	p->ai.src.cur_building_rule = 0xFF;
-	p->ai.src.unk6 = 1;
-	p->ai.src.unk7 = 0;
-	p->ai.src.buildcmd_a = 0x10;
-	p->ai.src.buildcmd_b = 0xFF;
-	p->ai.src.direction = AiGetDirectionBetweenTiles(
+	_players_ai[p->index].src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
+	_players_ai[p->index].src.use_tile = 0;
+	_players_ai[p->index].src.rand_rng = 9;
+	_players_ai[p->index].src.cur_building_rule = 0xFF;
+	_players_ai[p->index].src.unk6 = 1;
+	_players_ai[p->index].src.unk7 = 0;
+	_players_ai[p->index].src.buildcmd_a = 0x10;
+	_players_ai[p->index].src.buildcmd_b = 0xFF;
+	_players_ai[p->index].src.direction = AiGetDirectionBetweenTiles(
 		GET_TOWN_OR_INDUSTRY_TILE(fr.from),
 		GET_TOWN_OR_INDUSTRY_TILE(fr.to)
 	);
-	p->ai.src.cargo = fr.cargo | 0x80;
+	_players_ai[p->index].src.cargo = fr.cargo | 0x80;
 
 	// Fill the dest field
-	p->ai.dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
-	p->ai.dst.use_tile = 0;
-	p->ai.dst.rand_rng = 9;
-	p->ai.dst.cur_building_rule = 0xFF;
-	p->ai.dst.unk6 = 1;
-	p->ai.dst.unk7 = 0;
-	p->ai.dst.buildcmd_a = 0xFF;
-	p->ai.dst.buildcmd_b = 0xFF;
-	p->ai.dst.direction = AiGetDirectionBetweenTiles(
+	_players_ai[p->index].dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
+	_players_ai[p->index].dst.use_tile = 0;
+	_players_ai[p->index].dst.rand_rng = 9;
+	_players_ai[p->index].dst.cur_building_rule = 0xFF;
+	_players_ai[p->index].dst.unk6 = 1;
+	_players_ai[p->index].dst.unk7 = 0;
+	_players_ai[p->index].dst.buildcmd_a = 0xFF;
+	_players_ai[p->index].dst.buildcmd_b = 0xFF;
+	_players_ai[p->index].dst.direction = AiGetDirectionBetweenTiles(
 		GET_TOWN_OR_INDUSTRY_TILE(fr.to),
 		GET_TOWN_OR_INDUSTRY_TILE(fr.from)
 	);
-	p->ai.dst.cargo = fr.cargo;
+	_players_ai[p->index].dst.cargo = fr.cargo;
 
 	// Fill common fields
-	p->ai.cargo_type = fr.cargo;
-	p->ai.num_wagons = 3;
-	p->ai.build_kind = 1;
-	p->ai.num_build_rec = 2;
-	p->ai.num_loco_to_build = 1;
-	p->ai.num_want_fullload = 1;
-	p->ai.wagon_list[0] = INVALID_VEHICLE;
-	p->ai.order_list_blocks[0] = 0;
-	p->ai.order_list_blocks[1] = 1;
-	p->ai.order_list_blocks[2] = 255;
-	p->ai.state = AIS_BUILD_DEFAULT_RAIL_BLOCKS;
-	p->ai.state_mode = UCHAR_MAX;
-	p->ai.state_counter = 0;
-	p->ai.timeout_counter = 0;
+	_players_ai[p->index].cargo_type = fr.cargo;
+	_players_ai[p->index].num_wagons = 3;
+	_players_ai[p->index].build_kind = 1;
+	_players_ai[p->index].num_build_rec = 2;
+	_players_ai[p->index].num_loco_to_build = 1;
+	_players_ai[p->index].num_want_fullload = 1;
+	_players_ai[p->index].wagon_list[0] = INVALID_VEHICLE;
+	_players_ai[p->index].order_list_blocks[0] = 0;
+	_players_ai[p->index].order_list_blocks[1] = 1;
+	_players_ai[p->index].order_list_blocks[2] = 255;
+	_players_ai[p->index].state = AIS_BUILD_DEFAULT_RAIL_BLOCKS;
+	_players_ai[p->index].state_mode = UCHAR_MAX;
+	_players_ai[p->index].state_counter = 0;
+	_players_ai[p->index].timeout_counter = 0;
 }
 
 static void AiWantShortIndustryRoute(Player *p)
@@ -882,50 +885,50 @@
 	if (!AiCheckIfRouteIsGood(p, &fr, 1)) return;
 
 	// Fill the source field
-	p->ai.src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
-	p->ai.src.use_tile = 0;
-	p->ai.src.rand_rng = 9;
-	p->ai.src.cur_building_rule = 0xFF;
-	p->ai.src.unk6 = 1;
-	p->ai.src.unk7 = 0;
-	p->ai.src.buildcmd_a = 0x10;
-	p->ai.src.buildcmd_b = 0xFF;
-	p->ai.src.direction = AiGetDirectionBetweenTiles(
+	_players_ai[p->index].src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
+	_players_ai[p->index].src.use_tile = 0;
+	_players_ai[p->index].src.rand_rng = 9;
+	_players_ai[p->index].src.cur_building_rule = 0xFF;
+	_players_ai[p->index].src.unk6 = 1;
+	_players_ai[p->index].src.unk7 = 0;
+	_players_ai[p->index].src.buildcmd_a = 0x10;
+	_players_ai[p->index].src.buildcmd_b = 0xFF;
+	_players_ai[p->index].src.direction = AiGetDirectionBetweenTiles(
 		GET_TOWN_OR_INDUSTRY_TILE(fr.from),
 		GET_TOWN_OR_INDUSTRY_TILE(fr.to)
 	);
-	p->ai.src.cargo = fr.cargo | 0x80;
+	_players_ai[p->index].src.cargo = fr.cargo | 0x80;
 
 	// Fill the dest field
-	p->ai.dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
-	p->ai.dst.use_tile = 0;
-	p->ai.dst.rand_rng = 9;
-	p->ai.dst.cur_building_rule = 0xFF;
-	p->ai.dst.unk6 = 1;
-	p->ai.dst.unk7 = 0;
-	p->ai.dst.buildcmd_a = 0xFF;
-	p->ai.dst.buildcmd_b = 0xFF;
-	p->ai.dst.direction = AiGetDirectionBetweenTiles(
+	_players_ai[p->index].dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
+	_players_ai[p->index].dst.use_tile = 0;
+	_players_ai[p->index].dst.rand_rng = 9;
+	_players_ai[p->index].dst.cur_building_rule = 0xFF;
+	_players_ai[p->index].dst.unk6 = 1;
+	_players_ai[p->index].dst.unk7 = 0;
+	_players_ai[p->index].dst.buildcmd_a = 0xFF;
+	_players_ai[p->index].dst.buildcmd_b = 0xFF;
+	_players_ai[p->index].dst.direction = AiGetDirectionBetweenTiles(
 		GET_TOWN_OR_INDUSTRY_TILE(fr.to),
 		GET_TOWN_OR_INDUSTRY_TILE(fr.from)
 	);
-	p->ai.dst.cargo = fr.cargo;
+	_players_ai[p->index].dst.cargo = fr.cargo;
 
 	// Fill common fields
-	p->ai.cargo_type = fr.cargo;
-	p->ai.num_wagons = 2;
-	p->ai.build_kind = 1;
-	p->ai.num_build_rec = 2;
-	p->ai.num_loco_to_build = 1;
-	p->ai.num_want_fullload = 1;
-	p->ai.wagon_list[0] = INVALID_VEHICLE;
-	p->ai.order_list_blocks[0] = 0;
-	p->ai.order_list_blocks[1] = 1;
-	p->ai.order_list_blocks[2] = 255;
-	p->ai.state = AIS_BUILD_DEFAULT_RAIL_BLOCKS;
-	p->ai.state_mode = UCHAR_MAX;
-	p->ai.state_counter = 0;
-	p->ai.timeout_counter = 0;
+	_players_ai[p->index].cargo_type = fr.cargo;
+	_players_ai[p->index].num_wagons = 2;
+	_players_ai[p->index].build_kind = 1;
+	_players_ai[p->index].num_build_rec = 2;
+	_players_ai[p->index].num_loco_to_build = 1;
+	_players_ai[p->index].num_want_fullload = 1;
+	_players_ai[p->index].wagon_list[0] = INVALID_VEHICLE;
+	_players_ai[p->index].order_list_blocks[0] = 0;
+	_players_ai[p->index].order_list_blocks[1] = 1;
+	_players_ai[p->index].order_list_blocks[2] = 255;
+	_players_ai[p->index].state = AIS_BUILD_DEFAULT_RAIL_BLOCKS;
+	_players_ai[p->index].state_mode = UCHAR_MAX;
+	_players_ai[p->index].state_counter = 0;
+	_players_ai[p->index].timeout_counter = 0;
 }
 
 static void AiWantMailRoute(Player *p)
@@ -951,82 +954,82 @@
 	if (!AiCheckIfRouteIsGood(p, &fr, 1)) return;
 
 	// Fill the source field
-	p->ai.src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
-	p->ai.src.use_tile = 0;
-	p->ai.src.rand_rng = 7;
-	p->ai.src.cur_building_rule = 0xFF;
-	p->ai.src.unk6 = 1;
-	p->ai.src.unk7 = 0;
-	p->ai.src.buildcmd_a = 0x24;
-	p->ai.src.buildcmd_b = 0xFF;
-	p->ai.src.direction = AiGetDirectionBetweenTiles(
+	_players_ai[p->index].src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
+	_players_ai[p->index].src.use_tile = 0;
+	_players_ai[p->index].src.rand_rng = 7;
+	_players_ai[p->index].src.cur_building_rule = 0xFF;
+	_players_ai[p->index].src.unk6 = 1;
+	_players_ai[p->index].src.unk7 = 0;
+	_players_ai[p->index].src.buildcmd_a = 0x24;
+	_players_ai[p->index].src.buildcmd_b = 0xFF;
+	_players_ai[p->index].src.direction = AiGetDirectionBetweenTiles(
 		GET_TOWN_OR_INDUSTRY_TILE(fr.from),
 		GET_TOWN_OR_INDUSTRY_TILE(fr.to)
 	);
-	p->ai.src.cargo = fr.cargo;
+	_players_ai[p->index].src.cargo = fr.cargo;
 
 	// Fill the dest field
-	p->ai.dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
-	p->ai.dst.use_tile = 0;
-	p->ai.dst.rand_rng = 7;
-	p->ai.dst.cur_building_rule = 0xFF;
-	p->ai.dst.unk6 = 1;
-	p->ai.dst.unk7 = 0;
-	p->ai.dst.buildcmd_a = 0x34;
-	p->ai.dst.buildcmd_b = 0xFF;
-	p->ai.dst.direction = AiGetDirectionBetweenTiles(
+	_players_ai[p->index].dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
+	_players_ai[p->index].dst.use_tile = 0;
+	_players_ai[p->index].dst.rand_rng = 7;
+	_players_ai[p->index].dst.cur_building_rule = 0xFF;
+	_players_ai[p->index].dst.unk6 = 1;
+	_players_ai[p->index].dst.unk7 = 0;
+	_players_ai[p->index].dst.buildcmd_a = 0x34;
+	_players_ai[p->index].dst.buildcmd_b = 0xFF;
+	_players_ai[p->index].dst.direction = AiGetDirectionBetweenTiles(
 		GET_TOWN_OR_INDUSTRY_TILE(fr.to),
 		GET_TOWN_OR_INDUSTRY_TILE(fr.from)
 	);
-	p->ai.dst.cargo = fr.cargo;
+	_players_ai[p->index].dst.cargo = fr.cargo;
 
 	// Fill middle field 1
-	p->ai.mid1.spec_tile = AiGetPctTileBetween(
+	_players_ai[p->index].mid1.spec_tile = AiGetPctTileBetween(
 		GET_TOWN_OR_INDUSTRY_TILE(fr.from),
 		GET_TOWN_OR_INDUSTRY_TILE(fr.to),
 		0x55
 	);
-	p->ai.mid1.use_tile = 0;
-	p->ai.mid1.rand_rng = 6;
-	p->ai.mid1.cur_building_rule = 0xFF;
-	p->ai.mid1.unk6 = 2;
-	p->ai.mid1.unk7 = 1;
-	p->ai.mid1.buildcmd_a = 0x30;
-	p->ai.mid1.buildcmd_b = 0xFF;
-	p->ai.mid1.direction = p->ai.src.direction;
-	p->ai.mid1.cargo = fr.cargo;
+	_players_ai[p->index].mid1.use_tile = 0;
+	_players_ai[p->index].mid1.rand_rng = 6;
+	_players_ai[p->index].mid1.cur_building_rule = 0xFF;
+	_players_ai[p->index].mid1.unk6 = 2;
+	_players_ai[p->index].mid1.unk7 = 1;
+	_players_ai[p->index].mid1.buildcmd_a = 0x30;
+	_players_ai[p->index].mid1.buildcmd_b = 0xFF;
+	_players_ai[p->index].mid1.direction = _players_ai[p->index].src.direction;
+	_players_ai[p->index].mid1.cargo = fr.cargo;
 
 	// Fill middle field 2
-	p->ai.mid2.spec_tile = AiGetPctTileBetween(
+	_players_ai[p->index].mid2.spec_tile = AiGetPctTileBetween(
 		GET_TOWN_OR_INDUSTRY_TILE(fr.from),
 		GET_TOWN_OR_INDUSTRY_TILE(fr.to),
 		0xAA
 	);
-	p->ai.mid2.use_tile = 0;
-	p->ai.mid2.rand_rng = 6;
-	p->ai.mid2.cur_building_rule = 0xFF;
-	p->ai.mid2.unk6 = 2;
-	p->ai.mid2.unk7 = 1;
-	p->ai.mid2.buildcmd_a = 0xFF;
-	p->ai.mid2.buildcmd_b = 0xFF;
-	p->ai.mid2.direction = p->ai.dst.direction;
-	p->ai.mid2.cargo = fr.cargo;
+	_players_ai[p->index].mid2.use_tile = 0;
+	_players_ai[p->index].mid2.rand_rng = 6;
+	_players_ai[p->index].mid2.cur_building_rule = 0xFF;
+	_players_ai[p->index].mid2.unk6 = 2;
+	_players_ai[p->index].mid2.unk7 = 1;
+	_players_ai[p->index].mid2.buildcmd_a = 0xFF;
+	_players_ai[p->index].mid2.buildcmd_b = 0xFF;
+	_players_ai[p->index].mid2.direction = _players_ai[p->index].dst.direction;
+	_players_ai[p->index].mid2.cargo = fr.cargo;
 
 	// Fill common fields
-	p->ai.cargo_type = fr.cargo;
-	p->ai.num_wagons = 3;
-	p->ai.build_kind = 2;
-	p->ai.num_build_rec = 4;
-	p->ai.num_loco_to_build = 2;
-	p->ai.num_want_fullload = 0;
-	p->ai.wagon_list[0] = INVALID_VEHICLE;
-	p->ai.order_list_blocks[0] = 0;
-	p->ai.order_list_blocks[1] = 1;
-	p->ai.order_list_blocks[2] = 255;
-	p->ai.state = AIS_BUILD_DEFAULT_RAIL_BLOCKS;
-	p->ai.state_mode = UCHAR_MAX;
-	p->ai.state_counter = 0;
-	p->ai.timeout_counter = 0;
+	_players_ai[p->index].cargo_type = fr.cargo;
+	_players_ai[p->index].num_wagons = 3;
+	_players_ai[p->index].build_kind = 2;
+	_players_ai[p->index].num_build_rec = 4;
+	_players_ai[p->index].num_loco_to_build = 2;
+	_players_ai[p->index].num_want_fullload = 0;
+	_players_ai[p->index].wagon_list[0] = INVALID_VEHICLE;
+	_players_ai[p->index].order_list_blocks[0] = 0;
+	_players_ai[p->index].order_list_blocks[1] = 1;
+	_players_ai[p->index].order_list_blocks[2] = 255;
+	_players_ai[p->index].state = AIS_BUILD_DEFAULT_RAIL_BLOCKS;
+	_players_ai[p->index].state_mode = UCHAR_MAX;
+	_players_ai[p->index].state_counter = 0;
+	_players_ai[p->index].timeout_counter = 0;
 }
 
 static void AiWantPassengerRoute(Player *p)
@@ -1052,57 +1055,57 @@
 	if (!AiCheckIfRouteIsGood(p, &fr, 1)) return;
 
 	// Fill the source field
-	p->ai.src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
-	p->ai.src.use_tile = 0;
-	p->ai.src.rand_rng = 7;
-	p->ai.src.cur_building_rule = 0xFF;
-	p->ai.src.unk6 = 1;
-	p->ai.src.unk7 = 0;
-	p->ai.src.buildcmd_a = 0x10;
-	p->ai.src.buildcmd_b = 0xFF;
-	p->ai.src.direction = AiGetDirectionBetweenTiles(
+	_players_ai[p->index].src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
+	_players_ai[p->index].src.use_tile = 0;
+	_players_ai[p->index].src.rand_rng = 7;
+	_players_ai[p->index].src.cur_building_rule = 0xFF;
+	_players_ai[p->index].src.unk6 = 1;
+	_players_ai[p->index].src.unk7 = 0;
+	_players_ai[p->index].src.buildcmd_a = 0x10;
+	_players_ai[p->index].src.buildcmd_b = 0xFF;
+	_players_ai[p->index].src.direction = AiGetDirectionBetweenTiles(
 		GET_TOWN_OR_INDUSTRY_TILE(fr.from),
 		GET_TOWN_OR_INDUSTRY_TILE(fr.to)
 	);
-	p->ai.src.cargo = fr.cargo;
+	_players_ai[p->index].src.cargo = fr.cargo;
 
 	// Fill the dest field
-	p->ai.dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
-	p->ai.dst.use_tile = 0;
-	p->ai.dst.rand_rng = 7;
-	p->ai.dst.cur_building_rule = 0xFF;
-	p->ai.dst.unk6 = 1;
-	p->ai.dst.unk7 = 0;
-	p->ai.dst.buildcmd_a = 0xFF;
-	p->ai.dst.buildcmd_b = 0xFF;
-	p->ai.dst.direction = AiGetDirectionBetweenTiles(
+	_players_ai[p->index].dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
+	_players_ai[p->index].dst.use_tile = 0;
+	_players_ai[p->index].dst.rand_rng = 7;
+	_players_ai[p->index].dst.cur_building_rule = 0xFF;
+	_players_ai[p->index].dst.unk6 = 1;
+	_players_ai[p->index].dst.unk7 = 0;
+	_players_ai[p->index].dst.buildcmd_a = 0xFF;
+	_players_ai[p->index].dst.buildcmd_b = 0xFF;
+	_players_ai[p->index].dst.direction = AiGetDirectionBetweenTiles(
 		GET_TOWN_OR_INDUSTRY_TILE(fr.to),
 		GET_TOWN_OR_INDUSTRY_TILE(fr.from)
 	);
-	p->ai.dst.cargo = fr.cargo;
+	_players_ai[p->index].dst.cargo = fr.cargo;
 
 	// Fill common fields
-	p->ai.cargo_type = fr.cargo;
-	p->ai.num_wagons = 2;
-	p->ai.build_kind = 1;
-	p->ai.num_build_rec = 2;
-	p->ai.num_loco_to_build = 1;
-	p->ai.num_want_fullload = 0;
-	p->ai.wagon_list[0] = INVALID_VEHICLE;
-	p->ai.order_list_blocks[0] = 0;
-	p->ai.order_list_blocks[1] = 1;
-	p->ai.order_list_blocks[2] = 255;
-	p->ai.state = AIS_BUILD_DEFAULT_RAIL_BLOCKS;
-	p->ai.state_mode = UCHAR_MAX;
-	p->ai.state_counter = 0;
-	p->ai.timeout_counter = 0;
+	_players_ai[p->index].cargo_type = fr.cargo;
+	_players_ai[p->index].num_wagons = 2;
+	_players_ai[p->index].build_kind = 1;
+	_players_ai[p->index].num_build_rec = 2;
+	_players_ai[p->index].num_loco_to_build = 1;
+	_players_ai[p->index].num_want_fullload = 0;
+	_players_ai[p->index].wagon_list[0] = INVALID_VEHICLE;
+	_players_ai[p->index].order_list_blocks[0] = 0;
+	_players_ai[p->index].order_list_blocks[1] = 1;
+	_players_ai[p->index].order_list_blocks[2] = 255;
+	_players_ai[p->index].state = AIS_BUILD_DEFAULT_RAIL_BLOCKS;
+	_players_ai[p->index].state_mode = UCHAR_MAX;
+	_players_ai[p->index].state_counter = 0;
+	_players_ai[p->index].timeout_counter = 0;
 }
 
 static void AiWantTrainRoute(Player *p)
 {
 	uint16 r = GB(Random(), 0, 16);
 
-	p->ai.railtype_to_use = GetBestRailtype(p);
+	_players_ai[p->index].railtype_to_use = GetBestRailtype(p->index);
 
 	if (r > 0xD000) {
 		AiWantLongIndustryRoute(p);
@@ -1139,38 +1142,38 @@
 	if (!AiCheckIfRouteIsGood(p, &fr, 2)) return;
 
 	// Fill the source field
-	p->ai.src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
-	p->ai.src.use_tile = 0;
-	p->ai.src.rand_rng = 9;
-	p->ai.src.cur_building_rule = 0xFF;
-	p->ai.src.buildcmd_a = 1;
-	p->ai.src.direction = 0;
-	p->ai.src.cargo = fr.cargo | 0x80;
+	_players_ai[p->index].src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
+	_players_ai[p->index].src.use_tile = 0;
+	_players_ai[p->index].src.rand_rng = 9;
+	_players_ai[p->index].src.cur_building_rule = 0xFF;
+	_players_ai[p->index].src.buildcmd_a = 1;
+	_players_ai[p->index].src.direction = 0;
+	_players_ai[p->index].src.cargo = fr.cargo | 0x80;
 
 	// Fill the dest field
-	p->ai.dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
-	p->ai.dst.use_tile = 0;
-	p->ai.dst.rand_rng = 9;
-	p->ai.dst.cur_building_rule = 0xFF;
-	p->ai.dst.buildcmd_a = 0xFF;
-	p->ai.dst.direction = 0;
-	p->ai.dst.cargo = fr.cargo;
+	_players_ai[p->index].dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
+	_players_ai[p->index].dst.use_tile = 0;
+	_players_ai[p->index].dst.rand_rng = 9;
+	_players_ai[p->index].dst.cur_building_rule = 0xFF;
+	_players_ai[p->index].dst.buildcmd_a = 0xFF;
+	_players_ai[p->index].dst.direction = 0;
+	_players_ai[p->index].dst.cargo = fr.cargo;
 
 	// Fill common fields
-	p->ai.cargo_type = fr.cargo;
-	p->ai.num_build_rec = 2;
-	p->ai.num_loco_to_build = 5;
-	p->ai.num_want_fullload = 5;
-
-//	p->ai.loco_id = INVALID_VEHICLE;
-	p->ai.order_list_blocks[0] = 0;
-	p->ai.order_list_blocks[1] = 1;
-	p->ai.order_list_blocks[2] = 255;
-
-	p->ai.state = AIS_BUILD_DEFAULT_ROAD_BLOCKS;
-	p->ai.state_mode = UCHAR_MAX;
-	p->ai.state_counter = 0;
-	p->ai.timeout_counter = 0;
+	_players_ai[p->index].cargo_type = fr.cargo;
+	_players_ai[p->index].num_build_rec = 2;
+	_players_ai[p->index].num_loco_to_build = 5;
+	_players_ai[p->index].num_want_fullload = 5;
+
+//	_players_ai[p->index].loco_id = INVALID_VEHICLE;
+	_players_ai[p->index].order_list_blocks[0] = 0;
+	_players_ai[p->index].order_list_blocks[1] = 1;
+	_players_ai[p->index].order_list_blocks[2] = 255;
+
+	_players_ai[p->index].state = AIS_BUILD_DEFAULT_ROAD_BLOCKS;
+	_players_ai[p->index].state_mode = UCHAR_MAX;
+	_players_ai[p->index].state_counter = 0;
+	_players_ai[p->index].timeout_counter = 0;
 }
 
 static void AiWantMediumRoadIndustryRoute(Player *p)
@@ -1195,38 +1198,38 @@
 	if (!AiCheckIfRouteIsGood(p, &fr, 2)) return;
 
 	// Fill the source field
-	p->ai.src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
-	p->ai.src.use_tile = 0;
-	p->ai.src.rand_rng = 9;
-	p->ai.src.cur_building_rule = 0xFF;
-	p->ai.src.buildcmd_a = 1;
-	p->ai.src.direction = 0;
-	p->ai.src.cargo = fr.cargo | 0x80;
+	_players_ai[p->index].src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
+	_players_ai[p->index].src.use_tile = 0;
+	_players_ai[p->index].src.rand_rng = 9;
+	_players_ai[p->index].src.cur_building_rule = 0xFF;
+	_players_ai[p->index].src.buildcmd_a = 1;
+	_players_ai[p->index].src.direction = 0;
+	_players_ai[p->index].src.cargo = fr.cargo | 0x80;
 
 	// Fill the dest field
-	p->ai.dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
-	p->ai.dst.use_tile = 0;
-	p->ai.dst.rand_rng = 9;
-	p->ai.dst.cur_building_rule = 0xFF;
-	p->ai.dst.buildcmd_a = 0xFF;
-	p->ai.dst.direction = 0;
-	p->ai.dst.cargo = fr.cargo;
+	_players_ai[p->index].dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
+	_players_ai[p->index].dst.use_tile = 0;
+	_players_ai[p->index].dst.rand_rng = 9;
+	_players_ai[p->index].dst.cur_building_rule = 0xFF;
+	_players_ai[p->index].dst.buildcmd_a = 0xFF;
+	_players_ai[p->index].dst.direction = 0;
+	_players_ai[p->index].dst.cargo = fr.cargo;
 
 	// Fill common fields
-	p->ai.cargo_type = fr.cargo;
-	p->ai.num_build_rec = 2;
-	p->ai.num_loco_to_build = 3;
-	p->ai.num_want_fullload = 3;
-
-//	p->ai.loco_id = INVALID_VEHICLE;
-	p->ai.order_list_blocks[0] = 0;
-	p->ai.order_list_blocks[1] = 1;
-	p->ai.order_list_blocks[2] = 255;
-
-	p->ai.state = AIS_BUILD_DEFAULT_ROAD_BLOCKS;
-	p->ai.state_mode = UCHAR_MAX;
-	p->ai.state_counter = 0;
-	p->ai.timeout_counter = 0;
+	_players_ai[p->index].cargo_type = fr.cargo;
+	_players_ai[p->index].num_build_rec = 2;
+	_players_ai[p->index].num_loco_to_build = 3;
+	_players_ai[p->index].num_want_fullload = 3;
+
+//	_players_ai[p->index].loco_id = INVALID_VEHICLE;
+	_players_ai[p->index].order_list_blocks[0] = 0;
+	_players_ai[p->index].order_list_blocks[1] = 1;
+	_players_ai[p->index].order_list_blocks[2] = 255;
+
+	_players_ai[p->index].state = AIS_BUILD_DEFAULT_ROAD_BLOCKS;
+	_players_ai[p->index].state_mode = UCHAR_MAX;
+	_players_ai[p->index].state_counter = 0;
+	_players_ai[p->index].timeout_counter = 0;
 }
 
 static void AiWantLongRoadPassengerRoute(Player *p)
@@ -1253,38 +1256,38 @@
 	if (!AiCheckIfRouteIsGood(p, &fr, 2)) return;
 
 	// Fill the source field
-	p->ai.src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
-	p->ai.src.use_tile = 0;
-	p->ai.src.rand_rng = 10;
-	p->ai.src.cur_building_rule = 0xFF;
-	p->ai.src.buildcmd_a = 1;
-	p->ai.src.direction = 0;
-	p->ai.src.cargo = CT_PASSENGERS;
+	_players_ai[p->index].src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
+	_players_ai[p->index].src.use_tile = 0;
+	_players_ai[p->index].src.rand_rng = 10;
+	_players_ai[p->index].src.cur_building_rule = 0xFF;
+	_players_ai[p->index].src.buildcmd_a = 1;
+	_players_ai[p->index].src.direction = 0;
+	_players_ai[p->index].src.cargo = CT_PASSENGERS;
 
 	// Fill the dest field
-	p->ai.dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
-	p->ai.dst.use_tile = 0;
-	p->ai.dst.rand_rng = 10;
-	p->ai.dst.cur_building_rule = 0xFF;
-	p->ai.dst.buildcmd_a = 0xFF;
-	p->ai.dst.direction = 0;
-	p->ai.dst.cargo = CT_PASSENGERS;
+	_players_ai[p->index].dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
+	_players_ai[p->index].dst.use_tile = 0;
+	_players_ai[p->index].dst.rand_rng = 10;
+	_players_ai[p->index].dst.cur_building_rule = 0xFF;
+	_players_ai[p->index].dst.buildcmd_a = 0xFF;
+	_players_ai[p->index].dst.direction = 0;
+	_players_ai[p->index].dst.cargo = CT_PASSENGERS;
 
 	// Fill common fields
-	p->ai.cargo_type = CT_PASSENGERS;
-	p->ai.num_build_rec = 2;
-	p->ai.num_loco_to_build = 4;
-	p->ai.num_want_fullload = 0;
-
-//	p->ai.loco_id = INVALID_VEHICLE;
-	p->ai.order_list_blocks[0] = 0;
-	p->ai.order_list_blocks[1] = 1;
-	p->ai.order_list_blocks[2] = 255;
-
-	p->ai.state = AIS_BUILD_DEFAULT_ROAD_BLOCKS;
-	p->ai.state_mode = UCHAR_MAX;
-	p->ai.state_counter = 0;
-	p->ai.timeout_counter = 0;
+	_players_ai[p->index].cargo_type = CT_PASSENGERS;
+	_players_ai[p->index].num_build_rec = 2;
+	_players_ai[p->index].num_loco_to_build = 4;
+	_players_ai[p->index].num_want_fullload = 0;
+
+//	_players_ai[p->index].loco_id = INVALID_VEHICLE;
+	_players_ai[p->index].order_list_blocks[0] = 0;
+	_players_ai[p->index].order_list_blocks[1] = 1;
+	_players_ai[p->index].order_list_blocks[2] = 255;
+
+	_players_ai[p->index].state = AIS_BUILD_DEFAULT_ROAD_BLOCKS;
+	_players_ai[p->index].state_mode = UCHAR_MAX;
+	_players_ai[p->index].state_counter = 0;
+	_players_ai[p->index].timeout_counter = 0;
 }
 
 static void AiWantPassengerRouteInsideTown(Player *p)
@@ -1309,38 +1312,38 @@
 	if (!AiCheckIfRouteIsGood(p, &fr, 2)) return;
 
 	// Fill the source field
-	p->ai.src.spec_tile = t->xy;
-	p->ai.src.use_tile = 0;
-	p->ai.src.rand_rng = 10;
-	p->ai.src.cur_building_rule = 0xFF;
-	p->ai.src.buildcmd_a = 1;
-	p->ai.src.direction = 0;
-	p->ai.src.cargo = CT_PASSENGERS;
+	_players_ai[p->index].src.spec_tile = t->xy;
+	_players_ai[p->index].src.use_tile = 0;
+	_players_ai[p->index].src.rand_rng = 10;
+	_players_ai[p->index].src.cur_building_rule = 0xFF;
+	_players_ai[p->index].src.buildcmd_a = 1;
+	_players_ai[p->index].src.direction = 0;
+	_players_ai[p->index].src.cargo = CT_PASSENGERS;
 
 	// Fill the dest field
-	p->ai.dst.spec_tile = t->xy;
-	p->ai.dst.use_tile = 0;
-	p->ai.dst.rand_rng = 10;
-	p->ai.dst.cur_building_rule = 0xFF;
-	p->ai.dst.buildcmd_a = 0xFF;
-	p->ai.dst.direction = 0;
-	p->ai.dst.cargo = CT_PASSENGERS;
+	_players_ai[p->index].dst.spec_tile = t->xy;
+	_players_ai[p->index].dst.use_tile = 0;
+	_players_ai[p->index].dst.rand_rng = 10;
+	_players_ai[p->index].dst.cur_building_rule = 0xFF;
+	_players_ai[p->index].dst.buildcmd_a = 0xFF;
+	_players_ai[p->index].dst.direction = 0;
+	_players_ai[p->index].dst.cargo = CT_PASSENGERS;
 
 	// Fill common fields
-	p->ai.cargo_type = CT_PASSENGERS;
-	p->ai.num_build_rec = 2;
-	p->ai.num_loco_to_build = 2;
-	p->ai.num_want_fullload = 0;
-
-//	p->ai.loco_id = INVALID_VEHICLE;
-	p->ai.order_list_blocks[0] = 0;
-	p->ai.order_list_blocks[1] = 1;
-	p->ai.order_list_blocks[2] = 255;
-
-	p->ai.state = AIS_BUILD_DEFAULT_ROAD_BLOCKS;
-	p->ai.state_mode = UCHAR_MAX;
-	p->ai.state_counter = 0;
-	p->ai.timeout_counter = 0;
+	_players_ai[p->index].cargo_type = CT_PASSENGERS;
+	_players_ai[p->index].num_build_rec = 2;
+	_players_ai[p->index].num_loco_to_build = 2;
+	_players_ai[p->index].num_want_fullload = 0;
+
+//	_players_ai[p->index].loco_id = INVALID_VEHICLE;
+	_players_ai[p->index].order_list_blocks[0] = 0;
+	_players_ai[p->index].order_list_blocks[1] = 1;
+	_players_ai[p->index].order_list_blocks[2] = 255;
+
+	_players_ai[p->index].state = AIS_BUILD_DEFAULT_ROAD_BLOCKS;
+	_players_ai[p->index].state_mode = UCHAR_MAX;
+	_players_ai[p->index].state_counter = 0;
+	_players_ai[p->index].timeout_counter = 0;
 }
 
 static void AiWantRoadRoute(Player *p)
@@ -1366,7 +1369,7 @@
 	/* Get aircraft that would be bought for this route
 	 * (probably, as conditions may change before the route is fully built,
 	 * like running out of money and having to select different aircraft, etc ...) */
-	EngineID veh = AiChooseAircraftToBuild(p->player_money, p->ai.build_kind != 0 ? 0 : AIR_CTOL);
+	EngineID veh = AiChooseAircraftToBuild(p->player_money, _players_ai[p->index].build_kind != 0 ? 0 : AIR_CTOL);
 
 	/* No aircraft buildable mean no aircraft route */
 	if (veh == INVALID_ENGINE) return;
@@ -1422,24 +1425,24 @@
 
 
 	// Fill the source field
-	p->ai.src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
-	p->ai.src.use_tile = 0;
-	p->ai.src.rand_rng = 12;
-	p->ai.src.cur_building_rule = 0xFF;
-	p->ai.src.cargo = fr.cargo;
+	_players_ai[p->index].src.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.to);
+	_players_ai[p->index].src.use_tile = 0;
+	_players_ai[p->index].src.rand_rng = 12;
+	_players_ai[p->index].src.cur_building_rule = 0xFF;
+	_players_ai[p->index].src.cargo = fr.cargo;
 
 	// Fill the dest field
-	p->ai.dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
-	p->ai.dst.use_tile = 0;
-	p->ai.dst.rand_rng = 12;
-	p->ai.dst.cur_building_rule = 0xFF;
-	p->ai.dst.cargo = fr.cargo;
+	_players_ai[p->index].dst.spec_tile = GET_TOWN_OR_INDUSTRY_TILE(fr.from);
+	_players_ai[p->index].dst.use_tile = 0;
+	_players_ai[p->index].dst.rand_rng = 12;
+	_players_ai[p->index].dst.cur_building_rule = 0xFF;
+	_players_ai[p->index].dst.cargo = fr.cargo;
 
 	// Fill common fields
-	p->ai.cargo_type = fr.cargo;
-	p->ai.build_kind = 0;
-	p->ai.num_build_rec = 2;
-	p->ai.num_loco_to_build = 1;
+	_players_ai[p->index].cargo_type = fr.cargo;
+	_players_ai[p->index].build_kind = 0;
+	_players_ai[p->index].num_build_rec = 2;
+	_players_ai[p->index].num_loco_to_build = 1;
 	/* Using full load always may not be the best.
 	 * Pick random value and rely on selling the vehicle & route
 	 * afterwards if the choice was utterly wrong (or maybe altering the value if AI is improved)
@@ -1452,14 +1455,14 @@
 	 * Also, non-full load is more resistant against starving (by building better stations
 	 * or using exclusive rights)
 	 */
-	p->ai.num_want_fullload = Chance16(1, 5); // 20% chance
-//	p->ai.loco_id = INVALID_VEHICLE;
-	p->ai.order_list_blocks[0] = 0;
-	p->ai.order_list_blocks[1] = 1;
-	p->ai.order_list_blocks[2] = 255;
-
-	p->ai.state = AIS_AIRPORT_STUFF;
-	p->ai.timeout_counter = 0;
+	_players_ai[p->index].num_want_fullload = Chance16(1, 5); // 20% chance
+//	_players_ai[p->index].loco_id = INVALID_VEHICLE;
+	_players_ai[p->index].order_list_blocks[0] = 0;
+	_players_ai[p->index].order_list_blocks[1] = 1;
+	_players_ai[p->index].order_list_blocks[2] = 255;
+
+	_players_ai[p->index].state = AIS_AIRPORT_STUFF;
+	_players_ai[p->index].timeout_counter = 0;
 }
 
 static void AiWantOilRigAircraftRoute(Player *p)
@@ -1492,32 +1495,32 @@
 	if (!AiCheckIfRouteIsGood(p, &fr, 4)) return;
 
 	// Fill the source field
-	p->ai.src.spec_tile = t->xy;
-	p->ai.src.use_tile = 0;
-	p->ai.src.rand_rng = 12;
-	p->ai.src.cur_building_rule = 0xFF;
-	p->ai.src.cargo = CT_PASSENGERS;
+	_players_ai[p->index].src.spec_tile = t->xy;
+	_players_ai[p->index].src.use_tile = 0;
+	_players_ai[p->index].src.rand_rng = 12;
+	_players_ai[p->index].src.cur_building_rule = 0xFF;
+	_players_ai[p->index].src.cargo = CT_PASSENGERS;
 
 	// Fill the dest field
-	p->ai.dst.spec_tile = in->xy;
-	p->ai.dst.use_tile = 0;
-	p->ai.dst.rand_rng = 5;
-	p->ai.dst.cur_building_rule = 0xFF;
-	p->ai.dst.cargo = CT_PASSENGERS;
+	_players_ai[p->index].dst.spec_tile = in->xy;
+	_players_ai[p->index].dst.use_tile = 0;
+	_players_ai[p->index].dst.rand_rng = 5;
+	_players_ai[p->index].dst.cur_building_rule = 0xFF;
+	_players_ai[p->index].dst.cargo = CT_PASSENGERS;
 
 	// Fill common fields
-	p->ai.cargo_type = CT_PASSENGERS;
-	p->ai.build_kind = 1;
-	p->ai.num_build_rec = 2;
-	p->ai.num_loco_to_build = 1;
-	p->ai.num_want_fullload = 0;
-//	p->ai.loco_id = INVALID_VEHICLE;
-	p->ai.order_list_blocks[0] = 0;
-	p->ai.order_list_blocks[1] = 1;
-	p->ai.order_list_blocks[2] = 255;
-
-	p->ai.state = AIS_AIRPORT_STUFF;
-	p->ai.timeout_counter = 0;
+	_players_ai[p->index].cargo_type = CT_PASSENGERS;
+	_players_ai[p->index].build_kind = 1;
+	_players_ai[p->index].num_build_rec = 2;
+	_players_ai[p->index].num_loco_to_build = 1;
+	_players_ai[p->index].num_want_fullload = 0;
+//	_players_ai[p->index].loco_id = INVALID_VEHICLE;
+	_players_ai[p->index].order_list_blocks[0] = 0;
+	_players_ai[p->index].order_list_blocks[1] = 1;
+	_players_ai[p->index].order_list_blocks[2] = 255;
+
+	_players_ai[p->index].state = AIS_AIRPORT_STUFF;
+	_players_ai[p->index].timeout_counter = 0;
 }
 
 static void AiWantAircraftRoute(Player *p)
@@ -1539,7 +1542,7 @@
 	int i;
 
 	if (p->player_money < AiGetBasePrice(p) * 500) {
-		p->ai.state = AIS_0;
+		_players_ai[p->index].state = AIS_0;
 		return;
 	}
 
@@ -1568,11 +1571,11 @@
 		}
 
 		// got a route?
-		if (p->ai.state != AIS_WANT_NEW_ROUTE) break;
+		if (_players_ai[p->index].state != AIS_WANT_NEW_ROUTE) break;
 
 		// time out?
 		if (--i == 0) {
-			if (++p->ai.state_counter == 556) p->ai.state = AIS_0;
+			if (++_players_ai[p->index].state_counter == 556) _players_ai[p->index].state = AIS_0;
 			break;
 		}
 	}
@@ -1615,7 +1618,7 @@
 static CommandCost AiDoBuildDefaultRailTrack(TileIndex tile, const AiDefaultBlockData* p, RailType railtype, byte flag)
 {
 	CommandCost ret;
-	CommandCost total_cost;
+	CommandCost total_cost(EXPENSES_CONSTRUCTION);
 	Town *t = NULL;
 	int rating = 0;
 	int i, j, k;
@@ -1799,16 +1802,16 @@
 	CommandCost cost;
 
 	// time out?
-	if (++p->ai.timeout_counter == 1388) {
-		p->ai.state = AIS_DELETE_RAIL_BLOCKS;
+	if (++_players_ai[p->index].timeout_counter == 1388) {
+		_players_ai[p->index].state = AIS_DELETE_RAIL_BLOCKS;
 		return;
 	}
 
 	// do the following 8 times
 	for (i = 0; i < 8; i++) {
 		// check if we can build the default track
-		aib = &p->ai.src;
-		j = p->ai.num_build_rec;
+		aib = &_players_ai[p->index].src;
+		j = _players_ai[p->index].num_build_rec;
 		do {
 			// this item has already been built?
 			if (aib->cur_building_rule != 255) continue;
@@ -1819,22 +1822,22 @@
 
 			// check if the track can be build there.
 			rule = AiBuildDefaultRailTrack(aib->use_tile,
-				p->ai.build_kind, p->ai.num_wagons,
+				_players_ai[p->index].build_kind, _players_ai[p->index].num_wagons,
 				aib->unk6, aib->unk7,
 				aib->direction, aib->cargo,
-				p->ai.railtype_to_use,
+				_players_ai[p->index].railtype_to_use,
 				&cost
 			);
 
 			if (rule == -1) {
 				// cannot build, terraform after a while
-				if (p->ai.state_counter >= 600) {
-					AiDoTerraformLand(aib->use_tile, (DiagDirection)(Random() & 3), 3, (int8)p->ai.state_mode);
+				if (_players_ai[p->index].state_counter >= 600) {
+					AiDoTerraformLand(aib->use_tile, (DiagDirection)(Random() & 3), 3, (int8)_players_ai[p->index].state_mode);
 				}
 				// also try the other terraform direction
-				if (++p->ai.state_counter >= 1000) {
-					p->ai.state_counter = 0;
-					p->ai.state_mode = -p->ai.state_mode;
+				if (++_players_ai[p->index].state_counter >= 1000) {
+					_players_ai[p->index].state_counter = 0;
+					_players_ai[p->index].state_mode = -_players_ai[p->index].state_mode;
 				}
 			} else if (CheckPlayerHasMoney(cost)) {
 				// player has money, build it.
@@ -1843,7 +1846,7 @@
 				AiDoBuildDefaultRailTrack(
 					aib->use_tile,
 					_default_rail_track_data[rule]->data,
-					p->ai.railtype_to_use,
+					_players_ai[p->index].railtype_to_use,
 					DC_EXEC | DC_NO_TOWN_RATING
 				);
 			}
@@ -1851,15 +1854,15 @@
 	}
 
 	// check if we're done with all of them
-	aib = &p->ai.src;
-	j = p->ai.num_build_rec;
+	aib = &_players_ai[p->index].src;
+	j = _players_ai[p->index].num_build_rec;
 	do {
 		if (aib->cur_building_rule == 255) return;
 	} while (++aib, --j);
 
 	// yep, all are done. switch state to the rail building state.
-	p->ai.state = AIS_BUILD_RAIL;
-	p->ai.state_mode = 255;
+	_players_ai[p->index].state = AIS_BUILD_RAIL;
+	_players_ai[p->index].state_mode = 255;
 }
 
 static TileIndex AiGetEdgeOfDefaultRailBlock(byte rule, TileIndex tile, byte cmd, DiagDirection *dir)
@@ -1896,11 +1899,11 @@
 {
 	AiRailPathFindData arpfd;
 
-	arpfd.tile = p->ai.start_tile_a;
-	arpfd.tile2 = p->ai.cur_tile_a;
+	arpfd.tile = _players_ai[p->index].start_tile_a;
+	arpfd.tile2 = _players_ai[p->index].cur_tile_a;
 	arpfd.flag = false;
 	arpfd.count = 0;
-	FollowTrack(p->ai.cur_tile_a + TileOffsByDiagDir(p->ai.cur_dir_a), 0x2000 | TRANSPORT_RAIL, 0, ReverseDiagDir(p->ai.cur_dir_a),
+	FollowTrack(_players_ai[p->index].cur_tile_a + TileOffsByDiagDir(_players_ai[p->index].cur_dir_a), 0x2000 | TRANSPORT_RAIL, 0, ReverseDiagDir(_players_ai[p->index].cur_dir_a),
 		(TPFEnumProc*)AiEnumFollowTrack, NULL, &arpfd);
 	return arpfd.count > 8;
 }
@@ -1937,8 +1940,8 @@
 {
 	int i;
 
-	for (i = 0; i != p->ai.banned_tile_count; i++) {
-		if (p->ai.banned_tiles[i] == tile && p->ai.banned_val[i] == val) {
+	for (i = 0; i != _players_ai[p->index].banned_tile_count; i++) {
+		if (_players_ai[p->index].banned_tiles[i] == tile && _players_ai[p->index].banned_val[i] == val) {
 			return true;
 		}
 	}
@@ -1949,16 +1952,16 @@
 {
 	uint i;
 
-	for (i = lengthof(p->ai.banned_tiles) - 1; i != 0; i--) {
-		p->ai.banned_tiles[i] = p->ai.banned_tiles[i - 1];
-		p->ai.banned_val[i] = p->ai.banned_val[i - 1];
+	for (i = lengthof(_players_ai[p->index].banned_tiles) - 1; i != 0; i--) {
+		_players_ai[p->index].banned_tiles[i] = _players_ai[p->index].banned_tiles[i - 1];
+		_players_ai[p->index].banned_val[i] = _players_ai[p->index].banned_val[i - 1];
 	}
 
-	p->ai.banned_tiles[0] = tile;
-	p->ai.banned_val[0] = val;
-
-	if (p->ai.banned_tile_count != lengthof(p->ai.banned_tiles)) {
-		p->ai.banned_tile_count++;
+	_players_ai[p->index].banned_tiles[0] = tile;
+	_players_ai[p->index].banned_val[0] = val;
+
+	if (_players_ai[p->index].banned_tile_count != lengthof(_players_ai[p->index].banned_tiles)) {
+		_players_ai[p->index].banned_tile_count++;
 	}
 }
 
@@ -2025,7 +2028,7 @@
 		}
 
 		// Is building a (rail)bridge possible at this place (type doesn't matter)?
-		if (CmdFailed(DoCommand(tile_new, tile, 0 | arf->player->ai.railtype_to_use << 8, DC_AUTO, CMD_BUILD_BRIDGE))) {
+		if (CmdFailed(DoCommand(tile_new, tile, 0 | _players_ai[arf->player->index].railtype_to_use << 8, DC_AUTO, CMD_BUILD_BRIDGE))) {
 			return;
 		}
 		AiBuildRailRecursive(arf, tile_new, dir2);
@@ -2042,7 +2045,7 @@
 	uint z;
 
 	if (GetTileSlope(tile, &z) == _dir_table_2[p[0] & 3] && z != 0) {
-		CommandCost cost = DoCommand(tile, arf->player->ai.railtype_to_use, 0, DC_AUTO, CMD_BUILD_TUNNEL);
+		CommandCost cost = DoCommand(tile, _players_ai[arf->player->index].railtype_to_use, 0, DC_AUTO, CMD_BUILD_TUNNEL);
 
 		if (CmdSucceeded(cost) && cost.GetCost() <= (arf->player->player_money >> 4)) {
 			AiBuildRailRecursive(arf, _build_tunnel_endtile, (DiagDirection)(p[0] & 3));
@@ -2098,7 +2101,7 @@
 		do {
 			// Make sure the tile is not in the list of banned tiles and that a rail can be built here.
 			if (!AiIsTileBanned(arf->player, tile, p[0]) &&
-					CmdSucceeded(DoCommand(tile, arf->player->ai.railtype_to_use, p[0], DC_AUTO | DC_NO_WATER | DC_NO_RAIL_OVERLAP, CMD_BUILD_SINGLE_RAIL))) {
+					CmdSucceeded(DoCommand(tile, _players_ai[arf->player->index].railtype_to_use, p[0], DC_AUTO | DC_NO_WATER | DC_NO_RAIL_OVERLAP, CMD_BUILD_SINGLE_RAIL))) {
 				AiBuildRailRecursive(arf, tile, (DiagDirection)p[1]);
 			}
 
@@ -2125,18 +2128,18 @@
 
 	// Check too much lookahead?
 	if (AiDoFollowTrack(p)) {
-		p->ai.state_counter = (Random()&0xE)+6; // Destruct this amount of blocks
-		p->ai.state_mode = 1; // Start destruct
+		_players_ai[p->index].state_counter = (Random()&0xE)+6; // Destruct this amount of blocks
+		_players_ai[p->index].state_mode = 1; // Start destruct
 
 		// Ban this tile and don't reach it for a while.
-		AiBanTile(p, p->ai.cur_tile_a, FindFirstBit(GetRailTrackStatus(p->ai.cur_tile_a)));
+		AiBanTile(p, _players_ai[p->index].cur_tile_a, FindFirstBit(GetRailTrackStatus(_players_ai[p->index].cur_tile_a)));
 		return;
 	}
 
 	// Setup recursive finder and call it.
 	arf.player = p;
-	arf.final_tile = p->ai.cur_tile_b;
-	arf.final_dir = p->ai.cur_dir_b;
+	arf.final_tile = _players_ai[p->index].cur_tile_b;
+	arf.final_dir = _players_ai[p->index].cur_dir_b;
 	arf.depth = 0;
 	arf.recursive_mode = 0;
 	arf.best_ptr = NULL;
@@ -2146,11 +2149,11 @@
 	arf.best_depth = 0xff;
 	arf.cur_best_tile = 0;
 	arf.best_tile = 0;
-	AiBuildRailRecursive(&arf, p->ai.cur_tile_a, p->ai.cur_dir_a);
+	AiBuildRailRecursive(&arf, _players_ai[p->index].cur_tile_a, _players_ai[p->index].cur_dir_a);
 
 	// Reached destination?
 	if (arf.recursive_mode == 2 && arf.cur_best_depth == 0) {
-		p->ai.state_mode = 255;
+		_players_ai[p->index].state_mode = 255;
 		return;
 	}
 
@@ -2158,24 +2161,24 @@
 	if (arf.best_ptr == NULL) {
 		// Terraform some
 		for (i = 0; i != 5; i++) {
-			AiDoTerraformLand(p->ai.cur_tile_a, p->ai.cur_dir_a, 3, 0);
+			AiDoTerraformLand(_players_ai[p->index].cur_tile_a, _players_ai[p->index].cur_dir_a, 3, 0);
 		}
 
-		if (++p->ai.state_counter == 21) {
-			p->ai.state_counter = 40;
-			p->ai.state_mode = 1;
+		if (++_players_ai[p->index].state_counter == 21) {
+			_players_ai[p->index].state_counter = 40;
+			_players_ai[p->index].state_mode = 1;
 
 			// Ban this tile
-			AiBanTile(p, p->ai.cur_tile_a, FindFirstBit(GetRailTrackStatus(p->ai.cur_tile_a)));
+			AiBanTile(p, _players_ai[p->index].cur_tile_a, FindFirstBit(GetRailTrackStatus(_players_ai[p->index].cur_tile_a)));
 		}
 		return;
 	}
 
-	p->ai.cur_tile_a += TileOffsByDiagDir(p->ai.cur_dir_a);
+	_players_ai[p->index].cur_tile_a += TileOffsByDiagDir(_players_ai[p->index].cur_dir_a);
 
 	if (arf.best_ptr[0] & 0x80) {
 		int i;
-		int32 bridge_len = GetBridgeLength(arf.bridge_end_tile, p->ai.cur_tile_a);
+		int32 bridge_len = GetBridgeLength(arf.bridge_end_tile, _players_ai[p->index].cur_tile_a);
 
 		/* Figure out which (rail)bridge type to build
 		 * start with best bridge, then go down to worse and worse bridges
@@ -2185,27 +2188,27 @@
 		 */
 		for (i = MAX_BRIDGES - 1; i != 0; i--) {
 			if (CheckBridge_Stuff(i, bridge_len)) {
-				CommandCost cost = DoCommand(arf.bridge_end_tile, p->ai.cur_tile_a, i | (p->ai.railtype_to_use << 8), DC_AUTO, CMD_BUILD_BRIDGE);
+				CommandCost cost = DoCommand(arf.bridge_end_tile, _players_ai[p->index].cur_tile_a, i | (_players_ai[p->index].railtype_to_use << 8), DC_AUTO, CMD_BUILD_BRIDGE);
 				if (CmdSucceeded(cost) && cost.GetCost() < (p->player_money >> 5)) break;
 			}
 		}
 
 		// Build it
-		DoCommand(arf.bridge_end_tile, p->ai.cur_tile_a, i | (p->ai.railtype_to_use << 8), DC_AUTO | DC_EXEC, CMD_BUILD_BRIDGE);
-
-		p->ai.cur_tile_a = arf.bridge_end_tile;
-		p->ai.state_counter = 0;
+		DoCommand(arf.bridge_end_tile, _players_ai[p->index].cur_tile_a, i | (_players_ai[p->index].railtype_to_use << 8), DC_AUTO | DC_EXEC, CMD_BUILD_BRIDGE);
+
+		_players_ai[p->index].cur_tile_a = arf.bridge_end_tile;
+		_players_ai[p->index].state_counter = 0;
 	} else if (arf.best_ptr[0] & 0x40) {
 		// tunnel
-		DoCommand(p->ai.cur_tile_a, p->ai.railtype_to_use, 0, DC_AUTO | DC_EXEC, CMD_BUILD_TUNNEL);
-		p->ai.cur_tile_a = _build_tunnel_endtile;
-		p->ai.state_counter = 0;
+		DoCommand(_players_ai[p->index].cur_tile_a, _players_ai[p->index].railtype_to_use, 0, DC_AUTO | DC_EXEC, CMD_BUILD_TUNNEL);
+		_players_ai[p->index].cur_tile_a = _build_tunnel_endtile;
+		_players_ai[p->index].state_counter = 0;
 	} else {
 		// rail
-		p->ai.cur_dir_a = (DiagDirection)(arf.best_ptr[1] & 3);
-		DoCommand(p->ai.cur_tile_a, p->ai.railtype_to_use, arf.best_ptr[0],
+		_players_ai[p->index].cur_dir_a = (DiagDirection)(arf.best_ptr[1] & 3);
+		DoCommand(_players_ai[p->index].cur_tile_a, _players_ai[p->index].railtype_to_use, arf.best_ptr[0],
 			DC_EXEC | DC_AUTO | DC_NO_WATER | DC_NO_RAIL_OVERLAP, CMD_BUILD_SINGLE_RAIL);
-		p->ai.state_counter = 0;
+		_players_ai[p->index].state_counter = 0;
 	}
 
 	if (arf.best_tile != 0) {
@@ -2220,7 +2223,7 @@
 	byte b;
 	int bit;
 	const byte *ptr;
-	TileIndex tile = p->ai.cur_tile_a;
+	TileIndex tile = _players_ai[p->index].cur_tile_a;
 	TileIndex tilenew;
 
 	if (IsTileType(tile, MP_TUNNELBRIDGE)) {
@@ -2228,26 +2231,26 @@
 			// Clear the tunnel and continue at the other side of it.
 			if (CmdFailed(DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR)))
 				return false;
-			p->ai.cur_tile_a = TILE_MASK(_build_tunnel_endtile - TileOffsByDiagDir(p->ai.cur_dir_a));
+			_players_ai[p->index].cur_tile_a = TILE_MASK(_build_tunnel_endtile - TileOffsByDiagDir(_players_ai[p->index].cur_dir_a));
 			return true;
 		} else {
 			// Check if the bridge points in the right direction.
 			// This is not really needed the first place AiRemoveTileAndGoForward is called.
-			if (DiagDirToAxis(GetBridgeRampDirection(tile)) != (p->ai.cur_dir_a & 1)) return false;
+			if (DiagDirToAxis(GetTunnelBridgeDirection(tile)) != (_players_ai[p->index].cur_dir_a & 1)) return false;
 
 			tile = GetOtherBridgeEnd(tile);
 
-			tilenew = TILE_MASK(tile - TileOffsByDiagDir(p->ai.cur_dir_a));
+			tilenew = TILE_MASK(tile - TileOffsByDiagDir(_players_ai[p->index].cur_dir_a));
 			// And clear the bridge.
 			if (CmdFailed(DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR)))
 				return false;
-			p->ai.cur_tile_a = tilenew;
+			_players_ai[p->index].cur_tile_a = tilenew;
 			return true;
 		}
 	}
 
 	// Find the railtype at the position. Quit if no rail there.
-	b = GetRailTrackStatus(tile) & _dir_table_3[p->ai.cur_dir_a];
+	b = GetRailTrackStatus(tile) & _dir_table_3[_players_ai[p->index].cur_dir_a];
 	if (b == 0) return false;
 
 	// Convert into a bit position that CMD_REMOVE_SINGLE_RAIL expects.
@@ -2264,12 +2267,12 @@
 		return false;
 
 	// Find the direction at the other edge of the rail.
-	ptr = _ai_table_15[ReverseDiagDir(p->ai.cur_dir_a)];
+	ptr = _ai_table_15[ReverseDiagDir(_players_ai[p->index].cur_dir_a)];
 	while (ptr[0] != bit) ptr += 2;
-	p->ai.cur_dir_a = ReverseDiagDir((DiagDirection)ptr[1]);
+	_players_ai[p->index].cur_dir_a = ReverseDiagDir((DiagDirection)ptr[1]);
 
 	// And then also switch tile.
-	p->ai.cur_tile_a = TILE_MASK(p->ai.cur_tile_a - TileOffsByDiagDir(p->ai.cur_dir_a));
+	_players_ai[p->index].cur_tile_a = TILE_MASK(_players_ai[p->index].cur_tile_a - TileOffsByDiagDir(_players_ai[p->index].cur_dir_a));
 
 	return true;
 }
@@ -2278,13 +2281,13 @@
 static void AiBuildRailDestruct(Player *p)
 {
 	// Decrease timeout.
-	if (!--p->ai.state_counter) {
-		p->ai.state_mode = 2;
-		p->ai.state_counter = 0;
+	if (!--_players_ai[p->index].state_counter) {
+		_players_ai[p->index].state_mode = 2;
+		_players_ai[p->index].state_counter = 0;
 	}
 
 	// Don't do anything if the destination is already reached.
-	if (p->ai.cur_tile_a == p->ai.start_tile_a) return;
+	if (_players_ai[p->index].cur_tile_a == _players_ai[p->index].start_tile_a) return;
 
 	AiRemoveTileAndGoForward(p);
 }
@@ -2292,7 +2295,7 @@
 
 static void AiBuildRail(Player *p)
 {
-	switch (p->ai.state_mode) {
+	switch (_players_ai[p->index].state_mode) {
 		case 0: // Construct mode, build new rail.
 			AiBuildRailConstruct(p);
 			break;
@@ -2306,12 +2309,12 @@
 
 			// Terraform some and then try building again.
 			for (i = 0; i != 4; i++) {
-				AiDoTerraformLand(p->ai.cur_tile_a, p->ai.cur_dir_a, 3, 0);
+				AiDoTerraformLand(_players_ai[p->index].cur_tile_a, _players_ai[p->index].cur_dir_a, 3, 0);
 			}
 
-			if (++p->ai.state_counter == 4) {
-				p->ai.state_counter = 0;
-				p->ai.state_mode = 0;
+			if (++_players_ai[p->index].state_counter == 4) {
+				_players_ai[p->index].state_counter = 0;
+				_players_ai[p->index].state_mode = 0;
 			}
 		}
 
@@ -2328,26 +2331,26 @@
 	DiagDirection dir;
 
 	// time out?
-	if (++p->ai.timeout_counter == 1388) {
-		p->ai.state = AIS_DELETE_RAIL_BLOCKS;
+	if (++_players_ai[p->index].timeout_counter == 1388) {
+		_players_ai[p->index].state = AIS_DELETE_RAIL_BLOCKS;
 		return;
 	}
 
 	// Currently building a rail between two points?
-	if (p->ai.state_mode != 255) {
+	if (_players_ai[p->index].state_mode != 255) {
 		AiBuildRail(p);
 
 		// Alternate between edges
-		Swap(p->ai.start_tile_a, p->ai.start_tile_b);
-		Swap(p->ai.cur_tile_a,   p->ai.cur_tile_b);
-		Swap(p->ai.start_dir_a,  p->ai.start_dir_b);
-		Swap(p->ai.cur_dir_a,    p->ai.cur_dir_b);
+		Swap(_players_ai[p->index].start_tile_a, _players_ai[p->index].start_tile_b);
+		Swap(_players_ai[p->index].cur_tile_a,   _players_ai[p->index].cur_tile_b);
+		Swap(_players_ai[p->index].start_dir_a,  _players_ai[p->index].start_dir_b);
+		Swap(_players_ai[p->index].cur_dir_a,    _players_ai[p->index].cur_dir_b);
 		return;
 	}
 
 	// Now, find two new points to build between
-	num = p->ai.num_build_rec;
-	aib = &p->ai.src;
+	num = _players_ai[p->index].num_build_rec;
+	aib = &_players_ai[p->index].src;
 
 	for (;;) {
 		cmd = aib->buildcmd_a;
@@ -2360,37 +2363,37 @@
 
 		aib++;
 		if (--num == 0) {
-			p->ai.state = AIS_BUILD_RAIL_VEH;
-			p->ai.state_counter = 0; // timeout
+			_players_ai[p->index].state = AIS_BUILD_RAIL_VEH;
+			_players_ai[p->index].state_counter = 0; // timeout
 			return;
 		}
 	}
 
 	// Find first edge to build from.
 	tile = AiGetEdgeOfDefaultRailBlock(aib->cur_building_rule, aib->use_tile, cmd & 3, &dir);
-	p->ai.start_tile_a = tile;
-	p->ai.cur_tile_a = tile;
-	p->ai.start_dir_a = dir;
-	p->ai.cur_dir_a = dir;
+	_players_ai[p->index].start_tile_a = tile;
+	_players_ai[p->index].cur_tile_a = tile;
+	_players_ai[p->index].start_dir_a = dir;
+	_players_ai[p->index].cur_dir_a = dir;
 	DoCommand(TILE_MASK(tile + TileOffsByDiagDir(dir)), 0, (dir & 1) ? 1 : 0, DC_EXEC, CMD_REMOVE_SINGLE_RAIL);
 
 	assert(TILE_MASK(tile) != 0xFF00);
 
 	// Find second edge to build to
-	aib = (&p->ai.src) + ((cmd >> 4) & 0xF);
+	aib = (&_players_ai[p->index].src) + ((cmd >> 4) & 0xF);
 	tile = AiGetEdgeOfDefaultRailBlock(aib->cur_building_rule, aib->use_tile, (cmd >> 2) & 3, &dir);
-	p->ai.start_tile_b = tile;
-	p->ai.cur_tile_b = tile;
-	p->ai.start_dir_b = dir;
-	p->ai.cur_dir_b = dir;
+	_players_ai[p->index].start_tile_b = tile;
+	_players_ai[p->index].cur_tile_b = tile;
+	_players_ai[p->index].start_dir_b = dir;
+	_players_ai[p->index].cur_dir_b = dir;
 	DoCommand(TILE_MASK(tile + TileOffsByDiagDir(dir)), 0, (dir & 1) ? 1 : 0, DC_EXEC, CMD_REMOVE_SINGLE_RAIL);
 
 	assert(TILE_MASK(tile) != 0xFF00);
 
 	// And setup state.
-	p->ai.state_mode = 2;
-	p->ai.state_counter = 0;
-	p->ai.banned_tile_count = 0;
+	_players_ai[p->index].state_mode = 2;
+	_players_ai[p->index].state_counter = 0;
+	_players_ai[p->index].banned_tile_count = 0;
 }
 
 static StationID AiGetStationIdByDef(TileIndex tile, int id)
@@ -2444,40 +2447,40 @@
 	Vehicle *v;
 	VehicleID loco_id;
 
-	ptr = _default_rail_track_data[p->ai.src.cur_building_rule]->data;
+	ptr = _default_rail_track_data[_players_ai[p->index].src.cur_building_rule]->data;
 	while (ptr->mode != 0) ptr++;
 
-	tile = TILE_ADD(p->ai.src.use_tile, ToTileIndexDiff(ptr->tileoffs));
-
-
-	cargo = p->ai.cargo_type;
+	tile = TILE_ADD(_players_ai[p->index].src.use_tile, ToTileIndexDiff(ptr->tileoffs));
+
+
+	cargo = _players_ai[p->index].cargo_type;
 	for (i = 0;;) {
-		if (p->ai.wagon_list[i] == INVALID_VEHICLE) {
-			veh = AiFindBestWagon(cargo, p->ai.railtype_to_use);
+		if (_players_ai[p->index].wagon_list[i] == INVALID_VEHICLE) {
+			veh = AiFindBestWagon(cargo, _players_ai[p->index].railtype_to_use);
 			/* veh will return INVALID_ENGINE if no suitable wagon is available.
 			 * We shall treat this in the same way as having no money */
 			if (veh == INVALID_ENGINE) goto handle_nocash;
 			cost = DoCommand(tile, veh, 0, DC_EXEC, CMD_BUILD_RAIL_VEHICLE);
 			if (CmdFailed(cost)) goto handle_nocash;
-			p->ai.wagon_list[i] = _new_vehicle_id;
-			p->ai.wagon_list[i + 1] = INVALID_VEHICLE;
+			_players_ai[p->index].wagon_list[i] = _new_vehicle_id;
+			_players_ai[p->index].wagon_list[i + 1] = INVALID_VEHICLE;
 			return;
 		}
 		if (cargo == CT_MAIL) cargo = CT_PASSENGERS;
-		if (++i == p->ai.num_wagons * 2 - 1) break;
+		if (++i == _players_ai[p->index].num_wagons * 2 - 1) break;
 	}
 
 	// Which locomotive to build?
-	veh = AiChooseTrainToBuild(p->ai.railtype_to_use, p->player_money, cargo != CT_PASSENGERS ? 1 : 0, tile);
+	veh = AiChooseTrainToBuild(_players_ai[p->index].railtype_to_use, p->player_money, cargo != CT_PASSENGERS ? 1 : 0, tile);
 	if (veh == INVALID_ENGINE) {
 handle_nocash:
 		// after a while, if AI still doesn't have cash, get out of this block by selling the wagons.
-		if (++p->ai.state_counter == 1000) {
-			for (i = 0; p->ai.wagon_list[i] != INVALID_VEHICLE; i++) {
-				cost = DoCommand(tile, p->ai.wagon_list[i], 0, DC_EXEC, CMD_SELL_RAIL_WAGON);
+		if (++_players_ai[p->index].state_counter == 1000) {
+			for (i = 0; _players_ai[p->index].wagon_list[i] != INVALID_VEHICLE; i++) {
+				cost = DoCommand(tile, _players_ai[p->index].wagon_list[i], 0, DC_EXEC, CMD_SELL_RAIL_WAGON);
 				assert(CmdSucceeded(cost));
 			}
-			p->ai.state = AIS_0;
+			_players_ai[p->index].state = AIS_0;
 		}
 		return;
 	}
@@ -2490,22 +2493,22 @@
 	// Sell a vehicle if the train is double headed.
 	v = GetVehicle(loco_id);
 	if (v->Next() != NULL) {
-		i = p->ai.wagon_list[p->ai.num_wagons * 2 - 2];
-		p->ai.wagon_list[p->ai.num_wagons * 2 - 2] = INVALID_VEHICLE;
+		i = _players_ai[p->index].wagon_list[_players_ai[p->index].num_wagons * 2 - 2];
+		_players_ai[p->index].wagon_list[_players_ai[p->index].num_wagons * 2 - 2] = INVALID_VEHICLE;
 		DoCommand(tile, i, 0, DC_EXEC, CMD_SELL_RAIL_WAGON);
 	}
 
 	// Move the wagons onto the train
-	for (i = 0; p->ai.wagon_list[i] != INVALID_VEHICLE; i++) {
-		DoCommand(tile, p->ai.wagon_list[i] | (loco_id << 16), 0, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
+	for (i = 0; _players_ai[p->index].wagon_list[i] != INVALID_VEHICLE; i++) {
+		DoCommand(tile, _players_ai[p->index].wagon_list[i] | (loco_id << 16), 0, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
 	}
 
-	for (i = 0; p->ai.order_list_blocks[i] != 0xFF; i++) {
-		const AiBuildRec* aib = &p->ai.src + p->ai.order_list_blocks[i];
+	for (i = 0; _players_ai[p->index].order_list_blocks[i] != 0xFF; i++) {
+		const AiBuildRec* aib = &_players_ai[p->index].src + _players_ai[p->index].order_list_blocks[i];
 		bool is_pass = (
-			p->ai.cargo_type == CT_PASSENGERS ||
-			p->ai.cargo_type == CT_MAIL ||
-			(_opt.landscape == LT_TEMPERATE && p->ai.cargo_type == CT_VALUABLES)
+			_players_ai[p->index].cargo_type == CT_PASSENGERS ||
+			_players_ai[p->index].cargo_type == CT_MAIL ||
+			(_opt.landscape == LT_TEMPERATE && _players_ai[p->index].cargo_type == CT_VALUABLES)
 		);
 		Order order;
 
@@ -2513,9 +2516,9 @@
 		order.flags = 0;
 		order.dest = AiGetStationIdByDef(aib->use_tile, aib->cur_building_rule);
 
-		if (!is_pass && i == 1) order.flags |= OF_UNLOAD;
-		if (p->ai.num_want_fullload != 0 && (is_pass || i == 0))
-			order.flags |= OF_FULL_LOAD;
+		if (!is_pass && i == 1) order.flags |= OFB_UNLOAD;
+		if (_players_ai[p->index].num_want_fullload != 0 && (is_pass || i == 0))
+			order.flags |= OFB_FULL_LOAD;
 
 		DoCommand(0, loco_id + (i << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
 	}
@@ -2524,20 +2527,20 @@
 
 	DoCommand(0, loco_id, _ai_service_interval, DC_EXEC, CMD_CHANGE_SERVICE_INT);
 
-	if (p->ai.num_want_fullload != 0) p->ai.num_want_fullload--;
-
-	if (--p->ai.num_loco_to_build != 0) {
-//		p->ai.loco_id = INVALID_VEHICLE;
-		p->ai.wagon_list[0] = INVALID_VEHICLE;
+	if (_players_ai[p->index].num_want_fullload != 0) _players_ai[p->index].num_want_fullload--;
+
+	if (--_players_ai[p->index].num_loco_to_build != 0) {
+//		_players_ai[p->index].loco_id = INVALID_VEHICLE;
+		_players_ai[p->index].wagon_list[0] = INVALID_VEHICLE;
 	} else {
-		p->ai.state = AIS_0;
+		_players_ai[p->index].state = AIS_0;
 	}
 }
 
 static void AiStateDeleteRailBlocks(Player *p)
 {
-	const AiBuildRec* aib = &p->ai.src;
-	uint num = p->ai.num_build_rec;
+	const AiBuildRec* aib = &_players_ai[p->index].src;
+	uint num = _players_ai[p->index].num_build_rec;
 
 	do {
 		const AiDefaultBlockData* b;
@@ -2548,7 +2551,7 @@
 		}
 	} while (++aib, --num);
 
-	p->ai.state = AIS_0;
+	_players_ai[p->index].state = AIS_0;
 }
 
 static bool AiCheckRoadResources(TileIndex tile, const AiDefaultBlockData *p, byte cargo)
@@ -2604,7 +2607,7 @@
 static CommandCost AiDoBuildDefaultRoadBlock(TileIndex tile, const AiDefaultBlockData *p, byte flag)
 {
 	CommandCost ret;
-	CommandCost total_cost;
+	CommandCost total_cost(EXPENSES_CONSTRUCTION);
 	Town *t = NULL;
 	int rating = 0;
 	int roadflag = 0;
@@ -2677,8 +2680,8 @@
 // Make sure the blocks are not too close to each other
 static bool AiCheckBlockDistances(Player *p, TileIndex tile)
 {
-	const AiBuildRec* aib = &p->ai.src;
-	uint num = p->ai.num_build_rec;
+	const AiBuildRec* aib = &_players_ai[p->index].src;
+	uint num = _players_ai[p->index].num_build_rec;
 
 	do {
 		if (aib->cur_building_rule != 255) {
@@ -2699,16 +2702,16 @@
 	CommandCost cost;
 
 	// time out?
-	if (++p->ai.timeout_counter == 1388) {
-		p->ai.state = AIS_DELETE_RAIL_BLOCKS;
+	if (++_players_ai[p->index].timeout_counter == 1388) {
+		_players_ai[p->index].state = AIS_DELETE_RAIL_BLOCKS;
 		return;
 	}
 
 	// do the following 8 times
 	for (i = 0; i != 8; i++) {
 		// check if we can build the default track
-		aib = &p->ai.src;
-		j = p->ai.num_build_rec;
+		aib = &_players_ai[p->index].src;
+		j = _players_ai[p->index].num_build_rec;
 		do {
 			// this item has already been built?
 			if (aib->cur_building_rule != 255) continue;
@@ -2724,13 +2727,13 @@
 
 			if (rule == -1) {
 				// cannot build, terraform after a while
-				if (p->ai.state_counter >= 600) {
-					AiDoTerraformLand(aib->use_tile, (DiagDirection)(Random() & 3), 3, (int8)p->ai.state_mode);
+				if (_players_ai[p->index].state_counter >= 600) {
+					AiDoTerraformLand(aib->use_tile, (DiagDirection)(Random() & 3), 3, (int8)_players_ai[p->index].state_mode);
 				}
 				// also try the other terraform direction
-				if (++p->ai.state_counter >= 1000) {
-					p->ai.state_counter = 0;
-					p->ai.state_mode = -p->ai.state_mode;
+				if (++_players_ai[p->index].state_counter >= 1000) {
+					_players_ai[p->index].state_counter = 0;
+					_players_ai[p->index].state_mode = -_players_ai[p->index].state_mode;
 				}
 			} else if (CheckPlayerHasMoney(cost) && AiCheckBlockDistances(p, aib->use_tile)) {
 				CommandCost r;
@@ -2749,15 +2752,15 @@
 	}
 
 	// check if we're done with all of them
-	aib = &p->ai.src;
-	j = p->ai.num_build_rec;
+	aib = &_players_ai[p->index].src;
+	j = _players_ai[p->index].num_build_rec;
 	do {
 		if (aib->cur_building_rule == 255) return;
 	} while (++aib, --j);
 
 	// yep, all are done. switch state to the rail building state.
-	p->ai.state = AIS_BUILD_ROAD;
-	p->ai.state_mode = 255;
+	_players_ai[p->index].state = AIS_BUILD_ROAD;
+	_players_ai[p->index].state_mode = 255;
 }
 
 struct AiRoadFinder {
@@ -2854,11 +2857,11 @@
 {
 	AiRoadEnum are;
 	TileIndex tile;
-	DiagDirection dir = p->ai.cur_dir_a;
+	DiagDirection dir = _players_ai[p->index].cur_dir_a;
 	uint32 bits;
 
-	are.dest = p->ai.cur_tile_b;
-	tile = TILE_MASK(p->ai.cur_tile_a + TileOffsByDiagDir(dir));
+	are.dest = _players_ai[p->index].cur_tile_b;
+	tile = TILE_MASK(_players_ai[p->index].cur_tile_a + TileOffsByDiagDir(dir));
 
 	if (IsRoadStopTile(tile) || IsTileDepotType(tile, TRANSPORT_ROAD)) return false;
 	bits = GetTileTrackStatus(tile, TRANSPORT_ROAD, ROADTYPES_ROAD) & _ai_road_table_and[dir];
@@ -2875,8 +2878,8 @@
 
 	if (are.best_dist == 0) return true;
 
-	p->ai.cur_tile_a = are.best_tile;
-	p->ai.cur_dir_a = _dir_by_track[are.best_track];
+	_players_ai[p->index].cur_tile_a = are.best_tile;
+	_players_ai[p->index].cur_dir_a = _dir_by_track[are.best_track];
 	return false;
 }
 
@@ -2915,7 +2918,7 @@
 			tile_new = TILE_MASK(tile_new + TileOffsByDiagDir(dir2));
 			type = GetTileType(tile_new);
 
-			if (type == MP_CLEAR || type == MP_TREES || GetTileSlope(tile, NULL) != SLOPE_FLAT) {
+			if (type == MP_CLEAR || type == MP_TREES || GetTileSlope(tile_new, NULL) != SLOPE_FLAT) {
 				// Allow a bridge if either we have a tile that's water, rail or street,
 				// or if we found an up tile.
 				if (!flag) return;
@@ -3019,14 +3022,14 @@
 
 	// Reached destination?
 	if (AiCheckRoadFinished(p)) {
-		p->ai.state_mode = 255;
+		_players_ai[p->index].state_mode = 255;
 		return;
 	}
 
 	// Setup recursive finder and call it.
 	arf.player = p;
-	arf.final_tile = p->ai.cur_tile_b;
-	arf.final_dir = p->ai.cur_dir_b;
+	arf.final_tile = _players_ai[p->index].cur_tile_b;
+	arf.final_dir = _players_ai[p->index].cur_dir_b;
 	arf.depth = 0;
 	arf.recursive_mode = 0;
 	arf.best_ptr = NULL;
@@ -3036,11 +3039,11 @@
 	arf.best_depth =  0xff;
 	arf.cur_best_tile = 0;
 	arf.best_tile = 0;
-	AiBuildRoadRecursive(&arf, p->ai.cur_tile_a, p->ai.cur_dir_a);
+	AiBuildRoadRecursive(&arf, _players_ai[p->index].cur_tile_a, _players_ai[p->index].cur_dir_a);
 
 	// Reached destination?
 	if (arf.recursive_mode == 2 && arf.cur_best_depth == 0) {
-		p->ai.state_mode = 255;
+		_players_ai[p->index].state_mode = 255;
 		return;
 	}
 
@@ -3049,25 +3052,25 @@
 		// Terraform some
 do_some_terraform:
 		for (i = 0; i != 5; i++)
-			AiDoTerraformLand(p->ai.cur_tile_a, p->ai.cur_dir_a, 3, 0);
-
-		if (++p->ai.state_counter == 21) {
-			p->ai.state_mode = 1;
-
-			p->ai.cur_tile_a = TILE_MASK(p->ai.cur_tile_a + TileOffsByDiagDir(p->ai.cur_dir_a));
-			p->ai.cur_dir_a = ReverseDiagDir(p->ai.cur_dir_a);
-			p->ai.state_counter = 0;
+			AiDoTerraformLand(_players_ai[p->index].cur_tile_a, _players_ai[p->index].cur_dir_a, 3, 0);
+
+		if (++_players_ai[p->index].state_counter == 21) {
+			_players_ai[p->index].state_mode = 1;
+
+			_players_ai[p->index].cur_tile_a = TILE_MASK(_players_ai[p->index].cur_tile_a + TileOffsByDiagDir(_players_ai[p->index].cur_dir_a));
+			_players_ai[p->index].cur_dir_a = ReverseDiagDir(_players_ai[p->index].cur_dir_a);
+			_players_ai[p->index].state_counter = 0;
 		}
 		return;
 	}
 
-	tile = TILE_MASK(p->ai.cur_tile_a + TileOffsByDiagDir(p->ai.cur_dir_a));
+	tile = TILE_MASK(_players_ai[p->index].cur_tile_a + TileOffsByDiagDir(_players_ai[p->index].cur_dir_a));
 
 	if (arf.best_ptr[0] & 0x80) {
 		int i;
 		int32 bridge_len;
-		p->ai.cur_tile_a = arf.bridge_end_tile;
-		bridge_len = GetBridgeLength(tile, p->ai.cur_tile_a); // tile
+		_players_ai[p->index].cur_tile_a = arf.bridge_end_tile;
+		bridge_len = GetBridgeLength(tile, _players_ai[p->index].cur_tile_a); // tile
 
 		/* Figure out what (road)bridge type to build
 		 * start with best bridge, then go down to worse and worse bridges
@@ -3076,28 +3079,28 @@
 		 */
 		for (i = 10; i != 0; i--) {
 			if (CheckBridge_Stuff(i, bridge_len)) {
-				CommandCost cost = DoCommand(tile, p->ai.cur_tile_a, i + ((0x80 | ROADTYPES_ROAD) << 8), DC_AUTO, CMD_BUILD_BRIDGE);
+				CommandCost cost = DoCommand(tile, _players_ai[p->index].cur_tile_a, i + ((0x80 | ROADTYPES_ROAD) << 8), DC_AUTO, CMD_BUILD_BRIDGE);
 				if (CmdSucceeded(cost) && cost.GetCost() < (p->player_money >> 5)) break;
 			}
 		}
 
 		// Build it
-		DoCommand(tile, p->ai.cur_tile_a, i + ((0x80 | ROADTYPES_ROAD) << 8), DC_AUTO | DC_EXEC, CMD_BUILD_BRIDGE);
-
-		p->ai.state_counter = 0;
+		DoCommand(tile, _players_ai[p->index].cur_tile_a, i + ((0x80 | ROADTYPES_ROAD) << 8), DC_AUTO | DC_EXEC, CMD_BUILD_BRIDGE);
+
+		_players_ai[p->index].state_counter = 0;
 	} else if (arf.best_ptr[0] & 0x40) {
 		// tunnel
 		DoCommand(tile, 0x200, 0, DC_AUTO | DC_EXEC, CMD_BUILD_TUNNEL);
-		p->ai.cur_tile_a = _build_tunnel_endtile;
-		p->ai.state_counter = 0;
+		_players_ai[p->index].cur_tile_a = _build_tunnel_endtile;
+		_players_ai[p->index].state_counter = 0;
 	} else {
 		// road
 		if (!AiBuildRoadHelper(tile, DC_EXEC | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, arf.best_ptr[0]))
 			goto do_some_terraform;
 
-		p->ai.cur_dir_a = (DiagDirection)(arf.best_ptr[1] & 3);
-		p->ai.cur_tile_a = tile;
-		p->ai.state_counter = 0;
+		_players_ai[p->index].cur_dir_a = (DiagDirection)(arf.best_ptr[1] & 3);
+		_players_ai[p->index].cur_tile_a = tile;
+		_players_ai[p->index].state_counter = 0;
 	}
 
 	if (arf.best_tile != 0) {
@@ -3109,24 +3112,24 @@
 
 static void AiBuildRoad(Player *p)
 {
-	if (p->ai.state_mode < 1) {
+	if (_players_ai[p->index].state_mode < 1) {
 		// Construct mode, build new road.
 		AiBuildRoadConstruct(p);
-	} else if (p->ai.state_mode == 1) {
+	} else if (_players_ai[p->index].state_mode == 1) {
 		// Destruct mode, not implemented for roads.
-		p->ai.state_mode = 2;
-		p->ai.state_counter = 0;
-	} else if (p->ai.state_mode == 2) {
+		_players_ai[p->index].state_mode = 2;
+		_players_ai[p->index].state_counter = 0;
+	} else if (_players_ai[p->index].state_mode == 2) {
 		uint i;
 
 		// Terraform some and then try building again.
 		for (i = 0; i != 4; i++) {
-			AiDoTerraformLand(p->ai.cur_tile_a, p->ai.cur_dir_a, 3, 0);
+			AiDoTerraformLand(_players_ai[p->index].cur_tile_a, _players_ai[p->index].cur_dir_a, 3, 0);
 		}
 
-		if (++p->ai.state_counter == 4) {
-			p->ai.state_counter = 0;
-			p->ai.state_mode = 0;
+		if (++_players_ai[p->index].state_counter == 4) {
+			_players_ai[p->index].state_counter = 0;
+			_players_ai[p->index].state_mode = 0;
 		}
 	}
 }
@@ -3149,27 +3152,27 @@
 	DiagDirection dir;
 
 	// time out?
-	if (++p->ai.timeout_counter == 1388) {
-		p->ai.state = AIS_DELETE_ROAD_BLOCKS;
+	if (++_players_ai[p->index].timeout_counter == 1388) {
+		_players_ai[p->index].state = AIS_DELETE_ROAD_BLOCKS;
 		return;
 	}
 
 	// Currently building a road between two points?
-	if (p->ai.state_mode != 255) {
+	if (_players_ai[p->index].state_mode != 255) {
 		AiBuildRoad(p);
 
 		// Alternate between edges
-		Swap(p->ai.start_tile_a, p->ai.start_tile_b);
-		Swap(p->ai.cur_tile_a,   p->ai.cur_tile_b);
-		Swap(p->ai.start_dir_a,  p->ai.start_dir_b);
-		Swap(p->ai.cur_dir_a,    p->ai.cur_dir_b);
+		Swap(_players_ai[p->index].start_tile_a, _players_ai[p->index].start_tile_b);
+		Swap(_players_ai[p->index].cur_tile_a,   _players_ai[p->index].cur_tile_b);
+		Swap(_players_ai[p->index].start_dir_a,  _players_ai[p->index].start_dir_b);
+		Swap(_players_ai[p->index].cur_dir_a,    _players_ai[p->index].cur_dir_b);
 
 		return;
 	}
 
 	// Now, find two new points to build between
-	num = p->ai.num_build_rec;
-	aib = &p->ai.src;
+	num = _players_ai[p->index].num_build_rec;
+	aib = &_players_ai[p->index].src;
 
 	for (;;) {
 		cmd = aib->buildcmd_a;
@@ -3178,30 +3181,30 @@
 
 		aib++;
 		if (--num == 0) {
-			p->ai.state = AIS_BUILD_ROAD_VEHICLES;
+			_players_ai[p->index].state = AIS_BUILD_ROAD_VEHICLES;
 			return;
 		}
 	}
 
 	// Find first edge to build from.
 	tile = AiGetRoadBlockEdge(aib->cur_building_rule, aib->use_tile, &dir);
-	p->ai.start_tile_a = tile;
-	p->ai.cur_tile_a = tile;
-	p->ai.start_dir_a = dir;
-	p->ai.cur_dir_a = dir;
+	_players_ai[p->index].start_tile_a = tile;
+	_players_ai[p->index].cur_tile_a = tile;
+	_players_ai[p->index].start_dir_a = dir;
+	_players_ai[p->index].cur_dir_a = dir;
 
 	// Find second edge to build to
-	aib = (&p->ai.src) + (cmd & 0xF);
+	aib = (&_players_ai[p->index].src) + (cmd & 0xF);
 	tile = AiGetRoadBlockEdge(aib->cur_building_rule, aib->use_tile, &dir);
-	p->ai.start_tile_b = tile;
-	p->ai.cur_tile_b = tile;
-	p->ai.start_dir_b = dir;
-	p->ai.cur_dir_b = dir;
+	_players_ai[p->index].start_tile_b = tile;
+	_players_ai[p->index].cur_tile_b = tile;
+	_players_ai[p->index].start_dir_b = dir;
+	_players_ai[p->index].cur_dir_b = dir;
 
 	// And setup state.
-	p->ai.state_mode = 2;
-	p->ai.state_counter = 0;
-	p->ai.banned_tile_count = 0;
+	_players_ai[p->index].state_mode = 2;
+	_players_ai[p->index].state_counter = 0;
+	_players_ai[p->index].banned_tile_count = 0;
 }
 
 static StationID AiGetStationIdFromRoadBlock(TileIndex tile, int id)
@@ -3219,13 +3222,13 @@
 	EngineID veh;
 	uint i;
 
-	ptr = _road_default_block_data[p->ai.src.cur_building_rule]->data;
+	ptr = _road_default_block_data[_players_ai[p->index].src.cur_building_rule]->data;
 	for (; ptr->mode != 0; ptr++) {}
-	tile = TILE_ADD(p->ai.src.use_tile, ToTileIndexDiff(ptr->tileoffs));
-
-	veh = AiChooseRoadVehToBuild(p->ai.cargo_type, p->player_money, tile);
+	tile = TILE_ADD(_players_ai[p->index].src.use_tile, ToTileIndexDiff(ptr->tileoffs));
+
+	veh = AiChooseRoadVehToBuild(_players_ai[p->index].cargo_type, p->player_money, tile);
 	if (veh == INVALID_ENGINE) {
-		p->ai.state = AIS_0;
+		_players_ai[p->index].state = AIS_0;
 		return;
 	}
 
@@ -3233,21 +3236,21 @@
 
 	loco_id = _new_vehicle_id;
 
-	if (GetVehicle(loco_id)->cargo_type != p->ai.cargo_type) {
+	if (GetVehicle(loco_id)->cargo_type != _players_ai[p->index].cargo_type) {
 		/* Cargo type doesn't match, so refit it */
-		if (CmdFailed(DoCommand(tile, loco_id, p->ai.cargo_type, DC_EXEC, CMD_REFIT_ROAD_VEH))) {
+		if (CmdFailed(DoCommand(tile, loco_id, _players_ai[p->index].cargo_type, DC_EXEC, CMD_REFIT_ROAD_VEH))) {
 			/* Refit failed... sell the vehicle */
 			DoCommand(tile, loco_id, 0, DC_EXEC, CMD_SELL_ROAD_VEH);
 			return;
 		}
 	}
 
-	for (i = 0; p->ai.order_list_blocks[i] != 0xFF; i++) {
-		const AiBuildRec* aib = &p->ai.src + p->ai.order_list_blocks[i];
+	for (i = 0; _players_ai[p->index].order_list_blocks[i] != 0xFF; i++) {
+		const AiBuildRec* aib = &_players_ai[p->index].src + _players_ai[p->index].order_list_blocks[i];
 		bool is_pass = (
-			p->ai.cargo_type == CT_PASSENGERS ||
-			p->ai.cargo_type == CT_MAIL ||
-			(_opt.landscape == LT_TEMPERATE && p->ai.cargo_type == CT_VALUABLES)
+			_players_ai[p->index].cargo_type == CT_PASSENGERS ||
+			_players_ai[p->index].cargo_type == CT_MAIL ||
+			(_opt.landscape == LT_TEMPERATE && _players_ai[p->index].cargo_type == CT_VALUABLES)
 		);
 		Order order;
 
@@ -3255,9 +3258,9 @@
 		order.flags = 0;
 		order.dest = AiGetStationIdFromRoadBlock(aib->use_tile, aib->cur_building_rule);
 
-		if (!is_pass && i == 1) order.flags |= OF_UNLOAD;
-		if (p->ai.num_want_fullload != 0 && (is_pass || i == 0))
-			order.flags |= OF_FULL_LOAD;
+		if (!is_pass && i == 1) order.flags |= OFB_UNLOAD;
+		if (_players_ai[p->index].num_want_fullload != 0 && (is_pass || i == 0))
+			order.flags |= OFB_FULL_LOAD;
 
 		DoCommand(0, loco_id + (i << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
 	}
@@ -3265,14 +3268,14 @@
 	DoCommand(0, loco_id, 0, DC_EXEC, CMD_START_STOP_ROADVEH);
 	DoCommand(0, loco_id, _ai_service_interval, DC_EXEC, CMD_CHANGE_SERVICE_INT);
 
-	if (p->ai.num_want_fullload != 0) p->ai.num_want_fullload--;
-	if (--p->ai.num_loco_to_build == 0) p->ai.state = AIS_0;
+	if (_players_ai[p->index].num_want_fullload != 0) _players_ai[p->index].num_want_fullload--;
+	if (--_players_ai[p->index].num_loco_to_build == 0) _players_ai[p->index].state = AIS_0;
 }
 
 static void AiStateDeleteRoadBlocks(Player *p)
 {
-	const AiBuildRec* aib = &p->ai.src;
-	uint num = p->ai.num_build_rec;
+	const AiBuildRec* aib = &_players_ai[p->index].src;
+	uint num = _players_ai[p->index].num_build_rec;
 
 	do {
 		const AiDefaultBlockData* b;
@@ -3284,7 +3287,7 @@
 		}
 	} while (++aib, --num);
 
-	p->ai.state = AIS_0;
+	_players_ai[p->index].state = AIS_0;
 }
 
 
@@ -3305,7 +3308,7 @@
 		// We do this all twice - once for the source (town in the case
 		// of oilrig route) and then for the destination (oilrig in the
 		// case of oilrig route).
-		aib = &p->ai.src + i;
+		aib = &_players_ai[p->index].src + i;
 
 		FOR_ALL_STATIONS(st) {
 			// Is this an airport?
@@ -3316,7 +3319,7 @@
 
 			AirportFTAClass::Flags flags = st->Airport()->flags;
 
-			if (!(flags & (p->ai.build_kind == 1 && i == 0 ? AirportFTAClass::HELICOPTERS : AirportFTAClass::AIRPLANES))) {
+			if (!(flags & (_players_ai[p->index].build_kind == 1 && i == 0 ? AirportFTAClass::HELICOPTERS : AirportFTAClass::AIRPLANES))) {
 				continue;
 			}
 
@@ -3355,16 +3358,16 @@
 			aib->use_tile = st->airport_tile;
 			break;
 		}
-	} while (++i != p->ai.num_build_rec);
-
-	p->ai.state = AIS_BUILD_DEFAULT_AIRPORT_BLOCKS;
-	p->ai.state_mode = 255;
-	p->ai.state_counter = 0;
+	} while (++i != _players_ai[p->index].num_build_rec);
+
+	_players_ai[p->index].state = AIS_BUILD_DEFAULT_AIRPORT_BLOCKS;
+	_players_ai[p->index].state_mode = 255;
+	_players_ai[p->index].state_counter = 0;
 }
 
 static CommandCost AiDoBuildDefaultAirportBlock(TileIndex tile, uint16 airport, byte flag)
 {
-	CommandCost total_cost, ret;
+	CommandCost ret,total_cost(EXPENSES_CONSTRUCTION);
 
 	ret = DoCommand(tile, airport, 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_AIRPORT);
 	if (CmdFailed(ret)) return CMD_ERROR;
@@ -3414,8 +3417,8 @@
 	CommandCost cost;
 
 	// time out?
-	if (++p->ai.timeout_counter == 1388) {
-		p->ai.state = AIS_0;
+	if (++_players_ai[p->index].timeout_counter == 1388) {
+		_players_ai[p->index].state = AIS_0;
 		return;
 	}
 
@@ -3423,8 +3426,8 @@
 	i = 8;
 	do {
 		// check if we can build the default
-		aib = &p->ai.src;
-		j = p->ai.num_build_rec;
+		aib = &_players_ai[p->index].src;
+		j = _players_ai[p->index].num_build_rec;
 		do {
 			// this item has already been built?
 			if (aib->cur_building_rule != 255) continue;
@@ -3434,19 +3437,19 @@
 			aib->use_tile = AdjustTileCoordRandomly(aib->spec_tile, aib->rand_rng);
 
 			// check if the aircraft stuff can be built there.
-			int airport = AiFindBestDefaultAirportBlock(aib->use_tile, aib->cargo, p->ai.build_kind, &cost);
+			int airport = AiFindBestDefaultAirportBlock(aib->use_tile, aib->cargo, _players_ai[p->index].build_kind, &cost);
 
 //			SetRedErrorSquare(aib->use_tile);
 
 			if (airport == 0xFFFF) {
 				// cannot build, terraform after a while
-				if (p->ai.state_counter >= 600) {
-					AiDoTerraformLand(aib->use_tile, (DiagDirection)(Random() & 3), 3, (int8)p->ai.state_mode);
+				if (_players_ai[p->index].state_counter >= 600) {
+					AiDoTerraformLand(aib->use_tile, (DiagDirection)(Random() & 3), 3, (int8)_players_ai[p->index].state_mode);
 				}
 				// also try the other terraform direction
-				if (++p->ai.state_counter >= 1000) {
-					p->ai.state_counter = 0;
-					p->ai.state_mode = -p->ai.state_mode;
+				if (++_players_ai[p->index].state_counter >= 1000) {
+					_players_ai[p->index].state_counter = 0;
+					_players_ai[p->index].state_mode = -_players_ai[p->index].state_mode;
 				}
 			} else if (CheckPlayerHasMoney(cost) && AiCheckBlockDistances(p, aib->use_tile)) {
 				// player has money, build it.
@@ -3465,24 +3468,24 @@
 	} while (--i);
 
 	// check if we're done with all of them
-	aib = &p->ai.src;
-	j = p->ai.num_build_rec;
+	aib = &_players_ai[p->index].src;
+	j = _players_ai[p->index].num_build_rec;
 	do {
 		if (aib->cur_building_rule == 255) return;
 	} while (++aib, --j);
 
 	// yep, all are done. switch state.
-	p->ai.state = AIS_BUILD_AIRCRAFT_VEHICLES;
+	_players_ai[p->index].state = AIS_BUILD_AIRCRAFT_VEHICLES;
 }
 
 static void AiStateBuildAircraftVehicles(Player *p)
 {
-	TileIndex tile = p->ai.src.use_tile;
+	TileIndex tile = _players_ai[p->index].src.use_tile;
 	EngineID veh;
 	int i;
 	VehicleID loco_id;
 
-	veh = AiChooseAircraftToBuild(p->player_money, p->ai.build_kind != 0 ? 0 : AIR_CTOL);
+	veh = AiChooseAircraftToBuild(p->player_money, _players_ai[p->index].build_kind != 0 ? 0 : AIR_CTOL);
 	if (veh == INVALID_ENGINE) return;
 
 	/* XXX - Have the AI pick the hangar terminal in an airport. Eg get airport-type
@@ -3491,17 +3494,17 @@
 	if (CmdFailed(DoCommand(tile, veh, 0, DC_EXEC, CMD_BUILD_AIRCRAFT))) return;
 	loco_id = _new_vehicle_id;
 
-	for (i = 0; p->ai.order_list_blocks[i] != 0xFF; i++) {
-		bool is_pass = (p->ai.cargo_type == CT_PASSENGERS || p->ai.cargo_type == CT_MAIL);
+	for (i = 0; _players_ai[p->index].order_list_blocks[i] != 0xFF; i++) {
+		bool is_pass = (_players_ai[p->index].cargo_type == CT_PASSENGERS || _players_ai[p->index].cargo_type == CT_MAIL);
 		Order order;
 
 		order.type = OT_GOTO_STATION;
 		order.flags = 0;
 		order.dest = GetStationIndex(tile);
 
-		if (!is_pass && i == 1) order.flags |= OF_UNLOAD;
-		if (p->ai.num_want_fullload != 0 && (is_pass || i == 0))
-			order.flags |= OF_FULL_LOAD;
+		if (!is_pass && i == 1) order.flags |= OFB_UNLOAD;
+		if (_players_ai[p->index].num_want_fullload != 0 && (is_pass || i == 0))
+			order.flags |= OFB_FULL_LOAD;
 
 		DoCommand(0, loco_id + (i << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
 	}
@@ -3510,9 +3513,9 @@
 
 	DoCommand(0, loco_id, _ai_service_interval, DC_EXEC, CMD_CHANGE_SERVICE_INT);
 
-	if (p->ai.num_want_fullload != 0) p->ai.num_want_fullload--;
-
-	if (--p->ai.num_loco_to_build == 0) p->ai.state = AIS_0;
+	if (_players_ai[p->index].num_want_fullload != 0) _players_ai[p->index].num_want_fullload--;
+
+	if (--_players_ai[p->index].num_loco_to_build == 0) _players_ai[p->index].state = AIS_0;
 }
 
 static void AiStateCheckShipStuff(Player *p)
@@ -3532,7 +3535,7 @@
 
 static void AiStateSellVeh(Player *p)
 {
-	Vehicle *v = p->ai.cur_veh;
+	Vehicle *v = _players_ai[p->index].cur_veh;
 
 	if (v->owner == _current_player) {
 		if (v->type == VEH_TRAIN) {
@@ -3569,7 +3572,7 @@
 
 	goto return_to_loop;
 going_to_depot:;
-	if (++p->ai.state_counter <= 832) return;
+	if (++_players_ai[p->index].state_counter <= 832) return;
 
 	if (v->current_order.type == OT_GOTO_DEPOT) {
 		v->current_order.type = OT_DUMMY;
@@ -3577,7 +3580,7 @@
 		InvalidateWindow(WC_VEHICLE_VIEW, v->index);
 	}
 return_to_loop:;
-	p->ai.state = AIS_VEH_LOOP;
+	_players_ai[p->index].state = AIS_VEH_LOOP;
 }
 
 static void AiStateRemoveStation(Player *p)
@@ -3588,7 +3591,7 @@
 	TileIndex tile;
 
 	// Go to this state when we're done.
-	p->ai.state = AIS_1;
+	_players_ai[p->index].state = AIS_1;
 
 	// Get a list of all stations that are in use by a vehicle
 	byte *in_use = MallocT<byte>(GetMaxStationIndex() + 1);
@@ -3628,9 +3631,9 @@
 			if (rails & TRACK_BIT_3WAY_NE) {
 pos_0:
 				if ((GetRailTrackStatus(TILE_MASK(tile - TileDiffXY(1, 0))) & TRACK_BIT_3WAY_SW) == 0) {
-					p->ai.cur_dir_a = DIAGDIR_NE;
-					p->ai.cur_tile_a = tile;
-					p->ai.state = AIS_REMOVE_SINGLE_RAIL_TILE;
+					_players_ai[p->index].cur_dir_a = DIAGDIR_NE;
+					_players_ai[p->index].cur_tile_a = tile;
+					_players_ai[p->index].state = AIS_REMOVE_SINGLE_RAIL_TILE;
 					return;
 				}
 			}
@@ -3638,9 +3641,9 @@
 			if (rails & TRACK_BIT_3WAY_SE) {
 pos_1:
 				if ((GetRailTrackStatus(TILE_MASK(tile + TileDiffXY(0, 1))) & TRACK_BIT_3WAY_NW) == 0) {
-					p->ai.cur_dir_a = DIAGDIR_SE;
-					p->ai.cur_tile_a = tile;
-					p->ai.state = AIS_REMOVE_SINGLE_RAIL_TILE;
+					_players_ai[p->index].cur_dir_a = DIAGDIR_SE;
+					_players_ai[p->index].cur_tile_a = tile;
+					_players_ai[p->index].state = AIS_REMOVE_SINGLE_RAIL_TILE;
 					return;
 				}
 			}
@@ -3648,9 +3651,9 @@
 			if (rails & TRACK_BIT_3WAY_SW) {
 pos_2:
 				if ((GetRailTrackStatus(TILE_MASK(tile + TileDiffXY(1, 0))) & TRACK_BIT_3WAY_NE) == 0) {
-					p->ai.cur_dir_a = DIAGDIR_SW;
-					p->ai.cur_tile_a = tile;
-					p->ai.state = AIS_REMOVE_SINGLE_RAIL_TILE;
+					_players_ai[p->index].cur_dir_a = DIAGDIR_SW;
+					_players_ai[p->index].cur_tile_a = tile;
+					_players_ai[p->index].state = AIS_REMOVE_SINGLE_RAIL_TILE;
 					return;
 				}
 			}
@@ -3658,9 +3661,9 @@
 			if (rails & TRACK_BIT_3WAY_NW) {
 pos_3:
 				if ((GetRailTrackStatus(TILE_MASK(tile - TileDiffXY(0, 1))) & TRACK_BIT_3WAY_SE) == 0) {
-					p->ai.cur_dir_a = DIAGDIR_NW;
-					p->ai.cur_tile_a = tile;
-					p->ai.state = AIS_REMOVE_SINGLE_RAIL_TILE;
+					_players_ai[p->index].cur_dir_a = DIAGDIR_NW;
+					_players_ai[p->index].cur_tile_a = tile;
+					_players_ai[p->index].state = AIS_REMOVE_SINGLE_RAIL_TILE;
 					return;
 				}
 			}
@@ -3709,13 +3712,13 @@
 	} else if (IsTileType(tile, MP_TUNNELBRIDGE)) {
 		if (!IsTileOwner(tile, _current_player) ||
 				!IsBridge(tile) ||
-				GetBridgeTransportType(tile) != TRANSPORT_RAIL) {
+				GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL) {
 			return;
 		}
 
 		rails = TRACK_BIT_NONE;
 
-		switch (GetBridgeRampDirection(tile)) {
+		switch (GetTunnelBridgeDirection(tile)) {
 			default:
 			case DIAGDIR_NE: goto pos_2;
 			case DIAGDIR_SE: goto pos_3;
@@ -3731,24 +3734,24 @@
 	int num = MapSizeX() * 4;
 
 	do {
-		TileIndex tile = ++p->ai.state_counter;
+		TileIndex tile = ++_players_ai[p->index].state_counter;
 
 		// Iterated all tiles?
 		if (tile >= MapSize()) {
-			p->ai.state = AIS_REMOVE_STATION;
+			_players_ai[p->index].state = AIS_REMOVE_STATION;
 			return;
 		}
 
 		// Remove player stuff in that tile
 		AiRemovePlayerRailOrRoad(p, tile);
-		if (p->ai.state != AIS_REMOVE_TRACK) return;
+		if (_players_ai[p->index].state != AIS_REMOVE_TRACK) return;
 	} while (--num);
 }
 
 static void AiStateRemoveSingleRailTile(Player *p)
 {
 	// Remove until we can't remove more.
-	if (!AiRemoveTileAndGoForward(p)) p->ai.state = AIS_REMOVE_TRACK;
+	if (!AiRemoveTileAndGoForward(p)) _players_ai[p->index].state = AIS_REMOVE_TRACK;
 }
 
 static AiStateAction * const _ai_actions[] = {
@@ -3925,11 +3928,11 @@
 			"AiStateRemoveSingleRailTile"
 		};
 
-		if (p->ai.state != old_state) {
+		if (_players_ai[p->index].state != old_state) {
 			if (hasdots)
 				printf("\n");
 			hasdots=false;
-			printf("AiState: %s\n", _ai_state_names[old_state=p->ai.state]);
+			printf("AiState: %s\n", _ai_state_names[old_state=_players_ai[p->index].state]);
 		} else {
 			printf(".");
 			hasdots=true;
@@ -3937,5 +3940,76 @@
 	}
 #endif
 
-	_ai_actions[p->ai.state](p);
+	_ai_actions[_players_ai[p->index].state](p);
 }
+
+
+static const SaveLoad _player_ai_desc[] = {
+	    SLE_VAR(PlayerAI, state,             SLE_UINT8),
+	    SLE_VAR(PlayerAI, tick,              SLE_UINT8),
+	SLE_CONDVAR(PlayerAI, state_counter,     SLE_FILE_U16 | SLE_VAR_U32,  0, 12),
+	SLE_CONDVAR(PlayerAI, state_counter,     SLE_UINT32,                 13, SL_MAX_VERSION),
+	    SLE_VAR(PlayerAI, timeout_counter,   SLE_UINT16),
+
+	    SLE_VAR(PlayerAI, state_mode,        SLE_UINT8),
+	    SLE_VAR(PlayerAI, banned_tile_count, SLE_UINT8),
+	    SLE_VAR(PlayerAI, railtype_to_use,   SLE_UINT8),
+
+	    SLE_VAR(PlayerAI, cargo_type,        SLE_UINT8),
+	    SLE_VAR(PlayerAI, num_wagons,        SLE_UINT8),
+	    SLE_VAR(PlayerAI, build_kind,        SLE_UINT8),
+	    SLE_VAR(PlayerAI, num_build_rec,     SLE_UINT8),
+	    SLE_VAR(PlayerAI, num_loco_to_build, SLE_UINT8),
+	    SLE_VAR(PlayerAI, num_want_fullload, SLE_UINT8),
+
+	    SLE_VAR(PlayerAI, route_type_mask,   SLE_UINT8),
+
+	SLE_CONDVAR(PlayerAI, start_tile_a,      SLE_FILE_U16 | SLE_VAR_U32,  0,  5),
+	SLE_CONDVAR(PlayerAI, start_tile_a,      SLE_UINT32,                  6, SL_MAX_VERSION),
+	SLE_CONDVAR(PlayerAI, cur_tile_a,        SLE_FILE_U16 | SLE_VAR_U32,  0,  5),
+	SLE_CONDVAR(PlayerAI, cur_tile_a,        SLE_UINT32,                  6, SL_MAX_VERSION),
+	    SLE_VAR(PlayerAI, start_dir_a,       SLE_UINT8),
+	    SLE_VAR(PlayerAI, cur_dir_a,         SLE_UINT8),
+
+	SLE_CONDVAR(PlayerAI, start_tile_b,      SLE_FILE_U16 | SLE_VAR_U32,  0,  5),
+	SLE_CONDVAR(PlayerAI, start_tile_b,      SLE_UINT32,                  6, SL_MAX_VERSION),
+	SLE_CONDVAR(PlayerAI, cur_tile_b,        SLE_FILE_U16 | SLE_VAR_U32,  0,  5),
+	SLE_CONDVAR(PlayerAI, cur_tile_b,        SLE_UINT32,                  6, SL_MAX_VERSION),
+	    SLE_VAR(PlayerAI, start_dir_b,       SLE_UINT8),
+	    SLE_VAR(PlayerAI, cur_dir_b,         SLE_UINT8),
+
+	    SLE_REF(PlayerAI, cur_veh,           REF_VEHICLE),
+
+	    SLE_ARR(PlayerAI, wagon_list,        SLE_UINT16, 9),
+	    SLE_ARR(PlayerAI, order_list_blocks, SLE_UINT8, 20),
+	    SLE_ARR(PlayerAI, banned_tiles,      SLE_UINT16, 16),
+
+	SLE_CONDNULL(64, 2, SL_MAX_VERSION),
+	SLE_END()
+};
+
+static const SaveLoad _player_ai_build_rec_desc[] = {
+	SLE_CONDVAR(AiBuildRec, spec_tile,         SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
+	SLE_CONDVAR(AiBuildRec, spec_tile,         SLE_UINT32,                 6, SL_MAX_VERSION),
+	SLE_CONDVAR(AiBuildRec, use_tile,          SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
+	SLE_CONDVAR(AiBuildRec, use_tile,          SLE_UINT32,                 6, SL_MAX_VERSION),
+	    SLE_VAR(AiBuildRec, rand_rng,          SLE_UINT8),
+	    SLE_VAR(AiBuildRec, cur_building_rule, SLE_UINT8),
+	    SLE_VAR(AiBuildRec, unk6,              SLE_UINT8),
+	    SLE_VAR(AiBuildRec, unk7,              SLE_UINT8),
+	    SLE_VAR(AiBuildRec, buildcmd_a,        SLE_UINT8),
+	    SLE_VAR(AiBuildRec, buildcmd_b,        SLE_UINT8),
+	    SLE_VAR(AiBuildRec, direction,         SLE_UINT8),
+	    SLE_VAR(AiBuildRec, cargo,             SLE_UINT8),
+	SLE_END()
+};
+
+
+void SaveLoad_AI(PlayerID id)
+{
+	PlayerAI *pai = &_players_ai[id];
+	SlObject(pai, _player_ai_desc);
+	for (int i = 0; i != pai->num_build_rec; i++) {
+		SlObject(&pai->src + i, _player_ai_build_rec_desc);
+	}
+}
--- a/src/ai/default/default.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/ai/default/default.h	Tue Jan 22 21:00:30 2008 +0000
@@ -3,6 +3,66 @@
 #ifndef DEFAULT_H
 #define DEFAULT_H
 
+#include "../../direction_type.h"
+#include "../../vehicle_type.h"
+#include "../../rail_type.h"
+
 void AiDoGameLoop(Player*);
+void SaveLoad_AI(PlayerID id);
+
+struct AiBuildRec {
+	TileIndex spec_tile;
+	TileIndex use_tile;
+	byte rand_rng;
+	byte cur_building_rule;
+	byte unk6;
+	byte unk7;
+	byte buildcmd_a;
+	byte buildcmd_b;
+	byte direction;
+	CargoID cargo;
+};
+
+struct PlayerAI {
+	byte state;
+	byte tick;            ///< Used to determine how often to move
+	uint32 state_counter; ///< Can hold tile index!
+	uint16 timeout_counter;
+
+	byte state_mode;
+	byte banned_tile_count;
+	RailTypeByte railtype_to_use;
+
+	CargoID cargo_type;
+	byte num_wagons;
+	byte build_kind;
+	byte num_build_rec;
+	byte num_loco_to_build;
+	byte num_want_fullload;
+
+	byte route_type_mask;
+
+	TileIndex start_tile_a;
+	TileIndex cur_tile_a;
+	DiagDirectionByte cur_dir_a;
+	DiagDirectionByte start_dir_a;
+
+	TileIndex start_tile_b;
+	TileIndex cur_tile_b;
+	DiagDirectionByte cur_dir_b;
+	DiagDirectionByte start_dir_b;
+
+	Vehicle *cur_veh; ///< only used by some states
+
+	AiBuildRec src, dst, mid1, mid2;
+
+	VehicleID wagon_list[9];
+	byte order_list_blocks[20];
+
+	TileIndex banned_tiles[16];
+	byte banned_val[16];
+};
+
+extern PlayerAI _players_ai[MAX_PLAYERS];
 
 #endif
--- a/src/ai/trolly/build.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/ai/trolly/build.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,17 +3,17 @@
 #include "../../stdafx.h"
 #include "../../openttd.h"
 #include "../../debug.h"
-#include "../../functions.h"
-#include "../../map.h"
 #include "../../road_map.h"
-#include "../../tile.h"
-#include "../../vehicle.h"
-#include "../../command.h"
+#include "../../command_func.h"
 #include "trolly.h"
 #include "../../engine.h"
 #include "../../station.h"
 #include "../../variables.h"
 #include "../../bridge.h"
+#include "../../vehicle_func.h"
+#include "../../vehicle_base.h"
+#include "../../player_base.h"
+#include "../../player_func.h"
 #include "../ai.h"
 
 // Build HQ
@@ -72,7 +72,7 @@
 	if (type2 == 0 && type != 0) type2 = type;
 
 	// Now, simply, build the bridge!
-	if (p->ainew.tbt == AI_TRAIN) {
+	if (_players_ainew[p->index].tbt == AI_TRAIN) {
 		return AI_DoCommand(tile_a, tile_b, (0x00 << 8) + type2, flag | DC_AUTO, CMD_BUILD_BRIDGE);
 	} else {
 		return AI_DoCommand(tile_a, tile_b, ((0x80 | ROADTYPES_ROAD) << 8) + type2, flag | DC_AUTO, CMD_BUILD_BRIDGE);
@@ -146,7 +146,7 @@
 				res = AI_DoCommand(route[part], 0, dir, flag, CMD_BUILD_SINGLE_RAIL);
 				if (CmdFailed(res)) {
 					// Problem.. let's just abort it all!
-					p->ainew.state = AI_STATE_NOTHING;
+					_players_ainew[p->index].state = AI_STATE_NOTHING;
 					return CommandCost();
 				}
 				cost.AddCost(res);
@@ -202,7 +202,7 @@
 					if (CmdFailed(res) && flag == DC_EXEC && !IsTileType(route[part], MP_ROAD) && !EnsureNoVehicleOnGround(route[part])) {
 						// Problem.. let's just abort it all!
 						DEBUG(ai, 0, "[BuidPath] route building failed at tile 0x%X, aborting", route[part]);
-						p->ainew.state = AI_STATE_NOTHING;
+						_players_ainew[p->index].state = AI_STATE_NOTHING;
 						return CommandCost();
 					}
 
@@ -228,7 +228,7 @@
 // It returns INVALID_ENGINE if not suitable engine is found
 EngineID AiNew_PickVehicle(Player *p)
 {
-	if (p->ainew.tbt == AI_TRAIN) {
+	if (_players_ainew[p->index].tbt == AI_TRAIN) {
 		// Not supported yet
 		return INVALID_ENGINE;
 	} else {
@@ -246,7 +246,7 @@
 			CommandCost ret;
 
 			/* Skip vehicles which can't take our cargo type */
-			if (rvi->cargo_type != p->ainew.cargo && !CanRefitTo(i, p->ainew.cargo)) continue;
+			if (rvi->cargo_type != _players_ainew[p->index].cargo && !CanRefitTo(i, _players_ainew[p->index].cargo)) continue;
 
 			// Is it availiable?
 			// Also, check if the reliability of the vehicle is above the AI_VEHICLE_MIN_RELIABILTY
@@ -274,20 +274,20 @@
 	Player* p = GetPlayer(_current_player);
 
 	if (success) {
-		p->ainew.state = AI_STATE_GIVE_ORDERS;
-		p->ainew.veh_id = _new_vehicle_id;
+		_players_ainew[p->index].state = AI_STATE_GIVE_ORDERS;
+		_players_ainew[p->index].veh_id = _new_vehicle_id;
 
-		if (GetVehicle(p->ainew.veh_id)->cargo_type != p->ainew.cargo) {
+		if (GetVehicle(_players_ainew[p->index].veh_id)->cargo_type != _players_ainew[p->index].cargo) {
 			/* Cargo type doesn't match, so refit it */
-			if (CmdFailed(DoCommand(tile, p->ainew.veh_id, p->ainew.cargo, DC_EXEC, CMD_REFIT_ROAD_VEH))) {
+			if (CmdFailed(DoCommand(tile, _players_ainew[p->index].veh_id, _players_ainew[p->index].cargo, DC_EXEC, CMD_REFIT_ROAD_VEH))) {
 				/* Refit failed, so sell the vehicle */
-				DoCommand(tile, p->ainew.veh_id, 0, DC_EXEC, CMD_SELL_ROAD_VEH);
-				p->ainew.state = AI_STATE_NOTHING;
+				DoCommand(tile, _players_ainew[p->index].veh_id, 0, DC_EXEC, CMD_SELL_ROAD_VEH);
+				_players_ainew[p->index].state = AI_STATE_NOTHING;
 			}
 		}
 	} else {
 		/* XXX this should be handled more gracefully */
-		p->ainew.state = AI_STATE_NOTHING;
+		_players_ainew[p->index].state = AI_STATE_NOTHING;
 	}
 }
 
@@ -298,7 +298,7 @@
 	EngineID i = AiNew_PickVehicle(p);
 
 	if (i == INVALID_ENGINE) return CMD_ERROR;
-	if (p->ainew.tbt == AI_TRAIN) return CMD_ERROR;
+	if (_players_ainew[p->index].tbt == AI_TRAIN) return CMD_ERROR;
 
 	if (flag & DC_EXEC) {
 		return AI_DoCommandCc(tile, i, 0, flag, CMD_BUILD_ROAD_VEH, CcAI);
@@ -310,7 +310,7 @@
 CommandCost AiNew_Build_Depot(Player* p, TileIndex tile, DiagDirection direction, byte flag)
 {
 	CommandCost ret, ret2;
-	if (p->ainew.tbt == AI_TRAIN) {
+	if (_players_ainew[p->index].tbt == AI_TRAIN) {
 		return AI_DoCommand(tile, 0, direction, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_TRAIN_DEPOT);
 	} else {
 		ret = AI_DoCommand(tile, direction, 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD_DEPOT);
--- a/src/ai/trolly/pathfinder.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/ai/trolly/pathfinder.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,15 +4,17 @@
 #include "../../openttd.h"
 #include "../../bridge_map.h"
 #include "../../debug.h"
-#include "../../functions.h"
-#include "../../map.h"
-#include "../../tile.h"
-#include "../../command.h"
+#include "../../command_func.h"
 #include "trolly.h"
 #include "../../depot.h"
 #include "../../tunnel_map.h"
 #include "../../bridge.h"
+#include "../../tunnelbridge_map.h"
 #include "../ai.h"
+#include "../../variables.h"
+#include "../../player_base.h"
+#include "../../player_func.h"
+
 
 #define TEST_STATION_NO_DIR 0xFF
 
@@ -27,14 +29,14 @@
 		// TODO: currently we only allow spots that can be access from al 4 directions...
 		//  should be fixed!!!
 		for (dir = 0; dir < 4; dir++) {
-			ret = AiNew_Build_Station(p, p->ainew.tbt, tile, 1, 1, dir, DC_QUERY_COST);
+			ret = AiNew_Build_Station(p, _players_ainew[p->index].tbt, tile, 1, 1, dir, DC_QUERY_COST);
 			if (CmdSucceeded(ret)) return true;
 		}
 		return false;
 	}
 
 	// return true if command succeeded, so the inverse of CmdFailed()
-	return CmdSucceeded(AiNew_Build_Station(p, p->ainew.tbt, tile, 1, 1, dir, DC_QUERY_COST));
+	return CmdSucceeded(AiNew_Build_Station(p, _players_ainew[p->index].tbt, tile, 1, 1, dir, DC_QUERY_COST));
 }
 
 
@@ -43,10 +45,7 @@
 	return
 		// MP_ROAD, but not a road depot?
 		(IsTileType(tile, MP_ROAD) && !IsTileDepotType(tile, TRANSPORT_ROAD)) ||
-		(IsTileType(tile, MP_TUNNELBRIDGE) && (
-			(IsTunnel(tile) && GetTunnelTransportType(tile) == TRANSPORT_ROAD) ||
-			(IsBridge(tile) && GetBridgeTransportType(tile) == TRANSPORT_ROAD)
-		));
+		(IsTileType(tile, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(tile) == TRANSPORT_ROAD);
 }
 
 
@@ -234,11 +233,7 @@
 			// If the next step is a bridge, we have to enter it the right way
 			if (!PathFinderInfo->rail_or_road && IsRoad(atile)) {
 				if (IsTileType(atile, MP_TUNNELBRIDGE)) {
-					if (IsTunnel(atile)) {
-						if (GetTunnelDirection(atile) != i) continue;
-					} else {
-						if (GetBridgeRampDirection(atile) != i) continue;
-					}
+					if (GetTunnelBridgeDirection(atile) != i) continue;
 				}
 			}
 
@@ -364,10 +359,6 @@
 
 extern Foundation GetRailFoundation(Slope tileh, TrackBits bits); // XXX function declaration in .c
 extern Foundation GetRoadFoundation(Slope tileh, RoadBits bits); // XXX function declaration in .c
-extern Foundation GetBridgeFoundation(Slope tileh, Axis); // XXX function declaration in .c
-enum BridgeFoundation {
-	BRIDGE_NO_FOUNDATION = 1 << 0 | 1 << 3 | 1 << 6 | 1 << 9 | 1 << 12,
-};
 
 // The most important function: it calculates the g-value
 static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, OpenListNode *parent)
@@ -408,10 +399,10 @@
 	if (parent_tileh != SLOPE_FLAT && parent->path.parent != NULL) {
 		// Skip if the tile was from a bridge or tunnel
 		if (parent->path.node.user_data[0] == 0 && current->user_data[0] == 0) {
+			static const uint32 SLOPED_TILEHS = (1 << SLOPE_NW) | (1 << SLOPE_SW) |  (1 << SLOPE_SE) | (1 << SLOPE_NE);
 			if (PathFinderInfo->rail_or_road) {
 				Foundation f = GetRailFoundation(parent_tileh, (TrackBits)(1 << AiNew_GetRailDirection(parent->path.parent->node.tile, parent->path.node.tile, current->tile)));
-				// Maybe is BRIDGE_NO_FOUNDATION a bit strange here, but it contains just the right information..
-				if (IsInclinedFoundation(f) || (!IsFoundation(f) && HasBit(BRIDGE_NO_FOUNDATION, parent_tileh))) {
+				if (IsInclinedFoundation(f) || (!IsFoundation(f) && HasBit(SLOPED_TILEHS, parent_tileh))) {
 					res += AI_PATHFINDER_TILE_GOES_UP_PENALTY;
 				} else {
 					res += AI_PATHFINDER_FOUNDATION_PENALTY;
@@ -419,7 +410,7 @@
 			} else {
 				if (!IsRoad(parent->path.node.tile) || !IsTileType(parent->path.node.tile, MP_TUNNELBRIDGE)) {
 					Foundation f = GetRoadFoundation(parent_tileh, (RoadBits)AiNew_GetRoadDirection(parent->path.parent->node.tile, parent->path.node.tile, current->tile));
-					if (IsInclinedFoundation(f) || (!IsFoundation(f) && HasBit(BRIDGE_NO_FOUNDATION, parent_tileh))) {
+					if (IsInclinedFoundation(f) || (!IsFoundation(f) && HasBit(SLOPED_TILEHS, parent_tileh))) {
 						res += AI_PATHFINDER_TILE_GOES_UP_PENALTY;
 					} else {
 						res += AI_PATHFINDER_FOUNDATION_PENALTY;
@@ -444,19 +435,9 @@
 		res += AI_PATHFINDER_BRIDGE_PENALTY * GetBridgeLength(current->tile, parent->path.node.tile);
 		// Check if we are going up or down, first for the starting point
 		// In user_data[0] is at the 8th bit the direction
-		if (!HasBit(BRIDGE_NO_FOUNDATION, parent_tileh)) {
-			if (IsLeveledFoundation(GetBridgeFoundation(parent_tileh, (Axis)((current->user_data[0] >> 8) & 1)))) {
-				res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
-			}
-		}
+		if (!HasBridgeFlatRamp(parent_tileh, (Axis)((current->user_data[0] >> 8) & 1))) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
 		// Second for the end point
-		if (!HasBit(BRIDGE_NO_FOUNDATION, tileh)) {
-			if (IsLeveledFoundation(GetBridgeFoundation(tileh, (Axis)((current->user_data[0] >> 8) & 1)))) {
-				res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
-			}
-		}
-		if (parent_tileh == SLOPE_FLAT) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
-		if (tileh == SLOPE_FLAT) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
+		if (!HasBridgeFlatRamp(tileh, (Axis)((current->user_data[0] >> 8) & 1))) res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY;
 	}
 
 	//  To prevent the AI from taking the fastest way in tiles, but not the fastest way
--- a/src/ai/trolly/shared.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/ai/trolly/shared.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,9 +3,10 @@
 #include "../../stdafx.h"
 #include "../../openttd.h"
 #include "../../debug.h"
-#include "../../map.h"
+#include "../../map_func.h"
+#include "../../vehicle_base.h"
+#include "../../player_base.h"
 #include "trolly.h"
-#include "../../vehicle.h"
 
 int AiNew_GetRailDirection(TileIndex tile_a, TileIndex tile_b, TileIndex tile_c)
 {
@@ -80,8 +81,8 @@
 	uint i;
 
 	for (i = 0; i < AI_MAX_SPECIAL_VEHICLES; i++) {
-		if (p->ainew.special_vehicles[i].veh_id == v->index) {
-			return p->ainew.special_vehicles[i].flag;
+		if (_players_ainew[p->index].special_vehicles[i].veh_id == v->index) {
+			return _players_ainew[p->index].special_vehicles[i].flag;
 		}
 	}
 
@@ -96,13 +97,13 @@
 	uint i;
 
 	for (i = 0; i < AI_MAX_SPECIAL_VEHICLES; i++) {
-		if (p->ainew.special_vehicles[i].veh_id == v->index) {
-			p->ainew.special_vehicles[i].flag |= flag;
+		if (_players_ainew[p->index].special_vehicles[i].veh_id == v->index) {
+			_players_ainew[p->index].special_vehicles[i].flag |= flag;
 			return true;
 		}
 		if (new_id == -1 &&
-				p->ainew.special_vehicles[i].veh_id == 0 &&
-				p->ainew.special_vehicles[i].flag == 0) {
+				_players_ainew[p->index].special_vehicles[i].veh_id == 0 &&
+				_players_ainew[p->index].special_vehicles[i].flag == 0) {
 			new_id = i;
 		}
 	}
@@ -112,7 +113,7 @@
 		DEBUG(ai, 1, "special_vehicles list is too small");
 		return false;
 	}
-	p->ainew.special_vehicles[new_id].veh_id = v->index;
-	p->ainew.special_vehicles[new_id].flag = flag;
+	_players_ainew[p->index].special_vehicles[new_id].veh_id = v->index;
+	_players_ainew[p->index].special_vehicles[new_id].flag = flag;
 	return true;
 }
--- a/src/ai/trolly/trolly.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/ai/trolly/trolly.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -20,13 +20,9 @@
 #include "../../stdafx.h"
 #include "../../openttd.h"
 #include "../../debug.h"
-#include "../../functions.h"
 #include "../../road_map.h"
 #include "../../station_map.h"
-#include "table/strings.h"
-#include "../../map.h"
-#include "../../tile.h"
-#include "../../command.h"
+#include "../../command_func.h"
 #include "trolly.h"
 #include "../../town.h"
 #include "../../industry.h"
@@ -34,9 +30,17 @@
 #include "../../engine.h"
 #include "../../gui.h"
 #include "../../depot.h"
-#include "../../vehicle.h"
-#include "../../date.h"
+#include "../../vehicle_base.h"
+#include "../../vehicle_func.h"
+#include "../../date_func.h"
 #include "../ai.h"
+#include "../../order.h"
+#include "../../player_base.h"
+#include "../../player_func.h"
+
+#include "table/strings.h"
+
+PlayerAiNew _players_ainew[MAX_PLAYERS];
 
 // This function is called after StartUp. It is the init of an AI
 static void AiNew_State_FirstTime(Player *p)
@@ -45,7 +49,7 @@
 	//   You have quickly a small mistake in the state-array
 	//   With that, everything would go wrong. Finding that, is almost impossible
 	//   With this assert, that problem can never happen.
-	assert(p->ainew.state == AI_STATE_FIRST_TIME);
+	assert(_players_ainew[p->index].state == AI_STATE_FIRST_TIME);
 	// We first have to init some things
 
 	if (_current_player == 1) ShowErrorMessage(INVALID_STRING_ID, TEMP_AI_IN_PROGRESS, 0, 0);
@@ -53,20 +57,20 @@
 	// The PathFinder (AyStar)
 	// TODO: Maybe when an AI goes bankrupt, this is de-init
 	//  or when coming from a savegame.. should be checked out!
-	p->ainew.path_info.start_tile_tl = 0;
-	p->ainew.path_info.start_tile_br = 0;
-	p->ainew.path_info.end_tile_tl = 0;
-	p->ainew.path_info.end_tile_br = 0;
-	p->ainew.pathfinder = new_AyStar_AiPathFinder(12, &p->ainew.path_info);
+	_players_ainew[p->index].path_info.start_tile_tl = 0;
+	_players_ainew[p->index].path_info.start_tile_br = 0;
+	_players_ainew[p->index].path_info.end_tile_tl = 0;
+	_players_ainew[p->index].path_info.end_tile_br = 0;
+	_players_ainew[p->index].pathfinder = new_AyStar_AiPathFinder(12, &_players_ainew[p->index].path_info);
 
-	p->ainew.idle = 0;
-	p->ainew.last_vehiclecheck_date = _date;
+	_players_ainew[p->index].idle = 0;
+	_players_ainew[p->index].last_vehiclecheck_date = _date;
 
 	// We ALWAYS start with a bus route.. just some basic money ;)
-	p->ainew.action = AI_ACTION_BUS_ROUTE;
+	_players_ainew[p->index].action = AI_ACTION_BUS_ROUTE;
 
 	// Let's popup the news, and after that, start building..
-	p->ainew.state = AI_STATE_WAKE_UP;
+	_players_ainew[p->index].state = AI_STATE_WAKE_UP;
 }
 
 
@@ -79,13 +83,13 @@
 //  This means that on Very Slow it will be between 16 and 48 days.. slow enough?
 static void AiNew_State_Nothing(Player *p)
 {
-	assert(p->ainew.state == AI_STATE_NOTHING);
+	assert(_players_ainew[p->index].state == AI_STATE_NOTHING);
 	// If we are done idling, start over again
-	if (p->ainew.idle == 0) p->ainew.idle = AI_RandomRange(DAY_TICKS * 2) + DAY_TICKS;
-	if (--p->ainew.idle == 0) {
+	if (_players_ainew[p->index].idle == 0) _players_ainew[p->index].idle = AI_RandomRange(DAY_TICKS * 2) + DAY_TICKS;
+	if (--_players_ainew[p->index].idle == 0) {
 		// We are done idling.. what you say? Let's do something!
 		// I mean.. the next tick ;)
-		p->ainew.state = AI_STATE_WAKE_UP;
+		_players_ainew[p->index].state = AI_STATE_WAKE_UP;
 	}
 }
 
@@ -98,7 +102,7 @@
 static void AiNew_State_WakeUp(Player *p)
 {
 	int c;
-	assert(p->ainew.state == AI_STATE_WAKE_UP);
+	assert(_players_ainew[p->index].state == AI_STATE_WAKE_UP);
 	// First, check if we have a HQ
 	if (p->location_of_house == 0) {
 		// We have no HQ yet, build one on a random place
@@ -113,95 +117,95 @@
 	Money money = p->player_money - AI_MINIMUM_MONEY;
 
 	// Let's pick an action!
-	if (p->ainew.action == AI_ACTION_NONE) {
+	if (_players_ainew[p->index].action == AI_ACTION_NONE) {
 		c = AI_Random() & 0xFF;
 		if (p->current_loan > 0 &&
 				p->old_economy[1].income > AI_MINIMUM_INCOME_FOR_LOAN &&
 				c < 10) {
-			p->ainew.action = AI_ACTION_REPAY_LOAN;
-		} else if (p->ainew.last_vehiclecheck_date + AI_DAYS_BETWEEN_VEHICLE_CHECKS < _date) {
+			_players_ainew[p->index].action = AI_ACTION_REPAY_LOAN;
+		} else if (_players_ainew[p->index].last_vehiclecheck_date + AI_DAYS_BETWEEN_VEHICLE_CHECKS < _date) {
 			// Check all vehicles once in a while
-			p->ainew.action = AI_ACTION_CHECK_ALL_VEHICLES;
-			p->ainew.last_vehiclecheck_date = _date;
+			_players_ainew[p->index].action = AI_ACTION_CHECK_ALL_VEHICLES;
+			_players_ainew[p->index].last_vehiclecheck_date = _date;
 		} else if (c < 100 && !_patches.ai_disable_veh_roadveh) {
 			// Do we have any spots for road-vehicles left open?
 			if (GetFreeUnitNumber(VEH_ROAD) <= _patches.max_roadveh) {
 				if (c < 85) {
-					p->ainew.action = AI_ACTION_TRUCK_ROUTE;
+					_players_ainew[p->index].action = AI_ACTION_TRUCK_ROUTE;
 				} else {
-					p->ainew.action = AI_ACTION_BUS_ROUTE;
+					_players_ainew[p->index].action = AI_ACTION_BUS_ROUTE;
 				}
 			}
 #if 0
 		} else if (c < 200 && !_patches.ai_disable_veh_train) {
 			if (GetFreeUnitNumber(VEH_TRAIN) <= _patches.max_trains) {
-				p->ainew.action = AI_ACTION_TRAIN_ROUTE;
+				_players_ainew[p->index].action = AI_ACTION_TRAIN_ROUTE;
 			}
 #endif
 		}
 
-		p->ainew.counter = 0;
+		_players_ainew[p->index].counter = 0;
 	}
 
-	if (p->ainew.counter++ > AI_MAX_TRIES_FOR_SAME_ROUTE) {
-		p->ainew.action = AI_ACTION_NONE;
+	if (_players_ainew[p->index].counter++ > AI_MAX_TRIES_FOR_SAME_ROUTE) {
+		_players_ainew[p->index].action = AI_ACTION_NONE;
 		return;
 	}
 
 	if (_patches.ai_disable_veh_roadveh && (
-				p->ainew.action == AI_ACTION_BUS_ROUTE ||
-				p->ainew.action == AI_ACTION_TRUCK_ROUTE
+				_players_ainew[p->index].action == AI_ACTION_BUS_ROUTE ||
+				_players_ainew[p->index].action == AI_ACTION_TRUCK_ROUTE
 			)) {
-		p->ainew.action = AI_ACTION_NONE;
+		_players_ainew[p->index].action = AI_ACTION_NONE;
 		return;
 	}
 
-	if (p->ainew.action == AI_ACTION_REPAY_LOAN &&
+	if (_players_ainew[p->index].action == AI_ACTION_REPAY_LOAN &&
 			money > AI_MINIMUM_LOAN_REPAY_MONEY) {
 		// We start repaying some money..
-		p->ainew.state = AI_STATE_REPAY_MONEY;
+		_players_ainew[p->index].state = AI_STATE_REPAY_MONEY;
 		return;
 	}
 
-	if (p->ainew.action == AI_ACTION_CHECK_ALL_VEHICLES) {
-		p->ainew.state = AI_STATE_CHECK_ALL_VEHICLES;
+	if (_players_ainew[p->index].action == AI_ACTION_CHECK_ALL_VEHICLES) {
+		_players_ainew[p->index].state = AI_STATE_CHECK_ALL_VEHICLES;
 		return;
 	}
 
 	// It is useless to start finding a route if we don't have enough money
 	//  to build the route anyway..
-	if (p->ainew.action == AI_ACTION_BUS_ROUTE &&
+	if (_players_ainew[p->index].action == AI_ACTION_BUS_ROUTE &&
 			money > AI_MINIMUM_BUS_ROUTE_MONEY) {
 		if (GetFreeUnitNumber(VEH_ROAD) > _patches.max_roadveh) {
-			p->ainew.action = AI_ACTION_NONE;
+			_players_ainew[p->index].action = AI_ACTION_NONE;
 			return;
 		}
-		p->ainew.cargo = AI_NEED_CARGO;
-		p->ainew.state = AI_STATE_LOCATE_ROUTE;
-		p->ainew.tbt = AI_BUS; // Bus-route
+		_players_ainew[p->index].cargo = AI_NEED_CARGO;
+		_players_ainew[p->index].state = AI_STATE_LOCATE_ROUTE;
+		_players_ainew[p->index].tbt = AI_BUS; // Bus-route
 		return;
 	}
-	if (p->ainew.action == AI_ACTION_TRUCK_ROUTE &&
+	if (_players_ainew[p->index].action == AI_ACTION_TRUCK_ROUTE &&
 			money > AI_MINIMUM_TRUCK_ROUTE_MONEY) {
 		if (GetFreeUnitNumber(VEH_ROAD) > _patches.max_roadveh) {
-			p->ainew.action = AI_ACTION_NONE;
+			_players_ainew[p->index].action = AI_ACTION_NONE;
 			return;
 		}
-		p->ainew.cargo = AI_NEED_CARGO;
-		p->ainew.last_id = 0;
-		p->ainew.state = AI_STATE_LOCATE_ROUTE;
-		p->ainew.tbt = AI_TRUCK;
+		_players_ainew[p->index].cargo = AI_NEED_CARGO;
+		_players_ainew[p->index].last_id = 0;
+		_players_ainew[p->index].state = AI_STATE_LOCATE_ROUTE;
+		_players_ainew[p->index].tbt = AI_TRUCK;
 		return;
 	}
 
-	p->ainew.state = AI_STATE_NOTHING;
+	_players_ainew[p->index].state = AI_STATE_NOTHING;
 }
 
 
 static void AiNew_State_ActionDone(Player *p)
 {
-	p->ainew.action = AI_ACTION_NONE;
-	p->ainew.state = AI_STATE_NOTHING;
+	_players_ainew[p->index].action = AI_ACTION_NONE;
+	_players_ainew[p->index].state = AI_STATE_NOTHING;
 }
 
 
@@ -231,7 +235,7 @@
 			// Do we own it?
 			if (st->owner == _current_player) {
 				// Are we talking busses?
-				if (p->ainew.tbt == AI_BUS && (FACIL_BUS_STOP & st->facilities) != FACIL_BUS_STOP) continue;
+				if (_players_ainew[p->index].tbt == AI_BUS && (FACIL_BUS_STOP & st->facilities) != FACIL_BUS_STOP) continue;
 				// Is it the same city as we are in now?
 				if (st->town != t) continue;
 				// When was this station build?
@@ -289,7 +293,7 @@
 			// Do we own it?
 			if (st->owner == _current_player) {
 				// Are we talking trucks?
-				if (p->ainew.tbt == AI_TRUCK && (FACIL_TRUCK_STOP & st->facilities) != FACIL_TRUCK_STOP) continue;
+				if (_players_ainew[p->index].tbt == AI_TRUCK && (FACIL_TRUCK_STOP & st->facilities) != FACIL_TRUCK_STOP) continue;
 				// Is it the same city as we are in now?
 				if (st->town != i->town) continue;
 				// When was this station build?
@@ -333,30 +337,30 @@
 // This functions tries to locate a good route
 static void AiNew_State_LocateRoute(Player *p)
 {
-	assert(p->ainew.state == AI_STATE_LOCATE_ROUTE);
+	assert(_players_ainew[p->index].state == AI_STATE_LOCATE_ROUTE);
 	// For now, we only support PASSENGERS, CITY and BUSSES
 
 	// We don't have a route yet
-	if (p->ainew.cargo == AI_NEED_CARGO) {
-		p->ainew.new_cost = 0; // No cost yet
-		p->ainew.temp = -1;
+	if (_players_ainew[p->index].cargo == AI_NEED_CARGO) {
+		_players_ainew[p->index].new_cost = 0; // No cost yet
+		_players_ainew[p->index].temp = -1;
 		// Reset the counter
-		p->ainew.counter = 0;
+		_players_ainew[p->index].counter = 0;
 
-		p->ainew.from_ic = -1;
-		p->ainew.to_ic = -1;
-		if (p->ainew.tbt == AI_BUS) {
+		_players_ainew[p->index].from_ic = -1;
+		_players_ainew[p->index].to_ic = -1;
+		if (_players_ainew[p->index].tbt == AI_BUS) {
 			// For now we only have a passenger route
-			p->ainew.cargo = CT_PASSENGERS;
+			_players_ainew[p->index].cargo = CT_PASSENGERS;
 
 			// Find a route to cities
-			p->ainew.from_type = AI_CITY;
-			p->ainew.to_type = AI_CITY;
-		} else if (p->ainew.tbt == AI_TRUCK) {
-			p->ainew.cargo = AI_NO_CARGO;
+			_players_ainew[p->index].from_type = AI_CITY;
+			_players_ainew[p->index].to_type = AI_CITY;
+		} else if (_players_ainew[p->index].tbt == AI_TRUCK) {
+			_players_ainew[p->index].cargo = AI_NO_CARGO;
 
-			p->ainew.from_type = AI_INDUSTRY;
-			p->ainew.to_type = AI_INDUSTRY;
+			_players_ainew[p->index].from_type = AI_INDUSTRY;
+			_players_ainew[p->index].to_type = AI_INDUSTRY;
 		}
 
 		// Now we are doing initing, we wait one tick
@@ -364,63 +368,63 @@
 	}
 
 	// Increase the counter and abort if it is taking too long!
-	p->ainew.counter++;
-	if (p->ainew.counter > AI_LOCATE_ROUTE_MAX_COUNTER) {
+	_players_ainew[p->index].counter++;
+	if (_players_ainew[p->index].counter > AI_LOCATE_ROUTE_MAX_COUNTER) {
 		// Switch back to doing nothing!
-		p->ainew.state = AI_STATE_NOTHING;
+		_players_ainew[p->index].state = AI_STATE_NOTHING;
 		return;
 	}
 
 	// We are going to locate a city from where we are going to connect
-	if (p->ainew.from_ic == -1) {
-		if (p->ainew.temp == -1) {
+	if (_players_ainew[p->index].from_ic == -1) {
+		if (_players_ainew[p->index].temp == -1) {
 			// First, we pick a random spot to search from
-			if (p->ainew.from_type == AI_CITY) {
-				p->ainew.temp = AI_RandomRange(GetMaxTownIndex() + 1);
+			if (_players_ainew[p->index].from_type == AI_CITY) {
+				_players_ainew[p->index].temp = AI_RandomRange(GetMaxTownIndex() + 1);
 			} else {
-				p->ainew.temp = AI_RandomRange(GetMaxIndustryIndex() + 1);
+				_players_ainew[p->index].temp = AI_RandomRange(GetMaxIndustryIndex() + 1);
 			}
 		}
 
-		if (!AiNew_Check_City_or_Industry(p, p->ainew.temp, p->ainew.from_type)) {
+		if (!AiNew_Check_City_or_Industry(p, _players_ainew[p->index].temp, _players_ainew[p->index].from_type)) {
 			// It was not a valid city
 			//  increase the temp with one, and return. We will come back later here
 			//  to try again
-			p->ainew.temp++;
-			if (p->ainew.from_type == AI_CITY) {
-				if (p->ainew.temp > GetMaxTownIndex()) p->ainew.temp = 0;
+			_players_ainew[p->index].temp++;
+			if (_players_ainew[p->index].from_type == AI_CITY) {
+				if (_players_ainew[p->index].temp > GetMaxTownIndex()) _players_ainew[p->index].temp = 0;
 			} else {
-				if (p->ainew.temp > GetMaxIndustryIndex()) p->ainew.temp = 0;
+				if (_players_ainew[p->index].temp > GetMaxIndustryIndex()) _players_ainew[p->index].temp = 0;
 			}
 
 			// Don't do an attempt if we are trying the same id as the last time...
-			if (p->ainew.last_id == p->ainew.temp) return;
-			p->ainew.last_id = p->ainew.temp;
+			if (_players_ainew[p->index].last_id == _players_ainew[p->index].temp) return;
+			_players_ainew[p->index].last_id = _players_ainew[p->index].temp;
 
 			return;
 		}
 
 		// We found a good city/industry, save the data of it
-		p->ainew.from_ic = p->ainew.temp;
+		_players_ainew[p->index].from_ic = _players_ainew[p->index].temp;
 
 		// Start the next tick with finding a to-city
-		p->ainew.temp = -1;
+		_players_ainew[p->index].temp = -1;
 		return;
 	}
 
 	// Find a to-city
-	if (p->ainew.temp == -1) {
+	if (_players_ainew[p->index].temp == -1) {
 		// First, we pick a random spot to search to
-		if (p->ainew.to_type == AI_CITY) {
-			p->ainew.temp = AI_RandomRange(GetMaxTownIndex() + 1);
+		if (_players_ainew[p->index].to_type == AI_CITY) {
+			_players_ainew[p->index].temp = AI_RandomRange(GetMaxTownIndex() + 1);
 		} else {
-			p->ainew.temp = AI_RandomRange(GetMaxIndustryIndex() + 1);
+			_players_ainew[p->index].temp = AI_RandomRange(GetMaxIndustryIndex() + 1);
 		}
 	}
 
 	// The same city is not allowed
 	// Also check if the city is valid
-	if (p->ainew.temp != p->ainew.from_ic && AiNew_Check_City_or_Industry(p, p->ainew.temp, p->ainew.to_type)) {
+	if (_players_ainew[p->index].temp != _players_ainew[p->index].from_ic && AiNew_Check_City_or_Industry(p, _players_ainew[p->index].temp, _players_ainew[p->index].to_type)) {
 		// Maybe it is valid..
 
 		/* We need to know if they are not to far apart from eachother..
@@ -428,9 +432,9 @@
 		 * route is.
 		 */
 
-		if (p->ainew.from_type == AI_CITY && p->ainew.tbt == AI_BUS) {
-			const Town* town_from = GetTown(p->ainew.from_ic);
-			const Town* town_temp = GetTown(p->ainew.temp);
+		if (_players_ainew[p->index].from_type == AI_CITY && _players_ainew[p->index].tbt == AI_BUS) {
+			const Town* town_from = GetTown(_players_ainew[p->index].from_ic);
+			const Town* town_temp = GetTown(_players_ainew[p->index].temp);
 			uint distance = DistanceManhattan(town_from->xy, town_temp->xy);
 			int max_cargo;
 
@@ -441,23 +445,23 @@
 			// If it is more than the distance, we allow it
 			if (distance <= max_cargo * AI_LOCATEROUTE_BUS_CARGO_DISTANCE) {
 				// We found a good city/industry, save the data of it
-				p->ainew.to_ic = p->ainew.temp;
-				p->ainew.state = AI_STATE_FIND_STATION;
+				_players_ainew[p->index].to_ic = _players_ainew[p->index].temp;
+				_players_ainew[p->index].state = AI_STATE_FIND_STATION;
 
 				DEBUG(ai, 1, "[LocateRoute] found bus-route of %d tiles long (from %d to %d)",
 					distance,
-					p->ainew.from_ic,
-					p->ainew.temp
+					_players_ainew[p->index].from_ic,
+					_players_ainew[p->index].temp
 				);
 
-				p->ainew.from_tile = 0;
-				p->ainew.to_tile = 0;
+				_players_ainew[p->index].from_tile = 0;
+				_players_ainew[p->index].to_tile = 0;
 
 				return;
 			}
-		} else if (p->ainew.tbt == AI_TRUCK) {
-			const Industry* ind_from = GetIndustry(p->ainew.from_ic);
-			const Industry* ind_temp = GetIndustry(p->ainew.temp);
+		} else if (_players_ainew[p->index].tbt == AI_TRUCK) {
+			const Industry* ind_from = GetIndustry(_players_ainew[p->index].from_ic);
+			const Industry* ind_temp = GetIndustry(_players_ainew[p->index].temp);
 			bool found = false;
 			int max_cargo = 0;
 			uint i;
@@ -471,8 +475,8 @@
 						// Found a compatible industry
 						max_cargo = ind_from->last_month_production[0] - ind_from->last_month_transported[0];
 						found = true;
-						p->ainew.from_deliver = true;
-						p->ainew.to_deliver = false;
+						_players_ainew[p->index].from_deliver = true;
+						_players_ainew[p->index].to_deliver = false;
 						break;
 					}
 				}
@@ -485,8 +489,8 @@
 						// Found a compatbiel industry
 						found = true;
 						max_cargo = ind_temp->last_month_production[0] - ind_temp->last_month_transported[0];
-						p->ainew.from_deliver = false;
-						p->ainew.to_deliver = true;
+						_players_ainew[p->index].from_deliver = false;
+						_players_ainew[p->index].to_deliver = true;
 						break;
 					}
 				}
@@ -498,22 +502,22 @@
 
 				if (distance > AI_LOCATEROUTE_TRUCK_MIN_DISTANCE &&
 						distance <= max_cargo * AI_LOCATEROUTE_TRUCK_CARGO_DISTANCE) {
-					p->ainew.to_ic = p->ainew.temp;
-					if (p->ainew.from_deliver) {
-						p->ainew.cargo = ind_from->produced_cargo[0];
+					_players_ainew[p->index].to_ic = _players_ainew[p->index].temp;
+					if (_players_ainew[p->index].from_deliver) {
+						_players_ainew[p->index].cargo = ind_from->produced_cargo[0];
 					} else {
-						p->ainew.cargo = ind_temp->produced_cargo[0];
+						_players_ainew[p->index].cargo = ind_temp->produced_cargo[0];
 					}
-					p->ainew.state = AI_STATE_FIND_STATION;
+					_players_ainew[p->index].state = AI_STATE_FIND_STATION;
 
 					DEBUG(ai, 1, "[LocateRoute] found truck-route of %d tiles long (from %d to %d)",
 						distance,
-						p->ainew.from_ic,
-						p->ainew.temp
+						_players_ainew[p->index].from_ic,
+						_players_ainew[p->index].temp
 					);
 
-					p->ainew.from_tile = 0;
-					p->ainew.to_tile = 0;
+					_players_ainew[p->index].from_tile = 0;
+					_players_ainew[p->index].to_tile = 0;
 
 					return;
 				}
@@ -524,16 +528,16 @@
 	// It was not a valid city
 	//  increase the temp with one, and return. We will come back later here
 	//  to try again
-	p->ainew.temp++;
-	if (p->ainew.to_type == AI_CITY) {
-		if (p->ainew.temp > GetMaxTownIndex()) p->ainew.temp = 0;
+	_players_ainew[p->index].temp++;
+	if (_players_ainew[p->index].to_type == AI_CITY) {
+		if (_players_ainew[p->index].temp > GetMaxTownIndex()) _players_ainew[p->index].temp = 0;
 	} else {
-		if (p->ainew.temp > GetMaxIndustryIndex()) p->ainew.temp = 0;
+		if (_players_ainew[p->index].temp > GetMaxIndustryIndex()) _players_ainew[p->index].temp = 0;
 	}
 
 	// Don't do an attempt if we are trying the same id as the last time...
-	if (p->ainew.last_id == p->ainew.temp) return;
-	p->ainew.last_id = p->ainew.temp;
+	if (_players_ainew[p->index].last_id == _players_ainew[p->index].temp) return;
+	_players_ainew[p->index].last_id = _players_ainew[p->index].temp;
 }
 
 
@@ -572,29 +576,29 @@
 	TileIndex new_tile = 0;
 	DiagDirection direction = DIAGDIR_NE;
 	Town *town = NULL;
-	assert(p->ainew.state == AI_STATE_FIND_STATION);
+	assert(_players_ainew[p->index].state == AI_STATE_FIND_STATION);
 
-	if (p->ainew.from_tile == 0) {
+	if (_players_ainew[p->index].from_tile == 0) {
 		// First we scan for a station in the from-city
-		if (p->ainew.from_type == AI_CITY) {
-			town = GetTown(p->ainew.from_ic);
+		if (_players_ainew[p->index].from_type == AI_CITY) {
+			town = GetTown(_players_ainew[p->index].from_ic);
 			tile = town->xy;
 		} else {
-			tile = GetIndustry(p->ainew.from_ic)->xy;
+			tile = GetIndustry(_players_ainew[p->index].from_ic)->xy;
 		}
-	} else if (p->ainew.to_tile == 0) {
+	} else if (_players_ainew[p->index].to_tile == 0) {
 		// Second we scan for a station in the to-city
-		if (p->ainew.to_type == AI_CITY) {
-			town = GetTown(p->ainew.to_ic);
+		if (_players_ainew[p->index].to_type == AI_CITY) {
+			town = GetTown(_players_ainew[p->index].to_ic);
 			tile = town->xy;
 		} else {
-			tile = GetIndustry(p->ainew.to_ic)->xy;
+			tile = GetIndustry(_players_ainew[p->index].to_ic)->xy;
 		}
 	} else {
 		// Unsupported request
 		// Go to FIND_PATH
-		p->ainew.temp = -1;
-		p->ainew.state = AI_STATE_FIND_PATH;
+		_players_ainew[p->index].temp = -1;
+		_players_ainew[p->index].state = AI_STATE_FIND_PATH;
 		return;
 	}
 
@@ -605,16 +609,16 @@
 	// Euhmz, this should not happen _EVER_
 	// Quit finding a route...
 	if (i == INVALID_ENGINE) {
-		p->ainew.state = AI_STATE_NOTHING;
+		_players_ainew[p->index].state = AI_STATE_NOTHING;
 		return;
 	}
 
 	FOR_ALL_STATIONS(st) {
 		if (st->owner == _current_player) {
-			if (p->ainew.tbt == AI_BUS && (FACIL_BUS_STOP & st->facilities) == FACIL_BUS_STOP) {
+			if (_players_ainew[p->index].tbt == AI_BUS && (FACIL_BUS_STOP & st->facilities) == FACIL_BUS_STOP) {
 				if (st->town == town) {
 					// Check how much cargo there is left in the station
-					if ((int)st->goods[p->ainew.cargo].cargo.Count() > RoadVehInfo(i)->capacity * AI_STATION_REUSE_MULTIPLER) {
+					if ((int)st->goods[_players_ainew[p->index].cargo].cargo.Count() > RoadVehInfo(i)->capacity * AI_STATION_REUSE_MULTIPLER) {
 						if (AiNew_CheckVehicleStation(p, st)) {
 							// We did found a station that was good enough!
 							new_tile = st->xy;
@@ -632,11 +636,11 @@
 	// No more than 2 stations allowed in a city
 	//  This is because only the best 2 stations of one cargo do get any cargo
 	if (count > 2) {
-		p->ainew.state = AI_STATE_NOTHING;
+		_players_ainew[p->index].state = AI_STATE_NOTHING;
 		return;
 	}
 
-	if (new_tile == 0 && p->ainew.tbt == AI_BUS) {
+	if (new_tile == 0 && _players_ainew[p->index].tbt == AI_BUS) {
 		uint x, y, i = 0;
 		CommandCost r;
 		uint best;
@@ -656,20 +660,20 @@
 					// XXX - Get the catchment area
 					GetAcceptanceAroundTiles(accepts, new_tile, 1, 1, 4);
 					// >> 3 == 0 means no cargo
-					if (accepts[p->ainew.cargo] >> 3 == 0) continue;
+					if (accepts[_players_ainew[p->index].cargo] >> 3 == 0) continue;
 					// See if we can build the station
-					r = AiNew_Build_Station(p, p->ainew.tbt, new_tile, 0, 0, 0, DC_QUERY_COST);
+					r = AiNew_Build_Station(p, _players_ainew[p->index].tbt, new_tile, 0, 0, 0, DC_QUERY_COST);
 					if (CmdFailed(r)) continue;
 					// We can build it, so add it to found_spot
 					found_spot[i] = new_tile;
-					found_best[i++] = accepts[p->ainew.cargo];
+					found_best[i++] = accepts[_players_ainew[p->index].cargo];
 				}
 			}
 		}
 
 		// If i is still zero, we did not find anything
 		if (i == 0) {
-			p->ainew.state = AI_STATE_NOTHING;
+			_players_ainew[p->index].state = AI_STATE_NOTHING;
 			return;
 		}
 
@@ -686,11 +690,11 @@
 		}
 
 		// See how much it is going to cost us...
-		r = AiNew_Build_Station(p, p->ainew.tbt, new_tile, 0, 0, 0, DC_QUERY_COST);
-		p->ainew.new_cost += r.GetCost();
+		r = AiNew_Build_Station(p, _players_ainew[p->index].tbt, new_tile, 0, 0, 0, DC_QUERY_COST);
+		_players_ainew[p->index].new_cost += r.GetCost();
 
 		direction = (DiagDirection)AI_PATHFINDER_NO_DIRECTION;
-	} else if (new_tile == 0 && p->ainew.tbt == AI_TRUCK) {
+	} else if (new_tile == 0 && _players_ainew[p->index].tbt == AI_TRUCK) {
 		// Truck station locater works differently.. a station can be on any place
 		//  as long as it is in range. So we give back code AI_STATION_RANGE
 		//  so the pathfinder routine can work it out!
@@ -698,17 +702,17 @@
 		direction = (DiagDirection)AI_PATHFINDER_NO_DIRECTION;
 	}
 
-	if (p->ainew.from_tile == 0) {
-		p->ainew.from_tile = new_tile;
-		p->ainew.from_direction = direction;
+	if (_players_ainew[p->index].from_tile == 0) {
+		_players_ainew[p->index].from_tile = new_tile;
+		_players_ainew[p->index].from_direction = direction;
 		// Now we found thisone, go in for to_tile
 		return;
-	} else if (p->ainew.to_tile == 0) {
-		p->ainew.to_tile = new_tile;
-		p->ainew.to_direction = direction;
+	} else if (_players_ainew[p->index].to_tile == 0) {
+		_players_ainew[p->index].to_tile = new_tile;
+		_players_ainew[p->index].to_direction = direction;
 		// K, done placing stations!
-		p->ainew.temp = -1;
-		p->ainew.state = AI_STATE_FIND_PATH;
+		_players_ainew[p->index].temp = -1;
+		_players_ainew[p->index].state = AI_STATE_FIND_PATH;
 		return;
 	}
 }
@@ -718,56 +722,56 @@
 static void AiNew_State_FindPath(Player *p)
 {
 	int r;
-	assert(p->ainew.state == AI_STATE_FIND_PATH);
+	assert(_players_ainew[p->index].state == AI_STATE_FIND_PATH);
 
 	// First time, init some data
-	if (p->ainew.temp == -1) {
+	if (_players_ainew[p->index].temp == -1) {
 		// Init path_info
-		if (p->ainew.from_tile == AI_STATION_RANGE) {
-			const Industry* i = GetIndustry(p->ainew.from_ic);
+		if (_players_ainew[p->index].from_tile == AI_STATION_RANGE) {
+			const Industry* i = GetIndustry(_players_ainew[p->index].from_ic);
 
 			// For truck routes we take a range around the industry
-			p->ainew.path_info.start_tile_tl = i->xy - TileDiffXY(1, 1);
-			p->ainew.path_info.start_tile_br = i->xy + TileDiffXY(i->width + 1, i->height + 1);
-			p->ainew.path_info.start_direction = p->ainew.from_direction;
+			_players_ainew[p->index].path_info.start_tile_tl = i->xy - TileDiffXY(1, 1);
+			_players_ainew[p->index].path_info.start_tile_br = i->xy + TileDiffXY(i->width + 1, i->height + 1);
+			_players_ainew[p->index].path_info.start_direction = _players_ainew[p->index].from_direction;
 		} else {
-			p->ainew.path_info.start_tile_tl = p->ainew.from_tile;
-			p->ainew.path_info.start_tile_br = p->ainew.from_tile;
-			p->ainew.path_info.start_direction = p->ainew.from_direction;
+			_players_ainew[p->index].path_info.start_tile_tl = _players_ainew[p->index].from_tile;
+			_players_ainew[p->index].path_info.start_tile_br = _players_ainew[p->index].from_tile;
+			_players_ainew[p->index].path_info.start_direction = _players_ainew[p->index].from_direction;
 		}
 
-		if (p->ainew.to_tile == AI_STATION_RANGE) {
-			const Industry* i = GetIndustry(p->ainew.to_ic);
+		if (_players_ainew[p->index].to_tile == AI_STATION_RANGE) {
+			const Industry* i = GetIndustry(_players_ainew[p->index].to_ic);
 
-			p->ainew.path_info.end_tile_tl = i->xy - TileDiffXY(1, 1);
-			p->ainew.path_info.end_tile_br = i->xy + TileDiffXY(i->width + 1, i->height + 1);
-			p->ainew.path_info.end_direction = p->ainew.to_direction;
+			_players_ainew[p->index].path_info.end_tile_tl = i->xy - TileDiffXY(1, 1);
+			_players_ainew[p->index].path_info.end_tile_br = i->xy + TileDiffXY(i->width + 1, i->height + 1);
+			_players_ainew[p->index].path_info.end_direction = _players_ainew[p->index].to_direction;
 		} else {
-			p->ainew.path_info.end_tile_tl = p->ainew.to_tile;
-			p->ainew.path_info.end_tile_br = p->ainew.to_tile;
-			p->ainew.path_info.end_direction = p->ainew.to_direction;
+			_players_ainew[p->index].path_info.end_tile_tl = _players_ainew[p->index].to_tile;
+			_players_ainew[p->index].path_info.end_tile_br = _players_ainew[p->index].to_tile;
+			_players_ainew[p->index].path_info.end_direction = _players_ainew[p->index].to_direction;
 		}
 
-		p->ainew.path_info.rail_or_road = (p->ainew.tbt == AI_TRAIN);
+		_players_ainew[p->index].path_info.rail_or_road = (_players_ainew[p->index].tbt == AI_TRAIN);
 
 		// First, clean the pathfinder with our new begin and endpoints
-		clean_AyStar_AiPathFinder(p->ainew.pathfinder, &p->ainew.path_info);
+		clean_AyStar_AiPathFinder(_players_ainew[p->index].pathfinder, &_players_ainew[p->index].path_info);
 
-		p->ainew.temp = 0;
+		_players_ainew[p->index].temp = 0;
 	}
 
 	// Start the pathfinder
-	r = p->ainew.pathfinder->main(p->ainew.pathfinder);
+	r = _players_ainew[p->index].pathfinder->main(_players_ainew[p->index].pathfinder);
 	switch (r) {
 		case AYSTAR_NO_PATH:
 			DEBUG(ai, 1, "No route found by pathfinder");
 			// Start all over again
-			p->ainew.state = AI_STATE_NOTHING;
+			_players_ainew[p->index].state = AI_STATE_NOTHING;
 			break;
 
 		case AYSTAR_FOUND_END_NODE: // We found the end-point
-			p->ainew.temp = -1;
-			p->ainew.state = AI_STATE_FIND_DEPOT;
+			_players_ainew[p->index].temp = -1;
+			_players_ainew[p->index].state = AI_STATE_FIND_DEPOT;
 			break;
 
 		// In any other case, we are still busy finding the route
@@ -788,12 +792,12 @@
 	CommandCost r;
 	DiagDirection j;
 	TileIndex tile;
-	assert(p->ainew.state == AI_STATE_FIND_DEPOT);
+	assert(_players_ainew[p->index].state == AI_STATE_FIND_DEPOT);
 
-	p->ainew.depot_tile = 0;
+	_players_ainew[p->index].depot_tile = 0;
 
-	for (i=2;i<p->ainew.path_info.route_length-2;i++) {
-		tile = p->ainew.path_info.route[i];
+	for (i=2;i<_players_ainew[p->index].path_info.route_length-2;i++) {
+		tile = _players_ainew[p->index].path_info.route[i];
 		for (j = DIAGDIR_BEGIN; j < DIAGDIR_END; j++) {
 			TileIndex t = tile + TileOffsByDiagDir(j);
 
@@ -801,9 +805,9 @@
 					GetRoadTileType(t) == ROAD_TILE_DEPOT &&
 					IsTileOwner(t, _current_player) &&
 					GetRoadDepotDirection(t) == ReverseDiagDir(j)) {
-				p->ainew.depot_tile = t;
-				p->ainew.depot_direction = ReverseDiagDir(j);
-				p->ainew.state = AI_STATE_VERIFY_ROUTE;
+				_players_ainew[p->index].depot_tile = t;
+				_players_ainew[p->index].depot_direction = ReverseDiagDir(j);
+				_players_ainew[p->index].state = AI_STATE_VERIFY_ROUTE;
 				return;
 			}
 		}
@@ -811,19 +815,19 @@
 
 	// This routine let depot finding start in the middle, and work his way to the stations
 	// It makes depot placing nicer :)
-	i = p->ainew.path_info.route_length / 2;
+	i = _players_ainew[p->index].path_info.route_length / 2;
 	g = 1;
-	while (i > 1 && i < p->ainew.path_info.route_length - 2) {
+	while (i > 1 && i < _players_ainew[p->index].path_info.route_length - 2) {
 		i += g;
 		g *= -1;
 		(g < 0?g--:g++);
 
-		if (p->ainew.path_info.route_extra[i] != 0 || p->ainew.path_info.route_extra[i+1] != 0) {
+		if (_players_ainew[p->index].path_info.route_extra[i] != 0 || _players_ainew[p->index].path_info.route_extra[i+1] != 0) {
 			// Bridge or tunnel.. we can't place a depot there
 			continue;
 		}
 
-		tile = p->ainew.path_info.route[i];
+		tile = _players_ainew[p->index].path_info.route[i];
 
 		for (j = DIAGDIR_BEGIN; j < DIAGDIR_END; j++) {
 			TileIndex t = tile + TileOffsByDiagDir(j);
@@ -831,12 +835,12 @@
 			// It may not be placed on the road/rail itself
 			// And because it is not build yet, we can't see it on the tile..
 			// So check the surrounding tiles :)
-			if (t == p->ainew.path_info.route[i - 1] ||
-					t == p->ainew.path_info.route[i + 1]) {
+			if (t == _players_ainew[p->index].path_info.route[i - 1] ||
+					t == _players_ainew[p->index].path_info.route[i + 1]) {
 				continue;
 			}
 			// Not around a bridge?
-			if (p->ainew.path_info.route_extra[i] != 0) continue;
+			if (_players_ainew[p->index].path_info.route_extra[i] != 0) continue;
 			if (IsTileType(tile, MP_TUNNELBRIDGE)) continue;
 			// Is the terrain clear?
 			if (IsTileType(t, MP_CLEAR) || IsTileType(t, MP_TREES)) {
@@ -846,17 +850,17 @@
 				r = AiNew_Build_Depot(p, t, ReverseDiagDir(j), 0);
 				if (CmdFailed(r)) continue;
 				// Found a spot!
-				p->ainew.new_cost += r.GetCost();
-				p->ainew.depot_tile = t;
-				p->ainew.depot_direction = ReverseDiagDir(j); // Reverse direction
-				p->ainew.state = AI_STATE_VERIFY_ROUTE;
+				_players_ainew[p->index].new_cost += r.GetCost();
+				_players_ainew[p->index].depot_tile = t;
+				_players_ainew[p->index].depot_direction = ReverseDiagDir(j); // Reverse direction
+				_players_ainew[p->index].state = AI_STATE_VERIFY_ROUTE;
 				return;
 			}
 		}
 	}
 
 	// Failed to find a depot?
-	p->ainew.state = AI_STATE_NOTHING;
+	_players_ainew[p->index].state = AI_STATE_NOTHING;
 }
 
 
@@ -867,7 +871,7 @@
 // It returns the cost for the vehicles
 static int AiNew_HowManyVehicles(Player *p)
 {
-	if (p->ainew.tbt == AI_BUS) {
+	if (_players_ainew[p->index].tbt == AI_BUS) {
 		// For bus-routes we look at the time before we are back in the station
 		EngineID i;
 		int length, tiles_a_day;
@@ -875,7 +879,7 @@
 		i = AiNew_PickVehicle(p);
 		if (i == INVALID_ENGINE) return 0;
 		// Passenger run.. how long is the route?
-		length = p->ainew.path_info.route_length;
+		length = _players_ainew[p->index].path_info.route_length;
 		// Calculating tiles a day a vehicle moves is not easy.. this is how it must be done!
 		tiles_a_day = RoadVehInfo(i)->max_speed * DAY_TICKS / 256 / 16;
 		// We want a vehicle in a station once a month at least, so, calculate it!
@@ -883,7 +887,7 @@
 		amount = length * 2 * 2 / tiles_a_day / 30;
 		if (amount == 0) amount = 1;
 		return amount;
-	} else if (p->ainew.tbt == AI_TRUCK) {
+	} else if (_players_ainew[p->index].tbt == AI_TRUCK) {
 		// For truck-routes we look at the cargo
 		EngineID i;
 		int length, amount, tiles_a_day;
@@ -891,13 +895,13 @@
 		i = AiNew_PickVehicle(p);
 		if (i == INVALID_ENGINE) return 0;
 		// Passenger run.. how long is the route?
-		length = p->ainew.path_info.route_length;
+		length = _players_ainew[p->index].path_info.route_length;
 		// Calculating tiles a day a vehicle moves is not easy.. this is how it must be done!
 		tiles_a_day = RoadVehInfo(i)->max_speed * DAY_TICKS / 256 / 16;
-		if (p->ainew.from_deliver) {
-			max_cargo = GetIndustry(p->ainew.from_ic)->last_month_production[0];
+		if (_players_ainew[p->index].from_deliver) {
+			max_cargo = GetIndustry(_players_ainew[p->index].from_ic)->last_month_production[0];
 		} else {
-			max_cargo = GetIndustry(p->ainew.to_ic)->last_month_production[0];
+			max_cargo = GetIndustry(_players_ainew[p->index].to_ic)->last_month_production[0];
 		}
 
 		// This is because moving 60% is more than we can dream of!
@@ -923,58 +927,58 @@
 static void AiNew_State_VerifyRoute(Player *p)
 {
 	int res, i;
-	assert(p->ainew.state == AI_STATE_VERIFY_ROUTE);
+	assert(_players_ainew[p->index].state == AI_STATE_VERIFY_ROUTE);
 
 	// Let's calculate the cost of the path..
 	//  new_cost already contains the cost of the stations
-	p->ainew.path_info.position = -1;
+	_players_ainew[p->index].path_info.position = -1;
 
 	do {
-		p->ainew.path_info.position++;
-		p->ainew.new_cost += AiNew_Build_RoutePart(p, &p->ainew.path_info, DC_QUERY_COST).GetCost();
-	} while (p->ainew.path_info.position != -2);
+		_players_ainew[p->index].path_info.position++;
+		_players_ainew[p->index].new_cost += AiNew_Build_RoutePart(p, &_players_ainew[p->index].path_info, DC_QUERY_COST).GetCost();
+	} while (_players_ainew[p->index].path_info.position != -2);
 
 	// Now we know the price of build station + path. Now check how many vehicles
 	//  we need and what the price for that will be
 	res = AiNew_HowManyVehicles(p);
 	// If res == 0, no vehicle was found, or an other problem did occour
 	if (res == 0) {
-		p->ainew.state = AI_STATE_NOTHING;
+		_players_ainew[p->index].state = AI_STATE_NOTHING;
 		return;
 	}
-	p->ainew.amount_veh = res;
-	p->ainew.cur_veh = 0;
+	_players_ainew[p->index].amount_veh = res;
+	_players_ainew[p->index].cur_veh = 0;
 
 	// Check how much it it going to cost us..
 	for (i=0;i<res;i++) {
-		p->ainew.new_cost += AiNew_Build_Vehicle(p, 0, DC_QUERY_COST).GetCost();
+		_players_ainew[p->index].new_cost += AiNew_Build_Vehicle(p, 0, DC_QUERY_COST).GetCost();
 	}
 
 	// Now we know how much the route is going to cost us
 	//  Check if we have enough money for it!
-	if (p->ainew.new_cost > p->player_money - AI_MINIMUM_MONEY) {
+	if (_players_ainew[p->index].new_cost > p->player_money - AI_MINIMUM_MONEY) {
 		// Too bad..
-		DEBUG(ai, 1, "Insufficient funds to build route (%" OTTD_PRINTF64 "d)", (int64)p->ainew.new_cost);
-		p->ainew.state = AI_STATE_NOTHING;
+		DEBUG(ai, 1, "Insufficient funds to build route (%" OTTD_PRINTF64 "d)", (int64)_players_ainew[p->index].new_cost);
+		_players_ainew[p->index].state = AI_STATE_NOTHING;
 		return;
 	}
 
 	// Now we can build the route, check the direction of the stations!
-	if (p->ainew.from_direction == AI_PATHFINDER_NO_DIRECTION) {
-		p->ainew.from_direction = AiNew_GetDirection(p->ainew.path_info.route[p->ainew.path_info.route_length - 1], p->ainew.path_info.route[p->ainew.path_info.route_length - 2]);
-	}
-	if (p->ainew.to_direction == AI_PATHFINDER_NO_DIRECTION) {
-		p->ainew.to_direction = AiNew_GetDirection(p->ainew.path_info.route[0], p->ainew.path_info.route[1]);
+	if (_players_ainew[p->index].from_direction == AI_PATHFINDER_NO_DIRECTION) {
+		_players_ainew[p->index].from_direction = AiNew_GetDirection(_players_ainew[p->index].path_info.route[_players_ainew[p->index].path_info.route_length - 1], _players_ainew[p->index].path_info.route[_players_ainew[p->index].path_info.route_length - 2]);
 	}
-	if (p->ainew.from_tile == AI_STATION_RANGE)
-		p->ainew.from_tile = p->ainew.path_info.route[p->ainew.path_info.route_length - 1];
-	if (p->ainew.to_tile == AI_STATION_RANGE)
-		p->ainew.to_tile = p->ainew.path_info.route[0];
+	if (_players_ainew[p->index].to_direction == AI_PATHFINDER_NO_DIRECTION) {
+		_players_ainew[p->index].to_direction = AiNew_GetDirection(_players_ainew[p->index].path_info.route[0], _players_ainew[p->index].path_info.route[1]);
+	}
+	if (_players_ainew[p->index].from_tile == AI_STATION_RANGE)
+		_players_ainew[p->index].from_tile = _players_ainew[p->index].path_info.route[_players_ainew[p->index].path_info.route_length - 1];
+	if (_players_ainew[p->index].to_tile == AI_STATION_RANGE)
+		_players_ainew[p->index].to_tile = _players_ainew[p->index].path_info.route[0];
 
-	p->ainew.state = AI_STATE_BUILD_STATION;
-	p->ainew.temp = 0;
+	_players_ainew[p->index].state = AI_STATE_BUILD_STATION;
+	_players_ainew[p->index].temp = 0;
 
-	DEBUG(ai, 1, "The route is set and buildable, building 0x%X to 0x%X...", p->ainew.from_tile, p->ainew.to_tile);
+	DEBUG(ai, 1, "The route is set and buildable, building 0x%X to 0x%X...", _players_ainew[p->index].from_tile, _players_ainew[p->index].to_tile);
 }
 
 
@@ -982,54 +986,54 @@
 static void AiNew_State_BuildStation(Player *p)
 {
 	CommandCost res;
-	assert(p->ainew.state == AI_STATE_BUILD_STATION);
-	if (p->ainew.temp == 0) {
-		if (!IsTileType(p->ainew.from_tile, MP_STATION))
-			res = AiNew_Build_Station(p, p->ainew.tbt, p->ainew.from_tile, 0, 0, p->ainew.from_direction, DC_EXEC);
+	assert(_players_ainew[p->index].state == AI_STATE_BUILD_STATION);
+	if (_players_ainew[p->index].temp == 0) {
+		if (!IsTileType(_players_ainew[p->index].from_tile, MP_STATION))
+			res = AiNew_Build_Station(p, _players_ainew[p->index].tbt, _players_ainew[p->index].from_tile, 0, 0, _players_ainew[p->index].from_direction, DC_EXEC);
 	} else {
-		if (!IsTileType(p->ainew.to_tile, MP_STATION))
-			res = AiNew_Build_Station(p, p->ainew.tbt, p->ainew.to_tile, 0, 0, p->ainew.to_direction, DC_EXEC);
-		p->ainew.state = AI_STATE_BUILD_PATH;
+		if (!IsTileType(_players_ainew[p->index].to_tile, MP_STATION))
+			res = AiNew_Build_Station(p, _players_ainew[p->index].tbt, _players_ainew[p->index].to_tile, 0, 0, _players_ainew[p->index].to_direction, DC_EXEC);
+		_players_ainew[p->index].state = AI_STATE_BUILD_PATH;
 	}
 	if (CmdFailed(res)) {
-		DEBUG(ai, 0, "[BuildStation] station could not be built (0x%X)", p->ainew.to_tile);
-		p->ainew.state = AI_STATE_NOTHING;
+		DEBUG(ai, 0, "[BuildStation] station could not be built (0x%X)", _players_ainew[p->index].to_tile);
+		_players_ainew[p->index].state = AI_STATE_NOTHING;
 		// If the first station _was_ build, destroy it
-		if (p->ainew.temp != 0)
-			AI_DoCommand(p->ainew.from_tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
+		if (_players_ainew[p->index].temp != 0)
+			AI_DoCommand(_players_ainew[p->index].from_tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
 		return;
 	}
-	p->ainew.temp++;
+	_players_ainew[p->index].temp++;
 }
 
 
 // Build the path
 static void AiNew_State_BuildPath(Player *p)
 {
-	assert(p->ainew.state == AI_STATE_BUILD_PATH);
-	// p->ainew.temp is set to -1 when this function is called for the first time
-	if (p->ainew.temp == -1) {
+	assert(_players_ainew[p->index].state == AI_STATE_BUILD_PATH);
+	// _players_ainew[p->index].temp is set to -1 when this function is called for the first time
+	if (_players_ainew[p->index].temp == -1) {
 		DEBUG(ai, 1, "Starting to build new path");
 		// Init the counter
-		p->ainew.counter = (4 - _opt.diff.competitor_speed) * AI_BUILDPATH_PAUSE + 1;
+		_players_ainew[p->index].counter = (4 - _opt.diff.competitor_speed) * AI_BUILDPATH_PAUSE + 1;
 		// Set the position to the startingplace (-1 because in a minute we do ++)
-		p->ainew.path_info.position = -1;
+		_players_ainew[p->index].path_info.position = -1;
 		// And don't do this again
-		p->ainew.temp = 0;
+		_players_ainew[p->index].temp = 0;
 	}
 	// Building goes very fast on normal rate, so we are going to slow it down..
 	//  By let the counter count from AI_BUILDPATH_PAUSE to 0, we have a nice way :)
-	if (--p->ainew.counter != 0) return;
-	p->ainew.counter = (4 - _opt.diff.competitor_speed) * AI_BUILDPATH_PAUSE + 1;
+	if (--_players_ainew[p->index].counter != 0) return;
+	_players_ainew[p->index].counter = (4 - _opt.diff.competitor_speed) * AI_BUILDPATH_PAUSE + 1;
 
 	// Increase the building position
-	p->ainew.path_info.position++;
+	_players_ainew[p->index].path_info.position++;
 	// Build route
-	AiNew_Build_RoutePart(p, &p->ainew.path_info, DC_EXEC);
-	if (p->ainew.path_info.position == -2) {
+	AiNew_Build_RoutePart(p, &_players_ainew[p->index].path_info, DC_EXEC);
+	if (_players_ainew[p->index].path_info.position == -2) {
 		// This means we are done building!
 
-		if (p->ainew.tbt == AI_TRUCK && !_patches.roadveh_queue) {
+		if (_players_ainew[p->index].tbt == AI_TRUCK && !_patches.roadveh_queue) {
 			// If they not queue, they have to go up and down to try again at a station...
 			// We don't want that, so try building some road left or right of the station
 			DiagDirection dir1, dir2, dir3;
@@ -1037,15 +1041,15 @@
 			CommandCost ret;
 			for (int i = 0; i < 2; i++) {
 				if (i == 0) {
-					tile = p->ainew.from_tile + TileOffsByDiagDir(p->ainew.from_direction);
-					dir1 = ChangeDiagDir(p->ainew.from_direction, DIAGDIRDIFF_90LEFT);
-					dir2 = ChangeDiagDir(p->ainew.from_direction, DIAGDIRDIFF_90RIGHT);
-					dir3 = p->ainew.from_direction;
+					tile = _players_ainew[p->index].from_tile + TileOffsByDiagDir(_players_ainew[p->index].from_direction);
+					dir1 = ChangeDiagDir(_players_ainew[p->index].from_direction, DIAGDIRDIFF_90LEFT);
+					dir2 = ChangeDiagDir(_players_ainew[p->index].from_direction, DIAGDIRDIFF_90RIGHT);
+					dir3 = _players_ainew[p->index].from_direction;
 				} else {
-					tile = p->ainew.to_tile + TileOffsByDiagDir(p->ainew.to_direction);
-					dir1 = ChangeDiagDir(p->ainew.to_direction, DIAGDIRDIFF_90LEFT);
-					dir2 = ChangeDiagDir(p->ainew.to_direction, DIAGDIRDIFF_90RIGHT);
-					dir3 = p->ainew.to_direction;
+					tile = _players_ainew[p->index].to_tile + TileOffsByDiagDir(_players_ainew[p->index].to_direction);
+					dir1 = ChangeDiagDir(_players_ainew[p->index].to_direction, DIAGDIRDIFF_90LEFT);
+					dir2 = ChangeDiagDir(_players_ainew[p->index].to_direction, DIAGDIRDIFF_90RIGHT);
+					dir3 = _players_ainew[p->index].to_direction;
 				}
 
 				ret = AI_DoCommand(tile, DiagDirToRoadBits(ReverseDiagDir(dir1)), 0, DC_EXEC | DC_NO_WATER, CMD_BUILD_ROAD);
@@ -1086,8 +1090,8 @@
 			}
 		}
 
-		DEBUG(ai, 1, "Finished building path, cost: %" OTTD_PRINTF64 "d", (int64)p->ainew.new_cost);
-		p->ainew.state = AI_STATE_BUILD_DEPOT;
+		DEBUG(ai, 1, "Finished building path, cost: %" OTTD_PRINTF64 "d", (int64)_players_ainew[p->index].new_cost);
+		_players_ainew[p->index].state = AI_STATE_BUILD_DEPOT;
 	}
 }
 
@@ -1096,34 +1100,34 @@
 static void AiNew_State_BuildDepot(Player *p)
 {
 	CommandCost res;
-	assert(p->ainew.state == AI_STATE_BUILD_DEPOT);
+	assert(_players_ainew[p->index].state == AI_STATE_BUILD_DEPOT);
 
-	if (IsTileType(p->ainew.depot_tile, MP_ROAD) && GetRoadTileType(p->ainew.depot_tile) == ROAD_TILE_DEPOT) {
-		if (IsTileOwner(p->ainew.depot_tile, _current_player)) {
+	if (IsTileType(_players_ainew[p->index].depot_tile, MP_ROAD) && GetRoadTileType(_players_ainew[p->index].depot_tile) == ROAD_TILE_DEPOT) {
+		if (IsTileOwner(_players_ainew[p->index].depot_tile, _current_player)) {
 			// The depot is already built
-			p->ainew.state = AI_STATE_BUILD_VEHICLE;
+			_players_ainew[p->index].state = AI_STATE_BUILD_VEHICLE;
 			return;
 		} else {
 			// There is a depot, but not of our team! :(
-			p->ainew.state = AI_STATE_NOTHING;
+			_players_ainew[p->index].state = AI_STATE_NOTHING;
 			return;
 		}
 	}
 
 	// There is a bus on the tile we want to build road on... idle till he is gone! (BAD PERSON! :p)
-	if (!EnsureNoVehicleOnGround(p->ainew.depot_tile + TileOffsByDiagDir(p->ainew.depot_direction)))
+	if (!EnsureNoVehicleOnGround(_players_ainew[p->index].depot_tile + TileOffsByDiagDir(_players_ainew[p->index].depot_direction)))
 		return;
 
-	res = AiNew_Build_Depot(p, p->ainew.depot_tile, p->ainew.depot_direction, DC_EXEC);
+	res = AiNew_Build_Depot(p, _players_ainew[p->index].depot_tile, _players_ainew[p->index].depot_direction, DC_EXEC);
 	if (CmdFailed(res)) {
-		DEBUG(ai, 0, "[BuildDepot] depot could not be built (0x%X)", p->ainew.depot_tile);
-		p->ainew.state = AI_STATE_NOTHING;
+		DEBUG(ai, 0, "[BuildDepot] depot could not be built (0x%X)", _players_ainew[p->index].depot_tile);
+		_players_ainew[p->index].state = AI_STATE_NOTHING;
 		return;
 	}
 
-	p->ainew.state = AI_STATE_BUILD_VEHICLE;
-	p->ainew.idle = 10;
-	p->ainew.veh_main_id = INVALID_VEHICLE;
+	_players_ainew[p->index].state = AI_STATE_BUILD_VEHICLE;
+	_players_ainew[p->index].idle = 10;
+	_players_ainew[p->index].veh_main_id = INVALID_VEHICLE;
 }
 
 
@@ -1131,34 +1135,34 @@
 static void AiNew_State_BuildVehicle(Player *p)
 {
 	CommandCost res;
-	assert(p->ainew.state == AI_STATE_BUILD_VEHICLE);
+	assert(_players_ainew[p->index].state == AI_STATE_BUILD_VEHICLE);
 
 	// Check if we need to build a vehicle
-	if (p->ainew.amount_veh == 0) {
+	if (_players_ainew[p->index].amount_veh == 0) {
 		// Nope, we are done!
 		// This means: we are all done! The route is open.. go back to NOTHING
 		//  He will idle some time and it will all start over again.. :)
-		p->ainew.state = AI_STATE_ACTION_DONE;
+		_players_ainew[p->index].state = AI_STATE_ACTION_DONE;
 		return;
 	}
-	if (--p->ainew.idle != 0) return;
+	if (--_players_ainew[p->index].idle != 0) return;
 	// It is realistic that the AI can only build 1 vehicle a day..
 	// This makes sure of that!
-	p->ainew.idle = AI_BUILD_VEHICLE_TIME_BETWEEN;
+	_players_ainew[p->index].idle = AI_BUILD_VEHICLE_TIME_BETWEEN;
 
 	// Build the vehicle
-	res = AiNew_Build_Vehicle(p, p->ainew.depot_tile, DC_EXEC);
+	res = AiNew_Build_Vehicle(p, _players_ainew[p->index].depot_tile, DC_EXEC);
 	if (CmdFailed(res)) {
 		// This happens when the AI can't build any more vehicles!
-		p->ainew.state = AI_STATE_NOTHING;
+		_players_ainew[p->index].state = AI_STATE_NOTHING;
 		return;
 	}
 	// Increase the current counter
-	p->ainew.cur_veh++;
+	_players_ainew[p->index].cur_veh++;
 	// Decrease the total counter
-	p->ainew.amount_veh--;
+	_players_ainew[p->index].amount_veh--;
 	// Go give some orders!
-	p->ainew.state = AI_STATE_WAIT_FOR_BUILD;
+	_players_ainew[p->index].state = AI_STATE_WAIT_FOR_BUILD;
 }
 
 
@@ -1168,62 +1172,62 @@
 	int idx;
 	Order order;
 
-	assert(p->ainew.state == AI_STATE_GIVE_ORDERS);
+	assert(_players_ainew[p->index].state == AI_STATE_GIVE_ORDERS);
 
-	if (p->ainew.veh_main_id != INVALID_VEHICLE) {
-		AI_DoCommand(0, p->ainew.veh_id + (p->ainew.veh_main_id << 16), 0, DC_EXEC, CMD_CLONE_ORDER);
+	if (_players_ainew[p->index].veh_main_id != INVALID_VEHICLE) {
+		AI_DoCommand(0, _players_ainew[p->index].veh_id + (_players_ainew[p->index].veh_main_id << 16), CO_SHARE, DC_EXEC, CMD_CLONE_ORDER);
 
-		p->ainew.state = AI_STATE_START_VEHICLE;
+		_players_ainew[p->index].state = AI_STATE_START_VEHICLE;
 		return;
 	} else {
-		p->ainew.veh_main_id = p->ainew.veh_id;
+		_players_ainew[p->index].veh_main_id = _players_ainew[p->index].veh_id;
 	}
 
 	// Very handy for AI, goto depot.. but yeah, it needs to be activated ;)
 	if (_patches.gotodepot) {
 		idx = 0;
 		order.type = OT_GOTO_DEPOT;
-		order.flags = OF_UNLOAD;
-		order.dest = GetDepotByTile(p->ainew.depot_tile)->index;
-		AI_DoCommand(0, p->ainew.veh_id + (idx << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
+		order.flags = OFB_UNLOAD;
+		order.dest = GetDepotByTile(_players_ainew[p->index].depot_tile)->index;
+		AI_DoCommand(0, _players_ainew[p->index].veh_id + (idx << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
 	}
 
 	idx = 0;
 	order.type = OT_GOTO_STATION;
 	order.flags = 0;
-	order.dest = GetStationIndex(p->ainew.to_tile);
-	if (p->ainew.tbt == AI_TRUCK && p->ainew.to_deliver)
-		order.flags |= OF_FULL_LOAD;
-	AI_DoCommand(0, p->ainew.veh_id + (idx << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
+	order.dest = GetStationIndex(_players_ainew[p->index].to_tile);
+	if (_players_ainew[p->index].tbt == AI_TRUCK && _players_ainew[p->index].to_deliver)
+		order.flags |= OFB_FULL_LOAD;
+	AI_DoCommand(0, _players_ainew[p->index].veh_id + (idx << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
 
 	idx = 0;
 	order.type = OT_GOTO_STATION;
 	order.flags = 0;
-	order.dest = GetStationIndex(p->ainew.from_tile);
-	if (p->ainew.tbt == AI_TRUCK && p->ainew.from_deliver)
-		order.flags |= OF_FULL_LOAD;
-	AI_DoCommand(0, p->ainew.veh_id + (idx << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
+	order.dest = GetStationIndex(_players_ainew[p->index].from_tile);
+	if (_players_ainew[p->index].tbt == AI_TRUCK && _players_ainew[p->index].from_deliver)
+		order.flags |= OFB_FULL_LOAD;
+	AI_DoCommand(0, _players_ainew[p->index].veh_id + (idx << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
 
 	// Start the engines!
-	p->ainew.state = AI_STATE_START_VEHICLE;
+	_players_ainew[p->index].state = AI_STATE_START_VEHICLE;
 }
 
 
 // Start the vehicle
 static void AiNew_State_StartVehicle(Player *p)
 {
-	assert(p->ainew.state == AI_STATE_START_VEHICLE);
+	assert(_players_ainew[p->index].state == AI_STATE_START_VEHICLE);
 
 	// Skip the first order if it is a second vehicle
 	//  This to make vehicles go different ways..
-	if (p->ainew.cur_veh & 1)
-		AI_DoCommand(0, p->ainew.veh_id, 1, DC_EXEC, CMD_SKIP_TO_ORDER);
+	if (_players_ainew[p->index].cur_veh & 1)
+		AI_DoCommand(0, _players_ainew[p->index].veh_id, 1, DC_EXEC, CMD_SKIP_TO_ORDER);
 
 	// 3, 2, 1... go! (give START_STOP command ;))
-	AI_DoCommand(0, p->ainew.veh_id, 0, DC_EXEC, CMD_START_STOP_ROADVEH);
+	AI_DoCommand(0, _players_ainew[p->index].veh_id, 0, DC_EXEC, CMD_START_STOP_ROADVEH);
 	// Try to build an other vehicle (that function will stop building when needed)
-	p->ainew.idle  = 10;
-	p->ainew.state = AI_STATE_BUILD_VEHICLE;
+	_players_ainew[p->index].idle  = 10;
+	_players_ainew[p->index].state = AI_STATE_BUILD_VEHICLE;
 }
 
 
@@ -1235,7 +1239,7 @@
 	for (i = 0; i < AI_LOAN_REPAY; i++) {
 		AI_DoCommand(0, 0, 0, DC_EXEC, CMD_DECREASE_LOAN);
 	}
-	p->ainew.state = AI_STATE_ACTION_DONE;
+	_players_ainew[p->index].state = AI_STATE_ACTION_DONE;
 }
 
 
@@ -1294,7 +1298,7 @@
 		AiNew_CheckVehicle(p, v);
 	}
 
-	p->ainew.state = AI_STATE_ACTION_DONE;
+	_players_ainew[p->index].state = AI_STATE_ACTION_DONE;
 }
 
 
@@ -1326,24 +1330,24 @@
 
 static void AiNew_OnTick(Player *p)
 {
-	if (_ainew_state[p->ainew.state] != NULL)
-		_ainew_state[p->ainew.state](p);
+	if (_ainew_state[_players_ainew[p->index].state] != NULL)
+		_ainew_state[_players_ainew[p->index].state](p);
 }
 
 
 void AiNewDoGameLoop(Player *p)
 {
-	if (p->ainew.state == AI_STATE_STARTUP) {
+	if (_players_ainew[p->index].state == AI_STATE_STARTUP) {
 		// The AI just got alive!
-		p->ainew.state = AI_STATE_FIRST_TIME;
-		p->ainew.tick = 0;
+		_players_ainew[p->index].state = AI_STATE_FIRST_TIME;
+		_players_ainew[p->index].tick = 0;
 
 		// Only startup the AI
 		return;
 	}
 
 	// We keep a ticker. We use it for competitor_speed
-	p->ainew.tick++;
+	_players_ainew[p->index].tick++;
 
 	// If we come here, we can do a tick.. do so!
 	AiNew_OnTick(p);
--- a/src/ai/trolly/trolly.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/ai/trolly/trolly.h	Tue Jan 22 21:00:30 2008 +0000
@@ -4,7 +4,9 @@
 #define AI_TROLLY_H
 
 #include "../../aystar.h"
-#include "../../player.h"
+#include "../../player_type.h"
+#include "../../vehicle_type.h"
+#include "../../date_type.h"
 
 /*
  * These defines can be altered to change the behavoir of the AI
@@ -239,6 +241,22 @@
 // ai_new.c
 void AiNewDoGameLoop(Player *p);
 
+struct Ai_PathFinderInfo {
+	TileIndex start_tile_tl; ///< tl = top-left
+	TileIndex start_tile_br; ///< br = bottom-right
+	TileIndex end_tile_tl;   ///< tl = top-left
+	TileIndex end_tile_br;   ///< br = bottom-right
+	DiagDirection start_direction; ///< 0 to 3 or AI_PATHFINDER_NO_DIRECTION
+	DiagDirection end_direction;   ///< 0 to 3 or AI_PATHFINDER_NO_DIRECTION
+
+	TileIndex route[500];
+	byte route_extra[500];   ///< Some extra information about the route like bridge/tunnel
+	int route_length;
+	int position;            ///< Current position in the build-path, needed to build the path
+
+	bool rail_or_road;       ///< true = rail, false = road
+};
+
 // ai_pathfinder.c
 AyStar *new_AyStar_AiPathFinder(int max_tiles_around, Ai_PathFinderInfo *PathFinderInfo);
 void clean_AyStar_AiPathFinder(AyStar *aystar, Ai_PathFinderInfo *PathFinderInfo);
@@ -259,4 +277,64 @@
 CommandCost AiNew_Build_Vehicle(Player *p, TileIndex tile, byte flag);
 CommandCost AiNew_Build_Depot(Player* p, TileIndex tile, DiagDirection direction, byte flag);
 
+/* The amount of memory reserved for the AI-special-vehicles */
+#define AI_MAX_SPECIAL_VEHICLES 100
+
+struct Ai_SpecialVehicle {
+	VehicleID veh_id;
+	uint32 flag;
+};
+
+struct PlayerAiNew {
+	uint8 state;
+	uint tick;
+	uint idle;
+
+	int temp;    ///< A value used in more than one function, but it just temporary
+	             ///< The use is pretty simple: with this we can 'think' about stuff
+	             ///<   in more than one tick, and more than one AI. A static will not
+	             ///<   do, because they are not saved. This way, the AI is almost human ;)
+	int counter; ///< For the same reason as temp, we have counter. It can count how
+	             ///<  long we are trying something, and just abort if it takes too long
+
+	/* Pathfinder stuff */
+	Ai_PathFinderInfo path_info;
+	AyStar *pathfinder;
+
+	/* Route stuff */
+
+	CargoID cargo;
+	byte tbt;    ///< train/bus/truck 0/1/2 AI_TRAIN/AI_BUS/AI_TRUCK
+	Money new_cost;
+
+	byte action;
+
+	int last_id; ///< here is stored the last id of the searched city/industry
+	Date last_vehiclecheck_date; // Used in CheckVehicle
+	Ai_SpecialVehicle special_vehicles[AI_MAX_SPECIAL_VEHICLES]; ///< Some vehicles have some special flags
+
+	TileIndex from_tile;
+	TileIndex to_tile;
+
+	DiagDirectionByte from_direction;
+	DiagDirectionByte to_direction;
+
+	bool from_deliver; ///< True if this is the station that GIVES cargo
+	bool to_deliver;
+
+	TileIndex depot_tile;
+	DiagDirectionByte depot_direction;
+
+	byte amount_veh;       ///< How many vehicles we are going to build in this route
+	byte cur_veh;          ///< How many vehicles did we bought?
+	VehicleID veh_id;      ///< Used when bought a vehicle
+	VehicleID veh_main_id; ///< The ID of the first vehicle, for shared copy
+
+	int from_ic;           ///< ic = industry/city. This is the ID of them
+	byte from_type;        ///< AI_NO_TYPE/AI_CITY/AI_INDUSTRY
+	int to_ic;
+	byte to_type;
+};
+extern PlayerAiNew _players_ainew[MAX_PLAYERS];
+
 #endif /* AI_TROLLY_H */
--- a/src/aircraft.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/aircraft.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,9 +6,8 @@
 #define AIRCRAFT_H
 
 #include "station_map.h"
-#include "vehicle.h"
+#include "vehicle_base.h"
 #include "engine.h"
-#include "variables.h"
 
 /** An aircraft can be one ot those types */
 enum AircraftSubType {
--- a/src/aircraft_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/aircraft_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -7,33 +7,38 @@
 #include "openttd.h"
 #include "aircraft.h"
 #include "debug.h"
-#include "functions.h"
 #include "landscape.h"
 #include "station_map.h"
-#include "strings.h"
-#include "table/strings.h"
-#include "map.h"
-#include "tile.h"
-#include "vehicle.h"
 #include "timetable.h"
 #include "depot.h"
 #include "engine.h"
-#include "command.h"
 #include "station.h"
 #include "news.h"
-#include "sound.h"
-#include "player.h"
 #include "aircraft.h"
 #include "airport.h"
 #include "vehicle_gui.h"
-#include "table/sprites.h"
 #include "newgrf_engine.h"
 #include "newgrf_callbacks.h"
 #include "newgrf_text.h"
 #include "newgrf_sound.h"
-#include "date.h"
 #include "spritecache.h"
 #include "cargotype.h"
+#include "strings_func.h"
+#include "command_func.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "functions.h"
+#include "variables.h"
+#include "autoreplace_func.h"
+#include "autoreplace_gui.h"
+#include "gfx_func.h"
+#include "player_func.h"
+#include "settings_type.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
 
 void Aircraft::UpdateDeltaXY(Direction direction)
 {
@@ -192,7 +197,7 @@
 		int sprite = GetCustomVehicleSprite(this, direction);
 
 		if (sprite != 0) return sprite;
-		spritenum = orig_aircraft_vehicle_info[this->engine_type - AIRCRAFT_ENGINES_INDEX].image_index;
+		spritenum = _orig_aircraft_vehicle_info[this->engine_type - AIRCRAFT_ENGINES_INDEX].image_index;
 	}
 	return direction + _aircraft_sprite[spritenum];
 }
@@ -220,7 +225,7 @@
 	if (is_custom_sprite(spritenum)) {
 		sprite = GetCustomVehicleIcon(engine, DIR_W);
 		if (sprite == 0) {
-			spritenum = orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
+			spritenum = _orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
 			sprite = (6 + _aircraft_sprite[spritenum]);
 		}
 	}
@@ -248,7 +253,7 @@
 	if (is_custom_sprite(spritenum)) {
 		sprite = GetCustomVehicleIcon(engine, DIR_W);
 		if (sprite == 0) {
-			spritenum = orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
+			spritenum = _orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
 			sprite = (6 + _aircraft_sprite[spritenum]);
 		}
 	}
@@ -261,7 +266,7 @@
 
 static CommandCost EstimateAircraftCost(EngineID engine, const AircraftVehicleInfo *avi)
 {
-	return CommandCost(GetEngineProperty(engine, 0x0B, avi->base_cost) * (_price.aircraft_base >> 3) >> 5);
+	return CommandCost(EXPENSES_NEW_VEHICLES, GetEngineProperty(engine, 0x0B, avi->base_cost) * (_price.aircraft_base >> 3) >> 5);
 }
 
 
@@ -309,8 +314,6 @@
 
 	if (!IsHangarTile(tile) || !IsTileOwner(tile, _current_player)) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
-
 	/* Prevent building aircraft types at places which can't handle them */
 	if (!CanAircraftUseStation(p1, tile)) return CMD_ERROR;
 
@@ -355,7 +358,7 @@
 
 		v->cargo_subtype = 0;
 
-		v->string_id = STR_SV_AIRCRAFT_NAME;
+		v->name = NULL;
 //		v->next_order_param = v->next_order = 0;
 
 //		v->load_unload_time_rem = 0;
@@ -528,9 +531,7 @@
 
 	if (HASBITS(v->vehstatus, VS_CRASHED)) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE);
 
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
-
-	CommandCost ret(-v->value);
+	CommandCost ret(EXPENSES_NEW_VEHICLES, -v->value);
 
 	if (flags & DC_EXEC) {
 		// Invalidate depot
@@ -577,7 +578,7 @@
 
 		v->vehstatus ^= VS_STOPPED;
 		v->cur_speed = 0;
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 		InvalidateWindowClasses(WC_AIRCRAFT_LIST);
 	}
@@ -609,24 +610,24 @@
 	if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner) || v->IsInDepot()) return CMD_ERROR;
 
 	if (v->current_order.type == OT_GOTO_DEPOT && !(p2 & DEPOT_LOCATE_HANGAR)) {
-		if (!!(p2 & DEPOT_SERVICE) == HasBit(v->current_order.flags, OFB_HALT_IN_DEPOT)) {
+		if (!!(p2 & DEPOT_SERVICE) == HasBit(v->current_order.flags, OF_HALT_IN_DEPOT)) {
 			/* We called with a different DEPOT_SERVICE setting.
 			 * Now we change the setting to apply the new one and let the vehicle head for the same hangar.
 			 * Note: the if is (true for requesting service == true for ordered to stop in hangar) */
 			if (flags & DC_EXEC) {
-				ClrBit(v->current_order.flags, OFB_PART_OF_ORDERS);
-				ToggleBit(v->current_order.flags, OFB_HALT_IN_DEPOT);
-				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+				ClrBit(v->current_order.flags, OF_PART_OF_ORDERS);
+				ToggleBit(v->current_order.flags, OF_HALT_IN_DEPOT);
+				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 			}
 			return CommandCost();
 		}
 
 		if (p2 & DEPOT_DONT_CANCEL) return CMD_ERROR; // Requested no cancelation of hangar orders
 		if (flags & DC_EXEC) {
-			if (v->current_order.flags & OF_UNLOAD) v->cur_order_index++;
+			if (v->current_order.flags & OFB_UNLOAD) v->cur_order_index++;
 			v->current_order.type = OT_DUMMY;
 			v->current_order.flags = 0;
-			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		}
 	} else {
 		bool next_airport_has_hangar = true;
@@ -646,11 +647,11 @@
 			if (v->current_order.type == OT_LOADING) v->LeaveStation();
 
 			v->current_order.type = OT_GOTO_DEPOT;
-			v->current_order.flags = OF_NON_STOP;
-			if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OFB_HALT_IN_DEPOT);
+			v->current_order.flags = OFB_NON_STOP;
+			if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OF_HALT_IN_DEPOT);
 			v->current_order.refit_cargo = CT_INVALID;
 			v->current_order.dest = next_airport_index;
-			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 			if (v->u.air.state == FLYING && !next_airport_has_hangar) {
 				/* The aircraft is now heading for a different hangar than the next in the orders */
 				AircraftNextAirportPos_and_Order(v);
@@ -682,13 +683,12 @@
 
 	if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner)) return CMD_ERROR;
 	if (!v->IsStoppedInDepot()) return_cmd_error(STR_A01B_AIRCRAFT_MUST_BE_STOPPED);
+	if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_CAN_T_REFIT_DESTROYED_VEHICLE);
 
 	/* Check cargo */
 	CargoID new_cid = GB(p2, 0, 8);
 	if (new_cid >= NUM_CARGO || !CanRefitTo(v->engine_type, new_cid)) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_AIRCRAFT_RUN);
-
 	/* Check the refit capacity callback */
 	uint16 callback = CALLBACK_FAILED;
 	if (HasBit(EngInfo(v->engine_type)->callbackmask, CBM_VEHICLE_REFIT_CAPACITY)) {
@@ -755,12 +755,12 @@
 //		printf("targetairport = %d, st->index = %d\n", v->u.air.targetairport, st->index);
 //		v->u.air.targetairport = st->index;
 		v->current_order.type = OT_GOTO_DEPOT;
-		v->current_order.flags = OF_NON_STOP;
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+		v->current_order.flags = OFB_NON_STOP;
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 	} else if (v->current_order.type == OT_GOTO_DEPOT) {
 		v->current_order.type = OT_DUMMY;
 		v->current_order.flags = 0;
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 	}
 }
 
@@ -778,11 +778,10 @@
 
 	if (v->vehstatus & VS_STOPPED) return;
 
-	CommandCost cost = CommandCost(GetVehicleProperty(v, 0x0E, AircraftVehInfo(v->engine_type)->running_cost) * _price.aircraft_running / 364);
+	CommandCost cost = CommandCost(EXPENSES_AIRCRAFT_RUN, GetVehicleProperty(v, 0x0E, AircraftVehInfo(v->engine_type)->running_cost) * _price.aircraft_running / 364);
 
 	v->profit_this_year -= cost.GetCost() >> 8;
 
-	SET_EXPENSES_TYPE(EXPENSES_AIRCRAFT_RUN);
 	SubtractMoneyFromPlayerFract(v->owner, cost);
 
 	InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
@@ -1000,7 +999,7 @@
 	if (spd != v->cur_speed) {
 		v->cur_speed = spd;
 		if (_patches.vehicle_speed)
-			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 	}
 
 	if (!(v->direction & 1)) spd = spd * 3 / 4;
@@ -1341,8 +1340,7 @@
 		/* Clear all claimed blocks on the airport set by crashing plane */
 		st->airport_flags.ReleaseBlocks(&v->u.air.owned_blocks);
 
-		BeginVehicleMove(v);
-		EndVehicleMove(v);
+		MarkSingleVehicleDirty(v);
 
 		DoDeleteAircraft(v);
 	}
@@ -1400,8 +1398,8 @@
 {
 	switch (v->current_order.type) {
 		case OT_GOTO_DEPOT:
-			if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return;
-			if (v->current_order.flags & OF_SERVICE_IF_NEEDED &&
+			if (!(v->current_order.flags & OFB_PART_OF_ORDERS)) return;
+			if (v->current_order.flags & OFB_SERVICE_IF_NEEDED &&
 					!VehicleNeedsService(v)) {
 				UpdateVehicleTimetable(v, true);
 				v->cur_order_index++;
@@ -1470,7 +1468,7 @@
 {
 		this->cur_image = this->GetImage(this->direction);
 		if (this->subtype == AIR_HELICOPTER) this->Next()->Next()->cur_image = GetRotorImage(this);
-		MarkAllViewportsDirty(this->left_coord, this->top_coord, this->right_coord + 1, this->bottom_coord + 1);
+		MarkSingleVehicleDirty(this);
 }
 
 static void CrashAirplane(Vehicle *v)
@@ -1602,6 +1600,45 @@
 	InvalidateWindowClasses(WC_AIRCRAFT_LIST);
 }
 
+/** Checks if an aircraft should head towards a hangar because it needs replacement
+ * @param *v the vehicle to test
+ * @return true if the aircraft should head towards a hangar
+ */
+static inline bool CheckSendAircraftToHangarForReplacement(const Vehicle *v)
+{
+	EngineID new_engine;
+	Player *p = GetPlayer(v->owner);
+
+	if (VehicleHasDepotOrders(v)) return false; // The aircraft will end up in the hangar eventually on it's own
+
+	new_engine = EngineReplacementForPlayer(p, v->engine_type, v->group_id);
+
+	if (new_engine == INVALID_ENGINE) {
+		/* There is no autoreplace assigned to this EngineID so we will set it to renew to the same type if needed */
+		new_engine = v->engine_type;
+
+		if(!p->engine_renew || (v->age - v->max_age) < p->engine_renew_months * 30) {
+			/* No need to replace the aircraft */
+			return false;
+		}
+	}
+
+	if (!HasBit(GetEngine(new_engine)->player_avail, v->owner)) {
+		/* Engine is not buildable anymore */
+		return false;
+	}
+
+	if (p->player_money < (p->engine_renew_money + (2 * DoCommand(0, new_engine, 0, DC_QUERY_COST, CMD_BUILD_AIRCRAFT).GetCost()))) {
+		/* We lack enough money to request the replacement right away.
+		 * We want 2*(the price of the new vehicle) and not looking at the value of the vehicle we are going to sell.
+		 * The reason is that we don't want to send a whole lot of vehicles to the hangars when we only have enough money to replace a single one.
+		 * Remember this happens in the background so the user can't stop this. */
+		return false;
+	}
+
+	/* We found no reason NOT to send the aircraft to a hangar so we will send it there at once */
+	return true;
+}
 
 ////////////////////////////////////////////////////////////////////////////////
 ///////////////////   AIRCRAFT MOVEMENT SCHEME  ////////////////////////////////
@@ -1811,7 +1848,6 @@
 
 static void AircraftEventHandler_HeliTakeOff(Vehicle *v, const AirportFTAClass *apc)
 {
-	const Player* p = GetPlayer(v->owner);
 	v->u.air.state = FLYING;
 	v->UpdateDeltaXY(INVALID_DIR);
 
@@ -1823,15 +1859,10 @@
 	/* get the next position to go to, differs per airport */
 	AircraftNextAirportPos_and_Order(v);
 
-	/* check if the aircraft needs to be replaced or renewed and send it to a hangar if needed
-	 * unless it is due for renewal but the engine is no longer available */
-	if (v->owner == _local_player && (
-				EngineHasReplacementForPlayer(p, v->engine_type, v->group_id) ||
-				((p->engine_renew && v->age - v->max_age > p->engine_renew_months * 30) &&
-				HasBit(GetEngine(v->engine_type)->player_avail, _local_player))
-			)) {
-		_current_player = _local_player;
-		DoCommandP(v->tile, v->index, DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, NULL, CMD_SEND_AIRCRAFT_TO_HANGAR | CMD_SHOW_NO_ERROR);
+	/* Send the helicopter to a hangar if needed for replacement */
+	if (CheckSendAircraftToHangarForReplacement(v)) {
+		_current_player = v->owner;
+		DoCommand(v->tile, v->index, DEPOT_SERVICE | DEPOT_LOCATE_HANGAR, DC_EXEC, CMD_SEND_AIRCRAFT_TO_HANGAR);
 		_current_player = OWNER_NONE;
 	}
 }
@@ -1887,16 +1918,10 @@
 	AircraftLandAirplane(v);  // maybe crash airplane
 
 	/* check if the aircraft needs to be replaced or renewed and send it to a hangar if needed */
-	if (v->current_order.type != OT_GOTO_DEPOT && v->owner == _local_player) {
-		/* only the vehicle owner needs to calculate the rest (locally) */
-		const Player* p = GetPlayer(v->owner);
-		if (EngineHasReplacementForPlayer(p, v->engine_type, v->group_id) ||
-			(p->engine_renew && v->age - v->max_age > (p->engine_renew_months * 30))) {
-			/* send the aircraft to the hangar at next airport */
-			_current_player = _local_player;
-			DoCommandP(v->tile, v->index, DEPOT_SERVICE, NULL, CMD_SEND_AIRCRAFT_TO_HANGAR | CMD_SHOW_NO_ERROR);
-			_current_player = OWNER_NONE;
-		}
+	if (CheckSendAircraftToHangarForReplacement(v)) {
+		_current_player = v->owner;
+		DoCommand(v->tile, v->index, DEPOT_SERVICE, DC_EXEC, CMD_SEND_AIRCRAFT_TO_HANGAR);
+		_current_player = OWNER_NONE;
 	}
 }
 
--- a/src/aircraft_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/aircraft_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,22 +6,17 @@
 #include "openttd.h"
 #include "aircraft.h"
 #include "debug.h"
-#include "functions.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "map.h"
-#include "window.h"
 #include "gui.h"
-#include "vehicle.h"
-#include "gfx.h"
-#include "command.h"
 #include "engine.h"
-#include "viewport.h"
-#include "player.h"
 #include "depot.h"
 #include "vehicle_gui.h"
 #include "newgrf_engine.h"
+#include "strings_func.h"
+#include "vehicle_func.h"
+#include "gfx_func.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
 
 /**
 * Draw the details for the given vehicle at the position (x,y)
--- a/src/airport.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/airport.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,12 +5,11 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "map.h"
 #include "airport.h"
-#include "macros.h"
-#include "variables.h"
-#include "date.h"
-#include "helpers.hpp"
+#include "core/bitmath_func.hpp"
+#include "core/alloc_func.hpp"
+#include "date_func.h"
+#include "settings_type.h"
 #include "newgrf_fsmports.h"
 
 /* static */ AirportFTAClass *AirportFTAClass::oil_rig; ///< "Special" holding pattern used for oil rigs.
--- a/src/airport_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/airport_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,26 +4,30 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "functions.h"
-#include "map.h"
-#include "window.h"
+#include "window_gui.h"
 #include "gui.h"
-#include "viewport.h"
-#include "gfx.h"
-#include "sound.h"
-#include "command.h"
-#include "vehicle.h"
+#include "station_gui.h"
+#include "terraform_gui.h"
+#include "command_func.h"
 #include "station.h"
 #include "airport.h"
 #include "depot.h"
-#include "strings.h"
 #include "newgrf_callbacks.h"
+#include "sound_func.h"
+#include "window_func.h"
+#include "settings_type.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "player_func.h"
+#include "widgets/dropdown_func.h"
+#include "strings_func.h"
 
 //TODO: remove station.h once converted to newgrf airports. stations just used as temporary loader
 #include "station.h"
 
+#include "table/sprites.h"
+#include "table/strings.h"
+
 static struct {
 	byte layout_set;
 	byte numtracks;
@@ -120,7 +124,7 @@
 		break;
 
 	case WE_ABORT_PLACE_OBJ:
-		RaiseWindowButtons(w);
+		w->RaiseButtons();
 
 		w = FindWindowById(WC_BUILD_STATION, 0);
 		if (w != 0)
@@ -188,8 +192,8 @@
 		if (WP(w, def_d).close) return;
 
 		for (byte j = 0; j < 4; j++) {
-			SetWindowWidgetDisabledState(w, 8 + j, true);
-			RaiseWindowWidget(w, 8 + j);
+			w->SetWidgetDisabledState(8 + j, true);
+			w->RaiseWidget(8 + j);
 			w->widget[8 + j].data = SPR_IMG_ARROW_NE_WHITE + j;  //reset arrows to white
 		}
 
@@ -265,8 +269,8 @@
 		switch (e->we.click.widget) {
 		case 12: case 13:
 			_station_show_coverage = (e->we.click.widget != 12);
-			SetWindowWidgetLoweredState(w, 12, !_station_show_coverage);
-			SetWindowWidgetLoweredState(w, 13, _station_show_coverage);
+			w->SetWidgetLoweredState(12, !_station_show_coverage);
+			w->SetWidgetLoweredState(13, _station_show_coverage);
 			SndPlayFx(SND_15_BEEP);
 			SetWindowDirty(w);
 			break;
@@ -318,10 +322,10 @@
 				}
 			}
 
-			SetWindowWidgetLoweredState(w,  8, (_airport.direction == DIR_NE));
-			SetWindowWidgetLoweredState(w,  9, (_airport.direction == DIR_SE));
-			SetWindowWidgetLoweredState(w, 10, (_airport.direction == DIR_SW));
-			SetWindowWidgetLoweredState(w, 11, (_airport.direction == DIR_NW));
+			w->SetWidgetLoweredState( 8, (_airport.direction == DIR_NE));
+			w->SetWidgetLoweredState( 9, (_airport.direction == DIR_SE));
+			w->SetWidgetLoweredState(10, (_airport.direction == DIR_SW));
+			w->SetWidgetLoweredState(11, (_airport.direction == DIR_NW));
 			SndPlayFx(SND_15_BEEP);
 			SetWindowDirty(w);
 			break;
--- a/src/articulated_vehicles.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/articulated_vehicles.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,15 +4,13 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
-#include "command.h"
-#include "vehicle.h"
 #include "articulated_vehicles.h"
 #include "engine.h"
 #include "train.h"
 #include "roadveh.h"
 #include "newgrf_callbacks.h"
 #include "newgrf_engine.h"
+#include "vehicle_func.h"
 
 
 uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
--- a/src/articulated_vehicles.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/articulated_vehicles.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,8 @@
 #ifndef ARTICULATED_VEHICLES_H
 #define ARTICULATED_VEHICLES_H
 
+#include "vehicle_type.h"
+
 uint CountArticulatedParts(EngineID engine_type, bool purchase_window);
 void AddArticulatedParts(Vehicle **vl, VehicleType type);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/autoreplace_base.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,38 @@
+/* $Id$ */
+
+/** @file autoreplace_base.h Base class for autoreplaces/autorenews. */
+
+#ifndef AUTOREPLACE_BASE_H
+#define AUTOREPLACE_BASE_H
+
+#include "oldpool.h"
+#include "autoreplace_type.h"
+
+/**
+ * Memory pool for engine renew elements. DO NOT USE outside of engine.c. Is
+ * placed here so the only exception to this rule, the saveload code, can use
+ * it.
+ */
+DECLARE_OLD_POOL(EngineRenew, EngineRenew, 3, 8000)
+
+/**
+ * Struct to store engine replacements. DO NOT USE outside of engine.c. Is
+ * placed here so the only exception to this rule, the saveload code, can use
+ * it.
+ */
+struct EngineRenew : PoolItem<EngineRenew, EngineRenewID, &_EngineRenew_pool> {
+	EngineID from;
+	EngineID to;
+	EngineRenew *next;
+	GroupID group_id;
+
+	EngineRenew(EngineID from = INVALID_ENGINE, EngineID to = INVALID_ENGINE) : from(from), to(to), next(NULL) {}
+	~EngineRenew() { this->from = INVALID_ENGINE; }
+
+	inline bool IsValid() const { return this->from != INVALID_ENGINE; }
+};
+
+#define FOR_ALL_ENGINE_RENEWS_FROM(er, start) for (er = GetEngineRenew(start); er != NULL; er = (er->index + 1U < GetEngineRenewPoolSize()) ? GetEngineRenew(er->index + 1U) : NULL) if (er->IsValid())
+#define FOR_ALL_ENGINE_RENEWS(er) FOR_ALL_ENGINE_RENEWS_FROM(er, 0)
+
+#endif /* AUTOREPLACE_BASE_H */
--- a/src/autoreplace_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/autoreplace_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,11 +4,8 @@
 #include "openttd.h"
 #include "roadveh.h"
 #include "ship.h"
-#include "table/strings.h"
-#include "functions.h"
 #include "news.h"
-#include "command.h"
-#include "player.h"
+#include "player_func.h"
 #include "engine.h"
 #include "debug.h"
 #include "vehicle_gui.h"
@@ -17,8 +14,16 @@
 #include "aircraft.h"
 #include "cargotype.h"
 #include "group.h"
-#include "strings.h"
+#include "order.h"
+#include "strings_func.h"
+#include "command_func.h"
+#include "vehicle_func.h"
+#include "functions.h"
+#include "variables.h"
+#include "autoreplace_func.h"
+#include "articulated_vehicles.h"
 
+#include "table/strings.h"
 
 /*
  * move the cargo from one engine to another if possible
@@ -89,7 +94,7 @@
 
 	if (new_cargo_type == CT_INVALID) return CT_NO_REFIT; // Don't try to refit an engine with no cargo capacity
 
-	if (v->cargo_type == new_cargo_type || CanRefitTo(engine_type, v->cargo_type)) {
+	if (v->cargo_cap != 0 && (v->cargo_type == new_cargo_type || CanRefitTo(engine_type, v->cargo_type))) {
 		if (VerifyAutoreplaceRefitForOrders(v, engine_type)) {
 			return v->cargo_type == new_cargo_type ? (CargoID)CT_NO_REFIT : v->cargo_type;
 		} else {
@@ -131,7 +136,7 @@
 	const UnitID cached_unitnumber = old_v->unitnumber;
 	bool new_front = false;
 	Vehicle *new_v = NULL;
-	char vehicle_name[32];
+	char *vehicle_name = NULL;
 	CargoID replacement_cargo_type;
 
 	/* If the vehicle belongs to a group, check if the group is protected from the global autoreplace.
@@ -158,12 +163,10 @@
 	/* We give the player a loan of the same amount as the sell value.
 	 * This is needed in case he needs the income from the sale to build the new vehicle.
 	 * We take it back if building fails or when we really sell the old engine */
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 	SubtractMoneyFromPlayer(sell_value);
 
 	cost = DoCommand(old_v->tile, new_engine_type, 3, flags, GetCmdBuildVeh(old_v));
 	if (CmdFailed(cost)) {
-		SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 		/* Take back the money we just gave the player */
 		sell_value.MultiplyCost(-1);
 		SubtractMoneyFromPlayer(sell_value);
@@ -173,7 +176,10 @@
 	if (replacement_cargo_type != CT_NO_REFIT) {
 		/* add refit cost */
 		CommandCost refit_cost = GetRefitCost(new_engine_type);
-		if (old_v->type == VEH_TRAIN && IsMultiheaded(old_v)) refit_cost.AddCost(refit_cost); // pay for both ends
+		if (old_v->type == VEH_TRAIN && RailVehInfo(new_engine_type)->railveh_type == RAILVEH_MULTIHEAD) {
+			/* Since it's a dualheaded engine we have to pay once more because the rear end is being refitted too. */
+			refit_cost.AddCost(refit_cost);
+		}
 		cost.AddCost(refit_cost);
 	}
 
@@ -239,12 +245,7 @@
 		MoveVehicleCargo(new_v->type == VEH_TRAIN ? new_v->First() : new_v, old_v);
 
 		// Get the name of the old vehicle if it has a custom name.
-		if (!IsCustomName(old_v->string_id)) {
-			vehicle_name[0] = '\0';
-		} else {
-			SetDParam(0, old_v->index);
-			GetString(vehicle_name, STR_VEHICLE_NAME, lastof(vehicle_name));
-		}
+		if (old_v->name != NULL) vehicle_name = strdup(old_v->name);
 	} else { // flags & DC_EXEC not set
 		CommandCost tmp_move;
 
@@ -263,7 +264,6 @@
 		/* Ensure that the player will not end up having negative money while autoreplacing
 		 * This is needed because the only other check is done after the income from selling the old vehicle is substracted from the cost */
 		if (CmdFailed(tmp_move) || p->player_money < (cost.GetCost() + total_cost)) {
-			SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 			/* Pay back the loan */
 			sell_value.MultiplyCost(-1);
 			SubtractMoneyFromPlayer(sell_value);
@@ -273,7 +273,6 @@
 
 	/* Take back the money we just gave the player just before building the vehicle
 	 * The player will get the same amount now that the sale actually takes place */
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 	sell_value.MultiplyCost(-1);
 	SubtractMoneyFromPlayer(sell_value);
 
@@ -286,9 +285,10 @@
 	}
 
 	/* Transfer the name of the old vehicle */
-	if ((flags & DC_EXEC) && vehicle_name[0] != '\0') {
+	if ((flags & DC_EXEC) && vehicle_name != NULL) {
 		_cmd_text = vehicle_name;
 		DoCommand(0, new_v->index, 0, DC_EXEC, CMD_NAME_VEHICLE);
+		free(vehicle_name);
 	}
 
 	return cost;
@@ -333,7 +333,7 @@
 	v->leave_depot_instantly = false;
 
 	for (;;) {
-		cost = CommandCost();
+		cost = CommandCost(EXPENSES_NEW_VEHICLES);
 		w = v;
 		do {
 			if (w->type == VEH_TRAIN && IsRearDualheaded(w)) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/autoreplace_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,103 @@
+/* $Id$ */
+
+/** @file autoreplace_func.h Functions related to autoreplacing. */
+
+#ifndef AUTOREPLACE_FUNC_H
+#define AUTOREPLACE_FUNC_H
+
+#include "autoreplace_type.h"
+#include "player_base.h"
+
+/**
+ * Remove all engine replacement settings for the player.
+ * @param  erl The renewlist for a given player.
+ * @return The new renewlist for the player.
+ */
+void RemoveAllEngineReplacement(EngineRenewList *erl);
+
+/**
+ * Retrieve the engine replacement in a given renewlist for an original engine type.
+ * @param  erl The renewlist to search in.
+ * @param  engine Engine type to be replaced.
+ * @return The engine type to replace with, or INVALID_ENGINE if no
+ * replacement is in the list.
+ */
+EngineID EngineReplacement(EngineRenewList erl, EngineID engine, GroupID group);
+
+/**
+ * Add an engine replacement to the given renewlist.
+ * @param erl The renewlist to add to.
+ * @param old_engine The original engine type.
+ * @param new_engine The replacement engine type.
+ * @param flags The calling command flags.
+ * @return 0 on success, CMD_ERROR on failure.
+ */
+CommandCost AddEngineReplacement(EngineRenewList *erl, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags);
+
+/**
+ * Remove an engine replacement from a given renewlist.
+ * @param erl The renewlist from which to remove the replacement
+ * @param engine The original engine type.
+ * @param flags The calling command flags.
+ * @return 0 on success, CMD_ERROR on failure.
+ */
+CommandCost RemoveEngineReplacement(EngineRenewList *erl, EngineID engine, GroupID group, uint32 flags);
+
+/**
+ * Remove all engine replacement settings for the given player.
+ * @param p Player.
+ */
+static inline void RemoveAllEngineReplacementForPlayer(Player *p)
+{
+	RemoveAllEngineReplacement(&p->engine_renew_list);
+}
+
+/**
+ * Retrieve the engine replacement for the given player and original engine type.
+ * @param p Player.
+ * @param engine Engine type.
+ * @return The engine type to replace with, or INVALID_ENGINE if no
+ * replacement is in the list.
+ */
+static inline EngineID EngineReplacementForPlayer(const Player *p, EngineID engine, GroupID group)
+{
+	return EngineReplacement(p->engine_renew_list, engine, group);
+}
+
+/**
+ * Check if a player has a replacement set up for the given engine.
+ * @param p Player.
+ * @param  engine Engine type to be replaced.
+ * @return true if a replacement was set up, false otherwise.
+ */
+static inline bool EngineHasReplacementForPlayer(const Player *p, EngineID engine, GroupID group)
+{
+	return EngineReplacementForPlayer(p, engine, group) != INVALID_ENGINE;
+}
+
+/**
+ * Add an engine replacement for the player.
+ * @param p Player.
+ * @param old_engine The original engine type.
+ * @param new_engine The replacement engine type.
+ * @param flags The calling command flags.
+ * @return 0 on success, CMD_ERROR on failure.
+ */
+static inline CommandCost AddEngineReplacementForPlayer(Player *p, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags)
+{
+	return AddEngineReplacement(&p->engine_renew_list, old_engine, new_engine, group, flags);
+}
+
+/**
+ * Remove an engine replacement for the player.
+ * @param p Player.
+ * @param engine The original engine type.
+ * @param flags The calling command flags.
+ * @return 0 on success, CMD_ERROR on failure.
+ */
+static inline CommandCost RemoveEngineReplacementForPlayer(Player *p, EngineID engine, GroupID group, uint32 flags)
+{
+	return RemoveEngineReplacement(&p->engine_renew_list, engine, group, flags);
+}
+
+#endif /* AUTOREPLACE_FUNC_H */
--- a/src/autoreplace_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/autoreplace_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,18 +5,23 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "window.h"
 #include "gui.h"
-#include "command.h"
+#include "command_func.h"
 #include "variables.h"
 #include "vehicle_gui.h"
 #include "newgrf_engine.h"
 #include "group.h"
+#include "rail.h"
+#include "strings_func.h"
+#include "window_func.h"
+#include "vehicle_func.h"
+#include "autoreplace_func.h"
+#include "gfx_func.h"
+#include "player_func.h"
+#include "widgets/dropdown_func.h"
 
+#include "table/sprites.h"
+#include "table/strings.h"
 
 static RailType _railtype_selected_in_replace_gui;
 
@@ -31,6 +36,33 @@
 	INVALID_STRING_ID
 };
 
+enum ReplaceVehicleWindowWidgets {
+	RVW_WIDGET_LEFT_DETAILS = 3,
+	RVW_WIDGET_START_REPLACE,
+	RVW_WIDGET_INFO_TAB,
+	RVW_WIDGET_STOP_REPLACE,
+	RVW_WIDGET_LEFT_MATRIX,
+	RVW_WIDGET_LEFT_SCROLLBAR,
+	RVW_WIDGET_RIGHT_MATRIX,
+	RVW_WIDGET_RIGHT_SCROLLBAR,
+	RVW_WIDGET_RIGHT_DETAILS,
+
+	RVW_WIDGET_TRAIN_ENGINEWAGON_TOGGLE,
+	RVW_WIDGET_TRAIN_FLUFF_LEFT,
+	RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN,
+	RVW_WIDGET_TRAIN_FLUFF_RIGHT,
+	RVW_WIDGET_TRAIN_WAGONREMOVE_TOGGLE,
+};
+
+static int CDECL TrainEngineNumberSorter(const void *a, const void *b)
+{
+	const EngineID va = *(const EngineID*)a;
+	const EngineID vb = *(const EngineID*)b;
+	int r = ListPositionOfEngine(va) - ListPositionOfEngine(vb);
+
+	return r;
+}
+
 /* General Vehicle GUI based procedures that are independent of vehicle types */
 void InitializeVehiclesGuiList()
 {
@@ -172,6 +204,7 @@
 		if (e == WP(w, replaceveh_d).sel_engine[i]) selected_engine = e; // The selected engine is still in the list
 	}
 	WP(w, replaceveh_d).sel_engine[i] = selected_engine; // update which engine we selected (the same or none, if it's not in the list anymore)
+	if (type == VEH_TRAIN) EngList_Sort(list, &TrainEngineNumberSorter);
 }
 
 /** Generate the lists
@@ -240,7 +273,7 @@
 
 			Player *p = GetPlayer(_local_player);
 			EngineID selected_id[2];
-			const GroupID selected_group = WP(w,replaceveh_d).sel_group;
+			const GroupID selected_group = WP(w, replaceveh_d).sel_group;
 
 			selected_id[0] = WP(w, replaceveh_d).sel_engine[0];
 			selected_id[1] = WP(w, replaceveh_d).sel_engine[1];
@@ -249,7 +282,7 @@
 			 *    Either list is empty
 			 * or The selected replacement engine has a replacement (to prevent loops)
 			 * or The right list (new replacement) has the existing replacement vehicle selected */
-			w->SetWidgetDisabledState(4,
+			w->SetWidgetDisabledState(RVW_WIDGET_START_REPLACE,
 										 selected_id[0] == INVALID_ENGINE ||
 										 selected_id[1] == INVALID_ENGINE ||
 										 EngineReplacementForPlayer(p, selected_id[1], selected_group) != INVALID_ENGINE ||
@@ -258,7 +291,7 @@
 			/* Disable the "Stop Replacing" button if:
 			 *   The left list (existing vehicle) is empty
 			 *   or The selected vehicle has no replacement set up */
-			w->SetWidgetDisabledState(6,
+			w->SetWidgetDisabledState(RVW_WIDGET_STOP_REPLACE,
 										 selected_id[0] == INVALID_ENGINE ||
 										 !EngineHasReplacementForPlayer(p, selected_id[0], selected_group));
 
@@ -273,18 +306,18 @@
 				SetDParam(2, WP(w, replaceveh_d).wagon_btnstate ? STR_ENGINES : STR_WAGONS);
 
 				/* sets the colour of that art thing */
-				w->widget[13].color = _player_colors[_local_player];
-				w->widget[16].color = _player_colors[_local_player];
+				w->widget[RVW_WIDGET_TRAIN_FLUFF_LEFT].color  = _player_colors[_local_player];
+				w->widget[RVW_WIDGET_TRAIN_FLUFF_RIGHT].color = _player_colors[_local_player];
+			}
+
+			if (w->window_number == VEH_TRAIN) {
+				/* Show the selected railtype in the pulldown menu */
+				RailType railtype = _railtype_selected_in_replace_gui;
+				w->widget[RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN].data = _rail_types_list[railtype];
 			}
 
 			DrawWindowWidgets(w);
 
-			if (w->window_number == VEH_TRAIN) {
-				/* Draw the selected railtype in the pulldown menu */
-				RailType railtype = _railtype_selected_in_replace_gui;
-				DrawString(157, w->widget[14].top + 1, _rail_types_list[railtype], TC_BLACK);
-			}
-
 			/* sets up the string for the vehicle that is being replaced to */
 			if (selected_id[0] != INVALID_ENGINE) {
 				if (!EngineHasReplacementForPlayer(p, selected_id[0], selected_group)) {
@@ -297,21 +330,21 @@
 				SetDParam(0, STR_NOT_REPLACING_VEHICLE_SELECTED);
 			}
 
-			DrawString(145, w->widget[5].top + 1, STR_02BD, TC_BLACK);
+			DrawString(145, w->widget[RVW_WIDGET_INFO_TAB].top + 1, STR_02BD, TC_BLACK);
 
 			/* Draw the lists */
 			for(byte i = 0; i < 2; i++) {
-				uint16 x        = i == 0 ? 2 : 230; // at what X offset
+				uint widget     = (i == 0) ? RVW_WIDGET_LEFT_MATRIX : RVW_WIDGET_RIGHT_MATRIX;
 				EngineList list = WP(w, replaceveh_d).list[i]; // which list to draw
 				EngineID start  = i == 0 ? w->vscroll.pos : w->vscroll2.pos; // what is the offset for the start (scrolling)
 				EngineID end    = min((i == 0 ? w->vscroll.cap : w->vscroll2.cap) + start, EngList_Count(&list));
 
 				/* Do the actual drawing */
-				DrawEngineList((VehicleType)w->window_number, x, 15, list, start, end, WP(w, replaceveh_d).sel_engine[i], i == 0, selected_group);
+				DrawEngineList((VehicleType)w->window_number, w->widget[widget].left + 2, w->widget[widget].top + 1, list, start, end, WP(w, replaceveh_d).sel_engine[i], i == 0, selected_group);
 
 				/* Also draw the details if an engine is selected */
 				if (WP(w, replaceveh_d).sel_engine[i] != INVALID_ENGINE) {
-					const Widget *wi = &w->widget[i == 0 ? 3 : 11];
+					const Widget *wi = &w->widget[i == 0 ? RVW_WIDGET_LEFT_DETAILS : RVW_WIDGET_RIGHT_DETAILS];
 					DrawVehiclePurchaseInfo(wi->left + 2, wi->top + 1, wi->right - wi->left - 2, WP(w, replaceveh_d).sel_engine[i]);
 				}
 			}
@@ -320,39 +353,38 @@
 
 		case WE_CLICK: {
 			switch (e->we.click.widget) {
-				case 12:
+				case RVW_WIDGET_TRAIN_ENGINEWAGON_TOGGLE:
 					WP(w, replaceveh_d).wagon_btnstate = !(WP(w, replaceveh_d).wagon_btnstate);
 					WP(w, replaceveh_d).update_left = true;
 					WP(w, replaceveh_d).init_lists  = true;
 					SetWindowDirty(w);
 					break;
 
-				case 14:
-				case 15: /* Railtype selection dropdown menu */
-					ShowDropDownMenu(w, _rail_types_list, _railtype_selected_in_replace_gui, 15, 0, ~GetPlayer(_local_player)->avail_railtypes);
+				case RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN: /* Railtype selection dropdown menu */
+					ShowDropDownMenu(w, _rail_types_list, _railtype_selected_in_replace_gui, RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN, 0, ~GetPlayer(_local_player)->avail_railtypes);
 					break;
 
-				case 17: /* toggle renew_keep_length */
+				case RVW_WIDGET_TRAIN_WAGONREMOVE_TOGGLE: /* toggle renew_keep_length */
 					DoCommandP(0, 5, GetPlayer(_local_player)->renew_keep_length ? 0 : 1, NULL, CMD_SET_AUTOREPLACE);
 					break;
 
-				case 4: { /* Start replacing */
+				case RVW_WIDGET_START_REPLACE: { /* Start replacing */
 					EngineID veh_from = WP(w, replaceveh_d).sel_engine[0];
 					EngineID veh_to = WP(w, replaceveh_d).sel_engine[1];
 					DoCommandP(0, 3 + (WP(w, replaceveh_d).sel_group << 16) , veh_from + (veh_to << 16), NULL, CMD_SET_AUTOREPLACE);
 				} break;
 
-				case 6: { /* Stop replacing */
+				case RVW_WIDGET_STOP_REPLACE: { /* Stop replacing */
 					EngineID veh_from = WP(w, replaceveh_d).sel_engine[0];
 					DoCommandP(0, 3 + (WP(w, replaceveh_d).sel_group << 16), veh_from + (INVALID_ENGINE << 16), NULL, CMD_SET_AUTOREPLACE);
 				} break;
 
-				case 7:
-				case 9: {
+				case RVW_WIDGET_LEFT_MATRIX:
+				case RVW_WIDGET_RIGHT_MATRIX: {
 					uint i = (e->we.click.pt.y - 14) / w->resize.step_height;
-					uint16 click_scroll_pos = e->we.click.widget == 7 ? w->vscroll.pos : w->vscroll2.pos;
-					uint16 click_scroll_cap = e->we.click.widget == 7 ? w->vscroll.cap : w->vscroll2.cap;
-					byte click_side         = e->we.click.widget == 7 ? 0 : 1;
+					uint16 click_scroll_pos = e->we.click.widget == RVW_WIDGET_LEFT_MATRIX ? w->vscroll.pos : w->vscroll2.pos;
+					uint16 click_scroll_cap = e->we.click.widget == RVW_WIDGET_LEFT_MATRIX ? w->vscroll.cap : w->vscroll2.cap;
+					byte click_side         = e->we.click.widget == RVW_WIDGET_LEFT_MATRIX ? 0 : 1;
 					uint16 engine_count     = EngList_Count(&WP(w, replaceveh_d).list[click_side]);
 
 					if (i < click_scroll_cap) {
@@ -390,8 +422,8 @@
 			w->vscroll.cap  += e->we.sizing.diff.y / (int)w->resize.step_height;
 			w->vscroll2.cap += e->we.sizing.diff.y / (int)w->resize.step_height;
 
-			w->widget[7].data = (w->vscroll.cap  << 8) + 1;
-			w->widget[9].data = (w->vscroll2.cap << 8) + 1;
+			w->widget[RVW_WIDGET_LEFT_MATRIX].data  = (w->vscroll.cap  << 8) + 1;
+			w->widget[RVW_WIDGET_RIGHT_MATRIX].data = (w->vscroll2.cap << 8) + 1;
 			break;
 
 		case WE_INVALIDATE_DATA:
@@ -423,8 +455,7 @@
 // train specific stuff
 { WWT_PUSHTXTBTN,     RESIZE_TB,    14,     0,   138,   228,   239, STR_REPLACE_ENGINE_WAGON_SELECT,       STR_REPLACE_ENGINE_WAGON_SELECT_HELP},  // widget 12
 {      WWT_PANEL,     RESIZE_TB,    14,   139,   153,   240,   251, 0x0,            STR_NULL},
-{      WWT_PANEL,     RESIZE_TB,    14,   154,   277,   240,   251, 0x0,            STR_REPLACE_HELP_RAILTYPE},
-{    WWT_TEXTBTN,     RESIZE_TB,    14,   278,   289,   240,   251, STR_0225,       STR_REPLACE_HELP_RAILTYPE},
+{   WWT_DROPDOWN,     RESIZE_TB,    14,   154,   289,   240,   251, 0x0,            STR_REPLACE_HELP_RAILTYPE},
 {      WWT_PANEL,     RESIZE_TB,    14,   290,   305,   240,   251, 0x0,            STR_NULL},
 { WWT_PUSHTXTBTN,     RESIZE_TB,    14,   317,   455,   228,   239, STR_REPLACE_REMOVE_WAGON,       STR_REPLACE_REMOVE_WAGON_HELP},
 // end of train specific stuff
@@ -491,38 +522,6 @@
 };
 
 
-void ShowReplaceVehicleWindow(VehicleType vehicletype)
-{
-	Window *w;
-
-	DeleteWindowById(WC_REPLACE_VEHICLE, vehicletype);
-
-	switch (vehicletype) {
-		case VEH_TRAIN:
-			w = AllocateWindowDescFront(&_replace_rail_vehicle_desc, vehicletype);
-			w->vscroll.cap  = 8;
-			w->resize.step_height = 14;
-			WP(w, replaceveh_d).wagon_btnstate = true;
-			break;
-		case VEH_ROAD:
-			w = AllocateWindowDescFront(&_replace_road_vehicle_desc, vehicletype);
-			w->vscroll.cap  = 8;
-			w->resize.step_height = 14;
-			break;
-		case VEH_SHIP:
-		case VEH_AIRCRAFT:
-			w = AllocateWindowDescFront(&_replace_ship_aircraft_vehicle_desc, vehicletype);
-			w->vscroll.cap  = 4;
-			w->resize.step_height = 24;
-			break;
-		default: return;
-	}
-
-	w->caption_color = _local_player;
-	w->vscroll2.cap = w->vscroll.cap;   // these two are always the same
-	WP(w, replaceveh_d).sel_group = DEFAULT_GROUP;
- }
-
 void ShowReplaceGroupVehicleWindow(GroupID id_g, VehicleType vehicletype)
 {
 	Window *w;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/autoreplace_gui.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,18 @@
+/* $Id$ */
+
+/** @file autoreplace_gui.h Functions related to the autoreplace GUIs*/
+
+#ifndef AUTOREPLACE_GUI_H
+#define AUTOREPLACE_GUI_H
+
+#include "vehicle_type.h"
+
+/**
+ * When an engine is made buildable or is removed from being buildable, add/remove it from the build/autoreplace lists
+ * @param type The type of engine
+ */
+void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type);
+void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g);
+void ShowReplaceGroupVehicleWindow(GroupID group, VehicleType veh);
+
+#endif /* AUTOREPLACE_GUI_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/autoreplace_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,15 @@
+/* $Id$ */
+
+/** @file autoreplace_type.h Types related to autoreplacing. */
+
+#ifndef AUTOREPLACE_TYPE_H
+#define AUTOREPLACE_TYPE_H
+
+struct EngineRenew;
+
+/**
+ * A list to group EngineRenew directives together (such as per-player).
+ */
+typedef EngineRenew* EngineRenewList;
+
+#endif /* AUTOREPLACE_TYPE_H */
--- a/src/autoslope.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/autoslope.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,6 +6,8 @@
 #define AUTOSLOPE_H
 
 #include "depot.h"
+#include "settings_type.h"
+#include "player_func.h"
 
 /**
  * Autoslope check for tiles with an entrance on an edge.
--- a/src/aystar.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/aystar.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -21,7 +21,7 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "aystar.h"
-#include "helpers.hpp"
+#include "core/alloc_func.hpp"
 
 int _aystar_stats_open_size;
 int _aystar_stats_closed_size;
--- a/src/aystar.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/aystar.h	Tue Jan 22 21:00:30 2008 +0000
@@ -12,6 +12,7 @@
 #define AYSTAR_H
 
 #include "queue.h"
+#include "tile_type.h"
 
 //#define AYSTAR_DEBUG
 enum {
--- a/src/blitter/32bpp_anim.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/blitter/32bpp_anim.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -1,16 +1,20 @@
+/* $Id$ */
+
 #include "../stdafx.h"
-#include "../zoom.hpp"
-#include "../gfx.h"
+#include "../core/alloc_func.hpp"
+#include "../gfx_func.h"
+#include "../zoom_func.h"
 #include "../debug.h"
-#include "../table/sprites.h"
 #include "../video/video_driver.hpp"
 #include "32bpp_anim.hpp"
 
+#include "../table/sprites.h"
+
 static FBlitter_32bppAnim iFBlitter_32bppAnim;
 
 void Blitter_32bppAnim::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
 {
-	if (bp->dst < _screen.dst_ptr || bp->dst > (uint32 *)_screen.dst_ptr + _screen.width * _screen.height) {
+	if (_screen_disable_anim) {
 		/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent Draw() */
 		Blitter_32bppOptimized::Draw(bp, mode, zoom);
 		return;
@@ -95,6 +99,12 @@
 
 void Blitter_32bppAnim::DrawColorMappingRect(void *dst, int width, int height, int pal)
 {
+	if (_screen_disable_anim) {
+		/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent DrawColorMappingRect() */
+		Blitter_32bppOptimized::DrawColorMappingRect(dst, width, height, pal);
+		return;
+	}
+
 	uint32 *udst = (uint32 *)dst;
 	uint8 *anim;
 
@@ -133,7 +143,9 @@
 void Blitter_32bppAnim::SetPixel(void *video, int x, int y, uint8 color)
 {
 	*((uint32 *)video + x + y * _screen.pitch) = LookupColourInPalette(color);
-	/* Set the color in the anim-buffer too */
+
+	/* Set the color in the anim-buffer too, if we are rendering to the screen */
+	if (_screen_disable_anim) return;
 	this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = color;
 }
 
@@ -142,13 +154,20 @@
 	uint32 *dst = (uint32 *)video + x + y * _screen.pitch;
 	if (*dst == 0) {
 		*dst = LookupColourInPalette(color);
-		/* Set the color in the anim-buffer too */
+		/* Set the color in the anim-buffer too, if we are rendering to the screen */
+		if (_screen_disable_anim) return;
 		this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = color;
 	}
 }
 
 void Blitter_32bppAnim::DrawRect(void *video, int width, int height, uint8 color)
 {
+	if (_screen_disable_anim) {
+		/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent DrawRect() */
+		Blitter_32bppOptimized::DrawRect(video, width, height, color);
+		return;
+	}
+
 	uint32 color32 = LookupColourInPalette(color);
 	uint8 *anim_line;
 
@@ -172,6 +191,7 @@
 
 void Blitter_32bppAnim::CopyFromBuffer(void *video, const void *src, int width, int height)
 {
+	assert(!_screen_disable_anim);
 	assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
 	uint32 *dst = (uint32 *)video;
 	uint32 *usrc = (uint32 *)src;
@@ -195,6 +215,7 @@
 
 void Blitter_32bppAnim::CopyToBuffer(const void *video, void *dst, int width, int height)
 {
+	assert(!_screen_disable_anim);
 	assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
 	uint32 *udst = (uint32 *)dst;
 	uint32 *src = (uint32 *)video;
@@ -217,6 +238,8 @@
 
 void Blitter_32bppAnim::ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y)
 {
+	assert(!_screen_disable_anim);
+	assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
 	uint8 *dst, *src;
 
 	/* We need to scroll the anim-buffer too */
@@ -265,6 +288,7 @@
 
 void Blitter_32bppAnim::PaletteAnimate(uint start, uint count)
 {
+	assert(!_screen_disable_anim);
 	uint8 *anim = this->anim_buf;
 
 	/* Never repaint the transparency pixel */
--- a/src/blitter/32bpp_base.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/blitter/32bpp_base.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -1,5 +1,7 @@
+/* $Id$ */
+
 #include "../stdafx.h"
-#include "../gfx.h"
+#include "../gfx_func.h"
 #include "32bpp_base.hpp"
 
 void *Blitter_32bppBase::MoveTo(const void *video, int x, int y)
--- a/src/blitter/32bpp_base.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/blitter/32bpp_base.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,6 +6,7 @@
 #define BLITTER_32BPP_BASE_HPP
 
 #include "base.hpp"
+#include "../core/bitmath_func.hpp"
 
 class Blitter_32bppBase : public Blitter {
 public:
--- a/src/blitter/32bpp_optimized.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/blitter/32bpp_optimized.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -1,8 +1,9 @@
+/* $Id$ */
+
 #include "../stdafx.h"
-#include "../zoom.hpp"
-#include "../gfx.h"
+#include "../zoom_func.h"
+#include "../gfx_func.h"
 #include "../debug.h"
-#include "../table/sprites.h"
 #include "32bpp_optimized.hpp"
 
 static FBlitter_32bppOptimized iFBlitter_32bppOptimized;
--- a/src/blitter/32bpp_simple.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/blitter/32bpp_simple.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -1,9 +1,12 @@
+/* $Id$ */
+
 #include "../stdafx.h"
-#include "../zoom.hpp"
-#include "../gfx.h"
+#include "../gfx_func.h"
+#include "../zoom_func.h"
 #include "../debug.h"
+#include "32bpp_simple.hpp"
+
 #include "../table/sprites.h"
-#include "32bpp_simple.hpp"
 
 static FBlitter_32bppSimple iFBlitter_32bppSimple;
 
--- a/src/blitter/8bpp_base.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/blitter/8bpp_base.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -1,5 +1,7 @@
+/* $Id$ */
+
 #include "../stdafx.h"
-#include "../gfx.h"
+#include "../gfx_func.h"
 #include "8bpp_base.hpp"
 
 void Blitter_8bppBase::DrawColorMappingRect(void *dst, int width, int height, int pal)
--- a/src/blitter/8bpp_debug.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/blitter/8bpp_debug.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,9 +3,8 @@
 /** @file 8bpp_debug.cpp */
 
 #include "../stdafx.h"
-#include "../zoom.hpp"
-#include "../gfx.h"
-#include "../functions.h"
+#include "../zoom_func.h"
+#include "../core/random_func.hpp"
 #include "8bpp_debug.hpp"
 
 static FBlitter_8bppDebug iFBlitter_8bppDebug;
--- a/src/blitter/8bpp_optimized.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/blitter/8bpp_optimized.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,9 +3,9 @@
 /** @file 8bpp_optimized.cpp */
 
 #include "../stdafx.h"
-#include "../zoom.hpp"
-#include "../gfx.h"
+#include "../zoom_func.h"
 #include "../debug.h"
+#include "../core/alloc_func.hpp"
 #include "8bpp_optimized.hpp"
 
 static FBlitter_8bppOptimized iFBlitter_8bppOptimized;
@@ -17,7 +17,7 @@
 	uint offset = 0;
 
 	/* Find the offset of this zoom-level */
-	offset = ((const uint8 *)bp->sprite)[(int)zoom * 2] | ((const byte *)bp->sprite)[(int)zoom * 2 + 1] << 8;
+	offset = ((const uint8 *)bp->sprite)[(int)(zoom - ZOOM_LVL_BEGIN) * 2] | ((const byte *)bp->sprite)[(int)(zoom - ZOOM_LVL_BEGIN) * 2 + 1] << 8;
 
 	/* Find where to start reading in the source sprite */
 	src = (const uint8 *)bp->sprite + offset;
@@ -110,9 +110,9 @@
 	uint index = 0;
 
 	/* Make memory for all zoom-levels */
-	memory += (int)ZOOM_LVL_END * sizeof(uint16);
-	for (int i = 0; i < (int)ZOOM_LVL_END; i++) {
-		memory += UnScaleByZoom(sprite->height, (ZoomLevel)i) * UnScaleByZoom(sprite->width, (ZoomLevel)i);
+	memory += (int)(ZOOM_LVL_END - ZOOM_LVL_BEGIN) * sizeof(uint16);
+	for (ZoomLevel i = ZOOM_LVL_BEGIN; i < ZOOM_LVL_END; i++) {
+		memory += UnScaleByZoom(sprite->height, i) * UnScaleByZoom(sprite->width, i);
 		index += 2;
 	}
 
@@ -121,7 +121,7 @@
 	temp_dst = MallocT<byte>(memory);
 
 	/* Make the sprites per zoom-level */
-	for (int i = 0; i < (int)ZOOM_LVL_END; i++) {
+	for (ZoomLevel i = ZOOM_LVL_BEGIN; i < ZOOM_LVL_END; i++) {
 		/* Store the scaled image */
 		const SpriteLoader::CommonPixel *src;
 
@@ -131,19 +131,19 @@
 
 		byte *dst = &temp_dst[index];
 
-		for (int y = 0; y < UnScaleByZoom(sprite->height, (ZoomLevel)i); y++) {
+		for (int y = 0; y < UnScaleByZoom(sprite->height, i); y++) {
 			uint trans = 0;
 			uint pixels = 0;
 			uint last_color = 0;
 			uint count_index = 0;
 			uint rx = 0;
-			src = &sprite->data[ScaleByZoom(y, (ZoomLevel)i) * sprite->width];
+			src = &sprite->data[ScaleByZoom(y, i) * sprite->width];
 
-			for (int x = 0; x < UnScaleByZoom(sprite->width, (ZoomLevel)i); x++) {
+			for (int x = 0; x < UnScaleByZoom(sprite->width, i); x++) {
 				uint color = 0;
 
 				/* Get the color keeping in mind the zoom-level */
-				for (int j = 0; j < ScaleByZoom(1, (ZoomLevel)i); j++) {
+				for (int j = 0; j < ScaleByZoom(1, i); j++) {
 					if (src->m != 0) color = src->m;
 					src++;
 					rx++;
--- a/src/blitter/8bpp_simple.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/blitter/8bpp_simple.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,8 +3,7 @@
 /** @file 8bpp_simple.cpp */
 
 #include "../stdafx.h"
-#include "../zoom.hpp"
-#include "../gfx.h"
+#include "../zoom_func.h"
 #include "8bpp_simple.hpp"
 
 static FBlitter_8bppSimple iFBlitter_8bppSimple;
--- a/src/blitter/base.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/blitter/base.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,7 @@
 
 #include "../spritecache.h"
 #include "../spriteloader/spriteloader.hpp"
+#include "../zoom_type.h"
 
 enum BlitterMode {
 	BM_NORMAL,
--- a/src/blitter/factory.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/blitter/factory.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,8 +4,8 @@
 #define BLITTER_FACTORY_HPP
 
 #include "base.hpp"
-#include "../string.h"
 #include "../debug.h"
+#include "../string_func.h"
 #include <string>
 #include <map>
 
@@ -41,7 +41,7 @@
 		if (name == NULL) return;
 
 		this->name = strdup(name);
-#if !defined(NDEBUG)
+#if !defined(NDEBUG) || defined(WITH_ASSERT)
 		/* NDEBUG disables asserts and gives a warning: unused variable 'P' */
 		std::pair<Blitters::iterator, bool> P =
 #endif /* !NDEBUG */
@@ -130,4 +130,6 @@
 	const char *GetName();
 };
 
+extern char _ini_blitter[32];
+
 #endif /* BLITTER_FACTORY_HPP */
--- a/src/blitter/null.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/blitter/null.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -1,5 +1,8 @@
+/* $Id$ */
+
+/** @file null.cpp A blitter that doesn't blit. */
+
 #include "../stdafx.h"
-#include "../variables.h"
 #include "null.hpp"
 
 static FBlitter_Null iFBlitter_Null;
--- a/src/bmp.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/bmp.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,11 +3,9 @@
 /** @file bmp.cpp */
 
 #include "stdafx.h"
-#include "openttd.h"
-#include "gfx.h"
 #include "bmp.h"
-#include "macros.h"
-#include "helpers.hpp"
+#include "core/bitmath_func.hpp"
+#include "core/alloc_func.hpp"
 
 void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file)
 {
@@ -354,7 +352,7 @@
 {
 	assert(info != NULL && data != NULL);
 
-	data->bitmap = (byte*)calloc(info->width * info->height, ((info->bpp == 24) ? 3 : 1) * sizeof(byte));
+	data->bitmap = CallocT<byte>(info->width * info->height * ((info->bpp == 24) ? 3 : 1));
 	if (data->bitmap == NULL) return false;
 
 	/* Load image */
--- a/src/bmp.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/bmp.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,8 @@
 #ifndef BMP_H
 #define BMP_H
 
+#include "gfx_type.h"
+
 struct BmpInfo {
 	uint32 offset;       ///< offset of bitmap data from .bmp file begining
 	uint32 width;        ///< bitmap width
--- a/src/bridge.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/bridge.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,10 @@
 #ifndef BRIDGE_H
 #define BRIDGE_H
 
+#include "gfx_type.h"
+#include "direction_type.h"
+#include "tile_cmd.h"
+
 enum {
 	MAX_BRIDGES = 13
 };
@@ -28,6 +32,7 @@
 extern Bridge _bridge[MAX_BRIDGES];
 
 Foundation GetBridgeFoundation(Slope tileh, Axis axis);
+bool HasBridgeFlatRamp(Slope tileh, Axis axis);
 
 static inline const Bridge *GetBridge(uint i)
 {
@@ -37,4 +42,8 @@
 
 void DrawBridgeMiddle(const TileInfo *ti);
 
+bool CheckBridge_Stuff(byte bridge_type, uint bridge_len);
+uint32 GetBridgeLength(TileIndex begin, TileIndex end);
+int CalcBridgeLenCostFactor(int x);
+
 #endif /* BRIDGE_H */
--- a/src/bridge_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/bridge_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,26 +4,34 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "functions.h"
-#include "map.h"
-#include "window.h"
 #include "gui.h"
-#include "viewport.h"
-#include "gfx.h"
-#include "command.h"
-#include "sound.h"
+#include "window_gui.h"
+#include "command_func.h"
+#include "economy_func.h"
 #include "variables.h"
 #include "bridge.h"
+#include "strings_func.h"
+#include "window_func.h"
+#include "sound_func.h"
+#include "map_func.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+
+#include "table/strings.h"
 
 static struct BridgeData {
+	uint8 last_size;
 	uint count;
 	TileIndex start_tile;
 	TileIndex end_tile;
 	uint8 type;
 	uint8 indexes[MAX_BRIDGES];
 	Money costs[MAX_BRIDGES];
+
+	BridgeData()
+		: last_size(4)
+		, count(0)
+		{};
 } _bridgedata;
 
 void CcBuildBridge(bool success, TileIndex tile, uint32 p1, uint32 p2)
@@ -39,9 +47,32 @@
 		CMD_BUILD_BRIDGE | CMD_MSG(STR_5015_CAN_T_BUILD_BRIDGE_HERE));
 }
 
+/* Names of the build bridge selection window */
+enum BuildBridgeSelectionWidgets {
+	BBSW_CLOSEBOX = 0,
+	BBSW_CAPTION,
+	BBSW_BRIDGE_LIST,
+	BBSW_SCROLLBAR,
+	BBSW_RESIZEBOX
+};
+
 static void BuildBridgeWndProc(Window *w, WindowEvent *e)
 {
 	switch (e->event) {
+		case WE_CREATE:
+			w->resize.step_height = 22;
+			w->vscroll.count = _bridgedata.count;
+
+			if (_bridgedata.last_size <= 4) {
+				w->vscroll.cap = 4;
+			} else {
+				/* Resize the bridge selection window if we used a bigger one the last time */
+				w->vscroll.cap = (w->vscroll.count > _bridgedata.last_size) ? _bridgedata.last_size : w->vscroll.count;
+				ResizeWindow(w, 0, (w->vscroll.cap - 4) * w->resize.step_height);
+				w->widget[BBSW_BRIDGE_LIST].data = (w->vscroll.cap << 8) + 1;
+			}
+			break;
+
 		case WE_PAINT: {
 			DrawWindowWidgets(w);
 
@@ -71,7 +102,7 @@
 		}
 
 		case WE_CLICK:
-			if (e->we.click.widget == 2) {
+			if (e->we.click.widget == BBSW_BRIDGE_LIST) {
 				uint ind = ((int)e->we.click.pt.y - 14) / w->resize.step_height;
 				if (ind < w->vscroll.cap) {
 					ind += w->vscroll.pos;
@@ -84,21 +115,25 @@
 
 		case WE_RESIZE:
 			w->vscroll.cap += e->we.sizing.diff.y / (int)w->resize.step_height;
-			w->widget[2].data = (w->vscroll.cap << 8) + 1;
+			w->widget[BBSW_BRIDGE_LIST].data = (w->vscroll.cap << 8) + 1;
 			SetVScrollCount(w, _bridgedata.count);
+
+			_bridgedata.last_size = w->vscroll.cap;
 			break;
 	}
 }
 
+/* Widget definition for the rail bridge selection window */
 static const Widget _build_bridge_widgets[] = {
-{   WWT_CLOSEBOX,   RESIZE_NONE,  7,   0,  10,   0,  13, STR_00C5,                    STR_018B_CLOSE_WINDOW},
-{    WWT_CAPTION,   RESIZE_NONE,  7,  11, 199,   0,  13, STR_100D_SELECT_RAIL_BRIDGE, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{     WWT_MATRIX, RESIZE_BOTTOM,  7,   0, 187,  14, 101, 0x401,                       STR_101F_BRIDGE_SELECTION_CLICK},
-{  WWT_SCROLLBAR, RESIZE_BOTTOM,  7, 188, 199,  14,  89, 0x0,                         STR_0190_SCROLL_BAR_SCROLLS_LIST},
-{  WWT_RESIZEBOX,     RESIZE_TB,  7, 188, 199,  90, 101, 0x0,                         STR_RESIZE_BUTTON},
+{   WWT_CLOSEBOX,   RESIZE_NONE,  7,   0,  10,   0,  13, STR_00C5,                    STR_018B_CLOSE_WINDOW},            // BBSW_CLOSEBOX
+{    WWT_CAPTION,   RESIZE_NONE,  7,  11, 199,   0,  13, STR_100D_SELECT_RAIL_BRIDGE, STR_018C_WINDOW_TITLE_DRAG_THIS},  // BBSW_CAPTION
+{     WWT_MATRIX, RESIZE_BOTTOM,  7,   0, 187,  14, 101, 0x401,                       STR_101F_BRIDGE_SELECTION_CLICK},  // BBSW_BRIDGE_LIST
+{  WWT_SCROLLBAR, RESIZE_BOTTOM,  7, 188, 199,  14,  89, 0x0,                         STR_0190_SCROLL_BAR_SCROLLS_LIST}, // BBSW_SCROLLBAR
+{  WWT_RESIZEBOX,     RESIZE_TB,  7, 188, 199,  90, 101, 0x0,                         STR_RESIZE_BUTTON},                // BBSW_RESIZEBOX
 {   WIDGETS_END},
 };
 
+/* Window definition for the rail bridge selection window */
 static const WindowDesc _build_bridge_desc = {
 	WDP_AUTO, WDP_AUTO, 200, 102, 200, 102,
 	WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR,
@@ -107,16 +142,17 @@
 	BuildBridgeWndProc
 };
 
-
+/* Widget definition for the road bridge selection window */
 static const Widget _build_road_bridge_widgets[] = {
-{   WWT_CLOSEBOX,   RESIZE_NONE,  7,   0,  10,   0,  13, STR_00C5,                    STR_018B_CLOSE_WINDOW},
-{    WWT_CAPTION,   RESIZE_NONE,  7,  11, 199,   0,  13, STR_1803_SELECT_ROAD_BRIDGE, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{     WWT_MATRIX, RESIZE_BOTTOM,  7,   0, 187,  14, 101, 0x401,                       STR_101F_BRIDGE_SELECTION_CLICK},
-{  WWT_SCROLLBAR, RESIZE_BOTTOM,  7, 188, 199,  14,  89, 0x0,                         STR_0190_SCROLL_BAR_SCROLLS_LIST},
-{  WWT_RESIZEBOX,     RESIZE_TB,  7, 188, 199,  90, 101, 0x0,                         STR_RESIZE_BUTTON},
+{   WWT_CLOSEBOX,   RESIZE_NONE,  7,   0,  10,   0,  13, STR_00C5,                    STR_018B_CLOSE_WINDOW},            // BBSW_CLOSEBOX
+{    WWT_CAPTION,   RESIZE_NONE,  7,  11, 199,   0,  13, STR_1803_SELECT_ROAD_BRIDGE, STR_018C_WINDOW_TITLE_DRAG_THIS},  // BBSW_CAPTION
+{     WWT_MATRIX, RESIZE_BOTTOM,  7,   0, 187,  14, 101, 0x401,                       STR_101F_BRIDGE_SELECTION_CLICK},  // BBSW_BRIDGE_LIST
+{  WWT_SCROLLBAR, RESIZE_BOTTOM,  7, 188, 199,  14,  89, 0x0,                         STR_0190_SCROLL_BAR_SCROLLS_LIST}, // BBSW_SCROLLBAR
+{  WWT_RESIZEBOX,     RESIZE_TB,  7, 188, 199,  90, 101, 0x0,                         STR_RESIZE_BUTTON},                // BBSW_RESIZEBOX
 {   WIDGETS_END},
 };
 
+/* Window definition for the road bridge selection window */
 static const WindowDesc _build_road_bridge_desc = {
 	WDP_AUTO, WDP_AUTO, 200, 102, 200, 102,
 	WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR,
@@ -167,10 +203,7 @@
 	}
 
 	if (j != 0) {
-		Window *w = AllocateWindowDesc((_bridgedata.type & 0x80) ? &_build_road_bridge_desc : &_build_bridge_desc);
-		w->vscroll.cap = 4;
-		w->vscroll.count = j;
-		w->resize.step_height = 22;
+		AllocateWindowDesc((_bridgedata.type & 0x80) ? &_build_road_bridge_desc : &_build_bridge_desc);
 	} else {
 		ShowErrorMessage(errmsg, STR_5015_CAN_T_BUILD_BRIDGE_HERE, TileX(end) * TILE_SIZE, TileY(end) * TILE_SIZE);
 	}
--- a/src/bridge_map.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/bridge_map.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -8,6 +8,7 @@
 #include "bridge.h"
 #include "variables.h"
 #include "landscape.h"
+#include "tunnelbridge_map.h"
 
 
 TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir)
@@ -17,7 +18,7 @@
 	dir = ReverseDiagDir(dir);
 	do {
 		tile += delta;
-	} while (!IsBridgeTile(tile) || GetBridgeRampDirection(tile) != dir);
+	} while (!IsBridgeTile(tile) || GetTunnelBridgeDirection(tile) != dir);
 
 	return tile;
 }
@@ -38,14 +39,14 @@
 TileIndex GetOtherBridgeEnd(TileIndex tile)
 {
 	assert(IsBridgeTile(tile));
-	return GetBridgeEnd(tile, GetBridgeRampDirection(tile));
+	return GetBridgeEnd(tile, GetTunnelBridgeDirection(tile));
 }
 
 uint GetBridgeHeight(TileIndex t)
 {
 	uint h;
 	Slope tileh = GetTileSlope(t, &h);
-	Foundation f = GetBridgeFoundation(tileh, DiagDirToAxis(GetBridgeRampDirection(t)));
+	Foundation f = GetBridgeFoundation(tileh, DiagDirToAxis(GetTunnelBridgeDirection(t)));
 
 	/* one height level extra for the ramp */
 	return h + TILE_HEIGHT + ApplyFoundationToSlope(f, &tileh);
--- a/src/bridge_map.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/bridge_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,12 +5,9 @@
 #ifndef BRIDGE_MAP_H
 #define BRIDGE_MAP_H
 
-#include "direction.h"
-#include "macros.h"
-#include "map.h"
-#include "rail.h"
+#include "direction_func.h"
+#include "rail_type.h"
 #include "road_map.h"
-#include "tile.h"
 
 
 /**
@@ -64,7 +61,6 @@
 	return GB(_m[t].m6, 6, 2) != 0;
 }
 
-
 /**
  * Determines the type of bridge on a tile
  * @param t The tile to analyze
@@ -77,20 +73,6 @@
 	return GB(_m[t].m2, 4, 4);
 }
 
-
-/**
- * Get the direction pointing onto the bridge
- * @param t The tile to analyze
- * @pre IsBridgeTile(t)
- * @return the above mentionned direction
- */
-static inline DiagDirection GetBridgeRampDirection(TileIndex t)
-{
-	assert(IsBridgeTile(t));
-	return (DiagDirection)GB(_m[t].m5, 0, 2);
-}
-
-
 /**
  * Get the axis of the bridge that goes over the tile. Not the axis or the ramp.
  * @param t The tile to analyze
@@ -103,45 +85,6 @@
 	return (Axis)(GB(_m[t].m6, 6, 2) - 1);
 }
 
-
-/**
- * Get the transport type of the bridge's ramp.
- * @param t The ramp tile to analyze
- * @pre IsBridgeTile(t)
- * @return the transport type of the bridge
- */
-static inline TransportType GetBridgeTransportType(TileIndex t)
-{
-	assert(IsBridgeTile(t));
-	return (TransportType)GB(_m[t].m5, 2, 2);
-}
-
-
-/**
- * Does the bridge ramp lie in a snow or desert area?
- * @param t The ramp tile to analyze
- * @pre IsBridgeTile(t)
- * @return true if and only if in a snow or desert area
- */
-static inline bool HasBridgeSnowOrDesert(TileIndex t)
-{
-	assert(IsBridgeTile(t));
-	return HasBit(_m[t].m4, 7);
-}
-
-
-/**
- * Sets whether the bridge ramp lies in a snow or desert area.
- * @param t              The ramp tile to set (un)make a snow/desert area
- * @param snow_or_desert Make (true) or unmake the tile a snow/desert area
- * @pre IsBridgeTile(t)
- */
-static inline void SetBridgeSnowOrDesert(TileIndex t, bool snow_or_desert)
-{
-	assert(IsBridgeTile(t));
-	SB(_m[t].m4, 7, 1, snow_or_desert);
-}
-
 /**
  * Finds the end of a bridge in the specified direction starting at a middle tile
  * @param t the bridge tile to find the bridge ramp for
@@ -187,7 +130,6 @@
 	ClrBit(_m[t].m6, 6 + a);
 }
 
-
 /**
  * Removes bridges from the given, that is bridges along the X and Y axis.
  * @param t the tile to remove the bridge from
--- a/src/build_vehicle_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/build_vehicle_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -9,34 +9,52 @@
 #include "ship.h"
 #include "aircraft.h"
 #include "debug.h"
-#include "functions.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "window.h"
 #include "gui.h"
-#include "vehicle.h"
 #include "articulated_vehicles.h"
-#include "gfx.h"
+#include "textbuf_gui.h"
 #include "station.h"
-#include "command.h"
+#include "command_func.h"
 #include "engine.h"
-#include "player.h"
+#include "player_func.h"
 #include "depot.h"
 #include "airport.h"
 #include "vehicle_gui.h"
 #include "newgrf_engine.h"
-#include "date.h"
-#include "strings.h"
 #include "cargotype.h"
 #include "group.h"
 #include "road_map.h"
+#include "strings_func.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "settings_type.h"
+#include "gfx_func.h"
+#include "widgets/dropdown_func.h"
 
+#include "table/sprites.h"
+#include "table/strings.h"
+
+struct buildvehicle_d {
+	VehicleType vehicle_type;
+	union {
+		RailTypeByte railtype;
+		AirportFTAClass::Flags flags;
+		RoadTypes roadtypes;
+	} filter;
+	byte sel_index;  ///< deprecated value, used for 'unified' ship and road
+	bool descending_sort_order;
+	byte sort_criteria;
+	bool regenerate_list;
+	EngineID sel_engine;
+	EngineID rename_engine;
+	EngineList eng_list;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(buildvehicle_d));
 
 enum BuildVehicleWidgets {
 	BUILD_VEHICLE_WIDGET_CLOSEBOX = 0,
 	BUILD_VEHICLE_WIDGET_CAPTION,
 	BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING,
-	BUILD_VEHICLE_WIDGET_SORT_TEXT,
 	BUILD_VEHICLE_WIDGET_SORT_DROPDOWN,
 	BUILD_VEHICLE_WIDGET_LIST,
 	BUILD_VEHICLE_WIDGET_SCROLLBAR,
@@ -51,8 +69,7 @@
 	{   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,                STR_018B_CLOSE_WINDOW },
 	{    WWT_CAPTION,  RESIZE_RIGHT,    14,    11,   239,     0,    13, 0x0,                     STR_018C_WINDOW_TITLE_DRAG_THIS },
 	{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,     0,    80,    14,    25, STR_SORT_BY,             STR_SORT_ORDER_TIP},
-	{      WWT_PANEL,  RESIZE_RIGHT,    14,    81,   227,    14,    25, 0x0,                     STR_SORT_CRITERIA_TIP},
-	{    WWT_TEXTBTN,     RESIZE_LR,    14,   228,   239,    14,    25, STR_0225,                STR_SORT_CRITERIA_TIP},
+	{   WWT_DROPDOWN,  RESIZE_RIGHT,    14,    81,   239,    14,    25, 0x0,                     STR_SORT_CRITERIA_TIP},
 	{     WWT_MATRIX,     RESIZE_RB,    14,     0,   227,    26,    39, 0x101,                   STR_NULL },
 	{  WWT_SCROLLBAR,    RESIZE_LRB,    14,   228,   239,    26,    39, 0x0,                     STR_0190_SCROLL_BAR_SCROLLS_LIST },
 	{      WWT_PANEL,    RESIZE_RTB,    14,     0,   239,    40,   161, 0x0,                     STR_NULL },
@@ -269,6 +286,38 @@
 	return _internal_sort_order ? -r : r;
 }
 
+/* Road vehicle sorting functions */
+static int CDECL RoadVehEngineCostSorter(const void *a, const void *b)
+{
+	int va = RoadVehInfo(*(const EngineID*)a)->base_cost;
+	int vb = RoadVehInfo(*(const EngineID*)b)->base_cost;
+	int r = va - vb;
+
+	return _internal_sort_order ? -r : r;
+}
+
+static int CDECL RoadVehEngineSpeedSorter(const void *a, const void *b)
+{
+	int va = RoadVehInfo(*(const EngineID*)a)->max_speed;
+	int vb = RoadVehInfo(*(const EngineID*)b)->max_speed;
+	int r = va - vb;
+
+	return _internal_sort_order ? -r : r;
+}
+
+static int CDECL RoadVehEngineRunningCostSorter(const void *a, const void *b)
+{
+	const int va = RoadVehInfo(*(const EngineID*)a)->running_cost;
+	const int vb = RoadVehInfo(*(const EngineID*)b)->running_cost;
+	const int r = va - vb;
+
+	if (r == 0) {
+		/* Use EngineID to sort instead since we want consistent sorting */
+		return EngineNumberSorter(a, b);
+	}
+	return _internal_sort_order ? -r : r;
+}
+
 static int CDECL RoadVehEngineCapacitySorter(const void *a, const void *b)
 {
 	int va = RoadVehInfo(*(const EngineID*)a)->capacity;
@@ -282,6 +331,38 @@
 	return _internal_sort_order ? -r : r;
 }
 
+/* Road vehicle sorting functions */
+static int CDECL ShipEngineCostSorter(const void *a, const void *b)
+{
+	int va = ShipVehInfo(*(const EngineID*)a)->base_cost;
+	int vb = ShipVehInfo(*(const EngineID*)b)->base_cost;
+	int r = va - vb;
+
+	return _internal_sort_order ? -r : r;
+}
+
+static int CDECL ShipEngineSpeedSorter(const void *a, const void *b)
+{
+	int va = ShipVehInfo(*(const EngineID*)a)->max_speed;
+	int vb = ShipVehInfo(*(const EngineID*)b)->max_speed;
+	int r = va - vb;
+
+	return _internal_sort_order ? -r : r;
+}
+
+static int CDECL ShipEngineRunningCostSorter(const void *a, const void *b)
+{
+	const int va = ShipVehInfo(*(const EngineID*)a)->running_cost;
+	const int vb = ShipVehInfo(*(const EngineID*)b)->running_cost;
+	const int r = va - vb;
+
+	if (r == 0) {
+		/* Use EngineID to sort instead since we want consistent sorting */
+		return EngineNumberSorter(a, b);
+	}
+	return _internal_sort_order ? -r : r;
+}
+
 static int CDECL ShipEngineCapacitySorter(const void *a, const void *b)
 {
 	int va = ShipVehInfo(*(const EngineID*)a)->capacity;
@@ -367,15 +448,21 @@
 }, {
 	/* Road vehicles */
 	&EngineNumberSorter,
+	&RoadVehEngineCostSorter,
+	&RoadVehEngineSpeedSorter,
 	&EngineIntroDateSorter,
 	&EngineNameSorter,
+	&RoadVehEngineRunningCostSorter,
 	&EngineReliabilitySorter,
 	&RoadVehEngineCapacitySorter,
 }, {
 	/* Ships */
 	&EngineNumberSorter,
+	&ShipEngineCostSorter,
+	&ShipEngineSpeedSorter,
 	&EngineIntroDateSorter,
 	&EngineNameSorter,
+	&ShipEngineRunningCostSorter,
 	&EngineReliabilitySorter,
 	&ShipEngineCapacitySorter,
 }, {
@@ -406,16 +493,22 @@
 }, {
 	/* Road vehicles */
 	STR_ENGINE_SORT_ENGINE_ID,
+	STR_ENGINE_SORT_COST,
+	STR_SORT_BY_MAX_SPEED,
 	STR_ENGINE_SORT_INTRO_DATE,
 	STR_SORT_BY_DROPDOWN_NAME,
+	STR_ENGINE_SORT_RUNNING_COST,
 	STR_SORT_BY_RELIABILITY,
 	STR_ENGINE_SORT_CARGO_CAPACITY,
 	INVALID_STRING_ID
 }, {
 	/* Ships */
 	STR_ENGINE_SORT_ENGINE_ID,
+	STR_ENGINE_SORT_COST,
+	STR_SORT_BY_MAX_SPEED,
 	STR_ENGINE_SORT_INTRO_DATE,
 	STR_SORT_BY_DROPDOWN_NAME,
+	STR_ENGINE_SORT_RUNNING_COST,
 	STR_SORT_BY_RELIABILITY,
 	STR_ENGINE_SORT_CARGO_CAPACITY,
 	INVALID_STRING_ID
@@ -667,7 +760,7 @@
 /* Figure out what train EngineIDs to put in the list */
 static void GenerateBuildTrainList(Window *w)
 {
-	EngineID eid, sel_id;
+	EngineID sel_id = INVALID_ENGINE;
 	int num_engines = 0;
 	int num_wagons  = 0;
 	buildvehicle_d *bv = &WP(w, buildvehicle_d);
@@ -680,7 +773,7 @@
 	 * Also check to see if the previously selected engine is still available,
 	 * and if not, reset selection to INVALID_ENGINE. This could be the case
 	 * when engines become obsolete and are removed */
-	for (sel_id = INVALID_ENGINE, eid = 0; eid < NUM_TRAIN_ENGINES; eid++) {
+	for (EngineID eid = 0; eid < NUM_TRAIN_ENGINES; eid++) {
 		const RailVehicleInfo *rvi = RailVehInfo(eid);
 
 		if (bv->filter.railtype != RAILTYPE_END && !HasPowerOnRail(rvi->railtype, bv->filter.railtype)) continue;
@@ -713,14 +806,12 @@
 /* Figure out what road vehicle EngineIDs to put in the list */
 static void GenerateBuildRoadVehList(Window *w)
 {
-	EngineID eid, sel_id;
+	EngineID sel_id = INVALID_ENGINE;
 	buildvehicle_d *bv = &WP(w, buildvehicle_d);
 
 	EngList_RemoveAll(&bv->eng_list);
 
-	sel_id = INVALID_ENGINE;
-
-	for (eid = ROAD_ENGINES_INDEX; eid < ROAD_ENGINES_INDEX + NUM_ROAD_ENGINES; eid++) {
+	for (EngineID eid = ROAD_ENGINES_INDEX; eid < ROAD_ENGINES_INDEX + NUM_ROAD_ENGINES; eid++) {
 		if (!IsEngineBuildable(eid, VEH_ROAD, _local_player)) continue;
 		if (!HasBit(bv->filter.roadtypes, HasBit(EngInfo(eid)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD)) continue;
 		EngList_Add(&bv->eng_list, eid);
@@ -733,14 +824,12 @@
 /* Figure out what ship EngineIDs to put in the list */
 static void GenerateBuildShipList(Window *w)
 {
-	EngineID eid, sel_id;
+	EngineID sel_id = INVALID_ENGINE;
 	buildvehicle_d *bv = &WP(w, buildvehicle_d);
 
 	EngList_RemoveAll(&bv->eng_list);
 
-	sel_id = INVALID_ENGINE;
-
-	for (eid = SHIP_ENGINES_INDEX; eid < SHIP_ENGINES_INDEX + NUM_SHIP_ENGINES; eid++) {
+	for (EngineID eid = SHIP_ENGINES_INDEX; eid < SHIP_ENGINES_INDEX + NUM_SHIP_ENGINES; eid++) {
 		if (!IsEngineBuildable(eid, VEH_SHIP, _local_player)) continue;
 		EngList_Add(&bv->eng_list, eid);
 
@@ -752,7 +841,7 @@
 /* Figure out what aircraft EngineIDs to put in the list */
 static void GenerateBuildAircraftList(Window *w)
 {
-	EngineID eid, sel_id;
+	EngineID sel_id = INVALID_ENGINE;
 	buildvehicle_d *bv = &WP(w, buildvehicle_d);
 
 	EngList_RemoveAll(&bv->eng_list);
@@ -761,8 +850,7 @@
 	 * Also check to see if the previously selected plane is still available,
 	 * and if not, reset selection to INVALID_ENGINE. This could be the case
 	 * when planes become obsolete and are removed */
-	sel_id = INVALID_ENGINE;
-	for (eid = AIRCRAFT_ENGINES_INDEX; eid < AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES; eid++) {
+	for (EngineID eid = AIRCRAFT_ENGINES_INDEX; eid < AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES; eid++) {
 		if (!IsEngineBuildable(eid, VEH_AIRCRAFT, _local_player)) continue;
 		/* First VEH_END window_numbers are fake to allow a window open for all different types at once */
 		if (w->window_number > VEH_END && !CanAircraftUseStation(eid, w->window_number)) continue;
@@ -892,9 +980,13 @@
 
 	SetVScrollCount(w, EngList_Count(&bv->eng_list));
 	SetDParam(0, bv->filter.railtype + STR_881C_NEW_RAIL_VEHICLES); // This should only affect rail vehicles
+
+	/* Set text of sort by dropdown */
+	w->widget[BUILD_VEHICLE_WIDGET_SORT_DROPDOWN].data = _sort_listing[bv->vehicle_type][bv->sort_criteria];
+
 	DrawWindowWidgets(w);
 
-	DrawEngineList(bv->vehicle_type, 2, 27, bv->eng_list, w->vscroll.pos, max, bv->sel_engine, false, DEFAULT_GROUP);
+	DrawEngineList(bv->vehicle_type, w->widget[BUILD_VEHICLE_WIDGET_LIST].left + 2, w->widget[BUILD_VEHICLE_WIDGET_LIST].top + 1, bv->eng_list, w->vscroll.pos, max, bv->sel_engine, false, DEFAULT_GROUP);
 
 	if (bv->sel_engine != INVALID_ENGINE) {
 		const Widget *wi = &w->widget[BUILD_VEHICLE_WIDGET_PANEL];
@@ -903,8 +995,7 @@
 		if (text_end > wi->bottom) ExpandPurchaseInfoWidget(w, text_end - wi->bottom);
 	}
 
-	DrawString(85, 15, _sort_listing[bv->vehicle_type][bv->sort_criteria], TC_BLACK);
-	DoDrawString(bv->descending_sort_order ? DOWNARROW : UPARROW, 69, 15, TC_BLACK);
+	DrawSortButtonState(w, BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING, bv->descending_sort_order ? SBS_DOWN : SBS_UP);
 }
 
 static void BuildVehicleClickEvent(Window *w, WindowEvent *e)
@@ -920,14 +1011,14 @@
 			break;
 
 		case BUILD_VEHICLE_WIDGET_LIST: {
-			uint i = (e->we.click.pt.y - 26) / GetVehicleListHeight(bv->vehicle_type) + w->vscroll.pos;
+			uint i = (e->we.click.pt.y - w->widget[BUILD_VEHICLE_WIDGET_LIST].top) / GetVehicleListHeight(bv->vehicle_type) + w->vscroll.pos;
 			uint num_items = EngList_Count(&bv->eng_list);
 			bv->sel_engine = (i < num_items) ? bv->eng_list[i] : INVALID_ENGINE;
 			SetWindowDirty(w);
 			break;
 		}
 
-		case BUILD_VEHICLE_WIDGET_SORT_TEXT: case BUILD_VEHICLE_WIDGET_SORT_DROPDOWN: // Select sorting criteria dropdown menu
+		case BUILD_VEHICLE_WIDGET_SORT_DROPDOWN: // Select sorting criteria dropdown menu
 			ShowDropDownMenu(w, _sort_listing[bv->vehicle_type], bv->sort_criteria, BUILD_VEHICLE_WIDGET_SORT_DROPDOWN, 0, 0);
 			break;
 
--- a/src/callback_table.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/callback_table.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,7 +5,6 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "callback_table.h"
-#include "functions.h"
 
 /* If you add a callback for DoCommandP, also add the callback in here
  *   see below for the full list!
--- a/src/callback_table.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/callback_table.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,7 +5,7 @@
 #ifndef CALLBACK_TABLE_H
 #define CALLBACK_TABLE_H
 
-#include "command.h"
+#include "command_type.h"
 
 extern CommandCallback *_callback_table[];
 extern const int _callback_table_count;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cargo_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,59 @@
+/* $Id$ */
+
+/** @file cargo_type.h Types related to cargos... */
+
+#ifndef CARGO_TYPE_H
+#define CARGO_TYPE_H
+
+typedef byte CargoID;
+
+enum {
+	// Temperate
+	CT_PASSENGERS   =  0,
+	CT_COAL         =  1,
+	CT_MAIL         =  2,
+	CT_OIL          =  3,
+	CT_LIVESTOCK    =  4,
+	CT_GOODS        =  5,
+	CT_GRAIN        =  6,
+	CT_WOOD         =  7,
+	CT_IRON_ORE     =  8,
+	CT_STEEL        =  9,
+	CT_VALUABLES    = 10,
+
+	// Arctic
+	CT_WHEAT        =  6,
+	CT_HILLY_UNUSED =  8,
+	CT_PAPER        =  9,
+	CT_GOLD         = 10,
+	CT_FOOD         = 11,
+
+	// Tropic
+	CT_RUBBER       =  1,
+	CT_FRUIT        =  4,
+	CT_MAIZE        =  6,
+	CT_COPPER_ORE   =  8,
+	CT_WATER        =  9,
+	CT_DIAMONDS     = 10,
+
+	// Toyland
+	CT_SUGAR        =  1,
+	CT_TOYS         =  3,
+	CT_BATTERIES    =  4,
+	CT_CANDY        =  5,
+	CT_TOFFEE       =  6,
+	CT_COLA         =  7,
+	CT_COTTON_CANDY =  8,
+	CT_BUBBLES      =  9,
+	CT_PLASTIC      = 10,
+	CT_FIZZY_DRINKS = 11,
+
+	NUM_CARGO       = 32,
+
+	CT_NO_REFIT     = 0xFE,
+	CT_INVALID      = 0xFF
+};
+
+typedef uint AcceptedCargo[NUM_CARGO];
+
+#endif /* OPENTTD_H */
--- a/src/cargopacket.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/cargopacket.h	Tue Jan 22 21:00:30 2008 +0000
@@ -1,10 +1,12 @@
 /* $Id$ */
 
-/** @file cargotype.h */
+/** @file cargopacket.h */
 
 #ifndef CARGOPACKET_H
 #define CARGOPACKET_H
 
+#include "economy_type.h"
+#include "tile_type.h"
 #include <list>
 
 typedef uint32 CargoPacketID;
--- a/src/cargotype.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/cargotype.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,12 +4,12 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "macros.h"
+#include "newgrf_cargo.h"
+#include "cargotype.h"
+#include "core/bitmath_func.hpp"
+
 #include "table/sprites.h"
 #include "table/strings.h"
-#include "newgrf_cargo.h"
-#include "cargotype.h"
-
 #include "table/cargo_const.h"
 
 CargoSpec _cargo[NUM_CARGO];
@@ -37,7 +37,7 @@
 		if (cl < lengthof(_default_cargo)) {
 			/* Copy the indexed cargo */
 			_cargo[i] = _default_cargo[cl];
-			SetBit(_cargo_mask, i);
+			if (_cargo[i].bitnum != INVALID_CARGO) SetBit(_cargo_mask, i);
 			continue;
 		}
 
--- a/src/cargotype.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/cargotype.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,9 @@
 #ifndef CARGOTYPE_H
 #define CARGOTYPE_H
 
+#include "cargo_type.h"
+#include "gfx_type.h"
+#include "newgrf_string_type.h"
 
 typedef uint32 CargoLabel;
 
@@ -33,11 +36,11 @@
 	uint16 multipliertowngrowth;
 	uint8 callback_mask;
 
-	StringID name;
-	StringID name_single;
-	StringID units_volume;
-	StringID quantifier;
-	StringID abbrev;
+	GRFMappedStringID name;
+	GRFMappedStringID name_single;
+	GRFMappedStringID units_volume;
+	GRFMappedStringID quantifier;
+	GRFMappedStringID abbrev;
 
 	SpriteID sprite;
 
--- a/src/clear_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/clear_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,442 +5,23 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "clear_map.h"
-#include "rail_map.h"
-#include "table/strings.h"
-#include "functions.h"
-#include "map.h"
-#include "player.h"
-#include "tile.h"
-#include "viewport.h"
-#include "command.h"
-#include "tunnel_map.h"
-#include "bridge_map.h"
+#include "command_func.h"
 #include "bridge.h"
 #include "landscape.h"
 #include "variables.h"
-#include "table/sprites.h"
 #include "unmovable_map.h"
 #include "genworld.h"
 #include "industry.h"
 #include "water_map.h"
-
-/*
- * In one terraforming command all four corners of a initial tile can be raised/lowered (though this is not available to the player).
- * The maximal amount of height modifications is archieved when raising a complete flat land from sea level to MAX_TILE_HEIGHT or vice versa.
- * This affects all corners with a manhatten distance smaller than MAX_TILE_HEIGHT to one of the initial 4 corners.
- * Their maximal amount is computed to 4 * \sum_{i=1}^{h_max} i  =  2 * h_max * (h_max + 1).
- */
-static const int TERRAFORMER_MODHEIGHT_SIZE = 2 * MAX_TILE_HEIGHT * (MAX_TILE_HEIGHT + 1);
-
-/*
- * The maximal amount of affected tiles (i.e. the tiles that incident with one of the corners above, is computed similiar to
- * 1 + 4 * \sum_{i=1}^{h_max} (i+1)  =  1 + 2 * h_max + (h_max + 3).
- */
-static const int TERRAFORMER_TILE_TABLE_SIZE = 1 + 2 * MAX_TILE_HEIGHT * (MAX_TILE_HEIGHT + 3);
-
-struct TerraformerHeightMod {
-	TileIndex tile;   ///< Referenced tile.
-	byte height;      ///< New TileHeight (height of north corner) of the tile.
-};
-
-struct TerraformerState {
-	int modheight_count;                                         ///< amount of entries in "modheight".
-	int tile_table_count;                                        ///< amount of entries in "tile_table".
-
-	/**
-	 * Dirty tiles, i.e.\ at least one corner changed.
-	 *
-	 * This array contains the tiles which are or will be marked as dirty.
-	 *
-	 * @ingroup dirty
-	 */
-	TileIndex tile_table[TERRAFORMER_TILE_TABLE_SIZE];
-	TerraformerHeightMod modheight[TERRAFORMER_MODHEIGHT_SIZE];  ///< Height modifications.
-};
-
-/**
- * Gets the TileHeight (height of north corner) of a tile as of current terraforming progress.
- *
- * @param ts TerraformerState.
- * @param tile Tile.
- * @return TileHeight.
- */
-static int TerraformGetHeightOfTile(TerraformerState *ts, TileIndex tile)
-{
-	TerraformerHeightMod *mod = ts->modheight;
-	int count;
-
-	for (count = ts->modheight_count; count != 0; count--, mod++) {
-		if (mod->tile == tile) return mod->height;
-	}
-
-	/* TileHeight unchanged so far, read value from map. */
-	return TileHeight(tile);
-}
-
-/**
- * Stores the TileHeight (height of north corner) of a tile in a TerraformerState.
- *
- * @param ts TerraformerState.
- * @param tile Tile.
- * @param height New TileHeight.
- */
-static void TerraformSetHeightOfTile(TerraformerState *ts, TileIndex tile, int height)
-{
-	/* Find tile in the "modheight" table.
-	 * Note: In a normal user-terraform command the tile will not be found in the "modheight" table.
-	 *       But during house- or industry-construction multiple corners can be terraformed at once. */
-	TerraformerHeightMod *mod = ts->modheight;
-	int count = ts->modheight_count;
-	while ((count > 0) && (mod->tile != tile)) {
-		mod++;
-		count--;
-	}
-
-	/* New entry? */
-	if (count == 0) {
-		assert(ts->modheight_count < TERRAFORMER_MODHEIGHT_SIZE);
-		ts->modheight_count++;
-	}
-
-	/* Finally store the new value */
-	mod->tile = tile;
-	mod->height = (byte)height;
-}
-
-/**
- * Adds a tile to the "tile_table" in a TerraformerState.
- *
- * @param ts TerraformerState.
- * @param tile Tile.
- * @ingroup dirty
- */
-static void TerraformAddDirtyTile(TerraformerState *ts, TileIndex tile)
-{
-	int count;
-	TileIndex *t;
-
-	count = ts->tile_table_count;
-
-	for (t = ts->tile_table; count != 0; count--, t++) {
-		if (*t == tile) return;
-	}
-
-	assert(ts->tile_table_count < TERRAFORMER_TILE_TABLE_SIZE);
-
-	ts->tile_table[ts->tile_table_count++] = tile;
-}
-
-/**
- * Adds all tiles that incident with the north corner of a specific tile to the "tile_table" in a TerraformerState.
- *
- * @param ts TerraformerState.
- * @param tile Tile.
- * @ingroup dirty
- */
-static void TerraformAddDirtyTileAround(TerraformerState *ts, TileIndex tile)
-{
-	TerraformAddDirtyTile(ts, tile + TileDiffXY( 0, -1));
-	TerraformAddDirtyTile(ts, tile + TileDiffXY(-1, -1));
-	TerraformAddDirtyTile(ts, tile + TileDiffXY(-1,  0));
-	TerraformAddDirtyTile(ts, tile);
-}
-
-/**
- * Terraform the north corner of a tile to a specific height.
- *
- * @param ts TerraformerState.
- * @param tile Tile.
- * @param height Aimed height.
- * @param return Error code or cost.
- */
-static CommandCost TerraformTileHeight(TerraformerState *ts, TileIndex tile, int height)
-{
-	CommandCost total_cost = CommandCost();
-
-	assert(tile < MapSize());
-
-	/* Check range of destination height */
-	if (height < 0) return_cmd_error(STR_1003_ALREADY_AT_SEA_LEVEL);
-	if (height > MAX_TILE_HEIGHT) return_cmd_error(STR_1004_TOO_HIGH);
-
-	/*
-	 * Check if the terraforming has any effect.
-	 * This can only be true, if multiple corners of the start-tile are terraformed (i.e. the terraforming is done by towns/industries etc.).
-	 * In this case the terraforming should fail. (Don't know why.)
-	 */
-	if (height == TerraformGetHeightOfTile(ts, tile)) return CMD_ERROR;
-
-	/* Check "too close to edge of map" */
-	uint x = TileX(tile);
-	uint y = TileY(tile);
-	if ((x <= 1) || (y <= 1) || (x >= MapMaxX() - 1) || (y >= MapMaxY() - 1)) {
-		/*
-		 * Determine a sensible error tile
-		 * Note: If x and y are both zero this will disable the error tile. (Tile 0 cannot be highlighted :( )
-		 */
-		if ((x == 1) && (y != 0)) x = 0;
-		if ((y == 1) && (x != 0)) y = 0;
-		_terraform_err_tile = TileXY(x, y);
-		return_cmd_error(STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP);
-	}
-
-	/* Mark incident tiles, that are involved in the terraforming */
-	TerraformAddDirtyTileAround(ts, tile);
-
-	/* Store the height modification */
-	TerraformSetHeightOfTile(ts, tile, height);
-
-	/* Increment cost */
-	total_cost.AddCost(_price.terraform);
-
-	/* Recurse to neighboured corners if height difference is larger than 1 */
-	{
-		const TileIndexDiffC *ttm;
-
-		static const TileIndexDiffC _terraform_tilepos[] = {
-			{ 1,  0}, // move to tile in SE
-			{-2,  0}, // undo last move, and move to tile in NW
-			{ 1,  1}, // undo last move, and move to tile in SW
-			{ 0, -2}  // undo last move, and move to tile in NE
-		};
-
-		for (ttm = _terraform_tilepos; ttm != endof(_terraform_tilepos); ttm++) {
-			tile += ToTileIndexDiff(*ttm);
-
-			/* Get TileHeight of neighboured tile as of current terraform progress */
-			int r = TerraformGetHeightOfTile(ts, tile);
-			int height_diff = height - r;
-
-			/* Is the height difference to the neighboured corner greater than 1? */
-			if (abs(height_diff) > 1) {
-				/* Terraform the neighboured corner. The resulting height difference should be 1. */
-				height_diff += (height_diff < 0 ? 1 : -1);
-				CommandCost cost = TerraformTileHeight(ts, tile, r + height_diff);
-				if (CmdFailed(cost)) return cost;
-				total_cost.AddCost(cost);
-			}
-		}
-	}
-
-	return total_cost;
-}
+#include "tile_cmd.h"
+#include "functions.h"
+#include "economy_func.h"
+#include "viewport_func.h"
+#include "settings_type.h"
 
-/** Terraform land
- * @param tile tile to terraform
- * @param flags for this command type
- * @param p1 corners to terraform (SLOPE_xxx)
- * @param p2 direction; eg up (non-zero) or down (zero)
- * @return error or cost of terraforming
- */
-CommandCost CmdTerraformLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
-{
-	TerraformerState ts;
-	CommandCost total_cost = CommandCost();
-	int direction = (p2 != 0 ? 1 : -1);
-
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
-	_terraform_err_tile = 0;
-
-	ts.modheight_count = ts.tile_table_count = 0;
-
-	/* Make an extra check for map-bounds cause we add tiles to the originating tile */
-	if (tile + TileDiffXY(1, 1) >= MapSize()) return CMD_ERROR;
-
-	/* Compute the costs and the terraforming result in a model of the landscape */
-	if ((p1 & SLOPE_W) != 0) {
-		TileIndex t = tile + TileDiffXY(1, 0);
-		CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
-		if (CmdFailed(cost)) return cost;
-		total_cost.AddCost(cost);
-	}
-
-	if ((p1 & SLOPE_S) != 0) {
-		TileIndex t = tile + TileDiffXY(1, 1);
-		CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
-		if (CmdFailed(cost)) return cost;
-		total_cost.AddCost(cost);
-	}
-
-	if ((p1 & SLOPE_E) != 0) {
-		TileIndex t = tile + TileDiffXY(0, 1);
-		CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
-		if (CmdFailed(cost)) return cost;
-		total_cost.AddCost(cost);
-	}
-
-	if ((p1 & SLOPE_N) != 0) {
-		TileIndex t = tile + TileDiffXY(0, 0);
-		CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
-		if (CmdFailed(cost)) return cost;
-		total_cost.AddCost(cost);
-	}
-
-	/* Check if the terraforming is valid wrt. tunnels, bridges and objects on the surface */
-	{
-		int count;
-		TileIndex *ti = ts.tile_table;
-
-		for (count = ts.tile_table_count; count != 0; count--, ti++) {
-			TileIndex tile = *ti;
-
-			/* Find new heights of tile corners */
-			uint z_N = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(0, 0));
-			uint z_W = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(1, 0));
-			uint z_S = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(1, 1));
-			uint z_E = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(0, 1));
-
-			/* Find min and max height of tile */
-			uint z_min = min(min(z_N, z_W), min(z_S, z_E));
-			uint z_max = max(max(z_N, z_W), max(z_S, z_E));
-
-			/* Compute tile slope */
-			uint tileh = (z_max > z_min + 1 ? SLOPE_STEEP : SLOPE_FLAT);
-			if (z_W > z_min) tileh += SLOPE_W;
-			if (z_S > z_min) tileh += SLOPE_S;
-			if (z_E > z_min) tileh += SLOPE_E;
-			if (z_N > z_min) tileh += SLOPE_N;
-
-			/* Check if bridge would take damage */
-			if (direction == 1 && MayHaveBridgeAbove(tile) && IsBridgeAbove(tile) &&
-					GetBridgeHeight(GetSouthernBridgeEnd(tile)) <= z_max * TILE_HEIGHT) {
-				_terraform_err_tile = tile; // highlight the tile under the bridge
-				return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
-			}
-			/* Check if tunnel would take damage */
-			if (direction == -1 && IsTunnelInWay(tile, z_min * TILE_HEIGHT)) {
-				_terraform_err_tile = tile; // highlight the tile above the tunnel
-				return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE);
-			}
-			/* Check tiletype-specific things, and add extra-cost */
-			CommandCost cost = _tile_type_procs[GetTileType(tile)]->terraform_tile_proc(tile, flags | DC_AUTO, z_min * TILE_HEIGHT, (Slope) tileh);
-			if (CmdFailed(cost)) {
-				_terraform_err_tile = tile;
-				return cost;
-			}
-			total_cost.AddCost(cost);
-		}
-	}
-
-	if (flags & DC_EXEC) {
-		/* change the height */
-		{
-			int count;
-			TerraformerHeightMod *mod;
-
-			mod = ts.modheight;
-			for (count = ts.modheight_count; count != 0; count--, mod++) {
-				TileIndex til = mod->tile;
-
-				SetTileHeight(til, mod->height);
-			}
-		}
-
-		/* finally mark the dirty tiles dirty */
-		{
-			int count;
-			TileIndex *ti = ts.tile_table;
-			for (count = ts.tile_table_count; count != 0; count--, ti++) {
-				MarkTileDirtyByTile(*ti);
-			}
-		}
-	}
-	return total_cost;
-}
-
-
-/** Levels a selected (rectangle) area of land
- * @param tile end tile of area-drag
- * @param flags for this command type
- * @param p1 start tile of area drag
- * @param p2 unused
- * @return  error or cost of terraforming
- */
-CommandCost CmdLevelLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
-{
-	int size_x, size_y;
-	int ex;
-	int ey;
-	int sx, sy;
-	uint h, curh;
-	CommandCost money;
-	CommandCost ret;
-	CommandCost cost;
-
-	if (p1 >= MapSize()) return CMD_ERROR;
-
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
-	/* remember level height */
-	h = TileHeight(p1);
-
-	/* make sure sx,sy are smaller than ex,ey */
-	ex = TileX(tile);
-	ey = TileY(tile);
-	sx = TileX(p1);
-	sy = TileY(p1);
-	if (ex < sx) Swap(ex, sx);
-	if (ey < sy) Swap(ey, sy);
-	tile = TileXY(sx, sy);
-
-	size_x = ex - sx + 1;
-	size_y = ey - sy + 1;
-
-	money.AddCost(GetAvailableMoneyForCommand());
-
-	BEGIN_TILE_LOOP(tile2, size_x, size_y, tile) {
-		curh = TileHeight(tile2);
-		while (curh != h) {
-			ret = DoCommand(tile2, SLOPE_N, (curh > h) ? 0 : 1, flags & ~DC_EXEC, CMD_TERRAFORM_LAND);
-			if (CmdFailed(ret)) break;
-
-			if (flags & DC_EXEC) {
-				money.AddCost(-ret.GetCost());
-				if (money.GetCost() < 0) {
-					_additional_cash_required = ret.GetCost();
-					return cost;
-				}
-				DoCommand(tile2, SLOPE_N, (curh > h) ? 0 : 1, flags, CMD_TERRAFORM_LAND);
-			}
-
-			cost.AddCost(ret);
-			curh += (curh > h) ? -1 : 1;
-		}
-	} END_TILE_LOOP(tile2, size_x, size_y, tile)
-
-	return (cost.GetCost() == 0) ? CMD_ERROR : cost;
-}
-
-/** Purchase a land area. Actually you only purchase one tile, so
- * the name is a bit confusing ;p
- * @param tile the tile the player is purchasing
- * @param flags for this command type
- * @param p1 unused
- * @param p2 unused
- * @return error of cost of operation
- */
-CommandCost CmdPurchaseLandArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
-{
-	CommandCost cost;
-
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
-	if (IsOwnedLandTile(tile) && IsTileOwner(tile, _current_player)) {
-		return_cmd_error(STR_5807_YOU_ALREADY_OWN_IT);
-	}
-
-	cost = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
-	if (CmdFailed(cost)) return CMD_ERROR;
-
-	if (flags & DC_EXEC) {
-		MakeOwnedLand(tile, _current_player);
-		MarkTileDirtyByTile(tile);
-	}
-
-	return cost.AddCost(_price.clear_roughland * 10);
-}
-
+#include "table/strings.h"
+#include "table/sprites.h"
+#include "table/clear_land.h"
 
 static CommandCost ClearTile_Clear(TileIndex tile, byte flags)
 {
@@ -452,7 +33,7 @@
 		&_price.clear_roughland,
 		&_price.clear_roughland,
 	};
-	CommandCost price;
+	CommandCost price(EXPENSES_CONSTRUCTION);
 
 	if (!IsClearGround(tile, CLEAR_GRASS) || GetClearDensity(tile) != 0) {
 		price.AddCost(*clear_price_table[GetClearGround(tile)]);
@@ -463,33 +44,6 @@
 	return price;
 }
 
-/** Sell a land area. Actually you only sell one tile, so
- * the name is a bit confusing ;p
- * @param tile the tile the player is selling
- * @param flags for this command type
- * @param p1 unused
- * @param p2 unused
- * @return error or cost of operation
- */
-CommandCost CmdSellLandArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
-{
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
-	if (!IsOwnedLandTile(tile)) return CMD_ERROR;
-	if (!CheckTileOwnership(tile) && _current_player != OWNER_WATER) return CMD_ERROR;
-
-
-	if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
-
-	if (flags & DC_EXEC) DoClearSquare(tile);
-
-	return CommandCost(- _price.clear_roughland * 2);
-}
-
-
-#include "table/clear_land.h"
-
-
 void DrawClearLandTile(const TileInfo *ti, byte set)
 {
 	DrawGroundSprite(SPR_FLAT_BARE_LAND + _tileh_to_sprite[ti->tileh] + set * 19, PAL_NONE);
--- a/src/clear_map.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/clear_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,9 +5,8 @@
 #ifndef CLEAR_MAP_H
 #define CLEAR_MAP_H
 
-#include "macros.h"
-#include "tile.h"
 #include "bridge_map.h"
+#include "industry_type.h"
 
 /**
  * Ground types. Valid densities in comments after the enum.
--- a/src/cmd_helper.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/cmd_helper.h	Tue Jan 22 21:00:30 2008 +0000
@@ -3,13 +3,12 @@
 #ifndef CMD_HELPER_H
 #define CMD_HELPER_H
 
-#include "direction.h"
-#include "macros.h"
-#include "road.h"
+#include "direction_type.h"
+#include "road_type.h"
 
 
 template<uint N> static inline void ExtractValid();
-template<> static inline void ExtractValid<1>() {}
+template<> inline void ExtractValid<1>() {}
 
 
 template<typename T> struct ExtractBits;
--- a/src/command.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/command.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,20 +4,28 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "functions.h"
 #include "landscape.h"
-#include "map.h"
+#include "tile_map.h"
 #include "gui.h"
-#include "command.h"
-#include "player.h"
+#include "command_func.h"
 #include "network/network.h"
 #include "variables.h"
 #include "genworld.h"
 #include "newgrf_storage.h"
+#include "strings_func.h"
+#include "gfx_func.h"
+#include "functions.h"
+#include "town.h"
+#include "date_func.h"
+#include "debug.h"
+#include "player_func.h"
+#include "player_base.h"
+#include "signal_func.h"
+
+#include "table/strings.h"
 
 const char *_cmd_text = NULL;
+StringID _error_message;
 
 /**
  * Helper macro to define the header of all command handler macros.
@@ -387,7 +395,7 @@
 	return _command_proc_table[cmd & 0xFF].flags;
 }
 
-static int _docommand_recursive;
+static int _docommand_recursive = 0;
 
 /*!
  * This function executes a given command with the parameters from the #CommandProc parameter list.
@@ -400,7 +408,7 @@
  * @param procc The command-id to execute (a value of the CMD_* enums)
  * @see CommandProc
  */
-CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc)
+CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc)
 {
 	CommandCost res;
 	CommandProc *proc;
@@ -419,7 +427,9 @@
 
 	/* only execute the test call if it's toplevel, or we're not execing. */
 	if (_docommand_recursive == 1 || !(flags & DC_EXEC) || (flags & DC_FORCETEST) ) {
+		SetTownRatingTestMode(true);
 		res = proc(tile, flags & ~DC_EXEC, p1, p2);
+		SetTownRatingTestMode(false);
 		if (CmdFailed(res)) {
 			res.SetGlobalErrorMessage();
 			goto error;
@@ -440,7 +450,7 @@
 	}
 
 	/* Execute the command here. All cost-relevant functions set the expenses type
-	 * themselves with "SET_EXPENSES_TYPE(...);" at the beginning of the function */
+	 * themselves to the cost object at some point */
 	res = proc(tile, flags, p1, p2);
 	if (CmdFailed(res)) {
 		res.SetGlobalErrorMessage();
@@ -539,7 +549,7 @@
 	 *  e.g.: if you demolish a whole town, the dryrun would say okay.
 	 *  but by really destroying, your rating drops and at a certain point
 	 *  it will fail. so res and res2 are different
-	 * CMD_REMOVE_ROAD: This command has special local authority
+	 * CMD_REMOVE_LONG_ROAD: This command has special local authority
 	 * restrictions which may cause the test run to fail (the previous
 	 * road fragments still stay there and the town won't let you
 	 * disconnect the road system), but the exec will succeed and this
@@ -549,9 +559,7 @@
 	 * estimate the cost of cloning a vehicle. */
 	notest =
 		(cmd & 0xFF) == CMD_CLEAR_AREA ||
-		(cmd & 0xFF) == CMD_CONVERT_RAIL ||
 		(cmd & 0xFF) == CMD_LEVEL_LAND ||
-		(cmd & 0xFF) == CMD_REMOVE_ROAD ||
 		(cmd & 0xFF) == CMD_REMOVE_LONG_ROAD ||
 		(cmd & 0xFF) == CMD_CLONE_VEHICLE;
 
@@ -581,7 +589,9 @@
 
 	if (!((cmd & CMD_NO_TEST_IF_IN_NETWORK) && _networking)) {
 		/* first test if the command can be executed. */
+		SetTownRatingTestMode(true);
 		res = proc(tile, flags, p1, p2);
+		SetTownRatingTestMode(false);
 		if (CmdFailed(res)) {
 			res.SetGlobalErrorMessage();
 			goto show_error;
@@ -609,6 +619,7 @@
 		return true;
 	}
 #endif /* ENABLE_NETWORK */
+	DebugDumpCommands("ddc:cmd:%d;%d;%d;%d;%d;%d;%d;%s\n", _date, _date_fract, (int)_current_player, tile, p1, p2, cmd, _cmd_text);
 
 	/* update last build coordinate of player. */
 	if (tile != 0 && IsValidPlayer(_current_player)) {
@@ -617,7 +628,6 @@
 
 	/* Actually try and execute the command. If no cost-type is given
 	 * use the construction one */
-	_yearly_expenses_type = EXPENSES_CONSTRUCTION;
 	res2 = proc(tile, flags | DC_EXEC, p1, p2);
 
 	/* If notest is on, it means the result of the test can be different than
@@ -633,6 +643,9 @@
 
 	SubtractMoneyFromPlayer(res2);
 
+	/* update signals if needed */
+	UpdateSignalsInBuffer();
+
 	if (IsLocalPlayer() && _game_mode != GM_EDITOR) {
 		if (res2.GetCost() != 0 && tile != 0) ShowCostOrIncomeAnimation(x, y, GetSlopeZ(x, y), res2.GetCost());
 		if (_additional_cash_required != 0) {
@@ -692,6 +705,11 @@
 	return this->cost;
 }
 
+ExpensesType CommandCost::GetExpensesType() const
+{
+	return this->expense_type;
+}
+
 void CommandCost::SetGlobalErrorMessage() const
 {
 	extern StringID _error_message;
--- a/src/command.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,350 +0,0 @@
-/* $Id$ */
-
-/** @file command.h */
-
-#ifndef COMMAND_H
-#define COMMAND_H
-
-/**
- * List of commands.
- *
- * This enum defines all possible commands which can be executed to the game
- * engine. Observing the game like the query-tool or checking the profit of a
- * vehicle don't result in a command which should be executed in the engine
- * nor send to the server in a network game.
- *
- * @see _command_proc_table
- */
-enum {
-	CMD_BUILD_RAILROAD_TRACK         =   0, ///< build a rail track
-	CMD_REMOVE_RAILROAD_TRACK        =   1, ///< remove a rail track
-	CMD_BUILD_SINGLE_RAIL            =   2, ///< build a single rail track
-	CMD_REMOVE_SINGLE_RAIL           =   3, ///< remove a single rail track
-	CMD_LANDSCAPE_CLEAR              =   4, ///< demolish a tile
-	CMD_BUILD_BRIDGE                 =   5, ///< build a bridge
-	CMD_BUILD_RAILROAD_STATION       =   6, ///< build a railroad station
-	CMD_BUILD_TRAIN_DEPOT            =   7, ///< build a train depot
-	CMD_BUILD_SIGNALS                =   8, ///< build a signal
-	CMD_REMOVE_SIGNALS               =   9, ///< remove a signal
-	CMD_TERRAFORM_LAND               =  10, ///< terraform a tile
-	CMD_PURCHASE_LAND_AREA           =  11, ///< purchase a tile
-	CMD_SELL_LAND_AREA               =  12, ///< sell a bought tile before
-	CMD_BUILD_TUNNEL                 =  13, ///< build a tunnel
-
-	CMD_REMOVE_FROM_RAILROAD_STATION =  14, ///< remove a tile station
-	CMD_CONVERT_RAIL                 =  15, ///< convert a rail type
-
-	CMD_BUILD_TRAIN_WAYPOINT         =  16, ///< build a waypoint
-	CMD_RENAME_WAYPOINT              =  17, ///< rename a waypoint
-	CMD_REMOVE_TRAIN_WAYPOINT        =  18, ///< remove a waypoint
-
-	CMD_BUILD_ROAD_STOP              =  21, ///< build a road stop
-	CMD_REMOVE_ROAD_STOP             =  22, ///< remove a road stop
-	CMD_BUILD_LONG_ROAD              =  23, ///< build a complete road (not a "half" one)
-	CMD_REMOVE_LONG_ROAD             =  24, ///< remove a complete road (not a "half" one)
-	CMD_BUILD_ROAD                   =  25, ///< build a "half" road
-	CMD_REMOVE_ROAD                  =  26, ///< remove a "half" road
-	CMD_BUILD_ROAD_DEPOT             =  27, ///< build a road depot
-
-	CMD_BUILD_AIRPORT                =  29, ///< build an airport
-
-	CMD_BUILD_DOCK                   =  30, ///< build a dock
-
-	CMD_BUILD_SHIP_DEPOT             =  31, ///< build a ship depot
-	CMD_BUILD_BUOY                   =  32, ///< build a buoy
-
-	CMD_PLANT_TREE                   =  33, ///< plant a tree
-
-	CMD_BUILD_RAIL_VEHICLE           =  34, ///< build a rail vehicle
-	CMD_MOVE_RAIL_VEHICLE            =  35, ///< move a rail vehicle (in the depot)
-
-	CMD_START_STOP_TRAIN             =  36, ///< start or stop a train
-
-	CMD_SELL_RAIL_WAGON              =  38, ///< sell a rail wagon
-
-	CMD_SEND_TRAIN_TO_DEPOT          =  39, ///< send a train to a depot
-	CMD_FORCE_TRAIN_PROCEED          =  40, ///< proceed a train to pass a red signal
-	CMD_REVERSE_TRAIN_DIRECTION      =  41, ///< turn a train around
-
-	CMD_MODIFY_ORDER                 =  42, ///< modify an order (like set full-load)
-	CMD_SKIP_TO_ORDER                =  43, ///< skip an order to the next of specific one
-	CMD_DELETE_ORDER                 =  44, ///< delete an order
-	CMD_INSERT_ORDER                 =  45, ///< insert a new order
-
-	CMD_CHANGE_SERVICE_INT           =  46, ///< change the server interval of a vehicle
-
-	CMD_BUILD_INDUSTRY               =  47, ///< build a new industry
-
-	CMD_BUILD_COMPANY_HQ             =  48, ///< build the company headquarter
-	CMD_SET_PLAYER_FACE              =  49, ///< set the face of the player/company
-	CMD_SET_PLAYER_COLOR             =  50, ///< set the color of the player/company
-
-	CMD_INCREASE_LOAN                =  51, ///< increase the loan from the bank
-	CMD_DECREASE_LOAN                =  52, ///< decrease the loan from the bank
-
-	CMD_WANT_ENGINE_PREVIEW          =  53, ///< confirm the preview of an engine
-
-	CMD_NAME_VEHICLE                 =  54, ///< rename a whole vehicle
-	CMD_RENAME_ENGINE                =  55, ///< rename a engine (in the engine list)
-	CMD_CHANGE_COMPANY_NAME          =  56, ///< change the company name
-	CMD_CHANGE_PRESIDENT_NAME        =  57, ///< change the president name
-	CMD_RENAME_STATION               =  58, ///< rename a station
-
-	CMD_SELL_AIRCRAFT                =  59, ///< sell an aircraft
-	CMD_START_STOP_AIRCRAFT          =  60, ///< start/stop an aircraft
-	CMD_BUILD_AIRCRAFT               =  61, ///< build an aircraft
-	CMD_SEND_AIRCRAFT_TO_HANGAR      =  62, ///< send an aircraft to a hanger
-	CMD_REFIT_AIRCRAFT               =  64, ///< refit the cargo space of an aircraft
-
-	CMD_PLACE_SIGN                   =  65, ///< place a sign
-	CMD_RENAME_SIGN                  =  66, ///< rename a sign
-
-	CMD_BUILD_ROAD_VEH               =  67, ///< build a road vehicle
-	CMD_START_STOP_ROADVEH           =  68, ///< start/stop a road vehicle
-	CMD_SELL_ROAD_VEH                =  69, ///< sell a road vehicle
-	CMD_SEND_ROADVEH_TO_DEPOT        =  70, ///< send a road vehicle to the depot
-	CMD_TURN_ROADVEH                 =  71, ///< turn a road vehicle around
-	CMD_REFIT_ROAD_VEH               =  72, ///< refit the cargo space of a road vehicle
-
-	CMD_PAUSE                        =  73, ///< pause the game
-
-	CMD_BUY_SHARE_IN_COMPANY         =  74, ///< buy a share from a company
-	CMD_SELL_SHARE_IN_COMPANY        =  75, ///< sell a share from a company
-	CMD_BUY_COMPANY                  =  76, ///< buy a company which is bankrupt
-
-	CMD_BUILD_TOWN                   =  77, ///< build a town
-
-	CMD_RENAME_TOWN                  =  80, ///< rename a town
-	CMD_DO_TOWN_ACTION               =  81, ///< do a action from the town detail window (like advertises or bribe)
-
-	CMD_SET_ROAD_DRIVE_SIDE          =  82, ///< set the side where the road vehicles drive
-
-	CMD_CHANGE_DIFFICULTY_LEVEL      =  85, ///< change the difficult of a game (each setting for it own)
-
-	CMD_START_STOP_SHIP              =  86, ///< start/stop a ship
-	CMD_SELL_SHIP                    =  87, ///< sell a ship
-	CMD_BUILD_SHIP                   =  88, ///< build a new ship
-	CMD_SEND_SHIP_TO_DEPOT           =  89, ///< send a ship to a depot
-	CMD_REFIT_SHIP                   =  91, ///< refit the cargo space of a ship
-
-	CMD_ORDER_REFIT                  =  98, ///< change the refit informaction of an order (for "goto depot" )
-	CMD_CLONE_ORDER                  =  99, ///< clone (and share) an order
-	CMD_CLEAR_AREA                   = 100, ///< clear an area
-
-	CMD_MONEY_CHEAT                  = 102, ///< do the money cheat
-	CMD_BUILD_CANAL                  = 103, ///< build a canal
-
-	CMD_PLAYER_CTRL                  = 104, ///< used in multiplayer to create a new player etc.
-	CMD_LEVEL_LAND                   = 105, ///< level land
-
-	CMD_REFIT_RAIL_VEHICLE           = 106, ///< refit the cargo space of a train
-	CMD_RESTORE_ORDER_INDEX          = 107, ///< restore vehicle order-index and service interval
-	CMD_BUILD_LOCK                   = 108, ///< build a lock
-
-	CMD_BUILD_SIGNAL_TRACK           = 110, ///< add signals along a track (by dragging)
-	CMD_REMOVE_SIGNAL_TRACK          = 111, ///< remove signals along a track (by dragging)
-
-	CMD_GIVE_MONEY                   = 113, ///< give money to an other player
-	CMD_CHANGE_PATCH_SETTING         = 114, ///< change a patch setting
-
-	CMD_SET_AUTOREPLACE              = 115, ///< set an autoreplace entry
-
-	CMD_CLONE_VEHICLE                = 116, ///< clone a vehicle
-	CMD_MASS_START_STOP              = 117, ///< start/stop all vehicles (in a depot)
-	CMD_DEPOT_SELL_ALL_VEHICLES      = 118, ///< sell all vehicles which are in a given depot
-	CMD_DEPOT_MASS_AUTOREPLACE       = 119, ///< force the autoreplace to take action in a given depot
-
-	CMD_CREATE_GROUP                 = 120, ///< create a new group
-	CMD_DELETE_GROUP                 = 121, ///< delete a group
-	CMD_RENAME_GROUP                 = 122, ///< rename a group
-	CMD_ADD_VEHICLE_GROUP            = 123, ///< add a vehicle to a group
-	CMD_ADD_SHARED_VEHICLE_GROUP     = 124, ///< add all other shared vehicles to a group which are missing
-	CMD_REMOVE_ALL_VEHICLES_GROUP    = 125, ///< remove all vehicles from a group
-	CMD_SET_GROUP_REPLACE_PROTECTION = 126, ///< set the autoreplace-protection for a group
-
-	CMD_MOVE_ORDER                   = 127, ///< move an order
-	CMD_CHANGE_TIMETABLE             = 128, ///< change the timetable for a vehicle
-	CMD_SET_VEHICLE_ON_TIME          = 129, ///< set the vehicle on time feature (timetable)
-	CMD_AUTOFILL_TIMETABLE           = 130, ///< autofill the timetable
-};
-
-/**
- * List of flags for a command.
- *
- * This enums defines some flags which can be used for the commands.
- */
-enum {
-	DC_EXEC            = 0x01, ///< execute the given command
-	DC_AUTO            = 0x02, ///< don't allow building on structures
-	DC_QUERY_COST      = 0x04, ///< query cost only,  don't build.
-	DC_NO_WATER        = 0x08, ///< don't allow building on water
-	DC_NO_RAIL_OVERLAP = 0x10, ///< don't allow overlap of rails (used in buildrail)
-	DC_AI_BUILDING     = 0x20, ///< special building rules for AI
-	DC_NO_TOWN_RATING  = 0x40, ///< town rating does not disallow you from building
-	DC_FORCETEST       = 0x80, ///< force test too.
-};
-
-/**
- * Used to combine a StringID with the command.
- *
- * This macro can be used to add a StringID (the error message to show) on a command-id
- * (CMD_xxx). Use the binary or-operator "|" to combine the command with the result from
- * this macro.
- *
- * @param x The StringID to combine with a command-id
- */
-#define CMD_MSG(x) ((x) << 16)
-
-/**
- * Defines some flags.
- *
- * This enumeration defines some flags which are binary-or'ed on a command.
- */
-enum {
-	CMD_NO_WATER              = 0x0400, ///< dont build on water
-	CMD_NETWORK_COMMAND       = 0x0800, ///< execute the command without sending it on the network
-	CMD_NO_TEST_IF_IN_NETWORK = 0x1000, ///< When enabled, the command will bypass the no-DC_EXEC round if in network
-	CMD_SHOW_NO_ERROR         = 0x2000, ///< do not show the error message
-};
-
-/**
- * Command flags for the command table _command_proc_table.
- *
- * This enumeration defines flags for the _command_proc_table.
- */
-enum {
-	CMD_SERVER  = 0x1, ///< the command can only be initiated by the server
-	CMD_OFFLINE = 0x2, ///< the command cannot be executed in a multiplayer game; single-player only
-	CMD_AUTO    = 0x4, ///< set the DC_AUTO flag on this command
-};
-
-/**
- * Defines the callback type for all command handler functions.
- *
- * This type defines the function header for all functions which handles a CMD_* command.
- * A command handler use the parameters to act according to the meaning of the command.
- * The tile parameter defines the tile to perform an action on.
- * The flag parameter is filled with flags from the DC_* enumeration. The parameters
- * p1 and p2 are filled with parameters for the command like "which road type", "which
- * order" or "direction". Each function should mentioned in there doxygen comments
- * the usage of these parameters.
- *
- * @param tile The tile to apply a command on
- * @param flags Flags for the command, from the DC_* enumeration
- * @param p1 Additional data for the command
- * @param p2 Additional data for the command
- * @return The CommandCost of the command, which can be succeeded or failed.
- */
-typedef CommandCost CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2);
-
-/**
- * Define a command with the flags which belongs to it.
- *
- * This struct connect a command handler function with the flags created with
- * the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values.
- */
-struct Command {
-	CommandProc *proc;
-	byte flags;
-};
-
-/**
- * Checks if a command failes.
- *
- * As you see the parameter is not a command but the return value of a command,
- * the CommandCost class. This function checks if the command executed by
- * the CommandProc function failed and returns true if it does.
- *
- * @param cost The return value of a CommandProc call
- * @return true if the command failes
- * @see CmdSucceded
- */
-static inline bool CmdFailed(CommandCost cost) { return cost.Failed(); }
-
-/**
- * Checks if a command succeeded.
- *
- * As #CmdFailed this function checks if a command succeeded
- *
- * @param cost The return value of a CommandProc call
- * @return true if the command succeeded
- * @see CmdSucceeded
- */
-static inline bool CmdSucceeded(CommandCost cost) { return cost.Succeeded(); }
-
-/**
- * Define a default return value for a failed command.
- *
- * This variable contains a CommandCost object with is declared as "failed".
- * Other functions just need to return this error if there is an error,
- * which doesn't need to specific by a StringID.
- */
-static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID);
-
-/**
- * Returns from a function with a specific StringID as error.
- *
- * This macro is used to return from a function. The parameter contains the
- * StringID which will be returned.
- *
- * @param errcode The StringID to return
- */
-#define return_cmd_error(errcode) return CommandCost(errcode);
-
-/* command.cpp */
-/**
- * Define a callback function for the client, after the command is finished.
- *
- * Functions of this type are called after the command is finished. The parameters
- * are from the #CommandProc callback type. The boolean parameter indicates if the
- * command succeeded or failed.
- *
- * @param success If the command succeeded or not.
- * @param tile The tile of the command action
- * @param p1 Additional data of the command
- * @param p1 Additional data of the command
- * @see CommandProc
- */
-typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2);
-
-/**
- * Execute a command
- */
-CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
-
-/**
- * Execute a network safe DoCommand function
- */
-bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd, bool my_cmd = true);
-
-#ifdef ENABLE_NETWORK
-
-/**
- * Send a command over the network
- */
-void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback);
-#endif /* ENABLE_NETWORK */
-
-/**
- * Text, which gets sent with a command
- *
- * This variable contains a string (be specific a pointer of the first
- * char of this string) which will be send with a command. This is
- * used for user input data like names or chat messages.
- */
-extern const char *_cmd_text;
-
-/**
- * Checks if a integer value belongs to a command.
- */
-bool IsValidCommand(uint cmd);
-/**
- * Returns the flags from a given command.
- */
-byte GetCommandFlags(uint cmd);
-/**
- * Returns the current money available which can be used for a command.
- */
-Money GetAvailableMoneyForCommand();
-
-#endif /* COMMAND_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/command_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,95 @@
+/* $Id$ */
+
+/** @file command_func.h Functions related to commands. */
+
+#ifndef COMMAND_FUNC_H
+#define COMMAND_FUNC_H
+
+#include "command_type.h"
+
+/**
+ * Checks if a command failes.
+ *
+ * As you see the parameter is not a command but the return value of a command,
+ * the CommandCost class. This function checks if the command executed by
+ * the CommandProc function failed and returns true if it does.
+ *
+ * @param cost The return value of a CommandProc call
+ * @return true if the command failes
+ * @see CmdSucceded
+ */
+static inline bool CmdFailed(CommandCost cost) { return cost.Failed(); }
+
+/**
+ * Checks if a command succeeded.
+ *
+ * As #CmdFailed this function checks if a command succeeded
+ *
+ * @param cost The return value of a CommandProc call
+ * @return true if the command succeeded
+ * @see CmdSucceeded
+ */
+static inline bool CmdSucceeded(CommandCost cost) { return cost.Succeeded(); }
+
+/**
+ * Define a default return value for a failed command.
+ *
+ * This variable contains a CommandCost object with is declared as "failed".
+ * Other functions just need to return this error if there is an error,
+ * which doesn't need to specific by a StringID.
+ */
+static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID);
+
+/**
+ * Returns from a function with a specific StringID as error.
+ *
+ * This macro is used to return from a function. The parameter contains the
+ * StringID which will be returned.
+ *
+ * @param errcode The StringID to return
+ */
+#define return_cmd_error(errcode) return CommandCost(errcode);
+
+/**
+ * Execute a command
+ */
+CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 procc);
+
+/**
+ * Execute a network safe DoCommand function
+ */
+bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd, bool my_cmd = true);
+
+#ifdef ENABLE_NETWORK
+
+/**
+ * Send a command over the network
+ */
+void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback);
+#endif /* ENABLE_NETWORK */
+
+/**
+ * Text, which gets sent with a command
+ *
+ * This variable contains a string (be specific a pointer of the first
+ * char of this string) which will be send with a command. This is
+ * used for user input data like names or chat messages.
+ */
+extern const char *_cmd_text;
+extern Money _additional_cash_required;
+extern StringID _error_message;
+
+/**
+ * Checks if a integer value belongs to a command.
+ */
+bool IsValidCommand(uint32 cmd);
+/**
+ * Returns the flags from a given command.
+ */
+byte GetCommandFlags(uint32 cmd);
+/**
+ * Returns the current money available which can be used for a command.
+ */
+Money GetAvailableMoneyForCommand();
+
+#endif /* COMMAND_FUNC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/command_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,356 @@
+/* $Id$ */
+
+/** @file command_type.h Types related to commands. */
+
+#ifndef COMMAND_TYPE_H
+#define COMMAND_TYPE_H
+
+#include "economy_type.h"
+#include "strings_type.h"
+#include "tile_type.h"
+
+/**
+ * Common return value for all commands. Wraps the cost and
+ * a possible error message/state together.
+ */
+class CommandCost {
+	ExpensesType expense_type; ///< the type of expence as shown on the finances view
+	Money cost;       ///< The cost of this action
+	StringID message; ///< Warning message for when success is unset
+	bool success;     ///< Whether the comment went fine up to this moment
+
+public:
+	/**
+	 * Creates a command cost return with no cost and no error
+	 */
+	CommandCost() : expense_type(INVALID_EXPENSES), cost(0), message(INVALID_STRING_ID), success(true) {}
+
+	/**
+	 * Creates a command return value the is failed with the given message
+	 */
+	CommandCost(StringID msg) : expense_type(INVALID_EXPENSES), cost(0), message(msg), success(false) {}
+
+	/**
+	 * Creates a command cost with given expense type and start cost of 0
+	 * @param ex_t the expense type
+	 */
+	CommandCost(ExpensesType ex_t) : expense_type(ex_t), cost(0), message(INVALID_STRING_ID), success(true) {}
+
+	/**
+	 * Creates a command return value with the given start cost and expense type
+	 * @param ex_t the expense type
+	 * @param cst the initial cost of this command
+	 */
+	CommandCost(ExpensesType ex_t, Money cst) : expense_type(ex_t), cost(cst), message(INVALID_STRING_ID), success(true) {}
+
+	/**
+	 * Adds the cost of the given command return value to this cost.
+	 * Also takes a possible error message when it is set.
+	 * @param ret the command to add the cost of.
+	 * @return this class.
+	 */
+	CommandCost AddCost(CommandCost ret);
+
+	/**
+	 * Adds the given cost to the cost of the command.
+	 * @param cost the cost to add
+	 * @return this class.
+	 */
+	CommandCost AddCost(Money cost);
+
+	/**
+	 * Multiplies the cost of the command by the given factor.
+	 * @param cost factor to multiply the costs with
+	 * @return this class
+	 */
+	CommandCost MultiplyCost(int factor);
+
+	/**
+	 * The costs as made up to this moment
+	 * @return the costs
+	 */
+	Money GetCost() const;
+
+	/**
+	 * The expense type of the cost
+	 * @return the expense type
+	 */
+	ExpensesType GetExpensesType() const;
+
+	/**
+	 * Sets the global error message *if* this class has one.
+	 */
+	void SetGlobalErrorMessage() const;
+
+	/**
+	 * Did this command succeed?
+	 * @return true if and only if it succeeded
+	 */
+	bool Succeeded() const;
+
+	/**
+	 * Did this command fail?
+	 * @return true if and only if it failed
+	 */
+	bool Failed() const;
+};
+
+/**
+ * List of commands.
+ *
+ * This enum defines all possible commands which can be executed to the game
+ * engine. Observing the game like the query-tool or checking the profit of a
+ * vehicle don't result in a command which should be executed in the engine
+ * nor send to the server in a network game.
+ *
+ * @see _command_proc_table
+ */
+enum {
+	CMD_BUILD_RAILROAD_TRACK         =   0, ///< build a rail track
+	CMD_REMOVE_RAILROAD_TRACK        =   1, ///< remove a rail track
+	CMD_BUILD_SINGLE_RAIL            =   2, ///< build a single rail track
+	CMD_REMOVE_SINGLE_RAIL           =   3, ///< remove a single rail track
+	CMD_LANDSCAPE_CLEAR              =   4, ///< demolish a tile
+	CMD_BUILD_BRIDGE                 =   5, ///< build a bridge
+	CMD_BUILD_RAILROAD_STATION       =   6, ///< build a railroad station
+	CMD_BUILD_TRAIN_DEPOT            =   7, ///< build a train depot
+	CMD_BUILD_SIGNALS                =   8, ///< build a signal
+	CMD_REMOVE_SIGNALS               =   9, ///< remove a signal
+	CMD_TERRAFORM_LAND               =  10, ///< terraform a tile
+	CMD_PURCHASE_LAND_AREA           =  11, ///< purchase a tile
+	CMD_SELL_LAND_AREA               =  12, ///< sell a bought tile before
+	CMD_BUILD_TUNNEL                 =  13, ///< build a tunnel
+
+	CMD_REMOVE_FROM_RAILROAD_STATION =  14, ///< remove a tile station
+	CMD_CONVERT_RAIL                 =  15, ///< convert a rail type
+
+	CMD_BUILD_TRAIN_WAYPOINT         =  16, ///< build a waypoint
+	CMD_RENAME_WAYPOINT              =  17, ///< rename a waypoint
+	CMD_REMOVE_TRAIN_WAYPOINT        =  18, ///< remove a waypoint
+
+	CMD_BUILD_ROAD_STOP              =  21, ///< build a road stop
+	CMD_REMOVE_ROAD_STOP             =  22, ///< remove a road stop
+	CMD_BUILD_LONG_ROAD              =  23, ///< build a complete road (not a "half" one)
+	CMD_REMOVE_LONG_ROAD             =  24, ///< remove a complete road (not a "half" one)
+	CMD_BUILD_ROAD                   =  25, ///< build a "half" road
+	CMD_REMOVE_ROAD                  =  26, ///< remove a "half" road
+	CMD_BUILD_ROAD_DEPOT             =  27, ///< build a road depot
+
+	CMD_BUILD_AIRPORT                =  29, ///< build an airport
+
+	CMD_BUILD_DOCK                   =  30, ///< build a dock
+
+	CMD_BUILD_SHIP_DEPOT             =  31, ///< build a ship depot
+	CMD_BUILD_BUOY                   =  32, ///< build a buoy
+
+	CMD_PLANT_TREE                   =  33, ///< plant a tree
+
+	CMD_BUILD_RAIL_VEHICLE           =  34, ///< build a rail vehicle
+	CMD_MOVE_RAIL_VEHICLE            =  35, ///< move a rail vehicle (in the depot)
+
+	CMD_START_STOP_TRAIN             =  36, ///< start or stop a train
+
+	CMD_SELL_RAIL_WAGON              =  38, ///< sell a rail wagon
+
+	CMD_SEND_TRAIN_TO_DEPOT          =  39, ///< send a train to a depot
+	CMD_FORCE_TRAIN_PROCEED          =  40, ///< proceed a train to pass a red signal
+	CMD_REVERSE_TRAIN_DIRECTION      =  41, ///< turn a train around
+
+	CMD_MODIFY_ORDER                 =  42, ///< modify an order (like set full-load)
+	CMD_SKIP_TO_ORDER                =  43, ///< skip an order to the next of specific one
+	CMD_DELETE_ORDER                 =  44, ///< delete an order
+	CMD_INSERT_ORDER                 =  45, ///< insert a new order
+
+	CMD_CHANGE_SERVICE_INT           =  46, ///< change the server interval of a vehicle
+
+	CMD_BUILD_INDUSTRY               =  47, ///< build a new industry
+
+	CMD_BUILD_COMPANY_HQ             =  48, ///< build the company headquarter
+	CMD_SET_PLAYER_FACE              =  49, ///< set the face of the player/company
+	CMD_SET_PLAYER_COLOR             =  50, ///< set the color of the player/company
+
+	CMD_INCREASE_LOAN                =  51, ///< increase the loan from the bank
+	CMD_DECREASE_LOAN                =  52, ///< decrease the loan from the bank
+
+	CMD_WANT_ENGINE_PREVIEW          =  53, ///< confirm the preview of an engine
+
+	CMD_NAME_VEHICLE                 =  54, ///< rename a whole vehicle
+	CMD_RENAME_ENGINE                =  55, ///< rename a engine (in the engine list)
+	CMD_CHANGE_COMPANY_NAME          =  56, ///< change the company name
+	CMD_CHANGE_PRESIDENT_NAME        =  57, ///< change the president name
+	CMD_RENAME_STATION               =  58, ///< rename a station
+
+	CMD_SELL_AIRCRAFT                =  59, ///< sell an aircraft
+	CMD_START_STOP_AIRCRAFT          =  60, ///< start/stop an aircraft
+	CMD_BUILD_AIRCRAFT               =  61, ///< build an aircraft
+	CMD_SEND_AIRCRAFT_TO_HANGAR      =  62, ///< send an aircraft to a hanger
+	CMD_REFIT_AIRCRAFT               =  64, ///< refit the cargo space of an aircraft
+
+	CMD_PLACE_SIGN                   =  65, ///< place a sign
+	CMD_RENAME_SIGN                  =  66, ///< rename a sign
+
+	CMD_BUILD_ROAD_VEH               =  67, ///< build a road vehicle
+	CMD_START_STOP_ROADVEH           =  68, ///< start/stop a road vehicle
+	CMD_SELL_ROAD_VEH                =  69, ///< sell a road vehicle
+	CMD_SEND_ROADVEH_TO_DEPOT        =  70, ///< send a road vehicle to the depot
+	CMD_TURN_ROADVEH                 =  71, ///< turn a road vehicle around
+	CMD_REFIT_ROAD_VEH               =  72, ///< refit the cargo space of a road vehicle
+
+	CMD_PAUSE                        =  73, ///< pause the game
+
+	CMD_BUY_SHARE_IN_COMPANY         =  74, ///< buy a share from a company
+	CMD_SELL_SHARE_IN_COMPANY        =  75, ///< sell a share from a company
+	CMD_BUY_COMPANY                  =  76, ///< buy a company which is bankrupt
+
+	CMD_BUILD_TOWN                   =  77, ///< build a town
+
+	CMD_RENAME_TOWN                  =  80, ///< rename a town
+	CMD_DO_TOWN_ACTION               =  81, ///< do a action from the town detail window (like advertises or bribe)
+
+	CMD_SET_ROAD_DRIVE_SIDE          =  82, ///< set the side where the road vehicles drive
+
+	CMD_CHANGE_DIFFICULTY_LEVEL      =  85, ///< change the difficult of a game (each setting for it own)
+
+	CMD_START_STOP_SHIP              =  86, ///< start/stop a ship
+	CMD_SELL_SHIP                    =  87, ///< sell a ship
+	CMD_BUILD_SHIP                   =  88, ///< build a new ship
+	CMD_SEND_SHIP_TO_DEPOT           =  89, ///< send a ship to a depot
+	CMD_REFIT_SHIP                   =  91, ///< refit the cargo space of a ship
+
+	CMD_ORDER_REFIT                  =  98, ///< change the refit informaction of an order (for "goto depot" )
+	CMD_CLONE_ORDER                  =  99, ///< clone (and share) an order
+	CMD_CLEAR_AREA                   = 100, ///< clear an area
+
+	CMD_MONEY_CHEAT                  = 102, ///< do the money cheat
+	CMD_BUILD_CANAL                  = 103, ///< build a canal
+
+	CMD_PLAYER_CTRL                  = 104, ///< used in multiplayer to create a new player etc.
+	CMD_LEVEL_LAND                   = 105, ///< level land
+
+	CMD_REFIT_RAIL_VEHICLE           = 106, ///< refit the cargo space of a train
+	CMD_RESTORE_ORDER_INDEX          = 107, ///< restore vehicle order-index and service interval
+	CMD_BUILD_LOCK                   = 108, ///< build a lock
+
+	CMD_BUILD_SIGNAL_TRACK           = 110, ///< add signals along a track (by dragging)
+	CMD_REMOVE_SIGNAL_TRACK          = 111, ///< remove signals along a track (by dragging)
+
+	CMD_GIVE_MONEY                   = 113, ///< give money to an other player
+	CMD_CHANGE_PATCH_SETTING         = 114, ///< change a patch setting
+
+	CMD_SET_AUTOREPLACE              = 115, ///< set an autoreplace entry
+
+	CMD_CLONE_VEHICLE                = 116, ///< clone a vehicle
+	CMD_MASS_START_STOP              = 117, ///< start/stop all vehicles (in a depot)
+	CMD_DEPOT_SELL_ALL_VEHICLES      = 118, ///< sell all vehicles which are in a given depot
+	CMD_DEPOT_MASS_AUTOREPLACE       = 119, ///< force the autoreplace to take action in a given depot
+
+	CMD_CREATE_GROUP                 = 120, ///< create a new group
+	CMD_DELETE_GROUP                 = 121, ///< delete a group
+	CMD_RENAME_GROUP                 = 122, ///< rename a group
+	CMD_ADD_VEHICLE_GROUP            = 123, ///< add a vehicle to a group
+	CMD_ADD_SHARED_VEHICLE_GROUP     = 124, ///< add all other shared vehicles to a group which are missing
+	CMD_REMOVE_ALL_VEHICLES_GROUP    = 125, ///< remove all vehicles from a group
+	CMD_SET_GROUP_REPLACE_PROTECTION = 126, ///< set the autoreplace-protection for a group
+
+	CMD_MOVE_ORDER                   = 127, ///< move an order
+	CMD_CHANGE_TIMETABLE             = 128, ///< change the timetable for a vehicle
+	CMD_SET_VEHICLE_ON_TIME          = 129, ///< set the vehicle on time feature (timetable)
+	CMD_AUTOFILL_TIMETABLE           = 130, ///< autofill the timetable
+};
+
+/**
+ * List of flags for a command.
+ *
+ * This enums defines some flags which can be used for the commands.
+ */
+enum {
+	DC_EXEC            = 0x01, ///< execute the given command
+	DC_AUTO            = 0x02, ///< don't allow building on structures
+	DC_QUERY_COST      = 0x04, ///< query cost only,  don't build.
+	DC_NO_WATER        = 0x08, ///< don't allow building on water
+	DC_NO_RAIL_OVERLAP = 0x10, ///< don't allow overlap of rails (used in buildrail)
+	DC_AI_BUILDING     = 0x20, ///< special building rules for AI
+	DC_NO_TOWN_RATING  = 0x40, ///< town rating does not disallow you from building
+	DC_FORCETEST       = 0x80, ///< force test too.
+};
+
+/**
+ * Used to combine a StringID with the command.
+ *
+ * This macro can be used to add a StringID (the error message to show) on a command-id
+ * (CMD_xxx). Use the binary or-operator "|" to combine the command with the result from
+ * this macro.
+ *
+ * @param x The StringID to combine with a command-id
+ */
+#define CMD_MSG(x) ((x) << 16)
+
+/**
+ * Defines some flags.
+ *
+ * This enumeration defines some flags which are binary-or'ed on a command.
+ */
+enum {
+	CMD_NO_WATER              = 0x0400, ///< dont build on water
+	CMD_NETWORK_COMMAND       = 0x0800, ///< execute the command without sending it on the network
+	CMD_NO_TEST_IF_IN_NETWORK = 0x1000, ///< When enabled, the command will bypass the no-DC_EXEC round if in network
+	CMD_SHOW_NO_ERROR         = 0x2000, ///< do not show the error message
+};
+
+/**
+ * Command flags for the command table _command_proc_table.
+ *
+ * This enumeration defines flags for the _command_proc_table.
+ */
+enum {
+	CMD_SERVER  = 0x1, ///< the command can only be initiated by the server
+	CMD_OFFLINE = 0x2, ///< the command cannot be executed in a multiplayer game; single-player only
+	CMD_AUTO    = 0x4, ///< set the DC_AUTO flag on this command
+};
+
+/**
+ * Defines the callback type for all command handler functions.
+ *
+ * This type defines the function header for all functions which handles a CMD_* command.
+ * A command handler use the parameters to act according to the meaning of the command.
+ * The tile parameter defines the tile to perform an action on.
+ * The flag parameter is filled with flags from the DC_* enumeration. The parameters
+ * p1 and p2 are filled with parameters for the command like "which road type", "which
+ * order" or "direction". Each function should mentioned in there doxygen comments
+ * the usage of these parameters.
+ *
+ * @param tile The tile to apply a command on
+ * @param flags Flags for the command, from the DC_* enumeration
+ * @param p1 Additional data for the command
+ * @param p2 Additional data for the command
+ * @return The CommandCost of the command, which can be succeeded or failed.
+ */
+typedef CommandCost CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2);
+
+/**
+ * Define a command with the flags which belongs to it.
+ *
+ * This struct connect a command handler function with the flags created with
+ * the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values.
+ */
+struct Command {
+	CommandProc *proc;
+	byte flags;
+};
+
+/**
+ * Define a callback function for the client, after the command is finished.
+ *
+ * Functions of this type are called after the command is finished. The parameters
+ * are from the #CommandProc callback type. The boolean parameter indicates if the
+ * command succeeded or failed.
+ *
+ * @param success If the command succeeded or not.
+ * @param tile The tile of the command action
+ * @param p1 Additional data of the command
+ * @param p1 Additional data of the command
+ * @see CommandProc
+ */
+typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2);
+
+#endif /* COMMAND_TYPE_H */
--- a/src/console.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/console.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,21 +4,22 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/strings.h"
-#include "functions.h"
-#include "window.h"
 #include "gui.h"
-#include "gfx.h"
-#include "player.h"
+#include "textbuf_gui.h"
+#include "window_gui.h"
 #include "variables.h"
-#include "string.h"
 #include <stdarg.h>
 #include <string.h>
 #include "console.h"
-#include "helpers.hpp"
 #include "network/network.h"
 #include "network/network_data.h"
 #include "network/network_server.h"
+#include "core/alloc_func.hpp"
+#include "window_func.h"
+#include "string_func.h"
+#include "gfx_func.h"
+
+#include "table/strings.h"
 
 #define ICON_BUFFER 79
 #define ICON_HISTORY_SIZE 20
@@ -28,6 +29,19 @@
 #define ICON_MAX_ALIAS_LINES 40
 #define ICON_TOKEN_COUNT 20
 
+/* console parser */
+IConsoleCmd   *_iconsole_cmds;    ///< list of registred commands
+IConsoleVar   *_iconsole_vars;    ///< list of registred vars
+IConsoleAlias *_iconsole_aliases; ///< list of registred aliases
+
+/* console colors/modes */
+byte _icolour_def;
+byte _icolour_err;
+byte _icolour_warn;
+byte _icolour_dbg;
+byte _icolour_cmd;
+IConsoleModes _iconsole_mode;
+
 /* ** main console ** */
 static char *_iconsole_buffer[ICON_BUFFER + 1];
 static uint16 _iconsole_cbuffer[ICON_BUFFER + 1];
--- a/src/console.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/console.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,8 @@
 #ifndef CONSOLE_H
 #define CONSOLE_H
 
+#include "window_type.h"
+
 /* maximum length of a typed in command */
 #define ICON_CMDLN_SIZE 255
 /* maximum length of a totally expanded command */
@@ -101,17 +103,17 @@
 };
 
 /* console parser */
-VARDEF IConsoleCmd   *_iconsole_cmds;    ///< list of registred commands
-VARDEF IConsoleVar   *_iconsole_vars;    ///< list of registred vars
-VARDEF IConsoleAlias *_iconsole_aliases; ///< list of registred aliases
+extern IConsoleCmd   *_iconsole_cmds;    ///< list of registred commands
+extern IConsoleVar   *_iconsole_vars;    ///< list of registred vars
+extern IConsoleAlias *_iconsole_aliases; ///< list of registred aliases
 
 /* console colors/modes */
-VARDEF byte _icolour_def;
-VARDEF byte _icolour_err;
-VARDEF byte _icolour_warn;
-VARDEF byte _icolour_dbg;
-VARDEF byte _icolour_cmd;
-VARDEF IConsoleModes _iconsole_mode;
+extern byte _icolour_def;
+extern byte _icolour_err;
+extern byte _icolour_warn;
+extern byte _icolour_dbg;
+extern byte _icolour_cmd;
+extern IConsoleModes _iconsole_mode;
 
 /* console functions */
 void IConsoleInit();
--- a/src/console_cmds.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/console_cmds.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -7,26 +7,36 @@
 #include "console.h"
 #include "debug.h"
 #include "engine.h"
-#include "functions.h"
 #include "landscape.h"
 #include "saveload.h"
-#include "string.h"
 #include "variables.h"
 #include "network/network_data.h"
 #include "network/network_client.h"
 #include "network/network_server.h"
 #include "network/network_udp.h"
-#include "command.h"
-#include "settings.h"
+#include "command_func.h"
+#include "settings_func.h"
 #include "fios.h"
 #include "fileio.h"
-#include "vehicle.h"
 #include "station.h"
-#include "strings.h"
 #include "screenshot.h"
 #include "genworld.h"
-#include "date.h"
 #include "network/network.h"
+#include "strings_func.h"
+#include "viewport_func.h"
+#include "window_func.h"
+#include "functions.h"
+#include "map_func.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "string_func.h"
+#include "player_func.h"
+#include "player_base.h"
+#include "settings_type.h"
+
+#ifdef ENABLE_NETWORK
+	#include "table/strings.h"
+#endif /* ENABLE_NETWORK */
 
 // ** scriptfile handling ** //
 static FILE *_script_file;
@@ -134,19 +144,12 @@
 
 DEF_CONSOLE_CMD(ConStopAllVehicles)
 {
-	Vehicle* v;
 	if (argc == 0) {
 		IConsoleHelp("Stops all vehicles in the game. For debugging only! Use at your own risk... Usage: 'stopall'");
 		return true;
 	}
 
-	FOR_ALL_VEHICLES(v) {
-		/* Code ripped from CmdStartStopTrain. Can't call it, because of
-		 * ownership problems, so we'll duplicate some code, for now */
-		v->vehstatus |= VS_STOPPED;
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
-		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
-	}
+	StopAllVehicles();
 	return true;
 }
 #endif /* _DEBUG */
@@ -1226,10 +1229,6 @@
 	return true;
 }
 
-#ifdef ENABLE_NETWORK
-	#include "table/strings.h"
-#endif /* ENABLE_NETWORK */
-
 DEF_CONSOLE_CMD(ConPlayers)
 {
 	Player *p;
@@ -1654,6 +1653,8 @@
 	IConsoleVarRegister("min_players",           &_network_min_players, ICONSOLE_VAR_BYTE, "Automatically pause the game when the number of active players passes below the given amount");
 	IConsoleVarHookAdd("min_players",            ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
 	IConsoleVarHookAdd("min_players",            ICONSOLE_HOOK_POST_ACTION, ConHookCheckMinPlayers);
+	IConsoleVarRegister("reload_cfg",            &_network_reload_cfg, ICONSOLE_VAR_BOOLEAN, "reload the entire config file between the end of this game, and starting the next new game - dedicated servers");
+	IConsoleVarHookAdd("reload_cfg",             ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
 
 #endif /* ENABLE_NETWORK */
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/alloc_func.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,115 @@
+/* $Id$ */
+
+/** @file alloc_func.hpp Functions related to the allocation of memory */
+
+#ifndef ALLOC_FUNC_HPP
+#define ALLOC_FUNC_HPP
+
+/**
+ * Simplified allocation function that allocates the specified number of
+ * elements of the given type. It also explicitly casts it to the requested
+ * type.
+ * @note throws an error when there is no memory anymore.
+ * @note the memory contains garbage data (i.e. possibly non-zero values).
+ * @param T the type of the variable(s) to allocation.
+ * @param num_elements the number of elements to allocate of the given type.
+ * @return NULL when num_elements == 0, non-NULL otherwise.
+ */
+template <typename T> FORCEINLINE T* MallocT(size_t num_elements)
+{
+	/*
+	 * MorphOS cannot handle 0 elements allocations, or rather that always
+	 * returns NULL. So we do that for *all* allocations, thus causing it
+	 * to behave the same on all OSes.
+	 */
+	if (num_elements == 0) return NULL;
+
+	T *t_ptr = (T*)malloc(num_elements * sizeof(T));
+	if (t_ptr == NULL) error("Out of memory. Cannot allocate %i bytes", num_elements * sizeof(T));
+	return t_ptr;
+}
+
+/**
+ * Simplified allocation function that allocates the specified number of
+ * elements of the given type. It also explicitly casts it to the requested
+ * type.
+ * @note throws an error when there is no memory anymore.
+ * @note the memory contains all zero values.
+ * @param T the type of the variable(s) to allocation.
+ * @param num_elements the number of elements to allocate of the given type.
+ * @return NULL when num_elements == 0, non-NULL otherwise.
+ */
+template <typename T> FORCEINLINE T* CallocT(size_t num_elements)
+{
+	/*
+	 * MorphOS cannot handle 0 elements allocations, or rather that always
+	 * returns NULL. So we do that for *all* allocations, thus causing it
+	 * to behave the same on all OSes.
+	 */
+	if (num_elements == 0) return NULL;
+
+	T *t_ptr = (T*)calloc(num_elements, sizeof(T));
+	if (t_ptr == NULL) error("Out of memory. Cannot allocate %i bytes", num_elements * sizeof(T));
+	return t_ptr;
+}
+
+/**
+ * Simplified reallocation function that allocates the specified number of
+ * elements of the given type. It also explicitly casts it to the requested
+ * type. It extends/shrinks the memory allocation given in t_ptr.
+ * @note throws an error when there is no memory anymore.
+ * @note the memory contains all zero values.
+ * @param T the type of the variable(s) to allocation.
+ * @param t_ptr the previous allocation to extend/shrink.
+ * @param num_elements the number of elements to allocate of the given type.
+ * @return NULL when num_elements == 0, non-NULL otherwise.
+ */
+template <typename T> FORCEINLINE T* ReallocT(T *t_ptr, size_t num_elements)
+{
+	/*
+	 * MorphOS cannot handle 0 elements allocations, or rather that always
+	 * returns NULL. So we do that for *all* allocations, thus causing it
+	 * to behave the same on all OSes.
+	 */
+	if (num_elements == 0) {
+		free(t_ptr);
+		return NULL;
+	}
+
+	t_ptr = (T*)realloc(t_ptr, num_elements * sizeof(T));
+	if (t_ptr == NULL) error("Out of memory. Cannot reallocate %i bytes", num_elements * sizeof(T));
+	return t_ptr;
+}
+
+/**
+ * A small 'wrapper' for allocations that can be done on most OSes on the
+ * stack, but are just too large to fit in the stack on devices with a small
+ * stack such as the NDS.
+ * So when it is possible a stack allocation is made, otherwise a heap
+ * allocation is made and this is freed once the struct goes out of scope.
+ * @param T      the type to make the allocation for
+ * @param length the amount of items to allocate
+ */
+template <typename T, size_t length>
+struct SmallStackSafeStackAlloc {
+#if !defined(__NDS__)
+	/** Storing the data on the stack */
+	T data[length];
+#else
+	/** Storing it on the heap */
+	T *data;
+
+	/** Allocating the memory */
+	SmallStackSafeStackAlloc() : data(MallocT<T>(length)) {}
+	/** And freeing when it goes out of scope */
+	~SmallStackSafeStackAlloc() { free(data); }
+#endif
+
+	/**
+	 * Gets a pointer to the data stored in this wrapper.
+	 * @return the pointer.
+	 */
+	operator T* () { return data; }
+};
+
+#endif /* ALLOC_FUNC_HPP */
--- a/src/core/bitmath_func.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/core/bitmath_func.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -45,7 +45,7 @@
 }
 
 /**
- * Search the last set bit in a 32 bit variable.
+ * Search the last set bit in a 64 bit variable.
  *
  * This algorithm is a static implementation of a log
  * conguence search algorithm. It checks the second half
@@ -55,17 +55,18 @@
  * @param x The value to search
  * @return The position of the last bit set
  */
-uint8 FindLastBit(uint32 x)
+uint8 FindLastBit(uint64 x)
 {
 	if (x == 0) return 0;
 
 	uint8 pos = 0;
 
-	if ((x & 0xffff0000) != 0) { x >>= 16; pos += 16; }
-	if ((x & 0x0000ff00) != 0) { x >>= 8;  pos += 8;  }
-	if ((x & 0x000000f0) != 0) { x >>= 4;  pos += 4;  }
-	if ((x & 0x0000000c) != 0) { x >>= 2;  pos += 2;  }
-	if ((x & 0x00000002) != 0) { pos += 1; }
+	if ((x & 0xffffffff00000000ULL) != 0) { x >>= 32; pos += 32; }
+	if ((x & 0x00000000ffff0000ULL) != 0) { x >>= 16; pos += 16; }
+	if ((x & 0x000000000000ff00ULL) != 0) { x >>= 8;  pos += 8;  }
+	if ((x & 0x00000000000000f0ULL) != 0) { x >>= 4;  pos += 4;  }
+	if ((x & 0x000000000000000cULL) != 0) { x >>= 2;  pos += 2;  }
+	if ((x & 0x0000000000000002ULL) != 0) { pos += 1; }
 
 	return pos;
 }
--- a/src/core/bitmath_func.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/core/bitmath_func.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -211,7 +211,7 @@
 }
 
 uint8 FindFirstBit(uint32 x);
-uint8 FindLastBit(uint32 x);
+uint8 FindLastBit(uint64 x);
 
 /**
  * Clear the first bit in an integer.
@@ -276,4 +276,49 @@
 	return (T)(x >> n | x << (sizeof(x) * 8 - n));
 }
 
+/**
+ * Do an operation for each set set bit in a value.
+ *
+ * This macros is used to do an operation for each set
+ * bit in a variable. The first variable can be reused
+ * in the operation due to it's the bit position counter.
+ * The second variable will be cleared during the usage
+ *
+ * @param i The position counter
+ * @param b The value which we check for set bits
+ */
+#define FOR_EACH_SET_BIT(i, b)      \
+	for (i = 0; b != 0; i++, b >>= 1) \
+		if (b & 1)
+
+
+#if defined(__APPLE__)
+	/* Make endian swapping use Apple's macros to increase speed
+	 * (since it will use hardware swapping if available).
+	 * Even though they should return uint16 and uint32, we get
+	 * warnings if we don't cast those (why?) */
+	#define BSWAP32(x) ((uint32)Endian32_Swap(x))
+	#define BSWAP16(x) ((uint16)Endian16_Swap(x))
+#else
+	/**
+	 * Perform a 32 bits endianness bitswap on x.
+	 * @param x the variable to bitswap
+	 * @return the bitswapped value.
+	 */
+	static inline uint32 BSWAP32(uint32 x)
+	{
+		return ((x >> 24) & 0xFF) | ((x >> 8) & 0xFF00) | ((x << 8) & 0xFF0000) | ((x << 24) & 0xFF000000);
+	}
+
+	/**
+	 * Perform a 16 bits endianness bitswap on x.
+	 * @param x the variable to bitswap
+	 * @return the bitswapped value.
+	 */
+	static inline uint16 BSWAP16(uint16 x)
+	{
+		return (x >> 8) | (x << 8);
+	}
+#endif /* __APPLE__ */
+
 #endif /* BITMATH_FUNC_HPP */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/endian_func.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,65 @@
+/* $Id$ */
+
+/** @file endian_func.hpp */
+
+#ifndef ENDIAN_FUNC_H
+#define ENDIAN_FUNC_H
+
+#include "bitmath_func.hpp"
+
+#if defined(ARM) || defined(__arm__) || defined(__alpha__)
+	#define OTTD_ALIGNMENT
+#endif
+
+/* Windows has always LITTLE_ENDIAN */
+#if defined(WIN32) || defined(__OS2__) || defined(WIN64)
+	#define TTD_LITTLE_ENDIAN
+#elif !defined(TESTING)
+	/* Else include endian[target/host].h, which has the endian-type, autodetected by the Makefile */
+	#if defined(STRGEN)
+		#include "endian_host.h"
+	#else
+		#include "endian_target.h"
+	#endif
+#endif /* WIN32 || __OS2__ || WIN64 */
+
+/* Setup alignment and conversion macros */
+#if defined(TTD_BIG_ENDIAN)
+	#define FROM_BE16(x) (x)
+	#define FROM_BE32(x) (x)
+	#define TO_BE16(x)   (x)
+	#define TO_BE32(x)   (x)
+	#define TO_BE32X(x)  (x)
+	#define FROM_LE16(x) BSWAP16(x)
+	#define FROM_LE32(x) BSWAP32(x)
+	#define TO_LE16(x)   BSWAP16(x)
+	#define TO_LE32(x)   BSWAP32(x)
+	#define TO_LE32X(x)  BSWAP32(x)
+#else
+	#define FROM_BE16(x) BSWAP16(x)
+	#define FROM_BE32(x) BSWAP32(x)
+	#define TO_BE16(x)   BSWAP16(x)
+	#define TO_BE32(x)   BSWAP32(x)
+	#define TO_BE32X(x)  BSWAP32(x)
+	#define FROM_LE16(x) (x)
+	#define FROM_LE32(x) (x)
+	#define TO_LE16(x)   (x)
+	#define TO_LE32(x)   (x)
+	#define TO_LE32X(x)  (x)
+#endif /* TTD_BIG_ENDIAN */
+
+static inline uint16 ReadLE16Aligned(const void *x)
+{
+	return FROM_LE16(*(const uint16*)x);
+}
+
+static inline uint16 ReadLE16Unaligned(const void *x)
+{
+#ifdef OTTD_ALIGNMENT
+	return ((const byte*)x)[0] | ((const byte*)x)[1] << 8;
+#else
+	return FROM_LE16(*(const uint16*)x);
+#endif
+}
+
+#endif /* ENDIAN_FUNC_HPP */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/enum_type.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,115 @@
+/* $Id$ */
+
+/** @file enum_type.hpp Type (helpers) for enums */
+
+#ifndef ENUM_TYPE_HPP
+#define ENUM_TYPE_HPP
+
+/** Some enums need to have allowed incrementing (i.e. StationClassID) */
+#define DECLARE_POSTFIX_INCREMENT(type) \
+	FORCEINLINE type operator ++(type& e, int) \
+	{ \
+		type e_org = e; \
+		e = (type)((int)e + 1); \
+		return e_org; \
+	} \
+	FORCEINLINE type operator --(type& e, int) \
+	{ \
+		type e_org = e; \
+		e = (type)((int)e - 1); \
+		return e_org; \
+	}
+
+
+
+/** Operators to allow to work with enum as with type safe bit set in C++ */
+# define DECLARE_ENUM_AS_BIT_SET(mask_t) \
+	FORCEINLINE mask_t operator | (mask_t m1, mask_t m2) {return (mask_t)((int)m1 | m2);} \
+	FORCEINLINE mask_t operator & (mask_t m1, mask_t m2) {return (mask_t)((int)m1 & m2);} \
+	FORCEINLINE mask_t operator ^ (mask_t m1, mask_t m2) {return (mask_t)((int)m1 ^ m2);} \
+	FORCEINLINE mask_t& operator |= (mask_t& m1, mask_t m2) {m1 = m1 | m2; return m1;} \
+	FORCEINLINE mask_t& operator &= (mask_t& m1, mask_t m2) {m1 = m1 & m2; return m1;} \
+	FORCEINLINE mask_t& operator ^= (mask_t& m1, mask_t m2) {m1 = m1 ^ m2; return m1;} \
+	FORCEINLINE mask_t operator ~(mask_t m) {return (mask_t)(~(int)m);}
+
+
+/** Informative template class exposing basic enumeration properties used by several
+ *  other templates below. Here we have only forward declaration. For each enum type
+ *  we will create specialization derived from MakeEnumPropsT<>.
+ *  i.e.:
+ *    template <> struct EnumPropsT<Track> : MakeEnumPropsT<Track, byte, TRACK_BEGIN, TRACK_END, INVALID_TRACK> {};
+ *  followed by:
+ *    typedef TinyEnumT<Track> TrackByte;
+ */
+template <typename Tenum_t> struct EnumPropsT;
+
+/** Helper template class that makes basic properties of given enumeration type visible
+ *  from outsize. It is used as base class of several EnumPropsT specializations each
+ *  dedicated to one of commonly used enumeration types.
+ *  @param Tenum_t enumeration type that you want to describe
+ *  @param Tstorage_t what storage type would be sufficient (i.e. byte)
+ *  @param Tbegin first valid value from the contiguous range (i.e. TRACK_BEGIN)
+ *  @param Tend one past the last valid value from the contiguous range (i.e. TRACK_END)
+ *  @param Tinvalid value used as invalid value marker (i.e. INVALID_TRACK)
+ */
+template <typename Tenum_t, typename Tstorage_t, Tenum_t Tbegin, Tenum_t Tend, Tenum_t Tinvalid>
+struct MakeEnumPropsT {
+	typedef Tenum_t type;                     ///< enum type (i.e. Trackdir)
+	typedef Tstorage_t storage;               ///< storage type (i.e. byte)
+	static const Tenum_t begin = Tbegin;      ///< lowest valid value (i.e. TRACKDIR_BEGIN)
+	static const Tenum_t end = Tend;          ///< one after the last valid value (i.e. TRACKDIR_END)
+	static const Tenum_t invalid = Tinvalid;  ///< what value is used as invalid value (i.e. INVALID_TRACKDIR)
+};
+
+
+
+/** In some cases we use byte or uint16 to store values that are defined as enum. It is
+	*  necessary in order to control the sizeof() such values. Some compilers make enum
+	*  the same size as int (4 or 8 bytes instead of 1 or 2). As a consequence the strict
+	*  compiler type-checking causes errors like:
+	*     'HasPowerOnRail' : cannot convert parameter 1 from 'byte' to 'RailType' when
+	*  u->u.rail.railtype is passed as argument or type RailType. In such cases it is better
+	*  to teach the compiler that u->u.rail.railtype is to be treated as RailType. */
+template <typename Tenum_t> struct TinyEnumT;
+
+/** The general declaration of TinyEnumT<> (above) */
+template <typename Tenum_t> struct TinyEnumT
+{
+	typedef Tenum_t enum_type;                      ///< expose our enumeration type (i.e. Trackdir) to outside
+	typedef EnumPropsT<Tenum_t> Props;              ///< make easier access to our enumeration propeties
+	typedef typename Props::storage storage_type;   ///< small storage type
+	static const enum_type begin = Props::begin;    ///< enum beginning (i.e. TRACKDIR_BEGIN)
+	static const enum_type end = Props::end;        ///< enum end (i.e. TRACKDIR_END)
+	static const enum_type invalid = Props::invalid;///< invalid value (i.e. INVALID_TRACKDIR)
+
+	storage_type m_val;  ///< here we hold the actual value in small (i.e. byte) form
+
+	/** Cast operator - invoked then the value is assigned to the Tenum_t type */
+	FORCEINLINE operator enum_type () const
+	{
+		return (enum_type)m_val;
+	}
+
+	/** Assignment operator (from Tenum_t type) */
+	FORCEINLINE TinyEnumT& operator = (enum_type e)
+	{
+		m_val = (storage_type)e; return *this;
+	}
+
+	/** postfix ++ operator on tiny type */
+	FORCEINLINE TinyEnumT operator ++ (int)
+	{
+		TinyEnumT org = *this;
+		if (++m_val >= end) m_val -= (storage_type)(end - begin);
+		return org;
+	}
+
+	/** prefix ++ operator on tiny type */
+	FORCEINLINE TinyEnumT& operator ++ ()
+	{
+		if (++m_val >= end) m_val -= (storage_type)(end - begin);
+		return *this;
+	}
+};
+
+#endif /* HELPERS_HPP */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/geometry_type.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,49 @@
+/* $Id$ */
+
+/** @file geometry_type.hpp All geometry types in OpenTTD. */
+
+#ifndef GEOMETRY_TYPE_HPP
+#define GEOMETRY_TYPE_HPP
+
+#if defined(__AMIGA__)
+	/* AmigaOS already has a Point declared */
+	#define Point OTTD_Point
+#endif /* __AMIGA__ */
+
+#if defined(__APPLE__)
+	/* Mac OS X already has both Rect and Point declared */
+	#define Rect OTTD_Rect
+	#define Point OTTD_Point
+#endif /* __APPLE__ */
+
+
+struct Point {
+	int x;
+	int y;
+};
+
+struct Dimension {
+	int width;
+	int height;
+};
+
+struct Rect {
+	int left;
+	int top;
+	int right;
+	int bottom;
+};
+
+struct PointDimension {
+	int x;
+	int y;
+	int width;
+	int height;
+};
+
+struct Pair {
+	int a;
+	int b;
+};
+
+#endif /* GEOMETRY_TYPE_HPP */
--- a/src/core/math_func.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/core/math_func.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -1,6 +1,6 @@
-/* $Id */
+/* $Id$ */
 
-/** @file math_func.hpp */
+/** @file math_func.hpp Integer math functions */
 
 #ifndef MATH_FUNC_HPP
 #define MATH_FUNC_HPP
@@ -211,4 +211,16 @@
 	return (uint)(x - min) < (max - min);
 }
 
+/**
+ * Type safe swap operation
+ * @param a variable to swap with b
+ * @param b variable to swap with a
+ */
+template<typename T> void Swap(T& a, T& b)
+{
+	T t = a;
+	a = b;
+	b = t;
+}
+
 #endif /* MATH_FUNC_HPP */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/overflowsafe_type.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,149 @@
+/* $Id$ */
+
+/** @file overflowsafe_type.hpp An overflow safe integer-like type. */
+
+#ifndef OVERFLOWSAFE_TYPE_HPP
+#define OVERFLOWSAFE_TYPE_HPP
+
+#include "math_func.hpp"
+
+/**
+ * Overflow safe template for integers, i.e. integers that will never overflow
+ * you multiply the maximum value with 2, or add 2, or substract somethng from
+ * the minimum value, etc.
+ * @param T     the type these integers are stored with.
+ * @param T_MAX the maximum value for the integers.
+ * @param T_MIN the minimum value for the integers.
+ */
+template <class T, T T_MAX, T T_MIN>
+class OverflowSafeInt
+{
+private:
+	/** The non-overflow safe backend to store the value in. */
+	T m_value;
+public:
+	OverflowSafeInt() : m_value(0) { }
+
+	OverflowSafeInt(const OverflowSafeInt& other) { this->m_value = other.m_value; }
+	OverflowSafeInt(const int64 int_)             { this->m_value = int_; }
+
+	FORCEINLINE OverflowSafeInt& operator = (const OverflowSafeInt& other) { this->m_value = other.m_value; return *this; }
+
+	FORCEINLINE OverflowSafeInt operator - () const { return OverflowSafeInt(-this->m_value); }
+
+	/**
+	 * Safe implementation of addition.
+	 * @param other the amount to add
+	 * @note when the addition would yield more than T_MAX (or less than T_MIN),
+	 *       it will be T_MAX (respectively T_MIN).
+	 */
+	FORCEINLINE OverflowSafeInt& operator += (const OverflowSafeInt& other)
+	{
+		if ((T_MAX - abs(other.m_value)) < abs(this->m_value) &&
+				(this->m_value < 0) == (other.m_value < 0)) {
+			this->m_value = (this->m_value < 0) ? T_MIN : T_MAX ;
+		} else {
+			this->m_value += other.m_value;
+		}
+		return *this;
+	}
+
+	/* Operators for addition and substraction */
+	FORCEINLINE OverflowSafeInt  operator +  (const OverflowSafeInt& other) const { OverflowSafeInt result = *this; result += other; return result; }
+	FORCEINLINE OverflowSafeInt  operator +  (const int              other) const { OverflowSafeInt result = *this; result += (int64)other; return result; }
+	FORCEINLINE OverflowSafeInt  operator +  (const uint             other) const { OverflowSafeInt result = *this; result += (int64)other; return result; }
+	FORCEINLINE OverflowSafeInt& operator -= (const OverflowSafeInt& other)       { return *this += (-other); }
+	FORCEINLINE OverflowSafeInt  operator -  (const OverflowSafeInt& other) const { OverflowSafeInt result = *this; result -= other; return result; }
+	FORCEINLINE OverflowSafeInt  operator -  (const int              other) const { OverflowSafeInt result = *this; result -= (int64)other; return result; }
+	FORCEINLINE OverflowSafeInt  operator -  (const uint             other) const { OverflowSafeInt result = *this; result -= (int64)other; return result; }
+
+	FORCEINLINE OverflowSafeInt& operator ++ () { return *this += 1; }
+	FORCEINLINE OverflowSafeInt& operator -- () { return *this += -1; }
+	FORCEINLINE OverflowSafeInt operator ++ (int) { OverflowSafeInt org = *this; *this += 1; return org; }
+	FORCEINLINE OverflowSafeInt operator -- (int) { OverflowSafeInt org = *this; *this += -1; return org; }
+
+	/**
+	 * Safe implementation of multiplication.
+	 * @param factor the factor to multiply this with.
+	 * @note when the multiplication would yield more than T_MAX (or less than T_MIN),
+	 *       it will be T_MAX (respectively T_MIN).
+	 */
+	FORCEINLINE OverflowSafeInt& operator *= (const int factor)
+	{
+		if (factor != 0 && (T_MAX / abs(factor)) < abs(this->m_value)) {
+			 this->m_value = ((this->m_value < 0) == (factor < 0)) ? T_MAX : T_MIN ;
+		} else {
+			this->m_value *= factor ;
+		}
+		return *this;
+	}
+
+	/* Operators for multiplication */
+	FORCEINLINE OverflowSafeInt operator * (const int64  factor) const { OverflowSafeInt result = *this; result *= factor; return result; }
+	FORCEINLINE OverflowSafeInt operator * (const int    factor) const { OverflowSafeInt result = *this; result *= (int64)factor; return result; }
+	FORCEINLINE OverflowSafeInt operator * (const uint   factor) const { OverflowSafeInt result = *this; result *= (int64)factor; return result; }
+	FORCEINLINE OverflowSafeInt operator * (const uint16 factor) const { OverflowSafeInt result = *this; result *= (int64)factor; return result; }
+	FORCEINLINE OverflowSafeInt operator * (const byte   factor) const { OverflowSafeInt result = *this; result *= (int64)factor; return result; }
+
+	/* Operators for division */
+	FORCEINLINE OverflowSafeInt& operator /= (const int              divisor)       { this->m_value /= divisor; return *this; }
+	FORCEINLINE OverflowSafeInt  operator /  (const OverflowSafeInt& divisor) const { OverflowSafeInt result = *this; result /= divisor.m_value; return result; }
+	FORCEINLINE OverflowSafeInt  operator /  (const int              divisor) const { OverflowSafeInt result = *this; result /= divisor; return result; }
+	FORCEINLINE OverflowSafeInt  operator /  (const uint             divisor) const { OverflowSafeInt result = *this; result /= (int)divisor; return result; }
+
+	/* Operators for modulo */
+	FORCEINLINE OverflowSafeInt& operator %= (const int  divisor)       { this->m_value %= divisor; return *this; }
+	FORCEINLINE OverflowSafeInt  operator %  (const int  divisor) const { OverflowSafeInt result = *this; result %= divisor; return result; }
+
+	/* Operators for shifting */
+	FORCEINLINE OverflowSafeInt& operator <<= (const int shift)       { this->m_value <<= shift; return *this; }
+	FORCEINLINE OverflowSafeInt  operator <<  (const int shift) const { OverflowSafeInt result = *this; result <<= shift; return result; }
+	FORCEINLINE OverflowSafeInt& operator >>= (const int shift)       { this->m_value >>= shift; return *this; }
+	FORCEINLINE OverflowSafeInt  operator >>  (const int shift) const { OverflowSafeInt result = *this; result >>= shift; return result; }
+
+	/* Operators for (in)equality when comparing overflow safe ints */
+	FORCEINLINE bool operator == (const OverflowSafeInt& other) const { return this->m_value == other.m_value; }
+	FORCEINLINE bool operator != (const OverflowSafeInt& other) const { return !(*this == other); }
+	FORCEINLINE bool operator >  (const OverflowSafeInt& other) const { return this->m_value > other.m_value; }
+	FORCEINLINE bool operator >= (const OverflowSafeInt& other) const { return this->m_value >= other.m_value; }
+	FORCEINLINE bool operator <  (const OverflowSafeInt& other) const { return !(*this >= other); }
+	FORCEINLINE bool operator <= (const OverflowSafeInt& other) const { return !(*this > other); }
+
+	/* Operators for (in)equality when comparing non-overflow safe ints */
+	FORCEINLINE bool operator == (const int other) const { return this->m_value == other; }
+	FORCEINLINE bool operator != (const int other) const { return !(*this == other); }
+	FORCEINLINE bool operator >  (const int other) const { return this->m_value > other; }
+	FORCEINLINE bool operator >= (const int other) const { return this->m_value >= other; }
+	FORCEINLINE bool operator <  (const int other) const { return !(*this >= other); }
+	FORCEINLINE bool operator <= (const int other) const { return !(*this > other); }
+
+	FORCEINLINE operator int64 () const { return this->m_value; }
+};
+
+/* Sometimes we got int64 operator OverflowSafeInt instead of vice versa. Handle that properly */
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator + (int64 a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b + a; }
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator - (int64 a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return -b + a; }
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator * (int64 a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b * a; }
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator / (int64 a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return (OverflowSafeInt<T, T_MAX, T_MIN>)a / (int)b; }
+
+/* Sometimes we got int operator OverflowSafeInt instead of vice versa. Handle that properly */
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator + (int   a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b + a; }
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator - (int   a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return -b + a; }
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator * (int   a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b * a; }
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator / (int   a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return (OverflowSafeInt<T, T_MAX, T_MIN>)a / (int)b; }
+
+/* Sometimes we got uint operator OverflowSafeInt instead of vice versa. Handle that properly */
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator + (uint  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b + a; }
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator - (uint  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return -b + a; }
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator * (uint  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b * a; }
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator / (uint  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return (OverflowSafeInt<T, T_MAX, T_MIN>)a / (int)b; }
+
+/* Sometimes we got byte operator OverflowSafeInt instead of vice versa. Handle that properly */
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator + (byte  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b + a; }
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator - (byte  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return -b + a; }
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator * (byte  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b * a; }
+template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator / (byte  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return (OverflowSafeInt<T, T_MAX, T_MIN>)a / (int)b; }
+
+typedef OverflowSafeInt<int64, INT64_MAX, INT64_MIN> OverflowSafeInt64;
+
+#endif /* OVERFLOWSAFE_TYPE_HPP */
--- a/src/core/random_func.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/core/random_func.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,9 +3,10 @@
 /** @file random_func.cpp */
 
 #include "../stdafx.h"
-#include "../macros.h"
-#include "../variables.h"
 #include "random_func.hpp"
+#include "bitmath_func.hpp"
+
+uint32 _random_seeds[2][2];
 
 uint32 InteractiveRandom()
 {
@@ -125,7 +126,7 @@
 }
 
 #ifdef RANDOM_DEBUG
-#include "network/network_data.h"
+#include "../network/network_data.h"
 uint32 DoRandom(int line, const char *file)
 {
 	if (_networking && (DEREF_CLIENT(0)->status != STATUS_INACTIVE || !_network_server))
--- a/src/core/random_func.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/core/random_func.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -1,10 +1,15 @@
 /* $Id$ */
 
-/** @file random_func.h */
+/** @file random_func.hpp */
 
 #ifndef RANDOM_FUNC_HPP
 #define RANDOM_FUNC_HPP
 
+#if defined(__APPLE__)
+	/* Apple already has Random declared */
+	#define Random OTTD_Random
+#endif /* __APPLE__ */
+
 /**************
  * Warning: DO NOT enable this unless you understand what it does
  *
@@ -95,4 +100,6 @@
 	return Chance16I(a, b, r);
 }
 
+extern uint32 _random_seeds[2][2];
+
 #endif /* RANDOM_FUNC_HPP */
--- a/src/currency.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/currency.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,9 +6,10 @@
 #include "openttd.h"
 #include "currency.h"
 #include "news.h"
-#include "variables.h"
+#include "settings_type.h"
+#include "date_func.h"
+
 #include "table/strings.h"
-#include "date.h"
 
 	//   exchange rate    prefix             symbol_pos
 	//   |  separator        |     postfix   |
--- a/src/currency.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/currency.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,9 @@
 #ifndef CURRENCY_H
 #define CURRENCY_H
 
+#include "date_type.h"
+#include "strings_type.h"
+
 enum {
 	CF_NOEURO = 0,
 	CF_ISEURO = 1,
--- a/src/date.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/date.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,15 +4,17 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "date.h"
 #include "variables.h"
-#include "macros.h"
-#include "vehicle.h"
+#include "settings_type.h"
 #include "network/network.h"
 #include "network/network_data.h"
 #include "network/network_server.h"
+#include "currency.h"
+#include "window_func.h"
 #include "functions.h"
-#include "currency.h"
+#include "date_func.h"
+#include "vehicle_base.h"
+#include "debug.h"
 #ifdef DEBUG_DUMP_COMMANDS
 #include "saveload.h"
 #endif
@@ -270,7 +272,7 @@
 		char name[MAX_PATH];
 		snprintf(name, lengthof(name), "dmp_cmds_%d.sav", _date);
 		SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR);
-		debug_dump_commands("ddc:save:%s\n", name);
+		DebugDumpCommands("ddc:save:%s\n", name);
 #endif /* DUMP_COMMANDS */
 		if (_opt.autosave != 0 && (_cur_month % _autosave_months[_opt.autosave]) == 0) {
 			_do_autosave = true;
--- a/src/date.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/* $Id$ */
-
-/** @file date.h */
-
-#ifndef DATE_H
-#define DATE_H
-
-#include "openttd.h"
-
-/**
- * 1 day is 74 ticks; _date_fract used to be uint16 and incremented by 885. On
- *                    an overflow the new day begun and 65535 / 885 = 74.
- * 1 tick is approximately 30 ms.
- * 1 day is thus about 2 seconds (74 * 30 = 2220) on a machine that can run OpenTTD normally
- */
-#define DAY_TICKS 74
-
-/*
- * ORIGINAL_BASE_YEAR, ORIGINAL_MAX_YEAR and DAYS_TILL_ORIGINAL_BASE_YEAR are
- * primarily used for loading newgrf and savegame data and returning some
- * newgrf (callback) functions that were in the original (TTD) inherited
- * format, where '_date == 0' meant that it was 1920-01-01.
- */
-
-/** The minimum starting year/base year of the original TTD */
-#define ORIGINAL_BASE_YEAR 1920
-/** The maximum year of the original TTD */
-#define ORIGINAL_MAX_YEAR 2090
-
-/**
- * The offset in days from the '_date == 0' till
- * 'ConvertYMDToDate(ORIGINAL_BASE_YEAR, 0, 1)'
- */
-#define DAYS_TILL_ORIGINAL_BASE_YEAR (365 * ORIGINAL_BASE_YEAR + ORIGINAL_BASE_YEAR / 4 - ORIGINAL_BASE_YEAR / 100 + ORIGINAL_BASE_YEAR / 400)
-
-/* The absolute minimum & maximum years in OTTD */
-#define MIN_YEAR 0
-/* MAX_YEAR, nicely rounded value of the number of years that can
- * be encoded in a single 32 bits date, about 2^31 / 366 years. */
-#define MAX_YEAR 5000000
-
-/* Year and Date are defined elsewhere */
-typedef uint8  Month;
-typedef uint8  Day;
-typedef uint16 DateFract;
-
-struct YearMonthDay {
-	Year  year;
-	Month month;
-	Day   day;
-};
-
-extern Year      _cur_year;
-extern Month     _cur_month;
-extern Date      _date;
-extern DateFract _date_fract;
-
-
-void SetDate(Date date);
-void ConvertDateToYMD(Date date, YearMonthDay *ymd);
-Date ConvertYMDToDate(Year year, Month month, Day day);
-
-#endif /* DATE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/date_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,19 @@
+/* $Id$ */
+
+/** @file date_func.h Functions related to dates. */
+
+#ifndef DATE_FUNC_H
+#define DATE_FUNC_H
+
+#include "date_type.h"
+
+extern Year      _cur_year;
+extern Month     _cur_month;
+extern Date      _date;
+extern DateFract _date_fract;
+
+void SetDate(Date date);
+void ConvertDateToYMD(Date date, YearMonthDay *ymd);
+Date ConvertYMDToDate(Year year, Month month, Day day);
+
+#endif /* DATE_FUNC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/date_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,56 @@
+/* $Id$ */
+
+/** @file date_type.h Types related to the dates in OpenTTD. */
+
+#ifndef DATE_TYPE_H
+#define DATE_TYPE_H
+
+/**
+ * 1 day is 74 ticks; _date_fract used to be uint16 and incremented by 885. On
+ *                    an overflow the new day begun and 65535 / 885 = 74.
+ * 1 tick is approximately 30 ms.
+ * 1 day is thus about 2 seconds (74 * 30 = 2220) on a machine that can run OpenTTD normally
+ */
+#define DAY_TICKS 74
+
+/*
+ * ORIGINAL_BASE_YEAR, ORIGINAL_MAX_YEAR and DAYS_TILL_ORIGINAL_BASE_YEAR are
+ * primarily used for loading newgrf and savegame data and returning some
+ * newgrf (callback) functions that were in the original (TTD) inherited
+ * format, where '_date == 0' meant that it was 1920-01-01.
+ */
+
+/** The minimum starting year/base year of the original TTD */
+#define ORIGINAL_BASE_YEAR 1920
+/** The maximum year of the original TTD */
+#define ORIGINAL_MAX_YEAR 2090
+
+/**
+ * The offset in days from the '_date == 0' till
+ * 'ConvertYMDToDate(ORIGINAL_BASE_YEAR, 0, 1)'
+ */
+#define DAYS_TILL_ORIGINAL_BASE_YEAR (365 * ORIGINAL_BASE_YEAR + ORIGINAL_BASE_YEAR / 4 - ORIGINAL_BASE_YEAR / 100 + ORIGINAL_BASE_YEAR / 400)
+
+/* The absolute minimum & maximum years in OTTD */
+#define MIN_YEAR 0
+/* MAX_YEAR, nicely rounded value of the number of years that can
+ * be encoded in a single 32 bits date, about 2^31 / 366 years. */
+#define MAX_YEAR 5000000
+
+typedef int32  Date;
+typedef uint16 DateFract;
+
+typedef int32  Year;
+typedef uint8  Month;
+typedef uint8  Day;
+
+struct YearMonthDay {
+	Year  year;
+	Month month;
+	Day   day;
+};
+
+static const Year INVALID_YEAR = -1;
+static const Date INVALID_DATE = -1;
+
+#endif /* DATE_TYPE_H */
--- a/src/debug.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/debug.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -8,8 +8,7 @@
 #include "openttd.h"
 #include "console.h"
 #include "debug.h"
-#include "functions.h"
-#include "string.h"
+#include "string_func.h"
 #include "network/core/core.h"
 
 #if defined(ENABLE_NETWORK)
@@ -163,7 +162,7 @@
 const char *GetDebugString()
 {
 	const DebugLevel *i;
-	static char dbgstr[100];
+	static char dbgstr[150];
 	char dbgval[20];
 
 	memset(dbgstr, 0, sizeof(dbgstr));
@@ -177,3 +176,20 @@
 
 	return dbgstr;
 }
+
+#ifdef DEBUG_DUMP_COMMANDS
+#include "fileio.h"
+
+void CDECL DebugDumpCommands(const char *s, ...)
+{
+	static FILE *f = FioFOpenFile("commands-out.log", "wb", AUTOSAVE_DIR);
+	if (f == NULL) return;
+
+	va_list va;
+	va_start(va, s);
+	vfprintf(f, s, va);
+	va_end(va);
+
+	fflush(f);
+}
+#endif /* DEBUG_DUMP_COMMANDS */
--- a/src/debug.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/debug.h	Tue Jan 22 21:00:30 2008 +0000
@@ -129,4 +129,13 @@
 	}\
 }
 
+void ShowInfo(const char *str);
+void CDECL ShowInfoF(const char *str, ...);
+
+#ifdef DEBUG_DUMP_COMMANDS
+	void CDECL DebugDumpCommands(const char *s, ...);
+#else /* DEBUG_DUMP_COMMANDS */
+	static inline void DebugDumpCommands(const char *s, ...) {}
+#endif /* DEBUG_DUMP_COMMANDS */
+
 #endif /* DEBUG_H */
--- a/src/depot.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/depot.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,15 +4,13 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "vehicle.h"
 #include "depot.h"
-#include "functions.h"
 #include "landscape.h"
-#include "tile.h"
-#include "map.h"
-#include "table/strings.h"
 #include "saveload.h"
 #include "order.h"
+#include "window_func.h"
+
+#include "table/strings.h"
 
 DEFINE_OLD_POOL_GENERIC(Depot, Depot)
 
--- a/src/depot.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/depot.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,10 +5,8 @@
 #ifndef DEPOT_H
 #define DEPOT_H
 
-#include "direction.h"
+#include "direction_type.h"
 #include "oldpool.h"
-#include "tile.h"
-#include "variables.h"
 #include "road_map.h"
 #include "rail_map.h"
 #include "water_map.h"
@@ -37,23 +35,6 @@
 #define FOR_ALL_DEPOTS_FROM(d, start) for (d = GetDepot(start); d != NULL; d = (d->index + 1U < GetDepotPoolSize()) ? GetDepot(d->index + 1U) : NULL) if (d->IsValid())
 #define FOR_ALL_DEPOTS(d) FOR_ALL_DEPOTS_FROM(d, 0)
 
-#define MIN_SERVINT_PERCENT  5
-#define MAX_SERVINT_PERCENT 90
-#define MIN_SERVINT_DAYS    30
-#define MAX_SERVINT_DAYS   800
-
-/**
- * Get the service interval domain.
- * Get the new proposed service interval for the vehicle is indeed, clamped
- * within the given bounds. @see MIN_SERVINT_PERCENT ,etc.
- * @param index proposed service interval
- * @return service interval
- */
-static inline Date GetServiceIntervalClamped(uint index)
-{
-	return (_patches.servint_ispercent) ? Clamp(index, MIN_SERVINT_PERCENT, MAX_SERVINT_PERCENT) : Clamp(index, MIN_SERVINT_DAYS, MAX_SERVINT_DAYS);
-}
-
 /**
  * Check if a tile is a depot of the given type.
  */
--- a/src/depot_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/depot_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,24 +4,27 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
 #include "train.h"
 #include "roadveh.h"
 #include "ship.h"
 #include "aircraft.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "table/sprites.h"
 #include "gui.h"
-#include "gfx.h"
-#include "vehicle.h"
-#include "viewport.h"
-#include "command.h"
+#include "textbuf_gui.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "command_func.h"
 #include "depot.h"
 #include "vehicle_gui.h"
 #include "station_map.h"
 #include "newgrf_engine.h"
 #include "spritecache.h"
+#include "strings_func.h"
+#include "window_func.h"
+#include "vehicle_func.h"
+#include "player_func.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
 
 /*
  * Since all depot window sizes aren't the same, we need to modify sizes a little.
@@ -171,14 +174,14 @@
 
 	switch (v->type) {
 		case VEH_TRAIN:
-			DrawTrainImage(v, x + 21, sprite_y, w->hscroll.cap + 4, w->hscroll.pos, WP(w,depot_d).sel);
+			DrawTrainImage(v, x + 21, sprite_y, WP(w, depot_d).sel, w->hscroll.cap + 4, w->hscroll.pos);
 
 			/* Number of wagons relative to a standard length wagon (rounded up) */
 			SetDParam(0, (v->u.rail.cached_total_length + 7) / 8);
 			DrawStringRightAligned(w->widget[DEPOT_WIDGET_MATRIX].right - 1, y + 4, STR_TINY_BLACK, TC_FROMSTRING); // Draw the counter
 			break;
 
-		case VEH_ROAD:     DrawRoadVehImage( v, x + 24, sprite_y, 1, WP(w, depot_d).sel); break;
+		case VEH_ROAD:     DrawRoadVehImage( v, x + 24, sprite_y, WP(w, depot_d).sel, 1); break;
 		case VEH_SHIP:     DrawShipImage(    v, x + 19, sprite_y - 1, WP(w, depot_d).sel); break;
 		case VEH_AIRCRAFT: {
 			const Sprite *spr = GetSprite(v->GetImage(DIR_W));
@@ -273,7 +276,7 @@
 		const Vehicle *v = WP(w, depot_d).wagon_list[num - WP(w, depot_d).engine_count];
 		const Vehicle *u;
 
-		DrawTrainImage(v, x + 50, y, w->hscroll.cap - 29, 0, WP(w,depot_d).sel);
+		DrawTrainImage(v, x + 50, y, WP(w, depot_d).sel, w->hscroll.cap - 29, 0);
 		DrawString(x, y + 2, STR_8816, TC_FROMSTRING);
 
 		/*Draw the train counter */
@@ -429,7 +432,7 @@
 			VehicleID sel = WP(w, depot_d).sel;
 
 			if (WP(w, depot_d).type == VEH_TRAIN && sel != INVALID_VEHICLE) {
-				WP(w,depot_d).sel = INVALID_VEHICLE;
+				WP(w, depot_d).sel = INVALID_VEHICLE;
 				TrainDepotMoveVehicle(v, sel, gdvp.head);
 			} else if (v != NULL) {
 				int image = v->GetImage(DIR_W);
@@ -794,7 +797,7 @@
 					break;
 
 				case DEPOT_WIDGET_CLONE: // Clone button
-					InvalidateWidget(w, DEPOT_WIDGET_CLONE);
+					w->InvalidateWidget(DEPOT_WIDGET_CLONE);
 					w->ToggleWidgetLoweredState(DEPOT_WIDGET_CLONE);
 
 					if (w->IsWidgetLowered(DEPOT_WIDGET_CLONE)) {
@@ -856,7 +859,7 @@
 
 		case WE_ABORT_PLACE_OBJ: {
 			w->RaiseWidget(DEPOT_WIDGET_CLONE);
-			InvalidateWidget(w, DEPOT_WIDGET_CLONE);
+			w->InvalidateWidget(DEPOT_WIDGET_CLONE);
 		} break;
 
 			/* check if a vehicle in a depot was clicked.. */
@@ -916,7 +919,7 @@
 						if (w->IsWidgetDisabled(e->we.click.widget)) return;
 						if (WP(w, depot_d).sel == INVALID_VEHICLE) return;
 
-						HandleButtonClick(w, e->we.click.widget);
+						w->HandleButtonClick(e->we.click.widget);
 
 						v = GetVehicle(WP(w, depot_d).sel);
 						WP(w, depot_d).sel = INVALID_VEHICLE;
--- a/src/direction.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,322 +0,0 @@
-/* $Id$ */
-
-/** @file direction.h */
-
-#ifndef DIRECTION_H
-#define DIRECTION_H
-
-#include "helpers.hpp"
-
-/**
- * Defines the 8 directions on the map.
- *
- * This enum defines 8 possible directions which are used for
- * the vehicles in the game. The directions are aligned straight
- * to the viewport, not to the map. So north points to the top of
- * your viewport and not rotated by 45 degrees left or right to get
- * a "north" used in you games.
- */
-enum Direction {
-	DIR_BEGIN = 0,          ///< Used to iterate
-	DIR_N   = 0,            ///< North
-	DIR_NE  = 1,            ///< Northeast
-	DIR_E   = 2,            ///< East
-	DIR_SE  = 3,            ///< Southeast
-	DIR_S   = 4,            ///< South
-	DIR_SW  = 5,            ///< Southwest
-	DIR_W   = 6,            ///< West
-	DIR_NW  = 7,            ///< Northwest
-	DIR_END,                ///< Used to iterate
-	INVALID_DIR = 0xFF,     ///< Flag for an invalid direction
-};
-
-/** Define basic enum properties */
-template <> struct EnumPropsT<Direction> : MakeEnumPropsT<Direction, byte, DIR_BEGIN, DIR_END, INVALID_DIR> {};
-typedef TinyEnumT<Direction> DirectionByte; //typedefing-enumification of Direction
-
-/**
- * Return the reverse of a direction
- *
- * @param d The direction to get the reverse from
- * @return The reverse Direction
- */
-static inline Direction ReverseDir(Direction d)
-{
-	return (Direction)(4 ^ d);
-}
-
-
-/**
- * Enumeration for the difference between two directions.
- *
- * This enumeration is used to mark differences between
- * two directions. If you get one direction you can align
- * a second direction in 8 different ways. This enumeration
- * only contains 6 of these 8 differences, but the remaining
- * two can be calculated by adding to differences together.
- * This also means you can add two differences together and
- * get the difference you really want to get. The difference
- * of 45 degrees left + the difference of 45 degrees right results in the
- * difference of 0 degrees.
- *
- * @note To get this mentioned addition of direction you must use
- *       modulo DIR_END or use the #ChangeDirDiff(DirDiff, DirDiff) function.
- * @see ChangeDirDiff(DirDiff, DirDiff)
- */
-enum DirDiff {
-	DIRDIFF_SAME    = 0,    ///< Both directions faces to the same direction
-	DIRDIFF_45RIGHT = 1,    ///< Angle of 45 degrees right
-	DIRDIFF_90RIGHT = 2,    ///< Angle of 90 degrees right
-	DIRDIFF_REVERSE = 4,    ///< One direction is the opposit of the other one
-	DIRDIFF_90LEFT  = 6,    ///< Angle of 90 degrees left
-	DIRDIFF_45LEFT  = 7     ///< Angle of 45 degrees left
-};
-
-/**
- * Calculate the difference between to directions
- *
- * @param d0 The first direction as the base
- * @param d1 The second direction as the offset from the base
- * @return The difference how the second directions drifts of the first one.
- */
-static inline DirDiff DirDifference(Direction d0, Direction d1)
-{
-	return (DirDiff)((d0 + 8 - d1) % 8);
-}
-
-/**
- * Applies two differences together
- *
- * This function adds two differences together and return the resulting
- * difference. So adding two DIRDIFF_REVERSE together results in the
- * DIRDIFF_SAME difference.
- *
- * @param d The first difference
- * @param delta The second difference to add on
- * @return The resulting difference
- */
-static inline DirDiff ChangeDirDiff(DirDiff d, DirDiff delta)
-{
-	return (DirDiff)((d + delta) % 8);
-}
-
-/**
- * Change a direction by a given difference
- *
- * This functions returns a new direction of the given direction
- * which is rotated by the given difference.
- *
- * @param d The direction to get a new direction from
- * @param delta The offset/drift applied to the direction
- * @return The new direction
- */
-static inline Direction ChangeDir(Direction d, DirDiff delta)
-{
-	return (Direction)((d + delta) % 8);
-}
-
-
-/**
- * Enumeration for diagonal directions.
- *
- * This enumeration is used for the 4 direction of the tile-edges.
- */
-enum DiagDirection {
-	DIAGDIR_BEGIN = 0,      ///< Used for iterations
-	DIAGDIR_NE  = 0,        ///< Northeast, upper right on your monitor
-	DIAGDIR_SE  = 1,        ///< Southeast
-	DIAGDIR_SW  = 2,        ///< Southwest
-	DIAGDIR_NW  = 3,        ///< Northwest
-	DIAGDIR_END,            ///< Used for iterations
-	INVALID_DIAGDIR = 0xFF, ///< Flag for an invalid DiagDirection
-};
-
-DECLARE_POSTFIX_INCREMENT(DiagDirection);
-
-/** Define basic enum properties */
-template <> struct EnumPropsT<DiagDirection> : MakeEnumPropsT<DiagDirection, byte, DIAGDIR_BEGIN, DIAGDIR_END, INVALID_DIAGDIR> {};
-typedef TinyEnumT<DiagDirection> DiagDirectionByte; //typedefing-enumification of DiagDirection
-
-/**
- * Returns the reverse direction of the given DiagDirection
- *
- * @param d The DiagDirection to get the reverse from
- * @return The reverse direction
- */
-static inline DiagDirection ReverseDiagDir(DiagDirection d)
-{
-	return (DiagDirection)(2 ^ d);
-}
-
-/**
- * Enumeration for the difference between to DiagDirection.
- *
- * As the DiagDirection only contains 4 possible directions the
- * difference between two of these directions can only be in 4 ways.
- * As the DirDiff enumeration the values can be added together and
- * you will get the resulting difference (use modulo DIAGDIR_END).
- *
- * @see DirDiff
- */
-enum DiagDirDiff {
-	DIAGDIRDIFF_SAME    = 0,        ///< Same directions
-	DIAGDIRDIFF_90RIGHT = 1,        ///< 90 degrees right
-	DIAGDIRDIFF_REVERSE = 2,        ///< Reverse directions
-	DIAGDIRDIFF_90LEFT  = 3         ///< 90 degrees left
-};
-
-/** Allow incrementing of DiagDirDiff variables */
-DECLARE_POSTFIX_INCREMENT(DiagDirDiff);
-
-/**
- * Applies a difference on a DiagDirection
- *
- * This function applies a difference on a DiagDirection and returns
- * the new DiagDirection.
- *
- * @param d The DiagDirection
- * @param delta The difference to applie on
- * @return The new direction which was calculated
- */
-static inline DiagDirection ChangeDiagDir(DiagDirection d, DiagDirDiff delta)
-{
-	return (DiagDirection)((d + delta) % 4);
-}
-
-/**
- * Convert a Direction to a DiagDirection.
- *
- * This function can be used to convert the 8-way Direction to
- * the 4-way DiagDirection. If the direction cannot be mapped its
- * "rounded clockwise". So DIR_N becomes DIAGDIR_NE.
- *
- * @param dir The direction to convert
- * @return The resulting DiagDirection, maybe "rounded clockwise".
- */
-static inline DiagDirection DirToDiagDir(Direction dir)
-{
-	return (DiagDirection)(dir >> 1);
-}
-
-/**
- * Convert a DiagDirection to a Direction.
- *
- * This function can be used to convert the 4-way DiagDirection
- * to the 8-way Direction. As 4-way are less than 8-way not all
- * possible directions can be calculated.
- *
- * @param dir The direction to convert
- * @return The resulting Direction
- */
-static inline Direction DiagDirToDir(DiagDirection dir)
-{
-	return (Direction)(dir * 2 + 1);
-}
-
-
-/**
- * Enumeration for the two axis X and Y
- *
- * This enumeration represente the two axis X and Y in the game.
- * The X axis is the one which goes align the north-west edge
- * (and south-east edge). The Y axis must be so the one which goes
- * align the north-east edge (and south-west) edge.
- */
-enum Axis {
-	AXIS_X = 0,     ///< The X axis
-	AXIS_Y = 1,     ///< The y axis
-	AXIS_END        ///< Used for iterations
-};
-
-
-/**
- * Select the other axis as provided.
- *
- * This is basically the not-operator for the axis.
- *
- * @param a The given axis
- * @return The other axis
- */
-static inline Axis OtherAxis(Axis a)
-{
-	return (Axis)(a ^ 1);
-}
-
-
-/**
- * Convert a DiagDirection to the axis.
- *
- * This function returns the axis which belongs to the given
- * DiagDirection. The axis X belongs to the DiagDirection
- * north-east and south-west.
- *
- * @param d The DiagDirection
- * @return The axis which belongs to the direction
- */
-static inline Axis DiagDirToAxis(DiagDirection d)
-{
-	return (Axis)(d & 1);
-}
-
-
-/**
- * Converts an Axis to a DiagDirection
- *
- * This function returns the DiagDirection which
- * belongs to the axis. As 2 directions are mapped to an axis
- * this function returns the one which points to south,
- * either south-west (on X axis) or south-east (on Y axis)
- *
- * @param a The axis
- * @return The direction pointed to south
- */
-static inline DiagDirection AxisToDiagDir(Axis a)
-{
-	return (DiagDirection)(2 - a);
-}
-
-/**
- * Convert an axis and a flag for north/south into a DiagDirection
- * @param xy axis to convert
- * @param ns north -> 0, south -> 1
- * @return the desired DiagDirection
- */
-static inline DiagDirection XYNSToDiagDir(Axis xy, uint ns)
-{
-	return (DiagDirection)(xy * 3 ^ ns * 2);
-}
-
-/**
- * Checks if an interger value is a valid DiagDirection
- *
- * @param d The value to check
- * @return True if the value belongs to a DiagDirection, else false
- */
-static inline bool IsValidDiagDirection(DiagDirection d)
-{
-	return d < DIAGDIR_END;
-}
-
-/**
- * Checks if an integer value is a valid Direction
- *
- * @param d The value to check
- * @return True if the value belongs to a Direction, else false
- */
-static inline bool IsValidDirection(Direction d)
-{
-	return d < DIR_END;
-}
-
-/**
- * Checks if an integer value is a valid Axis
- *
- * @param d The value to check
- * @return True if the value belongs to an Axis, else false
- */
-static inline bool IsValidAxis(Axis d)
-{
-	return d < AXIS_END;
-}
-
-#endif /* DIRECTION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/direction_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,214 @@
+/* $Id$ */
+
+/** @file direction_func.h Different functions related to conversions between directions. */
+
+#ifndef DIRECTION_FUNC_H
+#define DIRECTION_FUNC_H
+
+#include "direction_type.h"
+
+/**
+ * Return the reverse of a direction
+ *
+ * @param d The direction to get the reverse from
+ * @return The reverse Direction
+ */
+static inline Direction ReverseDir(Direction d)
+{
+	return (Direction)(4 ^ d);
+}
+
+
+/**
+ * Calculate the difference between to directions
+ *
+ * @param d0 The first direction as the base
+ * @param d1 The second direction as the offset from the base
+ * @return The difference how the second directions drifts of the first one.
+ */
+static inline DirDiff DirDifference(Direction d0, Direction d1)
+{
+	return (DirDiff)((d0 + 8 - d1) % 8);
+}
+
+/**
+ * Applies two differences together
+ *
+ * This function adds two differences together and return the resulting
+ * difference. So adding two DIRDIFF_REVERSE together results in the
+ * DIRDIFF_SAME difference.
+ *
+ * @param d The first difference
+ * @param delta The second difference to add on
+ * @return The resulting difference
+ */
+static inline DirDiff ChangeDirDiff(DirDiff d, DirDiff delta)
+{
+	return (DirDiff)((d + delta) % 8);
+}
+
+/**
+ * Change a direction by a given difference
+ *
+ * This functions returns a new direction of the given direction
+ * which is rotated by the given difference.
+ *
+ * @param d The direction to get a new direction from
+ * @param delta The offset/drift applied to the direction
+ * @return The new direction
+ */
+static inline Direction ChangeDir(Direction d, DirDiff delta)
+{
+	return (Direction)((d + delta) % 8);
+}
+
+
+/**
+ * Returns the reverse direction of the given DiagDirection
+ *
+ * @param d The DiagDirection to get the reverse from
+ * @return The reverse direction
+ */
+static inline DiagDirection ReverseDiagDir(DiagDirection d)
+{
+	return (DiagDirection)(2 ^ d);
+}
+
+
+/**
+ * Applies a difference on a DiagDirection
+ *
+ * This function applies a difference on a DiagDirection and returns
+ * the new DiagDirection.
+ *
+ * @param d The DiagDirection
+ * @param delta The difference to applie on
+ * @return The new direction which was calculated
+ */
+static inline DiagDirection ChangeDiagDir(DiagDirection d, DiagDirDiff delta)
+{
+	return (DiagDirection)((d + delta) % 4);
+}
+
+/**
+ * Convert a Direction to a DiagDirection.
+ *
+ * This function can be used to convert the 8-way Direction to
+ * the 4-way DiagDirection. If the direction cannot be mapped its
+ * "rounded clockwise". So DIR_N becomes DIAGDIR_NE.
+ *
+ * @param dir The direction to convert
+ * @return The resulting DiagDirection, maybe "rounded clockwise".
+ */
+static inline DiagDirection DirToDiagDir(Direction dir)
+{
+	return (DiagDirection)(dir >> 1);
+}
+
+/**
+ * Convert a DiagDirection to a Direction.
+ *
+ * This function can be used to convert the 4-way DiagDirection
+ * to the 8-way Direction. As 4-way are less than 8-way not all
+ * possible directions can be calculated.
+ *
+ * @param dir The direction to convert
+ * @return The resulting Direction
+ */
+static inline Direction DiagDirToDir(DiagDirection dir)
+{
+	return (Direction)(dir * 2 + 1);
+}
+
+
+/**
+ * Select the other axis as provided.
+ *
+ * This is basically the not-operator for the axis.
+ *
+ * @param a The given axis
+ * @return The other axis
+ */
+static inline Axis OtherAxis(Axis a)
+{
+	return (Axis)(a ^ 1);
+}
+
+
+/**
+ * Convert a DiagDirection to the axis.
+ *
+ * This function returns the axis which belongs to the given
+ * DiagDirection. The axis X belongs to the DiagDirection
+ * north-east and south-west.
+ *
+ * @param d The DiagDirection
+ * @return The axis which belongs to the direction
+ */
+static inline Axis DiagDirToAxis(DiagDirection d)
+{
+	return (Axis)(d & 1);
+}
+
+
+/**
+ * Converts an Axis to a DiagDirection
+ *
+ * This function returns the DiagDirection which
+ * belongs to the axis. As 2 directions are mapped to an axis
+ * this function returns the one which points to south,
+ * either south-west (on X axis) or south-east (on Y axis)
+ *
+ * @param a The axis
+ * @return The direction pointed to south
+ */
+static inline DiagDirection AxisToDiagDir(Axis a)
+{
+	return (DiagDirection)(2 - a);
+}
+
+/**
+ * Convert an axis and a flag for north/south into a DiagDirection
+ * @param xy axis to convert
+ * @param ns north -> 0, south -> 1
+ * @return the desired DiagDirection
+ */
+static inline DiagDirection XYNSToDiagDir(Axis xy, uint ns)
+{
+	return (DiagDirection)(xy * 3 ^ ns * 2);
+}
+
+/**
+ * Checks if an interger value is a valid DiagDirection
+ *
+ * @param d The value to check
+ * @return True if the value belongs to a DiagDirection, else false
+ */
+static inline bool IsValidDiagDirection(DiagDirection d)
+{
+	return d < DIAGDIR_END;
+}
+
+/**
+ * Checks if an integer value is a valid Direction
+ *
+ * @param d The value to check
+ * @return True if the value belongs to a Direction, else false
+ */
+static inline bool IsValidDirection(Direction d)
+{
+	return d < DIR_END;
+}
+
+/**
+ * Checks if an integer value is a valid Axis
+ *
+ * @param d The value to check
+ * @return True if the value belongs to an Axis, else false
+ */
+static inline bool IsValidAxis(Axis d)
+{
+	return d < AXIS_END;
+}
+
+#endif /* DIRECTION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/direction_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,126 @@
+/* $Id$ */
+
+/** @file direction_type.h Different types to 'show' directions. */
+
+#ifndef DIRECTION_TYPE_H
+#define DIRECTION_TYPE_H
+
+#include "core/enum_type.hpp"
+
+/**
+ * Defines the 8 directions on the map.
+ *
+ * This enum defines 8 possible directions which are used for
+ * the vehicles in the game. The directions are aligned straight
+ * to the viewport, not to the map. So north points to the top of
+ * your viewport and not rotated by 45 degrees left or right to get
+ * a "north" used in you games.
+ */
+enum Direction {
+	DIR_BEGIN = 0,          ///< Used to iterate
+	DIR_N   = 0,            ///< North
+	DIR_NE  = 1,            ///< Northeast
+	DIR_E   = 2,            ///< East
+	DIR_SE  = 3,            ///< Southeast
+	DIR_S   = 4,            ///< South
+	DIR_SW  = 5,            ///< Southwest
+	DIR_W   = 6,            ///< West
+	DIR_NW  = 7,            ///< Northwest
+	DIR_END,                ///< Used to iterate
+	INVALID_DIR = 0xFF,     ///< Flag for an invalid direction
+};
+
+/** Allow incrementing of Direction variables */
+DECLARE_POSTFIX_INCREMENT(Direction);
+
+/** Define basic enum properties */
+template <> struct EnumPropsT<Direction> : MakeEnumPropsT<Direction, byte, DIR_BEGIN, DIR_END, INVALID_DIR> {};
+typedef TinyEnumT<Direction> DirectionByte; //typedefing-enumification of Direction
+
+
+/**
+ * Enumeration for the difference between two directions.
+ *
+ * This enumeration is used to mark differences between
+ * two directions. If you get one direction you can align
+ * a second direction in 8 different ways. This enumeration
+ * only contains 6 of these 8 differences, but the remaining
+ * two can be calculated by adding to differences together.
+ * This also means you can add two differences together and
+ * get the difference you really want to get. The difference
+ * of 45 degrees left + the difference of 45 degrees right results in the
+ * difference of 0 degrees.
+ *
+ * @note To get this mentioned addition of direction you must use
+ *       modulo DIR_END or use the #ChangeDirDiff(DirDiff, DirDiff) function.
+ * @see ChangeDirDiff(DirDiff, DirDiff)
+ */
+enum DirDiff {
+	DIRDIFF_SAME    = 0,    ///< Both directions faces to the same direction
+	DIRDIFF_45RIGHT = 1,    ///< Angle of 45 degrees right
+	DIRDIFF_90RIGHT = 2,    ///< Angle of 90 degrees right
+	DIRDIFF_REVERSE = 4,    ///< One direction is the opposit of the other one
+	DIRDIFF_90LEFT  = 6,    ///< Angle of 90 degrees left
+	DIRDIFF_45LEFT  = 7     ///< Angle of 45 degrees left
+};
+
+
+/**
+ * Enumeration for diagonal directions.
+ *
+ * This enumeration is used for the 4 direction of the tile-edges.
+ */
+enum DiagDirection {
+	DIAGDIR_BEGIN = 0,      ///< Used for iterations
+	DIAGDIR_NE  = 0,        ///< Northeast, upper right on your monitor
+	DIAGDIR_SE  = 1,        ///< Southeast
+	DIAGDIR_SW  = 2,        ///< Southwest
+	DIAGDIR_NW  = 3,        ///< Northwest
+	DIAGDIR_END,            ///< Used for iterations
+	INVALID_DIAGDIR = 0xFF, ///< Flag for an invalid DiagDirection
+};
+
+/** Allow incrementing of DiagDirection variables */
+DECLARE_POSTFIX_INCREMENT(DiagDirection);
+
+/** Define basic enum properties */
+template <> struct EnumPropsT<DiagDirection> : MakeEnumPropsT<DiagDirection, byte, DIAGDIR_BEGIN, DIAGDIR_END, INVALID_DIAGDIR> {};
+typedef TinyEnumT<DiagDirection> DiagDirectionByte; //typedefing-enumification of DiagDirection
+
+
+/**
+ * Enumeration for the difference between to DiagDirection.
+ *
+ * As the DiagDirection only contains 4 possible directions the
+ * difference between two of these directions can only be in 4 ways.
+ * As the DirDiff enumeration the values can be added together and
+ * you will get the resulting difference (use modulo DIAGDIR_END).
+ *
+ * @see DirDiff
+ */
+enum DiagDirDiff {
+	DIAGDIRDIFF_SAME    = 0,        ///< Same directions
+	DIAGDIRDIFF_90RIGHT = 1,        ///< 90 degrees right
+	DIAGDIRDIFF_REVERSE = 2,        ///< Reverse directions
+	DIAGDIRDIFF_90LEFT  = 3         ///< 90 degrees left
+};
+
+/** Allow incrementing of DiagDirDiff variables */
+DECLARE_POSTFIX_INCREMENT(DiagDirDiff);
+
+
+/**
+ * Enumeration for the two axis X and Y
+ *
+ * This enumeration represente the two axis X and Y in the game.
+ * The X axis is the one which goes align the north-west edge
+ * (and south-east edge). The Y axis must be so the one which goes
+ * align the north-east edge (and south-west) edge.
+ */
+enum Axis {
+	AXIS_X = 0,     ///< The X axis
+	AXIS_Y = 1,     ///< The y axis
+	AXIS_END        ///< Used for iterations
+};
+
+#endif /* DIRECTION_TYPE_H */
--- a/src/disaster_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/disaster_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -18,27 +18,30 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
 #include "landscape.h"
+
 #include "industry_map.h"
 #include "station_map.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "map.h"
-#include "tile.h"
-#include "vehicle.h"
-#include "command.h"
+#include "command_func.h"
+#include "tile_cmd.h"
 #include "news.h"
 #include "station.h"
 #include "waypoint.h"
 #include "town.h"
 #include "industry.h"
-#include "player.h"
+#include "player_func.h"
 #include "airport.h"
-#include "sound.h"
 #include "variables.h"
+#include "settings_type.h"
+#include "strings_func.h"
+#include "date_func.h"
+#include "functions.h"
+#include "vehicle_func.h"
+#include "vehicle_base.h"
+#include "sound_func.h"
+
+#include "table/strings.h"
 #include "table/sprites.h"
-#include "date.h"
 
 enum DisasterSubType {
 	ST_Zeppeliner,
@@ -69,6 +72,9 @@
 				_current_player = OWNER_WATER;
 				DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
 				_current_player = p;
+
+				/* update signals in buffer */
+				UpdateSignalsInBuffer();
 			}
 			break;
 
@@ -135,8 +141,7 @@
 
 	DisasterVehicleUpdateImage(v);
 	VehiclePositionChanged(v);
-	BeginVehicleMove(v);
-	EndVehicleMove(v);
+	MarkSingleVehicleDirty(v);
 }
 
 static void DeleteDisasterVeh(Vehicle *v)
@@ -547,8 +552,7 @@
 	if (++v->cur_image > SPR_ROTOR_MOVING_3) v->cur_image = SPR_ROTOR_MOVING_1;
 
 	VehiclePositionChanged(v);
-	BeginVehicleMove(v);
-	EndVehicleMove(v);
+	MarkSingleVehicleDirty(v);
 }
 
 /**
@@ -706,8 +710,7 @@
 
 	if (++v->age > 8880) {
 		VehiclePositionChanged(v);
-		BeginVehicleMove(v);
-		EndVehicleMove(v);
+		MarkSingleVehicleDirty(v);
 		delete v;
 		return;
 	}
--- a/src/dock_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/dock_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,19 +4,24 @@
 
 #include "stdafx.h"
 #include "openttd.h"
+#include "tile_map.h"
+#include "station.h"
+#include "gui.h"
+#include "terraform_gui.h"
+#include "window_gui.h"
+#include "station_gui.h"
+#include "command_func.h"
+#include "settings_type.h"
+#include "water.h"
+#include "window_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "player_func.h"
+
 #include "table/sprites.h"
 #include "table/strings.h"
-#include "functions.h"
-#include "map.h"
-#include "window.h"
-#include "station.h"
-#include "gui.h"
-#include "viewport.h"
-#include "gfx.h"
-#include "sound.h"
-#include "command.h"
-#include "variables.h"
-#include "water.h"
 
 static void ShowBuildDockStationPicker();
 static void ShowBuildDocksDepotPicker();
@@ -171,7 +176,7 @@
 		break;
 
 	case WE_ABORT_PLACE_OBJ:
-		RaiseWindowButtons(w);
+		w->RaiseButtons();
 
 		w = FindWindowById(WC_BUILD_STATION, 0);
 		if (w != NULL) WP(w, def_d).close = true;
--- a/src/driver.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/driver.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,16 +6,24 @@
 #include "openttd.h"
 #include "debug.h"
 #include "driver.h"
-#include "functions.h"
-#include "string.h"
 
 #include "sound/sound_driver.hpp"
 #include "music/music_driver.hpp"
 #include "video/video_driver.hpp"
 
+VideoDriver *_video_driver;
+char _ini_videodriver[32];
+int _num_resolutions;
+uint16 _resolutions[32][2];
+uint16 _cur_resolution[2];
+
 SoundDriver *_sound_driver;
+char _ini_sounddriver[32];
+
 MusicDriver *_music_driver;
-VideoDriver *_video_driver;
+char _ini_musicdriver[32];
+
+char _ini_blitter[32];
 
 static const char* GetDriverParam(const char* const* parm, const char* name)
 {
--- a/src/driver.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/driver.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,8 +6,8 @@
 #define DRIVER_H
 
 #include "debug.h"
-#include "helpers.hpp"
-#include "string.h"
+#include "core/enum_type.hpp"
+#include "string_func.h"
 #include <string>
 #include <map>
 
@@ -79,7 +79,7 @@
 		strecpy(buf, GetDriverTypeName(type), lastof(buf));
 		strecpy(buf + 5, name, lastof(buf));
 
-#if !defined(NDEBUG)
+#if !defined(NDEBUG) || defined(WITH_ASSERT)
 		/* NDEBUG disables asserts and gives a warning: unused variable 'P' */
 		std::pair<Drivers::iterator, bool> P =
 #endif /* !NDEBUG */
--- a/src/dummy_land.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/dummy_land.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,10 +4,11 @@
 
 #include "stdafx.h"
 #include "openttd.h"
+#include "tile_cmd.h"
+#include "command_func.h"
+#include "viewport_func.h"
+
 #include "table/strings.h"
-#include "functions.h"
-#include "viewport.h"
-#include "command.h"
 #include "table/sprites.h"
 
 static void DrawTile_Dummy(TileInfo *ti)
--- a/src/economy.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/economy.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,25 +5,16 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "currency.h"
-#include "functions.h"
 #include "landscape.h"
-#include "strings.h" // XXX InjectDParam()
-#include "table/strings.h"
-#include "table/sprites.h"
-#include "map.h"
 #include "news.h"
-#include "player.h"
+#include "player_base.h"
+#include "player_func.h"
 #include "station.h"
-#include "vehicle.h"
-#include "window.h"
-#include "gfx.h"
-#include "command.h"
+#include "command_func.h"
 #include "saveload.h"
-#include "economy.h"
 #include "industry.h"
 #include "town.h"
 #include "network/network.h"
-#include "sound.h"
 #include "engine.h"
 #include "network/network_data.h"
 #include "variables.h"
@@ -38,10 +29,25 @@
 #include "newgrf_industries.h"
 #include "newgrf_industrytiles.h"
 #include "unmovable.h"
-#include "date.h"
 #include "cargotype.h"
 #include "player_face.h"
 #include "group.h"
+#include "strings_func.h"
+#include "tile_cmd.h"
+#include "functions.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "track_type.h"
+#include "track_func.h"
+#include "road_func.h"
+#include "rail_map.h"
+#include "signal_func.h"
+#include "gfx_func.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
 
 /**
  * Multiply two integer values and shift the results to right.
@@ -90,11 +96,17 @@
 };
 
 int _score_part[MAX_PLAYERS][SCORE_END];
+Economy _economy;
+Subsidy _subsidies[MAX_PLAYERS];
+Prices _price;
+uint16 _price_frac[NUM_PRICES];
+Money  _cargo_payment_rates[NUM_CARGO];
+uint16 _cargo_payment_rates_frac[NUM_CARGO];
+Money _additional_cash_required;
 
 Money CalculateCompanyValue(const Player* p)
 {
 	PlayerID owner = p->index;
-	/* Do a little nasty by using CommandCost, so we can use the "overflow" protection of CommandCost */
 	Money value = 0;
 
 	Station *st;
@@ -280,6 +292,7 @@
 		/* See if the old_player had shares in other companies */
 		_current_player = old_player;
 		FOR_ALL_PLAYERS(p) {
+			if (!p->is_active) continue;
 			for (i = 0; i < 4; i++) {
 				if (p->share_owners[i] == old_player) {
 					/* Sell his shares */
@@ -396,6 +409,7 @@
 					}
 				} else {
 					v->owner = new_player;
+					v->colormap = PAL_NONE;
 					v->group_id = DEFAULT_GROUP;
 					if (IsEngineCountable(v)) GetPlayer(new_player)->num_engines[v->engine_type]++;
 					switch (v->type) {
@@ -416,6 +430,29 @@
 		do {
 			ChangeTileOwner(tile, old_player, new_player);
 		} while (++tile != MapSize());
+
+		if (new_player != PLAYER_SPECTATOR) {
+			/* Update all signals because there can be new segment that was owned by two players
+			 * and signals were not propagated
+			 * Similiar with crossings - it is needed to bar crossings that weren't before
+			 * because of different owner of crossing and approaching train */
+			tile = 0;
+
+			do {
+				if (IsTileType(tile, MP_RAILWAY) && IsTileOwner(tile, new_player) && HasSignals(tile)) {
+					TrackBits tracks = GetTrackBits(tile);
+					do { // there may be two tracks with signals for TRACK_BIT_HORZ and TRACK_BIT_VERT
+						Track track = RemoveFirstTrack(&tracks);
+						if (HasSignalOnTrack(tile, track)) AddTrackToSignalBuffer(tile, track, new_player);
+					} while (tracks != TRACK_BIT_NONE);
+				} else if (IsLevelCrossingTile(tile) && IsTileOwner(tile, new_player)) {
+					UpdateLevelCrossing(tile);
+				}
+			} while (++tile != MapSize());
+		}
+
+		/* update signals in buffer */
+		UpdateSignalsInBuffer();
 	}
 
 	/* Change color of existing windows */
@@ -635,8 +672,8 @@
 
 	FOR_ALL_STATIONS(st) {
 		_current_player = st->owner;
-		SET_EXPENSES_TYPE(EXPENSES_PROPERTY);
-		SubtractMoneyFromPlayer(_price.station_value >> 1);
+		CommandCost cost(EXPENSES_PROPERTY, _price.station_value >> 1);
+		SubtractMoneyFromPlayer(cost);
 	}
 
 	if (!HasBit(1<<0|1<<3|1<<6|1<<9, _cur_month))
@@ -736,12 +773,10 @@
 		if (!p->is_active) continue;
 
 		_current_player = p->index;
-		SET_EXPENSES_TYPE(EXPENSES_LOAN_INT);
 
-		SubtractMoneyFromPlayer(CommandCost((Money)BigMulSU(p->current_loan, interest, 16)));
+		SubtractMoneyFromPlayer(CommandCost(EXPENSES_LOAN_INT, (Money)BigMulSU(p->current_loan, interest, 16)));
 
-		SET_EXPENSES_TYPE(EXPENSES_OTHER);
-		SubtractMoneyFromPlayer(_price.station_value >> 2);
+		SubtractMoneyFromPlayer(CommandCost(EXPENSES_OTHER, _price.station_value >> 2));
 	}
 }
 
@@ -1448,7 +1483,7 @@
 			if (!cp->paid_for &&
 					cp->source != last_visited &&
 					HasBit(ge->acceptance_pickup, GoodsEntry::ACCEPTANCE) &&
-					(front_v->current_order.flags & OF_TRANSFER) == 0) {
+					(front_v->current_order.flags & OFB_TRANSFER) == 0) {
 				/* Deliver goods to the station */
 				st->time_since_unload = 0;
 
@@ -1461,8 +1496,8 @@
 				result |= 1;
 
 				SetBit(v->vehicle_flags, VF_CARGO_UNLOADING);
-			} else if (front_v->current_order.flags & (OF_UNLOAD | OF_TRANSFER)) {
-				if (!cp->paid_for && (front_v->current_order.flags & OF_TRANSFER) != 0) {
+			} else if (front_v->current_order.flags & (OFB_UNLOAD | OFB_TRANSFER)) {
+				if (!cp->paid_for && (front_v->current_order.flags & OFB_TRANSFER) != 0) {
 					Money profit = GetTransportedGoodsIncome(
 						cp->count,
 						/* pay transfer vehicle for only the part of transfer it has done: ie. cargo_loaded_at_xy to here */
@@ -1489,7 +1524,7 @@
 
 	if (route_profit != 0) {
 		front_v->profit_this_year += vehicle_profit;
-		SubtractMoneyFromPlayer(-route_profit);
+		SubtractMoneyFromPlayer(CommandCost(front_v->GetExpenseType(true), -route_profit));
 
 		if (IsLocalPlayer() && !PlayVehicleSound(front_v, VSE_LOAD_UNLOAD)) {
 			SndPlayVehicleFx(SND_14_CASHTILL, front_v);
@@ -1515,7 +1550,7 @@
 
 	/* We have not waited enough time till the next round of loading/unloading */
 	if (--v->load_unload_time_rem != 0) {
-		if (_patches.improved_load && HasBit(v->current_order.flags, OFB_FULL_LOAD)) {
+		if (_patches.improved_load && HasBit(v->current_order.flags, OF_FULL_LOAD)) {
 			/* 'Reserve' this cargo for this vehicle, because we were first. */
 			for (; v != NULL; v = v->Next()) {
 				if (v->cargo_cap != 0) cargo_left[v->cargo_type] -= v->cargo_cap - v->cargo.Count();
@@ -1524,7 +1559,10 @@
 		return;
 	}
 
-	if (v->type == VEH_TRAIN && !IsTileType(v->tile, MP_STATION)) {
+	StationID last_visited = v->last_station_visited;
+	Station *st = GetStation(last_visited);
+
+	if (v->type == VEH_TRAIN && (!IsTileType(v->tile, MP_STATION) || GetStationIndex(v->tile) != st->index)) {
 		/* The train reversed in the station. Take the "easy" way
 		 * out and let the train just leave as it always did. */
 		SetBit(v->vehicle_flags, VF_LOADING_FINISHED);
@@ -1536,7 +1574,7 @@
 	int result = 0;
 	uint cap;
 
-	bool completely_empty  = true;
+	bool completely_emptied = true;
 	bool anything_unloaded = false;
 	bool anything_loaded   = false;
 	uint32 cargo_not_full  = 0;
@@ -1544,9 +1582,6 @@
 
 	v->cur_speed = 0;
 
-	StationID last_visited = v->last_station_visited;
-	Station *st = GetStation(last_visited);
-
 	for (; v != NULL; v = v->Next()) {
 		if (v->cargo_cap == 0) continue;
 
@@ -1563,12 +1598,12 @@
 			uint amount_unloaded = _patches.gradual_loading ? min(cargo_count, load_amount) : cargo_count;
 			bool remaining; // Are there cargo entities in this vehicle that can still be unloaded here?
 
-			if (HasBit(ge->acceptance_pickup, GoodsEntry::ACCEPTANCE) && !(u->current_order.flags & OF_TRANSFER)) {
+			if (HasBit(ge->acceptance_pickup, GoodsEntry::ACCEPTANCE) && !(u->current_order.flags & OFB_TRANSFER)) {
 				/* The cargo has reached it's final destination, the packets may now be destroyed */
 				remaining = v->cargo.MoveTo(NULL, amount_unloaded, CargoList::MTA_FINAL_DELIVERY, last_visited);
 
 				result |= 1;
-			} else if (u->current_order.flags & (OF_UNLOAD | OF_TRANSFER)) {
+			} else if (u->current_order.flags & (OFB_UNLOAD | OFB_TRANSFER)) {
 				remaining = v->cargo.MoveTo(&ge->cargo, amount_unloaded);
 				SetBit(ge->acceptance_pickup, GoodsEntry::PICKUP);
 
@@ -1587,7 +1622,7 @@
 
 			anything_unloaded = true;
 			if (_patches.gradual_loading && remaining) {
-				completely_empty = false;
+				completely_emptied = false;
 			} else {
 				/* We have finished unloading (cargo count == 0) */
 				ClrBit(v->vehicle_flags, VF_CARGO_UNLOADING);
@@ -1597,7 +1632,7 @@
 		}
 
 		/* Do not pick up goods that we unloaded */
-		if (u->current_order.flags & OF_UNLOAD) continue;
+		if (u->current_order.flags & OFB_UNLOAD) continue;
 
 		/* update stats */
 		int t;
@@ -1640,9 +1675,9 @@
 			 * loading them. Since this will cause
 			 * VEHICLE_TRIGGER_EMPTY to be called at the time when
 			 * the whole vehicle chain is really totally empty, the
-			 * completely_empty assignment can then be safely
+			 * completely_emptied assignment can then be safely
 			 * removed; that's how TTDPatch behaves too. --pasky */
-			completely_empty = false;
+			completely_emptied = false;
 			anything_loaded = true;
 
 			ge->cargo.MoveTo(&v->cargo, cap, CargoList::MTA_CARGO_LOAD, st->xy);
@@ -1662,11 +1697,14 @@
 		}
 	}
 
+	/* Only set completly_emptied, if we just unloaded all remaining cargo */
+	completely_emptied &= anything_unloaded;
+
 	/* We update these variables here, so gradual loading still fills
 	 * all wagons at the same time instead of using the same 'improved'
 	 * loading algorithm for the wagons (only fill wagon when there is
 	 * enough to fill the previous wagons) */
-	if (_patches.improved_load && HasBit(u->current_order.flags, OFB_FULL_LOAD)) {
+	if (_patches.improved_load && HasBit(u->current_order.flags, OF_FULL_LOAD)) {
 		/* Update left cargo */
 		for (v = u; v != NULL; v = v->Next()) {
 			if (v->cargo_cap != 0) cargo_left[v->cargo_type] -= v->cargo_cap - v->cargo.Count();
@@ -1685,7 +1723,7 @@
 		}
 	} else {
 		bool finished_loading = true;
-		if (HasBit(v->current_order.flags, OFB_FULL_LOAD)) {
+		if (HasBit(v->current_order.flags, OF_FULL_LOAD)) {
 			if (_patches.full_load_any) {
 				/* if the aircraft carries passengers and is NOT full, then
 				 * continue loading, no matter how much mail is in */
@@ -1729,7 +1767,7 @@
 
 	v->load_unload_time_rem = unloading_time;
 
-	if (completely_empty) {
+	if (completely_emptied) {
 		TriggerVehicle(v, VEHICLE_TRIGGER_EMPTY);
 	}
 
@@ -1798,9 +1836,8 @@
 	PlayerID old_player = _current_player;
 	for (i = 0; i != 4; i++) {
 		if (p->share_owners[i] != PLAYER_SPECTATOR) {
-			SET_EXPENSES_TYPE(EXPENSES_OTHER);
 			_current_player = p->share_owners[i];
-			SubtractMoneyFromPlayer(CommandCost(-value));
+			SubtractMoneyFromPlayer(CommandCost(EXPENSES_OTHER, -value));
 		}
 	}
 	_current_player = old_player;
@@ -1822,7 +1859,7 @@
 CommandCost CmdBuyShareInCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	Player *p;
-	CommandCost cost;
+	CommandCost cost(EXPENSES_OTHER);
 
 	/* Check if buying shares is allowed (protection against modified clients) */
 	/* Cannot buy own shares */
@@ -1833,8 +1870,6 @@
 	/* Cannot buy shares of non-existent nor bankrupted company */
 	if (!p->is_active) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_OTHER);
-
 	/* Protect new companies from hostile takeovers */
 	if (_cur_year - p->inaugurated_year < 6) return_cmd_error(STR_7080_PROTECTED);
 
@@ -1884,8 +1919,6 @@
 	/* Cannot sell shares of non-existent nor bankrupted company */
 	if (!p->is_active) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_OTHER);
-
 	/* Those lines are here for network-protection (clients can be slow) */
 	if (GetAmountOwnedBy(p, _current_player) == 0) return CommandCost();
 
@@ -1899,7 +1932,7 @@
 		*b = PLAYER_SPECTATOR;
 		InvalidateWindow(WC_COMPANY, p1);
 	}
-	return CommandCost(cost);
+	return CommandCost(EXPENSES_OTHER, cost);
 }
 
 /** Buy up another company.
@@ -1922,7 +1955,6 @@
 	/* Do not allow players to take over themselves */
 	if (pid == _current_player) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_OTHER);
 	p = GetPlayer(pid);
 
 	if (!p->is_ai) return CMD_ERROR;
@@ -1930,7 +1962,7 @@
 	if (flags & DC_EXEC) {
 		DoAcquireCompany(p);
 	}
-	return CommandCost(p->bankrupt_value);
+	return CommandCost(EXPENSES_OTHER, p->bankrupt_value);
 }
 
 /** Prices */
--- a/src/economy.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/* $Id$ */
-
-/** @file economy.h */
-
-#ifndef ECONOMY_H
-#define ECONOMY_H
-
-void ResetPriceBaseMultipliers();
-void SetPriceBaseMultiplier(uint price, byte factor);
-
-struct Economy {
-	Money max_loan;         ///< Maximum possible loan
-	Money max_loan_unround; ///< Economy fluctuation status
-	uint16 max_loan_unround_fract; ///< Fraction of the unrounded max loan
-	int fluct;
-	byte interest_rate;     ///< Interest
-	byte infl_amount;       ///< inflation amount
-	byte infl_amount_pr;    ///< "floating" portion of inflation
-};
-
-VARDEF Economy _economy;
-
-struct Subsidy {
-	CargoID cargo_type;
-	byte age;
-	/* from and to can either be TownID, StationID or IndustryID */
-	uint16 from;
-	uint16 to;
-};
-
-
-enum ScoreID {
-	SCORE_BEGIN      = 0,
-	SCORE_VEHICLES   = 0,
-	SCORE_STATIONS   = 1,
-	SCORE_MIN_PROFIT = 2,
-	SCORE_MIN_INCOME = 3,
-	SCORE_MAX_INCOME = 4,
-	SCORE_DELIVERED  = 5,
-	SCORE_CARGO      = 6,
-	SCORE_MONEY      = 7,
-	SCORE_LOAN       = 8,
-	SCORE_TOTAL      = 9,  ///< This must always be the last entry
-	SCORE_END        = 10, ///< How many scores are there..
-
-	SCORE_MAX = 1000       ///< The max score that can be in the performance history
-	/* the scores together of score_info is allowed to be more! */
-};
-
-DECLARE_POSTFIX_INCREMENT(ScoreID);
-
-struct ScoreInfo {
-	byte id;    ///< Unique ID of the score
-	int needed; ///< How much you need to get the perfect score
-	int score;  ///< How much score it will give
-};
-
-extern const ScoreInfo _score_info[];
-extern int _score_part[MAX_PLAYERS][SCORE_END];
-
-int UpdateCompanyRatingAndValue(Player *p, bool update);
-
-VARDEF Subsidy _subsidies[MAX_PLAYERS];
-Pair SetupSubsidyDecodeParam(const Subsidy *s, bool mode);
-void DeleteSubsidyWithTown(TownID index);
-void DeleteSubsidyWithIndustry(IndustryID index);
-void DeleteSubsidyWithStation(StationID index);
-
-Money GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, CargoID cargo_type);
-uint MoveGoodsToStation(TileIndex tile, int w, int h, CargoID type, uint amount);
-
-void VehiclePayment(Vehicle *front_v);
-void LoadUnloadStation(Station *st);
-
-#endif /* ECONOMY_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/economy_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,44 @@
+/* $Id$ */
+
+/** @file economy_func.h Functions related to the economy. */
+
+#ifndef ECONOMY_FUNC_H
+#define ECONOMY_FUNC_H
+
+#include "core/geometry_type.hpp"
+#include "economy_type.h"
+#include "cargo_type.h"
+#include "vehicle_type.h"
+#include "tile_type.h"
+#include "town_type.h"
+#include "industry_type.h"
+#include "player_type.h"
+
+struct Player;
+
+void ResetPriceBaseMultipliers();
+void SetPriceBaseMultiplier(uint price, byte factor);
+
+extern const ScoreInfo _score_info[];
+extern int _score_part[MAX_PLAYERS][SCORE_END];
+extern Economy _economy;
+extern Subsidy _subsidies[MAX_PLAYERS];
+/* Prices and also the fractional part. */
+extern Prices _price;
+extern uint16 _price_frac[NUM_PRICES];
+extern Money  _cargo_payment_rates[NUM_CARGO];
+extern uint16 _cargo_payment_rates_frac[NUM_CARGO];
+
+int UpdateCompanyRatingAndValue(Player *p, bool update);
+Pair SetupSubsidyDecodeParam(const Subsidy *s, bool mode);
+void DeleteSubsidyWithTown(TownID index);
+void DeleteSubsidyWithIndustry(IndustryID index);
+void DeleteSubsidyWithStation(StationID index);
+
+Money GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, CargoID cargo_type);
+uint MoveGoodsToStation(TileIndex tile, int w, int h, CargoID type, uint amount);
+
+void VehiclePayment(Vehicle *front_v);
+void LoadUnloadStation(Station *st);
+
+#endif /* ECONOMY_FUNC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/economy_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,136 @@
+/* $Id$ */
+
+/** @file economy_type.h Types related to the economy. */
+
+#ifndef ECONOMY_TYPE_H
+#define ECONOMY_TYPE_H
+
+#include "core/overflowsafe_type.hpp"
+#include "core/enum_type.hpp"
+#include "cargo_type.h"
+
+typedef OverflowSafeInt64 Money;
+
+struct Economy {
+	Money max_loan;         ///< Maximum possible loan
+	Money max_loan_unround; ///< Economy fluctuation status
+	uint16 max_loan_unround_fract; ///< Fraction of the unrounded max loan
+	int fluct;
+	byte interest_rate;     ///< Interest
+	byte infl_amount;       ///< inflation amount
+	byte infl_amount_pr;    ///< "floating" portion of inflation
+};
+
+struct Subsidy {
+	CargoID cargo_type;
+	byte age;
+	/* from and to can either be TownID, StationID or IndustryID */
+	uint16 from;
+	uint16 to;
+};
+
+enum ScoreID {
+	SCORE_BEGIN      = 0,
+	SCORE_VEHICLES   = 0,
+	SCORE_STATIONS   = 1,
+	SCORE_MIN_PROFIT = 2,
+	SCORE_MIN_INCOME = 3,
+	SCORE_MAX_INCOME = 4,
+	SCORE_DELIVERED  = 5,
+	SCORE_CARGO      = 6,
+	SCORE_MONEY      = 7,
+	SCORE_LOAN       = 8,
+	SCORE_TOTAL      = 9,  ///< This must always be the last entry
+	SCORE_END        = 10, ///< How many scores are there..
+
+	SCORE_MAX = 1000       ///< The max score that can be in the performance history
+	/* the scores together of score_info is allowed to be more! */
+};
+DECLARE_POSTFIX_INCREMENT(ScoreID);
+
+struct ScoreInfo {
+	byte id;    ///< Unique ID of the score
+	int needed; ///< How much you need to get the perfect score
+	int score;  ///< How much score it will give
+};
+
+struct Prices {
+	Money station_value;
+	Money build_rail;
+	Money build_road;
+	Money build_signals;
+	Money build_bridge;
+	Money build_train_depot;
+	Money build_road_depot;
+	Money build_ship_depot;
+	Money build_tunnel;
+	Money train_station_track;
+	Money train_station_length;
+	Money build_airport;
+	Money build_bus_station;
+	Money build_truck_station;
+	Money build_dock;
+	Money build_railvehicle;
+	Money build_railwagon;
+	Money aircraft_base;
+	Money roadveh_base;
+	Money ship_base;
+	Money build_trees;
+	Money terraform;
+	Money clear_grass;
+	Money clear_roughland;
+	Money clear_rocks;
+	Money clear_fields;
+	Money remove_trees;
+	Money remove_rail;
+	Money remove_signals;
+	Money clear_bridge;
+	Money remove_train_depot;
+	Money remove_road_depot;
+	Money remove_ship_depot;
+	Money clear_tunnel;
+	Money clear_water;
+	Money remove_rail_station;
+	Money remove_airport;
+	Money remove_bus_station;
+	Money remove_truck_station;
+	Money remove_dock;
+	Money remove_house;
+	Money remove_road;
+	Money running_rail[3];
+	Money aircraft_running;
+	Money roadveh_running;
+	Money ship_running;
+	Money build_industry;
+};
+
+enum {
+	NUM_PRICES = 49,
+};
+
+assert_compile(NUM_PRICES * sizeof(Money) == sizeof(Prices));
+
+enum ExpensesType {
+	EXPENSES_CONSTRUCTION =  0,
+	EXPENSES_NEW_VEHICLES =  1,
+	EXPENSES_TRAIN_RUN    =  2,
+	EXPENSES_ROADVEH_RUN  =  3,
+	EXPENSES_AIRCRAFT_RUN =  4,
+	EXPENSES_SHIP_RUN     =  5,
+	EXPENSES_PROPERTY     =  6,
+	EXPENSES_TRAIN_INC    =  7,
+	EXPENSES_ROADVEH_INC  =  8,
+	EXPENSES_AIRCRAFT_INC =  9,
+	EXPENSES_SHIP_INC     = 10,
+	EXPENSES_LOAN_INT     = 11,
+	EXPENSES_OTHER        = 12,
+	INVALID_EXPENSES      = 0xFF,
+};
+
+/* The "steps" in loan size, in British Pounds! */
+enum {
+	LOAN_INTERVAL        = 10000,
+	LOAN_INTERVAL_OLD_AI = 50000,
+};
+
+#endif /* ECONOMY_TYPE_H */
--- a/src/elrail.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/elrail.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -48,24 +48,25 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "station_map.h"
-#include "tile.h"
-#include "viewport.h"
-#include "functions.h" /* We should REALLY get rid of this goddamn file, as it is butt-ugly */
-#include "variables.h" /* ... same here */
+#include "viewport_func.h"
+#include "settings_type.h"
 #include "landscape.h"
-#include "rail.h"
+#include "rail_type.h"
 #include "debug.h"
 #include "tunnel_map.h"
 #include "road_map.h"
 #include "bridge_map.h"
 #include "bridge.h"
 #include "rail_map.h"
+#include "train.h"
+#include "rail_gui.h"
+#include "transparency.h"
+#include "tunnelbridge_map.h"
+#include "vehicle_func.h"
+#include "player_base.h"
+
 #include "table/sprites.h"
 #include "table/elrail_data.h"
-#include "vehicle.h"
-#include "train.h"
-#include "gui.h"
-#include "transparency.h"
 
 static inline TLG GetTLG(TileIndex t)
 {
@@ -91,17 +92,11 @@
 			break;
 
 		case MP_TUNNELBRIDGE:
-			if (IsTunnel(t)) {
-				if (GetRailType(t) != RAILTYPE_ELECTRIC) return TRACK_BIT_NONE;
-				if (override != NULL) *override = 1 << GetTunnelDirection(t);
-				return AxisToTrackBits(DiagDirToAxis(GetTunnelDirection(t)));
-			} else {
-				if (GetRailType(t) != RAILTYPE_ELECTRIC) return TRACK_BIT_NONE;
-				if (override != NULL && DistanceMax(t, GetOtherBridgeEnd(t)) > 1) {
-					*override = 1 << GetBridgeRampDirection(t);
-				}
-				return AxisToTrackBits(DiagDirToAxis(GetBridgeRampDirection(t)));
+			if (GetRailType(t) != RAILTYPE_ELECTRIC) return TRACK_BIT_NONE;
+			if (override != NULL && (IsTunnel(t) || DistanceMax(t, GetOtherBridgeEnd(t)) > 1)) {
+				*override = 1 << GetTunnelBridgeDirection(t);
 			}
+			return AxisToTrackBits(DiagDirToAxis(GetTunnelBridgeDirection(t)));
 
 		case MP_ROAD:
 			if (GetRoadTileType(t) != ROAD_TILE_CROSSING) return TRACK_BIT_NONE;
@@ -131,7 +126,7 @@
 		} else if (*tileh != SLOPE_FLAT) {
 			*tileh = SLOPE_FLAT;
 		} else {
-			switch (GetBridgeRampDirection(tile)) {
+			switch (GetTunnelBridgeDirection(tile)) {
 				case DIAGDIR_NE: *tileh = SLOPE_NE; break;
 				case DIAGDIR_SE: *tileh = SLOPE_SE; break;
 				case DIAGDIR_SW: *tileh = SLOPE_SW; break;
@@ -188,7 +183,7 @@
 
 	if ((GetRailType(ti->tile) != RAILTYPE_ELECTRIC) || _patches.disable_elrails) return;
 
-	DiagDirection dir = GetTunnelDirection(ti->tile);
+	DiagDirection dir = GetTunnelBridgeDirection(ti->tile);
 
 	const SortableSpriteStruct *sss = &CatenarySpriteData_Tunnel[dir];
 	const int *BB_data = _tunnel_wire_BB[dir];
@@ -247,7 +242,7 @@
 		 * existing foundataions, so we do have to do that manually later on.*/
 		tileh[TS_NEIGHBOUR] = GetTileSlope(neighbour, NULL);
 		trackconfig[TS_NEIGHBOUR] = GetRailTrackBitsUniversal(neighbour, NULL);
-		if (IsTunnelTile(neighbour) && i != GetTunnelDirection(neighbour)) trackconfig[TS_NEIGHBOUR] = TRACK_BIT_NONE;
+		if (IsTunnelTile(neighbour) && i != GetTunnelBridgeDirection(neighbour)) trackconfig[TS_NEIGHBOUR] = TRACK_BIT_NONE;
 
 		/* If the neighboured tile does not smoothly connect to the current tile (because of a foundation),
 		 * we have to draw all pillars on the current tile. */
@@ -264,7 +259,7 @@
 			/* Next to us, we have a bridge head, don't worry about that one, if it shows away from us */
 			if (TrackSourceTile[i][k] == TS_NEIGHBOUR &&
 			    IsBridgeTile(neighbour) &&
-			    GetBridgeRampDirection(neighbour) == ReverseDiagDir(i)) {
+			    GetTunnelBridgeDirection(neighbour) == ReverseDiagDir(i)) {
 				continue;
 			}
 
@@ -291,7 +286,7 @@
 		/* Read the foundataions if they are present, and adjust the tileh */
 		if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE && IsTileType(neighbour, MP_RAILWAY) && GetRailType(neighbour) == RAILTYPE_ELECTRIC) foundation = GetRailFoundation(tileh[TS_NEIGHBOUR], trackconfig[TS_NEIGHBOUR]);
 		if (IsBridgeTile(neighbour)) {
-			foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], DiagDirToAxis(GetBridgeRampDirection(neighbour)));
+			foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], DiagDirToAxis(GetTunnelBridgeDirection(neighbour)));
 		}
 
 		ApplyFoundationToSlope(foundation, &tileh[TS_NEIGHBOUR]);
@@ -443,7 +438,7 @@
 	if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile)) {
 		TileIndex head = GetNorthernBridgeEnd(ti->tile);
 
-		if (GetBridgeTransportType(head) == TRANSPORT_RAIL && GetRailType(head) == RAILTYPE_ELECTRIC) {
+		if (GetTunnelBridgeTransportType(head) == TRANSPORT_RAIL && GetRailType(head) == RAILTYPE_ELECTRIC) {
 			DrawCatenaryOnBridge(ti);
 		}
 	}
@@ -502,7 +497,7 @@
 			if (v->type == VEH_TRAIN && v->u.rail.railtype == RAILTYPE_ELECTRIC) {
 				/* this railroad vehicle is now compatible only with elrail,
 				*  so add there also normal rail compatibility */
-				v->u.rail.compatible_railtypes |= (1 << RAILTYPE_RAIL);
+				v->u.rail.compatible_railtypes |= RAILTYPES_RAIL;
 				v->u.rail.railtype = RAILTYPE_RAIL;
 				SetBit(v->u.rail.flags, VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL);
 			}
--- a/src/engine.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/engine.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,26 +5,32 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "table/strings.h"
 #include "engine.h"
-#include "gfx.h"
-#include "player.h"
-#include "command.h"
-#include "vehicle.h"
+#include "player_base.h"
+#include "player_func.h"
+#include "command_func.h"
 #include "news.h"
 #include "saveload.h"
 #include "variables.h"
 #include "train.h"
 #include "aircraft.h"
 #include "newgrf_cargo.h"
-#include "date.h"
-#include "table/engines.h"
 #include "group.h"
-#include "string.h"
-#include "strings.h"
 #include "misc/autoptr.hpp"
+#include "strings_func.h"
+#include "gfx_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "autoreplace_base.h"
+#include "autoreplace_gui.h"
+#include "string_func.h"
+#include "settings_type.h"
 
+#include "table/strings.h"
+#include "table/engines.h"
+
+Engine _engines[TOTAL_NUM_ENGINES];
 EngineInfo _engine_info[TOTAL_NUM_ENGINES];
 RailVehicleInfo _rail_vehicle_info[NUM_TRAIN_ENGINES];
 ShipVehicleInfo _ship_vehicle_info[NUM_SHIP_ENGINES];
@@ -36,17 +42,38 @@
 };
 
 
+void SetupEngines()
+{
+	/* Copy original static engine data */
+	memcpy(&_engine_info, &_orig_engine_info, sizeof(_orig_engine_info));
+	memcpy(&_rail_vehicle_info, &_orig_rail_vehicle_info, sizeof(_orig_rail_vehicle_info));
+	memcpy(&_ship_vehicle_info, &_orig_ship_vehicle_info, sizeof(_orig_ship_vehicle_info));
+	memcpy(&_aircraft_vehicle_info, &_orig_aircraft_vehicle_info, sizeof(_orig_aircraft_vehicle_info));
+	memcpy(&_road_vehicle_info, &_orig_road_vehicle_info, sizeof(_orig_road_vehicle_info));
+
+	/* Add type to engines */
+	Engine* e = _engines;
+	do e->type = VEH_TRAIN;    while (++e < &_engines[ROAD_ENGINES_INDEX]);
+	do e->type = VEH_ROAD;     while (++e < &_engines[SHIP_ENGINES_INDEX]);
+	do e->type = VEH_SHIP;     while (++e < &_engines[AIRCRAFT_ENGINES_INDEX]);
+	do e->type = VEH_AIRCRAFT; while (++e < &_engines[TOTAL_NUM_ENGINES]);
+
+	/* Set up default engine names */
+	for (EngineID engine = 0; engine < TOTAL_NUM_ENGINES; engine++) {
+		EngineInfo *ei = &_engine_info[engine];
+		ei->string_id = STR_8000_KIRBY_PAUL_TANK_STEAM + engine;
+	}
+}
+
+
 void ShowEnginePreviewWindow(EngineID engine);
 
 void DeleteCustomEngineNames()
 {
-	uint i;
-	StringID old;
-
-	for (i = 0; i != TOTAL_NUM_ENGINES; i++) {
-		old = _engine_name_strings[i];
-		_engine_name_strings[i] = i + STR_8000_KIRBY_PAUL_TANK_STEAM;
-		DeleteName(old);
+	Engine *e;
+	FOR_ALL_ENGINES(e) {
+		free(e->name);
+		e->name = NULL;
 	}
 
 	_vehicle_design_names &= ~1;
@@ -58,18 +85,6 @@
 	DEBUG(misc, 1, "LoadCustomEngineNames: not done");
 }
 
-static void SetupEngineNames()
-{
-	StringID *name;
-
-	for (name = _engine_name_strings; name != endof(_engine_name_strings); name++)
-		*name = STR_SV_EMPTY;
-
-	DeleteCustomEngineNames();
-	LoadCustomEngineNames();
-}
-
-
 static void CalcEngineReliability(Engine *e)
 {
 	uint age = e->age;
@@ -106,16 +121,6 @@
 	InvalidateWindowClasses(WC_REPLACE_VEHICLE);
 }
 
-void AddTypeToEngines()
-{
-	Engine* e = _engines;
-
-	do e->type = VEH_TRAIN;    while (++e < &_engines[ROAD_ENGINES_INDEX]);
-	do e->type = VEH_ROAD;     while (++e < &_engines[SHIP_ENGINES_INDEX]);
-	do e->type = VEH_SHIP;     while (++e < &_engines[AIRCRAFT_ENGINES_INDEX]);
-	do e->type = VEH_AIRCRAFT; while (++e < &_engines[TOTAL_NUM_ENGINES]);
-}
-
 void StartupEngines()
 {
 	Engine *e;
@@ -123,8 +128,6 @@
 	/* Aging of vehicles stops, so account for that when starting late */
 	const Date aging_date = min(_date, ConvertYMDToDate(YEAR_ENGINE_AGING_STOPS, 0, 1));
 
-	SetupEngineNames();
-
 	for (e = _engines, ei = _engine_info; e != endof(_engines); e++, ei++) {
 		uint32 r;
 
@@ -327,15 +330,14 @@
 	/* Do not introduce new rail wagons */
 	if (IsWagon(index)) return;
 
-	if (index < NUM_TRAIN_ENGINES) {
+	if (e->type == VEH_TRAIN) {
 		/* maybe make another rail type available */
 		RailType railtype = RailVehInfo(index)->railtype;
 		assert(railtype < RAILTYPE_END);
 		FOR_ALL_PLAYERS(p) {
 			if (p->is_active) SetBit(p->avail_railtypes, railtype);
 		}
-	}
-	if ((index - NUM_TRAIN_ENGINES) < NUM_ROAD_ENGINES) {
+	} else if (e->type == VEH_ROAD) {
 		/* maybe make another road type available */
 		FOR_ALL_PLAYERS(p) {
 			if (p->is_active) SetBit(p->avail_roadtypes, HasBit(EngInfo(index)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD);
@@ -392,23 +394,16 @@
  */
 CommandCost CmdRenameEngine(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	StringID str;
-
 	if (!IsEngineIndex(p1) || StrEmpty(_cmd_text)) return CMD_ERROR;
 
 	if (!IsUniqueEngineName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
 
-	str = AllocateName(_cmd_text, 0);
-	if (str == 0) return CMD_ERROR;
-
 	if (flags & DC_EXEC) {
-		StringID old_str = _engine_name_strings[p1];
-		_engine_name_strings[p1] = str;
-		DeleteName(old_str);
+		Engine *e = GetEngine(p1);
+		free(e->name);
+		e->name = strdup(_cmd_text);
 		_vehicle_design_names |= 3;
 		MarkWholeScreenDirty();
-	} else {
-		DeleteName(str);
 	}
 
 	return CommandCost();
@@ -512,6 +507,10 @@
 EngineID EngineReplacement(EngineRenewList erl, EngineID engine, GroupID group)
 {
 	const EngineRenew *er = GetEngineReplacement(erl, engine, group);
+	if (er == NULL && (group == DEFAULT_GROUP || (IsValidGroupID(group) && !GetGroup(group)->replace_protection))) {
+		/* We didn't find anything useful in the vehicle's own group so we will try ALL_GROUP */
+		er = GetEngineReplacement(erl, engine, ALL_GROUP);
+	}
 	return er == NULL ? INVALID_ENGINE : er->to;
 }
 
@@ -627,6 +626,7 @@
 	    SLE_VAR(Engine, preview_wait,        SLE_UINT8),
 	SLE_CONDNULL(1, 0, 44),
 	    SLE_VAR(Engine, player_avail,        SLE_UINT8),
+	SLE_CONDSTR(Engine, name,                SLE_STR, 0,                 84, SL_MAX_VERSION),
 
 	/* reserve extra space in savegame here. (currently 16 bytes) */
 	SLE_CONDNULL(16, 2, SL_MAX_VERSION),
@@ -652,14 +652,21 @@
 	}
 }
 
-static void LoadSave_ENGS()
+static void Load_ENGS()
 {
-	SlArray(_engine_name_strings, lengthof(_engine_name_strings), SLE_STRINGID);
+	StringID names[TOTAL_NUM_ENGINES];
+
+	SlArray(names, lengthof(names), SLE_STRINGID);
+
+	for (EngineID engine = 0; engine < lengthof(names); engine++) {
+		Engine *e = GetEngine(engine);
+		e->name = CopyFromOldName(names[engine]);
+	}
 }
 
 extern const ChunkHandler _engine_chunk_handlers[] = {
 	{ 'ENGN', Save_ENGN,     Load_ENGN,     CH_ARRAY          },
-	{ 'ENGS', LoadSave_ENGS, LoadSave_ENGS, CH_RIFF           },
+	{ 'ENGS', NULL,          Load_ENGS,     CH_RIFF           },
 	{ 'ERNW', Save_ERNW,     Load_ERNW,     CH_ARRAY | CH_LAST},
 };
 
@@ -668,4 +675,10 @@
 	/* Clean the engine renew pool and create 1 block in it */
 	_EngineRenew_pool.CleanPool();
 	_EngineRenew_pool.AddBlockToPool();
+
+	Engine *e;
+	FOR_ALL_ENGINES(e) {
+		free(e->name);
+		e->name = NULL;
+	}
 }
--- a/src/engine.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/engine.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,10 +5,14 @@
 #ifndef ENGINE_H
 #define ENGINE_H
 
-#include "oldpool.h"
-#include "rail.h"
-#include "sound.h"
-#include "vehicle.h"
+#include "rail_type.h"
+#include "cargo_type.h"
+#include "vehicle_type.h"
+#include "gfx_type.h"
+#include "date_type.h"
+#include "sound_type.h"
+#include "player_type.h"
+#include "strings_type.h"
 
 enum RailVehicleTypes {
 	RAILVEH_SINGLEHEAD,  ///< indicates a "standalone" locomotive
@@ -107,9 +111,11 @@
 	byte misc_flags;
 	byte callbackmask;
 	byte retire_early; ///< Number of years early to retire vehicle
+	StringID string_id; ///< Default name of engine
 };
 
 struct Engine {
+	char *name;         ///< Custom name of engine
 	Date intro_date;
 	Date age;
 	uint16 reliability;
@@ -121,7 +127,7 @@
 	PlayerByte preview_player;
 	byte preview_wait;
 	byte player_avail;
-	VehicleType type; ///< type, ie VEH_ROAD, VEH_TRAIN, etc. Same as in vehicle.h
+	VehicleType type; ///< type, ie VEH_ROAD, VEH_TRAIN, etc.
 };
 
 /**
@@ -150,7 +156,7 @@
 static const EngineID INVALID_ENGINE = 0xFFFF;
 
 
-void AddTypeToEngines();
+void SetupEngines();
 void StartupEngines();
 
 
@@ -197,7 +203,7 @@
 	return end[type];
 }
 
-VARDEF Engine _engines[TOTAL_NUM_ENGINES];
+extern Engine _engines[TOTAL_NUM_ENGINES];
 #define FOR_ALL_ENGINES(e) for (e = _engines; e != endof(_engines); e++)
 #define FOR_ALL_ENGINEIDS_OF_TYPE(e, type) for (e = GetFirstEngineOfType(type); e != GetLastEngineOfType(type); e++)
 
@@ -208,20 +214,17 @@
 	return &_engines[i];
 }
 
-VARDEF StringID _engine_name_strings[TOTAL_NUM_ENGINES];
-
 static inline bool IsEngineIndex(uint index)
 {
 	return index < TOTAL_NUM_ENGINES;
 }
 
 /* Access Vehicle Data */
-//#include "table/engines.h"
-extern const EngineInfo orig_engine_info[TOTAL_NUM_ENGINES];
-extern const RailVehicleInfo orig_rail_vehicle_info[NUM_TRAIN_ENGINES];
-extern const ShipVehicleInfo orig_ship_vehicle_info[NUM_SHIP_ENGINES];
-extern const AircraftVehicleInfo orig_aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES];
-extern const RoadVehicleInfo orig_road_vehicle_info[NUM_ROAD_ENGINES];
+extern const EngineInfo _orig_engine_info[TOTAL_NUM_ENGINES];
+extern const RailVehicleInfo _orig_rail_vehicle_info[NUM_TRAIN_ENGINES];
+extern const ShipVehicleInfo _orig_ship_vehicle_info[NUM_SHIP_ENGINES];
+extern const AircraftVehicleInfo _orig_aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES];
+extern const RoadVehicleInfo _orig_road_vehicle_info[NUM_ROAD_ENGINES];
 
 extern EngineInfo _engine_info[TOTAL_NUM_ENGINES];
 extern RailVehicleInfo _rail_vehicle_info[NUM_TRAIN_ENGINES];
@@ -259,84 +262,6 @@
 	return &_road_vehicle_info[e - ROAD_ENGINES_INDEX];
 }
 
-/************************************************************************
- * Engine Replacement stuff
- ************************************************************************/
-
-struct EngineRenew;
-/**
- * Memory pool for engine renew elements. DO NOT USE outside of engine.c. Is
- * placed here so the only exception to this rule, the saveload code, can use
- * it.
- */
-DECLARE_OLD_POOL(EngineRenew, EngineRenew, 3, 8000)
-
-/**
- * Struct to store engine replacements. DO NOT USE outside of engine.c. Is
- * placed here so the only exception to this rule, the saveload code, can use
- * it.
- */
-struct EngineRenew : PoolItem<EngineRenew, EngineRenewID, &_EngineRenew_pool> {
-	EngineID from;
-	EngineID to;
-	EngineRenew *next;
-	GroupID group_id;
-
-	EngineRenew(EngineID from = INVALID_ENGINE, EngineID to = INVALID_ENGINE) : from(from), to(to), next(NULL) {}
-	~EngineRenew() { this->from = INVALID_ENGINE; }
-
-	inline bool IsValid() const { return this->from != INVALID_ENGINE; }
-};
-
-#define FOR_ALL_ENGINE_RENEWS_FROM(er, start) for (er = GetEngineRenew(start); er != NULL; er = (er->index + 1U < GetEngineRenewPoolSize()) ? GetEngineRenew(er->index + 1U) : NULL) if (er->IsValid())
-#define FOR_ALL_ENGINE_RENEWS(er) FOR_ALL_ENGINE_RENEWS_FROM(er, 0)
-
-
-/**
- * A list to group EngineRenew directives together (such as per-player).
- */
-typedef EngineRenew* EngineRenewList;
-
-/**
- * Remove all engine replacement settings for the player.
- * @param  erl The renewlist for a given player.
- * @return The new renewlist for the player.
- */
-void RemoveAllEngineReplacement(EngineRenewList *erl);
-
-/**
- * Retrieve the engine replacement in a given renewlist for an original engine type.
- * @param  erl The renewlist to search in.
- * @param  engine Engine type to be replaced.
- * @return The engine type to replace with, or INVALID_ENGINE if no
- * replacement is in the list.
- */
-EngineID EngineReplacement(EngineRenewList erl, EngineID engine, GroupID group);
-
-/**
- * Add an engine replacement to the given renewlist.
- * @param erl The renewlist to add to.
- * @param old_engine The original engine type.
- * @param new_engine The replacement engine type.
- * @param flags The calling command flags.
- * @return 0 on success, CMD_ERROR on failure.
- */
-CommandCost AddEngineReplacement(EngineRenewList *erl, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags);
-
-/**
- * Remove an engine replacement from a given renewlist.
- * @param erl The renewlist from which to remove the replacement
- * @param engine The original engine type.
- * @param flags The calling command flags.
- * @return 0 on success, CMD_ERROR on failure.
- */
-CommandCost RemoveEngineReplacement(EngineRenewList *erl, EngineID engine, GroupID group, uint32 flags);
-
-/** When an engine is made buildable or is removed from being buildable, add/remove it from the build/autoreplace lists
- * @param type The type of engine
- */
-void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type);
-
 /* Engine list manipulators - current implementation is only C wrapper of CBlobT<EngineID> class (helpers.cpp) */
 void EngList_Create(EngineList *el);            ///< Creates engine list
 void EngList_Destroy(EngineList *el);           ///< Deallocate and destroy engine list
--- a/src/engine_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/engine_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,20 +4,19 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "table/sprites.h"
-#include "functions.h"
-#include "window.h"
 #include "gui.h"
-#include "viewport.h"
-#include "gfx.h"
+#include "window_gui.h"
+#include "gfx_func.h"
 #include "engine.h"
-#include "command.h"
+#include "command_func.h"
+#include "economy_func.h"
 #include "news.h"
 #include "variables.h"
 #include "newgrf_engine.h"
+#include "strings_func.h"
 
+#include "table/strings.h"
+#include "table/sprites.h"
 
 static StringID GetEngineCategoryName(EngineID engine)
 {
--- a/src/fileio.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/fileio.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,12 +5,12 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "fileio.h"
-#include "functions.h"
-#include "string.h"
-#include "macros.h"
 #include "variables.h"
 #include "debug.h"
 #include "fios.h"
+#include "core/alloc_func.hpp"
+#include "core/math_func.hpp"
+#include "string_func.h"
 #ifdef WIN32
 #include <windows.h>
 #else
@@ -33,6 +33,7 @@
 	FILE *handles[MAX_FILE_SLOTS];         ///< array of file handles we can have open
 	byte buffer_start[FIO_BUFFER_SIZE];    ///< local buffer when read from file
 	const char *filenames[MAX_FILE_SLOTS]; ///< array of filenames we (should) have open
+	char *shortnames[MAX_FILE_SLOTS];///< array of short names for spriteloader's use
 #if defined(LIMITED_FDS)
 	uint open_handles;                     ///< current amount of open handles
 	uint usage_count[MAX_FILE_SLOTS];      ///< count how many times this file has been opened
@@ -47,9 +48,9 @@
 	return _fio.pos + (_fio.buffer - _fio.buffer_start) - FIO_BUFFER_SIZE;
 }
 
-const char *FioGetFilename()
+const char *FioGetFilename(uint8 slot)
 {
-	return _fio.filename;
+	return _fio.shortnames[slot];
 }
 
 void FioSeekTo(uint32 pos, int mode)
@@ -131,6 +132,10 @@
 {
 	if (_fio.handles[slot] != NULL) {
 		fclose(_fio.handles[slot]);
+
+		free(_fio.shortnames[slot]);
+		_fio.shortnames[slot] = NULL;
+
 		_fio.handles[slot] = NULL;
 #if defined(LIMITED_FDS)
 		_fio.open_handles--;
@@ -184,6 +189,14 @@
 	FioCloseFile(slot); // if file was opened before, close it
 	_fio.handles[slot] = f;
 	_fio.filenames[slot] = filename;
+
+	/* Store the filename without path and extension */
+	const char *t = strrchr(filename, PATHSEPCHAR);
+	_fio.shortnames[slot] = strdup(t == NULL ? filename : t);
+	char *t2 = strrchr(_fio.shortnames[slot], '.');
+	if (t2 != NULL) *t2 = '\0';
+	strtolower(_fio.shortnames[slot]);
+
 #if defined(LIMITED_FDS)
 	_fio.usage_count[slot] = 0;
 	_fio.open_handles++;
@@ -350,6 +363,12 @@
 		}
 	}
 
+	/* Sometimes a full path is given. To support
+	 * the 'subdirectory' must be 'removed'. */
+	if (f == NULL && subdir != NO_DIRECTORY) {
+		f = FioFOpenFile(filename, mode, NO_DIRECTORY, filesize);
+	}
+
 	return f;
 }
 
@@ -640,7 +659,14 @@
 
 	_searchpaths[SP_PERSONAL_DIR] = strdup(tmp);
 #endif
+
+#if defined(WITH_SHARED_DIR)
+	snprintf(tmp, MAX_PATH, "%s", SHARED_DIR);
+	AppendPathSeparator(tmp, MAX_PATH);
+	_searchpaths[SP_SHARED_DIR] = strdup(tmp);
+#else
 	_searchpaths[SP_SHARED_DIR] = NULL;
+#endif
 
 #if defined(__MORPHOS__) || defined(__AMIGA__)
 	_searchpaths[SP_WORKING_DIR] = NULL;
@@ -758,3 +784,31 @@
 		}
 	}
 }
+
+void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize)
+{
+	FILE *in;
+	byte *mem;
+	size_t len;
+
+	in = fopen(filename, "rb");
+	if (in == NULL) return NULL;
+
+	fseek(in, 0, SEEK_END);
+	len = ftell(in);
+	fseek(in, 0, SEEK_SET);
+	if (len > maxsize || (mem = MallocT<byte>(len + 1)) == NULL) {
+		fclose(in);
+		return NULL;
+	}
+	mem[len] = 0;
+	if (fread(mem, len, 1, in) != 1) {
+		fclose(in);
+		free(mem);
+		return NULL;
+	}
+	fclose(in);
+
+	*lenp = len;
+	return mem;
+}
--- a/src/fileio.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/fileio.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,14 +5,14 @@
 #ifndef FILEIO_H
 #define FILEIO_H
 
-#include "helpers.hpp"
 #include <map>
 #include <string>
+#include "core/enum_type.hpp"
 
 void FioSeekTo(uint32 pos, int mode);
 void FioSeekToFile(uint8 slot, uint32 pos);
 uint32 FioGetPos();
-const char *FioGetFilename();
+const char *FioGetFilename(uint8 slot);
 byte FioReadByte();
 uint16 FioReadWord();
 uint32 FioReadDword();
@@ -113,6 +113,8 @@
 void SanitizeFilename(char *filename);
 void AppendPathSeparator(char *buf, size_t buflen);
 void DeterminePaths(const char *exe);
+void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize);
+bool FileExists(const char *filename);
 
 extern char *_personal_dir; ///< custom directory for personal settings, saves, newgrf, etc.
 
--- a/src/fios.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/fios.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,29 +6,33 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "string.h"
 #include "variables.h"
-#include "functions.h"
 #include "heightmap.h"
-#include "helpers.hpp"
-#include "table/strings.h"
 #include "fios.h"
 #include "fileio.h"
+#include "core/alloc_func.hpp"
+#include "functions.h"
+#include "string_func.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 
 #ifdef WIN32
 # include <tchar.h>
 # include <io.h>
+# define access _taccess
+# define unlink _tunlink
 #else
 # include <unistd.h>
 #endif /* WIN32 */
 
+#include "table/strings.h"
+
 /* Variables to display file lists */
 int _fios_num;
 
 static char *_fios_path;
 static FiosItem *_fios_items;
+SmallFiosItem _file_to_saveload;
 static int _fios_count, _fios_alloc;
 
 /* OS-specific functions are taken from their respective files (win32/unix/os2 .c) */
@@ -200,7 +204,7 @@
 	CloseHandle(hand);
 	return 0;
 #else
-	return access(filename, 0) == 0;
+	return access(OTTD2FS(filename), 0) == 0;
 #endif
 }
 
--- a/src/fios.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/fios.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,8 @@
 #ifndef FIOS_H
 #define FIOS_H
 
+#include "strings_type.h"
+
 enum {
 	/**
 	 * Slot used for the GRF scanning and such. This slot cannot be reused
@@ -23,12 +25,21 @@
 	MAX_FILE_SLOTS = 64
 };
 
-/* Deals with finding savegames */
-struct FiosItem {
-	byte type;
-	uint64 mtime;
-	char title[64];
-	char name[256 - 12 - 64];
+enum SaveLoadDialogMode{
+	SLD_LOAD_GAME,
+	SLD_LOAD_SCENARIO,
+	SLD_SAVE_GAME,
+	SLD_SAVE_SCENARIO,
+	SLD_LOAD_HEIGHTMAP,
+	SLD_NEW_GAME,
+};
+
+/* The different types of files been handled by the system */
+enum FileType {
+	FT_NONE,      ///< nothing to do
+	FT_SAVEGAME,  ///< old or new savegame
+	FT_SCENARIO,  ///< old or new scenario
+	FT_HEIGHTMAP, ///< heightmap file
 };
 
 enum {
@@ -45,10 +56,30 @@
 	FIOS_TYPE_INVALID      = 255,
 };
 
+/* Deals with finding savegames */
+struct FiosItem {
+	byte type;
+	uint64 mtime;
+	char title[64];
+	char name[256 - 12 - 64];
+};
+
+/* Deals with the type of the savegame, independent of extension */
+struct SmallFiosItem {
+	int mode;             ///< savegame/scenario type (old, new)
+	FileType filetype;    ///< what type of file are we dealing with
+	char name[MAX_PATH];  ///< name
+	char title[255];      ///< internal name of the game
+};
+
 /* Variables to display file lists */
 extern FiosItem *_fios_list; ///< defined in misc_gui.cpp
 extern int _fios_num;        ///< defined in fios.cpp, read_only version of _fios_count
-extern int _saveload_mode;   ///< defined in misc_gui.cpp
+extern SmallFiosItem _file_to_saveload;
+extern SaveLoadDialogMode _saveload_mode;   ///< defined in misc_gui.cpp
+
+/* Launch save/load dialog */
+void ShowSaveLoadDialog(SaveLoadDialogMode mode);
 
 /* Get a list of savegames */
 FiosItem *FiosGetSavegameList(int mode);
--- a/src/fontcache.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/fontcache.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,21 +4,19 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
-#include "macros.h"
 #include "debug.h"
+#include "spritecache.h"
+#include "fontcache.h"
+#include "spriteloader/spriteloader.hpp"
+#include "blitter/factory.hpp"
+#include "gfx_func.h"
+#include "core/alloc_func.hpp"
+#include "core/math_func.hpp"
+
 #include "table/sprites.h"
 #include "table/control_codes.h"
-#include "spritecache.h"
-#include "gfx.h"
-#include "string.h"
-#include "fontcache.h"
-#include "helpers.hpp"
-#include "spriteloader/spriteloader.hpp"
-#include "blitter/factory.hpp"
 
 #ifdef WITH_FREETYPE
-
 #include <ft2build.h>
 #include FT_FREETYPE_H
 #include FT_GLYPH_H
@@ -365,7 +363,7 @@
 
 void *AllocateFont(size_t size)
 {
-	return malloc(size);
+	return MallocT<byte>(size);
 }
 
 
--- a/src/fontcache.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/fontcache.h	Tue Jan 22 21:00:30 2008 +0000
@@ -3,6 +3,8 @@
 #ifndef FONTCACHE_H
 #define FONTCACHE_H
 
+#include "gfx_type.h"
+
 /** Get the SpriteID mapped to the given font size and key */
 SpriteID GetUnicodeGlyph(FontSize size, uint32 key);
 
--- a/src/fsmport.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/fsmport.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,7 +5,8 @@
 #ifndef FSMPORT_H
 #define FSMPORT_H
 
-#include "direction.h"
+#include "direction_type.h"
+#include "map_type.h"
 #include "fsmblockmap.h"
 
 struct FSMPortMovingData {
--- a/src/functions.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/functions.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,11 +5,9 @@
 #ifndef FUNCTIONS_H
 #define FUNCTIONS_H
 
-#include "gfx.h"
-#include "viewport.h"
 #include "core/random_func.hpp"
-
-void UpdateTownMaxPass(Town *t);
+#include "command_type.h"
+#include "tile_cmd.h"
 
 /* clear_land.cpp */
 void DrawHillyLandTile(const TileInfo *ti);
@@ -24,25 +22,12 @@
 bool CheckOwnership(Owner owner);
 bool CheckTileOwnership(TileIndex tile);
 
-/* standard */
-void ShowInfo(const char *str);
-void CDECL ShowInfoF(const char *str, ...);
-
-/* openttd.cpp */
-static inline TileIndex RandomTileSeed(uint32 r) { return TILE_MASK(r); }
-static inline TileIndex RandomTile() { return TILE_MASK(Random()); }
-
 /* texteff.cpp */
 void AddAnimatedTile(TileIndex tile);
 void DeleteAnimatedTile(TileIndex tile);
 void AnimateAnimatedTiles();
 void InitializeAnimatedTiles();
 
-/* tunnelbridge_cmd.cpp */
-bool CheckBridge_Stuff(byte bridge_type, uint bridge_len);
-uint32 GetBridgeLength(TileIndex begin, TileIndex end);
-int CalcBridgeLenCostFactor(int x);
-
 /* misc_cmd.cpp */
 void PlaceTreesRandomly();
 
@@ -50,12 +35,7 @@
 
 /* misc.cpp */
 bool IsCustomName(StringID id);
-void DeleteName(StringID id);
-char *GetName(char *buff, StringID id, const char *last);
-
-#define AllocateName(name, skip) RealAllocateName(name, skip, false)
-StringID RealAllocateName(const char *name, byte skip, bool check_double);
-void ConvertNameArray();
+char *CopyFromOldName(StringID id);
 
 /* misc functions */
 /**
@@ -71,23 +51,6 @@
  * @ingroup dirty
  */
 void MarkTileDirtyByTile(TileIndex tile);
-void InvalidateWindow(WindowClass cls, WindowNumber number);
-void InvalidateWindowWidget(WindowClass cls, WindowNumber number, byte widget_index);
-void InvalidateWindowClasses(WindowClass cls);
-void InvalidateWindowClassesData(WindowClass cls);
-void DeleteWindowById(WindowClass cls, WindowNumber number);
-void DeleteWindowByClass(WindowClass cls);
-
-void SetObjectToPlaceWnd(CursorID icon, SpriteID pal, ViewportHighlightMode mode, Window *w);
-void SetObjectToPlace(CursorID icon, SpriteID pal, ViewportHighlightMode mode, WindowClass window_class, WindowNumber window_num);
-
-void ResetObjectToPlace();
-
-bool ScrollWindowTo(int x, int y, Window *w, bool instant = false);
-
-bool ScrollMainWindowToTile(TileIndex tile, bool instant = false);
-bool ScrollMainWindowTo(int x, int y, bool instant = false);
-bool EnsureNoVehicleOnGround(TileIndex tile);
 
 /**
  * Mark all viewports dirty for repaint.
@@ -98,15 +61,8 @@
 void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost);
 void ShowFeederIncomeAnimation(int x, int y, int z, Money cost);
 
-bool CheckIfAuthorityAllows(TileIndex tile);
-Town *ClosestTownFromTile(TileIndex tile, uint threshold);
-void ChangeTownRating(Town *t, int add, int max);
-
-uint GetTownRadiusGroup(const Town* t, TileIndex tile);
 void ShowHighscoreTable(int difficulty, int8 rank);
 
-void AfterLoadTown();
-void UpdatePatches();
 void AskExitGame();
 void AskExitToGameMenu();
 
@@ -116,25 +72,11 @@
 
 void UpdateViewportSignPos(ViewportSign *sign, int left, int top, StringID str);
 
-enum {
-	SLD_LOAD_GAME,
-	SLD_LOAD_SCENARIO,
-	SLD_SAVE_GAME,
-	SLD_SAVE_SCENARIO,
-	SLD_LOAD_HEIGHTMAP,
-	SLD_NEW_GAME,
-};
-void ShowSaveLoadDialog(int mode);
 
 /* callback from drivers that is called if the game size changes dynamically */
 void GameSizeChanged();
-bool FileExists(const char *filename);
 const char *GetCurrentLocale(const char *param);
-void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize);
 
-void LoadFromConfig();
-void SaveToConfig();
-void CheckConfig();
 int ttd_main(int argc, char* argv[]);
 void HandleExitGameRequest();
 
--- a/src/genworld.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/genworld.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,23 +4,29 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
 #include "landscape.h"
-#include "player.h"
-#include "table/sprites.h"
+#include "player_func.h"
 #include "variables.h"
 #include "thread.h"
-#include "command.h"
+#include "command_func.h"
 #include "genworld.h"
-#include "gfx.h"
 #include "gfxinit.h"
-#include "gui.h"
+#include "window_func.h"
 #include "network/network.h"
 #include "debug.h"
-#include "settings.h"
+#include "settings_func.h"
 #include "heightmap.h"
-#include "date.h"
-#include "viewport.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "map_func.h"
+#include "date_func.h"
+#include "core/random_func.hpp"
+#include "engine.h"
+#include "settings_type.h"
+#include "newgrf_storage.h"
+#include "water.h"
+
+#include "table/sprites.h"
 
 void GenerateClearTile();
 void GenerateIndustries();
@@ -114,6 +120,8 @@
 		}
 	}
 
+	ClearStorageChanges(true);
+
 	/* These are probably pointless when inside the scenario editor. */
 	SetGeneratingWorldProgress(GWP_GAME_INIT, 3);
 	StartupPlayers();
--- a/src/genworld.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/genworld.h	Tue Jan 22 21:00:30 2008 +0000
@@ -15,6 +15,8 @@
 #define OTTDThread void
 #endif
 
+#include "player_type.h"
+
 /*
  * Order of these enums has to be the same as in lang/english.txt
  * Otherwise you will get inconsistent behaviour.
--- a/src/genworld_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/genworld_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,26 +5,31 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "heightmap.h"
-#include "functions.h"
-#include "table/strings.h"
-#include "table/sprites.h"
-#include "window.h"
 #include "gui.h"
-#include "gfx.h"
-#include "strings.h"
+#include "window_gui.h"
+#include "textbuf_gui.h"
 #include "gfxinit.h"
-#include "player.h"
-#include "command.h"
-#include "sound.h"
+#include "command_func.h"
 #include "variables.h"
-#include "string.h"
-#include "settings.h"
+#include "settings_func.h"
 #include "debug.h"
 #include "genworld.h"
 #include "network/network.h"
 #include "thread.h"
-#include "date.h"
 #include "newgrf_config.h"
+#include "strings_func.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "sound_func.h"
+#include "fios.h"
+#include "string_func.h"
+#include "gfx_func.h"
+#include "settings_type.h"
+#include "widgets/dropdown_type.h"
+#include "widgets/dropdown_func.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
 
 /**
  * In what 'mode' the GenerateLandscapeWindowProc is.
@@ -68,15 +73,18 @@
 	GLAND_INDUSTRY_TEXT,
 	GLAND_INDUSTRY_PULLDOWN,
 
+	GLAND_RANDOM_TEXT,
 	GLAND_RANDOM_EDITBOX,
 	GLAND_RANDOM_BUTTON,
 
 	GLAND_GENERATE_BUTTON,
 
+	GLAND_START_DATE_TEXT1,
 	GLAND_START_DATE_DOWN,
 	GLAND_START_DATE_TEXT,
 	GLAND_START_DATE_UP,
 
+	GLAND_SNOW_LEVEL_TEXT1,
 	GLAND_SNOW_LEVEL_DOWN,
 	GLAND_SNOW_LEVEL_TEXT,
 	GLAND_SNOW_LEVEL_UP,
@@ -106,39 +114,47 @@
 {   WWT_IMGBTN_2, RESIZE_NONE, 12, 170, 246,  24,  78, SPR_SELECT_SUB_TROPICAL,      STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE},
 {   WWT_IMGBTN_2, RESIZE_NONE, 12, 250, 326,  24,  78, SPR_SELECT_TOYLAND,           STR_0311_SELECT_TOYLAND_LANDSCAPE},
 
-{      WWT_PANEL, RESIZE_NONE, 12, 114, 149,  90, 101, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 150, 161,  90, 101, STR_0225,                     STR_NULL}, // Mapsize X
-{      WWT_PANEL, RESIZE_NONE, 12, 180, 215,  90, 101, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 216, 227,  90, 101, STR_0225,                     STR_NULL}, // Mapsize Y
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110,  91, 101, STR_MAPSIZE,                  STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 114, 161,  90, 101, STR_NUM_1,                    STR_NULL}, // Mapsize X
+{       WWT_TEXT, RESIZE_NONE,  0, 168, 176,  91, 101, STR_BY,                       STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 180, 227,  90, 101, STR_NUM_2,                    STR_NULL}, // Mapsize Y
 
-{      WWT_PANEL, RESIZE_NONE, 12, 114, 163, 112, 123, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 164, 175, 112, 123, STR_0225,                     STR_NULL}, // Number of towns
-{      WWT_PANEL, RESIZE_NONE, 12, 114, 163, 130, 141, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 164, 175, 130, 141, STR_0225,                     STR_NULL}, // Number of industries
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 113, 123, STR_NUMBER_OF_TOWNS,          STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 114, 175, 112, 123, 0x0,                          STR_NULL}, // Number of towns
 
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 131, 141, STR_NUMBER_OF_INDUSTRIES,     STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 114, 175, 130, 141, 0x0,                          STR_NULL}, // Number of industries
+
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 153, 163, STR_RANDOM_SEED,              STR_NULL},
 {      WWT_PANEL, RESIZE_NONE, 15, 114, 207, 152, 163, 0x0,                          STR_RANDOM_SEED_HELP}, // Edit box for seed
 {    WWT_TEXTBTN, RESIZE_NONE, 12, 216, 326, 152, 163, STR_RANDOM,                   STR_RANDOM_HELP},
 
 {    WWT_TEXTBTN, RESIZE_NONE,  6, 243, 326, 228, 257, STR_GENERATE,                 STR_NULL}, // Generate button
 
+{       WWT_TEXT, RESIZE_NONE,  0, 182, 212, 113, 123, STR_DATE,                     STR_NULL},
 {     WWT_IMGBTN, RESIZE_NONE, 12, 216, 227, 112, 123, SPR_ARROW_DOWN,               STR_029E_MOVE_THE_STARTING_DATE},
-{      WWT_PANEL, RESIZE_NONE, 12, 228, 314, 112, 123, 0x0,                          STR_NULL},
+{    WWT_TEXTBTN, RESIZE_NONE, 12, 228, 314, 112, 123, STR_GENERATE_DATE,            STR_NULL},
 {     WWT_IMGBTN, RESIZE_NONE, 12, 315, 326, 112, 123, SPR_ARROW_UP,                 STR_029F_MOVE_THE_STARTING_DATE},
 
+{       WWT_TEXT, RESIZE_NONE,  0, 182, 278, 131, 141, STR_SNOW_LINE_HEIGHT,         STR_NULL},
 {     WWT_IMGBTN, RESIZE_NONE, 12, 282, 293, 130, 141, SPR_ARROW_DOWN,               STR_SNOW_LINE_DOWN},
-{      WWT_PANEL, RESIZE_NONE, 12, 294, 314, 130, 141, 0x0,                          STR_NULL},
+{    WWT_TEXTBTN, RESIZE_NONE, 12, 294, 314, 130, 141, STR_NUM_3,                    STR_NULL},
 {     WWT_IMGBTN, RESIZE_NONE, 12, 315, 326, 130, 141, SPR_ARROW_UP,                 STR_SNOW_LINE_UP},
 
-{      WWT_PANEL, RESIZE_NONE, 12, 114, 219, 192, 203, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 220, 231, 192, 203, STR_0225,                     STR_NULL}, // Tree placer
-{      WWT_PANEL, RESIZE_NONE, 12, 114, 219, 174, 185, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 220, 231, 174, 185, STR_0225,                     STR_NULL}, // Landscape generator
-{      WWT_PANEL, RESIZE_NONE, 12, 114, 219, 210, 221, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 220, 231, 210, 221, STR_0225,                     STR_NULL}, // Terrain type
-{      WWT_PANEL, RESIZE_NONE, 12, 113, 219, 228, 239, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 220, 231, 228, 239, STR_0225,                     STR_NULL}, // Water quantity
-{      WWT_PANEL, RESIZE_NONE, 12, 113, 219, 246, 257, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 220, 231, 246, 257, STR_0225,                     STR_NULL}, // Map smoothness
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 193, 203, STR_TREE_PLACER,              STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 192, 203, 0x0,                          STR_NULL}, // Tree placer
+
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 175, 185, STR_LAND_GENERATOR,           STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 174, 185, 0x0,                          STR_NULL}, // Landscape generator
+
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 211, 221, STR_TERRAIN_TYPE,             STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 210, 221, 0x0,                          STR_NULL}, // Terrain type
+
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 229, 239, STR_QUANTITY_OF_SEA_LAKES,    STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 228, 239, 0x0,                          STR_NULL}, // Water quantity
+
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 245, 257, STR_SMOOTHNESS,               STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 246, 257, 0x0,                          STR_NULL}, // Map smoothness
 {   WIDGETS_END},
 };
 
@@ -152,34 +168,39 @@
 {   WWT_IMGBTN_2, RESIZE_NONE, 12, 170, 246,  24,  78, SPR_SELECT_SUB_TROPICAL,     STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE},
 {   WWT_IMGBTN_2, RESIZE_NONE, 12, 250, 326,  24,  78, SPR_SELECT_TOYLAND,          STR_0311_SELECT_TOYLAND_LANDSCAPE},
 
-{      WWT_PANEL, RESIZE_NONE, 12, 114, 149, 112, 123, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 150, 161, 112, 123, STR_0225,                     STR_NULL}, // Mapsize X
-{      WWT_PANEL, RESIZE_NONE, 12, 180, 215, 112, 123, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 216, 227, 112, 123, STR_0225,                     STR_NULL}, // Mapsize Y
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 113, 123, STR_MAPSIZE,                  STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 114, 161, 112, 123, STR_NUM_1,                    STR_NULL}, // Mapsize X
+{       WWT_TEXT, RESIZE_NONE,  0, 168, 176, 113, 123, STR_BY,                       STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 180, 227, 112, 123, STR_NUM_2,                    STR_NULL}, // Mapsize Y
 
-{      WWT_PANEL, RESIZE_NONE, 12, 114, 163, 134, 145, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 164, 175, 134, 145, STR_0225,                     STR_NULL}, // Number of towns
-{      WWT_PANEL, RESIZE_NONE, 12, 114, 163, 152, 163, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 164, 175, 152, 163, STR_0225,                     STR_NULL}, // Number of industries
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 135, 145, STR_NUMBER_OF_TOWNS,          STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 114, 175, 134, 145, 0x0,                          STR_NULL}, // Number of towns
 
-{      WWT_PANEL, RESIZE_NONE, 15, 114, 194, 174, 185, 0x0,                          STR_RANDOM_SEED_HELP}, // Edit box for seed
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 203, 285, 174, 185, STR_RANDOM,                   STR_RANDOM_HELP},
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 153, 163, STR_NUMBER_OF_INDUSTRIES,     STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 114, 175, 152, 163, 0x0,                          STR_NULL}, // Number of industries
+
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 175, 185, STR_RANDOM_SEED,              STR_NULL},
+{      WWT_PANEL, RESIZE_NONE, 15, 114, 207, 174, 185, 0x0,                          STR_RANDOM_SEED_HELP}, // Edit box for seed
+{    WWT_TEXTBTN, RESIZE_NONE, 12, 216, 326, 174, 185, STR_RANDOM,                   STR_RANDOM_HELP},
 
 {    WWT_TEXTBTN, RESIZE_NONE,  6, 243, 326, 196, 225, STR_GENERATE,                 STR_NULL}, // Generate button
 
+{       WWT_TEXT, RESIZE_NONE,  0, 182, 212, 135, 145, STR_DATE,                     STR_NULL},
 {     WWT_IMGBTN, RESIZE_NONE, 12, 216, 227, 134, 145, SPR_ARROW_DOWN,               STR_029E_MOVE_THE_STARTING_DATE},
-{      WWT_PANEL, RESIZE_NONE, 12, 228, 314, 134, 145, 0x0,                          STR_NULL},
+{    WWT_TEXTBTN, RESIZE_NONE, 12, 228, 314, 134, 145, STR_GENERATE_DATE,            STR_NULL},
 {     WWT_IMGBTN, RESIZE_NONE, 12, 315, 326, 134, 145, SPR_ARROW_UP,                 STR_029F_MOVE_THE_STARTING_DATE},
 
+{       WWT_TEXT, RESIZE_NONE,  0, 182, 278, 153, 163, STR_SNOW_LINE_HEIGHT,         STR_NULL},
 {     WWT_IMGBTN, RESIZE_NONE, 12, 282, 293, 152, 163, SPR_ARROW_DOWN,               STR_SNOW_LINE_DOWN},
-{      WWT_PANEL, RESIZE_NONE, 12, 294, 314, 152, 163, 0x0,                          STR_NULL},
+{    WWT_TEXTBTN, RESIZE_NONE, 12, 294, 314, 152, 163, STR_NUM_3,                    STR_NULL},
 {     WWT_IMGBTN, RESIZE_NONE, 12, 315, 326, 152, 163, SPR_ARROW_UP,                 STR_SNOW_LINE_UP},
 
-{      WWT_PANEL, RESIZE_NONE, 12, 114, 219, 196, 207, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 220, 231, 196, 207, STR_0225,                     STR_NULL}, // Tree placer
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 197, 207, STR_TREE_PLACER,              STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 196, 207, STR_0225,                     STR_NULL}, // Tree placer
 
-{      WWT_PANEL, RESIZE_NONE, 12, 114, 219, 214, 225, 0x0,                          STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 220, 231, 214, 225, STR_0225,                     STR_NULL}, // Heightmap rotation
+{       WWT_TEXT, RESIZE_NONE,  0,  12, 110, 215, 225, STR_HEIGHTMAP_ROTATION,       STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 214, 225, STR_0225,                     STR_NULL}, // Heightmap rotation
+
 {   WIDGETS_END},
 };
 
@@ -207,9 +228,21 @@
 	if (confirmed) StartGeneratingLandscape((glwp_modes)w->window_number);
 }
 
+static DropDownList *BuildMapsizeDropDown()
+{
+	DropDownList *list = new DropDownList();
+
+	for (uint i = 6; i <= 11; i++) {
+		DropDownListParamStringItem *item = new DropDownListParamStringItem(STR_JUST_INT, i, false);
+		item->SetParam(0, 1 << i);
+		list->push_back(item);
+	}
+
+	return list;
+}
+
 static void GenerateLandscapeWndProc(Window *w, WindowEvent *e)
 {
-	static const StringID mapsizes[]    = {STR_64, STR_128, STR_256, STR_512, STR_1024, STR_2048, INVALID_STRING_ID};
 	static const StringID elevations[]  = {STR_682A_VERY_FLAT, STR_682B_FLAT, STR_682C_HILLY, STR_682D_MOUNTAINOUS, INVALID_STRING_ID};
 	static const StringID sea_lakes[]   = {STR_VERY_LOW, STR_6820_LOW, STR_6821_MEDIUM, STR_6822_HIGH, INVALID_STRING_ID};
 	static const StringID smoothness[]  = {STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH, STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_SMOOTH, STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_ROUGH, STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_ROUGH, INVALID_STRING_ID};
@@ -224,288 +257,286 @@
 	static char _genseed_buffer[11];
 
 	glwp_modes mode = (glwp_modes)w->window_number;
-	uint y;
 
 	switch (e->event) {
-	case WE_CREATE:
-		w->LowerWidget(_opt_newgame.landscape + GLAND_TEMPERATE);
-
-		snprintf(_genseed_buffer, sizeof(_genseed_buffer), "%u", _patches_newgame.generation_seed);
-		InitializeTextBuffer(&_genseed_query.text, _genseed_buffer, lengthof(_genseed_buffer), 120);
-		_genseed_query.caption = STR_NULL;
-		_genseed_query.afilter = CS_NUMERAL;
-		break;
-
-	case WE_PAINT:
-		/* You can't select smoothness if not terragenesis */
-		if (mode == GLWP_GENERATE) {
-			w->SetWidgetDisabledState(GLAND_SMOOTHNESS_TEXT,     _patches_newgame.land_generator == 0);
-			w->SetWidgetDisabledState(GLAND_SMOOTHNESS_PULLDOWN, _patches_newgame.land_generator == 0);
-		}
-		/* Disable snowline if not hilly */
-		w->SetWidgetDisabledState(GLAND_SNOW_LEVEL_TEXT, _opt_newgame.landscape != LT_ARCTIC);
-		/* Disable town, industry and trees in SE */
-		w->SetWidgetDisabledState(GLAND_TOWN_TEXT,         _game_mode == GM_EDITOR);
-		w->SetWidgetDisabledState(GLAND_TOWN_PULLDOWN,     _game_mode == GM_EDITOR);
-		w->SetWidgetDisabledState(GLAND_INDUSTRY_TEXT,     _game_mode == GM_EDITOR);
-		w->SetWidgetDisabledState(GLAND_INDUSTRY_PULLDOWN, _game_mode == GM_EDITOR);
-		w->SetWidgetDisabledState(GLAND_TREE_TEXT,         _game_mode == GM_EDITOR);
-		w->SetWidgetDisabledState(GLAND_TREE_PULLDOWN,     _game_mode == GM_EDITOR);
-
-		w->SetWidgetDisabledState(GLAND_START_DATE_DOWN, _patches_newgame.starting_year <= MIN_YEAR);
-		w->SetWidgetDisabledState(GLAND_START_DATE_UP,   _patches_newgame.starting_year >= MAX_YEAR);
-		w->SetWidgetDisabledState(GLAND_SNOW_LEVEL_DOWN, _patches_newgame.snow_line_height <= 2 || _opt_newgame.landscape != LT_ARCTIC);
-		w->SetWidgetDisabledState(GLAND_SNOW_LEVEL_UP,   _patches_newgame.snow_line_height >= MAX_SNOWLINE_HEIGHT || _opt_newgame.landscape != LT_ARCTIC);
-
-		w->SetWidgetLoweredState(GLAND_TEMPERATE, _opt_newgame.landscape == LT_TEMPERATE);
-		w->SetWidgetLoweredState(GLAND_ARCTIC,    _opt_newgame.landscape == LT_ARCTIC);
-		w->SetWidgetLoweredState(GLAND_TROPICAL,  _opt_newgame.landscape == LT_TROPIC);
-		w->SetWidgetLoweredState(GLAND_TOYLAND,   _opt_newgame.landscape == LT_TOYLAND);
-		DrawWindowWidgets(w);
-
-		y = (mode == GLWP_HEIGHTMAP) ? 22 : 0;
-
-		DrawString( 12,  91 + y, STR_MAPSIZE, TC_FROMSTRING);
-		DrawString(119,  91 + y, mapsizes[_patches_newgame.map_x - 6], TC_BLACK);
-		DrawString(168,  91 + y, STR_BY, TC_FROMSTRING);
-		DrawString(182,  91 + y, mapsizes[_patches_newgame.map_y - 6], TC_BLACK);
-
-		DrawString( 12, 113 + y, STR_NUMBER_OF_TOWNS, TC_FROMSTRING);
-		DrawString( 12, 131 + y, STR_NUMBER_OF_INDUSTRIES, TC_FROMSTRING);
-		if (_game_mode == GM_EDITOR) {
-			DrawString(118, 113 + y, STR_6836_OFF, TC_BLACK);
-			DrawString(118, 131 + y, STR_6836_OFF, TC_BLACK);
-		} else {
-			DrawString(118, 113 + y, num_towns[_opt_newgame.diff.number_towns], TC_BLACK);
-			DrawString(118, 131 + y, num_inds[_opt_newgame.diff.number_industries], TC_BLACK);
-		}
-
-		DrawString( 12, 153 + y, STR_RANDOM_SEED, TC_FROMSTRING);
-		DrawEditBox(w, &_genseed_query, GLAND_RANDOM_EDITBOX);
-
-		DrawString(182, 113 + y, STR_DATE, TC_FROMSTRING);
-		SetDParam(0, ConvertYMDToDate(_patches_newgame.starting_year, 0, 1));
-		DrawStringCentered(271, 113 + y, STR_GENERATE_DATE, TC_FROMSTRING);
+		case WE_CREATE:
+			w->LowerWidget(_opt_newgame.landscape + GLAND_TEMPERATE);
 
-		DrawString(182, 131 + y, STR_SNOW_LINE_HEIGHT, TC_FROMSTRING);
-		SetDParam(0, _patches_newgame.snow_line_height);
-		DrawStringCentered(303, 131 + y, STR_SNOW_LINE_HEIGHT_NUM, TC_BLACK);
-
-		if (mode == GLWP_GENERATE) {
-			DrawString( 12, 175, STR_LAND_GENERATOR, TC_FROMSTRING);
-			DrawString(118, 175, landscape[_patches_newgame.land_generator], TC_BLACK);
-
-			DrawString( 12, 193, STR_TREE_PLACER, TC_FROMSTRING);
-			DrawString(118, 193, tree_placer[_patches_newgame.tree_placer], TC_BLACK);
-
-			DrawString( 12, 211, STR_TERRAIN_TYPE, TC_FROMSTRING);
-			DrawString(118, 211, elevations[_opt_newgame.diff.terrain_type], TC_BLACK);
-
-			DrawString( 12, 229, STR_QUANTITY_OF_SEA_LAKES, TC_FROMSTRING);
-			DrawString(118, 229, sea_lakes[_opt_newgame.diff.quantity_sea_lakes], TC_BLACK);
-
-			DrawString( 12, 247, STR_SMOOTHNESS, TC_FROMSTRING);
-			DrawString(118, 247, smoothness[_patches_newgame.tgen_smoothness], TC_BLACK);
-		} else {
-			char buffer[512];
-
-			if (_patches_newgame.heightmap_rotation == HM_CLOCKWISE) {
-				SetDParam(0, WP(w, generate_d).y);
-				SetDParam(1, WP(w, generate_d).x);
-			} else {
-				SetDParam(0, WP(w, generate_d).x);
-				SetDParam(1, WP(w, generate_d).y);
-			}
-			GetString(buffer, STR_HEIGHTMAP_SIZE, lastof(buffer));
-			DrawStringRightAligned(326, 91, STR_HEIGHTMAP_SIZE, TC_BLACK);
+			snprintf(_genseed_buffer, sizeof(_genseed_buffer), "%u", _patches_newgame.generation_seed);
+			InitializeTextBuffer(&_genseed_query.text, _genseed_buffer, lengthof(_genseed_buffer), 120);
+			_genseed_query.caption = STR_NULL;
+			_genseed_query.afilter = CS_NUMERAL;
+			break;
 
-			DrawString( 12,  91, STR_HEIGHTMAP_NAME, TC_BLACK);
-			SetDParamStr(0, WP(w, generate_d).name);
-			DrawStringTruncated(114,  91, STR_ORANGE, TC_BLACK, 326 - 114 - GetStringBoundingBox(buffer).width - 5);
-
-			DrawString( 12, 197, STR_TREE_PLACER, TC_FROMSTRING);
-			DrawString(118, 197, tree_placer[_patches_newgame.tree_placer], TC_BLACK);
-
-			DrawString( 12, 215, STR_HEIGHTMAP_ROTATION, TC_FROMSTRING);
-			DrawString(118, 215, rotation[_patches_newgame.heightmap_rotation], TC_BLACK);
-		}
+		case WE_PAINT:
+			/* You can't select smoothness if not terragenesis */
+			if (mode == GLWP_GENERATE) {
+				w->SetWidgetDisabledState(GLAND_SMOOTHNESS_PULLDOWN, _patches_newgame.land_generator == 0);
+			}
+			/* Disable snowline if not hilly */
+			w->SetWidgetDisabledState(GLAND_SNOW_LEVEL_TEXT, _opt_newgame.landscape != LT_ARCTIC);
+			/* Disable town, industry and trees in SE */
+			w->SetWidgetDisabledState(GLAND_TOWN_PULLDOWN,     _game_mode == GM_EDITOR);
+			w->SetWidgetDisabledState(GLAND_INDUSTRY_PULLDOWN, _game_mode == GM_EDITOR);
+			w->SetWidgetDisabledState(GLAND_TREE_PULLDOWN,     _game_mode == GM_EDITOR);
 
-		break;
-	case WE_CLICK:
-		switch (e->we.click.widget) {
-		case 0: DeleteWindow(w); break;
-		case GLAND_TEMPERATE: case GLAND_ARCTIC: case GLAND_TROPICAL: case GLAND_TOYLAND:
-			w->RaiseWidget(_opt_newgame.landscape + GLAND_TEMPERATE);
-			SetNewLandscapeType(e->we.click.widget - GLAND_TEMPERATE);
-			break;
-		case GLAND_MAPSIZE_X_TEXT: case GLAND_MAPSIZE_X_PULLDOWN: // Mapsize X
-			ShowDropDownMenu(w, mapsizes, _patches_newgame.map_x - 6, GLAND_MAPSIZE_X_PULLDOWN, 0, 0);
+			w->SetWidgetDisabledState(GLAND_START_DATE_DOWN, _patches_newgame.starting_year <= MIN_YEAR);
+			w->SetWidgetDisabledState(GLAND_START_DATE_UP,   _patches_newgame.starting_year >= MAX_YEAR);
+			w->SetWidgetDisabledState(GLAND_SNOW_LEVEL_DOWN, _patches_newgame.snow_line_height <= 2 || _opt_newgame.landscape != LT_ARCTIC);
+			w->SetWidgetDisabledState(GLAND_SNOW_LEVEL_UP,   _patches_newgame.snow_line_height >= MAX_SNOWLINE_HEIGHT || _opt_newgame.landscape != LT_ARCTIC);
+
+			w->SetWidgetLoweredState(GLAND_TEMPERATE, _opt_newgame.landscape == LT_TEMPERATE);
+			w->SetWidgetLoweredState(GLAND_ARCTIC,    _opt_newgame.landscape == LT_ARCTIC);
+			w->SetWidgetLoweredState(GLAND_TROPICAL,  _opt_newgame.landscape == LT_TROPIC);
+			w->SetWidgetLoweredState(GLAND_TOYLAND,   _opt_newgame.landscape == LT_TOYLAND);
+
+			if (_game_mode == GM_EDITOR) {
+				w->widget[GLAND_TOWN_PULLDOWN].data     = STR_6836_OFF;
+				w->widget[GLAND_INDUSTRY_PULLDOWN].data = STR_6836_OFF;
+			} else {
+				w->widget[GLAND_TOWN_PULLDOWN].data     = num_towns[_opt_newgame.diff.number_towns];
+				w->widget[GLAND_INDUSTRY_PULLDOWN].data = num_inds[_opt_newgame.diff.number_industries];
+			}
+
+			if (mode == GLWP_GENERATE) {
+				w->widget[GLAND_LANDSCAPE_PULLDOWN].data  = landscape[_patches_newgame.land_generator];
+				w->widget[GLAND_TREE_PULLDOWN].data       = tree_placer[_patches_newgame.tree_placer];
+				w->widget[GLAND_TERRAIN_PULLDOWN].data    = elevations[_opt_newgame.diff.terrain_type];
+				w->widget[GLAND_WATER_PULLDOWN].data      = sea_lakes[_opt_newgame.diff.quantity_sea_lakes];
+				w->widget[GLAND_SMOOTHNESS_PULLDOWN].data = smoothness[_patches_newgame.tgen_smoothness];
+			} else {
+				w->widget[GLAND_TREE_PULLDOWN].data               = tree_placer[_patches_newgame.tree_placer];
+				w->widget[GLAND_HEIGHTMAP_ROTATION_PULLDOWN].data = rotation[_patches_newgame.heightmap_rotation];
+			}
+
+			/* Set parameters for widget text that requires them. */
+			SetDParam(0, ConvertYMDToDate(_patches_newgame.starting_year, 0, 1)); // GLAND_START_DATE_TEXT
+			SetDParam(1, 1 << _patches_newgame.map_x); // GLAND_MAPSIZE_X_PULLDOWN
+			SetDParam(2, 1 << _patches_newgame.map_y); // GLAND_MAPSIZE_Y_PULLDOWN
+			SetDParam(3, _patches_newgame.snow_line_height); // GLAND_SNOW_LEVEL_TEXT
+
+			DrawWindowWidgets(w);
+
+			DrawEditBox(w, &_genseed_query, GLAND_RANDOM_EDITBOX);
+
+			if (mode != GLWP_GENERATE) {
+				char buffer[512];
+
+				if (_patches_newgame.heightmap_rotation == HM_CLOCKWISE) {
+					SetDParam(0, WP(w, generate_d).y);
+					SetDParam(1, WP(w, generate_d).x);
+				} else {
+					SetDParam(0, WP(w, generate_d).x);
+					SetDParam(1, WP(w, generate_d).y);
+				}
+				GetString(buffer, STR_HEIGHTMAP_SIZE, lastof(buffer));
+				DrawStringRightAligned(326, 91, STR_HEIGHTMAP_SIZE, TC_BLACK);
+
+				DrawString( 12,  91, STR_HEIGHTMAP_NAME, TC_BLACK);
+				SetDParamStr(0, WP(w, generate_d).name);
+				DrawStringTruncated(114,  91, STR_ORANGE, TC_BLACK, 326 - 114 - GetStringBoundingBox(buffer).width - 5);
+			}
 			break;
-		case GLAND_MAPSIZE_Y_TEXT: case GLAND_MAPSIZE_Y_PULLDOWN: // Mapsize Y
-			ShowDropDownMenu(w, mapsizes, _patches_newgame.map_y - 6, GLAND_MAPSIZE_Y_PULLDOWN, 0, 0);
-			break;
-		case GLAND_TOWN_TEXT: case GLAND_TOWN_PULLDOWN: // Number of towns
-			ShowDropDownMenu(w, num_towns, _opt_newgame.diff.number_towns, GLAND_TOWN_PULLDOWN, 0, 0);
+
+		case WE_CLICK:
+			switch (e->we.click.widget) {
+				case 0: DeleteWindow(w); break;
+
+				case GLAND_TEMPERATE:
+				case GLAND_ARCTIC:
+				case GLAND_TROPICAL:
+				case GLAND_TOYLAND:
+					w->RaiseWidget(_opt_newgame.landscape + GLAND_TEMPERATE);
+					SetNewLandscapeType(e->we.click.widget - GLAND_TEMPERATE);
+					break;
+
+				case GLAND_MAPSIZE_X_PULLDOWN: // Mapsize X
+					ShowDropDownList(w, BuildMapsizeDropDown(), _patches_newgame.map_x, GLAND_MAPSIZE_X_PULLDOWN);
+					break;
+
+				case GLAND_MAPSIZE_Y_PULLDOWN: // Mapsize Y
+					ShowDropDownList(w, BuildMapsizeDropDown(), _patches_newgame.map_y, GLAND_MAPSIZE_Y_PULLDOWN);
+					break;
+
+				case GLAND_TOWN_PULLDOWN: // Number of towns
+					ShowDropDownMenu(w, num_towns, _opt_newgame.diff.number_towns, GLAND_TOWN_PULLDOWN, 0, 0);
+					break;
+
+				case GLAND_INDUSTRY_PULLDOWN: // Number of industries
+					ShowDropDownMenu(w, num_inds, _opt_newgame.diff.number_industries, GLAND_INDUSTRY_PULLDOWN, 0, 0);
+					break;
+
+				case GLAND_RANDOM_BUTTON: // Random seed
+					_patches_newgame.generation_seed = InteractiveRandom();
+					snprintf(_genseed_buffer, lengthof(_genseed_buffer), "%u", _patches_newgame.generation_seed);
+					UpdateTextBufferSize(&_genseed_query.text);
+					SetWindowDirty(w);
+					break;
+
+				case GLAND_GENERATE_BUTTON: // Generate
+
+					UpdatePatches();
+
+					if (_patches.town_layout == TL_NO_ROADS) {
+						ShowQuery(
+							STR_TOWN_LAYOUT_WARNING_CAPTION,
+							STR_TOWN_LAYOUT_WARNING_MESSAGE,
+							w,
+							LandscapeGenerationCallback);
+					} else if (mode == GLWP_HEIGHTMAP &&
+							(WP(w, generate_d).x * 2 < (1U << _patches_newgame.map_x) ||
+							WP(w, generate_d).x / 2 > (1U << _patches_newgame.map_x) ||
+							WP(w, generate_d).y * 2 < (1U << _patches_newgame.map_y) ||
+							WP(w, generate_d).y / 2 > (1U << _patches_newgame.map_y))) {
+						ShowQuery(
+							STR_HEIGHTMAP_SCALE_WARNING_CAPTION,
+							STR_HEIGHTMAP_SCALE_WARNING_MESSAGE,
+							w,
+							LandscapeGenerationCallback);
+					} else {
+						StartGeneratingLandscape(mode);
+					}
+					break;
+
+				case GLAND_START_DATE_DOWN:
+				case GLAND_START_DATE_UP: // Year buttons
+					/* Don't allow too fast scrolling */
+					if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
+						w->HandleButtonClick(e->we.click.widget);
+						SetWindowDirty(w);
+
+						_patches_newgame.starting_year = Clamp(_patches_newgame.starting_year + e->we.click.widget - GLAND_START_DATE_TEXT, MIN_YEAR, MAX_YEAR);
+					}
+					_left_button_clicked = false;
+					break;
+
+				case GLAND_START_DATE_TEXT: // Year text
+					WP(w, generate_d).widget_id = GLAND_START_DATE_TEXT;
+					SetDParam(0, _patches_newgame.starting_year);
+					ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_START_DATE_QUERY_CAPT, 8, 100, w, CS_NUMERAL);
+					break;
+
+				case GLAND_SNOW_LEVEL_DOWN:
+				case GLAND_SNOW_LEVEL_UP: // Snow line buttons
+					/* Don't allow too fast scrolling */
+					if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
+						w->HandleButtonClick(e->we.click.widget);
+						SetWindowDirty(w);
+
+						_patches_newgame.snow_line_height = Clamp(_patches_newgame.snow_line_height + e->we.click.widget - GLAND_SNOW_LEVEL_TEXT, 2, MAX_SNOWLINE_HEIGHT);
+					}
+					_left_button_clicked = false;
+					break;
+
+				case GLAND_SNOW_LEVEL_TEXT: // Snow line text
+					WP(w, generate_d).widget_id = GLAND_SNOW_LEVEL_TEXT;
+					SetDParam(0, _patches_newgame.snow_line_height);
+					ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_SNOW_LINE_QUERY_CAPT, 3, 100, w, CS_NUMERAL);
+					break;
+
+				case GLAND_TREE_PULLDOWN: // Tree placer
+					ShowDropDownMenu(w, tree_placer, _patches_newgame.tree_placer, GLAND_TREE_PULLDOWN, 0, 0);
+					break;
+
+				case GLAND_LANDSCAPE_PULLDOWN: // Landscape generator OR Heightmap rotation
+				/* case GLAND_HEIGHTMAP_ROTATION_TEXT: case GLAND_HEIGHTMAP_ROTATION_PULLDOWN:*/
+					if (mode == GLWP_HEIGHTMAP) {
+						ShowDropDownMenu(w, rotation, _patches_newgame.heightmap_rotation, GLAND_HEIGHTMAP_ROTATION_PULLDOWN, 0, 0);
+					} else {
+						ShowDropDownMenu(w, landscape, _patches_newgame.land_generator, GLAND_LANDSCAPE_PULLDOWN, 0, 0);
+					}
+					break;
+
+				case GLAND_TERRAIN_PULLDOWN: // Terrain type
+					ShowDropDownMenu(w, elevations, _opt_newgame.diff.terrain_type, GLAND_TERRAIN_PULLDOWN, 0, 0);
+					break;
+
+				case GLAND_WATER_PULLDOWN: // Water quantity
+					ShowDropDownMenu(w, sea_lakes, _opt_newgame.diff.quantity_sea_lakes, GLAND_WATER_PULLDOWN, 0, 0);
+					break;
+
+				case GLAND_SMOOTHNESS_PULLDOWN: // Map smoothness
+					ShowDropDownMenu(w, smoothness, _patches_newgame.tgen_smoothness, GLAND_SMOOTHNESS_PULLDOWN, 0, 0);
+					break;
+			}
 			break;
-		case GLAND_INDUSTRY_TEXT: case GLAND_INDUSTRY_PULLDOWN: // Number of industries
-			ShowDropDownMenu(w, num_inds, _opt_newgame.diff.number_industries, GLAND_INDUSTRY_PULLDOWN, 0, 0);
+
+		case WE_MOUSELOOP:
+			HandleEditBox(w, &_genseed_query, GLAND_RANDOM_EDITBOX);
 			break;
-		case GLAND_RANDOM_BUTTON: // Random seed
-			_patches_newgame.generation_seed = InteractiveRandom();
-			snprintf(_genseed_buffer, lengthof(_genseed_buffer), "%u", _patches_newgame.generation_seed);
-			UpdateTextBufferSize(&_genseed_query.text);
+
+		case WE_KEYPRESS:
+			HandleEditBoxKey(w, &_genseed_query, GLAND_RANDOM_EDITBOX, e);
+			/* the seed is unsigned, therefore atoi cannot be used.
+			 * As 2^32 - 1 (MAX_UVALUE(uint32)) is a 'magic' value
+			 * (use random seed) it should not be possible to be
+			 * entered into the input field; the generate seed
+			 * button can be used instead. */
+			_patches_newgame.generation_seed = minu(strtoul(_genseed_buffer, NULL, sizeof(_genseed_buffer) - 1), MAX_UVALUE(uint32) - 1);
+			break;
+
+		case WE_DROPDOWN_SELECT:
+			switch (e->we.dropdown.button) {
+				case GLAND_MAPSIZE_X_PULLDOWN:  _patches_newgame.map_x = e->we.dropdown.index; break;
+				case GLAND_MAPSIZE_Y_PULLDOWN:  _patches_newgame.map_y = e->we.dropdown.index; break;
+				case GLAND_TREE_PULLDOWN:       _patches_newgame.tree_placer = e->we.dropdown.index; break;
+				case GLAND_SMOOTHNESS_PULLDOWN: _patches_newgame.tgen_smoothness = e->we.dropdown.index;  break;
+
+				case GLAND_TOWN_PULLDOWN:
+					_opt_newgame.diff.number_towns = e->we.dropdown.index;
+					if (_opt_newgame.diff_level != 3) ShowErrorMessage(INVALID_STRING_ID, STR_DIFFICULTY_TO_CUSTOM, 0, 0);
+					DoCommandP(0, 2, _opt_newgame.diff.number_towns, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
+					break;
+
+				case GLAND_INDUSTRY_PULLDOWN:
+					_opt_newgame.diff.number_industries = e->we.dropdown.index;
+					if (_opt_newgame.diff_level != 3) ShowErrorMessage(INVALID_STRING_ID, STR_DIFFICULTY_TO_CUSTOM, 0, 0);
+					DoCommandP(0, 3, _opt_newgame.diff.number_industries, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
+					break;
+
+				case GLAND_LANDSCAPE_PULLDOWN:
+				/* case GLAND_HEIGHTMAP_PULLDOWN: */
+					if (mode == GLWP_HEIGHTMAP) {
+						_patches_newgame.heightmap_rotation = e->we.dropdown.index;
+					} else {
+						_patches_newgame.land_generator = e->we.dropdown.index;
+					}
+					break;
+
+				case GLAND_TERRAIN_PULLDOWN:
+					_opt_newgame.diff.terrain_type = e->we.dropdown.index;
+					if (_opt_newgame.diff_level != 3) ShowErrorMessage(INVALID_STRING_ID, STR_DIFFICULTY_TO_CUSTOM, 0, 0);
+					DoCommandP(0, 12, _opt_newgame.diff.terrain_type, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
+					break;
+
+				case GLAND_WATER_PULLDOWN:
+					_opt_newgame.diff.quantity_sea_lakes = e->we.dropdown.index;
+					if (_opt_newgame.diff_level != 3) ShowErrorMessage(INVALID_STRING_ID, STR_DIFFICULTY_TO_CUSTOM, 0, 0);
+					DoCommandP(0, 13, _opt_newgame.diff.quantity_sea_lakes, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
+					break;
+			}
 			SetWindowDirty(w);
 			break;
-		case GLAND_GENERATE_BUTTON: // Generate
-
-			UpdatePatches();
-
-			if (_patches.town_layout == TL_NO_ROADS) {
-				ShowQuery(
-					STR_TOWN_LAYOUT_WARNING_CAPTION,
-					STR_TOWN_LAYOUT_WARNING_MESSAGE,
-					w,
-					LandscapeGenerationCallback);
-			} else if (mode == GLWP_HEIGHTMAP &&
-					(WP(w, generate_d).x * 2 < (1U << _patches_newgame.map_x) ||
-					WP(w, generate_d).x / 2 > (1U << _patches_newgame.map_x) ||
-					WP(w, generate_d).y * 2 < (1U << _patches_newgame.map_y) ||
-					WP(w, generate_d).y / 2 > (1U << _patches_newgame.map_y))) {
-				ShowQuery(
-					STR_HEIGHTMAP_SCALE_WARNING_CAPTION,
-					STR_HEIGHTMAP_SCALE_WARNING_MESSAGE,
-					w,
-					LandscapeGenerationCallback);
-
-			} else {
-				StartGeneratingLandscape(mode);
-			}
-			break;
-		case GLAND_START_DATE_DOWN: case GLAND_START_DATE_UP: // Year buttons
-			/* Don't allow too fast scrolling */
-			if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
-				HandleButtonClick(w, e->we.click.widget);
-				SetWindowDirty(w);
 
-				_patches_newgame.starting_year = Clamp(_patches_newgame.starting_year + e->we.click.widget - GLAND_START_DATE_TEXT, MIN_YEAR, MAX_YEAR);
-			}
-			_left_button_clicked = false;
-			break;
-		case GLAND_START_DATE_TEXT: // Year text
-			WP(w, generate_d).widget_id = GLAND_START_DATE_TEXT;
-			SetDParam(0, _patches_newgame.starting_year);
-			ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_START_DATE_QUERY_CAPT, 8, 100, w, CS_NUMERAL);
-			break;
-		case GLAND_SNOW_LEVEL_DOWN: case GLAND_SNOW_LEVEL_UP: // Snow line buttons
-			/* Don't allow too fast scrolling */
-			if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
-				HandleButtonClick(w, e->we.click.widget);
-				SetWindowDirty(w);
+		case WE_ON_EDIT_TEXT:
+			if (e->we.edittext.str != NULL) {
+				int32 value = atoi(e->we.edittext.str);
 
-				_patches_newgame.snow_line_height = Clamp(_patches_newgame.snow_line_height + e->we.click.widget - GLAND_SNOW_LEVEL_TEXT, 2, MAX_SNOWLINE_HEIGHT);
-			}
-			_left_button_clicked = false;
-			break;
-		case GLAND_SNOW_LEVEL_TEXT: // Snow line text
-			WP(w, generate_d).widget_id = GLAND_SNOW_LEVEL_TEXT;
-			SetDParam(0, _patches_newgame.snow_line_height);
-			ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_SNOW_LINE_QUERY_CAPT, 3, 100, w, CS_NUMERAL);
-			break;
-		case GLAND_TREE_TEXT: case GLAND_TREE_PULLDOWN: // Tree placer
-			ShowDropDownMenu(w, tree_placer, _patches_newgame.tree_placer, GLAND_TREE_PULLDOWN, 0, 0);
-			break;
-		case GLAND_LANDSCAPE_TEXT: case GLAND_LANDSCAPE_PULLDOWN: // Landscape generator OR Heightmap rotation
-		/* case GLAND_HEIGHTMAP_ROTATION_TEXT: case GLAND_HEIGHTMAP_ROTATION_PULLDOWN:*/
-			if (mode == GLWP_HEIGHTMAP) {
-				ShowDropDownMenu(w, rotation, _patches_newgame.heightmap_rotation, GLAND_HEIGHTMAP_ROTATION_PULLDOWN, 0, 0);
-			} else {
-				ShowDropDownMenu(w, landscape, _patches_newgame.land_generator, GLAND_LANDSCAPE_PULLDOWN, 0, 0);
+				switch (WP(w, generate_d).widget_id) {
+					case GLAND_START_DATE_TEXT:
+						w->InvalidateWidget(GLAND_START_DATE_TEXT);
+						_patches_newgame.starting_year = Clamp(value, MIN_YEAR, MAX_YEAR);
+						break;
+
+					case GLAND_SNOW_LEVEL_TEXT:
+						w->InvalidateWidget(GLAND_SNOW_LEVEL_TEXT);
+						_patches_newgame.snow_line_height = Clamp(value, 2, MAX_SNOWLINE_HEIGHT);
+						break;
+				}
+
+				SetWindowDirty(w);
 			}
 			break;
-		case GLAND_TERRAIN_TEXT: case GLAND_TERRAIN_PULLDOWN: // Terrain type
-			ShowDropDownMenu(w, elevations, _opt_newgame.diff.terrain_type, GLAND_TERRAIN_PULLDOWN, 0, 0);
-			break;
-		case GLAND_WATER_TEXT: case GLAND_WATER_PULLDOWN: // Water quantity
-			ShowDropDownMenu(w, sea_lakes, _opt_newgame.diff.quantity_sea_lakes, GLAND_WATER_PULLDOWN, 0, 0);
-			break;
-		case GLAND_SMOOTHNESS_TEXT: case GLAND_SMOOTHNESS_PULLDOWN: // Map smoothness
-			ShowDropDownMenu(w, smoothness, _patches_newgame.tgen_smoothness, GLAND_SMOOTHNESS_PULLDOWN, 0, 0);
-			break;
-		}
-		break;
-
-	case WE_MOUSELOOP:
-		HandleEditBox(w, &_genseed_query, GLAND_RANDOM_EDITBOX);
-		break;
-
-	case WE_KEYPRESS:
-		HandleEditBoxKey(w, &_genseed_query, GLAND_RANDOM_EDITBOX, e);
-		/* the seed is unsigned, therefore atoi cannot be used.
-		 * As 2^32 - 1 (MAX_UVALUE(uint32)) is a 'magic' value
-		 * (use random seed) it should not be possible to be
-		 * entered into the input field; the generate seed
-		 * button can be used instead. */
-		_patches_newgame.generation_seed = minu(strtoul(_genseed_buffer, NULL, sizeof(_genseed_buffer) - 1), MAX_UVALUE(uint32) - 1);
-		break;
-
-	case WE_DROPDOWN_SELECT:
-		switch (e->we.dropdown.button) {
-			case GLAND_MAPSIZE_X_PULLDOWN:  _patches_newgame.map_x = e->we.dropdown.index + 6; break;
-			case GLAND_MAPSIZE_Y_PULLDOWN:  _patches_newgame.map_y = e->we.dropdown.index + 6; break;
-			case GLAND_TREE_PULLDOWN:       _patches_newgame.tree_placer = e->we.dropdown.index; break;
-			case GLAND_SMOOTHNESS_PULLDOWN: _patches_newgame.tgen_smoothness = e->we.dropdown.index;  break;
-
-			case GLAND_TOWN_PULLDOWN:
-				_opt_newgame.diff.number_towns = e->we.dropdown.index;
-				if (_opt_newgame.diff_level != 3) ShowErrorMessage(INVALID_STRING_ID, STR_DIFFICULTY_TO_CUSTOM, 0, 0);
-				DoCommandP(0, 2, _opt_newgame.diff.number_towns, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
-				break;
-			case GLAND_INDUSTRY_PULLDOWN:
-				_opt_newgame.diff.number_industries = e->we.dropdown.index;
-				if (_opt_newgame.diff_level != 3) ShowErrorMessage(INVALID_STRING_ID, STR_DIFFICULTY_TO_CUSTOM, 0, 0);
-				DoCommandP(0, 3, _opt_newgame.diff.number_industries, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
-				break;
-			case GLAND_LANDSCAPE_PULLDOWN:
-			/* case GLAND_HEIGHTMAP_PULLDOWN: */
-				if (mode == GLWP_HEIGHTMAP) {
-					_patches_newgame.heightmap_rotation = e->we.dropdown.index;
-				} else {
-					_patches_newgame.land_generator = e->we.dropdown.index;
-				}
-				break;
-			case GLAND_TERRAIN_PULLDOWN:
-				_opt_newgame.diff.terrain_type = e->we.dropdown.index;
-				if (_opt_newgame.diff_level != 3) ShowErrorMessage(INVALID_STRING_ID, STR_DIFFICULTY_TO_CUSTOM, 0, 0);
-				DoCommandP(0, 12, _opt_newgame.diff.terrain_type, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
-				break;
-			case GLAND_WATER_PULLDOWN:
-				_opt_newgame.diff.quantity_sea_lakes = e->we.dropdown.index;
-				if (_opt_newgame.diff_level != 3) ShowErrorMessage(INVALID_STRING_ID, STR_DIFFICULTY_TO_CUSTOM, 0, 0);
-				DoCommandP(0, 13, _opt_newgame.diff.quantity_sea_lakes, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
-				break;
-		}
-		SetWindowDirty(w);
-		break;
-
-	case WE_ON_EDIT_TEXT: {
-		if (e->we.edittext.str != NULL) {
-			int32 value = atoi(e->we.edittext.str);
-
-			switch (WP(w, generate_d).widget_id) {
-			case GLAND_START_DATE_TEXT:
-				InvalidateWidget(w, GLAND_START_DATE_TEXT);
-				_patches_newgame.starting_year = Clamp(value, MIN_YEAR, MAX_YEAR);
-				break;
-			case GLAND_SNOW_LEVEL_TEXT:
-				InvalidateWidget(w, GLAND_SNOW_LEVEL_TEXT);
-				_patches_newgame.snow_line_height = Clamp(value, 2, MAX_SNOWLINE_HEIGHT);
-				break;
-			}
-
-			SetWindowDirty(w);
-		}
-		break;
-	}
 	}
 }
 
@@ -591,9 +622,11 @@
 	CSCEN_MAPSIZE_X_PULLDOWN,
 	CSCEN_MAPSIZE_Y_TEXT,
 	CSCEN_MAPSIZE_Y_PULLDOWN,
+	CSCEN_START_DATE_LABEL,
 	CSCEN_START_DATE_DOWN,
 	CSCEN_START_DATE_TEXT,
 	CSCEN_START_DATE_UP,
+	CSCEN_FLAT_LAND_HEIGHT_LABEL,
 	CSCEN_FLAT_LAND_HEIGHT_DOWN,
 	CSCEN_FLAT_LAND_HEIGHT_TEXT,
 	CSCEN_FLAT_LAND_HEIGHT_UP
@@ -602,115 +635,123 @@
 
 static void CreateScenarioWndProc(Window *w, WindowEvent *e)
 {
-	static const StringID mapsizes[] = {STR_64, STR_128, STR_256, STR_512, STR_1024, STR_2048, INVALID_STRING_ID};
-
 	switch (e->event) {
-	case WE_CREATE: w->LowerWidget(_opt_newgame.landscape + CSCEN_TEMPERATE); break;
-
-	case WE_PAINT:
-		w->SetWidgetDisabledState(CSCEN_START_DATE_DOWN,       _patches_newgame.starting_year <= MIN_YEAR);
-		w->SetWidgetDisabledState(CSCEN_START_DATE_UP,         _patches_newgame.starting_year >= MAX_YEAR);
-		w->SetWidgetDisabledState(CSCEN_FLAT_LAND_HEIGHT_DOWN, _patches_newgame.se_flat_world_height <= 0);
-		w->SetWidgetDisabledState(CSCEN_FLAT_LAND_HEIGHT_UP,   _patches_newgame.se_flat_world_height >= MAX_TILE_HEIGHT);
-
-		w->SetWidgetLoweredState(CSCEN_TEMPERATE, _opt_newgame.landscape == LT_TEMPERATE);
-		w->SetWidgetLoweredState(CSCEN_ARCTIC,    _opt_newgame.landscape == LT_ARCTIC);
-		w->SetWidgetLoweredState(CSCEN_TROPICAL,  _opt_newgame.landscape == LT_TROPIC);
-		w->SetWidgetLoweredState(CSCEN_TOYLAND,   _opt_newgame.landscape == LT_TOYLAND);
-		DrawWindowWidgets(w);
-
-		DrawStringRightAligned(211, 97, STR_MAPSIZE, TC_FROMSTRING);
-		DrawString(            221, 97, mapsizes[_patches_newgame.map_x - 6], TC_BLACK);
-		DrawStringCentered(    272, 97, STR_BY, TC_FROMSTRING);
-		DrawString(            284, 97, mapsizes[_patches_newgame.map_y - 6], TC_BLACK);
-
-		DrawStringRightAligned(211, 115, STR_DATE, TC_FROMSTRING);
-		SetDParam(0, ConvertYMDToDate(_patches_newgame.starting_year, 0, 1));
-		DrawStringCentered(271, 115, STR_GENERATE_DATE, TC_FROMSTRING);
+		case WE_CREATE:
+			w->LowerWidget(_opt_newgame.landscape + CSCEN_TEMPERATE);
+			break;
 
-		DrawStringRightAligned(278, 133, STR_FLAT_WORLD_HEIGHT, TC_FROMSTRING);
-		SetDParam(0, _patches_newgame.se_flat_world_height);
-		DrawStringCentered(303, 133, STR_FLAT_WORLD_HEIGHT_NUM, TC_BLACK);
+		case WE_PAINT:
+			w->SetWidgetDisabledState(CSCEN_START_DATE_DOWN,       _patches_newgame.starting_year <= MIN_YEAR);
+			w->SetWidgetDisabledState(CSCEN_START_DATE_UP,         _patches_newgame.starting_year >= MAX_YEAR);
+			w->SetWidgetDisabledState(CSCEN_FLAT_LAND_HEIGHT_DOWN, _patches_newgame.se_flat_world_height <= 0);
+			w->SetWidgetDisabledState(CSCEN_FLAT_LAND_HEIGHT_UP,   _patches_newgame.se_flat_world_height >= MAX_TILE_HEIGHT);
 
-		break;
-	case WE_CLICK:
-		switch (e->we.click.widget) {
-		case CSCEN_TEMPERATE: case CSCEN_ARCTIC: case CSCEN_TROPICAL: case CSCEN_TOYLAND:
-			w->RaiseWidget(_opt_newgame.landscape + CSCEN_TEMPERATE);
-			SetNewLandscapeType(e->we.click.widget - CSCEN_TEMPERATE);
+			w->SetWidgetLoweredState(CSCEN_TEMPERATE, _opt_newgame.landscape == LT_TEMPERATE);
+			w->SetWidgetLoweredState(CSCEN_ARCTIC,    _opt_newgame.landscape == LT_ARCTIC);
+			w->SetWidgetLoweredState(CSCEN_TROPICAL,  _opt_newgame.landscape == LT_TROPIC);
+			w->SetWidgetLoweredState(CSCEN_TOYLAND,   _opt_newgame.landscape == LT_TOYLAND);
+
+			/* Set parameters for widget text that requires them */
+			SetDParam(0, ConvertYMDToDate(_patches_newgame.starting_year, 0, 1)); // CSCEN_START_DATE_TEXT
+			SetDParam(1, 1 << _patches_newgame.map_x); // CSCEN_MAPSIZE_X_PULLDOWN
+			SetDParam(2, 1 << _patches_newgame.map_y); // CSCEN_MAPSIZE_Y_PULLDOWN
+			SetDParam(3, _patches_newgame.se_flat_world_height); // CSCEN_FLAT_LAND_HEIGHT_TEXT
+
+			DrawWindowWidgets(w);
+
 			break;
-		case CSCEN_MAPSIZE_X_TEXT: case CSCEN_MAPSIZE_X_PULLDOWN: // Mapsize X
-			ShowDropDownMenu(w, mapsizes, _patches_newgame.map_x - 6, CSCEN_MAPSIZE_X_PULLDOWN, 0, 0);
-			break;
-		case CSCEN_MAPSIZE_Y_TEXT: case CSCEN_MAPSIZE_Y_PULLDOWN: // Mapsize Y
-			ShowDropDownMenu(w, mapsizes, _patches_newgame.map_y - 6, CSCEN_MAPSIZE_Y_PULLDOWN, 0, 0);
+
+		case WE_CLICK:
+			switch (e->we.click.widget) {
+				case CSCEN_TEMPERATE:
+				case CSCEN_ARCTIC:
+				case CSCEN_TROPICAL:
+				case CSCEN_TOYLAND:
+					w->RaiseWidget(_opt_newgame.landscape + CSCEN_TEMPERATE);
+					SetNewLandscapeType(e->we.click.widget - CSCEN_TEMPERATE);
+					break;
+
+				case CSCEN_MAPSIZE_X_PULLDOWN: // Mapsize X
+					ShowDropDownList(w, BuildMapsizeDropDown(), _patches_newgame.map_x, CSCEN_MAPSIZE_X_PULLDOWN);
+					break;
+
+				case CSCEN_MAPSIZE_Y_PULLDOWN: // Mapsize Y
+					ShowDropDownList(w, BuildMapsizeDropDown(), _patches_newgame.map_y, CSCEN_MAPSIZE_Y_PULLDOWN);
+					break;
+
+				case CSCEN_EMPTY_WORLD: // Empty world / flat world
+					StartGeneratingLandscape(GLWP_SCENARIO);
+					break;
+
+				case CSCEN_RANDOM_WORLD: // Generate
+					ShowGenerateLandscape();
+					break;
+
+				case CSCEN_START_DATE_DOWN:
+				case CSCEN_START_DATE_UP: // Year buttons
+					/* Don't allow too fast scrolling */
+					if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
+						w->HandleButtonClick(e->we.click.widget);
+						SetWindowDirty(w);
+
+						_patches_newgame.starting_year = Clamp(_patches_newgame.starting_year + e->we.click.widget - CSCEN_START_DATE_TEXT, MIN_YEAR, MAX_YEAR);
+					}
+					_left_button_clicked = false;
+					break;
+
+				case CSCEN_START_DATE_TEXT: // Year text
+					WP(w, generate_d).widget_id = CSCEN_START_DATE_TEXT;
+					SetDParam(0, _patches_newgame.starting_year);
+					ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_START_DATE_QUERY_CAPT, 8, 100, w, CS_NUMERAL);
+					break;
+
+				case CSCEN_FLAT_LAND_HEIGHT_DOWN:
+				case CSCEN_FLAT_LAND_HEIGHT_UP: // Height level buttons
+					/* Don't allow too fast scrolling */
+					if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
+						w->HandleButtonClick(e->we.click.widget);
+						SetWindowDirty(w);
+
+						_patches_newgame.se_flat_world_height = Clamp(_patches_newgame.se_flat_world_height + e->we.click.widget - CSCEN_FLAT_LAND_HEIGHT_TEXT, 0, MAX_TILE_HEIGHT);
+					}
+					_left_button_clicked = false;
+					break;
+
+				case CSCEN_FLAT_LAND_HEIGHT_TEXT: // Height level text
+					WP(w, generate_d).widget_id = CSCEN_FLAT_LAND_HEIGHT_TEXT;
+					SetDParam(0, _patches_newgame.se_flat_world_height);
+					ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_FLAT_WORLD_HEIGHT_QUERY_CAPT, 3, 100, w, CS_NUMERAL);
+					break;
+			}
 			break;
-		case CSCEN_EMPTY_WORLD: // Empty world / flat world
-			StartGeneratingLandscape(GLWP_SCENARIO);
+
+		case WE_DROPDOWN_SELECT:
+			switch (e->we.dropdown.button) {
+				case CSCEN_MAPSIZE_X_PULLDOWN: _patches_newgame.map_x = e->we.dropdown.index; break;
+				case CSCEN_MAPSIZE_Y_PULLDOWN: _patches_newgame.map_y = e->we.dropdown.index; break;
+			}
+			SetWindowDirty(w);
 			break;
-		case CSCEN_RANDOM_WORLD: // Generate
-			ShowGenerateLandscape();
-			break;
-		case CSCEN_START_DATE_DOWN: case CSCEN_START_DATE_UP: // Year buttons
-			/* Don't allow too fast scrolling */
-			if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
-				HandleButtonClick(w, e->we.click.widget);
+
+		case WE_ON_EDIT_TEXT:
+			if (e->we.edittext.str != NULL) {
+				int32 value = atoi(e->we.edittext.str);
+
+				switch (WP(w, generate_d).widget_id) {
+					case CSCEN_START_DATE_TEXT:
+						w->InvalidateWidget(CSCEN_START_DATE_TEXT);
+						_patches_newgame.starting_year = Clamp(value, MIN_YEAR, MAX_YEAR);
+						break;
+
+					case CSCEN_FLAT_LAND_HEIGHT_TEXT:
+						w->InvalidateWidget(CSCEN_FLAT_LAND_HEIGHT_TEXT);
+						_patches_newgame.se_flat_world_height = Clamp(value, 0, MAX_TILE_HEIGHT);
+						break;
+				}
+
 				SetWindowDirty(w);
-
-				_patches_newgame.starting_year = Clamp(_patches_newgame.starting_year + e->we.click.widget - CSCEN_START_DATE_TEXT, MIN_YEAR, MAX_YEAR);
 			}
-			_left_button_clicked = false;
-			break;
-		case CSCEN_START_DATE_TEXT: // Year text
-			WP(w, generate_d).widget_id = CSCEN_START_DATE_TEXT;
-			SetDParam(0, _patches_newgame.starting_year);
-			ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_START_DATE_QUERY_CAPT, 8, 100, w, CS_NUMERAL);
-			break;
-		case CSCEN_FLAT_LAND_HEIGHT_DOWN: case CSCEN_FLAT_LAND_HEIGHT_UP: // Height level buttons
-			/* Don't allow too fast scrolling */
-			if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
-				HandleButtonClick(w, e->we.click.widget);
-				SetWindowDirty(w);
-
-				_patches_newgame.se_flat_world_height = Clamp(_patches_newgame.se_flat_world_height + e->we.click.widget - CSCEN_FLAT_LAND_HEIGHT_TEXT, 0, MAX_TILE_HEIGHT);
-			}
-			_left_button_clicked = false;
-			break;
-		case CSCEN_FLAT_LAND_HEIGHT_TEXT: // Height level text
-			WP(w, generate_d).widget_id = CSCEN_FLAT_LAND_HEIGHT_TEXT;
-			SetDParam(0, _patches_newgame.se_flat_world_height);
-			ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_FLAT_WORLD_HEIGHT_QUERY_CAPT, 3, 100, w, CS_NUMERAL);
 			break;
-		}
-		break;
-
-	case WE_DROPDOWN_SELECT:
-		switch (e->we.dropdown.button) {
-			case CSCEN_MAPSIZE_X_PULLDOWN: _patches_newgame.map_x = e->we.dropdown.index + 6; break;
-			case CSCEN_MAPSIZE_Y_PULLDOWN: _patches_newgame.map_y = e->we.dropdown.index + 6; break;
-		}
-		SetWindowDirty(w);
-		break;
-
-	case WE_ON_EDIT_TEXT: {
-		if (e->we.edittext.str != NULL) {
-			int32 value = atoi(e->we.edittext.str);
-
-			switch (WP(w, generate_d).widget_id) {
-			case CSCEN_START_DATE_TEXT:
-				InvalidateWidget(w, CSCEN_START_DATE_TEXT);
-				_patches_newgame.starting_year = Clamp(value, MIN_YEAR, MAX_YEAR);
-				break;
-			case CSCEN_FLAT_LAND_HEIGHT_TEXT:
-				InvalidateWidget(w, CSCEN_FLAT_LAND_HEIGHT_TEXT);
-				_patches_newgame.se_flat_world_height = Clamp(value, 0, MAX_TILE_HEIGHT);
-				break;
-			}
-
-			SetWindowDirty(w);
-		}
-		break;
-	}
 	}
 }
 
@@ -727,17 +768,19 @@
 {    WWT_TEXTBTN, RESIZE_NONE,  6,  12, 115,  95, 124, STR_SE_FLAT_WORLD,       STR_SE_FLAT_WORLD_TIP},         // Empty (sea-level) map
 {    WWT_TEXTBTN, RESIZE_NONE,  6,  12, 115, 131, 160, STR_SE_RANDOM_LAND,      STR_022A_GENERATE_RANDOM_LAND}, // Generate
 
-{      WWT_PANEL, RESIZE_NONE, 12, 216, 251,  95, 106, 0x0,                     STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 252, 263,  95, 106, STR_0225,                STR_NULL}, // Mapsize X
-{      WWT_PANEL, RESIZE_NONE, 12, 279, 314,  95, 106, 0x0,                     STR_NULL},
-{    WWT_TEXTBTN, RESIZE_NONE, 12, 315, 326,  95, 106, STR_0225,                STR_NULL}, // Mapsize Y
+{       WWT_TEXT, RESIZE_NONE, 12, 182, 212,  96, 106, STR_MAPSIZE,             STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 216, 263,  95, 106, STR_NUM_1,               STR_NULL}, // Mapsize X
+{       WWT_TEXT, RESIZE_NONE, 12, 268, 276,  96, 106, STR_BY,                  STR_NULL},
+{   WWT_DROPDOWN, RESIZE_NONE, 12, 279, 326,  95, 106, STR_NUM_2,               STR_NULL}, // Mapsize Y
 
+{       WWT_TEXT, RESIZE_NONE,  0, 182, 212, 114, 124, STR_DATE,                STR_NULL},
 {     WWT_IMGBTN, RESIZE_NONE, 12, 216, 227, 113, 124, SPR_ARROW_DOWN,          STR_029E_MOVE_THE_STARTING_DATE},
-{      WWT_PANEL, RESIZE_NONE, 12, 228, 314, 113, 124, 0x0,                     STR_NULL},
+{    WWT_TEXTBTN, RESIZE_NONE, 12, 228, 314, 113, 124, STR_GENERATE_DATE,       STR_NULL},
 {     WWT_IMGBTN, RESIZE_NONE, 12, 315, 326, 113, 124, SPR_ARROW_UP,            STR_029F_MOVE_THE_STARTING_DATE},
 
+{       WWT_TEXT, RESIZE_NONE,  0, 182, 278, 132, 142, STR_FLAT_WORLD_HEIGHT,   STR_NULL},
 {     WWT_IMGBTN, RESIZE_NONE, 12, 282, 293, 131, 142, SPR_ARROW_DOWN,          STR_FLAT_WORLD_HEIGHT_DOWN},
-{      WWT_PANEL, RESIZE_NONE, 12, 294, 314, 131, 142, 0x0,                     STR_NULL},
+{    WWT_TEXTBTN, RESIZE_NONE, 12, 294, 314, 131, 142, STR_NUM_3,               STR_NULL},
 {     WWT_IMGBTN, RESIZE_NONE, 12, 315, 326, 131, 142, SPR_ARROW_UP,            STR_FLAT_WORLD_HEIGHT_UP},
 {   WIDGETS_END},
 };
@@ -786,39 +829,39 @@
 static void ShowTerrainProgressProc(Window* w, WindowEvent* e)
 {
 	switch (e->event) {
-	case WE_CLICK:
-		switch (e->we.click.widget) {
-		case 2:
-			if (_cursor.sprite == SPR_CURSOR_ZZZ) SetMouseCursor(SPR_CURSOR_MOUSE, PAL_NONE);
-			ShowQuery(
-				STR_GENERATION_ABORT_CAPTION,
-				STR_GENERATION_ABORT_MESSAGE,
-				w,
-				AbortGeneratingWorldCallback
-			);
+		case WE_CLICK:
+			switch (e->we.click.widget) {
+				case 2:
+					if (_cursor.sprite == SPR_CURSOR_ZZZ) SetMouseCursor(SPR_CURSOR_MOUSE, PAL_NONE);
+					ShowQuery(
+						STR_GENERATION_ABORT_CAPTION,
+						STR_GENERATION_ABORT_MESSAGE,
+						w,
+						AbortGeneratingWorldCallback
+					);
+					break;
+			}
 			break;
-		}
-		break;
 
-	case WE_PAINT:
-		DrawWindowWidgets(w);
-
-		/* Draw the % complete with a bar and a text */
-		DrawFrameRect(19, 20, (w->width - 18), 37, 14, FR_BORDERONLY);
-		DrawFrameRect(20, 21, (int)((w->width - 40) * _tp.percent / 100) + 20, 36, 10, FR_NONE);
-		SetDParam(0, _tp.percent);
-		DrawStringCentered(90, 25, STR_PROGRESS, TC_FROMSTRING);
+		case WE_PAINT:
+			DrawWindowWidgets(w);
 
-		/* Tell which class we are generating */
-		DrawStringCentered(90, 46, _tp.cls, TC_FROMSTRING);
+			/* Draw the % complete with a bar and a text */
+			DrawFrameRect(19, 20, (w->width - 18), 37, 14, FR_BORDERONLY);
+			DrawFrameRect(20, 21, (int)((w->width - 40) * _tp.percent / 100) + 20, 36, 10, FR_NONE);
+			SetDParam(0, _tp.percent);
+			DrawStringCentered(90, 25, STR_PROGRESS, TC_FROMSTRING);
 
-		/* And say where we are in that class */
-		SetDParam(0, _tp.current);
-		SetDParam(1, _tp.total);
-		DrawStringCentered(90, 58, STR_GENERATION_PROGRESS, TC_FROMSTRING);
+			/* Tell which class we are generating */
+			DrawStringCentered(90, 46, _tp.cls, TC_FROMSTRING);
 
-		SetWindowDirty(w);
-		break;
+			/* And say where we are in that class */
+			SetDParam(0, _tp.current);
+			SetDParam(1, _tp.total);
+			DrawStringCentered(90, 58, STR_GENERATION_PROGRESS, TC_FROMSTRING);
+
+			SetWindowDirty(w);
+			break;
 	}
 }
 
--- a/src/gfx.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/gfx.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,23 +4,23 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
-#include "macros.h"
+#include "gfx_func.h"
 #include "spritecache.h"
-#include "strings.h"
-#include "string.h"
-#include "gfx.h"
-#include "table/palettes.h"
-#include "table/sprites.h"
 #include "variables.h"
-#include "table/control_codes.h"
 #include "fontcache.h"
 #include "genworld.h"
 #include "debug.h"
-#include "zoom.hpp"
+#include "zoom_func.h"
 #include "texteff.hpp"
 #include "blitter/factory.hpp"
 #include "video/video_driver.hpp"
+#include "strings_func.h"
+#include "core/math_func.hpp"
+#include "settings_type.h"
+
+#include "table/palettes.h"
+#include "table/sprites.h"
+#include "table/control_codes.h"
 
 byte _dirkeys;        ///< 1 = left, 2 = up, 4 = right, 8 = down
 bool _fullscreen;
@@ -33,6 +33,7 @@
 bool _right_button_down;
 bool _right_button_clicked;
 DrawPixelInfo _screen;
+bool _screen_disable_anim = false;   ///< Disable palette animation (important for 32bpp-anim blitter during giant screenshot)
 bool _exit_game;
 bool _networking;         ///< are we in networking mode?
 byte _game_mode;
@@ -42,6 +43,9 @@
 
 Colour _cur_palette[256];
 byte _stringwidth_table[FS_END][224];
+DrawPixelInfo *_cur_dpi;
+byte _colour_gradient[16][8];
+bool _use_dos_palette;
 
 static void GfxMainBlitter(const Sprite *sprite, int x, int y, BlitterMode mode, const SubSprite *sub = NULL);
 
@@ -515,16 +519,16 @@
 }
 
 /** Return the string dimension in pixels. The height and width are returned
- * in a single BoundingRect value. TINYFONT, BIGFONT modifiers are only
+ * in a single Dimension value. TINYFONT, BIGFONT modifiers are only
  * supported as the first character of the string. The returned dimensions
  * are therefore a rough estimation correct for all the current strings
  * but not every possible combination
  * @param str string to calculate pixel-width
  * @return string width and height in pixels */
-BoundingRect GetStringBoundingBox(const char *str)
+Dimension GetStringBoundingBox(const char *str)
 {
 	FontSize size = _cur_fontsize;
-	BoundingRect br;
+	Dimension br;
 	int max_width;
 	WChar c;
 
@@ -562,7 +566,7 @@
  * @param x offset from left side of the screen, if negative offset from the right side
  * @param y offset from top side of the screen, if negative offset from the bottom
  * @param real_color colour of the string, see _string_colormap in
- * table/palettes.h or docs/ottd-colourtext-palette.png or the enum TextColour in gfx.h
+ * table/palettes.h or docs/ottd-colourtext-palette.png or the enum TextColour in gfx_type.h
  * @return the x-coordinates where the drawing has finished. If nothing is drawn
  * the originally passed x-coordinate is returned */
 int DoDrawString(const char *string, int x, int y, uint16 real_color)
@@ -1273,12 +1277,13 @@
 	return (_screen.width == width && _screen.height == height) || _video_driver->ChangeResolution(width, height);
 }
 
-void ToggleFullScreen(bool fs)
+bool ToggleFullScreen(bool fs)
 {
-	_video_driver->ToggleFullscreen(fs);
+	bool result = _video_driver->ToggleFullscreen(fs);
 	if (_fullscreen != fs && _num_resolutions == 0) {
 		DEBUG(driver, 0, "Could not find a suitable fullscreen resolution");
 	}
+	return result;
 }
 
 static int CDECL compare_res(const void *pa, const void *pb)
--- a/src/gfx.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,398 +0,0 @@
-/* $Id$ */
-
-/** @file gfx.h */
-
-/**
- * @defgroup dirty Dirty
- *
- * Handles the repaint of some part of the screen.
- *
- * Some places in the code are called functions which makes something "dirty".
- * This has nothing to do with making a Tile or Window darker or less visible.
- * This term comes from memory caching and is used to define an object must
- * be repaint. If some data of an object (like a Tile, Window, Vehicle, whatever)
- * are changed which are so extensive the object must be repaint its marked
- * as "dirty". The video driver repaint this object instead of the whole screen
- * (this is btw. also possible if needed). This is used to avoid a
- * flickering of the screen by the video driver constantly repainting it.
- *
- * This whole mechanism is controlled by an rectangle defined in #_invalid_rect. This
- * rectangle defines the area on the screen which must be repaint. If a new object
- * needs to be repainted this rectangle is extended to 'catch' the object on the
- * screen. At some point (which is normaly uninteressted for patch writers) this
- * rectangle is send to the video drivers method
- * VideoDriver::MakeDirty and it is truncated back to an empty rectangle. At some
- * later point (which is uninteressted, too) the video driver
- * repaints all these saved rectangle instead of the whole screen and drop the
- * rectangle informations. Then a new round begins by marking objects "dirty".
- *
- * @see VideoDriver::MakeDirty
- * @see _invalid_rect
- * @see _screen
- */
-
-
-#ifndef GFX_H
-#define GFX_H
-
-#include "openttd.h"
-#include "zoom.hpp"
-
-enum WindowKeyCodes {
-	WKC_SHIFT = 0x8000,
-	WKC_CTRL  = 0x4000,
-	WKC_ALT   = 0x2000,
-	WKC_META  = 0x1000,
-
-	/* Special ones */
-	WKC_NONE        =  0,
-	WKC_ESC         =  1,
-	WKC_BACKSPACE   =  2,
-	WKC_INSERT      =  3,
-	WKC_DELETE      =  4,
-
-	WKC_PAGEUP      =  5,
-	WKC_PAGEDOWN    =  6,
-	WKC_END         =  7,
-	WKC_HOME        =  8,
-
-	/* Arrow keys */
-	WKC_LEFT        =  9,
-	WKC_UP          = 10,
-	WKC_RIGHT       = 11,
-	WKC_DOWN        = 12,
-
-	/* Return & tab */
-	WKC_RETURN      = 13,
-	WKC_TAB         = 14,
-
-	/* Space */
-	WKC_SPACE       = 32,
-
-	/* Function keys */
-	WKC_F1          = 33,
-	WKC_F2          = 34,
-	WKC_F3          = 35,
-	WKC_F4          = 36,
-	WKC_F5          = 37,
-	WKC_F6          = 38,
-	WKC_F7          = 39,
-	WKC_F8          = 40,
-	WKC_F9          = 41,
-	WKC_F10         = 42,
-	WKC_F11         = 43,
-	WKC_F12         = 44,
-
-	/* Backquote is the key left of "1"
-	 * we only store this key here, no matter what character is really mapped to it
-	 * on a particular keyboard. (US keyboard: ` and ~ ; German keyboard: ^ and °) */
-	WKC_BACKQUOTE   = 45,
-	WKC_PAUSE       = 46,
-
-	/* 0-9 are mapped to 48-57
-	 * A-Z are mapped to 65-90
-	 * a-z are mapped to 97-122 */
-
-	/* Numerical keyboard */
-	WKC_NUM_0       = 128,
-	WKC_NUM_1       = 129,
-	WKC_NUM_2       = 130,
-	WKC_NUM_3       = 131,
-	WKC_NUM_4       = 132,
-	WKC_NUM_5       = 133,
-	WKC_NUM_6       = 134,
-	WKC_NUM_7       = 135,
-	WKC_NUM_8       = 136,
-	WKC_NUM_9       = 137,
-	WKC_NUM_DIV     = 138,
-	WKC_NUM_MUL     = 139,
-	WKC_NUM_MINUS   = 140,
-	WKC_NUM_PLUS    = 141,
-	WKC_NUM_ENTER   = 142,
-	WKC_NUM_DECIMAL = 143,
-
-	/* Other keys */
-	WKC_SLASH       = 144, ///< / Forward slash
-	WKC_SEMICOLON   = 145, ///< ; Semicolon
-	WKC_EQUALS      = 146, ///< = Equals
-	WKC_L_BRACKET   = 147, ///< [ Left square bracket
-	WKC_BACKSLASH   = 148, ///< \ Backslash
-	WKC_R_BRACKET   = 149, ///< ] Right square bracket
-	WKC_SINGLEQUOTE = 150, ///< ' Single quote
-	WKC_COMMA       = 151, ///< , Comma
-	WKC_PERIOD      = 152, ///< . Period
-	WKC_MINUS       = 153, ///< - Minus
-};
-
-enum GameModes {
-	GM_MENU,
-	GM_NORMAL,
-	GM_EDITOR
-};
-
-void GameLoop();
-
-void CreateConsole();
-
-typedef int32 CursorID;
-
-struct Point {
-	int x, y;
-};
-
-struct Rect {
-	int left,top,right,bottom;
-};
-
-/** A single sprite of a list of animated cursors */
-struct AnimCursor {
-	static const CursorID LAST = MAX_UVALUE(CursorID);
-	CursorID sprite;   ///< Must be set to LAST_ANIM when it is the last sprite of the loop
-	byte display_time; ///< Amount of ticks this sprite will be shown
-};
-
-struct CursorVars {
-	Point pos, size, offs, delta; ///< position, size, offset from top-left, and movement
-	Point draw_pos, draw_size;    ///< position and size bounding-box for drawing
-	SpriteID sprite; ///< current image of cursor
-	SpriteID pal;
-
-	int wheel;       ///< mouse wheel movement
-
-	/* We need two different vars to keep track of how far the scrollwheel moved.
-	 * OSX uses this for scrolling around the map. */
-	int v_wheel;
-	int h_wheel;
-
-	const AnimCursor *animate_list; ///< in case of animated cursor, list of frames
-	const AnimCursor *animate_cur;  ///< in case of animated cursor, current frame
-	uint animate_timeout;           ///< in case of animated cursor, number of ticks to show the current cursor
-
-	bool visible;    ///< cursor is visible
-	bool dirty;      ///< the rect occupied by the mouse is dirty (redraw)
-	bool fix_at;     ///< mouse is moving, but cursor is not (used for scrolling)
-	bool in_window;  ///< mouse inside this window, determines drawing logic
-};
-
-struct DrawPixelInfo {
-	void *dst_ptr;
-	int left, top, width, height;
-	int pitch;
-	ZoomLevel zoom;
-};
-
-struct Colour {
-	byte r;
-	byte g;
-	byte b;
-};
-
-
-
-extern byte _dirkeys;        ///< 1 = left, 2 = up, 4 = right, 8 = down
-extern bool _fullscreen;
-extern CursorVars _cursor;
-extern bool _ctrl_pressed;   ///< Is Ctrl pressed?
-extern bool _shift_pressed;  ///< Is Shift pressed?
-extern byte _fast_forward;
-
-extern bool _left_button_down;
-extern bool _left_button_clicked;
-extern bool _right_button_down;
-extern bool _right_button_clicked;
-
-extern DrawPixelInfo _screen;
-extern bool _exit_game;
-extern bool _networking;         ///< are we in networking mode?
-extern byte _game_mode;
-extern byte _pause_game;
-
-extern int _pal_first_dirty;
-extern int _pal_count_dirty;
-extern int _num_resolutions;
-extern uint16 _resolutions[32][2];
-extern uint16 _cur_resolution[2];
-extern Colour _cur_palette[256];
-
-void HandleKeypress(uint32 key);
-void HandleMouseEvents();
-void CSleep(int milliseconds);
-void UpdateWindows();
-
-uint32 InteractiveRandom(); //< Used for random sequences that are not the same on the other end of the multiplayer link
-uint InteractiveRandomRange(uint max);
-void DrawChatMessage();
-void DrawMouseCursor();
-void ScreenSizeChanged();
-void HandleExitGameRequest();
-void GameSizeChanged();
-void UndrawMouseCursor();
-
-#include "helpers.hpp"
-
-enum FontSize {
-	FS_NORMAL,
-	FS_SMALL,
-	FS_LARGE,
-	FS_END,
-};
-
-DECLARE_POSTFIX_INCREMENT(FontSize);
-
-void RedrawScreenRect(int left, int top, int right, int bottom);
-void GfxScroll(int left, int top, int width, int height, int xo, int yo);
-
-/**
- * Used to only draw a part of the sprite.
- * Draw the subsprite in the rect (sprite_x_offset + left, sprite_y_offset + top) to (sprite_x_offset + right, sprite_y_offset + bottom).
- * Both corners are included in the drawing area.
- */
-struct SubSprite {
-	int left, top, right, bottom;
-};
-
-void DrawSprite(SpriteID img, SpriteID pal, int x, int y, const SubSprite *sub = NULL);
-
-/* XXX doesn't really belong here, but the only
- * consumers always use it in conjunction with DoDrawString() */
-#define UPARROW   "\xEE\x8A\x80"
-#define DOWNARROW "\xEE\x8A\xAA"
-
-
-int DrawStringCentered(int x, int y, StringID str, uint16 color);
-int DrawStringCenteredTruncated(int xl, int xr, int y, StringID str, uint16 color);
-int DoDrawStringCentered(int x, int y, const char *str, uint16 color);
-
-int DrawString(int x, int y, StringID str, uint16 color);
-int DrawStringTruncated(int x, int y, StringID str, uint16 color, uint maxw);
-
-int DoDrawString(const char *string, int x, int y, uint16 color);
-int DoDrawStringTruncated(const char *str, int x, int y, uint16 color, uint maxw);
-
-void DrawStringCenterUnderline(int x, int y, StringID str, uint16 color);
-void DrawStringCenterUnderlineTruncated(int xl, int xr, int y, StringID str, uint16 color);
-
-int DrawStringRightAligned(int x, int y, StringID str, uint16 color);
-void DrawStringRightAlignedTruncated(int x, int y, StringID str, uint16 color, uint maxw);
-void DrawStringRightAlignedUnderline(int x, int y, StringID str, uint16 color);
-
-void GfxFillRect(int left, int top, int right, int bottom, int color);
-void GfxDrawLine(int left, int top, int right, int bottom, int color);
-void DrawBox(int x, int y, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3);
-
-BoundingRect GetStringBoundingBox(const char *str);
-uint32 FormatStringLinebreaks(char *str, int maxw);
-void LoadStringWidthTable();
-void DrawStringMultiCenter(int x, int y, StringID str, int maxw);
-uint DrawStringMultiLine(int x, int y, StringID str, int maxw, int maxh = -1);
-
-/**
- * Let the dirty blocks repainting by the video driver.
- *
- * @ingroup dirty
- */
-void DrawDirtyBlocks();
-
-/**
- * Set a new dirty block.
- *
- * @ingroup dirty
- */
-void SetDirtyBlocks(int left, int top, int right, int bottom);
-
-/**
- * Marks the whole screen as dirty.
- *
- * @ingroup dirty
- */
-void MarkWholeScreenDirty();
-
-void GfxInitPalettes();
-
-bool FillDrawPixelInfo(DrawPixelInfo* n, int left, int top, int width, int height);
-
-/* window.cpp */
-void DrawOverlappedWindowForAll(int left, int top, int right, int bottom);
-
-void SetMouseCursor(SpriteID sprite, SpriteID pal);
-void SetAnimatedMouseCursor(const AnimCursor *table);
-void CursorTick();
-void DrawMouseCursor();
-void ScreenSizeChanged();
-void UndrawMouseCursor();
-bool ChangeResInGame(int w, int h);
-void SortResolutions(int count);
-void ToggleFullScreen(bool fs);
-
-/* gfx.cpp */
-#define ASCII_LETTERSTART 32
-extern FontSize _cur_fontsize;
-
-byte GetCharacterWidth(FontSize size, uint32 key);
-
-static inline byte GetCharacterHeight(FontSize size)
-{
-	switch (size) {
-		default: NOT_REACHED();
-		case FS_NORMAL: return 10;
-		case FS_SMALL:  return 6;
-		case FS_LARGE:  return 18;
-	}
-}
-
-VARDEF DrawPixelInfo *_cur_dpi;
-
-enum {
-	COLOUR_DARK_BLUE,
-	COLOUR_PALE_GREEN,
-	COLOUR_PINK,
-	COLOUR_YELLOW,
-	COLOUR_RED,
-	COLOUR_LIGHT_BLUE,
-	COLOUR_GREEN,
-	COLOUR_DARK_GREEN,
-	COLOUR_BLUE,
-	COLOUR_CREAM,
-	COLOUR_MAUVE,
-	COLOUR_PURPLE,
-	COLOUR_ORANGE,
-	COLOUR_BROWN,
-	COLOUR_GREY,
-	COLOUR_WHITE
-};
-
-/** Colour of the strings, see _string_colormap in table/palettes.h or docs/ottd-colourtext-palette.png */
-enum TextColour {
-	TC_FROMSTRING  = 0x00,
-	TC_BLUE        = 0x00,
-	TC_SILVER      = 0x01,
-	TC_GOLD        = 0x02,
-	TC_RED         = 0x03,
-	TC_PURPLE      = 0x04,
-	TC_LIGHT_BROWN = 0x05,
-	TC_ORANGE      = 0x06,
-	TC_GREEN       = 0x07,
-	TC_YELLOW      = 0x08,
-	TC_DARK_GREEN  = 0x09,
-	TC_CREAM       = 0x0A,
-	TC_BROWN       = 0x0B,
-	TC_WHITE       = 0x0C,
-	TC_LIGHT_BLUE  = 0x0D,
-	TC_GREY        = 0x0E,
-	TC_DARK_BLUE   = 0x0F,
-	TC_BLACK       = 0x10,
-};
-
-/**
- * All 16 colour gradients
- * 8 colours per gradient from darkest (0) to lightest (7)
- */
-VARDEF byte _colour_gradient[16][8];
-
-VARDEF bool _use_dos_palette;
-
-enum StringColorFlags {
-	IS_PALETTE_COLOR = 0x100, ///< color value is already a real palette color index, not an index of a StringColor
-};
-
-#endif /* GFX_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/gfx_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,177 @@
+/* $Id$ */
+
+/** @file gfx_func.h Functions related to the gfx engine. */
+
+/**
+ * @defgroup dirty Dirty
+ *
+ * Handles the repaint of some part of the screen.
+ *
+ * Some places in the code are called functions which makes something "dirty".
+ * This has nothing to do with making a Tile or Window darker or less visible.
+ * This term comes from memory caching and is used to define an object must
+ * be repaint. If some data of an object (like a Tile, Window, Vehicle, whatever)
+ * are changed which are so extensive the object must be repaint its marked
+ * as "dirty". The video driver repaint this object instead of the whole screen
+ * (this is btw. also possible if needed). This is used to avoid a
+ * flickering of the screen by the video driver constantly repainting it.
+ *
+ * This whole mechanism is controlled by an rectangle defined in #_invalid_rect. This
+ * rectangle defines the area on the screen which must be repaint. If a new object
+ * needs to be repainted this rectangle is extended to 'catch' the object on the
+ * screen. At some point (which is normaly uninteressted for patch writers) this
+ * rectangle is send to the video drivers method
+ * VideoDriver::MakeDirty and it is truncated back to an empty rectangle. At some
+ * later point (which is uninteressted, too) the video driver
+ * repaints all these saved rectangle instead of the whole screen and drop the
+ * rectangle informations. Then a new round begins by marking objects "dirty".
+ *
+ * @see VideoDriver::MakeDirty
+ * @see _invalid_rect
+ * @see _screen
+ */
+
+
+#ifndef GFX_FUNC_H
+#define GFX_FUNC_H
+
+#include "gfx_type.h"
+#include "strings_type.h"
+
+void GameLoop();
+
+void CreateConsole();
+
+extern byte _dirkeys;        ///< 1 = left, 2 = up, 4 = right, 8 = down
+extern bool _fullscreen;
+extern CursorVars _cursor;
+extern bool _ctrl_pressed;   ///< Is Ctrl pressed?
+extern bool _shift_pressed;  ///< Is Shift pressed?
+extern byte _fast_forward;
+
+extern bool _left_button_down;
+extern bool _left_button_clicked;
+extern bool _right_button_down;
+extern bool _right_button_clicked;
+
+extern DrawPixelInfo _screen;
+extern bool _screen_disable_anim;   ///< Disable palette animation (important for 32bpp-anim blitter during giant screenshot)
+
+extern int _pal_first_dirty;
+extern int _pal_count_dirty;
+extern int _num_resolutions;
+extern uint16 _resolutions[32][2];
+extern uint16 _cur_resolution[2];
+extern Colour _cur_palette[256];
+
+void HandleKeypress(uint32 key);
+void HandleMouseEvents();
+void CSleep(int milliseconds);
+void UpdateWindows();
+
+uint32 InteractiveRandom(); //< Used for random sequences that are not the same on the other end of the multiplayer link
+uint InteractiveRandomRange(uint max);
+void DrawChatMessage();
+void DrawMouseCursor();
+void ScreenSizeChanged();
+void HandleExitGameRequest();
+void GameSizeChanged();
+void UndrawMouseCursor();
+
+void RedrawScreenRect(int left, int top, int right, int bottom);
+void GfxScroll(int left, int top, int width, int height, int xo, int yo);
+
+void DrawSprite(SpriteID img, SpriteID pal, int x, int y, const SubSprite *sub = NULL);
+
+int DrawStringCentered(int x, int y, StringID str, uint16 color);
+int DrawStringCenteredTruncated(int xl, int xr, int y, StringID str, uint16 color);
+int DoDrawStringCentered(int x, int y, const char *str, uint16 color);
+
+int DrawString(int x, int y, StringID str, uint16 color);
+int DrawStringTruncated(int x, int y, StringID str, uint16 color, uint maxw);
+
+int DoDrawString(const char *string, int x, int y, uint16 color);
+int DoDrawStringTruncated(const char *str, int x, int y, uint16 color, uint maxw);
+
+void DrawStringCenterUnderline(int x, int y, StringID str, uint16 color);
+void DrawStringCenterUnderlineTruncated(int xl, int xr, int y, StringID str, uint16 color);
+
+int DrawStringRightAligned(int x, int y, StringID str, uint16 color);
+void DrawStringRightAlignedTruncated(int x, int y, StringID str, uint16 color, uint maxw);
+void DrawStringRightAlignedUnderline(int x, int y, StringID str, uint16 color);
+
+void GfxFillRect(int left, int top, int right, int bottom, int color);
+void GfxDrawLine(int left, int top, int right, int bottom, int color);
+void DrawBox(int x, int y, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3);
+
+Dimension GetStringBoundingBox(const char *str);
+uint32 FormatStringLinebreaks(char *str, int maxw);
+void LoadStringWidthTable();
+void DrawStringMultiCenter(int x, int y, StringID str, int maxw);
+uint DrawStringMultiLine(int x, int y, StringID str, int maxw, int maxh = -1);
+
+/**
+ * Let the dirty blocks repainting by the video driver.
+ *
+ * @ingroup dirty
+ */
+void DrawDirtyBlocks();
+
+/**
+ * Set a new dirty block.
+ *
+ * @ingroup dirty
+ */
+void SetDirtyBlocks(int left, int top, int right, int bottom);
+
+/**
+ * Marks the whole screen as dirty.
+ *
+ * @ingroup dirty
+ */
+void MarkWholeScreenDirty();
+
+void GfxInitPalettes();
+
+bool FillDrawPixelInfo(DrawPixelInfo* n, int left, int top, int width, int height);
+
+/* window.cpp */
+void DrawOverlappedWindowForAll(int left, int top, int right, int bottom);
+
+void SetMouseCursor(SpriteID sprite, SpriteID pal);
+void SetAnimatedMouseCursor(const AnimCursor *table);
+void CursorTick();
+void DrawMouseCursor();
+void ScreenSizeChanged();
+void UndrawMouseCursor();
+bool ChangeResInGame(int w, int h);
+void SortResolutions(int count);
+bool ToggleFullScreen(bool fs);
+
+/* gfx.cpp */
+#define ASCII_LETTERSTART 32
+extern FontSize _cur_fontsize;
+
+byte GetCharacterWidth(FontSize size, uint32 key);
+
+static inline byte GetCharacterHeight(FontSize size)
+{
+	switch (size) {
+		default: NOT_REACHED();
+		case FS_NORMAL: return 10;
+		case FS_SMALL:  return 6;
+		case FS_LARGE:  return 18;
+	}
+}
+
+extern DrawPixelInfo *_cur_dpi;
+
+/**
+ * All 16 colour gradients
+ * 8 colours per gradient from darkest (0) to lightest (7)
+ */
+extern byte _colour_gradient[16][8];
+
+extern bool _use_dos_palette;
+
+#endif /* GFX_FUNC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/gfx_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,210 @@
+/* $Id$ */
+
+/** @file gfx_type.h Types related to the graphics and/or input devices. */
+
+#ifndef GFX_TYPE_H
+#define GFX_TYPE_H
+
+#include "core/enum_type.hpp"
+#include "core/geometry_type.hpp"
+#include "zoom_type.h"
+
+typedef uint32 SpriteID;      ///< The number of a sprite, without mapping bits and colortables
+struct PalSpriteID {
+	SpriteID sprite;
+	SpriteID pal;
+};
+typedef int32 CursorID;
+
+enum WindowKeyCodes {
+	WKC_SHIFT = 0x8000,
+	WKC_CTRL  = 0x4000,
+	WKC_ALT   = 0x2000,
+	WKC_META  = 0x1000,
+
+	/* Special ones */
+	WKC_NONE        =  0,
+	WKC_ESC         =  1,
+	WKC_BACKSPACE   =  2,
+	WKC_INSERT      =  3,
+	WKC_DELETE      =  4,
+
+	WKC_PAGEUP      =  5,
+	WKC_PAGEDOWN    =  6,
+	WKC_END         =  7,
+	WKC_HOME        =  8,
+
+	/* Arrow keys */
+	WKC_LEFT        =  9,
+	WKC_UP          = 10,
+	WKC_RIGHT       = 11,
+	WKC_DOWN        = 12,
+
+	/* Return & tab */
+	WKC_RETURN      = 13,
+	WKC_TAB         = 14,
+
+	/* Space */
+	WKC_SPACE       = 32,
+
+	/* Function keys */
+	WKC_F1          = 33,
+	WKC_F2          = 34,
+	WKC_F3          = 35,
+	WKC_F4          = 36,
+	WKC_F5          = 37,
+	WKC_F6          = 38,
+	WKC_F7          = 39,
+	WKC_F8          = 40,
+	WKC_F9          = 41,
+	WKC_F10         = 42,
+	WKC_F11         = 43,
+	WKC_F12         = 44,
+
+	/* Backquote is the key left of "1"
+	 * we only store this key here, no matter what character is really mapped to it
+	 * on a particular keyboard. (US keyboard: ` and ~ ; German keyboard: ^ and °) */
+	WKC_BACKQUOTE   = 45,
+	WKC_PAUSE       = 46,
+
+	/* 0-9 are mapped to 48-57
+	 * A-Z are mapped to 65-90
+	 * a-z are mapped to 97-122 */
+
+	/* Numerical keyboard */
+	WKC_NUM_0       = 128,
+	WKC_NUM_1       = 129,
+	WKC_NUM_2       = 130,
+	WKC_NUM_3       = 131,
+	WKC_NUM_4       = 132,
+	WKC_NUM_5       = 133,
+	WKC_NUM_6       = 134,
+	WKC_NUM_7       = 135,
+	WKC_NUM_8       = 136,
+	WKC_NUM_9       = 137,
+	WKC_NUM_DIV     = 138,
+	WKC_NUM_MUL     = 139,
+	WKC_NUM_MINUS   = 140,
+	WKC_NUM_PLUS    = 141,
+	WKC_NUM_ENTER   = 142,
+	WKC_NUM_DECIMAL = 143,
+
+	/* Other keys */
+	WKC_SLASH       = 144, ///< / Forward slash
+	WKC_SEMICOLON   = 145, ///< ; Semicolon
+	WKC_EQUALS      = 146, ///< = Equals
+	WKC_L_BRACKET   = 147, ///< [ Left square bracket
+	WKC_BACKSLASH   = 148, ///< \ Backslash
+	WKC_R_BRACKET   = 149, ///< ] Right square bracket
+	WKC_SINGLEQUOTE = 150, ///< ' Single quote
+	WKC_COMMA       = 151, ///< , Comma
+	WKC_PERIOD      = 152, ///< . Period
+	WKC_MINUS       = 153, ///< - Minus
+};
+
+/** A single sprite of a list of animated cursors */
+struct AnimCursor {
+	static const CursorID LAST = MAX_UVALUE(CursorID);
+	CursorID sprite;   ///< Must be set to LAST_ANIM when it is the last sprite of the loop
+	byte display_time; ///< Amount of ticks this sprite will be shown
+};
+
+struct CursorVars {
+	Point pos, size, offs, delta; ///< position, size, offset from top-left, and movement
+	Point draw_pos, draw_size;    ///< position and size bounding-box for drawing
+	SpriteID sprite; ///< current image of cursor
+	SpriteID pal;
+
+	int wheel;       ///< mouse wheel movement
+
+	/* We need two different vars to keep track of how far the scrollwheel moved.
+	 * OSX uses this for scrolling around the map. */
+	int v_wheel;
+	int h_wheel;
+
+	const AnimCursor *animate_list; ///< in case of animated cursor, list of frames
+	const AnimCursor *animate_cur;  ///< in case of animated cursor, current frame
+	uint animate_timeout;           ///< in case of animated cursor, number of ticks to show the current cursor
+
+	bool visible;    ///< cursor is visible
+	bool dirty;      ///< the rect occupied by the mouse is dirty (redraw)
+	bool fix_at;     ///< mouse is moving, but cursor is not (used for scrolling)
+	bool in_window;  ///< mouse inside this window, determines drawing logic
+};
+
+struct DrawPixelInfo {
+	void *dst_ptr;
+	int left, top, width, height;
+	int pitch;
+	ZoomLevel zoom;
+};
+
+struct Colour {
+	byte r;
+	byte g;
+	byte b;
+};
+
+enum FontSize {
+	FS_NORMAL,
+	FS_SMALL,
+	FS_LARGE,
+	FS_END,
+};
+DECLARE_POSTFIX_INCREMENT(FontSize);
+
+/**
+ * Used to only draw a part of the sprite.
+ * Draw the subsprite in the rect (sprite_x_offset + left, sprite_y_offset + top) to (sprite_x_offset + right, sprite_y_offset + bottom).
+ * Both corners are included in the drawing area.
+ */
+struct SubSprite {
+	int left, top, right, bottom;
+};
+
+enum {
+	COLOUR_DARK_BLUE,
+	COLOUR_PALE_GREEN,
+	COLOUR_PINK,
+	COLOUR_YELLOW,
+	COLOUR_RED,
+	COLOUR_LIGHT_BLUE,
+	COLOUR_GREEN,
+	COLOUR_DARK_GREEN,
+	COLOUR_BLUE,
+	COLOUR_CREAM,
+	COLOUR_MAUVE,
+	COLOUR_PURPLE,
+	COLOUR_ORANGE,
+	COLOUR_BROWN,
+	COLOUR_GREY,
+	COLOUR_WHITE
+};
+
+/** Colour of the strings, see _string_colormap in table/palettes.h or docs/ottd-colourtext-palette.png */
+enum TextColour {
+	TC_FROMSTRING  = 0x00,
+	TC_BLUE        = 0x00,
+	TC_SILVER      = 0x01,
+	TC_GOLD        = 0x02,
+	TC_RED         = 0x03,
+	TC_PURPLE      = 0x04,
+	TC_LIGHT_BROWN = 0x05,
+	TC_ORANGE      = 0x06,
+	TC_GREEN       = 0x07,
+	TC_YELLOW      = 0x08,
+	TC_DARK_GREEN  = 0x09,
+	TC_CREAM       = 0x0A,
+	TC_BROWN       = 0x0B,
+	TC_WHITE       = 0x0C,
+	TC_LIGHT_BLUE  = 0x0D,
+	TC_GREY        = 0x0E,
+	TC_DARK_BLUE   = 0x0F,
+	TC_BLACK       = 0x10,
+};
+
+enum StringColorFlags {
+	IS_PALETTE_COLOR = 0x100, ///< color value is already a real palette color index, not an index of a StringColor
+};
+
+#endif /* GFX_TYPE_H */
--- a/src/gfxinit.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/gfxinit.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,30 +5,31 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "gfx.h"
 #include "gfxinit.h"
 #include "spritecache.h"
-#include "table/sprites.h"
 #include "fileio.h"
 #include "fios.h"
-#include "string.h"
 #include "newgrf.h"
 #include "md5.h"
 #include "variables.h"
 #include "fontcache.h"
+#include "gfx_func.h"
+#include "core/alloc_func.hpp"
+#include "core/bitmath_func.hpp"
 #include <string.h>
+#include "settings_type.h"
+
+#include "table/sprites.h"
 
 struct MD5File {
 	const char * filename;     ///< filename
-	md5_byte_t hash[16];       ///< md5 sum of the file
+	uint8 hash[16];            ///< md5 sum of the file
 };
 
 struct FileList {
 	MD5File basic[2];     ///< GRF files that always have to be loaded
 	MD5File landscape[3]; ///< Landscape specific grf files
 	MD5File sound;        ///< Sound samples
-	MD5File chars;        ///< GRF File with character replacements
 	MD5File openttd;      ///< GRF File with OTTD specific graphics
 };
 
@@ -109,20 +110,19 @@
 	FILE *f = FioFOpenFile(file.filename, "rb", DATA_DIR, &size);
 
 	if (f != NULL) {
-		md5_state_t filemd5state;
-		md5_byte_t buffer[1024];
-		md5_byte_t digest[16];
+		Md5 checksum;
+		uint8 buffer[1024];
+		uint8 digest[16];
 		size_t len;
 
-		md5_init(&filemd5state);
 		while ((len = fread(buffer, 1, (size > sizeof(buffer)) ? sizeof(buffer) : size, f)) != 0 && size != 0) {
 			size -= len;
-			md5_append(&filemd5state, buffer, len);
+			checksum.Append(buffer, len);
 		}
 
 		FioFCloseFile(f);
 
-		md5_finish(&filemd5state, digest);
+		checksum.Finish(digest);
 		return memcmp(file.hash, digest, sizeof(file.hash)) == 0;
 	} else { // file not found
 		return false;
@@ -191,10 +191,6 @@
 		add_pos += snprintf(add_pos, ERROR_MESSAGE_LENGTH, "Your 'sample.cat' file is corrupted or missing! You can find 'sample.cat' on your Transport Tycoon Deluxe CD-ROM.\n");
 	}
 
-	if (!FileMD5(files->chars)) {
-		add_pos += snprintf(add_pos, ERROR_MESSAGE_LENGTH, "Your '%s' file is corrupted or missing! The file was part of your installation.\n", files->chars.filename);
-	}
-
 	if (!FileMD5(files->openttd)) {
 		add_pos += snprintf(add_pos, ERROR_MESSAGE_LENGTH, "Your '%s' file is corrupted or missing! The file was part of your installation.\n", files->openttd.filename);
 	}
@@ -283,53 +279,6 @@
 	END
 };
 
-/** Replace some letter sprites with some other letters */
-static const SpriteID _chars_grf_indexes[] = {
-	134, 134, ///<  euro symbol medium size
-	582, 582, ///<  euro symbol large size
-	358, 358, ///<  euro symbol tiny
-	648, 648, ///<  nordic char: æ
-	616, 616, ///<  nordic char: Æ
-	666, 666, ///<  nordic char: ø
-	634, 634, ///<  nordic char: Ø
-	382, 383, ///<  Œ œ tiny
-	158, 159, ///<  Œ œ medium
-	606, 607, ///<  Œ œ large
-	360, 360, ///<  Š tiny
-	362, 362, ///<  š tiny
-	136, 136, ///<  Š medium
-	138, 138, ///<  š medium
-	584, 584, ///<  Š large
-	586, 586, ///<  š large
-	626, 626, ///<  Ð large
-	658, 658, ///<  ð large
-	374, 374, ///<  Ž tiny
-	378, 378, ///<  ž tiny
-	150, 150, ///<  Ž medium
-	154, 154, ///<  ž medium
-	598, 598, ///<  Ž large
-	602, 602, ///<  ž large
-	640, 640, ///<  Þ large
-	672, 672, ///<  þ large
-	380, 380, ///<  º tiny
-	156, 156, ///<  º medium
-	604, 604, ///<  º large
-	317, 320, ///<  { | } ~ tiny
-	 93,  96, ///<  { | } ~ medium
-	541, 544, ///<  { | } ~ large
-	585, 585, ///<  § large
-	587, 587, ///<  © large
-	592, 592, ///<  ® large
-	594, 597, ///<  ° ± ² ³ large
-	633, 633, ///<  × large
-	665, 665, ///<  ÷ large
-	377, 377, ///<  · small
-	153, 153, ///<  · medium
-	601, 601, ///<  · large
-	END
-};
-
-
 static void LoadSpriteTables()
 {
 	const FileList *files = _use_dos_palette ? &files_dos : &files_win;
@@ -361,8 +310,6 @@
 		);
 	}
 
-	LoadGrfIndexed(files->chars.filename, _chars_grf_indexes, i++);
-
 	/* Initialize the unicode to sprite mapping table */
 	InitializeUnicodeGlyphMap();
 
--- a/src/gfxinit.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/gfxinit.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,8 @@
 #ifndef GFXINIT_H
 #define GFXINIT_H
 
+#include "gfx_type.h"
+
 void CheckExternalFiles();
 void GfxLoadSprites();
 void LoadSpritesIndexed(int file_index, uint *sprite_id, const SpriteID *index_tbl);
--- a/src/graph_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/graph_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,19 +4,21 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "table/sprites.h"
-#include "functions.h"
-#include "window.h"
 #include "gui.h"
-#include "gfx.h"
-#include "player.h"
-#include "economy.h"
+#include "window_gui.h"
+#include "player_base.h"
+#include "player_gui.h"
+#include "economy_func.h"
 #include "variables.h"
-#include "date.h"
-#include "helpers.hpp"
 #include "cargotype.h"
+#include "strings_func.h"
+#include "core/alloc_func.hpp"
+#include "window_func.h"
+#include "date_func.h"
+#include "gfx_func.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
 
 /* Bitmasks of player and cargo indices that shouldn't be drawn. */
 static uint _legend_excluded_players;
@@ -1103,6 +1105,8 @@
 		}
 
 		case WE_TICK:
+			if (_pause_game != 0) break;
+
 			/* Update the player score every 5 days */
 			if (--w->custom[0] == 0) {
 				w->custom[0] = DAY_TICKS;
--- a/src/group.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/group.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,6 +6,9 @@
 #define GROUP_H
 
 #include "oldpool.h"
+#include "player_type.h"
+#include "vehicle_type.h"
+#include "engine.h"
 
 enum {
 	ALL_GROUP     = 0xFFFD,
@@ -17,7 +20,7 @@
 DECLARE_OLD_POOL(Group, Group, 5, 2047)
 
 struct Group : PoolItem<Group, GroupID, &_Group_pool> {
-	StringID string_id;                     ///< Group Name
+	char *name;                             ///< Group Name
 
 	uint16 num_vehicle;                     ///< Number of vehicles wich belong to the group
 	PlayerID owner;                         ///< Group Owner
@@ -26,7 +29,7 @@
 	bool replace_protection;                ///< If set to true, the global autoreplace have no effect on the group
 	uint16 num_engines[TOTAL_NUM_ENGINES];  ///< Caches the number of engines of each type the player owns (no need to save this)
 
-	Group(StringID str = STR_NULL);
+	Group(PlayerID owner = INVALID_PLAYER);
 	virtual ~Group();
 
 	bool IsValid() const;
@@ -76,19 +79,7 @@
  * @param id_e The EngineID of the engine to count
  * @return The number of engines with EngineID id_e in the group
  */
-static inline uint GetGroupNumEngines(PlayerID p, GroupID id_g, EngineID id_e)
-{
-	if (IsValidGroupID(id_g)) return GetGroup(id_g)->num_engines[id_e];
-
-	uint num = GetPlayer(p)->num_engines[id_e];
-	if (!IsDefaultGroupID(id_g)) return num;
-
-	const Group *g;
-	FOR_ALL_GROUPS(g) {
-		if (g->owner == p) num -= g->num_engines[id_e];
-	}
-	return num;
-}
+uint GetGroupNumEngines(PlayerID p, GroupID id_g, EngineID id_e);
 
 static inline void IncreaseGroupNumVehicle(GroupID id_g)
 {
@@ -105,6 +96,6 @@
 void SetTrainGroupID(Vehicle *v, GroupID grp);
 void UpdateTrainGroupID(Vehicle *v);
 void RemoveVehicleFromGroup(const Vehicle *v);
-void RemoveAllGroupsForPlayer(const Player *p);
+void RemoveAllGroupsForPlayer(const PlayerID p);
 
 #endif /* GROUP_H */
--- a/src/group_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/group_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,21 +5,24 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "variables.h"
-#include "functions.h"
-#include "player.h"
-#include "table/strings.h"
-#include "command.h"
-#include "vehicle.h"
+#include "command_func.h"
 #include "saveload.h"
 #include "debug.h"
 #include "group.h"
 #include "train.h"
 #include "aircraft.h"
-#include "string.h"
-#include "window.h"
 #include "vehicle_gui.h"
-#include "strings.h"
 #include "misc/autoptr.hpp"
+#include "strings_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "vehicle_func.h"
+#include "autoreplace_base.h"
+#include "autoreplace_func.h"
+#include "string_func.h"
+#include "player_func.h"
+
+#include "table/strings.h"
 
 /**
  * Update the num engines of a groupID. Decrease the old one and increase the new one
@@ -43,20 +46,20 @@
 DEFINE_OLD_POOL_GENERIC(Group, Group)
 
 
-Group::Group(StringID str)
+Group::Group(PlayerID owner)
 {
-	this->string_id = str;
+	this->owner = owner;
 }
 
 Group::~Group()
 {
-	DeleteName(this->string_id);
-	this->string_id = STR_NULL;
+	free(this->name);
+	this->owner = INVALID_PLAYER;
 }
 
 bool Group::IsValid() const
 {
-	return this->string_id != STR_NULL;
+	return this->owner != INVALID_PLAYER;
 }
 
 void InitializeGroup(void)
@@ -91,13 +94,12 @@
 
 	AutoPtrT<Group> g_auto_delete;
 
-	Group *g = new Group(STR_EMPTY);
+	Group *g = new Group(_current_player);
 	if (g == NULL) return CMD_ERROR;
 
 	g_auto_delete = g;
 
 	if (flags & DC_EXEC) {
-		g->owner = _current_player;
 		g->replace_protection = false;
 		g->vehicle_type = vt;
 
@@ -185,15 +187,11 @@
 
 	if (!IsUniqueGroupName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
 
-	/* Create the name */
-	StringID str = AllocateName(_cmd_text, 0);
-	if (str == STR_NULL) return CMD_ERROR;
-
 	if (flags & DC_EXEC) {
 		/* Delete the old name */
-		DeleteName(g->string_id);
+		free(g->name);
 		/* Assign the new one */
-		g->string_id = str;
+		g->name = strdup(_cmd_text);
 
 		InvalidateWindowData(GetWCForVT(g->vehicle_type), (g->vehicle_type << 11) | VLW_GROUP_LIST | _current_player);
 	}
@@ -405,19 +403,33 @@
 	InvalidateWindow(WC_REPLACE_VEHICLE, VEH_TRAIN);
 }
 
+uint GetGroupNumEngines(PlayerID p, GroupID id_g, EngineID id_e)
+{
+	if (IsValidGroupID(id_g)) return GetGroup(id_g)->num_engines[id_e];
 
-void RemoveAllGroupsForPlayer(const Player *p)
+	uint num = GetPlayer(p)->num_engines[id_e];
+	if (!IsDefaultGroupID(id_g)) return num;
+
+	const Group *g;
+	FOR_ALL_GROUPS(g) {
+		if (g->owner == p) num -= g->num_engines[id_e];
+	}
+	return num;
+}
+
+void RemoveAllGroupsForPlayer(const PlayerID p)
 {
 	Group *g;
 
 	FOR_ALL_GROUPS(g) {
-		if (p->index == g->owner) delete g;
+		if (p == g->owner) delete g;
 	}
 }
 
 
 static const SaveLoad _group_desc[] = {
-  SLE_VAR(Group, string_id,          SLE_UINT16),
+  SLE_CONDVAR(Group, name,           SLE_NAME,    0, 83),
+  SLE_CONDSTR(Group, name,           SLE_STR, 0, 84, SL_MAX_VERSION),
   SLE_VAR(Group, num_vehicle,        SLE_UINT16),
   SLE_VAR(Group, owner,              SLE_UINT8),
   SLE_VAR(Group, vehicle_type,       SLE_UINT8),
--- a/src/group_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/group_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,25 +4,30 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
-#include "table/strings.h"
-#include "table/sprites.h"
-#include "window.h"
 #include "gui.h"
-#include "gfx.h"
-#include "vehicle.h"
-#include "command.h"
+#include "window_gui.h"
+#include "textbuf_gui.h"
+#include "command_func.h"
 #include "engine.h"
 #include "vehicle_gui.h"
 #include "depot.h"
 #include "train.h"
-#include "date.h"
 #include "group.h"
-#include "helpers.hpp"
-#include "viewport.h"
-#include "strings.h"
 #include "debug.h"
+#include "strings_func.h"
+#include "core/alloc_func.hpp"
+#include "window_func.h"
+#include "vehicle_func.h"
+#include "autoreplace_gui.h"
+#include "string_func.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "player_func.h"
+#include "widgets/dropdown_type.h"
+#include "widgets/dropdown_func.h"
 
+#include "table/strings.h"
+#include "table/sprites.h"
 
 struct Sorting {
 	Listing aircraft;
@@ -43,9 +48,6 @@
 	if (!(gl->l.flags & VL_REBUILD)) return;
 
 	list = MallocT<const Group*>(GetGroupArraySize());
-	if (GetGroupArraySize() != 0 && list == NULL) {
-		error("Could not allocate memory for the group-sorting-list");
-	}
 
 	FOR_ALL_GROUPS(g) {
 		if (g->owner == owner && g->vehicle_type == vehicle_type) list[n++] = g;
@@ -53,9 +55,6 @@
 
 	free((void*)gl->sort_list);
 	gl->sort_list = MallocT<const Group *>(n);
-	if (n != 0 && gl->sort_list == NULL) {
-		error("Could not allocate memory for the group-sorting-list");
-	}
 	gl->l.list_length = n;
 
 	for (uint i = 0; i < n; ++i) gl->sort_list[i] = list[i];
@@ -116,7 +115,6 @@
 	GRP_WIDGET_LIST_GROUP,
 	GRP_WIDGET_LIST_GROUP_SCROLLBAR,
 	GRP_WIDGET_SORT_BY_ORDER,
-	GRP_WIDGET_SORT_BY_TEXT,
 	GRP_WIDGET_SORT_BY_DROPDOWN,
 	GRP_WIDGET_EMPTY_TOP_RIGHT,
 	GRP_WIDGET_LIST_VEHICLE,
@@ -128,7 +126,6 @@
 	GRP_WIDGET_REPLACE_PROTECTION,
 	GRP_WIDGET_EMPTY2,
 	GRP_WIDGET_AVAILABLE_VEHICLES,
-	GRP_WIDGET_MANAGE_VEHICLES,
 	GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN,
 	GRP_WIDGET_STOP_ALL,
 	GRP_WIDGET_START_ALL,
@@ -147,8 +144,7 @@
 {     WWT_MATRIX, RESIZE_BOTTOM,    14,     0,   188,    52,   168, 0x701,                STR_GROUPS_CLICK_ON_GROUP_FOR_TIP},
 {  WWT_SCROLLBAR, RESIZE_BOTTOM,    14,   189,   200,    52,   168, 0x0,                  STR_0190_SCROLL_BAR_SCROLLS_LIST},
 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   201,   281,    14,    25, STR_SORT_BY,          STR_SORT_ORDER_TIP},
-{      WWT_PANEL,   RESIZE_NONE,    14,   282,   435,    14,    25, 0x0,                  STR_SORT_CRITERIA_TIP},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,   436,   447,    14,    25, STR_0225,             STR_SORT_CRITERIA_TIP},
+{   WWT_DROPDOWN,   RESIZE_NONE,    14,   282,   447,    14,    25, 0x0,                  STR_SORT_CRITERIA_TIP},
 {      WWT_PANEL,  RESIZE_RIGHT,    14,   448,   459,    14,    25, 0x0,                  STR_NULL},
 {     WWT_MATRIX,     RESIZE_RB,    14,   201,   447,    26,   181, 0x701,                STR_NULL},
 { WWT_SCROLL2BAR,    RESIZE_LRB,    14,   448,   459,    26,   181, 0x0,                  STR_0190_SCROLL_BAR_SCROLLS_LIST},
@@ -159,8 +155,7 @@
 { WWT_PUSHIMGBTN,     RESIZE_TB,    14,   165,   188,   169,   193, 0x0,                  STR_GROUP_REPLACE_PROTECTION_TIP},
 {      WWT_PANEL,     RESIZE_TB,    14,   189,   200,   169,   193, 0x0,                  STR_NULL},
 { WWT_PUSHTXTBTN,     RESIZE_TB,    14,   201,   306,   182,   193, 0x0,                  STR_AVAILABLE_ENGINES_TIP},
-{    WWT_TEXTBTN,     RESIZE_TB,    14,   307,   411,   182,   193, STR_MANAGE_LIST,      STR_MANAGE_LIST_TIP},
-{    WWT_TEXTBTN,     RESIZE_TB,    14,   412,   423,   182,   193, STR_0225,             STR_MANAGE_LIST_TIP},
+{   WWT_DROPDOWN,     RESIZE_TB,    14,   307,   423,   182,   193, STR_MANAGE_LIST,      STR_MANAGE_LIST_TIP},
 { WWT_PUSHIMGBTN,     RESIZE_TB,    14,   424,   435,   182,   193, SPR_FLAG_VEH_STOPPED, STR_MASS_STOP_LIST_TIP},
 { WWT_PUSHIMGBTN,     RESIZE_TB,    14,   436,   447,   182,   193, SPR_FLAG_VEH_RUNNING, STR_MASS_START_LIST_TIP},
 {      WWT_PANEL,    RESIZE_RTB,    14,   448,   447,   182,   193, 0x0,                  STR_NULL},
@@ -217,6 +212,7 @@
 	gl->l.resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;	// Set up resort timer
 
 	gv->group_sel = ALL_GROUP;
+	gv->vehicle_sel = INVALID_VEHICLE;
 
 	switch (gv->vehicle_type) {
 		case VEH_TRAIN:
@@ -259,28 +255,33 @@
 	}
 }
 
+enum GroupActionListFunction {
+	GALF_REPLACE,
+	GALF_SERVICE,
+	GALF_DEPOT,
+	GALF_ADD_SHARED,
+	GALF_REMOVE_ALL,
+};
+
 /**
  * Update/redraw the group action dropdown
  * @param w   the window the dropdown belongs to
  * @param gid the currently selected group in the window
  */
-static void UpdateGroupActionDropdown(Window *w, GroupID gid, bool refresh = true)
+static void ShowGroupActionDropdown(Window *w, GroupID gid)
 {
-	if (refresh && !w->IsWidgetLowered(GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN)) return;
+	DropDownList *list = new DropDownList();
 
-	static StringID action_str[] = {
-		STR_REPLACE_VEHICLES,
-		STR_SEND_FOR_SERVICING,
-		STR_SEND_TRAIN_TO_DEPOT,
-		STR_NULL,
-		STR_NULL,
-		INVALID_STRING_ID
-	};
+	list->push_back(new DropDownListStringItem(STR_REPLACE_VEHICLES,    GALF_REPLACE, false));
+	list->push_back(new DropDownListStringItem(STR_SEND_FOR_SERVICING,  GALF_SERVICE, false));
+	list->push_back(new DropDownListStringItem(STR_SEND_TRAIN_TO_DEPOT, GALF_DEPOT,   false));
 
-	action_str[3] = IsValidGroupID(gid) ? STR_GROUP_ADD_SHARED_VEHICLE : INVALID_STRING_ID;
-	action_str[4] = IsValidGroupID(gid) ? STR_GROUP_REMOVE_ALL_VEHICLES : INVALID_STRING_ID;
+	if (IsValidGroupID(gid)) {
+		list->push_back(new DropDownListStringItem(STR_GROUP_ADD_SHARED_VEHICLE,  GALF_ADD_SHARED, false));
+		list->push_back(new DropDownListStringItem(STR_GROUP_REMOVE_ALL_VEHICLES, GALF_REMOVE_ALL, false));
+	}
 
-	ShowDropDownMenu(w, action_str, 0, GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN, 0, 0);
+	ShowDropDownList(w, list, 0, GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN);
 }
 
 /**
@@ -291,7 +292,6 @@
 static void GroupWndProc(Window *w, WindowEvent *e)
 {
 	const PlayerID owner = (PlayerID)GB(w->window_number, 0, 8);
-	const Player *p = GetPlayer(owner);
 	groupveh_d *gv = &WP(w, groupveh_d);
 	grouplist_d *gl = &WP(w, groupveh_d).gl;
 
@@ -301,7 +301,10 @@
 		case WE_INVALIDATE_DATA:
 			gv->l.flags |= VL_REBUILD;
 			gl->l.flags |= VL_REBUILD;
-			UpdateGroupActionDropdown(w, gv->group_sel);
+			if (!(IsAllGroupID(gv->group_sel) || IsDefaultGroupID(gv->group_sel) || IsValidGroupID(gv->group_sel))) {
+				gv->group_sel = ALL_GROUP;
+				HideDropDownMenu(w);
+			}
 			SetWindowDirty(w);
 			break;
 
@@ -331,21 +334,13 @@
 			/* The drop down menu is out, *but* it may not be used, retract it. */
 			if (gv->l.list_length == 0 && w->IsWidgetLowered(GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN)) {
 				w->RaiseWidget(GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN);
-				Window **w2;
-				FOR_ALL_WINDOWS(w2) {
-					if (w->window_class  == WP(*w2, dropdown_d).parent_wnd_class &&
-							w->window_number == WP(*w2, dropdown_d).parent_wnd_num) {
-						DeleteWindow(*w2);
-						break;
-					}
-				}
+				HideDropDownMenu(w);
 			}
 
 			/* Disable all lists management button when the list is empty */
 			w->SetWidgetsDisabledState(gv->l.list_length == 0 || _local_player != owner,
 					GRP_WIDGET_STOP_ALL,
 					GRP_WIDGET_START_ALL,
-					GRP_WIDGET_MANAGE_VEHICLES,
 					GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN,
 					WIDGET_LIST_END);
 
@@ -371,7 +366,7 @@
 			/* If selected_group == DEFAULT_GROUP || ALL_GROUP, draw the standard caption
 			   We list all vehicles or ungrouped vehicles */
 			if (IsDefaultGroupID(gv->group_sel) || IsAllGroupID(gv->group_sel)) {
-				SetDParam(0, p->index);
+				SetDParam(0, owner);
 				SetDParam(1, gv->l.list_length);
 
 				switch (gv->vehicle_type) {
@@ -420,6 +415,8 @@
 				}
 			}
 
+			/* Set text of sort by dropdown */
+			w->widget[GRP_WIDGET_SORT_BY_DROPDOWN].data = _vehicle_sort_listing[gv->l.sort_type];
 
 			DrawWindowWidgets(w);
 
@@ -469,17 +466,16 @@
 				DrawStringRightAligned(187, y1 + 1, STR_GROUP_TINY_NUM, (gv->group_sel == g->index) ? TC_WHITE : TC_BLACK);
 			}
 
+			DrawSortButtonState(w, GRP_WIDGET_SORT_BY_ORDER, gv->l.flags & VL_DESC ? SBS_DOWN : SBS_UP);
+
 			/* Draw Matrix Vehicle according to the vehicle list built before */
-			DrawString(285, 15, _vehicle_sort_listing[gv->l.sort_type], TC_BLACK);
-			DoDrawString(gv->l.flags & VL_DESC ? DOWNARROW : UPARROW, 269, 15, TC_BLACK);
-
 			max = min(w->vscroll2.pos + w->vscroll2.cap, gv->l.list_length);
 			for (i = w->vscroll2.pos ; i < max ; ++i) {
 				const Vehicle* v = gv->sort_list[i];
 
 				assert(v->type == gv->vehicle_type && v->owner == owner);
 
-				DrawVehicleImage(v, x + 19, y2 + 6, w->hscroll.cap, 0, gv->vehicle_sel);
+				DrawVehicleImage(v, x + 19, y2 + 6, gv->vehicle_sel, w->hscroll.cap, 0);
 				DrawVehicleProfitButton(v, x, y2 + 13);
 
 				SetDParam(0, v->unitnumber);
@@ -503,6 +499,8 @@
 		}
 
 		case WE_CLICK:
+			HideDropDownMenu(w);
+
 			switch(e->we.click.widget) {
 				case GRP_WIDGET_SORT_BY_ORDER: // Flip sorting method ascending/descending
 					gv->l.flags ^= VL_DESC;
@@ -512,7 +510,6 @@
 					SetWindowDirty(w);
 					break;
 
-				case GRP_WIDGET_SORT_BY_TEXT:
 				case GRP_WIDGET_SORT_BY_DROPDOWN: // Select sorting criteria dropdown menu
 					ShowDropDownMenu(w, _vehicle_sort_listing, gv->l.sort_type,  GRP_WIDGET_SORT_BY_DROPDOWN, 0, 0);
 					return;
@@ -521,7 +518,6 @@
 					if (!IsAllGroupID(gv->group_sel)) {
 						gv->group_sel = ALL_GROUP;
 						gv->l.flags |= VL_REBUILD;
-						UpdateGroupActionDropdown(w, gv->group_sel);
 						SetWindowDirty(w);
 					}
 					break;
@@ -530,7 +526,6 @@
 					if (!IsDefaultGroupID(gv->group_sel)) {
 						gv->group_sel = DEFAULT_GROUP;
 						gv->l.flags |= VL_REBUILD;
-						UpdateGroupActionDropdown(w, gv->group_sel);
 						SetWindowDirty(w);
 					}
 					break;
@@ -547,7 +542,6 @@
 					gv->group_sel = gl->sort_list[id_g]->index;;
 
 					gv->l.flags |= VL_REBUILD;
-					UpdateGroupActionDropdown(w, gv->group_sel);
 					SetWindowDirty(w);
 					break;
 				}
@@ -600,12 +594,9 @@
 					ShowBuildVehicleWindow(0, gv->vehicle_type);
 					break;
 
-				case GRP_WIDGET_MANAGE_VEHICLES:
-				case GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN:  {
-					UpdateGroupActionDropdown(w, gv->group_sel, false);
+				case GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN:
+					ShowGroupActionDropdown(w, gv->group_sel);
 					break;
-				}
-
 
 				case GRP_WIDGET_START_ALL:
 				case GRP_WIDGET_STOP_ALL: { // Start/stop all vehicles of the list
@@ -718,24 +709,24 @@
 					assert(gv->l.list_length != 0);
 
 					switch (e->we.dropdown.index) {
-						case 0: // Replace window
+						case GALF_REPLACE: // Replace window
 							ShowReplaceGroupVehicleWindow(gv->group_sel, gv->vehicle_type);
 							break;
-						case 1: // Send for servicing
+						case GALF_SERVICE: // Send for servicing
 							DoCommandP(0, gv->group_sel, ((IsAllGroupID(gv->group_sel) ? VLW_STANDARD : VLW_GROUP_LIST) & VLW_MASK)
 										| DEPOT_MASS_SEND
 										| DEPOT_SERVICE, NULL, GetCmdSendToDepot(gv->vehicle_type));
 							break;
-						case 2: // Send to Depots
+						case GALF_DEPOT: // Send to Depots
 							DoCommandP(0, gv->group_sel, ((IsAllGroupID(gv->group_sel) ? VLW_STANDARD : VLW_GROUP_LIST) & VLW_MASK)
 										| DEPOT_MASS_SEND, NULL, GetCmdSendToDepot(gv->vehicle_type));
 							break;
-						case 3: // Add shared Vehicles
+						case GALF_ADD_SHARED: // Add shared Vehicles
 							assert(IsValidGroupID(gv->group_sel));
 
 							DoCommandP(0, gv->group_sel, gv->vehicle_type, NULL, CMD_ADD_SHARED_VEHICLE_GROUP | CMD_MSG(STR_GROUP_CAN_T_ADD_SHARED_VEHICLE));
 							break;
-						case 4: // Remove all Vehicles from the selected group
+						case GALF_REMOVE_ALL: // Remove all Vehicles from the selected group
 							assert(IsValidGroupID(gv->group_sel));
 
 							DoCommandP(0, gv->group_sel, gv->vehicle_type, NULL, CMD_REMOVE_ALL_VEHICLES_GROUP | CMD_MSG(STR_GROUP_CAN_T_REMOVE_ALL_VEHICLES));
@@ -758,6 +749,7 @@
 
 
 		case WE_TICK: // resort the lists every 20 seconds orso (10 days)
+			if (_pause_game != 0) break;
 			if (--gv->l.resort_timer == 0) {
 				gv->l.resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;
 				gv->l.flags |= VL_RESORT;
@@ -769,7 +761,7 @@
 				SetWindowDirty(w);
 			}
 			break;
-		}
+	}
 }
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/group_gui.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,12 @@
+/* $Id$ */
+
+/** @file group_gui.h Functions/definitions that have something to do with groups. */
+
+#ifndef GROUP_GUI_H
+#define GROUP_GUI_H
+
+#include "vehicle_type.h"
+
+void ShowPlayerGroup(PlayerID player, VehicleType veh);
+
+#endif /* GROUP_GUI_H */
--- a/src/gui.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/gui.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,15 +5,16 @@
 #ifndef GUI_H
 #define GUI_H
 
-#include "station.h"
-#include "window.h"
-#include "string.h"
+#include "window_type.h"
+#include "vehicle_type.h"
+#include "gfx_type.h"
+#include "economy_type.h"
+#include "tile_type.h"
+#include "strings_type.h"
 
 /* main_gui.cpp */
-void SetupColorsAndInitialWindow();
 void CcPlaySound10(bool success, TileIndex tile, uint32 p1, uint32 p2);
 void CcBuildCanal(bool success, TileIndex tile, uint32 p1, uint32 p2);
-void CcTerraform(bool success, TileIndex tile, uint32 p1, uint32 p2);
 
 /* settings_gui.cpp */
 void ShowGameOptions();
@@ -36,43 +37,30 @@
 void ShowMessageOptions();
 void ShowMessageHistory();
 
-/* rail_gui.cpp */
-void ShowBuildRailToolbar(RailType railtype, int button);
-void PlaceProc_BuyLand(TileIndex tile);
-void ReinitGuiAfterToggleElrail(bool disable);
-
 /* train_gui.cpp */
 void ShowOrdersWindow(const Vehicle *v);
 
-/* road_gui.cpp */
-void ShowBuildRoadToolbar(RoadType roadtype);
-void ShowBuildRoadScenToolbar();
-
 /* dock_gui.cpp */
 void ShowBuildDocksToolbar();
 
 /* aircraft_gui.cpp */
 void ShowBuildAirToolbar();
 
-/* terraform_gui.cpp */
-void ShowTerraformToolbar(Window *link = NULL);
-
 /* tgp_gui.cpp */
 void ShowGenerateLandscape();
 void ShowHeightmapLoad();
 
-void PlaceProc_DemolishArea(TileIndex tile);
-void PlaceProc_LevelLand(TileIndex tile);
-bool GUIPlaceProcDragXY(const WindowEvent *e);
-
 /** Drag and drop selection process, or, what to do with an area of land when
  * you've selected it. */
 enum {
 	DDSP_DEMOLISH_AREA,
+	DDSP_RAISE_AND_LEVEL_AREA,
+	DDSP_LOWER_AND_LEVEL_AREA,
 	DDSP_LEVEL_AREA,
 	DDSP_CREATE_DESERT,
 	DDSP_CREATE_ROCKS,
 	DDSP_CREATE_WATER,
+	DDSP_CREATE_RIVER,
 	DDSP_PLANT_TREES,
 	DDSP_BUILD_BRIDGE,
 
@@ -99,22 +87,10 @@
 void ShowTownDirectory();
 void ShowIndustryDirectory();
 void ShowSubsidiesList();
-void ShowPlayerStations(PlayerID player);
-void ShowPlayerFinances(PlayerID player);
-void ShowPlayerCompany(PlayerID player);
 
 void ShowEstimatedCostOrIncome(Money cost, int x, int y);
 void ShowErrorMessage(StringID msg_1, StringID msg_2, int x, int y);
 
-enum StationCoverageType {
-	SCT_PASSENGERS_ONLY,
-	SCT_NON_PASSENGERS_ONLY,
-	SCT_ALL
-};
-
-void DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad);
-void CheckRedrawStationCoverage(const Window *w);
-
 void ShowSmallMap();
 void ShowExtraViewPortWindow();
 void SetVScrollCount(Window *w, int num);
@@ -123,19 +99,6 @@
 
 void ShowCheatWindow();
 
-void DrawEditBox(Window *w, querystr_d *string, int wid);
-void HandleEditBox(Window *w, querystr_d *string, int wid);
-int HandleEditBoxKey(Window *w, querystr_d *string, int wid, WindowEvent *we);
-bool HandleCaret(Textbuf *tb);
-
-void DeleteTextBufferAll(Textbuf *tb);
-bool DeleteTextBufferChar(Textbuf *tb, int delmode);
-bool InsertTextBufferChar(Textbuf *tb, uint32 key);
-bool InsertTextBufferClipboard(Textbuf *tb);
-bool MoveTextBufferPos(Textbuf *tb, int navmode);
-void InitializeTextBuffer(Textbuf *tb, const char *buf, uint16 maxlength, uint16 maxwidth);
-void UpdateTextBufferSize(Textbuf *tb);
-
 void BuildFileList();
 void SetFiosType(const byte fiostype);
 
@@ -143,21 +106,14 @@
 extern const TextColour _fios_colors[];
 
 /* bridge_gui.cpp */
-void ShowBuildBridgeWindow(uint start, uint end, byte type);
+void ShowBuildBridgeWindow(TileIndex start, TileIndex end, byte type);
 
 void ShowBuildIndustryWindow();
-void ShowQueryString(StringID str, StringID caption, uint maxlen, uint maxwidth, Window *parent, CharSetFilter afilter);
-void ShowQuery(StringID caption, StringID message, Window *w, void (*callback)(Window*, bool));
 void ShowMusicWindow();
 
 /* main_gui.cpp */
 void HandleOnEditText(const char *str);
-VARDEF bool _station_show_coverage;
-VARDEF PlaceProc *_place_proc;
 
-/* vehicle_gui.cpp */
 void InitializeGUI();
 
-void ShowPlayerGroup(PlayerID player, VehicleType veh);
-
 #endif /* GUI_H */
--- a/src/heightmap.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/heightmap.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,17 +5,19 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "variables.h"
-#include "functions.h"
 #include "heightmap.h"
 #include "clear_map.h"
-#include "table/strings.h"
 #include "void_map.h"
 #include "debug.h"
-#include "gfx.h"
 #include "gui.h"
 #include "saveload.h"
 #include "bmp.h"
-#include "helpers.hpp"
+#include "gfx_func.h"
+#include "core/alloc_func.hpp"
+#include "fios.h"
+#include "settings_type.h"
+
+#include "table/strings.h"
 
 /**
  * Convert RGB colors to Grayscale using 29.9% Red, 58.7% Green, 11.4% Blue
--- a/src/helpers.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,286 +0,0 @@
-/* $Id$ */
-
-/** @file helpers.hpp */
-
-#ifndef HELPERS_HPP
-#define HELPERS_HPP
-
-#include "macros.h"
-
-/** When allocating using malloc/calloc in C++ it is usually needed to cast the return value
-*  from void* to the proper pointer type. Another alternative would be MallocT<> as follows */
-template <typename T> FORCEINLINE T* MallocT(size_t num_elements)
-{
-	T *t_ptr = (T*)malloc(num_elements * sizeof(T));
-	return t_ptr;
-}
-/** When allocating using malloc/calloc in C++ it is usually needed to cast the return value
-*  from void* to the proper pointer type. Another alternative would be MallocT<> as follows */
-template <typename T> FORCEINLINE T* CallocT(size_t num_elements)
-{
-	T *t_ptr = (T*)calloc(num_elements, sizeof(T));
-	return t_ptr;
-}
-/** When allocating using malloc/calloc in C++ it is usually needed to cast the return value
-*  from void* to the proper pointer type. Another alternative would be MallocT<> as follows */
-template <typename T> FORCEINLINE T* ReallocT(T* t_ptr, size_t num_elements)
-{
-	t_ptr = (T*)realloc(t_ptr, num_elements * sizeof(T));
-	return t_ptr;
-}
-
-
-/** type safe swap operation */
-template<typename T> void Swap(T& a, T& b)
-{
-	T t = a;
-	a = b;
-	b = t;
-}
-
-
-/** Some enums need to have allowed incrementing (i.e. StationClassID) */
-#define DECLARE_POSTFIX_INCREMENT(type) \
-	FORCEINLINE type operator ++(type& e, int) \
-	{ \
-		type e_org = e; \
-		e = (type)((int)e + 1); \
-		return e_org; \
-	} \
-	FORCEINLINE type operator --(type& e, int) \
-	{ \
-		type e_org = e; \
-		e = (type)((int)e - 1); \
-		return e_org; \
-	}
-
-
-
-/** Operators to allow to work with enum as with type safe bit set in C++ */
-# define DECLARE_ENUM_AS_BIT_SET(mask_t) \
-	FORCEINLINE mask_t operator | (mask_t m1, mask_t m2) {return (mask_t)((int)m1 | m2);} \
-	FORCEINLINE mask_t operator & (mask_t m1, mask_t m2) {return (mask_t)((int)m1 & m2);} \
-	FORCEINLINE mask_t operator ^ (mask_t m1, mask_t m2) {return (mask_t)((int)m1 ^ m2);} \
-	FORCEINLINE mask_t& operator |= (mask_t& m1, mask_t m2) {m1 = m1 | m2; return m1;} \
-	FORCEINLINE mask_t& operator &= (mask_t& m1, mask_t m2) {m1 = m1 & m2; return m1;} \
-	FORCEINLINE mask_t& operator ^= (mask_t& m1, mask_t m2) {m1 = m1 ^ m2; return m1;} \
-	FORCEINLINE mask_t operator ~(mask_t m) {return (mask_t)(~(int)m);}
-
-
-/** Informative template class exposing basic enumeration properties used by several
- *  other templates below. Here we have only forward declaration. For each enum type
- *  we will create specialization derived from MakeEnumPropsT<>.
- *  i.e.:
- *    template <> struct EnumPropsT<Track> : MakeEnumPropsT<Track, byte, TRACK_BEGIN, TRACK_END, INVALID_TRACK> {};
- *  followed by:
- *    typedef TinyEnumT<Track> TrackByte;
- */
-template <typename Tenum_t> struct EnumPropsT;
-
-/** Helper template class that makes basic properties of given enumeration type visible
- *  from outsize. It is used as base class of several EnumPropsT specializations each
- *  dedicated to one of commonly used enumeration types.
- *  @param Tenum_t enumeration type that you want to describe
- *  @param Tstorage_t what storage type would be sufficient (i.e. byte)
- *  @param Tbegin first valid value from the contiguous range (i.e. TRACK_BEGIN)
- *  @param Tend one past the last valid value from the contiguous range (i.e. TRACK_END)
- *  @param Tinvalid value used as invalid value marker (i.e. INVALID_TRACK)
- */
-template <typename Tenum_t, typename Tstorage_t, Tenum_t Tbegin, Tenum_t Tend, Tenum_t Tinvalid>
-struct MakeEnumPropsT {
-	typedef Tenum_t type;                     ///< enum type (i.e. Trackdir)
-	typedef Tstorage_t storage;               ///< storage type (i.e. byte)
-	static const Tenum_t begin = Tbegin;      ///< lowest valid value (i.e. TRACKDIR_BEGIN)
-	static const Tenum_t end = Tend;          ///< one after the last valid value (i.e. TRACKDIR_END)
-	static const Tenum_t invalid = Tinvalid;  ///< what value is used as invalid value (i.e. INVALID_TRACKDIR)
-};
-
-
-
-/** In some cases we use byte or uint16 to store values that are defined as enum. It is
-	*  necessary in order to control the sizeof() such values. Some compilers make enum
-	*  the same size as int (4 or 8 bytes instead of 1 or 2). As a consequence the strict
-	*  compiler type-checking causes errors like:
-	*     'HasPowerOnRail' : cannot convert parameter 1 from 'byte' to 'RailType' when
-	*  u->u.rail.railtype is passed as argument or type RailType. In such cases it is better
-	*  to teach the compiler that u->u.rail.railtype is to be treated as RailType. */
-template <typename Tenum_t> struct TinyEnumT;
-
-/** The general declaration of TinyEnumT<> (above) */
-template <typename Tenum_t> struct TinyEnumT
-{
-	typedef Tenum_t enum_type;                      ///< expose our enumeration type (i.e. Trackdir) to outside
-	typedef EnumPropsT<Tenum_t> Props;              ///< make easier access to our enumeration propeties
-	typedef typename Props::storage storage_type;   ///< small storage type
-	static const enum_type begin = Props::begin;    ///< enum beginning (i.e. TRACKDIR_BEGIN)
-	static const enum_type end = Props::end;        ///< enum end (i.e. TRACKDIR_END)
-	static const enum_type invalid = Props::invalid;///< invalid value (i.e. INVALID_TRACKDIR)
-
-	storage_type m_val;  ///< here we hold the actual value in small (i.e. byte) form
-
-	/** Cast operator - invoked then the value is assigned to the Tenum_t type */
-	FORCEINLINE operator enum_type () const
-	{
-		return (enum_type)m_val;
-	}
-
-	/** Assignment operator (from Tenum_t type) */
-	FORCEINLINE TinyEnumT& operator = (enum_type e)
-	{
-		m_val = (storage_type)e; return *this;
-	}
-
-	/** postfix ++ operator on tiny type */
-	FORCEINLINE TinyEnumT operator ++ (int)
-	{
-		TinyEnumT org = *this;
-		if (++m_val >= end) m_val -= (storage_type)(end - begin);
-		return org;
-	}
-
-	/** prefix ++ operator on tiny type */
-	FORCEINLINE TinyEnumT& operator ++ ()
-	{
-		if (++m_val >= end) m_val -= (storage_type)(end - begin);
-		return *this;
-	}
-};
-
-/**
- * Overflow safe template for integers, i.e. integers that will never overflow
- * you multiply the maximum value with 2, or add 2, or substract somethng from
- * the minimum value, etc.
- * @param T     the type these integers are stored with.
- * @param T_MAX the maximum value for the integers.
- * @param T_MIN the minimum value for the integers.
- */
-template <class T, T T_MAX, T T_MIN>
-class OverflowSafeInt
-{
-private:
-	/** The non-overflow safe backend to store the value in. */
-	T m_value;
-public:
-	OverflowSafeInt() : m_value(0) { }
-
-	OverflowSafeInt(const OverflowSafeInt& other) { this->m_value = other.m_value; }
-	OverflowSafeInt(const int64 int_)             { this->m_value = int_; }
-
-	FORCEINLINE OverflowSafeInt& operator = (const OverflowSafeInt& other) { this->m_value = other.m_value; return *this; }
-
-	FORCEINLINE OverflowSafeInt operator - () const { return OverflowSafeInt(-this->m_value); }
-
-	/**
-	 * Safe implementation of addition.
-	 * @param other the amount to add
-	 * @note when the addition would yield more than T_MAX (or less than T_MIN),
-	 *       it will be T_MAX (respectively T_MIN).
-	 */
-	FORCEINLINE OverflowSafeInt& operator += (const OverflowSafeInt& other)
-	{
-		if ((T_MAX - abs(other.m_value)) < abs(this->m_value) &&
-				(this->m_value < 0) == (other.m_value < 0)) {
-			this->m_value = (this->m_value < 0) ? T_MIN : T_MAX ;
-		} else {
-			this->m_value += other.m_value;
-		}
-		return *this;
-	}
-
-	/* Operators for addition and substraction */
-	FORCEINLINE OverflowSafeInt  operator +  (const OverflowSafeInt& other) const { OverflowSafeInt result = *this; result += other; return result; }
-	FORCEINLINE OverflowSafeInt  operator +  (const int              other) const { OverflowSafeInt result = *this; result += (int64)other; return result; }
-	FORCEINLINE OverflowSafeInt  operator +  (const uint             other) const { OverflowSafeInt result = *this; result += (int64)other; return result; }
-	FORCEINLINE OverflowSafeInt& operator -= (const OverflowSafeInt& other)       { return *this += (-other); }
-	FORCEINLINE OverflowSafeInt  operator -  (const OverflowSafeInt& other) const { OverflowSafeInt result = *this; result -= other; return result; }
-	FORCEINLINE OverflowSafeInt  operator -  (const int              other) const { OverflowSafeInt result = *this; result -= (int64)other; return result; }
-	FORCEINLINE OverflowSafeInt  operator -  (const uint             other) const { OverflowSafeInt result = *this; result -= (int64)other; return result; }
-
-	FORCEINLINE OverflowSafeInt& operator ++ () { return *this += 1; }
-	FORCEINLINE OverflowSafeInt& operator -- () { return *this += -1; }
-	FORCEINLINE OverflowSafeInt operator ++ (int) { OverflowSafeInt org = *this; *this += 1; return org; }
-	FORCEINLINE OverflowSafeInt operator -- (int) { OverflowSafeInt org = *this; *this += -1; return org; }
-
-	/**
-	 * Safe implementation of multiplication.
-	 * @param factor the factor to multiply this with.
-	 * @note when the multiplication would yield more than T_MAX (or less than T_MIN),
-	 *       it will be T_MAX (respectively T_MIN).
-	 */
-	FORCEINLINE OverflowSafeInt& operator *= (const int factor)
-	{
-		if (factor != 0 && (T_MAX / abs(factor)) < abs(this->m_value)) {
-			 this->m_value = ((this->m_value < 0) == (factor < 0)) ? T_MAX : T_MIN ;
-		} else {
-			this->m_value *= factor ;
-		}
-		return *this;
-	}
-
-	/* Operators for multiplication */
-	FORCEINLINE OverflowSafeInt operator * (const int64  factor) const { OverflowSafeInt result = *this; result *= factor; return result; }
-	FORCEINLINE OverflowSafeInt operator * (const int    factor) const { OverflowSafeInt result = *this; result *= (int64)factor; return result; }
-	FORCEINLINE OverflowSafeInt operator * (const uint   factor) const { OverflowSafeInt result = *this; result *= (int64)factor; return result; }
-	FORCEINLINE OverflowSafeInt operator * (const uint16 factor) const { OverflowSafeInt result = *this; result *= (int64)factor; return result; }
-	FORCEINLINE OverflowSafeInt operator * (const byte   factor) const { OverflowSafeInt result = *this; result *= (int64)factor; return result; }
-
-	/* Operators for division */
-	FORCEINLINE OverflowSafeInt& operator /= (const int              divisor)       { this->m_value /= divisor; return *this; }
-	FORCEINLINE OverflowSafeInt  operator /  (const OverflowSafeInt& divisor) const { OverflowSafeInt result = *this; result /= divisor.m_value; return result; }
-	FORCEINLINE OverflowSafeInt  operator /  (const int              divisor) const { OverflowSafeInt result = *this; result /= divisor; return result; }
-	FORCEINLINE OverflowSafeInt  operator /  (const uint             divisor) const { OverflowSafeInt result = *this; result /= (int)divisor; return result; }
-
-	/* Operators for modulo */
-	FORCEINLINE OverflowSafeInt& operator %= (const int  divisor)       { this->m_value %= divisor; return *this; }
-	FORCEINLINE OverflowSafeInt  operator %  (const int  divisor) const { OverflowSafeInt result = *this; result %= divisor; return result; }
-
-	/* Operators for shifting */
-	FORCEINLINE OverflowSafeInt& operator <<= (const int shift)       { this->m_value <<= shift; return *this; }
-	FORCEINLINE OverflowSafeInt  operator <<  (const int shift) const { OverflowSafeInt result = *this; result <<= shift; return result; }
-	FORCEINLINE OverflowSafeInt& operator >>= (const int shift)       { this->m_value >>= shift; return *this; }
-	FORCEINLINE OverflowSafeInt  operator >>  (const int shift) const { OverflowSafeInt result = *this; result >>= shift; return result; }
-
-	/* Operators for (in)equality when comparing overflow safe ints */
-	FORCEINLINE bool operator == (const OverflowSafeInt& other) const { return this->m_value == other.m_value; }
-	FORCEINLINE bool operator != (const OverflowSafeInt& other) const { return !(*this == other); }
-	FORCEINLINE bool operator >  (const OverflowSafeInt& other) const { return this->m_value > other.m_value; }
-	FORCEINLINE bool operator >= (const OverflowSafeInt& other) const { return this->m_value >= other.m_value; }
-	FORCEINLINE bool operator <  (const OverflowSafeInt& other) const { return !(*this >= other); }
-	FORCEINLINE bool operator <= (const OverflowSafeInt& other) const { return !(*this > other); }
-
-	/* Operators for (in)equality when comparing non-overflow safe ints */
-	FORCEINLINE bool operator == (const int other) const { return this->m_value == other; }
-	FORCEINLINE bool operator != (const int other) const { return !(*this == other); }
-	FORCEINLINE bool operator >  (const int other) const { return this->m_value > other; }
-	FORCEINLINE bool operator >= (const int other) const { return this->m_value >= other; }
-	FORCEINLINE bool operator <  (const int other) const { return !(*this >= other); }
-	FORCEINLINE bool operator <= (const int other) const { return !(*this > other); }
-
-	FORCEINLINE operator int64 () const { return this->m_value; }
-};
-
-/* Sometimes we got int64 operator OverflowSafeInt instead of vice versa. Handle that properly */
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator + (int64 a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b + a; }
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator - (int64 a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return -b + a; }
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator * (int64 a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b * a; }
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator / (int64 a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return (OverflowSafeInt<T, T_MAX, T_MIN>)a / (int)b; }
-
-/* Sometimes we got int operator OverflowSafeInt instead of vice versa. Handle that properly */
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator + (int   a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b + a; }
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator - (int   a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return -b + a; }
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator * (int   a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b * a; }
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator / (int   a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return (OverflowSafeInt<T, T_MAX, T_MIN>)a / (int)b; }
-
-/* Sometimes we got uint operator OverflowSafeInt instead of vice versa. Handle that properly */
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator + (uint  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b + a; }
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator - (uint  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return -b + a; }
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator * (uint  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b * a; }
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator / (uint  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return (OverflowSafeInt<T, T_MAX, T_MIN>)a / (int)b; }
-
-/* Sometimes we got byte operator OverflowSafeInt instead of vice versa. Handle that properly */
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator + (byte  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b + a; }
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator - (byte  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return -b + a; }
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator * (byte  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return b * a; }
-template <class T, int64 T_MAX, int64 T_MIN> FORCEINLINE OverflowSafeInt<T, T_MAX, T_MIN> operator / (byte  a, OverflowSafeInt<T, T_MAX, T_MIN> b) { return (OverflowSafeInt<T, T_MAX, T_MIN>)a / (int)b; }
-
-#endif /* HELPERS_HPP */
--- a/src/industry.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/industry.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,11 +6,16 @@
 #define INDUSTRY_H
 
 #include "oldpool.h"
-#include "helpers.hpp"
+#include "core/random_func.hpp"
 #include "newgrf_storage.h"
-
-typedef uint16 IndustryGfx;
-typedef uint8 IndustryType;
+#include "cargo_type.h"
+#include "economy_type.h"
+#include "map_type.h"
+#include "slope_type.h"
+#include "date_type.h"
+#include "town_type.h"
+#include "industry_type.h"
+#include "newgrf_string_type.h"
 
 enum {
 	INVALID_INDUSTRY       = 0xFFFF,
@@ -59,13 +64,6 @@
 	ICT_SCENARIO_EDITOR   ///< while scenarion edition
 };
 
-/** From where is callback CBID_INDUSTRY_AVAILABLE been called */
-enum IndustryAvailabilityCallType {
-	IACT_MAPGENERATION,   ///< during random map generation
-	IACT_RANDOMCREATION,  ///< during creation of random ingame industry
-	IACT_USERCREATION,    ///< from the Fund/build window
-};
-
 enum IndustryBehaviour {
 	INDUSTRYBEH_NONE                  =      0,
 	INDUSTRYBEH_PLANT_FIELDS          = 1 << 0,  ///< periodically plants fileds around itself (temp and artic farms)
@@ -92,7 +90,6 @@
 
 DECLARE_ENUM_AS_BIT_SET(IndustryBehaviour);
 
-struct Industry;
 DECLARE_OLD_POOL(Industry, Industry, 3, 8000)
 
 /**
@@ -177,11 +174,11 @@
 	byte climate_availability;            ///< Bitmask, giving landscape enums as bit position
 	IndustryBehaviour behaviour;           ///< How this industry will behave, and how others entities can use it
 	byte map_colour;                      ///< colour used for the small map
-	StringID name;                        ///< Displayed name of the industry
-	StringID new_industry_text;           ///< Message appearing when the industry is built
-	StringID closure_text;                ///< Message appearing when the industry closes
-	StringID production_up_text;          ///< Message appearing when the industry's production is increasing
-	StringID production_down_text;        ///< Message appearing when the industry's production is decreasing
+	GRFMappedStringID name;               ///< Displayed name of the industry
+	GRFMappedStringID new_industry_text;  ///< Message appearing when the industry is built
+	GRFMappedStringID closure_text;       ///< Message appearing when the industry closes
+	GRFMappedStringID production_up_text; ///< Message appearing when the industry's production is increasing
+	GRFMappedStringID production_down_text; ///< Message appearing when the industry's production is decreasing
 	byte appear_ingame[NUM_LANDSCAPE];    ///< Probability of appearance in game
 	byte appear_creation[NUM_LANDSCAPE];  ///< Probability of appearance during map creation
 	uint8 number_of_sounds;               ///< Number of sounds available in the sounds array
--- a/src/industry_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/industry_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,30 +5,18 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "clear_map.h"
-#include "functions.h"
 #include "industry_map.h"
 #include "station_map.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "table/sprites.h"
-#include "map.h"
-#include "tile.h"
 #include "train.h"
 #include "landscape.h"
-#include "viewport.h"
-#include "command.h"
+#include "viewport_func.h"
+#include "command_func.h"
 #include "industry.h"
 #include "town.h"
-#include "vehicle.h"
 #include "news.h"
 #include "saveload.h"
-#include "economy.h"
-#include "sound.h"
 #include "variables.h"
-#include "table/industry_land.h"
-#include "table/build_industry.h"
 #include "genworld.h"
-#include "date.h"
 #include "water_map.h"
 #include "tree_map.h"
 #include "cargotype.h"
@@ -41,6 +29,18 @@
 #include "autoslope.h"
 #include "transparency.h"
 #include "water.h"
+#include "strings_func.h"
+#include "tile_cmd.h"
+#include "functions.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
+#include "table/industry_land.h"
+#include "table/build_industry.h"
 
 void ShowIndustryViewWindow(int industry);
 void BuildOilRig(TileIndex tile);
@@ -401,7 +401,7 @@
 	}
 
 	if (flags & DC_EXEC) delete i;
-	return CommandCost(indspec->GetRemovalCost());
+	return CommandCost(EXPENSES_CONSTRUCTION, indspec->GetRemovalCost());
 }
 
 static void TransportIndustryGoods(TileIndex tile)
@@ -1184,14 +1184,14 @@
 {
 	if (IsSteepSlope(current)) return true;
 	if (current != SLOPE_FLAT) {
-		if (refused & SLOPE_STEEP) return true;
+		if (IsSteepSlope(refused)) return true;
 
 		Slope t = ComplementSlope(current);
 
-		if (refused & 1 && (t & SLOPE_NW)) return false;
-		if (refused & 2 && (t & SLOPE_NE)) return false;
-		if (refused & 4 && (t & SLOPE_SW)) return false;
-		if (refused & 8 && (t & SLOPE_SE)) return false;
+		if (refused & SLOPE_W && (t & SLOPE_NW)) return true;
+		if (refused & SLOPE_S && (t & SLOPE_NE)) return true;
+		if (refused & SLOPE_E && (t & SLOPE_SW)) return true;
+		if (refused & SLOPE_N && (t & SLOPE_SE)) return true;
 	}
 
 	return false;
@@ -1238,7 +1238,7 @@
 
 			if (ind_behav & (INDUSTRYBEH_ONLY_INTOWN | INDUSTRYBEH_TOWN1200_MORE)) {
 				if (!IsTileType(cur_tile, MP_HOUSE)) {
-					_error_message = STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS;
+					_error_message = STR_030D_CAN_ONLY_BE_BUILT_IN_TOWNS;
 					return false;
 				}
 				if (CmdFailed(DoCommand(cur_tile, 0, 0, 0, CMD_LANDSCAPE_CLEAR))) return false;
@@ -1253,7 +1253,7 @@
 	/* It is almost impossible to have a fully flat land in TG, so what we
 	 *  do is that we check if we can make the land flat later on. See
 	 *  CheckIfCanLevelIndustryPlatform(). */
-	return !refused_slope || (_patches.land_generator == LG_TERRAGENESIS && _generating_world && !custom_shape);
+	return !refused_slope || (_patches.land_generator == LG_TERRAGENESIS && _generating_world && !custom_shape && !_ignore_restrictions);
 }
 
 static bool CheckIfIndustryIsAllowed(TileIndex tile, int type, const Town *t)
@@ -1378,31 +1378,36 @@
 }
 
 
-static bool CheckIfTooCloseToIndustry(TileIndex tile, int type)
+static bool CheckIfFarEnoughFromIndustry(TileIndex tile, int type)
 {
 	const IndustrySpec *indspec = GetIndustrySpec(type);
 	const Industry *i;
 
-	/* accepting industries won't be close, not even with patch */
 	if (_patches.same_industry_close && indspec->accepts_cargo[0] == CT_INVALID)
+		/* Allow primary industries to be placed close to any other industry */
 		return true;
 
 	FOR_ALL_INDUSTRIES(i) {
+		/* Within 14 tiles from another industry is considered close */
+		bool in_low_distance = DistanceMax(tile, i->xy) <= 14;
+
 		/* check if an industry that accepts the same goods is nearby */
-		if (DistanceMax(tile, i->xy) <= 14 &&
-				indspec->accepts_cargo[0] != CT_INVALID &&
+		if (in_low_distance &&
+				indspec->accepts_cargo[0] != CT_INVALID && // not a primary industry?
 				indspec->accepts_cargo[0] == i->accepts_cargo[0] && (
-					_game_mode != GM_EDITOR ||
-					!_patches.same_industry_close ||
-					!_patches.multiple_industry_per_town
-				)) {
+				/* at least one of those options must be true */
+				_game_mode != GM_EDITOR || // editor must not be stopped
+				!_patches.same_industry_close ||
+				!_patches.multiple_industry_per_town)) {
 			_error_message = STR_INDUSTRY_TOO_CLOSE;
 			return false;
 		}
 
-		/* check "not close to" field. */
-		if ((i->type == indspec->conflicting[0] || i->type == indspec->conflicting[1] || i->type == indspec->conflicting[2]) &&
-				DistanceMax(tile, i->xy) <= 14) {
+		/* check if there are any conflicting industry types around */
+		if ((i->type == indspec->conflicting[0] ||
+				i->type == indspec->conflicting[1] ||
+				i->type == indspec->conflicting[2]) &&
+				in_low_distance) {
 			_error_message = STR_INDUSTRY_TOO_CLOSE;
 			return false;
 		}
@@ -1513,17 +1518,17 @@
 
 			DoCommand(cur_tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
 
-			MakeIndustry(cur_tile, i->index, it->gfx);
+			MakeIndustry(cur_tile, i->index, it->gfx, Random());
 
 			if (_generating_world) {
 				SetIndustryConstructionCounter(cur_tile, 3);
 				SetIndustryConstructionStage(cur_tile, 2);
 			}
-			if (it->gfx >= NEW_INDUSTRYTILEOFFSET) {
-				/* New industry */
-				const IndustryTileSpec *its = GetIndustryTileSpec(it->gfx);
-				if (its->animation_info != 0xFFFF) AddAnimatedTile(cur_tile);
-			}
+
+			/* it->gfx is stored in the map. But the translated ID cur_gfx is the interesting one */
+			IndustryGfx cur_gfx = GetTranslatedIndustryTileID(it->gfx);
+			const IndustryTileSpec *its = GetIndustryTileSpec(cur_gfx);
+			if (its->animation_info != 0xFFFF) AddAnimatedTile(cur_tile);
 		}
 	} while ((++it)->ti.x != -0x80);
 
@@ -1558,8 +1563,8 @@
 		if (!_check_new_industry_procs[indspec->check_proc](tile)) return NULL;
 	}
 
-	if (!custom_shape_check && _patches.land_generator == LG_TERRAGENESIS && _generating_world && !CheckIfCanLevelIndustryPlatform(tile, 0, it, type)) return NULL;
-	if (!CheckIfTooCloseToIndustry(tile, type)) return NULL;
+	if (!custom_shape_check && _patches.land_generator == LG_TERRAGENESIS && _generating_world && !_ignore_restrictions && !CheckIfCanLevelIndustryPlatform(tile, 0, it, type)) return NULL;
+	if (!CheckIfFarEnoughFromIndustry(tile, type)) return NULL;
 
 	const Town *t = CheckMultipleIndustryInTown(tile, type);
 	if (t == NULL) return NULL;
@@ -1591,8 +1596,6 @@
 {
 	const IndustrySpec *indspec;
 
-	SET_EXPENSES_TYPE(EXPENSES_OTHER);
-
 	indspec = GetIndustrySpec(p1);
 
 	/* Check if the to-be built/founded industry is available for this climate. */
@@ -1613,7 +1616,11 @@
 			 * is nothing we can really do about that. */
 			if (Random() <= indspec->prospecting_chance) {
 				for (int i = 0; i < 5000; i++) {
-					const Industry *ind = CreateNewIndustryHelper(RandomTile(), p1, flags, indspec, RandomRange(indspec->num_table));
+					/* We should not have more than one Random() in a function call
+					 * because parameter evaluation order is not guaranteed in the c++ standard
+					 */
+					tile = RandomTile();
+					const Industry *ind = CreateNewIndustryHelper(tile, p1, flags, indspec, RandomRange(indspec->num_table));
 					if (ind != NULL) {
 						SetDParam(0, indspec->name);
 						if (indspec->new_industry_text > STR_LAST_STRINGID) {
@@ -1643,7 +1650,7 @@
 		if (CreateNewIndustryHelper(tile, p1, flags, indspec, num) == NULL) return CMD_ERROR;
 	}
 
-	return CommandCost(indspec->GetConstructionCost());
+	return CommandCost(EXPENSES_OTHER, indspec->GetConstructionCost());
 }
 
 
@@ -1944,13 +1951,13 @@
 		 */
 		const Order *o;
 		FOR_VEHICLE_ORDERS(v, o) {
-			if (o->type == OT_GOTO_STATION && !HasBit(o->flags, OFB_TRANSFER)) {
+			if (o->type == OT_GOTO_STATION && !HasBit(o->flags, OF_TRANSFER)) {
 				/* Vehicle visits a station to load or unload */
 				Station *st = GetStation(o->dest);
 				if (!st->IsValid()) continue;
 
 				/* Same cargo produced by industry is dropped here => not serviced by vehicle v */
-				if (HasBit(o->flags, OFB_UNLOAD) && !c_accepts) break;
+				if (HasBit(o->flags, OF_UNLOAD) && !c_accepts) break;
 
 				if (stations.find(st) != stations.end()) {
 					if (v->owner == _local_player) return 2; // Player services industry
@@ -1991,6 +1998,7 @@
 
 enum {
 	PERCENT_TRANSPORTED_60 = 153,
+	PERCENT_TRANSPORTED_80 = 204,
 };
 
 /** Change industry production or do closure
@@ -2052,18 +2060,26 @@
 		if (smooth_economy) {
 			closeit = true;
 			for (byte j = 0; j < 2 && i->produced_cargo[j] != CT_INVALID; j++){
+				uint32 r = Random();
 				int old_prod, new_prod, percent;
+				/* If over 60% is transported, mult is 1, else mult is -1. */
 				int mult = (i->last_month_pct_transported[j] > PERCENT_TRANSPORTED_60) ? 1 : -1;
 
 				new_prod = old_prod = i->production_rate[j];
 
+				/* For industries with only_decrease flags (temperate terrain Oil Wells),
+				 * the multiplier will always be -1 so they will only decrease. */
 				if (only_decrease) {
 					mult = -1;
-				} else if (Chance16(1, 3)) {
+				/* For normal industries, if over 60% is transported, 33% chance for decrease.
+				 * Bonus for very high station ratings (over 80%): 16% chance for decrease. */
+				} else if (Chance16I(1, ((i->last_month_pct_transported[j] > PERCENT_TRANSPORTED_80) ? 6 : 3), r)) {
 					mult *= -1;
 				}
 
-				if (Chance16(1, 22)) {
+				/* 4.5% chance for 3-23% (or 1 unit for very low productions) production change,
+				 * determined by mult value. If mult = 1 prod. increases, else (-1) it decreases. */
+				if (Chance16I(1, 22, r >> 16)) {
 					new_prod += mult * (max(((RandomRange(50) + 10) * old_prod) >> 8, 1U));
 				}
 
@@ -2091,7 +2107,7 @@
 			}
 		} else {
 			if (only_decrease || Chance16(1, 3)) {
-				/* If you transport > 60%, 66% chance we increase, else 33% chance we increase */
+				/* If more than 60% transported, 66% chance of increase, else 33% chance of increase */
 				if (!only_decrease && (i->last_month_pct_transported[0] > PERCENT_TRANSPORTED_60) != Chance16(1, 3)) {
 					mul = 1; // Increase production
 				} else {
@@ -2251,10 +2267,10 @@
 			if (HasBit(itspec->callback_flags, CBM_INDT_AUTOSLOPE)) {
 				/* If the callback fails, allow autoslope. */
 				uint16 res = GetIndustryTileCallback(CBID_INDUSTRY_AUTOSLOPE, 0, 0, gfx, GetIndustryByTile(tile), tile);
-				if ((res == 0) || (res == CALLBACK_FAILED)) return _price.terraform;
+				if ((res == 0) || (res == CALLBACK_FAILED)) return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 			} else {
 				/* allow autoslope */
-				return _price.terraform;
+				return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 			}
 		}
 	}
@@ -2284,12 +2300,12 @@
 	    SLE_VAR(Industry, width,                      SLE_UINT8),
 	    SLE_VAR(Industry, height,                     SLE_UINT8),
 	    SLE_REF(Industry, town,                       REF_TOWN),
-	SLE_CONDNULL( 2, 2, 60),       ///< used to be industry's produced_cargo
+	SLE_CONDNULL( 2, 0, 60),       ///< used to be industry's produced_cargo
 	SLE_CONDARR(Industry, produced_cargo,             SLE_UINT8,  2,              78, SL_MAX_VERSION),
 	SLE_CONDARR(Industry, incoming_cargo_waiting,     SLE_UINT16, 3,              70, SL_MAX_VERSION),
 	    SLE_ARR(Industry, produced_cargo_waiting,     SLE_UINT16, 2),
 	    SLE_ARR(Industry, production_rate,            SLE_UINT8,  2),
-	SLE_CONDNULL( 3, 2, 60),       ///< used to be industry's accepts_cargo
+	SLE_CONDNULL( 3, 0, 60),       ///< used to be industry's accepts_cargo
 	SLE_CONDARR(Industry, accepts_cargo,              SLE_UINT8,  3,              78, SL_MAX_VERSION),
 	    SLE_VAR(Industry, prod_level,                 SLE_UINT8),
 	    SLE_ARR(Industry, this_month_production,      SLE_UINT16, 2),
--- a/src/industry_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/industry_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,58 +5,39 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "strings.h"
-#include "table/strings.h"
-#include "table/sprites.h"
-#include "map.h"
 #include "gui.h"
-#include "window.h"
-#include "gfx.h"
-#include "command.h"
-#include "viewport.h"
+#include "window_gui.h"
+#include "textbuf_gui.h"
+#include "command_func.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
 #include "industry.h"
 #include "town.h"
 #include "variables.h"
-#include "helpers.hpp"
 #include "cargotype.h"
 #include "newgrf.h"
 #include "newgrf_callbacks.h"
 #include "newgrf_industries.h"
 #include "newgrf_text.h"
-#include "date.h"
-
-extern Industry *CreateNewIndustry(TileIndex tile, IndustryType type);
+#include "strings_func.h"
+#include "map_func.h"
+#include "player_func.h"
+#include "settings_type.h"
 
-/**
- * Search callback function for TryBuildIndustry
- * @param tile to test
- * @param data that is passed by the caller.  In this case, the type of industry been tested
- * @return the success (or not) of the operation
- */
-static bool SearchTileForIndustry(TileIndex tile, uint32 data)
-{
-	return CreateNewIndustry(tile, data) != NULL;
-}
+#include "table/strings.h"
+#include "table/sprites.h"
 
-/**
- * Perform a 9*9 tiles circular search around a tile
- * in order to find a suitable zone to create the desired industry
- * @param tile to start search for
- * @param type of the desired industry
- * @return the success (or not) of the operation
- */
-static bool TryBuildIndustry(TileIndex tile, int type)
-{
-	return CircularTileSearch(tile, 9, SearchTileForIndustry, type);
-}
 bool _ignore_restrictions;
 
-enum {
-	DYNA_INDU_MATRIX_WIDGET = 2,
-	DYNA_INDU_INFOPANEL = 4,
-	DYNA_INDU_FUND_WIDGET,
-	DYNA_INDU_RESIZE_WIDGET,
+/** Names of the widgets of the dynamic place industries gui */
+enum DynamicPlaceIndustriesWidgets {
+	DPIW_CLOSEBOX = 0,
+	DPIW_CAPTION,
+	DPIW_MATRIX_WIDGET,
+	DPIW_SCROLLBAR,
+	DPIW_INFOPANEL,
+	DPIW_FUND_WIDGET,
+	DPIW_RESIZE_WIDGET,
 };
 
 /** Attached struct to the window extended data */
@@ -87,11 +68,11 @@
 			 * info coming from the callback.  SO it will only be available to tis full
 			 * height when newindistries are loaded */
 			if (!_loaded_newgrf_features.has_newindustries) {
-				w->widget[DYNA_INDU_INFOPANEL].bottom -= 44;
-				w->widget[DYNA_INDU_FUND_WIDGET].bottom -= 44;
-				w->widget[DYNA_INDU_FUND_WIDGET].top -= 44;
-				w->widget[DYNA_INDU_RESIZE_WIDGET].bottom -= 44;
-				w->widget[DYNA_INDU_RESIZE_WIDGET].top -= 44;
+				w->widget[DPIW_INFOPANEL].bottom -= 44;
+				w->widget[DPIW_FUND_WIDGET].bottom -= 44;
+				w->widget[DPIW_FUND_WIDGET].top -= 44;
+				w->widget[DPIW_RESIZE_WIDGET].bottom -= 44;
+				w->widget[DPIW_RESIZE_WIDGET].top -= 44;
 				w->resize.height = w->height -= 44;
 			}
 
@@ -138,9 +119,9 @@
 
 		case WE_PAINT: {
 			const IndustrySpec *indsp = (WP(w, fnd_d).select == INVALID_INDUSTRYTYPE) ? NULL : GetIndustrySpec(WP(w, fnd_d).select);
-			int x_str = w->widget[DYNA_INDU_INFOPANEL].left + 3;
-			int y_str = w->widget[DYNA_INDU_INFOPANEL].top + 3;
-			const Widget *wi = &w->widget[DYNA_INDU_INFOPANEL];
+			int x_str = w->widget[DPIW_INFOPANEL].left + 3;
+			int y_str = w->widget[DPIW_INFOPANEL].top + 3;
+			const Widget *wi = &w->widget[DPIW_INFOPANEL];
 			int max_width = wi->right - wi->left - 4;
 
 			/* Raw industries might be prospected. Show this fact by changing the string
@@ -148,11 +129,11 @@
 			if (_game_mode == GM_EDITOR) {
 				/* We've chosen many random industries but no industries have been specified */
 				if (indsp == NULL) _fund_gui.enabled[WP(w, fnd_d).index] = _opt.diff.number_industries != 0;
-				w->widget[DYNA_INDU_FUND_WIDGET].data = STR_BUILD_NEW_INDUSTRY;
+				w->widget[DPIW_FUND_WIDGET].data = STR_BUILD_NEW_INDUSTRY;
 			} else {
-				w->widget[DYNA_INDU_FUND_WIDGET].data = (_patches.raw_industry_construction == 2 && indsp->IsRawIndustry()) ? STR_PROSPECT_NEW_INDUSTRY : STR_FUND_NEW_INDUSTRY;
+				w->widget[DPIW_FUND_WIDGET].data = (_patches.raw_industry_construction == 2 && indsp->IsRawIndustry()) ? STR_PROSPECT_NEW_INDUSTRY : STR_FUND_NEW_INDUSTRY;
 			}
-			w->SetWidgetDisabledState(DYNA_INDU_FUND_WIDGET, !_fund_gui.enabled[WP(w, fnd_d).index]);
+			w->SetWidgetDisabledState(DPIW_FUND_WIDGET, !_fund_gui.enabled[WP(w, fnd_d).index]);
 
 			SetVScrollCount(w, _fund_gui.count);
 
@@ -232,11 +213,16 @@
 			}
 		} break;
 
+		case WE_DOUBLE_CLICK:
+			if (e->we.click.widget != DPIW_MATRIX_WIDGET) break;
+			e->we.click.widget = DPIW_FUND_WIDGET;
+			/* Fall through */
+
 		case WE_CLICK:
 			switch (e->we.click.widget) {
-				case DYNA_INDU_MATRIX_WIDGET: {
+				case DPIW_MATRIX_WIDGET: {
 					const IndustrySpec *indsp;
-					int y = (e->we.click.pt.y - w->widget[DYNA_INDU_MATRIX_WIDGET].top) / 13 + w->vscroll.pos ;
+					int y = (e->we.click.pt.y - w->widget[DPIW_MATRIX_WIDGET].top) / 13 + w->vscroll.pos ;
 
 					if (y >= 0 && y < _fund_gui.count) { // Is it within the boundaries of available data?
 						WP(w, fnd_d).index = y;
@@ -248,15 +234,15 @@
 						if ((_game_mode != GM_EDITOR && _patches.raw_industry_construction == 2 && indsp != NULL && indsp->IsRawIndustry()) ||
 								WP(w, fnd_d).select == INVALID_INDUSTRYTYPE) {
 							/* Reset the button state if going to prospecting or "build many industries" */
-							RaiseWindowButtons(w);
+							w->RaiseButtons();
 							ResetObjectToPlace();
 						}
 					}
 				} break;
 
-				case DYNA_INDU_FUND_WIDGET: {
+				case DPIW_FUND_WIDGET: {
 					if (WP(w, fnd_d).select == INVALID_INDUSTRYTYPE) {
-						HandleButtonClick(w, DYNA_INDU_FUND_WIDGET);
+						w->HandleButtonClick(DPIW_FUND_WIDGET);
 
 						if (GetNumTowns() == 0) {
 							ShowErrorMessage(STR_0286_MUST_BUILD_TOWN_FIRST, STR_CAN_T_GENERATE_INDUSTRIES, 0, 0);
@@ -268,9 +254,9 @@
 						}
 					} else if (_game_mode != GM_EDITOR && _patches.raw_industry_construction == 2 && GetIndustrySpec(WP(w, fnd_d).select)->IsRawIndustry()) {
 						DoCommandP(0, WP(w, fnd_d).select, 0, NULL, CMD_BUILD_INDUSTRY | CMD_MSG(STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY));
-						HandleButtonClick(w, DYNA_INDU_FUND_WIDGET);
+						w->HandleButtonClick(DPIW_FUND_WIDGET);
 					} else {
-						HandlePlacePushButton(w, DYNA_INDU_FUND_WIDGET, SPR_CURSOR_INDUSTRY, VHM_RECT, NULL);
+						HandlePlacePushButton(w, DPIW_FUND_WIDGET, SPR_CURSOR_INDUSTRY, VHM_RECT, NULL);
 					}
 				} break;
 			}
@@ -279,7 +265,7 @@
 		case WE_RESIZE: {
 			/* Adjust the number of items in the matrix depending of the rezise */
 			w->vscroll.cap  += e->we.sizing.diff.y / (int)w->resize.step_height;
-			w->widget[DYNA_INDU_MATRIX_WIDGET].data = (w->vscroll.cap << 8) + 1;
+			w->widget[DPIW_MATRIX_WIDGET].data = (w->vscroll.cap << 8) + 1;
 		} break;
 
 		case WE_PLACE_OBJ: {
@@ -298,7 +284,7 @@
 				_current_player = OWNER_NONE;
 				_generating_world = true;
 				_ignore_restrictions = true;
-				success = TryBuildIndustry(e->we.place.tile, WP(w, fnd_d).select);
+				success = DoCommandP(e->we.place.tile, WP(w, fnd_d).select, InteractiveRandomRange(indsp->num_table), NULL, CMD_BUILD_INDUSTRY | CMD_MSG(STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY));
 				if (!success) {
 					SetDParam(0, indsp->name);
 					ShowErrorMessage(_error_message, STR_0285_CAN_T_BUILD_HERE, e->we.place.pt.x, e->we.place.pt.y);
@@ -315,6 +301,7 @@
 		} break;
 
 		case WE_TICK:
+			if (_pause_game != 0) break;
 			if (!WP(w, fnd_d).timer_enabled) break;
 			if (--WP(w, fnd_d).callback_timer == 0) {
 				/* We have just passed another day.
@@ -337,22 +324,24 @@
 
 		case WE_TIMEOUT:
 		case WE_ABORT_PLACE_OBJ:
-			RaiseWindowButtons(w);
+			w->RaiseButtons();
 			break;
 	}
 }
 
+/** Widget definition of the dynamic place industries gui */
 static const Widget _build_dynamic_industry_widgets[] = {
-{   WWT_CLOSEBOX,    RESIZE_NONE,    7,     0,    10,     0,    13, STR_00C5,                       STR_018B_CLOSE_WINDOW},
-{    WWT_CAPTION,   RESIZE_RIGHT,    7,    11,   169,     0,    13, STR_0314_FUND_NEW_INDUSTRY,     STR_018C_WINDOW_TITLE_DRAG_THIS},
-{     WWT_MATRIX,      RESIZE_RB,    7,     0,   157,    14,   118, 0x801,                          STR_INDUSTRY_SELECTION_HINT},
-{  WWT_SCROLLBAR,     RESIZE_LRB,    7,   158,   169,    14,   118, 0x0,                            STR_0190_SCROLL_BAR_SCROLLS_LIST},
-{      WWT_PANEL,     RESIZE_RTB,    7,     0,   169,   119,   199, 0x0,                            STR_NULL},
-{    WWT_TEXTBTN,     RESIZE_RTB,    7,     0,   157,   200,   211, STR_FUND_NEW_INDUSTRY,          STR_NULL},
-{  WWT_RESIZEBOX,    RESIZE_LRTB,    7,   158,   169,   200,   211, 0x0,                            STR_RESIZE_BUTTON},
+{   WWT_CLOSEBOX,    RESIZE_NONE,    7,     0,    10,     0,    13, STR_00C5,                       STR_018B_CLOSE_WINDOW},            // DPIW_CLOSEBOX
+{    WWT_CAPTION,   RESIZE_RIGHT,    7,    11,   169,     0,    13, STR_0314_FUND_NEW_INDUSTRY,     STR_018C_WINDOW_TITLE_DRAG_THIS},  // DPIW_CAPTION
+{     WWT_MATRIX,      RESIZE_RB,    7,     0,   157,    14,   118, 0x801,                          STR_INDUSTRY_SELECTION_HINT},      // DPIW_MATRIX_WIDGET
+{  WWT_SCROLLBAR,     RESIZE_LRB,    7,   158,   169,    14,   118, 0x0,                            STR_0190_SCROLL_BAR_SCROLLS_LIST}, // DPIW_SCROLLBAR
+{      WWT_PANEL,     RESIZE_RTB,    7,     0,   169,   119,   199, 0x0,                            STR_NULL},                         // DPIW_INFOPANEL
+{    WWT_TEXTBTN,     RESIZE_RTB,    7,     0,   157,   200,   211, STR_FUND_NEW_INDUSTRY,          STR_NULL},                         // DPIW_FUND_WIDGET
+{  WWT_RESIZEBOX,    RESIZE_LRTB,    7,   158,   169,   200,   211, 0x0,                            STR_RESIZE_BUTTON},                // DPIW_RESIZE_WIDGET
 {   WIDGETS_END},
 };
 
+/** Window definition of the dynamic place industries gui */
 static const WindowDesc _build_industry_dynamic_desc = {
 	WDP_AUTO, WDP_AUTO, 170, 212, 170, 212,
 	WC_BUILD_INDUSTRY, WC_NONE,
@@ -385,6 +374,18 @@
 			(i->accepts_cargo[0] == CT_INVALID || i->accepts_cargo[0] == CT_VALUABLES));
 }
 
+/** Names of the widgets of the view industry gui */
+enum IndustryViewWidgets {
+	IVW_CLOSEBOX = 0,
+	IVW_CAPTION,
+	IVW_STICKY,
+	IVW_BACKGROUND,
+	IVW_VIEWPORT,
+	IVW_INFO,
+	IVW_GOTO,
+	IVW_SPACER,
+};
+
 /** Information to store about the industry window */
 struct indview_d : public vp_d {
 	byte editbox_line;        ///< The line clicked to open the edit box
@@ -530,7 +531,7 @@
 		Industry *i;
 
 		switch (e->we.click.widget) {
-		case 5: {
+		case IVW_INFO: {
 			int line, x;
 
 			i = GetIndustry(w->window_number);
@@ -565,7 +566,7 @@
 				}
 			}
 		} break;
-		case 6:
+		case IVW_GOTO:
 			i = GetIndustry(w->window_number);
 			ScrollMainWindowToTile(i->xy + TileDiffXY(1, 1));
 		} break;
@@ -599,18 +600,20 @@
 	}
 }
 
+/** Widget definition of the view industy gui */
 static const Widget _industry_view_widgets[] = {
-{   WWT_CLOSEBOX,   RESIZE_NONE,     9,     0,    10,     0,    13, STR_00C5,          STR_018B_CLOSE_WINDOW},
-{    WWT_CAPTION,   RESIZE_NONE,     9,    11,   247,     0,    13, STR_4801,          STR_018C_WINDOW_TITLE_DRAG_THIS},
-{  WWT_STICKYBOX,   RESIZE_NONE,     9,   248,   259,     0,    13, 0x0,               STR_STICKY_BUTTON},
-{      WWT_PANEL,   RESIZE_NONE,     9,     0,   259,    14,   105, 0x0,               STR_NULL},
-{      WWT_INSET,   RESIZE_NONE,     9,     2,   257,    16,   103, 0x0,               STR_NULL},
-{      WWT_PANEL,   RESIZE_NONE,     9,     0,   259,   106,   147, 0x0,               STR_NULL},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,     9,     0,   129,   148,   159, STR_00E4_LOCATION, STR_482C_CENTER_THE_MAIN_VIEW_ON},
-{      WWT_PANEL,   RESIZE_NONE,     9,   130,   259,   148,   159, 0x0,               STR_NULL},
+{   WWT_CLOSEBOX,   RESIZE_NONE,     9,     0,    10,     0,    13, STR_00C5,          STR_018B_CLOSE_WINDOW},            // IVW_CLOSEBOX
+{    WWT_CAPTION,   RESIZE_NONE,     9,    11,   247,     0,    13, STR_4801,          STR_018C_WINDOW_TITLE_DRAG_THIS},  // IVW_CAPTION
+{  WWT_STICKYBOX,   RESIZE_NONE,     9,   248,   259,     0,    13, 0x0,               STR_STICKY_BUTTON},                // IVW_STICKY
+{      WWT_PANEL,   RESIZE_NONE,     9,     0,   259,    14,   105, 0x0,               STR_NULL},                         // IVW_BACKGROUND
+{      WWT_INSET,   RESIZE_NONE,     9,     2,   257,    16,   103, 0x0,               STR_NULL},                         // IVW_VIEWPORT
+{      WWT_PANEL,   RESIZE_NONE,     9,     0,   259,   106,   147, 0x0,               STR_NULL},                         // IVW_INFO
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     9,     0,   129,   148,   159, STR_00E4_LOCATION, STR_482C_CENTER_THE_MAIN_VIEW_ON}, // IVW_GOTO
+{      WWT_PANEL,   RESIZE_NONE,     9,   130,   259,   148,   159, 0x0,               STR_NULL},                         // IVW_SPACER
 {   WIDGETS_END},
 };
 
+/** Window definition of the view industy gui */
 static const WindowDesc _industry_view_desc = {
 	WDP_AUTO, WDP_AUTO, 260, 160, 260, 160,
 	WC_INDUSTRY_VIEW, WC_NONE,
@@ -632,26 +635,34 @@
 	}
 }
 
-enum {
-	DIRECTORY_INDU_SORTBYNAME = 3,
-	DIRECTORY_INDU_SORTBYTYPE,
-	DIRECTORY_INDU_SORTBYPROD,
-	DIRECTORY_INDU_SORTBYTRANSPORT,
-	DIRECTORY_INDU_SHOWINDU = 8,
+/** Names of the widgets of the industry directory gui */
+enum IndustryDirectoryWidgets {
+	IDW_CLOSEBOX = 0,
+	IDW_CAPTION,
+	IDW_STICKY,
+	IDW_SORTBYNAME,
+	IDW_SORTBYTYPE,
+	IDW_SORTBYPROD,
+	IDW_SORTBYTRANSPORT,
+	IDW_SPACER,
+	IDW_INDUSRTY_LIST,
+	IDW_SCROLLBAR,
+	IDW_RESIZE,
 };
 
+/** Widget definition of the industy directory gui */
 static const Widget _industry_directory_widgets[] = {
-{   WWT_CLOSEBOX,   RESIZE_NONE,    13,     0,    10,     0,    13, STR_00C5,                STR_018B_CLOSE_WINDOW},
-{    WWT_CAPTION,   RESIZE_NONE,    13,    11,   495,     0,    13, STR_INDUSTRYDIR_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{  WWT_STICKYBOX,   RESIZE_NONE,    13,   496,   507,     0,    13, 0x0,                     STR_STICKY_BUTTON},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    13,     0,   100,    14,    25, STR_SORT_BY_NAME,        STR_SORT_ORDER_TIP},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    13,   101,   200,    14,    25, STR_SORT_BY_TYPE,        STR_SORT_ORDER_TIP},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    13,   201,   300,    14,    25, STR_SORT_BY_PRODUCTION,  STR_SORT_ORDER_TIP},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    13,   301,   400,    14,    25, STR_SORT_BY_TRANSPORTED, STR_SORT_ORDER_TIP},
-{      WWT_PANEL,   RESIZE_NONE,    13,   401,   495,    14,    25, 0x0,                     STR_NULL},
-{      WWT_PANEL, RESIZE_BOTTOM,    13,     0,   495,    26,   189, 0x0,                     STR_200A_TOWN_NAMES_CLICK_ON_NAME},
-{  WWT_SCROLLBAR, RESIZE_BOTTOM,    13,   496,   507,    14,   177, 0x0,                     STR_0190_SCROLL_BAR_SCROLLS_LIST},
-{  WWT_RESIZEBOX,     RESIZE_TB,    13,   496,   507,   178,   189, 0x0,                     STR_RESIZE_BUTTON},
+{   WWT_CLOSEBOX,   RESIZE_NONE,    13,     0,    10,     0,    13, STR_00C5,                STR_018B_CLOSE_WINDOW},             // IDW_CLOSEBOX
+{    WWT_CAPTION,   RESIZE_NONE,    13,    11,   495,     0,    13, STR_INDUSTRYDIR_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS},   // IDW_CAPTION
+{  WWT_STICKYBOX,   RESIZE_NONE,    13,   496,   507,     0,    13, 0x0,                     STR_STICKY_BUTTON},                 // IDW_STICKY
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    13,     0,   100,    14,    25, STR_SORT_BY_NAME,        STR_SORT_ORDER_TIP},                // IDW_SORTBYNAME
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    13,   101,   200,    14,    25, STR_SORT_BY_TYPE,        STR_SORT_ORDER_TIP},                // IDW_SORTBYTYPE
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    13,   201,   300,    14,    25, STR_SORT_BY_PRODUCTION,  STR_SORT_ORDER_TIP},                // IDW_SORTBYPROD
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    13,   301,   400,    14,    25, STR_SORT_BY_TRANSPORTED, STR_SORT_ORDER_TIP},                // IDW_SORTBYTRANSPORT
+{      WWT_PANEL,   RESIZE_NONE,    13,   401,   495,    14,    25, 0x0,                     STR_NULL},                          // IDW_SPACER
+{      WWT_PANEL, RESIZE_BOTTOM,    13,     0,   495,    26,   189, 0x0,                     STR_200A_TOWN_NAMES_CLICK_ON_NAME}, // IDW_INDUSRTY_LIST
+{  WWT_SCROLLBAR, RESIZE_BOTTOM,    13,   496,   507,    14,   177, 0x0,                     STR_0190_SCROLL_BAR_SCROLLS_LIST},  // IDW_SCROLLBAR
+{  WWT_RESIZEBOX,     RESIZE_TB,    13,   496,   507,   178,   189, 0x0,                     STR_RESIZE_BUTTON},                 // IDW_RESIZE
 {   WIDGETS_END},
 };
 
@@ -752,7 +763,6 @@
 
 	/* Create array for sorting */
 	_industry_sort = ReallocT(_industry_sort, GetMaxIndustryIndex() + 1);
-	if (_industry_sort == NULL) error("Could not allocate memory for the industry-sorting-list");
 
 	/* Don't attempt a sort if there are no industries */
 	if (GetNumIndustries() != 0) {
@@ -771,10 +781,6 @@
 {
 	switch (e->event) {
 	case WE_PAINT: {
-		int n;
-		uint p;
-		static const uint16 _indicator_positions[4] = {88, 187, 284, 387};
-
 		if (_industry_sort_dirty) {
 			_industry_sort_dirty = false;
 			MakeSortedIndustryList();
@@ -783,10 +789,10 @@
 		SetVScrollCount(w, _num_industry_sort);
 
 		DrawWindowWidgets(w);
-		DoDrawString(_industry_sort_order & 1 ? DOWNARROW : UPARROW, _indicator_positions[_industry_sort_order >> 1], 15, TC_BLACK);
+		DrawSortButtonState(w, IDW_SORTBYNAME + (_industry_sort_order >> 1), _industry_sort_order & 1 ? SBS_DOWN : SBS_UP);
 
-		p = w->vscroll.pos;
-		n = 0;
+		uint p = w->vscroll.pos;
+		int n = 0;
 
 		while (p < _num_industry_sort) {
 			const Industry* i = _industry_sort[p];
@@ -816,31 +822,31 @@
 
 	case WE_CLICK:
 		switch (e->we.click.widget) {
-			case DIRECTORY_INDU_SORTBYNAME: {
+			case IDW_SORTBYNAME: {
 				_industry_sort_order = _industry_sort_order == 0 ? 1 : 0;
 				_industry_sort_dirty = true;
 				SetWindowDirty(w);
 			} break;
 
-			case DIRECTORY_INDU_SORTBYTYPE: {
+			case IDW_SORTBYTYPE: {
 				_industry_sort_order = _industry_sort_order == 2 ? 3 : 2;
 				_industry_sort_dirty = true;
 				SetWindowDirty(w);
 			} break;
 
-			case DIRECTORY_INDU_SORTBYPROD: {
+			case IDW_SORTBYPROD: {
 				_industry_sort_order = _industry_sort_order == 4 ? 5 : 4;
 				_industry_sort_dirty = true;
 				SetWindowDirty(w);
 			} break;
 
-			case DIRECTORY_INDU_SORTBYTRANSPORT: {
+			case IDW_SORTBYTRANSPORT: {
 				_industry_sort_order = _industry_sort_order == 6 ? 7 : 6;
 				_industry_sort_dirty = true;
 				SetWindowDirty(w);
 			} break;
 
-			case DIRECTORY_INDU_SHOWINDU: {
+			case IDW_INDUSRTY_LIST: {
 				int y = (e->we.click.pt.y - 28) / 10;
 				uint16 p;
 
@@ -863,8 +869,7 @@
 	}
 }
 
-
-/* Industry List */
+/** Window definition of the industy directory gui */
 static const WindowDesc _industry_directory_desc = {
 	WDP_AUTO, WDP_AUTO, 508, 190, 508, 190,
 	WC_INDUSTRY_DIRECTORY, WC_NONE,
@@ -873,7 +878,6 @@
 	IndustryDirectoryWndProc
 };
 
-
 void ShowIndustryDirectory()
 {
 	Window *w = AllocateWindowDescFront(&_industry_directory_desc, 0);
--- a/src/industry_map.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/industry_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,8 +6,7 @@
 #define INDUSTRY_MAP_H
 
 #include "industry.h"
-#include "macros.h"
-#include "tile.h"
+#include "tile_map.h"
 
 
 
@@ -157,11 +156,12 @@
 
 /**
  * Make the given tile an industry tile
- * @param t     the tile to make an industry tile
- * @param index the industry this tile belongs to
- * @param gfx   the graphics to use for the tile
+ * @param t      the tile to make an industry tile
+ * @param index  the industry this tile belongs to
+ * @param gfx    the graphics to use for the tile
+ * @param random the random value
  */
-static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx)
+static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx, uint8 random)
 {
 	SetTileType(t, MP_INDUSTRY);
 	_m[t].m1 = 0;
@@ -169,7 +169,7 @@
 	_m[t].m3 = 0;
 	_m[t].m4 = 0;
 	SetIndustryGfx(t, gfx);
-	_me[t].m7 = Random();
+	_me[t].m7 = random;
 }
 
 /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/industry_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,16 @@
+/* $Id$ */
+
+/** @file industry_type.h Types related to the industry. */
+
+#ifndef INDUSTRY_TYPE_H
+#define INDUSTRY_TYPE_H
+
+typedef uint16 IndustryID;
+typedef uint16 IndustryGfx;
+typedef uint8 IndustryType;
+struct Industry;
+
+struct IndustrySpec;
+struct IndustryTileSpec;
+
+#endif /* INDUSTRY_TYPE_H */
--- a/src/intro_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/intro_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,21 +4,23 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "table/sprites.h"
-#include "functions.h"
-#include "window.h"
 #include "gui.h"
-#include "gfx.h"
-#include "player.h"
+#include "window_gui.h"
+#include "textbuf_gui.h"
 #include "network/network.h"
 #include "variables.h"
-#include "settings.h"
 #include "heightmap.h"
 #include "genworld.h"
 #include "network/network_gui.h"
 #include "newgrf.h"
+#include "strings_func.h"
+#include "window_func.h"
+#include "fios.h"
+#include "gfx_func.h"
+#include "settings_type.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
 
 static const Widget _select_game_widgets[] = {
 {    WWT_CAPTION, RESIZE_NONE, 13,   0, 335,   0,  13, STR_0307_OPENTTD,         STR_NULL},
@@ -50,51 +52,73 @@
 	InvalidateWindowClasses(WC_SELECT_GAME);
 }
 
+enum SelectGameIntroWidgets {
+	SGI_GENERATE_GAME = 2,
+	SGI_LOAD_GAME,
+	SGI_PLAY_SCENARIO,
+	SGI_PLAY_HEIGHTMAP,
+	SGI_EDIT_SCENARIO,
+	SGI_PLAY_NETWORK,
+	SGI_TEMPERATE_LANDSCAPE,
+	SGI_ARCTIC_LANDSCAPE,
+	SGI_TROPIC_LANDSCAPE,
+	SGI_TOYLAND_LANDSCAPE,
+	SGI_OPTIONS,
+	SGI_DIFFICULTIES,
+	SGI_PATCHES_OPTIONS,
+	SGI_GRF_SETTINGS,
+	SGI_EXIT,
+};
+
 static void SelectGameWndProc(Window *w, WindowEvent *e)
 {
 	switch (e->event) {
-	case WE_CREATE: w->LowerWidget(_opt_newgame.landscape + 8); break;
+		case WE_CREATE: w->LowerWidget(_opt_newgame.landscape + 8); break;
 
-	case WE_PAINT:
-		w->SetWidgetLoweredState(8,  _opt_newgame.landscape == LT_TEMPERATE);
-		w->SetWidgetLoweredState(9,  _opt_newgame.landscape == LT_ARCTIC);
-		w->SetWidgetLoweredState(10, _opt_newgame.landscape == LT_TROPIC);
-		w->SetWidgetLoweredState(11, _opt_newgame.landscape == LT_TOYLAND);
-		SetDParam(0, STR_6801_EASY + _opt_newgame.diff_level);
-		DrawWindowWidgets(w);
-		break;
+		case WE_PAINT:
+			w->SetWidgetLoweredState(SGI_TEMPERATE_LANDSCAPE, _opt_newgame.landscape == LT_TEMPERATE);
+			w->SetWidgetLoweredState(SGI_ARCTIC_LANDSCAPE, _opt_newgame.landscape == LT_ARCTIC);
+			w->SetWidgetLoweredState(SGI_TROPIC_LANDSCAPE, _opt_newgame.landscape == LT_TROPIC);
+			w->SetWidgetLoweredState(SGI_TOYLAND_LANDSCAPE, _opt_newgame.landscape == LT_TOYLAND);
+			SetDParam(0, STR_6801_EASY + _opt_newgame.diff_level);
+			DrawWindowWidgets(w);
+			break;
 
-	case WE_CLICK:
+		case WE_CLICK:
 #ifdef ENABLE_NETWORK
-		/* Do not create a network server when you (just) have closed one of the game
-		 * creation/load windows for the network server. */
-		if (2 <= e->we.click.widget && e->we.click.widget <= 6) _is_network_server = false;
+			/* Do not create a network server when you (just) have closed one of the game
+			 * creation/load windows for the network server. */
+			if (SGI_GENERATE_GAME <= e->we.click.widget && e->we.click.widget <= SGI_EDIT_SCENARIO) _is_network_server = false;
 #endif /* ENABLE_NETWORK */
 
-		switch (e->we.click.widget) {
-		case 2: ShowGenerateLandscape(); break;
-		case 3: ShowSaveLoadDialog(SLD_LOAD_GAME); break;
-		case 4: ShowSaveLoadDialog(SLD_LOAD_SCENARIO); break;
-		case 5: ShowSaveLoadDialog(SLD_LOAD_HEIGHTMAP); break;
-		case 6: StartScenarioEditor(); break;
-		case 7:
-			if (!_network_available) {
-				ShowErrorMessage(INVALID_STRING_ID, STR_NETWORK_ERR_NOTAVAILABLE, 0, 0);
-			} else {
-				ShowNetworkGameWindow();
+			switch (e->we.click.widget) {
+				case SGI_GENERATE_GAME:  ShowGenerateLandscape(); break;
+				case SGI_LOAD_GAME:      ShowSaveLoadDialog(SLD_LOAD_GAME); break;
+				case SGI_PLAY_SCENARIO:  ShowSaveLoadDialog(SLD_LOAD_SCENARIO); break;
+				case SGI_PLAY_HEIGHTMAP: ShowSaveLoadDialog(SLD_LOAD_HEIGHTMAP); break;
+				case SGI_EDIT_SCENARIO:  StartScenarioEditor(); break;
+
+				case SGI_PLAY_NETWORK:
+					if (!_network_available) {
+						ShowErrorMessage(INVALID_STRING_ID, STR_NETWORK_ERR_NOTAVAILABLE, 0, 0);
+					} else {
+						ShowNetworkGameWindow();
+					}
+					break;
+
+				case SGI_TEMPERATE_LANDSCAPE:	case SGI_ARCTIC_LANDSCAPE:
+				case SGI_TROPIC_LANDSCAPE: case SGI_TOYLAND_LANDSCAPE:
+					w->RaiseWidget(_opt_newgame.landscape + SGI_TEMPERATE_LANDSCAPE);
+					SetNewLandscapeType(e->we.click.widget - SGI_TEMPERATE_LANDSCAPE);
+					break;
+
+				case SGI_OPTIONS:         ShowGameOptions(); break;
+				case SGI_DIFFICULTIES:    ShowGameDifficulty(); break;
+				case SGI_PATCHES_OPTIONS: ShowPatchesSelection(); break;
+				case SGI_GRF_SETTINGS:    ShowNewGRFSettings(true, true, false, &_grfconfig_newgame); break;
+				case SGI_EXIT:            HandleExitGameRequest(); break;
 			}
 			break;
-		case 8: case 9: case 10: case 11:
-			w->RaiseWidget(_opt_newgame.landscape + 8);
-			SetNewLandscapeType(e->we.click.widget - 8);
-			break;
-		case 12: ShowGameOptions(); break;
-		case 13: ShowGameDifficulty(); break;
-		case 14: ShowPatchesSelection(); break;
-		case 15: ShowNewGRFSettings(true, true, false, &_grfconfig_newgame); break;
-		case 16: HandleExitGameRequest(); break;
-		}
-		break;
 	}
 }
 
--- a/src/landscape.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/landscape.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,23 +5,27 @@
 #include "bridge_map.h"
 #include "heightmap.h"
 #include "clear_map.h"
-#include "date.h"
-#include "functions.h"
-#include "map.h"
-#include "player.h"
 #include "spritecache.h"
-#include "table/sprites.h"
-#include "tile.h"
 #include <stdarg.h>
-#include "viewport.h"
-#include "command.h"
+#include "viewport_func.h"
+#include "command_func.h"
 #include "landscape.h"
-#include "vehicle.h"
 #include "variables.h"
 #include "void_map.h"
 #include "water_map.h"
 #include "tgp.h"
 #include "genworld.h"
+#include "tile_cmd.h"
+#include "core/alloc_func.hpp"
+#include "fios.h"
+#include "window_func.h"
+#include "functions.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "settings_type.h"
+#include "water.h"
+
+#include "table/sprites.h"
 
 extern const TileTypeProcs
 	_tile_type_clear_procs,
@@ -289,11 +293,12 @@
 	if ((tileh & ~SLOPE_HALFTILE_MASK) == corners[edge][3]) *z2 += TILE_HEIGHT; // z2 is highest corner of a steep slope
 }
 
-static Slope GetFoundationSlope(TileIndex tile, uint* z)
+Slope GetFoundationSlope(TileIndex tile, uint* z)
 {
 	Slope tileh = GetTileSlope(tile, z);
 	Foundation f = _tile_type_procs[GetTileType(tile)]->get_foundation_proc(tile, tileh);
-	*z += ApplyFoundationToSlope(f, &tileh);
+	uint z_inc = ApplyFoundationToSlope(f, &tileh);
+	if (z != NULL) *z += z_inc;
 	return tileh;
 }
 
@@ -522,8 +527,6 @@
  */
 CommandCost CmdLandscapeClear(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	return _tile_type_procs[GetTileType(tile)]->clear_tile_proc(tile, flags);
 }
 
@@ -535,7 +538,8 @@
  */
 CommandCost CmdClearArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	CommandCost cost, ret, money;
+	CommandCost ret, money;
+	CommandCost cost(EXPENSES_CONSTRUCTION);
 	int ex;
 	int ey;
 	int sx, sy;
@@ -544,8 +548,6 @@
 
 	if (p1 >= MapSize()) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	/* make sure sx,sy are smaller than ex,ey */
 	ex = TileX(tile);
 	ey = TileY(tile);
@@ -637,53 +639,6 @@
 	for (x = 0; x < sizex; x++) MakeVoid(sizex * y + x);
 }
 
-void ConvertGroundTilesIntoWaterTiles()
-{
-	TileIndex tile;
-	uint z;
-	Slope slope;
-
-	for (tile = 0; tile < MapSize(); ++tile) {
-		slope = GetTileSlope(tile, &z);
-		if (IsTileType(tile, MP_CLEAR) && z == 0) {
-			/* Make both water for tiles at level 0
-			 * and make shore, as that looks much better
-			 * during the generation. */
-			switch (slope) {
-				case SLOPE_FLAT:
-					MakeWater(tile);
-					break;
-
-				case SLOPE_N:
-				case SLOPE_E:
-				case SLOPE_S:
-				case SLOPE_W:
-					MakeShore(tile);
-					break;
-
-				case SLOPE_NW:
-					if (GetTileSlope(TileAddByDiagDir(tile, DIAGDIR_SE), NULL) != SLOPE_SE) MakeShore(tile);
-					break;
-
-				case SLOPE_SW:
-					if (GetTileSlope(TileAddByDiagDir(tile, DIAGDIR_NE), NULL) != SLOPE_NE) MakeShore(tile);
-					break;
-
-				case SLOPE_SE:
-					if (GetTileSlope(TileAddByDiagDir(tile, DIAGDIR_NW), NULL) != SLOPE_NW) MakeShore(tile);
-					break;
-
-				case SLOPE_NE:
-					if (GetTileSlope(TileAddByDiagDir(tile, DIAGDIR_SW), NULL) != SLOPE_SW) MakeShore(tile);
-					break;
-
-				default:
-					break;
-			}
-		}
-	}
-}
-
 static const byte _genterrain_tbl_1[5] = { 10, 22, 33, 37, 4  };
 static const byte _genterrain_tbl_2[5] = {  0,  0,  0,  0, 33 };
 
--- a/src/landscape.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/landscape.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,11 @@
 #ifndef LANDSCAPE_H
 #define LANDSCAPE_H
 
+#include "core/geometry_type.hpp"
+#include "tile_cmd.h"
+#include "slope_type.h"
+#include "direction_type.h"
+
 enum {
 	SNOW_LINE_MONTHS = 12,
 	SNOW_LINE_DAYS   = 32,
@@ -27,6 +32,7 @@
 uint GetSlopeZ(int x, int y);
 void GetSlopeZOnEdge(Slope tileh, DiagDirection edge, int *z1, int *z2);
 int GetSlopeZInCorner(Slope tileh, Corner corner);
+Slope GetFoundationSlope(TileIndex tile, uint* z);
 
 static inline Point RemapCoords(int x, int y, int z)
 {
@@ -47,18 +53,9 @@
 void DoClearSquare(TileIndex tile);
 void RunTileLoop();
 
-uint32 GetTileTrackStatus(TileIndex tile, TransportType mode, uint sub_mode);
-void GetAcceptedCargo(TileIndex tile, AcceptedCargo ac);
-void ChangeTileOwner(TileIndex tile, PlayerID old_player, PlayerID new_player);
-void AnimateTile(TileIndex tile);
-void ClickTile(TileIndex tile);
-void GetTileDesc(TileIndex tile, TileDesc *td);
-
 void InitializeLandscape();
 void GenerateLandscape(byte mode);
 
-void ConvertGroundTilesIntoWaterTiles();
-
 TileIndex AdjustTileCoordRandomly(TileIndex a, byte rng);
 
 #endif /* LANDSCAPE_H */
--- a/src/lang/afrikaans.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/afrikaans.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -160,7 +160,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Kan nie die area reinig nie....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Oorspronklik kopiereg {COPYRIGHT} 1995 Chris Sawyer, Alle regte voorbehou
 STR_00B7_VERSION                                                :{BLACK}OpenTTD uitgawe {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 Die OpenTTD span
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 Die OpenTTD span
 STR_TRANSLATED_BY                                               :{BLACK}  Vertaler(s) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Veelspeler
 STR_SCENARIO_EDITOR                                             :{BLACK}Draaiboek Redakteur
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Werfkaart groote:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Speletjie Opsies
@@ -3256,7 +3250,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Om te verstel oorsprong werfkaart te is nie aanbeveel. Voortgaan met die generasie?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Dorp uitleg waarskuwing
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Die dorp uitleg "geen meer paaie" is nie aanbeveel nie. Gaan aan met generasie?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Hoogtekaart name:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Groote: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Genereer wêreld...
@@ -3282,7 +3275,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Beweeg die hoogte van platte daal bo een
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Verander die hoogte van platte daal
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Hoogte van platte daal:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Senter die kleinwerfkaart op die huidige posisie
 
--- a/src/lang/american.txt	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3437 +0,0 @@
-##name American
-##ownname English (US)
-##isocode en_US
-##plural 0
-
-#
-
-##id 0x0000
-STR_NULL                                                        :
-STR_0001_OFF_EDGE_OF_MAP                                        :{WHITE}Off edge of map
-STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP                               :{WHITE}Too close to edge of map
-STR_0003_NOT_ENOUGH_CASH_REQUIRES                               :{WHITE}Not enough cash - requires {CURRENCY}
-STR_0004                                                        :{WHITE}{CURRENCY}
-STR_EMPTY                                                       :
-STR_0007_FLAT_LAND_REQUIRED                                     :{WHITE}Flat land required
-STR_0008_WAITING                                                :{BLACK}Waiting: {WHITE}{STRING}
-STR_0009                                                        :{WHITE}{CARGO}
-STR_000A_EN_ROUTE_FROM                                          :{WHITE}{CARGO}{YELLOW}  (en-route from
-STR_000B                                                        :{YELLOW}{STATION})
-STR_000C_ACCEPTS                                                :{BLACK}Accepts: {WHITE}
-STR_000D_ACCEPTS                                                :{BLACK}Accepts: {GOLD}
-STR_000E                                                        :
-STR_000F_PASSENGERS                                             :Passengers
-STR_0010_COAL                                                   :Coal
-STR_0011_MAIL                                                   :Mail
-STR_0012_OIL                                                    :Oil
-STR_0013_LIVESTOCK                                              :Livestock
-STR_0014_GOODS                                                  :Goods
-STR_0015_GRAIN                                                  :Grain
-STR_0016_WOOD                                                   :Wood
-STR_0017_IRON_ORE                                               :Iron Ore
-STR_0018_STEEL                                                  :Steel
-STR_0019_VALUABLES                                              :Valuables
-STR_001A_COPPER_ORE                                             :Copper Ore
-STR_001B_MAIZE                                                  :Maize
-STR_001C_FRUIT                                                  :Fruit
-STR_001D_DIAMONDS                                               :Diamonds
-STR_001E_FOOD                                                   :Food
-STR_001F_PAPER                                                  :Paper
-STR_0020_GOLD                                                   :Gold
-STR_0021_WATER                                                  :Water
-STR_0022_WHEAT                                                  :Wheat
-STR_0023_RUBBER                                                 :Rubber
-STR_0024_SUGAR                                                  :Sugar
-STR_0025_TOYS                                                   :Toys
-STR_0026_CANDY                                                  :Candy
-STR_0027_COLA                                                   :Cola
-STR_0028_COTTON_CANDY                                           :Cotton Candy
-STR_0029_BUBBLES                                                :Bubbles
-STR_002A_TOFFEE                                                 :Toffee
-STR_002B_BATTERIES                                              :Batteries
-STR_002C_PLASTIC                                                :Plastic
-STR_002D_FIZZY_DRINKS                                           :Fizzy Drinks
-STR_002E                                                        :
-STR_002F_PASSENGER                                              :Passenger
-STR_0030_COAL                                                   :Coal
-STR_0031_MAIL                                                   :Mail
-STR_0032_OIL                                                    :Oil
-STR_0033_LIVESTOCK                                              :Livestock
-STR_0034_GOODS                                                  :Goods
-STR_0035_GRAIN                                                  :Grain
-STR_0036_WOOD                                                   :Wood
-STR_0037_IRON_ORE                                               :Iron Ore
-STR_0038_STEEL                                                  :Steel
-STR_0039_VALUABLES                                              :Valuables
-STR_003A_COPPER_ORE                                             :Copper Ore
-STR_003B_MAIZE                                                  :Maize
-STR_003C_FRUIT                                                  :Fruit
-STR_003D_DIAMOND                                                :Diamond
-STR_003E_FOOD                                                   :Food
-STR_003F_PAPER                                                  :Paper
-STR_0040_GOLD                                                   :Gold
-STR_0041_WATER                                                  :Water
-STR_0042_WHEAT                                                  :Wheat
-STR_0043_RUBBER                                                 :Rubber
-STR_0044_SUGAR                                                  :Sugar
-STR_0045_TOY                                                    :Toy
-STR_0046_CANDY                                                  :Candy
-STR_0047_COLA                                                   :Cola
-STR_0048_COTTON_CANDY                                           :Cotton Candy
-STR_0049_BUBBLE                                                 :Bubble
-STR_004A_TOFFEE                                                 :Toffee
-STR_004B_BATTERY                                                :Battery
-STR_004C_PLASTIC                                                :Plastic
-STR_004D_FIZZY_DRINK                                            :Fizzy Drink
-STR_QUANTITY_NOTHING                                            :
-STR_QUANTITY_PASSENGERS                                         :{COMMA} passenger{P "" s}
-STR_QUANTITY_COAL                                               :{WEIGHT} of coal
-STR_QUANTITY_MAIL                                               :{COMMA} bag{P "" s} of mail
-STR_QUANTITY_OIL                                                :{VOLUME} of oil
-STR_QUANTITY_LIVESTOCK                                          :{COMMA} item{P "" s} of livestock
-STR_QUANTITY_GOODS                                              :{COMMA} crate{P "" s} of goods
-STR_QUANTITY_GRAIN                                              :{WEIGHT} of grain
-STR_QUANTITY_WOOD                                               :{WEIGHT} of wood
-STR_QUANTITY_IRON_ORE                                           :{WEIGHT} of iron ore
-STR_QUANTITY_STEEL                                              :{WEIGHT} of steel
-STR_QUANTITY_VALUABLES                                          :{COMMA} bag{P "" s} of valuables
-STR_QUANTITY_COPPER_ORE                                         :{WEIGHT} of copper ore
-STR_QUANTITY_MAIZE                                              :{WEIGHT} of maize
-STR_QUANTITY_FRUIT                                              :{WEIGHT} of fruit
-STR_QUANTITY_DIAMONDS                                           :{COMMA} bag{P "" s} of diamonds
-STR_QUANTITY_FOOD                                               :{WEIGHT} of food
-STR_QUANTITY_PAPER                                              :{WEIGHT} of paper
-STR_QUANTITY_GOLD                                               :{COMMA} bag{P "" s} of gold
-STR_QUANTITY_WATER                                              :{VOLUME} of water
-STR_QUANTITY_WHEAT                                              :{WEIGHT} of wheat
-STR_QUANTITY_RUBBER                                             :{VOLUME} of rubber
-STR_QUANTITY_SUGAR                                              :{WEIGHT} of sugar
-STR_QUANTITY_TOYS                                               :{COMMA} toy{P "" s}
-STR_QUANTITY_SWEETS                                             :{COMMA} bag{P "" s} of candy
-STR_QUANTITY_COLA                                               :{VOLUME} of cola
-STR_QUANTITY_CANDYFLOSS                                         :{WEIGHT} of cotton candy
-STR_QUANTITY_BUBBLES                                            :{COMMA} bubble{P "" s}
-STR_QUANTITY_TOFFEE                                             :{WEIGHT} of toffee
-STR_QUANTITY_BATTERIES                                          :{COMMA} batter{P y ies}
-STR_QUANTITY_PLASTIC                                            :{VOLUME} of plastic
-STR_QUANTITY_FIZZY_DRINKS                                       :{COMMA} fizzy drink{P "" s}
-STR_ABBREV_NOTHING                                              :
-STR_ABBREV_PASSENGERS                                           :{TINYFONT}PS
-STR_ABBREV_COAL                                                 :{TINYFONT}CL
-STR_ABBREV_MAIL                                                 :{TINYFONT}ML
-STR_ABBREV_OIL                                                  :{TINYFONT}OL
-STR_ABBREV_LIVESTOCK                                            :{TINYFONT}LV
-STR_ABBREV_GOODS                                                :{TINYFONT}GD
-STR_ABBREV_GRAIN                                                :{TINYFONT}GR
-STR_ABBREV_WOOD                                                 :{TINYFONT}WD
-STR_ABBREV_IRON_ORE                                             :{TINYFONT}OR
-STR_ABBREV_STEEL                                                :{TINYFONT}ST
-STR_ABBREV_VALUABLES                                            :{TINYFONT}VL
-STR_ABBREV_COPPER_ORE                                           :{TINYFONT}CO
-STR_ABBREV_MAIZE                                                :{TINYFONT}MZ
-STR_ABBREV_FRUIT                                                :{TINYFONT}FT
-STR_ABBREV_DIAMONDS                                             :{TINYFONT}DM
-STR_ABBREV_FOOD                                                 :{TINYFONT}FD
-STR_ABBREV_PAPER                                                :{TINYFONT}PR
-STR_ABBREV_GOLD                                                 :{TINYFONT}GD
-STR_ABBREV_WATER                                                :{TINYFONT}WR
-STR_ABBREV_WHEAT                                                :{TINYFONT}WH
-STR_ABBREV_RUBBER                                               :{TINYFONT}RB
-STR_ABBREV_SUGAR                                                :{TINYFONT}SG
-STR_ABBREV_TOYS                                                 :{TINYFONT}TY
-STR_ABBREV_SWEETS                                               :{TINYFONT}SW
-STR_ABBREV_COLA                                                 :{TINYFONT}CL
-STR_ABBREV_CANDYFLOSS                                           :{TINYFONT}CF
-STR_ABBREV_BUBBLES                                              :{TINYFONT}BU
-STR_ABBREV_TOFFEE                                               :{TINYFONT}TF
-STR_ABBREV_BATTERIES                                            :{TINYFONT}BA
-STR_ABBREV_PLASTIC                                              :{TINYFONT}PL
-STR_ABBREV_FIZZY_DRINKS                                         :{TINYFONT}FZ
-STR_ABBREV_NONE                                                 :{TINYFONT}NO
-STR_ABBREV_ALL                                                  :{TINYFONT}ALL
-STR_00AE                                                        :{WHITE}{DATE_SHORT}
-STR_00AF                                                        :{WHITE}{DATE_LONG}
-STR_00B0_MAP                                                    :{WHITE}Map - {STRING}
-STR_00B1_GAME_OPTIONS                                           :{WHITE}Game Options
-STR_00B2_MESSAGE                                                :{YELLOW}Message
-STR_00B3_MESSAGE_FROM                                           :{YELLOW}Message from {STRING}
-STR_POPUP_CAUTION_CAPTION                                       :{WHITE}Caution!
-STR_00B4_CAN_T_DO_THIS                                          :{WHITE}Can't do this....
-STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Can't clear this area....
-STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Original copyright {COPYRIGHT} 1995 Chris Sawyer, All rights reserved
-STR_00B7_VERSION                                                :{BLACK}OpenTTD version {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 The OpenTTD team
-STR_TRANSLATED_BY                                               :{BLACK}  Translator(s) -
-
-STR_00C5                                                        :{BLACK}{CROSS}
-STR_00C6                                                        :{SILVER}{CROSS}
-STR_00C7_QUIT                                                   :{WHITE}Quit
-STR_00C8_YES                                                    :{BLACK}Yes
-STR_00C9_NO                                                     :{BLACK}No
-STR_00CA_ARE_YOU_SURE_YOU_WANT_TO                               :{YELLOW}Are you sure you want to abandon this game and return to {STRING}?
-STR_00CB_1                                                      :{BLACK}1
-STR_00CC_2                                                      :{BLACK}2
-STR_00CD_3                                                      :{BLACK}3
-STR_00CE_4                                                      :{BLACK}4
-STR_00CF_5                                                      :{BLACK}5
-STR_00D0_NOTHING                                                :Nothing
-STR_00D1_DARK_BLUE                                              :Dark Blue
-STR_00D2_PALE_GREEN                                             :Pale Green
-STR_00D3_PINK                                                   :Pink
-STR_00D4_YELLOW                                                 :Yellow
-STR_00D5_RED                                                    :Red
-STR_00D6_LIGHT_BLUE                                             :Light Blue
-STR_00D7_GREEN                                                  :Green
-STR_00D8_DARK_GREEN                                             :Dark Green
-STR_00D9_BLUE                                                   :Blue
-STR_00DA_CREAM                                                  :Cream
-STR_00DB_MAUVE                                                  :Mauve
-STR_00DC_PURPLE                                                 :Purple
-STR_00DD_ORANGE                                                 :Orange
-STR_00DE_BROWN                                                  :Brown
-STR_00DF_GREY                                                   :Gray
-STR_00E0_WHITE                                                  :White
-STR_00E1_TOO_MANY_VEHICLES_IN_GAME                              :{WHITE}Too many vehicles in game
-STR_00E2                                                        :{BLACK}{COMMA}
-STR_00E3                                                        :{RED}{COMMA}
-STR_00E4_LOCATION                                               :{BLACK}Location
-STR_00E5_CONTOURS                                               :Contours
-STR_00E6_VEHICLES                                               :Vehicles
-STR_00E7_INDUSTRIES                                             :Industries
-STR_00E8_ROUTES                                                 :Routes
-STR_00E9_VEGETATION                                             :Vegetation
-STR_00EA_OWNERS                                                 :Owners
-STR_00EB_ROADS                                                  :{BLACK}{TINYFONT}Roads
-STR_00EC_RAILROADS                                              :{BLACK}{TINYFONT}Railroads
-STR_00ED_STATIONS_AIRPORTS_DOCKS                                :{BLACK}{TINYFONT}Stations/Airports/Docks
-STR_00EE_BUILDINGS_INDUSTRIES                                   :{BLACK}{TINYFONT}Buildings/Industries
-STR_00EF_VEHICLES                                               :{BLACK}{TINYFONT}Vehicles
-STR_00F0_100M                                                   :{BLACK}{TINYFONT}100m
-STR_00F1_200M                                                   :{BLACK}{TINYFONT}200m
-STR_00F2_300M                                                   :{BLACK}{TINYFONT}300m
-STR_00F3_400M                                                   :{BLACK}{TINYFONT}400m
-STR_00F4_500M                                                   :{BLACK}{TINYFONT}500m
-STR_00F5_TRAINS                                                 :{BLACK}{TINYFONT}Trains
-STR_00F6_ROAD_VEHICLES                                          :{BLACK}{TINYFONT}Road Vehicles
-STR_00F7_SHIPS                                                  :{BLACK}{TINYFONT}Ships
-STR_00F8_AIRCRAFT                                               :{BLACK}{TINYFONT}Aircraft
-STR_00F9_TRANSPORT_ROUTES                                       :{BLACK}{TINYFONT}Transport Routes
-STR_00FA_COAL_MINE                                              :{BLACK}{TINYFONT}Coal Mine
-STR_00FB_POWER_STATION                                          :{BLACK}{TINYFONT}Power Station
-STR_00FC_FOREST                                                 :{BLACK}{TINYFONT}Forest
-STR_00FD_SAWMILL                                                :{BLACK}{TINYFONT}Sawmill
-STR_00FE_OIL_REFINERY                                           :{BLACK}{TINYFONT}Oil Refinery
-STR_00FF_FARM                                                   :{BLACK}{TINYFONT}Farm
-STR_0100_FACTORY                                                :{BLACK}{TINYFONT}Factory
-STR_0101_PRINTING_WORKS                                         :{BLACK}{TINYFONT}Printing Works
-STR_0102_OIL_WELLS                                              :{BLACK}{TINYFONT}Oil Wells
-STR_0103_IRON_ORE_MINE                                          :{BLACK}{TINYFONT}Iron Ore Mine
-STR_0104_STEEL_MILL                                             :{BLACK}{TINYFONT}Steel Mill
-STR_0105_BANK                                                   :{BLACK}{TINYFONT}Bank
-STR_0106_PAPER_MILL                                             :{BLACK}{TINYFONT}Paper Mill
-STR_0107_GOLD_MINE                                              :{BLACK}{TINYFONT}Gold Mine
-STR_0108_FOOD_PROCESSING_PLANT                                  :{BLACK}{TINYFONT}Food Processing Plant
-STR_0109_DIAMOND_MINE                                           :{BLACK}{TINYFONT}Diamond Mine
-STR_010A_COPPER_ORE_MINE                                        :{BLACK}{TINYFONT}Copper Ore Mine
-STR_010B_FRUIT_PLANTATION                                       :{BLACK}{TINYFONT}Fruit Plantation
-STR_010C_RUBBER_PLANTATION                                      :{BLACK}{TINYFONT}Rubber Plantation
-STR_010D_WATER_SUPPLY                                           :{BLACK}{TINYFONT}Water Supply
-STR_010E_WATER_TOWER                                            :{BLACK}{TINYFONT}Water Tower
-STR_010F_LUMBER_MILL                                            :{BLACK}{TINYFONT}Lumber Mill
-STR_0110_COTTON_CANDY_FOREST                                    :{BLACK}{TINYFONT}Cotton Candy Forest
-STR_0111_CANDY_FACTORY                                          :{BLACK}{TINYFONT}Candy Factory
-STR_0112_BATTERY_FARM                                           :{BLACK}{TINYFONT}Battery Farm
-STR_0113_COLA_WELLS                                             :{BLACK}{TINYFONT}Cola Wells
-STR_0114_TOY_SHOP                                               :{BLACK}{TINYFONT}Toy Shop
-STR_0115_TOY_FACTORY                                            :{BLACK}{TINYFONT}Toy Factory
-STR_0116_PLASTIC_FOUNTAINS                                      :{BLACK}{TINYFONT}Plastic Fountains
-STR_0117_FIZZY_DRINK_FACTORY                                    :{BLACK}{TINYFONT}Fizzy Drink Factory
-STR_0118_BUBBLE_GENERATOR                                       :{BLACK}{TINYFONT}Bubble Generator
-STR_0119_TOFFEE_QUARRY                                          :{BLACK}{TINYFONT}Toffee Quarry
-STR_011A_SUGAR_MINE                                             :{BLACK}{TINYFONT}Sugar Mine
-STR_011B_RAILROAD_STATION                                       :{BLACK}{TINYFONT}Railroad Station
-STR_011C_TRUCK_LOADING_BAY                                      :{BLACK}{TINYFONT}Truck Loading Bay
-STR_011D_BUS_STATION                                            :{BLACK}{TINYFONT}Bus Station
-STR_011E_AIRPORT_HELIPORT                                       :{BLACK}{TINYFONT}Airport/Heliport
-STR_011F_DOCK                                                   :{BLACK}{TINYFONT}Dock
-STR_0120_ROUGH_LAND                                             :{BLACK}{TINYFONT}Rough Land
-STR_0121_GRASS_LAND                                             :{BLACK}{TINYFONT}Grass Land
-STR_0122_BARE_LAND                                              :{BLACK}{TINYFONT}Bare Land
-STR_0123_FIELDS                                                 :{BLACK}{TINYFONT}Fields
-STR_0124_TREES                                                  :{BLACK}{TINYFONT}Trees
-STR_0125_ROCKS                                                  :{BLACK}{TINYFONT}Rocks
-STR_0126_WATER                                                  :{BLACK}{TINYFONT}Water
-STR_0127_NO_OWNER                                               :{BLACK}{TINYFONT}No Owner
-STR_0128_TOWNS                                                  :{BLACK}{TINYFONT}Towns
-STR_0129_INDUSTRIES                                             :{BLACK}{TINYFONT}Industries
-STR_012A_DESERT                                                 :{BLACK}{TINYFONT}Desert
-STR_012B_SNOW                                                   :{BLACK}{TINYFONT}Snow
-STR_012C_MESSAGE                                                :{WHITE}Message
-STR_012D                                                        :{WHITE}{STRING}
-STR_012E_CANCEL                                                 :{BLACK}Cancel
-STR_012F_OK                                                     :{BLACK}OK
-STR_0130_RENAME                                                 :{BLACK}Rename
-STR_0131_TOO_MANY_NAMES_DEFINED                                 :{WHITE}Too many names defined
-STR_0132_CHOSEN_NAME_IN_USE_ALREADY                             :{WHITE}Chosen name already in use
-
-STR_0133_WINDOWS                                                :Windows
-STR_0134_UNIX                                                   :Unix
-STR_0135_OSX                                                    :OS X
-STR_OSNAME_BEOS                                                 :BeOS
-STR_OSNAME_MORPHOS                                              :MorphOS
-STR_OSNAME_AMIGAOS                                              :AmigaOS
-STR_OSNAME_OS2                                                  :OS/2
-STR_OSNAME_SUNOS                                                :SunOS
-
-STR_013B_OWNED_BY                                               :{WHITE}...owned by {STRING}
-STR_013C_CARGO                                                  :{BLACK}Cargo
-STR_013D_INFORMATION                                            :{BLACK}Information
-STR_013E_CAPACITIES                                             :{BLACK}Capacities
-STR_013E_TOTAL_CARGO                                            :{BLACK}Total Cargo
-STR_013F_CAPACITY                                               :{BLACK}Capacity: {LTBLUE}{CARGO}
-STR_CAPACITY_MULT                                               :{BLACK}Capacity: {LTBLUE}{CARGO} (x{NUM})
-STR_013F_TOTAL_CAPACITY_TEXT                                    :{BLACK}Total cargo (capacity) of this train:
-STR_013F_TOTAL_CAPACITY                                         :{LTBLUE}- {CARGO} ({SHORTCARGO})
-STR_TOTAL_CAPACITY_MULT                                         :{LTBLUE}- {CARGO} ({SHORTCARGO}) (x{NUM})
-STR_0140_NEW_GAME                                               :{BLACK}New Game
-STR_0141_LOAD_GAME                                              :{BLACK}Load Game
-STR_SINGLE_PLAYER                                               :{BLACK}Single player
-STR_MULTIPLAYER                                                 :{BLACK}Multiplayer
-STR_SCENARIO_EDITOR                                             :{BLACK}Scenario Editor
-
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
-STR_MAPSIZE                                                     :{BLACK}Map size:
-STR_BY                                                          :{BLACK}*
-STR_0148_GAME_OPTIONS                                           :{BLACK}Game Options
-
-STR_0150_SOMEONE                                                :someone{SKIP}{SKIP}
-STR_0151_MAP_OF_WORLD                                           :Map of world
-STR_0152_TOWN_DIRECTORY                                         :Town directory
-STR_0153_SUBSIDIES                                              :Subsidies
-
-STR_UNITS_IMPERIAL                                              :Imperial
-STR_UNITS_METRIC                                                :Metric
-STR_UNITS_SI                                                    :SI
-
-STR_UNITS_VELOCITY_IMPERIAL                                     :{COMMA} mph
-STR_UNITS_VELOCITY_METRIC                                       :{COMMA} km/h
-STR_UNITS_VELOCITY_SI                                           :{COMMA} m/s
-
-STR_UNITS_POWER_IMPERIAL                                        :{COMMA}hp
-STR_UNITS_POWER_METRIC                                          :{COMMA}hp
-STR_UNITS_POWER_SI                                              :{COMMA}kW
-
-STR_UNITS_WEIGHT_SHORT_IMPERIAL                                 :{COMMA}t
-STR_UNITS_WEIGHT_SHORT_METRIC                                   :{COMMA}t
-STR_UNITS_WEIGHT_SHORT_SI                                       :{COMMA}kg
-
-STR_UNITS_WEIGHT_LONG_IMPERIAL                                  :{COMMA} ton{P "" s}
-STR_UNITS_WEIGHT_LONG_METRIC                                    :{COMMA} tonne{P "" s}
-STR_UNITS_WEIGHT_LONG_SI                                        :{COMMA} kg
-
-STR_UNITS_VOLUME_SHORT_IMPERIAL                                 :{COMMA}gal
-STR_UNITS_VOLUME_SHORT_METRIC                                   :{COMMA}l
-STR_UNITS_VOLUME_SHORT_SI                                       :{COMMA}m³
-
-STR_UNITS_VOLUME_LONG_IMPERIAL                                  :{COMMA} gallon{P "" s}
-STR_UNITS_VOLUME_LONG_METRIC                                    :{COMMA} litre{P "" s}
-STR_UNITS_VOLUME_LONG_SI                                        :{COMMA} m³
-
-STR_UNITS_FORCE_IMPERIAL                                        :{COMMA}x10³lbf
-STR_UNITS_FORCE_METRIC                                          :{COMMA} tonne force
-STR_UNITS_FORCE_SI                                              :{COMMA} kN
-
-############ range for menu starts
-STR_0154_OPERATING_PROFIT_GRAPH                                 :Operating profit graph
-STR_0155_INCOME_GRAPH                                           :Income graph
-STR_0156_DELIVERED_CARGO_GRAPH                                  :Delivered cargo graph
-STR_0157_PERFORMANCE_HISTORY_GRAPH                              :Performance history graph
-STR_0158_COMPANY_VALUE_GRAPH                                    :Company value graph
-STR_0159_CARGO_PAYMENT_RATES                                    :Cargo payment rates
-STR_015A_COMPANY_LEAGUE_TABLE                                   :Company league table
-STR_PERFORMANCE_DETAIL_MENU                                     :Detailed performance rating
-############ range for menu ends
-
-STR_015B_OPENTTD                                                :{WHITE}OpenTTD
-STR_015C_SAVE_GAME                                              :Save game
-STR_015D_LOAD_GAME                                              :Load game
-STR_015E_QUIT_GAME                                              :Quit game
-STR_015F_QUIT                                                   :Quit
-STR_ABANDON_GAME_QUERY                                          :{YELLOW}Are you sure you want to quit this game ?
-STR_0161_QUIT_GAME                                              :{WHITE}Quit Game
-STR_SORT_ORDER_TIP                                              :{BLACK}Select sorting order (descending/ascending)
-STR_SORT_CRITERIA_TIP                                           :{BLACK}Select sorting criteria
-STR_SORT_BY                                                     :{BLACK}Sort by
-
-STR_SORT_BY_POPULATION                                          :{BLACK}Population
-STR_SORT_BY_PRODUCTION                                          :{BLACK}Production
-STR_SORT_BY_TYPE                                                :{BLACK}Type
-STR_SORT_BY_TRANSPORTED                                         :{BLACK}Transported
-STR_SORT_BY_NAME                                                :{BLACK}Name
-STR_SORT_BY_DROPDOWN_NAME                                       :Name
-STR_SORT_BY_DATE                                                :{BLACK}Date
-STR_SORT_BY_NUMBER                                              :Number
-STR_SORT_BY_PROFIT_LAST_YEAR                                    :Profit last year
-STR_SORT_BY_PROFIT_THIS_YEAR                                    :Profit this year
-STR_SORT_BY_AGE                                                 :Age
-STR_SORT_BY_RELIABILITY                                         :Reliability
-STR_SORT_BY_TOTAL_CAPACITY_PER_CARGOTYPE                        :Total capacity per cargo type
-STR_SORT_BY_MAX_SPEED                                           :Maximum speed
-STR_SORT_BY_MODEL                                               :Model
-STR_SORT_BY_VALUE                                               :Value
-STR_SORT_BY_FACILITY                                            :Station type
-STR_SORT_BY_WAITING                                             :Waiting cargo value
-STR_SORT_BY_RATING_MAX                                          :Cargo rating
-STR_ENGINE_SORT_ENGINE_ID                                       :EngineID (classic sort)
-STR_ENGINE_SORT_COST                                            :Cost
-STR_ENGINE_SORT_POWER                                           :Power
-STR_ENGINE_SORT_INTRO_DATE                                      :Introduction Date
-STR_ENGINE_SORT_RUNNING_COST                                    :Running Cost
-STR_ENGINE_SORT_POWER_VS_RUNNING_COST                           :Power/Running Cost
-STR_ENGINE_SORT_CARGO_CAPACITY                                  :Cargo Capacity
-STR_NO_WAITING_CARGO                                            :{BLACK}No cargo of any type is waiting
-STR_SELECT_ALL_FACILITIES                                       :{BLACK}Select all facilities
-STR_SELECT_ALL_TYPES                                            :{BLACK}Select all cargo types (including no waiting cargo)
-STR_AVAILABLE_TRAINS                                            :{BLACK}Available Trains
-STR_AVAILABLE_ROAD_VEHICLES                                     :{BLACK}Available Road Vehicles
-STR_AVAILABLE_SHIPS                                             :{BLACK}Available Ships
-STR_AVAILABLE_AIRCRAFT                                          :{BLACK}Available Aircraft
-STR_AVAILABLE_ENGINES_TIP                                       :{BLACK}See a list of available engine designs for this vehicle type.
-STR_MANAGE_LIST                                                 :{BLACK}Manage list
-STR_MANAGE_LIST_TIP                                             :{BLACK}Send instructions to all vehicles in this list
-STR_REPLACE_VEHICLES                                            :Replace vehicles
-STR_SEND_TRAIN_TO_DEPOT                                         :Send to Depot
-STR_SEND_ROAD_VEHICLE_TO_DEPOT                                  :Send to Depot
-STR_SEND_SHIP_TO_DEPOT                                          :Send to Depot
-STR_SEND_AIRCRAFT_TO_HANGAR                                     :Send to Hangar
-STR_SEND_FOR_SERVICING                                          :Send for Servicing
-
-############ range for months starts
-STR_0162_JAN                                                    :Jan
-STR_0163_FEB                                                    :Feb
-STR_0164_MAR                                                    :Mar
-STR_0165_APR                                                    :Apr
-STR_0166_MAY                                                    :May
-STR_0167_JUN                                                    :Jun
-STR_0168_JUL                                                    :Jul
-STR_0169_AUG                                                    :Aug
-STR_016A_SEP                                                    :Sep
-STR_016B_OCT                                                    :Oct
-STR_016C_NOV                                                    :Nov
-STR_016D_DEC                                                    :Dec
-############ range for months ends
-
-STR_016E                                                        :{TINYFONT}{STRING}{} {STRING}
-STR_016F                                                        :{TINYFONT}{STRING}{} {STRING}{}{NUM}
-STR_0170                                                        :{TINYFONT}{STRING}-
-STR_0171_PAUSE_GAME                                             :{BLACK}Pause game
-STR_0172_SAVE_GAME_ABANDON_GAME                                 :{BLACK}Save game, quit game, quit
-STR_0173_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Display list of company's stations
-STR_0174_DISPLAY_MAP                                            :{BLACK}Display map
-STR_0175_DISPLAY_MAP_TOWN_DIRECTORY                             :{BLACK}Display map, town directory
-STR_0176_DISPLAY_TOWN_DIRECTORY                                 :{BLACK}Display town directory
-STR_0177_DISPLAY_COMPANY_FINANCES                               :{BLACK}Display company finances information
-STR_0178_DISPLAY_COMPANY_GENERAL                                :{BLACK}Display general company information
-STR_0179_DISPLAY_GRAPHS                                         :{BLACK}Display graphs
-STR_017A_DISPLAY_COMPANY_LEAGUE                                 :{BLACK}Display company league table
-STR_017B_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Display list of company's trains
-STR_017C_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Display list of company's road vehicles
-STR_017D_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Display list of company's ships
-STR_017E_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Display list of company's aircraft
-STR_017F_ZOOM_THE_VIEW_IN                                       :{BLACK}Zoom the view in
-STR_0180_ZOOM_THE_VIEW_OUT                                      :{BLACK}Zoom the view out
-STR_0181_BUILD_RAILROAD_TRACK                                   :{BLACK}Build railroad track
-STR_0182_BUILD_ROADS                                            :{BLACK}Build roads
-STR_0183_BUILD_SHIP_DOCKS                                       :{BLACK}Build ship docks
-STR_0184_BUILD_AIRPORTS                                         :{BLACK}Build airports
-STR_0185_PLANT_TREES_PLACE_SIGNS                                :{BLACK}Plant trees, place signs etc.
-STR_0186_LAND_BLOCK_INFORMATION                                 :{BLACK}Land area information
-STR_0187_OPTIONS                                                :{BLACK}Options
-STR_0188                                                        :{BLACK}{SMALLUPARROW}
-STR_0189                                                        :{BLACK}{SMALLDOWNARROW}
-STR_018A_CAN_T_CHANGE_SERVICING                                 :{WHITE}Can't change servicing interval...
-STR_018B_CLOSE_WINDOW                                           :{BLACK}Close window
-STR_018C_WINDOW_TITLE_DRAG_THIS                                 :{BLACK}Window title - drag this to move window
-STR_STICKY_BUTTON                                               :{BLACK}Mark this window as uncloseable for the 'Close All Windows' key
-STR_RESIZE_BUTTON                                               :{BLACK}Click and drag to resize this window
-STR_SAVELOAD_HOME_BUTTON                                        :{BLACK}Click here to jump to the current default save/load directory
-STR_018D_DEMOLISH_BUILDINGS_ETC                                 :{BLACK}Demolish buildings etc. on a square of land
-STR_018E_LOWER_A_CORNER_OF_LAND                                 :{BLACK}Lower a corner of land
-STR_018F_RAISE_A_CORNER_OF_LAND                                 :{BLACK}Raise a corner of land
-STR_0190_SCROLL_BAR_SCROLLS_LIST                                :{BLACK}Scroll bar - scrolls list up/down
-STR_HSCROLL_BAR_SCROLLS_LIST                                    :{BLACK}Scroll bar - scrolls list left/right
-STR_0191_SHOW_LAND_CONTOURS_ON_MAP                              :{BLACK}Show land contours on map
-STR_0192_SHOW_VEHICLES_ON_MAP                                   :{BLACK}Show vehicles on map
-STR_0193_SHOW_INDUSTRIES_ON_MAP                                 :{BLACK}Show industries on map
-STR_0194_SHOW_TRANSPORT_ROUTES_ON                               :{BLACK}Show transport routes on map
-STR_0195_SHOW_VEGETATION_ON_MAP                                 :{BLACK}Show vegetation on map
-STR_0196_SHOW_LAND_OWNERS_ON_MAP                                :{BLACK}Show land owners on map
-STR_0197_TOGGLE_TOWN_NAMES_ON_OFF                               :{BLACK}Toggle town names on/off on map
-STR_0198_PROFIT_THIS_YEAR_LAST_YEAR                             :{TINYFONT}{BLACK}Profit this year: {CURRENCY} (last year: {CURRENCY})
-
-############ range for service numbers starts
-STR_AGE                                                         :{COMMA} year{P "" s} ({COMMA})
-STR_AGE_RED                                                     :{RED}{COMMA} year{P "" s} ({COMMA})
-############ range for service numbers ends
-
-STR_019C_ROAD_VEHICLE                                           :Road vehicle
-STR_019D_AIRCRAFT                                               :Aircraft
-STR_019E_SHIP                                                   :Ship
-STR_019F_TRAIN                                                  :Train
-STR_01A0_IS_GETTING_OLD                                         :{WHITE}{STRING} {COMMA} is getting old
-STR_01A1_IS_GETTING_VERY_OLD                                    :{WHITE}{STRING} {COMMA} is getting very old
-STR_01A2_IS_GETTING_VERY_OLD_AND                                :{WHITE}{STRING} {COMMA} is getting very old and urgently needs replacing
-STR_01A3_LAND_AREA_INFORMATION                                  :{WHITE}Land Area Information
-STR_01A4_COST_TO_CLEAR_N_A                                      :{BLACK}Cost to clear: {LTBLUE}N/A
-STR_01A5_COST_TO_CLEAR                                          :{BLACK}Cost to clear: {LTBLUE}{CURRENCY}
-STR_01A6_N_A                                                    :N/A
-STR_01A7_OWNER                                                  :{BLACK}Owner: {LTBLUE}{STRING}
-STR_01A8_LOCAL_AUTHORITY                                        :{BLACK}Local authority: {LTBLUE}{STRING}
-STR_01A9_NONE                                                   :None
-STR_01AA_NAME                                                   :{BLACK}Name
-STR_01AB                                                        :{BLACK}{TINYFONT}{VEHICLE}
-
-############ range for days starts
-STR_01AC_1ST                                                    :1st
-STR_01AD_2ND                                                    :2nd
-STR_01AE_3RD                                                    :3rd
-STR_01AF_4TH                                                    :4th
-STR_01B0_5TH                                                    :5th
-STR_01B1_6TH                                                    :6th
-STR_01B2_7TH                                                    :7th
-STR_01B3_8TH                                                    :8th
-STR_01B4_9TH                                                    :9th
-STR_01B5_10TH                                                   :10th
-STR_01B6_11TH                                                   :11th
-STR_01B7_12TH                                                   :12th
-STR_01B8_13TH                                                   :13th
-STR_01B9_14TH                                                   :14th
-STR_01BA_15TH                                                   :15th
-STR_01BB_16TH                                                   :16th
-STR_01BC_17TH                                                   :17th
-STR_01BD_18TH                                                   :18th
-STR_01BE_19TH                                                   :19th
-STR_01BF_20TH                                                   :20th
-STR_01C0_21ST                                                   :21st
-STR_01C1_22ND                                                   :22nd
-STR_01C2_23RD                                                   :23rd
-STR_01C3_24TH                                                   :24th
-STR_01C4_25TH                                                   :25th
-STR_01C5_26TH                                                   :26th
-STR_01C6_27TH                                                   :27th
-STR_01C7_28TH                                                   :28th
-STR_01C8_29TH                                                   :29th
-STR_01C9_30TH                                                   :30th
-STR_01CA_31ST                                                   :31st
-############ range for days ends
-
-STR_01CB                                                        :{TINYFONT}{COMMA}
-
-STR_01CE_CARGO_ACCEPTED                                         :{BLACK}Cargo accepted: {LTBLUE}
-
-STR_01D1_8                                                      :({COMMA}/8 {STRING})
-STR_01D2_JAZZ_JUKEBOX                                           :{WHITE}Jazz Jukebox
-STR_01D3_SOUND_MUSIC                                            :Sound/music
-STR_01D4_SHOW_SOUND_MUSIC_WINDOW                                :{BLACK}Show sound/music window
-STR_01D5_ALL                                                    :{TINYFONT}All
-STR_01D6_OLD_STYLE                                              :{TINYFONT}Old Style
-STR_01D7_NEW_STYLE                                              :{TINYFONT}New Style
-STR_01D8_EZY_STREET                                             :{TINYFONT}Ezy Street
-STR_01D9_CUSTOM_1                                               :{TINYFONT}Custom 1
-STR_01DA_CUSTOM_2                                               :{TINYFONT}Custom 2
-STR_01DB_MUSIC_VOLUME                                           :{BLACK}{TINYFONT}Music Volume
-STR_01DC_EFFECTS_VOLUME                                         :{BLACK}{TINYFONT}Effects Volume
-STR_01DD_MIN_MAX                                                :{BLACK}{TINYFONT}MIN  '  '  ' '  '  '  MAX
-STR_01DE_SKIP_TO_PREVIOUS_TRACK                                 :{BLACK}Skip to previous track in selection
-STR_01DF_SKIP_TO_NEXT_TRACK_IN_SELECTION                        :{BLACK}Skip to next track in selection
-STR_01E0_STOP_PLAYING_MUSIC                                     :{BLACK}Stop playing music
-STR_01E1_START_PLAYING_MUSIC                                    :{BLACK}Start playing music
-STR_01E2_DRAG_SLIDERS_TO_SET_MUSIC                              :{BLACK}Drag sliders to set music and sound effect volumes
-STR_01E3                                                        :{DKGREEN}{TINYFONT}--
-STR_01E4_0                                                      :{DKGREEN}{TINYFONT}0{COMMA}
-STR_01E5                                                        :{DKGREEN}{TINYFONT}{COMMA}
-STR_01E6                                                        :{DKGREEN}{TINYFONT}------
-STR_01E7                                                        :{DKGREEN}{TINYFONT}"{STRING}"
-STR_01E8_TRACK_XTITLE                                           :{BLACK}{TINYFONT}Track{SETX 88}Title
-STR_01E9_SHUFFLE                                                :{TINYFONT}Shuffle
-STR_01EA_PROGRAM                                                :{TINYFONT}{BLACK}Program
-STR_01EB_MUSIC_PROGRAM_SELECTION                                :{WHITE}Music Program Selection
-STR_01EC_0                                                      :{TINYFONT}{LTBLUE}0{COMMA} "{STRING}"
-STR_01ED                                                        :{TINYFONT}{LTBLUE}{COMMA} "{STRING}"
-STR_01EE_TRACK_INDEX                                            :{TINYFONT}{BLACK}Track Index
-STR_01EF_PROGRAM                                                :{TINYFONT}{BLACK}Program - '{STRING}'
-STR_01F0_CLEAR                                                  :{TINYFONT}{BLACK}Clear
-STR_01F1_SAVE                                                   :{TINYFONT}{BLACK}Save
-STR_01F2_CURRENT_PROGRAM_OF_MUSIC                               :{BLACK}Current program of music tracks
-STR_01F3_SELECT_ALL_TRACKS_PROGRAM                              :{BLACK}Select 'all tracks' program
-STR_01F4_SELECT_OLD_STYLE_MUSIC                                 :{BLACK}Select 'old style music' program
-STR_01F5_SELECT_NEW_STYLE_MUSIC                                 :{BLACK}Select 'new style music' program
-STR_01F6_SELECT_CUSTOM_1_USER_DEFINED                           :{BLACK}Select 'Custom 1' (user-defined) program
-STR_01F7_SELECT_CUSTOM_2_USER_DEFINED                           :{BLACK}Select 'Custom 2' (user-defined) program
-STR_01F8_CLEAR_CURRENT_PROGRAM_CUSTOM1                          :{BLACK}Clear current program (Custom1 or Custom2 only)
-STR_01F9_SAVE_MUSIC_SETTINGS                                    :{BLACK}Save music settings
-STR_01FA_CLICK_ON_MUSIC_TRACK_TO                                :{BLACK}Click on music track to add to current program (Custom1 or Custom2 only)
-STR_CLICK_ON_TRACK_TO_REMOVE                                    :{BLACK}Click on music track to remove it from current program (Custom1 or Custom2 only)
-STR_01FB_TOGGLE_PROGRAM_SHUFFLE                                 :{BLACK}Toggle program shuffle on/off
-STR_01FC_SHOW_MUSIC_TRACK_SELECTION                             :{BLACK}Show music track selection window
-STR_01FD_CLICK_ON_SERVICE_TO_CENTER                             :{BLACK}Click on service to center view on industry/town
-STR_01FE_DIFFICULTY                                             :{BLACK}Difficulty ({STRING})
-STR_01FF                                                        :{TINYFONT}{BLACK}{DATE_LONG}
-STR_0200_LAST_MESSAGE_NEWS_REPORT                               :Last message/news report
-STR_0201_MESSAGE_SETTINGS                                       :Message settings
-STR_MESSAGE_HISTORY_MENU                                        :Message History
-STR_0203_SHOW_LAST_MESSAGE_NEWS                                 :{BLACK}Show last message/news report, show message options
-STR_0204_MESSAGE_OPTIONS                                        :{WHITE}Message Options
-STR_0205_MESSAGE_TYPES                                          :{BLACK}Message types:
-STR_0206_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Arrival of first vehicle at player's station
-STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Arrival of first vehicle at competitor's station
-STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Accidents / disasters
-STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Company information
-STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Open / close of industries
-STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Economy changes
-STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Advice / information on player's vehicles
-STR_020C_NEW_VEHICLES                                           :{YELLOW}New vehicles
-STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Changes of cargo acceptance
-STR_020E_SUBSIDIES                                              :{YELLOW}Subsidies
-STR_020F_GENERAL_INFORMATION                                    :{YELLOW}General information
-STR_MESSAGES_ALL                                                :{YELLOW}Setting for all messagetypes (off/summary/full)
-STR_MESSAGE_SOUND                                               :{YELLOW}Play sound for summarized newsmessages
-STR_0210_TOO_FAR_FROM_PREVIOUS_DESTINATIO                       :{WHITE}...too far from previous destination
-STR_0211_TOP_COMPANIES_WHO_REACHED                              :{BIGFONT}{BLACK}Top companies who reached {NUM}{}({STRING} Level)
-STR_TOP_COMPANIES_NETWORK_GAME                                  :{BIGFONT}{BLACK}Company League Table in {NUM}
-STR_0212                                                        :{BIGFONT}{COMMA}.
-STR_0213_BUSINESSMAN                                            :Businessman
-STR_0214_ENTREPRENEUR                                           :Entrepreneur
-STR_0215_INDUSTRIALIST                                          :Industrialist
-STR_0216_CAPITALIST                                             :Capitalist
-STR_0217_MAGNATE                                                :Magnate
-STR_0218_MOGUL                                                  :Mogul
-STR_0219_TYCOON_OF_THE_CENTURY                                  :Tycoon of the Century
-STR_HIGHSCORE_NAME                                              :{BIGFONT}{PLAYERNAME}, {COMPANY}
-STR_HIGHSCORE_STATS                                             :{BIGFONT}'{STRING}'   ({COMMA})
-STR_021B_ACHIEVES_STATUS                                        :{BLACK}{BIGFONT}{COMPANY} achieves '{STRING}' status!
-STR_021C_OF_ACHIEVES_STATUS                                     :{WHITE}{BIGFONT}{PLAYERNAME} of {COMPANY} achieves '{STRING}' status!
-STR_021F                                                        :{BLUE}{COMMA}
-STR_0221_OPENTTD                                                :{YELLOW}OpenTTD
-STR_0222_SCENARIO_EDITOR                                        :{YELLOW}Scenario Editor
-STR_0223_LAND_GENERATION                                        :{WHITE}Land Generation
-STR_0224                                                        :{BLACK}{UPARROW}
-STR_0225                                                        :{BLACK}{DOWNARROW}
-STR_0228_INCREASE_SIZE_OF_LAND_AREA                             :{BLACK}Increase area of land to lower/raise
-STR_0229_DECREASE_SIZE_OF_LAND_AREA                             :{BLACK}Decrease area of land to lower/raise
-STR_022A_GENERATE_RANDOM_LAND                                   :{BLACK}Generate random land
-STR_022B_RESET_LANDSCAPE                                        :{BLACK}Reset landscape
-STR_022C_RESET_LANDSCAPE                                        :{WHITE}Reset Landscape
-STR_RESET_LANDSCAPE_TOOLTIP                                     :{BLACK}Remove all player-owned property from the map
-STR_RESET_LANDSCAPE_CONFIRMATION_TEXT                           :{WHITE}Are you sure you want to remove all player-owned property?
-STR_022E_LANDSCAPE_GENERATION                                   :{BLACK}Landscape generation
-STR_022F_TOWN_GENERATION                                        :{BLACK}Town generation
-STR_0230_INDUSTRY_GENERATION                                    :{BLACK}Industry generation
-STR_0231_ROAD_CONSTRUCTION                                      :{BLACK}Road construction
-STR_0233_TOWN_GENERATION                                        :{WHITE}Town Generation
-STR_0234_NEW_TOWN                                               :{BLACK}New Town
-STR_0235_CONSTRUCT_NEW_TOWN                                     :{BLACK}Construct new town
-STR_0236_CAN_T_BUILD_TOWN_HERE                                  :{WHITE}Can't build town here...
-STR_0237_TOO_CLOSE_TO_EDGE_OF_MAP                               :{WHITE}...too close to edge of map
-STR_0238_TOO_CLOSE_TO_ANOTHER_TOWN                              :{WHITE}...too close to another town
-STR_0239_SITE_UNSUITABLE                                        :{WHITE}...site unsuitable
-STR_023A_TOO_MANY_TOWNS                                         :{WHITE}...too many towns
-STR_CANNOT_GENERATE_TOWN                                        :{WHITE}Can't build any towns
-STR_NO_SPACE_FOR_TOWN                                           :{WHITE}...there is no more space on the map
-STR_023B_INCREASE_SIZE_OF_TOWN                                  :{BLACK}Increase size of town
-STR_023C_EXPAND                                                 :{BLACK}Expand
-STR_023D_RANDOM_TOWN                                            :{BLACK}Random Town
-STR_023E_BUILD_TOWN_IN_RANDOM_LOCATION                          :{BLACK}Build town in random location
-STR_023F_INDUSTRY_GENERATION                                    :{WHITE}Industry Generation
-STR_0240_COAL_MINE                                              :{BLACK}Coal Mine
-STR_0241_POWER_STATION                                          :{BLACK}Power Station
-STR_0242_SAWMILL                                                :{BLACK}Sawmill
-STR_0243_FOREST                                                 :{BLACK}Forest
-STR_0244_OIL_REFINERY                                           :{BLACK}Oil Refinery
-STR_0245_OIL_RIG                                                :{BLACK}Oil Rig
-STR_0246_FACTORY                                                :{BLACK}Factory
-STR_0247_STEEL_MILL                                             :{BLACK}Steel Mill
-STR_0248_FARM                                                   :{BLACK}Farm
-STR_0249_IRON_ORE_MINE                                          :{BLACK}Iron Ore Mine
-STR_024A_OIL_WELLS                                              :{BLACK}Oil Wells
-STR_024B_BANK                                                   :{BLACK}Bank
-STR_024C_PAPER_MILL                                             :{BLACK}Paper Mill
-STR_024D_FOOD_PROCESSING_PLANT                                  :{BLACK}Food Processing Plant
-STR_024E_PRINTING_WORKS                                         :{BLACK}Printing Works
-STR_024F_GOLD_MINE                                              :{BLACK}Gold Mine
-STR_0250_LUMBER_MILL                                            :{BLACK}Lumber Mill
-STR_0251_FRUIT_PLANTATION                                       :{BLACK}Fruit Plantation
-STR_0252_RUBBER_PLANTATION                                      :{BLACK}Rubber Plantation
-STR_0253_WATER_SUPPLY                                           :{BLACK}Water Supply
-STR_0254_WATER_TOWER                                            :{BLACK}Water Tower
-STR_0255_DIAMOND_MINE                                           :{BLACK}Diamond Mine
-STR_0256_COPPER_ORE_MINE                                        :{BLACK}Copper Ore Mine
-STR_0257_COTTON_CANDY_FOREST                                    :{BLACK}Cotton Candy Forest
-STR_0258_CANDY_FACTORY                                          :{BLACK}Candy Factory
-STR_0259_BATTERY_FARM                                           :{BLACK}Battery Farm
-STR_025A_COLA_WELLS                                             :{BLACK}Cola Wells
-STR_025B_TOY_SHOP                                               :{BLACK}Toy Shop
-STR_025C_TOY_FACTORY                                            :{BLACK}Toy Factory
-STR_025D_PLASTIC_FOUNTAINS                                      :{BLACK}Plastic Fountains
-STR_025E_FIZZY_DRINK_FACTORY                                    :{BLACK}Fizzy Drink Factory
-STR_025F_BUBBLE_GENERATOR                                       :{BLACK}Bubble Generator
-STR_0260_TOFFEE_QUARRY                                          :{BLACK}Toffee Quarry
-STR_0261_SUGAR_MINE                                             :{BLACK}Sugar Mine
-STR_0262_CONSTRUCT_COAL_MINE                                    :{BLACK}Construct Coal Mine
-STR_0263_CONSTRUCT_POWER_STATION                                :{BLACK}Construct Power Station
-STR_0264_CONSTRUCT_SAWMILL                                      :{BLACK}Construct Sawmill
-STR_0265_PLANT_FOREST                                           :{BLACK}Plant Forest
-STR_0266_CONSTRUCT_OIL_REFINERY                                 :{BLACK}Construct Oil Refinery
-STR_0267_CONSTRUCT_OIL_RIG_CAN_ONLY                             :{BLACK}Construct Oil Rig (Can only be built near the edges of the map)
-STR_0268_CONSTRUCT_FACTORY                                      :{BLACK}Construct Factory
-STR_0269_CONSTRUCT_STEEL_MILL                                   :{BLACK}Construct Steel Mill
-STR_026A_CONSTRUCT_FARM                                         :{BLACK}Construct Farm
-STR_026B_CONSTRUCT_IRON_ORE_MINE                                :{BLACK}Construct Iron Ore Mine
-STR_026C_CONSTRUCT_OIL_WELLS                                    :{BLACK}Construct Oil Wells
-STR_026D_CONSTRUCT_BANK_CAN_ONLY                                :{BLACK}Construct Bank (Can only be built in towns with a population greater than 1200)
-STR_026E_CONSTRUCT_PAPER_MILL                                   :{BLACK}Construct Paper Mill
-STR_026F_CONSTRUCT_FOOD_PROCESSING                              :{BLACK}Construct Food Processing Plant
-STR_0270_CONSTRUCT_PRINTING_WORKS                               :{BLACK}Construct Printing Works
-STR_0271_CONSTRUCT_GOLD_MINE                                    :{BLACK}Construct Gold Mine
-STR_0272_CONSTRUCT_BANK_CAN_ONLY                                :{BLACK}Construct Bank (Can only be built in towns)
-STR_0273_CONSTRUCT_LUMBER_MILL_TO                               :{BLACK}Construct Lumber Mill (to clear rainforest and produce Wood)
-STR_0274_PLANT_FRUIT_PLANTATION                                 :{BLACK}Plant Fruit Plantation
-STR_0275_PLANT_RUBBER_PLANTATION                                :{BLACK}Plant Rubber Plantation
-STR_0276_CONSTRUCT_WATER_SUPPLY                                 :{BLACK}Construct Water Supply
-STR_0277_CONSTRUCT_WATER_TOWER_CAN                              :{BLACK}Construct Water Tower (Can only be built in towns)
-STR_0278_CONSTRUCT_DIAMOND_MINE                                 :{BLACK}Construct Diamond Mine
-STR_0279_CONSTRUCT_COPPER_ORE_MINE                              :{BLACK}Construct Copper Ore Mine
-STR_027A_PLANT_COTTON_CANDY_FOREST                              :{BLACK}Plant Cotton Candy Forest
-STR_027B_CONSTRUCT_CANDY_FACTORY                                :{BLACK}Construct Candy Factory
-STR_027C_CONSTRUCT_BATTERY_FARM                                 :{BLACK}Construct Battery Farm
-STR_027D_CONSTRUCT_COLA_WELLS                                   :{BLACK}Construct Cola Wells
-STR_027E_CONSTRUCT_TOY_SHOP                                     :{BLACK}Construct Toy Shop
-STR_027F_CONSTRUCT_TOY_FACTORY                                  :{BLACK}Construct Toy Factory
-STR_0280_CONSTRUCT_PLASTIC_FOUNTAINS                            :{BLACK}Construct Plastic Fountains
-STR_0281_CONSTRUCT_FIZZY_DRINK_FACTORY                          :{BLACK}Construct Fizzy Drink Factory
-STR_0282_CONSTRUCT_BUBBLE_GENERATOR                             :{BLACK}Construct Bubble Generator
-STR_0283_CONSTRUCT_TOFFEE_QUARRY                                :{BLACK}Construct Toffee Quarry
-STR_0284_CONSTRUCT_SUGAR_MINE                                   :{BLACK}Construct Sugar Mine
-STR_0285_CAN_T_BUILD_HERE                                       :{WHITE}Can't build {STRING} here...
-STR_0286_MUST_BUILD_TOWN_FIRST                                  :{WHITE}...must build town first
-STR_0287_ONLY_ONE_ALLOWED_PER_TOWN                              :{WHITE}...only one allowed per town
-STR_0288_PLANT_TREES                                            :{BLACK}Plant trees
-STR_0289_PLACE_SIGN                                             :{BLACK}Place sign
-STR_028A_RANDOM_TREES                                           :{BLACK}Random Trees
-STR_028B_PLANT_TREES_RANDOMLY_OVER                              :{BLACK}Plant trees randomly over landscape
-STR_028C_PLACE_ROCKY_AREAS_ON_LANDSCAPE                         :{BLACK}Place rocky areas on landscape
-STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Place lighthouse
-STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Place transmitter
-STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Define desert area.{}Press and hold CTRL to remove it
-STR_CREATE_LAKE                                                 :{BLACK}Define water area.{}Make a canal, unless CTRL is held down at sea level, when it will flood the surroundings instead
-STR_0290_DELETE                                                 :{BLACK}Delete
-STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Delete this town completely
-STR_0292_SAVE_SCENARIO                                          :Save scenario
-STR_0293_LOAD_SCENARIO                                          :Load scenario
-STR_LOAD_HEIGHTMAP                                              :Load heightmap
-STR_0294_QUIT_EDITOR                                            :Quit editor
-STR_0295                                                        :
-STR_0296_QUIT                                                   :Quit
-STR_0297_SAVE_SCENARIO_LOAD_SCENARIO                            :{BLACK}Save scenario, load scenario, abandon scenario editor, quit
-STR_0298_LOAD_SCENARIO                                          :{WHITE}Load Scenario
-STR_0299_SAVE_SCENARIO                                          :{WHITE}Save Scenario
-STR_029A_PLAY_SCENARIO                                          :{BLACK}Play Scenario
-STR_PLAY_HEIGHTMAP                                              :{BLACK}Play Heightmap
-STR_PLAY_HEIGHTMAP_HINT                                         :{BLACK}Start a new game, using a heightmap as landscape
-STR_QUIT_SCENARIO_QUERY                                         :{YELLOW}Are you sure you want to quit this scenario ?
-STR_029C_QUIT_EDITOR                                            :{WHITE}Quit Editor
-STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...can only be built in towns with a population of at least 1200
-STR_029E_MOVE_THE_STARTING_DATE                                 :{BLACK}Move the starting date backward 1 year
-STR_029F_MOVE_THE_STARTING_DATE                                 :{BLACK}Move the starting date forward 1 year
-STR_02A0_ENDS_OF_BRIDGE_MUST_BOTH                               :{WHITE}...ends of bridge must both be on land
-STR_02A1_SMALL                                                  :{BLACK}Small
-STR_02A2_MEDIUM                                                 :{BLACK}Medium
-STR_02A3_LARGE                                                  :{BLACK}Large
-STR_SCENARIO_EDITOR_CITY                                        :{BLACK}City
-STR_02A4_SELECT_TOWN_SIZE                                       :{BLACK}Select town size
-STR_02A5_TOWN_SIZE                                              :{YELLOW}Town size:
-
-STR_02B6                                                        :{STRING}  -  {STRING}
-STR_02B7_SHOW_LAST_MESSAGE_OR_NEWS                              :{BLACK}Show last message or news report
-STR_OFF                                                         :Off
-STR_SUMMARY                                                     :Summary
-STR_FULL                                                        :Full
-STR_02BA                                                        :{SILVER}- -  {COMPANY}  - -
-STR_02BB_TOWN_DIRECTORY                                         :Town directory
-STR_02BC_VEHICLE_DESIGN_NAMES                                   :{BLACK}Vehicle design names
-STR_02BD                                                        :{BLACK}{STRING}
-STR_02BE_DEFAULT                                                :Default
-STR_02BF_CUSTOM                                                 :Custom
-STR_02C0_SAVE_CUSTOM_NAMES                                      :{BLACK}Save custom names
-STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION                         :{BLACK}Vehicle design names selection
-STR_02C2_SAVE_CUSTOMIZED_VEHICLE                                :{BLACK}Save customized vehicle design names
-
-STR_CHECKMARK                                                   :{CHECKMARK}
-############ range for menu starts
-STR_02C3_GAME_OPTIONS                                           :Game options
-STR_02C5_DIFFICULTY_SETTINGS                                    :Difficulty settings
-STR_02C7_CONFIG_PATCHES                                         :Configure patches
-STR_NEWGRF_SETTINGS                                             :Newgrf settings
-STR_TRANSPARENCY_OPTIONS                                        :Transparency options
-STR_GAMEOPTMENU_0A                                              :
-STR_02CA_TOWN_NAMES_DISPLAYED                                   :{SETX 12}Town names displayed
-STR_02CC_STATION_NAMES_DISPLAYED                                :{SETX 12}Station names displayed
-STR_02CE_SIGNS_DISPLAYED                                        :{SETX 12}Signs displayed
-STR_WAYPOINTS_DISPLAYED2                                        :{SETX 12}Waypoints displayed
-STR_02D0_FULL_ANIMATION                                         :{SETX 12}Full animation
-STR_02D2_FULL_DETAIL                                            :{SETX 12}Full detail
-STR_02D4_TRANSPARENT_BUILDINGS                                  :{SETX 12}Transparent buildings
-STR_TRANSPARENT_SIGNS                                           :{SETX 12}Transparent station signs
-############ range ends here
-
-############ range for menu starts
-STR_02D5_LAND_BLOCK_INFO                                        :Land area information
-STR_02D6                                                        :
-STR_CONSOLE_SETTING                                             :Toggle Console
-STR_02D7_SCREENSHOT_CTRL_S                                      :Screenshot (Ctrl-S)
-STR_02D8_GIANT_SCREENSHOT_CTRL_G                                :Giant Screenshot (Ctrl-G)
-STR_02D9_ABOUT_OPENTTD                                          :About 'OpenTTD'
-############ range ends here
-
-STR_02DB_OFF                                                    :{BLACK}Off
-STR_02DA_ON                                                     :{BLACK}On
-STR_02DC_DISPLAY_SUBSIDIES                                      :{BLACK}Display subsidies
-STR_02DD_SUBSIDIES                                              :Subsidies
-STR_02DE_MAP_OF_WORLD                                           :Map of world
-STR_EXTRA_VIEW_PORT                                             :Extra viewport
-STR_SIGN_LIST                                                   :Sign list
-STR_02DF_TOWN_DIRECTORY                                         :Town directory
-STR_TOWN_POPULATION                                             :{BLACK}World population: {COMMA}
-STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Viewport {COMMA}
-STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN                                :{BLACK}Copy to viewport
-STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN_TT                             :{BLACK}Copy the location of the global view to this viewport
-STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW                                :{BLACK}Paste from viewport
-STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT                             :{BLACK}Paste the location of this viewport to the global view
-
-STR_02E0_CURRENCY_UNITS                                         :{BLACK}Currency units
-STR_02E1                                                        :{BLACK}{SKIP}{STRING}
-STR_02E2_CURRENCY_UNITS_SELECTION                               :{BLACK}Currency units selection
-STR_MEASURING_UNITS                                             :{BLACK}Measuring units
-STR_02E4                                                        :{BLACK}{SKIP}{SKIP}{STRING}
-STR_MEASURING_UNITS_SELECTION                                   :{BLACK}Measuring units selection
-STR_02E6_ROAD_VEHICLES                                          :{BLACK}Road vehicles
-STR_02E7                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{STRING}
-STR_02E8_SELECT_SIDE_OF_ROAD_FOR                                :{BLACK}Select side of road for vehicles to drive on
-STR_02E9_DRIVE_ON_LEFT                                          :Drive on left
-STR_02EA_DRIVE_ON_RIGHT                                         :Drive on right
-STR_02EB_TOWN_NAMES                                             :{BLACK}Town names
-STR_02EC                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
-STR_02ED_SELECT_STYLE_OF_TOWN_NAMES                             :{BLACK}Select style of town names
-
-STR_02F4_AUTOSAVE                                               :{BLACK}Autosave
-STR_02F5                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
-STR_02F6_SELECT_INTERVAL_BETWEEN                                :{BLACK}Select interval between automatic game saves
-STR_02F7_OFF                                                    :Off
-STR_02F8_EVERY_3_MONTHS                                         :Every 3 months
-STR_02F9_EVERY_6_MONTHS                                         :Every 6 months
-STR_02FA_EVERY_12_MONTHS                                        :Every 12 months
-STR_02FB_START_A_NEW_GAME                                       :{BLACK}Start a new game
-STR_02FC_LOAD_A_SAVED_GAME                                      :{BLACK}Load a saved game
-STR_02FE_CREATE_A_CUSTOMIZED_GAME                               :{BLACK}Create a customized game world/scenario
-STR_02FF_SELECT_SINGLE_PLAYER_GAME                              :{BLACK}Select single-player game
-STR_0300_SELECT_MULTIPLAYER_GAME                                :{BLACK}Select multiplayer game of 2-8 players
-STR_0301_DISPLAY_GAME_OPTIONS                                   :{BLACK}Display game options
-STR_0302_DISPLAY_DIFFICULTY_OPTIONS                             :{BLACK}Display difficulty options
-STR_0303_START_A_NEW_GAME_USING                                 :{BLACK}Start a new game, using a customized scenario
-STR_0304_QUIT                                                   :{BLACK}Quit
-STR_0305_QUIT_OPENTTD                                           :{BLACK}Quit 'OpenTTD'
-STR_0307_OPENTTD                                                :{WHITE}OpenTTD {REV}
-STR_030D_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...can only be built in towns
-STR_030E_SELECT_TEMPERATE_LANDSCAPE                             :{BLACK}Select 'temperate' landscape style
-STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE                            :{BLACK}Select 'sub-arctic' landscape style
-STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE                          :{BLACK}Select 'sub-tropical' landscape style
-STR_0311_SELECT_TOYLAND_LANDSCAPE                               :{BLACK}Select 'toyland' landscape style
-STR_0312_FUND_CONSTRUCTION_OF_NEW                               :{BLACK}Fund construction of new industry
-
-############ range for menu starts
-STR_INDUSTRY_DIR                                                :Industry Directory
-STR_0313_FUND_NEW_INDUSTRY                                      :Fund new industry
-############ range ends here
-
-STR_0314_FUND_NEW_INDUSTRY                                      :{WHITE}Fund new industry
-STR_JUST_STRING                                                 :{STRING}
-STR_JUST_INT                                                    :{NUM}
-STR_0316_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...can only be built in towns
-STR_0317_CAN_ONLY_BE_BUILT_IN_RAINFOREST                        :{WHITE}...can only be built in rainforest areas
-STR_0318_CAN_ONLY_BE_BUILT_IN_DESERT                            :{WHITE}...can only be built in desert areas
-STR_0319_PAUSED                                                 :{YELLOW}* *  PAUSED  *  *
-
-STR_031B_SCREENSHOT_SUCCESSFULLY                                :{WHITE}Screenshot successfully saved as '{STRING}'
-STR_031C_SCREENSHOT_FAILED                                      :{WHITE}Screenshot failed!
-
-STR_0329_PURCHASE_LAND_FOR_FUTURE                               :{BLACK}Purchase land for future use
-STR_032F_AUTOSAVE                                               :{RED}AUTOSAVE
-STR_SAVING_GAME                                                 :{RED}*  *  SAVING GAME  *  *
-STR_SAVE_STILL_IN_PROGRESS                                      :{WHITE}Saving still in progress,{}please wait until it is finished!
-STR_0330_SELECT_EZY_STREET_STYLE                                :{BLACK}Select 'Ezy Street style music' program
-
-STR_0335_6                                                      :{BLACK}6
-STR_0336_7                                                      :{BLACK}7
-
-############ start of townname region
-STR_TOWNNAME_ORIGINAL_ENGLISH                                   :English (Original)
-STR_TOWNNAME_FRENCH                                             :French
-STR_TOWNNAME_GERMAN                                             :German
-STR_TOWNNAME_ADDITIONAL_ENGLISH                                 :English (Additional)
-STR_TOWNNAME_LATIN_AMERICAN                                     :Latin-American
-STR_TOWNNAME_SILLY                                              :Silly
-STR_TOWNNAME_SWEDISH                                            :Swedish
-STR_TOWNNAME_DUTCH                                              :Dutch
-STR_TOWNNAME_FINNISH                                            :Finnish
-STR_TOWNNAME_POLISH                                             :Polish
-STR_TOWNNAME_SLOVAKISH                                          :Slovakish
-STR_TOWNNAME_NORWEGIAN                                          :Norwegian
-STR_TOWNNAME_HUNGARIAN                                          :Hungarian
-STR_TOWNNAME_AUSTRIAN                                           :Austrian
-STR_TOWNNAME_ROMANIAN                                           :Romanian
-STR_TOWNNAME_CZECH                                              :Czech
-STR_TOWNNAME_SWISS                                              :Swiss
-STR_TOWNNAME_DANISH                                             :Danish
-STR_TOWNNAME_TURKISH                                            :Turkish
-STR_TOWNNAME_ITALIAN                                            :Italian
-STR_TOWNNAME_CATALAN                                            :Catalan
-############ end of townname region
-
-STR_CURR_GBP                                                    :Pounds (£)
-STR_CURR_USD                                                    :Dollars ($)
-STR_CURR_EUR                                                    :Euro (€)
-STR_CURR_YEN                                                    :Yen (¥)
-STR_CURR_ATS                                                    :Austrian Shilling (ATS)
-STR_CURR_BEF                                                    :Belgian Franc (BEF)
-STR_CURR_CHF                                                    :Swiss Franc (CHF)
-STR_CURR_CZK                                                    :Czech Koruna (CZK)
-STR_CURR_DEM                                                    :Deutschmark (DEM)
-STR_CURR_DKK                                                    :Danish Krone (DKK)
-STR_CURR_ESP                                                    :Peseta (ESP)
-STR_CURR_FIM                                                    :Finnish Markka (FIM)
-STR_CURR_FRF                                                    :Franc (FRF)
-STR_CURR_GRD                                                    :Greek Drachma (GRD)
-STR_CURR_HUF                                                    :Hungarian Forint (HUF)
-STR_CURR_ISK                                                    :Icelandic Krona (ISK)
-STR_CURR_ITL                                                    :Italian Lira (ITL)
-STR_CURR_NLG                                                    :Dutch Guilder (NLG)
-STR_CURR_NOK                                                    :Norwegian Krone (NOK)
-STR_CURR_PLN                                                    :Polish Zloty (PLN)
-STR_CURR_ROL                                                    :Romanian Leu (ROL)
-STR_CURR_RUR                                                    :Russian Rubel (RUR)
-STR_CURR_SIT                                                    :Slovenian Tolar (SIT)
-STR_CURR_SEK                                                    :Swedish Krona (SEK)
-STR_CURR_YTL                                                    :Turkish Lira (YTL)
-STR_CURR_SKK                                                    :Slovak Koruna (SKK)
-STR_CURR_BRR                                                    :Brazilian Real (BRL)
-
-STR_CURR_CUSTOM                                                 :Custom...
-
-STR_OPTIONS_LANG                                                :{BLACK}Language
-STR_OPTIONS_LANG_CBO                                            :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
-STR_OPTIONS_LANG_TIP                                            :{BLACK}Select the interface language to use
-
-STR_OPTIONS_FULLSCREEN                                          :{BLACK}Fullscreen
-STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Check this box to play OpenTTD fullscreen mode
-
-STR_OPTIONS_RES                                                 :{BLACK}Screen resolution
-STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
-STR_OPTIONS_RES_TIP                                             :{BLACK}Select the screen resolution to use
-
-STR_OPTIONS_SCREENSHOT_FORMAT                                   :{BLACK}Screenshot format
-STR_OPTIONS_SCREENSHOT_FORMAT_CBO                               :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
-STR_OPTIONS_SCREENSHOT_FORMAT_TIP                               :{BLACK}Select the screenshot format to use
-
-STR_AUTOSAVE_1_MONTH                                            :Every month
-STR_AUTOSAVE_FAILED                                             :{WHITE}Autosave failed
-
-STR_MONTH_JAN                                                   :January
-STR_MONTH_FEB                                                   :February
-STR_MONTH_MAR                                                   :March
-STR_MONTH_APR                                                   :April
-STR_MONTH_MAY                                                   :May
-STR_MONTH_JUN                                                   :June
-STR_MONTH_JUL                                                   :July
-STR_MONTH_AUG                                                   :August
-STR_MONTH_SEP                                                   :September
-STR_MONTH_OCT                                                   :October
-STR_MONTH_NOV                                                   :November
-STR_MONTH_DEC                                                   :December
-
-STR_HEADING_FOR_STATION                                         :{LTBLUE}Heading for {STATION}
-STR_HEADING_FOR_STATION_VEL                                     :{LTBLUE}Heading for {STATION}, {VELOCITY}
-STR_NO_ORDERS                                                   :{LTBLUE}No orders
-STR_NO_ORDERS_VEL                                               :{LTBLUE}No orders, {VELOCITY}
-
-STR_PASSENGERS                                                  :passengers
-STR_BAGS                                                        :bags
-STR_TONS                                                        :tonnes
-STR_LITERS                                                      :liters
-STR_ITEMS                                                       :items
-STR_CRATES                                                      :crates
-STR_RES_OTHER                                                   :other
-STR_NOTHING                                                     :
-
-STR_SMALL_RIGHT_ARROW                                           :{TINYFONT}{RIGHTARROW}
-
-STR_CANT_SHARE_ORDER_LIST                                       :{WHITE}Can't share order list...
-STR_CANT_COPY_ORDER_LIST                                        :{WHITE}Can't copy order list...
-STR_END_OF_SHARED_ORDERS                                        :{SETX 10}- - End of Shared Orders - -
-
-STR_TRAIN_IS_LOST                                               :{WHITE}Train {COMMA} is lost.
-STR_TRAIN_IS_UNPROFITABLE                                       :{WHITE}Train {COMMA}'s profit last year was {CURRENCY}
-STR_EURO_INTRODUCE                                              :{BLACK}{BIGFONT}European Monetary Union!{}{}The Euro is introduced as the sole currency for everyday transactions in your country!
-
-# Start of order review system.
-# DON'T ADD OR REMOVE LINES HERE
-STR_TRAIN_HAS_TOO_FEW_ORDERS                                    :{WHITE}Train {COMMA} has too few orders in the schedule
-STR_TRAIN_HAS_VOID_ORDER                                        :{WHITE}Train {COMMA} has a void order
-STR_TRAIN_HAS_DUPLICATE_ENTRY                                   :{WHITE}Train {COMMA} has duplicate orders
-STR_TRAIN_HAS_INVALID_ENTRY                                     :{WHITE}Train {COMMA} has an invalid station in its orders
-STR_ROADVEHICLE_HAS_TOO_FEW_ORDERS                              :{WHITE}Road Vehicle {COMMA} has too few orders in the schedule
-STR_ROADVEHICLE_HAS_VOID_ORDER                                  :{WHITE}Road Vehicle {COMMA} has a void order
-STR_ROADVEHICLE_HAS_DUPLICATE_ENTRY                             :{WHITE}Road Vehicle {COMMA} has duplicate orders
-STR_ROADVEHICLE_HAS_INVALID_ENTRY                               :{WHITE}Road Vehicle {COMMA} has an invalid station in its orders
-STR_SHIP_HAS_TOO_FEW_ORDERS                                     :{WHITE}Ship {COMMA} has too few orders in the schedule
-STR_SHIP_HAS_VOID_ORDER                                         :{WHITE}Ship {COMMA} has a void order
-STR_SHIP_HAS_DUPLICATE_ENTRY                                    :{WHITE}Ship {COMMA} has duplicate orders
-STR_SHIP_HAS_INVALID_ENTRY                                      :{WHITE}Ship {COMMA} has an invalid station in its orders
-STR_AIRCRAFT_HAS_TOO_FEW_ORDERS                                 :{WHITE}Aircraft {COMMA} has too few orders in the schedule
-STR_AIRCRAFT_HAS_VOID_ORDER                                     :{WHITE}Aircraft {COMMA} has a void order
-STR_AIRCRAFT_HAS_DUPLICATE_ENTRY                                :{WHITE}Aircraft {COMMA} has duplicate orders
-STR_AIRCRAFT_HAS_INVALID_ENTRY                                  :{WHITE}Aircraft {COMMA} has an invalid station in its orders
-# end of order system
-
-STR_TRAIN_AUTORENEW_FAILED                                      :{WHITE}Autorenew failed on train {COMMA} (money limit)
-STR_ROADVEHICLE_AUTORENEW_FAILED                                :{WHITE}Autorenew failed on road vehicle {COMMA} (money limit)
-STR_SHIP_AUTORENEW_FAILED                                       :{WHITE}Autorenew failed on ship {COMMA} (money limit)
-STR_AIRCRAFT_AUTORENEW_FAILED                                   :{WHITE}Autorenew failed on aircraft {COMMA} (money limit)
-STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT                            :{WHITE}Train {COMMA} is too long after replacement
-
-STR_CONFIG_PATCHES                                              :{BLACK}Configure Patches
-STR_CONFIG_PATCHES_TIP                                          :{BLACK}Configure the patches
-STR_CONFIG_PATCHES_CAPTION                                      :{WHITE}Configure Patches
-
-STR_CONFIG_PATCHES_OFF                                          :Off
-STR_CONFIG_PATCHES_ON                                           :On
-STR_CONFIG_PATCHES_VEHICLESPEED                                 :{LTBLUE}Show vehicle speed in status bar: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_BUILDONSLOPES                                :{LTBLUE}Allow building on slopes and coasts: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AUTOSLOPE                                    :{LTBLUE}Allow terraforming under buildings, tracks, etc. (autoslope): {ORANGE}{STRING}
-STR_CONFIG_PATCHES_CATCHMENT                                    :{LTBLUE}Allow more realistically sized catchment areas: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_EXTRADYNAMITE                                :{LTBLUE}Allow removal of more town-owned roads, bridges, etc: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MAMMOTHTRAINS                                :{LTBLUE}Enable building very long trains: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_REALISTICACCEL                               :{LTBLUE}Enable realistic acceleration for trains: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_FORBID_90_DEG                                :{LTBLUE}Forbid trains and ships to make 90 deg turns: {ORANGE}{STRING} {LTBLUE} (requires NPF)
-STR_CONFIG_PATCHES_JOINSTATIONS                                 :{LTBLUE}Join train stations built next to each other: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_FULLLOADANY                                  :{LTBLUE}Leave station when any cargo is full, if 'full load': {ORANGE}{STRING}
-STR_CONFIG_PATCHES_IMPROVEDLOAD                                 :{LTBLUE}Use improved loading algorithm: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_GRADUAL_LOADING                              :{LTBLUE}Load vehicles gradually: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_INFLATION                                    :{LTBLUE}Inflation: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SELECTGOODS                                  :{LTBLUE}Deliver cargo to a station only when there is a demand: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LONGBRIDGES                                  :{LTBLUE}Allow building very long bridges: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_GOTODEPOT                                    :{LTBLUE}Allow goto depot orders: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD             :{LTBLUE}Manual primary industry construction method: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_NONE        :none
-STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL      :as other industries
-STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :prospecting
-STR_CONFIG_PATCHES_MULTIPINDTOWN                                :{LTBLUE}Allow multiple similar industries per town: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SAMEINDCLOSE                                 :{LTBLUE}Industries of the same type can be built close to each other: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LONGDATE                                     :{LTBLUE}Always show long date in the status bar: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SIGNALSIDE                                   :{LTBLUE}Show signals on the drive side: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SHOWFINANCES                                 :{LTBLUE}Show finances window at the end of the year: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_NEW_NONSTOP                                  :{LTBLUE}TTDPatch compatible nonstop handling: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ROADVEH_QUEUE                                :{LTBLUE}Road vehicle queueing (with quantum effects): {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AUTOSCROLL                                   :{LTBLUE}Pan window when mouse is at the edge: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_BRIBE                                        :{LTBLUE}Allow bribing of the local authority: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ALLOW_EXCLUSIVE                              :{LTBLUE}Allow buying exclusive transport rights: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ALLOW_GIVE_MONEY                             :{LTBLUE}Allow sending money to other companies: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_NONUNIFORM_STATIONS                          :{LTBLUE}Nonuniform stations: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_NEW_PATHFINDING_ALL                          :{LTBLUE}New global pathfinding (NPF, overrides NTP): {ORANGE}{STRING}
-STR_CONFIG_PATCHES_FREIGHT_TRAINS                               :{LTBLUE}Weight multiplier for freight to simulate heavy trains: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_STOP_ON_TOWN_ROAD                            :{LTBLUE}Allow drive-through road stops on town owned roads: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ADJACENT_STATIONS                            :{LTBLUE}Allow building adjacent stations: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_SMALL_AIRPORTS                               :{LTBLUE}Always allow small airports: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_WARN_LOST_TRAIN                              :{LTBLUE}Warn if train is lost: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ORDER_REVIEW                                 :{LTBLUE}Review vehicles' orders: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ORDER_REVIEW_OFF                             :no
-STR_CONFIG_PATCHES_ORDER_REVIEW_EXDEPOT                         :yes, but exclude stopped vehicles
-STR_CONFIG_PATCHES_ORDER_REVIEW_ON                              :of all vehicles
-STR_CONFIG_PATCHES_WARN_INCOME_LESS                             :{LTBLUE}Warn if a train's income is negative: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_NEVER_EXPIRE_VEHICLES                        :{LTBLUE}Vehicles never expire: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AUTORENEW_VEHICLE                            :{LTBLUE}Autorenew vehicle when it gets old
-STR_CONFIG_PATCHES_AUTORENEW_MONTHS                             :{LTBLUE}Autorenew when vehice is {ORANGE}{STRING}{LTBLUE} months before/after max age
-STR_CONFIG_PATCHES_AUTORENEW_MONEY                              :{LTBLUE}Autorenew minimum needed money for renew: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ERRMSG_DURATION                              :{LTBLUE}Duration of error message: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_POPULATION_IN_LABEL                          :{LTBLUE}Show town population in the town name label: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_INVISIBLE_TREES                              :{LTBLUE}Invisible trees (with transparent buildings): {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_LAND_GENERATOR                               :{LTBLUE}Land generator: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LAND_GENERATOR_ORIGINAL                      :Original
-STR_CONFIG_PATCHES_LAND_GENERATOR_TERRA_GENESIS                 :TerraGenesis
-STR_CONFIG_PATCHES_OIL_REF_EDGE_DISTANCE                        :{LTBLUE}Oil Refineries' max distance from edge of map {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SNOWLINE_HEIGHT                              :{LTBLUE}Snow line height: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN                         :{LTBLUE}Roughness of terrain (TerraGenesis only) : {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH             :Very Smooth
-STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_SMOOTH                  :Smooth
-STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_ROUGH                   :Rough
-STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_ROUGH              :Very Rough
-STR_CONFIG_PATCHES_TREE_PLACER                                  :{LTBLUE}Tree placer algorithm: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_TREE_PLACER_NONE                             :None
-STR_CONFIG_PATCHES_TREE_PLACER_ORIGINAL                         :Original
-STR_CONFIG_PATCHES_TREE_PLACER_IMPROVED                         :Improved
-STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION                           :{LTBLUE}Heightmap rotation: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_COUNTER_CLOCKWISE         :Anti-clockwise
-STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_CLOCKWISE                 :Clockwise
-STR_CONFIG_PATCHES_SE_FLAT_WORLD_HEIGHT                         :{LTBLUE}The height level a flat scenario map gets: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_STATION_SPREAD                               :{LTBLUE}Max station spread: {ORANGE}{STRING} {RED}Warning: High setting slows game
-STR_CONFIG_PATCHES_SERVICEATHELIPAD                             :{LTBLUE}Service helicopters at helipads automatically: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR                       :{LTBLUE}Link landscape toolbar to rail/road/water/airport toolbars: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_REVERSE_SCROLLING                            :{LTBLUE}Reverse scroll direction: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SMOOTH_SCROLLING                             :{LTBLUE}Smooth viewport scrolling: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MEASURE_TOOLTIP                              :{LTBLUE}Show a measurement tooltip when using various build-tools: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LIVERIES                                     :{LTBLUE}Show company liveries: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LIVERIES_NONE                                :None
-STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Own company
-STR_CONFIG_PATCHES_LIVERIES_ALL                                 :All companies
-STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Prefer team chat with <ENTER>: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Function of scrollwheel: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom map
-STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Scroll map
-STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Off
-STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Map scrollwheel speed: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU                          :{LTBLUE}Right-click emulation: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_COMMAND                  :Command-click
-STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_CONTROL                  :Control-click
-STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_OFF                      :Off
-
-STR_CONFIG_PATCHES_PAUSE_ON_NEW_GAME                            :{LTBLUE}Automatically pause when starting a new game: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS                       :{LTBLUE}Use the advanced vehicle list: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OFF                   :Off
-STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OWN                   :Own company
-STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_ALL                   :All companies
-STR_CONFIG_PATCHES_LOADING_INDICATORS                           :{LTBLUE}Use loading indicators: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LOADING_INDICATORS_OFF                       :Off
-STR_CONFIG_PATCHES_LOADING_INDICATORS_OWN                       :Own company
-STR_CONFIG_PATCHES_LOADING_INDICATORS_ALL                       :All companies
-STR_CONFIG_PATCHES_TIMETABLE_ALLOW                              :{LTBLUE}Enable timetabling for vehicles: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_TIMETABLE_IN_TICKS                           :{LTBLUE}Show timetable in ticks rather than days: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE                            :{LTBLUE}Default rail type (after new game/game load): {ORANGE}{STRING}
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_RAIL                       :Normal Rail
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_ELRAIL                     :Electrified Rail
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MONORAIL                   :Monorail
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MAGLEV                     :Maglev
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_FIRST                      :First available
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_LAST                       :Last available
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MOST_USED                  :Most used
-
-STR_CONFIG_PATCHES_ALWAYS_BUILD_INFRASTRUCTURE                  :{LTBLUE}Show building tools when no suitable vehicles are available: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Max trains per player: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Max road vehicles per player: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MAX_AIRCRAFT                                 :{LTBLUE}Max aircraft per player: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MAX_SHIPS                                    :{LTBLUE}Max ships per player: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_AI_BUILDS_TRAINS                             :{LTBLUE}Disable trains for computer: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AI_BUILDS_ROADVEH                            :{LTBLUE}Disable road vehicles for computer: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AI_BUILDS_AIRCRAFT                           :{LTBLUE}Disable aircraft for computer: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AI_BUILDS_SHIPS                              :{LTBLUE}Disable ships for computer: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_AINEW_ACTIVE                                 :{LTBLUE}Enable new AI (alpha): {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AI_IN_MULTIPLAYER                            :{LTBLUE}Allow AIs in multiplayer (experimental): {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_SERVINT_TRAINS                               :{LTBLUE}Default service interval for trains: {ORANGE}{STRING} days/%
-STR_CONFIG_PATCHES_SERVINT_TRAINS_DISABLED                      :{LTBLUE}Default service interval for trains: {ORANGE}disabled
-STR_CONFIG_PATCHES_SERVINT_ROADVEH                              :{LTBLUE}Default service interval for road vehicles: {ORANGE}{STRING} days/%
-STR_CONFIG_PATCHES_SERVINT_ROADVEH_DISABLED                     :{LTBLUE}Default service interval for road vehicles: {ORANGE}disabled
-STR_CONFIG_PATCHES_SERVINT_AIRCRAFT                             :{LTBLUE}Default service interval for aircraft: {ORANGE}{STRING} days/%
-STR_CONFIG_PATCHES_SERVINT_AIRCRAFT_DISABLED                    :{LTBLUE}Default service interval for aircraft: {ORANGE}disabled
-STR_CONFIG_PATCHES_SERVINT_SHIPS                                :{LTBLUE}Default service interval for ships: {ORANGE}{STRING} days/%
-STR_CONFIG_PATCHES_SERVINT_SHIPS_DISABLED                       :{LTBLUE}Default service interval for ships: {ORANGE}disabled
-STR_CONFIG_PATCHES_NOSERVICE                                    :{LTBLUE}Disable servicing when breakdowns set to none: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_WAGONSPEEDLIMITS                             :{LTBLUE}Enable railroad car speed limits: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_DISABLE_ELRAILS                              :{LTBLUE}Disable electric rails: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_COLORED_NEWS_YEAR                            :{LTBLUE}Colored news appears in: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_STARTING_YEAR                                :{LTBLUE}Starting date: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ENDING_YEAR                                  :{LTBLUE}End game in: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SMOOTH_ECONOMY                               :{LTBLUE}Enable smooth economy (more, smaller changes)
-STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Allow buying shares from other companies
-STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}When dragging place signals every: {ORANGE}{STRING} tile(s)
-STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Automatically build semaphores before: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}The town layout "no more roads" isn't valid in the scenario editor
-STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Select town-road layout: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_TOWN_LAYOUT_NO_ROADS                         :no more roads
-STR_CONFIG_PATCHES_TOWN_LAYOUT_DEFAULT                          :default
-STR_CONFIG_PATCHES_TOWN_LAYOUT_BETTER_ROADS                     :better roads
-STR_CONFIG_PATCHES_TOWN_LAYOUT_2X2_GRID                         :2x2 grid
-STR_CONFIG_PATCHES_TOWN_LAYOUT_3X3_GRID                         :3x3 grid
-
-STR_CONFIG_PATCHES_TOOLBAR_POS                                  :{LTBLUE}Position of main toolbar: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT                             :Left
-STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER                           :Centre
-STR_CONFIG_PATCHES_TOOLBAR_POS_RIGHT                            :Right
-STR_CONFIG_PATCHES_SNAP_RADIUS                                  :{LTBLUE}Window snap radius: {ORANGE}{STRING} px
-STR_CONFIG_PATCHES_SNAP_RADIUS_DISABLED                         :{LTBLUE}Window snap radius: {ORANGE}disabled
-STR_CONFIG_PATCHES_TOWN_GROWTH                                  :{LTBLUE}Town growth speed: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_TOWN_GROWTH_NONE                             :None
-STR_CONFIG_PATCHES_TOWN_GROWTH_SLOW                             :Slow
-STR_CONFIG_PATCHES_TOWN_GROWTH_NORMAL                           :Normal
-STR_CONFIG_PATCHES_TOWN_GROWTH_FAST                             :Fast
-STR_CONFIG_PATCHES_TOWN_GROWTH_VERY_FAST                        :Very fast
-STR_CONFIG_PATCHES_LARGER_TOWNS                                 :{LTBLUE}Proportion of towns that will grow twice as fast: {ORANGE}1 in {STRING}
-STR_CONFIG_PATCHES_LARGER_TOWNS_DISABLED                        :{LTBLUE}Proportion of towns that will grow twice as fast: {ORANGE}None
-STR_CONFIG_PATCHES_CITY_SIZE_MULTIPLIER                         :{LTBLUE}Initial city size multiplier: {ORANGE}{STRING}
-STR_CONFIG_MODIFIED_ROAD_REBUILD                                :{LTBLUE}Remove absurd road-elements during the road construction
-
-STR_CONFIG_PATCHES_GUI                                          :{BLACK}Interface
-STR_CONFIG_PATCHES_CONSTRUCTION                                 :{BLACK}Construction
-STR_CONFIG_PATCHES_VEHICLES                                     :{BLACK}Vehicles
-STR_CONFIG_PATCHES_STATIONS                                     :{BLACK}Stations
-STR_CONFIG_PATCHES_ECONOMY                                      :{BLACK}Economy
-STR_CONFIG_PATCHES_AI                                           :{BLACK}Competitors
-
-STR_CONFIG_PATCHES_DISABLED                                     :disabled
-STR_CONFIG_PATCHES_INT32                                        :{NUM}
-STR_CONFIG_PATCHES_CURRENCY                                     :{CURRENCY}
-
-STR_CONFIG_PATCHES_QUERY_CAPT                                   :{WHITE}Change setting value
-STR_CONFIG_PATCHES_SERVICE_INTERVAL_INCOMPATIBLE                :{WHITE}Some or all of the default service interval(s) below are incompatible with chosen setting! 5-90% and 30-800 days are valid
-STR_CONFIG_PATCHES_YAPF_SHIPS                                   :{LTBLUE}Use YAPF for ships: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_YAPF_ROAD                                    :{LTBLUE}Use YAPF for roadvehs: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_YAPF_RAIL                                    :{LTBLUE}Use YAPF for trains: {ORANGE}{STRING}
-
-STR_TEMPERATE_LANDSCAPE                                         :Temperate landscape
-STR_SUB_ARCTIC_LANDSCAPE                                        :Sub-arctic landscape
-STR_SUB_TROPICAL_LANDSCAPE                                      :Sub-tropical landscape
-STR_TOYLAND_LANDSCAPE                                           :Toyland landscape
-
-STR_CHEATS                                                      :{WHITE}Cheats
-STR_CHEATS_TIP                                                  :{BLACK}Checkboxes indicate if you have used this cheat before
-STR_CHEATS_WARNING                                              :{BLACK}Warning! You are about to betray your fellow competitors. Keep in mind that such a disgrace will be remembered for eternity.
-STR_CHEAT_MONEY                                                 :{LTBLUE}Increase money by {CURRENCY}
-STR_CHEAT_CHANGE_PLAYER                                         :{LTBLUE}Playing as player: {ORANGE}{COMMA}
-STR_CHEAT_EXTRA_DYNAMITE                                        :{LTBLUE}Magic bulldozer (remove industries, unmovables): {ORANGE}{STRING}
-STR_CHEAT_CROSSINGTUNNELS                                       :{LTBLUE}Tunnels may cross each other: {ORANGE}{STRING}
-STR_CHEAT_BUILD_IN_PAUSE                                        :{LTBLUE}Build while in pause mode: {ORANGE}{STRING}
-STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Jetplanes will not crash (frequently) on small airports: {ORANGE} {STRING}
-STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Switch climate: {ORANGE} {STRING}
-STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Change date: {ORANGE} {DATE_SHORT}
-STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Enable modifying production values: {ORANGE}{STRING}
-
-STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Heading for {WAYPOINT}
-STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Heading for {WAYPOINT}, {VELOCITY}
-
-STR_GO_TO_WAYPOINT                                              :Go via {WAYPOINT}
-STR_GO_NON_STOP_TO_WAYPOINT                                     :Go non-stop via {WAYPOINT}
-
-STR_WAYPOINTNAME_CITY                                           :Waypoint {TOWN}
-STR_WAYPOINTNAME_CITY_SERIAL                                    :Waypoint {TOWN} #{COMMA}
-STR_LANDINFO_WAYPOINT                                           :Waypoint
-
-STR_WAYPOINT                                                    :{WHITE}Waypoint
-STR_WAYPOINT_GRAPHICS_TIP                                       :{BLACK}Select waypoint type
-
-STR_WAYPOINT_VIEWPORT                                           :{WHITE}{WAYPOINT}
-STR_WAYPOINT_VIEWPORT_TINY                                      :{TINYFONT}{WHITE}{WAYPOINT}
-STR_WAYPOINT_RAW                                                :{WAYPOINT}
-STR_EDIT_WAYPOINT_NAME                                          :{WHITE}Edit waypoint name
-
-STR_CANT_CHANGE_WAYPOINT_NAME                                   :{WHITE}Can't change waypoint name...
-STR_CONVERT_RAIL_TO_WAYPOINT_TIP                                :{BLACK}Convert rail to waypoint
-STR_CANT_BUILD_TRAIN_WAYPOINT                                   :{WHITE}Can't build train waypoint here...
-STR_CANT_REMOVE_TRAIN_WAYPOINT                                  :{WHITE}Can't remove train waypoint here...
-
-STR_BUILD_AUTORAIL_TIP                                          :{BLACK}Build railroad track using the Autorail mode
-
-STR_NO_TOWN_IN_SCENARIO                                         :{WHITE}...there is no town in this scenario
-
-STR_GENERATE_RANDOM_LANDSCAPE                                   :{WHITE}Are you sure you want to create a random landscape?
-STR_MANY_RANDOM_TOWNS                                           :{BLACK}Many random towns
-STR_RANDOM_TOWNS_TIP                                            :{BLACK}Cover the map with randomly placed towns
-STR_MANY_RANDOM_INDUSTRIES                                      :Many random industries
-STR_RANDOM_INDUSTRIES_TIP                                       :{BLACK}Cover the map with randomly placed industries
-STR_CAN_T_GENERATE_INDUSTRIES                                   :{WHITE}Can't generate industries...
-
-STR_LANDSCAPING_TOOLBAR_TIP                                     :{BLACK}Open the landscaping toolbar to raise/lower land, plant trees, etc.
-STR_LANDSCAPING_TOOLBAR                                         :{WHITE}Landscaping
-STR_LEVEL_LAND_TOOLTIP                                          :{BLACK}Level land
-
-
-STR_TREES_RANDOM_TYPE                                           :{BLACK}Trees of random type
-STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Place trees of random type
-
-STR_CANT_BUILD_CANALS                                           :{WHITE}Can't build canals here...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Build canals.
-STR_LANDINFO_CANAL                                              :Canal
-
-STR_CANT_BUILD_LOCKS                                            :{WHITE}Can't build locks here...
-STR_BUILD_LOCKS_TIP                                             :{BLACK}Build locks
-STR_LANDINFO_LOCK                                               :Lock
-
-STR_BUOY_IS_IN_USE                                              :{WHITE}... buoy is in use!
-
-STR_LANDINFO_COORDS                                             :{BLACK}Co-ordinates: {LTBLUE}{NUM}x{NUM}x{NUM} ({STRING})
-
-STR_CANT_REMOVE_PART_OF_STATION                                 :{WHITE}Can't remove part of station...
-STR_CANT_CONVERT_RAIL                                           :{WHITE}Can't convert railtype here...
-STR_CONVERT_RAIL_TIP                                            :{BLACK}Convert/Upgrade the type of the rail
-
-STR_DRAG_WHOLE_TRAIN_TO_SELL_TIP                                :{BLACK}Drag train engine here to sell the whole train
-
-STR_DRAG_DROP                                                   :{BLACK}Drag & Drop
-STR_STATION_DRAG_DROP                                           :{BLACK}Build a station with drag & drop
-STR_SELECT_STATION_CLASS_TIP                                    :{BLACK}Select a station class to display
-STR_SELECT_STATION_TYPE_TIP                                     :{BLACK}Select the station type to build
-
-STR_FAST_FORWARD                                                :{BLACK}Fast forward the game
-STR_MESSAGE_HISTORY                                             :{WHITE}Message History
-STR_MESSAGE_HISTORY_TIP                                         :{BLACK}A list of the recent news messages
-STR_MESSAGES_DISABLE_ALL                                        :{BLACK}Disable all
-STR_MESSAGES_ENABLE_ALL                                         :{BLACK}Enable all
-
-STR_CONSTRUCT_COAL_MINE_TIP                                     :{BLACK}Construct Coal Mine
-STR_CONSTRUCT_FOREST_TIP                                        :{BLACK}Plant Forest
-STR_CONSTRUCT_OIL_RIG_TIP                                       :{BLACK}Construct Oil Rig
-STR_CONSTRUCT_FARM_TIP                                          :{BLACK}Fund Farm
-STR_CONSTRUCT_COPPER_ORE_MINE_TIP                               :{BLACK}Construct Copper Ore Mine
-STR_CONSTRUCT_OIL_WELLS_TIP                                     :{BLACK}Drill for Oil
-STR_CONSTRUCT_GOLD_MINE_TIP                                     :{BLACK}Construct Gold Mine
-STR_CONSTRUCT_DIAMOND_MINE_TIP                                  :{BLACK}Construct Diamond Mine
-STR_CONSTRUCT_IRON_ORE_MINE_TIP                                 :{BLACK}Construct Iron Ore Mine
-STR_CONSTRUCT_FRUIT_PLANTATION_TIP                              :{BLACK}Fund Fruit Plantation
-STR_CONSTRUCT_RUBBER_PLANTATION_TIP                             :{BLACK}Fund Rubber Plantation
-STR_CONSTRUCT_WATER_SUPPLY_TIP                                  :{BLACK}Fund Water Supply
-STR_CONSTRUCT_COTTON_CANDY_TIP                                  :{BLACK}Plant Cotton Candy Forest
-STR_CONSTRUCT_BATTERY_FARM_TIP                                  :{BLACK}Fund Battery Farm
-STR_CONSTRUCT_COLA_WELLS_TIP                                    :{BLACK}Drill for Cola
-STR_CONSTRUCT_PLASTIC_FOUNTAINS_TIP                             :{BLACK}Fund Plastic Fountains
-STR_CONSTRUCT_BUBBLE_GENERATOR_TIP                              :{BLACK}Construct Bubble Generator
-STR_CONSTRUCT_TOFFEE_QUARRY_TIP                                 :{BLACK}Fund Toffee Quarry
-STR_CONSTRUCT_SUGAR_MINE_TIP                                    :{BLACK}Construct Sugar Mine
-
-STR_INDUSTRYDIR_CAPTION                                         :{WHITE}Industries
-STR_INDUSTRYDIR_ITEM                                            :{ORANGE}{INDUSTRY}{BLACK} ({CARGO}){YELLOW} ({COMMA}% transported)
-STR_INDUSTRYDIR_ITEM_TWO                                        :{ORANGE}{INDUSTRY}{BLACK} ({CARGO}/{CARGO}){YELLOW} ({COMMA}%/{COMMA}% transported)
-STR_INDUSTRYDIR_ITEM_NOPROD                                     :{ORANGE}{INDUSTRY}
-
-STR_INDUSTRY_TOO_CLOSE                                          :{WHITE}...too close to another industry
-
-STR_RAIL_REFIT_VEHICLE_TO_CARRY                                 :{BLACK}Refit train to carry a different cargo type
-STR_RAIL_REFIT_VEHICLE                                          :{BLACK}Refit train
-STR_RAIL_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Select type of cargo for train to carry
-STR_RAIL_REFIT_TO_CARRY_HIGHLIGHTED                             :{BLACK}Refit train to carry highlighted cargo type
-STR_RAIL_CAN_T_REFIT_VEHICLE                                    :{WHITE}Can't refit train...
-STR_CONFIG_PATCHES_SERVINT_ISPERCENT                            :{LTBLUE}Service intervals are in percents: {ORANGE}{STRING}
-STR_CONFIG_GAME_PRODUCTION                                      :{WHITE}Change production
-
-TEMP_AI_IN_PROGRESS                                             :{WHITE}Welcome to the new AI under development. If you encounter problems, take a screenshot and post it in the forum.
-TEMP_AI_ACTIVATED                                               :{WHITE}Warning: this new AI is still alpha! Currently, only trucks and busses work!
-TEMP_AI_MULTIPLAYER                                             :{WHITE}Warning: implementation is still experimental (using new AI). Please report any problems to truelight@openttd.org.
-
-############ network gui strings
-
-STR_NETWORK_MULTIPLAYER                                         :{WHITE}Multiplayer
-
-STR_NETWORK_PLAYER_NAME                                         :{BLACK}Player name:
-STR_NETWORK_ENTER_NAME_TIP                                      :{BLACK}This is the name other players will identify you by
-STR_NETWORK_CONNECTION                                          :{BLACK}Connection:
-STR_NETWORK_CONNECTION_TIP                                      :{BLACK}Choose between an internet game or a local area nework game
-
-STR_NETWORK_START_SERVER                                        :{BLACK}Start server
-STR_NETWORK_START_SERVER_TIP                                    :{BLACK}Start an own server
-
-STR_NETWORK_GAME_NAME                                           :{BLACK}Name
-STR_NETWORK_GAME_NAME_TIP                                       :{BLACK}Name of the game
-STR_NETWORK_INFO_ICONS_TIP                                      :{BLACK}Language, server version, etc.
-STR_NETWORK_CLICK_GAME_TO_SELECT                                :{BLACK}Click a game from the list to select it
-
-STR_NETWORK_FIND_SERVER                                         :{BLACK}Find server
-STR_NETWORK_FIND_SERVER_TIP                                     :{BLACK}Search network for a server
-STR_NETWORK_ADD_SERVER                                          :{BLACK}Add server
-STR_NETWORK_ADD_SERVER_TIP                                      :{BLACK}Adds a server to the list which will always be checked for running games.
-STR_NETWORK_ENTER_IP                                            :{BLACK}Enter the IP address of the server
-
-STR_NETWORK_GENERAL_ONLINE                                      :{BLACK}{COMMA}/{COMMA} - {COMMA}/{COMMA}
-STR_NETWORK_CLIENTS_CAPTION                                     :{BLACK}Clients
-STR_NETWORK_CLIENTS_CAPTION_TIP                                 :{BLACK}Clients online / clients max
-STR_NETWORK_GAME_INFO                                           :{SILVER}GAME INFO
-STR_ORANGE                                                      :{ORANGE}{STRING}
-STR_NETWORK_CLIENTS                                             :{SILVER}Clients:  {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA}
-STR_NETWORK_LANGUAGE                                            :{SILVER}Language:  {WHITE}{STRING}
-STR_NETWORK_TILESET                                             :{SILVER}Tileset:  {WHITE}{STRING}
-STR_NETWORK_MAP_SIZE                                            :{SILVER}Map size:  {WHITE}{COMMA}x{COMMA}
-STR_NETWORK_SERVER_VERSION                                      :{SILVER}Server version:  {WHITE}{STRING}
-STR_NETWORK_SERVER_ADDRESS                                      :{SILVER}Server address:  {WHITE}{STRING} : {NUM}
-STR_NETWORK_START_DATE                                          :{SILVER}Start date:  {WHITE}{DATE_SHORT}
-STR_NETWORK_CURRENT_DATE                                        :{SILVER}Current date:  {WHITE}{DATE_SHORT}
-STR_NETWORK_PASSWORD                                            :{SILVER}Password protected!
-STR_NETWORK_SERVER_OFFLINE                                      :{SILVER}SERVER OFFLINE
-STR_NETWORK_SERVER_FULL                                         :{SILVER}SERVER FULL
-STR_NETWORK_VERSION_MISMATCH                                    :{SILVER}VERSION MISMATCH
-STR_NETWORK_GRF_MISMATCH                                        :{SILVER}NEWGRF MISMATCH
-
-STR_NETWORK_JOIN_GAME                                           :{BLACK}Join game
-
-
-STR_NETWORK_START_GAME_WINDOW                                   :{WHITE}Start new game
-
-STR_NETWORK_NEW_GAME_NAME                                       :{BLACK}Game name:
-STR_NETWORK_NEW_GAME_NAME_TIP                                   :{BLACK}The game name will be displayed to other players in the multiplayer game selection menu
-STR_NETWORK_SET_PASSWORD                                        :{BLACK}Set password
-STR_NETWORK_PASSWORD_TIP                                        :{BLACK}Protect your game with a password if you don't want other people to join it
-STR_NETWORK_SELECT_MAP                                          :{BLACK}Select a map:
-STR_NETWORK_SELECT_MAP_TIP                                      :{BLACK}Which map do you want to play?
-STR_NETWORK_LAN_INTERNET_COMBO                                  :{BLACK}{SKIP}{STRING}
-STR_NETWORK_LAN                                                 :LAN
-STR_NETWORK_INTERNET                                            :Internet
-STR_NETWORK_LAN_INTERNET                                        :LAN / Internet
-STR_NETWORK_INTERNET_ADVERTISE                                  :Internet (advertize)
-STR_NETWORK_CLIENTS_SELECT                                      :{BLACK}{SKIP}{SKIP}{NUM} client{P "" s}
-STR_NETWORK_NUMBER_OF_CLIENTS                                   :{BLACK}Maximum allowed clients:
-STR_NETWORK_NUMBER_OF_CLIENTS_TIP                               :{BLACK}Choose a maximum number of clients. Not all slots need to be filled.
-STR_NETWORK_COMPANIES_SELECT                                    :{BLACK}{SKIP}{SKIP}{SKIP}{NUM} compan{P y ies}
-STR_NETWORK_NUMBER_OF_COMPANIES                                 :{BLACK}Max companies:
-STR_NETWORK_NUMBER_OF_COMPANIES_TIP                             :{BLACK}Limit the server to a certain number of companies
-STR_NETWORK_SPECTATORS_SELECT                                   :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{NUM} spectator{P "" s}
-STR_NETWORK_NUMBER_OF_SPECTATORS                                :{BLACK}Max spectators:
-STR_NETWORK_NUMBER_OF_SPECTATORS_TIP                            :{BLACK}Limit the server to a certain number of spectators
-STR_NETWORK_LANGUAGE_SPOKEN                                     :{BLACK}Language spoken:
-STR_NETWORK_LANGUAGE_TIP                                        :{BLACK}Other players will know which language is spoken on the server.
-STR_NETWORK_LANGUAGE_COMBO                                      :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
-STR_NETWORK_START_GAME                                          :{BLACK}Start Game
-STR_NETWORK_START_GAME_TIP                                      :{BLACK}Start a new network game from a random map, or scenario
-STR_NETWORK_LOAD_GAME                                           :{BLACK}Load Game
-STR_NETWORK_LOAD_GAME_TIP                                       :{BLACK}Resume an earlier saved multiplayer game (be sure to connect as the correct player)
-
-############ Leave those lines in this order!!
-STR_NETWORK_LANG_ANY                                            :Any
-STR_NETWORK_LANG_ENGLISH                                        :English
-STR_NETWORK_LANG_GERMAN                                         :German
-STR_NETWORK_LANG_FRENCH                                         :French
-STR_NETWORK_LANG_BRAZILIAN                                      :Brazilian
-STR_NETWORK_LANG_BULGARIAN                                      :Bulgarian
-STR_NETWORK_LANG_CHINESE                                        :Chinese
-STR_NETWORK_LANG_CZECH                                          :Czech
-STR_NETWORK_LANG_DANISH                                         :Danish
-STR_NETWORK_LANG_DUTCH                                          :Dutch
-STR_NETWORK_LANG_ESPERANTO                                      :Esperanto
-STR_NETWORK_LANG_FINNISH                                        :Finnish
-STR_NETWORK_LANG_HUNGARIAN                                      :Hungarian
-STR_NETWORK_LANG_ICELANDIC                                      :Icelandic
-STR_NETWORK_LANG_ITALIAN                                        :Italian
-STR_NETWORK_LANG_JAPANESE                                       :Japanese
-STR_NETWORK_LANG_KOREAN                                         :Korean
-STR_NETWORK_LANG_LITHUANIAN                                     :Lithuanian
-STR_NETWORK_LANG_NORWEGIAN                                      :Norwegian
-STR_NETWORK_LANG_POLISH                                         :Polish
-STR_NETWORK_LANG_PORTUGUESE                                     :Portuguese
-STR_NETWORK_LANG_ROMANIAN                                       :Romanian
-STR_NETWORK_LANG_RUSSIAN                                        :Russian
-STR_NETWORK_LANG_SLOVAK                                         :Slovak
-STR_NETWORK_LANG_SLOVENIAN                                      :Slovenian
-STR_NETWORK_LANG_SPANISH                                        :Spanish
-STR_NETWORK_LANG_SWEDISH                                        :Swedish
-STR_NETWORK_LANG_TURKISH                                        :Turkish
-STR_NETWORK_LANG_UKRAINIAN                                      :Ukrainian
-############ End of leave-in-this-order
-
-STR_NETWORK_GAME_LOBBY                                          :{WHITE}Multiplayer game lobby
-
-STR_NETWORK_PREPARE_TO_JOIN                                     :{BLACK}Preparing to join:   {ORANGE}{STRING}
-STR_NETWORK_COMPANY_LIST_TIP                                    :{BLACK}A list of all companies currently in this game. You can either join one or start a
-STR_NETWORK_NEW_COMPANY                                         :{BLACK}New company
-STR_NETWORK_NEW_COMPANY_TIP                                     :{BLACK}Open a new company
-STR_NETWORK_SPECTATE_GAME                                       :{BLACK}Watch game
-STR_NETWORK_SPECTATE_GAME_TIP                                   :{BLACK}Watch the game as a spectator
-STR_NETWORK_JOIN_COMPANY                                        :{BLACK}Join company
-STR_NETWORK_JOIN_COMPANY_TIP                                    :{BLACK}Help managing this company
-STR_NETWORK_REFRESH                                             :{BLACK}Refresh server
-STR_NETWORK_REFRESH_TIP                                         :{BLACK}Refresh the server info
-
-STR_NETWORK_COMPANY_INFO                                        :{SILVER}COMPANY INFO
-
-STR_NETWORK_COMPANY_NAME                                        :{SILVER}Company name:  {WHITE}{STRING}
-STR_NETWORK_INAUGURATION_YEAR                                   :{SILVER}Inauguration:  {WHITE}{NUM}
-STR_NETWORK_VALUE                                               :{SILVER}Company value:  {WHITE}{CURRENCY}
-STR_NETWORK_CURRENT_BALANCE                                     :{SILVER}Current balance:  {WHITE}{CURRENCY}
-STR_NETWORK_LAST_YEARS_INCOME                                   :{SILVER}Last year's income:  {WHITE}{CURRENCY}
-STR_NETWORK_PERFORMANCE                                         :{SILVER}Performance:  {WHITE}{NUM}
-
-STR_NETWORK_VEHICLES                                            :{SILVER}Vehicles:  {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP}
-STR_NETWORK_STATIONS                                            :{SILVER}Stations:  {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP}
-STR_NETWORK_PLAYERS                                             :{SILVER}Players:  {WHITE}{STRING}
-
-STR_NETWORK_CONNECTING                                          :{WHITE}Connecting...
-
-############ Leave those lines in this order!!
-STR_NETWORK_CONNECTING_1                                        :{BLACK}(1/6) Connecting..
-STR_NETWORK_CONNECTING_2                                        :{BLACK}(2/6) Authorizing..
-STR_NETWORK_CONNECTING_3                                        :{BLACK}(3/6) Waiting..
-STR_NETWORK_CONNECTING_4                                        :{BLACK}(4/6) Downloading map..
-STR_NETWORK_CONNECTING_5                                        :{BLACK}(5/6) Processing data..
-STR_NETWORK_CONNECTING_6                                        :{BLACK}(6/6) Registering..
-
-STR_NETWORK_CONNECTING_SPECIAL_1                                :{BLACK}Fetching game info..
-STR_NETWORK_CONNECTING_SPECIAL_2                                :{BLACK}Fetching company info..
-############ End of leave-in-this-order
-STR_NETWORK_CONNECTING_WAITING                                  :{BLACK}{NUM} client{P "" s} in front of us
-STR_NETWORK_CONNECTING_DOWNLOADING                              :{BLACK}{NUM} / {NUM} kbytes downloaded so far
-
-STR_NETWORK_DISCONNECT                                          :{BLACK}Disconnect
-
-STR_NETWORK_GIVE_MONEY_CAPTION                                  :{WHITE}Enter the amount of money you want to give
-STR_NETWORK_NEED_GAME_PASSWORD_CAPTION                          :{WHITE}Server is protected. Enter password
-STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION                       :{WHITE}Company is protected. Enter password
-STR_NETWORK_CLIENT_LIST                                         :{WHITE}Client List
-
-STR_NETWORK_ERR_NOTAVAILABLE                                    :{WHITE} No network devices found or compiled without ENABLE_NETWORK
-STR_NETWORK_ERR_NOSERVER                                        :{WHITE} Could not find any network games
-STR_NETWORK_ERR_NOCONNECTION                                    :{WHITE} The server didn't answer the request
-STR_NETWORK_ERR_NEWGRF_MISMATCH                                 :{WHITE} Could not connect due to NewGRF mismatch
-STR_NETWORK_ERR_DESYNC                                          :{WHITE} Network-Game synchronization failed.
-STR_NETWORK_ERR_LOSTCONNECTION                                  :{WHITE} Network-Game connection lost.
-STR_NETWORK_ERR_SAVEGAMEERROR                                   :{WHITE} Could not load server-savegame.
-STR_NETWORK_ERR_SERVER_START                                    :{WHITE} Could not start the server.
-STR_NETWORK_ERR_CLIENT_START                                    :{WHITE} Could not connect.
-STR_NETWORK_ERR_TIMEOUT                                         :{WHITE} Connection #{NUM} timed out.
-STR_NETWORK_ERR_SERVER_ERROR                                    :{WHITE} We made a protocol-error and our connection is closed.
-STR_NETWORK_ERR_WRONG_REVISION                                  :{WHITE} The revision of this client does not match the revision of the server.
-STR_NETWORK_ERR_WRONG_PASSWORD                                  :{WHITE} Wrong password.
-STR_NETWORK_ERR_SERVER_FULL                                     :{WHITE} The server is full
-STR_NETWORK_ERR_SERVER_BANNED                                   :{WHITE} You are banned from this server
-STR_NETWORK_ERR_KICKED                                          :{WHITE} You are kicked out of the server
-STR_NETWORK_ERR_CHEATER                                         :{WHITE} Cheating is not allowed on this server
-
-STR_NETWORK_ERR_LEFT                                            :has left the game
-############ Leave those lines in this order!!
-STR_NETWORK_ERR_CLIENT_GENERAL                                  :general error
-STR_NETWORK_ERR_CLIENT_DESYNC                                   :desync error
-STR_NETWORK_ERR_CLIENT_SAVEGAME                                 :could not load map
-STR_NETWORK_ERR_CLIENT_CONNECTION_LOST                          :connection lost
-STR_NETWORK_ERR_CLIENT_PROTOCOL_ERROR                           :protocol error
-STR_NETWORK_ERR_CLIENT_NEWGRF_MISMATCH                          :NewGRF mismatch
-STR_NETWORK_ERR_CLIENT_NOT_AUTHORIZED                           :not authorized
-STR_NETWORK_ERR_CLIENT_NOT_EXPECTED                             :received strange packet
-STR_NETWORK_ERR_CLIENT_WRONG_REVISION                           :wrong revision
-STR_NETWORK_ERR_CLIENT_NAME_IN_USE                              :name already in use
-STR_NETWORK_ERR_CLIENT_WRONG_PASSWORD                           :wrong game-password
-STR_NETWORK_ERR_CLIENT_PLAYER_MISMATCH                          :wrong player-id in DoCommand
-STR_NETWORK_ERR_CLIENT_KICKED                                   :kicked by server
-STR_NETWORK_ERR_CLIENT_CHEATER                                  :was trying to use a cheat
-STR_NETWORK_ERR_CLIENT_SERVER_FULL                              :server full
-############ End of leave-in-this-order
-STR_NETWORK_CLIENT_JOINED                                       :has joined the game
-STR_NETWORK_GIVE_MONEY                                          :gave you some money ({CURRENCY})
-STR_NETWORK_GAVE_MONEY_AWAY                                     :you gave {STRING} some money ({CURRENCY})
-STR_NETWORK_CHAT_COMPANY_CAPTION                                :[Team] :
-STR_NETWORK_CHAT_COMPANY                                        :[Team] {STRING}: {GRAY}{STRING}
-STR_NETWORK_CHAT_TO_COMPANY                                     :[Team] To {STRING}: {GRAY}{STRING}
-STR_NETWORK_CHAT_CLIENT_CAPTION                                 :[Private] :
-STR_NETWORK_CHAT_CLIENT                                         :[Private] {STRING}: {GRAY}{STRING}
-STR_NETWORK_CHAT_TO_CLIENT                                      :[Private] To {STRING}: {GRAY}{STRING}
-STR_NETWORK_CHAT_ALL_CAPTION                                    :[All] :
-STR_NETWORK_CHAT_ALL                                            :[All] {STRING}: {GRAY}{STRING}
-STR_NETWORK_NAME_CHANGE                                         :has changed his name to
-STR_NETWORK_SERVER_SHUTDOWN                                     :{WHITE} The server closed the session
-STR_NETWORK_SERVER_REBOOT                                       :{WHITE} The server is restarting...{}Please wait...
-
-STR_NETWORK_SERVER                                              :Server
-STR_NETWORK_CLIENT                                              :Client
-STR_NETWORK_SPECTATORS                                          :Spectators
-
-STR_NETWORK_CLIENTLIST_NONE                                     :(none)
-STR_NETWORK_CLIENTLIST_KICK                                     :Kick
-STR_NETWORK_CLIENTLIST_GIVE_MONEY                               :Give money
-STR_NETWORK_CLIENTLIST_SPEAK_TO_ALL                             :Speak to all
-STR_NETWORK_CLIENTLIST_SPEAK_TO_COMPANY                         :Speak to company
-STR_NETWORK_CLIENTLIST_SPEAK_TO_CLIENT                          :Private message
-
-
-STR_NETWORK_SEND                                                :{BLACK}Send
-
-############ end network gui strings
-
-
-STR_CONFIG_PATCHES_MAP_X                                        :{LTBLUE}X-size of map: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MAP_Y                                        :{LTBLUE}Y-size of map: {ORANGE}{STRING}
-
-
-##### PNG-MAP-Loader
-
-STR_PNGMAP_ERROR                                                :{WHITE}Cannot load landscape from PNG...
-STR_PNGMAP_ERR_FILE_NOT_FOUND                                   :{WHITE}...file not found.
-STR_PNGMAP_ERR_IMAGE_TYPE                                       :{WHITE}...could not convert image type. 8 or 24-bit PNG image needed.
-STR_PNGMAP_ERR_MISC                                             :{WHITE}...something just went wrong. Sorry. (probably corrupted file)
-
-STR_BMPMAP_ERROR                                                :{WHITE}Cannot load landscape from BMP...
-STR_BMPMAP_ERR_IMAGE_TYPE                                       :{WHITE}...could not convert image type.
-
-##id 0x0800
-STR_0800_COST                                                   :{TINYFONT}{RED}Cost: {CURRENCY}
-STR_0801_COST                                                   :{RED}Cost: {CURRENCY}
-STR_0802_INCOME                                                 :{TINYFONT}{GREEN}Income: {CURRENCY}
-STR_0803_INCOME                                                 :{GREEN}Income: {CURRENCY}
-STR_FEEDER_TINY                                                 :{TINYFONT}{YELLOW}Transfer: {CURRENCY}
-STR_FEEDER                                                      :{YELLOW}Transfer: {CURRENCY}
-STR_0805_ESTIMATED_COST                                         :{WHITE}Estimated Cost: {CURRENCY}
-STR_0807_ESTIMATED_INCOME                                       :{WHITE}Estimated Income: {CURRENCY}
-STR_0808_CAN_T_RAISE_LAND_HERE                                  :{WHITE}Can't raise land here...
-STR_0809_CAN_T_LOWER_LAND_HERE                                  :{WHITE}Can't lower land here...
-STR_080A_ROCKS                                                  :Rocks
-STR_080B_ROUGH_LAND                                             :Rough land
-STR_080C_BARE_LAND                                              :Bare land
-STR_080D_GRASS                                                  :Grass
-STR_080E_FIELDS                                                 :Fields
-STR_080F_SNOW_COVERED_LAND                                      :Snow-covered land
-STR_0810_DESERT                                                 :Desert
-
-##id 0x1000
-STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION                         :{WHITE}Land sloped in wrong direction
-STR_1001_IMPOSSIBLE_TRACK_COMBINATION                           :{WHITE}Impossible track combination
-STR_1002_EXCAVATION_WOULD_DAMAGE                                :{WHITE}Excavation would damage tunnel
-STR_1003_ALREADY_AT_SEA_LEVEL                                   :{WHITE}Already at sea-level
-STR_1004_TOO_HIGH                                               :{WHITE}Too high
-STR_1005_NO_SUITABLE_RAILROAD_TRACK                             :{WHITE}No suitable railroad track
-STR_1007_ALREADY_BUILT                                          :{WHITE}...already built
-STR_1008_MUST_REMOVE_RAILROAD_TRACK                             :{WHITE}Must remove railroad track first
-STR_100A_RAILROAD_CONSTRUCTION                                  :{WHITE}Railroad Construction
-STR_TITLE_ELRAIL_CONSTRUCTION                                   :{WHITE}Electrified Railroad Construction
-STR_100B_MONORAIL_CONSTRUCTION                                  :{WHITE}Monorail Construction
-STR_100C_MAGLEV_CONSTRUCTION                                    :{WHITE}MagLev Construction
-STR_100D_SELECT_RAIL_BRIDGE                                     :{WHITE}Select Rail Bridge
-STR_100E_CAN_T_BUILD_TRAIN_DEPOT                                :{WHITE}Can't build train depot here...
-STR_100F_CAN_T_BUILD_RAILROAD_STATION                           :{WHITE}Can't build railroad station here...
-STR_1010_CAN_T_BUILD_SIGNALS_HERE                               :{WHITE}Can't build signals here...
-STR_1011_CAN_T_BUILD_RAILROAD_TRACK                             :{WHITE}Can't build railroad track here...
-STR_1012_CAN_T_REMOVE_RAILROAD_TRACK                            :{WHITE}Can't remove railroad track from here...
-STR_1013_CAN_T_REMOVE_SIGNALS_FROM                              :{WHITE}Can't remove signals from here...
-STR_1014_TRAIN_DEPOT_ORIENTATION                                :{WHITE}Train Depot Orientation
-STR_1015_RAILROAD_CONSTRUCTION                                  :Railroad construction
-STR_TOOLB_ELRAIL_CONSTRUCTION                                   :Electrified Railroad construction
-STR_1016_MONORAIL_CONSTRUCTION                                  :Monorail construction
-STR_1017_MAGLEV_CONSTRUCTION                                    :MagLev construction
-STR_1018_BUILD_RAILROAD_TRACK                                   :{BLACK}Build railroad track
-STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING                         :{BLACK}Build train depot (for building and servicing trains)
-STR_101A_BUILD_RAILROAD_STATION                                 :{BLACK}Build railroad station
-STR_101B_BUILD_RAILROAD_SIGNALS                                 :{BLACK}Build railroad signals
-STR_101C_BUILD_RAILROAD_BRIDGE                                  :{BLACK}Build railroad bridge
-STR_101D_BUILD_RAILROAD_TUNNEL                                  :{BLACK}Build railroad tunnel
-STR_101E_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Toggle build/remove for railroad track and signals
-STR_101F_BRIDGE_SELECTION_CLICK                                 :{BLACK}Bridge selection - click on your prefered bridge to build it
-STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO                       :{BLACK}Select railroad depot orientation
-STR_1021_RAILROAD_TRACK                                         :Railroad track
-STR_1023_RAILROAD_TRAIN_DEPOT                                   :Railroad train depot
-STR_1024_AREA_IS_OWNED_BY_ANOTHER                               :{WHITE}...area is owned by another company
-STR_RAILROAD_TRACK_WITH_NORMAL_SIGNALS                          :Railroad track with normal signals
-STR_RAILROAD_TRACK_WITH_PRESIGNALS                              :Railroad track with pre-signals
-STR_RAILROAD_TRACK_WITH_EXITSIGNALS                             :Railroad track with exit-signals
-STR_RAILROAD_TRACK_WITH_COMBOSIGNALS                            :Railway track with combo-signals
-STR_RAILROAD_TRACK_WITH_NORMAL_PRESIGNALS                       :Railway track with normal and pre-signals
-STR_RAILROAD_TRACK_WITH_NORMAL_EXITSIGNALS                      :Railway track with normal and exit-signals
-STR_RAILROAD_TRACK_WITH_NORMAL_COMBOSIGNALS                     :Railway track with normal and combo-signals
-STR_RAILROAD_TRACK_WITH_PRE_EXITSIGNALS                         :Railway track with pre- and exit-signals
-STR_RAILROAD_TRACK_WITH_PRE_COMBOSIGNALS                        :Railway track with pre- and combo-signals
-STR_RAILROAD_TRACK_WITH_EXIT_COMBOSIGNALS                       :Railway track with exit- and combo-signals
-STR_MUST_REMOVE_RAILWAY_STATION_FIRST                           :{WHITE}Must remove railway station first
-
-
-
-##id 0x1800
-STR_1801_MUST_REMOVE_ROAD_FIRST                                 :{WHITE}Must remove road first
-STR_ROAD_WORKS_IN_PROGRESS                                      :{WHITE}Road works in progress
-STR_1802_ROAD_CONSTRUCTION                                      :{WHITE}Road Construction
-STR_1802_TRAMWAY_CONSTRUCTION                                   :{WHITE}Tramway Construction
-STR_1803_SELECT_ROAD_BRIDGE                                     :{WHITE}Select Road Bridge
-STR_ERR_ONEWAY_ROADS_CAN_T_HAVE_JUNCTION                        :{WHITE}... one way roads can't have junctions
-STR_1804_CAN_T_BUILD_ROAD_HERE                                  :{WHITE}Can't build road here...
-STR_1804_CAN_T_BUILD_TRAMWAY_HERE                               :{WHITE}Can't build tramway here...
-STR_1805_CAN_T_REMOVE_ROAD_FROM                                 :{WHITE}Can't remove road from here...
-STR_1805_CAN_T_REMOVE_TRAMWAY_FROM                              :{WHITE}Can't remove tramway from here...
-STR_1806_ROAD_DEPOT_ORIENTATION                                 :{WHITE}Road Depot Orientation
-STR_1806_TRAM_DEPOT_ORIENTATION                                 :{WHITE}Tram Depot Orientation
-STR_1807_CAN_T_BUILD_ROAD_VEHICLE                               :{WHITE}Can't build road vehicle depot here...
-STR_1807_CAN_T_BUILD_TRAM_VEHICLE                               :{WHITE}Can't build tram vehicle depot here...
-STR_1808_CAN_T_BUILD_BUS_STATION                                :{WHITE}Can't build bus station...
-STR_1809_CAN_T_BUILD_TRUCK_STATION                              :{WHITE}Can't build truck station...
-STR_1808_CAN_T_BUILD_PASSENGER_TRAM_STATION                     :{WHITE}Can't build passenger tram station...
-STR_1809_CAN_T_BUILD_CARGO_TRAM_STATION                         :{WHITE}Can't build freight tram station...
-STR_180A_ROAD_CONSTRUCTION                                      :Road construction
-STR_180A_TRAMWAY_CONSTRUCTION                                   :Tramway construction
-STR_180B_BUILD_ROAD_SECTION                                     :{BLACK}Build road section
-STR_180B_BUILD_TRAMWAY_SECTION                                  :{BLACK}Build tramway section
-STR_180C_BUILD_ROAD_VEHICLE_DEPOT                               :{BLACK}Build road vehicle depot (for building and servicing vehicles)
-STR_180C_BUILD_TRAM_VEHICLE_DEPOT                               :{BLACK}Build tram vehicle depot (for building and servicing trams)
-STR_180D_BUILD_BUS_STATION                                      :{BLACK}Build bus station
-STR_180E_BUILD_TRUCK_LOADING_BAY                                :{BLACK}Build truck loading bay
-STR_180D_BUILD_PASSENGER_TRAM_STATION                           :{BLACK}Build passenger tram station
-STR_180E_BUILD_CARGO_TRAM_STATION                               :{BLACK}Build freight tram station
-STR_180F_BUILD_ROAD_BRIDGE                                      :{BLACK}Build road bridge
-STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}Build tramway bridge
-STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}Build road tunnel
-STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}Build tramway tunnel
-STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Toggle build/remove for road construction
-STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}Toggle build/remove for tramway construction
-STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}Select road vehicle depot orientation
-STR_1813_SELECT_TRAM_VEHICLE_DEPOT                              :{BLACK}Select tram vehicle depot orientation
-STR_1814_ROAD                                                   :Road
-STR_1815_ROAD_WITH_STREETLIGHTS                                 :Road with streetlights
-STR_1816_TREE_LINED_ROAD                                        :Tree-lined road
-STR_1817_ROAD_VEHICLE_DEPOT                                     :Road vehicle depot
-STR_1818_ROAD_RAIL_LEVEL_CROSSING                               :Road/rail grade crossing
-STR_CAN_T_REMOVE_BUS_STATION                                    :{WHITE}Can't remove bus station...
-STR_CAN_T_REMOVE_TRUCK_STATION                                  :{WHITE}Can't remove truck station...
-STR_CAN_T_REMOVE_PASSENGER_TRAM_STATION                         :{WHITE}Can't remove passenger tram station...
-STR_CAN_T_REMOVE_CARGO_TRAM_STATION                             :{WHITE}Can't remove freight tram station...
-
-##id 0x2000
-STR_2000_TOWNS                                                  :{WHITE}Towns
-STR_TOWN_LABEL_POP                                              :{WHITE}{TOWN} ({COMMA})
-STR_TOWN_LABEL                                                  :{WHITE}{TOWN}
-STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
-STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
-STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
-STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Building must be demolished first
-STR_2005                                                        :{WHITE}{TOWN}
-STR_2006_POPULATION                                             :{BLACK}Population: {ORANGE}{COMMA}{BLACK}  Houses: {ORANGE}{COMMA}
-STR_2007_RENAME_TOWN                                            :Rename Town
-STR_2008_CAN_T_RENAME_TOWN                                      :{WHITE}Can't rename town...
-STR_2009_LOCAL_AUTHORITY_REFUSES                                :{WHITE}{TOWN} local authority refuses to allow this
-STR_200A_TOWN_NAMES_CLICK_ON_NAME                               :{BLACK}Town names - click on name to center view on town
-STR_200B_CENTER_THE_MAIN_VIEW_ON                                :{BLACK}Center the main view on town location
-STR_200C_CHANGE_TOWN_NAME                                       :{BLACK}Change town name
-STR_200D_PASSENGERS_LAST_MONTH_MAX                              :{BLACK}Passengers last month: {ORANGE}{COMMA}{BLACK}  max: {ORANGE}{COMMA}
-STR_200E_MAIL_LAST_MONTH_MAX                                    :{BLACK}Mail last month: {ORANGE}{COMMA}{BLACK}  max: {ORANGE}{COMMA}
-STR_200F_TALL_OFFICE_BLOCK                                      :Tall office block
-STR_2010_OFFICE_BLOCK                                           :Office block
-STR_2011_SMALL_BLOCK_OF_FLATS                                   :Small block of apartments
-STR_2012_CHURCH                                                 :Church
-STR_2013_LARGE_OFFICE_BLOCK                                     :Large office block
-STR_2014_TOWN_HOUSES                                            :Town houses
-STR_2015_HOTEL                                                  :Hotel
-STR_2016_STATUE                                                 :Statue
-STR_2017_FOUNTAIN                                               :Fountain
-STR_2018_PARK                                                   :Park
-STR_2019_OFFICE_BLOCK                                           :Office block
-STR_201A_SHOPS_AND_OFFICES                                      :Shops and offices
-STR_201B_MODERN_OFFICE_BUILDING                                 :Modern office building
-STR_201C_WAREHOUSE                                              :Warehouse
-STR_201D_OFFICE_BLOCK                                           :Office block
-STR_201E_STADIUM                                                :Stadium
-STR_201F_OLD_HOUSES                                             :Old houses
-STR_2020_LOCAL_AUTHORITY                                        :{BLACK}Local authority
-STR_2021_SHOW_INFORMATION_ON_LOCAL                              :{BLACK}Show information on local authority
-STR_2022_LOCAL_AUTHORITY                                        :{WHITE}{TOWN} local authority
-STR_2023_TRANSPORT_COMPANY_RATINGS                              :{BLACK}Transport company ratings:
-STR_2024                                                        :{YELLOW}{COMPANY} {COMPANYNUM}: {ORANGE}{STRING}
-STR_2025_SUBSIDIES                                              :{WHITE}Subsidies
-STR_2026_SUBSIDIES_ON_OFFER_FOR                                 :{BLACK}Subsidies on offer for services taking:
-STR_2027_FROM_TO                                                :{ORANGE}{STRING} from {STRING} to {STRING}
-STR_2028_BY                                                     :{YELLOW} (by {DATE_SHORT})
-STR_202A_NONE                                                   :{ORANGE}None
-STR_202B_SERVICES_ALREADY_SUBSIDISED                            :{BLACK}Services already subsidized:
-STR_202C_FROM_TO                                                :{ORANGE}{STRING} from {STATION} to {STATION}{YELLOW} ({COMPANY}
-STR_202D_UNTIL                                                  :{YELLOW}, until {DATE_SHORT})
-STR_202E_OFFER_OF_SUBSIDY_EXPIRED                               :{BLACK}{BIGFONT}Offer of subsidy expired:{}{}{STRING} from {STRING} to {STRING} will now not attract a subsidy.
-STR_202F_SUBSIDY_WITHDRAWN_SERVICE                              :{BLACK}{BIGFONT}Subsidy withdrawn:{}{}{STRING} service from {STATION} to {STATION} is no longer subsidized.
-STR_2030_SERVICE_SUBSIDY_OFFERED                                :{BLACK}{BIGFONT}Service subsidy offered:{}{}First {STRING} service from {STRING} to {STRING} will attract a year's subsidy from the local authority!
-STR_2031_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Service subsidy awarded to {COMPANY}!{}{}{STRING} service from {STATION} to {STATION} will pay 50% extra for the next year!
-STR_2032_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Service subsidy awarded to {COMPANY}!{}{}{STRING} service from {STATION} to {STATION} will pay double rates for the next year!
-STR_2033_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Service subsidy awarded to {COMPANY}!{}{}{STRING} service from {STATION} to {STATION} will pay triple rates for the next year!
-STR_2034_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Service subsidy awarded to {COMPANY}!{}{}{STRING} service from {STATION} to {STATION} will pay quadruple rates for the next year!
-STR_2035_LOCAL_AUTHORITY_REFUSES                                :{WHITE}{TOWN} local authority refuses to allow another airport to be built in this town
-STR_2036_COTTAGES                                               :Cottages
-STR_2037_HOUSES                                                 :Houses
-STR_2038_FLATS                                                  :Apartments
-STR_2039_TALL_OFFICE_BLOCK                                      :Tall office block
-STR_203A_SHOPS_AND_OFFICES                                      :Shops and offices
-STR_203B_SHOPS_AND_OFFICES                                      :Shops and offices
-STR_203C_THEATER                                                :Theater
-STR_203D_STADIUM                                                :Stadium
-STR_203E_OFFICES                                                :Offices
-STR_203F_HOUSES                                                 :Houses
-STR_2040_CINEMA                                                 :Cinema
-STR_2041_SHOPPING_MALL                                          :Shopping mall
-STR_2042_DO_IT                                                  :{BLACK}Do it
-STR_2043_LIST_OF_THINGS_TO_DO_AT                                :{BLACK}List of things to do at this town - click on item for more details
-STR_2044_CARRY_OUT_THE_HIGHLIGHTED                              :{BLACK}Carry out the highlighted action in the list above
-STR_2045_ACTIONS_AVAILABLE                                      :{BLACK}Actions available:
-STR_2046_SMALL_ADVERTISING_CAMPAIGN                             :Small advertising campaign
-STR_2047_MEDIUM_ADVERTISING_CAMPAIGN                            :Medium advertising campaign
-STR_2048_LARGE_ADVERTISING_CAMPAIGN                             :Large advertising campaign
-STR_2049_FUND_LOCAL_ROAD_RECONSTRUCTION                         :Fund local road reconstruction
-STR_204A_BUILD_STATUE_OF_COMPANY                                :Build statue of company owner
-STR_204B_FUND_NEW_BUILDINGS                                     :Fund new buildings
-STR_204C_BUY_EXCLUSIVE_TRANSPORT                                :Buy exclusive transport rights
-STR_TOWN_BRIBE_THE_LOCAL_AUTHORITY                              :Bribe the local authority
-STR_204D_INITIATE_A_SMALL_LOCAL                                 :{WHITE}{STRING}{}{YELLOW} Initiate a small local advertising campaign, to attract more passengers and cargo to your transport services.{}  Cost: {CURRENCY}
-STR_204E_INITIATE_A_MEDIUM_LOCAL                                :{WHITE}{STRING}{}{YELLOW} Initiate a medium local advertising campaign, to attract more passengers and cargo to your transport services.{}  Cost: {CURRENCY}
-STR_204F_INITIATE_A_LARGE_LOCAL                                 :{WHITE}{STRING}{}{YELLOW} Initiate a large local advertising campaign, to attract more passengers and cargo to your transport services.{}  Cost: {CURRENCY}
-STR_2050_FUND_THE_RECONSTRUCTION                                :{WHITE}{STRING}{}{YELLOW} Fund the reconstruction of the urban road network. Causes considerable disruption to road traffic for up to 6 months.{}  Cost: {CURRENCY}
-STR_2051_BUILD_A_STATUE_IN_HONOR                                :{WHITE}{STRING}{}{YELLOW} Build a statue in honor of your company.{} Cost: {CURRENCY}
-STR_2052_FUND_THE_CONSTRUCTION_OF                               :{WHITE}{STRING}{}{YELLOW} Fund the construction of new commercial buildings in the town.{}  Cost: {CURRENCY}
-STR_2053_BUY_1_YEAR_S_EXCLUSIVE                                 :{WHITE}{STRING}{}{YELLOW} Buy 1 year's exclusive transport rights in town. Town authority will only allow passengers and cargo to use your company's stations.{} Cost: {CURRENCY}
-STR_TOWN_BRIBE_THE_LOCAL_AUTHORITY_DESC                         :{WHITE}{STRING}{}{YELLOW} Bribe the local authority to increase your rating, at the risk of a severe penalty if caught.{}  Cost: {CURRENCY}
-STR_2055_TRAFFIC_CHAOS_IN_ROAD_REBUILDING                       :{BIGFONT}{BLACK}Traffic chaos in {TOWN}!{}{}Road rebuilding program funded by {COMPANY} brings 6 months of misery to motorists!
-STR_2056                                                        :{TINYFONT}{WHITE}{TOWN}
-STR_2057                                                        :{ORANGE}{TOWN}{BLACK} ({COMMA})
-STR_2058_UNDER_CONSTRUCTION                                     :{STRING} (under construction)
-STR_2059_IGLOO                                                  :Igloo
-STR_205A_TEPEES                                                 :Tepees
-STR_205B_TEAPOT_HOUSE                                           :Teapot-House
-STR_205C_PIGGY_BANK                                             :Piggy-Bank
-
-STR_INDUSTRY                                                    :{INDUSTRY}
-STR_TOWN                                                        :{TOWN}
-STR_INDUSTRY_FORMAT                                             :{TOWN} {STRING}
-STR_STATION                                                     :{STATION}
-
-##id 0x2800
-STR_LANDSCAPING                                                 :Landscaping
-STR_2800_PLANT_TREES                                            :Plant trees
-STR_2801_PLACE_SIGN                                             :Place sign
-STR_2802_TREES                                                  :{WHITE}Trees
-STR_2803_TREE_ALREADY_HERE                                      :{WHITE}...tree already here
-STR_2804_SITE_UNSUITABLE                                        :{WHITE}...site unsuitable
-STR_2805_CAN_T_PLANT_TREE_HERE                                  :{WHITE}Can't plant tree here...
-STR_2806                                                        :{WHITE}{SIGN}
-STR_2808_TOO_MANY_SIGNS                                         :{WHITE}...too many signs
-STR_2809_CAN_T_PLACE_SIGN_HERE                                  :{WHITE}Can't place sign here...
-STR_280A_SIGN                                                   :Sign
-STR_280B_EDIT_SIGN_TEXT                                         :{WHITE}Edit sign text
-STR_280C_CAN_T_CHANGE_SIGN_NAME                                 :{WHITE}Can't change sign name...
-STR_280D_SELECT_TREE_TYPE_TO_PLANT                              :{BLACK}Select tree type to plant
-STR_280E_TREES                                                  :Trees
-STR_280F_RAINFOREST                                             :Rainforest
-STR_2810_CACTUS_PLANTS                                          :Cactuses
-
-##id 0x3000
-STR_3000_RAIL_STATION_SELECTION                                 :{WHITE}Rail Station Selection
-STR_3001_AIRPORT_SELECTION                                      :{WHITE}Airport Selection
-STR_3002_ORIENTATION                                            :{BLACK}Orientation
-STR_3003_NUMBER_OF_TRACKS                                       :{BLACK}Number of tracks
-STR_3004_PLATFORM_LENGTH                                        :{BLACK}Platform length
-STR_3005_TOO_CLOSE_TO_ANOTHER_RAILROAD                          :{WHITE}Too close to another railroad station
-STR_3006_ADJOINS_MORE_THAN_ONE_EXISTING                         :{WHITE}Adjoins more than one existing station/loading area
-STR_3007_TOO_MANY_STATIONS_LOADING                              :{WHITE}Too many stations/loading areas in this town
-STR_3008_TOO_MANY_STATIONS_LOADING                              :{WHITE}Too many stations/loading areas
-STR_3008A_TOO_MANY_BUS_STOPS                                    :{WHITE}Too many bus stops
-STR_3008B_TOO_MANY_TRUCK_STOPS                                  :{WHITE}Too many truck stations
-STR_3009_TOO_CLOSE_TO_ANOTHER_STATION                           :{WHITE}Too close to another station/loading area
-STR_300A_0                                                      :{WHITE}{STATION} {STATIONFEATURES}
-STR_300B_MUST_DEMOLISH_RAILROAD                                 :{WHITE}Must demolish railroad station first
-STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT                           :{WHITE}Too close to another airport
-STR_300E_MUST_DEMOLISH_AIRPORT_FIRST                            :{WHITE}Must demolish airport first
-
-STR_3030_RENAME_STATION_LOADING                                 :Rename station/loading area
-STR_3031_CAN_T_RENAME_STATION                                   :{WHITE}Can't rename station...
-STR_3032_RATINGS                                                :{BLACK}Ratings
-STR_3033_ACCEPTS                                                :{BLACK}Accepts
-STR_3034_LOCAL_RATING_OF_TRANSPORT                              :{BLACK}Local rating of transport service:
-
-############ range for rating starts
-STR_3035_APPALLING                                              :Appalling
-STR_3036_VERY_POOR                                              :Very Poor
-STR_3037_POOR                                                   :Poor
-STR_3038_MEDIOCRE                                               :Mediocre
-STR_3039_GOOD                                                   :Good
-STR_303A_VERY_GOOD                                              :Very Good
-STR_303B_EXCELLENT                                              :Excellent
-STR_303C_OUTSTANDING                                            :Outstanding
-############ range for rating ends
-
-STR_303D                                                        :{WHITE}{STRING}: {YELLOW}{STRING} ({COMMA}%)
-STR_303E_NO_LONGER_ACCEPTS                                      :{WHITE}{STATION} no longer accepts {STRING}
-STR_303F_NO_LONGER_ACCEPTS_OR                                   :{WHITE}{STATION} no longer accepts {STRING} or {STRING}
-STR_3040_NOW_ACCEPTS                                            :{WHITE}{STATION} now accepts {STRING}
-STR_3041_NOW_ACCEPTS_AND                                        :{WHITE}{STATION} now accepts {STRING} and {STRING}
-STR_3042_BUS_STATION_ORIENTATION                                :{WHITE}Bus Station Orientation
-STR_3043_TRUCK_STATION_ORIENT                                   :{WHITE}Truck Station Orient.
-STR_3042_PASSENGER_TRAM_STATION_ORIENTATION                     :{WHITE}Passenger Tram Orientation
-STR_3043_CARGO_TRAM_STATION_ORIENT                              :{WHITE}Freight Tram Orientation
-STR_3046_MUST_DEMOLISH_BUS_STATION                              :{WHITE}Must demolish bus station first
-STR_3047_MUST_DEMOLISH_TRUCK_STATION                            :{WHITE}Must demolish truck station first
-STR_3046_MUST_DEMOLISH_PASSENGER_TRAM_STATION                   :{WHITE}Must demolish passenger tram station first
-STR_3047_MUST_DEMOLISH_CARGO_TRAM_STATION                       :{WHITE}Must demolish freight tram station first
-STR_3048_STATIONS                                               :{WHITE}{COMPANY} - {COMMA} Station{P "" s}
-STR_3049_0                                                      :{YELLOW}{STATION} {STATIONFEATURES}
-STR_304A_NONE                                                   :{YELLOW}- None -
-STR_304B_SITE_UNSUITABLE                                        :{WHITE}...site unsuitable
-STR_304C_TOO_CLOSE_TO_ANOTHER_DOCK                              :{WHITE}Too close to another dock
-STR_304D_MUST_DEMOLISH_DOCK_FIRST                               :{WHITE}Must demolish dock first
-STR_304E_SELECT_RAILROAD_STATION                                :{BLACK}Select railroad station orientation
-STR_304F_SELECT_NUMBER_OF_PLATFORMS                             :{BLACK}Select number of platforms for railroad station
-STR_3050_SELECT_LENGTH_OF_RAILROAD                              :{BLACK}Select length of railroad station
-STR_3051_SELECT_BUS_STATION_ORIENTATION                         :{BLACK}Select bus station orientation
-STR_3052_SELECT_TRUCK_LOADING_BAY                               :{BLACK}Select truck loading bay orientation
-STR_3051_SELECT_PASSENGER_TRAM_STATION_ORIENTATION              :{BLACK}Select passenger tram station orientation
-STR_3052_SELECT_CARGO_TRAM_STATION_ORIENTATION                  :{BLACK}Select freight tram station orientation
-STR_3053_CENTER_MAIN_VIEW_ON_STATION                            :{BLACK}Center main view on station location
-STR_3054_SHOW_STATION_RATINGS                                   :{BLACK}Show station ratings
-STR_3055_CHANGE_NAME_OF_STATION                                 :{BLACK}Change name of station
-STR_3056_SHOW_LIST_OF_ACCEPTED_CARGO                            :{BLACK}Show list of accepted cargo
-STR_3057_STATION_NAMES_CLICK_ON                                 :{BLACK}Station names - click on name to center main view on station
-STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT                            :{BLACK}Select size/type of airport
-STR_305C_0                                                      :{STATION} {STATIONFEATURES}
-STR_STATION_SIGN_TINY                                           :{TINYFONT}{STATION}
-STR_305E_RAILROAD_STATION                                       :Railroad station
-STR_305F_AIRCRAFT_HANGAR                                        :Aircraft hangar
-STR_3060_AIRPORT                                                :Airport
-STR_3061_TRUCK_LOADING_AREA                                     :Truck loading area
-STR_3062_BUS_STATION                                            :Bus station
-STR_3063_SHIP_DOCK                                              :Ship dock
-STR_3064_HIGHLIGHT_COVERAGE_AREA                                :{BLACK}Highlight coverage area of proposed site
-STR_3065_DON_T_HIGHLIGHT_COVERAGE                               :{BLACK}Don't highlight coverage area of proposed site
-STR_3066_COVERAGE_AREA_HIGHLIGHT                                :{BLACK}Coverage area highlight
-STR_3068_DOCK                                                   :{WHITE}Dock
-STR_3069_BUOY                                                   :Buoy
-STR_306A_BUOY_IN_THE_WAY                                        :{WHITE}...buoy in the way
-STR_306C_STATION_TOO_SPREAD_OUT                                 :{WHITE}...station too spread out
-STR_306D_NONUNIFORM_STATIONS_DISALLOWED                         :{WHITE}...nonuniform stations disabled
-STR_USE_CTRL_TO_SELECT_MORE                                     :{BLACK}Hold down CTRL to select more than one item
-
-STR_UNDEFINED                                                   :(undefined string)
-STR_STAT_CLASS_DFLT                                             :Default station
-STR_STAT_CLASS_WAYP                                             :Waypoints
-
-##id 0x3800
-STR_3800_SHIP_DEPOT_ORIENTATION                                 :{WHITE}Ship Depot Orientation
-STR_3801_MUST_BE_BUILT_ON_WATER                                 :{WHITE}...must be built on water
-STR_3802_CAN_T_BUILD_SHIP_DEPOT                                 :{WHITE}Can't build ship depot here...
-STR_3803_SELECT_SHIP_DEPOT_ORIENTATION                          :{BLACK}Select ship depot orientation
-STR_3804_WATER                                                  :Water
-STR_3805_COAST_OR_RIVERBANK                                     :Coast or riverbank
-STR_3806_SHIP_DEPOT                                             :Ship depot
-STR_3807_CAN_T_BUILD_ON_WATER                                   :{WHITE}...Can't build on water
-STR_MUST_DEMOLISH_CANAL_FIRST                                   :{WHITE}Must demolish canal first
-
-##id 0x4000
-STR_4000_SAVE_GAME                                              :{WHITE}Save Game
-STR_4001_LOAD_GAME                                              :{WHITE}Load Game
-STR_4002_SAVE                                                   :{BLACK}Save
-STR_4003_DELETE                                                 :{BLACK}Delete
-STR_4004                                                        :{COMPANY}, {DATE_LONG}
-STR_4005_BYTES_FREE                                             :{BLACK}{COMMA} megabyte{P "" s} free
-STR_4006_UNABLE_TO_READ_DRIVE                                   :{BLACK}Unable to read drive
-STR_4007_GAME_SAVE_FAILED                                       :{WHITE}Game Save Failed{}{STRING}
-STR_4008_UNABLE_TO_DELETE_FILE                                  :{WHITE}Unable to delete file
-STR_4009_GAME_LOAD_FAILED                                       :{WHITE}Game Load Failed{}{STRING}
-STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR                   :Internal error: {STRING}
-STR_GAME_SAVELOAD_ERROR_BROKEN_SAVEGAME                         :Broken savegame - {STRING}
-STR_GAME_SAVELOAD_ERROR_TOO_NEW_SAVEGAME                        :Savegame is made with newer version
-STR_GAME_SAVELOAD_ERROR_FILE_NOT_READABLE                       :File not readable
-STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE                      :File not writable
-STR_400A_LIST_OF_DRIVES_DIRECTORIES                             :{BLACK}List of drives, directories and saved-game files
-STR_400B_CURRENTLY_SELECTED_NAME                                :{BLACK}Currently selected name for saved-game
-STR_400C_DELETE_THE_CURRENTLY_SELECTED                          :{BLACK}Delete the currently selected saved-game
-STR_400D_SAVE_THE_CURRENT_GAME_USING                            :{BLACK}Save the current game, using the selected name
-STR_400E_SELECT_NEW_GAME_TYPE                                   :{WHITE}Select New Game Type
-STR_400F_SELECT_SCENARIO_GREEN_PRE                              :{BLACK}Select scenario (green), pre-set game (blue), or random new game
-STR_4010_GENERATE_RANDOM_NEW_GAME                               :Generate random new game
-STR_4011_LOAD_HEIGHTMAP                                         :{WHITE}Load Heightmap
-
-##id 0x4800
-STR_4800_IN_THE_WAY                                             :{WHITE}{STRING} in the way
-STR_4801                                                        :{WHITE}{INDUSTRY}
-STR_4802_COAL_MINE                                              :Coal Mine
-STR_4803_POWER_STATION                                          :Power Station
-STR_4804_SAWMILL                                                :Sawmill
-STR_4805_FOREST                                                 :Forest
-STR_4806_OIL_REFINERY                                           :Oil Refinery
-STR_4807_OIL_RIG                                                :Oil Rig
-STR_4808_FACTORY                                                :Factory
-STR_4809_PRINTING_WORKS                                         :Printing Works
-STR_480A_STEEL_MILL                                             :Steel Mill
-STR_480B_FARM                                                   :Farm
-STR_480C_COPPER_ORE_MINE                                        :Copper Ore Mine
-STR_480D_OIL_WELLS                                              :Oil Wells
-STR_480E_BANK                                                   :Bank
-STR_480F_FOOD_PROCESSING_PLANT                                  :Food Processing Plant
-STR_4810_PAPER_MILL                                             :Paper Mill
-STR_4811_GOLD_MINE                                              :Gold Mine
-STR_4812_BANK                                                   :Bank
-STR_4813_DIAMOND_MINE                                           :Diamond Mine
-STR_4814_IRON_ORE_MINE                                          :Iron Ore Mine
-STR_4815_FRUIT_PLANTATION                                       :Fruit Plantation
-STR_4816_RUBBER_PLANTATION                                      :Rubber Plantation
-STR_4817_WATER_SUPPLY                                           :Water Supply
-STR_4818_WATER_TOWER                                            :Water Tower
-STR_4819_FACTORY                                                :Factory
-STR_481A_FARM                                                   :Farm
-STR_481B_LUMBER_MILL                                            :Lumber Mill
-STR_481C_COTTON_CANDY_FOREST                                    :Cotton Candy Forest
-STR_481D_CANDY_FACTORY                                          :Candy Factory
-STR_481E_BATTERY_FARM                                           :Battery Farm
-STR_481F_COLA_WELLS                                             :Cola Wells
-STR_4820_TOY_SHOP                                               :Toy Shop
-STR_4821_TOY_FACTORY                                            :Toy Factory
-STR_4822_PLASTIC_FOUNTAINS                                      :Plastic Fountains
-STR_4823_FIZZY_DRINK_FACTORY                                    :Fizzy Drink Factory
-STR_4824_BUBBLE_GENERATOR                                       :Bubble Generator
-STR_4825_TOFFEE_QUARRY                                          :Toffee Quarry
-STR_4826_SUGAR_MINE                                             :Sugar Mine
-
-############ range for requires starts
-STR_4827_REQUIRES                                               :{BLACK}Requires: {YELLOW}{STRING}
-STR_4828_REQUIRES                                               :{BLACK}Requires: {YELLOW}{STRING}, {STRING}
-STR_4829_REQUIRES                                               :{BLACK}Requires: {YELLOW}{STRING}, {STRING}, {STRING}
-############ range for requires ends
-
-############ range for produces starts
-STR_INDUSTRY_WINDOW_WAITING_FOR_PROCESSING                      :{BLACK}Cargo waiting to be processed:
-STR_INDUSTRY_WINDOW_WAITING_STOCKPILE_CARGO                     :{YELLOW}{CARGO}{BLACK}
-STR_4827_PRODUCES                                               :{BLACK}Produces: {YELLOW}{STRING}
-STR_4828_PRODUCES                                               :{BLACK}Produces: {YELLOW}{STRING}, {STRING}
-############ range for produces ends
-
-STR_482A_PRODUCTION_LAST_MONTH                                  :{BLACK}Production last month:
-STR_482B_TRANSPORTED                                            :{YELLOW}{CARGO}{BLACK} ({COMMA}% transported)
-STR_482C_CENTER_THE_MAIN_VIEW_ON                                :{BLACK}Center the main view on industry location
-STR_482D_NEW_UNDER_CONSTRUCTION                                 :{BLACK}{BIGFONT}New {STRING} under construction near {TOWN}!
-STR_482E_NEW_BEING_PLANTED_NEAR                                 :{BLACK}{BIGFONT}New {STRING} being planted near {TOWN}!
-STR_482F_COST                                                   :{BLACK}Cost: {YELLOW}{CURRENCY}
-STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY                          :{WHITE}Can't construct this industry type here...
-STR_4831_FOREST_CAN_ONLY_BE_PLANTED                             :{WHITE}...forest can only be planted above snow-line
-STR_4832_ANNOUNCES_IMMINENT_CLOSURE                             :{BLACK}{BIGFONT}{STRING} announces imminent closure!
-STR_4833_SUPPLY_PROBLEMS_CAUSE_TO                               :{BLACK}{BIGFONT}Supply problems cause {STRING} to announce imminent closure!
-STR_4834_LACK_OF_NEARBY_TREES_CAUSES                            :{BLACK}{BIGFONT}Lack of nearby trees causes {STRING} to announce imminent closure!
-STR_4835_INCREASES_PRODUCTION                                   :{BLACK}{BIGFONT}{INDUSTRY} increases production!
-STR_4836_NEW_COAL_SEAM_FOUND_AT                                 :{BLACK}{BIGFONT}New coal seam found at {INDUSTRY}!{}Production is expected to double!
-STR_4837_NEW_OIL_RESERVES_FOUND                                 :{BLACK}{BIGFONT}New oil reserves found at {INDUSTRY}!{}Production is expected to double!
-STR_4838_IMPROVED_FARMING_METHODS                               :{BLACK}{BIGFONT}Improved farming methods at {INDUSTRY} are expected to double production!
-STR_4839_PRODUCTION_DOWN_BY_50                                  :{BLACK}{BIGFONT}{INDUSTRY} production down by 50%
-STR_483A_INSECT_INFESTATION_CAUSES                              :{BLACK}{BIGFONT}Insect infestation causes havoc at {INDUSTRY}!{}Production down by 50%
-STR_483B_CAN_ONLY_BE_POSITIONED                                 :{WHITE}...can only be positioned near edges of map
-STR_INDUSTRY_PROD_GOUP                                          :{BLACK}{BIGFONT}{STRING} production at {INDUSTRY} increases by {COMMA}%!
-STR_INDUSTRY_PROD_GODOWN                                        :{BLACK}{BIGFONT}{STRING} production at {INDUSTRY} goes down by {COMMA}%!
-
-##id 0x5000
-STR_5000_TRAIN_IN_TUNNEL                                        :{WHITE}Train in tunnel
-STR_5001_ROAD_VEHICLE_IN_TUNNEL                                 :{WHITE}Road vehicle in tunnel
-STR_5003_ANOTHER_TUNNEL_IN_THE_WAY                              :{WHITE}Another tunnel in the way
-STR_5005_UNABLE_TO_EXCAVATE_LAND                                :{WHITE}Unable to excavate land for other end of tunnel
-STR_5006_MUST_DEMOLISH_TUNNEL_FIRST                             :{WHITE}Must demolish tunnel first
-STR_5007_MUST_DEMOLISH_BRIDGE_FIRST                             :{WHITE}Must demolish bridge first
-STR_5008_CANNOT_START_AND_END_ON                                :{WHITE}Cannot start and end on same position
-STR_BRIDGEHEADS_NOT_SAME_HEIGHT                                 :{WHITE}Bridge heads not at the same level
-STR_BRIDGE_TOO_LOW_FOR_TERRAIN                                  :{WHITE}Bridge is too low for the terrain
-STR_500A_START_AND_END_MUST_BE_IN                               :{WHITE}Start and end must be in line
-STR_500B_SITE_UNSUITABLE_FOR_TUNNEL                             :{WHITE}Site unsuitable for tunnel entrance
-STR_500D                                                        :{GOLD}{STRING},{} {VELOCITY} {WHITE}{CURRENCY}
-STR_500E_SUSPENSION_STEEL                                       :Suspension, Steel
-STR_500F_GIRDER_STEEL                                           :Girder, Steel
-STR_5010_CANTILEVER_STEEL                                       :Cantilever, Steel
-STR_5011_SUSPENSION_CONCRETE                                    :Suspension, Concrete
-STR_5012_WOODEN                                                 :Wooden
-STR_5013_CONCRETE                                               :Concrete
-STR_5014_TUBULAR_STEEL                                          :Tubular, Steel
-STR_BRIDGE_TUBULAR_SILICON                                      :Tubular, Silicon
-STR_5015_CAN_T_BUILD_BRIDGE_HERE                                :{WHITE}Can't build bridge here...
-STR_5016_CAN_T_BUILD_TUNNEL_HERE                                :{WHITE}Can't build tunnel here...
-STR_5017_RAILROAD_TUNNEL                                        :Railroad tunnel
-STR_5018_ROAD_TUNNEL                                            :Road tunnel
-STR_501B_STEEL_SUSPENSION_RAIL_BRIDGE                           :Steel suspension rail bridge
-STR_501C_STEEL_GIRDER_RAIL_BRIDGE                               :Steel girder rail bridge
-STR_501D_STEEL_CANTILEVER_RAIL_BRIDGE                           :Steel cantilever rail bridge
-STR_501E_REINFORCED_CONCRETE_SUSPENSION                         :Reinforced concrete suspension rail bridge
-STR_501F_WOODEN_RAIL_BRIDGE                                     :Wooden rail bridge
-STR_5020_CONCRETE_RAIL_BRIDGE                                   :Concrete rail bridge
-STR_5021_STEEL_SUSPENSION_ROAD_BRIDGE                           :Steel suspension road bridge
-STR_5022_STEEL_GIRDER_ROAD_BRIDGE                               :Steel girder road bridge
-STR_5023_STEEL_CANTILEVER_ROAD_BRIDGE                           :Steel cantilever road bridge
-STR_5024_REINFORCED_CONCRETE_SUSPENSION                         :Reinforced concrete suspension road bridge
-STR_5025_WOODEN_ROAD_BRIDGE                                     :Wooden road bridge
-STR_5026_CONCRETE_ROAD_BRIDGE                                   :Concrete road bridge
-STR_5027_TUBULAR_RAIL_BRIDGE                                    :Tubular rail bridge
-STR_5028_TUBULAR_ROAD_BRIDGE                                    :Tubular road bridge
-
-##id 0x5800
-STR_5800_OBJECT_IN_THE_WAY                                      :{WHITE}Object in the way
-STR_5801_TRANSMITTER                                            :Transmitter
-STR_5802_LIGHTHOUSE                                             :Lighthouse
-STR_5803_COMPANY_HEADQUARTERS                                   :Company Headquarters
-STR_5804_COMPANY_HEADQUARTERS_IN                                :{WHITE}...company headquarters in the way
-STR_5805_COMPANY_OWNED_LAND                                     :Company-owned land
-STR_5806_CAN_T_PURCHASE_THIS_LAND                               :{WHITE}Can't purchase this land area...
-STR_5807_YOU_ALREADY_OWN_IT                                     :{WHITE}...you already own it!
-
-
-############ WARNING, using range 0x6000 for strings that are stored in the savegame
-############ These strings may never get a new id, or savegames will break!
-##id 0x6000
-STR_SV_EMPTY                                                    :
-STR_SV_UNNAMED                                                  :Unnamed
-STR_SV_TRAIN_NAME                                               :Train {COMMA}
-STR_SV_ROADVEH_NAME                                             :Road Vehicle {COMMA}
-STR_SV_SHIP_NAME                                                :Ship {COMMA}
-STR_SV_AIRCRAFT_NAME                                            :Aircraft {COMMA}
-
-STR_SV_STNAME                                                   :{STRING}
-STR_SV_STNAME_NORTH                                             :{STRING} North
-STR_SV_STNAME_SOUTH                                             :{STRING} South
-STR_SV_STNAME_EAST                                              :{STRING} East
-STR_SV_STNAME_WEST                                              :{STRING} West
-STR_SV_STNAME_CENTRAL                                           :{STRING} Central
-STR_SV_STNAME_TRANSFER                                          :{STRING} Transfer
-STR_SV_STNAME_HALT                                              :{STRING} Halt
-STR_SV_STNAME_VALLEY                                            :{STRING} Valley
-STR_SV_STNAME_HEIGHTS                                           :{STRING} Heights
-STR_SV_STNAME_WOODS                                             :{STRING} Woods
-STR_SV_STNAME_LAKESIDE                                          :{STRING} Lakeside
-STR_SV_STNAME_EXCHANGE                                          :{STRING} Exchange
-STR_SV_STNAME_AIRPORT                                           :{STRING} Airport
-STR_SV_STNAME_OILFIELD                                          :{STRING} Oilfield
-STR_SV_STNAME_MINES                                             :{STRING} Mines
-STR_SV_STNAME_DOCKS                                             :{STRING} Docks
-STR_SV_STNAME_BUOY_1                                            :{STRING} Buoy 1
-STR_SV_STNAME_BUOY_2                                            :{STRING} Buoy 2
-STR_SV_STNAME_BUOY_3                                            :{STRING} Buoy 3
-STR_SV_STNAME_BUOY_4                                            :{STRING} Buoy 4
-STR_SV_STNAME_BUOY_5                                            :{STRING} Buoy 5
-STR_SV_STNAME_BUOY_6                                            :{STRING} Buoy 6
-STR_SV_STNAME_BUOY_7                                            :{STRING} Buoy 7
-STR_SV_STNAME_BUOY_8                                            :{STRING} Buoy 8
-STR_SV_STNAME_BUOY_9                                            :{STRING} Buoy 9
-STR_SV_STNAME_ANNEXE                                            :{STRING} Annexe
-STR_SV_STNAME_SIDINGS                                           :{STRING} Sidings
-STR_SV_STNAME_BRANCH                                            :{STRING} Branch
-STR_SV_STNAME_UPPER                                             :Upper {STRING}
-STR_SV_STNAME_LOWER                                             :Lower {STRING}
-STR_SV_STNAME_HELIPORT                                          :{STRING} Heliport
-STR_SV_STNAME_FOREST                                            :{STRING} Forest
-STR_SV_STNAME_FALLBACK                                          :{STRING} Station #{NUM}
-
-############ end of savegame specific region!
-
-##id 0x6800
-STR_6800_DIFFICULTY_LEVEL                                       :{WHITE}Difficulty Level
-STR_OPTIONS_SAVE_CHANGES                                        :{BLACK}Save
-
-############ range for difficulty levels starts
-STR_6801_EASY                                                   :{BLACK}Easy
-STR_6802_MEDIUM                                                 :{BLACK}Medium
-STR_6803_HARD                                                   :{BLACK}Hard
-STR_6804_CUSTOM                                                 :{BLACK}Custom
-############ range for difficulty levels ends
-
-############ range for difficulty settings starts
-STR_6805_MAXIMUM_NO_COMPETITORS                                 :{LTBLUE}Maximum no. competitors: {ORANGE}{COMMA}
-STR_6806_COMPETITOR_START_TIME                                  :{LTBLUE}Competitor start time: {ORANGE}{STRING}
-STR_6807_NO_OF_TOWNS                                            :{LTBLUE}No. of towns: {ORANGE}{STRING}
-STR_6808_NO_OF_INDUSTRIES                                       :{LTBLUE}No. of industries: {ORANGE}{STRING}
-STR_6809_MAXIMUM_INITIAL_LOAN_000                               :{LTBLUE}Maximum initial loan: {ORANGE}{CURRENCY}
-STR_680A_INITIAL_INTEREST_RATE                                  :{LTBLUE}Initial interest rate: {ORANGE}{COMMA}%
-STR_680B_VEHICLE_RUNNING_COSTS                                  :{LTBLUE}Vehicle running costs: {ORANGE}{STRING}
-STR_680C_CONSTRUCTION_SPEED_OF_COMPETITOR                       :{LTBLUE}Construction speed of competitors: {ORANGE}{STRING}
-STR_680D_INTELLIGENCE_OF_COMPETITORS                            :{LTBLUE}Intelligence of competitors: {ORANGE}{STRING}
-STR_680E_VEHICLE_BREAKDOWNS                                     :{LTBLUE}Vehicle breakdowns: {ORANGE}{STRING}
-STR_680F_SUBSIDY_MULTIPLIER                                     :{LTBLUE}Subsidy multiplier: {ORANGE}{STRING}
-STR_6810_COST_OF_CONSTRUCTION                                   :{LTBLUE}Cost of construction: {ORANGE}{STRING}
-STR_6811_TERRAIN_TYPE                                           :{LTBLUE}Terrain type: {ORANGE}{STRING}
-STR_6812_QUANTITY_OF_SEA_LAKES                                  :{LTBLUE}Quantity of sea/lakes: {ORANGE}{STRING}
-STR_6813_ECONOMY                                                :{LTBLUE}Economy: {ORANGE}{STRING}
-STR_6814_TRAIN_REVERSING                                        :{LTBLUE}Train reversing: {ORANGE}{STRING}
-STR_6815_DISASTERS                                              :{LTBLUE}Disasters: {ORANGE}{STRING}
-STR_16816_CITY_APPROVAL                                         :{LTBLUE}City council's attitude towards area restructuring: {ORANGE}{STRING}
-############ range for difficulty settings ends
-
-STR_26816_NONE                                                  :None
-STR_NUM_VERY_LOW                                                :Very low
-STR_6816_LOW                                                    :Low
-STR_6817_NORMAL                                                 :Normal
-STR_6818_HIGH                                                   :High
-STR_6819                                                        :{BLACK}{SMALLLEFTARROW}
-STR_681A                                                        :{BLACK}{SMALLRIGHTARROW}
-STR_681B_VERY_SLOW                                              :Very Slow
-STR_681C_SLOW                                                   :Slow
-STR_681D_MEDIUM                                                 :Medium
-STR_681E_FAST                                                   :Fast
-STR_681F_VERY_FAST                                              :Very Fast
-STR_VERY_LOW                                                    :Very Low
-STR_6820_LOW                                                    :Low
-STR_6821_MEDIUM                                                 :Medium
-STR_6822_HIGH                                                   :High
-STR_6823_NONE                                                   :None
-STR_6824_REDUCED                                                :Reduced
-STR_6825_NORMAL                                                 :Normal
-STR_6826_X1_5                                                   :x1.5
-STR_6827_X2                                                     :x2
-STR_6828_X3                                                     :x3
-STR_6829_X4                                                     :x4
-STR_682A_VERY_FLAT                                              :Very Flat
-STR_682B_FLAT                                                   :Flat
-STR_682C_HILLY                                                  :Hilly
-STR_682D_MOUNTAINOUS                                            :Mountainous
-STR_682E_STEADY                                                 :Steady
-STR_682F_FLUCTUATING                                            :Fluctuating
-STR_6830_IMMEDIATE                                              :Immediate
-STR_6831_3_MONTHS_AFTER_PLAYER                                  :3 months after player
-STR_6832_6_MONTHS_AFTER_PLAYER                                  :6 months after player
-STR_6833_9_MONTHS_AFTER_PLAYER                                  :9 months after player
-STR_6834_AT_END_OF_LINE_AND_AT_STATIONS                         :At end of line, and at stations
-STR_6835_AT_END_OF_LINE_ONLY                                    :At end of line only
-STR_6836_OFF                                                    :Off
-STR_6837_ON                                                     :On
-STR_6838_SHOW_HI_SCORE_CHART                                    :{BLACK}Show hi-score chart
-STR_6839_PERMISSIVE                                             :Permissive
-STR_683A_TOLERANT                                               :Tolerant
-STR_683B_HOSTILE                                                :Hostile
-
-##id 0x7000
-STR_7000                                                        :
-STR_7001                                                        :{WHITE}{COMPANY} {BLACK}{COMPANYNUM}
-STR_7002_PLAYER                                                 :(Player {COMMA})
-STR_7004_NEW_FACE                                               :{BLACK}New Face
-STR_7005_COLOR_SCHEME                                           :{BLACK}Color Scheme
-STR_7006_COLOR_SCHEME                                           :{GOLD}Color Scheme:
-STR_7007_NEW_COLOR_SCHEME                                       :{WHITE}New Color Scheme
-STR_7008_COMPANY_NAME                                           :{BLACK}Company Name
-STR_7009_PRESIDENT_NAME                                         :{BLACK}President Name
-STR_700A_COMPANY_NAME                                           :Company Name
-STR_700B_PRESIDENT_S_NAME                                       :President's Name
-STR_700C_CAN_T_CHANGE_COMPANY_NAME                              :{WHITE}Can't change company name...
-STR_700D_CAN_T_CHANGE_PRESIDENT                                 :{WHITE}Can't change president's name...
-STR_700E_FINANCES                                               :{WHITE}{COMPANY} Finances {BLACK}{COMPANYNUM}
-STR_700F_EXPENDITURE_INCOME                                     :{WHITE}Expenditure/Income
-STR_7010                                                        :{WHITE}{NUM}
-STR_7011_CONSTRUCTION                                           :{GOLD}Construction
-STR_7012_NEW_VEHICLES                                           :{GOLD}New Vehicles
-STR_7013_TRAIN_RUNNING_COSTS                                    :{GOLD}Train Running Costs
-STR_7014_ROAD_VEH_RUNNING_COSTS                                 :{GOLD}Road Veh. Running Costs
-STR_7015_AIRCRAFT_RUNNING_COSTS                                 :{GOLD}Aircraft Running Costs
-STR_7016_SHIP_RUNNING_COSTS                                     :{GOLD}Ship Running Costs
-STR_7017_PROPERTY_MAINTENANCE                                   :{GOLD}Property Maintenance
-STR_7018_TRAIN_INCOME                                           :{GOLD}Train Income
-STR_7019_ROAD_VEHICLES_INCOME                                   :{GOLD}Road Vehicle Income
-STR_701A_AIRCRAFT_INCOME                                        :{GOLD}Aircraft Income
-STR_701B_SHIP_INCOME                                            :{GOLD}Ship Income
-STR_701C_LOAN_INTEREST                                          :{GOLD}Loan Interest
-STR_701D_OTHER                                                  :{GOLD}Other
-STR_701E                                                        :{BLACK}-{CURRENCY}
-STR_701F                                                        :{BLACK}+{CURRENCY}
-STR_7020_TOTAL                                                  :{WHITE}Total:
-STR_7021                                                        :{COMPANY} {COMPANYNUM}
-STR_7022_INCOME_GRAPH                                           :{WHITE}Income Graph
-STR_CURRCOMPACT                                                 :{CURRCOMPACT}
-STR_7024                                                        :{COMMA}
-STR_7025_OPERATING_PROFIT_GRAPH                                 :{WHITE}Operating Profit Graph
-STR_7026_BANK_BALANCE                                           :{WHITE}Bank Balance
-STR_7027_LOAN                                                   :{WHITE}Loan
-STR_MAX_LOAN                                                    :{WHITE}Max Loan:  {BLACK}{CURRENCY}
-STR_7028                                                        :{BLACK}{CURRENCY}
-STR_7029_BORROW                                                 :{BLACK}Borrow {SKIP}{SKIP}{CURRENCY}
-STR_702A_REPAY                                                  :{BLACK}Repay {SKIP}{SKIP}{CURRENCY}
-STR_702B_MAXIMUM_PERMITTED_LOAN                                 :{WHITE}...maximum permitted loan size is {CURRENCY}
-STR_702C_CAN_T_BORROW_ANY_MORE_MONEY                            :{WHITE}Can't borrow any more money...
-STR_702D_LOAN_ALREADY_REPAYED                                   :{WHITE}...no loan to repay
-STR_702E_REQUIRED                                               :{WHITE}...{CURRENCY} required
-STR_702F_CAN_T_REPAY_LOAN                                       :{WHITE}Can't repay loan...
-STR_INSUFFICIENT_FUNDS                                          :{WHITE}Can't give away money that is loaned from the bank...
-STR_7030_SELECT_NEW_FACE_FOR_PRESIDENT                          :{BLACK}Select new face for president
-STR_7031_CHANGE_THE_COMPANY_VEHICLE                             :{BLACK}Change the company vehicle livery
-STR_7032_CHANGE_THE_PRESIDENT_S                                 :{BLACK}Change the president's name
-STR_7033_CHANGE_THE_COMPANY_NAME                                :{BLACK}Change the company name
-STR_7034_CLICK_ON_SELECTED_NEW_COLOR                            :{BLACK}Click on desired color scheme
-STR_7035_INCREASE_SIZE_OF_LOAN                                  :{BLACK}Increase size of loan
-STR_7036_REPAY_PART_OF_LOAN                                     :{BLACK}Repay part of loan
-STR_7037_PRESIDENT                                              :{WHITE}{PLAYERNAME}{}{GOLD}(President)
-STR_7038_INAUGURATED                                            :{GOLD}Inaugurated: {WHITE}{NUM}
-STR_7039_VEHICLES                                               :{GOLD}Vehicles:
-STR_TRAINS                                                      :{WHITE}{COMMA} train{P "" s}
-STR_ROAD_VEHICLES                                               :{WHITE}{COMMA} road vehicle{P "" s}
-STR_AIRCRAFT                                                    :{WHITE}{COMMA} aircraft
-STR_SHIPS                                                       :{WHITE}{COMMA} ship{P "" s}
-STR_7042_NONE                                                   :{WHITE}None
-STR_7043_FACE_SELECTION                                         :{WHITE}Face Selection
-STR_7044_MALE                                                   :{BLACK}Male
-STR_7045_FEMALE                                                 :{BLACK}Female
-STR_7046_NEW_FACE                                               :{BLACK}New Face
-STR_7047_CANCEL_NEW_FACE_SELECTION                              :{BLACK}Cancel new face selection
-STR_7048_ACCEPT_NEW_FACE_SELECTION                              :{BLACK}Accept new face selection
-STR_7049_SELECT_MALE_FACES                                      :{BLACK}Select male faces
-STR_704A_SELECT_FEMALE_FACES                                    :{BLACK}Select female faces
-STR_704B_GENERATE_RANDOM_NEW_FACE                               :{BLACK}Generate random new face
-STR_704C_KEY                                                    :{BLACK}Key
-STR_704D_SHOW_KEY_TO_GRAPHS                                     :{BLACK}Show key to graphs
-STR_704E_KEY_TO_COMPANY_GRAPHS                                  :{WHITE}Key to company graphs
-STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY                           :{BLACK}Click here to toggle company's entry on graph on/off
-STR_7050_UNITS_OF_CARGO_DELIVERED                               :{WHITE}Units of cargo delivered
-STR_7051_COMPANY_PERFORMANCE_RATINGS                            :{WHITE}Company performance ratings (maximum rating=1000)
-STR_7052_COMPANY_VALUES                                         :{WHITE}Company values
-STR_7053_COMPANY_LEAGUE_TABLE                                   :{WHITE}Company League Table
-STR_7054                                                        :{WHITE}{STRING}{SETX 45}{ORANGE}{COMPANY} {BLACK}{COMPANYNUM} '{STRING}'
-STR_7055                                                        :{YELLOW}{STRING}{SETX 45}{ORANGE}{COMPANY} {BLACK}{COMPANYNUM}  '{STRING}'
-STR_7056_TRANSPORT_COMPANY_IN_TROUBLE                           :{BLACK}{BIGFONT}Transport company in trouble!
-STR_7057_WILL_BE_SOLD_OFF_OR_DECLARED                           :{BLACK}{BIGFONT}{COMPANY} will be sold off or declared bankrupt unless performance increases soon!
-STR_7058_PRESIDENT                                              :{BLACK}{PLAYERNAME}{}(President)
-STR_7059_TRANSPORT_COMPANY_MERGER                               :{BLACK}{BIGFONT}Transport company merger!
-STR_705A_HAS_BEEN_SOLD_TO_FOR                                   :{BLACK}{BIGFONT}{COMPANY} has been sold to {COMPANY} for {CURRENCY}!
-STR_705B_WE_ARE_LOOKING_FOR_A_TRANSPORT                         :{WHITE}We are looking for a transport company to take-over our company{}{}Do you want to purchase {COMPANY} for {CURRENCY}?
-STR_705C_BANKRUPT                                               :{BLACK}{BIGFONT}Bankrupt!
-STR_705D_HAS_BEEN_CLOSED_DOWN_BY                                :{BLACK}{BIGFONT}{COMPANY} has been closed down by creditors and all assets sold off!
-STR_705E_NEW_TRANSPORT_COMPANY_LAUNCHED                         :{BLACK}{BIGFONT}New transport company launched!
-STR_705F_STARTS_CONSTRUCTION_NEAR                               :{BLACK}{BIGFONT}{COMPANY} starts construction near {TOWN}!
-STR_7060_CAN_T_BUY_COMPANY                                      :{WHITE}Can't buy company...
-STR_7061_CARGO_PAYMENT_RATES                                    :{WHITE}Cargo Payment Rates
-STR_7062_DAYS_IN_TRANSIT                                        :{BLACK}{TINYFONT}Days in transit
-STR_7063_PAYMENT_FOR_DELIVERING                                 :{BLACK}{TINYFONT}Payment for delivering 10 units (or 10,000 litres) of cargo a distance of 20 squares
-STR_7064_TOGGLE_GRAPH_FOR_CARGO                                 :{BLACK}Toggle graph for cargo type on/off
-STR_7065                                                        :{BLACK}{TINYFONT}{STRING}
-STR_7066_ENGINEER                                               :Engineer
-STR_7067_TRAFFIC_MANAGER                                        :Traffic Manager
-STR_7068_TRANSPORT_COORDINATOR                                  :Transport Coordinator
-STR_7069_ROUTE_SUPERVISOR                                       :Route Supervisor
-STR_706A_DIRECTOR                                               :Director
-STR_706B_CHIEF_EXECUTIVE                                        :Chief Executive
-STR_706C_CHAIRMAN                                               :Chairman
-STR_706D_PRESIDENT                                              :President
-STR_706E_TYCOON                                                 :Tycoon
-STR_706F_BUILD_HQ                                               :{BLACK}Build HQ
-STR_7070_BUILD_COMPANY_HEADQUARTERS                             :{BLACK}Build company headquarters / view company headquarters
-STR_RELOCATE_COMPANY_HEADQUARTERS                               :{BLACK}Rebuild company headquarters elsewhere for 1% cost of company value
-STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS                       :{WHITE}Can't build company headquarters...
-STR_7072_VIEW_HQ                                                :{BLACK}View HQ
-STR_RELOCATE_HQ                                                 :{BLACK}Relocate HQ
-STR_COMPANY_PASSWORD                                            :{BLACK}Password
-STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Password-protect your company to prevent unauthorized users from joining.
-STR_SET_COMPANY_PASSWORD                                        :{BLACK}Set company password
-STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}World Recession!{}{}Financial experts fear worst as economy slumps!
-STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Recession Over!{}{}Upturn in trade gives confidence to industries as economy strengthens!
-STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Toggle large/small window size
-STR_7076_COMPANY_VALUE                                          :{GOLD}Company value: {WHITE}{CURRENCY}
-STR_7077_BUY_25_SHARE_IN_COMPANY                                :{BLACK}Buy 25% share in company
-STR_7078_SELL_25_SHARE_IN_COMPANY                               :{BLACK}Sell 25% share in company
-STR_7079_BUY_25_SHARE_IN_THIS_COMPANY                           :{BLACK}Buy 25% share in this company
-STR_707A_SELL_25_SHARE_IN_THIS_COMPANY                          :{BLACK}Sell 25% share in this company
-STR_707B_CAN_T_BUY_25_SHARE_IN_THIS                             :{WHITE}Can't buy 25% share in this company...
-STR_707C_CAN_T_SELL_25_SHARE_IN                                 :{WHITE}Can't sell 25% share in this company...
-STR_707D_OWNED_BY                                               :{WHITE}({COMMA}% owned by {COMPANY})
-STR_707F_HAS_BEEN_TAKEN_OVER_BY                                 :{BLACK}{BIGFONT}{COMPANY} has been taken over by {COMPANY}!
-STR_7080_PROTECTED                                              :{WHITE}This company is not old enough to trade shares yet...
-
-STR_LIVERY_DEFAULT                                              :Standard Livery
-STR_LIVERY_STEAM                                                :Steam Engine
-STR_LIVERY_DIESEL                                               :Diesel Engine
-STR_LIVERY_ELECTRIC                                             :Electric Engine
-STR_LIVERY_MONORAIL                                             :Monorail Engine
-STR_LIVERY_MAGLEV                                               :Maglev Engine
-STR_LIVERY_DMU                                                  :DMU
-STR_LIVERY_EMU                                                  :EMU
-STR_LIVERY_PASSENGER_WAGON_STEAM                                :Passenger/Mail Car (Steam)
-STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Passenger/Mail Car (Diesel)
-STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Passenger/Mail Car (Electric)
-STR_LIVERY_FREIGHT_WAGON                                        :Freight Car
-STR_LIVERY_BUS                                                  :Bus
-STR_LIVERY_TRUCK                                                :Truck
-STR_LIVERY_PASSENGER_SHIP                                       :Passenger Ship
-STR_LIVERY_FREIGHT_SHIP                                         :Freight Ship
-STR_LIVERY_HELICOPTER                                           :Helicopter
-STR_LIVERY_SMALL_PLANE                                          :Small Airplane
-STR_LIVERY_LARGE_PLANE                                          :Large Airplane
-STR_LIVERY_PASSENGER_TRAM                                       :Passenger Tram
-STR_LIVERY_FREIGHT_TRAM                                         :Freight Tram
-
-STR_LIVERY_GENERAL_TIP                                          :{BLACK}Show general color schemes
-STR_LIVERY_TRAIN_TIP                                            :{BLACK}Show train color schemes
-STR_LIVERY_ROADVEH_TIP                                          :{BLACK}Show road vehicle color schemes
-STR_LIVERY_SHIP_TIP                                             :{BLACK}Show ship color schemes
-STR_LIVERY_AIRCRAFT_TIP                                         :{BLACK}Show aircraft color schemes
-STR_LIVERY_PRIMARY_TIP                                          :{BLACK}Choose the primary color for the selected scheme
-STR_LIVERY_SECONDARY_TIP                                        :{BLACK}Choose the secondary color for the selected scheme
-STR_LIVERY_PANEL_TIP                                            :{BLACK}Select a color scheme to change, or multiple schemes with CTRL+click. Click on the box to toggle use of the scheme
-
-##id 0x8000
-STR_8000_KIRBY_PAUL_TANK_STEAM                                  :Kirby Paul Tank (Steam)
-STR_8001_MJS_250_DIESEL                                         :MJS 250 (Diesel)
-STR_8002_PLODDYPHUT_CHOO_CHOO                                   :Ploddyphut Choo-Choo
-STR_8003_POWERNAUT_CHOO_CHOO                                    :Powernaut Choo-Choo
-STR_8004_MIGHTYMOVER_CHOO_CHOO                                  :Mightymover Choo-Choo
-STR_8005_PLODDYPHUT_DIESEL                                      :Ploddyphut Diesel
-STR_8006_POWERNAUT_DIESEL                                       :Powernaut Diesel
-STR_8007_WILLS_2_8_0_STEAM                                      :Wills 2-8-0 (Steam)
-STR_8008_CHANEY_JUBILEE_STEAM                                   :Chaney 'Jubilee' (Steam)
-STR_8009_GINZU_A4_STEAM                                         :Ginzu 'A4' (Steam)
-STR_800A_SH_8P_STEAM                                            :SH '8P' (Steam)
-STR_800B_MANLEY_MOREL_DMU_DIESEL                                :Manley-Morel DMU (Diesel)
-STR_800C_DASH_DIESEL                                            :'Dash' (Diesel)
-STR_800D_SH_HENDRY_25_DIESEL                                    :SH/Hendry '25' (Diesel)
-STR_800E_UU_37_DIESEL                                           :UU '37' (Diesel)
-STR_800F_FLOSS_47_DIESEL                                        :Floss '47' (Diesel)
-STR_8010_CS_4000_DIESEL                                         :CS 4000 (Diesel)
-STR_8011_CS_2400_DIESEL                                         :CS 2400 (Diesel)
-STR_8012_CENTENNIAL_DIESEL                                      :Centennial (Diesel)
-STR_8013_KELLING_3100_DIESEL                                    :Kelling 3100 (Diesel)
-STR_8014_TURNER_TURBO_DIESEL                                    :Turner Turbo (Diesel)
-STR_8015_MJS_1000_DIESEL                                        :MJS 1000 (Diesel)
-STR_8016_SH_125_DIESEL                                          :SH '125' (Diesel)
-STR_8017_SH_30_ELECTRIC                                         :SH '30' (Electric)
-STR_8018_SH_40_ELECTRIC                                         :SH '40' (Electric)
-STR_8019_T_I_M_ELECTRIC                                         :'T.I.M.' (Electric)
-STR_801A_ASIASTAR_ELECTRIC                                      :'AsiaStar' (Electric)
-STR_801B_PASSENGER_CAR                                          :Passenger Car
-STR_801C_MAIL_VAN                                               :Mail Van
-STR_801D_COAL_CAR                                               :Coal Car
-STR_801E_OIL_TANKER                                             :Oil Tanker
-STR_801F_LIVESTOCK_VAN                                          :Livestock Van
-STR_8020_GOODS_VAN                                              :Goods Van
-STR_8021_GRAIN_HOPPER                                           :Grain Hopper
-STR_8022_WOOD_TRUCK                                             :Wood Truck
-STR_8023_IRON_ORE_HOPPER                                        :Iron Ore Hopper
-STR_8024_STEEL_TRUCK                                            :Steel Truck
-STR_8025_ARMORED_VAN                                            :Armored Van
-STR_8026_FOOD_VAN                                               :Food Van
-STR_8027_PAPER_TRUCK                                            :Paper Truck
-STR_8028_COPPER_ORE_HOPPER                                      :Copper Ore Hopper
-STR_8029_WATER_TANKER                                           :Water Tanker
-STR_802A_FRUIT_TRUCK                                            :Fruit Truck
-STR_802B_RUBBER_TRUCK                                           :Rubber Truck
-STR_802C_SUGAR_TRUCK                                            :Sugar Truck
-STR_802D_COTTON_CANDY_HOPPER                                    :Cotton Candy Hopper
-STR_802E_TOFFEE_HOPPER                                          :Toffee Hopper
-STR_802F_BUBBLE_VAN                                             :Bubble Van
-STR_8030_COLA_TANKER                                            :Cola Tanker
-STR_8031_CANDY_VAN                                              :Candy Van
-STR_8032_TOY_VAN                                                :Toy Van
-STR_8033_BATTERY_TRUCK                                          :Battery Truck
-STR_8034_FIZZY_DRINK_TRUCK                                      :Fizzy Drink Truck
-STR_8035_PLASTIC_TRUCK                                          :Plastic Truck
-STR_8036_X2001_ELECTRIC                                         :'X2001' (Electric)
-STR_8037_MILLENNIUM_Z1_ELECTRIC                                 :'Millennium Z1' (Electric)
-STR_8038_WIZZOWOW_Z99                                           :Wizzowow Z99
-STR_8039_PASSENGER_CAR                                          :Passenger Car
-STR_803A_MAIL_VAN                                               :Mail Van
-STR_803B_COAL_CAR                                               :Coal Car
-STR_803C_OIL_TANKER                                             :Oil Tanker
-STR_803D_LIVESTOCK_VAN                                          :Livestock Van
-STR_803E_GOODS_VAN                                              :Goods Van
-STR_803F_GRAIN_HOPPER                                           :Grain Hopper
-STR_8040_WOOD_TRUCK                                             :Wood Truck
-STR_8041_IRON_ORE_HOPPER                                        :Iron Ore Hopper
-STR_8042_STEEL_TRUCK                                            :Steel Truck
-STR_8043_ARMORED_VAN                                            :Armored Van
-STR_8044_FOOD_VAN                                               :Food Van
-STR_8045_PAPER_TRUCK                                            :Paper Truck
-STR_8046_COPPER_ORE_HOPPER                                      :Copper Ore Hopper
-STR_8047_WATER_TANKER                                           :Water Tanker
-STR_8048_FRUIT_TRUCK                                            :Fruit Truck
-STR_8049_RUBBER_TRUCK                                           :Rubber Truck
-STR_804A_SUGAR_TRUCK                                            :Sugar Truck
-STR_804B_COTTON_CANDY_HOPPER                                    :Cotton Candy Hopper
-STR_804C_TOFFEE_HOPPER                                          :Toffee Hopper
-STR_804D_BUBBLE_VAN                                             :Bubble Van
-STR_804E_COLA_TANKER                                            :Cola Tanker
-STR_804F_CANDY_VAN                                              :Candy Van
-STR_8050_TOY_VAN                                                :Toy Van
-STR_8051_BATTERY_TRUCK                                          :Battery Truck
-STR_8052_FIZZY_DRINK_TRUCK                                      :Fizzy Drink Truck
-STR_8053_PLASTIC_TRUCK                                          :Plastic Truck
-STR_8054_LEV1_LEVIATHAN_ELECTRIC                                :Lev1 'Leviathan' (Electric)
-STR_8055_LEV2_CYCLOPS_ELECTRIC                                  :Lev2 'Cyclops' (Electric)
-STR_8056_LEV3_PEGASUS_ELECTRIC                                  :Lev3 'Pegasus' (Electric)
-STR_8057_LEV4_CHIMAERA_ELECTRIC                                 :Lev4 'Chimaera' (Electric)
-STR_8058_WIZZOWOW_ROCKETEER                                     :Wizzowow Rocketeer
-STR_8059_PASSENGER_CAR                                          :Passenger Car
-STR_805A_MAIL_VAN                                               :Mail Van
-STR_805B_COAL_CAR                                               :Coal Car
-STR_805C_OIL_TANKER                                             :Oil Tanker
-STR_805D_LIVESTOCK_VAN                                          :Livestock Van
-STR_805E_GOODS_VAN                                              :Goods Van
-STR_805F_GRAIN_HOPPER                                           :Grain Hopper
-STR_8060_WOOD_TRUCK                                             :Wood Truck
-STR_8061_IRON_ORE_HOPPER                                        :Iron Ore Hopper
-STR_8062_STEEL_TRUCK                                            :Steel Truck
-STR_8063_ARMORED_VAN                                            :Armored Van
-STR_8064_FOOD_VAN                                               :Food Van
-STR_8065_PAPER_TRUCK                                            :Paper Truck
-STR_8066_COPPER_ORE_HOPPER                                      :Copper Ore Hopper
-STR_8067_WATER_TANKER                                           :Water Tanker
-STR_8068_FRUIT_TRUCK                                            :Fruit Truck
-STR_8069_RUBBER_TRUCK                                           :Rubber Truck
-STR_806A_SUGAR_TRUCK                                            :Sugar Truck
-STR_806B_COTTON_CANDY_HOPPER                                    :Cotton Candy Hopper
-STR_806C_TOFFEE_HOPPER                                          :Toffee Hopper
-STR_806D_BUBBLE_VAN                                             :Bubble Van
-STR_806E_COLA_TANKER                                            :Cola Tanker
-STR_806F_CANDY_VAN                                              :Candy Van
-STR_8070_TOY_VAN                                                :Toy Van
-STR_8071_BATTERY_TRUCK                                          :Battery Truck
-STR_8072_FIZZY_DRINK_TRUCK                                      :Fizzy Drink Truck
-STR_8073_PLASTIC_TRUCK                                          :Plastic Truck
-STR_8074_MPS_REGAL_BUS                                          :MPS Regal Bus
-STR_8075_HEREFORD_LEOPARD_BUS                                   :Hereford Leopard Bus
-STR_8076_FOSTER_BUS                                             :Foster Bus
-STR_8077_FOSTER_MKII_SUPERBUS                                   :Foster MkII Superbus
-STR_8078_PLODDYPHUT_MKI_BUS                                     :Ploddyphut MkI Bus
-STR_8079_PLODDYPHUT_MKII_BUS                                    :Ploddyphut MkII Bus
-STR_807A_PLODDYPHUT_MKIII_BUS                                   :Ploddyphut MkIII Bus
-STR_807B_BALOGH_COAL_TRUCK                                      :Balogh Coal Truck
-STR_807C_UHL_COAL_TRUCK                                         :Uhl Coal Truck
-STR_807D_DW_COAL_TRUCK                                          :DW Coal Truck
-STR_807E_MPS_MAIL_TRUCK                                         :MPS Mail Truck
-STR_807F_REYNARD_MAIL_TRUCK                                     :Reynard Mail Truck
-STR_8080_PERRY_MAIL_TRUCK                                       :Perry Mail Truck
-STR_8081_MIGHTYMOVER_MAIL_TRUCK                                 :MightyMover Mail Truck
-STR_8082_POWERNAUGHT_MAIL_TRUCK                                 :Powernaught Mail Truck
-STR_8083_WIZZOWOW_MAIL_TRUCK                                    :Wizzowow Mail Truck
-STR_8084_WITCOMBE_OIL_TANKER                                    :Witcombe Oil Tanker
-STR_8085_FOSTER_OIL_TANKER                                      :Foster Oil Tanker
-STR_8086_PERRY_OIL_TANKER                                       :Perry Oil Tanker
-STR_8087_TALBOTT_LIVESTOCK_VAN                                  :Talbott Livestock Van
-STR_8088_UHL_LIVESTOCK_VAN                                      :Uhl Livestock Van
-STR_8089_FOSTER_LIVESTOCK_VAN                                   :Foster Livestock Van
-STR_808A_BALOGH_GOODS_TRUCK                                     :Balogh Goods Truck
-STR_808B_CRAIGHEAD_GOODS_TRUCK                                  :Craighead Goods Truck
-STR_808C_GOSS_GOODS_TRUCK                                       :Goss Goods Truck
-STR_808D_HEREFORD_GRAIN_TRUCK                                   :Hereford Grain Truck
-STR_808E_THOMAS_GRAIN_TRUCK                                     :Thomas Grain Truck
-STR_808F_GOSS_GRAIN_TRUCK                                       :Goss Grain Truck
-STR_8090_WITCOMBE_WOOD_TRUCK                                    :Witcombe Wood Truck
-STR_8091_FOSTER_WOOD_TRUCK                                      :Foster Wood Truck
-STR_8092_MORELAND_WOOD_TRUCK                                    :Moreland Wood Truck
-STR_8093_MPS_IRON_ORE_TRUCK                                     :MPS Iron Ore Truck
-STR_8094_UHL_IRON_ORE_TRUCK                                     :Uhl Iron Ore Truck
-STR_8095_CHIPPY_IRON_ORE_TRUCK                                  :Chippy Iron Ore Truck
-STR_8096_BALOGH_STEEL_TRUCK                                     :Balogh Steel Truck
-STR_8097_UHL_STEEL_TRUCK                                        :Uhl Steel Truck
-STR_8098_KELLING_STEEL_TRUCK                                    :Kelling Steel Truck
-STR_8099_BALOGH_ARMORED_TRUCK                                   :Balogh Armored Truck
-STR_809A_UHL_ARMORED_TRUCK                                      :Uhl Armored Truck
-STR_809B_FOSTER_ARMORED_TRUCK                                   :Foster Armored Truck
-STR_809C_FOSTER_FOOD_VAN                                        :Foster Food Van
-STR_809D_PERRY_FOOD_VAN                                         :Perry Food Van
-STR_809E_CHIPPY_FOOD_VAN                                        :Chippy Food Van
-STR_809F_UHL_PAPER_TRUCK                                        :Uhl Paper Truck
-STR_80A0_BALOGH_PAPER_TRUCK                                     :Balogh Paper Truck
-STR_80A1_MPS_PAPER_TRUCK                                        :MPS Paper Truck
-STR_80A2_MPS_COPPER_ORE_TRUCK                                   :MPS Copper Ore Truck
-STR_80A3_UHL_COPPER_ORE_TRUCK                                   :Uhl Copper Ore Truck
-STR_80A4_GOSS_COPPER_ORE_TRUCK                                  :Goss Copper Ore Truck
-STR_80A5_UHL_WATER_TANKER                                       :Uhl Water Tanker
-STR_80A6_BALOGH_WATER_TANKER                                    :Balogh Water Tanker
-STR_80A7_MPS_WATER_TANKER                                       :MPS Water Tanker
-STR_80A8_BALOGH_FRUIT_TRUCK                                     :Balogh Fruit Truck
-STR_80A9_UHL_FRUIT_TRUCK                                        :Uhl Fruit Truck
-STR_80AA_KELLING_FRUIT_TRUCK                                    :Kelling Fruit Truck
-STR_80AB_BALOGH_RUBBER_TRUCK                                    :Balogh Rubber Truck
-STR_80AC_UHL_RUBBER_TRUCK                                       :Uhl Rubber Truck
-STR_80AD_RMT_RUBBER_TRUCK                                       :RMT Rubber Truck
-STR_80AE_MIGHTYMOVER_SUGAR_TRUCK                                :MightyMover Sugar Truck
-STR_80AF_POWERNAUGHT_SUGAR_TRUCK                                :Powernaught Sugar Truck
-STR_80B0_WIZZOWOW_SUGAR_TRUCK                                   :Wizzowow Sugar Truck
-STR_80B1_MIGHTYMOVER_COLA_TRUCK                                 :MightyMover Cola Truck
-STR_80B2_POWERNAUGHT_COLA_TRUCK                                 :Powernaught Cola Truck
-STR_80B3_WIZZOWOW_COLA_TRUCK                                    :Wizzowow Cola Truck
-STR_80B4_MIGHTYMOVER_COTTON_CANDY                               :MightyMover Cotton Candy Truck
-STR_80B5_POWERNAUGHT_COTTON_CANDY                               :Powernaught Cotton Candy Truck
-STR_80B6_WIZZOWOW_COTTON_CANDY_TRUCK                            :Wizzowow Cotton Candy Truck
-STR_80B7_MIGHTYMOVER_TOFFEE_TRUCK                               :MightyMover Toffee Truck
-STR_80B8_POWERNAUGHT_TOFFEE_TRUCK                               :Powernaught Toffee Truck
-STR_80B9_WIZZOWOW_TOFFEE_TRUCK                                  :Wizzowow Toffee Truck
-STR_80BA_MIGHTYMOVER_TOY_VAN                                    :MightyMover Toy Van
-STR_80BB_POWERNAUGHT_TOY_VAN                                    :Powernaught Toy Van
-STR_80BC_WIZZOWOW_TOY_VAN                                       :Wizzowow Toy Van
-STR_80BD_MIGHTYMOVER_CANDY_TRUCK                                :MightyMover Candy Truck
-STR_80BE_POWERNAUGHT_CANDY_TRUCK                                :Powernaught Candy Truck
-STR_80BF_WIZZOWOW_CANDY_TRUCK                                   :Wizzowow Candy Truck
-STR_80C0_MIGHTYMOVER_BATTERY_TRUCK                              :MightyMover Battery Truck
-STR_80C1_POWERNAUGHT_BATTERY_TRUCK                              :Powernaught Battery Truck
-STR_80C2_WIZZOWOW_BATTERY_TRUCK                                 :Wizzowow Battery Truck
-STR_80C3_MIGHTYMOVER_FIZZY_DRINK                                :MightyMover Fizzy Drink Truck
-STR_80C4_POWERNAUGHT_FIZZY_DRINK                                :Powernaught Fizzy Drink Truck
-STR_80C5_WIZZOWOW_FIZZY_DRINK_TRUCK                             :Wizzowow Fizzy Drink Truck
-STR_80C6_MIGHTYMOVER_PLASTIC_TRUCK                              :MightyMover Plastic Truck
-STR_80C7_POWERNAUGHT_PLASTIC_TRUCK                              :Powernaught Plastic Truck
-STR_80C8_WIZZOWOW_PLASTIC_TRUCK                                 :Wizzowow Plastic Truck
-STR_80C9_MIGHTYMOVER_BUBBLE_TRUCK                               :MightyMover Bubble Truck
-STR_80CA_POWERNAUGHT_BUBBLE_TRUCK                               :Powernaught Bubble Truck
-STR_80CB_WIZZOWOW_BUBBLE_TRUCK                                  :Wizzowow Bubble Truck
-STR_80CC_MPS_OIL_TANKER                                         :MPS Oil Tanker
-STR_80CD_CS_INC_OIL_TANKER                                      :CS-Inc. Oil Tanker
-STR_80CE_MPS_PASSENGER_FERRY                                    :MPS Passenger Ferry
-STR_80CF_FFP_PASSENGER_FERRY                                    :FFP Passenger Ferry
-STR_80D0_BAKEWELL_300_HOVERCRAFT                                :Bakewell 300 Hovercraft
-STR_80D1_CHUGGER_CHUG_PASSENGER                                 :Chugger-Chug Passenger Ferry
-STR_80D2_SHIVERSHAKE_PASSENGER_FERRY                            :Shivershake Passenger Ferry
-STR_80D3_YATE_CARGO_SHIP                                        :Yate Cargo ship
-STR_80D4_BAKEWELL_CARGO_SHIP                                    :Bakewell Cargo ship
-STR_80D5_MIGHTYMOVER_CARGO_SHIP                                 :Mightymover Cargo ship
-STR_80D6_POWERNAUT_CARGO_SHIP                                   :Powernaut Cargo ship
-STR_80D7_SAMPSON_U52                                            :Sampson U52
-STR_80D8_COLEMAN_COUNT                                          :Coleman Count
-STR_80D9_FFP_DART                                               :FFP Dart
-STR_80DA_YATE_HAUGAN                                            :Yate Haugan
-STR_80DB_BAKEWELL_COTSWALD_LB_3                                 :Bakewell Cotswald LB-3
-STR_80DC_BAKEWELL_LUCKETT_LB_8                                  :Bakewell Luckett LB-8
-STR_80DD_BAKEWELL_LUCKETT_LB_9                                  :Bakewell Luckett LB-9
-STR_80DE_BAKEWELL_LUCKETT_LB80                                  :Bakewell Luckett LB80
-STR_80DF_BAKEWELL_LUCKETT_LB_10                                 :Bakewell Luckett LB-10
-STR_80E0_BAKEWELL_LUCKETT_LB_11                                 :Bakewell Luckett LB-11
-STR_80E1_YATE_AEROSPACE_YAC_1_11                                :Yate Aerospace YAC 1-11
-STR_80E2_DARWIN_100                                             :Darwin 100
-STR_80E3_DARWIN_200                                             :Darwin 200
-STR_80E4_DARWIN_300                                             :Darwin 300
-STR_80E5_DARWIN_400                                             :Darwin 400
-STR_80E6_DARWIN_500                                             :Darwin 500
-STR_80E7_DARWIN_600                                             :Darwin 600
-STR_80E8_GURU_GALAXY                                            :Guru Galaxy
-STR_80E9_AIRTAXI_A21                                            :Airtaxi A21
-STR_80EA_AIRTAXI_A31                                            :Airtaxi A31
-STR_80EB_AIRTAXI_A32                                            :Airtaxi A32
-STR_80EC_AIRTAXI_A33                                            :Airtaxi A33
-STR_80ED_YATE_AEROSPACE_YAE46                                   :Yate Aerospace YAe46
-STR_80EE_DINGER_100                                             :Dinger 100
-STR_80EF_AIRTAXI_A34_1000                                       :AirTaxi A34-1000
-STR_80F0_YATE_Z_SHUTTLE                                         :Yate Z-Shuttle
-STR_80F1_KELLING_K1                                             :Kelling K1
-STR_80F2_KELLING_K6                                             :Kelling K6
-STR_80F3_KELLING_K7                                             :Kelling K7
-STR_80F4_DARWIN_700                                             :Darwin 700
-STR_80F5_FFP_HYPERDART_2                                        :FFP Hyperdart 2
-STR_80F6_DINGER_200                                             :Dinger 200
-STR_80F7_DINGER_1000                                            :Dinger 1000
-STR_80F8_PLODDYPHUT_100                                         :Ploddyphut 100
-STR_80F9_PLODDYPHUT_500                                         :Ploddyphut 500
-STR_80FA_FLASHBANG_X1                                           :Flashbang X1
-STR_80FB_JUGGERPLANE_M1                                         :Juggerplane M1
-STR_80FC_FLASHBANG_WIZZER                                       :Flashbang Wizzer
-STR_80FD_TRICARIO_HELICOPTER                                    :Tricario Helicopter
-STR_80FE_GURU_X2_HELICOPTER                                     :Guru X2 Helicopter
-STR_80FF_POWERNAUT_HELICOPTER                                   :Powernaut Helicopter
-STR_8100_MESSAGE_FROM_VEHICLE_MANUFACTURE                       :{WHITE}Message from vehicle manufacturer
-STR_8101_WE_HAVE_JUST_DESIGNED_A                                :{GOLD}We have just designed a new {STRING} - would you be interested in a year's exclusive use of this vehicle, so we can see how it performs before making it universally available ?
-STR_8102_RAILROAD_LOCOMOTIVE                                    :railroad locomotive
-STR_8103_ROAD_VEHICLE                                           :road vehicle
-STR_8104_AIRCRAFT                                               :aircraft
-STR_8105_SHIP                                                   :ship
-STR_8106_MONORAIL_LOCOMOTIVE                                    :monorail locomotive
-STR_8107_MAGLEV_LOCOMOTIVE                                      :maglev locomotive
-
-##id 0x8800
-STR_8800_TRAIN_DEPOT                                            :{WHITE}{TOWN} Train Depot
-STR_8801_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Citizens celebrate . . .{}First train arrives at {STATION}!
-STR_8802_DETAILS                                                :{WHITE}{VEHICLE} (Details)
-STR_8803_TRAIN_IN_THE_WAY                                       :{WHITE}Train in the way
-STR_8804                                                        :{SETX 10}{COMMA}: {STRING} {STRING}
-STR_8805                                                        :{RIGHTARROW}{SETX 10}{COMMA}: {STRING} {STRING}
-STR_8806_GO_TO                                                  :Go to {STATION}
-STR_8807_GO_TO_TRANSFER                                         :Go to {STATION} (Transfer and take cargo)
-STR_8808_GO_TO_UNLOAD                                           :Go to {STATION} (Unload)
-STR_8809_GO_TO_TRANSFER_UNLOAD                                  :Go to {STATION} (Transfer and leave empty)
-STR_880A_GO_TO_LOAD                                             :Go to {STATION} (Load)
-STR_880B_GO_TO_TRANSFER_LOAD                                    :Go to {STATION} (Transfer and wait for full load)
-STR_880C_GO_NON_STOP_TO                                         :Go non-stop to {STATION}
-STR_880D_GO_TO_NON_STOP_TRANSFER                                :Go non-stop to {STATION} (Transfer and take cargo)
-STR_880E_GO_NON_STOP_TO_UNLOAD                                  :Go non-stop to {STATION} (Unload)
-STR_880F_GO_TO_NON_STOP_TRANSFER_UNLOAD                         :Go non-stop to {STATION} (Transfer and leave empty)
-STR_8810_GO_NON_STOP_TO_LOAD                                    :Go non-stop to {STATION} (Load)
-STR_8811_GO_TO_NON_STOP_TRANSFER_LOAD                           :Go non-stop to {STATION} (Transfer and wait for full load)
-STR_GO_TO_TRAIN_DEPOT                                           :Go to {TOWN} Train Depot
-STR_SERVICE_AT_TRAIN_DEPOT                                      :Service at {TOWN} Train Depot
-STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT                             :Go non-stop to {TOWN} Train Depot
-STR_SERVICE_NON_STOP_AT_TRAIN_DEPOT                             :Service non-stop at {TOWN} Train Depot
-
-STR_TIMETABLE_GO_TO                                             :{STRING} {STRING}
-STR_TIMETABLE_TRAVEL_NOT_TIMETABLED                             :Travel (not timetabled)
-STR_TIMETABLE_TRAVEL_FOR                                        :Travel for {STRING}
-STR_TIMETABLE_STAY_FOR                                          :and stay for {STRING}
-STR_TIMETABLE_DAYS                                              :{COMMA} day{P "" s}
-STR_TIMETABLE_TICKS                                             :{COMMA} tick{P "" s}
-
-STR_HEADING_FOR_TRAIN_DEPOT                                     :{ORANGE}Heading for {TOWN} Train Depot
-STR_HEADING_FOR_TRAIN_DEPOT_VEL                                 :{ORANGE}Heading for {TOWN} Train Depot, {VELOCITY}
-STR_HEADING_FOR_TRAIN_DEPOT_SERVICE                             :{LTBLUE}Service at {TOWN} Train Depot
-STR_HEADING_FOR_TRAIN_DEPOT_SERVICE_VEL                         :{LTBLUE}Service at {TOWN} Train Depot, {VELOCITY}
-
-STR_INVALID_ORDER                                               :{RED} (Invalid Order)
-
-STR_UNKNOWN_DESTINATION                                         :unknown destination
-STR_8812_EMPTY                                                  :{LTBLUE}Empty
-STR_8813_FROM                                                   :{LTBLUE}{CARGO} from {STATION}
-STR_FROM_MULT                                                   :{LTBLUE}{CARGO} from {STATION} (x{NUM})
-STR_8814_TRAIN_IS_WAITING_IN_DEPOT                              :{WHITE}Train {COMMA} is waiting in depot
-STR_8815_NEW_VEHICLES                                           :{BLACK}New Vehicles
-STR_8816                                                        :{BLACK}-
-STR_8819_TRAIN_TOO_LONG                                         :{WHITE}Train too long
-STR_881A_TRAINS_CAN_ONLY_BE_ALTERED                             :{WHITE}Trains can only be altered when stopped inside a depot
-STR_881B_TRAINS                                                 :{WHITE}{COMPANY} - {COMMA} Train{P "" s}
-
-STR_881C_NEW_RAIL_VEHICLES                                      :{WHITE}New Rail Vehicles
-STR_NEW_ELRAIL_VEHICLES                                         :{WHITE}New Electric Rail Vehicles
-STR_881D_NEW_MONORAIL_VEHICLES                                  :{WHITE}New Monorail Vehicles
-STR_881E_NEW_MAGLEV_VEHICLES                                    :{WHITE}New Maglev Vehicles
-STR_ALL_AVAIL_RAIL_VEHICLES                                     :{WHITE}Rail Vehicles
-
-STR_881F_BUILD_VEHICLE                                          :{BLACK}Build Vehicle
-STR_CLONE_ROAD_VEHICLE                                          :{BLACK}Clone Vehicle
-STR_CLONE_ROAD_VEHICLE_INFO                                     :{BLACK}This will build a copy of the road vehicle. Control-click will share the orders
-STR_CLONE_ROAD_VEHICLE_DEPOT_INFO                               :{BLACK}This will build a copy of a road vehicle. Click this button and then on a road vehicle inside or outside the depot. Control-click will share the orders
-STR_CLONE_TRAIN                                                 :{BLACK}Clone Train
-STR_CLONE_TRAIN_INFO                                            :{BLACK}This will build a copy of the train including all cars. Control-click will share the orders
-STR_CLONE_TRAIN_DEPOT_INFO                                      :{BLACK}This will build a copy of a train including all cars. Click this button and then on a train inside or outside the depot. Control-click will share the orders
-STR_8820_RENAME                                                 :{BLACK}Rename
-STR_8823_SKIP                                                   :{BLACK}Skip
-STR_8824_DELETE                                                 :{BLACK}Delete
-STR_8825_NON_STOP                                               :{BLACK}Non-Stop
-STR_8826_GO_TO                                                  :{BLACK}Go To
-STR_8827_FULL_LOAD                                              :{BLACK}Full Load
-STR_8828_UNLOAD                                                 :{BLACK}Unload
-STR_REFIT                                                       :{BLACK}Refit
-STR_REFIT_TIP                                                   :{BLACK}Select what cargo type to refit to in this order. Control click to remove refit instruction
-STR_REFIT_ORDER                                                 :(Refit to {STRING})
-STR_TIMETABLE_VIEW                                              :{BLACK}Timetable
-STR_TIMETABLE_VIEW_TOOLTIP                                      :{BLACK}Switch to the timetable view
-STR_8829_ORDERS                                                 :{WHITE}{VEHICLE} (Orders)
-STR_882A_END_OF_ORDERS                                          :{SETX 10}- - End of Orders - -
-STR_FULLLOAD_OR_SERVICE                                         :{SKIP}{SKIP}{STRING}
-STR_SERVICE                                                     :{BLACK}Service
-STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE                           :{WHITE}Can't build railroad vehicle...
-STR_882C_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Built: {LTBLUE}{NUM}{BLACK} Value: {LTBLUE}{CURRENCY}
-STR_882D_VALUE                                                  :{LTBLUE}{ENGINE}{BLACK}   Value: {LTBLUE}{CURRENCY}
-STR_882E                                                        :{WHITE}{VEHICLE}
-STR_882F_LOADING_UNLOADING                                      :{LTBLUE}Loading / Unloading
-STR_TRAIN_MUST_BE_STOPPED                                       :{WHITE}Train must be stopped inside a depot
-STR_8830_CAN_T_SEND_TRAIN_TO_DEPOT                              :{WHITE}Can't send train to depot...
-STR_8831_NO_MORE_SPACE_FOR_ORDERS                               :{WHITE}No more space for orders
-STR_8832_TOO_MANY_ORDERS                                        :{WHITE}Too many orders
-STR_8833_CAN_T_INSERT_NEW_ORDER                                 :{WHITE}Can't insert new order...
-STR_8834_CAN_T_DELETE_THIS_ORDER                                :{WHITE}Can't delete this order...
-STR_8835_CAN_T_MODIFY_THIS_ORDER                                :{WHITE}Can't modify this order...
-STR_CAN_T_MOVE_THIS_ORDER                                       :{WHITE}Can't move this order...
-STR_CAN_T_SKIP_ORDER                                            :{WHITE}Can't skip current order...
-STR_CAN_T_SKIP_TO_ORDER                                         :{WHITE}Can't skip to selected order...
-STR_8837_CAN_T_MOVE_VEHICLE                                     :{WHITE}Can't move vehicle...
-STR_REAR_ENGINE_FOLLOW_FRONT_ERROR                              :{WHITE}The rear engine will always follow its front counterpart
-STR_8838_N_A                                                    :N/A{SKIP}
-STR_8839_CAN_T_SELL_RAILROAD_VEHICLE                            :{WHITE}Can't sell railroad vehicle...
-STR_883A_UNABLE_TO_FIND_ROUTE_TO                                :{WHITE}Unable to find route to local depot
-STR_883B_CAN_T_STOP_START_TRAIN                                 :{WHITE}Can't stop/start train...
-STR_883C_SERVICING_INTERVAL_DAYS                                :{BLACK}Servicing interval: {LTBLUE}{COMMA}days{BLACK}   Last service: {LTBLUE}{DATE_LONG}
-STR_SERVICING_INTERVAL_PERCENT                                  :{BLACK}Servicing interval: {LTBLUE}{COMMA}%{BLACK}   Last service: {LTBLUE}{DATE_LONG}
-STR_883D_TRAINS_CLICK_ON_TRAIN_FOR                              :{BLACK}Trains - click on train for information
-STR_883E_BUILD_NEW_TRAINS_REQUIRES                              :{BLACK}Build new trains (requires train depot)
-STR_883F_TRAINS_CLICK_ON_TRAIN_FOR                              :{BLACK}Trains - click on train for info., drag vehicle to add/remove from train
-STR_8840_BUILD_NEW_TRAIN_VEHICLE                                :{BLACK}Build new train vehicle
-STR_8841_DRAG_TRAIN_VEHICLE_TO_HERE                             :{BLACK}Drag train vehicle to here to sell it
-STR_8842_CENTER_MAIN_VIEW_ON_TRAIN                              :{BLACK}Center main view on train depot location
-STR_8843_TRAIN_VEHICLE_SELECTION                                :{BLACK}Train vehicle selection list - click on vehicle for information
-STR_8844_BUILD_THE_HIGHLIGHTED_TRAIN                            :{BLACK}Build the highlighted train vehicle
-STR_8845_RENAME_TRAIN_VEHICLE_TYPE                              :{BLACK}Rename train vehicle type
-STR_8846_CURRENT_TRAIN_ACTION_CLICK                             :{BLACK}Current train action - click here to stop/start train
-STR_8847_SHOW_TRAIN_S_ORDERS                                    :{BLACK}Show train's orders
-STR_8848_CENTER_MAIN_VIEW_ON_TRAIN                              :{BLACK}Center main view on train's location
-STR_8849_SEND_TRAIN_TO_DEPOT                                    :{BLACK}Send train to depot
-STR_884A_FORCE_TRAIN_TO_PROCEED                                 :{BLACK}Force train to proceed without waiting for signal to clear
-STR_884B_REVERSE_DIRECTION_OF_TRAIN                             :{BLACK}Reverse direction of train
-STR_884C_SHOW_TRAIN_DETAILS                                     :{BLACK}Show train details
-STR_884D_INCREASE_SERVICING_INTERVAL                            :{BLACK}Increase servicing interval
-STR_884E_DECREASE_SERVICING_INTERVAL                            :{BLACK}Decrease servicing interval
-STR_884F_SHOW_DETAILS_OF_CARGO_CARRIED                          :{BLACK}Show details of cargo carried
-STR_8850_SHOW_DETAILS_OF_TRAIN_VEHICLES                         :{BLACK}Show details of train vehicles
-STR_8851_SHOW_CAPACITIES_OF_EACH                                :{BLACK}Show capacities of each vehicle
-STR_8852_SHOW_TOTAL_CARGO                                       :{BLACK}Show total capacity of train, split by cargo type
-STR_8852_ORDERS_LIST_CLICK_ON_ORDER                             :{BLACK}Orders list - click on order to highlight it
-STR_8853_SKIP_THE_CURRENT_ORDER                                 :{BLACK}Skip the current order, and start the next. CTRL + click skips to the selected order)
-STR_8854_DELETE_THE_HIGHLIGHTED                                 :{BLACK}Delete the highlighted order
-STR_8855_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Make the highlighted order non-stop
-STR_8856_INSERT_A_NEW_ORDER_BEFORE                              :{BLACK}Insert a new order before the highlighted order, or add to end of list
-STR_8857_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Make the highlighted order force the vehicle to wait for a full load
-STR_8858_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Make the highlighted order force the vehicle to unload
-STR_TIMETABLE_TOOLTIP                                           :{BLACK}Timetable - click on an order to highlight it.
-STR_TIMETABLE_WAIT_TIME_TOOLTIP                                 :{BLACK}Change the amount of time that the highlighted order should take
-STR_TIMETABLE_CLEAR_TIME_TOOLTIP                                :{BLACK}Clear the amount of time for the highlighted order
-STR_TIMETABLE_RESET_LATENESS_TOOLTIP                            :{BLACK}Reset the lateness counter, so the vehicle will be on time
-STR_SERVICE_HINT                                                :{BLACK}Skip this order unless a service is needed
-STR_VEHICLE_INFO_COST_WEIGHT_SPEED_POWER                        :{BLACK}Cost: {CURRENCY} Weight: {WEIGHT_S}{}Speed: {VELOCITY}  Power: {POWER}{}Running Cost: {CURRENCY}/yr{}Capacity: {CARGO}
-STR_885C_BROKEN_DOWN                                            :{RED}Broken down
-STR_885D_AGE_RUNNING_COST_YR                                    :{BLACK}Age: {LTBLUE}{STRING}{BLACK}   Running Cost: {LTBLUE}{CURRENCY}/yr
-STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED                         :{BLACK}Weight: {LTBLUE}{WEIGHT_S}  {BLACK}Power: {LTBLUE}{POWER}{BLACK} Max. speed: {LTBLUE}{VELOCITY}
-STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE                  :{BLACK}Weight: {LTBLUE}{WEIGHT_S} {BLACK}Power: {LTBLUE}{POWER}{BLACK} Max. speed: {LTBLUE}{VELOCITY} {BLACK}Max. T.E.: {LTBLUE}{FORCE}
-STR_885F_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Profit this year: {LTBLUE}{CURRENCY}  (last year: {CURRENCY})
-STR_8860_RELIABILITY_BREAKDOWNS                                 :{BLACK}Reliability: {LTBLUE}{COMMA}%  {BLACK}Breakdowns since last service: {LTBLUE}{COMMA}
-STR_8861_STOPPED                                                :{RED}Stopped
-STR_8862_CAN_T_MAKE_TRAIN_PASS_SIGNAL                           :{WHITE}Can't make train pass signal at danger...
-STR_8863_CRASHED                                                :{RED}Crashed!
-
-STR_8865_NAME_TRAIN                                             :{WHITE}Name train
-STR_8866_CAN_T_NAME_TRAIN                                       :{WHITE}Can't name train...
-STR_8867_NAME_TRAIN                                             :{BLACK}Name train
-STR_8868_TRAIN_CRASH_DIE_IN_FIREBALL                            :{BLACK}{BIGFONT}Train Crash!{}{COMMA} die in fireball after collision
-STR_8869_CAN_T_REVERSE_DIRECTION                                :{WHITE}Can't reverse direction of train...
-STR_886A_RENAME_TRAIN_VEHICLE_TYPE                              :{WHITE}Rename train vehicle type
-STR_886B_CAN_T_RENAME_TRAIN_VEHICLE                             :{WHITE}Can't rename train vehicle type...
-STR_886D_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Make the highlighted order force the vehicle to dump cargo
-STR_886F_TRANSFER                                               :{BLACK}Transfer
-STR_CLEAR_TIME                                                  :{BLACK}Clear Time
-STR_RESET_LATENESS                                              :{BLACK}Reset Late Counter
-
-STR_TRAIN_STOPPING                                              :{RED}Stopping
-STR_TRAIN_STOPPING_VEL                                          :{RED}Stopping, {VELOCITY}
-STR_INCOMPATIBLE_RAIL_TYPES                                     :Incompatible rail types
-STR_TRAIN_NO_POWER                                              :{RED}No power
-STR_TRAIN_START_NO_CATENARY                                     :This track lacks catenary, so the train can't start
-
-STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}New {STRING} now available!
-STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{ENGINE}
-STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}New {STRING} now available!  -  {ENGINE}
-
-STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Can't sell destroyed vehicle...
-
-STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Can't timetable vehicle...
-STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Vehicles can only wait at stations.
-STR_TIMETABLE_NOT_STOPPING_HERE                                 :{WHITE}This vehicle is not stopping at this station.
-STR_TIMETABLE_CHANGE_TIME                                       :{BLACK}Change Time
-STR_TIMETABLE_STATUS_ON_TIME                                    :This vehicle is currently running on time
-STR_TIMETABLE_STATUS_LATE                                       :This vehicle is currently running {STRING} late
-STR_TIMETABLE_STATUS_EARLY                                      :This vehicle is currently running {STRING} early
-STR_TIMETABLE_TOTAL_TIME                                        :This timetable will take {STRING} to complete
-STR_TIMETABLE_TOTAL_TIME_INCOMPLETE                             :This timetable will take at least {STRING} to complete (not all timetabled)
-STR_TIMETABLE_AUTOFILL                                          :{BLACK}Autofill
-STR_TIMETABLE_AUTOFILL_TOOLTIP                                  :{BLACK}Fill the timetable automatically with the values from the first journey
-
-##id 0x9000
-STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Road vehicle in the way
-STR_9001_ROAD_VEHICLES                                          :{WHITE}{COMPANY} - {COMMA} Road Vehicle{P "" s}
-STR_9002                                                        :{WHITE}{VEHICLE}
-STR_9003_ROAD_VEHICLE_DEPOT                                     :{WHITE}{TOWN} Road Vehicle Depot
-STR_9004_NEW_VEHICLES                                           :{BLACK}New Vehicles
-STR_9006_NEW_ROAD_VEHICLES                                      :{WHITE}New Road Vehicles
-STR_9007_BUILD_VEHICLE                                          :{BLACK}Build Vehicle
-STR_9009_CAN_T_BUILD_ROAD_VEHICLE                               :{WHITE}Can't build road vehicle...
-STR_900C_DETAILS                                                :{WHITE}{VEHICLE} (Details)
-STR_900D_AGE_RUNNING_COST_YR                                    :{BLACK}Age: {LTBLUE}{STRING}{BLACK}   Running Cost: {LTBLUE}{CURRENCY}/yr
-STR_900E_MAX_SPEED                                              :{BLACK}Max. speed: {LTBLUE}{VELOCITY}
-STR_900F_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Profit this year: {LTBLUE}{CURRENCY}  (last year: {CURRENCY})
-STR_9010_RELIABILITY_BREAKDOWNS                                 :{BLACK}Reliability: {LTBLUE}{COMMA}%  {BLACK}Breakdowns since last service: {LTBLUE}{COMMA}
-STR_9011_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Built: {LTBLUE}{NUM}{BLACK} Value: {LTBLUE}{CURRENCY}
-STR_9012_CAPACITY                                               :{BLACK}Capacity: {LTBLUE}{CARGO}
-STR_9013_MUST_BE_STOPPED_INSIDE                                 :{WHITE}...must be stopped inside a road vehicle depot
-STR_9014_CAN_T_SELL_ROAD_VEHICLE                                :{WHITE}Can't sell road vehicle...
-STR_9015_CAN_T_STOP_START_ROAD_VEHICLE                          :{WHITE}Can't stop/start road vehicle...
-STR_9016_ROAD_VEHICLE_IS_WAITING                                :{WHITE}Road Vehicle {COMMA} is waiting in depot
-STR_HEADING_FOR_ROAD_DEPOT                                      :{ORANGE}Heading for {TOWN} Road Depot
-STR_HEADING_FOR_ROAD_DEPOT_VEL                                  :{ORANGE}Heading for {TOWN} Road Depot, {VELOCITY}
-STR_HEADING_FOR_ROAD_DEPOT_SERVICE                              :{LTBLUE}Service at {TOWN} Road Depot
-STR_HEADING_FOR_ROAD_DEPOT_SERVICE_VEL                          :{LTBLUE}Service at {TOWN} Road Depot, {VELOCITY}
-STR_9018_CAN_T_SEND_VEHICLE_TO_DEPOT                            :{WHITE}Can't send vehicle to depot...
-STR_9019_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Unable to find local depot
-STR_901A_ROAD_VEHICLES_CLICK_ON                                 :{BLACK}Road vehicles - click on vehicle for information
-STR_901B_BUILD_NEW_ROAD_VEHICLES                                :{BLACK}Build new road vehicles (requires road vehicle depot)
-STR_901C_CURRENT_VEHICLE_ACTION                                 :{BLACK}Current vehicle action - click here to stop/start vehicle
-STR_901D_SHOW_VEHICLE_S_ORDERS                                  :{BLACK}Show vehicle's orders
-STR_901E_CENTER_MAIN_VIEW_ON_VEHICLE                            :{BLACK}Center main view on vehicle's location
-STR_901F_SEND_VEHICLE_TO_DEPOT                                  :{BLACK}Send vehicle to depot
-STR_9020_FORCE_VEHICLE_TO_TURN_AROUND                           :{BLACK}Force vehicle to turn around
-STR_9021_SHOW_ROAD_VEHICLE_DETAILS                              :{BLACK}Show road vehicle details
-STR_9022_VEHICLES_CLICK_ON_VEHICLE                              :{BLACK}Vehicles - click on vehicle for information
-STR_9023_BUILD_NEW_ROAD_VEHICLE                                 :{BLACK}Build new road vehicle
-STR_9024_DRAG_ROAD_VEHICLE_TO_HERE                              :{BLACK}Drag road vehicle to here to sell it
-STR_9025_CENTER_MAIN_VIEW_ON_ROAD                               :{BLACK}Center main view on road vehicle depot location
-STR_9026_ROAD_VEHICLE_SELECTION                                 :{BLACK}Road vehicle selection list - click on vehicle for information
-STR_9027_BUILD_THE_HIGHLIGHTED_ROAD                             :{BLACK}Build the highlighted road vehicle
-STR_902A_COST_SPEED_RUNNING_COST                                :{BLACK}Cost: {CURRENCY}{}Speed: {VELOCITY}{}Running Cost: {CURRENCY}/yr{}Capacity: {CARGO}
-STR_ARTICULATED_RV_CAPACITY                                     :{BLACK}Capacity: {LTBLUE}
-STR_BARE_CARGO                                                  :{CARGO}
-
-STR_902C_NAME_ROAD_VEHICLE                                      :{WHITE}Name road vehicle
-STR_902D_CAN_T_NAME_ROAD_VEHICLE                                :{WHITE}Can't name road vehicle...
-STR_902E_NAME_ROAD_VEHICLE                                      :{BLACK}Name road vehicle
-STR_902F_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Citizens celebrate . . .{}First bus arrives at {STATION}!
-STR_9030_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Citizens celebrate . . .{}First truck arrives at {STATION}!
-STR_902F_CITIZENS_CELEBRATE_FIRST_TRAM                          :{BLACK}{BIGFONT}Citizens celebrate . . .{}First passenger tram arrives at {STATION}!
-STR_9030_CITIZENS_CELEBRATE_FIRST_TRAM                          :{BLACK}{BIGFONT}Citizens celebrate . . .{}First freight tram arrives at {STATION}!
-STR_9031_ROAD_VEHICLE_CRASH_DRIVER                              :{BLACK}{BIGFONT}Road Vehicle Crash!{}Driver dies in fireball after collision with train
-STR_9032_ROAD_VEHICLE_CRASH_DIE                                 :{BLACK}{BIGFONT}Road Vehicle Crash!{}{COMMA} die in fireball after collision with train
-STR_9033_CAN_T_MAKE_VEHICLE_TURN                                :{WHITE}Can't make vehicle turn around...
-STR_ONLY_TURN_SINGLE_UNIT                                       :{WHITE}Can't turn vehicles consisting of multiple units
-STR_9034_RENAME                                                 :{BLACK}Rename
-STR_9035_RENAME_ROAD_VEHICLE_TYPE                               :{BLACK}Rename road vehicle type
-STR_9036_RENAME_ROAD_VEHICLE_TYPE                               :{WHITE}Rename road vehicle type
-STR_9037_CAN_T_RENAME_ROAD_VEHICLE                              :{WHITE}Can't rename road vehicle type...
-STR_9038_GO_TO_ROADVEH_DEPOT                                    :Go to {TOWN} Road Vehicle Depot
-STR_SERVICE_AT_ROADVEH_DEPOT                                    :Service at {TOWN} Road Vehicle Depot
-
-STR_REFIT_ROAD_VEHICLE_TO_CARRY                                 :{BLACK}Refit road vehicle to carry a different cargo type
-STR_REFIT_ROAD_VEHICLE                                          :{BLACK}Refit road vehicle
-STR_REFIT_ROAD_VEHICLE_TO_CARRY_HIGHLIGHTED                     :{BLACK}Refit road vehicle to carry highlighted cargo type
-STR_REFIT_ROAD_VEHICLE_CAN_T                                    :{WHITE}Can't refit road vehicle...
-STR_ROAD_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Select type of cargo for road vehicle to carry
-
-##id 0x9800
-STR_9800_DOCK_CONSTRUCTION                                      :Dock construction
-STR_9801_DOCK_CONSTRUCTION                                      :{WHITE}Dock construction
-STR_9802_CAN_T_BUILD_DOCK_HERE                                  :{WHITE}Can't build dock here...
-STR_9803_SHIP_DEPOT                                             :{WHITE}{TOWN} Ship Depot
-STR_9804_NEW_SHIPS                                              :{BLACK}New Ships
-STR_9805_SHIPS                                                  :{WHITE}{COMPANY} - {COMMA} Ship{P "" s}
-STR_9808_NEW_SHIPS                                              :{WHITE}New Ships
-STR_9809_BUILD_SHIP                                             :{BLACK}Build Ship
-STR_CLONE_SHIP                                                  :{BLACK}Clone Ship
-STR_CLONE_SHIP_INFO                                             :{BLACK}This will build a copy of the ship. Control-click will share the orders
-STR_CLONE_SHIP_DEPOT_INFO                                       :{BLACK}This will build a copy of a ship. Click this button and then on a ship inside or outside the depot. Control-click will share the orders
-STR_980B_SHIP_MUST_BE_STOPPED_IN                                :{WHITE}Ship must be stopped in depot
-STR_980C_CAN_T_SELL_SHIP                                        :{WHITE}Can't sell ship...
-STR_980D_CAN_T_BUILD_SHIP                                       :{WHITE}Can't build ship...
-STR_980E_SHIP_IN_THE_WAY                                        :{WHITE}Ship in the way
-STR_980F                                                        :{WHITE}{VEHICLE}
-STR_9811_DETAILS                                                :{WHITE}{VEHICLE} (Details)
-STR_9812_AGE_RUNNING_COST_YR                                    :{BLACK}Age: {LTBLUE}{STRING}{BLACK}   Running Cost: {LTBLUE}{CURRENCY}/yr
-STR_9813_MAX_SPEED                                              :{BLACK}Max. speed: {LTBLUE}{VELOCITY}
-STR_9814_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Profit this year: {LTBLUE}{CURRENCY}  (last year: {CURRENCY})
-STR_9815_RELIABILITY_BREAKDOWNS                                 :{BLACK}Reliability: {LTBLUE}{COMMA}%  {BLACK}Breakdowns since last service: {LTBLUE}{COMMA}
-STR_9816_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Built: {LTBLUE}{NUM}{BLACK} Value: {LTBLUE}{CURRENCY}
-STR_9817_CAPACITY                                               :{BLACK}Capacity: {LTBLUE}{CARGO}
-STR_9818_CAN_T_STOP_START_SHIP                                  :{WHITE}Can't stop/start ship...
-STR_9819_CAN_T_SEND_SHIP_TO_DEPOT                               :{WHITE}Can't send ship to depot...
-STR_981A_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Unable to find local depot
-STR_HEADING_FOR_SHIP_DEPOT                                      :{ORANGE}Heading for {TOWN} Ship Depot
-STR_HEADING_FOR_SHIP_DEPOT_VEL                                  :{ORANGE}Heading for {TOWN} Ship Depot, {VELOCITY}
-STR_HEADING_FOR_SHIP_DEPOT_SERVICE                              :{LTBLUE}Service at {TOWN} Ship Depot
-STR_HEADING_FOR_SHIP_DEPOT_SERVICE_VEL                          :{LTBLUE}Service at {TOWN} Ship Depot, {VELOCITY}
-STR_981C_SHIP_IS_WAITING_IN_DEPOT                               :{WHITE}Ship {COMMA} is waiting in depot
-STR_981D_BUILD_SHIP_DOCK                                        :{BLACK}Build ship dock
-STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING                          :{BLACK}Build ship depot (for building and servicing ships)
-STR_981F_SHIPS_CLICK_ON_SHIP_FOR                                :{BLACK}Ships - click on ship for information
-STR_9820_BUILD_NEW_SHIP                                         :{BLACK}Build new ship
-STR_9821_DRAG_SHIP_TO_HERE_TO_SELL                              :{BLACK}Drag ship to here to sell it
-STR_9822_CENTER_MAIN_VIEW_ON_SHIP                               :{BLACK}Center main view on ship depot location
-STR_9823_SHIPS_CLICK_ON_SHIP_FOR                                :{BLACK}Ships - click on ship for information
-STR_9824_BUILD_NEW_SHIPS_REQUIRES                               :{BLACK}Build new ships (requires ship depot)
-STR_9825_SHIP_SELECTION_LIST_CLICK                              :{BLACK}Ship selection list - click on ship for information
-STR_9826_BUILD_THE_HIGHLIGHTED_SHIP                             :{BLACK}Build the highlighted ship
-STR_9827_CURRENT_SHIP_ACTION_CLICK                              :{BLACK}Current ship action - click here to stop/start ship
-STR_9828_SHOW_SHIP_S_ORDERS                                     :{BLACK}Show ship's orders
-STR_9829_CENTER_MAIN_VIEW_ON_SHIP                               :{BLACK}Center main view on ship's location
-STR_982A_SEND_SHIP_TO_DEPOT                                     :{BLACK}Send ship to depot
-STR_982B_SHOW_SHIP_DETAILS                                      :{BLACK}Show ship details
-STR_982E_COST_MAX_SPEED_CAPACITY                                :{BLACK}Cost: {CURRENCY} Max. Speed: {VELOCITY}{}Capacity: {CARGO}{}Running Cost: {CURRENCY}/yr
-STR_982F_NAME_SHIP                                              :{BLACK}Name ship
-
-STR_9831_NAME_SHIP                                              :{WHITE}Name ship
-STR_9832_CAN_T_NAME_SHIP                                        :{WHITE}Can't name ship...
-STR_9833_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Citizens celebrate . . .{}First ship arrives at {STATION}!
-STR_9834_POSITION_BUOY_WHICH_CAN                                :{BLACK}Place a buoy which can be used as a waypoint
-STR_9835_CAN_T_POSITION_BUOY_HERE                               :{WHITE}Can't place buoy here...
-STR_9836_RENAME                                                 :{BLACK}Rename
-STR_9837_RENAME_SHIP_TYPE                                       :{BLACK}Rename ship type
-STR_9838_RENAME_SHIP_TYPE                                       :{WHITE}Rename ship type
-STR_9839_CAN_T_RENAME_SHIP_TYPE                                 :{WHITE}Can't rename ship type...
-STR_983A_REFIT_CARGO_SHIP_TO_CARRY                              :{BLACK}Refit cargo ship to carry a different cargo type
-STR_983B_REFIT                                                  :{WHITE}{VEHICLE} (Refit)
-STR_983C_REFIT_SHIP                                             :{BLACK}Refit ship
-STR_983D_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Select type of cargo for ship to carry
-STR_983E_REFIT_SHIP_TO_CARRY_HIGHLIGHTED                        :{BLACK}Refit ship to carry highlighted cargo type
-STR_983F_SELECT_CARGO_TYPE_TO_CARRY                             :{GOLD}Select cargo type to carry:
-STR_9840_NEW_CAPACITY_COST_OF_REFIT                             :{BLACK}New capacity: {GOLD}{CARGO}{}{BLACK}Cost of refit: {GOLD}{CURRENCY}
-STR_9841_CAN_T_REFIT_SHIP                                       :{WHITE}Can't refit ship...
-STR_9842_REFITTABLE                                             :(refittable)
-STR_GO_TO_SHIP_DEPOT                                            :Go to {TOWN} Ship Depot
-SERVICE_AT_SHIP_DEPOT                                           :Service at {TOWN} Ship Depot
-
-##id 0xA000
-STR_A000_AIRPORTS                                               :{WHITE}Airports
-STR_A001_CAN_T_BUILD_AIRPORT_HERE                               :{WHITE}Can't build airport here...
-STR_A002_AIRCRAFT_HANGAR                                        :{WHITE}{STATION} Aircraft Hangar
-STR_A003_NEW_AIRCRAFT                                           :{BLACK}New Aircraft
-STR_CLONE_AIRCRAFT                                              :{BLACK}Clone Aircraft
-STR_CLONE_AIRCRAFT_INFO                                         :{BLACK}This will build a copy of the aircraft. Control-click will share the orders
-STR_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW                           :{BLACK}This will build a copy of an aircraft. Click this button and then on an aircraft inside or outside the hangar. Control-click will share the orders
-STR_A005_NEW_AIRCRAFT                                           :{WHITE}New Aircraft
-STR_A006_BUILD_AIRCRAFT                                         :{BLACK}Build Aircraft
-STR_A008_CAN_T_BUILD_AIRCRAFT                                   :{WHITE}Can't build aircraft...
-STR_A009_AIRCRAFT                                               :{WHITE}{COMPANY} - {COMMA} Aircraft
-STR_A00A                                                        :{WHITE}{VEHICLE}
-STR_A00B_ORDERS                                                 :{WHITE}{VEHICLE} (Orders)
-STR_A00C_DETAILS                                                :{WHITE}{VEHICLE} (Details)
-STR_A00D_AGE_RUNNING_COST_YR                                    :{BLACK}Age: {LTBLUE}{STRING}{BLACK}   Running Cost: {LTBLUE}{CURRENCY}/yr
-STR_A00E_MAX_SPEED                                              :{BLACK}Max. speed: {LTBLUE}{VELOCITY}
-STR_A00F_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Profit this year: {LTBLUE}{CURRENCY}  (last year: {CURRENCY})
-STR_A010_RELIABILITY_BREAKDOWNS                                 :{BLACK}Reliability: {LTBLUE}{COMMA}%  {BLACK}Breakdowns since last service: {LTBLUE}{COMMA}
-STR_A011_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Built: {LTBLUE}{NUM}{BLACK} Value: {LTBLUE}{CURRENCY}
-STR_A012_CAN_T_SEND_AIRCRAFT_TO                                 :{WHITE}Can't send aircraft to hangar...
-STR_HEADING_FOR_HANGAR                                          :{ORANGE}Heading for {STATION} Hangar
-STR_HEADING_FOR_HANGAR_VEL                                      :{ORANGE}Heading for {STATION} Hangar, {VELOCITY}
-STR_HEADING_FOR_HANGAR_SERVICE                                  :{LTBLUE}Service at {STATION} Hangar
-STR_HEADING_FOR_HANGAR_SERVICE_VEL                              :{LTBLUE}Service at {STATION} Hangar, {VELOCITY}
-STR_A014_AIRCRAFT_IS_WAITING_IN                                 :{WHITE}Aircraft {COMMA} is waiting in the aircraft hangar
-STR_A015_AIRCRAFT_IN_THE_WAY                                    :{WHITE}Aircraft in the way
-STR_A016_CAN_T_STOP_START_AIRCRAFT                              :{WHITE}Can't stop/start aircraft...
-STR_A017_AIRCRAFT_IS_IN_FLIGHT                                  :{WHITE}Aircraft is in flight
-STR_A019_CAPACITY                                               :{BLACK}Capacity: {LTBLUE}{CARGO}, {CARGO}
-STR_A01A_CAPACITY                                               :{BLACK}Capacity: {LTBLUE}{CARGO}
-STR_A01B_AIRCRAFT_MUST_BE_STOPPED                               :{WHITE}Aircraft must be stopped in hangar
-STR_A01C_CAN_T_SELL_AIRCRAFT                                    :{WHITE}Can't sell aircraft...
-STR_A01D_AIRPORT_CONSTRUCTION                                   :Airport construction
-STR_A01E_BUILD_AIRPORT                                          :{BLACK}Build airport
-STR_A01F_AIRCRAFT_CLICK_ON_AIRCRAFT                             :{BLACK}Aircraft - click on aircraft for information
-STR_A020_BUILD_NEW_AIRCRAFT_REQUIRES                            :{BLACK}Build new aircraft (requires airport with hangar)
-STR_A021_AIRCRAFT_CLICK_ON_AIRCRAFT                             :{BLACK}Aircraft - click on aircraft for information
-STR_A022_BUILD_NEW_AIRCRAFT                                     :{BLACK}Build new aircraft
-STR_A023_DRAG_AIRCRAFT_TO_HERE_TO                               :{BLACK}Drag aircraft to here to sell it
-STR_A024_CENTER_MAIN_VIEW_ON_HANGAR                             :{BLACK}Center main view on hangar location
-STR_A025_AIRCRAFT_SELECTION_LIST                                :{BLACK}Aircraft selection list - click on aircraft for information
-STR_A026_BUILD_THE_HIGHLIGHTED_AIRCRAFT                         :{BLACK}Build the highlighted aircraft
-STR_A027_CURRENT_AIRCRAFT_ACTION                                :{BLACK}Current aircraft action - click here to stop/start aircraft
-STR_A028_SHOW_AIRCRAFT_S_ORDERS                                 :{BLACK}Show aircraft's orders
-STR_A029_CENTER_MAIN_VIEW_ON_AIRCRAFT                           :{BLACK}Center main view on aircraft's location
-STR_A02A_SEND_AIRCRAFT_TO_HANGAR                                :{BLACK}Send aircraft to hangar
-STR_A02B_SHOW_AIRCRAFT_DETAILS                                  :{BLACK}Show aircraft details
-STR_A02E_COST_MAX_SPEED_CAPACITY                                :{BLACK}Cost: {CURRENCY} Max. Speed: {VELOCITY}{}Capacity: {COMMA} passengers, {COMMA} bags of mail{}Running Cost: {CURRENCY}/yr
-
-STR_A030_NAME_AIRCRAFT                                          :{WHITE}Name aircraft
-STR_A031_CAN_T_NAME_AIRCRAFT                                    :{WHITE}Can't name aircraft...
-STR_A032_NAME_AIRCRAFT                                          :{BLACK}Name aircraft
-STR_A033_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Citizens celebrate . . .{}First aircraft arrives at {STATION}!
-STR_A034_PLANE_CRASH_DIE_IN_FIREBALL                            :{BLACK}{BIGFONT}Plane Crash!{}{COMMA} die in fireball at {STATION}
-STR_PLANE_CRASH_OUT_OF_FUEL                                     :{BLACK}{BIGFONT}Plane Crash!{}Aircraft ran out of fuel, {COMMA} die in fireball!
-STR_A036                                                        :{TINYFONT}{BLACK}{STATION}
-STR_A037_RENAME                                                 :{BLACK}Rename
-STR_A038_RENAME_AIRCRAFT_TYPE                                   :{BLACK}Rename aircraft type
-STR_A039_RENAME_AIRCRAFT_TYPE                                   :{WHITE}Rename aircraft type
-STR_A03A_CAN_T_RENAME_AIRCRAFT_TYPE                             :{WHITE}Can't rename aircraft type...
-STR_A03B_REFIT_AIRCRAFT_TO_CARRY                                :{BLACK}Refit aircraft to carry a different cargo type
-STR_A03C_REFIT                                                  :{WHITE}{VEHICLE} (Refit)
-STR_A03D_REFIT_AIRCRAFT                                         :{BLACK}Refit aircraft
-STR_A03E_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Select type of cargo for aircraft to carry
-STR_A03F_REFIT_AIRCRAFT_TO_CARRY                                :{BLACK}Refit aircraft to carry highlighted cargo type
-STR_A040_SELECT_CARGO_TYPE_TO_CARRY                             :{GOLD}Select cargo type to carry:
-STR_A041_NEW_CAPACITY_COST_OF_REFIT                             :{BLACK}New capacity: {GOLD}{STRING}{}{BLACK}Cost of refit: {GOLD}{CURRENCY}
-STR_A042_CAN_T_REFIT_AIRCRAFT                                   :{WHITE}Can't refit aircraft...
-STR_GO_TO_AIRPORT_HANGAR                                        :Go to {STATION} Hangar
-SERVICE_AT_AIRPORT_HANGAR                                       :Service at {STATION} Hangar
-
-STR_TIMETABLE_TITLE                                             :{WHITE}{VEHICLE} (Timetable)
-
-##id 0xB000
-STR_B000_ZEPPELIN_DISASTER_AT                                   :{BLACK}{BIGFONT}Zeppelin disaster at {STATION}!
-STR_B001_ROAD_VEHICLE_DESTROYED                                 :{BLACK}{BIGFONT}Road vehicle destroyed in 'UFO' collision!
-STR_B002_OIL_REFINERY_EXPLOSION                                 :{BLACK}{BIGFONT}Oil refinery explosion near {TOWN}!
-STR_B003_FACTORY_DESTROYED_IN_SUSPICIOUS                        :{BLACK}{BIGFONT}Factory destroyed in suspicious circumstances near {TOWN}!
-STR_B004_UFO_LANDS_NEAR                                         :{BLACK}{BIGFONT}'UFO' lands near {TOWN}!
-STR_B005_COAL_MINE_SUBSIDENCE_LEAVES                            :{BLACK}{BIGFONT}Coal mine subsidence leaves trail of destruction near {TOWN}!
-STR_B006_FLOOD_VEHICLE_DESTROYED                                :{BLACK}{BIGFONT}Floods!{}At least {COMMA} missing, presumed dead after significant flooding!
-
-STR_BRIBE_FAILED                                                :{WHITE}Your attempted bribery has been
-STR_BRIBE_FAILED_2                                              :{WHITE}discovered by a regional investigator
-STR_BUILD_DATE                                                  :{BLACK}Built: {LTBLUE}{DATE_LONG}
-
-STR_PERFORMANCE_DETAIL                                          :{WHITE}Detailed performance rating
-STR_PERFORMANCE_DETAIL_KEY                                      :{BLACK}Detail
-STR_PERFORMANCE_DETAIL_AMOUNT_CURRENCY                          :{BLACK}({CURRCOMPACT}/{CURRCOMPACT})
-STR_PERFORMANCE_DETAIL_AMOUNT_INT                               :{BLACK}({COMMA}/{COMMA})
-STR_PERFORMANCE_DETAIL_PERCENT                                  :{WHITE}{NUM}%
-SET_PERFORMANCE_DETAIL_INT                                      :{BLACK}{NUM}
-############ Those following lines need to be in this order!!
-STR_PERFORMANCE_DETAIL_VEHICLES                                 :{BLACK}Vehicles:
-STR_PERFORMANCE_DETAIL_STATIONS                                 :{BLACK}Stations:
-STR_PERFORMANCE_DETAIL_MIN_PROFIT                               :{BLACK}Min. profit:
-STR_PERFORMANCE_DETAIL_MIN_INCOME                               :{BLACK}Min. income:
-STR_PERFORMANCE_DETAIL_MAX_INCOME                               :{BLACK}Max. income:
-STR_PERFORMANCE_DETAIL_DELIVERED                                :{BLACK}Delivered:
-STR_PERFORMANCE_DETAIL_CARGO                                    :{BLACK}Cargo:
-STR_PERFORMANCE_DETAIL_MONEY                                    :{BLACK}Money:
-STR_PERFORMANCE_DETAIL_LOAN                                     :{BLACK}Loan:
-STR_PERFORMANCE_DETAIL_TOTAL                                    :{BLACK}Total:
-############ End of order list
-STR_PERFORMANCE_DETAIL_VEHICLES_TIP                             :{BLACK}Number of vehicles; this includes road vehicles, trains, ships and aircraft
-STR_PERFORMANCE_DETAIL_STATIONS_TIP                             :{BLACK}Number of station parts. Every part of a station (e.g. train station, bus stop, airport) is counted, even if they are connected to one station.
-STR_PERFORMANCE_DETAIL_MIN_PROFIT_TIP                           :{BLACK}The profit of the vehicle with the lowest income (of all vehicles older than 2 years)
-STR_PERFORMANCE_DETAIL_MIN_INCOME_TIP                           :{BLACK}Amount of cash made in the month with the lowest profit of the past 12 quarters
-STR_PERFORMANCE_DETAIL_MAX_INCOME_TIP                           :{BLACK}Amount of cash made in the month with the highest profit of the past 12 quarters
-STR_PERFORMANCE_DETAIL_DELIVERED_TIP                            :{BLACK}Units of cargo delivered in the past four quarters.
-STR_PERFORMANCE_DETAIL_CARGO_TIP                                :{BLACK}Number of types of cargo delivered in the past quarter.
-STR_PERFORMANCE_DETAIL_MONEY_TIP                                :{BLACK}Amount of money this company has in the bank
-STR_PERFORMANCE_DETAIL_LOAN_TIP                                 :{BLACK}The amount of money this company has taken on loan
-STR_PERFORMANCE_DETAIL_TOTAL_TIP                                :{BLACK}Total points out of possible points
-
-STR_NEWGRF_SETTINGS_BUTTON                                      :{BLACK}NewGRF Settings
-STR_NEWGRF_SETTINGS_CAPTION                                     :{WHITE}Newgrf settings
-STR_NEWGRF_APPLY_CHANGES                                        :{BLACK}Apply changes
-STR_NEWGRF_SET_PARAMETERS                                       :{BLACK}Set parameters
-STR_NEWGRF_TIP                                                  :{BLACK}A list of all the Newgrf sets that you have installed. Click a set to change the settings.
-STR_NEWGRF_NO_FILES_INSTALLED                                   :{BLACK}There are currently no newgrf files installed! Please refer to the manual for instructions to install new graphics.
-STR_NEWGRF_FILENAME                                             :{BLACK}Filename: {SILVER}{STRING}
-STR_NEWGRF_GRF_ID                                               :{BLACK}GRF ID: {SILVER}{STRING}
-STR_NEWGRF_MD5SUM                                               :{BLACK}MD5sum: {SILVER}{STRING}
-STR_NEWGRF_CONFIRMATION_TEXT                                    :{YELLOW}You are about to make changes to a running game; this can crash OpenTTD.{}Are you absolutely sure about this?
-
-STR_NEWGRF_ERROR_MSG_INFO                                       :{SILVER}{STRING}
-STR_NEWGRF_ERROR_MSG_WARNING                                    :{RED}Warning: {SILVER}{STRING}
-STR_NEWGRF_ERROR_MSG_ERROR                                      :{RED}Error: {SILVER}{STRING}
-STR_NEWGRF_ERROR_MSG_FATAL                                      :{RED}Fatal: {SILVER}{STRING}
-STR_NEWGRF_ERROR_VERSION_NUMBER                                 :{STRING} will not work with the TTDPatch version reported by OpenTTD.
-STR_NEWGRF_ERROR_DOS_OR_WINDOWS                                 :{STRING} is for the {STRING} version of TTD.
-STR_NEWGRF_ERROR_UNSET_SWITCH                                   :{STRING} is designed to be used with {STRING}
-STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Invalid parameter for {STRING}: parameter {STRING} ({NUM})
-STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} must be loaded before {STRING}.
-STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} must be loaded after {STRING}.
-STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :the GRF file it was designed to translate
-
-STR_NEWGRF_ADD                                                  :{BLACK}Add
-STR_NEWGRF_ADD_TIP                                              :{BLACK}Add a NewGRF file to the list
-STR_NEWGRF_REMOVE                                               :{BLACK}Remove
-STR_NEWGRF_REMOVE_TIP                                           :{BLACK}Remove the selected NewGRF file from the list
-STR_NEWGRF_MOVEUP                                               :{BLACK}Move Up
-STR_NEWGRF_MOVEUP_TIP                                           :{BLACK}Move the selected NewGRF file up the list
-STR_NEWGRF_MOVEDOWN                                             :{BLACK}Move Down
-STR_NEWGRF_MOVEDOWN_TIP                                         :{BLACK}Move the selected NewGRF file down the list
-STR_NEWGRF_FILE_TIP                                             :{BLACK}A list of the NewGRF files that are installed. Click a file to change its parameters
-STR_NEWGRF_PARAMETER                                            :{BLACK}Parameters: {SILVER}{STRING}
-STR_NEWGRF_PARAMETER_QUERY                                      :{BLACK}Enter NewGRF parameters
-STR_NEWGRF_NO_INFO                                              :{BLACK}No information available
-
-STR_NEWGRF_ADD_CAPTION                                          :{WHITE}Available NewGRF files
-STR_NEWGRF_ADD_FILE                                             :{BLACK}Add to selection
-STR_NEWGRF_ADD_FILE_TIP                                         :{BLACK}Add the selected NewGRF file to your configuration
-STR_NEWGRF_RESCAN_FILES                                         :{BLACK}Rescan files
-STR_NEWGRF_RESCAN_FILES_TIP                                     :{BLACK}Update the list of available NewGRF files
-STR_NEWGRF_DUPLICATE_GRFID                                      :{WHITE}Cannot add file: duplicate GRF ID
-
-STR_NEWGRF_NOT_FOUND                                            :{RED}Matching file not found
-STR_NEWGRF_DISABLED                                             :{RED}Disabled
-STR_NEWGRF_COMPATIBLE_LOADED                                    :{ORANGE}Matching file not found (compatible GRF loaded)
-
-STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Compatible GRF(s) loaded for missing files
-STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Missing GRF file(s) have been disabled
-STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Missing GRF file(s) to be able to load game
-
-STR_CURRENCY_WINDOW                                             :{WHITE}Custom currency
-STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Exchange rate: {ORANGE}{CURRENCY} = £ {COMMA}
-STR_CURRENCY_SEPARATOR                                          :{LTBLUE}Separator:
-STR_CURRENCY_PREFIX                                             :{LTBLUE}Prefix:
-STR_CURRENCY_SUFFIX                                             :{LTBLUE}Suffix:
-STR_CURRENCY_SWITCH_TO_EURO                                     :{LTBLUE}Switch to Euro: {ORANGE}{NUM}
-STR_CURRENCY_SWITCH_TO_EURO_NEVER                               :{LTBLUE}Switch to Euro: {ORANGE}never
-STR_CURRENCY_PREVIEW                                            :{LTBLUE}Preview: {ORANGE}{CURRENCY}
-STR_CURRENCY_CHANGE_PARAMETER                                   :{BLACK}Change custom currency parameter
-
-STR_TRAIN                                                       :{BLACK}{TRAIN}
-STR_BUS                                                         :{BLACK}{BUS}
-STR_LORRY                                                       :{BLACK}{LORRY}
-STR_PLANE                                                       :{BLACK}{PLANE}
-STR_SHIP                                                        :{BLACK}{SHIP}
-
-STR_SCHEDULED_TRAINS                                            :{WHITE}{STATION} - {COMMA} Train{P "" s}
-STR_SCHEDULED_ROAD_VEHICLES                                     :{WHITE}{STATION} - {COMMA} Road Vehicle{P "" s}
-STR_SCHEDULED_AIRCRAFT                                          :{WHITE}{STATION} - {COMMA} Aircraft
-STR_SCHEDULED_SHIPS                                             :{WHITE}{STATION} - {COMMA} Ship{P "" s}
-
-STR_SCHEDULED_TRAINS_TIP                                        :{BLACK}Show all trains which have this station on their schedule
-STR_SCHEDULED_ROAD_VEHICLES_TIP                                 :{BLACK}Show all road vehicles which have this station on their schedule
-STR_SCHEDULED_AIRCRAFT_TIP                                      :{BLACK}Show all aircraft which have this station on their schedule
-STR_SCHEDULED_SHIPS_TIP                                         :{BLACK}Show all ships which have this station on their schedule
-
-STR_VEH_WITH_SHARED_ORDERS_LIST                                 :{WHITE}Shared orders of {COMMA} Vehicle{P "" s}
-STR_VEH_WITH_SHARED_ORDERS_LIST_TIP                             :{BLACK}Show all vehicles which have the same schedule
-
-### depot strings
-STR_DEPOT_SELL_CONFIRMATION_TEXT                                :{YELLOW}You are about to sell all the vehicles in the depot. Are you sure?
-STR_DEPOT_WRONG_DEPOT_TYPE                                      :Wrong depot type
-
-STR_DEPOT_SELL_ALL_BUTTON_TRAIN_TIP                             :{BLACK}Sell all trains in the depot
-STR_DEPOT_SELL_ALL_BUTTON_ROADVEH_TIP                           :{BLACK}Sell all road vehicles in the depot
-STR_DEPOT_SELL_ALL_BUTTON_SHIP_TIP                              :{BLACK}Sell all ships in the depot
-STR_DEPOT_SELL_ALL_BUTTON_AIRCRAFT_TIP                          :{BLACK}Sell all aircraft in the hangar
-
-STR_DEPOT_VEHICLE_ORDER_LIST_TRAIN_TIP                          :{BLACK}Get a list of all trains with the current depot in their orders
-STR_DEPOT_VEHICLE_ORDER_LIST_ROADVEH_TIP                        :{BLACK}Get a list of all road vehicles with the current depot in their orders
-STR_DEPOT_VEHICLE_ORDER_LIST_SHIP_TIP                           :{BLACK}Get a list of all ships with the current depot in their orders
-STR_DEPOT_VEHICLE_ORDER_LIST_AIRCRAFT_TIP                       :{BLACK}Get a list of all aircraft with any hangar at this airport in their orders
-
-STR_DEPOT_AUTOREPLACE_TRAIN_TIP                                 :{BLACK}Autoreplace all trains in the depot
-STR_DEPOT_AUTOREPLACE_ROADVEH_TIP                               :{BLACK}Autoreplace all road vehicles in the depot
-STR_DEPOT_AUTOREPLACE_SHIP_TIP                                  :{BLACK}Autoreplace all ships in the depot
-STR_DEPOT_AUTOREPLACE_AIRCRAFT_TIP                              :{BLACK}Autoreplace all aircraft in the hangar
-
-STR_VEHICLE_LIST_TRAIN_DEPOT                                    :{BLACK}{STRING} - {COMMA} Train{P "" s}
-STR_VEHICLE_LIST_ROADVEH_DEPOT                                  :{BLACK}{STRING} - {COMMA} Road Vehicle{P "" s}
-STR_VEHICLE_LIST_SHIP_DEPOT                                     :{BLACK}{STRING} - {COMMA} Ship{P "" s}
-STR_VEHICLE_LIST_AIRCRAFT_DEPOT                                 :{BLACK}{STRING} - {COMMA} Aircraft
-
-STR_REPLACE_VEHICLES_WHITE                                      :{WHITE}Replace {STRING}
-STR_REPLACE_VEHICLES_START                                      :{BLACK}Start Replacing Vehicles
-STR_REPLACE_VEHICLES_STOP                                       :{BLACK}Stop Replacing Vehicles
-STR_NOT_REPLACING                                               :{BLACK}Not replacing
-STR_NOT_REPLACING_VEHICLE_SELECTED                              :{BLACK}No vehicle selected
-STR_REPLACE_HELP_LEFT_ARRAY                                     :{BLACK}Select the engine type to replace
-STR_REPLACE_HELP_RIGHT_ARRAY                                    :{BLACK}Select the new engine type you would like to use in place of the left selected engine type
-STR_REPLACE_HELP_STOP_BUTTON                                    :{BLACK}Press to stop the replacement of the engine type selected on the left
-STR_REPLACE_HELP_START_BUTTON                                   :{BLACK}Press to begin replacement of the left selected engine type with the right selected engine type
-STR_REPLACE_HELP_RAILTYPE                                       :{BLACK}Choose the railtype you want to replace engines for
-STR_REPLACE_HELP_REPLACE_INFO_TAB                               :{BLACK}Displays which engine the left selected engine is being replaced with, if any
-STR_REPLACE_HELP                                                :{BLACK}This allows you to replace one engine type with another type, when trains of the original type enter a depot
-STR_REPLACE_REMOVE_WAGON                                        :{BLACK}Car removal: {ORANGE}{SKIP}{STRING}
-STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Make autoreplace keep the length of a train the same by removing cars (starting at the front), if replacing the engine would make the train longer.
-STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Replacing: {ORANGE}{SKIP}{SKIP}{STRING}
-STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EXPERIMENTAL FEATURE {}Switch between engine and car replacement windows.{}Car replacement will only be done if the new car can be refitted into carrying the same type of cargo as the old one. This is checked for each car when the actual replacement takes place.
-STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vehicle is not available
-STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vehicle is not available
-STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Ship is not available
-STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Aircraft is not available
-
-STR_ENGINES                                                     :Engines
-STR_WAGONS                                                      :Cars
-
-STR_MASS_STOP_DEPOT_TRAIN_TIP                                   :{BLACK}Click to stop all trains inside the depot
-STR_MASS_STOP_DEPOT_ROADVEH_TIP                                 :{BLACK}Click to stop all road vehicles inside the depot
-STR_MASS_STOP_DEPOT_SHIP_TIP                                    :{BLACK}Click to stop all ships inside the depot
-STR_MASS_STOP_HANGAR_TIP                                        :{BLACK}Click to stop all aircraft inside the hangar
-
-STR_MASS_START_DEPOT_TRAIN_TIP                                  :{BLACK}Click to start all trains inside the depot
-STR_MASS_START_DEPOT_ROADVEH_TIP                                :{BLACK}Click to start all the road vehicles inside the depot
-STR_MASS_START_DEPOT_SHIP_TIP                                   :{BLACK}Click to start all ships inside the depot
-STR_MASS_START_HANGAR_TIP                                       :{BLACK}Click to start all aircraft inside the hangar
-
-STR_MASS_STOP_LIST_TIP                                          :{BLACK}Click to stop all vehicles in the list
-STR_MASS_START_LIST_TIP                                         :{BLACK}Click to start all listed vehicles
-
-STR_SHORT_DATE                                                  :{WHITE}{DATE_TINY}
-STR_SIGN_LIST_CAPTION                                           :{WHITE}Sign List - {COMMA} Sign{P "" s}
-
-STR_ORDER_REFIT_FAILED                                          :{WHITE}Order refit failure stopped {STRING} {COMMA}
-
-############ Lists rail types
-
-STR_RAIL_VEHICLES                                               :Rail Vehicles
-STR_ELRAIL_VEHICLES                                             :Electrified Rail Vehicles
-STR_MONORAIL_VEHICLES                                           :Monorail Vehicles
-STR_MAGLEV_VEHICLES                                             :Maglev Vehicles
-
-############ End of list of rail types
-
-STR_TINY_BLACK                                                  :{BLACK}{TINYFONT}{COMMA}
-
-STR_PURCHASE_INFO_COST_WEIGHT                                   :{BLACK}Cost: {GOLD}{CURRENCY}{BLACK} Weight: {GOLD}{WEIGHT_S}
-STR_PURCHASE_INFO_SPEED_POWER                                   :{BLACK}Speed: {GOLD}{VELOCITY}{BLACK}   Power: {GOLD}{POWER}
-STR_PURCHASE_INFO_SPEED                                         :{BLACK}Speed: {GOLD}{VELOCITY}
-STR_PURCHASE_INFO_RUNNINGCOST                                   :{BLACK}Running Cost: {GOLD}{CURRENCY}/yr
-STR_PURCHASE_INFO_CAPACITY                                      :{BLACK}Capacity: {GOLD}{CARGO} {STRING}
-STR_PURCHASE_INFO_DESIGNED_LIFE                                 :{BLACK}Designed: {GOLD}{NUM}{BLACK} Life: {GOLD}{COMMA} years
-STR_PURCHASE_INFO_RELIABILITY                                   :{BLACK}Max. Reliability: {GOLD}{COMMA}%
-STR_PURCHASE_INFO_COST                                          :{BLACK}Cost: {GOLD}{CURRENCY}
-STR_PURCHASE_INFO_WEIGHT_CWEIGHT                                :{BLACK}Weight: {GOLD}{WEIGHT_S}  ({WEIGHT_S})
-STR_PURCHASE_INFO_COST_SPEED                                    :{BLACK}Cost: {GOLD}{CURRENCY}{BLACK} Speed: {GOLD}{VELOCITY}
-STR_PURCHASE_INFO_AIRCRAFT_CAPACITY                             :{BLACK}Capacity: {GOLD}{COMMA} passengers, {COMMA} bags of mail
-STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT                          :{BLACK}Powered Wagons: {GOLD}+{POWER}{BLACK} Weight: {GOLD}+{WEIGHT_S}
-STR_PURCHASE_INFO_REFITTABLE_TO                                 :{BLACK}Refittable to: {GOLD}
-STR_PURCHASE_INFO_ALL_TYPES                                     :All cargo types
-STR_PURCHASE_INFO_ALL_BUT                                       :All but {GOLD}
-STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Max. Tractive Effort: {GOLD}{FORCE}
-
-########### String for New Landscape Generator
-
-STR_GENERATE                                                    :{WHITE}Generate
-STR_RANDOM                                                      :{BLACK}Randomize
-STR_RANDOM_HELP                                                 :{BLACK}Change the random seed used for Terrain Generation
-STR_WORLD_GENERATION_CAPTION                                    :{WHITE}World generation
-STR_RANDOM_SEED                                                 :{BLACK}Random Seed:
-STR_RANDOM_SEED_HELP                                            :{BLACK}Click to enter a random seed
-STR_LAND_GENERATOR                                              :{BLACK}Land generator:
-STR_TREE_PLACER                                                 :{BLACK}Tree algorithm:
-STR_HEIGHTMAP_ROTATION                                          :{BLACK}Heightmap rotation:
-STR_TERRAIN_TYPE                                                :{BLACK}Terrain type:
-STR_QUANTITY_OF_SEA_LAKES                                       :{BLACK}Sea level:
-STR_SMOOTHNESS                                                  :{BLACK}Smoothness:
-STR_SNOW_LINE_HEIGHT                                            :{BLACK}Snow line height:
-STR_DATE                                                        :{BLACK}Date:
-STR_NUMBER_OF_TOWNS                                             :{BLACK}No. of towns:
-STR_NUMBER_OF_INDUSTRIES                                        :{BLACK}No. of industries:
-STR_GENERATE_DATE                                               :{BLACK}{DATE_LONG}
-STR_SNOW_LINE_UP                                                :{BLACK}Move the snow line height up one
-STR_SNOW_LINE_DOWN                                              :{BLACK}Move the snow line height down one
-STR_SNOW_LINE_QUERY_CAPT                                        :{WHITE}Change snow line height
-STR_START_DATE_QUERY_CAPT                                       :{WHITE}Change starting year
-STR_HEIGHTMAP_SCALE_WARNING_CAPTION                             :{WHITE}Scale warning
-STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Resizing source map too much is not recommended. Continue with the generation?
-STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Town layout warning
-STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}The town layout "no more roads" is not recommended. Continue with the generation?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
-STR_HEIGHTMAP_NAME                                              :{BLACK}Heightmap name:
-STR_HEIGHTMAP_SIZE                                              :{BLACK}Size: {ORANGE}{NUM} x {NUM}
-STR_GENERATION_WORLD                                            :{WHITE}Generating world...
-STR_GENERATION_ABORT                                            :{BLACK}Cancel
-STR_GENERATION_ABORT_CAPTION                                    :{WHITE}Cancel World Generation
-STR_GENERATION_ABORT_MESSAGE                                    :{YELLOW}Do you really want to cancel the generation?
-STR_PROGRESS                                                    :{WHITE}{NUM}% complete
-STR_GENERATION_PROGRESS                                         :{BLACK}{NUM} / {NUM}
-STR_WORLD_GENERATION                                            :{BLACK}World generation
-STR_TREE_GENERATION                                             :{BLACK}Tree generation
-STR_UNMOVABLE_GENERATION                                        :{BLACK}Unmovable generation
-STR_CLEARING_TILES                                              :{BLACK}Rough and rocky area generation
-STR_SETTINGUP_GAME                                              :{BLACK}Setting up game
-STR_PREPARING_TILELOOP                                          :{BLACK}Running tile-loop
-STR_PREPARING_GAME                                              :{BLACK}Preparing game
-STR_DIFFICULTY_TO_CUSTOM                                        :{WHITE}This action changed the difficulty level to custom
-STR_SE_FLAT_WORLD                                               :{WHITE}Flat land
-STR_SE_FLAT_WORLD_TIP                                           :{BLACK}Generate a flat land
-STR_SE_RANDOM_LAND                                              :{WHITE}Random land
-STR_SE_NEW_WORLD                                                :{BLACK}Create new scenario
-STR_SE_CAPTION                                                  :{WHITE}Scenario type
-STR_FLAT_WORLD_HEIGHT_DOWN                                      :{BLACK}Move the height of flat land down one
-STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Move the height of flat land up one
-STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Change height of flat land
-STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Height of flat land:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
-
-STR_SMALLMAP_CENTER                                             :{BLACK}Center the smallmap on the current position
-
-########### String for new airports
-STR_SMALL_AIRPORT                                               :{BLACK}Small
-STR_CITY_AIRPORT                                                :{BLACK}City
-STR_METRO_AIRPORT                                               :{BLACK}Metropolitan airport
-STR_INTERNATIONAL_AIRPORT                                       :{BLACK}International airport
-STR_COMMUTER_AIRPORT                                            :{BLACK}Commuter
-STR_INTERCONTINENTAL_AIRPORT                                    :{BLACK}Intercontinental
-STR_HELIPORT                                                    :{BLACK}Heliport
-STR_HELIDEPOT                                                   :{BLACK}Helidepot
-STR_HELISTATION                                                 :{BLACK}Helistation
-
-STR_SMALL_AIRPORTS                                              :{BLACK}Small airports
-STR_LARGE_AIRPORTS                                              :{BLACK}Large airports
-STR_HUB_AIRPORTS                                                :{BLACK}Hub airports
-STR_HELIPORTS                                                   :{BLACK}Helicopter airports
-
-############ Tooltip measurment
-
-STR_MEASURE_LENGTH                                              :{BLACK}Length: {NUM}
-STR_MEASURE_AREA                                                :{BLACK}Area: {NUM} x {NUM}
-STR_MEASURE_LENGTH_HEIGHTDIFF                                   :{BLACK}Length: {NUM}{}Height difference: {NUM} m
-STR_MEASURE_AREA_HEIGHTDIFF                                     :{BLACK}Area: {NUM} x {NUM}{}Height difference: {NUM} m
-
-############ Date formatting
-STR_DATE_TINY                                                   :{STRING}-{STRING}-{NUM}
-STR_DATE_SHORT                                                  :{STRING} {NUM}
-STR_DATE_LONG                                                   :{STRING} {STRING} {NUM}
-
-########
-
-STR_FEEDER_CARGO_VALUE                                          :{BLACK}Transfer Credits: {LTBLUE}{CURRENCY}
-STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...this is a town owned road
-STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...road facing in the wrong direction
-
-STR_TRANSPARENCY_TOOLB                                          :{WHITE}Transparency Options
-STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Toggle transparency for station signs
-STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Toggle transparency for trees
-STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Toggle transparency for houses
-STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Toggle transparency for industries
-STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Toggle transparency for buildables like stations, depots, waypoints and catenary
-STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Toggle transparency for bridges
-STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Toggle transparency for structures like lighthouses and antennas, maybe in future for eyecandy
-STR_TRANSPARENT_LOADING_DESC                                    :{BLACK}Toggle transparency for loading indicators
-
-STR_PERCENT_UP_SMALL                                            :{TINYFONT}{WHITE}{NUM}%{UPARROW}
-STR_PERCENT_UP                                                  :{WHITE}{NUM}%{UPARROW}
-STR_PERCENT_DOWN_SMALL                                          :{TINYFONT}{WHITE}{NUM}%{DOWNARROW}
-STR_PERCENT_DOWN                                                :{WHITE}{NUM}%{DOWNARROW}
-STR_PERCENT_UP_DOWN_SMALL                                       :{TINYFONT}{WHITE}{NUM}%{UPARROW}{DOWNARROW}
-STR_PERCENT_UP_DOWN                                             :{WHITE}{NUM}%{UPARROW}{DOWNARROW}
-
-##### Mass Order
-STR_GROUP_NAME_FORMAT                                           :Group {COMMA}
-STR_GROUP_TINY_NAME                                             :{TINYFONT}{GROUP}
-STR_GROUP_ALL_TRAINS                                            :All trains
-STR_GROUP_ALL_ROADS                                             :All road vehicles
-STR_GROUP_ALL_SHIPS                                             :All ships
-STR_GROUP_ALL_AIRCRAFTS                                         :All aircraft
-STR_GROUP_DEFAULT_TRAINS                                        :Ungrouped trains
-STR_GROUP_DEFAULT_ROADS                                         :Ungrouped road vehicles
-STR_GROUP_DEFAULT_SHIPS                                         :Ungrouped ships
-STR_GROUP_DEFAULT_AIRCRAFTS                                     :Ungrouped aircraft
-STR_GROUP_TINY_NUM                                              :{TINYFONT}{COMMA}
-STR_GROUP_ADD_SHARED_VEHICLE                                    :Add shared vehicles
-STR_GROUP_REMOVE_ALL_VEHICLES                                   :Remove all vehicles
-
-STR_GROUP_TRAINS_CAPTION                                        :{WHITE}{GROUP} - {COMMA} Train{P "" s}
-STR_GROUP_ROADVEH_CAPTION                                       :{WHITE}{GROUP} - {COMMA} Road Vehicle{P "" s}
-STR_GROUP_SHIPS_CAPTION                                         :{WHITE}{GROUP} - {COMMA} Ship{P "" s}
-STR_GROUP_AIRCRAFTS_CAPTION                                     :{WHITE}{GROUP} - {COMMA} Aircraft
-STR_GROUP_RENAME_CAPTION                                        :{BLACK}Rename a group
-STR_GROUP_REPLACE_CAPTION                                       :{WHITE}Replace Vehicles of "{GROUP}"
-
-STR_GROUP_CAN_T_CREATE                                          :{WHITE}Can't create group...
-STR_GROUP_CAN_T_DELETE                                          :{WHITE}Can't delete this group...
-STR_GROUP_CAN_T_RENAME                                          :{WHITE}Can't rename group...
-STR_GROUP_CAN_T_REMOVE_ALL_VEHICLES                             :{WHITE}Can't remove all vehicles from this group...
-STR_GROUP_CAN_T_ADD_VEHICLE                                     :{WHITE}Can't add the vehicle to this group...
-STR_GROUP_CAN_T_ADD_SHARED_VEHICLE                              :{WHITE}Can't add shared vehicles to group...
-
-STR_GROUPS_CLICK_ON_GROUP_FOR_TIP                               :{BLACK}Groups - Click on a group to list all of its vehicles
-STR_GROUP_CREATE_TIP                                            :{BLACK}Click to create a group
-STR_GROUP_DELETE_TIP                                            :{BLACK}Delete the selected group
-STR_GROUP_RENAME_TIP                                            :{BLACK}Rename the selected group
-STR_GROUP_REPLACE_PROTECTION_TIP                                :{BLACK}Click to protect this group from global autoreplace
-
-STR_COMPANY_NAME                                                :{COMPANY}
-STR_ENGINE_NAME                                                 :{ENGINE}
-STR_GROUP_NAME                                                  :{GROUP}
-STR_PLAYER_NAME                                                 :{PLAYERNAME}
-STR_SIGN_NAME                                                   :{SIGN}
-STR_VEHICLE_NAME                                                :{VEHICLE}
-
-STR_NAME_MUST_BE_UNIQUE                                         :{WHITE}Name must be unique
-
-#### Improved sign GUI
-STR_NEXT_SIGN_TOOLTIP                                           :{BLACK}Go to next sign
-STR_PREVIOUS_SIGN_TOOLTIP                                       :{BLACK}Go to previous sign
-
-########
-
-STR_FUND_NEW_INDUSTRY                                           :{BLACK}Fund
-STR_PROSPECT_NEW_INDUSTRY                                       :{BLACK}Prospect
-STR_BUILD_NEW_INDUSTRY                                          :{BLACK}Build
-STR_INDUSTRY_SELECTION_HINT                                     :{BLACK}Choose the appropriate industry from this list
-
-############ Face formatting
-STR_FACE_ADVANCED                                               :{BLACK}Advanced
-STR_FACE_ADVANCED_TIP                                           :{BLACK}Advanced face selection.
-STR_FACE_SIMPLE                                                 :{BLACK}Simple
-STR_FACE_SIMPLE_TIP                                             :{BLACK}Simple face selection.
-STR_FACE_LOAD                                                   :{BLACK}Load
-STR_FACE_LOAD_TIP                                               :{BLACK}Load favorite face
-STR_FACE_LOAD_DONE                                              :{WHITE}Your favorite face has been loaded from the OpenTTD config file.
-STR_FACE_FACECODE                                               :{BLACK}Player face no.
-STR_FACE_FACECODE_TIP                                           :{BLACK}View and/or set player face number
-STR_FACE_FACECODE_CAPTION                                       :{WHITE}View and/or set player face number
-STR_FACE_FACECODE_SET                                           :{WHITE}New face number code has been set.
-STR_FACE_FACECODE_ERR                                           :{WHITE}Couldn't set player face number - must be numeric between 0 and 4,294,967,295!
-STR_FACE_SAVE                                                   :{BLACK}Save
-STR_FACE_SAVE_TIP                                               :{BLACK}Save favorite face
-STR_FACE_SAVE_DONE                                              :{WHITE}This face will be saved as your favorite in the OpenTTD config file.
-STR_FACE_EUROPEAN                                               :{BLACK}European
-STR_FACE_SELECT_EUROPEAN                                        :{BLACK}Select European faces
-STR_FACE_AFRICAN                                                :{BLACK}African
-STR_FACE_SELECT_AFRICAN                                         :{BLACK}Select African faces
-STR_FACE_YES                                                    :Yes
-STR_FACE_NO                                                     :No
-STR_FACE_MOUSTACHE_EARRING_TIP                                  :{BLACK}Enable mustache or earring
-STR_FACE_HAIR                                                   :Hair:
-STR_FACE_HAIR_TIP                                               :{BLACK}Change hair
-STR_FACE_EYEBROWS                                               :Eyebrows:
-STR_FACE_EYEBROWS_TIP                                           :{BLACK}Change eyebrows
-STR_FACE_EYECOLOUR                                              :Eye color:
-STR_FACE_EYECOLOUR_TIP                                          :{BLACK}Change eyecolor
-STR_FACE_GLASSES                                                :Glasses:
-STR_FACE_GLASSES_TIP                                            :{BLACK}Enable glasses
-STR_FACE_GLASSES_TIP_2                                          :{BLACK}Change glasses
-STR_FACE_NOSE                                                   :Nose:
-STR_FACE_NOSE_TIP                                               :{BLACK}Change nose
-STR_FACE_LIPS                                                   :Lips:
-STR_FACE_MOUSTACHE                                              :Mustache:
-STR_FACE_LIPS_MOUSTACHE_TIP                                     :{BLACK}Change lips or mustache
-STR_FACE_CHIN                                                   :Chin:
-STR_FACE_CHIN_TIP                                               :{BLACK}Change chin
-STR_FACE_JACKET                                                 :Jacket:
-STR_FACE_JACKET_TIP                                             :{BLACK}Change jacket
-STR_FACE_COLLAR                                                 :Collar:
-STR_FACE_COLLAR_TIP                                             :{BLACK}Change collar
-STR_FACE_TIE                                                    :Tie:
-STR_FACE_EARRING                                                :Earring:
-STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Change tie or earring
-########
--- a/src/lang/brazilian_portuguese.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/brazilian_portuguese.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -14,7 +14,7 @@
 STR_0003_NOT_ENOUGH_CASH_REQUIRES                               :{WHITE}Não há dinheiro - requer {CURRENCY}
 STR_0004                                                        :{WHITE}{CURRENCY}
 STR_EMPTY                                                       :
-STR_0007_FLAT_LAND_REQUIRED                                     :{WHITE}Necessita de terreno plano
+STR_0007_FLAT_LAND_REQUIRED                                     :{WHITE}Requer terreno plano
 STR_0008_WAITING                                                :{BLACK}Aguardando: {WHITE}{STRING}
 STR_0009                                                        :{WHITE}{CARGO}
 STR_000A_EN_ROUTE_FROM                                          :{WHITE}{CARGO}{YELLOW} (em rota de
@@ -162,7 +162,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Impossível limpar esta área....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Copyright original {COPYRIGHT} 1995 Chris Sawyer, Todos os direitos reservados
 STR_00B7_VERSION                                                :{BLACK}OpenTTD versão {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 A equipe do OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 A equipe do OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK}  Tradutor(es) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -301,12 +301,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Multi-jogador
 STR_SCENARIO_EDITOR                                             :{BLACK}Editor de Cenário
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Dimensões do mapa:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Opções do Jogo
@@ -487,7 +481,7 @@
 STR_019F_TRAIN                                                  :{G=m}Trem
 STR_01A0_IS_GETTING_OLD                                         :{WHITE}{STRING} {COMMA} está ficando velho
 STR_01A1_IS_GETTING_VERY_OLD                                    :{WHITE}{STRING} {COMMA} está ficando muito velho
-STR_01A2_IS_GETTING_VERY_OLD_AND                                :{WHITE}{STRING} {COMMA} está ficando muito velho e necessita substituição urgente
+STR_01A2_IS_GETTING_VERY_OLD_AND                                :{WHITE}{STRING} {COMMA} está ficando muito velho e precisa substituição urgente
 STR_01A3_LAND_AREA_INFORMATION                                  :{WHITE}Informações do Terreno
 STR_01A4_COST_TO_CLEAR_N_A                                      :{BLACK}Custo para limpar: {LTBLUE}N/D
 STR_01A5_COST_TO_CLEAR                                          :{BLACK}Custo para limpar: {LTBLUE}{CURRENCY}
@@ -723,7 +717,7 @@
 STR_0283_CONSTRUCT_TOFFEE_QUARRY                                :{BLACK}Construir Extração de Caramelo
 STR_0284_CONSTRUCT_SUGAR_MINE                                   :{BLACK}Construir Mina de Açúcar
 STR_0285_CAN_T_BUILD_HERE                                       :{WHITE}Impossível construir {STRING} aqui...
-STR_0286_MUST_BUILD_TOWN_FIRST                                  :{WHITE}...necessário construir uma cidade primeiro
+STR_0286_MUST_BUILD_TOWN_FIRST                                  :{WHITE}...deve construir uma cidade primeiro
 STR_0287_ONLY_ONE_ALLOWED_PER_TOWN                              :{WHITE}...só é permitido uma por cidade
 STR_0288_PLANT_TREES                                            :{BLACK}Plantar árvores
 STR_0289_PLACE_SIGN                                             :{BLACK}Colocar placas
@@ -753,7 +747,7 @@
 STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...só pode ser construído em cidades com pelo menos 1200 habitantes
 STR_029E_MOVE_THE_STARTING_DATE                                 :{BLACK}Retroceder data de inicio em 1 ano
 STR_029F_MOVE_THE_STARTING_DATE                                 :{BLACK}Avançar data de inicio em 1 ano
-STR_02A0_ENDS_OF_BRIDGE_MUST_BOTH                               :{WHITE}...os extremos da ponte necessitam estar sobre a terra
+STR_02A0_ENDS_OF_BRIDGE_MUST_BOTH                               :{WHITE}...os extremos da ponte devem estar sobre a terra
 STR_02A1_SMALL                                                  :{BLACK}Pequena
 STR_02A2_MEDIUM                                                 :{BLACK}Média
 STR_02A3_LARGE                                                  :{BLACK}Grande
@@ -872,7 +866,7 @@
 STR_0319_PAUSED                                                 :{YELLOW}* *  PAUSADO *  *
 
 STR_031B_SCREENSHOT_SUCCESSFULLY                                :{WHITE}Foto salvado com sucesso como '{STRING}'
-STR_031C_SCREENSHOT_FAILED                                      :{WHITE}A foto falhou!
+STR_031C_SCREENSHOT_FAILED                                      :{WHITE}Falha ao tirar foto!
 
 STR_0329_PURCHASE_LAND_FOR_FUTURE                               :{BLACK}Comprar terreno para uso futuro
 STR_032F_AUTOSAVE                                               :{RED}Gravado automaticamente
@@ -941,8 +935,9 @@
 STR_OPTIONS_LANG_CBO                                            :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
 STR_OPTIONS_LANG_TIP                                            :{BLACK}Selecionar o idioma da interface do jogo
 
-STR_OPTIONS_FULLSCREEN                                          :{BLACK}Tela Inteira
-STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Selecione esta opção para jogar o OpenTTD em modo de tela inteiro
+STR_OPTIONS_FULLSCREEN                                          :{BLACK}Tela cheia
+STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Selecione esta opção para jogar o OpenTTD em modo de tela cheia
+STR_FULLSCREEN_FAILED                                           :{WHITE}Falha no modo de tela cheia
 
 STR_OPTIONS_RES                                                 :{BLACK}Resolução da tela
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1012,10 +1007,10 @@
 STR_AIRCRAFT_HAS_INVALID_ENTRY                                  :{WHITE}Aeronave {COMMA} possui uma estação inválida em suas ordens
 # end of order system
 
-STR_TRAIN_AUTORENEW_FAILED                                      :{WHITE}A auto-renovação do trem {COMMA} falhou (limite de dinheiro)
-STR_ROADVEHICLE_AUTORENEW_FAILED                                :{WHITE}A auto-renovação do automóvel {COMMA} falhou (falta de dinheiro)
-STR_SHIP_AUTORENEW_FAILED                                       :{WHITE}A auto-renovação da embarcação {COMMA} falhou (limite de dinheiro)
-STR_AIRCRAFT_AUTORENEW_FAILED                                   :{WHITE}A auto-renovação da aeronave {COMMA} falhou (limite de dinheiro)
+STR_TRAIN_AUTORENEW_FAILED                                      :{WHITE}Falha na auto-renovação do trem {COMMA} (limite de dinheiro)
+STR_ROADVEHICLE_AUTORENEW_FAILED                                :{WHITE}Falha na auto-renovação do automóvel {COMMA} (falta de dinheiro)
+STR_SHIP_AUTORENEW_FAILED                                       :{WHITE}Falha na auto-renovação da embarcação {COMMA} (limite de dinheiro)
+STR_AIRCRAFT_AUTORENEW_FAILED                                   :{WHITE}Falha na auto-renovação da aeronave {COMMA} (limite de dinheiro)
 STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT                            :{WHITE}O trem {COMMA} ficará muito longo após a substituição
 
 STR_CONFIG_PATCHES                                              :{BLACK}Configurar Correções
@@ -1171,6 +1166,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Permite comprar ações de outras companhias
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Ao arrastar colocar sinais a cada: {ORANGE}{STRING} quadrado(s)
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Automaticamente constroi semáforos anteriores: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Ativar interface de sinais: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}O layout de cidade "sem mais estradas" não é válido no editor
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Selecione o layout das estradas {ORANGE}{STRING}
@@ -1402,7 +1398,7 @@
 STR_NETWORK_INTERNET_ADVERTISE                                  :Internet (divulgar)
 STR_NETWORK_CLIENTS_SELECT                                      :{BLACK}{SKIP}{SKIP}{NUM} cliente{P "" s}
 STR_NETWORK_NUMBER_OF_CLIENTS                                   :{BLACK}Máximo de clientes:
-STR_NETWORK_NUMBER_OF_CLIENTS_TIP                               :{BLACK}Escolha o número máximo de clientes. Não necessita estarem todos preenchidos
+STR_NETWORK_NUMBER_OF_CLIENTS_TIP                               :{BLACK}Escolha o número máximo de clientes. Não precisa estarem todos preenchidos
 STR_NETWORK_COMPANIES_SELECT                                    :{BLACK}{SKIP}{SKIP}{SKIP}{NUM} compan{P ia ias}
 STR_NETWORK_NUMBER_OF_COMPANIES                                 :{BLACK}Máximo de empresas:
 STR_NETWORK_NUMBER_OF_COMPANIES_TIP                             :{BLACK}Limita o servidor para uma certa quantia de empresas
@@ -1574,7 +1570,7 @@
 
 STR_PNGMAP_ERROR                                                :{WHITE}Impossível carregar terreno a partir de PNG...
 STR_PNGMAP_ERR_FILE_NOT_FOUND                                   :{WHITE}...arquivo não encontrado.
-STR_PNGMAP_ERR_IMAGE_TYPE                                       :{WHITE}...impossível converter tipo de imagem. Necessária imagem PNG de 8 ou 24-bit.
+STR_PNGMAP_ERR_IMAGE_TYPE                                       :{WHITE}...impossível converter tipo de imagem. Precisa imagem PNG de 8 ou 24-bit.
 STR_PNGMAP_ERR_MISC                                             :{WHITE}...alguma coisa deu errado. Desculpe. (provavel arquivo corrupto)
 
 STR_BMPMAP_ERROR                                                :{WHITE}Impossível carregar terreno a partir de BMP...
@@ -1607,7 +1603,7 @@
 STR_1004_TOO_HIGH                                               :{WHITE}Muito alto
 STR_1005_NO_SUITABLE_RAILROAD_TRACK                             :{WHITE}Tipo de linha não apropriado
 STR_1007_ALREADY_BUILT                                          :{WHITE}...já construído
-STR_1008_MUST_REMOVE_RAILROAD_TRACK                             :{WHITE}Necessário remover a ferrovia primeiro
+STR_1008_MUST_REMOVE_RAILROAD_TRACK                             :{WHITE}Deve remover a ferrovia primeiro
 STR_100A_RAILROAD_CONSTRUCTION                                  :{WHITE}Construir ferrovias
 STR_TITLE_ELRAIL_CONSTRUCTION                                   :{WHITE}Construir ferrovias (elétricas)
 STR_100B_MONORAIL_CONSTRUCTION                                  :{WHITE}Construir ferrovias (monotrilho)
@@ -1646,12 +1642,12 @@
 STR_RAILROAD_TRACK_WITH_PRE_EXITSIGNALS                         :Linha de trem com pré-sinais e de saída
 STR_RAILROAD_TRACK_WITH_PRE_COMBOSIGNALS                        :Ferrovia com pré-sinais e combo
 STR_RAILROAD_TRACK_WITH_EXIT_COMBOSIGNALS                       :Ferrovia com sinais combo e de saída
-STR_MUST_REMOVE_RAILWAY_STATION_FIRST                           :{WHITE}Remova a estação de trem antes
+STR_MUST_REMOVE_RAILWAY_STATION_FIRST                           :{WHITE}Deve remover a estação de trem antes
 
 
 
 ##id 0x1800
-STR_1801_MUST_REMOVE_ROAD_FIRST                                 :{WHITE}Necessário remover a rodovia primeiro
+STR_1801_MUST_REMOVE_ROAD_FIRST                                 :{WHITE}Deve remover a rodovia primeiro
 STR_ROAD_WORKS_IN_PROGRESS                                      :{WHITE}Recapeamento rodoviário em progresso
 STR_1802_ROAD_CONSTRUCTION                                      :{WHITE}Construir rodovias
 STR_1802_TRAMWAY_CONSTRUCTION                                   :{WHITE}Construção de Bonde
@@ -1708,7 +1704,7 @@
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
 STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
-STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}O edifício necessita ser demolido primeiro
+STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}O edifício deve ser demolido primeiro
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}População: {ORANGE}{COMMA}{BLACK}  Casas: {ORANGE}{COMMA}
 STR_2007_RENAME_TOWN                                            :Renomear Cidade
@@ -1838,9 +1834,9 @@
 STR_3008B_TOO_MANY_TRUCK_STOPS                                  :{WHITE}Muitos locais de carga
 STR_3009_TOO_CLOSE_TO_ANOTHER_STATION                           :{WHITE}Muito perto de outra estação/local de carga
 STR_300A_0                                                      :{WHITE}{STATION} {STATIONFEATURES}
-STR_300B_MUST_DEMOLISH_RAILROAD                                 :{WHITE}Necessário demolir a estação primeiro
+STR_300B_MUST_DEMOLISH_RAILROAD                                 :{WHITE}Deve demolir a estação primeiro
 STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT                           :{WHITE}Muito perto de outro aeroporto
-STR_300E_MUST_DEMOLISH_AIRPORT_FIRST                            :{WHITE}Necessário demolir o aeroporto primeiro
+STR_300E_MUST_DEMOLISH_AIRPORT_FIRST                            :{WHITE}Deve demolir o aeroporto primeiro
 
 STR_3030_RENAME_STATION_LOADING                                 :Renomear estação/área de carga
 STR_3031_CAN_T_RENAME_STATION                                   :{WHITE}Impossível renomear a estação...
@@ -1868,16 +1864,16 @@
 STR_3043_TRUCK_STATION_ORIENT                                   :{WHITE}Orientação da estação de caminhão
 STR_3042_PASSENGER_TRAM_STATION_ORIENTATION                     :{WHITE}Orientação da Estação de Bonde
 STR_3043_CARGO_TRAM_STATION_ORIENT                              :{WHITE}Orientação da Estação de Bonde
-STR_3046_MUST_DEMOLISH_BUS_STATION                              :{WHITE}Necessário demolir a estação de ônibus primeiro
-STR_3047_MUST_DEMOLISH_TRUCK_STATION                            :{WHITE}Necessário demolir a estação de caminhão
-STR_3046_MUST_DEMOLISH_PASSENGER_TRAM_STATION                   :{WHITE}Necessário demolir estação de bonde primeiro
-STR_3047_MUST_DEMOLISH_CARGO_TRAM_STATION                       :{WHITE}Necessário demolir estação de bonde primeiro
+STR_3046_MUST_DEMOLISH_BUS_STATION                              :{WHITE}Deve demolir a estação de ônibus primeiro
+STR_3047_MUST_DEMOLISH_TRUCK_STATION                            :{WHITE}Deve demolir a estação de caminhão
+STR_3046_MUST_DEMOLISH_PASSENGER_TRAM_STATION                   :{WHITE}Deve demolir a estação de bonde primeiro
+STR_3047_MUST_DEMOLISH_CARGO_TRAM_STATION                       :{WHITE}Deve demolir a estação de bonde primeiro
 STR_3048_STATIONS                                               :{WHITE}{COMPANY} - {COMMA} Estações
 STR_3049_0                                                      :{YELLOW}{STATION} {STATIONFEATURES}
 STR_304A_NONE                                                   :{YELLOW}- Nenhuma -
 STR_304B_SITE_UNSUITABLE                                        :{WHITE}...local inadequado
 STR_304C_TOO_CLOSE_TO_ANOTHER_DOCK                              :{WHITE}Muito perto de outra doca
-STR_304D_MUST_DEMOLISH_DOCK_FIRST                               :{WHITE}Necessário demolir a doca primeiro
+STR_304D_MUST_DEMOLISH_DOCK_FIRST                               :{WHITE}Deve demolir a doca primeiro
 STR_304E_SELECT_RAILROAD_STATION                                :{BLACK}Selecionar a orientação da estação ferroviária
 STR_304F_SELECT_NUMBER_OF_PLATFORMS                             :{BLACK}Selecionar o número de linhas da estação ferroviária
 STR_3050_SELECT_LENGTH_OF_RAILROAD                              :{BLACK}Selecionar o tamanho da estação ferroviária
@@ -1915,7 +1911,7 @@
 
 ##id 0x3800
 STR_3800_SHIP_DEPOT_ORIENTATION                                 :{WHITE}Orientação do Depósito Naval
-STR_3801_MUST_BE_BUILT_ON_WATER                                 :{WHITE}...necessita ser construído na água
+STR_3801_MUST_BE_BUILT_ON_WATER                                 :{WHITE}...deve ser construído na água
 STR_3802_CAN_T_BUILD_SHIP_DEPOT                                 :{WHITE}Impossível construir depósito naval aqui...
 STR_3803_SELECT_SHIP_DEPOT_ORIENTATION                          :{BLACK}Selecionar orientação do depósito naval
 STR_3804_WATER                                                  :Água
@@ -1991,9 +1987,9 @@
 STR_4826_SUGAR_MINE                                             :{G=f}Mina de Açúcar
 
 ############ range for requires starts
-STR_4827_REQUIRES                                               :{BLACK}Necessário: {YELLOW}{STRING}
-STR_4828_REQUIRES                                               :{BLACK}Necessário: {YELLOW}{STRING}, {STRING}
-STR_4829_REQUIRES                                               :{BLACK}Necessário: {YELLOW}{STRING}, {STRING}, {STRING}
+STR_4827_REQUIRES                                               :{BLACK}Requer: {YELLOW}{STRING}
+STR_4828_REQUIRES                                               :{BLACK}Requer: {YELLOW}{STRING}, {STRING}
+STR_4829_REQUIRES                                               :{BLACK}Requer: {YELLOW}{STRING}, {STRING}, {STRING}
 ############ range for requires ends
 
 ############ range for produces starts
@@ -2029,12 +2025,12 @@
 STR_5001_ROAD_VEHICLE_IN_TUNNEL                                 :{WHITE}Automóvel no túnel
 STR_5003_ANOTHER_TUNNEL_IN_THE_WAY                              :{WHITE}Há outro túnel no caminho
 STR_5005_UNABLE_TO_EXCAVATE_LAND                                :{WHITE}Incapaz de escavar o terreno para o outro lado do túnel
-STR_5006_MUST_DEMOLISH_TUNNEL_FIRST                             :{WHITE}Necessário demolir o túnel primeiro
-STR_5007_MUST_DEMOLISH_BRIDGE_FIRST                             :{WHITE}Necessário demolir a ponte primeiro
+STR_5006_MUST_DEMOLISH_TUNNEL_FIRST                             :{WHITE}Deve demolir o túnel primeiro
+STR_5007_MUST_DEMOLISH_BRIDGE_FIRST                             :{WHITE}Deve demolir a ponte primeiro
 STR_5008_CANNOT_START_AND_END_ON                                :{WHITE}Impossível iniciar e terminar no mesmo ponto
 STR_BRIDGEHEADS_NOT_SAME_HEIGHT                                 :{WHITE}Extremidades da ponte não estão no mesmo nível
 STR_BRIDGE_TOO_LOW_FOR_TERRAIN                                  :{WHITE}Ponte é muito baixa para o terreno
-STR_500A_START_AND_END_MUST_BE_IN                               :{WHITE}Inicio e fim necessitam estar alinhados
+STR_500A_START_AND_END_MUST_BE_IN                               :{WHITE}Inicio e fim devem estar alinhados
 STR_500B_SITE_UNSUITABLE_FOR_TUNNEL                             :{WHITE}O local não é adequado para a entrada do túnel
 STR_500D                                                        :{GOLD}{STRING},{} {VELOCITY} {WHITE}{CURRENCY}
 STR_500E_SUSPENSION_STEEL                                       :Suspensa, Aço
@@ -2243,7 +2239,7 @@
 STR_702B_MAXIMUM_PERMITTED_LOAN                                 :{WHITE}...o empréstimo máximo permitido é de {CURRENCY}
 STR_702C_CAN_T_BORROW_ANY_MORE_MONEY                            :{WHITE}Impossível pedir mais dinheiro emprestado...
 STR_702D_LOAN_ALREADY_REPAYED                                   :{WHITE}...não há empréstimo para pagar
-STR_702E_REQUIRED                                               :{WHITE}...necessário {CURRENCY}
+STR_702E_REQUIRED                                               :{WHITE}...{CURRENCY} requerido
 STR_702F_CAN_T_REPAY_LOAN                                       :{WHITE}Impossível pagar empréstimo...
 STR_INSUFFICIENT_FUNDS                                          :{WHITE}Impossível dar o dinheiro emprestado do banco
 STR_7030_SELECT_NEW_FACE_FOR_PRESIDENT                          :{BLACK}Selecionar novo rosto para o presidente
@@ -2314,8 +2310,13 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Senha
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Usar senha na empresa para prevenir utilizadores não autorizados.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Definir senha para empresa
-STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Recesso Mundial!{}{}Economistas temem crise!
-STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Fim do recesso!{}{}Melhoras no comércio inspiram confiança nas indústrias à medida que a economia se fortalece!
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Não salvar a senha digitada
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Dar à empresa uma nova senha
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Senha da empresa
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Senha padrão da empresa
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Usar esta senha de empresa como padrão para novas empresas
+STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Recessão Mundial!{}{}Economistas temem crise!
+STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Fim do recessão!{}{}Melhoras no comércio inspiram confiança nas indústrias à medida que a economia se fortalece!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Alternar entre janela grande/pequena
 STR_7076_COMPANY_VALUE                                          :{GOLD}Valor da empresa: {WHITE}{CURRENCY}
 STR_7077_BUY_25_SHARE_IN_COMPANY                                :{BLACK}Comprar 25% de ações
@@ -2339,6 +2340,8 @@
 STR_LIVERY_PASSENGER_WAGON_STEAM                                :Vagão de Passageiro (Vapor)
 STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Vagão de Passageiro (Diesel)
 STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Vagão de Passageiro (Elétrico)
+STR_LIVERY_PASSENGER_WAGON_MONORAIL                             :Vagão de Passageiro (Monorail)
+STR_LIVERY_PASSENGER_WAGON_MAGLEV                               :Vagão de Passageiro (Maglev)
 STR_LIVERY_FREIGHT_WAGON                                        :Vagão de carga
 STR_LIVERY_BUS                                                  :Ônibus
 STR_LIVERY_TRUCK                                                :Caminhão
@@ -2694,9 +2697,9 @@
 STR_8826_GO_TO                                                  :{BLACK}Ir Para
 STR_8827_FULL_LOAD                                              :{BLACK}Carga
 STR_8828_UNLOAD                                                 :{BLACK}Descarga
-STR_REFIT                                                       :{BLACK}Readaptar
+STR_REFIT                                                       :{BLACK}Adaptar
 STR_REFIT_TIP                                                   :{BLACK}Selecionar a adaptação na ordem atual. CTRL + Clique para remover a instrução
-STR_REFIT_ORDER                                                 :(Readaptar para {STRING})
+STR_REFIT_ORDER                                                 :(Adaptar para {STRING})
 STR_TIMETABLE_VIEW                                              :{BLACK}Plano de horário
 STR_TIMETABLE_VIEW_TOOLTIP                                      :{BLACK}Exibe o plano de horário
 STR_8829_ORDERS                                                 :{WHITE}{VEHICLE} (Ordens)
@@ -2708,7 +2711,7 @@
 STR_882D_VALUE                                                  :{LTBLUE}{ENGINE}{BLACK}   Valor: {LTBLUE}{CURRENCY}
 STR_882E                                                        :{WHITE}{VEHICLE}
 STR_882F_LOADING_UNLOADING                                      :{LTBLUE}Carregando / descarregando
-STR_TRAIN_MUST_BE_STOPPED                                       :{WHITE}O trem necessita estar parado dentro do depósito
+STR_TRAIN_MUST_BE_STOPPED                                       :{WHITE}O trem deve estar parado dentro do depósito
 STR_8830_CAN_T_SEND_TRAIN_TO_DEPOT                              :{WHITE}Impossível enviar o trem para o depósito...
 STR_8831_NO_MORE_SPACE_FOR_ORDERS                               :{WHITE}Não há espaço para mais ordens
 STR_8832_TOO_MANY_ORDERS                                        :{WHITE}Muitas ordens
@@ -2727,7 +2730,7 @@
 STR_883C_SERVICING_INTERVAL_DAYS                                :{BLACK}Intervalo de serviço: {LTBLUE}{COMMA}dias{BLACK}   Último serviço: {LTBLUE}{DATE_LONG}
 STR_SERVICING_INTERVAL_PERCENT                                  :{BLACK}Intervalo de serviço: {LTBLUE}{COMMA}%{BLACK}   Último serviço: {LTBLUE}{DATE_LONG}
 STR_883D_TRAINS_CLICK_ON_TRAIN_FOR                              :{BLACK}Trens - clique num trem para informações
-STR_883E_BUILD_NEW_TRAINS_REQUIRES                              :{BLACK}Construir novos trens (necessita depósito de trens)
+STR_883E_BUILD_NEW_TRAINS_REQUIRES                              :{BLACK}Construir novos trens (requer depósito de trens)
 STR_883F_TRAINS_CLICK_ON_TRAIN_FOR                              :{BLACK}Trens - clique num trem para informações, arraste um veículo o adicionar ao tren ou remover
 STR_8840_BUILD_NEW_TRAIN_VEHICLE                                :{BLACK}Construir novo veículo ferroviário
 STR_8841_DRAG_TRAIN_VEHICLE_TO_HERE                             :{BLACK}Arraste o veículo aqui para vendê-lo
@@ -2759,7 +2762,7 @@
 STR_TIMETABLE_WAIT_TIME_TOOLTIP                                 :{BLACK}Mude a quantidade de tempo que a ordem deverá levar
 STR_TIMETABLE_CLEAR_TIME_TOOLTIP                                :{BLACK}Reseta a quantidade de tempo para a ordem selecionada
 STR_TIMETABLE_RESET_LATENESS_TOOLTIP                            :{BLACK}Reseta o contador de atraso, fazendo o veículo estar na hora
-STR_SERVICE_HINT                                                :{BLACK}Saltar esta ordem a menos que seja necessário manutenção
+STR_SERVICE_HINT                                                :{BLACK}Saltar esta ordem a menos que seja preciso manutenção
 STR_VEHICLE_INFO_COST_WEIGHT_SPEED_POWER                        :{BLACK}Custo: {CURRENCY} Peso: {WEIGHT_S}{}Velocidade: {VELOCITY}  Potência: {POWER}{}Custo de circulação: {CURRENCY}/ano{}Capacidade: {CARGO}
 STR_885C_BROKEN_DOWN                                            :{RED}Quebrado
 STR_885D_AGE_RUNNING_COST_YR                                    :{BLACK}Idade: {LTBLUE}{STRING}{BLACK}   Custo de circulação: {LTBLUE}{CURRENCY}/ano
@@ -2794,6 +2797,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Novo {STRING} agora disponível!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Impossível vender veículo destruído...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Impossível adptar veículo destruído...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Impossível programar veículo...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Veículos só podem aguardar em estações
@@ -2823,7 +2827,7 @@
 STR_9010_RELIABILITY_BREAKDOWNS                                 :{BLACK}Confiabilidade: {LTBLUE}{COMMA}%  {BLACK}Quebras desde a última manutenção: {LTBLUE}{COMMA}
 STR_9011_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Construído: {LTBLUE}{NUM}{BLACK} Valor: {LTBLUE}{CURRENCY}
 STR_9012_CAPACITY                                               :{BLACK}Capacidade: {LTBLUE}{CARGO}
-STR_9013_MUST_BE_STOPPED_INSIDE                                 :{WHITE}...necessita estar parado dentro de uma garagem
+STR_9013_MUST_BE_STOPPED_INSIDE                                 :{WHITE}...deve estar parado dentro de uma garagem
 STR_9014_CAN_T_SELL_ROAD_VEHICLE                                :{WHITE}Impossível vender automóvel...
 STR_9015_CAN_T_STOP_START_ROAD_VEHICLE                          :{WHITE}Impossível iniciar/parar automóvel...
 STR_9016_ROAD_VEHICLE_IS_WAITING                                :{WHITE}Automóvel {COMMA} está aguardando na garagem
@@ -2834,7 +2838,7 @@
 STR_9018_CAN_T_SEND_VEHICLE_TO_DEPOT                            :{WHITE}Impossível enviar o veículo para a garagem...
 STR_9019_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Incapaz de encontrar a garagem local
 STR_901A_ROAD_VEHICLES_CLICK_ON                                 :{BLACK}Automóveis - clique num veículo para informações
-STR_901B_BUILD_NEW_ROAD_VEHICLES                                :{BLACK}Construir novos automóveis (necessita de garagem)
+STR_901B_BUILD_NEW_ROAD_VEHICLES                                :{BLACK}Construir novos automóveis (requer garagem)
 STR_901C_CURRENT_VEHICLE_ACTION                                 :{BLACK}Tarefa atual do veículo - clique aqui para iniciar/parar veículo
 STR_901D_SHOW_VEHICLE_S_ORDERS                                  :{BLACK}Exibir ordens do veículo
 STR_901E_CENTER_MAIN_VIEW_ON_VEHICLE                            :{BLACK}Centrar visualização na localização do veículo
@@ -2869,10 +2873,10 @@
 STR_9038_GO_TO_ROADVEH_DEPOT                                    :Ir para a garagem de {TOWN}
 STR_SERVICE_AT_ROADVEH_DEPOT                                    :Manutenção na garagem de {TOWN}
 
-STR_REFIT_ROAD_VEHICLE_TO_CARRY                                 :{BLACK}Reacondicionar automóvel para carregar tipo de carga diferente
-STR_REFIT_ROAD_VEHICLE                                          :{BLACK}Reacondicionar automóvel
-STR_REFIT_ROAD_VEHICLE_TO_CARRY_HIGHLIGHTED                     :{BLACK}Reacondicionar automóvel para carregar o tipo de carga selecionado
-STR_REFIT_ROAD_VEHICLE_CAN_T                                    :{WHITE}Impossível reacondicionar automóvel...
+STR_REFIT_ROAD_VEHICLE_TO_CARRY                                 :{BLACK}Adaptar automóvel para carregar tipo de carga diferente
+STR_REFIT_ROAD_VEHICLE                                          :{BLACK}Adaptar automóvel
+STR_REFIT_ROAD_VEHICLE_TO_CARRY_HIGHLIGHTED                     :{BLACK}Adaptar automóvel para carregar o tipo de carga selecionado
+STR_REFIT_ROAD_VEHICLE_CAN_T                                    :{WHITE}Impossível adaptar automóvel...
 STR_ROAD_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Selecionar tipo de carga para o automóvel
 
 ##id 0x9800
@@ -2887,7 +2891,7 @@
 STR_CLONE_SHIP                                                  :{BLACK}Clonar Embarcação
 STR_CLONE_SHIP_INFO                                             :{BLACK}Isso vai construir uma cópia da embarcação. Control-clique vai compartilhar as ordens
 STR_CLONE_SHIP_DEPOT_INFO                                       :{BLACK}Isso irá construir uma cópia da embarcação. Clique neste botão e depois em uma embarcação dentro ou fora do depósito naval. Control-clique vai compartilhar as ordens
-STR_980B_SHIP_MUST_BE_STOPPED_IN                                :{WHITE}A embarcação necessita estar parado no depósito naval
+STR_980B_SHIP_MUST_BE_STOPPED_IN                                :{WHITE}A embarcação deve estar parado no depósito naval
 STR_980C_CAN_T_SELL_SHIP                                        :{WHITE}Impossível vender embarcação...
 STR_980D_CAN_T_BUILD_SHIP                                       :{WHITE}Impossível construir embarcação...
 STR_980E_SHIP_IN_THE_WAY                                        :{WHITE}Embarcação no caminho
@@ -2914,7 +2918,7 @@
 STR_9821_DRAG_SHIP_TO_HERE_TO_SELL                              :{BLACK}Arraste a embarcação aqui para vendê-la
 STR_9822_CENTER_MAIN_VIEW_ON_SHIP                               :{BLACK}Centrar visualização na localização do depósito naval
 STR_9823_SHIPS_CLICK_ON_SHIP_FOR                                :{BLACK}Embarcações - clique numa embarcação para informações
-STR_9824_BUILD_NEW_SHIPS_REQUIRES                               :{BLACK}Construir novas embarcações (necessita de depósito naval)
+STR_9824_BUILD_NEW_SHIPS_REQUIRES                               :{BLACK}Construir novas embarcações (requer depósito naval)
 STR_9825_SHIP_SELECTION_LIST_CLICK                              :{BLACK}Lista de embarcações - clique numa embarcação para informações
 STR_9826_BUILD_THE_HIGHLIGHTED_SHIP                             :{BLACK}Construir embarcação selecionado
 STR_9827_CURRENT_SHIP_ACTION_CLICK                              :{BLACK}Tarefa atual da embarcação - clique aqui para iniciar/parar embarcação
@@ -2977,12 +2981,12 @@
 STR_A017_AIRCRAFT_IS_IN_FLIGHT                                  :{WHITE}Aeronave está em voo
 STR_A019_CAPACITY                                               :{BLACK}Capacidade: {LTBLUE}{CARGO}, {CARGO}
 STR_A01A_CAPACITY                                               :{BLACK}Capacidade: {LTBLUE}{CARGO}
-STR_A01B_AIRCRAFT_MUST_BE_STOPPED                               :{WHITE}A aeronave necessita estar parada no hangar
+STR_A01B_AIRCRAFT_MUST_BE_STOPPED                               :{WHITE}A aeronave deve estar parada no hangar
 STR_A01C_CAN_T_SELL_AIRCRAFT                                    :{WHITE}Impossível vender aeronave...
 STR_A01D_AIRPORT_CONSTRUCTION                                   :Construir aeroporto
 STR_A01E_BUILD_AIRPORT                                          :{BLACK}Construir aeroporto
 STR_A01F_AIRCRAFT_CLICK_ON_AIRCRAFT                             :{BLACK}Aeronave - clique na aeronave para informações
-STR_A020_BUILD_NEW_AIRCRAFT_REQUIRES                            :{BLACK}Construir nova aeronave (necessita de aeroporto com hangar)
+STR_A020_BUILD_NEW_AIRCRAFT_REQUIRES                            :{BLACK}Construir nova aeronave (requer de aeroporto com hangar)
 STR_A021_AIRCRAFT_CLICK_ON_AIRCRAFT                             :{BLACK}Aeronave - clique na aeronave para informações
 STR_A022_BUILD_NEW_AIRCRAFT                                     :{BLACK}Construir nova aeronave
 STR_A023_DRAG_AIRCRAFT_TO_HERE_TO                               :{BLACK}Arraste a aeronave aqui para vendê-la
@@ -3114,6 +3118,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Carregado compativel com GRF(s)  por falta de arquivo
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}arquivo(s) GRF em falta foram desativados
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Falta(m) arquivo(s) GRF para carregar o jogo
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Arquivo(s) GRF faltantes
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Despausar pode travar OpenTTD. Não envie relatórios de erros sobre travas subseqüentes.{}Você realmente quer despausar?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Moeda Modificada
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Taxa de câmbio: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3208,7 +3214,7 @@
 STR_SHORT_DATE                                                  :{WHITE}{DATE_TINY}
 STR_SIGN_LIST_CAPTION                                           :{WHITE}Lista de Placas - {COMMA} Placa{P "" s}
 
-STR_ORDER_REFIT_FAILED                                          :{WHITE}Erro na ordem de readaptação {STRING} {COMMA}
+STR_ORDER_REFIT_FAILED                                          :{WHITE}Falha na parada de ordem de adaptação {STRING} {COMMA}
 
 ############ Lists rail types
 
@@ -3233,11 +3239,14 @@
 STR_PURCHASE_INFO_COST_SPEED                                    :{BLACK}Custo: {GOLD}{CURRENCY}{BLACK} Velocidade: {GOLD}{VELOCITY}
 STR_PURCHASE_INFO_AIRCRAFT_CAPACITY                             :{BLACK}Capacidade: {GOLD}{COMMA} passageiros, {COMMA} sacos de cartas
 STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT                          :{BLACK}Vagões energizados: {GOLD}+{POWER}{BLACK} Peso: {GOLD}+{WEIGHT_S}
-STR_PURCHASE_INFO_REFITTABLE_TO                                 :{BLACK}Readaptável para: {GOLD}
+STR_PURCHASE_INFO_REFITTABLE_TO                                 :{BLACK}Adaptável para: {GOLD}
 STR_PURCHASE_INFO_ALL_TYPES                                     :Todos as cargas
 STR_PURCHASE_INFO_ALL_BUT                                       :Todas menos {GOLD}
 STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Max. Tração : {GOLD}{FORCE}
 
+########### For showing numbers in widgets
+
+
 ########### String for New Landscape Generator
 
 STR_GENERATE                                                    :{WHITE}Gerar
@@ -3265,7 +3274,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Alterar muito o tamanho do mapa original não é recomendado. Continuar com a geração?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Aviso do layout da cidade
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}O Layout "sem mais estradas" não é recomendado. Continuar com a geração?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Nome do mapa em relevo:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Tamanho: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Gerando mundo...
@@ -3291,7 +3299,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Mover a altitude da terra plana em uma unidade a mais
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Mudar a altitude da terra plana
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Altitude da terra plana
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centralizar o minimapa na posição atual
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3449,3 +3456,20 @@
 STR_FACE_EARRING                                                :Brinco:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Alterar gravata ou brinco
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Seleção de Sinais
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Impossível converter sinais aqui...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Sinais padrão (semáforos){}Sinais são necessários para manter trens de colidirem nas malhas ferroviárias com mais de um trem.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Sinal de Entrada (semáforo){}Verde contanto que haja um ou mais sinais de saída verdes na atual seção dos trilhos. Do contrário, fica vermelho.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Sinal de saída (semáforo){}Funciona como um sinal normal, porém é necessário para o funcionamento correto do sistema de sinais combo ou de entrada.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Sinal combo (semáforo){}O sinal combo funciona tanto como um sinal de entrada quanto de saída. Permite construir várias ramificações.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Sinal Padrão (elétrico){}Sinais são necessários para impedir que trens batam em redes de ferrovias com mais de uma máquina.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Sinal de entrada (elétrico){}Verde contanto que haja um ou mais sinais de saída verdes na atual seção dos trilhos. Do contrário, fica vermelho.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Sinal de saída(elétrico){}Funciona como um sinal normal, porém é necessário para o funcionamento correto do sistema de sinais combo ou de entrada.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Sinal combo (elétrico){}O sinal combo funciona tanto como um sinal de entrada quanto de saída. Permite construir várias ramificações.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Converter sinal{}Quando selecionado, clicar num sinal existente converte-o para o tipo selecionado e suas variantes. CTRL+clique muda a variante atual.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Densidade dos sinais ao clicar e arrastar
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Diminuir a densidade dos sinais
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Aumentar a densidade dos sinais
+########
--- a/src/lang/bulgarian.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/bulgarian.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -162,7 +162,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Изчистването е невъзможно....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Авторски права {COPYRIGHT} 1995 Крис Сойер (Chris Sawyer), Всички права са запазени
 STR_00B7_VERSION                                                :{BLACK}OpenTTD версия {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 The OpenTTD team
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 The OpenTTD team
 STR_TRANSLATED_BY                                               :{BLACK}  Преводач(и) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -301,12 +301,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Много играчи
 STR_SCENARIO_EDITOR                                             :{BLACK}Редактор сценарии
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Размер на картата:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Настройки
@@ -590,12 +584,15 @@
 STR_0203_SHOW_LAST_MESSAGE_NEWS                                 :{BLACK}Покажи последното съобщение/новини, покажи настройките на съобщенията
 STR_0204_MESSAGE_OPTIONS                                        :{WHITE}Настройки на съобщенията
 STR_0205_MESSAGE_TYPES                                          :{BLACK}Типове съобщения:
-STR_0206_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Първо пристигане на превозно средство в станция
+STR_0206_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Първа кола пристигнала в станция
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Първо пристигане на превозно средство в конкурентна станция
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Инциденти / бедствия
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Информация за компанията
 STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Отворени / затворени промишлености
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Промени в икономиката
+STR_INDUSTRY_CHANGES_SERVED_BY_PLAYER                           :{YELLOW}Промяна в производството на индустрия обслужвана от играча
+STR_INDUSTRY_CHANGES_SERVED_BY_OTHER                            :{YELLOW}Промяна в производството на индустрия обслужвана от конкуренцията
+STR_OTHER_INDUSTRY_PRODUCTION_CHANGES                           :{YELLOW}Промяна в производството на индустрия
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Съвет / информация за превозните средства
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Нови превозни средства
 STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Промени в приемането на товари
@@ -834,9 +831,9 @@
 STR_02F5                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
 STR_02F6_SELECT_INTERVAL_BETWEEN                                :{BLACK}Интервала между две автозаписваня
 STR_02F7_OFF                                                    :изключено
-STR_02F8_EVERY_3_MONTHS                                         :на всеки 3 месеца
-STR_02F9_EVERY_6_MONTHS                                         :На всеки 6 месеца
-STR_02FA_EVERY_12_MONTHS                                        :На всеки 12 месеца
+STR_02F8_EVERY_3_MONTHS                                         :всеки 3 месеца
+STR_02F9_EVERY_6_MONTHS                                         :всеки 6 месеца
+STR_02FA_EVERY_12_MONTHS                                        :всеки 12 месеца
 STR_02FB_START_A_NEW_GAME                                       :{BLACK}Започни нова игра
 STR_02FC_LOAD_A_SAVED_GAME                                      :{BLACK}Отвори запасена игра
 STR_02FE_CREATE_A_CUSTOMIZED_GAME                               :{BLACK}Създай свой собствен карта-свят
@@ -932,7 +929,7 @@
 STR_CURR_SKK                                                    :словашка крона (SKK)
 STR_CURR_BRR                                                    :бразилски реал (BRL)
 
-STR_CURR_CUSTOM                                                 :Друга...
+STR_CURR_CUSTOM                                                 :друга...
 
 STR_OPTIONS_LANG                                                :{BLACK}Език
 STR_OPTIONS_LANG_CBO                                            :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -940,6 +937,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Цял екран
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Изберете тази опция за да играете OpenTTD в цял екран
+STR_FULLSCREEN_FAILED                                           :{WHITE}Проблем при включване на режим "цял екран"
 
 STR_OPTIONS_RES                                                 :{BLACK}Размер на екрана
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -949,7 +947,7 @@
 STR_OPTIONS_SCREENSHOT_FORMAT_CBO                               :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
 STR_OPTIONS_SCREENSHOT_FORMAT_TIP                               :{BLACK}Избор на формата на екранните снимки
 
-STR_AUTOSAVE_1_MONTH                                            :Всеки месец
+STR_AUTOSAVE_1_MONTH                                            :всеки месец
 STR_AUTOSAVE_FAILED                                             :{WHITE}Автозапазването е неуспешно
 
 STR_MONTH_JAN                                                   :Януари
@@ -1023,6 +1021,7 @@
 STR_CONFIG_PATCHES_ON                                           :Включено
 STR_CONFIG_PATCHES_VEHICLESPEED                                 :{LTBLUE}Показване скоростта на автомобилите в лента за състоянието: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_BUILDONSLOPES                                :{LTBLUE}Позволяване строенето на склонове и брегове: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AUTOSLOPE                                    :{LTBLUE}Тераформиране под сгради, пътища и др. (autoslope): {ORANGE}{STRING}
 STR_CONFIG_PATCHES_CATCHMENT                                    :{LTBLUE}По-реалистична зона за обслужване: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_EXTRADYNAMITE                                :{LTBLUE}Премахване на повече неща собственост на град: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAMMOTHTRAINS                                :{LTBLUE}Строене на много дълги влакове: {ORANGE}{STRING}
@@ -1036,6 +1035,7 @@
 STR_CONFIG_PATCHES_SELECTGOODS                                  :{LTBLUE}Доставяне на стока до станция само ако има търсене: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_LONGBRIDGES                                  :{LTBLUE}Строене на много дълги мостове: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_GOTODEPOT                                    :{LTBLUE}Сервиз в маршрута: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD             :{LTBLUE}Ръчен строеж на първични индустрии: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_NONE        :нищо
 STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL      :като други промишлености
 STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :предстоящ
@@ -1133,6 +1133,7 @@
 STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_LAST                       :Последно на разположение
 STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MOST_USED                  :Най-много използван
 
+STR_CONFIG_PATCHES_ALWAYS_BUILD_INFRASTRUCTURE                  :{LTBLUE}Показване на инструментите за строене при липса на съответни превозни средства: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Макс. влакове на играч: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Макс. брой коли на играч: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_AIRCRAFT                                 :{LTBLUE}Макс. брой самолети на играч: {ORANGE}{STRING}
@@ -1165,6 +1166,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Позволяване покупката на акции от други компании
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}При влачене, поставяне на семафори всеки: {ORANGE}{STRING} плочка(и)
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Автоматично построй семафори преди: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Вклучи GUI за сигналите: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Грацкиа план "няма повече пътища" е невалиден в сценарий редакторат
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Избери грацки пътформат: {ORANGE}{STRING}
@@ -1679,7 +1681,9 @@
 STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}Построи трамвайен мост
 STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}Построй тунел
 STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}Построи трамвайен тунел
+STR_TOGGLE_ONE_WAY_ROAD                                         :{BLACK}Активирай/Деактивирай еднопосочни пътища
 STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Премахване на асфалтов път
+STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}Превключване строене/разрушаване на трамвайни консктрукции
 STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}Ориентация на гараж
 STR_1813_SELECT_TRAM_VEHICLE_DEPOT                              :{BLACK}Избери посоката на трамвайното депо
 STR_1814_ROAD                                                   :път
@@ -1699,6 +1703,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Сградата първо трябва да бъде разрушена
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}Население: {ORANGE}{COMMA}{BLACK}  Жилища: {ORANGE}{COMMA}
@@ -1791,7 +1796,7 @@
 
 STR_INDUSTRY                                                    :{INDUSTRY}
 STR_TOWN                                                        :{TOWN}
-STR_INDUSTRY_FORMAT                                             :{TOWN} {STRING}
+STR_INDUSTRY_FORMAT                                             :{1:STRING} {0:TOWN}
 STR_STATION                                                     :{STATION}
 
 ##id 0x2800
@@ -2010,8 +2015,8 @@
 STR_4839_PRODUCTION_DOWN_BY_50                                  :{BLACK}{BIGFONT}Прозиводството в {INDUSTRY} спадна с 50%
 STR_483A_INSECT_INFESTATION_CAUSES                              :{BLACK}{BIGFONT}Напаст от насекоми предизвика опустошение в {INDUSTRY}!{}Производството намаля с 50%
 STR_483B_CAN_ONLY_BE_POSITIONED                                 :{WHITE}...може да бъде поставено само до краищата на картата
-STR_INDUSTRY_PROD_GOUP                                          :{BLACK}{BIGFONT}{STRING} продукция в {INDUSTRY} нарасна с {COMMA}%!
-STR_INDUSTRY_PROD_GODOWN                                        :{BLACK}{BIGFONT}{STRING} продукция в {INDUSTRY} намаля с {COMMA}%!
+STR_INDUSTRY_PROD_GOUP                                          :{BLACK}{BIGFONT}Производството на {STRING} в {INDUSTRY} нарасна с {COMMA}%!
+STR_INDUSTRY_PROD_GODOWN                                        :{BLACK}{BIGFONT}Производството на {STRING} в {INDUSTRY} намаля с {COMMA}%!
 
 ##id 0x5000
 STR_5000_TRAIN_IN_TUNNEL                                        :{WHITE}Влак в тунела
@@ -2303,6 +2308,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Парола
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Постави парола за да предпазиш компанията си от неоторизирани потребители.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Поставяне парола на компанията
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Незапазвай паролата
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Дай на компанията новата парола
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Парола на компанията
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Парола по подразбиране за компания
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Използване на тази парола по подразбиране за нови компании
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Световна икономическа криза!{}{}Финансовите експерти очакват най-лошото от сриващата се световна икономика!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Световната икономическа криза отмина!{}{}Възходът на търговията дава увереност на индустриите в новата засилваща се икономическа реалност!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Активирай голям/малък размер на прозореца
@@ -2783,7 +2793,9 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Нов {STRING} е на разположение! - {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Унищожено превозно средство не може да се продаде...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Не може да се преустройва разрушено превозно средство...
 
+STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Не може да добави разписание на превозно средство...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Превозни средства могат да чакат само на гари.
 STR_TIMETABLE_NOT_STOPPING_HERE                                 :{WHITE}Това превознот средство не спира на тази гара.
 STR_TIMETABLE_CHANGE_TIME                                       :{BLACK}Промени времето
@@ -2793,6 +2805,7 @@
 STR_TIMETABLE_TOTAL_TIME                                        :Ще трябва {STRING} за това разписание да бъде приклучено
 STR_TIMETABLE_TOTAL_TIME_INCOMPLETE                             :Това разписание ще вземе най-малко {STRING} за да приклучи (не всичко е планирано)
 STR_TIMETABLE_AUTOFILL                                          :{BLACK}Афтонапълване
+STR_TIMETABLE_AUTOFILL_TOOLTIP                                  :{BLACK}Автоматично попълване на разписанието със стойности от първото пътуване
 
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Кола на пътя
@@ -2841,7 +2854,7 @@
 STR_902C_NAME_ROAD_VEHICLE                                      :{WHITE}Преименувай МПС-то
 STR_902D_CAN_T_NAME_ROAD_VEHICLE                                :{WHITE}Не може да преименуваш МПС-то...
 STR_902E_NAME_ROAD_VEHICLE                                      :{BLACK}Преименувай МПС-то
-STR_902F_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Хората празнуват . . .{}Първи автобус пристигна на {STATION}!
+STR_902F_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Гражданите празнуват . . .{}Първият автобус пристигнал в {STATION}!
 STR_9030_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Хората празнуват . . .{}Първи камион пристигна на {STATION}!
 STR_902F_CITIZENS_CELEBRATE_FIRST_TRAM                          :{BLACK}{BIGFONT}Гражданите празнуват . . .{}Първиат пътнически трамвай пристига на {STATION}!
 STR_9030_CITIZENS_CELEBRATE_FIRST_TRAM                          :{BLACK}{BIGFONT}Гражданите празнуват . . .{}Първиат товарен трамвай пристига на {STATION}!
@@ -3072,6 +3085,7 @@
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} трябва да бъде зареден след {STRING}.
 STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER                            :{STRING} поискай OpenTTD версиа {STRING} или по-добра.
 STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :GRF файлат беше предназначен да преведе
+STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED                        :Прекалено много графики (NewGRF) са заредени.
 
 STR_NEWGRF_ADD                                                  :{BLACK}Добави
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Добавяне на NewGRF файл към списъка
@@ -3100,6 +3114,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Съвместими GRF файлове за заредени вместо липсващите
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Липсващите GRF файлове за изключени
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Липсващи GRF файлове при зареждане на игра
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Липсва GRF файл(ове)
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Може да счупи OpenTTD. Не пускайте съобщение за грешка за последвали счупвания.{}Желаете ли да се махне паузата?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Парична единица
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Обменен курс: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3251,7 +3267,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Прекаленото оразмеряване не е препорачително. Продължаване с генерацията?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Грацки план предупреждение
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Грацкиа план "няма повече пътища" не е препоръчан. Продължи със създаването?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Име на височинна карта:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Размер: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Създаване на свят...
@@ -3277,9 +3292,9 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Повишаване височината на плоска земя
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Промяна височината на плоска земя
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Височина на плоска земя:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Центриране на малката карта на текущата позиция
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
 
 ########### String for new airports
 STR_SMALL_AIRPORT                                               :{BLACK}Малко
@@ -3434,3 +3449,20 @@
 STR_FACE_EARRING                                                :Oбица:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Cмени вратовръзкатa или oбицатa
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Сигнал селекция
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Тук не може да се конвертират сигналите...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Нормален сигнал (семафор){}Сигналите са необходими за да предпазват влаковете от катастрофи по ЖП мрежата.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Входен сигнал (семафор){}Свети зелено докато има поне един зелен изходен сигнал от следващия сегмент от пътя. В противен случай свети червено.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Изходен сигнал (семафор){}Действа като нормален сигнал, но е необходим за да работят входните и комбинираните сигнали.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Комбиниран сигнал (семафор){}Комбинирания сигнал действа едновременно като входен и изходен сигнал. Това позволява за изграждането на големи "дървета" от сигнали.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Нормален сигнал (електрически){}Сигналите са необходими за да предпазват влаковете от катастрофи по ЖП мрежата.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Входен сигнал (електрически){}Свети зелено докато има поне един зелен изходен сигнал от следващия сегмент от пътя. В противен случай свети червено.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Изходен сигнал (електрически){}Действа като нормален сигнал, но е необходим за да работят входните и комбинираните сигнали.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Комбиниран сигнал (електрически){}Комбинирания сигнал действа едновременно като входен и изходен сигнал. Това позволява за изграждането на големи "дървета" от сигнали.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Конвертиране на сигнал{}Когато е избран, натискането на съществуващ сигнал ще го конвертира в избрания тип и вариант, CTRL-click ще смени съществуващия вариант.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Плътност на сигналите при влачене
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Намалява плътноста на сигналите при влачене
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Увеличава плътноста на сигналите при влачене
+########
--- a/src/lang/catalan.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/catalan.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -160,7 +160,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}No es pot netejar l'àrea....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Copyright original {COPYRIGHT} 1995 Chris Sawyer, Tots els drets reservats
 STR_00B7_VERSION                                                :{BLACK}OpenTTD versió {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 L'equip d'OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 L'equip d'OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK}  Traductor(s) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Multijugador
 STR_SCENARIO_EDITOR                                             :{BLACK}Editor d'Escenaris
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Tamany del mapa:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Opcions del Joc
@@ -732,6 +726,7 @@
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Situa un repetidor
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Defineix àrea de desert.{}Prem i mantingues la tecla CTRL per treure'l
 STR_CREATE_LAKE                                                 :{BLACK}Defineix l'area d'aigua.{}Fa un canal, excepte si CTRL està apretat al nivell del mar, llavors s'inundaran els voltants
+STR_CREATE_RIVER                                                :{BLACK}Posa rius.
 STR_0290_DELETE                                                 :{BLACK}Esborra
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Esborra totalment aquesta població
 STR_0292_SAVE_SCENARIO                                          :Desa l'escenari
@@ -941,6 +936,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Pantalla Completa
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Marca la casella per tenir l'OpenTTD en pantalla completa
+STR_FULLSCREEN_FAILED                                           :{WHITE}El mode en pantalla completa ha fallat
 
 STR_OPTIONS_RES                                                 :{BLACK}Resolució de Pantalla
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1169,6 +1165,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Permet comprar participacions d'altres empreses
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Arrossegant, sitúa senyals cada: {ORANGE}{STRING} quadre(s)
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Construir semàfors automàticament abans de: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Activa la interfície de les senyals: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}El format de poble "no més carreteres" no és vàlid a l'editor d'escenaris
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Selecciona el format poble-carretera: {ORANGE}{STRING}
@@ -2310,6 +2307,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Contrasenya
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Protegeix la teva Empresa amb contrasenya per tal d'evitar que la utilitzin usuaris no autoritzats.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Estableix la contrasenya de l'Empresa
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}No desis la contrasenya introduïda
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Dóna a la companyia una nova contrasenya
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Contrasenya de la companyia
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Contrasenya de la companyia predeterminada
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Utilitza la contrasenya d'aquesta companyia com a predeterminada per a noves companyies
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Recessió Mundial!{}{}Economistes experts temen que l'economia es desplomi!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Recessió Acabada!{}{}La millora als negocis dóna confiança a les indústries a la vegada que l'economia s'enforteix!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Intercanvia mida gran/petita de finestra
@@ -2335,6 +2337,8 @@
 STR_LIVERY_PASSENGER_WAGON_STEAM                                :Vagó de passatgers (Vapor)
 STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Vagó de passatgers (Diesel)
 STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Vagó de passatgers (Elèctric)
+STR_LIVERY_PASSENGER_WAGON_MONORAIL                             :Vagó de Passatgers (Monorail)
+STR_LIVERY_PASSENGER_WAGON_MAGLEV                               :Vagó de Passatgers (Maglev)
 STR_LIVERY_FREIGHT_WAGON                                        :Vagó de càrrega
 STR_LIVERY_BUS                                                  :Autobús
 STR_LIVERY_TRUCK                                                :Camió
@@ -2790,6 +2794,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Nou/Nova {STRING} disponible!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}No es pot vendre el vehicle destruït...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}No es pot remodelar el vehicle destruït...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Impossible establir l'horari del vehicle...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Els vehicles només poden esperar a les estacions.
@@ -3110,6 +3115,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}S'han carregat els GRF(s) compatibles pels arxius faltants
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Els arxius GRF(s) faltants han estat desactivats
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Arxius GRF(s) faltants per poder carregar el joc
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Falten arxiu(s) GRF
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Treure la pausa pot provocar fallades d'OpenTTD. No informis d'errors a causa de fallades subseqüents.{}Estàs segur de voler treure la pausa?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Moneda personalitzada
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Canvi de moneda: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3234,6 +3241,12 @@
 STR_PURCHASE_INFO_ALL_BUT                                       :Tots menys {GOLD}
 STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Max. Esforç de Tracció: {GOLD}{FORCE}
 
+########### For showing numbers in widgets
+
+STR_NUM_1                                                       :{BLACK}{SKIP}{NUM}
+STR_NUM_2                                                       :{BLACK}{SKIP}{SKIP}{NUM}
+STR_NUM_3                                                       :{BLACK}{SKIP}{SKIP}{SKIP}{NUM}
+
 ########### String for New Landscape Generator
 
 STR_GENERATE                                                    :{WHITE}Genera
@@ -3261,7 +3274,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}No es recomana redimensionar massa el mapa d'origen. Vols continuar amb la generació?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Alerta de format de poble
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}El format de poble "no més carreteres" no està recomanat. Continuar amb la generació?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Nom del mapa d'alçades:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Mida: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Generant món...
@@ -3287,7 +3299,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Mou l'alçada del terreny pla un pas amunt
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Canvia alçada del terreny pla
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Alçada del terreny pla:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centrar el mapa petit a la posició actual
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3445,3 +3456,20 @@
 STR_FACE_EARRING                                                :Arracades:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Canvia la corbata o les arracades
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Selecció de senyals
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Aquí no es pot convertir les senyals...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Senyal estàndard (semàfor){}Les senyals són necessàries per impedir que els trens s'accidentin en xarxes de ferrocarrils amb més d'un tren.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Senyal d'endrada (semàfor){}En verd mentre hi hagi una o més senyals de sortida en verd en la secció següent de vies. En cas contrari està en vermell.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Senyal de Sortida (semàfor){}Es comporta com una senyal normal però és necessari actuar sobre el color correcte en les pre-senyals d'entrada i combinada.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Senyal Combinada (semàfor){}La senyal combinada simplement actua com a senyal d'entrada i sortida. Això permet construir grans extensions de pre-senyals.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Senyal estàndard (elèctrica){}Les senyals són necessàries per impedir que els trens s'accidentin en xarxes de ferrocarrils amb més d'un tren.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Senyal d'endrada (elèctrica){}En verd mentre hi hagi una o més senyals de sortida en verd en la secció següent de vies. En cas contrari està en vermell.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Senyal de Sortida (elèctrica){}Es comporta com una senyal normal però és necessari actuar sobre el color correcte en les pre-senyals d'entrada i combinada.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Senyal Combinada (elèctrica){}La senyal combinada simplement actua com a senyal d'entrada i sortida. Això permet construir grans extensions de pre-senyals.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Conversió de senyals{}Quan esta seleccionat, clicant una senyal existent la converteix en el tipus de senyal seleccionada i variants, CTRL-clic commuta la variant existent.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Densitat de senyals en arrossegar
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Disminueix la densitat de senyals en arrossegar
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Incrementa la densitat de senyals en arrossegar
+########
--- a/src/lang/croatian.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/croatian.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -22,9 +22,9 @@
 STR_000C_ACCEPTS                                                :{BLACK}Prihvaća: {WHITE}
 STR_000D_ACCEPTS                                                :{BLACK}Prihvaća: {GOLD}
 STR_000E                                                        :
-STR_000F_PASSENGERS                                             :putnici
-STR_0010_COAL                                                   :ugljen
-STR_0011_MAIL                                                   :pošta
+STR_000F_PASSENGERS                                             :Putnici
+STR_0010_COAL                                                   :Ugljen
+STR_0011_MAIL                                                   :Pošta
 STR_0012_OIL                                                    :nafta
 STR_0013_LIVESTOCK                                              :domaće životinje
 STR_0014_GOODS                                                  :robe
@@ -301,12 +301,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Više igrača
 STR_SCENARIO_EDITOR                                             :{BLACK}Editor scenarija
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Veličina karte:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Postavke igre
@@ -596,6 +590,9 @@
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Podatci vezani za tvrtku
 STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Otvaranje / zatvaranje industrija
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Promjene u gospodarstvu
+STR_INDUSTRY_CHANGES_SERVED_BY_PLAYER                           :{YELLOW}Izmjene u produktivnosti industrija djelovanjem igrača
+STR_INDUSTRY_CHANGES_SERVED_BY_OTHER                            :{YELLOW}Izmjene u produktivnosti industrija djelovanjem suparnika
+STR_OTHER_INDUSTRY_PRODUCTION_CHANGES                           :{YELLOW}Ostale izmjene u produktivnosti industrija
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Savjet / informacija o vozilima igrača
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nova vozila
 STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Promjene u prihvaćanju tereta
@@ -940,6 +937,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Cijeli ekran
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Označi ovu kućicu kako bi igrao OpenTTD preko cijelog ekrana
+STR_FULLSCREEN_FAILED                                           :{WHITE}Neuspješan prelazak na prikaz na cijelom ekranu
 
 STR_OPTIONS_RES                                                 :{BLACK}Razlučivost ekrana
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1168,6 +1166,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Dopusti kupovanje udjela u drugim tvrtkama
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Kod povlačenja, postavi signale svakih; {ORANGE}{STRING} pločica
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Automatski izgradi semafore prije: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Omogući signalni GUI: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Raspored grada "nema više cesta" nije valjan u editoru scenarija
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Odaberi grad-cesta raspored: {ORANGE}{STRING}
@@ -1682,6 +1681,7 @@
 STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}Izgradi tramvajski most
 STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}Izgradi cestovni tunel
 STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}Izgradi tramvajski tunel
+STR_TOGGLE_ONE_WAY_ROAD                                         :{BLACK}Aktiviraj/deaktiviraj jednosmjerne ceste
 STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Aktiviraj izgradnju/uklanjanje ceste
 STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}Aktiviraj izgradnju/brisanje za izgradnju tramvaja
 STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}Odaberi smjer spremišta cestovnih vozila
@@ -1703,6 +1703,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Najprije moraš srušiti građevinu
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}Stanovništvo: {ORANGE}{COMMA}{BLACK}  Kuće: {ORANGE}{COMMA}
@@ -2307,6 +2308,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Zaporka
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Zaštiti svoju tvrtku od neovlaštenog korištenja pomoću zaporke.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Postavi zaporku tvrtke
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Nemoj spremiti upisanu zaporku
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Daj tvrtci novu zaporku
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Zaporka tvrtke
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Inicijalna zaporka tvrtke
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Uporabi zaporku ove tvrtke kao inicijalnu za nove tvrtke
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Svjetska recesija!{}{}Financijski stručnjaci očekuju najgore zbog ekonomske krize!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Recesija završena!{}{}Obrat  u trgovanu daje samopouzdanje gospodarstvu jer ekonomija jača!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Namjesti veliku/malu veličinu prozora
@@ -2722,7 +2728,7 @@
 STR_883D_TRAINS_CLICK_ON_TRAIN_FOR                              :{BLACK}Vlakovi - klikni na vlak za informacije
 STR_883E_BUILD_NEW_TRAINS_REQUIRES                              :{BLACK}Izgradi/kupi nove vlakove (zahtijeva spremište vlakova)
 STR_883F_TRAINS_CLICK_ON_TRAIN_FOR                              :{BLACK}Vlakovi - klikni na vlak za informacije., vuci vozilo kako bi dodao/oduzeo od vlaka
-STR_8840_BUILD_NEW_TRAIN_VEHICLE                                :{BLACK}Izgradi novi vlak
+STR_8840_BUILD_NEW_TRAIN_VEHICLE                                :{BLACK}Kupi novo željezničko vozilo
 STR_8841_DRAG_TRAIN_VEHICLE_TO_HERE                             :{BLACK}Ovdje povuci vlak kako bi ga prodao
 STR_8842_CENTER_MAIN_VIEW_ON_TRAIN                              :{BLACK}Centriraj glavni pogled na lokaciju željezničkog spremišta
 STR_8843_TRAIN_VEHICLE_SELECTION                                :{BLACK}Popis izabranih vlakova - klikni na vlak za informacije
@@ -2787,6 +2793,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Novi {STRING} je sada dostupan! - {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Ne mogu prodati uništeno vozilo...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Ne mogu prenamijeniti uništeno vozilo...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Nije moguće rasporediti vozilo...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Vozila mogu čekati samo na stanicama.
@@ -3107,6 +3114,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Kompatibilni GRF(ovi) učitani umjesto nepronađenih datoteka
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Nepronađene GRF datoteke su isključene
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Nedostaje(u) datoteka(e) GRF za učitavanje igre
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Nedostaje GRF datoteka(e)
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Odpauziranje može uzrokovati rušenje OpenTTD-a. Nemojte slati prijave bugova za posljedična rušenja.{}Želite li stvarno odpauzirati?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Proizvoljna valuta
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Devizni tečaj: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3231,6 +3240,9 @@
 STR_PURCHASE_INFO_ALL_BUT                                       :Sve osim {GOLD}
 STR_PURCHASE_INFO_MAX_TE                                        :{BLACK} Maks. vučni napor: {GOLD}{FORCE}
 
+########### For showing numbers in widgets
+
+
 ########### String for New Landscape Generator
 
 STR_GENERATE                                                    :{WHITE}Izradi
@@ -3258,7 +3270,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Prekomjerna promjena veličine mape nije preporučena. Nastaviti sa kreiranjem?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Upozorenje na raspored grada
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Raspored grada s opcijom "nema više cesti" nije preporučen. Nastaviti s generiranjem?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Ime heightmape:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Veličina: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Izrada svijeta u toku...
@@ -3284,9 +3295,9 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Povisi ravnu površinu za jedan korak
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Promijeni visinu ravne površine
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Visina ravne površine:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centriraj malu mapu na trenutni položaj
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
 
 ########### String for new airports
 STR_SMALL_AIRPORT                                               :{BLACK}Mala
@@ -3441,3 +3452,20 @@
 STR_FACE_EARRING                                                :Naušnica:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Promijeni kravatu ili naušnicu
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Izbornik signala
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Ovdje nije moguće konvertirati signale...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Standardni signal (semafor){}Signali su nužni kako bi spriječili vlakove da se sudaraju na pružnim mrežama s više od jednog vlaka.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Ulazni signal (semafor){}Zeleno sve dok je jedan ili više zelenih izlaznih signala na narednom dijelu pruge. U protivnom pokazuje crveno.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Izlazni signal (semafor){}Ponaša se na isti način kao i normalni signali, ali je nužno potrefiti točnu boju na ulaznim & kombo pre-signalima.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Kombo signal (semafor){}Kombo singal jednostavno radi kao ulazni i izlazni signal. Ovo omogućava izgradnju velike "šume" pre-signala.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Standardni signal (električni){}Signali su nužni kako bi spriječili vlakove da se sudaraju na pružnim mrežama s više od jednog vlaka
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Ulazni signal (električni){}Zeleno sve dok je jedan ili više zelenih izlaznih signala na narednom dijelu pruge. U protivnom pokazuje crveno.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Izlazni signal (električni){}Ponaša se na isti način kao i normalni signali, ali je nužno potrefiti točnu boju na ulaznim & kombo pre-signalima.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Kombo signal (električni){}Kombo signal jednostavno radi kao ulazni i izlazni signal. Ovo omogućava izgradnju velike "šume" pre-signala.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Pretvaranje signala{}Kada je označeno, klikanjem na bilo koji postojeći signal pretvara taj signal u odabrani tip i varijantu, CRTL+klik mijenja postojeću varijantu.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Gustoća signala prilikom izgradnje
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Smanji gustoću signala prilikom izgradnje
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Povećaj gustoću signala prilikom izgradnje
+########
--- a/src/lang/czech.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/czech.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -218,7 +218,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Nemůžeš vyčistit tuto oblast...
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Původní copyright: {COPYRIGHT} 1995 Chris Sawyer, všechna práva vyhrazena
 STR_00B7_VERSION                                                :{BLACK}OpenTTD verze {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 Tým OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 Tým OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK}  Překladatel(é) - Hadez, iSteve
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -357,12 +357,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Více hráčů
 STR_SCENARIO_EDITOR                                             :{BLACK}Editor scénáře
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Velikost mapy:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Možnosti hry
@@ -790,6 +784,7 @@
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Umístit vysílač
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Vytvořit pouštní oblast{}Stiskem CTRL ji odstraníš
 STR_CREATE_LAKE                                                 :{BLACK}Vytvořit vodní plochu.{}Pokud není držen CTRL, vytvoří se na úrovni moře průplav; v opačném případě se zaplaví ostatní dílky
+STR_CREATE_RIVER                                                :{BLACK}Vytvořit řeky.
 STR_0290_DELETE                                                 :{BLACK}Smaž
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Smazat celé toto město
 STR_0292_SAVE_SCENARIO                                          :Uložit mapu
@@ -999,6 +994,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Na celou obrazovku
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Zaškrtnutím této volby poběží OpenTTD na celé obrazovce
+STR_FULLSCREEN_FAILED                                           :{WHITE}Selhalo přepnutí na celou obrazovku
 
 STR_OPTIONS_RES                                                 :{BLACK}Rozlišení obrazovky
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1227,6 +1223,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Povolit kupování podílu z ostatních společností
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Při tažení umisťovat signály každých(é): {ORANGE}{STRING} dilků(y)
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Semafory automaticky stavět do roku: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Okno pro stavbu signálů: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Vzor "žádné silnice" se neuplatňuje v editoru scénářů
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Vyber vzor městských silnic: {ORANGE}{STRING}
@@ -2368,6 +2365,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Heslo
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Heslo - zabrání neautorizovaným uživatelům v připojení se k tvé společnosti.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Nastav heslo společnosti.
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Neukládat zadané heslo
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Změnit heslo společnosti
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Heslo společnosti
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Výchozí heslo společností
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Použít toto heslo jako výchozí pro nově založené společnosti
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Celosvětový hospodářský úpadek!{}{}Finanční experti se kvůli prudkému poklesu ekonomiky obávají nejhoršího!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Konec hospodářského úpadku!{}{}Posílení trhu zvýšilo u průmyslu důvěru!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Přepnout velké/malé okno
@@ -2393,6 +2395,8 @@
 STR_LIVERY_PASSENGER_WAGON_STEAM                                :Osobní vagon (parní)
 STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Osobní vagon (dieselový)
 STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Osobní vagon (elektrický)
+STR_LIVERY_PASSENGER_WAGON_MONORAIL                             :Osobní vagon (monorail)
+STR_LIVERY_PASSENGER_WAGON_MAGLEV                               :Osobní vagon (Maglev)
 STR_LIVERY_FREIGHT_WAGON                                        :Nákladní vagon
 STR_LIVERY_BUS                                                  :Autobus
 STR_LIVERY_TRUCK                                                :Nákladní vůz
@@ -2854,6 +2858,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Nov{G á ý é} {STRING} k dispozici!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Nelze prodat zničené vozidlo...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Nelze přestavět zničené vozidlo...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Tomuto vozidlu nejde nastavit jízdní řád...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Vozidla mohou čekat jen ve stanicích.
@@ -3174,6 +3179,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Kompatibilní GRF načteny místo chybějících
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Chybějící soubory GRF byly vyřazeny
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Pro načtení hry chybí GRF soubory
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Chybějící grafické soubory
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Spuštění hry může shodit OpenTTD. Nehlaš chybu kvůli pádům způsobeným touto akcí.{}Opravdu chceš rozjet hru?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Vlastní měna
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Kurz měny: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3298,6 +3305,12 @@
 STR_PURCHASE_INFO_ALL_BUT                                       :Všechny kromě {GOLD}
 STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Max. tažná síla: {GOLD}{FORCE}
 
+########### For showing numbers in widgets
+
+STR_NUM_1                                                       :{BLACK}{SKIP}{NUM}
+STR_NUM_2                                                       :{BLACK}{SKIP}{SKIP}{NUM}
+STR_NUM_3                                                       :{BLACK}{SKIP}{SKIP}{SKIP}{NUM}
+
 ########### String for New Landscape Generator
 
 STR_GENERATE                                                    :{WHITE}Vytvořit
@@ -3325,7 +3338,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Tak velká zmena velikosti zdrojové mapy není doporučena. Pokračovat s generováním?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Varování kvůli vzoru silnic
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Vzor "žádné silnice" není doporučen (nepostaví se ani domy). Pokračovat ve vytváření mapy?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Jméno výškové mapy:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Velikost: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Vytvářím krajinu...
@@ -3351,7 +3363,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Zvednout výšku ploché země o jednu úroveň
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Změnit výšku ploché země
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Výška ploché země:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Vycentrovat malou mapu na tomto místě
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3511,4 +3522,18 @@
 ########
 
 ############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Výběr signálů
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Zde nelze změnit signály...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Standardní signál (semafor){}Signály jsou nutné, aby nedocházelo ke srážkám vlaků na tratích, kde jezdí více než jeden vlak.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Vjezdový signál (semafor){}Svítí zeleně do té doby, kdy v dalším úseku trati je alespoň jeden zeleně svítící výjezdový signál. Jinak svítí červeně.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Výjezdový signál (semafor){}Chová se stejně jako normální signál, ale musí se aktivovat správné světlo na vjezdovém a kombinovaném presignálu.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Kombinovaný signál (semafor){}Kombinovaný signál jednoduše slouží jako zároveň vjezdový a výjezdový signál. Tím je možné postavit velké "řetězce" presignálů.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Standardní signál (elektrický){}Signály jsou nutné, aby nedocházelo ke srážkám vlaků na tratích, kde jezdí více než jeden vlak.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Vjezdový signál (elektrický){}Svítí zeleně do té doby, kdy v dalším úseku trati je alespoň jeden zeleně svítící výjezdový signál. Jinak svítí červeně.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Výjezdový signál (elektrický){}Chová se stejně jako normální signál, ale musí se aktivovat správné světlo na vjezdovém a kombinovaném presignálu.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Kombinovaný signál (elektrický){}Kombinovaný signál jednoduše slouží jako zároveň vjezdový a výjezdový signál. Tím je možné postavit velké "řetězce" presignálů.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Změna signálů{}Pokud je vybrána, signál se změní kliknutím na něj. Při kliknutí s CTRL se bude přepínat mezi variantami existujícího signálu.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Rozestup při stavbě signálů tažením
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Snížit rozestup mezi signály
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Zvýšit rozestup mezi signály
 ########
--- a/src/lang/danish.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/danish.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -160,7 +160,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Kan ikke rydde området....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Original copyright {COPYRIGHT} 1995 Chris Sawyer, Alle rettigheder reserveret
 STR_00B7_VERSION                                                :{BLACK}OpenTTD version {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 OpenTTD teamet
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 OpenTTD teamet
 STR_TRANSLATED_BY                                               :{BLACK}  Oversætter(e) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Netværksspil
 STR_SCENARIO_EDITOR                                             :{BLACK}Scenarieeditor
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Kortstørrelse:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Spilvalg
@@ -1010,10 +1004,10 @@
 STR_AIRCRAFT_HAS_INVALID_ENTRY                                  :{WHITE}Fly {COMMA} har en ugyldig lufthavn i sin ordreliste
 # end of order system
 
-STR_TRAIN_AUTORENEW_FAILED                                      :{WHITE}Automatisk fornyelse af tog mislykkedes {COMMA} (ikke penge nok)
-STR_ROADVEHICLE_AUTORENEW_FAILED                                :{WHITE}Automatisk fornyelse af køretøj mislykkedes {COMMA} (ikke penge nok)
-STR_SHIP_AUTORENEW_FAILED                                       :{WHITE}Automatisk fornyelse af skib mislykkedes {COMMA} (ikke penge nok)
-STR_AIRCRAFT_AUTORENEW_FAILED                                   :{WHITE}Automatisk fornyelse af fly mislykkedes {COMMA} (ikke penge nok)
+STR_TRAIN_AUTORENEW_FAILED                                      :{WHITE}Automatisk fornyelse af tog {COMMA} mislykkedes (ikke penge nok)
+STR_ROADVEHICLE_AUTORENEW_FAILED                                :{WHITE}Automatisk fornyelse af køretøj {COMMA} mislykkedes (ikke penge nok)
+STR_SHIP_AUTORENEW_FAILED                                       :{WHITE}Automatisk fornyelse af skib {COMMA} mislykkedes (ikke penge nok)
+STR_AIRCRAFT_AUTORENEW_FAILED                                   :{WHITE}Automatisk fornyelse af fly {COMMA} mislykkedes (ikke penge nok)
 STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT                            :{WHITE}Tog {COMMA} er for langt efter udskiftning
 
 STR_CONFIG_PATCHES                                              :{BLACK}Indstil programrettelser
@@ -1169,6 +1163,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Tillad at købe aktier i andre selskaber
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Ved trækning placer signal hvert: {ORANGE}{STRING} felt
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Byg automatisk semaforer før: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Slå signalbrugerfladen til: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Vejlayoutet "ikke flere veje" er ikke gyldigt i scenarieeditoren
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Vælg layout for veje i byer: {ORANGE}{STRING}
@@ -1705,6 +1700,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Det er nødvendigt at nedrive bygningen først
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}Indbyggere: {ORANGE}{COMMA}{BLACK}  Huse: {ORANGE}{COMMA}
@@ -2309,6 +2305,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Kodeord
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Beskyt dit selskab med et kodeord for at undgå, at fremmede slutter sig til spillet.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Sæt selskabets kodeord
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Gem ikke den indtastede adgangskode
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Giv firmaet den nye adgangskode
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Firma-adgangskode
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Standard firma-adgangskode
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Brug denne firma-adgangskode som standard for nye firmaer
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Lavkonjuktur over hele verden!{}{}Vismændende frygter det værste, økonomien skrumper!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Økonomisk krise overvundet!{}{}Stigning i forbrug giver industrien selvtilliden tilbage, produktionen øges!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Skift mellem stort/lille vindue
@@ -3109,6 +3110,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Kompatible GRF fil(er) indlæst i stedet for manglende fil(er)
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Manglende GRF fil(er) er blevet slået fra
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Mangler GRF fil(er) for at kunne indlæse spillet
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Manglende GRF-fil(er)
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}OpenTTD kan gå ned, når spillet sættes i gang igen. Undlad at indsende fejlrapporter for efterfølgende nedbrud.{}Vil du virkelig sætte spillet i gang igen?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Brugerdefineret møntfod
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Kurs: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3260,7 +3263,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}At ændre størrelsen på kildebilledet anbefales ikke. Fortsæt genereringen?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Vejlayout-advarsel
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Vejlayoutet "ikke flere veje" anbefales ikke. Fortsæt med at generere?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Højdekortets navn:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Størrelse: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Genererer verden...
@@ -3286,7 +3288,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Flyt højden af fladt land en op
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Ændre højden af fladt land
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Højde af fladt land:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centrer det lille kort ved den nuværende position
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3444,3 +3445,20 @@
 STR_FACE_EARRING                                                :Ørering:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Ændre slips eller ørering
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Signalvalg
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Kan ikke konvertere signaler her...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Standardsignal (semafor){}Signaler er nødvendige for at undgå sammenstød mellem tog på jernbanenetværk med mere end et tog.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Indgangssignal (semafor){}Grønt så længe der er et eller flere grønne udgangssignaler fra den efterfølgende sporsektion. Ellers vises rødt.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Udgangssignal (semafor){}Fungerer som et normalt signal men er nødvendigt for at vise den korrekte farve ved indgangs- og kombisignaler.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Kombisignal (semafor){}Kombisignalet fungerer både som indgangs- og udgangssignal. Dette muliggør opbygning af store forgreninger af signaler.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Standardsignal (electrisk){}Signaler er nødvendige for at undgå sammenstød mellem tog på jernbanenetværk med mere end et tog.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Indgangssignal (elektrisk){}Grønt så længe der er et eller flere grønne udgangssignaler fra den efterfølgende sporsektion. Ellers vises rødt.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Udgangssignal (elektrisk){}Fungerer som et normalt signal men er nødvendigt for at vise den korrekte farve ved indgangs- og kombisignaler.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Kombisignal (elektrisk){}Kombisignalet fungerer både som indgangs- og udgangssignal. Dette muliggør opbygning af store forgreninger af signaler.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Signalkonvertering{}Når denne er valgt, vil klik på et eksisterende signal konvertere det til den valgte signaltype og -variant. CTRL-klik vil skifte den eksisterende signalvariant.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Træk-og-slip signaltæthed
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Formindsk træk-og-slip signaltæthed
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Forøg træk-og-slip signaltæthed
+########
--- a/src/lang/dutch.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/dutch.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -160,7 +160,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Kan gebied niet ontruimen....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Originele copyright {COPYRIGHT} 1995 Chris Sawyer, alle rechten voorbehouden
 STR_00B7_VERSION                                                :{BLACK}OpenTTD versie {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 Het OpenTTD team
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 Het OpenTTD team
 STR_TRANSLATED_BY                                               :{BLACK}  Vertaler(s) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Multiplayer
 STR_SCENARIO_EDITOR                                             :{BLACK}Scenario Bewerken
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Mapgrootte:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Spelopties
@@ -941,6 +935,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Volledig scherm
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Vink dit vakje aan om OpenTTD in het volledige scherm te spelen
+STR_FULLSCREEN_FAILED                                           :{WHITE}Modus volledigscherm is mislukt
 
 STR_OPTIONS_RES                                                 :{BLACK}Schermresolutie
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1169,6 +1164,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Sta het kopen van aandelen toe
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Bij slepen, plaats seinen elke: {ORANGE}{STRING} tegel(s)
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Plaats automatisch semaphore seinen voor: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Activeer sein GUI: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}De stadsindeling "geen wegen" is niet geldig in de scenario editor
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Selecteer stedelijke wegindeling: {ORANGE}{STRING}
@@ -2310,6 +2306,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Wachtwoord
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Bescherm het bedrijf met een wachtwoord zodat niet geautoriseerde personen niet mee kunnen doen.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Geef bedrijfswachtwoord op
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Sla het ingegeven wachtwoord niet op
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Geef het bedrijf het nieuwe wachtwoord
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Bedrijfswachtwoord
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Standaard bedrijfswachtwoord
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Gebruik dit bedrijfswachtwoord als standaard voor nieuwe bedrijven
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Wereld Recessie!{}{}Financiële experts vrezen het ergste terwijl economie ineen stort!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Recessie Voorbij!{}{}Stijgende handel geeft industrie vertrouwen terwijl economie verstevigt!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Schakel tussen groot/klein venster
@@ -2335,6 +2336,8 @@
 STR_LIVERY_PASSENGER_WAGON_STEAM                                :Passagierswagon (Stoom)
 STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Passagierswagon (Diesel)
 STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Passagierswagon (Elektrisch)
+STR_LIVERY_PASSENGER_WAGON_MONORAIL                             :Passagierswagon (Monorail)
+STR_LIVERY_PASSENGER_WAGON_MAGLEV                               :Passagierswagon (Maglev)
 STR_LIVERY_FREIGHT_WAGON                                        :Vracht Wagon
 STR_LIVERY_BUS                                                  :Bus
 STR_LIVERY_TRUCK                                                :Vrachtwagen
@@ -2790,6 +2793,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Nieuw {STRING} nu beschikbaar!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Kan verwoest voertuig niet verkopen...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Kan vernietigd voortuig niet aanpassen...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Kan geen dienstregeling opzetten voor dit voertuig...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Voertuigen kunnen alleen wachten op stations.
@@ -3110,6 +3114,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Compatibele GRF(s) geladen voor ontbrekende bestanden
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Missend(e) GRF bestand(en) zijn uitgeschakeld
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Er zijn missende GRF bestanden om het spel te laden
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Ontbrekende GRF bestand(en)
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Pauze uit zetten kan OpenTTD laten vastlopen. Geef geen fout rapporten bij herhaaldelijk vastlopen.{}Weet je zeker dat je pauze wilt uit zetten?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Aangepaste valuta
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Wisselkoers: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3234,6 +3240,9 @@
 STR_PURCHASE_INFO_ALL_BUT                                       :Alles behalve {GOLD}
 STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Max. Trekkracht: {GOLD}{FORCE}
 
+########### For showing numbers in widgets
+
+
 ########### String for New Landscape Generator
 
 STR_GENERATE                                                    :{WHITE}Maak aan
@@ -3261,7 +3270,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Het aanpassen van de grootte van een bronkaar is niet aan te bevelen. Toch doorgaan?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Stadsindelingswaarschuwing
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}De stadsindeling "geen wegen" is niet aanbevolen. Doorgaan met aanmaken?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Hoogtekaart naam:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Grootte: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Wereld creëren
@@ -3287,7 +3295,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Maak de hoogte van plat land een hoger
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Verander hoogte van vlak land
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Hoogte van platte grond:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centreer de kleine kaart op huidige positie
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3445,3 +3452,20 @@
 STR_FACE_EARRING                                                :Oorbel:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Verander das of oorbel
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Sein keuze
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Kan sein hier niet ombouwen...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Standaard sein (semaphore){}Seinen zijn nodig om te voorkomen dat treinen botsen bij een netwerk met meer dan een trein.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Ingangssein (semaphore){}Groen zolang als er een of meer groene exitseinen zijn volgend na dit sein. Anders is deze rood.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Exitsein (semaphore){}Gedraagt zich hetzelfde als een gewoon sein, maar is nodig om ingangs- en combo-voor-seinen te sturen.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Combo-Sein (semaphore){}Het combo sein gedraagt zicht als zowel Ingangs- als exit-sein. Zo kun je grote netwerken van voorseinen maken.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Standaard sein (electric){}Seinen zijn nodig om te voorkomen dat treinen botsen bij netwerken met meer dan een trein.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Ingangssein (electric){}Groen wanneer er meer dan een groen exit-sein is in het volgende traject. Anders is deze rood.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Exit-sein (electric){}Gedraagt zich hetzelfde als een standaard sein, maar is nodig om ingangs- & combo voorseinen aan te sturen.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Combo-sein (electric){}Het combo sein gedraagt zicht als zowel ingangs- als exit-sein. Zo kun je grote netwerken van voorseinen maken.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Sein ombouwen{}Wanneer geselecteerd, door te klikken op een bestaand seintype, zal het sein worden omgebouwd naar het geselecteerde seintype en varianten, CTRL-klik schakeld tussen de bestaande varianten.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Sleep sein dichtheid
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Verklein gesleepte sein dichtheid
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Vergroot gesleepte sein dichtheid
+########
--- a/src/lang/english.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/english.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -1,4 +1,4 @@
-##name English
+##name English (UK)
 ##ownname English (UK)
 ##isocode en_GB
 ##plural 0
@@ -160,7 +160,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Can't clear this area....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Original copyright {COPYRIGHT} 1995 Chris Sawyer, All rights reserved
 STR_00B7_VERSION                                                :{BLACK}OpenTTD version {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 The OpenTTD team
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 The OpenTTD team
 STR_TRANSLATED_BY                                               :{BLACK}  Translator(s) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Multiplayer
 STR_SCENARIO_EDITOR                                             :{BLACK}Scenario Editor
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Map size:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Game Options
@@ -432,7 +426,7 @@
 STR_0171_PAUSE_GAME                                             :{BLACK}Pause game
 STR_0172_SAVE_GAME_ABANDON_GAME                                 :{BLACK}Save game, abandon game, quit
 STR_0173_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Display list of company's stations
-STR_0174_DISPLAY_MAP                                            :{BLACK}Display map
+STR_0174_DISPLAY_MAP                                            :{BLACK}Display map, extra viewport or list of signs
 STR_0175_DISPLAY_MAP_TOWN_DIRECTORY                             :{BLACK}Display map, town directory
 STR_0176_DISPLAY_TOWN_DIRECTORY                                 :{BLACK}Display town directory
 STR_0177_DISPLAY_COMPANY_FINANCES                               :{BLACK}Display company finances information
@@ -732,6 +726,7 @@
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Place transmitter
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Define desert area.{}Press and hold CTRL to remove it
 STR_CREATE_LAKE                                                 :{BLACK}Define water area.{}Make a canal, unless CTRL is held down at sea level, when it will flood the surroundings instead
+STR_CREATE_RIVER                                                :{BLACK}Place rivers.
 STR_0290_DELETE                                                 :{BLACK}Delete
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Delete this town completely
 STR_0292_SAVE_SCENARIO                                          :Save scenario
@@ -854,7 +849,7 @@
 STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE                            :{BLACK}Select 'sub-arctic' landscape style
 STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE                          :{BLACK}Select 'sub-tropical' landscape style
 STR_0311_SELECT_TOYLAND_LANDSCAPE                               :{BLACK}Select 'toyland' landscape style
-STR_0312_FUND_CONSTRUCTION_OF_NEW                               :{BLACK}Fund construction of new industry
+STR_0312_FUND_CONSTRUCTION_OF_NEW                               :{BLACK}Fund construction of new industry or list all industries
 
 ############ range for menu starts
 STR_INDUSTRY_DIR                                                :Industry Directory
@@ -941,6 +936,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Fullscreen
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Check this box to play OpenTTD fullscreen mode
+STR_FULLSCREEN_FAILED                                           :{WHITE}Fullscreen mode failed
 
 STR_OPTIONS_RES                                                 :{BLACK}Screen resolution
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1610,7 +1606,7 @@
 STR_100A_RAILROAD_CONSTRUCTION                                  :{WHITE}Railway Construction
 STR_TITLE_ELRAIL_CONSTRUCTION                                   :{WHITE}Electrified Railway Construction
 STR_100B_MONORAIL_CONSTRUCTION                                  :{WHITE}Monorail Construction
-STR_100C_MAGLEV_CONSTRUCTION                                    :{WHITE}MagLev Construction
+STR_100C_MAGLEV_CONSTRUCTION                                    :{WHITE}Maglev Construction
 STR_100D_SELECT_RAIL_BRIDGE                                     :{WHITE}Select Rail Bridge
 STR_100E_CAN_T_BUILD_TRAIN_DEPOT                                :{WHITE}Can't build train depot here...
 STR_100F_CAN_T_BUILD_RAILROAD_STATION                           :{WHITE}Can't build railway station here...
@@ -1622,7 +1618,7 @@
 STR_1015_RAILROAD_CONSTRUCTION                                  :Railway construction
 STR_TOOLB_ELRAIL_CONSTRUCTION                                   :Electrified Railway construction
 STR_1016_MONORAIL_CONSTRUCTION                                  :Monorail construction
-STR_1017_MAGLEV_CONSTRUCTION                                    :MagLev construction
+STR_1017_MAGLEV_CONSTRUCTION                                    :Maglev construction
 STR_1018_BUILD_RAILROAD_TRACK                                   :{BLACK}Build railway track
 STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING                         :{BLACK}Build train depot (for building and servicing trains)
 STR_101A_BUILD_RAILROAD_STATION                                 :{BLACK}Build railway station
@@ -2341,6 +2337,8 @@
 STR_LIVERY_PASSENGER_WAGON_STEAM                                :Passenger Coach (Steam)
 STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Passenger Coach (Diesel)
 STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Passenger Coach (Electric)
+STR_LIVERY_PASSENGER_WAGON_MONORAIL                             :Passenger Coach (Monorail)
+STR_LIVERY_PASSENGER_WAGON_MAGLEV                               :Passenger Coach (Maglev)
 STR_LIVERY_FREIGHT_WAGON                                        :Freight Wagon
 STR_LIVERY_BUS                                                  :Bus
 STR_LIVERY_TRUCK                                                :Lorry
@@ -2796,6 +2794,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}New {STRING} now available!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Can't sell destroyed vehicle...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Can't refit destroyed vehicle...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Can't timetable vehicle...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Vehicles can only wait at stations.
@@ -3116,6 +3115,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Compatible GRF(s) loaded for missing files
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Missing GRF file(s) have been disabled
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Missing GRF file(s) to be able to load game
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Missing GRF file(s)
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Unpausing can crash OpenTTD. Do not file bug reports for subsequent crashes.{}Do you really want to unpause?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Custom currency
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Exchange rate: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3240,6 +3241,12 @@
 STR_PURCHASE_INFO_ALL_BUT                                       :All but {GOLD}
 STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Max. Tractive Effort: {GOLD}{FORCE}
 
+########### For showing numbers in widgets
+
+STR_NUM_1                                                       :{BLACK}{SKIP}{NUM}
+STR_NUM_2                                                       :{BLACK}{SKIP}{SKIP}{NUM}
+STR_NUM_3                                                       :{BLACK}{SKIP}{SKIP}{SKIP}{NUM}
+
 ########### String for New Landscape Generator
 
 STR_GENERATE                                                    :{WHITE}Generate
@@ -3267,7 +3274,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Resizing source map too much is not recommended. Continue with the generation?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Town layout warning
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}The town layout "no more roads" is not recommended. Continue with the generation?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Heightmap name:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Size: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Generating world...
@@ -3293,7 +3299,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Move the height of flat land one up
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Change height of flat land
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Height of flat land:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Center the smallmap on the current position
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lang/english_US.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,3462 @@
+##name English (US)
+##ownname English (US)
+##isocode en_US
+##plural 0
+
+#
+
+##id 0x0000
+STR_NULL                                                        :
+STR_0001_OFF_EDGE_OF_MAP                                        :{WHITE}Off edge of map
+STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP                               :{WHITE}Too close to edge of map
+STR_0003_NOT_ENOUGH_CASH_REQUIRES                               :{WHITE}Not enough cash - requires {CURRENCY}
+STR_0004                                                        :{WHITE}{CURRENCY}
+STR_EMPTY                                                       :
+STR_0007_FLAT_LAND_REQUIRED                                     :{WHITE}Flat land required
+STR_0008_WAITING                                                :{BLACK}Waiting: {WHITE}{STRING}
+STR_0009                                                        :{WHITE}{CARGO}
+STR_000A_EN_ROUTE_FROM                                          :{WHITE}{CARGO}{YELLOW}  (en-route from
+STR_000B                                                        :{YELLOW}{STATION})
+STR_000C_ACCEPTS                                                :{BLACK}Accepts: {WHITE}
+STR_000D_ACCEPTS                                                :{BLACK}Accepts: {GOLD}
+STR_000E                                                        :
+STR_000F_PASSENGERS                                             :Passengers
+STR_0010_COAL                                                   :Coal
+STR_0011_MAIL                                                   :Mail
+STR_0012_OIL                                                    :Oil
+STR_0013_LIVESTOCK                                              :Livestock
+STR_0014_GOODS                                                  :Goods
+STR_0015_GRAIN                                                  :Grain
+STR_0016_WOOD                                                   :Wood
+STR_0017_IRON_ORE                                               :Iron Ore
+STR_0018_STEEL                                                  :Steel
+STR_0019_VALUABLES                                              :Valuables
+STR_001A_COPPER_ORE                                             :Copper Ore
+STR_001B_MAIZE                                                  :Maize
+STR_001C_FRUIT                                                  :Fruit
+STR_001D_DIAMONDS                                               :Diamonds
+STR_001E_FOOD                                                   :Food
+STR_001F_PAPER                                                  :Paper
+STR_0020_GOLD                                                   :Gold
+STR_0021_WATER                                                  :Water
+STR_0022_WHEAT                                                  :Wheat
+STR_0023_RUBBER                                                 :Rubber
+STR_0024_SUGAR                                                  :Sugar
+STR_0025_TOYS                                                   :Toys
+STR_0026_CANDY                                                  :Candy
+STR_0027_COLA                                                   :Cola
+STR_0028_COTTON_CANDY                                           :Cotton Candy
+STR_0029_BUBBLES                                                :Bubbles
+STR_002A_TOFFEE                                                 :Toffee
+STR_002B_BATTERIES                                              :Batteries
+STR_002C_PLASTIC                                                :Plastic
+STR_002D_FIZZY_DRINKS                                           :Fizzy Drinks
+STR_002E                                                        :
+STR_002F_PASSENGER                                              :Passenger
+STR_0030_COAL                                                   :Coal
+STR_0031_MAIL                                                   :Mail
+STR_0032_OIL                                                    :Oil
+STR_0033_LIVESTOCK                                              :Livestock
+STR_0034_GOODS                                                  :Goods
+STR_0035_GRAIN                                                  :Grain
+STR_0036_WOOD                                                   :Wood
+STR_0037_IRON_ORE                                               :Iron Ore
+STR_0038_STEEL                                                  :Steel
+STR_0039_VALUABLES                                              :Valuables
+STR_003A_COPPER_ORE                                             :Copper Ore
+STR_003B_MAIZE                                                  :Maize
+STR_003C_FRUIT                                                  :Fruit
+STR_003D_DIAMOND                                                :Diamond
+STR_003E_FOOD                                                   :Food
+STR_003F_PAPER                                                  :Paper
+STR_0040_GOLD                                                   :Gold
+STR_0041_WATER                                                  :Water
+STR_0042_WHEAT                                                  :Wheat
+STR_0043_RUBBER                                                 :Rubber
+STR_0044_SUGAR                                                  :Sugar
+STR_0045_TOY                                                    :Toy
+STR_0046_CANDY                                                  :Candy
+STR_0047_COLA                                                   :Cola
+STR_0048_COTTON_CANDY                                           :Cotton Candy
+STR_0049_BUBBLE                                                 :Bubble
+STR_004A_TOFFEE                                                 :Toffee
+STR_004B_BATTERY                                                :Battery
+STR_004C_PLASTIC                                                :Plastic
+STR_004D_FIZZY_DRINK                                            :Fizzy Drink
+STR_QUANTITY_NOTHING                                            :
+STR_QUANTITY_PASSENGERS                                         :{COMMA} passenger{P "" s}
+STR_QUANTITY_COAL                                               :{WEIGHT} of coal
+STR_QUANTITY_MAIL                                               :{COMMA} bag{P "" s} of mail
+STR_QUANTITY_OIL                                                :{VOLUME} of oil
+STR_QUANTITY_LIVESTOCK                                          :{COMMA} item{P "" s} of livestock
+STR_QUANTITY_GOODS                                              :{COMMA} crate{P "" s} of goods
+STR_QUANTITY_GRAIN                                              :{WEIGHT} of grain
+STR_QUANTITY_WOOD                                               :{WEIGHT} of wood
+STR_QUANTITY_IRON_ORE                                           :{WEIGHT} of iron ore
+STR_QUANTITY_STEEL                                              :{WEIGHT} of steel
+STR_QUANTITY_VALUABLES                                          :{COMMA} bag{P "" s} of valuables
+STR_QUANTITY_COPPER_ORE                                         :{WEIGHT} of copper ore
+STR_QUANTITY_MAIZE                                              :{WEIGHT} of maize
+STR_QUANTITY_FRUIT                                              :{WEIGHT} of fruit
+STR_QUANTITY_DIAMONDS                                           :{COMMA} bag{P "" s} of diamonds
+STR_QUANTITY_FOOD                                               :{WEIGHT} of food
+STR_QUANTITY_PAPER                                              :{WEIGHT} of paper
+STR_QUANTITY_GOLD                                               :{COMMA} bag{P "" s} of gold
+STR_QUANTITY_WATER                                              :{VOLUME} of water
+STR_QUANTITY_WHEAT                                              :{WEIGHT} of wheat
+STR_QUANTITY_RUBBER                                             :{VOLUME} of rubber
+STR_QUANTITY_SUGAR                                              :{WEIGHT} of sugar
+STR_QUANTITY_TOYS                                               :{COMMA} toy{P "" s}
+STR_QUANTITY_SWEETS                                             :{COMMA} bag{P "" s} of candy
+STR_QUANTITY_COLA                                               :{VOLUME} of cola
+STR_QUANTITY_CANDYFLOSS                                         :{WEIGHT} of cotton candy
+STR_QUANTITY_BUBBLES                                            :{COMMA} bubble{P "" s}
+STR_QUANTITY_TOFFEE                                             :{WEIGHT} of toffee
+STR_QUANTITY_BATTERIES                                          :{COMMA} batter{P y ies}
+STR_QUANTITY_PLASTIC                                            :{VOLUME} of plastic
+STR_QUANTITY_FIZZY_DRINKS                                       :{COMMA} fizzy drink{P "" s}
+STR_ABBREV_NOTHING                                              :
+STR_ABBREV_PASSENGERS                                           :{TINYFONT}PS
+STR_ABBREV_COAL                                                 :{TINYFONT}CL
+STR_ABBREV_MAIL                                                 :{TINYFONT}ML
+STR_ABBREV_OIL                                                  :{TINYFONT}OL
+STR_ABBREV_LIVESTOCK                                            :{TINYFONT}LV
+STR_ABBREV_GOODS                                                :{TINYFONT}GD
+STR_ABBREV_GRAIN                                                :{TINYFONT}GR
+STR_ABBREV_WOOD                                                 :{TINYFONT}WD
+STR_ABBREV_IRON_ORE                                             :{TINYFONT}OR
+STR_ABBREV_STEEL                                                :{TINYFONT}ST
+STR_ABBREV_VALUABLES                                            :{TINYFONT}VL
+STR_ABBREV_COPPER_ORE                                           :{TINYFONT}CO
+STR_ABBREV_MAIZE                                                :{TINYFONT}MZ
+STR_ABBREV_FRUIT                                                :{TINYFONT}FT
+STR_ABBREV_DIAMONDS                                             :{TINYFONT}DM
+STR_ABBREV_FOOD                                                 :{TINYFONT}FD
+STR_ABBREV_PAPER                                                :{TINYFONT}PR
+STR_ABBREV_GOLD                                                 :{TINYFONT}GD
+STR_ABBREV_WATER                                                :{TINYFONT}WR
+STR_ABBREV_WHEAT                                                :{TINYFONT}WH
+STR_ABBREV_RUBBER                                               :{TINYFONT}RB
+STR_ABBREV_SUGAR                                                :{TINYFONT}SG
+STR_ABBREV_TOYS                                                 :{TINYFONT}TY
+STR_ABBREV_SWEETS                                               :{TINYFONT}SW
+STR_ABBREV_COLA                                                 :{TINYFONT}CL
+STR_ABBREV_CANDYFLOSS                                           :{TINYFONT}CF
+STR_ABBREV_BUBBLES                                              :{TINYFONT}BU
+STR_ABBREV_TOFFEE                                               :{TINYFONT}TF
+STR_ABBREV_BATTERIES                                            :{TINYFONT}BA
+STR_ABBREV_PLASTIC                                              :{TINYFONT}PL
+STR_ABBREV_FIZZY_DRINKS                                         :{TINYFONT}FZ
+STR_ABBREV_NONE                                                 :{TINYFONT}NO
+STR_ABBREV_ALL                                                  :{TINYFONT}ALL
+STR_00AE                                                        :{WHITE}{DATE_SHORT}
+STR_00AF                                                        :{WHITE}{DATE_LONG}
+STR_00B0_MAP                                                    :{WHITE}Map - {STRING}
+STR_00B1_GAME_OPTIONS                                           :{WHITE}Game Options
+STR_00B2_MESSAGE                                                :{YELLOW}Message
+STR_00B3_MESSAGE_FROM                                           :{YELLOW}Message from {STRING}
+STR_POPUP_CAUTION_CAPTION                                       :{WHITE}Caution!
+STR_00B4_CAN_T_DO_THIS                                          :{WHITE}Can't do this....
+STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Can't clear this area....
+STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Original copyright {COPYRIGHT} 1995 Chris Sawyer, All rights reserved
+STR_00B7_VERSION                                                :{BLACK}OpenTTD version {REV}
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 The OpenTTD team
+STR_TRANSLATED_BY                                               :{BLACK}  Translator(s) -
+
+STR_00C5                                                        :{BLACK}{CROSS}
+STR_00C6                                                        :{SILVER}{CROSS}
+STR_00C7_QUIT                                                   :{WHITE}Quit
+STR_00C8_YES                                                    :{BLACK}Yes
+STR_00C9_NO                                                     :{BLACK}No
+STR_00CA_ARE_YOU_SURE_YOU_WANT_TO                               :{YELLOW}Are you sure you want to abandon this game and return to {STRING}?
+STR_00CB_1                                                      :{BLACK}1
+STR_00CC_2                                                      :{BLACK}2
+STR_00CD_3                                                      :{BLACK}3
+STR_00CE_4                                                      :{BLACK}4
+STR_00CF_5                                                      :{BLACK}5
+STR_00D0_NOTHING                                                :Nothing
+STR_00D1_DARK_BLUE                                              :Dark Blue
+STR_00D2_PALE_GREEN                                             :Pale Green
+STR_00D3_PINK                                                   :Pink
+STR_00D4_YELLOW                                                 :Yellow
+STR_00D5_RED                                                    :Red
+STR_00D6_LIGHT_BLUE                                             :Light Blue
+STR_00D7_GREEN                                                  :Green
+STR_00D8_DARK_GREEN                                             :Dark Green
+STR_00D9_BLUE                                                   :Blue
+STR_00DA_CREAM                                                  :Cream
+STR_00DB_MAUVE                                                  :Mauve
+STR_00DC_PURPLE                                                 :Purple
+STR_00DD_ORANGE                                                 :Orange
+STR_00DE_BROWN                                                  :Brown
+STR_00DF_GREY                                                   :Gray
+STR_00E0_WHITE                                                  :White
+STR_00E1_TOO_MANY_VEHICLES_IN_GAME                              :{WHITE}Too many vehicles in game
+STR_00E2                                                        :{BLACK}{COMMA}
+STR_00E3                                                        :{RED}{COMMA}
+STR_00E4_LOCATION                                               :{BLACK}Location
+STR_00E5_CONTOURS                                               :Contours
+STR_00E6_VEHICLES                                               :Vehicles
+STR_00E7_INDUSTRIES                                             :Industries
+STR_00E8_ROUTES                                                 :Routes
+STR_00E9_VEGETATION                                             :Vegetation
+STR_00EA_OWNERS                                                 :Owners
+STR_00EB_ROADS                                                  :{BLACK}{TINYFONT}Roads
+STR_00EC_RAILROADS                                              :{BLACK}{TINYFONT}Railroads
+STR_00ED_STATIONS_AIRPORTS_DOCKS                                :{BLACK}{TINYFONT}Stations/Airports/Docks
+STR_00EE_BUILDINGS_INDUSTRIES                                   :{BLACK}{TINYFONT}Buildings/Industries
+STR_00EF_VEHICLES                                               :{BLACK}{TINYFONT}Vehicles
+STR_00F0_100M                                                   :{BLACK}{TINYFONT}100m
+STR_00F1_200M                                                   :{BLACK}{TINYFONT}200m
+STR_00F2_300M                                                   :{BLACK}{TINYFONT}300m
+STR_00F3_400M                                                   :{BLACK}{TINYFONT}400m
+STR_00F4_500M                                                   :{BLACK}{TINYFONT}500m
+STR_00F5_TRAINS                                                 :{BLACK}{TINYFONT}Trains
+STR_00F6_ROAD_VEHICLES                                          :{BLACK}{TINYFONT}Road Vehicles
+STR_00F7_SHIPS                                                  :{BLACK}{TINYFONT}Ships
+STR_00F8_AIRCRAFT                                               :{BLACK}{TINYFONT}Aircraft
+STR_00F9_TRANSPORT_ROUTES                                       :{BLACK}{TINYFONT}Transport Routes
+STR_00FA_COAL_MINE                                              :{BLACK}{TINYFONT}Coal Mine
+STR_00FB_POWER_STATION                                          :{BLACK}{TINYFONT}Power Station
+STR_00FC_FOREST                                                 :{BLACK}{TINYFONT}Forest
+STR_00FD_SAWMILL                                                :{BLACK}{TINYFONT}Sawmill
+STR_00FE_OIL_REFINERY                                           :{BLACK}{TINYFONT}Oil Refinery
+STR_00FF_FARM                                                   :{BLACK}{TINYFONT}Farm
+STR_0100_FACTORY                                                :{BLACK}{TINYFONT}Factory
+STR_0101_PRINTING_WORKS                                         :{BLACK}{TINYFONT}Printing Works
+STR_0102_OIL_WELLS                                              :{BLACK}{TINYFONT}Oil Wells
+STR_0103_IRON_ORE_MINE                                          :{BLACK}{TINYFONT}Iron Ore Mine
+STR_0104_STEEL_MILL                                             :{BLACK}{TINYFONT}Steel Mill
+STR_0105_BANK                                                   :{BLACK}{TINYFONT}Bank
+STR_0106_PAPER_MILL                                             :{BLACK}{TINYFONT}Paper Mill
+STR_0107_GOLD_MINE                                              :{BLACK}{TINYFONT}Gold Mine
+STR_0108_FOOD_PROCESSING_PLANT                                  :{BLACK}{TINYFONT}Food Processing Plant
+STR_0109_DIAMOND_MINE                                           :{BLACK}{TINYFONT}Diamond Mine
+STR_010A_COPPER_ORE_MINE                                        :{BLACK}{TINYFONT}Copper Ore Mine
+STR_010B_FRUIT_PLANTATION                                       :{BLACK}{TINYFONT}Fruit Plantation
+STR_010C_RUBBER_PLANTATION                                      :{BLACK}{TINYFONT}Rubber Plantation
+STR_010D_WATER_SUPPLY                                           :{BLACK}{TINYFONT}Water Supply
+STR_010E_WATER_TOWER                                            :{BLACK}{TINYFONT}Water Tower
+STR_010F_LUMBER_MILL                                            :{BLACK}{TINYFONT}Lumber Mill
+STR_0110_COTTON_CANDY_FOREST                                    :{BLACK}{TINYFONT}Cotton Candy Forest
+STR_0111_CANDY_FACTORY                                          :{BLACK}{TINYFONT}Candy Factory
+STR_0112_BATTERY_FARM                                           :{BLACK}{TINYFONT}Battery Farm
+STR_0113_COLA_WELLS                                             :{BLACK}{TINYFONT}Cola Wells
+STR_0114_TOY_SHOP                                               :{BLACK}{TINYFONT}Toy Shop
+STR_0115_TOY_FACTORY                                            :{BLACK}{TINYFONT}Toy Factory
+STR_0116_PLASTIC_FOUNTAINS                                      :{BLACK}{TINYFONT}Plastic Fountains
+STR_0117_FIZZY_DRINK_FACTORY                                    :{BLACK}{TINYFONT}Fizzy Drink Factory
+STR_0118_BUBBLE_GENERATOR                                       :{BLACK}{TINYFONT}Bubble Generator
+STR_0119_TOFFEE_QUARRY                                          :{BLACK}{TINYFONT}Toffee Quarry
+STR_011A_SUGAR_MINE                                             :{BLACK}{TINYFONT}Sugar Mine
+STR_011B_RAILROAD_STATION                                       :{BLACK}{TINYFONT}Railroad Station
+STR_011C_TRUCK_LOADING_BAY                                      :{BLACK}{TINYFONT}Truck Loading Bay
+STR_011D_BUS_STATION                                            :{BLACK}{TINYFONT}Bus Station
+STR_011E_AIRPORT_HELIPORT                                       :{BLACK}{TINYFONT}Airport/Heliport
+STR_011F_DOCK                                                   :{BLACK}{TINYFONT}Dock
+STR_0120_ROUGH_LAND                                             :{BLACK}{TINYFONT}Rough Land
+STR_0121_GRASS_LAND                                             :{BLACK}{TINYFONT}Grass Land
+STR_0122_BARE_LAND                                              :{BLACK}{TINYFONT}Bare Land
+STR_0123_FIELDS                                                 :{BLACK}{TINYFONT}Fields
+STR_0124_TREES                                                  :{BLACK}{TINYFONT}Trees
+STR_0125_ROCKS                                                  :{BLACK}{TINYFONT}Rocks
+STR_0126_WATER                                                  :{BLACK}{TINYFONT}Water
+STR_0127_NO_OWNER                                               :{BLACK}{TINYFONT}No Owner
+STR_0128_TOWNS                                                  :{BLACK}{TINYFONT}Towns
+STR_0129_INDUSTRIES                                             :{BLACK}{TINYFONT}Industries
+STR_012A_DESERT                                                 :{BLACK}{TINYFONT}Desert
+STR_012B_SNOW                                                   :{BLACK}{TINYFONT}Snow
+STR_012C_MESSAGE                                                :{WHITE}Message
+STR_012D                                                        :{WHITE}{STRING}
+STR_012E_CANCEL                                                 :{BLACK}Cancel
+STR_012F_OK                                                     :{BLACK}OK
+STR_0130_RENAME                                                 :{BLACK}Rename
+STR_0131_TOO_MANY_NAMES_DEFINED                                 :{WHITE}Too many names defined
+STR_0132_CHOSEN_NAME_IN_USE_ALREADY                             :{WHITE}Chosen name already in use
+
+STR_0133_WINDOWS                                                :Windows
+STR_0134_UNIX                                                   :Unix
+STR_0135_OSX                                                    :OS X
+STR_OSNAME_BEOS                                                 :BeOS
+STR_OSNAME_MORPHOS                                              :MorphOS
+STR_OSNAME_AMIGAOS                                              :AmigaOS
+STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
+
+STR_013B_OWNED_BY                                               :{WHITE}...owned by {STRING}
+STR_013C_CARGO                                                  :{BLACK}Cargo
+STR_013D_INFORMATION                                            :{BLACK}Information
+STR_013E_CAPACITIES                                             :{BLACK}Capacities
+STR_013E_TOTAL_CARGO                                            :{BLACK}Total Cargo
+STR_013F_CAPACITY                                               :{BLACK}Capacity: {LTBLUE}{CARGO}
+STR_CAPACITY_MULT                                               :{BLACK}Capacity: {LTBLUE}{CARGO} (x{NUM})
+STR_013F_TOTAL_CAPACITY_TEXT                                    :{BLACK}Total cargo (capacity) of this train:
+STR_013F_TOTAL_CAPACITY                                         :{LTBLUE}- {CARGO} ({SHORTCARGO})
+STR_TOTAL_CAPACITY_MULT                                         :{LTBLUE}- {CARGO} ({SHORTCARGO}) (x{NUM})
+STR_0140_NEW_GAME                                               :{BLACK}New Game
+STR_0141_LOAD_GAME                                              :{BLACK}Load Game
+STR_SINGLE_PLAYER                                               :{BLACK}Single player
+STR_MULTIPLAYER                                                 :{BLACK}Multiplayer
+STR_SCENARIO_EDITOR                                             :{BLACK}Scenario Editor
+
+STR_MAPSIZE                                                     :{BLACK}Map size:
+STR_BY                                                          :{BLACK}*
+STR_0148_GAME_OPTIONS                                           :{BLACK}Game Options
+
+STR_0150_SOMEONE                                                :someone{SKIP}{SKIP}
+STR_0151_MAP_OF_WORLD                                           :Map of world
+STR_0152_TOWN_DIRECTORY                                         :Town directory
+STR_0153_SUBSIDIES                                              :Subsidies
+
+STR_UNITS_IMPERIAL                                              :Imperial
+STR_UNITS_METRIC                                                :Metric
+STR_UNITS_SI                                                    :SI
+
+STR_UNITS_VELOCITY_IMPERIAL                                     :{COMMA} mph
+STR_UNITS_VELOCITY_METRIC                                       :{COMMA} km/h
+STR_UNITS_VELOCITY_SI                                           :{COMMA} m/s
+
+STR_UNITS_POWER_IMPERIAL                                        :{COMMA}hp
+STR_UNITS_POWER_METRIC                                          :{COMMA}hp
+STR_UNITS_POWER_SI                                              :{COMMA}kW
+
+STR_UNITS_WEIGHT_SHORT_IMPERIAL                                 :{COMMA}t
+STR_UNITS_WEIGHT_SHORT_METRIC                                   :{COMMA}t
+STR_UNITS_WEIGHT_SHORT_SI                                       :{COMMA}kg
+
+STR_UNITS_WEIGHT_LONG_IMPERIAL                                  :{COMMA} ton{P "" s}
+STR_UNITS_WEIGHT_LONG_METRIC                                    :{COMMA} tonne{P "" s}
+STR_UNITS_WEIGHT_LONG_SI                                        :{COMMA} kg
+
+STR_UNITS_VOLUME_SHORT_IMPERIAL                                 :{COMMA}gal
+STR_UNITS_VOLUME_SHORT_METRIC                                   :{COMMA}l
+STR_UNITS_VOLUME_SHORT_SI                                       :{COMMA}m³
+
+STR_UNITS_VOLUME_LONG_IMPERIAL                                  :{COMMA} gallon{P "" s}
+STR_UNITS_VOLUME_LONG_METRIC                                    :{COMMA} litre{P "" s}
+STR_UNITS_VOLUME_LONG_SI                                        :{COMMA} m³
+
+STR_UNITS_FORCE_IMPERIAL                                        :{COMMA}x10³lbf
+STR_UNITS_FORCE_METRIC                                          :{COMMA} tonne force
+STR_UNITS_FORCE_SI                                              :{COMMA} kN
+
+############ range for menu starts
+STR_0154_OPERATING_PROFIT_GRAPH                                 :Operating profit graph
+STR_0155_INCOME_GRAPH                                           :Income graph
+STR_0156_DELIVERED_CARGO_GRAPH                                  :Delivered cargo graph
+STR_0157_PERFORMANCE_HISTORY_GRAPH                              :Performance history graph
+STR_0158_COMPANY_VALUE_GRAPH                                    :Company value graph
+STR_0159_CARGO_PAYMENT_RATES                                    :Cargo payment rates
+STR_015A_COMPANY_LEAGUE_TABLE                                   :Company league table
+STR_PERFORMANCE_DETAIL_MENU                                     :Detailed performance rating
+############ range for menu ends
+
+STR_015B_OPENTTD                                                :{WHITE}OpenTTD
+STR_015C_SAVE_GAME                                              :Save game
+STR_015D_LOAD_GAME                                              :Load game
+STR_015E_QUIT_GAME                                              :Quit game
+STR_015F_QUIT                                                   :Quit
+STR_ABANDON_GAME_QUERY                                          :{YELLOW}Are you sure you want to quit this game ?
+STR_0161_QUIT_GAME                                              :{WHITE}Quit Game
+STR_SORT_ORDER_TIP                                              :{BLACK}Select sorting order (descending/ascending)
+STR_SORT_CRITERIA_TIP                                           :{BLACK}Select sorting criteria
+STR_SORT_BY                                                     :{BLACK}Sort by
+
+STR_SORT_BY_POPULATION                                          :{BLACK}Population
+STR_SORT_BY_PRODUCTION                                          :{BLACK}Production
+STR_SORT_BY_TYPE                                                :{BLACK}Type
+STR_SORT_BY_TRANSPORTED                                         :{BLACK}Transported
+STR_SORT_BY_NAME                                                :{BLACK}Name
+STR_SORT_BY_DROPDOWN_NAME                                       :Name
+STR_SORT_BY_DATE                                                :{BLACK}Date
+STR_SORT_BY_NUMBER                                              :Number
+STR_SORT_BY_PROFIT_LAST_YEAR                                    :Profit last year
+STR_SORT_BY_PROFIT_THIS_YEAR                                    :Profit this year
+STR_SORT_BY_AGE                                                 :Age
+STR_SORT_BY_RELIABILITY                                         :Reliability
+STR_SORT_BY_TOTAL_CAPACITY_PER_CARGOTYPE                        :Total capacity per cargo type
+STR_SORT_BY_MAX_SPEED                                           :Maximum speed
+STR_SORT_BY_MODEL                                               :Model
+STR_SORT_BY_VALUE                                               :Value
+STR_SORT_BY_FACILITY                                            :Station type
+STR_SORT_BY_WAITING                                             :Waiting cargo value
+STR_SORT_BY_RATING_MAX                                          :Cargo rating
+STR_ENGINE_SORT_ENGINE_ID                                       :EngineID (classic sort)
+STR_ENGINE_SORT_COST                                            :Cost
+STR_ENGINE_SORT_POWER                                           :Power
+STR_ENGINE_SORT_INTRO_DATE                                      :Introduction Date
+STR_ENGINE_SORT_RUNNING_COST                                    :Running Cost
+STR_ENGINE_SORT_POWER_VS_RUNNING_COST                           :Power/Running Cost
+STR_ENGINE_SORT_CARGO_CAPACITY                                  :Cargo Capacity
+STR_NO_WAITING_CARGO                                            :{BLACK}No cargo of any type is waiting
+STR_SELECT_ALL_FACILITIES                                       :{BLACK}Select all facilities
+STR_SELECT_ALL_TYPES                                            :{BLACK}Select all cargo types (including no waiting cargo)
+STR_AVAILABLE_TRAINS                                            :{BLACK}Available Trains
+STR_AVAILABLE_ROAD_VEHICLES                                     :{BLACK}Available Road Vehicles
+STR_AVAILABLE_SHIPS                                             :{BLACK}Available Ships
+STR_AVAILABLE_AIRCRAFT                                          :{BLACK}Available Aircraft
+STR_AVAILABLE_ENGINES_TIP                                       :{BLACK}See a list of available engine designs for this vehicle type.
+STR_MANAGE_LIST                                                 :{BLACK}Manage list
+STR_MANAGE_LIST_TIP                                             :{BLACK}Send instructions to all vehicles in this list
+STR_REPLACE_VEHICLES                                            :Replace vehicles
+STR_SEND_TRAIN_TO_DEPOT                                         :Send to Depot
+STR_SEND_ROAD_VEHICLE_TO_DEPOT                                  :Send to Depot
+STR_SEND_SHIP_TO_DEPOT                                          :Send to Depot
+STR_SEND_AIRCRAFT_TO_HANGAR                                     :Send to Hangar
+STR_SEND_FOR_SERVICING                                          :Send for Servicing
+
+############ range for months starts
+STR_0162_JAN                                                    :Jan
+STR_0163_FEB                                                    :Feb
+STR_0164_MAR                                                    :Mar
+STR_0165_APR                                                    :Apr
+STR_0166_MAY                                                    :May
+STR_0167_JUN                                                    :Jun
+STR_0168_JUL                                                    :Jul
+STR_0169_AUG                                                    :Aug
+STR_016A_SEP                                                    :Sep
+STR_016B_OCT                                                    :Oct
+STR_016C_NOV                                                    :Nov
+STR_016D_DEC                                                    :Dec
+############ range for months ends
+
+STR_016E                                                        :{TINYFONT}{STRING}{} {STRING}
+STR_016F                                                        :{TINYFONT}{STRING}{} {STRING}{}{NUM}
+STR_0170                                                        :{TINYFONT}{STRING}-
+STR_0171_PAUSE_GAME                                             :{BLACK}Pause game
+STR_0172_SAVE_GAME_ABANDON_GAME                                 :{BLACK}Save game, quit game, quit
+STR_0173_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Display list of company's stations
+STR_0174_DISPLAY_MAP                                            :{BLACK}Display map
+STR_0175_DISPLAY_MAP_TOWN_DIRECTORY                             :{BLACK}Display map, town directory
+STR_0176_DISPLAY_TOWN_DIRECTORY                                 :{BLACK}Display town directory
+STR_0177_DISPLAY_COMPANY_FINANCES                               :{BLACK}Display company finances information
+STR_0178_DISPLAY_COMPANY_GENERAL                                :{BLACK}Display general company information
+STR_0179_DISPLAY_GRAPHS                                         :{BLACK}Display graphs
+STR_017A_DISPLAY_COMPANY_LEAGUE                                 :{BLACK}Display company league table
+STR_017B_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Display list of company's trains
+STR_017C_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Display list of company's road vehicles
+STR_017D_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Display list of company's ships
+STR_017E_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Display list of company's aircraft
+STR_017F_ZOOM_THE_VIEW_IN                                       :{BLACK}Zoom the view in
+STR_0180_ZOOM_THE_VIEW_OUT                                      :{BLACK}Zoom the view out
+STR_0181_BUILD_RAILROAD_TRACK                                   :{BLACK}Build railroad track
+STR_0182_BUILD_ROADS                                            :{BLACK}Build roads
+STR_0183_BUILD_SHIP_DOCKS                                       :{BLACK}Build ship docks
+STR_0184_BUILD_AIRPORTS                                         :{BLACK}Build airports
+STR_0185_PLANT_TREES_PLACE_SIGNS                                :{BLACK}Plant trees, place signs etc.
+STR_0186_LAND_BLOCK_INFORMATION                                 :{BLACK}Land area information
+STR_0187_OPTIONS                                                :{BLACK}Options
+STR_0188                                                        :{BLACK}{SMALLUPARROW}
+STR_0189                                                        :{BLACK}{SMALLDOWNARROW}
+STR_018A_CAN_T_CHANGE_SERVICING                                 :{WHITE}Can't change servicing interval...
+STR_018B_CLOSE_WINDOW                                           :{BLACK}Close window
+STR_018C_WINDOW_TITLE_DRAG_THIS                                 :{BLACK}Window title - drag this to move window
+STR_STICKY_BUTTON                                               :{BLACK}Mark this window as uncloseable for the 'Close All Windows' key
+STR_RESIZE_BUTTON                                               :{BLACK}Click and drag to resize this window
+STR_SAVELOAD_HOME_BUTTON                                        :{BLACK}Click here to jump to the current default save/load directory
+STR_018D_DEMOLISH_BUILDINGS_ETC                                 :{BLACK}Demolish buildings etc. on a square of land
+STR_018E_LOWER_A_CORNER_OF_LAND                                 :{BLACK}Lower a corner of land
+STR_018F_RAISE_A_CORNER_OF_LAND                                 :{BLACK}Raise a corner of land
+STR_0190_SCROLL_BAR_SCROLLS_LIST                                :{BLACK}Scroll bar - scrolls list up/down
+STR_HSCROLL_BAR_SCROLLS_LIST                                    :{BLACK}Scroll bar - scrolls list left/right
+STR_0191_SHOW_LAND_CONTOURS_ON_MAP                              :{BLACK}Show land contours on map
+STR_0192_SHOW_VEHICLES_ON_MAP                                   :{BLACK}Show vehicles on map
+STR_0193_SHOW_INDUSTRIES_ON_MAP                                 :{BLACK}Show industries on map
+STR_0194_SHOW_TRANSPORT_ROUTES_ON                               :{BLACK}Show transport routes on map
+STR_0195_SHOW_VEGETATION_ON_MAP                                 :{BLACK}Show vegetation on map
+STR_0196_SHOW_LAND_OWNERS_ON_MAP                                :{BLACK}Show land owners on map
+STR_0197_TOGGLE_TOWN_NAMES_ON_OFF                               :{BLACK}Toggle town names on/off on map
+STR_0198_PROFIT_THIS_YEAR_LAST_YEAR                             :{TINYFONT}{BLACK}Profit this year: {CURRENCY} (last year: {CURRENCY})
+
+############ range for service numbers starts
+STR_AGE                                                         :{COMMA} year{P "" s} ({COMMA})
+STR_AGE_RED                                                     :{RED}{COMMA} year{P "" s} ({COMMA})
+############ range for service numbers ends
+
+STR_019C_ROAD_VEHICLE                                           :Road vehicle
+STR_019D_AIRCRAFT                                               :Aircraft
+STR_019E_SHIP                                                   :Ship
+STR_019F_TRAIN                                                  :Train
+STR_01A0_IS_GETTING_OLD                                         :{WHITE}{STRING} {COMMA} is getting old
+STR_01A1_IS_GETTING_VERY_OLD                                    :{WHITE}{STRING} {COMMA} is getting very old
+STR_01A2_IS_GETTING_VERY_OLD_AND                                :{WHITE}{STRING} {COMMA} is getting very old and urgently needs replacing
+STR_01A3_LAND_AREA_INFORMATION                                  :{WHITE}Land Area Information
+STR_01A4_COST_TO_CLEAR_N_A                                      :{BLACK}Cost to clear: {LTBLUE}N/A
+STR_01A5_COST_TO_CLEAR                                          :{BLACK}Cost to clear: {LTBLUE}{CURRENCY}
+STR_01A6_N_A                                                    :N/A
+STR_01A7_OWNER                                                  :{BLACK}Owner: {LTBLUE}{STRING}
+STR_01A8_LOCAL_AUTHORITY                                        :{BLACK}Local authority: {LTBLUE}{STRING}
+STR_01A9_NONE                                                   :None
+STR_01AA_NAME                                                   :{BLACK}Name
+STR_01AB                                                        :{BLACK}{TINYFONT}{VEHICLE}
+
+############ range for days starts
+STR_01AC_1ST                                                    :1st
+STR_01AD_2ND                                                    :2nd
+STR_01AE_3RD                                                    :3rd
+STR_01AF_4TH                                                    :4th
+STR_01B0_5TH                                                    :5th
+STR_01B1_6TH                                                    :6th
+STR_01B2_7TH                                                    :7th
+STR_01B3_8TH                                                    :8th
+STR_01B4_9TH                                                    :9th
+STR_01B5_10TH                                                   :10th
+STR_01B6_11TH                                                   :11th
+STR_01B7_12TH                                                   :12th
+STR_01B8_13TH                                                   :13th
+STR_01B9_14TH                                                   :14th
+STR_01BA_15TH                                                   :15th
+STR_01BB_16TH                                                   :16th
+STR_01BC_17TH                                                   :17th
+STR_01BD_18TH                                                   :18th
+STR_01BE_19TH                                                   :19th
+STR_01BF_20TH                                                   :20th
+STR_01C0_21ST                                                   :21st
+STR_01C1_22ND                                                   :22nd
+STR_01C2_23RD                                                   :23rd
+STR_01C3_24TH                                                   :24th
+STR_01C4_25TH                                                   :25th
+STR_01C5_26TH                                                   :26th
+STR_01C6_27TH                                                   :27th
+STR_01C7_28TH                                                   :28th
+STR_01C8_29TH                                                   :29th
+STR_01C9_30TH                                                   :30th
+STR_01CA_31ST                                                   :31st
+############ range for days ends
+
+STR_01CB                                                        :{TINYFONT}{COMMA}
+
+STR_01CE_CARGO_ACCEPTED                                         :{BLACK}Cargo accepted: {LTBLUE}
+
+STR_01D1_8                                                      :({COMMA}/8 {STRING})
+STR_01D2_JAZZ_JUKEBOX                                           :{WHITE}Jazz Jukebox
+STR_01D3_SOUND_MUSIC                                            :Sound/music
+STR_01D4_SHOW_SOUND_MUSIC_WINDOW                                :{BLACK}Show sound/music window
+STR_01D5_ALL                                                    :{TINYFONT}All
+STR_01D6_OLD_STYLE                                              :{TINYFONT}Old Style
+STR_01D7_NEW_STYLE                                              :{TINYFONT}New Style
+STR_01D8_EZY_STREET                                             :{TINYFONT}Ezy Street
+STR_01D9_CUSTOM_1                                               :{TINYFONT}Custom 1
+STR_01DA_CUSTOM_2                                               :{TINYFONT}Custom 2
+STR_01DB_MUSIC_VOLUME                                           :{BLACK}{TINYFONT}Music Volume
+STR_01DC_EFFECTS_VOLUME                                         :{BLACK}{TINYFONT}Effects Volume
+STR_01DD_MIN_MAX                                                :{BLACK}{TINYFONT}MIN  '  '  ' '  '  '  MAX
+STR_01DE_SKIP_TO_PREVIOUS_TRACK                                 :{BLACK}Skip to previous track in selection
+STR_01DF_SKIP_TO_NEXT_TRACK_IN_SELECTION                        :{BLACK}Skip to next track in selection
+STR_01E0_STOP_PLAYING_MUSIC                                     :{BLACK}Stop playing music
+STR_01E1_START_PLAYING_MUSIC                                    :{BLACK}Start playing music
+STR_01E2_DRAG_SLIDERS_TO_SET_MUSIC                              :{BLACK}Drag sliders to set music and sound effect volumes
+STR_01E3                                                        :{DKGREEN}{TINYFONT}--
+STR_01E4_0                                                      :{DKGREEN}{TINYFONT}0{COMMA}
+STR_01E5                                                        :{DKGREEN}{TINYFONT}{COMMA}
+STR_01E6                                                        :{DKGREEN}{TINYFONT}------
+STR_01E7                                                        :{DKGREEN}{TINYFONT}"{STRING}"
+STR_01E8_TRACK_XTITLE                                           :{BLACK}{TINYFONT}Track{SETX 88}Title
+STR_01E9_SHUFFLE                                                :{TINYFONT}Shuffle
+STR_01EA_PROGRAM                                                :{TINYFONT}{BLACK}Program
+STR_01EB_MUSIC_PROGRAM_SELECTION                                :{WHITE}Music Program Selection
+STR_01EC_0                                                      :{TINYFONT}{LTBLUE}0{COMMA} "{STRING}"
+STR_01ED                                                        :{TINYFONT}{LTBLUE}{COMMA} "{STRING}"
+STR_01EE_TRACK_INDEX                                            :{TINYFONT}{BLACK}Track Index
+STR_01EF_PROGRAM                                                :{TINYFONT}{BLACK}Program - '{STRING}'
+STR_01F0_CLEAR                                                  :{TINYFONT}{BLACK}Clear
+STR_01F1_SAVE                                                   :{TINYFONT}{BLACK}Save
+STR_01F2_CURRENT_PROGRAM_OF_MUSIC                               :{BLACK}Current program of music tracks
+STR_01F3_SELECT_ALL_TRACKS_PROGRAM                              :{BLACK}Select 'all tracks' program
+STR_01F4_SELECT_OLD_STYLE_MUSIC                                 :{BLACK}Select 'old style music' program
+STR_01F5_SELECT_NEW_STYLE_MUSIC                                 :{BLACK}Select 'new style music' program
+STR_01F6_SELECT_CUSTOM_1_USER_DEFINED                           :{BLACK}Select 'Custom 1' (user-defined) program
+STR_01F7_SELECT_CUSTOM_2_USER_DEFINED                           :{BLACK}Select 'Custom 2' (user-defined) program
+STR_01F8_CLEAR_CURRENT_PROGRAM_CUSTOM1                          :{BLACK}Clear current program (Custom1 or Custom2 only)
+STR_01F9_SAVE_MUSIC_SETTINGS                                    :{BLACK}Save music settings
+STR_01FA_CLICK_ON_MUSIC_TRACK_TO                                :{BLACK}Click on music track to add to current program (Custom1 or Custom2 only)
+STR_CLICK_ON_TRACK_TO_REMOVE                                    :{BLACK}Click on music track to remove it from current program (Custom1 or Custom2 only)
+STR_01FB_TOGGLE_PROGRAM_SHUFFLE                                 :{BLACK}Toggle program shuffle on/off
+STR_01FC_SHOW_MUSIC_TRACK_SELECTION                             :{BLACK}Show music track selection window
+STR_01FD_CLICK_ON_SERVICE_TO_CENTER                             :{BLACK}Click on service to center view on industry/town
+STR_01FE_DIFFICULTY                                             :{BLACK}Difficulty ({STRING})
+STR_01FF                                                        :{TINYFONT}{BLACK}{DATE_LONG}
+STR_0200_LAST_MESSAGE_NEWS_REPORT                               :Last message/news report
+STR_0201_MESSAGE_SETTINGS                                       :Message settings
+STR_MESSAGE_HISTORY_MENU                                        :Message History
+STR_0203_SHOW_LAST_MESSAGE_NEWS                                 :{BLACK}Show last message/news report, show message options
+STR_0204_MESSAGE_OPTIONS                                        :{WHITE}Message Options
+STR_0205_MESSAGE_TYPES                                          :{BLACK}Message types:
+STR_0206_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Arrival of first vehicle at player's station
+STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Arrival of first vehicle at competitor's station
+STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Accidents / disasters
+STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Company information
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Open / close of industries
+STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Economy changes
+STR_INDUSTRY_CHANGES_SERVED_BY_PLAYER                           :{YELLOW}Production changes of industries served by the player
+STR_INDUSTRY_CHANGES_SERVED_BY_OTHER                            :{YELLOW}Production changes of industries served by competitor(s)
+STR_OTHER_INDUSTRY_PRODUCTION_CHANGES                           :{YELLOW}Other industry production changes
+STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Advice / information on player's vehicles
+STR_020C_NEW_VEHICLES                                           :{YELLOW}New vehicles
+STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Changes of cargo acceptance
+STR_020E_SUBSIDIES                                              :{YELLOW}Subsidies
+STR_020F_GENERAL_INFORMATION                                    :{YELLOW}General information
+STR_MESSAGES_ALL                                                :{YELLOW}Setting for all messagetypes (off/summary/full)
+STR_MESSAGE_SOUND                                               :{YELLOW}Play sound for summarized newsmessages
+STR_0210_TOO_FAR_FROM_PREVIOUS_DESTINATIO                       :{WHITE}...too far from previous destination
+STR_0211_TOP_COMPANIES_WHO_REACHED                              :{BIGFONT}{BLACK}Top companies who reached {NUM}{}({STRING} Level)
+STR_TOP_COMPANIES_NETWORK_GAME                                  :{BIGFONT}{BLACK}Company League Table in {NUM}
+STR_0212                                                        :{BIGFONT}{COMMA}.
+STR_0213_BUSINESSMAN                                            :Businessman
+STR_0214_ENTREPRENEUR                                           :Entrepreneur
+STR_0215_INDUSTRIALIST                                          :Industrialist
+STR_0216_CAPITALIST                                             :Capitalist
+STR_0217_MAGNATE                                                :Magnate
+STR_0218_MOGUL                                                  :Mogul
+STR_0219_TYCOON_OF_THE_CENTURY                                  :Tycoon of the Century
+STR_HIGHSCORE_NAME                                              :{BIGFONT}{PLAYERNAME}, {COMPANY}
+STR_HIGHSCORE_STATS                                             :{BIGFONT}'{STRING}'   ({COMMA})
+STR_021B_ACHIEVES_STATUS                                        :{BLACK}{BIGFONT}{COMPANY} achieves '{STRING}' status!
+STR_021C_OF_ACHIEVES_STATUS                                     :{WHITE}{BIGFONT}{PLAYERNAME} of {COMPANY} achieves '{STRING}' status!
+STR_021F                                                        :{BLUE}{COMMA}
+STR_0221_OPENTTD                                                :{YELLOW}OpenTTD
+STR_0222_SCENARIO_EDITOR                                        :{YELLOW}Scenario Editor
+STR_0223_LAND_GENERATION                                        :{WHITE}Land Generation
+STR_0224                                                        :{BLACK}{UPARROW}
+STR_0225                                                        :{BLACK}{DOWNARROW}
+STR_0228_INCREASE_SIZE_OF_LAND_AREA                             :{BLACK}Increase area of land to lower/raise
+STR_0229_DECREASE_SIZE_OF_LAND_AREA                             :{BLACK}Decrease area of land to lower/raise
+STR_022A_GENERATE_RANDOM_LAND                                   :{BLACK}Generate random land
+STR_022B_RESET_LANDSCAPE                                        :{BLACK}Reset landscape
+STR_022C_RESET_LANDSCAPE                                        :{WHITE}Reset Landscape
+STR_RESET_LANDSCAPE_TOOLTIP                                     :{BLACK}Remove all player-owned property from the map
+STR_RESET_LANDSCAPE_CONFIRMATION_TEXT                           :{WHITE}Are you sure you want to remove all player-owned property?
+STR_022E_LANDSCAPE_GENERATION                                   :{BLACK}Landscape generation
+STR_022F_TOWN_GENERATION                                        :{BLACK}Town generation
+STR_0230_INDUSTRY_GENERATION                                    :{BLACK}Industry generation
+STR_0231_ROAD_CONSTRUCTION                                      :{BLACK}Road construction
+STR_0233_TOWN_GENERATION                                        :{WHITE}Town Generation
+STR_0234_NEW_TOWN                                               :{BLACK}New Town
+STR_0235_CONSTRUCT_NEW_TOWN                                     :{BLACK}Construct new town
+STR_0236_CAN_T_BUILD_TOWN_HERE                                  :{WHITE}Can't build town here...
+STR_0237_TOO_CLOSE_TO_EDGE_OF_MAP                               :{WHITE}...too close to edge of map
+STR_0238_TOO_CLOSE_TO_ANOTHER_TOWN                              :{WHITE}...too close to another town
+STR_0239_SITE_UNSUITABLE                                        :{WHITE}...site unsuitable
+STR_023A_TOO_MANY_TOWNS                                         :{WHITE}...too many towns
+STR_CANNOT_GENERATE_TOWN                                        :{WHITE}Can't build any towns
+STR_NO_SPACE_FOR_TOWN                                           :{WHITE}...there is no more space on the map
+STR_023B_INCREASE_SIZE_OF_TOWN                                  :{BLACK}Increase size of town
+STR_023C_EXPAND                                                 :{BLACK}Expand
+STR_023D_RANDOM_TOWN                                            :{BLACK}Random Town
+STR_023E_BUILD_TOWN_IN_RANDOM_LOCATION                          :{BLACK}Build town in random location
+STR_023F_INDUSTRY_GENERATION                                    :{WHITE}Industry Generation
+STR_0240_COAL_MINE                                              :{BLACK}Coal Mine
+STR_0241_POWER_STATION                                          :{BLACK}Power Station
+STR_0242_SAWMILL                                                :{BLACK}Sawmill
+STR_0243_FOREST                                                 :{BLACK}Forest
+STR_0244_OIL_REFINERY                                           :{BLACK}Oil Refinery
+STR_0245_OIL_RIG                                                :{BLACK}Oil Rig
+STR_0246_FACTORY                                                :{BLACK}Factory
+STR_0247_STEEL_MILL                                             :{BLACK}Steel Mill
+STR_0248_FARM                                                   :{BLACK}Farm
+STR_0249_IRON_ORE_MINE                                          :{BLACK}Iron Ore Mine
+STR_024A_OIL_WELLS                                              :{BLACK}Oil Wells
+STR_024B_BANK                                                   :{BLACK}Bank
+STR_024C_PAPER_MILL                                             :{BLACK}Paper Mill
+STR_024D_FOOD_PROCESSING_PLANT                                  :{BLACK}Food Processing Plant
+STR_024E_PRINTING_WORKS                                         :{BLACK}Printing Works
+STR_024F_GOLD_MINE                                              :{BLACK}Gold Mine
+STR_0250_LUMBER_MILL                                            :{BLACK}Lumber Mill
+STR_0251_FRUIT_PLANTATION                                       :{BLACK}Fruit Plantation
+STR_0252_RUBBER_PLANTATION                                      :{BLACK}Rubber Plantation
+STR_0253_WATER_SUPPLY                                           :{BLACK}Water Supply
+STR_0254_WATER_TOWER                                            :{BLACK}Water Tower
+STR_0255_DIAMOND_MINE                                           :{BLACK}Diamond Mine
+STR_0256_COPPER_ORE_MINE                                        :{BLACK}Copper Ore Mine
+STR_0257_COTTON_CANDY_FOREST                                    :{BLACK}Cotton Candy Forest
+STR_0258_CANDY_FACTORY                                          :{BLACK}Candy Factory
+STR_0259_BATTERY_FARM                                           :{BLACK}Battery Farm
+STR_025A_COLA_WELLS                                             :{BLACK}Cola Wells
+STR_025B_TOY_SHOP                                               :{BLACK}Toy Shop
+STR_025C_TOY_FACTORY                                            :{BLACK}Toy Factory
+STR_025D_PLASTIC_FOUNTAINS                                      :{BLACK}Plastic Fountains
+STR_025E_FIZZY_DRINK_FACTORY                                    :{BLACK}Fizzy Drink Factory
+STR_025F_BUBBLE_GENERATOR                                       :{BLACK}Bubble Generator
+STR_0260_TOFFEE_QUARRY                                          :{BLACK}Toffee Quarry
+STR_0261_SUGAR_MINE                                             :{BLACK}Sugar Mine
+STR_0262_CONSTRUCT_COAL_MINE                                    :{BLACK}Construct Coal Mine
+STR_0263_CONSTRUCT_POWER_STATION                                :{BLACK}Construct Power Station
+STR_0264_CONSTRUCT_SAWMILL                                      :{BLACK}Construct Sawmill
+STR_0265_PLANT_FOREST                                           :{BLACK}Plant Forest
+STR_0266_CONSTRUCT_OIL_REFINERY                                 :{BLACK}Construct Oil Refinery
+STR_0267_CONSTRUCT_OIL_RIG_CAN_ONLY                             :{BLACK}Construct Oil Rig (Can only be built near the edges of the map)
+STR_0268_CONSTRUCT_FACTORY                                      :{BLACK}Construct Factory
+STR_0269_CONSTRUCT_STEEL_MILL                                   :{BLACK}Construct Steel Mill
+STR_026A_CONSTRUCT_FARM                                         :{BLACK}Construct Farm
+STR_026B_CONSTRUCT_IRON_ORE_MINE                                :{BLACK}Construct Iron Ore Mine
+STR_026C_CONSTRUCT_OIL_WELLS                                    :{BLACK}Construct Oil Wells
+STR_026D_CONSTRUCT_BANK_CAN_ONLY                                :{BLACK}Construct Bank (Can only be built in towns with a population greater than 1200)
+STR_026E_CONSTRUCT_PAPER_MILL                                   :{BLACK}Construct Paper Mill
+STR_026F_CONSTRUCT_FOOD_PROCESSING                              :{BLACK}Construct Food Processing Plant
+STR_0270_CONSTRUCT_PRINTING_WORKS                               :{BLACK}Construct Printing Works
+STR_0271_CONSTRUCT_GOLD_MINE                                    :{BLACK}Construct Gold Mine
+STR_0272_CONSTRUCT_BANK_CAN_ONLY                                :{BLACK}Construct Bank (Can only be built in towns)
+STR_0273_CONSTRUCT_LUMBER_MILL_TO                               :{BLACK}Construct Lumber Mill (to clear rainforest and produce Wood)
+STR_0274_PLANT_FRUIT_PLANTATION                                 :{BLACK}Plant Fruit Plantation
+STR_0275_PLANT_RUBBER_PLANTATION                                :{BLACK}Plant Rubber Plantation
+STR_0276_CONSTRUCT_WATER_SUPPLY                                 :{BLACK}Construct Water Supply
+STR_0277_CONSTRUCT_WATER_TOWER_CAN                              :{BLACK}Construct Water Tower (Can only be built in towns)
+STR_0278_CONSTRUCT_DIAMOND_MINE                                 :{BLACK}Construct Diamond Mine
+STR_0279_CONSTRUCT_COPPER_ORE_MINE                              :{BLACK}Construct Copper Ore Mine
+STR_027A_PLANT_COTTON_CANDY_FOREST                              :{BLACK}Plant Cotton Candy Forest
+STR_027B_CONSTRUCT_CANDY_FACTORY                                :{BLACK}Construct Candy Factory
+STR_027C_CONSTRUCT_BATTERY_FARM                                 :{BLACK}Construct Battery Farm
+STR_027D_CONSTRUCT_COLA_WELLS                                   :{BLACK}Construct Cola Wells
+STR_027E_CONSTRUCT_TOY_SHOP                                     :{BLACK}Construct Toy Shop
+STR_027F_CONSTRUCT_TOY_FACTORY                                  :{BLACK}Construct Toy Factory
+STR_0280_CONSTRUCT_PLASTIC_FOUNTAINS                            :{BLACK}Construct Plastic Fountains
+STR_0281_CONSTRUCT_FIZZY_DRINK_FACTORY                          :{BLACK}Construct Fizzy Drink Factory
+STR_0282_CONSTRUCT_BUBBLE_GENERATOR                             :{BLACK}Construct Bubble Generator
+STR_0283_CONSTRUCT_TOFFEE_QUARRY                                :{BLACK}Construct Toffee Quarry
+STR_0284_CONSTRUCT_SUGAR_MINE                                   :{BLACK}Construct Sugar Mine
+STR_0285_CAN_T_BUILD_HERE                                       :{WHITE}Can't build {STRING} here...
+STR_0286_MUST_BUILD_TOWN_FIRST                                  :{WHITE}...must build town first
+STR_0287_ONLY_ONE_ALLOWED_PER_TOWN                              :{WHITE}...only one allowed per town
+STR_0288_PLANT_TREES                                            :{BLACK}Plant trees
+STR_0289_PLACE_SIGN                                             :{BLACK}Place sign
+STR_028A_RANDOM_TREES                                           :{BLACK}Random Trees
+STR_028B_PLANT_TREES_RANDOMLY_OVER                              :{BLACK}Plant trees randomly over landscape
+STR_028C_PLACE_ROCKY_AREAS_ON_LANDSCAPE                         :{BLACK}Place rocky areas on landscape
+STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Place lighthouse
+STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Place transmitter
+STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Define desert area.{}Press and hold CTRL to remove it
+STR_CREATE_LAKE                                                 :{BLACK}Define water area.{}Make a canal, unless CTRL is held down at sea level, when it will flood the surroundings instead
+STR_0290_DELETE                                                 :{BLACK}Delete
+STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Delete this town completely
+STR_0292_SAVE_SCENARIO                                          :Save scenario
+STR_0293_LOAD_SCENARIO                                          :Load scenario
+STR_LOAD_HEIGHTMAP                                              :Load heightmap
+STR_0294_QUIT_EDITOR                                            :Quit editor
+STR_0295                                                        :
+STR_0296_QUIT                                                   :Quit
+STR_0297_SAVE_SCENARIO_LOAD_SCENARIO                            :{BLACK}Save scenario, load scenario, abandon scenario editor, quit
+STR_0298_LOAD_SCENARIO                                          :{WHITE}Load Scenario
+STR_0299_SAVE_SCENARIO                                          :{WHITE}Save Scenario
+STR_029A_PLAY_SCENARIO                                          :{BLACK}Play Scenario
+STR_PLAY_HEIGHTMAP                                              :{BLACK}Play Heightmap
+STR_PLAY_HEIGHTMAP_HINT                                         :{BLACK}Start a new game, using a heightmap as landscape
+STR_QUIT_SCENARIO_QUERY                                         :{YELLOW}Are you sure you want to quit this scenario ?
+STR_029C_QUIT_EDITOR                                            :{WHITE}Quit Editor
+STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...can only be built in towns with a population of at least 1200
+STR_029E_MOVE_THE_STARTING_DATE                                 :{BLACK}Move the starting date backward 1 year
+STR_029F_MOVE_THE_STARTING_DATE                                 :{BLACK}Move the starting date forward 1 year
+STR_02A0_ENDS_OF_BRIDGE_MUST_BOTH                               :{WHITE}...ends of bridge must both be on land
+STR_02A1_SMALL                                                  :{BLACK}Small
+STR_02A2_MEDIUM                                                 :{BLACK}Medium
+STR_02A3_LARGE                                                  :{BLACK}Large
+STR_SCENARIO_EDITOR_CITY                                        :{BLACK}City
+STR_02A4_SELECT_TOWN_SIZE                                       :{BLACK}Select town size
+STR_02A5_TOWN_SIZE                                              :{YELLOW}Town size:
+
+STR_02B6                                                        :{STRING}  -  {STRING}
+STR_02B7_SHOW_LAST_MESSAGE_OR_NEWS                              :{BLACK}Show last message or news report
+STR_OFF                                                         :Off
+STR_SUMMARY                                                     :Summary
+STR_FULL                                                        :Full
+STR_02BA                                                        :{SILVER}- -  {COMPANY}  - -
+STR_02BB_TOWN_DIRECTORY                                         :Town directory
+STR_02BC_VEHICLE_DESIGN_NAMES                                   :{BLACK}Vehicle design names
+STR_02BD                                                        :{BLACK}{STRING}
+STR_02BE_DEFAULT                                                :Default
+STR_02BF_CUSTOM                                                 :Custom
+STR_02C0_SAVE_CUSTOM_NAMES                                      :{BLACK}Save custom names
+STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION                         :{BLACK}Vehicle design names selection
+STR_02C2_SAVE_CUSTOMIZED_VEHICLE                                :{BLACK}Save customized vehicle design names
+
+STR_CHECKMARK                                                   :{CHECKMARK}
+############ range for menu starts
+STR_02C3_GAME_OPTIONS                                           :Game options
+STR_02C5_DIFFICULTY_SETTINGS                                    :Difficulty settings
+STR_02C7_CONFIG_PATCHES                                         :Configure patches
+STR_NEWGRF_SETTINGS                                             :Newgrf settings
+STR_TRANSPARENCY_OPTIONS                                        :Transparency options
+STR_GAMEOPTMENU_0A                                              :
+STR_02CA_TOWN_NAMES_DISPLAYED                                   :{SETX 12}Town names displayed
+STR_02CC_STATION_NAMES_DISPLAYED                                :{SETX 12}Station names displayed
+STR_02CE_SIGNS_DISPLAYED                                        :{SETX 12}Signs displayed
+STR_WAYPOINTS_DISPLAYED2                                        :{SETX 12}Waypoints displayed
+STR_02D0_FULL_ANIMATION                                         :{SETX 12}Full animation
+STR_02D2_FULL_DETAIL                                            :{SETX 12}Full detail
+STR_02D4_TRANSPARENT_BUILDINGS                                  :{SETX 12}Transparent buildings
+STR_TRANSPARENT_SIGNS                                           :{SETX 12}Transparent station signs
+############ range ends here
+
+############ range for menu starts
+STR_02D5_LAND_BLOCK_INFO                                        :Land area information
+STR_02D6                                                        :
+STR_CONSOLE_SETTING                                             :Toggle Console
+STR_02D7_SCREENSHOT_CTRL_S                                      :Screenshot (Ctrl-S)
+STR_02D8_GIANT_SCREENSHOT_CTRL_G                                :Giant Screenshot (Ctrl-G)
+STR_02D9_ABOUT_OPENTTD                                          :About 'OpenTTD'
+############ range ends here
+
+STR_02DB_OFF                                                    :{BLACK}Off
+STR_02DA_ON                                                     :{BLACK}On
+STR_02DC_DISPLAY_SUBSIDIES                                      :{BLACK}Display subsidies
+STR_02DD_SUBSIDIES                                              :Subsidies
+STR_02DE_MAP_OF_WORLD                                           :Map of world
+STR_EXTRA_VIEW_PORT                                             :Extra viewport
+STR_SIGN_LIST                                                   :Sign list
+STR_02DF_TOWN_DIRECTORY                                         :Town directory
+STR_TOWN_POPULATION                                             :{BLACK}World population: {COMMA}
+STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Viewport {COMMA}
+STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN                                :{BLACK}Copy to viewport
+STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN_TT                             :{BLACK}Copy the location of the global view to this viewport
+STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW                                :{BLACK}Paste from viewport
+STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT                             :{BLACK}Paste the location of this viewport to the global view
+
+STR_02E0_CURRENCY_UNITS                                         :{BLACK}Currency units
+STR_02E1                                                        :{BLACK}{SKIP}{STRING}
+STR_02E2_CURRENCY_UNITS_SELECTION                               :{BLACK}Currency units selection
+STR_MEASURING_UNITS                                             :{BLACK}Measuring units
+STR_02E4                                                        :{BLACK}{SKIP}{SKIP}{STRING}
+STR_MEASURING_UNITS_SELECTION                                   :{BLACK}Measuring units selection
+STR_02E6_ROAD_VEHICLES                                          :{BLACK}Road vehicles
+STR_02E7                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{STRING}
+STR_02E8_SELECT_SIDE_OF_ROAD_FOR                                :{BLACK}Select side of road for vehicles to drive on
+STR_02E9_DRIVE_ON_LEFT                                          :Drive on left
+STR_02EA_DRIVE_ON_RIGHT                                         :Drive on right
+STR_02EB_TOWN_NAMES                                             :{BLACK}Town names
+STR_02EC                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_02ED_SELECT_STYLE_OF_TOWN_NAMES                             :{BLACK}Select style of town names
+
+STR_02F4_AUTOSAVE                                               :{BLACK}Autosave
+STR_02F5                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_02F6_SELECT_INTERVAL_BETWEEN                                :{BLACK}Select interval between automatic game saves
+STR_02F7_OFF                                                    :Off
+STR_02F8_EVERY_3_MONTHS                                         :Every 3 months
+STR_02F9_EVERY_6_MONTHS                                         :Every 6 months
+STR_02FA_EVERY_12_MONTHS                                        :Every 12 months
+STR_02FB_START_A_NEW_GAME                                       :{BLACK}Start a new game
+STR_02FC_LOAD_A_SAVED_GAME                                      :{BLACK}Load a saved game
+STR_02FE_CREATE_A_CUSTOMIZED_GAME                               :{BLACK}Create a customized game world/scenario
+STR_02FF_SELECT_SINGLE_PLAYER_GAME                              :{BLACK}Select single-player game
+STR_0300_SELECT_MULTIPLAYER_GAME                                :{BLACK}Select multiplayer game of 2-8 players
+STR_0301_DISPLAY_GAME_OPTIONS                                   :{BLACK}Display game options
+STR_0302_DISPLAY_DIFFICULTY_OPTIONS                             :{BLACK}Display difficulty options
+STR_0303_START_A_NEW_GAME_USING                                 :{BLACK}Start a new game, using a customized scenario
+STR_0304_QUIT                                                   :{BLACK}Quit
+STR_0305_QUIT_OPENTTD                                           :{BLACK}Quit 'OpenTTD'
+STR_0307_OPENTTD                                                :{WHITE}OpenTTD {REV}
+STR_030D_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...can only be built in towns
+STR_030E_SELECT_TEMPERATE_LANDSCAPE                             :{BLACK}Select 'temperate' landscape style
+STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE                            :{BLACK}Select 'sub-arctic' landscape style
+STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE                          :{BLACK}Select 'sub-tropical' landscape style
+STR_0311_SELECT_TOYLAND_LANDSCAPE                               :{BLACK}Select 'toyland' landscape style
+STR_0312_FUND_CONSTRUCTION_OF_NEW                               :{BLACK}Fund construction of new industry
+
+############ range for menu starts
+STR_INDUSTRY_DIR                                                :Industry Directory
+STR_0313_FUND_NEW_INDUSTRY                                      :Fund new industry
+############ range ends here
+
+STR_0314_FUND_NEW_INDUSTRY                                      :{WHITE}Fund new industry
+STR_JUST_STRING                                                 :{STRING}
+STR_JUST_INT                                                    :{NUM}
+STR_0316_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...can only be built in towns
+STR_0317_CAN_ONLY_BE_BUILT_IN_RAINFOREST                        :{WHITE}...can only be built in rainforest areas
+STR_0318_CAN_ONLY_BE_BUILT_IN_DESERT                            :{WHITE}...can only be built in desert areas
+STR_0319_PAUSED                                                 :{YELLOW}* *  PAUSED  *  *
+
+STR_031B_SCREENSHOT_SUCCESSFULLY                                :{WHITE}Screenshot successfully saved as '{STRING}'
+STR_031C_SCREENSHOT_FAILED                                      :{WHITE}Screenshot failed!
+
+STR_0329_PURCHASE_LAND_FOR_FUTURE                               :{BLACK}Purchase land for future use
+STR_032F_AUTOSAVE                                               :{RED}AUTOSAVE
+STR_SAVING_GAME                                                 :{RED}*  *  SAVING GAME  *  *
+STR_SAVE_STILL_IN_PROGRESS                                      :{WHITE}Saving still in progress,{}please wait until it is finished!
+STR_0330_SELECT_EZY_STREET_STYLE                                :{BLACK}Select 'Ezy Street style music' program
+
+STR_0335_6                                                      :{BLACK}6
+STR_0336_7                                                      :{BLACK}7
+
+############ start of townname region
+STR_TOWNNAME_ORIGINAL_ENGLISH                                   :English (Original)
+STR_TOWNNAME_FRENCH                                             :French
+STR_TOWNNAME_GERMAN                                             :German
+STR_TOWNNAME_ADDITIONAL_ENGLISH                                 :English (Additional)
+STR_TOWNNAME_LATIN_AMERICAN                                     :Latin-American
+STR_TOWNNAME_SILLY                                              :Silly
+STR_TOWNNAME_SWEDISH                                            :Swedish
+STR_TOWNNAME_DUTCH                                              :Dutch
+STR_TOWNNAME_FINNISH                                            :Finnish
+STR_TOWNNAME_POLISH                                             :Polish
+STR_TOWNNAME_SLOVAKISH                                          :Slovakish
+STR_TOWNNAME_NORWEGIAN                                          :Norwegian
+STR_TOWNNAME_HUNGARIAN                                          :Hungarian
+STR_TOWNNAME_AUSTRIAN                                           :Austrian
+STR_TOWNNAME_ROMANIAN                                           :Romanian
+STR_TOWNNAME_CZECH                                              :Czech
+STR_TOWNNAME_SWISS                                              :Swiss
+STR_TOWNNAME_DANISH                                             :Danish
+STR_TOWNNAME_TURKISH                                            :Turkish
+STR_TOWNNAME_ITALIAN                                            :Italian
+STR_TOWNNAME_CATALAN                                            :Catalan
+############ end of townname region
+
+STR_CURR_GBP                                                    :Pounds (£)
+STR_CURR_USD                                                    :Dollars ($)
+STR_CURR_EUR                                                    :Euro (€)
+STR_CURR_YEN                                                    :Yen (¥)
+STR_CURR_ATS                                                    :Austrian Shilling (ATS)
+STR_CURR_BEF                                                    :Belgian Franc (BEF)
+STR_CURR_CHF                                                    :Swiss Franc (CHF)
+STR_CURR_CZK                                                    :Czech Koruna (CZK)
+STR_CURR_DEM                                                    :Deutschmark (DEM)
+STR_CURR_DKK                                                    :Danish Krone (DKK)
+STR_CURR_ESP                                                    :Peseta (ESP)
+STR_CURR_FIM                                                    :Finnish Markka (FIM)
+STR_CURR_FRF                                                    :Franc (FRF)
+STR_CURR_GRD                                                    :Greek Drachma (GRD)
+STR_CURR_HUF                                                    :Hungarian Forint (HUF)
+STR_CURR_ISK                                                    :Icelandic Krona (ISK)
+STR_CURR_ITL                                                    :Italian Lira (ITL)
+STR_CURR_NLG                                                    :Dutch Guilder (NLG)
+STR_CURR_NOK                                                    :Norwegian Krone (NOK)
+STR_CURR_PLN                                                    :Polish Zloty (PLN)
+STR_CURR_ROL                                                    :Romanian Leu (ROL)
+STR_CURR_RUR                                                    :Russian Rubel (RUR)
+STR_CURR_SIT                                                    :Slovenian Tolar (SIT)
+STR_CURR_SEK                                                    :Swedish Krona (SEK)
+STR_CURR_YTL                                                    :Turkish Lira (YTL)
+STR_CURR_SKK                                                    :Slovak Koruna (SKK)
+STR_CURR_BRR                                                    :Brazilian Real (BRL)
+
+STR_CURR_CUSTOM                                                 :Custom...
+
+STR_OPTIONS_LANG                                                :{BLACK}Language
+STR_OPTIONS_LANG_CBO                                            :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_OPTIONS_LANG_TIP                                            :{BLACK}Select the interface language to use
+
+STR_OPTIONS_FULLSCREEN                                          :{BLACK}Fullscreen
+STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Check this box to play OpenTTD fullscreen mode
+
+STR_OPTIONS_RES                                                 :{BLACK}Screen resolution
+STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_OPTIONS_RES_TIP                                             :{BLACK}Select the screen resolution to use
+
+STR_OPTIONS_SCREENSHOT_FORMAT                                   :{BLACK}Screenshot format
+STR_OPTIONS_SCREENSHOT_FORMAT_CBO                               :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_OPTIONS_SCREENSHOT_FORMAT_TIP                               :{BLACK}Select the screenshot format to use
+
+STR_AUTOSAVE_1_MONTH                                            :Every month
+STR_AUTOSAVE_FAILED                                             :{WHITE}Autosave failed
+
+STR_MONTH_JAN                                                   :January
+STR_MONTH_FEB                                                   :February
+STR_MONTH_MAR                                                   :March
+STR_MONTH_APR                                                   :April
+STR_MONTH_MAY                                                   :May
+STR_MONTH_JUN                                                   :June
+STR_MONTH_JUL                                                   :July
+STR_MONTH_AUG                                                   :August
+STR_MONTH_SEP                                                   :September
+STR_MONTH_OCT                                                   :October
+STR_MONTH_NOV                                                   :November
+STR_MONTH_DEC                                                   :December
+
+STR_HEADING_FOR_STATION                                         :{LTBLUE}Heading for {STATION}
+STR_HEADING_FOR_STATION_VEL                                     :{LTBLUE}Heading for {STATION}, {VELOCITY}
+STR_NO_ORDERS                                                   :{LTBLUE}No orders
+STR_NO_ORDERS_VEL                                               :{LTBLUE}No orders, {VELOCITY}
+
+STR_PASSENGERS                                                  :passengers
+STR_BAGS                                                        :bags
+STR_TONS                                                        :tonnes
+STR_LITERS                                                      :liters
+STR_ITEMS                                                       :items
+STR_CRATES                                                      :crates
+STR_RES_OTHER                                                   :other
+STR_NOTHING                                                     :
+
+STR_SMALL_RIGHT_ARROW                                           :{TINYFONT}{RIGHTARROW}
+
+STR_CANT_SHARE_ORDER_LIST                                       :{WHITE}Can't share order list...
+STR_CANT_COPY_ORDER_LIST                                        :{WHITE}Can't copy order list...
+STR_END_OF_SHARED_ORDERS                                        :{SETX 10}- - End of Shared Orders - -
+
+STR_TRAIN_IS_LOST                                               :{WHITE}Train {COMMA} is lost.
+STR_TRAIN_IS_UNPROFITABLE                                       :{WHITE}Train {COMMA}'s profit last year was {CURRENCY}
+STR_EURO_INTRODUCE                                              :{BLACK}{BIGFONT}European Monetary Union!{}{}The Euro is introduced as the sole currency for everyday transactions in your country!
+
+# Start of order review system.
+# DON'T ADD OR REMOVE LINES HERE
+STR_TRAIN_HAS_TOO_FEW_ORDERS                                    :{WHITE}Train {COMMA} has too few orders in the schedule
+STR_TRAIN_HAS_VOID_ORDER                                        :{WHITE}Train {COMMA} has a void order
+STR_TRAIN_HAS_DUPLICATE_ENTRY                                   :{WHITE}Train {COMMA} has duplicate orders
+STR_TRAIN_HAS_INVALID_ENTRY                                     :{WHITE}Train {COMMA} has an invalid station in its orders
+STR_ROADVEHICLE_HAS_TOO_FEW_ORDERS                              :{WHITE}Road Vehicle {COMMA} has too few orders in the schedule
+STR_ROADVEHICLE_HAS_VOID_ORDER                                  :{WHITE}Road Vehicle {COMMA} has a void order
+STR_ROADVEHICLE_HAS_DUPLICATE_ENTRY                             :{WHITE}Road Vehicle {COMMA} has duplicate orders
+STR_ROADVEHICLE_HAS_INVALID_ENTRY                               :{WHITE}Road Vehicle {COMMA} has an invalid station in its orders
+STR_SHIP_HAS_TOO_FEW_ORDERS                                     :{WHITE}Ship {COMMA} has too few orders in the schedule
+STR_SHIP_HAS_VOID_ORDER                                         :{WHITE}Ship {COMMA} has a void order
+STR_SHIP_HAS_DUPLICATE_ENTRY                                    :{WHITE}Ship {COMMA} has duplicate orders
+STR_SHIP_HAS_INVALID_ENTRY                                      :{WHITE}Ship {COMMA} has an invalid station in its orders
+STR_AIRCRAFT_HAS_TOO_FEW_ORDERS                                 :{WHITE}Aircraft {COMMA} has too few orders in the schedule
+STR_AIRCRAFT_HAS_VOID_ORDER                                     :{WHITE}Aircraft {COMMA} has a void order
+STR_AIRCRAFT_HAS_DUPLICATE_ENTRY                                :{WHITE}Aircraft {COMMA} has duplicate orders
+STR_AIRCRAFT_HAS_INVALID_ENTRY                                  :{WHITE}Aircraft {COMMA} has an invalid station in its orders
+# end of order system
+
+STR_TRAIN_AUTORENEW_FAILED                                      :{WHITE}Autorenew failed on train {COMMA} (money limit)
+STR_ROADVEHICLE_AUTORENEW_FAILED                                :{WHITE}Autorenew failed on road vehicle {COMMA} (money limit)
+STR_SHIP_AUTORENEW_FAILED                                       :{WHITE}Autorenew failed on ship {COMMA} (money limit)
+STR_AIRCRAFT_AUTORENEW_FAILED                                   :{WHITE}Autorenew failed on aircraft {COMMA} (money limit)
+STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT                            :{WHITE}Train {COMMA} is too long after replacement
+
+STR_CONFIG_PATCHES                                              :{BLACK}Configure Patches
+STR_CONFIG_PATCHES_TIP                                          :{BLACK}Configure the patches
+STR_CONFIG_PATCHES_CAPTION                                      :{WHITE}Configure Patches
+
+STR_CONFIG_PATCHES_OFF                                          :Off
+STR_CONFIG_PATCHES_ON                                           :On
+STR_CONFIG_PATCHES_VEHICLESPEED                                 :{LTBLUE}Show vehicle speed in status bar: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_BUILDONSLOPES                                :{LTBLUE}Allow building on slopes and coasts: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AUTOSLOPE                                    :{LTBLUE}Allow terraforming under buildings, tracks, etc. (autoslope): {ORANGE}{STRING}
+STR_CONFIG_PATCHES_CATCHMENT                                    :{LTBLUE}Allow more realistically sized catchment areas: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_EXTRADYNAMITE                                :{LTBLUE}Allow removal of more town-owned roads, bridges, etc: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAMMOTHTRAINS                                :{LTBLUE}Enable building very long trains: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_REALISTICACCEL                               :{LTBLUE}Enable realistic acceleration for trains: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_FORBID_90_DEG                                :{LTBLUE}Forbid trains and ships to make 90 deg turns: {ORANGE}{STRING} {LTBLUE} (requires NPF)
+STR_CONFIG_PATCHES_JOINSTATIONS                                 :{LTBLUE}Join train stations built next to each other: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_FULLLOADANY                                  :{LTBLUE}Leave station when any cargo is full, if 'full load': {ORANGE}{STRING}
+STR_CONFIG_PATCHES_IMPROVEDLOAD                                 :{LTBLUE}Use improved loading algorithm: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_GRADUAL_LOADING                              :{LTBLUE}Load vehicles gradually: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_INFLATION                                    :{LTBLUE}Inflation: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SELECTGOODS                                  :{LTBLUE}Deliver cargo to a station only when there is a demand: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LONGBRIDGES                                  :{LTBLUE}Allow building very long bridges: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_GOTODEPOT                                    :{LTBLUE}Allow goto depot orders: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD             :{LTBLUE}Manual primary industry construction method: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_NONE        :none
+STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL      :as other industries
+STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :prospecting
+STR_CONFIG_PATCHES_MULTIPINDTOWN                                :{LTBLUE}Allow multiple similar industries per town: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SAMEINDCLOSE                                 :{LTBLUE}Industries of the same type can be built close to each other: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LONGDATE                                     :{LTBLUE}Always show long date in the status bar: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SIGNALSIDE                                   :{LTBLUE}Show signals on the drive side: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SHOWFINANCES                                 :{LTBLUE}Show finances window at the end of the year: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_NEW_NONSTOP                                  :{LTBLUE}TTDPatch compatible nonstop handling: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ROADVEH_QUEUE                                :{LTBLUE}Road vehicle queueing (with quantum effects): {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AUTOSCROLL                                   :{LTBLUE}Pan window when mouse is at the edge: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_BRIBE                                        :{LTBLUE}Allow bribing of the local authority: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ALLOW_EXCLUSIVE                              :{LTBLUE}Allow buying exclusive transport rights: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ALLOW_GIVE_MONEY                             :{LTBLUE}Allow sending money to other companies: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_NONUNIFORM_STATIONS                          :{LTBLUE}Nonuniform stations: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_NEW_PATHFINDING_ALL                          :{LTBLUE}New global pathfinding (NPF, overrides NTP): {ORANGE}{STRING}
+STR_CONFIG_PATCHES_FREIGHT_TRAINS                               :{LTBLUE}Weight multiplier for freight to simulate heavy trains: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_STOP_ON_TOWN_ROAD                            :{LTBLUE}Allow drive-through road stops on town owned roads: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ADJACENT_STATIONS                            :{LTBLUE}Allow building adjacent stations: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_SMALL_AIRPORTS                               :{LTBLUE}Always allow small airports: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_WARN_LOST_TRAIN                              :{LTBLUE}Warn if train is lost: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ORDER_REVIEW                                 :{LTBLUE}Review vehicles' orders: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ORDER_REVIEW_OFF                             :no
+STR_CONFIG_PATCHES_ORDER_REVIEW_EXDEPOT                         :yes, but exclude stopped vehicles
+STR_CONFIG_PATCHES_ORDER_REVIEW_ON                              :of all vehicles
+STR_CONFIG_PATCHES_WARN_INCOME_LESS                             :{LTBLUE}Warn if a train's income is negative: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_NEVER_EXPIRE_VEHICLES                        :{LTBLUE}Vehicles never expire: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AUTORENEW_VEHICLE                            :{LTBLUE}Autorenew vehicle when it gets old
+STR_CONFIG_PATCHES_AUTORENEW_MONTHS                             :{LTBLUE}Autorenew when vehice is {ORANGE}{STRING}{LTBLUE} months before/after max age
+STR_CONFIG_PATCHES_AUTORENEW_MONEY                              :{LTBLUE}Autorenew minimum needed money for renew: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ERRMSG_DURATION                              :{LTBLUE}Duration of error message: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_POPULATION_IN_LABEL                          :{LTBLUE}Show town population in the town name label: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_INVISIBLE_TREES                              :{LTBLUE}Invisible trees (with transparent buildings): {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_LAND_GENERATOR                               :{LTBLUE}Land generator: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LAND_GENERATOR_ORIGINAL                      :Original
+STR_CONFIG_PATCHES_LAND_GENERATOR_TERRA_GENESIS                 :TerraGenesis
+STR_CONFIG_PATCHES_OIL_REF_EDGE_DISTANCE                        :{LTBLUE}Oil Refineries' max distance from edge of map {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SNOWLINE_HEIGHT                              :{LTBLUE}Snow line height: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN                         :{LTBLUE}Roughness of terrain (TerraGenesis only) : {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH             :Very Smooth
+STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_SMOOTH                  :Smooth
+STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_ROUGH                   :Rough
+STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_ROUGH              :Very Rough
+STR_CONFIG_PATCHES_TREE_PLACER                                  :{LTBLUE}Tree placer algorithm: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_TREE_PLACER_NONE                             :None
+STR_CONFIG_PATCHES_TREE_PLACER_ORIGINAL                         :Original
+STR_CONFIG_PATCHES_TREE_PLACER_IMPROVED                         :Improved
+STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION                           :{LTBLUE}Heightmap rotation: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_COUNTER_CLOCKWISE         :Anti-clockwise
+STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_CLOCKWISE                 :Clockwise
+STR_CONFIG_PATCHES_SE_FLAT_WORLD_HEIGHT                         :{LTBLUE}The height level a flat scenario map gets: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_STATION_SPREAD                               :{LTBLUE}Max station spread: {ORANGE}{STRING} {RED}Warning: High setting slows game
+STR_CONFIG_PATCHES_SERVICEATHELIPAD                             :{LTBLUE}Service helicopters at helipads automatically: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR                       :{LTBLUE}Link landscape toolbar to rail/road/water/airport toolbars: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_REVERSE_SCROLLING                            :{LTBLUE}Reverse scroll direction: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SMOOTH_SCROLLING                             :{LTBLUE}Smooth viewport scrolling: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MEASURE_TOOLTIP                              :{LTBLUE}Show a measurement tooltip when using various build-tools: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LIVERIES                                     :{LTBLUE}Show company liveries: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LIVERIES_NONE                                :None
+STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Own company
+STR_CONFIG_PATCHES_LIVERIES_ALL                                 :All companies
+STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Prefer team chat with <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Function of scrollwheel: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom map
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Scroll map
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Off
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Map scrollwheel speed: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU                          :{LTBLUE}Right-click emulation: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_COMMAND                  :Command-click
+STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_CONTROL                  :Control-click
+STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_OFF                      :Off
+
+STR_CONFIG_PATCHES_PAUSE_ON_NEW_GAME                            :{LTBLUE}Automatically pause when starting a new game: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS                       :{LTBLUE}Use the advanced vehicle list: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OFF                   :Off
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OWN                   :Own company
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_ALL                   :All companies
+STR_CONFIG_PATCHES_LOADING_INDICATORS                           :{LTBLUE}Use loading indicators: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LOADING_INDICATORS_OFF                       :Off
+STR_CONFIG_PATCHES_LOADING_INDICATORS_OWN                       :Own company
+STR_CONFIG_PATCHES_LOADING_INDICATORS_ALL                       :All companies
+STR_CONFIG_PATCHES_TIMETABLE_ALLOW                              :{LTBLUE}Enable timetabling for vehicles: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_TIMETABLE_IN_TICKS                           :{LTBLUE}Show timetable in ticks rather than days: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE                            :{LTBLUE}Default rail type (after new game/game load): {ORANGE}{STRING}
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_RAIL                       :Normal Rail
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_ELRAIL                     :Electrified Rail
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MONORAIL                   :Monorail
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MAGLEV                     :Maglev
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_FIRST                      :First available
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_LAST                       :Last available
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MOST_USED                  :Most used
+
+STR_CONFIG_PATCHES_ALWAYS_BUILD_INFRASTRUCTURE                  :{LTBLUE}Show building tools when no suitable vehicles are available: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Max trains per player: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Max road vehicles per player: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAX_AIRCRAFT                                 :{LTBLUE}Max aircraft per player: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAX_SHIPS                                    :{LTBLUE}Max ships per player: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_AI_BUILDS_TRAINS                             :{LTBLUE}Disable trains for computer: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AI_BUILDS_ROADVEH                            :{LTBLUE}Disable road vehicles for computer: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AI_BUILDS_AIRCRAFT                           :{LTBLUE}Disable aircraft for computer: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AI_BUILDS_SHIPS                              :{LTBLUE}Disable ships for computer: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_AINEW_ACTIVE                                 :{LTBLUE}Enable new AI (alpha): {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AI_IN_MULTIPLAYER                            :{LTBLUE}Allow AIs in multiplayer (experimental): {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_SERVINT_TRAINS                               :{LTBLUE}Default service interval for trains: {ORANGE}{STRING} days/%
+STR_CONFIG_PATCHES_SERVINT_TRAINS_DISABLED                      :{LTBLUE}Default service interval for trains: {ORANGE}disabled
+STR_CONFIG_PATCHES_SERVINT_ROADVEH                              :{LTBLUE}Default service interval for road vehicles: {ORANGE}{STRING} days/%
+STR_CONFIG_PATCHES_SERVINT_ROADVEH_DISABLED                     :{LTBLUE}Default service interval for road vehicles: {ORANGE}disabled
+STR_CONFIG_PATCHES_SERVINT_AIRCRAFT                             :{LTBLUE}Default service interval for aircraft: {ORANGE}{STRING} days/%
+STR_CONFIG_PATCHES_SERVINT_AIRCRAFT_DISABLED                    :{LTBLUE}Default service interval for aircraft: {ORANGE}disabled
+STR_CONFIG_PATCHES_SERVINT_SHIPS                                :{LTBLUE}Default service interval for ships: {ORANGE}{STRING} days/%
+STR_CONFIG_PATCHES_SERVINT_SHIPS_DISABLED                       :{LTBLUE}Default service interval for ships: {ORANGE}disabled
+STR_CONFIG_PATCHES_NOSERVICE                                    :{LTBLUE}Disable servicing when breakdowns set to none: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_WAGONSPEEDLIMITS                             :{LTBLUE}Enable railroad car speed limits: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_DISABLE_ELRAILS                              :{LTBLUE}Disable electric rails: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_COLORED_NEWS_YEAR                            :{LTBLUE}Colored news appears in: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_STARTING_YEAR                                :{LTBLUE}Starting date: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENDING_YEAR                                  :{LTBLUE}End game in: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SMOOTH_ECONOMY                               :{LTBLUE}Enable smooth economy (more, smaller changes)
+STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Allow buying shares from other companies
+STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}When dragging place signals every: {ORANGE}{STRING} tile(s)
+STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Automatically build semaphores before: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Enable the signal GUI: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}The town layout "no more roads" isn't valid in the scenario editor
+STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Select town-road layout: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_TOWN_LAYOUT_NO_ROADS                         :no more roads
+STR_CONFIG_PATCHES_TOWN_LAYOUT_DEFAULT                          :default
+STR_CONFIG_PATCHES_TOWN_LAYOUT_BETTER_ROADS                     :better roads
+STR_CONFIG_PATCHES_TOWN_LAYOUT_2X2_GRID                         :2x2 grid
+STR_CONFIG_PATCHES_TOWN_LAYOUT_3X3_GRID                         :3x3 grid
+
+STR_CONFIG_PATCHES_TOOLBAR_POS                                  :{LTBLUE}Position of main toolbar: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT                             :Left
+STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER                           :Centre
+STR_CONFIG_PATCHES_TOOLBAR_POS_RIGHT                            :Right
+STR_CONFIG_PATCHES_SNAP_RADIUS                                  :{LTBLUE}Window snap radius: {ORANGE}{STRING} px
+STR_CONFIG_PATCHES_SNAP_RADIUS_DISABLED                         :{LTBLUE}Window snap radius: {ORANGE}disabled
+STR_CONFIG_PATCHES_TOWN_GROWTH                                  :{LTBLUE}Town growth speed: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_TOWN_GROWTH_NONE                             :None
+STR_CONFIG_PATCHES_TOWN_GROWTH_SLOW                             :Slow
+STR_CONFIG_PATCHES_TOWN_GROWTH_NORMAL                           :Normal
+STR_CONFIG_PATCHES_TOWN_GROWTH_FAST                             :Fast
+STR_CONFIG_PATCHES_TOWN_GROWTH_VERY_FAST                        :Very fast
+STR_CONFIG_PATCHES_LARGER_TOWNS                                 :{LTBLUE}Proportion of towns that will grow twice as fast: {ORANGE}1 in {STRING}
+STR_CONFIG_PATCHES_LARGER_TOWNS_DISABLED                        :{LTBLUE}Proportion of towns that will grow twice as fast: {ORANGE}None
+STR_CONFIG_PATCHES_CITY_SIZE_MULTIPLIER                         :{LTBLUE}Initial city size multiplier: {ORANGE}{STRING}
+STR_CONFIG_MODIFIED_ROAD_REBUILD                                :{LTBLUE}Remove absurd road-elements during the road construction
+
+STR_CONFIG_PATCHES_GUI                                          :{BLACK}Interface
+STR_CONFIG_PATCHES_CONSTRUCTION                                 :{BLACK}Construction
+STR_CONFIG_PATCHES_VEHICLES                                     :{BLACK}Vehicles
+STR_CONFIG_PATCHES_STATIONS                                     :{BLACK}Stations
+STR_CONFIG_PATCHES_ECONOMY                                      :{BLACK}Economy
+STR_CONFIG_PATCHES_AI                                           :{BLACK}Competitors
+
+STR_CONFIG_PATCHES_DISABLED                                     :disabled
+STR_CONFIG_PATCHES_INT32                                        :{NUM}
+STR_CONFIG_PATCHES_CURRENCY                                     :{CURRENCY}
+
+STR_CONFIG_PATCHES_QUERY_CAPT                                   :{WHITE}Change setting value
+STR_CONFIG_PATCHES_SERVICE_INTERVAL_INCOMPATIBLE                :{WHITE}Some or all of the default service interval(s) below are incompatible with chosen setting! 5-90% and 30-800 days are valid
+STR_CONFIG_PATCHES_YAPF_SHIPS                                   :{LTBLUE}Use YAPF for ships: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_YAPF_ROAD                                    :{LTBLUE}Use YAPF for roadvehs: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_YAPF_RAIL                                    :{LTBLUE}Use YAPF for trains: {ORANGE}{STRING}
+
+STR_TEMPERATE_LANDSCAPE                                         :Temperate landscape
+STR_SUB_ARCTIC_LANDSCAPE                                        :Sub-arctic landscape
+STR_SUB_TROPICAL_LANDSCAPE                                      :Sub-tropical landscape
+STR_TOYLAND_LANDSCAPE                                           :Toyland landscape
+
+STR_CHEATS                                                      :{WHITE}Cheats
+STR_CHEATS_TIP                                                  :{BLACK}Checkboxes indicate if you have used this cheat before
+STR_CHEATS_WARNING                                              :{BLACK}Warning! You are about to betray your fellow competitors. Keep in mind that such a disgrace will be remembered for eternity.
+STR_CHEAT_MONEY                                                 :{LTBLUE}Increase money by {CURRENCY}
+STR_CHEAT_CHANGE_PLAYER                                         :{LTBLUE}Playing as player: {ORANGE}{COMMA}
+STR_CHEAT_EXTRA_DYNAMITE                                        :{LTBLUE}Magic bulldozer (remove industries, unmovables): {ORANGE}{STRING}
+STR_CHEAT_CROSSINGTUNNELS                                       :{LTBLUE}Tunnels may cross each other: {ORANGE}{STRING}
+STR_CHEAT_BUILD_IN_PAUSE                                        :{LTBLUE}Build while in pause mode: {ORANGE}{STRING}
+STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Jetplanes will not crash (frequently) on small airports: {ORANGE} {STRING}
+STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Switch climate: {ORANGE} {STRING}
+STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Change date: {ORANGE} {DATE_SHORT}
+STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Enable modifying production values: {ORANGE}{STRING}
+
+STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Heading for {WAYPOINT}
+STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Heading for {WAYPOINT}, {VELOCITY}
+
+STR_GO_TO_WAYPOINT                                              :Go via {WAYPOINT}
+STR_GO_NON_STOP_TO_WAYPOINT                                     :Go non-stop via {WAYPOINT}
+
+STR_WAYPOINTNAME_CITY                                           :Waypoint {TOWN}
+STR_WAYPOINTNAME_CITY_SERIAL                                    :Waypoint {TOWN} #{COMMA}
+STR_LANDINFO_WAYPOINT                                           :Waypoint
+
+STR_WAYPOINT                                                    :{WHITE}Waypoint
+STR_WAYPOINT_GRAPHICS_TIP                                       :{BLACK}Select waypoint type
+
+STR_WAYPOINT_VIEWPORT                                           :{WHITE}{WAYPOINT}
+STR_WAYPOINT_VIEWPORT_TINY                                      :{TINYFONT}{WHITE}{WAYPOINT}
+STR_WAYPOINT_RAW                                                :{WAYPOINT}
+STR_EDIT_WAYPOINT_NAME                                          :{WHITE}Edit waypoint name
+
+STR_CANT_CHANGE_WAYPOINT_NAME                                   :{WHITE}Can't change waypoint name...
+STR_CONVERT_RAIL_TO_WAYPOINT_TIP                                :{BLACK}Convert rail to waypoint
+STR_CANT_BUILD_TRAIN_WAYPOINT                                   :{WHITE}Can't build train waypoint here...
+STR_CANT_REMOVE_TRAIN_WAYPOINT                                  :{WHITE}Can't remove train waypoint here...
+
+STR_BUILD_AUTORAIL_TIP                                          :{BLACK}Build railroad track using the Autorail mode
+
+STR_NO_TOWN_IN_SCENARIO                                         :{WHITE}...there is no town in this scenario
+
+STR_GENERATE_RANDOM_LANDSCAPE                                   :{WHITE}Are you sure you want to create a random landscape?
+STR_MANY_RANDOM_TOWNS                                           :{BLACK}Many random towns
+STR_RANDOM_TOWNS_TIP                                            :{BLACK}Cover the map with randomly placed towns
+STR_MANY_RANDOM_INDUSTRIES                                      :Many random industries
+STR_RANDOM_INDUSTRIES_TIP                                       :{BLACK}Cover the map with randomly placed industries
+STR_CAN_T_GENERATE_INDUSTRIES                                   :{WHITE}Can't generate industries...
+
+STR_LANDSCAPING_TOOLBAR_TIP                                     :{BLACK}Open the landscaping toolbar to raise/lower land, plant trees, etc.
+STR_LANDSCAPING_TOOLBAR                                         :{WHITE}Landscaping
+STR_LEVEL_LAND_TOOLTIP                                          :{BLACK}Level land
+
+
+STR_TREES_RANDOM_TYPE                                           :{BLACK}Trees of random type
+STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Place trees of random type
+
+STR_CANT_BUILD_CANALS                                           :{WHITE}Can't build canals here...
+STR_BUILD_CANALS_TIP                                            :{BLACK}Build canals.
+STR_LANDINFO_CANAL                                              :Canal
+
+STR_CANT_BUILD_LOCKS                                            :{WHITE}Can't build locks here...
+STR_BUILD_LOCKS_TIP                                             :{BLACK}Build locks
+STR_LANDINFO_LOCK                                               :Lock
+
+STR_BUOY_IS_IN_USE                                              :{WHITE}... buoy is in use!
+
+STR_LANDINFO_COORDS                                             :{BLACK}Co-ordinates: {LTBLUE}{NUM}x{NUM}x{NUM} ({STRING})
+
+STR_CANT_REMOVE_PART_OF_STATION                                 :{WHITE}Can't remove part of station...
+STR_CANT_CONVERT_RAIL                                           :{WHITE}Can't convert railtype here...
+STR_CONVERT_RAIL_TIP                                            :{BLACK}Convert/Upgrade the type of the rail
+
+STR_DRAG_WHOLE_TRAIN_TO_SELL_TIP                                :{BLACK}Drag train engine here to sell the whole train
+
+STR_DRAG_DROP                                                   :{BLACK}Drag & Drop
+STR_STATION_DRAG_DROP                                           :{BLACK}Build a station with drag & drop
+STR_SELECT_STATION_CLASS_TIP                                    :{BLACK}Select a station class to display
+STR_SELECT_STATION_TYPE_TIP                                     :{BLACK}Select the station type to build
+
+STR_FAST_FORWARD                                                :{BLACK}Fast forward the game
+STR_MESSAGE_HISTORY                                             :{WHITE}Message History
+STR_MESSAGE_HISTORY_TIP                                         :{BLACK}A list of the recent news messages
+STR_MESSAGES_DISABLE_ALL                                        :{BLACK}Disable all
+STR_MESSAGES_ENABLE_ALL                                         :{BLACK}Enable all
+
+STR_CONSTRUCT_COAL_MINE_TIP                                     :{BLACK}Construct Coal Mine
+STR_CONSTRUCT_FOREST_TIP                                        :{BLACK}Plant Forest
+STR_CONSTRUCT_OIL_RIG_TIP                                       :{BLACK}Construct Oil Rig
+STR_CONSTRUCT_FARM_TIP                                          :{BLACK}Fund Farm
+STR_CONSTRUCT_COPPER_ORE_MINE_TIP                               :{BLACK}Construct Copper Ore Mine
+STR_CONSTRUCT_OIL_WELLS_TIP                                     :{BLACK}Drill for Oil
+STR_CONSTRUCT_GOLD_MINE_TIP                                     :{BLACK}Construct Gold Mine
+STR_CONSTRUCT_DIAMOND_MINE_TIP                                  :{BLACK}Construct Diamond Mine
+STR_CONSTRUCT_IRON_ORE_MINE_TIP                                 :{BLACK}Construct Iron Ore Mine
+STR_CONSTRUCT_FRUIT_PLANTATION_TIP                              :{BLACK}Fund Fruit Plantation
+STR_CONSTRUCT_RUBBER_PLANTATION_TIP                             :{BLACK}Fund Rubber Plantation
+STR_CONSTRUCT_WATER_SUPPLY_TIP                                  :{BLACK}Fund Water Supply
+STR_CONSTRUCT_COTTON_CANDY_TIP                                  :{BLACK}Plant Cotton Candy Forest
+STR_CONSTRUCT_BATTERY_FARM_TIP                                  :{BLACK}Fund Battery Farm
+STR_CONSTRUCT_COLA_WELLS_TIP                                    :{BLACK}Drill for Cola
+STR_CONSTRUCT_PLASTIC_FOUNTAINS_TIP                             :{BLACK}Fund Plastic Fountains
+STR_CONSTRUCT_BUBBLE_GENERATOR_TIP                              :{BLACK}Construct Bubble Generator
+STR_CONSTRUCT_TOFFEE_QUARRY_TIP                                 :{BLACK}Fund Toffee Quarry
+STR_CONSTRUCT_SUGAR_MINE_TIP                                    :{BLACK}Construct Sugar Mine
+
+STR_INDUSTRYDIR_CAPTION                                         :{WHITE}Industries
+STR_INDUSTRYDIR_ITEM                                            :{ORANGE}{INDUSTRY}{BLACK} ({CARGO}){YELLOW} ({COMMA}% transported)
+STR_INDUSTRYDIR_ITEM_TWO                                        :{ORANGE}{INDUSTRY}{BLACK} ({CARGO}/{CARGO}){YELLOW} ({COMMA}%/{COMMA}% transported)
+STR_INDUSTRYDIR_ITEM_NOPROD                                     :{ORANGE}{INDUSTRY}
+
+STR_INDUSTRY_TOO_CLOSE                                          :{WHITE}...too close to another industry
+
+STR_RAIL_REFIT_VEHICLE_TO_CARRY                                 :{BLACK}Refit train to carry a different cargo type
+STR_RAIL_REFIT_VEHICLE                                          :{BLACK}Refit train
+STR_RAIL_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Select type of cargo for train to carry
+STR_RAIL_REFIT_TO_CARRY_HIGHLIGHTED                             :{BLACK}Refit train to carry highlighted cargo type
+STR_RAIL_CAN_T_REFIT_VEHICLE                                    :{WHITE}Can't refit train...
+STR_CONFIG_PATCHES_SERVINT_ISPERCENT                            :{LTBLUE}Service intervals are in percents: {ORANGE}{STRING}
+STR_CONFIG_GAME_PRODUCTION                                      :{WHITE}Change production
+
+TEMP_AI_IN_PROGRESS                                             :{WHITE}Welcome to the new AI under development. If you encounter problems, take a screenshot and post it in the forum.
+TEMP_AI_ACTIVATED                                               :{WHITE}Warning: this new AI is still alpha! Currently, only trucks and busses work!
+TEMP_AI_MULTIPLAYER                                             :{WHITE}Warning: implementation is still experimental (using new AI). Please report any problems to truelight@openttd.org.
+
+############ network gui strings
+
+STR_NETWORK_MULTIPLAYER                                         :{WHITE}Multiplayer
+
+STR_NETWORK_PLAYER_NAME                                         :{BLACK}Player name:
+STR_NETWORK_ENTER_NAME_TIP                                      :{BLACK}This is the name other players will identify you by
+STR_NETWORK_CONNECTION                                          :{BLACK}Connection:
+STR_NETWORK_CONNECTION_TIP                                      :{BLACK}Choose between an internet game or a local area nework game
+
+STR_NETWORK_START_SERVER                                        :{BLACK}Start server
+STR_NETWORK_START_SERVER_TIP                                    :{BLACK}Start an own server
+
+STR_NETWORK_GAME_NAME                                           :{BLACK}Name
+STR_NETWORK_GAME_NAME_TIP                                       :{BLACK}Name of the game
+STR_NETWORK_INFO_ICONS_TIP                                      :{BLACK}Language, server version, etc.
+STR_NETWORK_CLICK_GAME_TO_SELECT                                :{BLACK}Click a game from the list to select it
+
+STR_NETWORK_FIND_SERVER                                         :{BLACK}Find server
+STR_NETWORK_FIND_SERVER_TIP                                     :{BLACK}Search network for a server
+STR_NETWORK_ADD_SERVER                                          :{BLACK}Add server
+STR_NETWORK_ADD_SERVER_TIP                                      :{BLACK}Adds a server to the list which will always be checked for running games.
+STR_NETWORK_ENTER_IP                                            :{BLACK}Enter the IP address of the server
+
+STR_NETWORK_GENERAL_ONLINE                                      :{BLACK}{COMMA}/{COMMA} - {COMMA}/{COMMA}
+STR_NETWORK_CLIENTS_CAPTION                                     :{BLACK}Clients
+STR_NETWORK_CLIENTS_CAPTION_TIP                                 :{BLACK}Clients online / clients max
+STR_NETWORK_GAME_INFO                                           :{SILVER}GAME INFO
+STR_ORANGE                                                      :{ORANGE}{STRING}
+STR_NETWORK_CLIENTS                                             :{SILVER}Clients:  {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA}
+STR_NETWORK_LANGUAGE                                            :{SILVER}Language:  {WHITE}{STRING}
+STR_NETWORK_TILESET                                             :{SILVER}Tileset:  {WHITE}{STRING}
+STR_NETWORK_MAP_SIZE                                            :{SILVER}Map size:  {WHITE}{COMMA}x{COMMA}
+STR_NETWORK_SERVER_VERSION                                      :{SILVER}Server version:  {WHITE}{STRING}
+STR_NETWORK_SERVER_ADDRESS                                      :{SILVER}Server address:  {WHITE}{STRING} : {NUM}
+STR_NETWORK_START_DATE                                          :{SILVER}Start date:  {WHITE}{DATE_SHORT}
+STR_NETWORK_CURRENT_DATE                                        :{SILVER}Current date:  {WHITE}{DATE_SHORT}
+STR_NETWORK_PASSWORD                                            :{SILVER}Password protected!
+STR_NETWORK_SERVER_OFFLINE                                      :{SILVER}SERVER OFFLINE
+STR_NETWORK_SERVER_FULL                                         :{SILVER}SERVER FULL
+STR_NETWORK_VERSION_MISMATCH                                    :{SILVER}VERSION MISMATCH
+STR_NETWORK_GRF_MISMATCH                                        :{SILVER}NEWGRF MISMATCH
+
+STR_NETWORK_JOIN_GAME                                           :{BLACK}Join game
+
+
+STR_NETWORK_START_GAME_WINDOW                                   :{WHITE}Start new game
+
+STR_NETWORK_NEW_GAME_NAME                                       :{BLACK}Game name:
+STR_NETWORK_NEW_GAME_NAME_TIP                                   :{BLACK}The game name will be displayed to other players in the multiplayer game selection menu
+STR_NETWORK_SET_PASSWORD                                        :{BLACK}Set password
+STR_NETWORK_PASSWORD_TIP                                        :{BLACK}Protect your game with a password if you don't want other people to join it
+STR_NETWORK_SELECT_MAP                                          :{BLACK}Select a map:
+STR_NETWORK_SELECT_MAP_TIP                                      :{BLACK}Which map do you want to play?
+STR_NETWORK_LAN_INTERNET_COMBO                                  :{BLACK}{SKIP}{STRING}
+STR_NETWORK_LAN                                                 :LAN
+STR_NETWORK_INTERNET                                            :Internet
+STR_NETWORK_LAN_INTERNET                                        :LAN / Internet
+STR_NETWORK_INTERNET_ADVERTISE                                  :Internet (advertize)
+STR_NETWORK_CLIENTS_SELECT                                      :{BLACK}{SKIP}{SKIP}{NUM} client{P "" s}
+STR_NETWORK_NUMBER_OF_CLIENTS                                   :{BLACK}Maximum allowed clients:
+STR_NETWORK_NUMBER_OF_CLIENTS_TIP                               :{BLACK}Choose a maximum number of clients. Not all slots need to be filled.
+STR_NETWORK_COMPANIES_SELECT                                    :{BLACK}{SKIP}{SKIP}{SKIP}{NUM} compan{P y ies}
+STR_NETWORK_NUMBER_OF_COMPANIES                                 :{BLACK}Max companies:
+STR_NETWORK_NUMBER_OF_COMPANIES_TIP                             :{BLACK}Limit the server to a certain number of companies
+STR_NETWORK_SPECTATORS_SELECT                                   :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{NUM} spectator{P "" s}
+STR_NETWORK_NUMBER_OF_SPECTATORS                                :{BLACK}Max spectators:
+STR_NETWORK_NUMBER_OF_SPECTATORS_TIP                            :{BLACK}Limit the server to a certain number of spectators
+STR_NETWORK_LANGUAGE_SPOKEN                                     :{BLACK}Language spoken:
+STR_NETWORK_LANGUAGE_TIP                                        :{BLACK}Other players will know which language is spoken on the server.
+STR_NETWORK_LANGUAGE_COMBO                                      :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_NETWORK_START_GAME                                          :{BLACK}Start Game
+STR_NETWORK_START_GAME_TIP                                      :{BLACK}Start a new network game from a random map, or scenario
+STR_NETWORK_LOAD_GAME                                           :{BLACK}Load Game
+STR_NETWORK_LOAD_GAME_TIP                                       :{BLACK}Resume an earlier saved multiplayer game (be sure to connect as the correct player)
+
+############ Leave those lines in this order!!
+STR_NETWORK_LANG_ANY                                            :Any
+STR_NETWORK_LANG_ENGLISH                                        :English
+STR_NETWORK_LANG_GERMAN                                         :German
+STR_NETWORK_LANG_FRENCH                                         :French
+STR_NETWORK_LANG_BRAZILIAN                                      :Brazilian
+STR_NETWORK_LANG_BULGARIAN                                      :Bulgarian
+STR_NETWORK_LANG_CHINESE                                        :Chinese
+STR_NETWORK_LANG_CZECH                                          :Czech
+STR_NETWORK_LANG_DANISH                                         :Danish
+STR_NETWORK_LANG_DUTCH                                          :Dutch
+STR_NETWORK_LANG_ESPERANTO                                      :Esperanto
+STR_NETWORK_LANG_FINNISH                                        :Finnish
+STR_NETWORK_LANG_HUNGARIAN                                      :Hungarian
+STR_NETWORK_LANG_ICELANDIC                                      :Icelandic
+STR_NETWORK_LANG_ITALIAN                                        :Italian
+STR_NETWORK_LANG_JAPANESE                                       :Japanese
+STR_NETWORK_LANG_KOREAN                                         :Korean
+STR_NETWORK_LANG_LITHUANIAN                                     :Lithuanian
+STR_NETWORK_LANG_NORWEGIAN                                      :Norwegian
+STR_NETWORK_LANG_POLISH                                         :Polish
+STR_NETWORK_LANG_PORTUGUESE                                     :Portuguese
+STR_NETWORK_LANG_ROMANIAN                                       :Romanian
+STR_NETWORK_LANG_RUSSIAN                                        :Russian
+STR_NETWORK_LANG_SLOVAK                                         :Slovak
+STR_NETWORK_LANG_SLOVENIAN                                      :Slovenian
+STR_NETWORK_LANG_SPANISH                                        :Spanish
+STR_NETWORK_LANG_SWEDISH                                        :Swedish
+STR_NETWORK_LANG_TURKISH                                        :Turkish
+STR_NETWORK_LANG_UKRAINIAN                                      :Ukrainian
+############ End of leave-in-this-order
+
+STR_NETWORK_GAME_LOBBY                                          :{WHITE}Multiplayer game lobby
+
+STR_NETWORK_PREPARE_TO_JOIN                                     :{BLACK}Preparing to join:   {ORANGE}{STRING}
+STR_NETWORK_COMPANY_LIST_TIP                                    :{BLACK}A list of all companies currently in this game. You can either join one or start a
+STR_NETWORK_NEW_COMPANY                                         :{BLACK}New company
+STR_NETWORK_NEW_COMPANY_TIP                                     :{BLACK}Open a new company
+STR_NETWORK_SPECTATE_GAME                                       :{BLACK}Watch game
+STR_NETWORK_SPECTATE_GAME_TIP                                   :{BLACK}Watch the game as a spectator
+STR_NETWORK_JOIN_COMPANY                                        :{BLACK}Join company
+STR_NETWORK_JOIN_COMPANY_TIP                                    :{BLACK}Help managing this company
+STR_NETWORK_REFRESH                                             :{BLACK}Refresh server
+STR_NETWORK_REFRESH_TIP                                         :{BLACK}Refresh the server info
+
+STR_NETWORK_COMPANY_INFO                                        :{SILVER}COMPANY INFO
+
+STR_NETWORK_COMPANY_NAME                                        :{SILVER}Company name:  {WHITE}{STRING}
+STR_NETWORK_INAUGURATION_YEAR                                   :{SILVER}Inauguration:  {WHITE}{NUM}
+STR_NETWORK_VALUE                                               :{SILVER}Company value:  {WHITE}{CURRENCY}
+STR_NETWORK_CURRENT_BALANCE                                     :{SILVER}Current balance:  {WHITE}{CURRENCY}
+STR_NETWORK_LAST_YEARS_INCOME                                   :{SILVER}Last year's income:  {WHITE}{CURRENCY}
+STR_NETWORK_PERFORMANCE                                         :{SILVER}Performance:  {WHITE}{NUM}
+
+STR_NETWORK_VEHICLES                                            :{SILVER}Vehicles:  {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP}
+STR_NETWORK_STATIONS                                            :{SILVER}Stations:  {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP}
+STR_NETWORK_PLAYERS                                             :{SILVER}Players:  {WHITE}{STRING}
+
+STR_NETWORK_CONNECTING                                          :{WHITE}Connecting...
+
+############ Leave those lines in this order!!
+STR_NETWORK_CONNECTING_1                                        :{BLACK}(1/6) Connecting..
+STR_NETWORK_CONNECTING_2                                        :{BLACK}(2/6) Authorizing..
+STR_NETWORK_CONNECTING_3                                        :{BLACK}(3/6) Waiting..
+STR_NETWORK_CONNECTING_4                                        :{BLACK}(4/6) Downloading map..
+STR_NETWORK_CONNECTING_5                                        :{BLACK}(5/6) Processing data..
+STR_NETWORK_CONNECTING_6                                        :{BLACK}(6/6) Registering..
+
+STR_NETWORK_CONNECTING_SPECIAL_1                                :{BLACK}Fetching game info..
+STR_NETWORK_CONNECTING_SPECIAL_2                                :{BLACK}Fetching company info..
+############ End of leave-in-this-order
+STR_NETWORK_CONNECTING_WAITING                                  :{BLACK}{NUM} client{P "" s} in front of us
+STR_NETWORK_CONNECTING_DOWNLOADING                              :{BLACK}{NUM} / {NUM} kbytes downloaded so far
+
+STR_NETWORK_DISCONNECT                                          :{BLACK}Disconnect
+
+STR_NETWORK_GIVE_MONEY_CAPTION                                  :{WHITE}Enter the amount of money you want to give
+STR_NETWORK_NEED_GAME_PASSWORD_CAPTION                          :{WHITE}Server is protected. Enter password
+STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION                       :{WHITE}Company is protected. Enter password
+STR_NETWORK_CLIENT_LIST                                         :{WHITE}Client List
+
+STR_NETWORK_ERR_NOTAVAILABLE                                    :{WHITE} No network devices found or compiled without ENABLE_NETWORK
+STR_NETWORK_ERR_NOSERVER                                        :{WHITE} Could not find any network games
+STR_NETWORK_ERR_NOCONNECTION                                    :{WHITE} The server didn't answer the request
+STR_NETWORK_ERR_NEWGRF_MISMATCH                                 :{WHITE} Could not connect due to NewGRF mismatch
+STR_NETWORK_ERR_DESYNC                                          :{WHITE} Network-Game synchronization failed.
+STR_NETWORK_ERR_LOSTCONNECTION                                  :{WHITE} Network-Game connection lost.
+STR_NETWORK_ERR_SAVEGAMEERROR                                   :{WHITE} Could not load server-savegame.
+STR_NETWORK_ERR_SERVER_START                                    :{WHITE} Could not start the server.
+STR_NETWORK_ERR_CLIENT_START                                    :{WHITE} Could not connect.
+STR_NETWORK_ERR_TIMEOUT                                         :{WHITE} Connection #{NUM} timed out.
+STR_NETWORK_ERR_SERVER_ERROR                                    :{WHITE} We made a protocol-error and our connection is closed.
+STR_NETWORK_ERR_WRONG_REVISION                                  :{WHITE} The revision of this client does not match the revision of the server.
+STR_NETWORK_ERR_WRONG_PASSWORD                                  :{WHITE} Wrong password.
+STR_NETWORK_ERR_SERVER_FULL                                     :{WHITE} The server is full
+STR_NETWORK_ERR_SERVER_BANNED                                   :{WHITE} You are banned from this server
+STR_NETWORK_ERR_KICKED                                          :{WHITE} You are kicked out of the server
+STR_NETWORK_ERR_CHEATER                                         :{WHITE} Cheating is not allowed on this server
+
+STR_NETWORK_ERR_LEFT                                            :has left the game
+############ Leave those lines in this order!!
+STR_NETWORK_ERR_CLIENT_GENERAL                                  :general error
+STR_NETWORK_ERR_CLIENT_DESYNC                                   :desync error
+STR_NETWORK_ERR_CLIENT_SAVEGAME                                 :could not load map
+STR_NETWORK_ERR_CLIENT_CONNECTION_LOST                          :connection lost
+STR_NETWORK_ERR_CLIENT_PROTOCOL_ERROR                           :protocol error
+STR_NETWORK_ERR_CLIENT_NEWGRF_MISMATCH                          :NewGRF mismatch
+STR_NETWORK_ERR_CLIENT_NOT_AUTHORIZED                           :not authorized
+STR_NETWORK_ERR_CLIENT_NOT_EXPECTED                             :received strange packet
+STR_NETWORK_ERR_CLIENT_WRONG_REVISION                           :wrong revision
+STR_NETWORK_ERR_CLIENT_NAME_IN_USE                              :name already in use
+STR_NETWORK_ERR_CLIENT_WRONG_PASSWORD                           :wrong game-password
+STR_NETWORK_ERR_CLIENT_PLAYER_MISMATCH                          :wrong player-id in DoCommand
+STR_NETWORK_ERR_CLIENT_KICKED                                   :kicked by server
+STR_NETWORK_ERR_CLIENT_CHEATER                                  :was trying to use a cheat
+STR_NETWORK_ERR_CLIENT_SERVER_FULL                              :server full
+############ End of leave-in-this-order
+STR_NETWORK_CLIENT_JOINED                                       :has joined the game
+STR_NETWORK_GIVE_MONEY                                          :gave you some money ({CURRENCY})
+STR_NETWORK_GAVE_MONEY_AWAY                                     :you gave {STRING} some money ({CURRENCY})
+STR_NETWORK_CHAT_COMPANY_CAPTION                                :[Team] :
+STR_NETWORK_CHAT_COMPANY                                        :[Team] {STRING}: {GRAY}{STRING}
+STR_NETWORK_CHAT_TO_COMPANY                                     :[Team] To {STRING}: {GRAY}{STRING}
+STR_NETWORK_CHAT_CLIENT_CAPTION                                 :[Private] :
+STR_NETWORK_CHAT_CLIENT                                         :[Private] {STRING}: {GRAY}{STRING}
+STR_NETWORK_CHAT_TO_CLIENT                                      :[Private] To {STRING}: {GRAY}{STRING}
+STR_NETWORK_CHAT_ALL_CAPTION                                    :[All] :
+STR_NETWORK_CHAT_ALL                                            :[All] {STRING}: {GRAY}{STRING}
+STR_NETWORK_NAME_CHANGE                                         :has changed his name to
+STR_NETWORK_SERVER_SHUTDOWN                                     :{WHITE} The server closed the session
+STR_NETWORK_SERVER_REBOOT                                       :{WHITE} The server is restarting...{}Please wait...
+
+STR_NETWORK_SERVER                                              :Server
+STR_NETWORK_CLIENT                                              :Client
+STR_NETWORK_SPECTATORS                                          :Spectators
+
+STR_NETWORK_CLIENTLIST_NONE                                     :(none)
+STR_NETWORK_CLIENTLIST_KICK                                     :Kick
+STR_NETWORK_CLIENTLIST_GIVE_MONEY                               :Give money
+STR_NETWORK_CLIENTLIST_SPEAK_TO_ALL                             :Speak to all
+STR_NETWORK_CLIENTLIST_SPEAK_TO_COMPANY                         :Speak to company
+STR_NETWORK_CLIENTLIST_SPEAK_TO_CLIENT                          :Private message
+
+
+STR_NETWORK_SEND                                                :{BLACK}Send
+
+############ end network gui strings
+
+
+STR_CONFIG_PATCHES_MAP_X                                        :{LTBLUE}X-size of map: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAP_Y                                        :{LTBLUE}Y-size of map: {ORANGE}{STRING}
+
+
+##### PNG-MAP-Loader
+
+STR_PNGMAP_ERROR                                                :{WHITE}Cannot load landscape from PNG...
+STR_PNGMAP_ERR_FILE_NOT_FOUND                                   :{WHITE}...file not found.
+STR_PNGMAP_ERR_IMAGE_TYPE                                       :{WHITE}...could not convert image type. 8 or 24-bit PNG image needed.
+STR_PNGMAP_ERR_MISC                                             :{WHITE}...something just went wrong. Sorry. (probably corrupted file)
+
+STR_BMPMAP_ERROR                                                :{WHITE}Cannot load landscape from BMP...
+STR_BMPMAP_ERR_IMAGE_TYPE                                       :{WHITE}...could not convert image type.
+
+##id 0x0800
+STR_0800_COST                                                   :{TINYFONT}{RED}Cost: {CURRENCY}
+STR_0801_COST                                                   :{RED}Cost: {CURRENCY}
+STR_0802_INCOME                                                 :{TINYFONT}{GREEN}Income: {CURRENCY}
+STR_0803_INCOME                                                 :{GREEN}Income: {CURRENCY}
+STR_FEEDER_TINY                                                 :{TINYFONT}{YELLOW}Transfer: {CURRENCY}
+STR_FEEDER                                                      :{YELLOW}Transfer: {CURRENCY}
+STR_0805_ESTIMATED_COST                                         :{WHITE}Estimated Cost: {CURRENCY}
+STR_0807_ESTIMATED_INCOME                                       :{WHITE}Estimated Income: {CURRENCY}
+STR_0808_CAN_T_RAISE_LAND_HERE                                  :{WHITE}Can't raise land here...
+STR_0809_CAN_T_LOWER_LAND_HERE                                  :{WHITE}Can't lower land here...
+STR_080A_ROCKS                                                  :Rocks
+STR_080B_ROUGH_LAND                                             :Rough land
+STR_080C_BARE_LAND                                              :Bare land
+STR_080D_GRASS                                                  :Grass
+STR_080E_FIELDS                                                 :Fields
+STR_080F_SNOW_COVERED_LAND                                      :Snow-covered land
+STR_0810_DESERT                                                 :Desert
+
+##id 0x1000
+STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION                         :{WHITE}Land sloped in wrong direction
+STR_1001_IMPOSSIBLE_TRACK_COMBINATION                           :{WHITE}Impossible track combination
+STR_1002_EXCAVATION_WOULD_DAMAGE                                :{WHITE}Excavation would damage tunnel
+STR_1003_ALREADY_AT_SEA_LEVEL                                   :{WHITE}Already at sea-level
+STR_1004_TOO_HIGH                                               :{WHITE}Too high
+STR_1005_NO_SUITABLE_RAILROAD_TRACK                             :{WHITE}No suitable railroad track
+STR_1007_ALREADY_BUILT                                          :{WHITE}...already built
+STR_1008_MUST_REMOVE_RAILROAD_TRACK                             :{WHITE}Must remove railroad track first
+STR_100A_RAILROAD_CONSTRUCTION                                  :{WHITE}Railroad Construction
+STR_TITLE_ELRAIL_CONSTRUCTION                                   :{WHITE}Electrified Railroad Construction
+STR_100B_MONORAIL_CONSTRUCTION                                  :{WHITE}Monorail Construction
+STR_100C_MAGLEV_CONSTRUCTION                                    :{WHITE}MagLev Construction
+STR_100D_SELECT_RAIL_BRIDGE                                     :{WHITE}Select Rail Bridge
+STR_100E_CAN_T_BUILD_TRAIN_DEPOT                                :{WHITE}Can't build train depot here...
+STR_100F_CAN_T_BUILD_RAILROAD_STATION                           :{WHITE}Can't build railroad station here...
+STR_1010_CAN_T_BUILD_SIGNALS_HERE                               :{WHITE}Can't build signals here...
+STR_1011_CAN_T_BUILD_RAILROAD_TRACK                             :{WHITE}Can't build railroad track here...
+STR_1012_CAN_T_REMOVE_RAILROAD_TRACK                            :{WHITE}Can't remove railroad track from here...
+STR_1013_CAN_T_REMOVE_SIGNALS_FROM                              :{WHITE}Can't remove signals from here...
+STR_1014_TRAIN_DEPOT_ORIENTATION                                :{WHITE}Train Depot Orientation
+STR_1015_RAILROAD_CONSTRUCTION                                  :Railroad construction
+STR_TOOLB_ELRAIL_CONSTRUCTION                                   :Electrified Railroad construction
+STR_1016_MONORAIL_CONSTRUCTION                                  :Monorail construction
+STR_1017_MAGLEV_CONSTRUCTION                                    :MagLev construction
+STR_1018_BUILD_RAILROAD_TRACK                                   :{BLACK}Build railroad track
+STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING                         :{BLACK}Build train depot (for building and servicing trains)
+STR_101A_BUILD_RAILROAD_STATION                                 :{BLACK}Build railroad station
+STR_101B_BUILD_RAILROAD_SIGNALS                                 :{BLACK}Build railroad signals
+STR_101C_BUILD_RAILROAD_BRIDGE                                  :{BLACK}Build railroad bridge
+STR_101D_BUILD_RAILROAD_TUNNEL                                  :{BLACK}Build railroad tunnel
+STR_101E_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Toggle build/remove for railroad track and signals
+STR_101F_BRIDGE_SELECTION_CLICK                                 :{BLACK}Bridge selection - click on your prefered bridge to build it
+STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO                       :{BLACK}Select railroad depot orientation
+STR_1021_RAILROAD_TRACK                                         :Railroad track
+STR_1023_RAILROAD_TRAIN_DEPOT                                   :Railroad train depot
+STR_1024_AREA_IS_OWNED_BY_ANOTHER                               :{WHITE}...area is owned by another company
+STR_RAILROAD_TRACK_WITH_NORMAL_SIGNALS                          :Railroad track with normal signals
+STR_RAILROAD_TRACK_WITH_PRESIGNALS                              :Railroad track with pre-signals
+STR_RAILROAD_TRACK_WITH_EXITSIGNALS                             :Railroad track with exit-signals
+STR_RAILROAD_TRACK_WITH_COMBOSIGNALS                            :Railway track with combo-signals
+STR_RAILROAD_TRACK_WITH_NORMAL_PRESIGNALS                       :Railway track with normal and pre-signals
+STR_RAILROAD_TRACK_WITH_NORMAL_EXITSIGNALS                      :Railway track with normal and exit-signals
+STR_RAILROAD_TRACK_WITH_NORMAL_COMBOSIGNALS                     :Railway track with normal and combo-signals
+STR_RAILROAD_TRACK_WITH_PRE_EXITSIGNALS                         :Railway track with pre- and exit-signals
+STR_RAILROAD_TRACK_WITH_PRE_COMBOSIGNALS                        :Railway track with pre- and combo-signals
+STR_RAILROAD_TRACK_WITH_EXIT_COMBOSIGNALS                       :Railway track with exit- and combo-signals
+STR_MUST_REMOVE_RAILWAY_STATION_FIRST                           :{WHITE}Must remove railway station first
+
+
+
+##id 0x1800
+STR_1801_MUST_REMOVE_ROAD_FIRST                                 :{WHITE}Must remove road first
+STR_ROAD_WORKS_IN_PROGRESS                                      :{WHITE}Road works in progress
+STR_1802_ROAD_CONSTRUCTION                                      :{WHITE}Road Construction
+STR_1802_TRAMWAY_CONSTRUCTION                                   :{WHITE}Tramway Construction
+STR_1803_SELECT_ROAD_BRIDGE                                     :{WHITE}Select Road Bridge
+STR_ERR_ONEWAY_ROADS_CAN_T_HAVE_JUNCTION                        :{WHITE}... one way roads can't have junctions
+STR_1804_CAN_T_BUILD_ROAD_HERE                                  :{WHITE}Can't build road here...
+STR_1804_CAN_T_BUILD_TRAMWAY_HERE                               :{WHITE}Can't build tramway here...
+STR_1805_CAN_T_REMOVE_ROAD_FROM                                 :{WHITE}Can't remove road from here...
+STR_1805_CAN_T_REMOVE_TRAMWAY_FROM                              :{WHITE}Can't remove tramway from here...
+STR_1806_ROAD_DEPOT_ORIENTATION                                 :{WHITE}Road Depot Orientation
+STR_1806_TRAM_DEPOT_ORIENTATION                                 :{WHITE}Tram Depot Orientation
+STR_1807_CAN_T_BUILD_ROAD_VEHICLE                               :{WHITE}Can't build road vehicle depot here...
+STR_1807_CAN_T_BUILD_TRAM_VEHICLE                               :{WHITE}Can't build tram vehicle depot here...
+STR_1808_CAN_T_BUILD_BUS_STATION                                :{WHITE}Can't build bus station...
+STR_1809_CAN_T_BUILD_TRUCK_STATION                              :{WHITE}Can't build truck station...
+STR_1808_CAN_T_BUILD_PASSENGER_TRAM_STATION                     :{WHITE}Can't build passenger tram station...
+STR_1809_CAN_T_BUILD_CARGO_TRAM_STATION                         :{WHITE}Can't build freight tram station...
+STR_180A_ROAD_CONSTRUCTION                                      :Road construction
+STR_180A_TRAMWAY_CONSTRUCTION                                   :Tramway construction
+STR_180B_BUILD_ROAD_SECTION                                     :{BLACK}Build road section
+STR_BUILD_AUTOROAD_TIP                                          :{BLACK}Build road section using the Autoroad mode
+STR_180B_BUILD_TRAMWAY_SECTION                                  :{BLACK}Build tramway section
+STR_BUILD_AUTOTRAM_TIP                                          :{BLACK}Build tramway section using the Autotram mode
+STR_180C_BUILD_ROAD_VEHICLE_DEPOT                               :{BLACK}Build road vehicle depot (for building and servicing vehicles)
+STR_180C_BUILD_TRAM_VEHICLE_DEPOT                               :{BLACK}Build tram vehicle depot (for building and servicing trams)
+STR_180D_BUILD_BUS_STATION                                      :{BLACK}Build bus station
+STR_180E_BUILD_TRUCK_LOADING_BAY                                :{BLACK}Build truck loading bay
+STR_180D_BUILD_PASSENGER_TRAM_STATION                           :{BLACK}Build passenger tram station
+STR_180E_BUILD_CARGO_TRAM_STATION                               :{BLACK}Build freight tram station
+STR_180F_BUILD_ROAD_BRIDGE                                      :{BLACK}Build road bridge
+STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}Build tramway bridge
+STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}Build road tunnel
+STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}Build tramway tunnel
+STR_TOGGLE_ONE_WAY_ROAD                                         :{BLACK}Activate/Deactivate one way roads
+STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Toggle build/remove for road construction
+STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}Toggle build/remove for tramway construction
+STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}Select road vehicle depot orientation
+STR_1813_SELECT_TRAM_VEHICLE_DEPOT                              :{BLACK}Select tram vehicle depot orientation
+STR_1814_ROAD                                                   :Road
+STR_1815_ROAD_WITH_STREETLIGHTS                                 :Road with streetlights
+STR_1816_TREE_LINED_ROAD                                        :Tree-lined road
+STR_1817_ROAD_VEHICLE_DEPOT                                     :Road vehicle depot
+STR_1818_ROAD_RAIL_LEVEL_CROSSING                               :Road/rail grade crossing
+STR_CAN_T_REMOVE_BUS_STATION                                    :{WHITE}Can't remove bus station...
+STR_CAN_T_REMOVE_TRUCK_STATION                                  :{WHITE}Can't remove truck station...
+STR_CAN_T_REMOVE_PASSENGER_TRAM_STATION                         :{WHITE}Can't remove passenger tram station...
+STR_CAN_T_REMOVE_CARGO_TRAM_STATION                             :{WHITE}Can't remove freight tram station...
+
+##id 0x2000
+STR_2000_TOWNS                                                  :{WHITE}Towns
+STR_TOWN_LABEL_POP                                              :{WHITE}{TOWN} ({COMMA})
+STR_TOWN_LABEL                                                  :{WHITE}{TOWN}
+STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
+STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
+STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
+STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Building must be demolished first
+STR_2005                                                        :{WHITE}{TOWN}
+STR_2006_POPULATION                                             :{BLACK}Population: {ORANGE}{COMMA}{BLACK}  Houses: {ORANGE}{COMMA}
+STR_2007_RENAME_TOWN                                            :Rename Town
+STR_2008_CAN_T_RENAME_TOWN                                      :{WHITE}Can't rename town...
+STR_2009_LOCAL_AUTHORITY_REFUSES                                :{WHITE}{TOWN} local authority refuses to allow this
+STR_200A_TOWN_NAMES_CLICK_ON_NAME                               :{BLACK}Town names - click on name to center view on town
+STR_200B_CENTER_THE_MAIN_VIEW_ON                                :{BLACK}Center the main view on town location
+STR_200C_CHANGE_TOWN_NAME                                       :{BLACK}Change town name
+STR_200D_PASSENGERS_LAST_MONTH_MAX                              :{BLACK}Passengers last month: {ORANGE}{COMMA}{BLACK}  max: {ORANGE}{COMMA}
+STR_200E_MAIL_LAST_MONTH_MAX                                    :{BLACK}Mail last month: {ORANGE}{COMMA}{BLACK}  max: {ORANGE}{COMMA}
+STR_200F_TALL_OFFICE_BLOCK                                      :Tall office block
+STR_2010_OFFICE_BLOCK                                           :Office block
+STR_2011_SMALL_BLOCK_OF_FLATS                                   :Small block of apartments
+STR_2012_CHURCH                                                 :Church
+STR_2013_LARGE_OFFICE_BLOCK                                     :Large office block
+STR_2014_TOWN_HOUSES                                            :Town houses
+STR_2015_HOTEL                                                  :Hotel
+STR_2016_STATUE                                                 :Statue
+STR_2017_FOUNTAIN                                               :Fountain
+STR_2018_PARK                                                   :Park
+STR_2019_OFFICE_BLOCK                                           :Office block
+STR_201A_SHOPS_AND_OFFICES                                      :Shops and offices
+STR_201B_MODERN_OFFICE_BUILDING                                 :Modern office building
+STR_201C_WAREHOUSE                                              :Warehouse
+STR_201D_OFFICE_BLOCK                                           :Office block
+STR_201E_STADIUM                                                :Stadium
+STR_201F_OLD_HOUSES                                             :Old houses
+STR_2020_LOCAL_AUTHORITY                                        :{BLACK}Local authority
+STR_2021_SHOW_INFORMATION_ON_LOCAL                              :{BLACK}Show information on local authority
+STR_2022_LOCAL_AUTHORITY                                        :{WHITE}{TOWN} local authority
+STR_2023_TRANSPORT_COMPANY_RATINGS                              :{BLACK}Transport company ratings:
+STR_2024                                                        :{YELLOW}{COMPANY} {COMPANYNUM}: {ORANGE}{STRING}
+STR_2025_SUBSIDIES                                              :{WHITE}Subsidies
+STR_2026_SUBSIDIES_ON_OFFER_FOR                                 :{BLACK}Subsidies on offer for services taking:
+STR_2027_FROM_TO                                                :{ORANGE}{STRING} from {STRING} to {STRING}
+STR_2028_BY                                                     :{YELLOW} (by {DATE_SHORT})
+STR_202A_NONE                                                   :{ORANGE}None
+STR_202B_SERVICES_ALREADY_SUBSIDISED                            :{BLACK}Services already subsidized:
+STR_202C_FROM_TO                                                :{ORANGE}{STRING} from {STATION} to {STATION}{YELLOW} ({COMPANY}
+STR_202D_UNTIL                                                  :{YELLOW}, until {DATE_SHORT})
+STR_202E_OFFER_OF_SUBSIDY_EXPIRED                               :{BLACK}{BIGFONT}Offer of subsidy expired:{}{}{STRING} from {STRING} to {STRING} will now not attract a subsidy.
+STR_202F_SUBSIDY_WITHDRAWN_SERVICE                              :{BLACK}{BIGFONT}Subsidy withdrawn:{}{}{STRING} service from {STATION} to {STATION} is no longer subsidized.
+STR_2030_SERVICE_SUBSIDY_OFFERED                                :{BLACK}{BIGFONT}Service subsidy offered:{}{}First {STRING} service from {STRING} to {STRING} will attract a year's subsidy from the local authority!
+STR_2031_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Service subsidy awarded to {COMPANY}!{}{}{STRING} service from {STATION} to {STATION} will pay 50% extra for the next year!
+STR_2032_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Service subsidy awarded to {COMPANY}!{}{}{STRING} service from {STATION} to {STATION} will pay double rates for the next year!
+STR_2033_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Service subsidy awarded to {COMPANY}!{}{}{STRING} service from {STATION} to {STATION} will pay triple rates for the next year!
+STR_2034_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Service subsidy awarded to {COMPANY}!{}{}{STRING} service from {STATION} to {STATION} will pay quadruple rates for the next year!
+STR_2035_LOCAL_AUTHORITY_REFUSES                                :{WHITE}{TOWN} local authority refuses to allow another airport to be built in this town
+STR_2036_COTTAGES                                               :Cottages
+STR_2037_HOUSES                                                 :Houses
+STR_2038_FLATS                                                  :Apartments
+STR_2039_TALL_OFFICE_BLOCK                                      :Tall office block
+STR_203A_SHOPS_AND_OFFICES                                      :Shops and offices
+STR_203B_SHOPS_AND_OFFICES                                      :Shops and offices
+STR_203C_THEATER                                                :Theater
+STR_203D_STADIUM                                                :Stadium
+STR_203E_OFFICES                                                :Offices
+STR_203F_HOUSES                                                 :Houses
+STR_2040_CINEMA                                                 :Cinema
+STR_2041_SHOPPING_MALL                                          :Shopping mall
+STR_2042_DO_IT                                                  :{BLACK}Do it
+STR_2043_LIST_OF_THINGS_TO_DO_AT                                :{BLACK}List of things to do at this town - click on item for more details
+STR_2044_CARRY_OUT_THE_HIGHLIGHTED                              :{BLACK}Carry out the highlighted action in the list above
+STR_2045_ACTIONS_AVAILABLE                                      :{BLACK}Actions available:
+STR_2046_SMALL_ADVERTISING_CAMPAIGN                             :Small advertising campaign
+STR_2047_MEDIUM_ADVERTISING_CAMPAIGN                            :Medium advertising campaign
+STR_2048_LARGE_ADVERTISING_CAMPAIGN                             :Large advertising campaign
+STR_2049_FUND_LOCAL_ROAD_RECONSTRUCTION                         :Fund local road reconstruction
+STR_204A_BUILD_STATUE_OF_COMPANY                                :Build statue of company owner
+STR_204B_FUND_NEW_BUILDINGS                                     :Fund new buildings
+STR_204C_BUY_EXCLUSIVE_TRANSPORT                                :Buy exclusive transport rights
+STR_TOWN_BRIBE_THE_LOCAL_AUTHORITY                              :Bribe the local authority
+STR_204D_INITIATE_A_SMALL_LOCAL                                 :{WHITE}{STRING}{}{YELLOW} Initiate a small local advertising campaign, to attract more passengers and cargo to your transport services.{}  Cost: {CURRENCY}
+STR_204E_INITIATE_A_MEDIUM_LOCAL                                :{WHITE}{STRING}{}{YELLOW} Initiate a medium local advertising campaign, to attract more passengers and cargo to your transport services.{}  Cost: {CURRENCY}
+STR_204F_INITIATE_A_LARGE_LOCAL                                 :{WHITE}{STRING}{}{YELLOW} Initiate a large local advertising campaign, to attract more passengers and cargo to your transport services.{}  Cost: {CURRENCY}
+STR_2050_FUND_THE_RECONSTRUCTION                                :{WHITE}{STRING}{}{YELLOW} Fund the reconstruction of the urban road network. Causes considerable disruption to road traffic for up to 6 months.{}  Cost: {CURRENCY}
+STR_2051_BUILD_A_STATUE_IN_HONOR                                :{WHITE}{STRING}{}{YELLOW} Build a statue in honor of your company.{} Cost: {CURRENCY}
+STR_2052_FUND_THE_CONSTRUCTION_OF                               :{WHITE}{STRING}{}{YELLOW} Fund the construction of new commercial buildings in the town.{}  Cost: {CURRENCY}
+STR_2053_BUY_1_YEAR_S_EXCLUSIVE                                 :{WHITE}{STRING}{}{YELLOW} Buy 1 year's exclusive transport rights in town. Town authority will only allow passengers and cargo to use your company's stations.{} Cost: {CURRENCY}
+STR_TOWN_BRIBE_THE_LOCAL_AUTHORITY_DESC                         :{WHITE}{STRING}{}{YELLOW} Bribe the local authority to increase your rating, at the risk of a severe penalty if caught.{}  Cost: {CURRENCY}
+STR_2055_TRAFFIC_CHAOS_IN_ROAD_REBUILDING                       :{BIGFONT}{BLACK}Traffic chaos in {TOWN}!{}{}Road rebuilding program funded by {COMPANY} brings 6 months of misery to motorists!
+STR_2056                                                        :{TINYFONT}{WHITE}{TOWN}
+STR_2057                                                        :{ORANGE}{TOWN}{BLACK} ({COMMA})
+STR_2058_UNDER_CONSTRUCTION                                     :{STRING} (under construction)
+STR_2059_IGLOO                                                  :Igloo
+STR_205A_TEPEES                                                 :Tepees
+STR_205B_TEAPOT_HOUSE                                           :Teapot-House
+STR_205C_PIGGY_BANK                                             :Piggy-Bank
+
+STR_INDUSTRY                                                    :{INDUSTRY}
+STR_TOWN                                                        :{TOWN}
+STR_INDUSTRY_FORMAT                                             :{TOWN} {STRING}
+STR_STATION                                                     :{STATION}
+
+##id 0x2800
+STR_LANDSCAPING                                                 :Landscaping
+STR_2800_PLANT_TREES                                            :Plant trees
+STR_2801_PLACE_SIGN                                             :Place sign
+STR_2802_TREES                                                  :{WHITE}Trees
+STR_2803_TREE_ALREADY_HERE                                      :{WHITE}...tree already here
+STR_2804_SITE_UNSUITABLE                                        :{WHITE}...site unsuitable
+STR_2805_CAN_T_PLANT_TREE_HERE                                  :{WHITE}Can't plant tree here...
+STR_2806                                                        :{WHITE}{SIGN}
+STR_2808_TOO_MANY_SIGNS                                         :{WHITE}...too many signs
+STR_2809_CAN_T_PLACE_SIGN_HERE                                  :{WHITE}Can't place sign here...
+STR_280A_SIGN                                                   :Sign
+STR_280B_EDIT_SIGN_TEXT                                         :{WHITE}Edit sign text
+STR_280C_CAN_T_CHANGE_SIGN_NAME                                 :{WHITE}Can't change sign name...
+STR_280D_SELECT_TREE_TYPE_TO_PLANT                              :{BLACK}Select tree type to plant
+STR_280E_TREES                                                  :Trees
+STR_280F_RAINFOREST                                             :Rainforest
+STR_2810_CACTUS_PLANTS                                          :Cactuses
+
+##id 0x3000
+STR_3000_RAIL_STATION_SELECTION                                 :{WHITE}Rail Station Selection
+STR_3001_AIRPORT_SELECTION                                      :{WHITE}Airport Selection
+STR_3002_ORIENTATION                                            :{BLACK}Orientation
+STR_3003_NUMBER_OF_TRACKS                                       :{BLACK}Number of tracks
+STR_3004_PLATFORM_LENGTH                                        :{BLACK}Platform length
+STR_3005_TOO_CLOSE_TO_ANOTHER_RAILROAD                          :{WHITE}Too close to another railroad station
+STR_3006_ADJOINS_MORE_THAN_ONE_EXISTING                         :{WHITE}Adjoins more than one existing station/loading area
+STR_3007_TOO_MANY_STATIONS_LOADING                              :{WHITE}Too many stations/loading areas in this town
+STR_3008_TOO_MANY_STATIONS_LOADING                              :{WHITE}Too many stations/loading areas
+STR_3008A_TOO_MANY_BUS_STOPS                                    :{WHITE}Too many bus stops
+STR_3008B_TOO_MANY_TRUCK_STOPS                                  :{WHITE}Too many truck stations
+STR_3009_TOO_CLOSE_TO_ANOTHER_STATION                           :{WHITE}Too close to another station/loading area
+STR_300A_0                                                      :{WHITE}{STATION} {STATIONFEATURES}
+STR_300B_MUST_DEMOLISH_RAILROAD                                 :{WHITE}Must demolish railroad station first
+STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT                           :{WHITE}Too close to another airport
+STR_300E_MUST_DEMOLISH_AIRPORT_FIRST                            :{WHITE}Must demolish airport first
+
+STR_3030_RENAME_STATION_LOADING                                 :Rename station/loading area
+STR_3031_CAN_T_RENAME_STATION                                   :{WHITE}Can't rename station...
+STR_3032_RATINGS                                                :{BLACK}Ratings
+STR_3033_ACCEPTS                                                :{BLACK}Accepts
+STR_3034_LOCAL_RATING_OF_TRANSPORT                              :{BLACK}Local rating of transport service:
+
+############ range for rating starts
+STR_3035_APPALLING                                              :Appalling
+STR_3036_VERY_POOR                                              :Very Poor
+STR_3037_POOR                                                   :Poor
+STR_3038_MEDIOCRE                                               :Mediocre
+STR_3039_GOOD                                                   :Good
+STR_303A_VERY_GOOD                                              :Very Good
+STR_303B_EXCELLENT                                              :Excellent
+STR_303C_OUTSTANDING                                            :Outstanding
+############ range for rating ends
+
+STR_303D                                                        :{WHITE}{STRING}: {YELLOW}{STRING} ({COMMA}%)
+STR_303E_NO_LONGER_ACCEPTS                                      :{WHITE}{STATION} no longer accepts {STRING}
+STR_303F_NO_LONGER_ACCEPTS_OR                                   :{WHITE}{STATION} no longer accepts {STRING} or {STRING}
+STR_3040_NOW_ACCEPTS                                            :{WHITE}{STATION} now accepts {STRING}
+STR_3041_NOW_ACCEPTS_AND                                        :{WHITE}{STATION} now accepts {STRING} and {STRING}
+STR_3042_BUS_STATION_ORIENTATION                                :{WHITE}Bus Station Orientation
+STR_3043_TRUCK_STATION_ORIENT                                   :{WHITE}Truck Station Orient.
+STR_3042_PASSENGER_TRAM_STATION_ORIENTATION                     :{WHITE}Passenger Tram Orientation
+STR_3043_CARGO_TRAM_STATION_ORIENT                              :{WHITE}Freight Tram Orientation
+STR_3046_MUST_DEMOLISH_BUS_STATION                              :{WHITE}Must demolish bus station first
+STR_3047_MUST_DEMOLISH_TRUCK_STATION                            :{WHITE}Must demolish truck station first
+STR_3046_MUST_DEMOLISH_PASSENGER_TRAM_STATION                   :{WHITE}Must demolish passenger tram station first
+STR_3047_MUST_DEMOLISH_CARGO_TRAM_STATION                       :{WHITE}Must demolish freight tram station first
+STR_3048_STATIONS                                               :{WHITE}{COMPANY} - {COMMA} Station{P "" s}
+STR_3049_0                                                      :{YELLOW}{STATION} {STATIONFEATURES}
+STR_304A_NONE                                                   :{YELLOW}- None -
+STR_304B_SITE_UNSUITABLE                                        :{WHITE}...site unsuitable
+STR_304C_TOO_CLOSE_TO_ANOTHER_DOCK                              :{WHITE}Too close to another dock
+STR_304D_MUST_DEMOLISH_DOCK_FIRST                               :{WHITE}Must demolish dock first
+STR_304E_SELECT_RAILROAD_STATION                                :{BLACK}Select railroad station orientation
+STR_304F_SELECT_NUMBER_OF_PLATFORMS                             :{BLACK}Select number of platforms for railroad station
+STR_3050_SELECT_LENGTH_OF_RAILROAD                              :{BLACK}Select length of railroad station
+STR_3051_SELECT_BUS_STATION_ORIENTATION                         :{BLACK}Select bus station orientation
+STR_3052_SELECT_TRUCK_LOADING_BAY                               :{BLACK}Select truck loading bay orientation
+STR_3051_SELECT_PASSENGER_TRAM_STATION_ORIENTATION              :{BLACK}Select passenger tram station orientation
+STR_3052_SELECT_CARGO_TRAM_STATION_ORIENTATION                  :{BLACK}Select freight tram station orientation
+STR_3053_CENTER_MAIN_VIEW_ON_STATION                            :{BLACK}Center main view on station location
+STR_3054_SHOW_STATION_RATINGS                                   :{BLACK}Show station ratings
+STR_3055_CHANGE_NAME_OF_STATION                                 :{BLACK}Change name of station
+STR_3056_SHOW_LIST_OF_ACCEPTED_CARGO                            :{BLACK}Show list of accepted cargo
+STR_3057_STATION_NAMES_CLICK_ON                                 :{BLACK}Station names - click on name to center main view on station
+STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT                            :{BLACK}Select size/type of airport
+STR_305C_0                                                      :{STATION} {STATIONFEATURES}
+STR_STATION_SIGN_TINY                                           :{TINYFONT}{STATION}
+STR_305E_RAILROAD_STATION                                       :Railroad station
+STR_305F_AIRCRAFT_HANGAR                                        :Aircraft hangar
+STR_3060_AIRPORT                                                :Airport
+STR_3061_TRUCK_LOADING_AREA                                     :Truck loading area
+STR_3062_BUS_STATION                                            :Bus station
+STR_3063_SHIP_DOCK                                              :Ship dock
+STR_3064_HIGHLIGHT_COVERAGE_AREA                                :{BLACK}Highlight coverage area of proposed site
+STR_3065_DON_T_HIGHLIGHT_COVERAGE                               :{BLACK}Don't highlight coverage area of proposed site
+STR_3066_COVERAGE_AREA_HIGHLIGHT                                :{BLACK}Coverage area highlight
+STR_3068_DOCK                                                   :{WHITE}Dock
+STR_3069_BUOY                                                   :Buoy
+STR_306A_BUOY_IN_THE_WAY                                        :{WHITE}...buoy in the way
+STR_306C_STATION_TOO_SPREAD_OUT                                 :{WHITE}...station too spread out
+STR_306D_NONUNIFORM_STATIONS_DISALLOWED                         :{WHITE}...nonuniform stations disabled
+STR_USE_CTRL_TO_SELECT_MORE                                     :{BLACK}Hold down CTRL to select more than one item
+
+STR_UNDEFINED                                                   :(undefined string)
+STR_STAT_CLASS_DFLT                                             :Default station
+STR_STAT_CLASS_WAYP                                             :Waypoints
+
+##id 0x3800
+STR_3800_SHIP_DEPOT_ORIENTATION                                 :{WHITE}Ship Depot Orientation
+STR_3801_MUST_BE_BUILT_ON_WATER                                 :{WHITE}...must be built on water
+STR_3802_CAN_T_BUILD_SHIP_DEPOT                                 :{WHITE}Can't build ship depot here...
+STR_3803_SELECT_SHIP_DEPOT_ORIENTATION                          :{BLACK}Select ship depot orientation
+STR_3804_WATER                                                  :Water
+STR_3805_COAST_OR_RIVERBANK                                     :Coast or riverbank
+STR_3806_SHIP_DEPOT                                             :Ship depot
+STR_3807_CAN_T_BUILD_ON_WATER                                   :{WHITE}...Can't build on water
+STR_MUST_DEMOLISH_CANAL_FIRST                                   :{WHITE}Must demolish canal first
+
+##id 0x4000
+STR_4000_SAVE_GAME                                              :{WHITE}Save Game
+STR_4001_LOAD_GAME                                              :{WHITE}Load Game
+STR_4002_SAVE                                                   :{BLACK}Save
+STR_4003_DELETE                                                 :{BLACK}Delete
+STR_4004                                                        :{COMPANY}, {DATE_LONG}
+STR_4005_BYTES_FREE                                             :{BLACK}{COMMA} megabyte{P "" s} free
+STR_4006_UNABLE_TO_READ_DRIVE                                   :{BLACK}Unable to read drive
+STR_4007_GAME_SAVE_FAILED                                       :{WHITE}Game Save Failed{}{STRING}
+STR_4008_UNABLE_TO_DELETE_FILE                                  :{WHITE}Unable to delete file
+STR_4009_GAME_LOAD_FAILED                                       :{WHITE}Game Load Failed{}{STRING}
+STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR                   :Internal error: {STRING}
+STR_GAME_SAVELOAD_ERROR_BROKEN_SAVEGAME                         :Broken savegame - {STRING}
+STR_GAME_SAVELOAD_ERROR_TOO_NEW_SAVEGAME                        :Savegame is made with newer version
+STR_GAME_SAVELOAD_ERROR_FILE_NOT_READABLE                       :File not readable
+STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE                      :File not writable
+STR_400A_LIST_OF_DRIVES_DIRECTORIES                             :{BLACK}List of drives, directories and saved-game files
+STR_400B_CURRENTLY_SELECTED_NAME                                :{BLACK}Currently selected name for saved-game
+STR_400C_DELETE_THE_CURRENTLY_SELECTED                          :{BLACK}Delete the currently selected saved-game
+STR_400D_SAVE_THE_CURRENT_GAME_USING                            :{BLACK}Save the current game, using the selected name
+STR_400E_SELECT_NEW_GAME_TYPE                                   :{WHITE}Select New Game Type
+STR_400F_SELECT_SCENARIO_GREEN_PRE                              :{BLACK}Select scenario (green), pre-set game (blue), or random new game
+STR_4010_GENERATE_RANDOM_NEW_GAME                               :Generate random new game
+STR_4011_LOAD_HEIGHTMAP                                         :{WHITE}Load Heightmap
+
+##id 0x4800
+STR_4800_IN_THE_WAY                                             :{WHITE}{STRING} in the way
+STR_4801                                                        :{WHITE}{INDUSTRY}
+STR_4802_COAL_MINE                                              :Coal Mine
+STR_4803_POWER_STATION                                          :Power Station
+STR_4804_SAWMILL                                                :Sawmill
+STR_4805_FOREST                                                 :Forest
+STR_4806_OIL_REFINERY                                           :Oil Refinery
+STR_4807_OIL_RIG                                                :Oil Rig
+STR_4808_FACTORY                                                :Factory
+STR_4809_PRINTING_WORKS                                         :Printing Works
+STR_480A_STEEL_MILL                                             :Steel Mill
+STR_480B_FARM                                                   :Farm
+STR_480C_COPPER_ORE_MINE                                        :Copper Ore Mine
+STR_480D_OIL_WELLS                                              :Oil Wells
+STR_480E_BANK                                                   :Bank
+STR_480F_FOOD_PROCESSING_PLANT                                  :Food Processing Plant
+STR_4810_PAPER_MILL                                             :Paper Mill
+STR_4811_GOLD_MINE                                              :Gold Mine
+STR_4812_BANK                                                   :Bank
+STR_4813_DIAMOND_MINE                                           :Diamond Mine
+STR_4814_IRON_ORE_MINE                                          :Iron Ore Mine
+STR_4815_FRUIT_PLANTATION                                       :Fruit Plantation
+STR_4816_RUBBER_PLANTATION                                      :Rubber Plantation
+STR_4817_WATER_SUPPLY                                           :Water Supply
+STR_4818_WATER_TOWER                                            :Water Tower
+STR_4819_FACTORY                                                :Factory
+STR_481A_FARM                                                   :Farm
+STR_481B_LUMBER_MILL                                            :Lumber Mill
+STR_481C_COTTON_CANDY_FOREST                                    :Cotton Candy Forest
+STR_481D_CANDY_FACTORY                                          :Candy Factory
+STR_481E_BATTERY_FARM                                           :Battery Farm
+STR_481F_COLA_WELLS                                             :Cola Wells
+STR_4820_TOY_SHOP                                               :Toy Shop
+STR_4821_TOY_FACTORY                                            :Toy Factory
+STR_4822_PLASTIC_FOUNTAINS                                      :Plastic Fountains
+STR_4823_FIZZY_DRINK_FACTORY                                    :Fizzy Drink Factory
+STR_4824_BUBBLE_GENERATOR                                       :Bubble Generator
+STR_4825_TOFFEE_QUARRY                                          :Toffee Quarry
+STR_4826_SUGAR_MINE                                             :Sugar Mine
+
+############ range for requires starts
+STR_4827_REQUIRES                                               :{BLACK}Requires: {YELLOW}{STRING}
+STR_4828_REQUIRES                                               :{BLACK}Requires: {YELLOW}{STRING}, {STRING}
+STR_4829_REQUIRES                                               :{BLACK}Requires: {YELLOW}{STRING}, {STRING}, {STRING}
+############ range for requires ends
+
+############ range for produces starts
+STR_INDUSTRY_WINDOW_WAITING_FOR_PROCESSING                      :{BLACK}Cargo waiting to be processed:
+STR_INDUSTRY_WINDOW_WAITING_STOCKPILE_CARGO                     :{YELLOW}{CARGO}{BLACK}
+STR_4827_PRODUCES                                               :{BLACK}Produces: {YELLOW}{STRING}
+STR_4828_PRODUCES                                               :{BLACK}Produces: {YELLOW}{STRING}, {STRING}
+############ range for produces ends
+
+STR_482A_PRODUCTION_LAST_MONTH                                  :{BLACK}Production last month:
+STR_482B_TRANSPORTED                                            :{YELLOW}{CARGO}{BLACK} ({COMMA}% transported)
+STR_482C_CENTER_THE_MAIN_VIEW_ON                                :{BLACK}Center the main view on industry location
+STR_482D_NEW_UNDER_CONSTRUCTION                                 :{BLACK}{BIGFONT}New {STRING} under construction near {TOWN}!
+STR_482E_NEW_BEING_PLANTED_NEAR                                 :{BLACK}{BIGFONT}New {STRING} being planted near {TOWN}!
+STR_482F_COST                                                   :{BLACK}Cost: {YELLOW}{CURRENCY}
+STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY                          :{WHITE}Can't construct this industry type here...
+STR_4831_FOREST_CAN_ONLY_BE_PLANTED                             :{WHITE}...forest can only be planted above snow-line
+STR_4832_ANNOUNCES_IMMINENT_CLOSURE                             :{BLACK}{BIGFONT}{STRING} announces imminent closure!
+STR_4833_SUPPLY_PROBLEMS_CAUSE_TO                               :{BLACK}{BIGFONT}Supply problems cause {STRING} to announce imminent closure!
+STR_4834_LACK_OF_NEARBY_TREES_CAUSES                            :{BLACK}{BIGFONT}Lack of nearby trees causes {STRING} to announce imminent closure!
+STR_4835_INCREASES_PRODUCTION                                   :{BLACK}{BIGFONT}{INDUSTRY} increases production!
+STR_4836_NEW_COAL_SEAM_FOUND_AT                                 :{BLACK}{BIGFONT}New coal seam found at {INDUSTRY}!{}Production is expected to double!
+STR_4837_NEW_OIL_RESERVES_FOUND                                 :{BLACK}{BIGFONT}New oil reserves found at {INDUSTRY}!{}Production is expected to double!
+STR_4838_IMPROVED_FARMING_METHODS                               :{BLACK}{BIGFONT}Improved farming methods at {INDUSTRY} are expected to double production!
+STR_4839_PRODUCTION_DOWN_BY_50                                  :{BLACK}{BIGFONT}{INDUSTRY} production down by 50%
+STR_483A_INSECT_INFESTATION_CAUSES                              :{BLACK}{BIGFONT}Insect infestation causes havoc at {INDUSTRY}!{}Production down by 50%
+STR_483B_CAN_ONLY_BE_POSITIONED                                 :{WHITE}...can only be positioned near edges of map
+STR_INDUSTRY_PROD_GOUP                                          :{BLACK}{BIGFONT}{STRING} production at {INDUSTRY} increases by {COMMA}%!
+STR_INDUSTRY_PROD_GODOWN                                        :{BLACK}{BIGFONT}{STRING} production at {INDUSTRY} goes down by {COMMA}%!
+
+##id 0x5000
+STR_5000_TRAIN_IN_TUNNEL                                        :{WHITE}Train in tunnel
+STR_5001_ROAD_VEHICLE_IN_TUNNEL                                 :{WHITE}Road vehicle in tunnel
+STR_5003_ANOTHER_TUNNEL_IN_THE_WAY                              :{WHITE}Another tunnel in the way
+STR_5005_UNABLE_TO_EXCAVATE_LAND                                :{WHITE}Unable to excavate land for other end of tunnel
+STR_5006_MUST_DEMOLISH_TUNNEL_FIRST                             :{WHITE}Must demolish tunnel first
+STR_5007_MUST_DEMOLISH_BRIDGE_FIRST                             :{WHITE}Must demolish bridge first
+STR_5008_CANNOT_START_AND_END_ON                                :{WHITE}Cannot start and end on same position
+STR_BRIDGEHEADS_NOT_SAME_HEIGHT                                 :{WHITE}Bridge heads not at the same level
+STR_BRIDGE_TOO_LOW_FOR_TERRAIN                                  :{WHITE}Bridge is too low for the terrain
+STR_500A_START_AND_END_MUST_BE_IN                               :{WHITE}Start and end must be in line
+STR_500B_SITE_UNSUITABLE_FOR_TUNNEL                             :{WHITE}Site unsuitable for tunnel entrance
+STR_500D                                                        :{GOLD}{STRING},{} {VELOCITY} {WHITE}{CURRENCY}
+STR_500E_SUSPENSION_STEEL                                       :Suspension, Steel
+STR_500F_GIRDER_STEEL                                           :Girder, Steel
+STR_5010_CANTILEVER_STEEL                                       :Cantilever, Steel
+STR_5011_SUSPENSION_CONCRETE                                    :Suspension, Concrete
+STR_5012_WOODEN                                                 :Wooden
+STR_5013_CONCRETE                                               :Concrete
+STR_5014_TUBULAR_STEEL                                          :Tubular, Steel
+STR_BRIDGE_TUBULAR_SILICON                                      :Tubular, Silicon
+STR_5015_CAN_T_BUILD_BRIDGE_HERE                                :{WHITE}Can't build bridge here...
+STR_5016_CAN_T_BUILD_TUNNEL_HERE                                :{WHITE}Can't build tunnel here...
+STR_5017_RAILROAD_TUNNEL                                        :Railroad tunnel
+STR_5018_ROAD_TUNNEL                                            :Road tunnel
+STR_501B_STEEL_SUSPENSION_RAIL_BRIDGE                           :Steel suspension rail bridge
+STR_501C_STEEL_GIRDER_RAIL_BRIDGE                               :Steel girder rail bridge
+STR_501D_STEEL_CANTILEVER_RAIL_BRIDGE                           :Steel cantilever rail bridge
+STR_501E_REINFORCED_CONCRETE_SUSPENSION                         :Reinforced concrete suspension rail bridge
+STR_501F_WOODEN_RAIL_BRIDGE                                     :Wooden rail bridge
+STR_5020_CONCRETE_RAIL_BRIDGE                                   :Concrete rail bridge
+STR_5021_STEEL_SUSPENSION_ROAD_BRIDGE                           :Steel suspension road bridge
+STR_5022_STEEL_GIRDER_ROAD_BRIDGE                               :Steel girder road bridge
+STR_5023_STEEL_CANTILEVER_ROAD_BRIDGE                           :Steel cantilever road bridge
+STR_5024_REINFORCED_CONCRETE_SUSPENSION                         :Reinforced concrete suspension road bridge
+STR_5025_WOODEN_ROAD_BRIDGE                                     :Wooden road bridge
+STR_5026_CONCRETE_ROAD_BRIDGE                                   :Concrete road bridge
+STR_5027_TUBULAR_RAIL_BRIDGE                                    :Tubular rail bridge
+STR_5028_TUBULAR_ROAD_BRIDGE                                    :Tubular road bridge
+
+##id 0x5800
+STR_5800_OBJECT_IN_THE_WAY                                      :{WHITE}Object in the way
+STR_5801_TRANSMITTER                                            :Transmitter
+STR_5802_LIGHTHOUSE                                             :Lighthouse
+STR_5803_COMPANY_HEADQUARTERS                                   :Company Headquarters
+STR_5804_COMPANY_HEADQUARTERS_IN                                :{WHITE}...company headquarters in the way
+STR_5805_COMPANY_OWNED_LAND                                     :Company-owned land
+STR_5806_CAN_T_PURCHASE_THIS_LAND                               :{WHITE}Can't purchase this land area...
+STR_5807_YOU_ALREADY_OWN_IT                                     :{WHITE}...you already own it!
+
+
+############ WARNING, using range 0x6000 for strings that are stored in the savegame
+############ These strings may never get a new id, or savegames will break!
+##id 0x6000
+STR_SV_EMPTY                                                    :
+STR_SV_UNNAMED                                                  :Unnamed
+STR_SV_TRAIN_NAME                                               :Train {COMMA}
+STR_SV_ROADVEH_NAME                                             :Road Vehicle {COMMA}
+STR_SV_SHIP_NAME                                                :Ship {COMMA}
+STR_SV_AIRCRAFT_NAME                                            :Aircraft {COMMA}
+
+STR_SV_STNAME                                                   :{STRING}
+STR_SV_STNAME_NORTH                                             :{STRING} North
+STR_SV_STNAME_SOUTH                                             :{STRING} South
+STR_SV_STNAME_EAST                                              :{STRING} East
+STR_SV_STNAME_WEST                                              :{STRING} West
+STR_SV_STNAME_CENTRAL                                           :{STRING} Central
+STR_SV_STNAME_TRANSFER                                          :{STRING} Transfer
+STR_SV_STNAME_HALT                                              :{STRING} Halt
+STR_SV_STNAME_VALLEY                                            :{STRING} Valley
+STR_SV_STNAME_HEIGHTS                                           :{STRING} Heights
+STR_SV_STNAME_WOODS                                             :{STRING} Woods
+STR_SV_STNAME_LAKESIDE                                          :{STRING} Lakeside
+STR_SV_STNAME_EXCHANGE                                          :{STRING} Exchange
+STR_SV_STNAME_AIRPORT                                           :{STRING} Airport
+STR_SV_STNAME_OILFIELD                                          :{STRING} Oilfield
+STR_SV_STNAME_MINES                                             :{STRING} Mines
+STR_SV_STNAME_DOCKS                                             :{STRING} Docks
+STR_SV_STNAME_BUOY_1                                            :{STRING} Buoy 1
+STR_SV_STNAME_BUOY_2                                            :{STRING} Buoy 2
+STR_SV_STNAME_BUOY_3                                            :{STRING} Buoy 3
+STR_SV_STNAME_BUOY_4                                            :{STRING} Buoy 4
+STR_SV_STNAME_BUOY_5                                            :{STRING} Buoy 5
+STR_SV_STNAME_BUOY_6                                            :{STRING} Buoy 6
+STR_SV_STNAME_BUOY_7                                            :{STRING} Buoy 7
+STR_SV_STNAME_BUOY_8                                            :{STRING} Buoy 8
+STR_SV_STNAME_BUOY_9                                            :{STRING} Buoy 9
+STR_SV_STNAME_ANNEXE                                            :{STRING} Annexe
+STR_SV_STNAME_SIDINGS                                           :{STRING} Sidings
+STR_SV_STNAME_BRANCH                                            :{STRING} Branch
+STR_SV_STNAME_UPPER                                             :Upper {STRING}
+STR_SV_STNAME_LOWER                                             :Lower {STRING}
+STR_SV_STNAME_HELIPORT                                          :{STRING} Heliport
+STR_SV_STNAME_FOREST                                            :{STRING} Forest
+STR_SV_STNAME_FALLBACK                                          :{STRING} Station #{NUM}
+
+############ end of savegame specific region!
+
+##id 0x6800
+STR_6800_DIFFICULTY_LEVEL                                       :{WHITE}Difficulty Level
+STR_OPTIONS_SAVE_CHANGES                                        :{BLACK}Save
+
+############ range for difficulty levels starts
+STR_6801_EASY                                                   :{BLACK}Easy
+STR_6802_MEDIUM                                                 :{BLACK}Medium
+STR_6803_HARD                                                   :{BLACK}Hard
+STR_6804_CUSTOM                                                 :{BLACK}Custom
+############ range for difficulty levels ends
+
+############ range for difficulty settings starts
+STR_6805_MAXIMUM_NO_COMPETITORS                                 :{LTBLUE}Maximum no. competitors: {ORANGE}{COMMA}
+STR_6806_COMPETITOR_START_TIME                                  :{LTBLUE}Competitor start time: {ORANGE}{STRING}
+STR_6807_NO_OF_TOWNS                                            :{LTBLUE}No. of towns: {ORANGE}{STRING}
+STR_6808_NO_OF_INDUSTRIES                                       :{LTBLUE}No. of industries: {ORANGE}{STRING}
+STR_6809_MAXIMUM_INITIAL_LOAN_000                               :{LTBLUE}Maximum initial loan: {ORANGE}{CURRENCY}
+STR_680A_INITIAL_INTEREST_RATE                                  :{LTBLUE}Initial interest rate: {ORANGE}{COMMA}%
+STR_680B_VEHICLE_RUNNING_COSTS                                  :{LTBLUE}Vehicle running costs: {ORANGE}{STRING}
+STR_680C_CONSTRUCTION_SPEED_OF_COMPETITOR                       :{LTBLUE}Construction speed of competitors: {ORANGE}{STRING}
+STR_680D_INTELLIGENCE_OF_COMPETITORS                            :{LTBLUE}Intelligence of competitors: {ORANGE}{STRING}
+STR_680E_VEHICLE_BREAKDOWNS                                     :{LTBLUE}Vehicle breakdowns: {ORANGE}{STRING}
+STR_680F_SUBSIDY_MULTIPLIER                                     :{LTBLUE}Subsidy multiplier: {ORANGE}{STRING}
+STR_6810_COST_OF_CONSTRUCTION                                   :{LTBLUE}Cost of construction: {ORANGE}{STRING}
+STR_6811_TERRAIN_TYPE                                           :{LTBLUE}Terrain type: {ORANGE}{STRING}
+STR_6812_QUANTITY_OF_SEA_LAKES                                  :{LTBLUE}Quantity of sea/lakes: {ORANGE}{STRING}
+STR_6813_ECONOMY                                                :{LTBLUE}Economy: {ORANGE}{STRING}
+STR_6814_TRAIN_REVERSING                                        :{LTBLUE}Train reversing: {ORANGE}{STRING}
+STR_6815_DISASTERS                                              :{LTBLUE}Disasters: {ORANGE}{STRING}
+STR_16816_CITY_APPROVAL                                         :{LTBLUE}City council's attitude towards area restructuring: {ORANGE}{STRING}
+############ range for difficulty settings ends
+
+STR_26816_NONE                                                  :None
+STR_NUM_VERY_LOW                                                :Very low
+STR_6816_LOW                                                    :Low
+STR_6817_NORMAL                                                 :Normal
+STR_6818_HIGH                                                   :High
+STR_6819                                                        :{BLACK}{SMALLLEFTARROW}
+STR_681A                                                        :{BLACK}{SMALLRIGHTARROW}
+STR_681B_VERY_SLOW                                              :Very Slow
+STR_681C_SLOW                                                   :Slow
+STR_681D_MEDIUM                                                 :Medium
+STR_681E_FAST                                                   :Fast
+STR_681F_VERY_FAST                                              :Very Fast
+STR_VERY_LOW                                                    :Very Low
+STR_6820_LOW                                                    :Low
+STR_6821_MEDIUM                                                 :Medium
+STR_6822_HIGH                                                   :High
+STR_6823_NONE                                                   :None
+STR_6824_REDUCED                                                :Reduced
+STR_6825_NORMAL                                                 :Normal
+STR_6826_X1_5                                                   :x1.5
+STR_6827_X2                                                     :x2
+STR_6828_X3                                                     :x3
+STR_6829_X4                                                     :x4
+STR_682A_VERY_FLAT                                              :Very Flat
+STR_682B_FLAT                                                   :Flat
+STR_682C_HILLY                                                  :Hilly
+STR_682D_MOUNTAINOUS                                            :Mountainous
+STR_682E_STEADY                                                 :Steady
+STR_682F_FLUCTUATING                                            :Fluctuating
+STR_6830_IMMEDIATE                                              :Immediate
+STR_6831_3_MONTHS_AFTER_PLAYER                                  :3 months after player
+STR_6832_6_MONTHS_AFTER_PLAYER                                  :6 months after player
+STR_6833_9_MONTHS_AFTER_PLAYER                                  :9 months after player
+STR_6834_AT_END_OF_LINE_AND_AT_STATIONS                         :At end of line, and at stations
+STR_6835_AT_END_OF_LINE_ONLY                                    :At end of line only
+STR_6836_OFF                                                    :Off
+STR_6837_ON                                                     :On
+STR_6838_SHOW_HI_SCORE_CHART                                    :{BLACK}Show hi-score chart
+STR_6839_PERMISSIVE                                             :Permissive
+STR_683A_TOLERANT                                               :Tolerant
+STR_683B_HOSTILE                                                :Hostile
+
+##id 0x7000
+STR_7000                                                        :
+STR_7001                                                        :{WHITE}{COMPANY} {BLACK}{COMPANYNUM}
+STR_7002_PLAYER                                                 :(Player {COMMA})
+STR_7004_NEW_FACE                                               :{BLACK}New Face
+STR_7005_COLOR_SCHEME                                           :{BLACK}Color Scheme
+STR_7006_COLOR_SCHEME                                           :{GOLD}Color Scheme:
+STR_7007_NEW_COLOR_SCHEME                                       :{WHITE}New Color Scheme
+STR_7008_COMPANY_NAME                                           :{BLACK}Company Name
+STR_7009_PRESIDENT_NAME                                         :{BLACK}President Name
+STR_700A_COMPANY_NAME                                           :Company Name
+STR_700B_PRESIDENT_S_NAME                                       :President's Name
+STR_700C_CAN_T_CHANGE_COMPANY_NAME                              :{WHITE}Can't change company name...
+STR_700D_CAN_T_CHANGE_PRESIDENT                                 :{WHITE}Can't change president's name...
+STR_700E_FINANCES                                               :{WHITE}{COMPANY} Finances {BLACK}{COMPANYNUM}
+STR_700F_EXPENDITURE_INCOME                                     :{WHITE}Expenditure/Income
+STR_7010                                                        :{WHITE}{NUM}
+STR_7011_CONSTRUCTION                                           :{GOLD}Construction
+STR_7012_NEW_VEHICLES                                           :{GOLD}New Vehicles
+STR_7013_TRAIN_RUNNING_COSTS                                    :{GOLD}Train Running Costs
+STR_7014_ROAD_VEH_RUNNING_COSTS                                 :{GOLD}Road Veh. Running Costs
+STR_7015_AIRCRAFT_RUNNING_COSTS                                 :{GOLD}Aircraft Running Costs
+STR_7016_SHIP_RUNNING_COSTS                                     :{GOLD}Ship Running Costs
+STR_7017_PROPERTY_MAINTENANCE                                   :{GOLD}Property Maintenance
+STR_7018_TRAIN_INCOME                                           :{GOLD}Train Income
+STR_7019_ROAD_VEHICLES_INCOME                                   :{GOLD}Road Vehicle Income
+STR_701A_AIRCRAFT_INCOME                                        :{GOLD}Aircraft Income
+STR_701B_SHIP_INCOME                                            :{GOLD}Ship Income
+STR_701C_LOAN_INTEREST                                          :{GOLD}Loan Interest
+STR_701D_OTHER                                                  :{GOLD}Other
+STR_701E                                                        :{BLACK}-{CURRENCY}
+STR_701F                                                        :{BLACK}+{CURRENCY}
+STR_7020_TOTAL                                                  :{WHITE}Total:
+STR_7021                                                        :{COMPANY} {COMPANYNUM}
+STR_7022_INCOME_GRAPH                                           :{WHITE}Income Graph
+STR_CURRCOMPACT                                                 :{CURRCOMPACT}
+STR_7024                                                        :{COMMA}
+STR_7025_OPERATING_PROFIT_GRAPH                                 :{WHITE}Operating Profit Graph
+STR_7026_BANK_BALANCE                                           :{WHITE}Bank Balance
+STR_7027_LOAN                                                   :{WHITE}Loan
+STR_MAX_LOAN                                                    :{WHITE}Max Loan:  {BLACK}{CURRENCY}
+STR_7028                                                        :{BLACK}{CURRENCY}
+STR_7029_BORROW                                                 :{BLACK}Borrow {SKIP}{SKIP}{CURRENCY}
+STR_702A_REPAY                                                  :{BLACK}Repay {SKIP}{SKIP}{CURRENCY}
+STR_702B_MAXIMUM_PERMITTED_LOAN                                 :{WHITE}...maximum permitted loan size is {CURRENCY}
+STR_702C_CAN_T_BORROW_ANY_MORE_MONEY                            :{WHITE}Can't borrow any more money...
+STR_702D_LOAN_ALREADY_REPAYED                                   :{WHITE}...no loan to repay
+STR_702E_REQUIRED                                               :{WHITE}...{CURRENCY} required
+STR_702F_CAN_T_REPAY_LOAN                                       :{WHITE}Can't repay loan...
+STR_INSUFFICIENT_FUNDS                                          :{WHITE}Can't give away money that is loaned from the bank...
+STR_7030_SELECT_NEW_FACE_FOR_PRESIDENT                          :{BLACK}Select new face for president
+STR_7031_CHANGE_THE_COMPANY_VEHICLE                             :{BLACK}Change the company vehicle livery
+STR_7032_CHANGE_THE_PRESIDENT_S                                 :{BLACK}Change the president's name
+STR_7033_CHANGE_THE_COMPANY_NAME                                :{BLACK}Change the company name
+STR_7034_CLICK_ON_SELECTED_NEW_COLOR                            :{BLACK}Click on desired color scheme
+STR_7035_INCREASE_SIZE_OF_LOAN                                  :{BLACK}Increase size of loan
+STR_7036_REPAY_PART_OF_LOAN                                     :{BLACK}Repay part of loan
+STR_7037_PRESIDENT                                              :{WHITE}{PLAYERNAME}{}{GOLD}(President)
+STR_7038_INAUGURATED                                            :{GOLD}Inaugurated: {WHITE}{NUM}
+STR_7039_VEHICLES                                               :{GOLD}Vehicles:
+STR_TRAINS                                                      :{WHITE}{COMMA} train{P "" s}
+STR_ROAD_VEHICLES                                               :{WHITE}{COMMA} road vehicle{P "" s}
+STR_AIRCRAFT                                                    :{WHITE}{COMMA} aircraft
+STR_SHIPS                                                       :{WHITE}{COMMA} ship{P "" s}
+STR_7042_NONE                                                   :{WHITE}None
+STR_7043_FACE_SELECTION                                         :{WHITE}Face Selection
+STR_7044_MALE                                                   :{BLACK}Male
+STR_7045_FEMALE                                                 :{BLACK}Female
+STR_7046_NEW_FACE                                               :{BLACK}New Face
+STR_7047_CANCEL_NEW_FACE_SELECTION                              :{BLACK}Cancel new face selection
+STR_7048_ACCEPT_NEW_FACE_SELECTION                              :{BLACK}Accept new face selection
+STR_7049_SELECT_MALE_FACES                                      :{BLACK}Select male faces
+STR_704A_SELECT_FEMALE_FACES                                    :{BLACK}Select female faces
+STR_704B_GENERATE_RANDOM_NEW_FACE                               :{BLACK}Generate random new face
+STR_704C_KEY                                                    :{BLACK}Key
+STR_704D_SHOW_KEY_TO_GRAPHS                                     :{BLACK}Show key to graphs
+STR_704E_KEY_TO_COMPANY_GRAPHS                                  :{WHITE}Key to company graphs
+STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY                           :{BLACK}Click here to toggle company's entry on graph on/off
+STR_7050_UNITS_OF_CARGO_DELIVERED                               :{WHITE}Units of cargo delivered
+STR_7051_COMPANY_PERFORMANCE_RATINGS                            :{WHITE}Company performance ratings (maximum rating=1000)
+STR_7052_COMPANY_VALUES                                         :{WHITE}Company values
+STR_7053_COMPANY_LEAGUE_TABLE                                   :{WHITE}Company League Table
+STR_7054                                                        :{WHITE}{STRING}{SETX 45}{ORANGE}{COMPANY} {BLACK}{COMPANYNUM} '{STRING}'
+STR_7055                                                        :{YELLOW}{STRING}{SETX 45}{ORANGE}{COMPANY} {BLACK}{COMPANYNUM}  '{STRING}'
+STR_7056_TRANSPORT_COMPANY_IN_TROUBLE                           :{BLACK}{BIGFONT}Transport company in trouble!
+STR_7057_WILL_BE_SOLD_OFF_OR_DECLARED                           :{BLACK}{BIGFONT}{COMPANY} will be sold off or declared bankrupt unless performance increases soon!
+STR_7058_PRESIDENT                                              :{BLACK}{PLAYERNAME}{}(President)
+STR_7059_TRANSPORT_COMPANY_MERGER                               :{BLACK}{BIGFONT}Transport company merger!
+STR_705A_HAS_BEEN_SOLD_TO_FOR                                   :{BLACK}{BIGFONT}{COMPANY} has been sold to {COMPANY} for {CURRENCY}!
+STR_705B_WE_ARE_LOOKING_FOR_A_TRANSPORT                         :{WHITE}We are looking for a transport company to take-over our company{}{}Do you want to purchase {COMPANY} for {CURRENCY}?
+STR_705C_BANKRUPT                                               :{BLACK}{BIGFONT}Bankrupt!
+STR_705D_HAS_BEEN_CLOSED_DOWN_BY                                :{BLACK}{BIGFONT}{COMPANY} has been closed down by creditors and all assets sold off!
+STR_705E_NEW_TRANSPORT_COMPANY_LAUNCHED                         :{BLACK}{BIGFONT}New transport company launched!
+STR_705F_STARTS_CONSTRUCTION_NEAR                               :{BLACK}{BIGFONT}{COMPANY} starts construction near {TOWN}!
+STR_7060_CAN_T_BUY_COMPANY                                      :{WHITE}Can't buy company...
+STR_7061_CARGO_PAYMENT_RATES                                    :{WHITE}Cargo Payment Rates
+STR_7062_DAYS_IN_TRANSIT                                        :{BLACK}{TINYFONT}Days in transit
+STR_7063_PAYMENT_FOR_DELIVERING                                 :{BLACK}{TINYFONT}Payment for delivering 10 units (or 10,000 litres) of cargo a distance of 20 squares
+STR_7064_TOGGLE_GRAPH_FOR_CARGO                                 :{BLACK}Toggle graph for cargo type on/off
+STR_7065                                                        :{BLACK}{TINYFONT}{STRING}
+STR_7066_ENGINEER                                               :Engineer
+STR_7067_TRAFFIC_MANAGER                                        :Traffic Manager
+STR_7068_TRANSPORT_COORDINATOR                                  :Transport Coordinator
+STR_7069_ROUTE_SUPERVISOR                                       :Route Supervisor
+STR_706A_DIRECTOR                                               :Director
+STR_706B_CHIEF_EXECUTIVE                                        :Chief Executive
+STR_706C_CHAIRMAN                                               :Chairman
+STR_706D_PRESIDENT                                              :President
+STR_706E_TYCOON                                                 :Tycoon
+STR_706F_BUILD_HQ                                               :{BLACK}Build HQ
+STR_7070_BUILD_COMPANY_HEADQUARTERS                             :{BLACK}Build company headquarters / view company headquarters
+STR_RELOCATE_COMPANY_HEADQUARTERS                               :{BLACK}Rebuild company headquarters elsewhere for 1% cost of company value
+STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS                       :{WHITE}Can't build company headquarters...
+STR_7072_VIEW_HQ                                                :{BLACK}View HQ
+STR_RELOCATE_HQ                                                 :{BLACK}Relocate HQ
+STR_COMPANY_PASSWORD                                            :{BLACK}Password
+STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Password-protect your company to prevent unauthorized users from joining.
+STR_SET_COMPANY_PASSWORD                                        :{BLACK}Set company password
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Do not save the entered password
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Give the company the new password
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Company password
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Default company password
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Use this company password as default for new companies
+STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}World Recession!{}{}Financial experts fear worst as economy slumps!
+STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Recession Over!{}{}Upturn in trade gives confidence to industries as economy strengthens!
+STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Toggle large/small window size
+STR_7076_COMPANY_VALUE                                          :{GOLD}Company value: {WHITE}{CURRENCY}
+STR_7077_BUY_25_SHARE_IN_COMPANY                                :{BLACK}Buy 25% share in company
+STR_7078_SELL_25_SHARE_IN_COMPANY                               :{BLACK}Sell 25% share in company
+STR_7079_BUY_25_SHARE_IN_THIS_COMPANY                           :{BLACK}Buy 25% share in this company
+STR_707A_SELL_25_SHARE_IN_THIS_COMPANY                          :{BLACK}Sell 25% share in this company
+STR_707B_CAN_T_BUY_25_SHARE_IN_THIS                             :{WHITE}Can't buy 25% share in this company...
+STR_707C_CAN_T_SELL_25_SHARE_IN                                 :{WHITE}Can't sell 25% share in this company...
+STR_707D_OWNED_BY                                               :{WHITE}({COMMA}% owned by {COMPANY})
+STR_707F_HAS_BEEN_TAKEN_OVER_BY                                 :{BLACK}{BIGFONT}{COMPANY} has been taken over by {COMPANY}!
+STR_7080_PROTECTED                                              :{WHITE}This company is not old enough to trade shares yet...
+
+STR_LIVERY_DEFAULT                                              :Standard Livery
+STR_LIVERY_STEAM                                                :Steam Engine
+STR_LIVERY_DIESEL                                               :Diesel Engine
+STR_LIVERY_ELECTRIC                                             :Electric Engine
+STR_LIVERY_MONORAIL                                             :Monorail Engine
+STR_LIVERY_MAGLEV                                               :Maglev Engine
+STR_LIVERY_DMU                                                  :DMU
+STR_LIVERY_EMU                                                  :EMU
+STR_LIVERY_PASSENGER_WAGON_STEAM                                :Passenger/Mail Car (Steam)
+STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Passenger/Mail Car (Diesel)
+STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Passenger/Mail Car (Electric)
+STR_LIVERY_FREIGHT_WAGON                                        :Freight Car
+STR_LIVERY_BUS                                                  :Bus
+STR_LIVERY_TRUCK                                                :Truck
+STR_LIVERY_PASSENGER_SHIP                                       :Passenger Ship
+STR_LIVERY_FREIGHT_SHIP                                         :Freight Ship
+STR_LIVERY_HELICOPTER                                           :Helicopter
+STR_LIVERY_SMALL_PLANE                                          :Small Airplane
+STR_LIVERY_LARGE_PLANE                                          :Large Airplane
+STR_LIVERY_PASSENGER_TRAM                                       :Passenger Tram
+STR_LIVERY_FREIGHT_TRAM                                         :Freight Tram
+
+STR_LIVERY_GENERAL_TIP                                          :{BLACK}Show general color schemes
+STR_LIVERY_TRAIN_TIP                                            :{BLACK}Show train color schemes
+STR_LIVERY_ROADVEH_TIP                                          :{BLACK}Show road vehicle color schemes
+STR_LIVERY_SHIP_TIP                                             :{BLACK}Show ship color schemes
+STR_LIVERY_AIRCRAFT_TIP                                         :{BLACK}Show aircraft color schemes
+STR_LIVERY_PRIMARY_TIP                                          :{BLACK}Choose the primary color for the selected scheme
+STR_LIVERY_SECONDARY_TIP                                        :{BLACK}Choose the secondary color for the selected scheme
+STR_LIVERY_PANEL_TIP                                            :{BLACK}Select a color scheme to change, or multiple schemes with CTRL+click. Click on the box to toggle use of the scheme
+
+##id 0x8000
+STR_8000_KIRBY_PAUL_TANK_STEAM                                  :Kirby Paul Tank (Steam)
+STR_8001_MJS_250_DIESEL                                         :MJS 250 (Diesel)
+STR_8002_PLODDYPHUT_CHOO_CHOO                                   :Ploddyphut Choo-Choo
+STR_8003_POWERNAUT_CHOO_CHOO                                    :Powernaut Choo-Choo
+STR_8004_MIGHTYMOVER_CHOO_CHOO                                  :Mightymover Choo-Choo
+STR_8005_PLODDYPHUT_DIESEL                                      :Ploddyphut Diesel
+STR_8006_POWERNAUT_DIESEL                                       :Powernaut Diesel
+STR_8007_WILLS_2_8_0_STEAM                                      :Wills 2-8-0 (Steam)
+STR_8008_CHANEY_JUBILEE_STEAM                                   :Chaney 'Jubilee' (Steam)
+STR_8009_GINZU_A4_STEAM                                         :Ginzu 'A4' (Steam)
+STR_800A_SH_8P_STEAM                                            :SH '8P' (Steam)
+STR_800B_MANLEY_MOREL_DMU_DIESEL                                :Manley-Morel DMU (Diesel)
+STR_800C_DASH_DIESEL                                            :'Dash' (Diesel)
+STR_800D_SH_HENDRY_25_DIESEL                                    :SH/Hendry '25' (Diesel)
+STR_800E_UU_37_DIESEL                                           :UU '37' (Diesel)
+STR_800F_FLOSS_47_DIESEL                                        :Floss '47' (Diesel)
+STR_8010_CS_4000_DIESEL                                         :CS 4000 (Diesel)
+STR_8011_CS_2400_DIESEL                                         :CS 2400 (Diesel)
+STR_8012_CENTENNIAL_DIESEL                                      :Centennial (Diesel)
+STR_8013_KELLING_3100_DIESEL                                    :Kelling 3100 (Diesel)
+STR_8014_TURNER_TURBO_DIESEL                                    :Turner Turbo (Diesel)
+STR_8015_MJS_1000_DIESEL                                        :MJS 1000 (Diesel)
+STR_8016_SH_125_DIESEL                                          :SH '125' (Diesel)
+STR_8017_SH_30_ELECTRIC                                         :SH '30' (Electric)
+STR_8018_SH_40_ELECTRIC                                         :SH '40' (Electric)
+STR_8019_T_I_M_ELECTRIC                                         :'T.I.M.' (Electric)
+STR_801A_ASIASTAR_ELECTRIC                                      :'AsiaStar' (Electric)
+STR_801B_PASSENGER_CAR                                          :Passenger Car
+STR_801C_MAIL_VAN                                               :Mail Van
+STR_801D_COAL_CAR                                               :Coal Car
+STR_801E_OIL_TANKER                                             :Oil Tanker
+STR_801F_LIVESTOCK_VAN                                          :Livestock Van
+STR_8020_GOODS_VAN                                              :Goods Van
+STR_8021_GRAIN_HOPPER                                           :Grain Hopper
+STR_8022_WOOD_TRUCK                                             :Wood Truck
+STR_8023_IRON_ORE_HOPPER                                        :Iron Ore Hopper
+STR_8024_STEEL_TRUCK                                            :Steel Truck
+STR_8025_ARMORED_VAN                                            :Armored Van
+STR_8026_FOOD_VAN                                               :Food Van
+STR_8027_PAPER_TRUCK                                            :Paper Truck
+STR_8028_COPPER_ORE_HOPPER                                      :Copper Ore Hopper
+STR_8029_WATER_TANKER                                           :Water Tanker
+STR_802A_FRUIT_TRUCK                                            :Fruit Truck
+STR_802B_RUBBER_TRUCK                                           :Rubber Truck
+STR_802C_SUGAR_TRUCK                                            :Sugar Truck
+STR_802D_COTTON_CANDY_HOPPER                                    :Cotton Candy Hopper
+STR_802E_TOFFEE_HOPPER                                          :Toffee Hopper
+STR_802F_BUBBLE_VAN                                             :Bubble Van
+STR_8030_COLA_TANKER                                            :Cola Tanker
+STR_8031_CANDY_VAN                                              :Candy Van
+STR_8032_TOY_VAN                                                :Toy Van
+STR_8033_BATTERY_TRUCK                                          :Battery Truck
+STR_8034_FIZZY_DRINK_TRUCK                                      :Fizzy Drink Truck
+STR_8035_PLASTIC_TRUCK                                          :Plastic Truck
+STR_8036_X2001_ELECTRIC                                         :'X2001' (Electric)
+STR_8037_MILLENNIUM_Z1_ELECTRIC                                 :'Millennium Z1' (Electric)
+STR_8038_WIZZOWOW_Z99                                           :Wizzowow Z99
+STR_8039_PASSENGER_CAR                                          :Passenger Car
+STR_803A_MAIL_VAN                                               :Mail Van
+STR_803B_COAL_CAR                                               :Coal Car
+STR_803C_OIL_TANKER                                             :Oil Tanker
+STR_803D_LIVESTOCK_VAN                                          :Livestock Van
+STR_803E_GOODS_VAN                                              :Goods Van
+STR_803F_GRAIN_HOPPER                                           :Grain Hopper
+STR_8040_WOOD_TRUCK                                             :Wood Truck
+STR_8041_IRON_ORE_HOPPER                                        :Iron Ore Hopper
+STR_8042_STEEL_TRUCK                                            :Steel Truck
+STR_8043_ARMORED_VAN                                            :Armored Van
+STR_8044_FOOD_VAN                                               :Food Van
+STR_8045_PAPER_TRUCK                                            :Paper Truck
+STR_8046_COPPER_ORE_HOPPER                                      :Copper Ore Hopper
+STR_8047_WATER_TANKER                                           :Water Tanker
+STR_8048_FRUIT_TRUCK                                            :Fruit Truck
+STR_8049_RUBBER_TRUCK                                           :Rubber Truck
+STR_804A_SUGAR_TRUCK                                            :Sugar Truck
+STR_804B_COTTON_CANDY_HOPPER                                    :Cotton Candy Hopper
+STR_804C_TOFFEE_HOPPER                                          :Toffee Hopper
+STR_804D_BUBBLE_VAN                                             :Bubble Van
+STR_804E_COLA_TANKER                                            :Cola Tanker
+STR_804F_CANDY_VAN                                              :Candy Van
+STR_8050_TOY_VAN                                                :Toy Van
+STR_8051_BATTERY_TRUCK                                          :Battery Truck
+STR_8052_FIZZY_DRINK_TRUCK                                      :Fizzy Drink Truck
+STR_8053_PLASTIC_TRUCK                                          :Plastic Truck
+STR_8054_LEV1_LEVIATHAN_ELECTRIC                                :Lev1 'Leviathan' (Electric)
+STR_8055_LEV2_CYCLOPS_ELECTRIC                                  :Lev2 'Cyclops' (Electric)
+STR_8056_LEV3_PEGASUS_ELECTRIC                                  :Lev3 'Pegasus' (Electric)
+STR_8057_LEV4_CHIMAERA_ELECTRIC                                 :Lev4 'Chimaera' (Electric)
+STR_8058_WIZZOWOW_ROCKETEER                                     :Wizzowow Rocketeer
+STR_8059_PASSENGER_CAR                                          :Passenger Car
+STR_805A_MAIL_VAN                                               :Mail Van
+STR_805B_COAL_CAR                                               :Coal Car
+STR_805C_OIL_TANKER                                             :Oil Tanker
+STR_805D_LIVESTOCK_VAN                                          :Livestock Van
+STR_805E_GOODS_VAN                                              :Goods Van
+STR_805F_GRAIN_HOPPER                                           :Grain Hopper
+STR_8060_WOOD_TRUCK                                             :Wood Truck
+STR_8061_IRON_ORE_HOPPER                                        :Iron Ore Hopper
+STR_8062_STEEL_TRUCK                                            :Steel Truck
+STR_8063_ARMORED_VAN                                            :Armored Van
+STR_8064_FOOD_VAN                                               :Food Van
+STR_8065_PAPER_TRUCK                                            :Paper Truck
+STR_8066_COPPER_ORE_HOPPER                                      :Copper Ore Hopper
+STR_8067_WATER_TANKER                                           :Water Tanker
+STR_8068_FRUIT_TRUCK                                            :Fruit Truck
+STR_8069_RUBBER_TRUCK                                           :Rubber Truck
+STR_806A_SUGAR_TRUCK                                            :Sugar Truck
+STR_806B_COTTON_CANDY_HOPPER                                    :Cotton Candy Hopper
+STR_806C_TOFFEE_HOPPER                                          :Toffee Hopper
+STR_806D_BUBBLE_VAN                                             :Bubble Van
+STR_806E_COLA_TANKER                                            :Cola Tanker
+STR_806F_CANDY_VAN                                              :Candy Van
+STR_8070_TOY_VAN                                                :Toy Van
+STR_8071_BATTERY_TRUCK                                          :Battery Truck
+STR_8072_FIZZY_DRINK_TRUCK                                      :Fizzy Drink Truck
+STR_8073_PLASTIC_TRUCK                                          :Plastic Truck
+STR_8074_MPS_REGAL_BUS                                          :MPS Regal Bus
+STR_8075_HEREFORD_LEOPARD_BUS                                   :Hereford Leopard Bus
+STR_8076_FOSTER_BUS                                             :Foster Bus
+STR_8077_FOSTER_MKII_SUPERBUS                                   :Foster MkII Superbus
+STR_8078_PLODDYPHUT_MKI_BUS                                     :Ploddyphut MkI Bus
+STR_8079_PLODDYPHUT_MKII_BUS                                    :Ploddyphut MkII Bus
+STR_807A_PLODDYPHUT_MKIII_BUS                                   :Ploddyphut MkIII Bus
+STR_807B_BALOGH_COAL_TRUCK                                      :Balogh Coal Truck
+STR_807C_UHL_COAL_TRUCK                                         :Uhl Coal Truck
+STR_807D_DW_COAL_TRUCK                                          :DW Coal Truck
+STR_807E_MPS_MAIL_TRUCK                                         :MPS Mail Truck
+STR_807F_REYNARD_MAIL_TRUCK                                     :Reynard Mail Truck
+STR_8080_PERRY_MAIL_TRUCK                                       :Perry Mail Truck
+STR_8081_MIGHTYMOVER_MAIL_TRUCK                                 :MightyMover Mail Truck
+STR_8082_POWERNAUGHT_MAIL_TRUCK                                 :Powernaught Mail Truck
+STR_8083_WIZZOWOW_MAIL_TRUCK                                    :Wizzowow Mail Truck
+STR_8084_WITCOMBE_OIL_TANKER                                    :Witcombe Oil Tanker
+STR_8085_FOSTER_OIL_TANKER                                      :Foster Oil Tanker
+STR_8086_PERRY_OIL_TANKER                                       :Perry Oil Tanker
+STR_8087_TALBOTT_LIVESTOCK_VAN                                  :Talbott Livestock Van
+STR_8088_UHL_LIVESTOCK_VAN                                      :Uhl Livestock Van
+STR_8089_FOSTER_LIVESTOCK_VAN                                   :Foster Livestock Van
+STR_808A_BALOGH_GOODS_TRUCK                                     :Balogh Goods Truck
+STR_808B_CRAIGHEAD_GOODS_TRUCK                                  :Craighead Goods Truck
+STR_808C_GOSS_GOODS_TRUCK                                       :Goss Goods Truck
+STR_808D_HEREFORD_GRAIN_TRUCK                                   :Hereford Grain Truck
+STR_808E_THOMAS_GRAIN_TRUCK                                     :Thomas Grain Truck
+STR_808F_GOSS_GRAIN_TRUCK                                       :Goss Grain Truck
+STR_8090_WITCOMBE_WOOD_TRUCK                                    :Witcombe Wood Truck
+STR_8091_FOSTER_WOOD_TRUCK                                      :Foster Wood Truck
+STR_8092_MORELAND_WOOD_TRUCK                                    :Moreland Wood Truck
+STR_8093_MPS_IRON_ORE_TRUCK                                     :MPS Iron Ore Truck
+STR_8094_UHL_IRON_ORE_TRUCK                                     :Uhl Iron Ore Truck
+STR_8095_CHIPPY_IRON_ORE_TRUCK                                  :Chippy Iron Ore Truck
+STR_8096_BALOGH_STEEL_TRUCK                                     :Balogh Steel Truck
+STR_8097_UHL_STEEL_TRUCK                                        :Uhl Steel Truck
+STR_8098_KELLING_STEEL_TRUCK                                    :Kelling Steel Truck
+STR_8099_BALOGH_ARMORED_TRUCK                                   :Balogh Armored Truck
+STR_809A_UHL_ARMORED_TRUCK                                      :Uhl Armored Truck
+STR_809B_FOSTER_ARMORED_TRUCK                                   :Foster Armored Truck
+STR_809C_FOSTER_FOOD_VAN                                        :Foster Food Van
+STR_809D_PERRY_FOOD_VAN                                         :Perry Food Van
+STR_809E_CHIPPY_FOOD_VAN                                        :Chippy Food Van
+STR_809F_UHL_PAPER_TRUCK                                        :Uhl Paper Truck
+STR_80A0_BALOGH_PAPER_TRUCK                                     :Balogh Paper Truck
+STR_80A1_MPS_PAPER_TRUCK                                        :MPS Paper Truck
+STR_80A2_MPS_COPPER_ORE_TRUCK                                   :MPS Copper Ore Truck
+STR_80A3_UHL_COPPER_ORE_TRUCK                                   :Uhl Copper Ore Truck
+STR_80A4_GOSS_COPPER_ORE_TRUCK                                  :Goss Copper Ore Truck
+STR_80A5_UHL_WATER_TANKER                                       :Uhl Water Tanker
+STR_80A6_BALOGH_WATER_TANKER                                    :Balogh Water Tanker
+STR_80A7_MPS_WATER_TANKER                                       :MPS Water Tanker
+STR_80A8_BALOGH_FRUIT_TRUCK                                     :Balogh Fruit Truck
+STR_80A9_UHL_FRUIT_TRUCK                                        :Uhl Fruit Truck
+STR_80AA_KELLING_FRUIT_TRUCK                                    :Kelling Fruit Truck
+STR_80AB_BALOGH_RUBBER_TRUCK                                    :Balogh Rubber Truck
+STR_80AC_UHL_RUBBER_TRUCK                                       :Uhl Rubber Truck
+STR_80AD_RMT_RUBBER_TRUCK                                       :RMT Rubber Truck
+STR_80AE_MIGHTYMOVER_SUGAR_TRUCK                                :MightyMover Sugar Truck
+STR_80AF_POWERNAUGHT_SUGAR_TRUCK                                :Powernaught Sugar Truck
+STR_80B0_WIZZOWOW_SUGAR_TRUCK                                   :Wizzowow Sugar Truck
+STR_80B1_MIGHTYMOVER_COLA_TRUCK                                 :MightyMover Cola Truck
+STR_80B2_POWERNAUGHT_COLA_TRUCK                                 :Powernaught Cola Truck
+STR_80B3_WIZZOWOW_COLA_TRUCK                                    :Wizzowow Cola Truck
+STR_80B4_MIGHTYMOVER_COTTON_CANDY                               :MightyMover Cotton Candy Truck
+STR_80B5_POWERNAUGHT_COTTON_CANDY                               :Powernaught Cotton Candy Truck
+STR_80B6_WIZZOWOW_COTTON_CANDY_TRUCK                            :Wizzowow Cotton Candy Truck
+STR_80B7_MIGHTYMOVER_TOFFEE_TRUCK                               :MightyMover Toffee Truck
+STR_80B8_POWERNAUGHT_TOFFEE_TRUCK                               :Powernaught Toffee Truck
+STR_80B9_WIZZOWOW_TOFFEE_TRUCK                                  :Wizzowow Toffee Truck
+STR_80BA_MIGHTYMOVER_TOY_VAN                                    :MightyMover Toy Van
+STR_80BB_POWERNAUGHT_TOY_VAN                                    :Powernaught Toy Van
+STR_80BC_WIZZOWOW_TOY_VAN                                       :Wizzowow Toy Van
+STR_80BD_MIGHTYMOVER_CANDY_TRUCK                                :MightyMover Candy Truck
+STR_80BE_POWERNAUGHT_CANDY_TRUCK                                :Powernaught Candy Truck
+STR_80BF_WIZZOWOW_CANDY_TRUCK                                   :Wizzowow Candy Truck
+STR_80C0_MIGHTYMOVER_BATTERY_TRUCK                              :MightyMover Battery Truck
+STR_80C1_POWERNAUGHT_BATTERY_TRUCK                              :Powernaught Battery Truck
+STR_80C2_WIZZOWOW_BATTERY_TRUCK                                 :Wizzowow Battery Truck
+STR_80C3_MIGHTYMOVER_FIZZY_DRINK                                :MightyMover Fizzy Drink Truck
+STR_80C4_POWERNAUGHT_FIZZY_DRINK                                :Powernaught Fizzy Drink Truck
+STR_80C5_WIZZOWOW_FIZZY_DRINK_TRUCK                             :Wizzowow Fizzy Drink Truck
+STR_80C6_MIGHTYMOVER_PLASTIC_TRUCK                              :MightyMover Plastic Truck
+STR_80C7_POWERNAUGHT_PLASTIC_TRUCK                              :Powernaught Plastic Truck
+STR_80C8_WIZZOWOW_PLASTIC_TRUCK                                 :Wizzowow Plastic Truck
+STR_80C9_MIGHTYMOVER_BUBBLE_TRUCK                               :MightyMover Bubble Truck
+STR_80CA_POWERNAUGHT_BUBBLE_TRUCK                               :Powernaught Bubble Truck
+STR_80CB_WIZZOWOW_BUBBLE_TRUCK                                  :Wizzowow Bubble Truck
+STR_80CC_MPS_OIL_TANKER                                         :MPS Oil Tanker
+STR_80CD_CS_INC_OIL_TANKER                                      :CS-Inc. Oil Tanker
+STR_80CE_MPS_PASSENGER_FERRY                                    :MPS Passenger Ferry
+STR_80CF_FFP_PASSENGER_FERRY                                    :FFP Passenger Ferry
+STR_80D0_BAKEWELL_300_HOVERCRAFT                                :Bakewell 300 Hovercraft
+STR_80D1_CHUGGER_CHUG_PASSENGER                                 :Chugger-Chug Passenger Ferry
+STR_80D2_SHIVERSHAKE_PASSENGER_FERRY                            :Shivershake Passenger Ferry
+STR_80D3_YATE_CARGO_SHIP                                        :Yate Cargo ship
+STR_80D4_BAKEWELL_CARGO_SHIP                                    :Bakewell Cargo ship
+STR_80D5_MIGHTYMOVER_CARGO_SHIP                                 :Mightymover Cargo ship
+STR_80D6_POWERNAUT_CARGO_SHIP                                   :Powernaut Cargo ship
+STR_80D7_SAMPSON_U52                                            :Sampson U52
+STR_80D8_COLEMAN_COUNT                                          :Coleman Count
+STR_80D9_FFP_DART                                               :FFP Dart
+STR_80DA_YATE_HAUGAN                                            :Yate Haugan
+STR_80DB_BAKEWELL_COTSWALD_LB_3                                 :Bakewell Cotswald LB-3
+STR_80DC_BAKEWELL_LUCKETT_LB_8                                  :Bakewell Luckett LB-8
+STR_80DD_BAKEWELL_LUCKETT_LB_9                                  :Bakewell Luckett LB-9
+STR_80DE_BAKEWELL_LUCKETT_LB80                                  :Bakewell Luckett LB80
+STR_80DF_BAKEWELL_LUCKETT_LB_10                                 :Bakewell Luckett LB-10
+STR_80E0_BAKEWELL_LUCKETT_LB_11                                 :Bakewell Luckett LB-11
+STR_80E1_YATE_AEROSPACE_YAC_1_11                                :Yate Aerospace YAC 1-11
+STR_80E2_DARWIN_100                                             :Darwin 100
+STR_80E3_DARWIN_200                                             :Darwin 200
+STR_80E4_DARWIN_300                                             :Darwin 300
+STR_80E5_DARWIN_400                                             :Darwin 400
+STR_80E6_DARWIN_500                                             :Darwin 500
+STR_80E7_DARWIN_600                                             :Darwin 600
+STR_80E8_GURU_GALAXY                                            :Guru Galaxy
+STR_80E9_AIRTAXI_A21                                            :Airtaxi A21
+STR_80EA_AIRTAXI_A31                                            :Airtaxi A31
+STR_80EB_AIRTAXI_A32                                            :Airtaxi A32
+STR_80EC_AIRTAXI_A33                                            :Airtaxi A33
+STR_80ED_YATE_AEROSPACE_YAE46                                   :Yate Aerospace YAe46
+STR_80EE_DINGER_100                                             :Dinger 100
+STR_80EF_AIRTAXI_A34_1000                                       :AirTaxi A34-1000
+STR_80F0_YATE_Z_SHUTTLE                                         :Yate Z-Shuttle
+STR_80F1_KELLING_K1                                             :Kelling K1
+STR_80F2_KELLING_K6                                             :Kelling K6
+STR_80F3_KELLING_K7                                             :Kelling K7
+STR_80F4_DARWIN_700                                             :Darwin 700
+STR_80F5_FFP_HYPERDART_2                                        :FFP Hyperdart 2
+STR_80F6_DINGER_200                                             :Dinger 200
+STR_80F7_DINGER_1000                                            :Dinger 1000
+STR_80F8_PLODDYPHUT_100                                         :Ploddyphut 100
+STR_80F9_PLODDYPHUT_500                                         :Ploddyphut 500
+STR_80FA_FLASHBANG_X1                                           :Flashbang X1
+STR_80FB_JUGGERPLANE_M1                                         :Juggerplane M1
+STR_80FC_FLASHBANG_WIZZER                                       :Flashbang Wizzer
+STR_80FD_TRICARIO_HELICOPTER                                    :Tricario Helicopter
+STR_80FE_GURU_X2_HELICOPTER                                     :Guru X2 Helicopter
+STR_80FF_POWERNAUT_HELICOPTER                                   :Powernaut Helicopter
+STR_8100_MESSAGE_FROM_VEHICLE_MANUFACTURE                       :{WHITE}Message from vehicle manufacturer
+STR_8101_WE_HAVE_JUST_DESIGNED_A                                :{GOLD}We have just designed a new {STRING} - would you be interested in a year's exclusive use of this vehicle, so we can see how it performs before making it universally available ?
+STR_8102_RAILROAD_LOCOMOTIVE                                    :railroad locomotive
+STR_8103_ROAD_VEHICLE                                           :road vehicle
+STR_8104_AIRCRAFT                                               :aircraft
+STR_8105_SHIP                                                   :ship
+STR_8106_MONORAIL_LOCOMOTIVE                                    :monorail locomotive
+STR_8107_MAGLEV_LOCOMOTIVE                                      :maglev locomotive
+
+##id 0x8800
+STR_8800_TRAIN_DEPOT                                            :{WHITE}{TOWN} Train Depot
+STR_8801_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Citizens celebrate . . .{}First train arrives at {STATION}!
+STR_8802_DETAILS                                                :{WHITE}{VEHICLE} (Details)
+STR_8803_TRAIN_IN_THE_WAY                                       :{WHITE}Train in the way
+STR_8804                                                        :{SETX 10}{COMMA}: {STRING} {STRING}
+STR_8805                                                        :{RIGHTARROW}{SETX 10}{COMMA}: {STRING} {STRING}
+STR_8806_GO_TO                                                  :Go to {STATION}
+STR_8807_GO_TO_TRANSFER                                         :Go to {STATION} (Transfer and take cargo)
+STR_8808_GO_TO_UNLOAD                                           :Go to {STATION} (Unload)
+STR_8809_GO_TO_TRANSFER_UNLOAD                                  :Go to {STATION} (Transfer and leave empty)
+STR_880A_GO_TO_LOAD                                             :Go to {STATION} (Load)
+STR_880B_GO_TO_TRANSFER_LOAD                                    :Go to {STATION} (Transfer and wait for full load)
+STR_880C_GO_NON_STOP_TO                                         :Go non-stop to {STATION}
+STR_880D_GO_TO_NON_STOP_TRANSFER                                :Go non-stop to {STATION} (Transfer and take cargo)
+STR_880E_GO_NON_STOP_TO_UNLOAD                                  :Go non-stop to {STATION} (Unload)
+STR_880F_GO_TO_NON_STOP_TRANSFER_UNLOAD                         :Go non-stop to {STATION} (Transfer and leave empty)
+STR_8810_GO_NON_STOP_TO_LOAD                                    :Go non-stop to {STATION} (Load)
+STR_8811_GO_TO_NON_STOP_TRANSFER_LOAD                           :Go non-stop to {STATION} (Transfer and wait for full load)
+STR_GO_TO_TRAIN_DEPOT                                           :Go to {TOWN} Train Depot
+STR_SERVICE_AT_TRAIN_DEPOT                                      :Service at {TOWN} Train Depot
+STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT                             :Go non-stop to {TOWN} Train Depot
+STR_SERVICE_NON_STOP_AT_TRAIN_DEPOT                             :Service non-stop at {TOWN} Train Depot
+
+STR_TIMETABLE_GO_TO                                             :{STRING} {STRING}
+STR_TIMETABLE_TRAVEL_NOT_TIMETABLED                             :Travel (not timetabled)
+STR_TIMETABLE_TRAVEL_FOR                                        :Travel for {STRING}
+STR_TIMETABLE_STAY_FOR                                          :and stay for {STRING}
+STR_TIMETABLE_DAYS                                              :{COMMA} day{P "" s}
+STR_TIMETABLE_TICKS                                             :{COMMA} tick{P "" s}
+
+STR_HEADING_FOR_TRAIN_DEPOT                                     :{ORANGE}Heading for {TOWN} Train Depot
+STR_HEADING_FOR_TRAIN_DEPOT_VEL                                 :{ORANGE}Heading for {TOWN} Train Depot, {VELOCITY}
+STR_HEADING_FOR_TRAIN_DEPOT_SERVICE                             :{LTBLUE}Service at {TOWN} Train Depot
+STR_HEADING_FOR_TRAIN_DEPOT_SERVICE_VEL                         :{LTBLUE}Service at {TOWN} Train Depot, {VELOCITY}
+
+STR_INVALID_ORDER                                               :{RED} (Invalid Order)
+
+STR_UNKNOWN_DESTINATION                                         :unknown destination
+STR_8812_EMPTY                                                  :{LTBLUE}Empty
+STR_8813_FROM                                                   :{LTBLUE}{CARGO} from {STATION}
+STR_FROM_MULT                                                   :{LTBLUE}{CARGO} from {STATION} (x{NUM})
+STR_8814_TRAIN_IS_WAITING_IN_DEPOT                              :{WHITE}Train {COMMA} is waiting in depot
+STR_8815_NEW_VEHICLES                                           :{BLACK}New Vehicles
+STR_8816                                                        :{BLACK}-
+STR_8819_TRAIN_TOO_LONG                                         :{WHITE}Train too long
+STR_881A_TRAINS_CAN_ONLY_BE_ALTERED                             :{WHITE}Trains can only be altered when stopped inside a depot
+STR_881B_TRAINS                                                 :{WHITE}{COMPANY} - {COMMA} Train{P "" s}
+
+STR_881C_NEW_RAIL_VEHICLES                                      :{WHITE}New Rail Vehicles
+STR_NEW_ELRAIL_VEHICLES                                         :{WHITE}New Electric Rail Vehicles
+STR_881D_NEW_MONORAIL_VEHICLES                                  :{WHITE}New Monorail Vehicles
+STR_881E_NEW_MAGLEV_VEHICLES                                    :{WHITE}New Maglev Vehicles
+STR_ALL_AVAIL_RAIL_VEHICLES                                     :{WHITE}Rail Vehicles
+
+STR_881F_BUILD_VEHICLE                                          :{BLACK}Build Vehicle
+STR_CLONE_ROAD_VEHICLE                                          :{BLACK}Clone Vehicle
+STR_CLONE_ROAD_VEHICLE_INFO                                     :{BLACK}This will build a copy of the road vehicle. Control-click will share the orders
+STR_CLONE_ROAD_VEHICLE_DEPOT_INFO                               :{BLACK}This will build a copy of a road vehicle. Click this button and then on a road vehicle inside or outside the depot. Control-click will share the orders
+STR_CLONE_TRAIN                                                 :{BLACK}Clone Train
+STR_CLONE_TRAIN_INFO                                            :{BLACK}This will build a copy of the train including all cars. Control-click will share the orders
+STR_CLONE_TRAIN_DEPOT_INFO                                      :{BLACK}This will build a copy of a train including all cars. Click this button and then on a train inside or outside the depot. Control-click will share the orders
+STR_8820_RENAME                                                 :{BLACK}Rename
+STR_8823_SKIP                                                   :{BLACK}Skip
+STR_8824_DELETE                                                 :{BLACK}Delete
+STR_8825_NON_STOP                                               :{BLACK}Non-Stop
+STR_8826_GO_TO                                                  :{BLACK}Go To
+STR_8827_FULL_LOAD                                              :{BLACK}Full Load
+STR_8828_UNLOAD                                                 :{BLACK}Unload
+STR_REFIT                                                       :{BLACK}Refit
+STR_REFIT_TIP                                                   :{BLACK}Select what cargo type to refit to in this order. Control click to remove refit instruction
+STR_REFIT_ORDER                                                 :(Refit to {STRING})
+STR_TIMETABLE_VIEW                                              :{BLACK}Timetable
+STR_TIMETABLE_VIEW_TOOLTIP                                      :{BLACK}Switch to the timetable view
+STR_8829_ORDERS                                                 :{WHITE}{VEHICLE} (Orders)
+STR_882A_END_OF_ORDERS                                          :{SETX 10}- - End of Orders - -
+STR_FULLLOAD_OR_SERVICE                                         :{SKIP}{SKIP}{STRING}
+STR_SERVICE                                                     :{BLACK}Service
+STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE                           :{WHITE}Can't build railroad vehicle...
+STR_882C_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Built: {LTBLUE}{NUM}{BLACK} Value: {LTBLUE}{CURRENCY}
+STR_882D_VALUE                                                  :{LTBLUE}{ENGINE}{BLACK}   Value: {LTBLUE}{CURRENCY}
+STR_882E                                                        :{WHITE}{VEHICLE}
+STR_882F_LOADING_UNLOADING                                      :{LTBLUE}Loading / Unloading
+STR_TRAIN_MUST_BE_STOPPED                                       :{WHITE}Train must be stopped inside a depot
+STR_8830_CAN_T_SEND_TRAIN_TO_DEPOT                              :{WHITE}Can't send train to depot...
+STR_8831_NO_MORE_SPACE_FOR_ORDERS                               :{WHITE}No more space for orders
+STR_8832_TOO_MANY_ORDERS                                        :{WHITE}Too many orders
+STR_8833_CAN_T_INSERT_NEW_ORDER                                 :{WHITE}Can't insert new order...
+STR_8834_CAN_T_DELETE_THIS_ORDER                                :{WHITE}Can't delete this order...
+STR_8835_CAN_T_MODIFY_THIS_ORDER                                :{WHITE}Can't modify this order...
+STR_CAN_T_MOVE_THIS_ORDER                                       :{WHITE}Can't move this order...
+STR_CAN_T_SKIP_ORDER                                            :{WHITE}Can't skip current order...
+STR_CAN_T_SKIP_TO_ORDER                                         :{WHITE}Can't skip to selected order...
+STR_8837_CAN_T_MOVE_VEHICLE                                     :{WHITE}Can't move vehicle...
+STR_REAR_ENGINE_FOLLOW_FRONT_ERROR                              :{WHITE}The rear engine will always follow its front counterpart
+STR_8838_N_A                                                    :N/A{SKIP}
+STR_8839_CAN_T_SELL_RAILROAD_VEHICLE                            :{WHITE}Can't sell railroad vehicle...
+STR_883A_UNABLE_TO_FIND_ROUTE_TO                                :{WHITE}Unable to find route to local depot
+STR_883B_CAN_T_STOP_START_TRAIN                                 :{WHITE}Can't stop/start train...
+STR_883C_SERVICING_INTERVAL_DAYS                                :{BLACK}Servicing interval: {LTBLUE}{COMMA}days{BLACK}   Last service: {LTBLUE}{DATE_LONG}
+STR_SERVICING_INTERVAL_PERCENT                                  :{BLACK}Servicing interval: {LTBLUE}{COMMA}%{BLACK}   Last service: {LTBLUE}{DATE_LONG}
+STR_883D_TRAINS_CLICK_ON_TRAIN_FOR                              :{BLACK}Trains - click on train for information
+STR_883E_BUILD_NEW_TRAINS_REQUIRES                              :{BLACK}Build new trains (requires train depot)
+STR_883F_TRAINS_CLICK_ON_TRAIN_FOR                              :{BLACK}Trains - click on train for info., drag vehicle to add/remove from train
+STR_8840_BUILD_NEW_TRAIN_VEHICLE                                :{BLACK}Build new train vehicle
+STR_8841_DRAG_TRAIN_VEHICLE_TO_HERE                             :{BLACK}Drag train vehicle to here to sell it
+STR_8842_CENTER_MAIN_VIEW_ON_TRAIN                              :{BLACK}Center main view on train depot location
+STR_8843_TRAIN_VEHICLE_SELECTION                                :{BLACK}Train vehicle selection list - click on vehicle for information
+STR_8844_BUILD_THE_HIGHLIGHTED_TRAIN                            :{BLACK}Build the highlighted train vehicle
+STR_8845_RENAME_TRAIN_VEHICLE_TYPE                              :{BLACK}Rename train vehicle type
+STR_8846_CURRENT_TRAIN_ACTION_CLICK                             :{BLACK}Current train action - click here to stop/start train
+STR_8847_SHOW_TRAIN_S_ORDERS                                    :{BLACK}Show train's orders
+STR_8848_CENTER_MAIN_VIEW_ON_TRAIN                              :{BLACK}Center main view on train's location
+STR_8849_SEND_TRAIN_TO_DEPOT                                    :{BLACK}Send train to depot
+STR_884A_FORCE_TRAIN_TO_PROCEED                                 :{BLACK}Force train to proceed without waiting for signal to clear
+STR_884B_REVERSE_DIRECTION_OF_TRAIN                             :{BLACK}Reverse direction of train
+STR_884C_SHOW_TRAIN_DETAILS                                     :{BLACK}Show train details
+STR_884D_INCREASE_SERVICING_INTERVAL                            :{BLACK}Increase servicing interval
+STR_884E_DECREASE_SERVICING_INTERVAL                            :{BLACK}Decrease servicing interval
+STR_884F_SHOW_DETAILS_OF_CARGO_CARRIED                          :{BLACK}Show details of cargo carried
+STR_8850_SHOW_DETAILS_OF_TRAIN_VEHICLES                         :{BLACK}Show details of train vehicles
+STR_8851_SHOW_CAPACITIES_OF_EACH                                :{BLACK}Show capacities of each vehicle
+STR_8852_SHOW_TOTAL_CARGO                                       :{BLACK}Show total capacity of train, split by cargo type
+STR_8852_ORDERS_LIST_CLICK_ON_ORDER                             :{BLACK}Orders list - click on order to highlight it
+STR_8853_SKIP_THE_CURRENT_ORDER                                 :{BLACK}Skip the current order, and start the next. CTRL + click skips to the selected order)
+STR_8854_DELETE_THE_HIGHLIGHTED                                 :{BLACK}Delete the highlighted order
+STR_8855_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Make the highlighted order non-stop
+STR_8856_INSERT_A_NEW_ORDER_BEFORE                              :{BLACK}Insert a new order before the highlighted order, or add to end of list
+STR_8857_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Make the highlighted order force the vehicle to wait for a full load
+STR_8858_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Make the highlighted order force the vehicle to unload
+STR_TIMETABLE_TOOLTIP                                           :{BLACK}Timetable - click on an order to highlight it.
+STR_TIMETABLE_WAIT_TIME_TOOLTIP                                 :{BLACK}Change the amount of time that the highlighted order should take
+STR_TIMETABLE_CLEAR_TIME_TOOLTIP                                :{BLACK}Clear the amount of time for the highlighted order
+STR_TIMETABLE_RESET_LATENESS_TOOLTIP                            :{BLACK}Reset the lateness counter, so the vehicle will be on time
+STR_SERVICE_HINT                                                :{BLACK}Skip this order unless a service is needed
+STR_VEHICLE_INFO_COST_WEIGHT_SPEED_POWER                        :{BLACK}Cost: {CURRENCY} Weight: {WEIGHT_S}{}Speed: {VELOCITY}  Power: {POWER}{}Running Cost: {CURRENCY}/yr{}Capacity: {CARGO}
+STR_885C_BROKEN_DOWN                                            :{RED}Broken down
+STR_885D_AGE_RUNNING_COST_YR                                    :{BLACK}Age: {LTBLUE}{STRING}{BLACK}   Running Cost: {LTBLUE}{CURRENCY}/yr
+STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED                         :{BLACK}Weight: {LTBLUE}{WEIGHT_S}  {BLACK}Power: {LTBLUE}{POWER}{BLACK} Max. speed: {LTBLUE}{VELOCITY}
+STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE                  :{BLACK}Weight: {LTBLUE}{WEIGHT_S} {BLACK}Power: {LTBLUE}{POWER}{BLACK} Max. speed: {LTBLUE}{VELOCITY} {BLACK}Max. T.E.: {LTBLUE}{FORCE}
+STR_885F_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Profit this year: {LTBLUE}{CURRENCY}  (last year: {CURRENCY})
+STR_8860_RELIABILITY_BREAKDOWNS                                 :{BLACK}Reliability: {LTBLUE}{COMMA}%  {BLACK}Breakdowns since last service: {LTBLUE}{COMMA}
+STR_8861_STOPPED                                                :{RED}Stopped
+STR_8862_CAN_T_MAKE_TRAIN_PASS_SIGNAL                           :{WHITE}Can't make train pass signal at danger...
+STR_8863_CRASHED                                                :{RED}Crashed!
+
+STR_8865_NAME_TRAIN                                             :{WHITE}Name train
+STR_8866_CAN_T_NAME_TRAIN                                       :{WHITE}Can't name train...
+STR_8867_NAME_TRAIN                                             :{BLACK}Name train
+STR_8868_TRAIN_CRASH_DIE_IN_FIREBALL                            :{BLACK}{BIGFONT}Train Crash!{}{COMMA} die in fireball after collision
+STR_8869_CAN_T_REVERSE_DIRECTION                                :{WHITE}Can't reverse direction of train...
+STR_886A_RENAME_TRAIN_VEHICLE_TYPE                              :{WHITE}Rename train vehicle type
+STR_886B_CAN_T_RENAME_TRAIN_VEHICLE                             :{WHITE}Can't rename train vehicle type...
+STR_886D_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Make the highlighted order force the vehicle to dump cargo
+STR_886F_TRANSFER                                               :{BLACK}Transfer
+STR_CLEAR_TIME                                                  :{BLACK}Clear Time
+STR_RESET_LATENESS                                              :{BLACK}Reset Late Counter
+
+STR_TRAIN_STOPPING                                              :{RED}Stopping
+STR_TRAIN_STOPPING_VEL                                          :{RED}Stopping, {VELOCITY}
+STR_INCOMPATIBLE_RAIL_TYPES                                     :Incompatible rail types
+STR_TRAIN_NO_POWER                                              :{RED}No power
+STR_TRAIN_START_NO_CATENARY                                     :This track lacks catenary, so the train can't start
+
+STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}New {STRING} now available!
+STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{ENGINE}
+STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}New {STRING} now available!  -  {ENGINE}
+
+STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Can't sell destroyed vehicle...
+
+STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Can't timetable vehicle...
+STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Vehicles can only wait at stations.
+STR_TIMETABLE_NOT_STOPPING_HERE                                 :{WHITE}This vehicle is not stopping at this station.
+STR_TIMETABLE_CHANGE_TIME                                       :{BLACK}Change Time
+STR_TIMETABLE_STATUS_ON_TIME                                    :This vehicle is currently running on time
+STR_TIMETABLE_STATUS_LATE                                       :This vehicle is currently running {STRING} late
+STR_TIMETABLE_STATUS_EARLY                                      :This vehicle is currently running {STRING} early
+STR_TIMETABLE_TOTAL_TIME                                        :This timetable will take {STRING} to complete
+STR_TIMETABLE_TOTAL_TIME_INCOMPLETE                             :This timetable will take at least {STRING} to complete (not all timetabled)
+STR_TIMETABLE_AUTOFILL                                          :{BLACK}Autofill
+STR_TIMETABLE_AUTOFILL_TOOLTIP                                  :{BLACK}Fill the timetable automatically with the values from the first journey
+
+##id 0x9000
+STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Road vehicle in the way
+STR_9001_ROAD_VEHICLES                                          :{WHITE}{COMPANY} - {COMMA} Road Vehicle{P "" s}
+STR_9002                                                        :{WHITE}{VEHICLE}
+STR_9003_ROAD_VEHICLE_DEPOT                                     :{WHITE}{TOWN} Road Vehicle Depot
+STR_9004_NEW_VEHICLES                                           :{BLACK}New Vehicles
+STR_9006_NEW_ROAD_VEHICLES                                      :{WHITE}New Road Vehicles
+STR_9007_BUILD_VEHICLE                                          :{BLACK}Build Vehicle
+STR_9009_CAN_T_BUILD_ROAD_VEHICLE                               :{WHITE}Can't build road vehicle...
+STR_900C_DETAILS                                                :{WHITE}{VEHICLE} (Details)
+STR_900D_AGE_RUNNING_COST_YR                                    :{BLACK}Age: {LTBLUE}{STRING}{BLACK}   Running Cost: {LTBLUE}{CURRENCY}/yr
+STR_900E_MAX_SPEED                                              :{BLACK}Max. speed: {LTBLUE}{VELOCITY}
+STR_900F_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Profit this year: {LTBLUE}{CURRENCY}  (last year: {CURRENCY})
+STR_9010_RELIABILITY_BREAKDOWNS                                 :{BLACK}Reliability: {LTBLUE}{COMMA}%  {BLACK}Breakdowns since last service: {LTBLUE}{COMMA}
+STR_9011_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Built: {LTBLUE}{NUM}{BLACK} Value: {LTBLUE}{CURRENCY}
+STR_9012_CAPACITY                                               :{BLACK}Capacity: {LTBLUE}{CARGO}
+STR_9013_MUST_BE_STOPPED_INSIDE                                 :{WHITE}...must be stopped inside a road vehicle depot
+STR_9014_CAN_T_SELL_ROAD_VEHICLE                                :{WHITE}Can't sell road vehicle...
+STR_9015_CAN_T_STOP_START_ROAD_VEHICLE                          :{WHITE}Can't stop/start road vehicle...
+STR_9016_ROAD_VEHICLE_IS_WAITING                                :{WHITE}Road Vehicle {COMMA} is waiting in depot
+STR_HEADING_FOR_ROAD_DEPOT                                      :{ORANGE}Heading for {TOWN} Road Depot
+STR_HEADING_FOR_ROAD_DEPOT_VEL                                  :{ORANGE}Heading for {TOWN} Road Depot, {VELOCITY}
+STR_HEADING_FOR_ROAD_DEPOT_SERVICE                              :{LTBLUE}Service at {TOWN} Road Depot
+STR_HEADING_FOR_ROAD_DEPOT_SERVICE_VEL                          :{LTBLUE}Service at {TOWN} Road Depot, {VELOCITY}
+STR_9018_CAN_T_SEND_VEHICLE_TO_DEPOT                            :{WHITE}Can't send vehicle to depot...
+STR_9019_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Unable to find local depot
+STR_901A_ROAD_VEHICLES_CLICK_ON                                 :{BLACK}Road vehicles - click on vehicle for information
+STR_901B_BUILD_NEW_ROAD_VEHICLES                                :{BLACK}Build new road vehicles (requires road vehicle depot)
+STR_901C_CURRENT_VEHICLE_ACTION                                 :{BLACK}Current vehicle action - click here to stop/start vehicle
+STR_901D_SHOW_VEHICLE_S_ORDERS                                  :{BLACK}Show vehicle's orders
+STR_901E_CENTER_MAIN_VIEW_ON_VEHICLE                            :{BLACK}Center main view on vehicle's location
+STR_901F_SEND_VEHICLE_TO_DEPOT                                  :{BLACK}Send vehicle to depot
+STR_9020_FORCE_VEHICLE_TO_TURN_AROUND                           :{BLACK}Force vehicle to turn around
+STR_9021_SHOW_ROAD_VEHICLE_DETAILS                              :{BLACK}Show road vehicle details
+STR_9022_VEHICLES_CLICK_ON_VEHICLE                              :{BLACK}Vehicles - click on vehicle for information
+STR_9023_BUILD_NEW_ROAD_VEHICLE                                 :{BLACK}Build new road vehicle
+STR_9024_DRAG_ROAD_VEHICLE_TO_HERE                              :{BLACK}Drag road vehicle to here to sell it
+STR_9025_CENTER_MAIN_VIEW_ON_ROAD                               :{BLACK}Center main view on road vehicle depot location
+STR_9026_ROAD_VEHICLE_SELECTION                                 :{BLACK}Road vehicle selection list - click on vehicle for information
+STR_9027_BUILD_THE_HIGHLIGHTED_ROAD                             :{BLACK}Build the highlighted road vehicle
+STR_902A_COST_SPEED_RUNNING_COST                                :{BLACK}Cost: {CURRENCY}{}Speed: {VELOCITY}{}Running Cost: {CURRENCY}/yr{}Capacity: {CARGO}
+STR_ARTICULATED_RV_CAPACITY                                     :{BLACK}Capacity: {LTBLUE}
+STR_BARE_CARGO                                                  :{CARGO}
+
+STR_902C_NAME_ROAD_VEHICLE                                      :{WHITE}Name road vehicle
+STR_902D_CAN_T_NAME_ROAD_VEHICLE                                :{WHITE}Can't name road vehicle...
+STR_902E_NAME_ROAD_VEHICLE                                      :{BLACK}Name road vehicle
+STR_902F_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Citizens celebrate . . .{}First bus arrives at {STATION}!
+STR_9030_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Citizens celebrate . . .{}First truck arrives at {STATION}!
+STR_902F_CITIZENS_CELEBRATE_FIRST_TRAM                          :{BLACK}{BIGFONT}Citizens celebrate . . .{}First passenger tram arrives at {STATION}!
+STR_9030_CITIZENS_CELEBRATE_FIRST_TRAM                          :{BLACK}{BIGFONT}Citizens celebrate . . .{}First freight tram arrives at {STATION}!
+STR_9031_ROAD_VEHICLE_CRASH_DRIVER                              :{BLACK}{BIGFONT}Road Vehicle Crash!{}Driver dies in fireball after collision with train
+STR_9032_ROAD_VEHICLE_CRASH_DIE                                 :{BLACK}{BIGFONT}Road Vehicle Crash!{}{COMMA} die in fireball after collision with train
+STR_9033_CAN_T_MAKE_VEHICLE_TURN                                :{WHITE}Can't make vehicle turn around...
+STR_ONLY_TURN_SINGLE_UNIT                                       :{WHITE}Can't turn vehicles consisting of multiple units
+STR_9034_RENAME                                                 :{BLACK}Rename
+STR_9035_RENAME_ROAD_VEHICLE_TYPE                               :{BLACK}Rename road vehicle type
+STR_9036_RENAME_ROAD_VEHICLE_TYPE                               :{WHITE}Rename road vehicle type
+STR_9037_CAN_T_RENAME_ROAD_VEHICLE                              :{WHITE}Can't rename road vehicle type...
+STR_9038_GO_TO_ROADVEH_DEPOT                                    :Go to {TOWN} Road Vehicle Depot
+STR_SERVICE_AT_ROADVEH_DEPOT                                    :Service at {TOWN} Road Vehicle Depot
+
+STR_REFIT_ROAD_VEHICLE_TO_CARRY                                 :{BLACK}Refit road vehicle to carry a different cargo type
+STR_REFIT_ROAD_VEHICLE                                          :{BLACK}Refit road vehicle
+STR_REFIT_ROAD_VEHICLE_TO_CARRY_HIGHLIGHTED                     :{BLACK}Refit road vehicle to carry highlighted cargo type
+STR_REFIT_ROAD_VEHICLE_CAN_T                                    :{WHITE}Can't refit road vehicle...
+STR_ROAD_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Select type of cargo for road vehicle to carry
+
+##id 0x9800
+STR_9800_DOCK_CONSTRUCTION                                      :Dock construction
+STR_9801_DOCK_CONSTRUCTION                                      :{WHITE}Dock construction
+STR_9802_CAN_T_BUILD_DOCK_HERE                                  :{WHITE}Can't build dock here...
+STR_9803_SHIP_DEPOT                                             :{WHITE}{TOWN} Ship Depot
+STR_9804_NEW_SHIPS                                              :{BLACK}New Ships
+STR_9805_SHIPS                                                  :{WHITE}{COMPANY} - {COMMA} Ship{P "" s}
+STR_9808_NEW_SHIPS                                              :{WHITE}New Ships
+STR_9809_BUILD_SHIP                                             :{BLACK}Build Ship
+STR_CLONE_SHIP                                                  :{BLACK}Clone Ship
+STR_CLONE_SHIP_INFO                                             :{BLACK}This will build a copy of the ship. Control-click will share the orders
+STR_CLONE_SHIP_DEPOT_INFO                                       :{BLACK}This will build a copy of a ship. Click this button and then on a ship inside or outside the depot. Control-click will share the orders
+STR_980B_SHIP_MUST_BE_STOPPED_IN                                :{WHITE}Ship must be stopped in depot
+STR_980C_CAN_T_SELL_SHIP                                        :{WHITE}Can't sell ship...
+STR_980D_CAN_T_BUILD_SHIP                                       :{WHITE}Can't build ship...
+STR_980E_SHIP_IN_THE_WAY                                        :{WHITE}Ship in the way
+STR_980F                                                        :{WHITE}{VEHICLE}
+STR_9811_DETAILS                                                :{WHITE}{VEHICLE} (Details)
+STR_9812_AGE_RUNNING_COST_YR                                    :{BLACK}Age: {LTBLUE}{STRING}{BLACK}   Running Cost: {LTBLUE}{CURRENCY}/yr
+STR_9813_MAX_SPEED                                              :{BLACK}Max. speed: {LTBLUE}{VELOCITY}
+STR_9814_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Profit this year: {LTBLUE}{CURRENCY}  (last year: {CURRENCY})
+STR_9815_RELIABILITY_BREAKDOWNS                                 :{BLACK}Reliability: {LTBLUE}{COMMA}%  {BLACK}Breakdowns since last service: {LTBLUE}{COMMA}
+STR_9816_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Built: {LTBLUE}{NUM}{BLACK} Value: {LTBLUE}{CURRENCY}
+STR_9817_CAPACITY                                               :{BLACK}Capacity: {LTBLUE}{CARGO}
+STR_9818_CAN_T_STOP_START_SHIP                                  :{WHITE}Can't stop/start ship...
+STR_9819_CAN_T_SEND_SHIP_TO_DEPOT                               :{WHITE}Can't send ship to depot...
+STR_981A_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Unable to find local depot
+STR_HEADING_FOR_SHIP_DEPOT                                      :{ORANGE}Heading for {TOWN} Ship Depot
+STR_HEADING_FOR_SHIP_DEPOT_VEL                                  :{ORANGE}Heading for {TOWN} Ship Depot, {VELOCITY}
+STR_HEADING_FOR_SHIP_DEPOT_SERVICE                              :{LTBLUE}Service at {TOWN} Ship Depot
+STR_HEADING_FOR_SHIP_DEPOT_SERVICE_VEL                          :{LTBLUE}Service at {TOWN} Ship Depot, {VELOCITY}
+STR_981C_SHIP_IS_WAITING_IN_DEPOT                               :{WHITE}Ship {COMMA} is waiting in depot
+STR_981D_BUILD_SHIP_DOCK                                        :{BLACK}Build ship dock
+STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING                          :{BLACK}Build ship depot (for building and servicing ships)
+STR_981F_SHIPS_CLICK_ON_SHIP_FOR                                :{BLACK}Ships - click on ship for information
+STR_9820_BUILD_NEW_SHIP                                         :{BLACK}Build new ship
+STR_9821_DRAG_SHIP_TO_HERE_TO_SELL                              :{BLACK}Drag ship to here to sell it
+STR_9822_CENTER_MAIN_VIEW_ON_SHIP                               :{BLACK}Center main view on ship depot location
+STR_9823_SHIPS_CLICK_ON_SHIP_FOR                                :{BLACK}Ships - click on ship for information
+STR_9824_BUILD_NEW_SHIPS_REQUIRES                               :{BLACK}Build new ships (requires ship depot)
+STR_9825_SHIP_SELECTION_LIST_CLICK                              :{BLACK}Ship selection list - click on ship for information
+STR_9826_BUILD_THE_HIGHLIGHTED_SHIP                             :{BLACK}Build the highlighted ship
+STR_9827_CURRENT_SHIP_ACTION_CLICK                              :{BLACK}Current ship action - click here to stop/start ship
+STR_9828_SHOW_SHIP_S_ORDERS                                     :{BLACK}Show ship's orders
+STR_9829_CENTER_MAIN_VIEW_ON_SHIP                               :{BLACK}Center main view on ship's location
+STR_982A_SEND_SHIP_TO_DEPOT                                     :{BLACK}Send ship to depot
+STR_982B_SHOW_SHIP_DETAILS                                      :{BLACK}Show ship details
+STR_982E_COST_MAX_SPEED_CAPACITY                                :{BLACK}Cost: {CURRENCY} Max. Speed: {VELOCITY}{}Capacity: {CARGO}{}Running Cost: {CURRENCY}/yr
+STR_982F_NAME_SHIP                                              :{BLACK}Name ship
+
+STR_9831_NAME_SHIP                                              :{WHITE}Name ship
+STR_9832_CAN_T_NAME_SHIP                                        :{WHITE}Can't name ship...
+STR_9833_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Citizens celebrate . . .{}First ship arrives at {STATION}!
+STR_9834_POSITION_BUOY_WHICH_CAN                                :{BLACK}Place a buoy which can be used as a waypoint
+STR_9835_CAN_T_POSITION_BUOY_HERE                               :{WHITE}Can't place buoy here...
+STR_9836_RENAME                                                 :{BLACK}Rename
+STR_9837_RENAME_SHIP_TYPE                                       :{BLACK}Rename ship type
+STR_9838_RENAME_SHIP_TYPE                                       :{WHITE}Rename ship type
+STR_9839_CAN_T_RENAME_SHIP_TYPE                                 :{WHITE}Can't rename ship type...
+STR_983A_REFIT_CARGO_SHIP_TO_CARRY                              :{BLACK}Refit cargo ship to carry a different cargo type
+STR_983B_REFIT                                                  :{WHITE}{VEHICLE} (Refit)
+STR_983C_REFIT_SHIP                                             :{BLACK}Refit ship
+STR_983D_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Select type of cargo for ship to carry
+STR_983E_REFIT_SHIP_TO_CARRY_HIGHLIGHTED                        :{BLACK}Refit ship to carry highlighted cargo type
+STR_983F_SELECT_CARGO_TYPE_TO_CARRY                             :{GOLD}Select cargo type to carry:
+STR_9840_NEW_CAPACITY_COST_OF_REFIT                             :{BLACK}New capacity: {GOLD}{CARGO}{}{BLACK}Cost of refit: {GOLD}{CURRENCY}
+STR_9841_CAN_T_REFIT_SHIP                                       :{WHITE}Can't refit ship...
+STR_9842_REFITTABLE                                             :(refittable)
+STR_GO_TO_SHIP_DEPOT                                            :Go to {TOWN} Ship Depot
+SERVICE_AT_SHIP_DEPOT                                           :Service at {TOWN} Ship Depot
+
+##id 0xA000
+STR_A000_AIRPORTS                                               :{WHITE}Airports
+STR_A001_CAN_T_BUILD_AIRPORT_HERE                               :{WHITE}Can't build airport here...
+STR_A002_AIRCRAFT_HANGAR                                        :{WHITE}{STATION} Aircraft Hangar
+STR_A003_NEW_AIRCRAFT                                           :{BLACK}New Aircraft
+STR_CLONE_AIRCRAFT                                              :{BLACK}Clone Aircraft
+STR_CLONE_AIRCRAFT_INFO                                         :{BLACK}This will build a copy of the aircraft. Control-click will share the orders
+STR_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW                           :{BLACK}This will build a copy of an aircraft. Click this button and then on an aircraft inside or outside the hangar. Control-click will share the orders
+STR_A005_NEW_AIRCRAFT                                           :{WHITE}New Aircraft
+STR_A006_BUILD_AIRCRAFT                                         :{BLACK}Build Aircraft
+STR_A008_CAN_T_BUILD_AIRCRAFT                                   :{WHITE}Can't build aircraft...
+STR_A009_AIRCRAFT                                               :{WHITE}{COMPANY} - {COMMA} Aircraft
+STR_A00A                                                        :{WHITE}{VEHICLE}
+STR_A00B_ORDERS                                                 :{WHITE}{VEHICLE} (Orders)
+STR_A00C_DETAILS                                                :{WHITE}{VEHICLE} (Details)
+STR_A00D_AGE_RUNNING_COST_YR                                    :{BLACK}Age: {LTBLUE}{STRING}{BLACK}   Running Cost: {LTBLUE}{CURRENCY}/yr
+STR_A00E_MAX_SPEED                                              :{BLACK}Max. speed: {LTBLUE}{VELOCITY}
+STR_A00F_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Profit this year: {LTBLUE}{CURRENCY}  (last year: {CURRENCY})
+STR_A010_RELIABILITY_BREAKDOWNS                                 :{BLACK}Reliability: {LTBLUE}{COMMA}%  {BLACK}Breakdowns since last service: {LTBLUE}{COMMA}
+STR_A011_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Built: {LTBLUE}{NUM}{BLACK} Value: {LTBLUE}{CURRENCY}
+STR_A012_CAN_T_SEND_AIRCRAFT_TO                                 :{WHITE}Can't send aircraft to hangar...
+STR_HEADING_FOR_HANGAR                                          :{ORANGE}Heading for {STATION} Hangar
+STR_HEADING_FOR_HANGAR_VEL                                      :{ORANGE}Heading for {STATION} Hangar, {VELOCITY}
+STR_HEADING_FOR_HANGAR_SERVICE                                  :{LTBLUE}Service at {STATION} Hangar
+STR_HEADING_FOR_HANGAR_SERVICE_VEL                              :{LTBLUE}Service at {STATION} Hangar, {VELOCITY}
+STR_A014_AIRCRAFT_IS_WAITING_IN                                 :{WHITE}Aircraft {COMMA} is waiting in the aircraft hangar
+STR_A015_AIRCRAFT_IN_THE_WAY                                    :{WHITE}Aircraft in the way
+STR_A016_CAN_T_STOP_START_AIRCRAFT                              :{WHITE}Can't stop/start aircraft...
+STR_A017_AIRCRAFT_IS_IN_FLIGHT                                  :{WHITE}Aircraft is in flight
+STR_A019_CAPACITY                                               :{BLACK}Capacity: {LTBLUE}{CARGO}, {CARGO}
+STR_A01A_CAPACITY                                               :{BLACK}Capacity: {LTBLUE}{CARGO}
+STR_A01B_AIRCRAFT_MUST_BE_STOPPED                               :{WHITE}Aircraft must be stopped in hangar
+STR_A01C_CAN_T_SELL_AIRCRAFT                                    :{WHITE}Can't sell aircraft...
+STR_A01D_AIRPORT_CONSTRUCTION                                   :Airport construction
+STR_A01E_BUILD_AIRPORT                                          :{BLACK}Build airport
+STR_A01F_AIRCRAFT_CLICK_ON_AIRCRAFT                             :{BLACK}Aircraft - click on aircraft for information
+STR_A020_BUILD_NEW_AIRCRAFT_REQUIRES                            :{BLACK}Build new aircraft (requires airport with hangar)
+STR_A021_AIRCRAFT_CLICK_ON_AIRCRAFT                             :{BLACK}Aircraft - click on aircraft for information
+STR_A022_BUILD_NEW_AIRCRAFT                                     :{BLACK}Build new aircraft
+STR_A023_DRAG_AIRCRAFT_TO_HERE_TO                               :{BLACK}Drag aircraft to here to sell it
+STR_A024_CENTER_MAIN_VIEW_ON_HANGAR                             :{BLACK}Center main view on hangar location
+STR_A025_AIRCRAFT_SELECTION_LIST                                :{BLACK}Aircraft selection list - click on aircraft for information
+STR_A026_BUILD_THE_HIGHLIGHTED_AIRCRAFT                         :{BLACK}Build the highlighted aircraft
+STR_A027_CURRENT_AIRCRAFT_ACTION                                :{BLACK}Current aircraft action - click here to stop/start aircraft
+STR_A028_SHOW_AIRCRAFT_S_ORDERS                                 :{BLACK}Show aircraft's orders
+STR_A029_CENTER_MAIN_VIEW_ON_AIRCRAFT                           :{BLACK}Center main view on aircraft's location
+STR_A02A_SEND_AIRCRAFT_TO_HANGAR                                :{BLACK}Send aircraft to hangar
+STR_A02B_SHOW_AIRCRAFT_DETAILS                                  :{BLACK}Show aircraft details
+STR_A02E_COST_MAX_SPEED_CAPACITY                                :{BLACK}Cost: {CURRENCY} Max. Speed: {VELOCITY}{}Capacity: {COMMA} passengers, {COMMA} bags of mail{}Running Cost: {CURRENCY}/yr
+
+STR_A030_NAME_AIRCRAFT                                          :{WHITE}Name aircraft
+STR_A031_CAN_T_NAME_AIRCRAFT                                    :{WHITE}Can't name aircraft...
+STR_A032_NAME_AIRCRAFT                                          :{BLACK}Name aircraft
+STR_A033_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Citizens celebrate . . .{}First aircraft arrives at {STATION}!
+STR_A034_PLANE_CRASH_DIE_IN_FIREBALL                            :{BLACK}{BIGFONT}Plane Crash!{}{COMMA} die in fireball at {STATION}
+STR_PLANE_CRASH_OUT_OF_FUEL                                     :{BLACK}{BIGFONT}Plane Crash!{}Aircraft ran out of fuel, {COMMA} die in fireball!
+STR_A036                                                        :{TINYFONT}{BLACK}{STATION}
+STR_A037_RENAME                                                 :{BLACK}Rename
+STR_A038_RENAME_AIRCRAFT_TYPE                                   :{BLACK}Rename aircraft type
+STR_A039_RENAME_AIRCRAFT_TYPE                                   :{WHITE}Rename aircraft type
+STR_A03A_CAN_T_RENAME_AIRCRAFT_TYPE                             :{WHITE}Can't rename aircraft type...
+STR_A03B_REFIT_AIRCRAFT_TO_CARRY                                :{BLACK}Refit aircraft to carry a different cargo type
+STR_A03C_REFIT                                                  :{WHITE}{VEHICLE} (Refit)
+STR_A03D_REFIT_AIRCRAFT                                         :{BLACK}Refit aircraft
+STR_A03E_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Select type of cargo for aircraft to carry
+STR_A03F_REFIT_AIRCRAFT_TO_CARRY                                :{BLACK}Refit aircraft to carry highlighted cargo type
+STR_A040_SELECT_CARGO_TYPE_TO_CARRY                             :{GOLD}Select cargo type to carry:
+STR_A041_NEW_CAPACITY_COST_OF_REFIT                             :{BLACK}New capacity: {GOLD}{STRING}{}{BLACK}Cost of refit: {GOLD}{CURRENCY}
+STR_A042_CAN_T_REFIT_AIRCRAFT                                   :{WHITE}Can't refit aircraft...
+STR_GO_TO_AIRPORT_HANGAR                                        :Go to {STATION} Hangar
+SERVICE_AT_AIRPORT_HANGAR                                       :Service at {STATION} Hangar
+
+STR_TIMETABLE_TITLE                                             :{WHITE}{VEHICLE} (Timetable)
+
+##id 0xB000
+STR_B000_ZEPPELIN_DISASTER_AT                                   :{BLACK}{BIGFONT}Zeppelin disaster at {STATION}!
+STR_B001_ROAD_VEHICLE_DESTROYED                                 :{BLACK}{BIGFONT}Road vehicle destroyed in 'UFO' collision!
+STR_B002_OIL_REFINERY_EXPLOSION                                 :{BLACK}{BIGFONT}Oil refinery explosion near {TOWN}!
+STR_B003_FACTORY_DESTROYED_IN_SUSPICIOUS                        :{BLACK}{BIGFONT}Factory destroyed in suspicious circumstances near {TOWN}!
+STR_B004_UFO_LANDS_NEAR                                         :{BLACK}{BIGFONT}'UFO' lands near {TOWN}!
+STR_B005_COAL_MINE_SUBSIDENCE_LEAVES                            :{BLACK}{BIGFONT}Coal mine subsidence leaves trail of destruction near {TOWN}!
+STR_B006_FLOOD_VEHICLE_DESTROYED                                :{BLACK}{BIGFONT}Floods!{}At least {COMMA} missing, presumed dead after significant flooding!
+
+STR_BRIBE_FAILED                                                :{WHITE}Your attempted bribery has been
+STR_BRIBE_FAILED_2                                              :{WHITE}discovered by a regional investigator
+STR_BUILD_DATE                                                  :{BLACK}Built: {LTBLUE}{DATE_LONG}
+
+STR_PERFORMANCE_DETAIL                                          :{WHITE}Detailed performance rating
+STR_PERFORMANCE_DETAIL_KEY                                      :{BLACK}Detail
+STR_PERFORMANCE_DETAIL_AMOUNT_CURRENCY                          :{BLACK}({CURRCOMPACT}/{CURRCOMPACT})
+STR_PERFORMANCE_DETAIL_AMOUNT_INT                               :{BLACK}({COMMA}/{COMMA})
+STR_PERFORMANCE_DETAIL_PERCENT                                  :{WHITE}{NUM}%
+SET_PERFORMANCE_DETAIL_INT                                      :{BLACK}{NUM}
+############ Those following lines need to be in this order!!
+STR_PERFORMANCE_DETAIL_VEHICLES                                 :{BLACK}Vehicles:
+STR_PERFORMANCE_DETAIL_STATIONS                                 :{BLACK}Stations:
+STR_PERFORMANCE_DETAIL_MIN_PROFIT                               :{BLACK}Min. profit:
+STR_PERFORMANCE_DETAIL_MIN_INCOME                               :{BLACK}Min. income:
+STR_PERFORMANCE_DETAIL_MAX_INCOME                               :{BLACK}Max. income:
+STR_PERFORMANCE_DETAIL_DELIVERED                                :{BLACK}Delivered:
+STR_PERFORMANCE_DETAIL_CARGO                                    :{BLACK}Cargo:
+STR_PERFORMANCE_DETAIL_MONEY                                    :{BLACK}Money:
+STR_PERFORMANCE_DETAIL_LOAN                                     :{BLACK}Loan:
+STR_PERFORMANCE_DETAIL_TOTAL                                    :{BLACK}Total:
+############ End of order list
+STR_PERFORMANCE_DETAIL_VEHICLES_TIP                             :{BLACK}Number of vehicles; this includes road vehicles, trains, ships and aircraft
+STR_PERFORMANCE_DETAIL_STATIONS_TIP                             :{BLACK}Number of station parts. Every part of a station (e.g. train station, bus stop, airport) is counted, even if they are connected to one station.
+STR_PERFORMANCE_DETAIL_MIN_PROFIT_TIP                           :{BLACK}The profit of the vehicle with the lowest income (of all vehicles older than 2 years)
+STR_PERFORMANCE_DETAIL_MIN_INCOME_TIP                           :{BLACK}Amount of cash made in the month with the lowest profit of the past 12 quarters
+STR_PERFORMANCE_DETAIL_MAX_INCOME_TIP                           :{BLACK}Amount of cash made in the month with the highest profit of the past 12 quarters
+STR_PERFORMANCE_DETAIL_DELIVERED_TIP                            :{BLACK}Units of cargo delivered in the past four quarters.
+STR_PERFORMANCE_DETAIL_CARGO_TIP                                :{BLACK}Number of types of cargo delivered in the past quarter.
+STR_PERFORMANCE_DETAIL_MONEY_TIP                                :{BLACK}Amount of money this company has in the bank
+STR_PERFORMANCE_DETAIL_LOAN_TIP                                 :{BLACK}The amount of money this company has taken on loan
+STR_PERFORMANCE_DETAIL_TOTAL_TIP                                :{BLACK}Total points out of possible points
+
+STR_NEWGRF_SETTINGS_BUTTON                                      :{BLACK}NewGRF Settings
+STR_NEWGRF_SETTINGS_CAPTION                                     :{WHITE}Newgrf settings
+STR_NEWGRF_APPLY_CHANGES                                        :{BLACK}Apply changes
+STR_NEWGRF_SET_PARAMETERS                                       :{BLACK}Set parameters
+STR_NEWGRF_TIP                                                  :{BLACK}A list of all the Newgrf sets that you have installed. Click a set to change the settings.
+STR_NEWGRF_NO_FILES_INSTALLED                                   :{BLACK}There are currently no newgrf files installed! Please refer to the manual for instructions to install new graphics.
+STR_NEWGRF_FILENAME                                             :{BLACK}Filename: {SILVER}{STRING}
+STR_NEWGRF_GRF_ID                                               :{BLACK}GRF ID: {SILVER}{STRING}
+STR_NEWGRF_MD5SUM                                               :{BLACK}MD5sum: {SILVER}{STRING}
+STR_NEWGRF_CONFIRMATION_TEXT                                    :{YELLOW}You are about to make changes to a running game; this can crash OpenTTD.{}Are you absolutely sure about this?
+
+STR_NEWGRF_ERROR_MSG_INFO                                       :{SILVER}{STRING}
+STR_NEWGRF_ERROR_MSG_WARNING                                    :{RED}Warning: {SILVER}{STRING}
+STR_NEWGRF_ERROR_MSG_ERROR                                      :{RED}Error: {SILVER}{STRING}
+STR_NEWGRF_ERROR_MSG_FATAL                                      :{RED}Fatal: {SILVER}{STRING}
+STR_NEWGRF_ERROR_VERSION_NUMBER                                 :{STRING} will not work with the TTDPatch version reported by OpenTTD.
+STR_NEWGRF_ERROR_DOS_OR_WINDOWS                                 :{STRING} is for the {STRING} version of TTD.
+STR_NEWGRF_ERROR_UNSET_SWITCH                                   :{STRING} is designed to be used with {STRING}
+STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Invalid parameter for {STRING}: parameter {STRING} ({NUM})
+STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} must be loaded before {STRING}.
+STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} must be loaded after {STRING}.
+STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER                            :{STRING} requires OpenTTD version {STRING} or better.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :the GRF file it was designed to translate
+STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED                        :Too many NewGRFs are loaded.
+
+STR_NEWGRF_ADD                                                  :{BLACK}Add
+STR_NEWGRF_ADD_TIP                                              :{BLACK}Add a NewGRF file to the list
+STR_NEWGRF_REMOVE                                               :{BLACK}Remove
+STR_NEWGRF_REMOVE_TIP                                           :{BLACK}Remove the selected NewGRF file from the list
+STR_NEWGRF_MOVEUP                                               :{BLACK}Move Up
+STR_NEWGRF_MOVEUP_TIP                                           :{BLACK}Move the selected NewGRF file up the list
+STR_NEWGRF_MOVEDOWN                                             :{BLACK}Move Down
+STR_NEWGRF_MOVEDOWN_TIP                                         :{BLACK}Move the selected NewGRF file down the list
+STR_NEWGRF_FILE_TIP                                             :{BLACK}A list of the NewGRF files that are installed. Click a file to change its parameters
+STR_NEWGRF_PARAMETER                                            :{BLACK}Parameters: {SILVER}{STRING}
+STR_NEWGRF_PARAMETER_QUERY                                      :{BLACK}Enter NewGRF parameters
+STR_NEWGRF_NO_INFO                                              :{BLACK}No information available
+
+STR_NEWGRF_ADD_CAPTION                                          :{WHITE}Available NewGRF files
+STR_NEWGRF_ADD_FILE                                             :{BLACK}Add to selection
+STR_NEWGRF_ADD_FILE_TIP                                         :{BLACK}Add the selected NewGRF file to your configuration
+STR_NEWGRF_RESCAN_FILES                                         :{BLACK}Rescan files
+STR_NEWGRF_RESCAN_FILES_TIP                                     :{BLACK}Update the list of available NewGRF files
+STR_NEWGRF_DUPLICATE_GRFID                                      :{WHITE}Cannot add file: duplicate GRF ID
+
+STR_NEWGRF_NOT_FOUND                                            :{RED}Matching file not found
+STR_NEWGRF_DISABLED                                             :{RED}Disabled
+STR_NEWGRF_COMPATIBLE_LOADED                                    :{ORANGE}Matching file not found (compatible GRF loaded)
+
+STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Compatible GRF(s) loaded for missing files
+STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Missing GRF file(s) have been disabled
+STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Missing GRF file(s) to be able to load game
+
+STR_CURRENCY_WINDOW                                             :{WHITE}Custom currency
+STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Exchange rate: {ORANGE}{CURRENCY} = £ {COMMA}
+STR_CURRENCY_SEPARATOR                                          :{LTBLUE}Separator:
+STR_CURRENCY_PREFIX                                             :{LTBLUE}Prefix:
+STR_CURRENCY_SUFFIX                                             :{LTBLUE}Suffix:
+STR_CURRENCY_SWITCH_TO_EURO                                     :{LTBLUE}Switch to Euro: {ORANGE}{NUM}
+STR_CURRENCY_SWITCH_TO_EURO_NEVER                               :{LTBLUE}Switch to Euro: {ORANGE}never
+STR_CURRENCY_PREVIEW                                            :{LTBLUE}Preview: {ORANGE}{CURRENCY}
+STR_CURRENCY_CHANGE_PARAMETER                                   :{BLACK}Change custom currency parameter
+
+STR_TRAIN                                                       :{BLACK}{TRAIN}
+STR_BUS                                                         :{BLACK}{BUS}
+STR_LORRY                                                       :{BLACK}{LORRY}
+STR_PLANE                                                       :{BLACK}{PLANE}
+STR_SHIP                                                        :{BLACK}{SHIP}
+
+STR_SCHEDULED_TRAINS                                            :{WHITE}{STATION} - {COMMA} Train{P "" s}
+STR_SCHEDULED_ROAD_VEHICLES                                     :{WHITE}{STATION} - {COMMA} Road Vehicle{P "" s}
+STR_SCHEDULED_AIRCRAFT                                          :{WHITE}{STATION} - {COMMA} Aircraft
+STR_SCHEDULED_SHIPS                                             :{WHITE}{STATION} - {COMMA} Ship{P "" s}
+
+STR_SCHEDULED_TRAINS_TIP                                        :{BLACK}Show all trains which have this station on their schedule
+STR_SCHEDULED_ROAD_VEHICLES_TIP                                 :{BLACK}Show all road vehicles which have this station on their schedule
+STR_SCHEDULED_AIRCRAFT_TIP                                      :{BLACK}Show all aircraft which have this station on their schedule
+STR_SCHEDULED_SHIPS_TIP                                         :{BLACK}Show all ships which have this station on their schedule
+
+STR_VEH_WITH_SHARED_ORDERS_LIST                                 :{WHITE}Shared orders of {COMMA} Vehicle{P "" s}
+STR_VEH_WITH_SHARED_ORDERS_LIST_TIP                             :{BLACK}Show all vehicles which have the same schedule
+
+### depot strings
+STR_DEPOT_SELL_CONFIRMATION_TEXT                                :{YELLOW}You are about to sell all the vehicles in the depot. Are you sure?
+STR_DEPOT_WRONG_DEPOT_TYPE                                      :Wrong depot type
+
+STR_DEPOT_SELL_ALL_BUTTON_TRAIN_TIP                             :{BLACK}Sell all trains in the depot
+STR_DEPOT_SELL_ALL_BUTTON_ROADVEH_TIP                           :{BLACK}Sell all road vehicles in the depot
+STR_DEPOT_SELL_ALL_BUTTON_SHIP_TIP                              :{BLACK}Sell all ships in the depot
+STR_DEPOT_SELL_ALL_BUTTON_AIRCRAFT_TIP                          :{BLACK}Sell all aircraft in the hangar
+
+STR_DEPOT_VEHICLE_ORDER_LIST_TRAIN_TIP                          :{BLACK}Get a list of all trains with the current depot in their orders
+STR_DEPOT_VEHICLE_ORDER_LIST_ROADVEH_TIP                        :{BLACK}Get a list of all road vehicles with the current depot in their orders
+STR_DEPOT_VEHICLE_ORDER_LIST_SHIP_TIP                           :{BLACK}Get a list of all ships with the current depot in their orders
+STR_DEPOT_VEHICLE_ORDER_LIST_AIRCRAFT_TIP                       :{BLACK}Get a list of all aircraft with any hangar at this airport in their orders
+
+STR_DEPOT_AUTOREPLACE_TRAIN_TIP                                 :{BLACK}Autoreplace all trains in the depot
+STR_DEPOT_AUTOREPLACE_ROADVEH_TIP                               :{BLACK}Autoreplace all road vehicles in the depot
+STR_DEPOT_AUTOREPLACE_SHIP_TIP                                  :{BLACK}Autoreplace all ships in the depot
+STR_DEPOT_AUTOREPLACE_AIRCRAFT_TIP                              :{BLACK}Autoreplace all aircraft in the hangar
+
+STR_VEHICLE_LIST_TRAIN_DEPOT                                    :{BLACK}{STRING} - {COMMA} Train{P "" s}
+STR_VEHICLE_LIST_ROADVEH_DEPOT                                  :{BLACK}{STRING} - {COMMA} Road Vehicle{P "" s}
+STR_VEHICLE_LIST_SHIP_DEPOT                                     :{BLACK}{STRING} - {COMMA} Ship{P "" s}
+STR_VEHICLE_LIST_AIRCRAFT_DEPOT                                 :{BLACK}{STRING} - {COMMA} Aircraft
+
+STR_REPLACE_VEHICLES_WHITE                                      :{WHITE}Replace {STRING}
+STR_REPLACE_VEHICLES_START                                      :{BLACK}Start Replacing Vehicles
+STR_REPLACE_VEHICLES_STOP                                       :{BLACK}Stop Replacing Vehicles
+STR_NOT_REPLACING                                               :{BLACK}Not replacing
+STR_NOT_REPLACING_VEHICLE_SELECTED                              :{BLACK}No vehicle selected
+STR_REPLACE_HELP_LEFT_ARRAY                                     :{BLACK}Select the engine type to replace
+STR_REPLACE_HELP_RIGHT_ARRAY                                    :{BLACK}Select the new engine type you would like to use in place of the left selected engine type
+STR_REPLACE_HELP_STOP_BUTTON                                    :{BLACK}Press to stop the replacement of the engine type selected on the left
+STR_REPLACE_HELP_START_BUTTON                                   :{BLACK}Press to begin replacement of the left selected engine type with the right selected engine type
+STR_REPLACE_HELP_RAILTYPE                                       :{BLACK}Choose the railtype you want to replace engines for
+STR_REPLACE_HELP_REPLACE_INFO_TAB                               :{BLACK}Displays which engine the left selected engine is being replaced with, if any
+STR_REPLACE_HELP                                                :{BLACK}This allows you to replace one engine type with another type, when trains of the original type enter a depot
+STR_REPLACE_REMOVE_WAGON                                        :{BLACK}Car removal: {ORANGE}{SKIP}{STRING}
+STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Make autoreplace keep the length of a train the same by removing cars (starting at the front), if replacing the engine would make the train longer.
+STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Replacing: {ORANGE}{SKIP}{SKIP}{STRING}
+STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EXPERIMENTAL FEATURE {}Switch between engine and car replacement windows.{}Car replacement will only be done if the new car can be refitted into carrying the same type of cargo as the old one. This is checked for each car when the actual replacement takes place.
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vehicle is not available
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vehicle is not available
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Ship is not available
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Aircraft is not available
+
+STR_ENGINES                                                     :Engines
+STR_WAGONS                                                      :Cars
+
+STR_MASS_STOP_DEPOT_TRAIN_TIP                                   :{BLACK}Click to stop all trains inside the depot
+STR_MASS_STOP_DEPOT_ROADVEH_TIP                                 :{BLACK}Click to stop all road vehicles inside the depot
+STR_MASS_STOP_DEPOT_SHIP_TIP                                    :{BLACK}Click to stop all ships inside the depot
+STR_MASS_STOP_HANGAR_TIP                                        :{BLACK}Click to stop all aircraft inside the hangar
+
+STR_MASS_START_DEPOT_TRAIN_TIP                                  :{BLACK}Click to start all trains inside the depot
+STR_MASS_START_DEPOT_ROADVEH_TIP                                :{BLACK}Click to start all the road vehicles inside the depot
+STR_MASS_START_DEPOT_SHIP_TIP                                   :{BLACK}Click to start all ships inside the depot
+STR_MASS_START_HANGAR_TIP                                       :{BLACK}Click to start all aircraft inside the hangar
+
+STR_MASS_STOP_LIST_TIP                                          :{BLACK}Click to stop all vehicles in the list
+STR_MASS_START_LIST_TIP                                         :{BLACK}Click to start all listed vehicles
+
+STR_SHORT_DATE                                                  :{WHITE}{DATE_TINY}
+STR_SIGN_LIST_CAPTION                                           :{WHITE}Sign List - {COMMA} Sign{P "" s}
+
+STR_ORDER_REFIT_FAILED                                          :{WHITE}Order refit failure stopped {STRING} {COMMA}
+
+############ Lists rail types
+
+STR_RAIL_VEHICLES                                               :Rail Vehicles
+STR_ELRAIL_VEHICLES                                             :Electrified Rail Vehicles
+STR_MONORAIL_VEHICLES                                           :Monorail Vehicles
+STR_MAGLEV_VEHICLES                                             :Maglev Vehicles
+
+############ End of list of rail types
+
+STR_TINY_BLACK                                                  :{BLACK}{TINYFONT}{COMMA}
+
+STR_PURCHASE_INFO_COST_WEIGHT                                   :{BLACK}Cost: {GOLD}{CURRENCY}{BLACK} Weight: {GOLD}{WEIGHT_S}
+STR_PURCHASE_INFO_SPEED_POWER                                   :{BLACK}Speed: {GOLD}{VELOCITY}{BLACK}   Power: {GOLD}{POWER}
+STR_PURCHASE_INFO_SPEED                                         :{BLACK}Speed: {GOLD}{VELOCITY}
+STR_PURCHASE_INFO_RUNNINGCOST                                   :{BLACK}Running Cost: {GOLD}{CURRENCY}/yr
+STR_PURCHASE_INFO_CAPACITY                                      :{BLACK}Capacity: {GOLD}{CARGO} {STRING}
+STR_PURCHASE_INFO_DESIGNED_LIFE                                 :{BLACK}Designed: {GOLD}{NUM}{BLACK} Life: {GOLD}{COMMA} years
+STR_PURCHASE_INFO_RELIABILITY                                   :{BLACK}Max. Reliability: {GOLD}{COMMA}%
+STR_PURCHASE_INFO_COST                                          :{BLACK}Cost: {GOLD}{CURRENCY}
+STR_PURCHASE_INFO_WEIGHT_CWEIGHT                                :{BLACK}Weight: {GOLD}{WEIGHT_S}  ({WEIGHT_S})
+STR_PURCHASE_INFO_COST_SPEED                                    :{BLACK}Cost: {GOLD}{CURRENCY}{BLACK} Speed: {GOLD}{VELOCITY}
+STR_PURCHASE_INFO_AIRCRAFT_CAPACITY                             :{BLACK}Capacity: {GOLD}{COMMA} passengers, {COMMA} bags of mail
+STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT                          :{BLACK}Powered Wagons: {GOLD}+{POWER}{BLACK} Weight: {GOLD}+{WEIGHT_S}
+STR_PURCHASE_INFO_REFITTABLE_TO                                 :{BLACK}Refittable to: {GOLD}
+STR_PURCHASE_INFO_ALL_TYPES                                     :All cargo types
+STR_PURCHASE_INFO_ALL_BUT                                       :All but {GOLD}
+STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Max. Tractive Effort: {GOLD}{FORCE}
+
+########### String for New Landscape Generator
+
+STR_GENERATE                                                    :{WHITE}Generate
+STR_RANDOM                                                      :{BLACK}Randomize
+STR_RANDOM_HELP                                                 :{BLACK}Change the random seed used for Terrain Generation
+STR_WORLD_GENERATION_CAPTION                                    :{WHITE}World generation
+STR_RANDOM_SEED                                                 :{BLACK}Random Seed:
+STR_RANDOM_SEED_HELP                                            :{BLACK}Click to enter a random seed
+STR_LAND_GENERATOR                                              :{BLACK}Land generator:
+STR_TREE_PLACER                                                 :{BLACK}Tree algorithm:
+STR_HEIGHTMAP_ROTATION                                          :{BLACK}Heightmap rotation:
+STR_TERRAIN_TYPE                                                :{BLACK}Terrain type:
+STR_QUANTITY_OF_SEA_LAKES                                       :{BLACK}Sea level:
+STR_SMOOTHNESS                                                  :{BLACK}Smoothness:
+STR_SNOW_LINE_HEIGHT                                            :{BLACK}Snow line height:
+STR_DATE                                                        :{BLACK}Date:
+STR_NUMBER_OF_TOWNS                                             :{BLACK}No. of towns:
+STR_NUMBER_OF_INDUSTRIES                                        :{BLACK}No. of industries:
+STR_GENERATE_DATE                                               :{BLACK}{DATE_LONG}
+STR_SNOW_LINE_UP                                                :{BLACK}Move the snow line height up one
+STR_SNOW_LINE_DOWN                                              :{BLACK}Move the snow line height down one
+STR_SNOW_LINE_QUERY_CAPT                                        :{WHITE}Change snow line height
+STR_START_DATE_QUERY_CAPT                                       :{WHITE}Change starting year
+STR_HEIGHTMAP_SCALE_WARNING_CAPTION                             :{WHITE}Scale warning
+STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Resizing source map too much is not recommended. Continue with the generation?
+STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Town layout warning
+STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}The town layout "no more roads" is not recommended. Continue with the generation?
+STR_HEIGHTMAP_NAME                                              :{BLACK}Heightmap name:
+STR_HEIGHTMAP_SIZE                                              :{BLACK}Size: {ORANGE}{NUM} x {NUM}
+STR_GENERATION_WORLD                                            :{WHITE}Generating world...
+STR_GENERATION_ABORT                                            :{BLACK}Cancel
+STR_GENERATION_ABORT_CAPTION                                    :{WHITE}Cancel World Generation
+STR_GENERATION_ABORT_MESSAGE                                    :{YELLOW}Do you really want to cancel the generation?
+STR_PROGRESS                                                    :{WHITE}{NUM}% complete
+STR_GENERATION_PROGRESS                                         :{BLACK}{NUM} / {NUM}
+STR_WORLD_GENERATION                                            :{BLACK}World generation
+STR_TREE_GENERATION                                             :{BLACK}Tree generation
+STR_UNMOVABLE_GENERATION                                        :{BLACK}Unmovable generation
+STR_CLEARING_TILES                                              :{BLACK}Rough and rocky area generation
+STR_SETTINGUP_GAME                                              :{BLACK}Setting up game
+STR_PREPARING_TILELOOP                                          :{BLACK}Running tile-loop
+STR_PREPARING_GAME                                              :{BLACK}Preparing game
+STR_DIFFICULTY_TO_CUSTOM                                        :{WHITE}This action changed the difficulty level to custom
+STR_SE_FLAT_WORLD                                               :{WHITE}Flat land
+STR_SE_FLAT_WORLD_TIP                                           :{BLACK}Generate a flat land
+STR_SE_RANDOM_LAND                                              :{WHITE}Random land
+STR_SE_NEW_WORLD                                                :{BLACK}Create new scenario
+STR_SE_CAPTION                                                  :{WHITE}Scenario type
+STR_FLAT_WORLD_HEIGHT_DOWN                                      :{BLACK}Move the height of flat land down one
+STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Move the height of flat land up one
+STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Change height of flat land
+STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Height of flat land:
+
+STR_SMALLMAP_CENTER                                             :{BLACK}Center the smallmap on the current position
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
+
+########### String for new airports
+STR_SMALL_AIRPORT                                               :{BLACK}Small
+STR_CITY_AIRPORT                                                :{BLACK}City
+STR_METRO_AIRPORT                                               :{BLACK}Metropolitan airport
+STR_INTERNATIONAL_AIRPORT                                       :{BLACK}International airport
+STR_COMMUTER_AIRPORT                                            :{BLACK}Commuter
+STR_INTERCONTINENTAL_AIRPORT                                    :{BLACK}Intercontinental
+STR_HELIPORT                                                    :{BLACK}Heliport
+STR_HELIDEPOT                                                   :{BLACK}Helidepot
+STR_HELISTATION                                                 :{BLACK}Helistation
+
+STR_SMALL_AIRPORTS                                              :{BLACK}Small airports
+STR_LARGE_AIRPORTS                                              :{BLACK}Large airports
+STR_HUB_AIRPORTS                                                :{BLACK}Hub airports
+STR_HELIPORTS                                                   :{BLACK}Helicopter airports
+
+############ Tooltip measurment
+
+STR_MEASURE_LENGTH                                              :{BLACK}Length: {NUM}
+STR_MEASURE_AREA                                                :{BLACK}Area: {NUM} x {NUM}
+STR_MEASURE_LENGTH_HEIGHTDIFF                                   :{BLACK}Length: {NUM}{}Height difference: {NUM} m
+STR_MEASURE_AREA_HEIGHTDIFF                                     :{BLACK}Area: {NUM} x {NUM}{}Height difference: {NUM} m
+
+############ Date formatting
+STR_DATE_TINY                                                   :{STRING}-{STRING}-{NUM}
+STR_DATE_SHORT                                                  :{STRING} {NUM}
+STR_DATE_LONG                                                   :{STRING} {STRING} {NUM}
+
+########
+
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}Transfer Credits: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...this is a town owned road
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...road facing in the wrong direction
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Transparency Options
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Toggle transparency for station signs
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Toggle transparency for trees
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Toggle transparency for houses
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Toggle transparency for industries
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Toggle transparency for buildables like stations, depots, waypoints and catenary
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Toggle transparency for bridges
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Toggle transparency for structures like lighthouses and antennas, maybe in future for eyecandy
+STR_TRANSPARENT_LOADING_DESC                                    :{BLACK}Toggle transparency for loading indicators
+
+STR_PERCENT_UP_SMALL                                            :{TINYFONT}{WHITE}{NUM}%{UPARROW}
+STR_PERCENT_UP                                                  :{WHITE}{NUM}%{UPARROW}
+STR_PERCENT_DOWN_SMALL                                          :{TINYFONT}{WHITE}{NUM}%{DOWNARROW}
+STR_PERCENT_DOWN                                                :{WHITE}{NUM}%{DOWNARROW}
+STR_PERCENT_UP_DOWN_SMALL                                       :{TINYFONT}{WHITE}{NUM}%{UPARROW}{DOWNARROW}
+STR_PERCENT_UP_DOWN                                             :{WHITE}{NUM}%{UPARROW}{DOWNARROW}
+
+##### Mass Order
+STR_GROUP_NAME_FORMAT                                           :Group {COMMA}
+STR_GROUP_TINY_NAME                                             :{TINYFONT}{GROUP}
+STR_GROUP_ALL_TRAINS                                            :All trains
+STR_GROUP_ALL_ROADS                                             :All road vehicles
+STR_GROUP_ALL_SHIPS                                             :All ships
+STR_GROUP_ALL_AIRCRAFTS                                         :All aircraft
+STR_GROUP_DEFAULT_TRAINS                                        :Ungrouped trains
+STR_GROUP_DEFAULT_ROADS                                         :Ungrouped road vehicles
+STR_GROUP_DEFAULT_SHIPS                                         :Ungrouped ships
+STR_GROUP_DEFAULT_AIRCRAFTS                                     :Ungrouped aircraft
+STR_GROUP_TINY_NUM                                              :{TINYFONT}{COMMA}
+STR_GROUP_ADD_SHARED_VEHICLE                                    :Add shared vehicles
+STR_GROUP_REMOVE_ALL_VEHICLES                                   :Remove all vehicles
+
+STR_GROUP_TRAINS_CAPTION                                        :{WHITE}{GROUP} - {COMMA} Train{P "" s}
+STR_GROUP_ROADVEH_CAPTION                                       :{WHITE}{GROUP} - {COMMA} Road Vehicle{P "" s}
+STR_GROUP_SHIPS_CAPTION                                         :{WHITE}{GROUP} - {COMMA} Ship{P "" s}
+STR_GROUP_AIRCRAFTS_CAPTION                                     :{WHITE}{GROUP} - {COMMA} Aircraft
+STR_GROUP_RENAME_CAPTION                                        :{BLACK}Rename a group
+STR_GROUP_REPLACE_CAPTION                                       :{WHITE}Replace Vehicles of "{GROUP}"
+
+STR_GROUP_CAN_T_CREATE                                          :{WHITE}Can't create group...
+STR_GROUP_CAN_T_DELETE                                          :{WHITE}Can't delete this group...
+STR_GROUP_CAN_T_RENAME                                          :{WHITE}Can't rename group...
+STR_GROUP_CAN_T_REMOVE_ALL_VEHICLES                             :{WHITE}Can't remove all vehicles from this group...
+STR_GROUP_CAN_T_ADD_VEHICLE                                     :{WHITE}Can't add the vehicle to this group...
+STR_GROUP_CAN_T_ADD_SHARED_VEHICLE                              :{WHITE}Can't add shared vehicles to group...
+
+STR_GROUPS_CLICK_ON_GROUP_FOR_TIP                               :{BLACK}Groups - Click on a group to list all of its vehicles
+STR_GROUP_CREATE_TIP                                            :{BLACK}Click to create a group
+STR_GROUP_DELETE_TIP                                            :{BLACK}Delete the selected group
+STR_GROUP_RENAME_TIP                                            :{BLACK}Rename the selected group
+STR_GROUP_REPLACE_PROTECTION_TIP                                :{BLACK}Click to protect this group from global autoreplace
+
+STR_COMPANY_NAME                                                :{COMPANY}
+STR_ENGINE_NAME                                                 :{ENGINE}
+STR_GROUP_NAME                                                  :{GROUP}
+STR_PLAYER_NAME                                                 :{PLAYERNAME}
+STR_SIGN_NAME                                                   :{SIGN}
+STR_VEHICLE_NAME                                                :{VEHICLE}
+
+STR_NAME_MUST_BE_UNIQUE                                         :{WHITE}Name must be unique
+
+#### Improved sign GUI
+STR_NEXT_SIGN_TOOLTIP                                           :{BLACK}Go to next sign
+STR_PREVIOUS_SIGN_TOOLTIP                                       :{BLACK}Go to previous sign
+
+########
+
+STR_FUND_NEW_INDUSTRY                                           :{BLACK}Fund
+STR_PROSPECT_NEW_INDUSTRY                                       :{BLACK}Prospect
+STR_BUILD_NEW_INDUSTRY                                          :{BLACK}Build
+STR_INDUSTRY_SELECTION_HINT                                     :{BLACK}Choose the appropriate industry from this list
+
+############ Face formatting
+STR_FACE_ADVANCED                                               :{BLACK}Advanced
+STR_FACE_ADVANCED_TIP                                           :{BLACK}Advanced face selection.
+STR_FACE_SIMPLE                                                 :{BLACK}Simple
+STR_FACE_SIMPLE_TIP                                             :{BLACK}Simple face selection.
+STR_FACE_LOAD                                                   :{BLACK}Load
+STR_FACE_LOAD_TIP                                               :{BLACK}Load favorite face
+STR_FACE_LOAD_DONE                                              :{WHITE}Your favorite face has been loaded from the OpenTTD config file.
+STR_FACE_FACECODE                                               :{BLACK}Player face no.
+STR_FACE_FACECODE_TIP                                           :{BLACK}View and/or set player face number
+STR_FACE_FACECODE_CAPTION                                       :{WHITE}View and/or set player face number
+STR_FACE_FACECODE_SET                                           :{WHITE}New face number code has been set.
+STR_FACE_FACECODE_ERR                                           :{WHITE}Couldn't set player face number - must be numeric between 0 and 4,294,967,295!
+STR_FACE_SAVE                                                   :{BLACK}Save
+STR_FACE_SAVE_TIP                                               :{BLACK}Save favorite face
+STR_FACE_SAVE_DONE                                              :{WHITE}This face will be saved as your favorite in the OpenTTD config file.
+STR_FACE_EUROPEAN                                               :{BLACK}European
+STR_FACE_SELECT_EUROPEAN                                        :{BLACK}Select European faces
+STR_FACE_AFRICAN                                                :{BLACK}African
+STR_FACE_SELECT_AFRICAN                                         :{BLACK}Select African faces
+STR_FACE_YES                                                    :Yes
+STR_FACE_NO                                                     :No
+STR_FACE_MOUSTACHE_EARRING_TIP                                  :{BLACK}Enable mustache or earring
+STR_FACE_HAIR                                                   :Hair:
+STR_FACE_HAIR_TIP                                               :{BLACK}Change hair
+STR_FACE_EYEBROWS                                               :Eyebrows:
+STR_FACE_EYEBROWS_TIP                                           :{BLACK}Change eyebrows
+STR_FACE_EYECOLOUR                                              :Eye color:
+STR_FACE_EYECOLOUR_TIP                                          :{BLACK}Change eyecolor
+STR_FACE_GLASSES                                                :Glasses:
+STR_FACE_GLASSES_TIP                                            :{BLACK}Enable glasses
+STR_FACE_GLASSES_TIP_2                                          :{BLACK}Change glasses
+STR_FACE_NOSE                                                   :Nose:
+STR_FACE_NOSE_TIP                                               :{BLACK}Change nose
+STR_FACE_LIPS                                                   :Lips:
+STR_FACE_MOUSTACHE                                              :Mustache:
+STR_FACE_LIPS_MOUSTACHE_TIP                                     :{BLACK}Change lips or mustache
+STR_FACE_CHIN                                                   :Chin:
+STR_FACE_CHIN_TIP                                               :{BLACK}Change chin
+STR_FACE_JACKET                                                 :Jacket:
+STR_FACE_JACKET_TIP                                             :{BLACK}Change jacket
+STR_FACE_COLLAR                                                 :Collar:
+STR_FACE_COLLAR_TIP                                             :{BLACK}Change collar
+STR_FACE_TIE                                                    :Tie:
+STR_FACE_EARRING                                                :Earring:
+STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Change tie or earring
+########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Signal Selection
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Can't convert signals here...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Standard Signal (semaphore){}Signals are necessary to keep trains from crashing on railway networks with more than one train.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Entry-Signal (semaphore){}Green as long as there is one or more green exit-signal from the following section of track. Otherwise it shows red.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Exit-Signal (semaphore){}Behaves in the same way as a normal signal but is necessary to trigger the correct color on entry & combo pre-signals.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Combo-Signal (semaphore){}The combo signal simply acts as both an entry and exit signal. This allows you to build large "trees" of presignals.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Standard Signal (electric){}Signals are necessary to keep trains from crashing on railway networks with more than one train.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Entry-Signal (electric){}Green as long as there is one or more green exit-signal from the following section of track. Otherwise it shows red.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Exit-Signal (electric){}Behaves in the same way as a normal signal but is necessary to trigger the correct color on entry & combo pre-signals.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Combo-Signal (electric){}The combo signal simply acts as both an entry and exit signal. This allows you to build large "trees" of presignals.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Signal Convert{}When selected, clicking an existing signal will convert it to the selected signal type and variant, CTRL-click will toggle the existing variant.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Dragging signal density
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Decrease dragging signal density
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Increase dragging signal density
+########
--- a/src/lang/esperanto.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/esperanto.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -161,7 +161,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Ne eblas malplenigi la regionon....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Origina kopirajto {COPYRIGHT} 1995 Chris Sawyer, Ĉiuj rajtoj rezervitaj
 STR_00B7_VERSION                                                :{BLACK}OpenTTD-versio {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 La teamo de OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 La teamo de OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK}  Tradukanto(j) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -300,12 +300,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Pluraj Ludantoj
 STR_SCENARIO_EDITOR                                             :{BLACK}Scenarkreilo
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Mapgrandeco:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Ludaj Opcioj
@@ -3097,7 +3091,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Ne rekomendindas tro ŝanĝi la grandecon de la mapo. Ĉu daŭrigi la generadon?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Urbaspekta averto
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}La urbaspekto "sen pliaj vojoj" ne estas rekomendata. Ĉu plugeneri?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Mapa nomo:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Grandeco: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Generante mondon...
@@ -3123,7 +3116,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Altigu la altecon de ebena lando per unu
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Ŝanĝu altecon de ebena lando
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Alteco de ebena lando:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centrigu la mapeton al la nuna loko
 
--- a/src/lang/estonian.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/estonian.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -260,7 +260,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Seda ala ei saa puhastada....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Algupärane autorikaitse {COPYRIGHT} 1995 Chris Sawyer, kõik õigused kaitstud
 STR_00B7_VERSION                                                :{BLACK}OpenTTD versioon {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 OpenTTD meeskond
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 OpenTTD meeskond
 STR_TRANSLATED_BY                                               :{BLACK}  Tõlgi(d) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -370,7 +370,7 @@
 STR_012D                                                        :{WHITE}{STRING}
 STR_012E_CANCEL                                                 :{BLACK}Loobu
 STR_012F_OK                                                     :{BLACK}OK
-STR_0130_RENAME                                                 :{BLACK}Muuda nime
+STR_0130_RENAME                                                 :{BLACK}Nime muutmine
 STR_0131_TOO_MANY_NAMES_DEFINED                                 :{WHITE}Liiga palju määratletud nimesid
 STR_0132_CHOSEN_NAME_IN_USE_ALREADY                             :{WHITE}Valitud nimi on juba kasutusel
 
@@ -393,18 +393,12 @@
 STR_013F_TOTAL_CAPACITY_TEXT                                    :{BLACK}Selle rongi kandevõime:
 STR_013F_TOTAL_CAPACITY                                         :{LTBLUE}- {CARGO} ({SHORTCARGO})
 STR_TOTAL_CAPACITY_MULT                                         :{LTBLUE}- {CARGO} ({SHORTCARGO}) (x{NUM})
-STR_0140_NEW_GAME                                               :{BLACK}Alusta mängu
-STR_0141_LOAD_GAME                                              :{BLACK}Laadi mängu
+STR_0140_NEW_GAME                                               :{BLACK}Uus mäng
+STR_0141_LOAD_GAME                                              :{BLACK}Mängu laadimine
 STR_SINGLE_PLAYER                                               :{BLACK}Üksikmängija
 STR_MULTIPLAYER                                                 :{BLACK}Võrgumäng
 STR_SCENARIO_EDITOR                                             :{BLACK}Stsenaariumiredaktor
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Kaardi suurus:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Mängu valikud
@@ -468,7 +462,7 @@
 STR_SORT_CRITERIA_TIP                                           :{BLACK}Sorteerimistingimuse valimine
 STR_SORT_BY                                                     :{BLACK}Sorteeri:
 
-STR_SORT_BY_POPULATION                                          :{BLACK}Rahvastik
+STR_SORT_BY_POPULATION                                          :{BLACK}Rahvaarv
 STR_SORT_BY_PRODUCTION                                          :{BLACK}Toodang
 STR_SORT_BY_TYPE                                                :{BLACK}Tüüp
 STR_SORT_BY_TRANSPORTED                                         :{BLACK}Veetud
@@ -694,6 +688,9 @@
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Ettevõtte teave
 STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Tööstuste avamised ja sulgemised
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Muutused majanduses
+STR_INDUSTRY_CHANGES_SERVED_BY_PLAYER                           :{YELLOW}Mängija poolt teenindavate tööstuste toodangumuutused
+STR_INDUSTRY_CHANGES_SERVED_BY_OTHER                            :{YELLOW}Konkurentide poolt teenindavate tööstuste toodangumuutused
+STR_OTHER_INDUSTRY_PRODUCTION_CHANGES                           :{YELLOW}Ülejäänud tööstuste toodangumuutused
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Soovitused ja teated mängija veovahendite kohta
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Uus veerem
 STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Veoste vastuvõtutingimuste muutumine
@@ -840,8 +837,8 @@
 STR_0297_SAVE_SCENARIO_LOAD_SCENARIO                            :{BLACK}Kaardi salvestamine, kaardi laadimine, kaarditegemisest lahkumine, mängust väljumine
 STR_0298_LOAD_SCENARIO                                          :{WHITE}Laadi stsenaariumit
 STR_0299_SAVE_SCENARIO                                          :{WHITE}Salvesta stsenaarium
-STR_029A_PLAY_SCENARIO                                          :{BLACK}Mängi stsenaariumit
-STR_PLAY_HEIGHTMAP                                              :{BLACK}Mängi kõrguskaardil
+STR_029A_PLAY_SCENARIO                                          :{BLACK}Stsenaariumi mängimine
+STR_PLAY_HEIGHTMAP                                              :{BLACK}Kõrguskaardil mängimine
 STR_PLAY_HEIGHTMAP_HINT                                         :{BLACK}Alusta uut mängu kasutades kõrguskaarti maastikuna
 STR_QUIT_SCENARIO_QUERY                                         :{YELLOW}Kas sa oled kindel, et sa tahad kaardi tegemise lõpetada?
 STR_029C_QUIT_EDITOR                                            :{WHITE}Lahku redaktorist
@@ -875,7 +872,7 @@
 ############ range for menu starts
 STR_02C3_GAME_OPTIONS                                           :Mängu valikud
 STR_02C5_DIFFICULTY_SETTINGS                                    :Raskusastme seadistused
-STR_02C7_CONFIG_PATCHES                                         :Seadista paikasid
+STR_02C7_CONFIG_PATCHES                                         :Paikade seadistamine
 STR_NEWGRF_SETTINGS                                             :NewGRF seadistused
 STR_TRANSPARENCY_OPTIONS                                        :Läbipaistvuse valikud
 STR_GAMEOPTMENU_0A                                              :
@@ -967,7 +964,7 @@
 STR_0319_PAUSED                                                 :{YELLOW}* *  PEATUS  *  *
 
 STR_031B_SCREENSHOT_SUCCESSFULLY                                :{WHITE}Ekraanitõmmis edukalt salvestatud nimega '{STRING}'
-STR_031C_SCREENSHOT_FAILED                                      :{WHITE}Ekraanitõmmise tegemine ebaõnnestus!
+STR_031C_SCREENSHOT_FAILED                                      :{WHITE}Ekraanitõmmise võtmine nurjus!
 
 STR_0329_PURCHASE_LAND_FOR_FUTURE                               :{BLACK}Maa ostmine tulevaseks kasutamiseks
 STR_032F_AUTOSAVE                                               :{RED}AUTOMAATSALVESTUS
@@ -1038,6 +1035,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Täisekraan
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Märgi see kast, et OpenTTD täisekraanirežiimis mängida
+STR_FULLSCREEN_FAILED                                           :{WHITE}Täisekraanrežiim ebaõnnestus
 
 STR_OPTIONS_RES                                                 :{BLACK}Ekraanilahutus
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1048,7 +1046,7 @@
 STR_OPTIONS_SCREENSHOT_FORMAT_TIP                               :{BLACK}Vali kasutatav ekraanipildi vorming
 
 STR_AUTOSAVE_1_MONTH                                            :Iga kuu
-STR_AUTOSAVE_FAILED                                             :{WHITE}Isesalvestus ebaõnnestus
+STR_AUTOSAVE_FAILED                                             :{WHITE}Automaatne salvestus nurjus
 
 STR_MONTH_JAN                                                   :Jaanuar
 STR_MONTH_FEB                                                   :Veebruar
@@ -1107,19 +1105,19 @@
 STR_AIRCRAFT_HAS_INVALID_ENTRY                                  :{WHITE}Õhusõiduki {COMMA} sõidugraafikus on kehtetu jaam
 # end of order system
 
-STR_TRAIN_AUTORENEW_FAILED                                      :{WHITE}Rongi iseuuendamine {COMMA} ebaõnnestus (rahapiirang)
-STR_ROADVEHICLE_AUTORENEW_FAILED                                :{WHITE}Mootorsõiduki iseuuendamine ebaõnnestus {COMMA} (rahapiirang)
-STR_SHIP_AUTORENEW_FAILED                                       :{WHITE}Laeva iseuuendamine ebaõnnestus {COMMA} (rahapiirang)
-STR_AIRCRAFT_AUTORENEW_FAILED                                   :{WHITE}Õhusõiduki iseuuendamine ebaõnnestus{COMMA} (rahapiirang)
+STR_TRAIN_AUTORENEW_FAILED                                      :{WHITE}Rongi {COMMA} automaatne uuendamine nurjus (rahapiirang)
+STR_ROADVEHICLE_AUTORENEW_FAILED                                :{WHITE}Mootorsõiduki {COMMA} automaatne uuendamine nurjus (rahapiirang)
+STR_SHIP_AUTORENEW_FAILED                                       :{WHITE}Laeva {COMMA} automaatne uuendamine nurjus (rahapiirang)
+STR_AIRCRAFT_AUTORENEW_FAILED                                   :{WHITE}Õhusõiduki iseuuendamine nurjus{COMMA} (rahapiirang)
 STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT                            :{WHITE}Rong {COMMA} on peale asendust liiga pikk
 
-STR_CONFIG_PATCHES                                              :{BLACK}Seadista paikasid
-STR_CONFIG_PATCHES_TIP                                          :{BLACK}Seadista paikasid
-STR_CONFIG_PATCHES_CAPTION                                      :{WHITE}Seadista paikasid
+STR_CONFIG_PATCHES                                              :{BLACK}Paikade seadistamine
+STR_CONFIG_PATCHES_TIP                                          :{BLACK}Paikade seadistamine
+STR_CONFIG_PATCHES_CAPTION                                      :{WHITE}Paikade seadistamine
 
 STR_CONFIG_PATCHES_OFF                                          :Väljas
 STR_CONFIG_PATCHES_ON                                           :Sees
-STR_CONFIG_PATCHES_VEHICLESPEED                                 :{LTBLUE}Näita olekuribal veovahendi kiirust: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_VEHICLESPEED                                 :{LTBLUE}Olekuribal näidatakse veovahendi kiirust: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_BUILDONSLOPES                                :{LTBLUE}Luba ehitised nõlvadele ja kallastele: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_AUTOSLOPE                                    :{LTBLUE}Võimalda maastikujunduse teostust majade, rööbaste jms. all (autoslope): {ORANGE}{STRING}
 STR_CONFIG_PATCHES_CATCHMENT                                    :{LTBLUE}Võimalda reaalsemaid veekogu alasid: {ORANGE}{STRING}
@@ -1141,12 +1139,12 @@
 STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :uurides
 STR_CONFIG_PATCHES_MULTIPINDTOWN                                :{LTBLUE}Luba mitu sama liiki tööstust linna kohta: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_SAMEINDCLOSE                                 :{LTBLUE}Sama liiki tööstusi saab ehitada üksteise lähedale: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LONGDATE                                     :{LTBLUE}Alati näita olekuribal pikka kuupäeva: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LONGDATE                                     :{LTBLUE}Olekuribal näidatakse alati täispikka kuupäeva: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_SIGNALSIDE                                   :{LTBLUE}Paiguta signaalid rööbasteele sõidusuunda arvestades: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SHOWFINANCES                                 :{LTBLUE}Näita rahaliste seisude akent iga aasta lõpus: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SHOWFINANCES                                 :{LTBLUE}Aasta lõpus näidatakse rahavoogude aruannet: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_NEW_NONSTOP                                  :{LTBLUE}TTDPatchiga ühilduv 'mittepeatumine': {ORANGE}{STRING}
 STR_CONFIG_PATCHES_ROADVEH_QUEUE                                :{LTBLUE}Mootorsõidukite järjekorrad (koos mahueffektidega): {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AUTOSCROLL                                   :{LTBLUE}Keri vaadet, kui hiir on viidud ekraani serva: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AUTOSCROLL                                   :{LTBLUE}Kursori ekraani serva viimisel keritakse vaadet: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_BRIBE                                        :{LTBLUE}Luba kohalikule omavalitsusele altkäemaksu maksmine: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_ALLOW_EXCLUSIVE                              :{LTBLUE}Luba eksklusiivseid veoõiguseid osta: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_ALLOW_GIVE_MONEY                             :{LTBLUE}Luba teistele ettevõtetele raha saata: {ORANGE}{STRING}
@@ -1169,7 +1167,7 @@
 STR_CONFIG_PATCHES_AUTORENEW_MONTHS                             :{LTBLUE}Uuenda {ORANGE}{STRING}{LTBLUE} kuud enne/pärast veovahendi suurimat vanust
 STR_CONFIG_PATCHES_AUTORENEW_MONEY                              :{LTBLUE}Iseuuendusele kuluv väikseim summa: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_ERRMSG_DURATION                              :{LTBLUE}Veateate kuvamise kestus: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_POPULATION_IN_LABEL                          :{LTBLUE}Näita linna nimesildil rahvaarvu: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_POPULATION_IN_LABEL                          :{LTBLUE}Linna nimesildil näidatakse rahvaarvu: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_INVISIBLE_TREES                              :{LTBLUE}Nähtamatud puud (läbipaistvate ehitistega): {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_LAND_GENERATOR                               :{LTBLUE}Maaala Generaator: {ORANGE}{STRING}
@@ -1194,15 +1192,15 @@
 STR_CONFIG_PATCHES_STATION_SPREAD                               :{LTBLUE}Suurim jaama ala: {ORANGE}{STRING} {RED}Hoiatus: kõrged seadistused aeglustavad mängu
 STR_CONFIG_PATCHES_SERVICEATHELIPAD                             :{LTBLUE}Hoolda maandumisplatsidel ise helikoptereid: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR                       :{LTBLUE}Liida maastikuriba raudtee/tee/vee/lennujaamade tööriistaribaga: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_REVERSE_SCROLLING                            :{LTBLUE}Kui kerid hiirega, liiguta vaade vastassuunda: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SMOOTH_SCROLLING                             :{LTBLUE}Sujuv vaatevälja liigutamine: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MEASURE_TOOLTIP                              :{LTBLUE}Näita mitmesuguste ehitusvahendite kasutamisel mõõtmise kohtspikrit: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_REVERSE_SCROLLING                            :{LTBLUE}Vaadet keritakse vastassuunas: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SMOOTH_SCROLLING                             :{LTBLUE}Vaatevälja liigutatakse sujuvalt: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MEASURE_TOOLTIP                              :{LTBLUE}Mitmete ehitusvahendite kasutamisel näidatakse mõõtmise kohtspikrit: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_LIVERIES                                     :{LTBLUE}Näita firma livree: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_LIVERIES_NONE                                :Mitte ükski
-STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Enda firma
-STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Kõik Firmad
-STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Eelista Meeskonnajututuba <ENTER>i vajutamisega: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Kerimisratta funktsioon: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Enda ettevõte
+STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Kõik ettevõtted
+STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Vajutades <ENTER> eelistatakse meeskonna jututuba: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Kerimisrulliku otstarve: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Suurenda kaarti
 STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Keri kaarti
 STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Väljas
@@ -1266,6 +1264,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Luba teiste ettevõtete aktsiate ostmine
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Venitades rajatavate signaalide paigutustihedus: {ORANGE}{STRING} ühik(ut)
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Ehita ise semaforid enne: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Näita signalisatsiooni GUI-d: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Stsenaariumiredaktor ei tunnista "ilma teedeta" linnaplaneeringut
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Vali linnale teedeplaneering: {ORANGE}{STRING}
@@ -1382,7 +1381,7 @@
 STR_LANDINFO_COORDS                                             :{BLACK}Koordinaadid: {LTBLUE}{NUM}x{NUM}x{NUM} ({STRING})
 
 STR_CANT_REMOVE_PART_OF_STATION                                 :{WHITE}Siinset jaamablokki ei saa lammutada...
-STR_CANT_CONVERT_RAIL                                           :{WHITE}Siin ei saa raudteetüüpi muuta...
+STR_CANT_CONVERT_RAIL                                           :{WHITE}Siin ei saa raudtee tüüpi muuta...
 STR_CONVERT_RAIL_TIP                                            :{BLACK}Muuda/uuenda rööpaliiki
 
 STR_DRAG_WHOLE_TRAIN_TO_SELL_TIP                                :{BLACK}Tõsta vedur siia, et kogu rong maha müüa
@@ -1596,10 +1595,10 @@
 STR_NETWORK_ERR_NOTAVAILABLE                                    :{WHITE} Võrgukaarti ei leitud või kompileeritud ilma võtmeta ENABLE_NETWORK
 STR_NETWORK_ERR_NOSERVER                                        :{WHITE} Ei leidnud ühtegi võrgumängu
 STR_NETWORK_ERR_NOCONNECTION                                    :{WHITE} Server ei vastanud päringule
-STR_NETWORK_ERR_NEWGRF_MISMATCH                                 :{WHITE} Ühendus ebaõnnestus NewGRF-i kokkusobimatuse tõttu
+STR_NETWORK_ERR_NEWGRF_MISMATCH                                 :{WHITE} Ühendus nurjus NewGRF-i kokkusobimatuse tõttu
 STR_NETWORK_ERR_DESYNC                                          :{WHITE} Võrgumäng läks sünkroonist välja
 STR_NETWORK_ERR_LOSTCONNECTION                                  :{WHITE} Võrgumängu ühendus katkes
-STR_NETWORK_ERR_SAVEGAMEERROR                                   :{WHITE} Mängu laadimine ebaõnnestus
+STR_NETWORK_ERR_SAVEGAMEERROR                                   :{WHITE} Mängu laadimine nurjus
 STR_NETWORK_ERR_SERVER_START                                    :{WHITE} Ei saa uut serverit alustada
 STR_NETWORK_ERR_CLIENT_START                                    :{WHITE} Ei õnneust ühendada
 STR_NETWORK_ERR_TIMEOUT                                         :{WHITE} Ühendusel #{NUM} sai aeg otsa
@@ -1703,7 +1702,7 @@
 STR_1005_NO_SUITABLE_RAILROAD_TRACK                             :{WHITE}Sobiv rongitee puudub
 STR_1007_ALREADY_BUILT                                          :{WHITE}...juba ehitatud
 STR_1008_MUST_REMOVE_RAILROAD_TRACK                             :{WHITE}Rööbastee tuleb eelnevalt lammutada
-STR_100A_RAILROAD_CONSTRUCTION                                  :{WHITE}Rööbastee ehitamine
+STR_100A_RAILROAD_CONSTRUCTION                                  :{WHITE}Rööbasteede ehitus
 STR_TITLE_ELRAIL_CONSTRUCTION                                   :{WHITE}Elektrifitseeritud rööbastee ehitus
 STR_100B_MONORAIL_CONSTRUCTION                                  :{WHITE}Monorelsi ehitamine
 STR_100C_MAGLEV_CONSTRUCTION                                    :{WHITE}Elektromageetilise rööbastee ehitamine
@@ -1780,6 +1779,7 @@
 STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}Ehita trammisild
 STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}Ehita tunnel
 STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}Ehita trammitunnel
+STR_TOGGLE_ONE_WAY_ROAD                                         :{BLACK}Lülita ühesuunalised teed sisse/välja
 STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Tee-ehituse ja -lammutamise vahetamine
 STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}Lülitu trammitee ehitamise ja lammutamise vahel
 STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}Vali depoole suund
@@ -1801,9 +1801,10 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Ehitis tuleb eelnevalt hävitada
 STR_2005                                                        :{WHITE}{TOWN}
-STR_2006_POPULATION                                             :{BLACK}Rahvastik: {ORANGE}{COMMA}{BLACK}  Ehitisi: {ORANGE}{COMMA}
+STR_2006_POPULATION                                             :{BLACK}Rahvaarv: {ORANGE}{COMMA}{BLACK}  Ehitisi: {ORANGE}{COMMA}
 STR_2007_RENAME_TOWN                                            :Linnanime muutmine
 STR_2008_CAN_T_RENAME_TOWN                                      :{WHITE}Linnanime ei saa muuta...
 STR_2009_LOCAL_AUTHORITY_REFUSES                                :{WHITE}{TOWN} kohalik omavalitsus keeldub seda lubamast
@@ -2005,7 +2006,7 @@
 STR_STAT_CLASS_WAYP                                             :Meldepunktid
 
 ##id 0x3800
-STR_3800_SHIP_DEPOT_ORIENTATION                                 :{WHITE}Paadikuuri Orientatsioon
+STR_3800_SHIP_DEPOT_ORIENTATION                                 :{WHITE}Laevaangaari suund
 STR_3801_MUST_BE_BUILT_ON_WATER                                 :{WHITE}...peab ehitama vette
 STR_3802_CAN_T_BUILD_SHIP_DEPOT                                 :{WHITE}Siia ei saa laevaangaari ehitada...
 STR_3803_SELECT_SHIP_DEPOT_ORIENTATION                          :{BLACK}Laevaangaarile suuna valimine
@@ -2023,9 +2024,9 @@
 STR_4004                                                        :{COMPANY}, {DATE_LONG}
 STR_4005_BYTES_FREE                                             :{BLACK}{COMMA} megabaiti{P "" i} vaba
 STR_4006_UNABLE_TO_READ_DRIVE                                   :{BLACK}Ei suuda kettalt lugeda
-STR_4007_GAME_SAVE_FAILED                                       :{WHITE}Mängu salvestamine ebaõnnestus{}{STRING}
+STR_4007_GAME_SAVE_FAILED                                       :{WHITE}Mängu salvestamine nurjus{}{STRING}
 STR_4008_UNABLE_TO_DELETE_FILE                                  :{WHITE}Faili ei saa kustutada
-STR_4009_GAME_LOAD_FAILED                                       :{WHITE}Mängu laadimine ebaõnnestus{}{STRING}
+STR_4009_GAME_LOAD_FAILED                                       :{WHITE}Mängu laadimine nurjus{}{STRING}
 STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR                   :Süsteemi viga: {STRING}
 STR_GAME_SAVELOAD_ERROR_BROKEN_SAVEGAME                         :Katkine salvestus - {STRING}
 STR_GAME_SAVELOAD_ERROR_TOO_NEW_SAVEGAME                        :Salvestus on tehtud uuemas versioonis
@@ -2227,7 +2228,7 @@
 ############ range for difficulty settings starts
 STR_6805_MAXIMUM_NO_COMPETITORS                                 :{LTBLUE}Suurim konkurentide arv: {ORANGE}{COMMA}
 STR_6806_COMPETITOR_START_TIME                                  :{LTBLUE}Konkurentide tulemise aeg: {ORANGE}{STRING}
-STR_6807_NO_OF_TOWNS                                            :{LTBLUE}Linnade arv: {ORANGE}{STRING}
+STR_6807_NO_OF_TOWNS                                            :{LTBLUE}Linnade sagedus: {ORANGE}{STRING}
 STR_6808_NO_OF_INDUSTRIES                                       :{LTBLUE}Tööstuste arv: {ORANGE}{STRING}
 STR_6809_MAXIMUM_INITIAL_LOAN_000                               :{LTBLUE}Suurim alustuslaen: {ORANGE}{CURRENCY}
 STR_680A_INITIAL_INTEREST_RATE                                  :{LTBLUE}Intress alguses: {ORANGE}{COMMA}%
@@ -2405,6 +2406,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Salasõna
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Ettevõtte kaitsmine salasõnaga, et võõrad ei saaks ilma loata ühineda.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Vali ettevõttele salasõna
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Sisestatud salasõna ei salvestata
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Määra ettevõtte uus salasõna
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Ettevõtte salasõna
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Vaikimisi määratud ettevõtte salasõna
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Kasuta selle ettevõtte salasõna uute ettevõtete vaikimisi määratud salasõnana
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Majanduslik tagasilöök!{}{}Finantseksperdid ennustavad suurt majanduslangust!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Madalseis on läbi!{}{}Suurem kauplemine julgustab majanduse tugevnemisega ettevõtteid!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Lülita aken suureks/väikseks
@@ -2713,7 +2719,7 @@
 STR_8103_ROAD_VEHICLE                                           :mootorsõiduk
 STR_8104_AIRCRAFT                                               :lennuk
 STR_8105_SHIP                                                   :laev
-STR_8106_MONORAIL_LOCOMOTIVE                                    :monorelsivedur
+STR_8106_MONORAIL_LOCOMOTIVE                                    :monorelssvedur
 STR_8107_MAGLEV_LOCOMOTIVE                                      :maglevivedur
 
 ##id 0x8800
@@ -2765,20 +2771,20 @@
 STR_881A_TRAINS_CAN_ONLY_BE_ALTERED                             :{WHITE}Ronge saab ainult siis muuta kui nad on peatatud depoo sees
 STR_881B_TRAINS                                                 :{WHITE}{COMPANY} - {COMMA} rong{P "" i}
 
-STR_881C_NEW_RAIL_VEHICLES                                      :{WHITE}Uus raudteeveerem
+STR_881C_NEW_RAIL_VEHICLES                                      :{WHITE}Uued rööbassõidukid
 STR_NEW_ELRAIL_VEHICLES                                         :{WHITE}Uus elektriraudteeveerem
 STR_881D_NEW_MONORAIL_VEHICLES                                  :{WHITE}Uued monorelsi sõidukid
 STR_881E_NEW_MAGLEV_VEHICLES                                    :{WHITE}Uus maglevi sõiduk
-STR_ALL_AVAIL_RAIL_VEHICLES                                     :{WHITE}Raudteesõidukid
+STR_ALL_AVAIL_RAIL_VEHICLES                                     :{WHITE}Rööbassõidukid
 
 STR_881F_BUILD_VEHICLE                                          :{BLACK}Ehita veovahend
-STR_CLONE_ROAD_VEHICLE                                          :{BLACK}Klooni veovahendit
+STR_CLONE_ROAD_VEHICLE                                          :{BLACK}Kloonimine
 STR_CLONE_ROAD_VEHICLE_INFO                                     :{BLACK}See paljundab mootorsõidukit. CTRL-klõps jagab sihtpunkte
 STR_CLONE_ROAD_VEHICLE_DEPOT_INFO                               :{BLACK}See paljundab mootorsõidukit. Klõpsa seda nuppu, ning seejärel mootorsõidukil depoos või sellest väljas. CTRL-klõps jagab sihtpunkte
 STR_CLONE_TRAIN                                                 :{BLACK}Klooni rong
 STR_CLONE_TRAIN_INFO                                            :{BLACK}See ehitab koopia rongist koos kõikide vagunitega. CTRL-klikk jagab sihtpunkte
 STR_CLONE_TRAIN_DEPOT_INFO                                      :{BLACK}See ehitab koopia rongist koos kõikide vagunitega. Vajuta sellele nuppule, ning seejärel rongile depoo sees või väljas. CTRL-klikk jagab sihtpunkte
-STR_8820_RENAME                                                 :{BLACK}Muuda nime
+STR_8820_RENAME                                                 :{BLACK}Nime muutmine
 STR_8823_SKIP                                                   :{BLACK}Jäta vahele
 STR_8824_DELETE                                                 :{BLACK}Kustuta
 STR_8825_NON_STOP                                               :{BLACK}Peatusteta
@@ -2794,7 +2800,7 @@
 STR_882A_END_OF_ORDERS                                          :{SETX 10}- - Käskude Lõpp - -
 STR_FULLLOAD_OR_SERVICE                                         :{SKIP}{SKIP}{STRING}
 STR_SERVICE                                                     :{BLACK}Hooldus
-STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE                           :{WHITE}Raudteesõidukit ei saa ehitada...
+STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE                           :{WHITE}Rööbassõidukit ei saa ehitada...
 STR_882C_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Ehitatud: {LTBLUE}{NUM}{BLACK} Väärtus: {LTBLUE}{CURRENCY}
 STR_882D_VALUE                                                  :{LTBLUE}{ENGINE}{BLACK}   Väärtus: {LTBLUE}{CURRENCY}
 STR_882E                                                        :{WHITE}{VEHICLE}
@@ -2812,7 +2818,7 @@
 STR_8837_CAN_T_MOVE_VEHICLE                                     :{WHITE}Transpordivahendit ei saa liigutada...
 STR_REAR_ENGINE_FOLLOW_FRONT_ERROR                              :{WHITE}Tagumine vedur järgneb alati eesmisele
 STR_8838_N_A                                                    :N/A{SKIP}
-STR_8839_CAN_T_SELL_RAILROAD_VEHICLE                            :{WHITE}Raudteesõidukit ei saa müüa...
+STR_8839_CAN_T_SELL_RAILROAD_VEHICLE                            :{WHITE}Rööbassõidukit ei saa müüa...
 STR_883A_UNABLE_TO_FIND_ROUTE_TO                                :{WHITE}Ei leia teed kohalikku depoosse
 STR_883B_CAN_T_STOP_START_TRAIN                                 :{WHITE}Ei saa peatada/startida rongi...
 STR_883C_SERVICING_INTERVAL_DAYS                                :{BLACK}Hooldusperiood: {LTBLUE}{COMMA} päeva{BLACK}  Viimati hooldatud: {LTBLUE}{DATE_LONG}
@@ -2885,6 +2891,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Uus {STRING} saadaval!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Hävinenud sõidukit ei saa müüa...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Hävitatud sõidukit pole võimalik ümber seadistada...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Sõidukile ei saa sõiduplaani anda...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Sõidukid saavad ainult peatustes oodata.
@@ -2903,7 +2910,7 @@
 STR_9001_ROAD_VEHICLES                                          :{WHITE}{COMPANY} - {COMMA} mootorsõiduk{P "" it}
 STR_9002                                                        :{WHITE}{VEHICLE}
 STR_9003_ROAD_VEHICLE_DEPOT                                     :{WHITE}Linna {TOWN} mootorsõidukidepoo
-STR_9004_NEW_VEHICLES                                           :{BLACK}Uus mootorsõiduk
+STR_9004_NEW_VEHICLES                                           :{BLACK}Ostmine
 STR_9006_NEW_ROAD_VEHICLES                                      :{WHITE}Uued mootorsõidukid
 STR_9007_BUILD_VEHICLE                                          :{BLACK}Ehita veovahend
 STR_9009_CAN_T_BUILD_ROAD_VEHICLE                               :{WHITE}Mootorsõidukit ei saa ehitada...
@@ -2922,8 +2929,8 @@
 STR_HEADING_FOR_ROAD_DEPOT_VEL                                  :{ORANGE}Suundub {TOWN} garaaþi, {VELOCITY}
 STR_HEADING_FOR_ROAD_DEPOT_SERVICE                              :{LTBLUE}Hooldus linna {TOWN} depoos
 STR_HEADING_FOR_ROAD_DEPOT_SERVICE_VEL                          :{LTBLUE}Hooldus linna {TOWN} depoos, {VELOCITY}
-STR_9018_CAN_T_SEND_VEHICLE_TO_DEPOT                            :{WHITE}Ei saa veokit garaaþi saata
-STR_9019_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Ei leia kohalikku garaaþi üles
+STR_9018_CAN_T_SEND_VEHICLE_TO_DEPOT                            :{WHITE}Ei saa veokit garaaži saata
+STR_9019_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Ei leia kohalikku garaaži üles
 STR_901A_ROAD_VEHICLES_CLICK_ON                                 :{BLACK}Veokid - info saamiseks vajuta veokile
 STR_901B_BUILD_NEW_ROAD_VEHICLES                                :{BLACK}Osta uus veok (vajab garaaþi)
 STR_901C_CURRENT_VEHICLE_ACTION                                 :{BLACK}Transpordivahendi praegune tegevus - selle peatamiseks või startimiseks klõpsa siia
@@ -2953,11 +2960,11 @@
 STR_9032_ROAD_VEHICLE_CRASH_DIE                                 :{BLACK}{BIGFONT}Mootorsõiduki kokkupõrge rongiga!{}{COMMA} inimest suri õnnetuses
 STR_9033_CAN_T_MAKE_VEHICLE_TURN                                :{WHITE}Transpordivahendit ei saa ümber pöörata...
 STR_ONLY_TURN_SINGLE_UNIT                                       :{WHITE}Mitmest osast koosnevaid veovahendeid ei saa ümber pöörata
-STR_9034_RENAME                                                 :{BLACK}Muuda nime
+STR_9034_RENAME                                                 :{BLACK}Nime muutmine
 STR_9035_RENAME_ROAD_VEHICLE_TYPE                               :{BLACK}Muuda mootorsõiduki tüübinime
 STR_9036_RENAME_ROAD_VEHICLE_TYPE                               :{WHITE}Muuda mootorsõiduki tüübinime
 STR_9037_CAN_T_RENAME_ROAD_VEHICLE                              :{WHITE}Mootorsõiduki tüübinime ei saa muuta...
-STR_9038_GO_TO_ROADVEH_DEPOT                                    :Mine linna {TOWN} garaaþi
+STR_9038_GO_TO_ROADVEH_DEPOT                                    :Mine linna {TOWN} garaaži
 STR_SERVICE_AT_ROADVEH_DEPOT                                    :Hoolda linna {TOWN} mootorsõidukidepoos
 
 STR_REFIT_ROAD_VEHICLE_TO_CARRY                                 :{BLACK}Seadista mootorsõidukit kandmaks teist tüüpi veost
@@ -2970,7 +2977,7 @@
 STR_9800_DOCK_CONSTRUCTION                                      :Sadamaehitus
 STR_9801_DOCK_CONSTRUCTION                                      :{WHITE}Sadama ehitus
 STR_9802_CAN_T_BUILD_DOCK_HERE                                  :{WHITE}Siia ei saa sadamat ehitada
-STR_9803_SHIP_DEPOT                                             :{WHITE}{TOWN} Paadikuur
+STR_9803_SHIP_DEPOT                                             :{WHITE}{TOWN} Laevaangaar
 STR_9804_NEW_SHIPS                                              :{BLACK}Uus laev
 STR_9805_SHIPS                                                  :{WHITE}{COMPANY} - {COMMA} laev{P "" a}
 STR_9808_NEW_SHIPS                                              :{WHITE}Uued laevad
@@ -2991,15 +2998,15 @@
 STR_9816_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Ehitati: {LTBLUE}{NUM}{BLACK} Väärtus: {LTBLUE}{CURRENCY}
 STR_9817_CAPACITY                                               :{BLACK}Kandevõime: {LTBLUE}{CARGO}
 STR_9818_CAN_T_STOP_START_SHIP                                  :{WHITE}Ei saa peatada/käivitada laeva...
-STR_9819_CAN_T_SEND_SHIP_TO_DEPOT                               :{WHITE}Ei saa laeva paadikuuri saata...
-STR_981A_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Ei leia kohalikku paadikuuri
+STR_9819_CAN_T_SEND_SHIP_TO_DEPOT                               :{WHITE}Ei saa laeva angaari saata...
+STR_981A_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Ei leia kohalikku laevaangaari
 STR_HEADING_FOR_SHIP_DEPOT                                      :{ORANGE}Suundub {TOWN}a paadikuuri
 STR_HEADING_FOR_SHIP_DEPOT_VEL                                  :{ORANGE}Suundub {TOWN}a paadikuuri, {VELOCITY}
 STR_HEADING_FOR_SHIP_DEPOT_SERVICE                              :{LTBLUE}Hooldus linna {TOWN} sadamas
 STR_HEADING_FOR_SHIP_DEPOT_SERVICE_VEL                          :{LTBLUE}Hooldus linna {TOWN} sadamas, {VELOCITY}
 STR_981C_SHIP_IS_WAITING_IN_DEPOT                               :{WHITE}Laev {COMMA} ootab sadamas
 STR_981D_BUILD_SHIP_DOCK                                        :{BLACK}Ehita laevakuur
-STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING                          :{BLACK}Ehita laevakuur (laevade ehitamiseks ja hoolduseks)
+STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING                          :{BLACK}Ehita laevaangaar (laevade ehitamiseks ja hoolduseks)
 STR_981F_SHIPS_CLICK_ON_SHIP_FOR                                :{BLACK}Laevad - info saamiseks klõpsa laevale
 STR_9820_BUILD_NEW_SHIP                                         :{BLACK}Ehita uus laev
 STR_9821_DRAG_SHIP_TO_HERE_TO_SELL                              :{BLACK}Müügiks tiri laev siia
@@ -3011,7 +3018,7 @@
 STR_9827_CURRENT_SHIP_ACTION_CLICK                              :{BLACK}Praegune laeva tegevus - vajuta siia, et peatada/käivitada laeva
 STR_9828_SHOW_SHIP_S_ORDERS                                     :{BLACK}Näita laeva sihtpunkte
 STR_9829_CENTER_MAIN_VIEW_ON_SHIP                               :{BLACK}Vii vaade laeva asukohale
-STR_982A_SEND_SHIP_TO_DEPOT                                     :{BLACK}Saada laev paadikuuri
+STR_982A_SEND_SHIP_TO_DEPOT                                     :{BLACK}Saada laev angaari. CTRL+klikk ainult teenindab.
 STR_982B_SHOW_SHIP_DETAILS                                      :{BLACK}Näita laeva detaile
 STR_982E_COST_MAX_SPEED_CAPACITY                                :{BLACK}Hind: {CURRENCY} Tippkiirus: {VELOCITY}{}Kandevõime: {CARGO}{}Käituskulud: {CURRENCY}/aastas
 STR_982F_NAME_SHIP                                              :{BLACK}Anna laevale nimi
@@ -3021,7 +3028,7 @@
 STR_9833_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Rahvas rõõmustab . . .{}{STATION} terminali saabus esimene laev!
 STR_9834_POSITION_BUOY_WHICH_CAN                                :{BLACK}Raja teemärgisena kasutatav poi
 STR_9835_CAN_T_POSITION_BUOY_HERE                               :{WHITE}Poid ei saa siia asetada...
-STR_9836_RENAME                                                 :{BLACK}Muuda nime
+STR_9836_RENAME                                                 :{BLACK}Nime muutmine
 STR_9837_RENAME_SHIP_TYPE                                       :{BLACK}Nimeta laeva tüüp ümber
 STR_9838_RENAME_SHIP_TYPE                                       :{WHITE}Nimeta laeva tüüp ümber
 STR_9839_CAN_T_RENAME_SHIP_TYPE                                 :{WHITE}Ei saa laeva tüüpi ümber nimetada...
@@ -3035,7 +3042,7 @@
 STR_9841_CAN_T_REFIT_SHIP                                       :{WHITE}Ei saa laeva ümber seadistada...
 STR_9842_REFITTABLE                                             :(ümberseadistatav)
 STR_GO_TO_SHIP_DEPOT                                            :Mine {TOWN} paadikuuri
-SERVICE_AT_SHIP_DEPOT                                           :Hooldus {TOWN} paadikuuris
+SERVICE_AT_SHIP_DEPOT                                           :Hooldus {TOWN} laevaangaaris
 
 ##id 0xA000
 STR_A000_AIRPORTS                                               :{WHITE}Lennuväljad
@@ -3094,7 +3101,7 @@
 STR_A034_PLANE_CRASH_DIE_IN_FIREBALL                            :{BLACK}{BIGFONT}Lennuõnnetus!{}{COMMA} surid tules {STATION}s
 STR_PLANE_CRASH_OUT_OF_FUEL                                     :{BLACK}{BIGFONT}Lennuõnnetus!{}Lennukil lõppes kütus, {COMMA} surid tules!
 STR_A036                                                        :{TINYFONT}{BLACK}{STATION}
-STR_A037_RENAME                                                 :{BLACK}Muuda nime
+STR_A037_RENAME                                                 :{BLACK}Nime muutmine
 STR_A038_RENAME_AIRCRAFT_TYPE                                   :{BLACK}Nimeta lennuki tüüp ümber
 STR_A039_RENAME_AIRCRAFT_TYPE                                   :{WHITE}Nimeta lennuki tüüp ümber
 STR_A03A_CAN_T_RENAME_AIRCRAFT_TYPE                             :{WHITE}Ei saa lennuki tüüpi ümber nimetada...
@@ -3205,6 +3212,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Puuduvatele failidele on laaditud ühilduvad GRF failid
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Puuduvad GRF failid on välja lülitatud
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Mängu laadimiseks puudu olevad GRF failid
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Puuduolevad GRF failid
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Pausi lõpetamine võib põhjustada OpenTTD krahhi. Ära teavita järgnevatest krahhidest.{}Oled sa tõepoolest veendunud, et sa soovid pausi lõpetada?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Isiklik valuuta
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Vahetuskurss: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3245,7 +3254,7 @@
 STR_DEPOT_SELL_ALL_BUTTON_AIRCRAFT_TIP                          :{BLACK}Müü kõik lennukid angaarist
 
 STR_DEPOT_VEHICLE_ORDER_LIST_TRAIN_TIP                          :{BLACK}Võta nimekiri kõikidest rongidest selles jaamas nende käskude järgi
-STR_DEPOT_VEHICLE_ORDER_LIST_ROADVEH_TIP                        :{BLACK}Hangi kõikidest autodest nimekiri, kus käskude all on nende praegune depoo
+STR_DEPOT_VEHICLE_ORDER_LIST_ROADVEH_TIP                        :{BLACK}Hangi kõikidest autodest nimekiri, kus praegune depoo on üks sihtpunktidest
 STR_DEPOT_VEHICLE_ORDER_LIST_SHIP_TIP                           :{BLACK}Võta nimekiri kõikidest laevadest selles sadamas nende käskude järgi
 STR_DEPOT_VEHICLE_ORDER_LIST_AIRCRAFT_TIP                       :{BLACK}Võta nimekiri kõikidest lennukitest suvalistest angaaridest selles lennujaamas nende käskude järgi
 
@@ -3332,21 +3341,21 @@
 ########### String for New Landscape Generator
 
 STR_GENERATE                                                    :{WHITE}Tekita
-STR_RANDOM                                                      :{BLACK}Muuda suvaliseks
+STR_RANDOM                                                      :{BLACK}Suvaline
 STR_RANDOM_HELP                                                 :{BLACK}Muuda maastiku loomisel kasutatavat suvalist seemet
 STR_WORLD_GENERATION_CAPTION                                    :{WHITE}Maailma genereerimine
 STR_RANDOM_SEED                                                 :{BLACK}Juhuarv:
 STR_RANDOM_SEED_HELP                                            :{BLACK}Klõpsa juhuarvu sisestamiseks
 STR_LAND_GENERATOR                                              :{BLACK}Maa generaator:
-STR_TREE_PLACER                                                 :{BLACK}Puu algoritm:
+STR_TREE_PLACER                                                 :{BLACK}Puude algoritm:
 STR_HEIGHTMAP_ROTATION                                          :{BLACK}Kõrgustekaardi pööre:
 STR_TERRAIN_TYPE                                                :{BLACK}Maapinna tüüp:
 STR_QUANTITY_OF_SEA_LAKES                                       :{BLACK}Merepinna tase:
 STR_SMOOTHNESS                                                  :{BLACK}Tasapinnalisus:
 STR_SNOW_LINE_HEIGHT                                            :{BLACK}Lumepiiri kõrgus:
 STR_DATE                                                        :{BLACK}Algus:
-STR_NUMBER_OF_TOWNS                                             :{BLACK}Linnade arv:
-STR_NUMBER_OF_INDUSTRIES                                        :{BLACK}Tehaste arv
+STR_NUMBER_OF_TOWNS                                             :{BLACK}Linnade sagedus:
+STR_NUMBER_OF_INDUSTRIES                                        :{BLACK}Tehaste sagedus:
 STR_GENERATE_DATE                                               :{BLACK}{DATE_LONG}
 STR_SNOW_LINE_UP                                                :{BLACK}Liiguta lumepiiri ühe ühiku võrra üles
 STR_SNOW_LINE_DOWN                                              :{BLACK}Liiguta lumepiiri ühe ühiku võrra alla
@@ -3356,7 +3365,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Kaardi suuruse muutmine pole soovitatav. Jätka?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Linnaplaneerimise hoiatus
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Linnaplaneeringut "ilma teedeta" ei ole soovitatav kasutada. Jätkata selle tekitamisega?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Kõrgusekaardi nimi:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Suurus: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Maailma genereerimine...
@@ -3382,9 +3390,9 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Liiguta lameda maa kõrgus ühe võrra üles
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Muuda maa kõrgust lamedal maal
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Lameda maa kõrgus:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Vii väikekaart praegusele asukohale
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
 
 ########### String for new airports
 STR_SMALL_AIRPORT                                               :{BLACK}Väike
@@ -3515,7 +3523,7 @@
 STR_FACE_YES                                                    :Jah
 STR_FACE_NO                                                     :Ei
 STR_FACE_MOUSTACHE_EARRING_TIP                                  :{BLACK}Vuntsid või kõrvarõngad on lubatud
-STR_FACE_HAIR                                                   :Juuksed:
+STR_FACE_HAIR                                                   :Soeng:
 STR_FACE_HAIR_TIP                                               :{BLACK}Vaheta juukseid
 STR_FACE_EYEBROWS                                               :Kulmud:
 STR_FACE_EYEBROWS_TIP                                           :{BLACK}Vaheta kulmusid
@@ -3539,3 +3547,20 @@
 STR_FACE_EARRING                                                :Kõrvarõngas:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Vaheta kraed või kõrvarõngast
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Signalisatsiooni valimine
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Siin ei saa signalisatsiooni teisendada...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Läbisõidusignalisatsioon (semafor){}Signalisatsiooni läheb tarvis vältimaks kokkupõrkeid enam kui ühe rongiga rööbasteedel.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Sissesõidusignalisatsioon (semafor){}Roheline, kuni vähemalt üks väljasõidusignalisatsioon on roheline. Muudel juhtudel näitab punast.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Väljasõidusignalisatsioon (semafor){}Käitub samamoodi, nagu tavapärane signalsatsioon, kuid läheb vaja et sissesõidu- ja mitmikeelsignaalid näitaksid õiget värvi.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Mitmiksignalisatsioon (semafor){}Mitmiksignalisatsioon toimib nii sissesõidu-, kui ka läbisõidusignalisatsioonina. See võimaldab ehitada laialiulatuvaid sissesõidusignalisatsioonide
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Läbisõidusignalisatsioon (elektriline){}Signalisatsiooni läheb tarvis vältimaks kokkupõrkeid enam kui ühe rongiga rööbasteedel.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Sissesõidusignalisatsioon (elektriline){}Roheline, kuni vähemalt üks väljasõidusignalisatsioon on roheline. Muudel juhtudel näitab punast.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Väljasõidusignalisatsioon (elektriline){}Käitub samamoodi, nagu tavapärane signalsatsioon, kuid läheb vaja et sissesõidu- ja mitmikeelsignaalid näitaksid õiget värvi.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Mitmiksignalisatsioon (elektriline){}Mitmiksignalisatsioon toimib nii sissesõidu-, kui ka läbisõidusignalisatsioonina. See võimaldab ehitada laialiulatuvaid sissesõidusignalisatsioonide harusid.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Signalisatsiooni teisendamine{}Kui see on valitud, siis olemasolevad signalisatsioonil klõpsates teisendatakse see määratud signalisatsioonitüübiks ja -variandiks. Samal ajal CTRL klahvi all hoides lülitutakse olemasoleva variandi vahel.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Signalisatsioonide sagedus lohistades
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Vähenda signalisatsioonide sagedust lohistades
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Suurenda signalisatsioonide sagedust lohistades
+########
--- a/src/lang/finnish.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/finnish.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -160,7 +160,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Aluetta ei voi tyhjentää....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Alkuperäiset oikeudet {COPYRIGHT} 1995 Chris Sawyer, kaikki oikeudet pidätetään
 STR_00B7_VERSION                                                :{BLACK}OpenTTD-versio {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 The OpenTTD team
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 The OpenTTD team
 STR_TRANSLATED_BY                                               :{BLACK}  Kääntäjä(t) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Moninpeli
 STR_SCENARIO_EDITOR                                             :{BLACK}Maisemaeditori
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Kartan koko:
 STR_BY                                                          :{BLACK}×
 STR_0148_GAME_OPTIONS                                           :{BLACK}Pelin asetukset
@@ -3243,7 +3237,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Lähdekartan koon liiallinen muuttaminen ei ole suositeltavaa. Haluatko jatkaa?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Varoitus tiekaavasta
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Tiekaavaa "ei uusia teitä" ei suositella. Jatketaanko?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Korkeuskartan nimi:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Koko: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Maailmaa luodaan...
@@ -3269,7 +3262,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Siirrä tasaista maata yksi ylöspäin
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Vaihda tasaisen maan korkeutta
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Tasaisen maan korkeus:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Keskitä pieni kartta tähän paikkaan
 
--- a/src/lang/french.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/french.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -161,7 +161,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Impossible de démolir....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Copyright original {COPYRIGHT} 1995 Chris Sawyer, Tous droits réservés
 STR_00B7_VERSION                                                :{BLACK}OpenTTD version {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 L'équipe OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 L'équipe OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK}  Traducteur(s) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -300,12 +300,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Mode Multijoueur
 STR_SCENARIO_EDITOR                                             :{BLACK}Éditeur de Scénario
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Taille de la carte :
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Options
@@ -433,7 +427,7 @@
 STR_0171_PAUSE_GAME                                             :{BLACK}Mettre le jeu en pause
 STR_0172_SAVE_GAME_ABANDON_GAME                                 :{BLACK}Sauvegarder, abandonner, quitter
 STR_0173_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Afficher la liste des stations de la compagnie
-STR_0174_DISPLAY_MAP                                            :{BLACK}Afficher la carte
+STR_0174_DISPLAY_MAP                                            :{BLACK}Afficher la carte, vue supplémentaire ou liste des panneaux
 STR_0175_DISPLAY_MAP_TOWN_DIRECTORY                             :{BLACK}Afficher la carte, annuaire des villes
 STR_0176_DISPLAY_TOWN_DIRECTORY                                 :{BLACK}Afficher l'annuaire des villes
 STR_0177_DISPLAY_COMPANY_FINANCES                               :{BLACK}Afficher les informations financières
@@ -733,6 +727,7 @@
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Placer un Transmetteur
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Définir une zone désertique.{}Garder Ctrl enfoncé pour retrait
 STR_CREATE_LAKE                                                 :{BLACK}Définir une zone d'eau.{}Construit un canal, si Ctrl est enfoncé au niveau de la mer, le voisinage sera innondé.
+STR_CREATE_RIVER                                                :{BLACK}Placer des rivières.
 STR_0290_DELETE                                                 :{BLACK}Supprimer
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Supprimer complètement cette ville
 STR_0292_SAVE_SCENARIO                                          :Sauvegarder scénario
@@ -855,7 +850,7 @@
 STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE                            :{BLACK}Sélectionner l'environnement 'Arctique'
 STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE                          :{BLACK}Sélectionner l'environnement 'Tropical'
 STR_0311_SELECT_TOYLAND_LANDSCAPE                               :{BLACK}Sélectionner l'environnement 'Monde des jouets'
-STR_0312_FUND_CONSTRUCTION_OF_NEW                               :{BLACK}Financer la construction de nouvelles industries
+STR_0312_FUND_CONSTRUCTION_OF_NEW                               :{BLACK}Financer la construction de nouvelles industries ou liste les industries
 
 ############ range for menu starts
 STR_INDUSTRY_DIR                                                :Annuaire des industries
@@ -941,7 +936,8 @@
 STR_OPTIONS_LANG_TIP                                            :{BLACK}Sélectionner la langue d'interface à utiliser
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Plein écran
-STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Cocher cette case pour jouer à OpenTTD plein écran
+STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Cocher cette case pour jouer à OpenTTD en plein écran
+STR_FULLSCREEN_FAILED                                           :{WHITE}Echec du mode plein écran
 
 STR_OPTIONS_RES                                                 :{BLACK}Résolution
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -2312,6 +2308,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Mot de passe
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Permet de protéger par mot de passe votre compagnie pour empêcher des utilisateurs non-autorisés de rejoindre. Utilisez '*' pour vider le mot de passe.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Choisir le mot de passe de la compagnie
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Ne pas sauver le mot de passe entré
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Donner un nouveau mot de passe à la compagnie
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Mot de passe de compagnie
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Mot de passe de compagnie par défaut
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Utiliser ce mot de passe de compagnie comme défaut pour les nouvelles compagnies
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Récession mondiale!{}{}Les experts financiers craignent le pire!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Fin de la récession!{}{}La reprise redonne confiance aux industries!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Bascule entre une grande/petite fenêtre
@@ -2337,6 +2338,8 @@
 STR_LIVERY_PASSENGER_WAGON_STEAM                                :Voiture (Vapeur)
 STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Voiture (Diesel)
 STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Voiture (Electrique)
+STR_LIVERY_PASSENGER_WAGON_MONORAIL                             :Voiture (Monorail)
+STR_LIVERY_PASSENGER_WAGON_MAGLEV                               :Voiture (Maglev)
 STR_LIVERY_FREIGHT_WAGON                                        :Wagon
 STR_LIVERY_BUS                                                  :Bus
 STR_LIVERY_TRUCK                                                :Camion
@@ -2792,6 +2795,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Nouv{G eau el elle} {STRING} disponible!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Impossible de vendre le véhicule détruit...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Impossible de réaménager un véhicule détruit...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Impossible d'affecter un horaire au véhicule...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Les véhicules ne peuvent attendre qu'aux stations.
@@ -3112,6 +3116,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}GRF(s) compatible(s) chargé(s) pour les fichiers absents
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Fichier(s) GRF absent(s) désactivés
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Fichier(s) GRF absent(s) pour pouvoir charger la partie
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Fichier(s) GRF manquant(s)
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Retirer la pause peut faire planter OpenTTD. Ne créez pas de rapport de bug pour ceux-ci.{}Voulez-vous vraiment retirer la pause?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Devise personnalisée
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Taux de change : {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3236,6 +3242,12 @@
 STR_PURCHASE_INFO_ALL_BUT                                       :Tous sauf {GOLD}
 STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Effort de traction max.: {GOLD}{FORCE}
 
+########### For showing numbers in widgets
+
+STR_NUM_1                                                       :{BLACK}{SKIP}{NUM}
+STR_NUM_2                                                       :{BLACK}{SKIP}{SKIP}{NUM}
+STR_NUM_3                                                       :{BLACK}{SKIP}{SKIP}{SKIP}{NUM}
+
 ########### String for New Landscape Generator
 
 STR_GENERATE                                                    :{WHITE}Créer
@@ -3263,7 +3275,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Trop redimensionner la carte source n'est pas recommandé. Continuer la génération ?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Avertissement schéma de ville
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Le schéma de ville "pas de routes" n'est pas recommandé.  Voulez-vous poursuivre la génération?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Nom de la carte d'altitude :
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Taille: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Création du monde...
@@ -3289,7 +3300,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Augmenter l'altitude du terrain plat
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Modifier l'altitude du terrain plat
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Altitude du terrain plat :
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centrer la carte sur la position actuelle
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
--- a/src/lang/galician.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/galician.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -160,7 +160,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Non podes limpar esta área....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Copyright Orixinal {COPYRIGHT} 1995 Chris Sawyer, Tódolos dereitos reservados
 STR_00B7_VERSION                                                :{BLACK}OpenTTD versión {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 O Equipo de OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 O Equipo de OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK}  Traductor(es) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Multixogador
 STR_SCENARIO_EDITOR                                             :{BLACK}Editor De Escenarios
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Tamaño do mapa:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Opcións da Partida
@@ -2577,7 +2571,12 @@
 STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{ENGINE}
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}¡Nova{STRING} dispoñible!  -  {ENGINE}
 
+STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Non se pode vender un vehículo destruido...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Non se pode actualizar un vehículo destruido...
 
+STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Os vehículos só poden parar nas estacións.
+STR_TIMETABLE_NOT_STOPPING_HERE                                 :{WHITE}Este vehículo non para nesta estación.
+STR_TIMETABLE_CHANGE_TIME                                       :{BLACK}Cambiar Tempo
 
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Haí un vehículo de estrada no camiño
@@ -2786,6 +2785,7 @@
 STR_GO_TO_AIRPORT_HANGAR                                        :Ir ó hangar de {STATION}
 SERVICE_AT_AIRPORT_HANGAR                                       :Face-lo servicio no hangar de {STATION}
 
+STR_TIMETABLE_TITLE                                             :{WHITE}{VEHICLE} (Táboa de tempo)
 
 ##id 0xB000
 STR_B000_ZEPPELIN_DISASTER_AT                                   :{BLACK}{BIGFONT}¡Desastre cun Zeppelin en {STATION}!
@@ -2840,6 +2840,8 @@
 STR_NEWGRF_ERROR_MSG_WARNING                                    :{RED}Aviso: {SILVER}{STRING}
 STR_NEWGRF_ERROR_MSG_ERROR                                      :{RED}Erro: {SILVER}{STRING}
 STR_NEWGRF_ERROR_UNSET_SWITCH                                   :{STRING} está deseñado para ser usado con {STRING}
+STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} debe cargarse antes de {STRING}.
+STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} debe cargarse despois de {STRING}.
 
 STR_NEWGRF_ADD                                                  :{BLACK}Engadir
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Engadir un novo arquivo NewGRF á lista
@@ -2849,8 +2851,13 @@
 STR_NEWGRF_MOVEUP_TIP                                           :{BLACK}Move-lo arquivo NewGRF seleccionado arriba na lista
 STR_NEWGRF_MOVEDOWN                                             :{BLACK}Baixar
 STR_NEWGRF_MOVEDOWN_TIP                                         :{BLACK}Move-lo arquivo NewGRF seleccionado abaixo na lista
+STR_NEWGRF_FILE_TIP                                             :{BLACK}Lista dos ficheiros NewGRF instalados. Pincha nun ficheiro para cambiar os parámetros
 STR_NEWGRF_PARAMETER                                            :{BLACK}Parámetros: {SILVER}{STRING}
 
+STR_NEWGRF_ADD_FILE                                             :{BLACK}Engadir á selección
+STR_NEWGRF_RESCAN_FILES                                         :{BLACK}Actualizar ficheiros
+STR_NEWGRF_RESCAN_FILES_TIP                                     :{BLACK}Actualiza a lista dos ficheiros NewGRF dispoñibles
+STR_NEWGRF_DUPLICATE_GRFID                                      :{WHITE}Non se pode engadir o ficheiro: ID do GRF duplicado
 
 STR_NEWGRF_DISABLED                                             :{RED}Desactivado
 
@@ -2888,6 +2895,7 @@
 STR_DEPOT_WRONG_DEPOT_TYPE                                      :Tipo de depósito erróneo
 
 STR_DEPOT_SELL_ALL_BUTTON_TRAIN_TIP                             :{BLACK}Vender tódolos trens do depósito
+STR_DEPOT_SELL_ALL_BUTTON_ROADVEH_TIP                           :{BLACK}Vender tódolos vehículos que hai no depósito
 STR_DEPOT_SELL_ALL_BUTTON_SHIP_TIP                              :{BLACK}Vender tódolos barcos no depósito
 STR_DEPOT_SELL_ALL_BUTTON_AIRCRAFT_TIP                          :{BLACK}Vender tódalas aeronaves do hangar
 
@@ -2908,6 +2916,9 @@
 STR_REPLACE_HELP                                                :{BLACK}Permíteche reemplazar untipo de máquina cunha doutro tipo, cando trens do tipo orixinal entran nun depósito
 STR_REPLACE_REMOVE_WAGON                                        :{BLACK}Eliminar os vagóns: {ORANGE}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Reemprazando: {ORANGE}{SKIP}{SKIP}{STRING}
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}O vehículo non está dispoñible
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}O vehículo non está dispoñible
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}O barco non está dispoñible
 
 STR_ENGINES                                                     :Máquinas
 STR_WAGONS                                                      :Vagóns
@@ -2951,6 +2962,7 @@
 STR_PURCHASE_INFO_COST_SPEED                                    :{BLACK}Coste: {GOLD}{CURRENCY}{BLACK} Velocidade: {GOLD}{VELOCITY}
 STR_PURCHASE_INFO_AIRCRAFT_CAPACITY                             :{BLACK}Capacidade: {GOLD}{COMMA} pasaxeiros, {COMMA} sacos de correo
 STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT                          :{BLACK}Vagóns tractores: {GOLD}+{POWER}{BLACK} Peso: {GOLD}+{WEIGHT_S}
+STR_PURCHASE_INFO_REFITTABLE_TO                                 :{BLACK}Actualizable a: {GOLD}
 STR_PURCHASE_INFO_ALL_BUT                                       :Todo excepto {GOLD}
 
 ########### String for New Landscape Generator
@@ -2970,8 +2982,10 @@
 STR_NUMBER_OF_TOWNS                                             :{BLACK}Num. de cidades:
 STR_NUMBER_OF_INDUSTRIES                                        :{BLACK}Num. de industrias:
 STR_GENERATE_DATE                                               :{BLACK}{DATE_LONG}
+STR_SNOW_LINE_UP                                                :{BLACK}Subir a altura da liña de neve
+STR_SNOW_LINE_DOWN                                              :{BLACK}Baixar a altura da liña de neve
+STR_SNOW_LINE_QUERY_CAPT                                        :{WHITE}Cambiar a altura da liña de neve
 STR_START_DATE_QUERY_CAPT                                       :{WHITE}Cambia-lo ano de inicio
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Tamaño: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Xerando mundo...
 STR_GENERATION_ABORT                                            :{BLACK}Cancelar
@@ -2984,12 +2998,17 @@
 STR_PREPARING_GAME                                              :{BLACK}Preparando partida
 STR_DIFFICULTY_TO_CUSTOM                                        :{WHITE}Esta acción cambiou o nivel de dificultade a Personalizado
 STR_SE_FLAT_WORLD                                               :{WHITE}Terreo Chan
+STR_SE_FLAT_WORLD_TIP                                           :{BLACK}Xerar terreo chan
 STR_SE_RANDOM_LAND                                              :{WHITE}Terreo aleatorio
 STR_SE_NEW_WORLD                                                :{BLACK}Crear novo escenario
 STR_SE_CAPTION                                                  :{WHITE}Tipo de escenario
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
+STR_FLAT_WORLD_HEIGHT_DOWN                                      :{BLACK}Subir a altura do terreo chan un nivel
+STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Baixar a altura do terreo chan un nivel
+STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Cambiar a altura do terreo chan
+STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Altura do terreo chan:
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centra-lo mapa pequeno na posición actual
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
 
 ########### String for new airports
 STR_SMALL_AIRPORT                                               :{BLACK}Pequeno
@@ -3045,6 +3064,7 @@
 STR_GROUP_ALL_SHIPS                                             :Tódolos barcos
 STR_GROUP_ALL_AIRCRAFTS                                         :Tódolos avións
 STR_GROUP_TINY_NUM                                              :{TINYFONT}{COMMA}
+STR_GROUP_REMOVE_ALL_VEHICLES                                   :Borrar tódolos vehículos
 
 STR_GROUP_RENAME_CAPTION                                        :{BLACK}Renomear un grupo
 
@@ -3054,6 +3074,7 @@
 STR_GROUP_CAN_T_REMOVE_ALL_VEHICLES                             :{WHITE}Non se pode borrar tódolos vehículos deste grupo...
 STR_GROUP_CAN_T_ADD_VEHICLE                                     :{WHITE}Non se pode engadir o vehículo a este grupo...
 
+STR_GROUPS_CLICK_ON_GROUP_FOR_TIP                               :{BLACK}Grupos - Pincha nun grupo para ver unha lista dos vehículos dese grupo
 STR_GROUP_CREATE_TIP                                            :{BLACK}Pincha para crear un grupo
 STR_GROUP_DELETE_TIP                                            :{BLACK}Borrar o grupo seleccionado
 STR_GROUP_RENAME_TIP                                            :{BLACK}Renomear o grupo seleccionado
@@ -3072,6 +3093,15 @@
 
 
 ############ Face formatting
+STR_FACE_SIMPLE                                                 :{BLACK}Simple
+STR_FACE_LOAD                                                   :{BLACK}Cargar
+STR_FACE_FACECODE_ERR                                           :{WHITE}¡Non se pode axustar o número da cara - debe estar entre 0 e 4.294.967.295!
+STR_FACE_SAVE                                                   :{BLACK}Grabar
+STR_FACE_EUROPEAN                                               :{BLACK}Europea
+STR_FACE_SELECT_EUROPEAN                                        :{BLACK}Seleccionar caras europeas
+STR_FACE_AFRICAN                                                :{BLACK}Africana
+STR_FACE_YES                                                    :Si
+STR_FACE_NO                                                     :Non
 ########
 
 ############ signal GUI
--- a/src/lang/german.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/german.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -161,7 +161,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Gebiet kann nicht geräumt werden...
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Ursprüngliches Urheberrecht {COPYRIGHT} 1995 Chris Sawyer, Alle Rechte vorbehalten
 STR_00B7_VERSION                                                :{BLACK}OpenTTD Version {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 OpenTTD-Team
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 OpenTTD-Team
 STR_TRANSLATED_BY                                               :{BLACK}  Übersetzer -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -300,12 +300,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Mehrspieler
 STR_SCENARIO_EDITOR                                             :{BLACK}Szenarieneditor
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Spielfeldgröße:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Spieleinstellungen
@@ -595,6 +589,9 @@
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Firmendaten
 STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Öffnen und Schließen von Industrien
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Änderungen der Wirtschaftslage
+STR_INDUSTRY_CHANGES_SERVED_BY_PLAYER                           :{YELLOW}Produktionsänderungen bei vom Spieler belieferten Industriebetrieben
+STR_INDUSTRY_CHANGES_SERVED_BY_OTHER                            :{YELLOW}Produktionsänderungen bei von Wettbewerbern belieferten Industriebetrieben
+STR_OTHER_INDUSTRY_PRODUCTION_CHANGES                           :{YELLOW}Andere Produktionsänderungen
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Rat / Informationen zu Fahrzeugen des Spielers
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Neue Fahrzeuge
 STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Änderungen akzeptierter Fracht
@@ -939,6 +936,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Vollbild
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}OpenTTD im Vollbildmodus spielen
+STR_FULLSCREEN_FAILED                                           :{WHITE}Vollbildmodus nicht möglich
 
 STR_OPTIONS_RES                                                 :{BLACK}Bildschirmauflösung
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1050,7 +1048,7 @@
 STR_CONFIG_PATCHES_AUTOSCROLL                                   :{LTBLUE}Spielfeld scrollen, wenn die Maus am Bildrand anstößt: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_BRIBE                                        :{LTBLUE}Bestechen der Stadtverwaltung erlauben: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_ALLOW_EXCLUSIVE                              :{LTBLUE}Erlaube den Erwerb exklusiver Transportrechte: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ALLOW_GIVE_MONEY                             :{LTBLUE}Erlaube es, anderen Firemn Geld zu schenken: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ALLOW_GIVE_MONEY                             :{LTBLUE}Erlaube es, anderen Firmen Geld zu schenken: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_NONUNIFORM_STATIONS                          :{LTBLUE}Ungleichmäßige Bahnhöfe: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_NEW_PATHFINDING_ALL                          :{LTBLUE}Neue globale Wegfindung für alle Fahrzeuge: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_FREIGHT_TRAINS                               :{LTBLUE}Frachtgewicht erhöhen um schwere Züge zu simulieren: {ORANGE}{STRING}
@@ -1167,6 +1165,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Erlaube Anteile an anderen Firmen zu kaufen
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Errichte Signale alle {ORANGE}{STRING} Felder beim Ziehen mit der Maus
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Automatischer Bau von Formsignalen bis: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Aktiviere Signal-Menü: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Der Stadtaufbau "keine weiteren Straßen" ist im Szenarieneditor nicht möglich
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Stadtstraßenaufbau auswählen: {ORANGE}{STRING}
@@ -1681,6 +1680,7 @@
 STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}Straßenbahnbrücke bauen
 STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}Straßentunnel bauen
 STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}Straßenbahntunnel bauen
+STR_TOGGLE_ONE_WAY_ROAD                                         :{BLACK}Aktiviere/Deaktiviere Einbahnstraßen
 STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Zwischen Bau/Abriss der Straße umschalten
 STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}Umschalten zwischen Bauen/Entfernen für Straßenbahnbau
 STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}Ausrichtung des Fahrzeugdepots wählen
@@ -1702,6 +1702,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Gebäude muss erst abgerissen werden
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}Bevölkerung: {ORANGE}{COMMA}{BLACK}  Häuser: {ORANGE}{COMMA}
@@ -2306,6 +2307,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Passwort
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Sie können Ihre Firma mit einem Passwort schützen, sodass nur ausgewählte Spieler beitreten können.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Firmenpasswort setzen
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}eingegebenes Passwort nicht speichern
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Passwort der Firma zuweisen
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Firmenpasswort
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Standard-Firmenpasswort
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Benutze dieses Firmenpasswort als Standard für neue Firmen
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Weltwirtschaftskrise!{}{}Finanzexperten befürchten schlimmsten Zusammenbruch der Wirtschaft!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Wirtschaftskrise beendet!{}{}Aufschwung des Handels gibt Vertrauen in die Industrie und stärkt die Wirtschaft!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Schalter für großes/kleines Fenster
@@ -2786,6 +2792,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Neue{G r "" s} {STRING} jetzt erhältlich!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Kann dieses Schrottfahrzeug nicht mehr verkaufen ...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Kann zerstörtes Fahrzeug nicht nachrüsten...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Kein Fahrplan für das Fahrzeug...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Fahrzeuge halten nur an Stationen.
@@ -3077,6 +3084,7 @@
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} muss nach {STRING} geladen werden.
 STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER                            :{STRING} Benötigt OpenTTD-Version {STRING} oder höher.
 STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :der GRF-Datei, die es übersetzen soll,
+STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED                        :Zu viele NewGRFs geladen.
 
 STR_NEWGRF_ADD                                                  :{BLACK}Hinzufügen
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Eine neue NewGRF-Datei zur Liste hinzufügen
@@ -3105,6 +3113,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Kompatible GRF(s) für fehlende Dateien geladen
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Fehlende GRF-Dateien wurden deaktiviert.
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Es fehlen GRF-Dateien um das Spiel zu laden
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}GRF-Datei(en) fehlen
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Das beenden der PAuse kann OpenTTD zum Abstürzen bringen. Bitte sende keine Fehlerberichte bei auftretenden Fehlern. {}Willst du die Pause wirklich beenden?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Eigene Währung
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Wechselkurs: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3256,7 +3266,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Zu starke Skalierung des Spielfeldes wird nicht empfohlen. Generierung dennoch fortsetzen?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Städtebauwarnung
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Der Stadtaufbau "keine weiteren Straßen" wird nicht empfohlen. Mit der Generierung fortfahren?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Reliefkartenname:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Größe: {ORANGE}{NUM} × {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Spielfeld wird generiert...
@@ -3282,9 +3291,9 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Flachland um eine Stufe erhöhen
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Flachlandhöhe ändern
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Höhe des Flachlands:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Zusatzansicht zur akutellen Position scrollen
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
 
 ########### String for new airports
 STR_SMALL_AIRPORT                                               :{BLACK}klein
@@ -3439,3 +3448,20 @@
 STR_FACE_EARRING                                                :Ohrring:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Krawatte oder Ohrring ändern
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Signalauswahl
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Kann Signale hier nicht umbauen...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Standardsignal (Formsignal){}Signale ermöglichen den unfallfreien Betrieb mehrerer Züge in einem Schienensystem.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Einfahrsignal (Formsignal){}Zeigt grün, wenn im folgenden Block mindestens Ausfahrsignal grün zeigt. Andernfalls zeigt es rot.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Ausfahrsignal (Formsignal){}Verhält sich wie ein normales Signal, wird jedoch benötigt, um Einfahr- oder Combosignalen den Block als "frei" zu melden.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Combosignal (Formsignal){}Das Combosignal ist gleichzeitig Ausfahr- und Einfahrsignal. Somit werden umfangreiche Signalverschaltungen möglich.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Standardsignal (Lichtsignal){}Signale ermöglichen den unfallfreien Betrieb mehrerer Züge in einem Schienensystem.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Einfahrsignal (Lichtsignal){}Zeigt grün, wenn im folgenden Block mindestens Ausfahrsignal grün zeigt. Andernfalls zeigt es rot.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Ausfahrsignal (Lichtsignal){}Verhält sich wie ein normales Signal, gibt jedoch das Signal an Einfahr- und Combosignale im vorherliegenden Block weiter.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Combosignal (Lichtsignal){}Das Combosignal ist gleichzeitig Ausfahr- und Einfahrsignal. Somit werden umfangreiche Signalverschaltungen möglich.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Signalumbau{}Wenn ausgewählt, werden bestehende Signale durch Anklicken zum ausgewählten Signaltyp umgebaut. Strg.+Klicken ändert die bestehende Bauform.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Abstand der Signale
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Signalabstand verringern
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Signalabstand erhöhen
+########
--- a/src/lang/hungarian.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/hungarian.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -193,7 +193,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Nem tisztíthatod meg a területet...
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Copyright {COPYRIGHT} 1995 Chris Sawyer, Minden jog fenntartva
 STR_00B7_VERSION                                                :{BLACK}OpenTTD version {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 Az OpenTTD csapat
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 Az OpenTTD csapat
 STR_TRANSLATED_BY                                               :{BLACK}  Fordítók -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -365,12 +365,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Hálózati játék
 STR_SCENARIO_EDITOR                                             :{BLACK}Pályaszerkesztő
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Méret:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Beállítások
@@ -660,6 +654,9 @@
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Céginformációk
 STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Ipari létesítmények létrejötte / bezárása
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Gazdasági változások
+STR_INDUSTRY_CHANGES_SERVED_BY_PLAYER                           :{YELLOW}Termelésváltozások az általad szállított ipari cégeknél
+STR_INDUSTRY_CHANGES_SERVED_BY_OTHER                            :{YELLOW}Termelésváltozások a konkurrenseid által szállított ipari cégeknél
+STR_OTHER_INDUSTRY_PRODUCTION_CHANGES                           :{YELLOW}Más ipari termelési változások
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Tanácsok / információk a játékos járműveiről
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Új járművek
 STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Áruk elfogadásának változásai
@@ -795,6 +792,7 @@
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Rádióadó építése
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Sivatagot hoz létre.{}Nyomj CTRL-t az eltávolításához
 STR_CREATE_LAKE                                                 :{BLACK}Vizi terület definiálása.{}Csatornát készít, kivéve ha tengerszinten CTRL-t lenyomva hívod meg, ekkor elárasztja a területet
+STR_CREATE_RIVER                                                :{BLACK}Folyók elhelyezése
 STR_0290_DELETE                                                 :{BLACK}Töröl
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}A város teljes eltüntetése
 STR_0292_SAVE_SCENARIO                                          :Pálya mentése
@@ -1004,6 +1002,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Teljes képernyő
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Jelöld be ezt, ha teljes képernyős módban szeretnél OpenTTD-zni
+STR_FULLSCREEN_FAILED                                           :{WHITE}Teljesképernyős módra váltás sikertelen
 
 STR_OPTIONS_RES                                                 :{BLACK}A képernyő felbontása
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1232,6 +1231,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Másik cégekből részvényt lehet vásárolni
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Amikor megragadom helyezzen lámpákat minden {ORANGE}{STRING}. mezőre
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Automatikusan szemafor épüljön eddig: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Szignálkezelő engedélyezése: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}A "nincs több út" városkinézeti séma a pályaszerkesztőben nem elérhető
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Válassz városi úthálózat-sémát: {ORANGE}{STRING}
@@ -1733,7 +1733,9 @@
 STR_180A_ROAD_CONSTRUCTION                                      :Útépítés
 STR_180A_TRAMWAY_CONSTRUCTION                                   :Villamospálya építés
 STR_180B_BUILD_ROAD_SECTION                                     :{BLACK}Út építése
+STR_BUILD_AUTOROAD_TIP                                          :{BLACK}Közút-szakasz megépítése automata módon
 STR_180B_BUILD_TRAMWAY_SECTION                                  :{BLACK}Villamos-sín építése
+STR_BUILD_AUTOTRAM_TIP                                          :{BLACK}Villamos-sín szakasz megépítése automata módon
 STR_180C_BUILD_ROAD_VEHICLE_DEPOT                               :{BLACK}Garázs építése (járművek vételére és karbantartására)
 STR_180C_BUILD_TRAM_VEHICLE_DEPOT                               :{BLACK}Villamos-depó építése (járművek megépítésére és szervizelésére)
 STR_180D_BUILD_BUS_STATION                                      :{BLACK}Buszmegálló építése
@@ -1744,6 +1746,7 @@
 STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}Villamos-híd építése
 STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}Közúti alagút építése
 STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}Villamos-alagút építése
+STR_TOGGLE_ONE_WAY_ROAD                                         :{BLACK}Egyirányú utak ki/be kapcsolása
 STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Építés/felszedés közötti váltás utaknál
 STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}Építő/bontó üzemmód váltása a villamospályákhoz
 STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}Válaszd ki a garázs helyzetét
@@ -1765,6 +1768,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Előbb le kell rombolnod az épületet
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}Lakosság: {ORANGE}{COMMA}{BLACK} Házak: {ORANGE}{COMMA}
@@ -2124,6 +2128,7 @@
 STR_5006_MUST_DEMOLISH_TUNNEL_FIRST                             :{WHITE}Előbb le kell rombolnod az alagutat
 STR_5007_MUST_DEMOLISH_BRIDGE_FIRST                             :{WHITE}Előbb le kell rombolnod a hidat
 STR_5008_CANNOT_START_AND_END_ON                                :{WHITE}Nem kezdődhet és végződhet ugyanott
+STR_BRIDGEHEADS_NOT_SAME_HEIGHT                                 :{WHITE}Hídfők nem egy szinten vannak
 STR_BRIDGE_TOO_LOW_FOR_TERRAIN                                  :{WHITE}A híd túl alacsony a terepre
 STR_500A_START_AND_END_MUST_BE_IN                               :{WHITE}A kezdetének és a végének egy vonalban kell lennie
 STR_500B_SITE_UNSUITABLE_FOR_TUNNEL                             :{WHITE}Nem alkalmas a hely alagút bejáratának
@@ -2405,6 +2410,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Jelszó
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Védd le a vállalatodat jelszóval ha nem akarod hogy mások csatlakozzanak hozzá.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Vállalati jelszó beállítása
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Ne mentsd el a megadott jelszót
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Új jelszó megadása a céghez
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Cég jelszó
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Alapértelmezett cég jelszó
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Ezen jelszó mint alapjelszó használata az új cégeknél
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Gazdasági visszaesés!{}{}A közgazdászok gazdasági válságtól tartanak!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Vége a visszaesésnek!{}{}A kereskedelem fellendül, ami önbizalmat ad az iparnak, és erősödik a gazdaság!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Kicsi/nagy ablakméret közötti váltás
@@ -2430,6 +2440,8 @@
 STR_LIVERY_PASSENGER_WAGON_STEAM                                :Utasszállító kocsi (gőz)
 STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Utasszállító kocsi (dízeles)
 STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Utasszállító kocsi (elektromos)
+STR_LIVERY_PASSENGER_WAGON_MONORAIL                             :Utasszállító kocsi (Egysínű)
+STR_LIVERY_PASSENGER_WAGON_MAGLEV                               :Utasszállító kocsi (Maglev)
 STR_LIVERY_FREIGHT_WAGON                                        :Tehervagon
 STR_LIVERY_BUS                                                  :Busz
 STR_LIVERY_TRUCK                                                :Teherautó
@@ -2885,6 +2897,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Új {STRING} elérhető!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}A megsemmisült jármű nem eladható...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Nem lehetséges a megsemmisült jármű átalakítása...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}A jármű nem időzíthető
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}A járművek csak az állomáson várakozhatnak
@@ -3174,7 +3187,9 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Hibás paraméterérték ehhez: {STRING}: paraméter {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} muszáj hogy betöltődjön ezelőtt: {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} muszáj hogy ezután töltődjön be: {STRING}.
+STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER                            :{STRING} csak a {STRING} vagy nagyobb verziójú OpenTTD-vel működik.
 STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :az adott GRF fájl célja egy másik lefordítása
+STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED                        :Túl sok NewGRF van betöltve.
 
 STR_NEWGRF_ADD                                                  :{BLACK}Hozzáad
 STR_NEWGRF_ADD_TIP                                              :{BLACK}A NewGRF-et hozzáadja a listához
@@ -3203,6 +3218,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Kompatibilis GRF(ek) betöltve a hiányzó fájl(ok) helyett
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Hiányzó GRF fájl(oka)t kikapcsoltam
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Kritikus GRF fájl(ok) hiányoznak, a játék nem betölthető
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Hiányzó GRF fájl(ok)
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}A játék folytatásától az OpenTTD lefagyhat.{}Ne jelentsd be az ismétlődő lefagyásokat egyesével.{}Biztosan folytatni akarod?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Saját pénznem
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Értékarány: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3327,6 +3344,12 @@
 STR_PURCHASE_INFO_ALL_BUT                                       :Mindenre, kivéve {GOLD}
 STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Maximális húzó erő: {GOLD}{FORCE}
 
+########### For showing numbers in widgets
+
+STR_NUM_1                                                       :{BLACK}{SKIP}{NUM}
+STR_NUM_2                                                       :{BLACK}{SKIP}{SKIP}{NUM}
+STR_NUM_3                                                       :{BLACK}{SKIP}{SKIP}{SKIP}{NUM}
+
 ########### String for New Landscape Generator
 
 STR_GENERATE                                                    :{WHITE}Generál
@@ -3354,7 +3377,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}A forrás térkép túlságosan nagy mértékű átméretezése nem javasolt. Folytatod mégis?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Városkinézeti figyelmeztetés
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}A "nincs több út" városkinézeti séma ellenjavallott. Biztosan folytatod a generálást?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Magasságtérkép neve:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Méret: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Térkép létrehozása...
@@ -3380,9 +3402,9 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Növeli eggyel a sima terep magasságát
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Sima terem magasságát változtatja
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Sima terep magassága:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}A kistérkép közepét a jelenlegi helyre állítja
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
 
 ########### String for new airports
 STR_SMALL_AIRPORT                                               :{BLACK}Kicsi
@@ -3499,15 +3521,26 @@
 STR_FACE_LOAD_TIP                                               :{BLACK}Kedvenc arcd betöltése
 STR_FACE_LOAD_DONE                                              :{WHITE}A kedvenc arcod az OpenTTD konfig-fájlból be lett töltve.
 STR_FACE_FACECODE                                               :{BLACK}Játékos arc szám
+STR_FACE_FACECODE_TIP                                           :{BLACK}Játékos arc-számának megtekintését/módosítását teszi lehetővé
+STR_FACE_FACECODE_CAPTION                                       :{WHITE}Játékos arcszámának megtekintése/módosítása
+STR_FACE_FACECODE_SET                                           :{WHITE}Az új arcszám-kód beállítása megtörtént.
+STR_FACE_FACECODE_ERR                                           :{WHITE}Játékos arc-szám beállítás sikertelen - A megadott értéknek 0 és 4.294.967.295 közé eső számnak kell lennie!
 STR_FACE_SAVE                                                   :{BLACK}Mentés
 STR_FACE_SAVE_TIP                                               :{BLACK}Kedvenc arc elmentése
 STR_FACE_SAVE_DONE                                              :{WHITE}Ez az arc mint a kedvenc arcod fog az OpenTTD konfig-fájlba elmentődni.
 STR_FACE_EUROPEAN                                               :{BLACK}Európai
+STR_FACE_SELECT_EUROPEAN                                        :{BLACK}Európai arc választása
 STR_FACE_AFRICAN                                                :{BLACK}Afrikai
+STR_FACE_SELECT_AFRICAN                                         :{BLACK}Afrikai arc választása
 STR_FACE_YES                                                    :Igen
 STR_FACE_NO                                                     :Nem
+STR_FACE_MOUSTACHE_EARRING_TIP                                  :{BLACK}Engedélyezi a bajuszt és/vagy a fülbevalót
 STR_FACE_HAIR                                                   :Haj:
 STR_FACE_HAIR_TIP                                               :{BLACK}Haj váltása
+STR_FACE_EYEBROWS                                               :Szemöldök:
+STR_FACE_EYEBROWS_TIP                                           :{BLACK}Szemöldök módosítása
+STR_FACE_EYECOLOUR                                              :Szemszín:
+STR_FACE_EYECOLOUR_TIP                                          :{BLACK}Szemszín cseréje
 STR_FACE_GLASSES                                                :Szemüveg:
 STR_FACE_GLASSES_TIP                                            :{BLACK}Szemüveg engedélyezése
 STR_FACE_GLASSES_TIP_2                                          :{BLACK}Szemüveg váltása
@@ -3518,4 +3551,28 @@
 STR_FACE_LIPS_MOUSTACHE_TIP                                     :{BLACK}Ajkak vagy bajusz váltása
 STR_FACE_CHIN                                                   :Ál:
 STR_FACE_CHIN_TIP                                               :{BLACK}Ál váltása
+STR_FACE_JACKET                                                 :Kabát
+STR_FACE_JACKET_TIP                                             :{BLACK}Babát cseréje
+STR_FACE_COLLAR                                                 :Gallér
+STR_FACE_COLLAR_TIP                                             :{BLACK}Gallér cseréje
+STR_FACE_TIE                                                    :Nyakkendő:
+STR_FACE_EARRING                                                :Fülbevaló:
+STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Nyakkendő vagy fülbevaló cseréje
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Szignál választó
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Nem lehet konvertálni a szignálokat itt...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Általános szignál (szemafor){}A szignálok feladata a vonatok összeütközésének megakadályozása a többvonatos vasúti hálózatokon.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Belépő-szignál (szemafor){}Mindaddig zöld, amíg van legalább egy zöld kilépő-szignál az utánakövetkező szakaszon. Egyébként pirosat mutat.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Kilépő-szignál (szemafor){}Ugyanúgy viselkedik mint az általános szignál, de megléte elengedhetetlenül szükséges a belépő- és a kombó-szignálok működéséhez.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Kombó-szignál (szemafor){}A kombó szignál voltaképpen egy kilépő- és egy belépő-szignál egybeépítve. Segítségével előjelző szignálokból lehet nagy "fákat" kialakítani.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Általános szignál (lámpa){}A szignálok feladata a vonatok összeütközésének megakadályozása a többvonatos vasúti hálózatokon.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Belépő-szignál (lámpa){}Mindaddig zöld, amíg van legalább egy zöld kilépő-szignál az utánakövetkező szakaszon. Egyébként pirosat mutat.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Kilépő-szignál (lámpa){}Ugyanúgy viselkedik mint az általános szignál, de megléte elengedhetetlenül szükséges a belépő- és a kombó-szignálok működéséhez.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Kombó-szignál (lámpa){}A kombó szignál voltaképpen egy kilépő- és egy belépő-szignál egybeépítve. Segítségével előjelző szignálokból lehet nagy "fákat" kialakítani.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Szignál Átalakító{}Amikor ki van jelölve, egy meglévő szignálra kattintással átkonvertálja a kiválasztott szignál-típusra és -variációra, CTRL+kattintás a variációt fogja változtatni.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Automata szignálsűrűség
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Automata szignáltávolság csökkentése
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Automata szignáltávolság növelése
+########
--- a/src/lang/icelandic.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/icelandic.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -159,7 +159,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Get ekki hreinsað þetta svæði....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Upphaflegur höfundarréttur {COPYRIGHT} 1995 Chris Sawyer, Öll réttindi áskilin
 STR_00B7_VERSION                                                :{BLACK}OpenTTD útgáfa {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 OpenTTD hópurinn
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 OpenTTD hópurinn
 STR_TRANSLATED_BY                                               :{BLACK}  Þýðendur -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -297,12 +297,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Fjölspilun
 STR_SCENARIO_EDITOR                                             :{BLACK}Landslagsgerð
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Kortastærð:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Stillingar
@@ -3041,7 +3035,6 @@
 STR_START_DATE_QUERY_CAPT                                       :{WHITE}Breyta upphafsári
 STR_HEIGHTMAP_SCALE_WARNING_CAPTION                             :{WHITE}Stærð hæðarlínukorts
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Ekki er mælt með því að breyta stærð grunnkorts of mikið. Viltu halda áfram?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Nafn hæðarlínukorts:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Stærð: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Skapa heim...
@@ -3067,7 +3060,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Hækka slétt land upp um eitt þrep
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Breyta hæð á sléttu landi
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Hæð slétts lands yfir sjávarmáli
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Miðja heimskort á núverandi staðsetningu
 
--- a/src/lang/italian.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/italian.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -162,7 +162,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Impossibile ripulire l'area....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Copyright originale {COPYRIGHT} 1995 Chris Sawyer, Tutti i diritti riservati
 STR_00B7_VERSION                                                :{BLACK}OpenTTD versione {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 Il team OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 Il team OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK}  Traduttori - Sidew, LorenzoDV e altri, senza nome, che ci hanno preceduti.
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -301,12 +301,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Multigiocatore
 STR_SCENARIO_EDITOR                                             :{BLACK}Editor di scenari
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Dimensione mappa:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Opzioni di gioco
@@ -434,7 +428,7 @@
 STR_0171_PAUSE_GAME                                             :{BLACK}Pausa
 STR_0172_SAVE_GAME_ABANDON_GAME                                 :{BLACK}Salva la partita, abandona la partita, esci
 STR_0173_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Mostra l'elenco delle stazioni di una compagnia
-STR_0174_DISPLAY_MAP                                            :{BLACK}Mostra la mappa
+STR_0174_DISPLAY_MAP                                            :{BLACK}Mostra la mappa, apre una mini visuale extra o mostra l'elenco dei cartelli
 STR_0175_DISPLAY_MAP_TOWN_DIRECTORY                             :{BLACK}Mostra la mappa, l'elenco delle città
 STR_0176_DISPLAY_TOWN_DIRECTORY                                 :{BLACK}Mostra l'elenco delle città
 STR_0177_DISPLAY_COMPANY_FINANCES                               :{BLACK}Mostra informazioni finanziare sulle compagnie
@@ -734,6 +728,7 @@
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Piazza trasmettitore
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Definisce un'area desertica.{}Fare clic tenendo premuto CTRL per rimuoverla
 STR_CREATE_LAKE                                                 :{BLACK}Definisce una zona d'acqua.{}Costruisce un canale, a meno che non si tenga premuto CTRL mentre si fa clic al livello del mare, provocando l'allagamento dei dintorni
+STR_CREATE_RIVER                                                :{BLACK}Crea un fiume
 STR_0290_DELETE                                                 :{BLACK}Elimina
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Elimina completamente questa città
 STR_0292_SAVE_SCENARIO                                          :Salva scenario
@@ -856,7 +851,7 @@
 STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE                            :{BLACK}Seleziona il paesaggio 'sub-artico'
 STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE                          :{BLACK}Seleziona il paesaggio 'sub-tropicale'
 STR_0311_SELECT_TOYLAND_LANDSCAPE                               :{BLACK}Seleziona il paesaggio 'città dei giocattoli'
-STR_0312_FUND_CONSTRUCTION_OF_NEW                               :{BLACK}Finanzia la costruzione di una nuova industria
+STR_0312_FUND_CONSTRUCTION_OF_NEW                               :{BLACK}Finanzia la costruzione di una nuova industria o mostra l'elenco delle industrie
 
 ############ range for menu starts
 STR_INDUSTRY_DIR                                                :Elenco industrie
@@ -943,6 +938,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Schermo intero
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Attiva questa casella per giocate a OpenTTD in modalità schermo intero
+STR_FULLSCREEN_FAILED                                           :{WHITE}Attivazione modalità schermo intero fallita
 
 STR_OPTIONS_RES                                                 :{BLACK}Risoluzione schermo
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1394,8 +1390,8 @@
 STR_NETWORK_NEW_GAME_NAME_TIP                                   :{BLACK}Il nome della partita sarà mostrato dagli altri giocatori nel menu di selezione delle partite multigiocatore
 STR_NETWORK_SET_PASSWORD                                        :{BLACK}Imposta password
 STR_NETWORK_PASSWORD_TIP                                        :{BLACK}Protegge la partita con una password in modo che non sia accessibile pubblicamente
-STR_NETWORK_SELECT_MAP                                          :{BLACK}Seleziona una mappa:
-STR_NETWORK_SELECT_MAP_TIP                                      :{BLACK}Con quale mappa vuoi giocare?
+STR_NETWORK_SELECT_MAP                                          :{BLACK}Seleziona mappa:
+STR_NETWORK_SELECT_MAP_TIP                                      :{BLACK}Selezionare la mappa con la quale si desidera giocare
 STR_NETWORK_LAN_INTERNET_COMBO                                  :{BLACK}{SKIP}{STRING}
 STR_NETWORK_LAN                                                 :LAN
 STR_NETWORK_INTERNET                                            :Internet
@@ -2311,8 +2307,13 @@
 STR_7072_VIEW_HQ                                                :{BLACK}Vedi sede
 STR_RELOCATE_HQ                                                 :{BLACK}Sposta sede
 STR_COMPANY_PASSWORD                                            :{BLACK}Password
-STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Protegge la compagnia con una password per impedire ad utenti non autorizzati di accedervi.
+STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Protegge la compagnia con una password per impedire ad utenti non autorizzati di accedervi
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Imposta password compagnia
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Non salvare la password inserita
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Assegna la nuova password alla compagnia
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Password della compagnia
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Password predefinita compagnia
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Usa questa password come predefinita per le nuove compagnie
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Recessione mondiale!{}{}Il crollo dell'economia porta gli analisti finanziari a temere il peggio!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Recessione finita!{}{}La ripresa del commercio da fiducia alle industrie e rafforza l'economia!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Seleziona dimensione grande/piccola della finestra
@@ -2338,6 +2339,8 @@
 STR_LIVERY_PASSENGER_WAGON_STEAM                                :Carrozza passeggeri (V)
 STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Carrozza passeggeri (D)
 STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Carrozza passeggeri (E)
+STR_LIVERY_PASSENGER_WAGON_MONORAIL                             :Carrozza passeggeri (MR)
+STR_LIVERY_PASSENGER_WAGON_MAGLEV                               :Carrozza passeggeri (ML)
 STR_LIVERY_FREIGHT_WAGON                                        :Vagone merci
 STR_LIVERY_BUS                                                  :Autobus
 STR_LIVERY_TRUCK                                                :Camion
@@ -2793,6 +2796,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Nuov{G o a} {STRING} disponibile! -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Impossibile vendere un veicolo distrutto...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Impossibile riadattare un veicolo distrutto...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Impossibile dare un orario al veicolo...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}I veicoli possono attendere solo alle stazioni.
@@ -3113,6 +3117,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}File GRF compatibili caricati al posto dei file mancanti
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}I file GRF mancanti sono stati disabilitati
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Mancano file GRF necessari per caricare la partita
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}File GRF mancanti
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Uscire dalla pausa può causare un crash: nel caso, si prega di non inviare segnalazioni bug al riguardo.{}Uscire dalla pausa?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Valuta personalizzata
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Cambio: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3237,6 +3243,12 @@
 STR_PURCHASE_INFO_ALL_BUT                                       :Tutto tranne {GOLD}
 STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Sforzo di trazione massimo: {GOLD}{FORCE}
 
+########### For showing numbers in widgets
+
+STR_NUM_1                                                       :{BLACK}{SKIP}{NUM}
+STR_NUM_2                                                       :{BLACK}{SKIP}{SKIP}{NUM}
+STR_NUM_3                                                       :{BLACK}{SKIP}{SKIP}{SKIP}{NUM}
+
 ########### String for New Landscape Generator
 
 STR_GENERATE                                                    :{WHITE}Genera
@@ -3264,7 +3276,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Ridimensionare di molto l'heightmap sorgente non è consigliabile. Continuare con la generazione?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Avviso sulla disposizione delle strade
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}L'opzione "Nessuna nuova strada" non è raccomandata. Proseguire con la generazione?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Nome heightmap:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Dim.: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Generazione del mondo...
@@ -3290,7 +3301,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Sposta in su di uno l'altezza del terreno pianeggiante
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Cambia l'altezza del terreno pianeggiante
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Altezza terreno pianeggiante:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centra la minimappa sulla posizione corrente
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
--- a/src/lang/japanese.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/japanese.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}多人数プレイ
 STR_SCENARIO_EDITOR                                             :{BLACK}シナリオエディタ
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}地図のサイズ:
 STR_BY                                                          :{BLACK}x
 STR_0148_GAME_OPTIONS                                           :{BLACK}ゲームの設定
@@ -941,6 +935,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}フルスクリーン
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}OpenTTD をフルスクリーンでプレイするにはチックします
+STR_FULLSCREEN_FAILED                                           :{WHITE}フルスクリーンモードが設定できません
 
 STR_OPTIONS_RES                                                 :{BLACK}画面の解像度
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1169,6 +1164,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}他の会社が所有している株式の購入を入にする
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}ドラッグするときの信号設備頻度:{ORANGE}{STRING}
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}次の年まで腕木式信号を建設:{ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}信号のインタフェースを使用:{ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}シナリオエディタを使用時に、「道路網を拡大せず」という道路網が選択できません
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}道路網の選択:{ORANGE}{STRING}
@@ -1705,6 +1701,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}まずは建物を破壊しなければなりません
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}人口:{ORANGE}{COMMA}人{BLACK} 建物:{ORANGE}{COMMA}戸
@@ -2309,6 +2306,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}パスワード
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}他のプレヤーがこの会社の経営に参加できないようにするには、パスワードで保護します
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}会社のパスワードを設定
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}入力したパスワードを保存しない
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}選択した交通会社の新しいパスワードを設定
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}交通会社のパスワード
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}デフォルトの交通会社のパスワード
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}このパスワードを新しい交通会社のパスワードとして使用
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}世界中不景気!{}{}経済がスランプに陥る、アナリストの不安説!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}スランプの終わり!{}{}経済が上昇気流、産業が好転!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}大きい/小さいウィンドウサイズを切り替えます
@@ -2789,6 +2791,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}{STRING}が新登場!ー{ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}破壊した車両が売却できません...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}破壊した車両が再装備できません...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}この車両に時刻表が設定できません...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}車両が駅/バス停のみで停車できます。
@@ -3109,6 +3112,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}見つからないファイルの代わりに対応している代替 GRF ファイルを使用しています
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}見つからない GRF ファイルを切にしています
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}ゲームを開くには次の GRF ファイルが必要
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}GRF ファイルが見つかりません
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}ポーズを解除した場合は、OpenTTD の安定性に悪影響を与える可能性があります。この後クラッシュが行った場合は、バグレポートの報告をご遠慮ください。{}ポーズを解除してもよろしいですか?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}カスタム通貨
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}為替レート:{ORANGE}{CURRENCY} = £ {COMMA}
@@ -3260,7 +3265,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}ソース地図をリサイズしすぎることはお勧めしません。地形作成を続けてもよろしいですか?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}道路網の警告
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}「道路網を拡大せず」という道路網をおすすめしません。続けてもよろしいですか?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}ハイトマップ名:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}サイズ:{ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}地形作成中...
@@ -3286,7 +3290,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}平地の高さを上げる
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}平地の高さを変更
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}平地の土地の高さ:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}予約地図を現在の場所に移動します
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3444,3 +3447,20 @@
 STR_FACE_EARRING                                                :イヤリング:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}ネクタイ/イヤリングを変更
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}信号の選択
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}ここに信号が交換できません...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}通常の信号(腕木式){}線路上に複数の電車が走った場合は、事故を避けるために信号が必要となります。
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}入り口の信号(腕木式){}信号の後ろにある部分にせめて一つの青い出口の信号があった場合は青いです。
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}出口の信号(腕木式){}通常の信号と同様の信号ですが、入り口、コンボの信号を使用した場合は、必要となります。
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}コンボ信号(腕木式){}コンボの信号は入り口信号と出口信号の機能を結合します。
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}通常の信号(電子式){}線路上に複数の電車が走った場合は、事故を避けるために信号が必要となります。
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}入り口の信号(電子式){}信号の後ろにある部分にせめて一つの青い出口の信号があった場合は青いです。
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}出口の信号(電子式){}通常の信号と同様の信号ですが、入り口、コンボの信号を使用した場合は、必要となります。
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}コンボ信号(電子式){}コンボの信号は入り口信号と出口信号の機能を結合します。
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}信号を交換{}すでに設置した信号をクリックしたときに選択した信号の書類に交換します。
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}ドラッグ時の信号設置密度
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}ドラッグ時の信号設置密度を減らす
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}ドラッグ時の信号設置密度を増やす
+########
--- a/src/lang/korean.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/korean.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -161,7 +161,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}이 지역을 파괴할 수 없습니다....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Original copyright {COPYRIGHT} 1995 Chris Sawyer, All rights reserved
 STR_00B7_VERSION                                                :{BLACK}OpenTTD 버전 {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 The OpenTTD team
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 The OpenTTD team
 STR_TRANSLATED_BY                                               :{BLACK}  한글화 -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -300,12 +300,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}멀티 플레이
 STR_SCENARIO_EDITOR                                             :{BLACK}시나리오 에디터
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}맵 크기:
 STR_BY                                                          :{BLACK}x
 STR_0148_GAME_OPTIONS                                           :{BLACK}게임 설정
@@ -595,6 +589,9 @@
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}회사 정보
 STR_NEWS_OPEN_CLOSE                                             :{YELLOW}산업 띄우기 / 끄기
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}경제적 변화
+STR_INDUSTRY_CHANGES_SERVED_BY_PLAYER                           :{YELLOW}플레이어에 의한 산업시설의 생산품 변화
+STR_INDUSTRY_CHANGES_SERVED_BY_OTHER                            :{YELLOW}경쟁자에 의한 산업시설의 생산품 변화
+STR_OTHER_INDUSTRY_PRODUCTION_CHANGES                           :{YELLOW}다른 산업 생산물 변화
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}조언 / 당신 차량에 대한 정보
 STR_020C_NEW_VEHICLES                                           :{YELLOW}새로운 차량
 STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}역에서 받는 화물의 변경
@@ -861,6 +858,7 @@
 
 STR_0314_FUND_NEW_INDUSTRY                                      :{WHITE}새로운 산업시설 건설
 STR_JUST_STRING                                                 :{STRING}
+STR_JUST_INT                                                    :{NUM}
 STR_0316_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...도시에만 건설할 수 있습니다!
 STR_0317_CAN_ONLY_BE_BUILT_IN_RAINFOREST                        :{WHITE}...열대우림 지역에만 건설할 수 있습니다!
 STR_0318_CAN_ONLY_BE_BUILT_IN_DESERT                            :{WHITE}...사막 지역에만 건설할 수 있습니다!
@@ -938,6 +936,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}전체화면
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}OpenTTD를 전체화면으로 플레이하려면 클릭하세요
+STR_FULLSCREEN_FAILED                                           :{WHITE}풀스크린 모드 실패
 
 STR_OPTIONS_RES                                                 :{BLACK}화면 해상도
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1021,6 +1020,7 @@
 STR_CONFIG_PATCHES_ON                                           :On
 STR_CONFIG_PATCHES_VEHICLESPEED                                 :{LTBLUE}상태바에 차량 속도를 표시 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_BUILDONSLOPES                                :{LTBLUE}경사/해안가 건설을 허용 : {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AUTOSLOPE                                    :{LTBLUE}건물, 트랙 등의 하부 지형 편집 허용 (자동 슬로프): {ORANGE}{STRING}
 STR_CONFIG_PATCHES_CATCHMENT                                    :{LTBLUE}드래그로 철도역 크기 설정 허용 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_EXTRADYNAMITE                                :{LTBLUE}도시 소유의 도로, 다리 등의 제거를 허용 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAMMOTHTRAINS                                :{LTBLUE}매우 긴 열차 허용 : {ORANGE}{STRING}
@@ -1041,12 +1041,14 @@
 STR_CONFIG_PATCHES_MULTIPINDTOWN                                :{LTBLUE}한 도시당 같은 종류의 산업시설의 중복 건설을 허용 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_SAMEINDCLOSE                                 :{LTBLUE}같은 종류의 산업 시설이 가까이에 지어지는 것을 허용 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_LONGDATE                                     :{LTBLUE}날짜를 일(日)단위까지 상세하게 표시 : {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SIGNALSIDE                                   :{LTBLUE}신호등을 통행 방식에 따라 달리 위치함. (좌측통행시 좌측에, 우측통행시 우측에) : {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SIGNALSIDE                                   :{LTBLUE}신호등을 통행 방식에 따라 다른 위치에 설치 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_SHOWFINANCES                                 :{LTBLUE}연말에 재정 창을 띄움 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_NEW_NONSTOP                                  :{LTBLUE}TTD패치에 적합한 급행(논스톱) 처리 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_ROADVEH_QUEUE                                :{LTBLUE}(획기적 방법으로) 자동차를 대기하게 하기 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_AUTOSCROLL                                   :{LTBLUE}가장자리에 마우스를 가져가면 화면을 움직이게 하기 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_BRIBE                                        :{LTBLUE}지역 당국에 뇌물을 주는 행위 허용 : {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ALLOW_EXCLUSIVE                              :{LTBLUE}독점 운송권 구입 허용: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ALLOW_GIVE_MONEY                             :{LTBLUE}다른 회사에게 돈을 송금하는 것을 허용: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_NONUNIFORM_STATIONS                          :{LTBLUE}이미 지어진 역에 추가로 역을 증축하는 것을 허용 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_NEW_PATHFINDING_ALL                          :{LTBLUE}향상된 글로벌 경로탐색 (NPF, NTP 우선) : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_FREIGHT_TRAINS                               :{LTBLUE}무거운 열차를 운행하기 위해 화물에 무게를 가함 : {ORANGE}{STRING}
@@ -1093,7 +1095,7 @@
 STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR                       :{LTBLUE}철도/도로/항만/공항 툴바에 지형 정보 링크 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_REVERSE_SCROLLING                            :{LTBLUE}스크롤 방향 뒤집기 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_SMOOTH_SCROLLING                             :{LTBLUE}부드러운 뷰포인트 스크롤: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MEASURE_TOOLTIP                              :{LTBLUE}다양한 건설도구를 사용시에 거리측정 툴팁 표시 : {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MEASURE_TOOLTIP                              :{LTBLUE}건설도구 사용시 거리측정 툴팁 표시 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_LIVERIES                                     :{LTBLUE}회사 조합원 표시 : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_LIVERIES_NONE                                :없음
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :내 회사
@@ -1112,13 +1114,16 @@
 
 STR_CONFIG_PATCHES_PAUSE_ON_NEW_GAME                            :{LTBLUE}새로운 게임 시작할 때 자동으로 일시정지: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS                       :{LTBLUE}진보된 차량 목록 사용: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OFF                   :끄기
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OWN                   :내 회사만
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_ALL                   :모든 회사에
 STR_CONFIG_PATCHES_LOADING_INDICATORS                           :{LTBLUE}적재 정도 표시: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_LOADING_INDICATORS_OFF                       :끄기
 STR_CONFIG_PATCHES_LOADING_INDICATORS_OWN                       :소유한 회사
 STR_CONFIG_PATCHES_LOADING_INDICATORS_ALL                       :모든 회사
 STR_CONFIG_PATCHES_TIMETABLE_ALLOW                              :{LTBLUE}차량에 시간표 사용: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_TIMETABLE_IN_TICKS                           :{LTBLUE}시간표를 일(日)이 아닌 틱으로 표시: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE                            :{LTBLUE}기본 철도 종류 (새 게임/불러오기 후): {ORANGE}{STRING}
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE                            :{LTBLUE}기본값으로 사용할 철도의 종류 (새 게임/불러오기 후): {ORANGE}{STRING}
 STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_RAIL                       :보통 철도
 STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_ELRAIL                     :전개 철도
 STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MONORAIL                   :모노레일
@@ -1159,7 +1164,8 @@
 STR_CONFIG_PATCHES_SMOOTH_ECONOMY                               :{LTBLUE}부드러운 경제 설정 사용 (좀더 적은 변화)
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}다른 회사가 주식을 사는 것을 허용
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}드래그 할때 신호등을 매 {ORANGE}{STRING}타일마다 설치
-STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}자동으로 신호기 설치 : {ORANGE}{STRING} 이전에
+STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}전자식 신호기의 사용 : {ORANGE}{STRING}년 이후에
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}신호기 GUI를 사용: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}도시설계 "도로건설 안함"은 시나리오 에디터에서 유효하지 않습니다
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}도시도로 설계: {ORANGE}{STRING}
@@ -1389,13 +1395,13 @@
 STR_NETWORK_INTERNET                                            :인터넷
 STR_NETWORK_LAN_INTERNET                                        :LAN / 인터넷
 STR_NETWORK_INTERNET_ADVERTISE                                  :인터넷 (광고 허용)
-STR_NETWORK_CLIENTS_SELECT                                      :{BLACK}{SKIP}{SKIP}{NUM}명 접속중
+STR_NETWORK_CLIENTS_SELECT                                      :{BLACK}{SKIP}{SKIP}{NUM}명
 STR_NETWORK_NUMBER_OF_CLIENTS                                   :{BLACK}최대 접속자 수:
 STR_NETWORK_NUMBER_OF_CLIENTS_TIP                               :{BLACK}최대 접속자수를 선택합니다. 모든 슬롯이 차있을 필요는 없습니다.
-STR_NETWORK_COMPANIES_SELECT                                    :{BLACK}{SKIP}{SKIP}{SKIP}{NUM}개의 회사
+STR_NETWORK_COMPANIES_SELECT                                    :{BLACK}{SKIP}{SKIP}{SKIP}{NUM}개
 STR_NETWORK_NUMBER_OF_COMPANIES                                 :{BLACK}최대 회사수:
 STR_NETWORK_NUMBER_OF_COMPANIES_TIP                             :{BLACK}서버의 회사의 수를 제한합니다
-STR_NETWORK_SPECTATORS_SELECT                                   :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{NUM}명 참관중
+STR_NETWORK_SPECTATORS_SELECT                                   :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{NUM}명
 STR_NETWORK_NUMBER_OF_SPECTATORS                                :{BLACK}최대 관전자수:
 STR_NETWORK_NUMBER_OF_SPECTATORS_TIP                            :{BLACK}게임을 관전하는 접속자의 수를 제한합니다
 STR_NETWORK_LANGUAGE_SPOKEN                                     :{BLACK}대화 언어:
@@ -1696,6 +1702,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}건물을 먼저 제거하십시오!
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}인구: {ORANGE}{COMMA}{BLACK}  가구수: {ORANGE}{COMMA}
@@ -2300,6 +2307,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}암호
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}다른 참가자가 이 회사로의 플레이를 하지 못하도록 암호로 보호합니다
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}회사 암호 설정
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}입력한 비밀번호는 저장하지 않기
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}이 회사에 새 비밀번호 부여
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}회사 비밀번호
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}회사 비밀번호 기본값
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}이 회사 비밀번호를 새 회사의 비밀번호 기본값으로 사용
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}세계 공황!{}{}경제 전문가들이 경제 슬럼프에 대해 우려를 표망하고 있습니다!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}공황 종료!{}{}무역량의 증대로 경제를 살려낸 결과 산업시설에 대한 신뢰를 가져왔습니다!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}대형/소형 창 크기 토글
@@ -2780,6 +2792,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}신형 {STRING} 이(가) 출시되었습니다!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}폭발한 차량을 팔 수 없습니다...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}파괴된 차량은 개조할 수 없습니다...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}차량의 시간표를 정할 수 없습니다...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}정거장에서만 기다릴 수 있습니다.
@@ -3100,6 +3113,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}사라진 파일의 자리에 알맞은 GRF가 로드되었습니다
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}사라진 GRF 파일은 사용불가능합니다
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}사라진 GRF 파일이 게임 로드에 사용될 수 있습니다
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}GRF 파일 손실
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}일시정지는 OpenTTD를 망가뜨릴 수 있습니다. 차후에 나오는 버그를 위해 버그 리포트를 파일로 만들지 마십시오.{}일시정지하시겠습니까?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}사용자 화폐 단위
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}환율: {ORANGE}{CURRENCY} = {COMMA}파운드
@@ -3251,7 +3266,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}맵 자원의 크기를 너무 키우는 것은 좋지 않습니다. 생성을 계속하시겠습니까?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}도시 설계 경고
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}도시 설계 "도로건설 안함"은 추천하지 않습니다. 생성을 계속 하시겠습니까?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}DEM지형 이름:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}크기: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}나는야 신이라네~ 천지창조중...
@@ -3277,7 +3291,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}평지의 높이를 1칸 낮춥니다
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}평지의 높이 변경
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}평지의 높이:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}소형맵을 현재 위치에 위치시킵니다
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3435,3 +3448,20 @@
 STR_FACE_EARRING                                                :귀걸이:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}넥타이/귀걸이 변경
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}신호기 선택
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}이곳의 신호기를 변환할 수 없습니다...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}표준 신호기 (구식){}신호등은 하나 이상의 열차가 한 철도 네트워크상에서 폭발사고를 일으키지 않게 해줍니다.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}입구 신호기 (구식){}다음 폐색 구간에 출구 신호등이 하나라도 파란불이면 파란불이 뜨고 그렇지 않으면 빨간불이 됩니다.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}출구-신호기 (구식){}일반 신호등과 같은 방법으로 만들되, 입구 & 콤보 전면 신호기와 올바르게 연계되어야 합니다.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}콤보-신호기 (구식){}콤보-신호기는 입구/출구 신호기의 역할을 동시에 합니다. 이 신호기는 거대한 전면신호기의 "나무구조"를 건설할 수 있게 합니다.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}표준 신호기 (전자식){}신호등은 하나 이상의 열차가 한 철도 네트워크상에서 폭발사고를 일으키지 않게 해줍니다.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}입구-신호기 (전자식){}다음 폐색 구간에 출구 신호등이 하나라도 파란불이면 파란불이 뜨고 그렇지 않으면 빨간불이 됩니다.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}출구-신호기 (전자식){}일반 신호등과 같은 방법으로 만들되, 입구 & 콤보 전면 신호기와 올바르게 연계되어야 합니다.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}콤보-신호기 (전자식){}콤보-신호기는 입구/출구 신호기의 역할을 동시에 합니다. 이 신호기는 거대한 전면신호기의 "나무구조"를 건설할 수 있게 합니다.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}신호기 변환{}선택했을 때, 이미 설치한 신호기를 클릭하면 선택한 신호기의 타입과 종류를 변경하게 되고, CTRL+클릭은 존재하는 종류를 토글할 것입니다.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}드래그시 신호기 간격
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}드래그시 신호기 간격 감소
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}드래그시 신호기 증가
+########
--- a/src/lang/lithuanian.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/lithuanian.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -194,7 +194,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Negalima griauti šios teritorijos....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Pradinės versijos teisės priklauso {COPYRIGHT} 1995 Chris Sawyer, Visos teisės saugomos
 STR_00B7_VERSION                                                :{BLACK}OpenTTD versija {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 OpenTTD komanda
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 OpenTTD komanda
 STR_TRANSLATED_BY                                               :{BLACK}  Vertejai: Mindaugas Surdokas (L781), Vytautas Liuolia
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -333,12 +333,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Žaidimas tinkle
 STR_SCENARIO_EDITOR                                             :{BLACK}Scenarijaus redaktorius
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Zemelapio dydis:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Žaidimo nustatymai
@@ -3089,7 +3083,6 @@
 STR_START_DATE_QUERY_CAPT                                       :{WHITE}Keisti pradzios metus
 STR_HEIGHTMAP_SCALE_WARNING_CAPTION                             :{WHITE}Skales ispejimas
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Perdaryti pagrindini zemelapi per daug nerekomenduojama. Testi generavima?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Zemelapio vardas:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Dydis: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Pasaulis generuojamas...
@@ -3115,7 +3108,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Pakelti lygios zemes lygi vienu lygiu
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Keisti lygumos auksti
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Lygumos aukstis:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centruoti maza zemelapi i sita vieta
 
--- a/src/lang/norwegian_bokmal.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/norwegian_bokmal.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -161,7 +161,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Kan ikke rydde dette området...
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Opprinnelig opphavsbeskyttet {COPYRIGHT} 1995 Chris Sawyer, Alle rettigheter reservert
 STR_00B7_VERSION                                                :{BLACK}OpenTTD versjon {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 OpenTTD-teamet
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 OpenTTD-teamet
 STR_TRANSLATED_BY                                               :{BLACK}  Oversetter(e) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -300,12 +300,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Flerspiller
 STR_SCENARIO_EDITOR                                             :{BLACK}Scenario Editor
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Kartstørrelse:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Spillinnstillinger
@@ -942,6 +936,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Fullskjerm
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Kryss av i denne boksen for å spille OpenTTD i fullskjermmodus
+STR_FULLSCREEN_FAILED                                           :{WHITE}Fullskjerm modus mislykkes
 
 STR_OPTIONS_RES                                                 :{BLACK}Skjermoppløsning
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1170,6 +1165,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Tillat aksjekjøp i andre selskaper
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Ved dra-og-slipp, plasser signal på hver {ORANGE}{STRING}. rute
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Bygg signalsystem med mast automatisk før: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Slå på signalgrensesnittet: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Byutlegget «ingen flere veier» er ikke gyldig i scenariobyggeren
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Velg byvei-layout: {ORANGE}{STRING}
@@ -2311,6 +2307,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Passord
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Passordbeskytt ditt firma for å forhindre uautoriserte brukere fra å bli med. Bruk '*' for å tømme passord.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Velg firmapassord
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Ikke lagre passordet
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Gi firmaet nytt passord
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Firmapassord
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Standard firmapassord
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Bruk dette passordet som standard for nye firmaer
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Verdenskrise!{}{}Økonomer frykter det verste. Nedgangstider i møte.
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Verdenskrise over!{}{}Opptur i markedet gir industrien selvsikkerheten tilbake.
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Bytte mellom stor/liten vindustørrelse
@@ -2791,6 +2792,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Ny {STRING} Nå tilgjengelig!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Kan ikke selge ødelagt kjøretøy...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Kan ikke ombygge ødelagt kjøretøy...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Kan ikke gi kjøretøy tidstabell...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Kjøretøy kan bare vente på stasjoner.
@@ -3111,6 +3113,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Kompatibel GRF lastet for manglende filer
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Manglende GRF-fil(er) har blitt slått av
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Mangler GRF-fil(er) nødvendige for å laste spillet
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Mangler GRF-fil(er)
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Å slå av pause kan gjøre at OpenTTD krasjer. Ikke rapporter feil for etterfølgende krasje.{}Ønsker du virkelig å slå av pause?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Vanlig valuta
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Valutakurs: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3262,7 +3266,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Å endre kildemapstørrelsen for mye er ikke anbefalt. Fortsette generering?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Byutleggsadvarsel
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Byutlegget «ingen flere veier» anbefales ikke. Fortsette generering?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Høydekartnavn:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Størrelse: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Genererer verden...
@@ -3288,7 +3291,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Flytt høyden på flagg land ett nivå opp
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Endre høyden på flatt land
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Høyde av flatt land:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Midstill oversiktskartet på den gjeldende posisjonen
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3448,4 +3450,18 @@
 ########
 
 ############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Signalvalg
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Kan ikke konvertere signaler her...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Standardsignal{}Signaler trengs for å forhindre tog fra å kræsje med hverandre på spor med mer enn ett tog.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Grønt så lenge det er mer enn ett grønt utgangssignal fra etterfølgende sporseksjon. Ellers rødt.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Utgangssignal (semafor){}Oppfører seg på samme måte som et vanlig signal ville gjort, men er nødvendig for å riktig farge på inngangs- og kombinasjonspresignaler.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Kombinasjonssignal (semafor){}Kombinasjonssignalet fungerer både som inn- og utgangssignal. Dette gjør at du kan bygge «trær» av presignaler.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Vanlig signal (elektrisk){}Signaler trengs for å forhindre togkrasj på jernbanenettverk med mer enn ett tog.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Inngangssignal (elektrisk){}Grønt så lenge det er mer enn ett grønt utgangssignal fra etterfølgende sporseksjon. Ellers rødt.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Utgangssignal (elektrisk){}Oppfører seg på samme måte som et vanlig signal ville gjort, men er nødvendig for å riktig farge på inngangs- og kombinasjonspresignaler.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Kombinasjonssignal (elektrisk){}Kombinasjonssignalet fungerer både som inn- og utgangssignal. Dette gjør at du kan bygge «trær» av presignaler.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Signalkonvertering{}Konverterer signaler til den valgte signaltypen; Ctrl-klikk vil endre eksisterende variant.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Signaltetthet ved dra-og-slipp
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Senk signaltetthet ved dra-og-slipp
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Øk signaltetthet ved dra-og-slipp
 ########
--- a/src/lang/norwegian_nynorsk.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/norwegian_nynorsk.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -161,7 +161,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Kan ikkje rydde dette området...
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Opphaveleg opphavsbeskytta {COPYRIGHT} 1995 Chris Sawyer, Alle rettigheter reservert
 STR_00B7_VERSION                                                :{BLACK}OpenTTD versjon {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 OpenTTD-teamet
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 OpenTTD-teamet
 STR_TRANSLATED_BY                                               :{BLACK}  Omsett av -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -300,12 +300,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Fleirspelar
 STR_SCENARIO_EDITOR                                             :{BLACK}Scenarioredigering
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Kartstorleik:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Spelinnstillingar
@@ -595,6 +589,9 @@
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Firma informasjon
 STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Opning / stenging av industriar
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Økonomiske endringar
+STR_INDUSTRY_CHANGES_SERVED_BY_PLAYER                           :{YELLOW}Produksjonsendringar for industriar betente av spelaren sjølve
+STR_INDUSTRY_CHANGES_SERVED_BY_OTHER                            :{YELLOW}Produksjonsendringar for industriar betente av konkurrent(ar)
+STR_OTHER_INDUSTRY_PRODUCTION_CHANGES                           :{YELLOW}Produksonsendringar for andre industriar
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Råd/informasjon om køyretøya til spelaren
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nye køyretøy
 STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Endringar i godtekne varer
@@ -1167,6 +1164,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Tillat kjøping av aksjar i andre selskap
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Ved opptrekking, plasser signal hver: {ORANGE}{STRING} rute{P "" r}
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Bygg semaforer automatisk før: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Bruk signal GUI: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Byoppsettet " ingen fleire vegar" kan ikkje brukast i scenarioredigeringsprogrammet
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Velg oppsett for byvegar: {ORANGE}{STRING}
@@ -1681,6 +1679,7 @@
 STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}Bygg bro for trikk
 STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}Bygg tunnel
 STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}Bygg tunell for trikk
+STR_TOGGLE_ONE_WAY_ROAD                                         :{BLACK}Aktiver / Deaktiver envegskøyrde vegar
 STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Vel mellom bygging/fjerning for vegbygging
 STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}Byt mellom bygge / fjerne for trikk
 STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}Vel retninga på garasjen
@@ -1702,6 +1701,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Bygningen må rivst først
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}Innbyggjartal: {ORANGE}{COMMA}{BLACK}  Antal hus: {ORANGE}{COMMA}
@@ -2306,6 +2306,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Passord
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Passordbeskytt firmaet ditt slik at ikkje alle og einkvar kan verte med. Bruk '*' for å tømme passord.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Vel firmapassord
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK} Ikkje lagre passordet
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Gje firmaet nytt passord
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Firmapassord
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Standard passord for firma
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Bruk passordet fra dette firmaet som standard for nye firma
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Verdskrise!{}{}Økonomar fryktar det verste. Nedgangstider i kjømda.
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Verdskrise over!{}{}Opptur i marknaden gjer industrien sjølvkjensla attende.
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Byt mellom stor/liten storleik på vindauga
@@ -3077,6 +3082,7 @@
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} må være lasta etter {STRING}.
 STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER                            :{STRING} Behøver OpenTTD versjon {STRING} eller betre.
 STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :GRF fila den var laga for å omsetje
+STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED                        :For mange NewGRF lasta
 
 STR_NEWGRF_ADD                                                  :{BLACK}Legg til
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Legg ei ny NewGRF-fil til lista
@@ -3105,6 +3111,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Ein eller fleire kompatible GRF-filar har vorte lasta inn i plassen for manglande filar
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Ein eller fleire manglande GRF-filar har vorte deaktiverte
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Manglar ein eller fleire GRF-filer for å kunne laste inn spelet
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Manglar GRF fil(er)
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Unpausing can crash OpenTTD. Do not file bug reports for subsequent crashes.{}Do you really want to unpause?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Vanleg valuta
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Valutakurs: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3256,7 +3264,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Å endre storleiken på kjeldekartet for mykje er ikkje anbefalt. Vil du halde fram med genereringa?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Åtvaring for byoppsett
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Byoppsettet "ingen fleire vegar" er ikkje anbefalt.  Hald fram med bygginga?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Høgdekartnamn:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Storleik: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Genererer verd...
@@ -3282,9 +3289,9 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Flytt landhøgda eitt nivå opp
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Endre høgda på flatt land
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Høgde på flatt land:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Still oversiktskartet midt på på den gjeldande posisjonen
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
 
 ########### String for new airports
 STR_SMALL_AIRPORT                                               :{BLACK}Liten
@@ -3439,3 +3446,20 @@
 STR_FACE_EARRING                                                :Øyrering:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Bytt slips eller øyrering
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Signal Selection
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Kan ikkje endre signal her
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Standard Signal (semaphore){}Signals are necessary to keep trains from crashing on railway networks with more than one train.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Entry-Signal (semaphore){}Grønt så lenge det er eit eller fleir grøne ut-signal i den følgande seksjonen. Ellers syner det raudt.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Ut-Signal (semaphore){}Virker på samme måte som normale signal, men er naudsynte for å få rett farge på inn og combo pre-signal.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Combo-Signal (semaphore){}Combo signal fungerer som både inn og ut signal. Det gjer deg moglegheit til å bygge store "tre" av presignal.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Standard Signal (elektrisk){}Signals er naudsynte for at tog ikkje skal kollidere når det er meir en ett på linja.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}In-Signal (elektrisk){}Grøn så lenge det er eit eller fleir grønne ut signal fra den følgande seksjonen. Ellers synar det raudt.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Ut-Signal (elektrisk){}Verker på samme måte som vanlege signal, men er naudsynt for å gje rett farge på in og combo pre-signal
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Combo-Signal (elektrisk){}Verker som både inn og ut signaler og gjer det moglegheit til å lage store "tre" av presignal
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Signal Konvertering{}Klikk på eit signal for å endra det til valde type, CTRL-klikk  skifter mellom forskjellige variantar.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Tettleik for dra og slepp signalbygging
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Minsk tettleik for dra og slepp signalbygging
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Auk tettleik for dra og slepp signalbygging
+########
--- a/src/lang/piglatin.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/piglatin.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -1,3380 +1,3399 @@
-##name Pig latin
-##ownname Igpay atinlay
-##isocode xx_PL
-##plural 0
-
-#
-
-##id 0x0000
-STR_NULL                                                        :
-STR_0001_OFF_EDGE_OF_MAP                                        :{WHITE}Offway edgeway ofway apmay
-STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP                               :{WHITE}Ootay oseclay otay edgeway ofway apmay
-STR_0003_NOT_ENOUGH_CASH_REQUIRES                               :{WHITE}Otnay enoughway ashcay - equiresray {CURRENCY}
-STR_0004                                                        :{WHITE}{CURRENCY}
-STR_EMPTY                                                       :
-STR_0007_FLAT_LAND_REQUIRED                                     :{WHITE}Atflay andlay equiredray
-STR_0008_WAITING                                                :{BLACK}Aitingway: {WHITE}{STRING}
-STR_0009                                                        :{WHITE}{CARGO}
-STR_000A_EN_ROUTE_FROM                                          :{WHITE}{CARGO}{YELLOW}  (enway-outeray omfray
-STR_000B                                                        :{YELLOW}{STATION})
-STR_000C_ACCEPTS                                                :{BLACK}Acceptsway: {WHITE}
-STR_000D_ACCEPTS                                                :{BLACK}Acceptsway: {GOLD}
-STR_000E                                                        :
-STR_000F_PASSENGERS                                             :Assengerspay
-STR_0010_COAL                                                   :Oalcay
-STR_0011_MAIL                                                   :Ailmay
-STR_0012_OIL                                                    :Oilway
-STR_0013_LIVESTOCK                                              :Ivestocklay
-STR_0014_GOODS                                                  :Oodsgay
-STR_0015_GRAIN                                                  :Aingray
-STR_0016_WOOD                                                   :Oodway
-STR_0017_IRON_ORE                                               :Ironway Oreway
-STR_0018_STEEL                                                  :Eelstay
-STR_0019_VALUABLES                                              :Aluablesvay
-STR_001A_COPPER_ORE                                             :Oppercay Oreway
-STR_001B_MAIZE                                                  :Aizemay
-STR_001C_FRUIT                                                  :Uitfray
-STR_001D_DIAMONDS                                               :Iamondsday
-STR_001E_FOOD                                                   :Oodfay
-STR_001F_PAPER                                                  :Aperpay
-STR_0020_GOLD                                                   :Oldgay
-STR_0021_WATER                                                  :Aterway
-STR_0022_WHEAT                                                  :Eatwhay
-STR_0023_RUBBER                                                 :Ubberray
-STR_0024_SUGAR                                                  :Ugarsay
-STR_0025_TOYS                                                   :Oystay
-STR_0026_CANDY                                                  :Eetssway
-STR_0027_COLA                                                   :Olacay
-STR_0028_COTTON_CANDY                                           :Andyflosscay
-STR_0029_BUBBLES                                                :Ubblesbay
-STR_002A_TOFFEE                                                 :Offeetay
-STR_002B_BATTERIES                                              :Atteriesbay
-STR_002C_PLASTIC                                                :Asticplay
-STR_002D_FIZZY_DRINKS                                           :Izzyfay Inksdray
-STR_002E                                                        :
-STR_002F_PASSENGER                                              :Assengerpay
-STR_0030_COAL                                                   :Oalcay
-STR_0031_MAIL                                                   :Ailmay
-STR_0032_OIL                                                    :Oilway
-STR_0033_LIVESTOCK                                              :Ivestocklay
-STR_0034_GOODS                                                  :Oodsgay
-STR_0035_GRAIN                                                  :Aingray
-STR_0036_WOOD                                                   :Oodway
-STR_0037_IRON_ORE                                               :Ironway Oreway
-STR_0038_STEEL                                                  :Eelstay
-STR_0039_VALUABLES                                              :Aluablesvay
-STR_003A_COPPER_ORE                                             :Oppercay Oreway
-STR_003B_MAIZE                                                  :Aizemay
-STR_003C_FRUIT                                                  :Uitfray
-STR_003D_DIAMOND                                                :Iamondday
-STR_003E_FOOD                                                   :Oodfay
-STR_003F_PAPER                                                  :Aperpay
-STR_0040_GOLD                                                   :Oldgay
-STR_0041_WATER                                                  :Aterway
-STR_0042_WHEAT                                                  :Eatwhay
-STR_0043_RUBBER                                                 :Ubberray
-STR_0044_SUGAR                                                  :Ugarsay
-STR_0045_TOY                                                    :Oytay
-STR_0046_CANDY                                                  :Eetsway
-STR_0047_COLA                                                   :Olacay
-STR_0048_COTTON_CANDY                                           :Andyflosscay
-STR_0049_BUBBLE                                                 :Ubblebay
-STR_004A_TOFFEE                                                 :Offeetay
-STR_004B_BATTERY                                                :Atterybay
-STR_004C_PLASTIC                                                :Asticplay
-STR_004D_FIZZY_DRINK                                            :Izzyfay Inkdray
-STR_QUANTITY_NOTHING                                            :
-STR_QUANTITY_PASSENGERS                                         :{COMMA} assenger{P "" s}pay
-STR_QUANTITY_COAL                                               :{WEIGHT} ofway oalcay
-STR_QUANTITY_MAIL                                               :{COMMA} ag{P "" s}bay ofway ailmay
-STR_QUANTITY_OIL                                                :{VOLUME} ofway oilway
-STR_QUANTITY_LIVESTOCK                                          :{COMMA} item{P "" s}WAY ofway ivestocklay
-STR_QUANTITY_GOODS                                              :{COMMA} ate{P "" s}cray ofway oodsgay
-STR_QUANTITY_GRAIN                                              :{WEIGHT} ofway aingray
-STR_QUANTITY_WOOD                                               :{WEIGHT} ofway oodway
-STR_QUANTITY_IRON_ORE                                           :{WEIGHT} ofway ironway oreway
-STR_QUANTITY_STEEL                                              :{WEIGHT} ofway eelstay
-STR_QUANTITY_VALUABLES                                          :{COMMA} ag{P "" s}bay ofway aluablesvay
-STR_QUANTITY_COPPER_ORE                                         :{WEIGHT} ofway oppercay oreway
-STR_QUANTITY_MAIZE                                              :{WEIGHT} ofway aizemay
-STR_QUANTITY_FRUIT                                              :{WEIGHT} ofway uitfray
-STR_QUANTITY_DIAMONDS                                           :{COMMA} ag{P "" s}bay ofway iamondsday
-STR_QUANTITY_FOOD                                               :{WEIGHT} ofway oodfay
-STR_QUANTITY_PAPER                                              :{WEIGHT} ofway aperpay
-STR_QUANTITY_GOLD                                               :{COMMA} ag{P "" s}bay ofway oldgay
-STR_QUANTITY_WATER                                              :{VOLUME} ofway aterway
-STR_QUANTITY_WHEAT                                              :{WEIGHT} ofway eatwhay
-STR_QUANTITY_RUBBER                                             :{VOLUME} ofway ubberray
-STR_QUANTITY_SUGAR                                              :{WEIGHT} ofway ugarsay
-STR_QUANTITY_TOYS                                               :{COMMA} oy{P "" s}tay
-STR_QUANTITY_SWEETS                                             :{COMMA} ag{P "" s}bay ofway eetssway
-STR_QUANTITY_COLA                                               :{VOLUME} ofway olacay
-STR_QUANTITY_CANDYFLOSS                                         :{WEIGHT} ofway andyflosscay
-STR_QUANTITY_BUBBLES                                            :{COMMA} ubble{P "" s}bay
-STR_QUANTITY_TOFFEE                                             :{WEIGHT} ofway offeetay
-STR_QUANTITY_BATTERIES                                          :{COMMA} atter{P y ies}bay
-STR_QUANTITY_PLASTIC                                            :{VOLUME} ofway asticplay
-STR_QUANTITY_FIZZY_DRINKS                                       :{COMMA} izzyfay ink{P "" s}dray
-STR_ABBREV_NOTHING                                              :
-STR_ABBREV_PASSENGERS                                           :{TINYFONT}PSay
-STR_ABBREV_COAL                                                 :{TINYFONT}CLay
-STR_ABBREV_MAIL                                                 :{TINYFONT}MLay
-STR_ABBREV_OIL                                                  :{TINYFONT}OLWAY
-STR_ABBREV_LIVESTOCK                                            :{TINYFONT}LVay
-STR_ABBREV_GOODS                                                :{TINYFONT}GDay
-STR_ABBREV_GRAIN                                                :{TINYFONT}GRay
-STR_ABBREV_WOOD                                                 :{TINYFONT}WDay
-STR_ABBREV_IRON_ORE                                             :{TINYFONT}ORWAY
-STR_ABBREV_STEEL                                                :{TINYFONT}STay
-STR_ABBREV_VALUABLES                                            :{TINYFONT}VLay
-STR_ABBREV_COPPER_ORE                                           :{TINYFONT}OCay
-STR_ABBREV_MAIZE                                                :{TINYFONT}MZay
-STR_ABBREV_FRUIT                                                :{TINYFONT}FTay
-STR_ABBREV_DIAMONDS                                             :{TINYFONT}DMay
-STR_ABBREV_FOOD                                                 :{TINYFONT}FDay
-STR_ABBREV_PAPER                                                :{TINYFONT}PRay
-STR_ABBREV_GOLD                                                 :{TINYFONT}GDay
-STR_ABBREV_WATER                                                :{TINYFONT}WRay
-STR_ABBREV_WHEAT                                                :{TINYFONT}WHay
-STR_ABBREV_RUBBER                                               :{TINYFONT}RBay
-STR_ABBREV_SUGAR                                                :{TINYFONT}SGay
-STR_ABBREV_TOYS                                                 :{TINYFONT}YTay
-STR_ABBREV_SWEETS                                               :{TINYFONT}SWay
-STR_ABBREV_COLA                                                 :{TINYFONT}CLay
-STR_ABBREV_CANDYFLOSS                                           :{TINYFONT}CFay
-STR_ABBREV_BUBBLES                                              :{TINYFONT}UBay
-STR_ABBREV_TOFFEE                                               :{TINYFONT}TFay
-STR_ABBREV_BATTERIES                                            :{TINYFONT}BAay
-STR_ABBREV_PLASTIC                                              :{TINYFONT}PLay
-STR_ABBREV_FIZZY_DRINKS                                         :{TINYFONT}FZay
-STR_ABBREV_NONE                                                 :{TINYFONT}ONay
-STR_ABBREV_ALL                                                  :{TINYFONT}ALLWAY
-STR_00AE                                                        :{WHITE}{DATE_SHORT}
-STR_00AF                                                        :{WHITE}{DATE_LONG}
-STR_00B0_MAP                                                    :{WHITE}Apmay - {STRING}
-STR_00B1_GAME_OPTIONS                                           :{WHITE}Amegay Optionsway
-STR_00B2_MESSAGE                                                :{YELLOW}Essagemay
-STR_00B3_MESSAGE_FROM                                           :{YELLOW}Essagemay omfray {STRING}
-STR_POPUP_CAUTION_CAPTION                                       :{WHITE}Autioncay!
-STR_00B4_CAN_T_DO_THIS                                          :{WHITE}An'tcay oday isthay....
-STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}An'tcay earclay isthay areaway....
-STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Originalway opyrightcay {COPYRIGHT} 1995 Ischray Awyersay, Allway ightsray eservedray
-STR_00B7_VERSION                                                :{BLACK}OpenTTDWAY ersionvay {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTDWAY {COPYRIGHT}2002-2007 Ethay OpenTTDWAY eamtay
-STR_TRANSLATED_BY                                               :{BLACK}  Anslatortray(say) -
-
-STR_00C5                                                        :{BLACK}{CROSS}
-STR_00C6                                                        :{SILVER}{CROSS}
-STR_00C7_QUIT                                                   :{WHITE}Itquay
-STR_00C8_YES                                                    :{BLACK}Esyay
-STR_00C9_NO                                                     :{BLACK}Onay
-STR_00CA_ARE_YOU_SURE_YOU_WANT_TO                               :{YELLOW}Areway ouyay uresay ouyay antway otay abandonway isthay amegay andway eturnray otay {STRING}?
-STR_00CB_1                                                      :{BLACK}1
-STR_00CC_2                                                      :{BLACK}2
-STR_00CD_3                                                      :{BLACK}3
-STR_00CE_4                                                      :{BLACK}4
-STR_00CF_5                                                      :{BLACK}5
-STR_00D0_NOTHING                                                :Othingnay
-STR_00D1_DARK_BLUE                                              :Arkday Ueblay
-STR_00D2_PALE_GREEN                                             :Alepay Eengray
-STR_00D3_PINK                                                   :Inkpay
-STR_00D4_YELLOW                                                 :Ellowyay
-STR_00D5_RED                                                    :Edray
-STR_00D6_LIGHT_BLUE                                             :Ightlay Ueblay
-STR_00D7_GREEN                                                  :Eengray
-STR_00D8_DARK_GREEN                                             :Arkday Eengray
-STR_00D9_BLUE                                                   :Ueblay
-STR_00DA_CREAM                                                  :Eamcray
-STR_00DB_MAUVE                                                  :Auvemay
-STR_00DC_PURPLE                                                 :Urplepay
-STR_00DD_ORANGE                                                 :Orangeway
-STR_00DE_BROWN                                                  :Ownbray
-STR_00DF_GREY                                                   :Eygray
-STR_00E0_WHITE                                                  :Itewhay
-STR_00E1_TOO_MANY_VEHICLES_IN_GAME                              :{WHITE}Ootay anymay ehiclesvay inway amegay
-STR_00E2                                                        :{BLACK}{COMMA}
-STR_00E3                                                        :{RED}{COMMA}
-STR_00E4_LOCATION                                               :{BLACK}Ocationlay
-STR_00E5_CONTOURS                                               :Ontourscay
-STR_00E6_VEHICLES                                               :Ehiclesvay
-STR_00E7_INDUSTRIES                                             :Industriesway
-STR_00E8_ROUTES                                                 :Outesray
-STR_00E9_VEGETATION                                             :Egetationvay
-STR_00EA_OWNERS                                                 :Ownersway
-STR_00EB_ROADS                                                  :{BLACK}{TINYFONT}Oadsray
-STR_00EC_RAILROADS                                              :{BLACK}{TINYFONT}Ailwaysray
-STR_00ED_STATIONS_AIRPORTS_DOCKS                                :{BLACK}{TINYFONT}Ationsstay/Airportsway/Ocksday
-STR_00EE_BUILDINGS_INDUSTRIES                                   :{BLACK}{TINYFONT}Uildingsbay/Industriesway
-STR_00EF_VEHICLES                                               :{BLACK}{TINYFONT}Ehiclesvay
-STR_00F0_100M                                                   :{BLACK}{TINYFONT}100may
-STR_00F1_200M                                                   :{BLACK}{TINYFONT}200may
-STR_00F2_300M                                                   :{BLACK}{TINYFONT}300may
-STR_00F3_400M                                                   :{BLACK}{TINYFONT}400may
-STR_00F4_500M                                                   :{BLACK}{TINYFONT}500may
-STR_00F5_TRAINS                                                 :{BLACK}{TINYFONT}Ainstray
-STR_00F6_ROAD_VEHICLES                                          :{BLACK}{TINYFONT}Oadray Ehiclesvay
-STR_00F7_SHIPS                                                  :{BLACK}{TINYFONT}Ipsshay
-STR_00F8_AIRCRAFT                                               :{BLACK}{TINYFONT}Aircraftway
-STR_00F9_TRANSPORT_ROUTES                                       :{BLACK}{TINYFONT}Ansporttray Outesray
-STR_00FA_COAL_MINE                                              :{BLACK}{TINYFONT}Oalcay Inemay
-STR_00FB_POWER_STATION                                          :{BLACK}{TINYFONT}Owerpay Ationstay
-STR_00FC_FOREST                                                 :{BLACK}{TINYFONT}Orestfay
-STR_00FD_SAWMILL                                                :{BLACK}{TINYFONT}Awmillsay
-STR_00FE_OIL_REFINERY                                           :{BLACK}{TINYFONT}Oilway Efineryray
-STR_00FF_FARM                                                   :{BLACK}{TINYFONT}Armfay
-STR_0100_FACTORY                                                :{BLACK}{TINYFONT}Actoryfay
-STR_0101_PRINTING_WORKS                                         :{BLACK}{TINYFONT}Intingpray Orksway
-STR_0102_OIL_WELLS                                              :{BLACK}{TINYFONT}Oilway Ellsway
-STR_0103_IRON_ORE_MINE                                          :{BLACK}{TINYFONT}Ironway Oreway Inemay
-STR_0104_STEEL_MILL                                             :{BLACK}{TINYFONT}Eelstay Illmay
-STR_0105_BANK                                                   :{BLACK}{TINYFONT}Ankbay
-STR_0106_PAPER_MILL                                             :{BLACK}{TINYFONT}Aperpay Illmay
-STR_0107_GOLD_MINE                                              :{BLACK}{TINYFONT}Oldgay Inemay
-STR_0108_FOOD_PROCESSING_PLANT                                  :{BLACK}{TINYFONT}Oodfay Ocessingpray Antplay
-STR_0109_DIAMOND_MINE                                           :{BLACK}{TINYFONT}Iamondday Inemay
-STR_010A_COPPER_ORE_MINE                                        :{BLACK}{TINYFONT}Oppercay Oreway Inemay
-STR_010B_FRUIT_PLANTATION                                       :{BLACK}{TINYFONT}Uitfray Antationplay
-STR_010C_RUBBER_PLANTATION                                      :{BLACK}{TINYFONT}Ubberray Antationplay
-STR_010D_WATER_SUPPLY                                           :{BLACK}{TINYFONT}Aterway Upplysay
-STR_010E_WATER_TOWER                                            :{BLACK}{TINYFONT}Aterway Owertay
-STR_010F_LUMBER_MILL                                            :{BLACK}{TINYFONT}Umberlay Illmay
-STR_0110_COTTON_CANDY_FOREST                                    :{BLACK}{TINYFONT}Andyflosscay Orestfay
-STR_0111_CANDY_FACTORY                                          :{BLACK}{TINYFONT}Eetsway Actoryfay
-STR_0112_BATTERY_FARM                                           :{BLACK}{TINYFONT}Atterybay Armfay
-STR_0113_COLA_WELLS                                             :{BLACK}{TINYFONT}Olacay Ellsway
-STR_0114_TOY_SHOP                                               :{BLACK}{TINYFONT}Oytay Opshay
-STR_0115_TOY_FACTORY                                            :{BLACK}{TINYFONT}Oytay Actoryfay
-STR_0116_PLASTIC_FOUNTAINS                                      :{BLACK}{TINYFONT}Asticplay Ountainsfay
-STR_0117_FIZZY_DRINK_FACTORY                                    :{BLACK}{TINYFONT}Izzyfay Inkdray Actoryfay
-STR_0118_BUBBLE_GENERATOR                                       :{BLACK}{TINYFONT}Ubblebay Eneratorgay
-STR_0119_TOFFEE_QUARRY                                          :{BLACK}{TINYFONT}Offeetay Arryquay
-STR_011A_SUGAR_MINE                                             :{BLACK}{TINYFONT}Ugarsay Inemay
-STR_011B_RAILROAD_STATION                                       :{BLACK}{TINYFONT}Ailwayray Ationstay
-STR_011C_TRUCK_LOADING_BAY                                      :{BLACK}{TINYFONT}Orrylay Oadinglay Aybay
-STR_011D_BUS_STATION                                            :{BLACK}{TINYFONT}Usbay Ationstay
-STR_011E_AIRPORT_HELIPORT                                       :{BLACK}{TINYFONT}Airportway/Eliporthay
-STR_011F_DOCK                                                   :{BLACK}{TINYFONT}Ockday
-STR_0120_ROUGH_LAND                                             :{BLACK}{TINYFONT}Oughray Andlay
-STR_0121_GRASS_LAND                                             :{BLACK}{TINYFONT}Assgray Andlay
-STR_0122_BARE_LAND                                              :{BLACK}{TINYFONT}Arebay Andlay
-STR_0123_FIELDS                                                 :{BLACK}{TINYFONT}Ieldsfay
-STR_0124_TREES                                                  :{BLACK}{TINYFONT}Eestray
-STR_0125_ROCKS                                                  :{BLACK}{TINYFONT}Ocksray
-STR_0126_WATER                                                  :{BLACK}{TINYFONT}Aterway
-STR_0127_NO_OWNER                                               :{BLACK}{TINYFONT}Onay Ownerway
-STR_0128_TOWNS                                                  :{BLACK}{TINYFONT}Ownstay
-STR_0129_INDUSTRIES                                             :{BLACK}{TINYFONT}Industriesway
-STR_012A_DESERT                                                 :{BLACK}{TINYFONT}Esertday
-STR_012B_SNOW                                                   :{BLACK}{TINYFONT}Owsnay
-STR_012C_MESSAGE                                                :{WHITE}Essagemay
-STR_012D                                                        :{WHITE}{STRING}
-STR_012E_CANCEL                                                 :{BLACK}Ancelcay
-STR_012F_OK                                                     :{BLACK}OKWAY
-STR_0130_RENAME                                                 :{BLACK}Enameray
-STR_0131_TOO_MANY_NAMES_DEFINED                                 :{WHITE}Ootay anymay amesnay efinedday
-STR_0132_CHOSEN_NAME_IN_USE_ALREADY                             :{WHITE}Osenchay amenay alreadyway inway useway
-
-STR_0133_WINDOWS                                                :Indowsway
-STR_0134_UNIX                                                   :Unixway
-STR_0135_OSX                                                    :OSWAY Xay
-STR_OSNAME_BEOS                                                 :EOSbay
-STR_OSNAME_MORPHOS                                              :OrphOSmay
-STR_OSNAME_AMIGAOS                                              :AmigaOSWAY
-STR_OSNAME_OS2                                                  :OSWAY/2
-STR_OSNAME_SUNOS                                                :UnOSsay
-
-STR_013B_OWNED_BY                                               :{WHITE}...ownedway ybay {STRING}
-STR_013C_CARGO                                                  :{BLACK}Argocay
-STR_013D_INFORMATION                                            :{BLACK}Informationway
-STR_013E_CAPACITIES                                             :{BLACK}Apacitiescay
-STR_013E_TOTAL_CARGO                                            :{BLACK}Otaltay Argocay
-STR_013F_CAPACITY                                               :{BLACK}Apacitycay: {LTBLUE}{CARGO}
-STR_CAPACITY_MULT                                               :{BLACK}Apacitycay: {LTBLUE}{CARGO} (xay{NUM})
-STR_013F_TOTAL_CAPACITY_TEXT                                    :{BLACK}Otaltay argocay apacitycay ofway isthay aintray:
-STR_013F_TOTAL_CAPACITY                                         :{LTBLUE}- {CARGO} ({SHORTCARGO})
-STR_TOTAL_CAPACITY_MULT                                         :{LTBLUE}- {CARGO} ({SHORTCARGO}) (xay{NUM})
-STR_0140_NEW_GAME                                               :{BLACK}Ewnay Amegay
-STR_0141_LOAD_GAME                                              :{BLACK}Oadlay Amegay
-STR_SINGLE_PLAYER                                               :{BLACK}Inglesay ayerplay
-STR_MULTIPLAYER                                                 :{BLACK}Ultiplayermay
-STR_SCENARIO_EDITOR                                             :{BLACK}Enarioscay Editorway
-
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
-STR_MAPSIZE                                                     :{BLACK}Apmay izesay:
-STR_BY                                                          :{BLACK}*
-STR_0148_GAME_OPTIONS                                           :{BLACK}Amegay Optionsway
-
-STR_0150_SOMEONE                                                :omeonesay{SKIP}{SKIP}
-STR_0151_MAP_OF_WORLD                                           :Apmay ofway orldway
-STR_0152_TOWN_DIRECTORY                                         :Owntay irectoryday
-STR_0153_SUBSIDIES                                              :Ubsidiessay
-
-STR_UNITS_IMPERIAL                                              :Imperialway
-STR_UNITS_METRIC                                                :Etricmay
-STR_UNITS_SI                                                    :ISay
-
-STR_UNITS_VELOCITY_IMPERIAL                                     :{COMMA} mphay
-STR_UNITS_VELOCITY_METRIC                                       :{COMMA} kmay/hay
-STR_UNITS_VELOCITY_SI                                           :{COMMA} may/say
-
-STR_UNITS_POWER_IMPERIAL                                        :{COMMA}hpay
-STR_UNITS_POWER_METRIC                                          :{COMMA}hpay
-STR_UNITS_POWER_SI                                              :{COMMA}kWay
-
-STR_UNITS_WEIGHT_SHORT_IMPERIAL                                 :{COMMA}tay
-STR_UNITS_WEIGHT_SHORT_METRIC                                   :{COMMA}tay
-STR_UNITS_WEIGHT_SHORT_SI                                       :{COMMA}kgay
-
-STR_UNITS_WEIGHT_LONG_IMPERIAL                                  :{COMMA} on{P "" s}tay
-STR_UNITS_WEIGHT_LONG_METRIC                                    :{COMMA} onne{P "" s}tay
-STR_UNITS_WEIGHT_LONG_SI                                        :{COMMA} kgay
-
-STR_UNITS_VOLUME_SHORT_IMPERIAL                                 :{COMMA}algay
-STR_UNITS_VOLUME_SHORT_METRIC                                   :{COMMA}lay
-STR_UNITS_VOLUME_SHORT_SI                                       :{COMMA}may³
-
-STR_UNITS_VOLUME_LONG_IMPERIAL                                  :{COMMA} allon{P "" s}gay
-STR_UNITS_VOLUME_LONG_METRIC                                    :{COMMA} itre{P "" s}lay
-STR_UNITS_VOLUME_LONG_SI                                        :{COMMA} may³
-
-STR_UNITS_FORCE_IMPERIAL                                        :{COMMA}xay10³ lbfay
-STR_UNITS_FORCE_METRIC                                          :{COMMA} ontay orcefay
-STR_UNITS_FORCE_SI                                              :{COMMA} kNay
-
-############ range for menu starts
-STR_0154_OPERATING_PROFIT_GRAPH                                 :Operatingway ofitpray aphgray
-STR_0155_INCOME_GRAPH                                           :Incomeway aphgray
-STR_0156_DELIVERED_CARGO_GRAPH                                  :Eliveredday argocay aphgray
-STR_0157_PERFORMANCE_HISTORY_GRAPH                              :Erformancepay istoryhay aphgray
-STR_0158_COMPANY_VALUE_GRAPH                                    :Ompanycay aluevay aphgray
-STR_0159_CARGO_PAYMENT_RATES                                    :Argocay aymentpay atesray
-STR_015A_COMPANY_LEAGUE_TABLE                                   :Ompanycay eaguelay abletay
-STR_PERFORMANCE_DETAIL_MENU                                     :Etailedday erformancepay atingray
-############ range for menu ends
-
-STR_015B_OPENTTD                                                :{WHITE}Aboutway OpenTTDWAY
-STR_015C_SAVE_GAME                                              :Avesay amegay
-STR_015D_LOAD_GAME                                              :Oadlay amegay
-STR_015E_QUIT_GAME                                              :Abandonway amegay
-STR_015F_QUIT                                                   :Exitway
-STR_ABANDON_GAME_QUERY                                          :{YELLOW}Areway ouyay uresay ouyay antway otay abandonway isthay amegay?
-STR_0161_QUIT_GAME                                              :{WHITE}Abandonway Amegay
-STR_SORT_ORDER_TIP                                              :{BLACK}Electsay ortingsay orderway (escendingday/ascendingway)
-STR_SORT_CRITERIA_TIP                                           :{BLACK}Electsay ortingsay iteriacray
-STR_SORT_BY                                                     :{BLACK}Ortsay ybay
-
-STR_SORT_BY_POPULATION                                          :{BLACK}Opulationpay
-STR_SORT_BY_PRODUCTION                                          :{BLACK}Oductionpray
-STR_SORT_BY_TYPE                                                :{BLACK}Ypetay
-STR_SORT_BY_TRANSPORTED                                         :{BLACK}Ansportedtray
-STR_SORT_BY_NAME                                                :{BLACK}Amenay
-STR_SORT_BY_DROPDOWN_NAME                                       :Amenay
-STR_SORT_BY_DATE                                                :{BLACK}Ateday
-STR_SORT_BY_NUMBER                                              :Umbernay
-STR_SORT_BY_PROFIT_LAST_YEAR                                    :Ofitpray astlay earyay
-STR_SORT_BY_PROFIT_THIS_YEAR                                    :Ofitpray isthay earyay
-STR_SORT_BY_AGE                                                 :Ageway
-STR_SORT_BY_RELIABILITY                                         :Eliabilityray
-STR_SORT_BY_TOTAL_CAPACITY_PER_CARGOTYPE                        :Otaltay apacitycay erpay argocay ypetay
-STR_SORT_BY_MAX_SPEED                                           :Aximummay eedspay
-STR_SORT_BY_MODEL                                               :Odelmay
-STR_SORT_BY_VALUE                                               :Aluevay
-STR_SORT_BY_FACILITY                                            :Ationstay ypetay
-STR_SORT_BY_WAITING                                             :Aitingway argocay aluevay
-STR_SORT_BY_RATING_MAX                                          :Argocay atingray
-STR_ENGINE_SORT_ENGINE_ID                                       :EngineIDWAY (assicclay ortsay)
-STR_ENGINE_SORT_COST                                            :Ostcay
-STR_ENGINE_SORT_POWER                                           :Owerpay
-STR_ENGINE_SORT_INTRO_DATE                                      :Introductionway Ateday
-STR_ENGINE_SORT_RUNNING_COST                                    :Unningray Ostcay
-STR_ENGINE_SORT_POWER_VS_RUNNING_COST                           :Owerpay/Unningray Ostcay
-STR_ENGINE_SORT_CARGO_CAPACITY                                  :Argocay Apacitycay
-STR_NO_WAITING_CARGO                                            :{BLACK}Onay argocay ofway anyway ypetay isway aitingway
-STR_SELECT_ALL_FACILITIES                                       :{BLACK}Electsay allway acilitiesfay
-STR_SELECT_ALL_TYPES                                            :{BLACK}Electsay allway argocay ypestay (includingway onay aitingway argocay)
-STR_AVAILABLE_TRAINS                                            :{BLACK}Availableway Ainstray
-STR_AVAILABLE_ROAD_VEHICLES                                     :{BLACK}Availableway Ehiclesvay
-STR_AVAILABLE_SHIPS                                             :{BLACK}Availableway Ipsshay
-STR_AVAILABLE_AIRCRAFT                                          :{BLACK}Availableway Aircraftway
-STR_AVAILABLE_ENGINES_TIP                                       :{BLACK}Eesay away istlay ofway availableway engineway esignsday orfay isthay ehiclevay ypetay.
-STR_MANAGE_LIST                                                 :{BLACK}Anagemay istlay
-STR_MANAGE_LIST_TIP                                             :{BLACK}Endsay instructionsway otay allway ehiclesvay inway isthay istlay
-STR_REPLACE_VEHICLES                                            :Eplaceray ehiclesvay
-STR_SEND_TRAIN_TO_DEPOT                                         :Endsay otay Epotday
-STR_SEND_ROAD_VEHICLE_TO_DEPOT                                  :Endsay otay Epotday
-STR_SEND_SHIP_TO_DEPOT                                          :Endsay otay Epotday
-STR_SEND_AIRCRAFT_TO_HANGAR                                     :Endsay otay Angarhay
-STR_SEND_FOR_SERVICING                                          :Endsay orfay Ervicingsay
-
-############ range for months starts
-STR_0162_JAN                                                    :Anjay
-STR_0163_FEB                                                    :Ebfay
-STR_0164_MAR                                                    :Armay
-STR_0165_APR                                                    :Aprway
-STR_0166_MAY                                                    :Aymay
-STR_0167_JUN                                                    :Unjay
-STR_0168_JUL                                                    :Uljay
-STR_0169_AUG                                                    :Augway
-STR_016A_SEP                                                    :Epsay
-STR_016B_OCT                                                    :Octway
-STR_016C_NOV                                                    :Ovnay
-STR_016D_DEC                                                    :Ecday
-############ range for months ends
-
-STR_016E                                                        :{TINYFONT}{STRING}{} {STRING}
-STR_016F                                                        :{TINYFONT}{STRING}{} {STRING}{}{NUM}
-STR_0170                                                        :{TINYFONT}{STRING}-
-STR_0171_PAUSE_GAME                                             :{BLACK}Ausepay amegay
-STR_0172_SAVE_GAME_ABANDON_GAME                                 :{BLACK}Avesay amegay, abandonway amegay, itquay
-STR_0173_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Isplayday istlay ofway ompany'scay ationsstay
-STR_0174_DISPLAY_MAP                                            :{BLACK}Isplayday apmay
-STR_0175_DISPLAY_MAP_TOWN_DIRECTORY                             :{BLACK}Isplayday apmay, owntay irectoryday
-STR_0176_DISPLAY_TOWN_DIRECTORY                                 :{BLACK}Isplayday owntay irectoryday
-STR_0177_DISPLAY_COMPANY_FINANCES                               :{BLACK}Isplayday ompanycay inancesfay informationway
-STR_0178_DISPLAY_COMPANY_GENERAL                                :{BLACK}Isplayday eneralgay ompanycay informationway
-STR_0179_DISPLAY_GRAPHS                                         :{BLACK}Isplayday aphsgray
-STR_017A_DISPLAY_COMPANY_LEAGUE                                 :{BLACK}Isplayday ompanycay eaguelay abletay
-STR_017B_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Isplayday istlay ofway ompany'scay ainstray
-STR_017C_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Isplayday istlay ofway ompany'scay oadray ehiclesvay
-STR_017D_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Isplayday istlay ofway ompany'scay ipsshay
-STR_017E_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Isplayday istlay ofway ompany'scay aircraftway
-STR_017F_ZOOM_THE_VIEW_IN                                       :{BLACK}Oomzay ethay iewvay inway
-STR_0180_ZOOM_THE_VIEW_OUT                                      :{BLACK}Oomzay ethay iewvay outway
-STR_0181_BUILD_RAILROAD_TRACK                                   :{BLACK}Uildbay ailwayray acktray
-STR_0182_BUILD_ROADS                                            :{BLACK}Uildbay oadsray
-STR_0183_BUILD_SHIP_DOCKS                                       :{BLACK}Uildbay ipshay ocksday
-STR_0184_BUILD_AIRPORTS                                         :{BLACK}Uildbay airportsway
-STR_0185_PLANT_TREES_PLACE_SIGNS                                :{BLACK}Antplay eestray, aceplay ignssay etcway.
-STR_0186_LAND_BLOCK_INFORMATION                                 :{BLACK}Andlay areaway informationway
-STR_0187_OPTIONS                                                :{BLACK}Optionsway
-STR_0188                                                        :{BLACK}{SMALLUPARROW}
-STR_0189                                                        :{BLACK}{SMALLDOWNARROW}
-STR_018A_CAN_T_CHANGE_SERVICING                                 :{WHITE}An'tcay angechay ervicingsay intervalway...
-STR_018B_CLOSE_WINDOW                                           :{BLACK}Oseclay indowway
-STR_018C_WINDOW_TITLE_DRAG_THIS                                 :{BLACK}Indowway itletay - agdray isthay otay ovemay indowway
-STR_STICKY_BUTTON                                               :{BLACK}Arkmay isthay indowway asway uncloseableway ybay ethay 'Oseclay Allway Indows'way eykay
-STR_RESIZE_BUTTON                                               :{BLACK}Ickclay andway agdray otay esizeray isthay indowway
-STR_SAVELOAD_HOME_BUTTON                                        :{BLACK}Ickclay erehay otay umpjay otay ethay urrentcay efaultday avesay/oadlay irectoryday
-STR_018D_DEMOLISH_BUILDINGS_ETC                                 :{BLACK}Emolishday uildingsbay etcway. onway away aresquay ofway andlay
-STR_018E_LOWER_A_CORNER_OF_LAND                                 :{BLACK}Owerlay away ornercay ofway andlay
-STR_018F_RAISE_A_CORNER_OF_LAND                                 :{BLACK}Aiseray away ornercay ofway andlay
-STR_0190_SCROLL_BAR_SCROLLS_LIST                                :{BLACK}Ollscray arbay - ollsscray istlay upway/ownday
-STR_HSCROLL_BAR_SCROLLS_LIST                                    :{BLACK}Ollscray arbay - ollsscray istlay eftlay/ightray
-STR_0191_SHOW_LAND_CONTOURS_ON_MAP                              :{BLACK}Owshay andlay ontourscay onway apmay
-STR_0192_SHOW_VEHICLES_ON_MAP                                   :{BLACK}Owshay ehiclesvay onway apmay
-STR_0193_SHOW_INDUSTRIES_ON_MAP                                 :{BLACK}Owshay industriesway onway apmay
-STR_0194_SHOW_TRANSPORT_ROUTES_ON                               :{BLACK}Owshay ansporttray outesray onway apmay
-STR_0195_SHOW_VEGETATION_ON_MAP                                 :{BLACK}Owshay egetationvay onway apmay
-STR_0196_SHOW_LAND_OWNERS_ON_MAP                                :{BLACK}Owshay andlay ownersway onway apmay
-STR_0197_TOGGLE_TOWN_NAMES_ON_OFF                               :{BLACK}Oggletay owntay amesnay onway/offway onway apmay
-STR_0198_PROFIT_THIS_YEAR_LAST_YEAR                             :{TINYFONT}{BLACK}Ofitpray isthay earyay: {CURRENCY} (astlay earyay: {CURRENCY})
-
-############ range for service numbers starts
-STR_AGE                                                         :{COMMA} ear{P "" s}yay ({COMMA})
-STR_AGE_RED                                                     :{RED}{COMMA} ear{P "" s}yay ({COMMA})
-############ range for service numbers ends
-
-STR_019C_ROAD_VEHICLE                                           :Oadray ehiclevay
-STR_019D_AIRCRAFT                                               :Aircraftway
-STR_019E_SHIP                                                   :Ipshay
-STR_019F_TRAIN                                                  :Aintray
-STR_01A0_IS_GETTING_OLD                                         :{WHITE}{STRING} {COMMA} isway ettinggay oldway
-STR_01A1_IS_GETTING_VERY_OLD                                    :{WHITE}{STRING} {COMMA} isway ettinggay eryvay oldway
-STR_01A2_IS_GETTING_VERY_OLD_AND                                :{WHITE}{STRING} {COMMA} isway ettinggay eryvay oldway andway urgentlyway eedsnay eplacingray
-STR_01A3_LAND_AREA_INFORMATION                                  :{WHITE}Andlay Areaway Informationway
-STR_01A4_COST_TO_CLEAR_N_A                                      :{BLACK}Ostcay otay earclay: {LTBLUE}Nay/Away
-STR_01A5_COST_TO_CLEAR                                          :{BLACK}Ostcay otay earclay: {LTBLUE}{CURRENCY}
-STR_01A6_N_A                                                    :Nay/Away
-STR_01A7_OWNER                                                  :{BLACK}Ownerway: {LTBLUE}{STRING}
-STR_01A8_LOCAL_AUTHORITY                                        :{BLACK}Ocallay authorityway: {LTBLUE}{STRING}
-STR_01A9_NONE                                                   :Onenay
-STR_01AA_NAME                                                   :{BLACK}Amenay
-STR_01AB                                                        :{BLACK}{TINYFONT}{VEHICLE}
-
-############ range for days starts
-STR_01AC_1ST                                                    :1stay
-STR_01AD_2ND                                                    :2nday
-STR_01AE_3RD                                                    :3rday
-STR_01AF_4TH                                                    :4thay
-STR_01B0_5TH                                                    :5thay
-STR_01B1_6TH                                                    :6thay
-STR_01B2_7TH                                                    :7thay
-STR_01B3_8TH                                                    :8thay
-STR_01B4_9TH                                                    :9thay
-STR_01B5_10TH                                                   :10thay
-STR_01B6_11TH                                                   :11thay
-STR_01B7_12TH                                                   :12thay
-STR_01B8_13TH                                                   :13thay
-STR_01B9_14TH                                                   :14thay
-STR_01BA_15TH                                                   :15thay
-STR_01BB_16TH                                                   :16thay
-STR_01BC_17TH                                                   :17thay
-STR_01BD_18TH                                                   :18thay
-STR_01BE_19TH                                                   :19thay
-STR_01BF_20TH                                                   :20thay
-STR_01C0_21ST                                                   :21stay
-STR_01C1_22ND                                                   :22nday
-STR_01C2_23RD                                                   :23rday
-STR_01C3_24TH                                                   :24thay
-STR_01C4_25TH                                                   :25thay
-STR_01C5_26TH                                                   :26thay
-STR_01C6_27TH                                                   :27thay
-STR_01C7_28TH                                                   :28thay
-STR_01C8_29TH                                                   :29thay
-STR_01C9_30TH                                                   :30thay
-STR_01CA_31ST                                                   :31stay
-############ range for days ends
-
-STR_01CB                                                        :{TINYFONT}{COMMA}
-
-STR_01CE_CARGO_ACCEPTED                                         :{BLACK}Argocay acceptedway: {LTBLUE}
-
-STR_01D1_8                                                      :({COMMA}/8 {STRING})
-STR_01D2_JAZZ_JUKEBOX                                           :{WHITE}Azzjay Ukeboxjay
-STR_01D3_SOUND_MUSIC                                            :Oundsay/usicmay
-STR_01D4_SHOW_SOUND_MUSIC_WINDOW                                :{BLACK}Owshay oundsay/usicmay indowway
-STR_01D5_ALL                                                    :{TINYFONT}Allway
-STR_01D6_OLD_STYLE                                              :{TINYFONT}Oldway Ylestay
-STR_01D7_NEW_STYLE                                              :{TINYFONT}Ewnay Ylestay
-STR_01D8_EZY_STREET                                             :{TINYFONT}Ezyway Eetstray
-STR_01D9_CUSTOM_1                                               :{TINYFONT}Ustomcay 1
-STR_01DA_CUSTOM_2                                               :{TINYFONT}Ustomcay 2
-STR_01DB_MUSIC_VOLUME                                           :{BLACK}{TINYFONT}Usicmay Olumevay
-STR_01DC_EFFECTS_VOLUME                                         :{BLACK}{TINYFONT}Effectsway Olumevay
-STR_01DD_MIN_MAX                                                :{BLACK}{TINYFONT}INMay  '  '  ' '  '  '  MAXay
-STR_01DE_SKIP_TO_PREVIOUS_TRACK                                 :{BLACK}Ipskay otay eviouspray acktray inway electionsay
-STR_01DF_SKIP_TO_NEXT_TRACK_IN_SELECTION                        :{BLACK}Ipskay otay extnay acktray inway electionsay
-STR_01E0_STOP_PLAYING_MUSIC                                     :{BLACK}Opstay ayingplay usicmay
-STR_01E1_START_PLAYING_MUSIC                                    :{BLACK}Artstay ayingplay usicmay
-STR_01E2_DRAG_SLIDERS_TO_SET_MUSIC                              :{BLACK}Agdray idersslay otay etsay usicmay andway oundsay effectway olumesvay
-STR_01E3                                                        :{DKGREEN}{TINYFONT}--
-STR_01E4_0                                                      :{DKGREEN}{TINYFONT}0{COMMA}
-STR_01E5                                                        :{DKGREEN}{TINYFONT}{COMMA}
-STR_01E6                                                        :{DKGREEN}{TINYFONT}------
-STR_01E7                                                        :{DKGREEN}{TINYFONT}"{STRING}"
-STR_01E8_TRACK_XTITLE                                           :{BLACK}{TINYFONT}Acktray{SETX 88}Itletay
-STR_01E9_SHUFFLE                                                :{TINYFONT}Uffleshay
-STR_01EA_PROGRAM                                                :{TINYFONT}{BLACK}Ogrammepray
-STR_01EB_MUSIC_PROGRAM_SELECTION                                :{WHITE}Usicmay Ogrammepray Electionsay
-STR_01EC_0                                                      :{TINYFONT}{LTBLUE}0{COMMA} "{STRING}"
-STR_01ED                                                        :{TINYFONT}{LTBLUE}{COMMA} "{STRING}"
-STR_01EE_TRACK_INDEX                                            :{TINYFONT}{BLACK}Acktray Indexway
-STR_01EF_PROGRAM                                                :{TINYFONT}{BLACK}Ogrammepray - '{STRING}'
-STR_01F0_CLEAR                                                  :{TINYFONT}{BLACK}Earclay
-STR_01F1_SAVE                                                   :{TINYFONT}{BLACK}Avesay
-STR_01F2_CURRENT_PROGRAM_OF_MUSIC                               :{BLACK}Urrentcay ogrammepray ofway usicmay ackstray
-STR_01F3_SELECT_ALL_TRACKS_PROGRAM                              :{BLACK}Electsay 'allway acks'tray ogrammepray
-STR_01F4_SELECT_OLD_STYLE_MUSIC                                 :{BLACK}Electsay 'oldway ylestay usic'may ogrammepray
-STR_01F5_SELECT_NEW_STYLE_MUSIC                                 :{BLACK}Electsay 'ewnay ylestay usic'may ogrammepray
-STR_01F6_SELECT_CUSTOM_1_USER_DEFINED                           :{BLACK}Electsay 'Ustomcay 1' (userway-efinedday) ogrammepray
-STR_01F7_SELECT_CUSTOM_2_USER_DEFINED                           :{BLACK}Electsay 'Ustomcay 2' (userway-efinedday) ogrammepray
-STR_01F8_CLEAR_CURRENT_PROGRAM_CUSTOM1                          :{BLACK}Earclay urrentcay ogrammepray (Ustomcay1 orway Ustomcay2 onlyway)
-STR_01F9_SAVE_MUSIC_SETTINGS                                    :{BLACK}Avesay usicmay ettingssay
-STR_01FA_CLICK_ON_MUSIC_TRACK_TO                                :{BLACK}Ickclay onway usicmay acktray otay addway otay urrentcay ogrammepray (Ustomcay1 orway Ustomcay2 onlyway)
-STR_CLICK_ON_TRACK_TO_REMOVE                                    :{BLACK}Ickclay onway usicmay acktray otay emoveray itway omfray urrentcay ogrammepray (Ustomcay1 orway Ustomcay2 onlyway)
-STR_01FB_TOGGLE_PROGRAM_SHUFFLE                                 :{BLACK}Oggletay ogrammepray uffleshay onway/offway
-STR_01FC_SHOW_MUSIC_TRACK_SELECTION                             :{BLACK}Owshay usicmay acktray electionsay indowway
-STR_01FD_CLICK_ON_SERVICE_TO_CENTER                             :{BLACK}Ickclay onway ervicesay otay entrecay iewvay onway industryway/owntay
-STR_01FE_DIFFICULTY                                             :{BLACK}Ifficultyday ({STRING})
-STR_01FF                                                        :{TINYFONT}{BLACK}{DATE_LONG}
-STR_0200_LAST_MESSAGE_NEWS_REPORT                               :Astlay essagemay/ewsnay eportray
-STR_0201_MESSAGE_SETTINGS                                       :Essagemay ettingssay
-STR_MESSAGE_HISTORY_MENU                                        :Essagemay Istoryhay
-STR_0203_SHOW_LAST_MESSAGE_NEWS                                 :{BLACK}Owshay astlay essagemay/ewsnay eportray, owshay essagemay optionsway
-STR_0204_MESSAGE_OPTIONS                                        :{WHITE}Essagemay Optionsway
-STR_0205_MESSAGE_TYPES                                          :{BLACK}Essagemay ypestay:
-STR_0206_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Arrivalway ofway irstfay ehiclevay atway ayer'splay ationstay
-STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Arrivalway ofway irstfay ehiclevay atway ompetitor'scay ationstay
-STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Accidentsway / isastersday
-STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Ompanycay informationway
-STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Openway / oseclay ofway industriesway
-STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Economyway angeschay
-STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Adviceway / informationway onway ayer'splay ehiclesvay
-STR_020C_NEW_VEHICLES                                           :{YELLOW}Ewnay ehiclesvay
-STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Angeschay otay argocay acceptanceway
-STR_020E_SUBSIDIES                                              :{YELLOW}Ubsidiessay
-STR_020F_GENERAL_INFORMATION                                    :{YELLOW}Eneralgay informationway
-STR_MESSAGES_ALL                                                :{YELLOW}Etsay allway essagemay ypestay otay: Offway / Ummarysay/ Ullfay
-STR_MESSAGE_SOUND                                               :{YELLOW}Ayplay oundsay orfay ummarisedsay ewsnay essagesmay
-STR_0210_TOO_FAR_FROM_PREVIOUS_DESTINATIO                       :{WHITE}...ootay arfay omfray eviouspray estinationday
-STR_0211_TOP_COMPANIES_WHO_REACHED                              :{BIGFONT}{BLACK}Optay ompaniescay owhay eachedray {NUM}{}({STRING} Evellay)
-STR_TOP_COMPANIES_NETWORK_GAME                                  :{BIGFONT}{BLACK}Ompanycay Eaguelay Abletay inway {NUM}
-STR_0212                                                        :{BIGFONT}{COMMA}.
-STR_0213_BUSINESSMAN                                            :Usinessmanbay
-STR_0214_ENTREPRENEUR                                           :Entrepreneurway
-STR_0215_INDUSTRIALIST                                          :Industrialistway
-STR_0216_CAPITALIST                                             :Apitalistcay
-STR_0217_MAGNATE                                                :Agnatemay
-STR_0218_MOGUL                                                  :Ogulmay
-STR_0219_TYCOON_OF_THE_CENTURY                                  :Ycoontay ofway ethay Enturycay
-STR_HIGHSCORE_NAME                                              :{BIGFONT}{PLAYERNAME}, {COMPANY}
-STR_HIGHSCORE_STATS                                             :{BIGFONT}'{STRING}'   ({COMMA})
-STR_021B_ACHIEVES_STATUS                                        :{BLACK}{BIGFONT}{COMPANY} achievesway '{STRING}' atusstay!
-STR_021C_OF_ACHIEVES_STATUS                                     :{WHITE}{BIGFONT}{PLAYERNAME} ofway {COMPANY} achievesway '{STRING}' atusstay!
-STR_021F                                                        :{BLUE}{COMMA}
-STR_0221_OPENTTD                                                :{YELLOW}OpenTTDWAY
-STR_0222_SCENARIO_EDITOR                                        :{YELLOW}Enarioscay Editorway
-STR_0223_LAND_GENERATION                                        :{WHITE}Andlay Enerationgay
-STR_0224                                                        :{BLACK}{UPARROW}
-STR_0225                                                        :{BLACK}{DOWNARROW}
-STR_0228_INCREASE_SIZE_OF_LAND_AREA                             :{BLACK}Increaseway areaway ofway andlay otay owerlay/aiseray
-STR_0229_DECREASE_SIZE_OF_LAND_AREA                             :{BLACK}Ecreaseday areaway ofway andlay otay owerlay/aiseray
-STR_022A_GENERATE_RANDOM_LAND                                   :{BLACK}Enerategay andomray andlay
-STR_022B_RESET_LANDSCAPE                                        :{BLACK}Esetray andscapelay
-STR_022C_RESET_LANDSCAPE                                        :{WHITE}Esetray Andscapelay
-STR_RESET_LANDSCAPE_TOOLTIP                                     :{BLACK}Emoveray allway ayerplay-ownedway opertypray omfray ethay apmay
-STR_RESET_LANDSCAPE_CONFIRMATION_TEXT                           :{WHITE}Areway ouyay uresay ouyay antway otay emoveray allway ayerplay-ownedway opertypray?
-STR_022E_LANDSCAPE_GENERATION                                   :{BLACK}Andscapelay enerationgay
-STR_022F_TOWN_GENERATION                                        :{BLACK}Owntay enerationgay
-STR_0230_INDUSTRY_GENERATION                                    :{BLACK}Industryway enerationgay
-STR_0231_ROAD_CONSTRUCTION                                      :{BLACK}Oadray onstructioncay
-STR_0233_TOWN_GENERATION                                        :{WHITE}Owntay Enerationgay
-STR_0234_NEW_TOWN                                               :{BLACK}Ewnay Owntay
-STR_0235_CONSTRUCT_NEW_TOWN                                     :{BLACK}Onstructcay ewnay owntay
-STR_0236_CAN_T_BUILD_TOWN_HERE                                  :{WHITE}An'tcay uildbay owntay erehay...
-STR_0237_TOO_CLOSE_TO_EDGE_OF_MAP                               :{WHITE}...ootay oseclay otay edgeway ofway apmay
-STR_0238_TOO_CLOSE_TO_ANOTHER_TOWN                              :{WHITE}...ootay oseclay otay anotherway owntay
-STR_0239_SITE_UNSUITABLE                                        :{WHITE}...itesay unsuitableway
-STR_023A_TOO_MANY_TOWNS                                         :{WHITE}...ootay anymay ownstay
-STR_CANNOT_GENERATE_TOWN                                        :{WHITE}An'tcay uildbay anyway ownstay
-STR_NO_SPACE_FOR_TOWN                                           :{WHITE}...erethay isway onay oremay acespay onway ethay apmay
-STR_023B_INCREASE_SIZE_OF_TOWN                                  :{BLACK}Increaseway izesay ofway owntay
-STR_023C_EXPAND                                                 :{BLACK}Expandway
-STR_023D_RANDOM_TOWN                                            :{BLACK}Andomray Owntay
-STR_023E_BUILD_TOWN_IN_RANDOM_LOCATION                          :{BLACK}Uildbay owntay inway andomray ocationlay
-STR_023F_INDUSTRY_GENERATION                                    :{WHITE}Industryway Enerationgay
-STR_0240_COAL_MINE                                              :{BLACK}Oalcay Inemay
-STR_0241_POWER_STATION                                          :{BLACK}Owerpay Ationstay
-STR_0242_SAWMILL                                                :{BLACK}Awmillsay
-STR_0243_FOREST                                                 :{BLACK}Orestfay
-STR_0244_OIL_REFINERY                                           :{BLACK}Oilway Efineryray
-STR_0245_OIL_RIG                                                :{BLACK}Oilway Igray
-STR_0246_FACTORY                                                :{BLACK}Actoryfay
-STR_0247_STEEL_MILL                                             :{BLACK}Eelstay Illmay
-STR_0248_FARM                                                   :{BLACK}Armfay
-STR_0249_IRON_ORE_MINE                                          :{BLACK}Ironway Oreway Inemay
-STR_024A_OIL_WELLS                                              :{BLACK}Oilway Ellsway
-STR_024B_BANK                                                   :{BLACK}Ankbay
-STR_024C_PAPER_MILL                                             :{BLACK}Aperpay Illmay
-STR_024D_FOOD_PROCESSING_PLANT                                  :{BLACK}Oodfay Ocessingpray Antplay
-STR_024E_PRINTING_WORKS                                         :{BLACK}Intingpray Orksway
-STR_024F_GOLD_MINE                                              :{BLACK}Oldgay Inemay
-STR_0250_LUMBER_MILL                                            :{BLACK}Umberlay Illmay
-STR_0251_FRUIT_PLANTATION                                       :{BLACK}Uitfray Antationplay
-STR_0252_RUBBER_PLANTATION                                      :{BLACK}Ubberray Antationplay
-STR_0253_WATER_SUPPLY                                           :{BLACK}Aterway Upplysay
-STR_0254_WATER_TOWER                                            :{BLACK}Aterway Owertay
-STR_0255_DIAMOND_MINE                                           :{BLACK}Iamondday Inemay
-STR_0256_COPPER_ORE_MINE                                        :{BLACK}Oppercay Oreway Inemay
-STR_0257_COTTON_CANDY_FOREST                                    :{BLACK}Andyflosscay Orestfay
-STR_0258_CANDY_FACTORY                                          :{BLACK}Eetsway Actoryfay
-STR_0259_BATTERY_FARM                                           :{BLACK}Atterybay Armfay
-STR_025A_COLA_WELLS                                             :{BLACK}Olacay Ellsway
-STR_025B_TOY_SHOP                                               :{BLACK}Oytay Opshay
-STR_025C_TOY_FACTORY                                            :{BLACK}Oytay Actoryfay
-STR_025D_PLASTIC_FOUNTAINS                                      :{BLACK}Asticplay Ountainsfay
-STR_025E_FIZZY_DRINK_FACTORY                                    :{BLACK}Izzyfay Inkdray Actoryfay
-STR_025F_BUBBLE_GENERATOR                                       :{BLACK}Ubblebay Eneratorgay
-STR_0260_TOFFEE_QUARRY                                          :{BLACK}Offeetay Arryquay
-STR_0261_SUGAR_MINE                                             :{BLACK}Ugarsay Inemay
-STR_0262_CONSTRUCT_COAL_MINE                                    :{BLACK}Onstructcay Oalcay Inemay
-STR_0263_CONSTRUCT_POWER_STATION                                :{BLACK}Onstructcay Owerpay Ationstay
-STR_0264_CONSTRUCT_SAWMILL                                      :{BLACK}Onstructcay Awmillsay
-STR_0265_PLANT_FOREST                                           :{BLACK}Antplay Orestfay
-STR_0266_CONSTRUCT_OIL_REFINERY                                 :{BLACK}Onstructcay Oilway Efineryray
-STR_0267_CONSTRUCT_OIL_RIG_CAN_ONLY                             :{BLACK}Onstructcay Oilway Igray (Ancay onlyway ebay uiltbay earnay ethay edgesway ofway ethay apmay)
-STR_0268_CONSTRUCT_FACTORY                                      :{BLACK}Onstructcay Actoryfay
-STR_0269_CONSTRUCT_STEEL_MILL                                   :{BLACK}Onstructcay Eelstay Illmay
-STR_026A_CONSTRUCT_FARM                                         :{BLACK}Onstructcay Armfay
-STR_026B_CONSTRUCT_IRON_ORE_MINE                                :{BLACK}Onstructcay Ironway Oreway Inemay
-STR_026C_CONSTRUCT_OIL_WELLS                                    :{BLACK}Onstructcay Oilway Ellsway
-STR_026D_CONSTRUCT_BANK_CAN_ONLY                                :{BLACK}Onstructcay Ankbay (Ancay onlyway ebay uiltbay inway ownstay ithway away opulationpay eatergray anthay 1200)
-STR_026E_CONSTRUCT_PAPER_MILL                                   :{BLACK}Onstructcay Aperpay Illmay
-STR_026F_CONSTRUCT_FOOD_PROCESSING                              :{BLACK}Onstructcay Oodfay Ocessingpray Antplay
-STR_0270_CONSTRUCT_PRINTING_WORKS                               :{BLACK}Onstructcay Intingpray Orksway
-STR_0271_CONSTRUCT_GOLD_MINE                                    :{BLACK}Onstructcay Oldgay Inemay
-STR_0272_CONSTRUCT_BANK_CAN_ONLY                                :{BLACK}Onstructcay Ankbay (Ancay onlyway ebay uiltbay inway ownstay)
-STR_0273_CONSTRUCT_LUMBER_MILL_TO                               :{BLACK}Onstructcay Umberlay Illmay (otay earclay ainforestray andway oducepray Oodway)
-STR_0274_PLANT_FRUIT_PLANTATION                                 :{BLACK}Antplay Uitfray Antationplay
-STR_0275_PLANT_RUBBER_PLANTATION                                :{BLACK}Antplay Ubberray Antationplay
-STR_0276_CONSTRUCT_WATER_SUPPLY                                 :{BLACK}Onstructcay Aterway Upplysay
-STR_0277_CONSTRUCT_WATER_TOWER_CAN                              :{BLACK}Onstructcay Aterway Owertay (Ancay onlyway ebay uiltbay inway ownstay)
-STR_0278_CONSTRUCT_DIAMOND_MINE                                 :{BLACK}Onstructcay Iamondday Inemay
-STR_0279_CONSTRUCT_COPPER_ORE_MINE                              :{BLACK}Onstructcay Oppercay Oreway Inemay
-STR_027A_PLANT_COTTON_CANDY_FOREST                              :{BLACK}Antplay Andyflosscay Orestfay
-STR_027B_CONSTRUCT_CANDY_FACTORY                                :{BLACK}Onstructcay Eetsway Actoryfay
-STR_027C_CONSTRUCT_BATTERY_FARM                                 :{BLACK}Onstructcay Atterybay Armfay
-STR_027D_CONSTRUCT_COLA_WELLS                                   :{BLACK}Onstructcay Olacay Ellsway
-STR_027E_CONSTRUCT_TOY_SHOP                                     :{BLACK}Onstructcay Oytay Opshay
-STR_027F_CONSTRUCT_TOY_FACTORY                                  :{BLACK}Onstructcay Oytay Actoryfay
-STR_0280_CONSTRUCT_PLASTIC_FOUNTAINS                            :{BLACK}Onstructcay Asticplay Ountainsfay
-STR_0281_CONSTRUCT_FIZZY_DRINK_FACTORY                          :{BLACK}Onstructcay Izzyfay Inkdray Actoryfay
-STR_0282_CONSTRUCT_BUBBLE_GENERATOR                             :{BLACK}Onstructcay Ubblebay Eneratorgay
-STR_0283_CONSTRUCT_TOFFEE_QUARRY                                :{BLACK}Onstructcay Offeetay Arryquay
-STR_0284_CONSTRUCT_SUGAR_MINE                                   :{BLACK}Onstructcay Ugarsay Inemay
-STR_0285_CAN_T_BUILD_HERE                                       :{WHITE}An'tcay uildbay {STRING} erehay...
-STR_0286_MUST_BUILD_TOWN_FIRST                                  :{WHITE}...ustmay uildbay owntay irstfay
-STR_0287_ONLY_ONE_ALLOWED_PER_TOWN                              :{WHITE}...onlyway oneway allowedway erpay owntay
-STR_0288_PLANT_TREES                                            :{BLACK}Antplay eestray
-STR_0289_PLACE_SIGN                                             :{BLACK}Aceplay ignsay
-STR_028A_RANDOM_TREES                                           :{BLACK}Andomray Eestray
-STR_028B_PLANT_TREES_RANDOMLY_OVER                              :{BLACK}Antplay eestray andomlyray overway andscapelay
-STR_028C_PLACE_ROCKY_AREAS_ON_LANDSCAPE                         :{BLACK}Aceplay ockyray areasway onway andscapelay
-STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Aceplay ighthouselay
-STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Aceplay ansmittertray
-STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Efineday esertday areaway.{}Esspray andway oldhay CTRLay otay emoveray itway
-STR_CREATE_LAKE                                                 :{BLACK}Efineday aterway areaway.{}Akemay away analcay, unlessway CTRLay isway eldhay ownday atway easay evellay, enwhay itway illway oodflay ethay urroundingssay insteadway
-STR_0290_DELETE                                                 :{BLACK}Eleteday
-STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Eleteday isthay owntay ompletelycay
-STR_0292_SAVE_SCENARIO                                          :Avesay enarioscay
-STR_0293_LOAD_SCENARIO                                          :Oadlay enarioscay
-STR_LOAD_HEIGHTMAP                                              :Oadlay eightmaphay
-STR_0294_QUIT_EDITOR                                            :Itquay editorway
-STR_0295                                                        :
-STR_0296_QUIT                                                   :Itquay
-STR_0297_SAVE_SCENARIO_LOAD_SCENARIO                            :{BLACK}Avesay enarioscay, oadlay enarioscay, abandonway enarioscay editorway, itquay
-STR_0298_LOAD_SCENARIO                                          :{WHITE}Oadlay Enarioscay
-STR_0299_SAVE_SCENARIO                                          :{WHITE}Avesay Enarioscay
-STR_029A_PLAY_SCENARIO                                          :{BLACK}Ayplay Enarioscay
-STR_PLAY_HEIGHTMAP                                              :{BLACK}Ayplay Eightmaphay
-STR_PLAY_HEIGHTMAP_HINT                                         :{BLACK}Artstay away ewnay amegay, usingway away eightmaphay asway andscapelay
-STR_QUIT_SCENARIO_QUERY                                         :{YELLOW}Areway ouyay uresay ouyay antway otay itquay isthay enarioscay ?
-STR_029C_QUIT_EDITOR                                            :{WHITE}Itquay Editorway
-STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...ancay onlyway ebay uiltbay inway ownstay ithway away opulationpay ofway atway eastlay 1200
-STR_029E_MOVE_THE_STARTING_DATE                                 :{BLACK}Ovemay ethay artingstay ateday ackwardbay 1 earyay
-STR_029F_MOVE_THE_STARTING_DATE                                 :{BLACK}Ovemay ethay artingstay ateday orwardfay 1 earyay
-STR_02A0_ENDS_OF_BRIDGE_MUST_BOTH                               :{WHITE}...endsway ofway idgebray ustmay othbay ebay onway andlay
-STR_02A1_SMALL                                                  :{BLACK}Allsmay
-STR_02A2_MEDIUM                                                 :{BLACK}Ediummay
-STR_02A3_LARGE                                                  :{BLACK}Argelay
-STR_SCENARIO_EDITOR_CITY                                        :{BLACK}Itycay
-STR_02A4_SELECT_TOWN_SIZE                                       :{BLACK}Electsay owntay izesay
-STR_02A5_TOWN_SIZE                                              :{YELLOW}Owntay izesay:
-
-STR_02B6                                                        :{STRING}  -  {STRING}
-STR_02B7_SHOW_LAST_MESSAGE_OR_NEWS                              :{BLACK}Owshay astlay essagemay orway ewsnay eportray
-STR_OFF                                                         :Offway
-STR_SUMMARY                                                     :Ummarysay
-STR_FULL                                                        :Ullfay
-STR_02BA                                                        :{SILVER}- -  {COMPANY}  - -
-STR_02BB_TOWN_DIRECTORY                                         :Owntay irectoryday
-STR_02BC_VEHICLE_DESIGN_NAMES                                   :{BLACK}Ehiclevay esignday amesnay
-STR_02BD                                                        :{BLACK}{STRING}
-STR_02BE_DEFAULT                                                :Efaultday
-STR_02BF_CUSTOM                                                 :Ustomcay
-STR_02C0_SAVE_CUSTOM_NAMES                                      :{BLACK}Avesay ustomcay amesnay
-STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION                         :{BLACK}Ehiclevay esignday amesnay electionsay
-STR_02C2_SAVE_CUSTOMIZED_VEHICLE                                :{BLACK}Avesay ustomisedcay ehiclevay esignday amesnay
-
-STR_CHECKMARK                                                   :{CHECKMARK}
-############ range for menu starts
-STR_02C3_GAME_OPTIONS                                           :Amegay optionsway
-STR_02C5_DIFFICULTY_SETTINGS                                    :Ifficultyday ettingssay
-STR_02C7_CONFIG_PATCHES                                         :Onfigurecay atchespay
-STR_NEWGRF_SETTINGS                                             :EwGRFnay ettingssay
-STR_TRANSPARENCY_OPTIONS                                        :Ansparencytray optionsway
-STR_GAMEOPTMENU_0A                                              :
-STR_02CA_TOWN_NAMES_DISPLAYED                                   :{SETX 12}Owntay amesnay isplayedday
-STR_02CC_STATION_NAMES_DISPLAYED                                :{SETX 12}Ationstay amesnay isplayedday
-STR_02CE_SIGNS_DISPLAYED                                        :{SETX 12}Ignssay isplayedday
-STR_WAYPOINTS_DISPLAYED2                                        :{SETX 12}Aypointsway isplayedday
-STR_02D0_FULL_ANIMATION                                         :{SETX 12}Ullfay animationway
-STR_02D2_FULL_DETAIL                                            :{SETX 12}Ullfay etailday
-STR_02D4_TRANSPARENT_BUILDINGS                                  :{SETX 12}Ansparenttray uildingsbay
-STR_TRANSPARENT_SIGNS                                           :{SETX 12}Ansparenttray ationstay ignssay
-############ range ends here
-
-############ range for menu starts
-STR_02D5_LAND_BLOCK_INFO                                        :Andlay areaway informationway
-STR_02D6                                                        :
-STR_CONSOLE_SETTING                                             :Oggletay Onsolecay
-STR_02D7_SCREENSHOT_CTRL_S                                      :Eenshotscray (Ctrlay-Say)
-STR_02D8_GIANT_SCREENSHOT_CTRL_G                                :Iantgay Eenshotscray (Ctrlay-Gay)
-STR_02D9_ABOUT_OPENTTD                                          :Aboutway 'OpenTTD'WAY
-############ range ends here
-
-STR_02DB_OFF                                                    :{BLACK}Offway
-STR_02DA_ON                                                     :{BLACK}Onway
-STR_02DC_DISPLAY_SUBSIDIES                                      :{BLACK}Isplayday ubsidiessay
-STR_02DD_SUBSIDIES                                              :Ubsidiessay
-STR_02DE_MAP_OF_WORLD                                           :Apmay ofway orldway
-STR_EXTRA_VIEW_PORT                                             :Extraway iewportvay
-STR_SIGN_LIST                                                   :Ignsay istlay
-STR_02DF_TOWN_DIRECTORY                                         :Owntay irectoryday
-STR_TOWN_POPULATION                                             :{BLACK}Orldway opulationpay: {COMMA}
-STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Iewportvay {COMMA}
-STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN                                :{BLACK}Opycay otay iewportvay
-STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN_TT                             :{BLACK}Opycay ethay ocationlay ofway ethay obalglay iewvay otay isthay iewportvay
-STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW                                :{BLACK}Astepay omfray iewportvay
-STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT                             :{BLACK}Astepay ethay ocationlay ofway isthay iewportvay otay ethay obalglay iewvay
-
-STR_02E0_CURRENCY_UNITS                                         :{BLACK}Urrencycay unitsway
-STR_02E1                                                        :{BLACK}{SKIP}{STRING}
-STR_02E2_CURRENCY_UNITS_SELECTION                               :{BLACK}Urrencycay unitsway electionsay
-STR_MEASURING_UNITS                                             :{BLACK}Easuringmay unitsway
-STR_02E4                                                        :{BLACK}{SKIP}{SKIP}{STRING}
-STR_MEASURING_UNITS_SELECTION                                   :{BLACK}Easuringmay unitsway electionsay
-STR_02E6_ROAD_VEHICLES                                          :{BLACK}Oadray ehiclesvay
-STR_02E7                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{STRING}
-STR_02E8_SELECT_SIDE_OF_ROAD_FOR                                :{BLACK}Electsay idesay ofway oadray orfay ehiclesvay otay ivedray onway
-STR_02E9_DRIVE_ON_LEFT                                          :Ivedray onway eftlay
-STR_02EA_DRIVE_ON_RIGHT                                         :Ivedray onway ightray
-STR_02EB_TOWN_NAMES                                             :{BLACK}Owntay amesnay
-STR_02EC                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
-STR_02ED_SELECT_STYLE_OF_TOWN_NAMES                             :{BLACK}Electsay ylestay ofway owntay amesnay
-
-STR_02F4_AUTOSAVE                                               :{BLACK}Autosaveway
-STR_02F5                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
-STR_02F6_SELECT_INTERVAL_BETWEEN                                :{BLACK}Electsay intervalway etweenbay automaticway amegay avessay
-STR_02F7_OFF                                                    :Offway
-STR_02F8_EVERY_3_MONTHS                                         :Everyway 3 onthsmay
-STR_02F9_EVERY_6_MONTHS                                         :Everyway 6 onthsmay
-STR_02FA_EVERY_12_MONTHS                                        :Everyway 12 onthsmay
-STR_02FB_START_A_NEW_GAME                                       :{BLACK}Artstay away ewnay amegay
-STR_02FC_LOAD_A_SAVED_GAME                                      :{BLACK}Oadlay away avedsay amegay
-STR_02FE_CREATE_A_CUSTOMIZED_GAME                               :{BLACK}Eatecray away ustomisedcay amegay orldway/enarioscay
-STR_02FF_SELECT_SINGLE_PLAYER_GAME                              :{BLACK}Electsay inglesay-ayerplay amegay
-STR_0300_SELECT_MULTIPLAYER_GAME                                :{BLACK}Electsay ultiplayermay amegay ofway 2-8 ayersplay
-STR_0301_DISPLAY_GAME_OPTIONS                                   :{BLACK}Isplayday amegay optionsway
-STR_0302_DISPLAY_DIFFICULTY_OPTIONS                             :{BLACK}Isplayday ifficultyday optionsway
-STR_0303_START_A_NEW_GAME_USING                                 :{BLACK}Artstay away ewnay amegay, usingway away ustomisedcay enarioscay
-STR_0304_QUIT                                                   :{BLACK}Itquay
-STR_0305_QUIT_OPENTTD                                           :{BLACK}Itquay 'OpenTTD'WAY
-STR_0307_OPENTTD                                                :{WHITE}OpenTTDWAY {REV}
-STR_030D_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...ancay onlyway ebay uiltbay inway ownstay
-STR_030E_SELECT_TEMPERATE_LANDSCAPE                             :{BLACK}Electsay 'emperate'tay andscapelay ylestay
-STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE                            :{BLACK}Electsay 'ubsay-arctic'WAY andscapelay ylestay
-STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE                          :{BLACK}Electsay 'ubsay-opical'tray andscapelay ylestay
-STR_0311_SELECT_TOYLAND_LANDSCAPE                               :{BLACK}Electsay 'oyland'tay andscapelay ylestay
-STR_0312_FUND_CONSTRUCTION_OF_NEW                               :{BLACK}Undfay onstructioncay ofway ewnay industryway
-
-############ range for menu starts
-STR_INDUSTRY_DIR                                                :Industryway Irectoryday
-STR_0313_FUND_NEW_INDUSTRY                                      :Undfay ewnay industryway
-############ range ends here
-
-STR_0314_FUND_NEW_INDUSTRY                                      :{WHITE}Undfay ewnay industryway
-STR_JUST_STRING                                                 :{STRING}
-STR_0316_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...ancay onlyway ebay uiltbay inway ownstay
-STR_0317_CAN_ONLY_BE_BUILT_IN_RAINFOREST                        :{WHITE}...ancay onlyway ebay uiltbay inway ainforestray areasway
-STR_0318_CAN_ONLY_BE_BUILT_IN_DESERT                            :{WHITE}...ancay onlyway ebay uiltbay inway esertday areasway
-STR_0319_PAUSED                                                 :{YELLOW}* *  USEDPAay  *  *
-
-STR_031B_SCREENSHOT_SUCCESSFULLY                                :{WHITE}Eenshotscray uccessfullysay avedsay asway '{STRING}'
-STR_031C_SCREENSHOT_FAILED                                      :{WHITE}Eenshotscray ailedfay!
-
-STR_0329_PURCHASE_LAND_FOR_FUTURE                               :{BLACK}Urchasepay andlay orfay uturefay useway
-STR_032F_AUTOSAVE                                               :{RED}AUTOSAVEWAY
-STR_SAVING_GAME                                                 :{RED}*  *  INGSAVay EGAMay  *  *
-STR_SAVE_STILL_IN_PROGRESS                                      :{WHITE}Avingsay illstay inway ogresspray,{}easeplay aitway untilway itway isway inishedfay!
-STR_0330_SELECT_EZY_STREET_STYLE                                :{BLACK}Electsay 'Ezyway Eetstray ylestay usic'may ogrammepray
-
-STR_0335_6                                                      :{BLACK}6
-STR_0336_7                                                      :{BLACK}7
-
-############ start of townname region
-STR_TOWNNAME_ORIGINAL_ENGLISH                                   :Englishway (Originalway)
-STR_TOWNNAME_FRENCH                                             :Enchfray
-STR_TOWNNAME_GERMAN                                             :Ermangay
-STR_TOWNNAME_ADDITIONAL_ENGLISH                                 :Englishway (Additionalway)
-STR_TOWNNAME_LATIN_AMERICAN                                     :Atinlay-Americanway
-STR_TOWNNAME_SILLY                                              :Illysay
-STR_TOWNNAME_SWEDISH                                            :Edishsway
-STR_TOWNNAME_DUTCH                                              :Utchday
-STR_TOWNNAME_FINNISH                                            :Innishfay
-STR_TOWNNAME_POLISH                                             :Olishpay
-STR_TOWNNAME_SLOVAKISH                                          :Ovakishslay
-STR_TOWNNAME_NORWEGIAN                                          :Orwegiannay
-STR_TOWNNAME_HUNGARIAN                                          :Ungarianhay
-STR_TOWNNAME_AUSTRIAN                                           :Austrianway
-STR_TOWNNAME_ROMANIAN                                           :Omanianray
-STR_TOWNNAME_CZECH                                              :Echczay
-STR_TOWNNAME_SWISS                                              :Isssway
-STR_TOWNNAME_DANISH                                             :Anishday
-STR_TOWNNAME_TURKISH                                            :Urkishtay
-STR_TOWNNAME_ITALIAN                                            :Italianway
-STR_TOWNNAME_CATALAN                                            :Atalancay
-############ end of townname region
-
-STR_CURR_GBP                                                    :Oundspay (£)
-STR_CURR_USD                                                    :Ollarsday ($)
-STR_CURR_EUR                                                    :Euroway (€)
-STR_CURR_YEN                                                    :Enyay (¥)
-STR_CURR_ATS                                                    :Austrianway Illingshay (ATSWAY)
-STR_CURR_BEF                                                    :Elgianbay Ancfray (EFBay)
-STR_CURR_CHF                                                    :Isssway Ancfray (CHFay)
-STR_CURR_CZK                                                    :Echczay Orunakay (CZKay)
-STR_CURR_DEM                                                    :Eutschmarkday (EMDay)
-STR_CURR_DKK                                                    :Anishday Onekray (DKKay)
-STR_CURR_ESP                                                    :Esetapay (ESPWAY)
-STR_CURR_FIM                                                    :Innishfay Arkkamay (IMFay)
-STR_CURR_FRF                                                    :Ancfray (FRFay)
-STR_CURR_GRD                                                    :Eekgray Achmadray (GRDay)
-STR_CURR_HUF                                                    :Ungarianhay Orintfay (UFHay)
-STR_CURR_ISK                                                    :Icelandicway Onakray (ISKWAY)
-STR_CURR_ITL                                                    :Italianway Iralay (ITLWAY)
-STR_CURR_NLG                                                    :Utchday Uildergay (NLGay)
-STR_CURR_NOK                                                    :Orwegiannay Onekray (OKNay)
-STR_CURR_PLN                                                    :Olishpay Otyzlay (PLNay)
-STR_CURR_ROL                                                    :Omanianray Eulay (OLRay)
-STR_CURR_RUR                                                    :Ussianray Ublesray (URRay)
-STR_CURR_SIT                                                    :Ovenianslay Olartay (ITSay)
-STR_CURR_SEK                                                    :Edishsway Onakray (EKSay)
-STR_CURR_YTL                                                    :Urkishtay Iralay (YTLay)
-STR_CURR_SKK                                                    :Ovakslay Orunakay (SKKay)
-STR_CURR_BRR                                                    :Azilianbray Ealray (BRLay)
-
-STR_CURR_CUSTOM                                                 :Ustomcay...
-
-STR_OPTIONS_LANG                                                :{BLACK}Anguagelay
-STR_OPTIONS_LANG_CBO                                            :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
-STR_OPTIONS_LANG_TIP                                            :{BLACK}Electsay ethay interfaceway anguagelay otay useway
-
-STR_OPTIONS_FULLSCREEN                                          :{BLACK}Ullscreenfay
-STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Eckchay isthay oxbay otay ayplay OpenTTDWAY ullscreenfay odemay
-
-STR_OPTIONS_RES                                                 :{BLACK}Eenscray esolutionray
-STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
-STR_OPTIONS_RES_TIP                                             :{BLACK}Electsay ethay eenscray esolutionray otay useway
-
-STR_OPTIONS_SCREENSHOT_FORMAT                                   :{BLACK}Eenshotscray ormatfay
-STR_OPTIONS_SCREENSHOT_FORMAT_CBO                               :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
-STR_OPTIONS_SCREENSHOT_FORMAT_TIP                               :{BLACK}Electsay ethay eenshotscray ormatfay otay useway
-
-STR_AUTOSAVE_1_MONTH                                            :Everyway onthmay
-STR_AUTOSAVE_FAILED                                             :{WHITE}Autosaveway ailedfay
-
-STR_MONTH_JAN                                                   :Anuaryjay
-STR_MONTH_FEB                                                   :Ebruaryfay
-STR_MONTH_MAR                                                   :Archmay
-STR_MONTH_APR                                                   :Aprilway
-STR_MONTH_MAY                                                   :Aymay
-STR_MONTH_JUN                                                   :Unejay
-STR_MONTH_JUL                                                   :Ulyjay
-STR_MONTH_AUG                                                   :Augustway
-STR_MONTH_SEP                                                   :Eptembersay
-STR_MONTH_OCT                                                   :Octoberway
-STR_MONTH_NOV                                                   :Ovembernay
-STR_MONTH_DEC                                                   :Ecemberday
-
-STR_HEADING_FOR_STATION                                         :{LTBLUE}Eadinghay orfay {STATION}
-STR_HEADING_FOR_STATION_VEL                                     :{LTBLUE}Eadinghay orfay {STATION}, {VELOCITY}
-STR_NO_ORDERS                                                   :{LTBLUE}Onay ordersway
-STR_NO_ORDERS_VEL                                               :{LTBLUE}Onay ordersway, {VELOCITY}
-
-STR_PASSENGERS                                                  :assengerspay
-STR_BAGS                                                        :agsbay
-STR_TONS                                                        :onnestay
-STR_LITERS                                                      :itreslay
-STR_ITEMS                                                       :itemsway
-STR_CRATES                                                      :atescray
-STR_RES_OTHER                                                   :otherway
-STR_NOTHING                                                     :
-
-STR_SMALL_RIGHT_ARROW                                           :{TINYFONT}{RIGHTARROW}
-
-STR_CANT_SHARE_ORDER_LIST                                       :{WHITE}An'tcay areshay orderway istlay...
-STR_CANT_COPY_ORDER_LIST                                        :{WHITE}An'tcay opycay orderway istlay...
-STR_END_OF_SHARED_ORDERS                                        :{SETX 10}- - Endway ofway Aredshay Ordersway - -
-
-STR_TRAIN_IS_LOST                                               :{WHITE}Aintray {COMMA} isway ostlay.
-STR_TRAIN_IS_UNPROFITABLE                                       :{WHITE}Aintray {COMMA}'say ofitpray astlay earyay asway {CURRENCY}
-STR_EURO_INTRODUCE                                              :{BLACK}{BIGFONT}Europeanway Onetarymay Unionway!{}{}Ethay Euroway isway introducedway asway ethay olesay urrencycay orfay everydayway ansactionstray inway ouryay ountrycay!
-
-# Start of order review system.
-# DON'T ADD OR REMOVE LINES HERE
-STR_TRAIN_HAS_TOO_FEW_ORDERS                                    :{WHITE}Aintray {COMMA} ashay ootay ewfay ordersway inway ethay eduleschay
-STR_TRAIN_HAS_VOID_ORDER                                        :{WHITE}Aintray {COMMA} ashay away oidvay orderway
-STR_TRAIN_HAS_DUPLICATE_ENTRY                                   :{WHITE}Aintray {COMMA} ashay uplicateday ordersway
-STR_TRAIN_HAS_INVALID_ENTRY                                     :{WHITE}Aintray {COMMA} ashay anway invalidway ationstay inway itsway ordersway
-STR_ROADVEHICLE_HAS_TOO_FEW_ORDERS                              :{WHITE}Oadray Ehiclevay {COMMA} ashay ootay ewfay ordersway inway ethay eduleschay
-STR_ROADVEHICLE_HAS_VOID_ORDER                                  :{WHITE}Oadray Ehiclevay {COMMA} ashay away oidvay orderway
-STR_ROADVEHICLE_HAS_DUPLICATE_ENTRY                             :{WHITE}Oadray Ehiclevay {COMMA} ashay uplicateday ordersway
-STR_ROADVEHICLE_HAS_INVALID_ENTRY                               :{WHITE}Oadray Ehiclevay {COMMA} ashay anway invalidway ationstay inway itsway ordersway
-STR_SHIP_HAS_TOO_FEW_ORDERS                                     :{WHITE}Ipshay {COMMA} ashay ootay ewfay ordersway inway ethay eduleschay
-STR_SHIP_HAS_VOID_ORDER                                         :{WHITE}Ipshay {COMMA} ashay away oidvay orderway
-STR_SHIP_HAS_DUPLICATE_ENTRY                                    :{WHITE}Ipshay {COMMA} ashay uplicateday ordersway
-STR_SHIP_HAS_INVALID_ENTRY                                      :{WHITE}Ipshay {COMMA} ashay anway invalidway ationstay inway itsway ordersway
-STR_AIRCRAFT_HAS_TOO_FEW_ORDERS                                 :{WHITE}Aircraftway {COMMA} ashay ootay ewfay ordersway inway ethay eduleschay
-STR_AIRCRAFT_HAS_VOID_ORDER                                     :{WHITE}Aircraftway {COMMA} ashay away oidvay orderway
-STR_AIRCRAFT_HAS_DUPLICATE_ENTRY                                :{WHITE}Aircraftway {COMMA} ashay uplicateday ordersway
-STR_AIRCRAFT_HAS_INVALID_ENTRY                                  :{WHITE}Aircraftway {COMMA} ashay anway invalidway ationstay inway itsway ordersway
-# end of order system
-
-STR_TRAIN_AUTORENEW_FAILED                                      :{WHITE}Autorenewway ailedfay onway aintray {COMMA} (oneymay imitlay)
-STR_ROADVEHICLE_AUTORENEW_FAILED                                :{WHITE}Autorenewway ailedfay onway oadray ehiclevay {COMMA} (oneymay imitlay)
-STR_SHIP_AUTORENEW_FAILED                                       :{WHITE}Autorenewway ailedfay onway ipshay {COMMA} (oneymay imitlay)
-STR_AIRCRAFT_AUTORENEW_FAILED                                   :{WHITE}Autorenewway ailedfay onway aircraftway {COMMA} (oneymay imitlay)
-STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT                            :{WHITE}Aintray {COMMA} isway ootay onglay afterway eplacementray
-
-STR_CONFIG_PATCHES                                              :{BLACK}Onfigurecay Atchespay
-STR_CONFIG_PATCHES_TIP                                          :{BLACK}Onfigurecay ethay atchespay
-STR_CONFIG_PATCHES_CAPTION                                      :{WHITE}Onfigurecay Atchespay
-
-STR_CONFIG_PATCHES_OFF                                          :Offway
-STR_CONFIG_PATCHES_ON                                           :Onway
-STR_CONFIG_PATCHES_VEHICLESPEED                                 :{LTBLUE}Owshay ehiclevay eedspay inway atusstay arbay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_BUILDONSLOPES                                :{LTBLUE}Allowway uildingbay onway opesslay andway oastscay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_CATCHMENT                                    :{LTBLUE}Allowway oremay ealisticallyray izedsay atchmentcay areasway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_EXTRADYNAMITE                                :{LTBLUE}Allowway emovalray ofway oremay owntay-ownedway oadsray, idgesbray, etcway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MAMMOTHTRAINS                                :{LTBLUE}Enableway uildingbay eryvay onglay ainstray: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_REALISTICACCEL                               :{LTBLUE}Enableway ealisticray accelerationway orfay ainstray: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_FORBID_90_DEG                                :{LTBLUE}Orbidfay ainstray andway ipsshay otay akemay 90 egday urnstay: {ORANGE}{STRING} {LTBLUE} (equiresray NPFay)
-STR_CONFIG_PATCHES_JOINSTATIONS                                 :{LTBLUE}Oinjay aintray ationsstay uiltbay extnay otay eachway otherway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_FULLLOADANY                                  :{LTBLUE}Eavelay ationstay enwhay anyway argocay isway ullfay, ifway 'ullfay oad'lay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_IMPROVEDLOAD                                 :{LTBLUE}Useway improvedway oadinglay algorithmway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_GRADUAL_LOADING                              :{LTBLUE}Oadlay ehiclesvay aduallygray: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_INFLATION                                    :{LTBLUE}Inflationway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SELECTGOODS                                  :{LTBLUE}Eliverday argocay otay away ationstay onlyway enwhay erethay isway away emandday: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LONGBRIDGES                                  :{LTBLUE}Allowway uildingbay eryvay onglay idgesbray: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_GOTODEPOT                                    :{LTBLUE}Allowway otogay epotday ordersway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD             :{LTBLUE}Anualmay imarypray industryway onstructioncay ethodmay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_NONE        :onenay
-STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL      :asway otherway industriesway
-STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :ospectingpray
-STR_CONFIG_PATCHES_MULTIPINDTOWN                                :{LTBLUE}Allowway ultiplemay imilarsay industriesway erpay owntay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SAMEINDCLOSE                                 :{LTBLUE}Industriesway ofway ethay amesay ypetay ancay ebay uiltbay oseclay otay eachway otherway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LONGDATE                                     :{LTBLUE}Alwaysway owshay onglay ateday inway ethay atusstay arbay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SIGNALSIDE                                   :{LTBLUE}Owshay ignalssay onway ethay ivedray idesay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SHOWFINANCES                                 :{LTBLUE}Owshay inancesfay indowway atway ethay endway ofway ethay earyay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_NEW_NONSTOP                                  :{LTBLUE}AtchtTDPay ompatiblecay onstopnay andlinghay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ROADVEH_QUEUE                                :{LTBLUE}Oadray ehiclevay eueingquay (ithway antumquay effectsway): {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AUTOSCROLL                                   :{LTBLUE}Anpay indowway enwhay ousemay isway atway ethay edgeway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_BRIBE                                        :{LTBLUE}Allowway ibingbray ofway ethay ocallay authorityway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_NONUNIFORM_STATIONS                          :{LTBLUE}Onuniformnay ationsstay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_NEW_PATHFINDING_ALL                          :{LTBLUE}Ewnay obalglay athfindingpay (NPFay, overridesway NTPay): {ORANGE}{STRING}
-STR_CONFIG_PATCHES_FREIGHT_TRAINS                               :{LTBLUE}Eightway ultipliermay orfay eightfray otay imulatesay eavyhay ainstray: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_STOP_ON_TOWN_ROAD                            :{LTBLUE}Allowway ivedray-oughthray oadray opsstay onway owntay ownedway oadsray: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ADJACENT_STATIONS                            :{LTBLUE}Allowway uildingbay adjacentway ationsstay: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_SMALL_AIRPORTS                               :{LTBLUE}Alwaysway allowway allsmay airportsway: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_WARN_LOST_TRAIN                              :{LTBLUE}Arnway ifway aintray isway ostlay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ORDER_REVIEW                                 :{LTBLUE}Eviewray ehicles'vay ordersway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ORDER_REVIEW_OFF                             :onay
-STR_CONFIG_PATCHES_ORDER_REVIEW_EXDEPOT                         :esyay, utbay excludeway oppedstay ehiclesvay
-STR_CONFIG_PATCHES_ORDER_REVIEW_ON                              :ofway allway ehiclesvay
-STR_CONFIG_PATCHES_WARN_INCOME_LESS                             :{LTBLUE}Arnway ifway away ain'stray incomeway isway egativenay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_NEVER_EXPIRE_VEHICLES                        :{LTBLUE}Ehiclesvay evernay expireway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AUTORENEW_VEHICLE                            :{LTBLUE}Autorenewway ehiclevay enwhay itway etsgay oldway
-STR_CONFIG_PATCHES_AUTORENEW_MONTHS                             :{LTBLUE}Autorenewway enwhay ehicevay isway {ORANGE}{STRING}{LTBLUE} onthsmay eforebay/afterway axmay ageway
-STR_CONFIG_PATCHES_AUTORENEW_MONEY                              :{LTBLUE}Autorenewway inimummay eedednay oneymay orfay enewray: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ERRMSG_DURATION                              :{LTBLUE}Urationday ofway errorway essagemay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_POPULATION_IN_LABEL                          :{LTBLUE}Owshay owntay opulationpay inway ethay owntay amenay abellay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_INVISIBLE_TREES                              :{LTBLUE}Invisibleway eestray (ithway ansparenttray uildingsbay): {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_LAND_GENERATOR                               :{LTBLUE}Andlay eneratorgay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LAND_GENERATOR_ORIGINAL                      :Originalway
-STR_CONFIG_PATCHES_LAND_GENERATOR_TERRA_GENESIS                 :ErraGenesistay
-STR_CONFIG_PATCHES_OIL_REF_EDGE_DISTANCE                        :{LTBLUE}Axmay istanceday omfray edgeway orfay Oilway Efineriesray {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SNOWLINE_HEIGHT                              :{LTBLUE}Owsnay inelay eighthay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN                         :{LTBLUE}Oughnessray ofway erraintay (ErraGenesistay onlyway) : {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH             :Eryvay Oothsmay
-STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_SMOOTH                  :Oothsmay
-STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_ROUGH                   :Oughray
-STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_ROUGH              :Eryvay Oughray
-STR_CONFIG_PATCHES_TREE_PLACER                                  :{LTBLUE}Eetray acerplay algorithmway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_TREE_PLACER_NONE                             :Onenay
-STR_CONFIG_PATCHES_TREE_PLACER_ORIGINAL                         :Originalway
-STR_CONFIG_PATCHES_TREE_PLACER_IMPROVED                         :Improvedway
-STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION                           :{LTBLUE}Eightmaphay otationray: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_COUNTER_CLOCKWISE         :Ountercay ockwiseclay
-STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_CLOCKWISE                 :Ockwiseclay
-STR_CONFIG_PATCHES_SE_FLAT_WORLD_HEIGHT                         :{LTBLUE}Ethay eighthay evellay away atflay enarioscay apmay etsgay: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_STATION_SPREAD                               :{LTBLUE}Axmay ationstay eadspray: {ORANGE}{STRING} {RED}Arningway: Ighhay ettingsay owsslay amegay
-STR_CONFIG_PATCHES_SERVICEATHELIPAD                             :{LTBLUE}Ervicesay elicoptershay atway elipadshay automaticallyway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR                       :{LTBLUE}Inklay andscapelay oolbartay otay ailray/oadray/aterway/airportway oolbarstay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_REVERSE_SCROLLING                            :{LTBLUE}Everseray ollscray irectionday: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SMOOTH_SCROLLING                             :{LTBLUE}Oothsmay iewportvay ollingscray: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MEASURE_TOOLTIP                              :{LTBLUE}Owshay away easurementmay ooltiptay enwhay usingway ariousvay uildbay-oolstay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LIVERIES                                     :{LTBLUE}Owshay ompanycay iverieslay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_LIVERIES_NONE                                :Onenay
-STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Ownway ompanycay
-STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Allway ompaniescay
-STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Eferpray eamtay atchay ithway <ENTERWAY>: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Unctionfay ofway ollwheelscray: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Oomzay apmay
-STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Ollscray apmay
-STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Offway
-STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Apmay ollwheelscray eedspay: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU                          :{LTBLUE}Ightray-ickclay emulationway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_COMMAND                  :Ommandcay-ickclay
-STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_CONTROL                  :Ontrolcay-ickclay
-STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_OFF                      :Offway
-
-STR_CONFIG_PATCHES_PAUSE_ON_NEW_GAME                            :{LTBLUE}Automaticallyway ausepay enwhay artingstay away ewnay amegay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS                       :{LTBLUE}Useway ethay advancedway ehiclevay istlay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OFF                   :Offway
-STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OWN                   :Ownway ompanycay
-STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_ALL                   :Allway ompaniescay
-STR_CONFIG_PATCHES_LOADING_INDICATORS                           :{LTBLUE}Useway oadinglay indicatorsway:{ORANGE}{STRING}
-STR_CONFIG_PATCHES_LOADING_INDICATORS_OFF                       :Offway
-STR_CONFIG_PATCHES_LOADING_INDICATORS_OWN                       :Ownway ompanycay
-STR_CONFIG_PATCHES_LOADING_INDICATORS_ALL                       :Allway ompaniescay
-STR_CONFIG_PATCHES_TIMETABLE_ALLOW                              :{LTBLUE}Enableway imetablingtay orfay ehiclesvay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_TIMETABLE_IN_TICKS                           :{LTBLUE}Owshay imetabletay inway ickstay atherray anthay aysday: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE                            :{LTBLUE}Efaultday ailray ypetay (afterway ewnay amegay/amegay oadlay): {ORANGE}{STRING}
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_RAIL                       :Ormalnay Ailray
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_ELRAIL                     :Electrifiedway Ailray
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MONORAIL                   :Onorailmay
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MAGLEV                     :Aglevmay
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_FIRST                      :Irstfay availableway
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_LAST                       :Astlay availableway
-STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MOST_USED                  :Ostmay usedway
-
-STR_CONFIG_PATCHES_ALWAYS_BUILD_INFRASTRUCTURE                  :{LTBLUE}Owshay uildingbay oolstay enwhay onay uitablesay ehiclesvay:{ORANGE}{STRING}
-STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Axmay ainstray erpay ayerplay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Axmay oadray ehiclesvay erpay ayerplay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MAX_AIRCRAFT                                 :{LTBLUE}Axmay aircraftway erpay ayerplay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MAX_SHIPS                                    :{LTBLUE}Axmay ipsshay erpay ayerplay: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_AI_BUILDS_TRAINS                             :{LTBLUE}Isableday ainstray orfay omputercay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AI_BUILDS_ROADVEH                            :{LTBLUE}Isableday oadray ehiclesvay orfay omputercay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AI_BUILDS_AIRCRAFT                           :{LTBLUE}Isableday aircraftway orfay omputercay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AI_BUILDS_SHIPS                              :{LTBLUE}Isableday ipsshay orfay omputercay: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_AINEW_ACTIVE                                 :{LTBLUE}Enableway ewnay AIWAY (alphaway): {ORANGE}{STRING}
-STR_CONFIG_PATCHES_AI_IN_MULTIPLAYER                            :{LTBLUE}Allowway AIsway inway ultiplayermay (experimentalway): {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_SERVINT_TRAINS                               :{LTBLUE}Efaultday ervicesay intervalway orfay ainstray: {ORANGE}{STRING} aysday/%
-STR_CONFIG_PATCHES_SERVINT_TRAINS_DISABLED                      :{LTBLUE}Efaultday ervicesay intervalway orfay ainstray: {ORANGE}isabledday
-STR_CONFIG_PATCHES_SERVINT_ROADVEH                              :{LTBLUE}Efaultday ervicesay intervalway orfay oadray ehiclesvay: {ORANGE}{STRING} aysday/%
-STR_CONFIG_PATCHES_SERVINT_ROADVEH_DISABLED                     :{LTBLUE}Efaultday ervicesay intervalway orfay oadray ehiclesvay: {ORANGE}isabledday
-STR_CONFIG_PATCHES_SERVINT_AIRCRAFT                             :{LTBLUE}Efaultday ervicesay intervalway orfay aircraftway: {ORANGE}{STRING} aysday/%
-STR_CONFIG_PATCHES_SERVINT_AIRCRAFT_DISABLED                    :{LTBLUE}Efaultday ervicesay intervalway orfay aircraftway: {ORANGE}isabledday
-STR_CONFIG_PATCHES_SERVINT_SHIPS                                :{LTBLUE}Efaultday ervicesay intervalway orfay ipsshay: {ORANGE}{STRING} aysday/%
-STR_CONFIG_PATCHES_SERVINT_SHIPS_DISABLED                       :{LTBLUE}Efaultday ervicesay intervalway orfay ipsshay: {ORANGE}isabledday
-STR_CONFIG_PATCHES_NOSERVICE                                    :{LTBLUE}Isableday ervicingsay enwhay eakdownsbray etsay otay onenay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_WAGONSPEEDLIMITS                             :{LTBLUE}Enableway agonway eedspay imitslay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_DISABLE_ELRAILS                              :{LTBLUE}Isableday electricway ailsray: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_COLORED_NEWS_YEAR                            :{LTBLUE}Olouredcay ewsnay appearsway inway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_STARTING_YEAR                                :{LTBLUE}Artingstay earyay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_ENDING_YEAR                                  :{LTBLUE}Endway amegay inway: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_SMOOTH_ECONOMY                               :{LTBLUE}Enableway oothsmay economyway (oremay, allersmay angeschay)
-STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Allowway uyingbay aresshay omfray otherway ompaniescay
-STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Enwhay aggingdray, aceplay ignalssay everyway: {ORANGE}{STRING} iletay(say)
-STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Automaticallyway uildbay emaphoressay eforebay: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Ethay owntay ayoutlay "onay oremay oadsray" isn'tway alidvay inway ethay enarioscay editorway
-STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Electsay owntay-oadray ayoutlay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_TOWN_LAYOUT_NO_ROADS                         :onay oremay oadsray
-STR_CONFIG_PATCHES_TOWN_LAYOUT_DEFAULT                          :efaultday
-STR_CONFIG_PATCHES_TOWN_LAYOUT_BETTER_ROADS                     :etterbay oadsray
-STR_CONFIG_PATCHES_TOWN_LAYOUT_2X2_GRID                         :2xay2 idgray
-STR_CONFIG_PATCHES_TOWN_LAYOUT_3X3_GRID                         :3xay3 idgray
-
-STR_CONFIG_PATCHES_TOOLBAR_POS                                  :{LTBLUE}Ositionpay ofway ainmay oolbartay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT                             :Eftlay
-STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER                           :Entrecay
-STR_CONFIG_PATCHES_TOOLBAR_POS_RIGHT                            :Ightray
-STR_CONFIG_PATCHES_SNAP_RADIUS                                  :{LTBLUE}Indowway apsnay adiusray: {ORANGE}{STRING} pxay
-STR_CONFIG_PATCHES_SNAP_RADIUS_DISABLED                         :{LTBLUE}Indowway apsnay adiusray: {ORANGE}isabledday
-STR_CONFIG_PATCHES_TOWN_GROWTH                                  :{LTBLUE}Owntay owthgray eedspay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_TOWN_GROWTH_NONE                             :Onenay
-STR_CONFIG_PATCHES_TOWN_GROWTH_SLOW                             :Owslay
-STR_CONFIG_PATCHES_TOWN_GROWTH_NORMAL                           :Ormalnay
-STR_CONFIG_PATCHES_TOWN_GROWTH_FAST                             :Astfay
-STR_CONFIG_PATCHES_TOWN_GROWTH_VERY_FAST                        :Eryvay astfay
-STR_CONFIG_PATCHES_LARGER_TOWNS                                 :{LTBLUE}Oportionpray ofway ownstay atthay illway ecomebay itiescay: {ORANGE}1 inway {STRING}
-STR_CONFIG_PATCHES_LARGER_TOWNS_DISABLED                        :{LTBLUE}Oportionpray ofway ownstay atthay illway ecomebay itiescay: {ORANGE}Onenay
-STR_CONFIG_PATCHES_CITY_SIZE_MULTIPLIER                         :{LTBLUE}Initialway itycay izesay ultipliermay: {ORANGE}{STRING}
-
-STR_CONFIG_PATCHES_GUI                                          :{BLACK}Interfaceway
-STR_CONFIG_PATCHES_CONSTRUCTION                                 :{BLACK}Onstructioncay
-STR_CONFIG_PATCHES_VEHICLES                                     :{BLACK}Ehiclesvay
-STR_CONFIG_PATCHES_STATIONS                                     :{BLACK}Ationsstay
-STR_CONFIG_PATCHES_ECONOMY                                      :{BLACK}Economyway
-STR_CONFIG_PATCHES_AI                                           :{BLACK}Ompetitorscay
-
-STR_CONFIG_PATCHES_DISABLED                                     :isabledday
-STR_CONFIG_PATCHES_INT32                                        :{NUM}
-STR_CONFIG_PATCHES_CURRENCY                                     :{CURRENCY}
-
-STR_CONFIG_PATCHES_QUERY_CAPT                                   :{WHITE}Angechay ettingsay aluevay
-STR_CONFIG_PATCHES_SERVICE_INTERVAL_INCOMPATIBLE                :{WHITE}Omesay orway allway ofway ethay efaultday ervicesay intervalway(say) elowbay areway incompatibleway ithway ethay osenchay ettingsay! 5-90% andway 30-800 aysday areway alidvay
-STR_CONFIG_PATCHES_YAPF_SHIPS                                   :{LTBLUE}Useway YAPFay orfay ipsshay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_YAPF_ROAD                                    :{LTBLUE}Useway YAPFay orfay oadvehsray: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_YAPF_RAIL                                    :{LTBLUE}Useway YAPFay orfay ainstray: {ORANGE}{STRING}
-
-STR_TEMPERATE_LANDSCAPE                                         :Emperatetay andscapelay
-STR_SUB_ARCTIC_LANDSCAPE                                        :Ubsay-arcticway andscapelay
-STR_SUB_TROPICAL_LANDSCAPE                                      :Ubsay-opicaltray andscapelay
-STR_TOYLAND_LANDSCAPE                                           :Oylandtay andscapelay
-
-STR_CHEATS                                                      :{WHITE}Eatschay
-STR_CHEATS_TIP                                                  :{BLACK}Eckboxeschay indicateway ifway ouyay avehay usedway isthay eatchay eforebay
-STR_CHEATS_WARNING                                              :{BLACK}Arningway! Ouyay areway aboutway otay etraybay ouryay ellowfay ompetitorscay. Eepkay inway indmay atthay uchsay away isgraceday illway ebay ememberedray orfay eternityway.
-STR_CHEAT_MONEY                                                 :{LTBLUE}Increaseway oneymay ybay {CURRENCY}
-STR_CHEAT_CHANGE_PLAYER                                         :{LTBLUE}Ayingplay asway ayerplay: {ORANGE}{COMMA}
-STR_CHEAT_EXTRA_DYNAMITE                                        :{LTBLUE}Agicmay ulldozerbay (emoveray industriesway, unmovablesway): {ORANGE}{STRING}
-STR_CHEAT_CROSSINGTUNNELS                                       :{LTBLUE}Unnelstay aymay osscray eachway otherway: {ORANGE}{STRING}
-STR_CHEAT_BUILD_IN_PAUSE                                        :{LTBLUE}Uildbay ilewhay inway ausepay odemay: {ORANGE}{STRING}
-STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Etplanesjay illway otnay ashcray (equentlyfray) onway allsmay airportsway: {ORANGE} {STRING}
-STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Itchsway imateclay: {ORANGE} {STRING}
-STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Angechay ateday: {ORANGE} {DATE_SHORT}
-STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Enableway odifyingmay oductionpray aluesvay: {ORANGE}{STRING}
-
-STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Eadinghay orfay {WAYPOINT}
-STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Eadinghay orfay {WAYPOINT}, {VELOCITY}
-
-STR_GO_TO_WAYPOINT                                              :Ogay iavay {WAYPOINT}
-STR_GO_NON_STOP_TO_WAYPOINT                                     :Ogay onnay-opstay iavay {WAYPOINT}
-
-STR_WAYPOINTNAME_CITY                                           :Aypointway {TOWN}
-STR_WAYPOINTNAME_CITY_SERIAL                                    :Aypointway {TOWN} #{COMMA}
-STR_LANDINFO_WAYPOINT                                           :Aypointway
-
-STR_WAYPOINT                                                    :{WHITE}Aypointway
-STR_WAYPOINT_GRAPHICS_TIP                                       :{BLACK}Electsay aypointway ypetay
-
-STR_WAYPOINT_VIEWPORT                                           :{WHITE}{WAYPOINT}
-STR_WAYPOINT_VIEWPORT_TINY                                      :{TINYFONT}{WHITE}{WAYPOINT}
-STR_WAYPOINT_RAW                                                :{WAYPOINT}
-STR_EDIT_WAYPOINT_NAME                                          :{WHITE}Editway aypointway amenay
-
-STR_CANT_CHANGE_WAYPOINT_NAME                                   :{WHITE}An'tcay angechay aypointway amenay...
-STR_CONVERT_RAIL_TO_WAYPOINT_TIP                                :{BLACK}Onvertcay ailray otay aypointway
-STR_CANT_BUILD_TRAIN_WAYPOINT                                   :{WHITE}An'tcay uildbay aintray aypointway erehay...
-STR_CANT_REMOVE_TRAIN_WAYPOINT                                  :{WHITE}An'tcay emoveray aintray aypointway erehay...
-
-STR_BUILD_AUTORAIL_TIP                                          :{BLACK}Uildbay ailwayray acktray usingway ethay Autorailway odemay
-
-STR_NO_TOWN_IN_SCENARIO                                         :{WHITE}...erethay isway onay owntay inway isthay enarioscay
-
-STR_GENERATE_RANDOM_LANDSCAPE                                   :{WHITE}Areway ouyay uresay ouyay antway otay eatecray away andomray andscapelay?
-STR_MANY_RANDOM_TOWNS                                           :{BLACK}Anymay andomray ownstay
-STR_RANDOM_TOWNS_TIP                                            :{BLACK}Overcay ethay apmay ithway andomlyray acedplay ownstay
-STR_MANY_RANDOM_INDUSTRIES                                      :Anymay andomray industriesway
-STR_RANDOM_INDUSTRIES_TIP                                       :{BLACK}Overcay ethay apmay ithway andomlyray acedplay industriesway
-STR_CAN_T_GENERATE_INDUSTRIES                                   :{WHITE}An'tcay enerategay industriesway...
-
-STR_LANDSCAPING_TOOLBAR_TIP                                     :{BLACK}Openway ethay andscapinglay oolbartay otay aiseray/owerlay andlay, antplay eestray, etcway.
-STR_LANDSCAPING_TOOLBAR                                         :{WHITE}Andscapinglay
-STR_LEVEL_LAND_TOOLTIP                                          :{BLACK}Evellay andlay
-
-
-STR_TREES_RANDOM_TYPE                                           :{BLACK}Eestray ofway andomray ypetay
-STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Aceplay eestray ofway andomray ypetay
-
-STR_CANT_BUILD_CANALS                                           :{WHITE}An'tcay uildbay analscay erehay...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Uildbay analscay.
-STR_LANDINFO_CANAL                                              :Analcay
-
-STR_CANT_BUILD_LOCKS                                            :{WHITE}An'tcay uildbay ockslay erehay...
-STR_BUILD_LOCKS_TIP                                             :{BLACK}Uildbay ockslay
-STR_LANDINFO_LOCK                                               :Ocklay
-
-STR_BUOY_IS_IN_USE                                              :{WHITE}...uoybay isway inway useway!
-
-STR_LANDINFO_COORDS                                             :{BLACK}Oordinatescay: {LTBLUE}{NUM}x{NUM}x{NUM} ({STRING})
-
-STR_CANT_REMOVE_PART_OF_STATION                                 :{WHITE}An'tcay emoveray artpay ofway ationstay...
-STR_CANT_CONVERT_RAIL                                           :{WHITE}An'tcay onvertcay ailtyperay erehay...
-STR_CONVERT_RAIL_TIP                                            :{BLACK}Onvertcay/Upgradeway ethay ypetay ofway ailray
-
-STR_DRAG_WHOLE_TRAIN_TO_SELL_TIP                                :{BLACK}Agdray aintray engineway erehay otay ellsay ethay olewhay aintray
-
-STR_DRAG_DROP                                                   :{BLACK}Agdray & Opdray
-STR_STATION_DRAG_DROP                                           :{BLACK}Uildbay away ationstay usingway agdray & opdray
-STR_SELECT_STATION_CLASS_TIP                                    :{BLACK}Electsay away ationstay assclay otay isplayday
-STR_SELECT_STATION_TYPE_TIP                                     :{BLACK}Electsay ethay ationstay ypetay otay uildbay
-
-STR_FAST_FORWARD                                                :{BLACK}Astfay orwardfay ethay amegay
-STR_MESSAGE_HISTORY                                             :{WHITE}Essagemay Istoryhay
-STR_MESSAGE_HISTORY_TIP                                         :{BLACK}Away istlay ofway ethay ecentray ewsnay essagesmay
-STR_MESSAGES_DISABLE_ALL                                        :{BLACK}Isableday allway
-STR_MESSAGES_ENABLE_ALL                                         :{BLACK}Enableway allway
-
-STR_CONSTRUCT_COAL_MINE_TIP                                     :{BLACK}Onstructcay Oalcay Inemay
-STR_CONSTRUCT_FOREST_TIP                                        :{BLACK}Antplay Orestfay
-STR_CONSTRUCT_OIL_RIG_TIP                                       :{BLACK}Onstructcay Oilway Igray
-STR_CONSTRUCT_FARM_TIP                                          :{BLACK}Undfay Armfay
-STR_CONSTRUCT_COPPER_ORE_MINE_TIP                               :{BLACK}Onstructcay Oppercay Oreway Inemay
-STR_CONSTRUCT_OIL_WELLS_TIP                                     :{BLACK}Illdray orfay Oilway
-STR_CONSTRUCT_GOLD_MINE_TIP                                     :{BLACK}Onstructcay Oldgay Inemay
-STR_CONSTRUCT_DIAMOND_MINE_TIP                                  :{BLACK}Onstructcay Iamondday Inemay
-STR_CONSTRUCT_IRON_ORE_MINE_TIP                                 :{BLACK}Onstructcay Ironway Oreway Inemay
-STR_CONSTRUCT_FRUIT_PLANTATION_TIP                              :{BLACK}Undfay Uitfray Antationplay
-STR_CONSTRUCT_RUBBER_PLANTATION_TIP                             :{BLACK}Undfay Ubberray Antationplay
-STR_CONSTRUCT_WATER_SUPPLY_TIP                                  :{BLACK}Undfay Aterway Upplysay
-STR_CONSTRUCT_COTTON_CANDY_TIP                                  :{BLACK}Antplay Andyflosscay Orestfay
-STR_CONSTRUCT_BATTERY_FARM_TIP                                  :{BLACK}Undfay Atterybay Armfay
-STR_CONSTRUCT_COLA_WELLS_TIP                                    :{BLACK}Illdray orfay Olacay
-STR_CONSTRUCT_PLASTIC_FOUNTAINS_TIP                             :{BLACK}Undfay Asticplay Ountainsfay
-STR_CONSTRUCT_BUBBLE_GENERATOR_TIP                              :{BLACK}Onstructcay Ubblebay Eneratorgay
-STR_CONSTRUCT_TOFFEE_QUARRY_TIP                                 :{BLACK}Undfay Offeetay Arryquay
-STR_CONSTRUCT_SUGAR_MINE_TIP                                    :{BLACK}Onstructcay Ugarsay Inemay
-
-STR_INDUSTRYDIR_CAPTION                                         :{WHITE}Industriesway
-STR_INDUSTRYDIR_ITEM                                            :{ORANGE}{INDUSTRY}{BLACK} ({CARGO}){YELLOW} ({COMMA}% ansportedtray)
-STR_INDUSTRYDIR_ITEM_TWO                                        :{ORANGE}{INDUSTRY}{BLACK} ({CARGO}/{CARGO}){YELLOW} ({COMMA}%/{COMMA}% ansportedtray)
-STR_INDUSTRYDIR_ITEM_NOPROD                                     :{ORANGE}{INDUSTRY}
-
-STR_INDUSTRY_TOO_CLOSE                                          :{WHITE}...ootay oseclay otay anotherway industryway
-
-STR_RAIL_REFIT_VEHICLE_TO_CARRY                                 :{BLACK}Efitray aintray otay arrycay away ifferentday argocay ypetay
-STR_RAIL_REFIT_VEHICLE                                          :{BLACK}Efitray aintray
-STR_RAIL_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Electsay ypetay ofway argocay orfay aintray otay arrycay
-STR_RAIL_REFIT_TO_CARRY_HIGHLIGHTED                             :{BLACK}Efitray aintray otay arrycay ighlightedhay argocay ypetay
-STR_RAIL_CAN_T_REFIT_VEHICLE                                    :{WHITE}An'tcay efitray aintray...
-STR_CONFIG_PATCHES_SERVINT_ISPERCENT                            :{LTBLUE}Ervicesay intervalsway areway inway ercentspay: {ORANGE}{STRING}
-STR_CONFIG_GAME_PRODUCTION                                      :{WHITE}Angechay oductionpray
-
-TEMP_AI_IN_PROGRESS                                             :{WHITE}Elcomeway otay ethay ewnay AIWAY underway evelopmentday. Ifway ouyay encounterway oblemspray, aketay away eenshotscray andway ostpay itway inway ethay orumfay.
-TEMP_AI_ACTIVATED                                               :{WHITE}Arningway: isthay ewnay AIWAY isway illstay alphaway! Urrentlycay, onlyway uckstray andway ussesbay orkway!
-TEMP_AI_MULTIPLAYER                                             :{WHITE}Arningway: implementationway isway illstay experimentalway (usingway ewnay AIWAY). Easeplay eportray anyway oblemspray otay uelighttray@openttdway.orgway.
-
-############ network gui strings
-
-STR_NETWORK_MULTIPLAYER                                         :{WHITE}Ultiplayermay
-
-STR_NETWORK_PLAYER_NAME                                         :{BLACK}Ayerplay amenay:
-STR_NETWORK_ENTER_NAME_TIP                                      :{BLACK}Isthay isway ethay amenay otherway ayersplay illway identifyway ouyay ybay
-STR_NETWORK_CONNECTION                                          :{BLACK}Onnectioncay:
-STR_NETWORK_CONNECTION_TIP                                      :{BLACK}Oosechay etweenbay anway internetway amegay orway away Ocallay Areaway Etworknay (LANay) amegay
-
-STR_NETWORK_START_SERVER                                        :{BLACK}Artstay erversay
-STR_NETWORK_START_SERVER_TIP                                    :{BLACK}Artstay ouryay ownway erversay
-
-STR_NETWORK_GAME_NAME                                           :{BLACK}Amenay
-STR_NETWORK_GAME_NAME_TIP                                       :{BLACK}Amenay ofway ethay amegay
-STR_NETWORK_INFO_ICONS_TIP                                      :{BLACK}Anguagelay, erversay ersionvay, etcway.
-STR_NETWORK_CLICK_GAME_TO_SELECT                                :{BLACK}Ickclay away amegay omfray ethay istlay otay electsay itway
-
-STR_NETWORK_FIND_SERVER                                         :{BLACK}Indfay erversay
-STR_NETWORK_FIND_SERVER_TIP                                     :{BLACK}Earchsay etworknay orfay away erversay
-STR_NETWORK_ADD_SERVER                                          :{BLACK}Addway erversay
-STR_NETWORK_ADD_SERVER_TIP                                      :{BLACK}Addsway away erversay otay ethay istlay ichwhay illway alwaysway ebay eckedchay orfay unningray amesgay.
-STR_NETWORK_ENTER_IP                                            :{BLACK}Enterway ethay addressway ofway ethay osthay
-
-STR_NETWORK_GENERAL_ONLINE                                      :{BLACK}{COMMA}/{COMMA} - {COMMA}/{COMMA}
-STR_NETWORK_CLIENTS_CAPTION                                     :{BLACK}Ientsclay
-STR_NETWORK_CLIENTS_CAPTION_TIP                                 :{BLACK}Ientsclay onlineway / ientsclay axmay{}Ompaniescay onlineway / ompaniescay axmay
-STR_NETWORK_GAME_INFO                                           :{SILVER}EGAMay INFOWAY
-STR_ORANGE                                                      :{ORANGE}{STRING}
-STR_NETWORK_CLIENTS                                             :{SILVER}Ientsclay:  {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA}
-STR_NETWORK_LANGUAGE                                            :{SILVER}Anguagelay:  {WHITE}{STRING}
-STR_NETWORK_TILESET                                             :{SILVER}Ilesettay:  {WHITE}{STRING}
-STR_NETWORK_MAP_SIZE                                            :{SILVER}Apmay izesay:  {WHITE}{COMMA}xay{COMMA}
-STR_NETWORK_SERVER_VERSION                                      :{SILVER}Erversay ersionvay:  {WHITE}{STRING}
-STR_NETWORK_SERVER_ADDRESS                                      :{SILVER}Erversay addressway:  {WHITE}{STRING} : {NUM}
-STR_NETWORK_START_DATE                                          :{SILVER}Artstay ateday:  {WHITE}{DATE_SHORT}
-STR_NETWORK_CURRENT_DATE                                        :{SILVER}Urrentcay ateday:  {WHITE}{DATE_SHORT}
-STR_NETWORK_PASSWORD                                            :{SILVER}Asswordpay otectedpray!
-STR_NETWORK_SERVER_OFFLINE                                      :{SILVER}ERVERSay OFFLINEWAY
-STR_NETWORK_SERVER_FULL                                         :{SILVER}ERVERSay ULLFay
-STR_NETWORK_VERSION_MISMATCH                                    :{SILVER}ERSIONVay ISMATCHMay
-STR_NETWORK_GRF_MISMATCH                                        :{SILVER}EWGRFNay ISMATCHMay
-
-STR_NETWORK_JOIN_GAME                                           :{BLACK}Oinjay amegay
-
-
-STR_NETWORK_START_GAME_WINDOW                                   :{WHITE}Artstay ewnay ultiplayermay amegay
-
-STR_NETWORK_NEW_GAME_NAME                                       :{BLACK}Amegay amenay:
-STR_NETWORK_NEW_GAME_NAME_TIP                                   :{BLACK}Ethay amegay amenay illway ebay isplayedday otay otherway ayersplay inway ethay ultiplayermay amegay electionsay enumay
-STR_NETWORK_SET_PASSWORD                                        :{BLACK}Etsay asswordpay
-STR_NETWORK_PASSWORD_TIP                                        :{BLACK}Otectpray ouryay amegay ithway away asswordpay ifway ouyay on'tday antway itway otay ebay ubliclypay accessibleway
-STR_NETWORK_SELECT_MAP                                          :{BLACK}Electsay away apmay:
-STR_NETWORK_SELECT_MAP_TIP                                      :{BLACK}Ichwhay apmay oday ouyay antway otay ayplay?
-STR_NETWORK_LAN_INTERNET_COMBO                                  :{BLACK}{SKIP}{STRING}
-STR_NETWORK_LAN                                                 :LANay
-STR_NETWORK_INTERNET                                            :Internetway
-STR_NETWORK_LAN_INTERNET                                        :LANay / Internetway
-STR_NETWORK_INTERNET_ADVERTISE                                  :Internetway (advertiseway)
-STR_NETWORK_CLIENTS_SELECT                                      :{BLACK}{SKIP}{SKIP}{NUM} ient{P "" s}clay
-STR_NETWORK_NUMBER_OF_CLIENTS                                   :{BLACK}Axmay ientsclay:
-STR_NETWORK_NUMBER_OF_CLIENTS_TIP                               :{BLACK}Oosechay ethay aximummay umbernay ofway ientsclay. Otnay allway otsslay eednay otay ebay illedfay
-STR_NETWORK_COMPANIES_SELECT                                    :{BLACK}{SKIP}{SKIP}{SKIP}{NUM} ompan{P y ies}cay
-STR_NETWORK_NUMBER_OF_COMPANIES                                 :{BLACK}Axmay ompaniescay:
-STR_NETWORK_NUMBER_OF_COMPANIES_TIP                             :{BLACK}Imitlay ethay erversay otay away ertaincay amountway ofway ompaniescay
-STR_NETWORK_SPECTATORS_SELECT                                   :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{NUM} ectator{P "" s}spay
-STR_NETWORK_NUMBER_OF_SPECTATORS                                :{BLACK}Axmay ectatorsspay:
-STR_NETWORK_NUMBER_OF_SPECTATORS_TIP                            :{BLACK}Imitlay ethay erversay otay away ertaincay amountway ofway ectatorsspay
-STR_NETWORK_LANGUAGE_SPOKEN                                     :{BLACK}Anguagelay okenspay:
-STR_NETWORK_LANGUAGE_TIP                                        :{BLACK}Otherway ayersplay illway owknay ichwhay anguagelay isway okenspay onway ethay erversay
-STR_NETWORK_LANGUAGE_COMBO                                      :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
-STR_NETWORK_START_GAME                                          :{BLACK}Artstay Amegay
-STR_NETWORK_START_GAME_TIP                                      :{BLACK}Artstay away ewnay etworknay amegay omfray away andomray apmay, orway enarioscay
-STR_NETWORK_LOAD_GAME                                           :{BLACK}Oadlay Amegay
-STR_NETWORK_LOAD_GAME_TIP                                       :{BLACK}Esumeray anway earlierway avedsay ultiplayermay amegay (ebay uresay otay onnectcay asway ethay orrectcay ayerplay)
-
-############ Leave those lines in this order!!
-STR_NETWORK_LANG_ANY                                            :Anyway
-STR_NETWORK_LANG_ENGLISH                                        :Englishway
-STR_NETWORK_LANG_GERMAN                                         :Ermangay
-STR_NETWORK_LANG_FRENCH                                         :Enchfray
-STR_NETWORK_LANG_BRAZILIAN                                      :Azilianbray
-STR_NETWORK_LANG_BULGARIAN                                      :Ulgarianbay
-STR_NETWORK_LANG_CHINESE                                        :Inesechay
-STR_NETWORK_LANG_CZECH                                          :Echczay
-STR_NETWORK_LANG_DANISH                                         :Anishday
-STR_NETWORK_LANG_DUTCH                                          :Utchday
-STR_NETWORK_LANG_ESPERANTO                                      :Esperantoway
-STR_NETWORK_LANG_FINNISH                                        :Innishfay
-STR_NETWORK_LANG_HUNGARIAN                                      :Ungarianhay
-STR_NETWORK_LANG_ICELANDIC                                      :Icelandicway
-STR_NETWORK_LANG_ITALIAN                                        :Italianway
-STR_NETWORK_LANG_JAPANESE                                       :Apanesejay
-STR_NETWORK_LANG_KOREAN                                         :Oreankay
-STR_NETWORK_LANG_LITHUANIAN                                     :Ithuanianlay
-STR_NETWORK_LANG_NORWEGIAN                                      :Orwegiannay
-STR_NETWORK_LANG_POLISH                                         :Olishpay
-STR_NETWORK_LANG_PORTUGUESE                                     :Ortuguesepay
-STR_NETWORK_LANG_ROMANIAN                                       :Omanianray
-STR_NETWORK_LANG_RUSSIAN                                        :Ussianray
-STR_NETWORK_LANG_SLOVAK                                         :Ovakslay
-STR_NETWORK_LANG_SLOVENIAN                                      :Ovenianslay
-STR_NETWORK_LANG_SPANISH                                        :Anishspay
-STR_NETWORK_LANG_SWEDISH                                        :Edishsway
-STR_NETWORK_LANG_TURKISH                                        :Urkishtay
-STR_NETWORK_LANG_UKRAINIAN                                      :Ukrainianway
-############ End of leave-in-this-order
-
-STR_NETWORK_GAME_LOBBY                                          :{WHITE}Ultiplayermay amegay obbylay
-
-STR_NETWORK_PREPARE_TO_JOIN                                     :{BLACK}Eparingpray otay oinjay:   {ORANGE}{STRING}
-STR_NETWORK_COMPANY_LIST_TIP                                    :{BLACK}Away istlay ofway allway ompaniescay urrentlycay inway isthay amegay. Ouyay ancay eitherway oinjay oneway orway artstay away ewnay oneway ifway erethay isway away eefray ompanycay otslay
-STR_NETWORK_NEW_COMPANY                                         :{BLACK}Ewnay ompanycay
-STR_NETWORK_NEW_COMPANY_TIP                                     :{BLACK}Eatecray away ewnay ompanycay
-STR_NETWORK_SPECTATE_GAME                                       :{BLACK}Ectatespay amegay
-STR_NETWORK_SPECTATE_GAME_TIP                                   :{BLACK}Atchway ethay amegay asway away ectatorspay
-STR_NETWORK_JOIN_COMPANY                                        :{BLACK}Oinjay ompanycay
-STR_NETWORK_JOIN_COMPANY_TIP                                    :{BLACK}Elphay anagemay isthay ompanycay
-STR_NETWORK_REFRESH                                             :{BLACK}Efreshray erversay
-STR_NETWORK_REFRESH_TIP                                         :{BLACK}Efreshray ethay erversay infoway
-
-STR_NETWORK_COMPANY_INFO                                        :{SILVER}OMPANYCay INFOWAY
-
-STR_NETWORK_COMPANY_NAME                                        :{SILVER}Ompanycay amenay:  {WHITE}{STRING}
-STR_NETWORK_INAUGURATION_YEAR                                   :{SILVER}Inaugurationway:  {WHITE}{NUM}
-STR_NETWORK_VALUE                                               :{SILVER}Ompanycay aluevay:  {WHITE}{CURRENCY}
-STR_NETWORK_CURRENT_BALANCE                                     :{SILVER}Urrentcay alancebay:  {WHITE}{CURRENCY}
-STR_NETWORK_LAST_YEARS_INCOME                                   :{SILVER}Astlay ear'syay incomeway:  {WHITE}{CURRENCY}
-STR_NETWORK_PERFORMANCE                                         :{SILVER}Erformancepay:  {WHITE}{NUM}
-
-STR_NETWORK_VEHICLES                                            :{SILVER}Ehiclesvay:  {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP}
-STR_NETWORK_STATIONS                                            :{SILVER}Ationsstay:  {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP}
-STR_NETWORK_PLAYERS                                             :{SILVER}Ayersplay:  {WHITE}{STRING}
-
-STR_NETWORK_CONNECTING                                          :{WHITE}Onnectingcay...
-
-############ Leave those lines in this order!!
-STR_NETWORK_CONNECTING_1                                        :{BLACK}(1/6) Onnectingcay..
-STR_NETWORK_CONNECTING_2                                        :{BLACK}(2/6) Authorisingway..
-STR_NETWORK_CONNECTING_3                                        :{BLACK}(3/6) Aitingway..
-STR_NETWORK_CONNECTING_4                                        :{BLACK}(4/6) Ownloadingday apmay..
-STR_NETWORK_CONNECTING_5                                        :{BLACK}(5/6) Ocessingpray ataday..
-STR_NETWORK_CONNECTING_6                                        :{BLACK}(6/6) Egisteringray..
-
-STR_NETWORK_CONNECTING_SPECIAL_1                                :{BLACK}Etchingfay amegay infoway..
-STR_NETWORK_CONNECTING_SPECIAL_2                                :{BLACK}Etchingfay ompanycay infoway..
-############ End of leave-in-this-order
-STR_NETWORK_CONNECTING_WAITING                                  :{BLACK}{NUM} ient{P "" s}clay inway ontfray ofway ouyay
-STR_NETWORK_CONNECTING_DOWNLOADING                              :{BLACK}{NUM} / {NUM} yteskbay ownloadedday osay arfay
-
-STR_NETWORK_DISCONNECT                                          :{BLACK}Isconnectday
-
-STR_NETWORK_GIVE_MONEY_CAPTION                                  :{WHITE}Enterway ethay amountway ofway oneymay ouyay antway otay ivegay
-STR_NETWORK_NEED_GAME_PASSWORD_CAPTION                          :{WHITE}Erversay isway otectedpray. Enterway asswordpay
-STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION                       :{WHITE}Ompanycay isway otectedpray. Enterway asswordpay
-STR_NETWORK_CLIENT_LIST                                         :{WHITE}Ientclay Istlay
-
-STR_NETWORK_ERR_NOTAVAILABLE                                    :{WHITE} Onay etworknay evicesday oundfay orway ompiledcay ithoutway ENABLEWAY_ETWORKNay
-STR_NETWORK_ERR_NOSERVER                                        :{WHITE} Ouldcay otnay indfay anyway etworknay amesgay
-STR_NETWORK_ERR_NOCONNECTION                                    :{WHITE} Ethay erversay idn'tday answerway ethay equestray
-STR_NETWORK_ERR_NEWGRF_MISMATCH                                 :{WHITE} Ouldcay otnay onnectcay ueday otay EwGRFnay ismatchmay
-STR_NETWORK_ERR_DESYNC                                          :{WHITE} Etworknay-Amegay ynchronisationsay ailedfay
-STR_NETWORK_ERR_LOSTCONNECTION                                  :{WHITE} Etworknay-Amegay onnectioncay ostlay
-STR_NETWORK_ERR_SAVEGAMEERROR                                   :{WHITE} Ouldcay otnay oadlay avegamesay
-STR_NETWORK_ERR_SERVER_START                                    :{WHITE} Ouldcay otnay artstay ethay erversay
-STR_NETWORK_ERR_CLIENT_START                                    :{WHITE} Ouldcay otnay onnectcay
-STR_NETWORK_ERR_TIMEOUT                                         :{WHITE} Onnectioncay #{NUM} imedtay outway
-STR_NETWORK_ERR_SERVER_ERROR                                    :{WHITE} Away otocolpray-errorway asway ademay andway ethay onnectioncay asway osedclay
-STR_NETWORK_ERR_WRONG_REVISION                                  :{WHITE} Ethay evisionray ofway isthay ientclay oesday otnay atchmay ethay erver'ssay evisionray
-STR_NETWORK_ERR_WRONG_PASSWORD                                  :{WHITE} Ongwray asswordpay
-STR_NETWORK_ERR_SERVER_FULL                                     :{WHITE} Ethay erversay isway ullfay
-STR_NETWORK_ERR_SERVER_BANNED                                   :{WHITE} Ouyay areway annedbay omfray isthay erversay
-STR_NETWORK_ERR_KICKED                                          :{WHITE} Ouyay ereway ickedkay outway ofway ethay amegay
-STR_NETWORK_ERR_CHEATER                                         :{WHITE} Eatingchay isway otnay allowedway onway isthay erversay
-
-STR_NETWORK_ERR_LEFT                                            :ashay eftlay ethay amegay
-############ Leave those lines in this order!!
-STR_NETWORK_ERR_CLIENT_GENERAL                                  :eneralgay errorway
-STR_NETWORK_ERR_CLIENT_DESYNC                                   :esyncday errorway
-STR_NETWORK_ERR_CLIENT_SAVEGAME                                 :ouldcay otnay oadlay apmay
-STR_NETWORK_ERR_CLIENT_CONNECTION_LOST                          :onnectioncay ostlay
-STR_NETWORK_ERR_CLIENT_PROTOCOL_ERROR                           :otocolpray errorway
-STR_NETWORK_ERR_CLIENT_NEWGRF_MISMATCH                          :EwGRFnay ismatchmay
-STR_NETWORK_ERR_CLIENT_NOT_AUTHORIZED                           :otnay authorizedway
-STR_NETWORK_ERR_CLIENT_NOT_EXPECTED                             :eceivedray angestray acketpay
-STR_NETWORK_ERR_CLIENT_WRONG_REVISION                           :ongwray evisionray
-STR_NETWORK_ERR_CLIENT_NAME_IN_USE                              :amenay alreadyway inway useway
-STR_NETWORK_ERR_CLIENT_WRONG_PASSWORD                           :ongwray asswordpay
-STR_NETWORK_ERR_CLIENT_PLAYER_MISMATCH                          :ongwray ayerplay-idway inway OCommandday
-STR_NETWORK_ERR_CLIENT_KICKED                                   :ickedkay ybay erversay
-STR_NETWORK_ERR_CLIENT_CHEATER                                  :asway yingtray otay useway away eatchay
-STR_NETWORK_ERR_CLIENT_SERVER_FULL                              :erversay ullfay
-############ End of leave-in-this-order
-STR_NETWORK_CLIENT_JOINED                                       :ashay oinedjay ethay amegay
-STR_NETWORK_GIVE_MONEY                                          :avegay ouryay ompanycay omesay oneymay ({CURRENCY})
-STR_NETWORK_GAVE_MONEY_AWAY                                     :ouyay avegay {STRING} omesay oneymay ({CURRENCY})
-STR_NETWORK_CHAT_COMPANY_CAPTION                                :[Eamtay] :
-STR_NETWORK_CHAT_COMPANY                                        :[Eamtay] {STRING}: {GRAY}{STRING}
-STR_NETWORK_CHAT_TO_COMPANY                                     :[Eamtay] Otay {STRING}: {GRAY}{STRING}
-STR_NETWORK_CHAT_CLIENT_CAPTION                                 :[Ivatepray] :
-STR_NETWORK_CHAT_CLIENT                                         :[Ivatepray] {STRING}: {GRAY}{STRING}
-STR_NETWORK_CHAT_TO_CLIENT                                      :[Ivatepray] Otay {STRING}: {GRAY}{STRING}
-STR_NETWORK_CHAT_ALL_CAPTION                                    :[Allway] :
-STR_NETWORK_CHAT_ALL                                            :[Allway] {STRING}: {GRAY}{STRING}
-STR_NETWORK_NAME_CHANGE                                         :ashay angedchay ishay/erhay amenay otay
-STR_NETWORK_SERVER_SHUTDOWN                                     :{WHITE} Ethay erversay osedclay ethay essionsay
-STR_NETWORK_SERVER_REBOOT                                       :{WHITE} Ethay erversay isway estartingray...{}Easeplay aitway...
-
-STR_NETWORK_SERVER                                              :Erversay
-STR_NETWORK_CLIENT                                              :Ientclay
-STR_NETWORK_SPECTATORS                                          :Ectatorsspay
-
-STR_NETWORK_CLIENTLIST_NONE                                     :(onenay)
-STR_NETWORK_CLIENTLIST_KICK                                     :Ickkay
-STR_NETWORK_CLIENTLIST_GIVE_MONEY                               :Ivegay oneymay
-STR_NETWORK_CLIENTLIST_SPEAK_TO_ALL                             :Eakspay otay allway
-STR_NETWORK_CLIENTLIST_SPEAK_TO_COMPANY                         :Eakspay otay ompanycay
-STR_NETWORK_CLIENTLIST_SPEAK_TO_CLIENT                          :Ivatepray essagemay
-
-
-STR_NETWORK_SEND                                                :{BLACK}Endsay
-
-############ end network gui strings
-
-
-STR_CONFIG_PATCHES_MAP_X                                        :{LTBLUE}Xay-izesay ofway apmay: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_MAP_Y                                        :{LTBLUE}Yay-izesay ofway apmay: {ORANGE}{STRING}
-
-
-##### PNG-MAP-Loader
-
-STR_PNGMAP_ERROR                                                :{WHITE}Annotcay oadlay andscapelay omfray PNGay...
-STR_PNGMAP_ERR_FILE_NOT_FOUND                                   :{WHITE}...ilefay otnay oundfay.
-STR_PNGMAP_ERR_IMAGE_TYPE                                       :{WHITE}...ouldcay otnay onvertcay imageway ypetay. 8 orway 24-itbay PNGay imageway eedednay.
-STR_PNGMAP_ERR_MISC                                             :{WHITE}...omethingsay ustjay entway ongwray. Orrysay. (obablypray orruptedcay ilefay)
-
-STR_BMPMAP_ERROR                                                :{WHITE}Annotcay oadlay andscapelay omfray BMPay...
-STR_BMPMAP_ERR_IMAGE_TYPE                                       :{WHITE}...ouldcay otnay onvertcay imageway ypetay.
-
-##id 0x0800
-STR_0800_COST                                                   :{TINYFONT}{RED}Ostcay: {CURRENCY}
-STR_0801_COST                                                   :{RED}Ostcay: {CURRENCY}
-STR_0802_INCOME                                                 :{TINYFONT}{GREEN}Incomeway: {CURRENCY}
-STR_0803_INCOME                                                 :{GREEN}Incomeway: {CURRENCY}
-STR_FEEDER_TINY                                                 :{TINYFONT}{YELLOW}Ansfertray: {CURRENCY}
-STR_FEEDER                                                      :{YELLOW}Ansfertray: {CURRENCY}
-STR_0805_ESTIMATED_COST                                         :{WHITE}Estimatedway Ostcay: {CURRENCY}
-STR_0807_ESTIMATED_INCOME                                       :{WHITE}Estimatedway Incomeway: {CURRENCY}
-STR_0808_CAN_T_RAISE_LAND_HERE                                  :{WHITE}An'tcay aiseray andlay erehay...
-STR_0809_CAN_T_LOWER_LAND_HERE                                  :{WHITE}An'tcay owerlay andlay erehay...
-STR_080A_ROCKS                                                  :Ocksray
-STR_080B_ROUGH_LAND                                             :Oughray andlay
-STR_080C_BARE_LAND                                              :Arebay andlay
-STR_080D_GRASS                                                  :Assgray
-STR_080E_FIELDS                                                 :Ieldsfay
-STR_080F_SNOW_COVERED_LAND                                      :Owsnay-overedcay andlay
-STR_0810_DESERT                                                 :Esertday
-
-##id 0x1000
-STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION                         :{WHITE}Andlay opedslay inway ongwray irectionday
-STR_1001_IMPOSSIBLE_TRACK_COMBINATION                           :{WHITE}Impossibleway acktray ombinationcay
-STR_1002_EXCAVATION_WOULD_DAMAGE                                :{WHITE}Excavationway ouldway amageday unneltay
-STR_1003_ALREADY_AT_SEA_LEVEL                                   :{WHITE}Alreadyway atway easay-evellay
-STR_1004_TOO_HIGH                                               :{WHITE}Ootay ighhay
-STR_1005_NO_SUITABLE_RAILROAD_TRACK                             :{WHITE}Onay uitablesay ailwayray acktray
-STR_1007_ALREADY_BUILT                                          :{WHITE}...alreadyway uiltbay
-STR_1008_MUST_REMOVE_RAILROAD_TRACK                             :{WHITE}Ustmay emoveray ailwayray acktray irstfay
-STR_100A_RAILROAD_CONSTRUCTION                                  :{WHITE}Ailwayray Onstructioncay
-STR_TITLE_ELRAIL_CONSTRUCTION                                   :{WHITE}Electrifiedway Ailwayray Onstructioncay
-STR_100B_MONORAIL_CONSTRUCTION                                  :{WHITE}Onorailmay Onstructioncay
-STR_100C_MAGLEV_CONSTRUCTION                                    :{WHITE}AgLevmay Onstructioncay
-STR_100D_SELECT_RAIL_BRIDGE                                     :{WHITE}Electsay Ailray Idgebray
-STR_100E_CAN_T_BUILD_TRAIN_DEPOT                                :{WHITE}An'tcay uildbay aintray epotday erehay...
-STR_100F_CAN_T_BUILD_RAILROAD_STATION                           :{WHITE}An'tcay uildbay ailwayray ationstay erehay...
-STR_1010_CAN_T_BUILD_SIGNALS_HERE                               :{WHITE}An'tcay uildbay ignalssay erehay...
-STR_1011_CAN_T_BUILD_RAILROAD_TRACK                             :{WHITE}An'tcay uildbay ailwayray acktray erehay...
-STR_1012_CAN_T_REMOVE_RAILROAD_TRACK                            :{WHITE}An'tcay emoveray ailwayray acktray omfray erehay...
-STR_1013_CAN_T_REMOVE_SIGNALS_FROM                              :{WHITE}An'tcay emoveray ignalssay omfray erehay...
-STR_1014_TRAIN_DEPOT_ORIENTATION                                :{WHITE}Aintray Epotday Orientationway
-STR_1015_RAILROAD_CONSTRUCTION                                  :Ailwayray onstructioncay
-STR_TOOLB_ELRAIL_CONSTRUCTION                                   :Electrifiedway Ailwayray onstructioncay
-STR_1016_MONORAIL_CONSTRUCTION                                  :Onorailmay onstructioncay
-STR_1017_MAGLEV_CONSTRUCTION                                    :AgLevmay onstructioncay
-STR_1018_BUILD_RAILROAD_TRACK                                   :{BLACK}Uildbay ailwayray acktray
-STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING                         :{BLACK}Uildbay aintray epotday (orfay uildingbay andway ervicingsay ainstray)
-STR_101A_BUILD_RAILROAD_STATION                                 :{BLACK}Uildbay ailwayray ationstay
-STR_101B_BUILD_RAILROAD_SIGNALS                                 :{BLACK}Uildbay ailwayray ignalssay
-STR_101C_BUILD_RAILROAD_BRIDGE                                  :{BLACK}Uildbay ailwayray idgebray
-STR_101D_BUILD_RAILROAD_TUNNEL                                  :{BLACK}Uildbay ailwayray unneltay
-STR_101E_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Oggletay uildbay/emoveray orfay ailwayray acktray andway ignalssay
-STR_101F_BRIDGE_SELECTION_CLICK                                 :{BLACK}Idgebray electionsay - ickclay onway ouryay eferedpray idgebray otay uildbay itway
-STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO                       :{BLACK}Electsay ailwayray epotday orientationway
-STR_1021_RAILROAD_TRACK                                         :Ailwayray acktray
-STR_1023_RAILROAD_TRAIN_DEPOT                                   :Ailwayray aintray epotday
-STR_1024_AREA_IS_OWNED_BY_ANOTHER                               :{WHITE}...areaway isway ownedway ybay anotherway ompanycay
-STR_RAILROAD_TRACK_WITH_NORMAL_SIGNALS                          :Ailwayray acktray ithway ormalnay ignalssay
-STR_RAILROAD_TRACK_WITH_PRESIGNALS                              :Ailwayray acktray ithway epray-ignalssay
-STR_RAILROAD_TRACK_WITH_EXITSIGNALS                             :Ailwayray acktray ithway exitway-ignalssay
-STR_RAILROAD_TRACK_WITH_COMBOSIGNALS                            :Ailwayray acktray ithway ombocay-ignalssay
-STR_RAILROAD_TRACK_WITH_NORMAL_PRESIGNALS                       :Ailwayray acktray ithway ormalnay andway epray-ignalssay
-STR_RAILROAD_TRACK_WITH_NORMAL_EXITSIGNALS                      :Ailwayray acktray ithway ormalnay andway exitway-ignalssay
-STR_RAILROAD_TRACK_WITH_NORMAL_COMBOSIGNALS                     :Ailwayray acktray ithway ormalnay andway ombocay-ignalssay
-STR_RAILROAD_TRACK_WITH_PRE_EXITSIGNALS                         :Ailwayray acktray ithway epray- andway exitway-ignalssay
-STR_RAILROAD_TRACK_WITH_PRE_COMBOSIGNALS                        :Ailwayray acktray ithway epray- andway ombocay-ignalssay
-STR_RAILROAD_TRACK_WITH_EXIT_COMBOSIGNALS                       :Ailwayray acktray ithway exitway- andway ombocay-ignalssay
-STR_MUST_REMOVE_RAILWAY_STATION_FIRST                           :{WHITE}Ustmay emoveray ailwayray ationstay irstfay
-
-
-
-##id 0x1800
-STR_1801_MUST_REMOVE_ROAD_FIRST                                 :{WHITE}Ustmay emoveray oadray irstfay
-STR_ROAD_WORKS_IN_PROGRESS                                      :{WHITE}Oadray orksway inway ogresspray
-STR_1802_ROAD_CONSTRUCTION                                      :{WHITE}Oadray Onstructioncay
-STR_1802_TRAMWAY_CONSTRUCTION                                   :{WHITE}Amwaytray Onstructioncay
-STR_1803_SELECT_ROAD_BRIDGE                                     :{WHITE}Electsay Oadray Idgebray
-STR_ERR_ONEWAY_ROADS_CAN_T_HAVE_JUNCTION                        :{WHITE}... oneway ayway oadsray an'tcay avehay unctionsjay
-STR_1804_CAN_T_BUILD_ROAD_HERE                                  :{WHITE}An'tcay uildbay oadray erehay...
-STR_1804_CAN_T_BUILD_TRAMWAY_HERE                               :{WHITE}An'tcay uildbay amwaytray erehay...
-STR_1805_CAN_T_REMOVE_ROAD_FROM                                 :{WHITE}An'tcay emoveray oadray omfray erehay...
-STR_1805_CAN_T_REMOVE_TRAMWAY_FROM                              :{WHITE}An'tcay emoveray amwaytray omfray erehay...
-STR_1806_ROAD_DEPOT_ORIENTATION                                 :{WHITE}Oadray Epotday Orientationway
-STR_1806_TRAM_DEPOT_ORIENTATION                                 :{WHITE}Amtray Epotday Orientationway
-STR_1807_CAN_T_BUILD_ROAD_VEHICLE                               :{WHITE}An'tcay uildbay oadray ehiclevay epotday erehay...
-STR_1807_CAN_T_BUILD_TRAM_VEHICLE                               :{WHITE}An'tcay uildbay amtray ehiclevay epotday erehay...
-STR_1808_CAN_T_BUILD_BUS_STATION                                :{WHITE}An'tcay uildbay usbay ationstay...
-STR_1809_CAN_T_BUILD_TRUCK_STATION                              :{WHITE}An'tcay uildbay orrylay ationstay...
-STR_1808_CAN_T_BUILD_PASSENGER_TRAM_STATION                     :{WHITE}An'tcay uildbay assengerpay amtray ationstay...
-STR_1809_CAN_T_BUILD_CARGO_TRAM_STATION                         :{WHITE}An'tcay uildbay eightfray amtray ationstay...
-STR_180A_ROAD_CONSTRUCTION                                      :Oadray onstructioncay
-STR_180A_TRAMWAY_CONSTRUCTION                                   :Amwaytray onstructioncay
-STR_180B_BUILD_ROAD_SECTION                                     :{BLACK}Uildbay oadray ectionsay
-STR_180B_BUILD_TRAMWAY_SECTION                                  :{BLACK}Uildbay amwaytray ectionsay
-STR_180C_BUILD_ROAD_VEHICLE_DEPOT                               :{BLACK}Uildbay oadray ehiclevay epotday (orfay uildingbay andway ervicingsay ehiclesvay)
-STR_180C_BUILD_TRAM_VEHICLE_DEPOT                               :{BLACK}Uildbay amtray ehiclevay epotday (orfay uildingbay andway ervicingsay ehiclesvay)
-STR_180D_BUILD_BUS_STATION                                      :{BLACK}Uildbay usbay ationstay
-STR_180E_BUILD_TRUCK_LOADING_BAY                                :{BLACK}Uildbay orrylay oadinglay aybay
-STR_180D_BUILD_PASSENGER_TRAM_STATION                           :{BLACK}Uildbay assengerpay amtray ationstay
-STR_180E_BUILD_CARGO_TRAM_STATION                               :{BLACK}Uildbay eightfray amtray ationstay
-STR_180F_BUILD_ROAD_BRIDGE                                      :{BLACK}Uildbay oadray idgebray
-STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}Uildbay amwaytray idgebray
-STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}Uildbay oadray unneltay
-STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}Uildbay amwaytray unneltay
-STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Oggletay uildbay/emoveray orfay oadray onstructioncay
-STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}Oggletay uildbay/emoveray orfay amwaytray onstructioncay
-STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}Electsay oadray ehiclevay epotday orientationway
-STR_1813_SELECT_TRAM_VEHICLE_DEPOT                              :{BLACK}Electsay amtray ehiclevay epotday orientationway
-STR_1814_ROAD                                                   :Oadray
-STR_1815_ROAD_WITH_STREETLIGHTS                                 :Oadray ithway eetlightsstray
-STR_1816_TREE_LINED_ROAD                                        :Eetray-inedlay oadray
-STR_1817_ROAD_VEHICLE_DEPOT                                     :Oadray ehiclevay epotday
-STR_1818_ROAD_RAIL_LEVEL_CROSSING                               :Oadray/ailray evellay ossingcray
-STR_CAN_T_REMOVE_BUS_STATION                                    :{WHITE}An'tcay emoveray usbay ationstay...
-STR_CAN_T_REMOVE_TRUCK_STATION                                  :{WHITE}An'tcay emoveray orrylay ationstay...
-STR_CAN_T_REMOVE_PASSENGER_TRAM_STATION                         :{WHITE}An'tcay emoveray assengerpay amtray ationstay...
-STR_CAN_T_REMOVE_CARGO_TRAM_STATION                             :{WHITE}An'tcay emoveray eightfray amtray ationstay...
-
-##id 0x2000
-STR_2000_TOWNS                                                  :{WHITE}Ownstay
-STR_TOWN_LABEL_POP                                              :{WHITE}{TOWN} ({COMMA})
-STR_TOWN_LABEL                                                  :{WHITE}{TOWN}
-STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
-STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
-STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
-STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Uildingbay ustmay ebay emolishedday irstfay
-STR_2005                                                        :{WHITE}{TOWN}
-STR_2006_POPULATION                                             :{BLACK}Opulationpay: {ORANGE}{COMMA}{BLACK}  Ouseshay: {ORANGE}{COMMA}
-STR_2007_RENAME_TOWN                                            :Enameray Owntay
-STR_2008_CAN_T_RENAME_TOWN                                      :{WHITE}An'tcay enameray owntay...
-STR_2009_LOCAL_AUTHORITY_REFUSES                                :{WHITE}{TOWN} ocallay authorityway efusesray otay allowway isthay
-STR_200A_TOWN_NAMES_CLICK_ON_NAME                               :{BLACK}Owntay amesnay - ickclay onway amenay otay entrecay iewvay onway owntay
-STR_200B_CENTER_THE_MAIN_VIEW_ON                                :{BLACK}Entrecay ethay ainmay iewvay onway owntay ocationlay
-STR_200C_CHANGE_TOWN_NAME                                       :{BLACK}Angechay owntay amenay
-STR_200D_PASSENGERS_LAST_MONTH_MAX                              :{BLACK}Assengerspay astlay onthmay: {ORANGE}{COMMA}{BLACK}  axmay: {ORANGE}{COMMA}
-STR_200E_MAIL_LAST_MONTH_MAX                                    :{BLACK}Ailmay astlay onthmay: {ORANGE}{COMMA}{BLACK}  axmay: {ORANGE}{COMMA}
-STR_200F_TALL_OFFICE_BLOCK                                      :Alltay officeway ockblay
-STR_2010_OFFICE_BLOCK                                           :Officeway ockblay
-STR_2011_SMALL_BLOCK_OF_FLATS                                   :Allsmay ockblay ofway atsflay
-STR_2012_CHURCH                                                 :Urchchay
-STR_2013_LARGE_OFFICE_BLOCK                                     :Argelay officeway ockblay
-STR_2014_TOWN_HOUSES                                            :Owntay ouseshay
-STR_2015_HOTEL                                                  :Otelhay
-STR_2016_STATUE                                                 :Atuestay
-STR_2017_FOUNTAIN                                               :Ountainfay
-STR_2018_PARK                                                   :Arkpay
-STR_2019_OFFICE_BLOCK                                           :Officeway ockblay
-STR_201A_SHOPS_AND_OFFICES                                      :Opsshay andway officesway
-STR_201B_MODERN_OFFICE_BUILDING                                 :Odernmay officeway uildingbay
-STR_201C_WAREHOUSE                                              :Arehouseway
-STR_201D_OFFICE_BLOCK                                           :Officeway ockblay
-STR_201E_STADIUM                                                :Adiumstay
-STR_201F_OLD_HOUSES                                             :Oldway ouseshay
-STR_2020_LOCAL_AUTHORITY                                        :{BLACK}Ocallay authorityway
-STR_2021_SHOW_INFORMATION_ON_LOCAL                              :{BLACK}Owshay informationway onway ocallay authorityway
-STR_2022_LOCAL_AUTHORITY                                        :{WHITE}{TOWN} ocallay authorityway
-STR_2023_TRANSPORT_COMPANY_RATINGS                              :{BLACK}Ansporttray ompanycay atingsray:
-STR_2024                                                        :{YELLOW}{COMPANY} {COMPANYNUM}: {ORANGE}{STRING}
-STR_2025_SUBSIDIES                                              :{WHITE}Ubsidiessay
-STR_2026_SUBSIDIES_ON_OFFER_FOR                                 :{BLACK}Ubsidiessay onway offerway orfay ervicessay akingtay:
-STR_2027_FROM_TO                                                :{ORANGE}{STRING} omfray {STRING} otay {STRING}
-STR_2028_BY                                                     :{YELLOW} (ybay {DATE_SHORT})
-STR_202A_NONE                                                   :{ORANGE}Onenay
-STR_202B_SERVICES_ALREADY_SUBSIDISED                            :{BLACK}Ervicessay alreadyway ubsidisedsay:
-STR_202C_FROM_TO                                                :{ORANGE}{STRING} omfray {STATION} otay {STATION}{YELLOW} ({COMPANY}
-STR_202D_UNTIL                                                  :{YELLOW}, untilway {DATE_SHORT})
-STR_202E_OFFER_OF_SUBSIDY_EXPIRED                               :{BLACK}{BIGFONT}Offerway ofway ubsidysay expiredway:{}{}{STRING} omfray {STRING} otay {STRING} illway ownay otnay attractway away ubsidysay.
-STR_202F_SUBSIDY_WITHDRAWN_SERVICE                              :{BLACK}{BIGFONT}Ubsidysay ithdrawnway:{}{}{STRING} ervicesay omfray {STATION} otay {STATION} isway onay ongerlay ubsidisedsay.
-STR_2030_SERVICE_SUBSIDY_OFFERED                                :{BLACK}{BIGFONT}Ervicesay ubsidysay offeredway:{}{}Irstfay {STRING} ervicesay omfray {STRING} otay {STRING} illway attractway away ear'syay ubsidysay omfray ethay ocallay authorityway!
-STR_2031_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Ervicesay ubsidysay awardedway otay {COMPANY}!{}{}{STRING} ervicesay omfray {STATION} otay {STATION} illway aypay 50% extraway orfay ethay extnay earyay!
-STR_2032_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Ervicesay ubsidysay awardedway otay {COMPANY}!{}{}{STRING} ervicesay omfray {STATION} otay {STATION} illway aypay oubleday atesray orfay ethay extnay earyay!
-STR_2033_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Ervicesay ubsidysay awardedway otay {COMPANY}!{}{}{STRING} ervicesay omfray {STATION} otay {STATION} illway aypay ipletray atesray orfay ethay extnay earyay!
-STR_2034_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Ervicesay ubsidysay awardedway otay {COMPANY}!{}{}{STRING} ervicesay omfray {STATION} otay {STATION} illway aypay adruplequay atesray orfay ethay extnay earyay!
-STR_2035_LOCAL_AUTHORITY_REFUSES                                :{WHITE}{TOWN} ocallay authorityway efusesray otay allowway anotherway airportway otay ebay uiltbay inway isthay owntay
-STR_2036_COTTAGES                                               :Ottagescay
-STR_2037_HOUSES                                                 :Ouseshay
-STR_2038_FLATS                                                  :Atsflay
-STR_2039_TALL_OFFICE_BLOCK                                      :Alltay officeway ockblay
-STR_203A_SHOPS_AND_OFFICES                                      :Opsshay andway officesway
-STR_203B_SHOPS_AND_OFFICES                                      :Opsshay andway officesway
-STR_203C_THEATER                                                :Eatrethay
-STR_203D_STADIUM                                                :Adiumstay
-STR_203E_OFFICES                                                :Officesway
-STR_203F_HOUSES                                                 :Ouseshay
-STR_2040_CINEMA                                                 :Inemacay
-STR_2041_SHOPPING_MALL                                          :Oppingshay allmay
-STR_2042_DO_IT                                                  :{BLACK}Oday itway
-STR_2043_LIST_OF_THINGS_TO_DO_AT                                :{BLACK}Istlay ofway ingsthay otay oday atway isthay owntay - ickclay onway itemway orfay oremay etailsday
-STR_2044_CARRY_OUT_THE_HIGHLIGHTED                              :{BLACK}Arrycay outway ethay ighlightedhay actionway inway ethay istlay aboveway
-STR_2045_ACTIONS_AVAILABLE                                      :{BLACK}Actionsway availableway:
-STR_2046_SMALL_ADVERTISING_CAMPAIGN                             :Allsmay advertisingway ampaigncay
-STR_2047_MEDIUM_ADVERTISING_CAMPAIGN                            :Ediummay advertisingway ampaigncay
-STR_2048_LARGE_ADVERTISING_CAMPAIGN                             :Argelay advertisingway ampaigncay
-STR_2049_FUND_LOCAL_ROAD_RECONSTRUCTION                         :Undfay ocallay oadray econstructionray
-STR_204A_BUILD_STATUE_OF_COMPANY                                :Uildbay atuestay ofway ompanycay ownerway
-STR_204B_FUND_NEW_BUILDINGS                                     :Undfay ewnay uildingsbay
-STR_204C_BUY_EXCLUSIVE_TRANSPORT                                :Uybay exclusiveway ansporttray ightsray
-STR_TOWN_BRIBE_THE_LOCAL_AUTHORITY                              :Ibebray ethay ocallay authorityway
-STR_204D_INITIATE_A_SMALL_LOCAL                                 :{WHITE}{STRING}{}{YELLOW} Initiateway away allsmay ocallay advertisingway ampaigncay, otay attractway oremay assengerspay andway argocay otay ouryay ansporttray ervicessay.{}  Ostcay: {CURRENCY}
-STR_204E_INITIATE_A_MEDIUM_LOCAL                                :{WHITE}{STRING}{}{YELLOW} Initiateway away ediummay ocallay advertisingway ampaigncay, otay attractway oremay assengerspay andway argocay otay ouryay ansporttray ervicessay.{}  Ostcay: {CURRENCY}
-STR_204F_INITIATE_A_LARGE_LOCAL                                 :{WHITE}{STRING}{}{YELLOW} Initiateway away argelay ocallay advertisingway ampaigncay, otay attractway oremay assengerspay andway argocay otay ouryay ansporttray ervicessay.{}  Ostcay: {CURRENCY}
-STR_2050_FUND_THE_RECONSTRUCTION                                :{WHITE}{STRING}{}{YELLOW} Undfay ethay econstructionray ofway ethay urbanway oadray etworknay. Ausescay onsiderablecay isruptionday otay oadray affictray orfay upway otay 6 onthsmay.{}  Ostcay: {CURRENCY}
-STR_2051_BUILD_A_STATUE_IN_HONOR                                :{WHITE}{STRING}{}{YELLOW} Uildbay away atuestay inway onourhay ofway ouryay ompanycay.{} Ostcay: {CURRENCY}
-STR_2052_FUND_THE_CONSTRUCTION_OF                               :{WHITE}{STRING}{}{YELLOW} Undfay ethay onstructioncay ofway ewnay ommercialcay uildingsbay inway ethay owntay.{}  Ostcay: {CURRENCY}
-STR_2053_BUY_1_YEAR_S_EXCLUSIVE                                 :{WHITE}{STRING}{}{YELLOW} Uybay 1 ear'syay exclusiveway ansporttray ightsray inway owntay. Owntay authorityway illway onlyway allowway assengerspay andway argocay otay useway ouryay ompany'scay ationsstay.{} Ostcay: {CURRENCY}
-STR_TOWN_BRIBE_THE_LOCAL_AUTHORITY_DESC                         :{WHITE}{STRING}{}{YELLOW} Ibebray ethay ocallay authorityway otay increaseway ouryay atingray, atway ethay iskray ofway away everesay enaltypay ifway aughtcay.{}  Ostcay: {CURRENCY}
-STR_2055_TRAFFIC_CHAOS_IN_ROAD_REBUILDING                       :{BIGFONT}{BLACK}Affictray aoschay inway {TOWN}!{}{}Oadray ebuildingray ogrammepray undedfay ybay {COMPANY} ingsbray 6 onthsmay ofway iserymay otay otoristsmay!
-STR_2056                                                        :{TINYFONT}{WHITE}{TOWN}
-STR_2057                                                        :{ORANGE}{TOWN}{BLACK} ({COMMA})
-STR_2058_UNDER_CONSTRUCTION                                     :{STRING} (underway onstructioncay)
-STR_2059_IGLOO                                                  :Iglooway
-STR_205A_TEPEES                                                 :Epeestay
-STR_205B_TEAPOT_HOUSE                                           :Eapottay-Ousehay
-STR_205C_PIGGY_BANK                                             :Iggypay-Ankbay
-
-STR_INDUSTRY                                                    :{INDUSTRY}
-STR_TOWN                                                        :{TOWN}
-STR_INDUSTRY_FORMAT                                             :{TOWN} {STRING}
-STR_STATION                                                     :{STATION}
-
-##id 0x2800
-STR_LANDSCAPING                                                 :Andscapinglay
-STR_2800_PLANT_TREES                                            :Antplay eestray
-STR_2801_PLACE_SIGN                                             :Aceplay ignsay
-STR_2802_TREES                                                  :{WHITE}Eestray
-STR_2803_TREE_ALREADY_HERE                                      :{WHITE}...eetray alreadyway erehay
-STR_2804_SITE_UNSUITABLE                                        :{WHITE}...itesay unsuitableway
-STR_2805_CAN_T_PLANT_TREE_HERE                                  :{WHITE}An'tcay antplay eetray erehay...
-STR_2806                                                        :{WHITE}{SIGN}
-STR_2808_TOO_MANY_SIGNS                                         :{WHITE}...ootay anymay ignssay
-STR_2809_CAN_T_PLACE_SIGN_HERE                                  :{WHITE}An'tcay aceplay ignsay erehay...
-STR_280A_SIGN                                                   :Ignsay
-STR_280B_EDIT_SIGN_TEXT                                         :{WHITE}Editway ignsay exttay
-STR_280C_CAN_T_CHANGE_SIGN_NAME                                 :{WHITE}An'tcay angechay ignsay amenay...
-STR_280D_SELECT_TREE_TYPE_TO_PLANT                              :{BLACK}Electsay eetray ypetay otay antplay
-STR_280E_TREES                                                  :Eestray
-STR_280F_RAINFOREST                                             :Ainforestray
-STR_2810_CACTUS_PLANTS                                          :Actuscay Antsplay
-
-##id 0x3000
-STR_3000_RAIL_STATION_SELECTION                                 :{WHITE}Ailray Ationstay Electionsay
-STR_3001_AIRPORT_SELECTION                                      :{WHITE}Airportway Electionsay
-STR_3002_ORIENTATION                                            :{BLACK}Orientationway
-STR_3003_NUMBER_OF_TRACKS                                       :{BLACK}Umbernay ofway ackstray
-STR_3004_PLATFORM_LENGTH                                        :{BLACK}Atformplay engthlay
-STR_3005_TOO_CLOSE_TO_ANOTHER_RAILROAD                          :{WHITE}Ootay oseclay otay anotherway ailwayray ationstay
-STR_3006_ADJOINS_MORE_THAN_ONE_EXISTING                         :{WHITE}Adjoinsway oremay anthay oneway existingway ationstay/oadinglay areaway
-STR_3007_TOO_MANY_STATIONS_LOADING                              :{WHITE}Ootay anymay ationsstay/oadinglay areasway inway isthay owntay
-STR_3008_TOO_MANY_STATIONS_LOADING                              :{WHITE}Ootay anymay ationsstay/oadinglay areasway
-STR_3008A_TOO_MANY_BUS_STOPS                                    :{WHITE}Ootay anymay usbay opsstay
-STR_3008B_TOO_MANY_TRUCK_STOPS                                  :{WHITE}Ootay anymay orrylay ationsstay
-STR_3009_TOO_CLOSE_TO_ANOTHER_STATION                           :{WHITE}Ootay oseclay otay anotherway ationstay/oadinglay areaway
-STR_300A_0                                                      :{WHITE}{STATION} {STATIONFEATURES}
-STR_300B_MUST_DEMOLISH_RAILROAD                                 :{WHITE}Ustmay emolishday ailwayray ationstay irstfay
-STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT                           :{WHITE}Ootay oseclay otay anotherway airportway
-STR_300E_MUST_DEMOLISH_AIRPORT_FIRST                            :{WHITE}Ustmay emolishday airportway irstfay
-
-STR_3030_RENAME_STATION_LOADING                                 :Enameray ationstay/oadinglay areaway
-STR_3031_CAN_T_RENAME_STATION                                   :{WHITE}An'tcay enameray ationstay...
-STR_3032_RATINGS                                                :{BLACK}Atingsray
-STR_3033_ACCEPTS                                                :{BLACK}Acceptsway
-STR_3034_LOCAL_RATING_OF_TRANSPORT                              :{BLACK}Ocallay atingray ofway ansporttray ervicesay:
-
-############ range for rating starts
-STR_3035_APPALLING                                              :Appallingway
-STR_3036_VERY_POOR                                              :Eryvay Oorpay
-STR_3037_POOR                                                   :Oorpay
-STR_3038_MEDIOCRE                                               :Ediocremay
-STR_3039_GOOD                                                   :Oodgay
-STR_303A_VERY_GOOD                                              :Eryvay Oodgay
-STR_303B_EXCELLENT                                              :Excellentway
-STR_303C_OUTSTANDING                                            :Outstandingway
-############ range for rating ends
-
-STR_303D                                                        :{WHITE}{STRING}: {YELLOW}{STRING} ({COMMA}%)
-STR_303E_NO_LONGER_ACCEPTS                                      :{WHITE}{STATION} onay ongerlay acceptsway {STRING}
-STR_303F_NO_LONGER_ACCEPTS_OR                                   :{WHITE}{STATION} onay ongerlay acceptsway {STRING} orway {STRING}
-STR_3040_NOW_ACCEPTS                                            :{WHITE}{STATION} ownay acceptsway {STRING}
-STR_3041_NOW_ACCEPTS_AND                                        :{WHITE}{STATION} ownay acceptsway {STRING} andway {STRING}
-STR_3042_BUS_STATION_ORIENTATION                                :{WHITE}Usbay Ationstay Orientationway
-STR_3043_TRUCK_STATION_ORIENT                                   :{WHITE}Orrylay Ationstay Orientationway
-STR_3042_PASSENGER_TRAM_STATION_ORIENTATION                     :{WHITE}Assengerpay Amtray Orientationway
-STR_3043_CARGO_TRAM_STATION_ORIENT                              :{WHITE}Eightfray Amtray Orientationway
-STR_3046_MUST_DEMOLISH_BUS_STATION                              :{WHITE}Ustmay emolishday usbay ationstay irstfay
-STR_3047_MUST_DEMOLISH_TRUCK_STATION                            :{WHITE}Ustmay emolishday orrylay ationstay irstfay
-STR_3046_MUST_DEMOLISH_PASSENGER_TRAM_STATION                   :{WHITE}Ustmay emolishday assengerpay amtray ationstay irstfay
-STR_3047_MUST_DEMOLISH_CARGO_TRAM_STATION                       :{WHITE}Ustmay emolishday eightfray amtray ationstay irstfay
-STR_3048_STATIONS                                               :{WHITE}{COMPANY} - {COMMA} Ation{P "" s}stay
-STR_3049_0                                                      :{YELLOW}{STATION} {STATIONFEATURES}
-STR_304A_NONE                                                   :{YELLOW}- Onenay -
-STR_304B_SITE_UNSUITABLE                                        :{WHITE}...itesay unsuitableway
-STR_304C_TOO_CLOSE_TO_ANOTHER_DOCK                              :{WHITE}Ootay oseclay otay anotherway ockday
-STR_304D_MUST_DEMOLISH_DOCK_FIRST                               :{WHITE}Ustmay emolishday ockday irstfay
-STR_304E_SELECT_RAILROAD_STATION                                :{BLACK}Electsay ailwayray ationstay orientationway
-STR_304F_SELECT_NUMBER_OF_PLATFORMS                             :{BLACK}Electsay umbernay ofway atformsplay orfay ailwayray ationstay
-STR_3050_SELECT_LENGTH_OF_RAILROAD                              :{BLACK}Electsay engthlay ofway ailwayray ationstay
-STR_3051_SELECT_BUS_STATION_ORIENTATION                         :{BLACK}Electsay usbay ationstay orientationway
-STR_3052_SELECT_TRUCK_LOADING_BAY                               :{BLACK}Electsay orrylay oadinglay aybay orientationway
-STR_3051_SELECT_PASSENGER_TRAM_STATION_ORIENTATION              :{BLACK}Electsay assengerpay amtray ationstay orientationway
-STR_3052_SELECT_CARGO_TRAM_STATION_ORIENTATION                  :{BLACK}Electsay eightfray amtray ationstay orientationway
-STR_3053_CENTER_MAIN_VIEW_ON_STATION                            :{BLACK}Entrecay ainmay iewvay onway ationstay ocationlay
-STR_3054_SHOW_STATION_RATINGS                                   :{BLACK}Owshay ationstay atingsray
-STR_3055_CHANGE_NAME_OF_STATION                                 :{BLACK}Angechay amenay ofway ationstay
-STR_3056_SHOW_LIST_OF_ACCEPTED_CARGO                            :{BLACK}Owshay istlay ofway acceptedway argocay
-STR_3057_STATION_NAMES_CLICK_ON                                 :{BLACK}Ationstay amesnay - ickclay onway amenay otay entrecay ainmay iewvay onway ationstay
-STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT                            :{BLACK}Electsay izesay/ypetay ofway airportway
-STR_305C_0                                                      :{STATION} {STATIONFEATURES}
-STR_STATION_SIGN_TINY                                           :{TINYFONT}{STATION}
-STR_305E_RAILROAD_STATION                                       :Ailwayray ationstay
-STR_305F_AIRCRAFT_HANGAR                                        :Aircraftway angarhay
-STR_3060_AIRPORT                                                :Airportway
-STR_3061_TRUCK_LOADING_AREA                                     :Orrylay oadinglay areaway
-STR_3062_BUS_STATION                                            :Usbay ationstay
-STR_3063_SHIP_DOCK                                              :Ipshay ockday
-STR_3064_HIGHLIGHT_COVERAGE_AREA                                :{BLACK}Ighlighthay overagecay areaway ofway oposedpray itesay
-STR_3065_DON_T_HIGHLIGHT_COVERAGE                               :{BLACK}On'tday ighlighthay overagecay areaway ofway oposedpray itesay
-STR_3066_COVERAGE_AREA_HIGHLIGHT                                :{BLACK}Overagecay areaway ighlighthay
-STR_3068_DOCK                                                   :{WHITE}Ockday
-STR_3069_BUOY                                                   :Uoybay
-STR_306A_BUOY_IN_THE_WAY                                        :{WHITE}...uoybay inway ethay ayway
-STR_306C_STATION_TOO_SPREAD_OUT                                 :{WHITE}...ationstay ootay eadspray outway
-STR_306D_NONUNIFORM_STATIONS_DISALLOWED                         :{WHITE}...onuniformnay ationsstay isabledday
-STR_USE_CTRL_TO_SELECT_MORE                                     :{BLACK}Oldhay ownday CTRLay otay electsay oremay anthay oneway itemway
-
-STR_UNDEFINED                                                   :(undefinedway ingstray)
-STR_STAT_CLASS_DFLT                                             :Efaultday ationstay
-STR_STAT_CLASS_WAYP                                             :Aypointsway
-
-##id 0x3800
-STR_3800_SHIP_DEPOT_ORIENTATION                                 :{WHITE}Ipshay Epotday Orientationway
-STR_3801_MUST_BE_BUILT_ON_WATER                                 :{WHITE}...ustmay ebay uiltbay onway aterway
-STR_3802_CAN_T_BUILD_SHIP_DEPOT                                 :{WHITE}An'tcay uildbay ipshay epotday erehay...
-STR_3803_SELECT_SHIP_DEPOT_ORIENTATION                          :{BLACK}Electsay ipshay epotday orientationway
-STR_3804_WATER                                                  :Aterway
-STR_3805_COAST_OR_RIVERBANK                                     :Oastcay orway iverbankray
-STR_3806_SHIP_DEPOT                                             :Ipshay epotday
-STR_3807_CAN_T_BUILD_ON_WATER                                   :{WHITE}...An'tcay uildbay onway aterway
-STR_MUST_DEMOLISH_CANAL_FIRST                                   :{WHITE}Ustmay emolishday analcay irstfay
-
-##id 0x4000
-STR_4000_SAVE_GAME                                              :{WHITE}Avesay Amegay
-STR_4001_LOAD_GAME                                              :{WHITE}Oadlay Amegay
-STR_4002_SAVE                                                   :{BLACK}Avesay
-STR_4003_DELETE                                                 :{BLACK}Eleteday
-STR_4004                                                        :{COMPANY}, {DATE_LONG}
-STR_4005_BYTES_FREE                                             :{BLACK}{COMMA} egabyte{P "" s}may eefray
-STR_4006_UNABLE_TO_READ_DRIVE                                   :{BLACK}Unableway otay eadray ivedray
-STR_4007_GAME_SAVE_FAILED                                       :{WHITE}Amegay Avesay Ailedfay{}{STRING}
-STR_4008_UNABLE_TO_DELETE_FILE                                  :{WHITE}Unableway otay eleteday ilefay
-STR_4009_GAME_LOAD_FAILED                                       :{WHITE}Amegay Oadlay Ailedfay{}{STRING}
-STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR                   :Internalway errorway: {STRING}
-STR_GAME_SAVELOAD_ERROR_BROKEN_SAVEGAME                         :Okenbray avegamesay - {STRING}
-STR_GAME_SAVELOAD_ERROR_TOO_NEW_SAVEGAME                        :Avegamesay isway ademay ithway ewernay ersionvay
-STR_GAME_SAVELOAD_ERROR_FILE_NOT_READABLE                       :Ilefay otnay eadableray
-STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE                      :Ilefay otnay iteablewray
-STR_400A_LIST_OF_DRIVES_DIRECTORIES                             :{BLACK}Istlay ofway ivesdray, irectoriesday andway avedsay-amegay ilesfay
-STR_400B_CURRENTLY_SELECTED_NAME                                :{BLACK}Urrentlycay electedsay amenay orfay avedsay-amegay
-STR_400C_DELETE_THE_CURRENTLY_SELECTED                          :{BLACK}Eleteday ethay urrentlycay electedsay avedsay-amegay
-STR_400D_SAVE_THE_CURRENT_GAME_USING                            :{BLACK}Avesay ethay urrentcay amegay, usingway ethay electedsay amenay
-STR_400E_SELECT_NEW_GAME_TYPE                                   :{WHITE}Electsay Ewnay Amegay Ypetay
-STR_400F_SELECT_SCENARIO_GREEN_PRE                              :{BLACK}Electsay enarioscay (eengray), epray-etsay amegay (ueblay), orway andomray ewnay amegay
-STR_4010_GENERATE_RANDOM_NEW_GAME                               :Enerategay andomray ewnay amegay
-STR_4011_LOAD_HEIGHTMAP                                         :{WHITE}Oadlay Eightmaphay
-
-##id 0x4800
-STR_4800_IN_THE_WAY                                             :{WHITE}{STRING} inway ethay ayway
-STR_4801                                                        :{WHITE}{INDUSTRY}
-STR_4802_COAL_MINE                                              :Oalcay Inemay
-STR_4803_POWER_STATION                                          :Owerpay Ationstay
-STR_4804_SAWMILL                                                :Awmillsay
-STR_4805_FOREST                                                 :Orestfay
-STR_4806_OIL_REFINERY                                           :Oilway Efineryray
-STR_4807_OIL_RIG                                                :Oilway Igray
-STR_4808_FACTORY                                                :Actoryfay
-STR_4809_PRINTING_WORKS                                         :Intingpray Orksway
-STR_480A_STEEL_MILL                                             :Eelstay Illmay
-STR_480B_FARM                                                   :Armfay
-STR_480C_COPPER_ORE_MINE                                        :Oppercay Oreway Inemay
-STR_480D_OIL_WELLS                                              :Oilway Ellsway
-STR_480E_BANK                                                   :Ankbay
-STR_480F_FOOD_PROCESSING_PLANT                                  :Oodfay Ocessingpray Antplay
-STR_4810_PAPER_MILL                                             :Aperpay Illmay
-STR_4811_GOLD_MINE                                              :Oldgay Inemay
-STR_4812_BANK                                                   :Ankbay
-STR_4813_DIAMOND_MINE                                           :Iamondday Inemay
-STR_4814_IRON_ORE_MINE                                          :Ironway Oreway Inemay
-STR_4815_FRUIT_PLANTATION                                       :Uitfray Antationplay
-STR_4816_RUBBER_PLANTATION                                      :Ubberray Antationplay
-STR_4817_WATER_SUPPLY                                           :Aterway Upplysay
-STR_4818_WATER_TOWER                                            :Aterway Owertay
-STR_4819_FACTORY                                                :Actoryfay
-STR_481A_FARM                                                   :Armfay
-STR_481B_LUMBER_MILL                                            :Umberlay Illmay
-STR_481C_COTTON_CANDY_FOREST                                    :Andyflosscay Orestfay
-STR_481D_CANDY_FACTORY                                          :Eetsway Actoryfay
-STR_481E_BATTERY_FARM                                           :Atterybay Armfay
-STR_481F_COLA_WELLS                                             :Olacay Ellsway
-STR_4820_TOY_SHOP                                               :Oytay Opshay
-STR_4821_TOY_FACTORY                                            :Oytay Actoryfay
-STR_4822_PLASTIC_FOUNTAINS                                      :Asticplay Ountainsfay
-STR_4823_FIZZY_DRINK_FACTORY                                    :Izzyfay Inkdray Actoryfay
-STR_4824_BUBBLE_GENERATOR                                       :Ubblebay Eneratorgay
-STR_4825_TOFFEE_QUARRY                                          :Offeetay Arryquay
-STR_4826_SUGAR_MINE                                             :Ugarsay Inemay
-
-############ range for requires starts
-STR_4827_REQUIRES                                               :{BLACK}Equiresray: {YELLOW}{STRING}
-STR_4828_REQUIRES                                               :{BLACK}Equiresray: {YELLOW}{STRING}, {STRING}
-STR_4829_REQUIRES                                               :{BLACK}Equiresray: {YELLOW}{STRING}, {STRING}, {STRING}
-############ range for requires ends
-
-############ range for produces starts
-STR_INDUSTRY_WINDOW_WAITING_FOR_PROCESSING                      :{BLACK}Argocay aitingway otay ebay ocessedpray:
-STR_INDUSTRY_WINDOW_WAITING_STOCKPILE_CARGO                     :{YELLOW}{CARGO}{BLACK}
-STR_4827_PRODUCES                                               :{BLACK}Oducespray: {YELLOW}{STRING}
-STR_4828_PRODUCES                                               :{BLACK}Oducespray: {YELLOW}{STRING}, {STRING}
-############ range for produces ends
-
-STR_482A_PRODUCTION_LAST_MONTH                                  :{BLACK}Oductionpray astlay onthmay:
-STR_482B_TRANSPORTED                                            :{YELLOW}{CARGO}{BLACK} ({COMMA}% ansportedtray)
-STR_482C_CENTER_THE_MAIN_VIEW_ON                                :{BLACK}Entrecay ethay ainmay iewvay onway industryway ocationlay
-STR_482D_NEW_UNDER_CONSTRUCTION                                 :{BLACK}{BIGFONT}Ewnay {STRING} underway onstructioncay earnay {TOWN}!
-STR_482E_NEW_BEING_PLANTED_NEAR                                 :{BLACK}{BIGFONT}Ewnay {STRING} eingbay antedplay earnay {TOWN}!
-STR_482F_COST                                                   :{BLACK}Ostcay: {YELLOW}{CURRENCY}
-STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY                          :{WHITE}An'tcay onstructcay isthay industryway ypetay erehay...
-STR_4831_FOREST_CAN_ONLY_BE_PLANTED                             :{WHITE}...orestfay ancay onlyway ebay antedplay aboveway owsnay-inelay
-STR_4832_ANNOUNCES_IMMINENT_CLOSURE                             :{BLACK}{BIGFONT}{STRING} announcesway imminentway osureclay!
-STR_4833_SUPPLY_PROBLEMS_CAUSE_TO                               :{BLACK}{BIGFONT}Upplysay oblemspray ausecay {STRING} otay announceway imminentway osureclay!
-STR_4834_LACK_OF_NEARBY_TREES_CAUSES                            :{BLACK}{BIGFONT}Acklay ofway earbynay eestray ausescay {STRING} otay announceway imminentway osureclay!
-STR_4835_INCREASES_PRODUCTION                                   :{BLACK}{BIGFONT}{INDUSTRY} increasesway oductionpray!
-STR_4836_NEW_COAL_SEAM_FOUND_AT                                 :{BLACK}{BIGFONT}Ewnay oalcay eamsay oundfay atway {INDUSTRY}!{}Oductionpray isway expectedway otay oubleday!
-STR_4837_NEW_OIL_RESERVES_FOUND                                 :{BLACK}{BIGFONT}Ewnay oilway eservesray oundfay atway {INDUSTRY}!{}Oductionpray isway expectedway otay oubleday!
-STR_4838_IMPROVED_FARMING_METHODS                               :{BLACK}{BIGFONT}Improvedway armingfay ethodsmay atway {INDUSTRY} areway expectedway otay oubleday oductionpray!
-STR_4839_PRODUCTION_DOWN_BY_50                                  :{BLACK}{BIGFONT}{INDUSTRY} oductionpray ownday ybay 50%
-STR_483A_INSECT_INFESTATION_CAUSES                              :{BLACK}{BIGFONT}Insectway infestationway ausescay avochay atway {INDUSTRY}!{}Oductionpray ownday ybay 50%
-STR_483B_CAN_ONLY_BE_POSITIONED                                 :{WHITE}...ancay onlyway ebay ositionedpay earnay edgesway ofway apmay
-STR_INDUSTRY_PROD_GOUP                                          :{BLACK}{BIGFONT}{STRING} oductionpray atway {INDUSTRY} increasesway {COMMA}%!
-STR_INDUSTRY_PROD_GODOWN                                        :{BLACK}{BIGFONT}{STRING} oductionpray atway {INDUSTRY} ecreasesday {COMMA}%!
-
-##id 0x5000
-STR_5000_TRAIN_IN_TUNNEL                                        :{WHITE}Aintray inway unneltay
-STR_5001_ROAD_VEHICLE_IN_TUNNEL                                 :{WHITE}Oadray ehiclevay inway unneltay
-STR_5003_ANOTHER_TUNNEL_IN_THE_WAY                              :{WHITE}Anotherway unneltay inway ethay ayway
-STR_5005_UNABLE_TO_EXCAVATE_LAND                                :{WHITE}Unableway otay excavateway andlay orfay otherway endway ofway unneltay
-STR_5006_MUST_DEMOLISH_TUNNEL_FIRST                             :{WHITE}Ustmay emolishday unneltay irstfay
-STR_5007_MUST_DEMOLISH_BRIDGE_FIRST                             :{WHITE}Ustmay emolishday idgebray irstfay
-STR_5008_CANNOT_START_AND_END_ON                                :{WHITE}Annotcay artstay andway endway inway ethay amesay otspay
-STR_500A_START_AND_END_MUST_BE_IN                               :{WHITE}Artstay andway endway ustmay ebay inway inelay
-STR_500B_SITE_UNSUITABLE_FOR_TUNNEL                             :{WHITE}Itesay unsuitableway orfay unneltay entranceway
-STR_500D                                                        :{GOLD}{STRING},{} {VELOCITY} {WHITE}{CURRENCY}
-STR_500E_SUSPENSION_STEEL                                       :Uspensionsay, Eelstay
-STR_500F_GIRDER_STEEL                                           :Irdergay, Eelstay
-STR_5010_CANTILEVER_STEEL                                       :Antilevercay, Eelstay
-STR_5011_SUSPENSION_CONCRETE                                    :Uspensionsay, Oncretecay
-STR_5012_WOODEN                                                 :Oodenway
-STR_5013_CONCRETE                                               :Oncretecay
-STR_5014_TUBULAR_STEEL                                          :Ubulartay, Eelstay
-STR_BRIDGE_TUBULAR_SILICON                                      :Ubulartay, Iliconsay
-STR_5015_CAN_T_BUILD_BRIDGE_HERE                                :{WHITE}An'tcay uildbay idgebray erehay...
-STR_5016_CAN_T_BUILD_TUNNEL_HERE                                :{WHITE}An'tcay uildbay unneltay erehay...
-STR_5017_RAILROAD_TUNNEL                                        :Ailwayray unneltay
-STR_5018_ROAD_TUNNEL                                            :Oadray unneltay
-STR_501B_STEEL_SUSPENSION_RAIL_BRIDGE                           :Eelstay uspensionsay ailray idgebray
-STR_501C_STEEL_GIRDER_RAIL_BRIDGE                               :Eelstay irdergay ailray idgebray
-STR_501D_STEEL_CANTILEVER_RAIL_BRIDGE                           :Eelstay antilevercay ailray idgebray
-STR_501E_REINFORCED_CONCRETE_SUSPENSION                         :Einforcedray oncretecay uspensionsay ailray idgebray
-STR_501F_WOODEN_RAIL_BRIDGE                                     :Oodenway ailray idgebray
-STR_5020_CONCRETE_RAIL_BRIDGE                                   :Oncretecay ailray idgebray
-STR_5021_STEEL_SUSPENSION_ROAD_BRIDGE                           :Eelstay uspensionsay oadray idgebray
-STR_5022_STEEL_GIRDER_ROAD_BRIDGE                               :Eelstay irdergay oadray idgebray
-STR_5023_STEEL_CANTILEVER_ROAD_BRIDGE                           :Eelstay antilevercay oadray idgebray
-STR_5024_REINFORCED_CONCRETE_SUSPENSION                         :Einforcedray oncretecay uspensionsay oadray idgebray
-STR_5025_WOODEN_ROAD_BRIDGE                                     :Oodenway oadray idgebray
-STR_5026_CONCRETE_ROAD_BRIDGE                                   :Oncretecay oadray idgebray
-STR_5027_TUBULAR_RAIL_BRIDGE                                    :Ubulartay ailray idgebray
-STR_5028_TUBULAR_ROAD_BRIDGE                                    :Ubulartay oadray idgebray
-
-##id 0x5800
-STR_5800_OBJECT_IN_THE_WAY                                      :{WHITE}Objectway inway ethay ayway
-STR_5801_TRANSMITTER                                            :Ansmittertray
-STR_5802_LIGHTHOUSE                                             :Ighthouselay
-STR_5803_COMPANY_HEADQUARTERS                                   :Ompanycay Eadquartershay
-STR_5804_COMPANY_HEADQUARTERS_IN                                :{WHITE}...ompanycay eadquartershay inway ethay ayway
-STR_5805_COMPANY_OWNED_LAND                                     :Ompanycay-ownedway andlay
-STR_5806_CAN_T_PURCHASE_THIS_LAND                               :{WHITE}An'tcay urchasepay isthay andlay areaway...
-STR_5807_YOU_ALREADY_OWN_IT                                     :{WHITE}...ouyay alreadyway ownway itway!
-
-
-############ WARNING, using range 0x6000 for strings that are stored in the savegame
-############ These strings may never get a new id, or savegames will break!
-##id 0x6000
-STR_SV_EMPTY                                                    :
-STR_SV_UNNAMED                                                  :Unnamedway
-STR_SV_TRAIN_NAME                                               :Aintray {COMMA}
-STR_SV_ROADVEH_NAME                                             :Oadray Ehiclevay {COMMA}
-STR_SV_SHIP_NAME                                                :Ipshay {COMMA}
-STR_SV_AIRCRAFT_NAME                                            :Aircraftway {COMMA}
-
-STR_SV_STNAME                                                   :{STRING}
-STR_SV_STNAME_NORTH                                             :{STRING} Orthnay
-STR_SV_STNAME_SOUTH                                             :{STRING} Outhsay
-STR_SV_STNAME_EAST                                              :{STRING} Eastway
-STR_SV_STNAME_WEST                                              :{STRING} Estway
-STR_SV_STNAME_CENTRAL                                           :{STRING} Entralcay
-STR_SV_STNAME_TRANSFER                                          :{STRING} Ansfertray
-STR_SV_STNAME_HALT                                              :{STRING} Althay
-STR_SV_STNAME_VALLEY                                            :{STRING} Alleyvay
-STR_SV_STNAME_HEIGHTS                                           :{STRING} Eightshay
-STR_SV_STNAME_WOODS                                             :{STRING} Oodsway
-STR_SV_STNAME_LAKESIDE                                          :{STRING} Akesidelay
-STR_SV_STNAME_EXCHANGE                                          :{STRING} Exchangeway
-STR_SV_STNAME_AIRPORT                                           :{STRING} Airportway
-STR_SV_STNAME_OILFIELD                                          :{STRING} Oilfieldway
-STR_SV_STNAME_MINES                                             :{STRING} Inesmay
-STR_SV_STNAME_DOCKS                                             :{STRING} Ocksday
-STR_SV_STNAME_BUOY_1                                            :{STRING} Uoybay 1
-STR_SV_STNAME_BUOY_2                                            :{STRING} Uoybay 2
-STR_SV_STNAME_BUOY_3                                            :{STRING} Uoybay 3
-STR_SV_STNAME_BUOY_4                                            :{STRING} Uoybay 4
-STR_SV_STNAME_BUOY_5                                            :{STRING} Uoybay 5
-STR_SV_STNAME_BUOY_6                                            :{STRING} Uoybay 6
-STR_SV_STNAME_BUOY_7                                            :{STRING} Uoybay 7
-STR_SV_STNAME_BUOY_8                                            :{STRING} Uoybay 8
-STR_SV_STNAME_BUOY_9                                            :{STRING} Uoybay 9
-STR_SV_STNAME_ANNEXE                                            :{STRING} Annexeway
-STR_SV_STNAME_SIDINGS                                           :{STRING} Idingssay
-STR_SV_STNAME_BRANCH                                            :{STRING} Anchbray
-STR_SV_STNAME_UPPER                                             :Upperway {STRING}
-STR_SV_STNAME_LOWER                                             :Owerlay {STRING}
-STR_SV_STNAME_HELIPORT                                          :{STRING} Eliporthay
-STR_SV_STNAME_FOREST                                            :{STRING} Orestfay
-STR_SV_STNAME_FALLBACK                                          :{STRING} Ationstay #{NUM}
-
-############ end of savegame specific region!
-
-##id 0x6800
-STR_6800_DIFFICULTY_LEVEL                                       :{WHITE}Ifficultyday Evellay
-STR_OPTIONS_SAVE_CHANGES                                        :{BLACK}Avesay
-
-############ range for difficulty levels starts
-STR_6801_EASY                                                   :{BLACK}Easyway
-STR_6802_MEDIUM                                                 :{BLACK}Ediummay
-STR_6803_HARD                                                   :{BLACK}Ardhay
-STR_6804_CUSTOM                                                 :{BLACK}Ustomcay
-############ range for difficulty levels ends
-
-############ range for difficulty settings starts
-STR_6805_MAXIMUM_NO_COMPETITORS                                 :{LTBLUE}Aximummay onay. ompetitorscay: {ORANGE}{COMMA}
-STR_6806_COMPETITOR_START_TIME                                  :{LTBLUE}Ompetitorcay artstay imetay: {ORANGE}{STRING}
-STR_6807_NO_OF_TOWNS                                            :{LTBLUE}Onay. ofway ownstay: {ORANGE}{STRING}
-STR_6808_NO_OF_INDUSTRIES                                       :{LTBLUE}Onay. ofway industriesway: {ORANGE}{STRING}
-STR_6809_MAXIMUM_INITIAL_LOAN_000                               :{LTBLUE}Aximummay initialway oanlay: {ORANGE}{CURRENCY}
-STR_680A_INITIAL_INTEREST_RATE                                  :{LTBLUE}Initialway interestway ateray: {ORANGE}{COMMA}%
-STR_680B_VEHICLE_RUNNING_COSTS                                  :{LTBLUE}Ehiclevay unningray ostscay: {ORANGE}{STRING}
-STR_680C_CONSTRUCTION_SPEED_OF_COMPETITOR                       :{LTBLUE}Onstructioncay eedspay ofway ompetitorscay: {ORANGE}{STRING}
-STR_680D_INTELLIGENCE_OF_COMPETITORS                            :{LTBLUE}Intelligenceway ofway ompetitorscay: {ORANGE}{STRING}
-STR_680E_VEHICLE_BREAKDOWNS                                     :{LTBLUE}Ehiclevay eakdownsbray: {ORANGE}{STRING}
-STR_680F_SUBSIDY_MULTIPLIER                                     :{LTBLUE}Ubsidysay ultipliermay: {ORANGE}{STRING}
-STR_6810_COST_OF_CONSTRUCTION                                   :{LTBLUE}Ostcay ofway onstructioncay: {ORANGE}{STRING}
-STR_6811_TERRAIN_TYPE                                           :{LTBLUE}Erraintay ypetay: {ORANGE}{STRING}
-STR_6812_QUANTITY_OF_SEA_LAKES                                  :{LTBLUE}Antityquay ofway easay/akeslay: {ORANGE}{STRING}
-STR_6813_ECONOMY                                                :{LTBLUE}Economyway: {ORANGE}{STRING}
-STR_6814_TRAIN_REVERSING                                        :{LTBLUE}Aintray eversingray: {ORANGE}{STRING}
-STR_6815_DISASTERS                                              :{LTBLUE}Isastersday: {ORANGE}{STRING}
-STR_16816_CITY_APPROVAL                                         :{LTBLUE}Itycay ouncil'scay attitudeway owardstay areaway estructuringray: {ORANGE}{STRING}
-############ range for difficulty settings ends
-
-STR_26816_NONE                                                  :Onenay
-STR_NUM_VERY_LOW                                                :Eryvay owlay
-STR_6816_LOW                                                    :Owlay
-STR_6817_NORMAL                                                 :Ormalnay
-STR_6818_HIGH                                                   :Ighhay
-STR_6819                                                        :{BLACK}{SMALLLEFTARROW}
-STR_681A                                                        :{BLACK}{SMALLRIGHTARROW}
-STR_681B_VERY_SLOW                                              :Eryvay Owslay
-STR_681C_SLOW                                                   :Owslay
-STR_681D_MEDIUM                                                 :Ediummay
-STR_681E_FAST                                                   :Astfay
-STR_681F_VERY_FAST                                              :Eryvay Astfay
-STR_VERY_LOW                                                    :Eryvay Owlay
-STR_6820_LOW                                                    :Owlay
-STR_6821_MEDIUM                                                 :Ediummay
-STR_6822_HIGH                                                   :Ighhay
-STR_6823_NONE                                                   :Onenay
-STR_6824_REDUCED                                                :Educedray
-STR_6825_NORMAL                                                 :Ormalnay
-STR_6826_X1_5                                                   :xay1.5
-STR_6827_X2                                                     :xay2
-STR_6828_X3                                                     :xay3
-STR_6829_X4                                                     :xay4
-STR_682A_VERY_FLAT                                              :Eryvay Atflay
-STR_682B_FLAT                                                   :Atflay
-STR_682C_HILLY                                                  :Illyhay
-STR_682D_MOUNTAINOUS                                            :Ountainousmay
-STR_682E_STEADY                                                 :Eadystay
-STR_682F_FLUCTUATING                                            :Uctuatingflay
-STR_6830_IMMEDIATE                                              :Immediateway
-STR_6831_3_MONTHS_AFTER_PLAYER                                  :3 onthsmay afterway ayerplay
-STR_6832_6_MONTHS_AFTER_PLAYER                                  :6 onthsmay afterway ayerplay
-STR_6833_9_MONTHS_AFTER_PLAYER                                  :9 onthsmay afterway ayerplay
-STR_6834_AT_END_OF_LINE_AND_AT_STATIONS                         :Atway endway ofway inelay, andway atway ationsstay
-STR_6835_AT_END_OF_LINE_ONLY                                    :Atway endway ofway inelay onlyway
-STR_6836_OFF                                                    :Offway
-STR_6837_ON                                                     :Onway
-STR_6838_SHOW_HI_SCORE_CHART                                    :{BLACK}Owshay ihay-orescay artchay
-STR_6839_PERMISSIVE                                             :Ermissivepay
-STR_683A_TOLERANT                                               :Oleranttay
-STR_683B_HOSTILE                                                :Ostilehay
-
-##id 0x7000
-STR_7000                                                        :
-STR_7001                                                        :{WHITE}{COMPANY} {BLACK}{COMPANYNUM}
-STR_7002_PLAYER                                                 :(Ayerplay {COMMA})
-STR_7004_NEW_FACE                                               :{BLACK}Ewnay Acefay
-STR_7005_COLOR_SCHEME                                           :{BLACK}Olourcay Emeschay
-STR_7006_COLOR_SCHEME                                           :{GOLD}Olourcay Emeschay:
-STR_7007_NEW_COLOR_SCHEME                                       :{WHITE}Ewnay Olourcay Emeschay
-STR_7008_COMPANY_NAME                                           :{BLACK}Ompanycay Amenay
-STR_7009_PRESIDENT_NAME                                         :{BLACK}Anagermay Amenay
-STR_700A_COMPANY_NAME                                           :Ompanycay Amenay
-STR_700B_PRESIDENT_S_NAME                                       :Anager'smay Amenay
-STR_700C_CAN_T_CHANGE_COMPANY_NAME                              :{WHITE}An'tcay angechay ompanycay amenay...
-STR_700D_CAN_T_CHANGE_PRESIDENT                                 :{WHITE}An'tcay angechay anager'smay amenay...
-STR_700E_FINANCES                                               :{WHITE}{COMPANY} Inancesfay {BLACK}{COMPANYNUM}
-STR_700F_EXPENDITURE_INCOME                                     :{WHITE}Expenditureway/Incomeway
-STR_7010                                                        :{WHITE}{NUM}
-STR_7011_CONSTRUCTION                                           :{GOLD}Onstructioncay
-STR_7012_NEW_VEHICLES                                           :{GOLD}Ewnay Ehiclesvay
-STR_7013_TRAIN_RUNNING_COSTS                                    :{GOLD}Aintray Unningray Ostscay
-STR_7014_ROAD_VEH_RUNNING_COSTS                                 :{GOLD}Oadray Ehvay. Unningray Ostscay
-STR_7015_AIRCRAFT_RUNNING_COSTS                                 :{GOLD}Aircraftway Unningray Ostscay
-STR_7016_SHIP_RUNNING_COSTS                                     :{GOLD}Ipshay Unningray Ostscay
-STR_7017_PROPERTY_MAINTENANCE                                   :{GOLD}Opertypray Aintenancemay
-STR_7018_TRAIN_INCOME                                           :{GOLD}Aintray Incomeway
-STR_7019_ROAD_VEHICLES_INCOME                                   :{GOLD}Oadray Ehiclevay Incomeway
-STR_701A_AIRCRAFT_INCOME                                        :{GOLD}Aircraftway Incomeway
-STR_701B_SHIP_INCOME                                            :{GOLD}Ipshay Incomeway
-STR_701C_LOAN_INTEREST                                          :{GOLD}Oanlay Interestway
-STR_701D_OTHER                                                  :{GOLD}Otherway
-STR_701E                                                        :{BLACK}-{CURRENCY}
-STR_701F                                                        :{BLACK}+{CURRENCY}
-STR_7020_TOTAL                                                  :{WHITE}Otaltay:
-STR_7021                                                        :{COMPANY} {COMPANYNUM}
-STR_7022_INCOME_GRAPH                                           :{WHITE}Incomeway Aphgray
-STR_CURRCOMPACT                                                 :{CURRCOMPACT}
-STR_7024                                                        :{COMMA}
-STR_7025_OPERATING_PROFIT_GRAPH                                 :{WHITE}Operatingway Ofitpray Aphgray
-STR_7026_BANK_BALANCE                                           :{WHITE}Ankbay Alancebay
-STR_7027_LOAN                                                   :{WHITE}Oanlay
-STR_MAX_LOAN                                                    :{WHITE}Axmay Oanlay:  {BLACK}{CURRENCY}
-STR_7028                                                        :{BLACK}{CURRENCY}
-STR_7029_BORROW                                                 :{BLACK}Orrowbay {SKIP}{SKIP}{CURRENCY}
-STR_702A_REPAY                                                  :{BLACK}Epayray {SKIP}{SKIP}{CURRENCY}
-STR_702B_MAXIMUM_PERMITTED_LOAN                                 :{WHITE}...aximummay ermittedpay oanlay izesay isway {CURRENCY}
-STR_702C_CAN_T_BORROW_ANY_MORE_MONEY                            :{WHITE}An'tcay orrowbay anyway oremay oneymay...
-STR_702D_LOAN_ALREADY_REPAYED                                   :{WHITE}...onay oanlay otay epayray
-STR_702E_REQUIRED                                               :{WHITE}...{CURRENCY} equiredray
-STR_702F_CAN_T_REPAY_LOAN                                       :{WHITE}An'tcay epayray oanlay...
-STR_INSUFFICIENT_FUNDS                                          :{WHITE}An'tcay ivegay awayway oneymay atthay isway oanedlay omfray ethay ankbay...
-STR_7030_SELECT_NEW_FACE_FOR_PRESIDENT                          :{BLACK}Electsay ewnay acefay orfay anagermay
-STR_7031_CHANGE_THE_COMPANY_VEHICLE                             :{BLACK}Angechay ethay ompanycay ehiclevay iverylay
-STR_7032_CHANGE_THE_PRESIDENT_S                                 :{BLACK}Angechay ethay anager'smay amenay
-STR_7033_CHANGE_THE_COMPANY_NAME                                :{BLACK}Angechay ethay ompanycay amenay
-STR_7034_CLICK_ON_SELECTED_NEW_COLOR                            :{BLACK}Ickclay onway esiredday olourcay emeschay
-STR_7035_INCREASE_SIZE_OF_LOAN                                  :{BLACK}Increaseway izesay ofway oanlay
-STR_7036_REPAY_PART_OF_LOAN                                     :{BLACK}Epayray artpay ofway oanlay
-STR_7037_PRESIDENT                                              :{WHITE}{PLAYERNAME}{}{GOLD}(Anagermay)
-STR_7038_INAUGURATED                                            :{GOLD}Inauguratedway: {WHITE}{NUM}
-STR_7039_VEHICLES                                               :{GOLD}Ehiclesvay:
-STR_TRAINS                                                      :{WHITE}{COMMA} ain{P "" s}tray
-STR_ROAD_VEHICLES                                               :{WHITE}{COMMA} oadray ehicle{P "" s}vay
-STR_AIRCRAFT                                                    :{WHITE}{COMMA} aircraftway
-STR_SHIPS                                                       :{WHITE}{COMMA} ip{P "" s}shay
-STR_7042_NONE                                                   :{WHITE}Onenay
-STR_7043_FACE_SELECTION                                         :{WHITE}Acefay Electionsay
-STR_7044_MALE                                                   :{BLACK}Alemay
-STR_7045_FEMALE                                                 :{BLACK}Emalefay
-STR_7046_NEW_FACE                                               :{BLACK}Ewnay Acefay
-STR_7047_CANCEL_NEW_FACE_SELECTION                              :{BLACK}Ancelcay ewnay acefay electionsay
-STR_7048_ACCEPT_NEW_FACE_SELECTION                              :{BLACK}Acceptway ewnay acefay electionsay
-STR_7049_SELECT_MALE_FACES                                      :{BLACK}Electsay alemay acesfay
-STR_704A_SELECT_FEMALE_FACES                                    :{BLACK}Electsay emalefay acesfay
-STR_704B_GENERATE_RANDOM_NEW_FACE                               :{BLACK}Enerategay andomray ewnay acefay
-STR_704C_KEY                                                    :{BLACK}Eykay
-STR_704D_SHOW_KEY_TO_GRAPHS                                     :{BLACK}Owshay eykay otay aphsgray
-STR_704E_KEY_TO_COMPANY_GRAPHS                                  :{WHITE}Eykay otay ompanycay aphsgray
-STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY                           :{BLACK}Ickclay erehay otay oggletay ompany'scay entryway onway aphgray onway/offway
-STR_7050_UNITS_OF_CARGO_DELIVERED                               :{WHITE}Unitsway ofway argocay eliveredday
-STR_7051_COMPANY_PERFORMANCE_RATINGS                            :{WHITE}Ompanycay erformancepay atingsray (aximummay atingray=1000)
-STR_7052_COMPANY_VALUES                                         :{WHITE}Ompanycay aluesvay
-STR_7053_COMPANY_LEAGUE_TABLE                                   :{WHITE}Ompanycay Eaguelay Abletay
-STR_7054                                                        :{WHITE}{STRING}{SETX 45}{ORANGE}{COMPANY} {BLACK}{COMPANYNUM} '{STRING}'
-STR_7055                                                        :{YELLOW}{STRING}{SETX 45}{ORANGE}{COMPANY} {BLACK}{COMPANYNUM}  '{STRING}'
-STR_7056_TRANSPORT_COMPANY_IN_TROUBLE                           :{BLACK}{BIGFONT}Ansporttray ompanycay inway oubletray!
-STR_7057_WILL_BE_SOLD_OFF_OR_DECLARED                           :{BLACK}{BIGFONT}{COMPANY} illway ebay oldsay offway orway eclaredday ankruptbay unlessway erformancepay increasesway oonsay!
-STR_7058_PRESIDENT                                              :{BLACK}{PLAYERNAME}{}(Anagermay)
-STR_7059_TRANSPORT_COMPANY_MERGER                               :{BLACK}{BIGFONT}Ansporttray ompanycay ergermay!
-STR_705A_HAS_BEEN_SOLD_TO_FOR                                   :{BLACK}{BIGFONT}{COMPANY} ashay eenbay oldsay otay {COMPANY} orfay {CURRENCY}!
-STR_705B_WE_ARE_LOOKING_FOR_A_TRANSPORT                         :{WHITE}Eway areway ookinglay orfay away ansporttray ompanycay otay aketay-overway ourway ompanycay.{}{}Oday ouyay antway otay urchasepay {COMPANY} orfay {CURRENCY}?
-STR_705C_BANKRUPT                                               :{BLACK}{BIGFONT}Ankruptbay!
-STR_705D_HAS_BEEN_CLOSED_DOWN_BY                                :{BLACK}{BIGFONT}{COMPANY} ashay eenbay osedclay ownday ybay editorscray andway allway assetsway oldsay offway!
-STR_705E_NEW_TRANSPORT_COMPANY_LAUNCHED                         :{BLACK}{BIGFONT}Ewnay ansporttray ompanycay aunchedlay!
-STR_705F_STARTS_CONSTRUCTION_NEAR                               :{BLACK}{BIGFONT}{COMPANY} artsstay onstructioncay earnay {TOWN}!
-STR_7060_CAN_T_BUY_COMPANY                                      :{WHITE}An'tcay uybay ompanycay...
-STR_7061_CARGO_PAYMENT_RATES                                    :{WHITE}Argocay Aymentpay Atesray
-STR_7062_DAYS_IN_TRANSIT                                        :{BLACK}{TINYFONT}Aysday inway ansittray
-STR_7063_PAYMENT_FOR_DELIVERING                                 :{BLACK}{TINYFONT}Aymentpay orfay eliveringday 10 unitsway (orway 10,000 itreslay) ofway argocay away istanceday ofway 20 aressquay
-STR_7064_TOGGLE_GRAPH_FOR_CARGO                                 :{BLACK}Oggletay aphgray orfay argocay ypetay onway/offway
-STR_7065                                                        :{BLACK}{TINYFONT}{STRING}
-STR_7066_ENGINEER                                               :Engineerway
-STR_7067_TRAFFIC_MANAGER                                        :Affictray Anagermay
-STR_7068_TRANSPORT_COORDINATOR                                  :Ansporttray Oordinatorcay
-STR_7069_ROUTE_SUPERVISOR                                       :Outeray Upervisorsay
-STR_706A_DIRECTOR                                               :Irectorday
-STR_706B_CHIEF_EXECUTIVE                                        :Iefchay Executiveway
-STR_706C_CHAIRMAN                                               :Airmanchay
-STR_706D_PRESIDENT                                              :Esidentpray
-STR_706E_TYCOON                                                 :Ycoontay
-STR_706F_BUILD_HQ                                               :{BLACK}Uildbay HQay
-STR_7070_BUILD_COMPANY_HEADQUARTERS                             :{BLACK}Uildbay ompanycay eadquartershay / iewvay ompanycay eadquartershay
-STR_RELOCATE_COMPANY_HEADQUARTERS                               :{BLACK}Ebuildray ompanycay eadquartershay elsewhereway orfay 1% ostcay ofway ompanycay aluevay
-STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS                       :{WHITE}An'tcay uildbay ompanycay eadquartershay...
-STR_7072_VIEW_HQ                                                :{BLACK}Iewvay HQay
-STR_RELOCATE_HQ                                                 :{BLACK}Elocateray HQay
-STR_COMPANY_PASSWORD                                            :{BLACK}Asswordpay
-STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Asswordpay-otectpray ouryay ompanycay otay eventpray unauthorisedway usersway omfray oiningjay.
-STR_SET_COMPANY_PASSWORD                                        :{BLACK}Etsay ompanycay asswordpay
-STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Orldway Ecessionray!{}{}Inancialfay expertsway earfay orstway asway economyway umpsslay!
-STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Ecessionray Overway!{}{}Upturnway inway adetray ivesgay onfidencecay otay industriesway asway economyway engthensstray!
-STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Oggletay argelay/allsmay indowway izesay
-STR_7076_COMPANY_VALUE                                          :{GOLD}Ompanycay aluevay: {WHITE}{CURRENCY}
-STR_7077_BUY_25_SHARE_IN_COMPANY                                :{BLACK}Uybay 25% areshay inway ompanycay
-STR_7078_SELL_25_SHARE_IN_COMPANY                               :{BLACK}Ellsay 25% areshay inway ompanycay
-STR_7079_BUY_25_SHARE_IN_THIS_COMPANY                           :{BLACK}Uybay 25% areshay inway isthay ompanycay
-STR_707A_SELL_25_SHARE_IN_THIS_COMPANY                          :{BLACK}Ellsay 25% areshay inway isthay ompanycay
-STR_707B_CAN_T_BUY_25_SHARE_IN_THIS                             :{WHITE}An'tcay uybay 25% areshay inway isthay ompanycay...
-STR_707C_CAN_T_SELL_25_SHARE_IN                                 :{WHITE}An'tcay ellsay 25% areshay inway isthay ompanycay...
-STR_707D_OWNED_BY                                               :{WHITE}({COMMA}% ownedway ybay {COMPANY})
-STR_707F_HAS_BEEN_TAKEN_OVER_BY                                 :{BLACK}{BIGFONT}{COMPANY} ashay eenbay akentay overway ybay {COMPANY}!
-STR_7080_PROTECTED                                              :{WHITE}Isthay ompanycay isway otnay oldway enoughway otay adetray aresshay etyay...
-
-STR_LIVERY_DEFAULT                                              :Andardstay Iverylay
-STR_LIVERY_STEAM                                                :Eamstay Engineway
-STR_LIVERY_DIESEL                                               :Ieselday Engineway
-STR_LIVERY_ELECTRIC                                             :Electricway Engineway
-STR_LIVERY_MONORAIL                                             :Onorailmay Engineway
-STR_LIVERY_MAGLEV                                               :Aglevmay Engineway
-STR_LIVERY_DMU                                                  :UDMay
-STR_LIVERY_EMU                                                  :EMUWAY
-STR_LIVERY_PASSENGER_WAGON_STEAM                                :Assengerpay Oachcay (Eamstay)
-STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Assengerpay Oachcay (Ieselday)
-STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Assengerpay Oachcay (Electricway)
-STR_LIVERY_FREIGHT_WAGON                                        :Eightfray Agonway
-STR_LIVERY_BUS                                                  :Usbay
-STR_LIVERY_TRUCK                                                :Orrylay
-STR_LIVERY_PASSENGER_SHIP                                       :Assengerpay Erryfay
-STR_LIVERY_FREIGHT_SHIP                                         :Eightfray Ipshay
-STR_LIVERY_HELICOPTER                                           :Elicopterhay
-STR_LIVERY_SMALL_PLANE                                          :Allsmay Aeroplaneway
-STR_LIVERY_LARGE_PLANE                                          :Argelay Aeroplaneway
-STR_LIVERY_PASSENGER_TRAM                                       :Assengerpay Amtray
-STR_LIVERY_FREIGHT_TRAM                                         :Eightfray Amtray
-
-STR_LIVERY_GENERAL_TIP                                          :{BLACK}Owshay eneralgay olourcay emesschay
-STR_LIVERY_TRAIN_TIP                                            :{BLACK}Owshay aintray olourcay emesschay
-STR_LIVERY_ROADVEH_TIP                                          :{BLACK}Owshay oadray ehiclevay olourcay emesschay
-STR_LIVERY_SHIP_TIP                                             :{BLACK}Owshay ipshay olourcay emesschay
-STR_LIVERY_AIRCRAFT_TIP                                         :{BLACK}Owshay aircraftway olourcay emesschay
-STR_LIVERY_PRIMARY_TIP                                          :{BLACK}Oosechay ethay imarypray olourcay orfay ethay electedsay emeschay
-STR_LIVERY_SECONDARY_TIP                                        :{BLACK}Oosechay ethay econdarysay olourcay orfay ethay electedsay emeschay
-STR_LIVERY_PANEL_TIP                                            :{BLACK}Electsay away olourcay emeschay otay angechay, orway ultiplemay emesschay ithway CTRLay+ickclay. Ickclay onway ethay oxbay otay oggletay useway ofway ethay emeschay
-
-##id 0x8000
-STR_8000_KIRBY_PAUL_TANK_STEAM                                  :Irbykay Aulpay Anktay (Eamstay)
-STR_8001_MJS_250_DIESEL                                         :MJSay 250 (Ieselday)
-STR_8002_PLODDYPHUT_CHOO_CHOO                                   :Oddyphutplay Oochay-Oochay
-STR_8003_POWERNAUT_CHOO_CHOO                                    :Owernautpay Oochay-Oochay
-STR_8004_MIGHTYMOVER_CHOO_CHOO                                  :Ightymovermay Oochay-Oochay
-STR_8005_PLODDYPHUT_DIESEL                                      :Oddyphutplay Ieselday
-STR_8006_POWERNAUT_DIESEL                                       :Owernautpay Ieselday
-STR_8007_WILLS_2_8_0_STEAM                                      :Illsway 2-8-0 (Eamstay)
-STR_8008_CHANEY_JUBILEE_STEAM                                   :Aneychay 'Ubilee'jay (Eamstay)
-STR_8009_GINZU_A4_STEAM                                         :Inzugay 'Away4' (Eamstay)
-STR_800A_SH_8P_STEAM                                            :SHay '8P'ay (Eamstay)
-STR_800B_MANLEY_MOREL_DMU_DIESEL                                :Anleymay-Orelmay UDMay (Ieselday)
-STR_800C_DASH_DIESEL                                            :'Ash'day (Ieselday)
-STR_800D_SH_HENDRY_25_DIESEL                                    :SHay/Endryhay '25' (Ieselday)
-STR_800E_UU_37_DIESEL                                           :UUWAY '37' (Ieselday)
-STR_800F_FLOSS_47_DIESEL                                        :Ossflay '47' (Ieselday)
-STR_8010_CS_4000_DIESEL                                         :CSay 4000 (Ieselday)
-STR_8011_CS_2400_DIESEL                                         :CSay 2400 (Ieselday)
-STR_8012_CENTENNIAL_DIESEL                                      :Entennialcay (Ieselday)
-STR_8013_KELLING_3100_DIESEL                                    :Ellingkay 3100 (Ieselday)
-STR_8014_TURNER_TURBO_DIESEL                                    :Urnertay Urbotay (Ieselday)
-STR_8015_MJS_1000_DIESEL                                        :MJSay 1000 (Ieselday)
-STR_8016_SH_125_DIESEL                                          :SHay '125' (Ieselday)
-STR_8017_SH_30_ELECTRIC                                         :SHay '30' (Electricway)
-STR_8018_SH_40_ELECTRIC                                         :SHay '40' (Electricway)
-STR_8019_T_I_M_ELECTRIC                                         :'Tay.Iway.May.' (Electricway)
-STR_801A_ASIASTAR_ELECTRIC                                      :'AsiaStar'WAY (Electricway)
-STR_801B_PASSENGER_CAR                                          :Assengerpay Arriagecay
-STR_801C_MAIL_VAN                                               :Ailmay Anvay
-STR_801D_COAL_CAR                                               :Oalcay Ucktray
-STR_801E_OIL_TANKER                                             :Oilway Ankertay
-STR_801F_LIVESTOCK_VAN                                          :Ivestocklay Anvay
-STR_8020_GOODS_VAN                                              :Oodsgay Anvay
-STR_8021_GRAIN_HOPPER                                           :Aingray Opperhay
-STR_8022_WOOD_TRUCK                                             :Oodway Ucktray
-STR_8023_IRON_ORE_HOPPER                                        :Ironway Oreway Opperhay
-STR_8024_STEEL_TRUCK                                            :Eelstay Ucktray
-STR_8025_ARMORED_VAN                                            :Armouredway Anvay
-STR_8026_FOOD_VAN                                               :Oodfay Anvay
-STR_8027_PAPER_TRUCK                                            :Aperpay Ucktray
-STR_8028_COPPER_ORE_HOPPER                                      :Oppercay Oreway Opperhay
-STR_8029_WATER_TANKER                                           :Aterway Ankertay
-STR_802A_FRUIT_TRUCK                                            :Uitfray Ucktray
-STR_802B_RUBBER_TRUCK                                           :Ubberray Ucktray
-STR_802C_SUGAR_TRUCK                                            :Ugarsay Ucktray
-STR_802D_COTTON_CANDY_HOPPER                                    :Andyflosscay Opperhay
-STR_802E_TOFFEE_HOPPER                                          :Offeetay Opperhay
-STR_802F_BUBBLE_VAN                                             :Ubblebay Anvay
-STR_8030_COLA_TANKER                                            :Olacay Ankertay
-STR_8031_CANDY_VAN                                              :Eetsway Anvay
-STR_8032_TOY_VAN                                                :Oytay Anvay
-STR_8033_BATTERY_TRUCK                                          :Atterybay Ucktray
-STR_8034_FIZZY_DRINK_TRUCK                                      :Izzyfay Inkdray Ucktray
-STR_8035_PLASTIC_TRUCK                                          :Asticplay Ucktray
-STR_8036_X2001_ELECTRIC                                         :'Xay2001' (Electricway)
-STR_8037_MILLENNIUM_Z1_ELECTRIC                                 :'Illenniummay Zay1' (Electricway)
-STR_8038_WIZZOWOW_Z99                                           :Izzowowway Zay99
-STR_8039_PASSENGER_CAR                                          :Assengerpay Arriagecay
-STR_803A_MAIL_VAN                                               :Ailmay Anvay
-STR_803B_COAL_CAR                                               :Oalcay Ucktray
-STR_803C_OIL_TANKER                                             :Oilway Ankertay
-STR_803D_LIVESTOCK_VAN                                          :Ivestocklay Anvay
-STR_803E_GOODS_VAN                                              :Oodsgay Anvay
-STR_803F_GRAIN_HOPPER                                           :Aingray Opperhay
-STR_8040_WOOD_TRUCK                                             :Oodway Ucktray
-STR_8041_IRON_ORE_HOPPER                                        :Ironway Oreway Opperhay
-STR_8042_STEEL_TRUCK                                            :Eelstay Ucktray
-STR_8043_ARMORED_VAN                                            :Armouredway Anvay
-STR_8044_FOOD_VAN                                               :Oodfay Anvay
-STR_8045_PAPER_TRUCK                                            :Aperpay Ucktray
-STR_8046_COPPER_ORE_HOPPER                                      :Oppercay Oreway Opperhay
-STR_8047_WATER_TANKER                                           :Aterway Ankertay
-STR_8048_FRUIT_TRUCK                                            :Uitfray Ucktray
-STR_8049_RUBBER_TRUCK                                           :Ubberray Ucktray
-STR_804A_SUGAR_TRUCK                                            :Ugarsay Ucktray
-STR_804B_COTTON_CANDY_HOPPER                                    :Andyflosscay Opperhay
-STR_804C_TOFFEE_HOPPER                                          :Offeetay Opperhay
-STR_804D_BUBBLE_VAN                                             :Ubblebay Anvay
-STR_804E_COLA_TANKER                                            :Olacay Ankertay
-STR_804F_CANDY_VAN                                              :Eetsway Anvay
-STR_8050_TOY_VAN                                                :Oytay Anvay
-STR_8051_BATTERY_TRUCK                                          :Atterybay Ucktray
-STR_8052_FIZZY_DRINK_TRUCK                                      :Izzyfay Inkdray Ucktray
-STR_8053_PLASTIC_TRUCK                                          :Asticplay Ucktray
-STR_8054_LEV1_LEVIATHAN_ELECTRIC                                :Evlay1 'Eviathan'lay (Electricway)
-STR_8055_LEV2_CYCLOPS_ELECTRIC                                  :Evlay2 'Yclops'cay (Electricway)
-STR_8056_LEV3_PEGASUS_ELECTRIC                                  :Evlay3 'Egasus'pay (Electricway)
-STR_8057_LEV4_CHIMAERA_ELECTRIC                                 :Evlay4 'Imaera'chay (Electricway)
-STR_8058_WIZZOWOW_ROCKETEER                                     :Izzowowway Ocketeerray
-STR_8059_PASSENGER_CAR                                          :Assengerpay Arriagecay
-STR_805A_MAIL_VAN                                               :Ailmay Anvay
-STR_805B_COAL_CAR                                               :Oalcay Ucktray
-STR_805C_OIL_TANKER                                             :Oilway Ankertay
-STR_805D_LIVESTOCK_VAN                                          :Ivestocklay Anvay
-STR_805E_GOODS_VAN                                              :Oodsgay Anvay
-STR_805F_GRAIN_HOPPER                                           :Aingray Opperhay
-STR_8060_WOOD_TRUCK                                             :Oodway Ucktray
-STR_8061_IRON_ORE_HOPPER                                        :Ironway Oreway Opperhay
-STR_8062_STEEL_TRUCK                                            :Eelstay Ucktray
-STR_8063_ARMORED_VAN                                            :Armouredway Anvay
-STR_8064_FOOD_VAN                                               :Oodfay Anvay
-STR_8065_PAPER_TRUCK                                            :Aperpay Ucktray
-STR_8066_COPPER_ORE_HOPPER                                      :Oppercay Oreway Opperhay
-STR_8067_WATER_TANKER                                           :Aterway Ankertay
-STR_8068_FRUIT_TRUCK                                            :Uitfray Ucktray
-STR_8069_RUBBER_TRUCK                                           :Ubberray Ucktray
-STR_806A_SUGAR_TRUCK                                            :Ugarsay Ucktray
-STR_806B_COTTON_CANDY_HOPPER                                    :Andyflosscay Opperhay
-STR_806C_TOFFEE_HOPPER                                          :Offeetay Opperhay
-STR_806D_BUBBLE_VAN                                             :Ubblebay Anvay
-STR_806E_COLA_TANKER                                            :Olacay Ankertay
-STR_806F_CANDY_VAN                                              :Eetsway Anvay
-STR_8070_TOY_VAN                                                :Oytay Anvay
-STR_8071_BATTERY_TRUCK                                          :Atterybay Ucktray
-STR_8072_FIZZY_DRINK_TRUCK                                      :Izzyfay Inkdray Ucktray
-STR_8073_PLASTIC_TRUCK                                          :Asticplay Ucktray
-STR_8074_MPS_REGAL_BUS                                          :MPSay Egalray Usbay
-STR_8075_HEREFORD_LEOPARD_BUS                                   :Erefordhay Eopardlay Usbay
-STR_8076_FOSTER_BUS                                             :Osterfay Usbay
-STR_8077_FOSTER_MKII_SUPERBUS                                   :Osterfay IImkay Uperbussay
-STR_8078_PLODDYPHUT_MKI_BUS                                     :Oddyphutplay Imkay Usbay
-STR_8079_PLODDYPHUT_MKII_BUS                                    :Oddyphutplay IImkay Usbay
-STR_807A_PLODDYPHUT_MKIII_BUS                                   :Oddyphutplay IIImkay Usbay
-STR_807B_BALOGH_COAL_TRUCK                                      :Aloghbay Oalcay Ucktray
-STR_807C_UHL_COAL_TRUCK                                         :Uhlway Oalcay Ucktray
-STR_807D_DW_COAL_TRUCK                                          :DWay Oalcay Ucktray
-STR_807E_MPS_MAIL_TRUCK                                         :MPSay Ailmay Ucktray
-STR_807F_REYNARD_MAIL_TRUCK                                     :Eynardray Ailmay Ucktray
-STR_8080_PERRY_MAIL_TRUCK                                       :Errypay Ailmay Ucktray
-STR_8081_MIGHTYMOVER_MAIL_TRUCK                                 :IghtyMovermay Ailmay Ucktray
-STR_8082_POWERNAUGHT_MAIL_TRUCK                                 :Owernaughtpay Ailmay Ucktray
-STR_8083_WIZZOWOW_MAIL_TRUCK                                    :Izzowowway Ailmay Ucktray
-STR_8084_WITCOMBE_OIL_TANKER                                    :Itcombeway Oilway Ankertay
-STR_8085_FOSTER_OIL_TANKER                                      :Osterfay Oilway Ankertay
-STR_8086_PERRY_OIL_TANKER                                       :Errypay Oilway Ankertay
-STR_8087_TALBOTT_LIVESTOCK_VAN                                  :Albotttay Ivestocklay Anvay
-STR_8088_UHL_LIVESTOCK_VAN                                      :Uhlway Ivestocklay Anvay
-STR_8089_FOSTER_LIVESTOCK_VAN                                   :Osterfay Ivestocklay Anvay
-STR_808A_BALOGH_GOODS_TRUCK                                     :Aloghbay Oodsgay Ucktray
-STR_808B_CRAIGHEAD_GOODS_TRUCK                                  :Aigheadcray Oodsgay Ucktray
-STR_808C_GOSS_GOODS_TRUCK                                       :Ossgay Oodsgay Ucktray
-STR_808D_HEREFORD_GRAIN_TRUCK                                   :Erefordhay Aingray Ucktray
-STR_808E_THOMAS_GRAIN_TRUCK                                     :Omasthay Aingray Ucktray
-STR_808F_GOSS_GRAIN_TRUCK                                       :Ossgay Aingray Ucktray
-STR_8090_WITCOMBE_WOOD_TRUCK                                    :Itcombeway Oodway Ucktray
-STR_8091_FOSTER_WOOD_TRUCK                                      :Osterfay Oodway Ucktray
-STR_8092_MORELAND_WOOD_TRUCK                                    :Orelandmay Oodway Ucktray
-STR_8093_MPS_IRON_ORE_TRUCK                                     :MPSay Ironway Oreway Ucktray
-STR_8094_UHL_IRON_ORE_TRUCK                                     :Uhlway Ironway Oreway Ucktray
-STR_8095_CHIPPY_IRON_ORE_TRUCK                                  :Ippychay Ironway Oreway Ucktray
-STR_8096_BALOGH_STEEL_TRUCK                                     :Aloghbay Eelstay Ucktray
-STR_8097_UHL_STEEL_TRUCK                                        :Uhlway Eelstay Ucktray
-STR_8098_KELLING_STEEL_TRUCK                                    :Ellingkay Eelstay Ucktray
-STR_8099_BALOGH_ARMORED_TRUCK                                   :Aloghbay Armouredway Ucktray
-STR_809A_UHL_ARMORED_TRUCK                                      :Uhlway Armouredway Ucktray
-STR_809B_FOSTER_ARMORED_TRUCK                                   :Osterfay Armouredway Ucktray
-STR_809C_FOSTER_FOOD_VAN                                        :Osterfay Oodfay Anvay
-STR_809D_PERRY_FOOD_VAN                                         :Errypay Oodfay Anvay
-STR_809E_CHIPPY_FOOD_VAN                                        :Ippychay Oodfay Anvay
-STR_809F_UHL_PAPER_TRUCK                                        :Uhlway Aperpay Ucktray
-STR_80A0_BALOGH_PAPER_TRUCK                                     :Aloghbay Aperpay Ucktray
-STR_80A1_MPS_PAPER_TRUCK                                        :MPSay Aperpay Ucktray
-STR_80A2_MPS_COPPER_ORE_TRUCK                                   :MPSay Oppercay Oreway Ucktray
-STR_80A3_UHL_COPPER_ORE_TRUCK                                   :Uhlway Oppercay Oreway Ucktray
-STR_80A4_GOSS_COPPER_ORE_TRUCK                                  :Ossgay Oppercay Oreway Ucktray
-STR_80A5_UHL_WATER_TANKER                                       :Uhlway Aterway Ankertay
-STR_80A6_BALOGH_WATER_TANKER                                    :Aloghbay Aterway Ankertay
-STR_80A7_MPS_WATER_TANKER                                       :MPSay Aterway Ankertay
-STR_80A8_BALOGH_FRUIT_TRUCK                                     :Aloghbay Uitfray Ucktray
-STR_80A9_UHL_FRUIT_TRUCK                                        :Uhlway Uitfray Ucktray
-STR_80AA_KELLING_FRUIT_TRUCK                                    :Ellingkay Uitfray Ucktray
-STR_80AB_BALOGH_RUBBER_TRUCK                                    :Aloghbay Ubberray Ucktray
-STR_80AC_UHL_RUBBER_TRUCK                                       :Uhlway Ubberray Ucktray
-STR_80AD_RMT_RUBBER_TRUCK                                       :RMTay Ubberray Ucktray
-STR_80AE_MIGHTYMOVER_SUGAR_TRUCK                                :IghtyMovermay Ugarsay Ucktray
-STR_80AF_POWERNAUGHT_SUGAR_TRUCK                                :Owernaughtpay Ugarsay Ucktray
-STR_80B0_WIZZOWOW_SUGAR_TRUCK                                   :Izzowowway Ugarsay Ucktray
-STR_80B1_MIGHTYMOVER_COLA_TRUCK                                 :IghtyMovermay Olacay Ucktray
-STR_80B2_POWERNAUGHT_COLA_TRUCK                                 :Owernaughtpay Olacay Ucktray
-STR_80B3_WIZZOWOW_COLA_TRUCK                                    :Izzowowway Olacay Ucktray
-STR_80B4_MIGHTYMOVER_COTTON_CANDY                               :IghtyMovermay Andyflosscay Ucktray
-STR_80B5_POWERNAUGHT_COTTON_CANDY                               :Owernaughtpay Andyflosscay Ucktray
-STR_80B6_WIZZOWOW_COTTON_CANDY_TRUCK                            :Izzowowway Andyflosscay Ucktray
-STR_80B7_MIGHTYMOVER_TOFFEE_TRUCK                               :IghtyMovermay Offeetay Ucktray
-STR_80B8_POWERNAUGHT_TOFFEE_TRUCK                               :Owernaughtpay Offeetay Ucktray
-STR_80B9_WIZZOWOW_TOFFEE_TRUCK                                  :Izzowowway Offeetay Ucktray
-STR_80BA_MIGHTYMOVER_TOY_VAN                                    :IghtyMovermay Oytay Anvay
-STR_80BB_POWERNAUGHT_TOY_VAN                                    :Owernaughtpay Oytay Anvay
-STR_80BC_WIZZOWOW_TOY_VAN                                       :Izzowowway Oytay Anvay
-STR_80BD_MIGHTYMOVER_CANDY_TRUCK                                :IghtyMovermay Eetsway Ucktray
-STR_80BE_POWERNAUGHT_CANDY_TRUCK                                :Owernaughtpay Eetsway Ucktray
-STR_80BF_WIZZOWOW_CANDY_TRUCK                                   :Izzowowway Eetsway Ucktray
-STR_80C0_MIGHTYMOVER_BATTERY_TRUCK                              :IghtyMovermay Atterybay Ucktray
-STR_80C1_POWERNAUGHT_BATTERY_TRUCK                              :Owernaughtpay Atterybay Ucktray
-STR_80C2_WIZZOWOW_BATTERY_TRUCK                                 :Izzowowway Atterybay Ucktray
-STR_80C3_MIGHTYMOVER_FIZZY_DRINK                                :IghtyMovermay Izzyfay Inkdray Ucktray
-STR_80C4_POWERNAUGHT_FIZZY_DRINK                                :Owernaughtpay Izzyfay Inkdray Ucktray
-STR_80C5_WIZZOWOW_FIZZY_DRINK_TRUCK                             :Izzowowway Izzyfay Inkdray Ucktray
-STR_80C6_MIGHTYMOVER_PLASTIC_TRUCK                              :IghtyMovermay Asticplay Ucktray
-STR_80C7_POWERNAUGHT_PLASTIC_TRUCK                              :Owernaughtpay Asticplay Ucktray
-STR_80C8_WIZZOWOW_PLASTIC_TRUCK                                 :Izzowowway Asticplay Ucktray
-STR_80C9_MIGHTYMOVER_BUBBLE_TRUCK                               :IghtyMovermay Ubblebay Ucktray
-STR_80CA_POWERNAUGHT_BUBBLE_TRUCK                               :Owernaughtpay Ubblebay Ucktray
-STR_80CB_WIZZOWOW_BUBBLE_TRUCK                                  :Izzowowway Ubblebay Ucktray
-STR_80CC_MPS_OIL_TANKER                                         :MPSay Oilway Ankertay
-STR_80CD_CS_INC_OIL_TANKER                                      :CSay-Incway. Oilway Ankertay
-STR_80CE_MPS_PASSENGER_FERRY                                    :MPSay Assengerpay Erryfay
-STR_80CF_FFP_PASSENGER_FERRY                                    :FFPay Assengerpay Erryfay
-STR_80D0_BAKEWELL_300_HOVERCRAFT                                :Akewellbay 300 Overcrafthay
-STR_80D1_CHUGGER_CHUG_PASSENGER                                 :Uggerchay-Ugchay Assengerpay Erryfay
-STR_80D2_SHIVERSHAKE_PASSENGER_FERRY                            :Ivershakeshay Assengerpay Erryfay
-STR_80D3_YATE_CARGO_SHIP                                        :Ateyay Argocay ipshay
-STR_80D4_BAKEWELL_CARGO_SHIP                                    :Akewellbay Argocay ipshay
-STR_80D5_MIGHTYMOVER_CARGO_SHIP                                 :Ightymovermay Argocay ipshay
-STR_80D6_POWERNAUT_CARGO_SHIP                                   :Owernautpay Argocay ipshay
-STR_80D7_SAMPSON_U52                                            :Ampsonsay Uway52
-STR_80D8_COLEMAN_COUNT                                          :Olemancay Ountcay
-STR_80D9_FFP_DART                                               :FFPay Artday
-STR_80DA_YATE_HAUGAN                                            :Ateyay Auganhay
-STR_80DB_BAKEWELL_COTSWALD_LB_3                                 :Akewellbay Otswaldcay LBay-3
-STR_80DC_BAKEWELL_LUCKETT_LB_8                                  :Akewellbay Uckettlay LBay-8
-STR_80DD_BAKEWELL_LUCKETT_LB_9                                  :Akewellbay Uckettlay LBay-9
-STR_80DE_BAKEWELL_LUCKETT_LB80                                  :Akewellbay Uckettlay LBay80
-STR_80DF_BAKEWELL_LUCKETT_LB_10                                 :Akewellbay Uckettlay LBay-10
-STR_80E0_BAKEWELL_LUCKETT_LB_11                                 :Akewellbay Uckettlay LBay-11
-STR_80E1_YATE_AEROSPACE_YAC_1_11                                :Ateyay Aerospaceway YACay 1-11
-STR_80E2_DARWIN_100                                             :Arwinday 100
-STR_80E3_DARWIN_200                                             :Arwinday 200
-STR_80E4_DARWIN_300                                             :Arwinday 300
-STR_80E5_DARWIN_400                                             :Arwinday 400
-STR_80E6_DARWIN_500                                             :Arwinday 500
-STR_80E7_DARWIN_600                                             :Arwinday 600
-STR_80E8_GURU_GALAXY                                            :Urugay Alaxygay
-STR_80E9_AIRTAXI_A21                                            :Airtaxiway Away21
-STR_80EA_AIRTAXI_A31                                            :Airtaxiway Away31
-STR_80EB_AIRTAXI_A32                                            :Airtaxiway Away32
-STR_80EC_AIRTAXI_A33                                            :Airtaxiway Away33
-STR_80ED_YATE_AEROSPACE_YAE46                                   :Ateyay Aerospaceway EyAay46
-STR_80EE_DINGER_100                                             :Ingerday 100
-STR_80EF_AIRTAXI_A34_1000                                       :AirTaxiway Away34-1000
-STR_80F0_YATE_Z_SHUTTLE                                         :Ateyay Zay-Uttleshay
-STR_80F1_KELLING_K1                                             :Ellingkay Kay1
-STR_80F2_KELLING_K6                                             :Ellingkay Kay6
-STR_80F3_KELLING_K7                                             :Ellingkay Kay7
-STR_80F4_DARWIN_700                                             :Arwinday 700
-STR_80F5_FFP_HYPERDART_2                                        :FFPay Yperdarthay 2
-STR_80F6_DINGER_200                                             :Ingerday 200
-STR_80F7_DINGER_1000                                            :Ingerday 1000
-STR_80F8_PLODDYPHUT_100                                         :Oddyphutplay 100
-STR_80F9_PLODDYPHUT_500                                         :Oddyphutplay 500
-STR_80FA_FLASHBANG_X1                                           :Ashbangflay Xay1
-STR_80FB_JUGGERPLANE_M1                                         :Uggerplanejay May1
-STR_80FC_FLASHBANG_WIZZER                                       :Ashbangflay Izzerway
-STR_80FD_TRICARIO_HELICOPTER                                    :Icariotray Elicopterhay
-STR_80FE_GURU_X2_HELICOPTER                                     :Urugay Xay2 Elicopterhay
-STR_80FF_POWERNAUT_HELICOPTER                                   :Owernautpay Elicopterhay
-STR_8100_MESSAGE_FROM_VEHICLE_MANUFACTURE                       :{WHITE}Essagemay omfray ehiclevay anufacturermay
-STR_8101_WE_HAVE_JUST_DESIGNED_A                                :{GOLD}Eway avehay ustjay esignedday away ewnay {STRING} - ouldway ouyay ebay interestedway inway away ear'syay exclusiveway useway ofway isthay ehiclevay, osay eway ancay eesay owhay itway erformspay eforebay akingmay itway universallyway availableway?
-STR_8102_RAILROAD_LOCOMOTIVE                                    :ailwayray ocomotivelay
-STR_8103_ROAD_VEHICLE                                           :oadray ehiclevay
-STR_8104_AIRCRAFT                                               :aircraftway
-STR_8105_SHIP                                                   :ipshay
-STR_8106_MONORAIL_LOCOMOTIVE                                    :onorailmay ocomotivelay
-STR_8107_MAGLEV_LOCOMOTIVE                                      :aglevmay ocomotivelay
-
-##id 0x8800
-STR_8800_TRAIN_DEPOT                                            :{WHITE}{TOWN} Aintray Epotday
-STR_8801_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay aintray arrivesway atway {STATION}!
-STR_8802_DETAILS                                                :{WHITE}{VEHICLE} (Etailsday)
-STR_8803_TRAIN_IN_THE_WAY                                       :{WHITE}Aintray inway ethay ayway
-STR_8804                                                        :{SETX 10}{COMMA}: {STRING} {STRING}
-STR_8805                                                        :{RIGHTARROW}{SETX 10}{COMMA}: {STRING} {STRING}
-STR_8806_GO_TO                                                  :Ogay otay {STATION}
-STR_8807_GO_TO_TRANSFER                                         :Ogay otay {STATION} (Ansfertray andway aketay argocay)
-STR_8808_GO_TO_UNLOAD                                           :Ogay otay {STATION} (Unloadway)
-STR_8809_GO_TO_TRANSFER_UNLOAD                                  :Ogay otay {STATION} (Ansfertray andway eavelay emptyway)
-STR_880A_GO_TO_LOAD                                             :Ogay otay {STATION} (Oadlay)
-STR_880B_GO_TO_TRANSFER_LOAD                                    :Ogay otay {STATION} (Ansfertray andway aitway orfay ullfay oadlay)
-STR_880C_GO_NON_STOP_TO                                         :Ogay onnay-opstay otay {STATION}
-STR_880D_GO_TO_NON_STOP_TRANSFER                                :Ogay onnay-opstay otay {STATION} (Ansfertray andway aketay argocay)
-STR_880E_GO_NON_STOP_TO_UNLOAD                                  :Ogay onnay-opstay otay {STATION} (Unloadway)
-STR_880F_GO_TO_NON_STOP_TRANSFER_UNLOAD                         :Ogay onnay-opstay otay {STATION} (Ansfertray andway eavelay emptyway)
-STR_8810_GO_NON_STOP_TO_LOAD                                    :Ogay onnay-opstay otay {STATION} (Oadlay)
-STR_8811_GO_TO_NON_STOP_TRANSFER_LOAD                           :Ogay onnay-opstay otay {STATION} (Ansfertray andway aitway orfay ullfay oadlay)
-STR_GO_TO_TRAIN_DEPOT                                           :Ogay otay {TOWN} Aintray Epotday
-STR_SERVICE_AT_TRAIN_DEPOT                                      :Ervicesay atway {TOWN} Aintray Epotday
-STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT                             :Ogay onnay-opstay otay {TOWN} Aintray Epotday
-STR_SERVICE_NON_STOP_AT_TRAIN_DEPOT                             :Ervicesay onnay-opstay atway {TOWN} Aintray Epotday
-
-STR_TIMETABLE_GO_TO                                             :{STRING} {STRING}
-STR_TIMETABLE_TRAVEL_NOT_TIMETABLED                             :Aveltray (otnay imetabledtay)
-STR_TIMETABLE_TRAVEL_FOR                                        :Aveltray orfay {STRING}
-STR_TIMETABLE_STAY_FOR                                          :andway aystay orfay {STRING}
-STR_TIMETABLE_DAYS                                              :{COMMA} ay{P "" s}day
-STR_TIMETABLE_TICKS                                             :{COMMA} ick{P "" s}tay
-
-STR_HEADING_FOR_TRAIN_DEPOT                                     :{ORANGE}Eadinghay orfay {TOWN} Aintray Epotday
-STR_HEADING_FOR_TRAIN_DEPOT_VEL                                 :{ORANGE}Eadinghay orfay {TOWN} Aintray Epotday, {VELOCITY}
-STR_HEADING_FOR_TRAIN_DEPOT_SERVICE                             :{LTBLUE}Ervicesay atway {TOWN} Aintray Epotday
-STR_HEADING_FOR_TRAIN_DEPOT_SERVICE_VEL                         :{LTBLUE}Ervicesay atway {TOWN} Aintray Epotday, {VELOCITY}
-
-STR_INVALID_ORDER                                               :{RED} (Invalidway Orderway)
-
-STR_UNKNOWN_DESTINATION                                         :unknownway estinationday
-STR_8812_EMPTY                                                  :{LTBLUE}Emptyway
-STR_8813_FROM                                                   :{LTBLUE}{CARGO} omfray {STATION}
-STR_FROM_MULT                                                   :{LTBLUE}{CARGO} omfray {STATION} (xay{NUM})
-STR_8814_TRAIN_IS_WAITING_IN_DEPOT                              :{WHITE}Aintray {COMMA} isway aitingway inway epotday
-STR_8815_NEW_VEHICLES                                           :{BLACK}Ewnay Ehiclesvay
-STR_8816                                                        :{BLACK}-
-STR_8819_TRAIN_TOO_LONG                                         :{WHITE}Aintray ootay onglay
-STR_881A_TRAINS_CAN_ONLY_BE_ALTERED                             :{WHITE}Ainstray ancay onlyway ebay alteredway enwhay oppedstay insideway away epotday
-STR_881B_TRAINS                                                 :{WHITE}{COMPANY} - {COMMA} Ain{P "" s}tray
-
-STR_881C_NEW_RAIL_VEHICLES                                      :{WHITE}Ewnay Ailray Ehiclesvay
-STR_NEW_ELRAIL_VEHICLES                                         :{WHITE}Ewnay Electricway Ailray Ehiclesvay
-STR_881D_NEW_MONORAIL_VEHICLES                                  :{WHITE}Ewnay Onorailmay Ehiclesvay
-STR_881E_NEW_MAGLEV_VEHICLES                                    :{WHITE}Ewnay Aglevmay Ehiclesvay
-STR_ALL_AVAIL_RAIL_VEHICLES                                     :{WHITE}Ailray Ehiclesvay
-
-STR_881F_BUILD_VEHICLE                                          :{BLACK}Uildbay Ehiclevay
-STR_CLONE_ROAD_VEHICLE                                          :{BLACK}Oneclay Ehiclevay
-STR_CLONE_ROAD_VEHICLE_INFO                                     :{BLACK}Isthay illway uildbay away opycay ofway ethay oadray ehiclevay. Ontrolcay-ickclay illway areshay ethay ordersway
-STR_CLONE_ROAD_VEHICLE_DEPOT_INFO                               :{BLACK}Isthay illway uildbay away opycay ofway away oadray ehiclevay. Ickclay isthay uttonbay andway enthay onway away oadray ehiclevay insideway orway outsideway ethay epotday. Ontrolcay-ickclay illway areshay ethay ordersway
-STR_CLONE_TRAIN                                                 :{BLACK}Oneclay Aintray
-STR_CLONE_TRAIN_INFO                                            :{BLACK}Isthay illway uildbay away opycay ofway ethay aintray includingway allway arscay. Ontrolcay-ickclay illway areshay ethay ordersway
-STR_CLONE_TRAIN_DEPOT_INFO                                      :{BLACK}Isthay illway uildbay away opycay ofway away aintray includingway allway arscay. Ickclay isthay uttonbay andway enthay onway away aintray insideway orway outsideway ethay epotday. Ontrolcay-ickclay illway areshay ethay ordersway
-STR_8820_RENAME                                                 :{BLACK}Enameray
-STR_8823_SKIP                                                   :{BLACK}Ipskay
-STR_8824_DELETE                                                 :{BLACK}Eleteday
-STR_8825_NON_STOP                                               :{BLACK}Onnay-Opstay
-STR_8826_GO_TO                                                  :{BLACK}Ogay Otay
-STR_8827_FULL_LOAD                                              :{BLACK}Ullfay Oadlay
-STR_8828_UNLOAD                                                 :{BLACK}Unloadway
-STR_REFIT                                                       :{BLACK}Efitray
-STR_REFIT_TIP                                                   :{BLACK}Electsay atwhay argocay ypetay otay efitray otay inway isthay orderway. Ontrolcay ickclay otay emoveray efitray instructionway
-STR_REFIT_ORDER                                                 :(Efitray otay {STRING})
-STR_TIMETABLE_VIEW                                              :{BLACK}Imetabletay
-STR_TIMETABLE_VIEW_TOOLTIP                                      :{BLACK}Itchsway otay ethay imetabletay iewvay
-STR_8829_ORDERS                                                 :{WHITE}{VEHICLE} (Ordersway)
-STR_882A_END_OF_ORDERS                                          :{SETX 10}- - Endway ofway Ordersway - -
-STR_FULLLOAD_OR_SERVICE                                         :{SKIP}{SKIP}{STRING}
-STR_SERVICE                                                     :{BLACK}Ervicesay
-STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE                           :{WHITE}An'tcay uildbay ailwayray ehiclevay...
-STR_882C_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Uiltbay: {LTBLUE}{NUM}{BLACK} Aluevay: {LTBLUE}{CURRENCY}
-STR_882D_VALUE                                                  :{LTBLUE}{ENGINE}{BLACK}   Aluevay: {LTBLUE}{CURRENCY}
-STR_882E                                                        :{WHITE}{VEHICLE}
-STR_882F_LOADING_UNLOADING                                      :{LTBLUE}Oadinglay / Unloadingway
-STR_TRAIN_MUST_BE_STOPPED                                       :{WHITE}Aintray ustmay ebay oppedstay insideway away epotday
-STR_8830_CAN_T_SEND_TRAIN_TO_DEPOT                              :{WHITE}An'tcay endsay aintray otay epotday...
-STR_8831_NO_MORE_SPACE_FOR_ORDERS                               :{WHITE}Onay oremay acespay orfay ordersway
-STR_8832_TOO_MANY_ORDERS                                        :{WHITE}Ootay anymay ordersway
-STR_8833_CAN_T_INSERT_NEW_ORDER                                 :{WHITE}An'tcay insertway ewnay orderway...
-STR_8834_CAN_T_DELETE_THIS_ORDER                                :{WHITE}An'tcay eleteday isthay orderway...
-STR_8835_CAN_T_MODIFY_THIS_ORDER                                :{WHITE}An'tcay odifymay isthay orderway...
-STR_CAN_T_MOVE_THIS_ORDER                                       :{WHITE}An'tcay ovemay isthay orderway...
-STR_CAN_T_SKIP_ORDER                                            :{WHITE}An'tcay ipskay urrentcay orderway...
-STR_CAN_T_SKIP_TO_ORDER                                         :{WHITE}An'tcay ipskay otay electedsay orderway...
-STR_8837_CAN_T_MOVE_VEHICLE                                     :{WHITE}An'tcay ovemay ehiclevay...
-STR_REAR_ENGINE_FOLLOW_FRONT_ERROR                              :{WHITE}Ethay earray engineway illway alwaysway ollowfay itsway ontfray ounterpartcay
-STR_8838_N_A                                                    :Nay/Away{SKIP}
-STR_8839_CAN_T_SELL_RAILROAD_VEHICLE                            :{WHITE}An'tcay ellsay ailwayray ehiclevay...
-STR_883A_UNABLE_TO_FIND_ROUTE_TO                                :{WHITE}Unableway otay indfay outeray otay ocallay epotday
-STR_883B_CAN_T_STOP_START_TRAIN                                 :{WHITE}An'tcay opstay/artstay aintray...
-STR_883C_SERVICING_INTERVAL_DAYS                                :{BLACK}Ervicingsay intervalway: {LTBLUE}{COMMA}aysday{BLACK}   Astlay ervicesay: {LTBLUE}{DATE_LONG}
-STR_SERVICING_INTERVAL_PERCENT                                  :{BLACK}Ervicingsay intervalway: {LTBLUE}{COMMA}%{BLACK}   Astlay ervicesay: {LTBLUE}{DATE_LONG}
-STR_883D_TRAINS_CLICK_ON_TRAIN_FOR                              :{BLACK}Ainstray - ickclay onway aintray orfay informationway
-STR_883E_BUILD_NEW_TRAINS_REQUIRES                              :{BLACK}Uildbay ewnay ainstray (equiresray aintray epotday)
-STR_883F_TRAINS_CLICK_ON_TRAIN_FOR                              :{BLACK}Ainstray - ickclay onway aintray orfay infoway., agdray ehiclevay otay addway/emoveray omfray aintray
-STR_8840_BUILD_NEW_TRAIN_VEHICLE                                :{BLACK}Uildbay ewnay aintray ehiclevay
-STR_8841_DRAG_TRAIN_VEHICLE_TO_HERE                             :{BLACK}Agdray aintray ehiclevay otay erehay otay ellsay itway
-STR_8842_CENTER_MAIN_VIEW_ON_TRAIN                              :{BLACK}Entrecay ainmay iewvay onway aintray epotday ocationlay
-STR_8843_TRAIN_VEHICLE_SELECTION                                :{BLACK}Aintray ehiclevay electionsay istlay - ickclay onway ehiclevay orfay informationway
-STR_8844_BUILD_THE_HIGHLIGHTED_TRAIN                            :{BLACK}Uildbay ethay ighlightedhay aintray ehiclevay
-STR_8845_RENAME_TRAIN_VEHICLE_TYPE                              :{BLACK}Enameray aintray ehiclevay ypetay
-STR_8846_CURRENT_TRAIN_ACTION_CLICK                             :{BLACK}Urrentcay aintray actionway - ickclay erehay otay opstay/artstay aintray
-STR_8847_SHOW_TRAIN_S_ORDERS                                    :{BLACK}Owshay ain'stray ordersway
-STR_8848_CENTER_MAIN_VIEW_ON_TRAIN                              :{BLACK}Entrecay ainmay iewvay onway ain'stray ocationlay
-STR_8849_SEND_TRAIN_TO_DEPOT                                    :{BLACK}Endsay aintray otay epotday. CTRLay+ickclay illway onlyway ervicesay
-STR_884A_FORCE_TRAIN_TO_PROCEED                                 :{BLACK}Orcefay aintray otay oceedpray ithoutway aitingway orfay ignalsay otay earclay itway
-STR_884B_REVERSE_DIRECTION_OF_TRAIN                             :{BLACK}Everseray irectionday ofway aintray
-STR_884C_SHOW_TRAIN_DETAILS                                     :{BLACK}Owshay aintray etailsday
-STR_884D_INCREASE_SERVICING_INTERVAL                            :{BLACK}Increaseway ervicingsay intervalway
-STR_884E_DECREASE_SERVICING_INTERVAL                            :{BLACK}Ecreaseday ervicingsay intervalway
-STR_884F_SHOW_DETAILS_OF_CARGO_CARRIED                          :{BLACK}Owshay etailsday ofway argocay arriedcay
-STR_8850_SHOW_DETAILS_OF_TRAIN_VEHICLES                         :{BLACK}Owshay etailsday ofway aintray ehiclesvay
-STR_8851_SHOW_CAPACITIES_OF_EACH                                :{BLACK}Owshay apacitiescay ofway eachway ehiclevay
-STR_8852_SHOW_TOTAL_CARGO                                       :{BLACK}Owshay otaltay apacitycay ofway aintray, itsplay ybay argocay ypetay
-STR_8852_ORDERS_LIST_CLICK_ON_ORDER                             :{BLACK}Ordersway istlay - ickclay onway anway orderway otay ighlighthay itway. CTRLay + ickclay ollsscray otay ethay ationstay
-STR_8853_SKIP_THE_CURRENT_ORDER                                 :{BLACK}Ipskay ethay urrentcay orderway, andway artstay ethay extnay. CTRLay + ickclay ipsskay otay ethay electedsay orderway
-STR_8854_DELETE_THE_HIGHLIGHTED                                 :{BLACK}Eleteday ethay ighlightedhay orderway
-STR_8855_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Akemay ethay ighlightedhay orderway onnay-opstay
-STR_8856_INSERT_A_NEW_ORDER_BEFORE                              :{BLACK}Insertway away ewnay orderway eforebay ethay ighlightedhay orderway, orway addway otay endway ofway istlay
-STR_8857_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Akemay ethay ighlightedhay orderway orcefay ethay ehiclevay otay aitway orfay away ullfay oadlay
-STR_8858_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Akemay ethay ighlightedhay orderway orcefay ethay ehiclevay otay unloadway
-STR_TIMETABLE_TOOLTIP                                           :{BLACK}Imetabletay - ickclay onway anway orderway otay ighlighthay itway.
-STR_TIMETABLE_WAIT_TIME_TOOLTIP                                 :{BLACK}Angechay ethay amountway ofway imetay atthay ethay ighlightedhay orderway ouldshay aketay
-STR_TIMETABLE_CLEAR_TIME_TOOLTIP                                :{BLACK}Earclay ethay amountway ofway imetay orfay ethay ighlightedhay orderway
-STR_TIMETABLE_RESET_LATENESS_TOOLTIP                            :{BLACK}Esetray ethay atenesslay ountercay, osay ethay ehiclevay illway ebay onway imetay
-STR_SERVICE_HINT                                                :{BLACK}Ipskay isthay orderway unlessway away ervicesay isway eedednay
-STR_VEHICLE_INFO_COST_WEIGHT_SPEED_POWER                        :{BLACK}Ostcay: {CURRENCY} Eightway: {WEIGHT_S}{}Eedspay: {VELOCITY}  Owerpay: {POWER}{}Unningray Ostcay: {CURRENCY}/yray{}Apacitycay: {CARGO}
-STR_885C_BROKEN_DOWN                                            :{RED}Okenbray ownday
-STR_885D_AGE_RUNNING_COST_YR                                    :{BLACK}Ageway: {LTBLUE}{STRING}{BLACK}   Unningray Ostcay: {LTBLUE}{CURRENCY}/yray
-STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED                         :{BLACK}Eightway: {LTBLUE}{WEIGHT_S}  {BLACK}Owerpay: {LTBLUE}{POWER}{BLACK} Axmay. eedspay: {LTBLUE}{VELOCITY}
-STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE                  :{BLACK}Eightway: {LTBLUE}{WEIGHT_S} {BLACK}Owerpay: {LTBLUE}{POWER}{BLACK} Axmay. eedspay: {LTBLUE}{VELOCITY} {BLACK}Axmay. Tay.Eway.: {LTBLUE}{FORCE}
-STR_885F_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Ofitpray isthay earyay: {LTBLUE}{CURRENCY}  (astlay earyay: {CURRENCY})
-STR_8860_RELIABILITY_BREAKDOWNS                                 :{BLACK}Eliabilityray: {LTBLUE}{COMMA}%  {BLACK}Eakdownsbray incesay astlay ervicesay: {LTBLUE}{COMMA}
-STR_8861_STOPPED                                                :{RED}Oppedstay
-STR_8862_CAN_T_MAKE_TRAIN_PASS_SIGNAL                           :{WHITE}An'tcay akemay aintray asspay ignalsay atway angerday...
-STR_8863_CRASHED                                                :{RED}Ashedcray!
-
-STR_8865_NAME_TRAIN                                             :{WHITE}Amenay aintray
-STR_8866_CAN_T_NAME_TRAIN                                       :{WHITE}An'tcay amenay aintray...
-STR_8867_NAME_TRAIN                                             :{BLACK}Amenay aintray
-STR_8868_TRAIN_CRASH_DIE_IN_FIREBALL                            :{BLACK}{BIGFONT}Aintray Ashcray!{}{COMMA} ieday inway ireballfay afterway ollisioncay
-STR_8869_CAN_T_REVERSE_DIRECTION                                :{WHITE}An'tcay everseray irectionday ofway aintray...
-STR_886A_RENAME_TRAIN_VEHICLE_TYPE                              :{WHITE}Enameray aintray ehiclevay ypetay
-STR_886B_CAN_T_RENAME_TRAIN_VEHICLE                             :{WHITE}An'tcay enameray aintray ehiclevay ypetay...
-STR_886D_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Akemay ethay ighlightedhay orderway orcefay ethay ehiclevay otay umpday argocay
-STR_886F_TRANSFER                                               :{BLACK}Ansfertray
-STR_CLEAR_TIME                                                  :{BLACK}Angechay Imetay
-STR_RESET_LATENESS                                              :{BLACK}Esetray Atelay Ountercay
-
-STR_TRAIN_STOPPING                                              :{RED}Oppingstay
-STR_TRAIN_STOPPING_VEL                                          :{RED}Oppingstay, {VELOCITY}
-STR_INCOMPATIBLE_RAIL_TYPES                                     :Incompatibleway ailray ypestay
-STR_TRAIN_NO_POWER                                              :{RED}Onay owerpay
-STR_TRAIN_START_NO_CATENARY                                     :Isthay acktray ackslay atenarycay, osay ethay aintray an'tcay artstay
-
-STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}Ewnay {STRING} ownay availableway!
-STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{ENGINE}
-STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Ewnay {STRING} ownay availableway!  -  {ENGINE}
-
-STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Ancay otnay imetabletay ehiclevay...
-STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Ehiclesvay ancay onlyway aitway atway ationsstay.
-STR_TIMETABLE_NOT_STOPPING_HERE                                 :{WHITE}Isthay ehiclevay isway otnay oppingstay atway isthay ationstay.
-STR_TIMETABLE_CHANGE_TIME                                       :{BLACK}Angechay Imetay
-STR_TIMETABLE_STATUS_ON_TIME                                    :Isthay ehiclevay isway urrentlycay unningray onway imetay
-STR_TIMETABLE_STATUS_LATE                                       :Isthay ehiclevay isway urrentlycay unningray {STRING} atelay
-STR_TIMETABLE_STATUS_EARLY                                      :Isthay ehiclevay isway urrentlycay unningray {STRING} earlyway
-STR_TIMETABLE_TOTAL_TIME                                        :Isthay imetabletay illway aketay {STRING} otay ompletecay
-STR_TIMETABLE_TOTAL_TIME_INCOMPLETE                             :Isthay imetabletay illway aketay atway eastlay {STRING} otay ompletecay (otnay allway imetabledtay)
-STR_TIMETABLE_AUTOFILL                                          :{BLACK}Autofillway
-STR_TIMETABLE_AUTOFILL_TOOLTIP                                  :{BLACK}Fill thIllfay ethay imetabletay automaticallyway ithway ethay aluesvay omfray ethay irstfay ourneyjay
-
-##id 0x9000
-STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Oadray ehiclevay inway ethay ayway
-STR_9001_ROAD_VEHICLES                                          :{WHITE}{COMPANY} - {COMMA} Oadray Ehicle{P "" s}vay
-STR_9002                                                        :{WHITE}{VEHICLE}
-STR_9003_ROAD_VEHICLE_DEPOT                                     :{WHITE}{TOWN} Oadray Ehiclevay Epotday
-STR_9004_NEW_VEHICLES                                           :{BLACK}Ewnay Ehiclesvay
-STR_9006_NEW_ROAD_VEHICLES                                      :{WHITE}Ewnay Oadray Ehiclesvay
-STR_9007_BUILD_VEHICLE                                          :{BLACK}Uildbay Ehiclevay
-STR_9009_CAN_T_BUILD_ROAD_VEHICLE                               :{WHITE}An'tcay uildbay oadray ehiclevay...
-STR_900C_DETAILS                                                :{WHITE}{VEHICLE} (Etailsday)
-STR_900D_AGE_RUNNING_COST_YR                                    :{BLACK}Ageway: {LTBLUE}{STRING}{BLACK}   Unningray Ostcay: {LTBLUE}{CURRENCY}/yray
-STR_900E_MAX_SPEED                                              :{BLACK}Axmay. eedspay: {LTBLUE}{VELOCITY}
-STR_900F_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Ofitpray isthay earyay: {LTBLUE}{CURRENCY}  (astlay earyay: {CURRENCY})
-STR_9010_RELIABILITY_BREAKDOWNS                                 :{BLACK}Eliabilityray: {LTBLUE}{COMMA}%  {BLACK}Eakdownsbray incesay astlay ervicesay: {LTBLUE}{COMMA}
-STR_9011_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Uiltbay: {LTBLUE}{NUM}{BLACK} Aluevay: {LTBLUE}{CURRENCY}
-STR_9012_CAPACITY                                               :{BLACK}Apacitycay: {LTBLUE}{CARGO}
-STR_9013_MUST_BE_STOPPED_INSIDE                                 :{WHITE}...ustmay ebay oppedstay insideway away oadray ehiclevay epotday
-STR_9014_CAN_T_SELL_ROAD_VEHICLE                                :{WHITE}An'tcay ellsay oadray ehiclevay...
-STR_9015_CAN_T_STOP_START_ROAD_VEHICLE                          :{WHITE}An'tcay opstay/artstay oadray ehiclevay...
-STR_9016_ROAD_VEHICLE_IS_WAITING                                :{WHITE}Oadray ehiclevay {COMMA} isway aitingway inway epotday
-STR_HEADING_FOR_ROAD_DEPOT                                      :{ORANGE}Eadinghay orfay {TOWN} Oadray Epotday
-STR_HEADING_FOR_ROAD_DEPOT_VEL                                  :{ORANGE}Eadinghay orfay {TOWN} Oadray Epotday, {VELOCITY}
-STR_HEADING_FOR_ROAD_DEPOT_SERVICE                              :{LTBLUE}Ervicesay atway {TOWN} Oadray Epotday
-STR_HEADING_FOR_ROAD_DEPOT_SERVICE_VEL                          :{LTBLUE}Ervicesay atway {TOWN} Oadray Epotday, {VELOCITY}
-STR_9018_CAN_T_SEND_VEHICLE_TO_DEPOT                            :{WHITE}An'tcay endsay ehiclevay otay epotday...
-STR_9019_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Unableway otay indfay ocallay epotday
-STR_901A_ROAD_VEHICLES_CLICK_ON                                 :{BLACK}Oadray ehiclesvay - ickclay onway ehiclevay orfay informationway
-STR_901B_BUILD_NEW_ROAD_VEHICLES                                :{BLACK}Uildbay ewnay oadray ehiclesvay (equiresray oadray ehiclevay epotday)
-STR_901C_CURRENT_VEHICLE_ACTION                                 :{BLACK}Urrentcay ehiclevay actionway - ickclay erehay otay opstay/artstay ehiclevay
-STR_901D_SHOW_VEHICLE_S_ORDERS                                  :{BLACK}Owshay ehicle'svay ordersway
-STR_901E_CENTER_MAIN_VIEW_ON_VEHICLE                            :{BLACK}Entrecay ainmay iewvay onway ehicle'svay ocationlay
-STR_901F_SEND_VEHICLE_TO_DEPOT                                  :{BLACK}Endsay ehiclevay otay epotday. CTRLay+ickclay illway onlyway ervicesay
-STR_9020_FORCE_VEHICLE_TO_TURN_AROUND                           :{BLACK}Orcefay ehiclevay otay urntay aroundway
-STR_9021_SHOW_ROAD_VEHICLE_DETAILS                              :{BLACK}Owshay oadray ehiclevay etailsday
-STR_9022_VEHICLES_CLICK_ON_VEHICLE                              :{BLACK}Ehiclesvay - ickclay onway ehiclevay orfay informationway
-STR_9023_BUILD_NEW_ROAD_VEHICLE                                 :{BLACK}Uildbay ewnay oadray ehiclevay
-STR_9024_DRAG_ROAD_VEHICLE_TO_HERE                              :{BLACK}Agdray oadray ehiclevay otay erehay otay ellsay itway
-STR_9025_CENTER_MAIN_VIEW_ON_ROAD                               :{BLACK}Entrecay ainmay iewvay onway oadray ehiclevay epotday ocationlay
-STR_9026_ROAD_VEHICLE_SELECTION                                 :{BLACK}Oadray ehiclevay electionsay istlay - ickclay onway ehiclevay orfay informationway
-STR_9027_BUILD_THE_HIGHLIGHTED_ROAD                             :{BLACK}Uildbay ethay ighlightedhay oadray ehiclevay
-STR_902A_COST_SPEED_RUNNING_COST                                :{BLACK}Ostcay: {CURRENCY}{}Eedspay: {VELOCITY}{}Unningray Ostcay: {CURRENCY}/yray{}Apacitycay: {CARGO}
-STR_ARTICULATED_RV_CAPACITY                                     :{BLACK}Apacitycay: {LTBLUE}
-STR_BARE_CARGO                                                  :{CARGO}
-
-STR_902C_NAME_ROAD_VEHICLE                                      :{WHITE}Amenay oadray ehiclevay
-STR_902D_CAN_T_NAME_ROAD_VEHICLE                                :{WHITE}An'tcay amenay oadray ehiclevay...
-STR_902E_NAME_ROAD_VEHICLE                                      :{BLACK}Amenay oadray ehiclevay
-STR_902F_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay usbay arrivesway atway {STATION}!
-STR_9030_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay ucktray arrivesway atway {STATION}!
-STR_902F_CITIZENS_CELEBRATE_FIRST_TRAM                          :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay assengerpay amtray arrivesway atway {STATION}!
-STR_9030_CITIZENS_CELEBRATE_FIRST_TRAM                          :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay eightfray amtray arrivesway atway {STATION}!
-STR_9031_ROAD_VEHICLE_CRASH_DRIVER                              :{BLACK}{BIGFONT}Oadray Ehiclevay Ashcray!{}Iverdray iesday inway ireballfay afterway ollisioncay ithway aintray
-STR_9032_ROAD_VEHICLE_CRASH_DIE                                 :{BLACK}{BIGFONT}Oadray Ehiclevay Ashcray!{}{COMMA} ieday inway ireballfay afterway ollisioncay ithway aintray
-STR_9033_CAN_T_MAKE_VEHICLE_TURN                                :{WHITE}An'tcay akemay ehiclevay urntay aroundway...
-STR_ONLY_TURN_SINGLE_UNIT                                       :{WHITE}An'tcay urntay ehiclesvay onsistingcay ofway ultiplemay unitsway
-STR_9034_RENAME                                                 :{BLACK}Enameray
-STR_9035_RENAME_ROAD_VEHICLE_TYPE                               :{BLACK}Enameray oadray ehiclevay ypetay
-STR_9036_RENAME_ROAD_VEHICLE_TYPE                               :{WHITE}Enameray oadray ehiclevay ypetay
-STR_9037_CAN_T_RENAME_ROAD_VEHICLE                              :{WHITE}An'tcay enameray oadray ehiclevay ypetay...
-STR_9038_GO_TO_ROADVEH_DEPOT                                    :Ogay otay {TOWN} Oadray Ehiclevay Epotday
-STR_SERVICE_AT_ROADVEH_DEPOT                                    :Ervicesay atway {TOWN} Oadray Ehiclevay Epotday
-
-STR_REFIT_ROAD_VEHICLE_TO_CARRY                                 :{BLACK}Efitray oadray ehiclevay otay arrycay away ifferentday argocay ypetay
-STR_REFIT_ROAD_VEHICLE                                          :{BLACK}Efitray oadray ehiclevay
-STR_REFIT_ROAD_VEHICLE_TO_CARRY_HIGHLIGHTED                     :{BLACK}Efitray oadray ehiclevay otay arrycay ighlightedhay argocay ypetay
-STR_REFIT_ROAD_VEHICLE_CAN_T                                    :{WHITE}An'tcay efitray oadray ehiclevay...
-STR_ROAD_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Electsay ypetay ofway argocay orfay oadray ehiclevay otay arrycay
-
-##id 0x9800
-STR_9800_DOCK_CONSTRUCTION                                      :Ockday onstructioncay
-STR_9801_DOCK_CONSTRUCTION                                      :{WHITE}Ockday onstructioncay
-STR_9802_CAN_T_BUILD_DOCK_HERE                                  :{WHITE}An'tcay uildbay ockday erehay...
-STR_9803_SHIP_DEPOT                                             :{WHITE}{TOWN} Ipshay Epotday
-STR_9804_NEW_SHIPS                                              :{BLACK}Ewnay Ipsshay
-STR_9805_SHIPS                                                  :{WHITE}{COMPANY} - {COMMA} Ip{P "" s}shay
-STR_9808_NEW_SHIPS                                              :{WHITE}Ewnay Ipsshay
-STR_9809_BUILD_SHIP                                             :{BLACK}Uildbay Ipshay
-STR_CLONE_SHIP                                                  :{BLACK}Oneclay Ipshay
-STR_CLONE_SHIP_INFO                                             :{BLACK}Isthay illway uildbay away opycay ofway ethay ipshay. Ontrolcay-ickclay illway areshay ethay ordersway
-STR_CLONE_SHIP_DEPOT_INFO                                       :{BLACK}Isthay illway uildbay away opycay ofway away ipshay. Ickclay isthay uttonbay andway enthay onway away ipshay insideway orway outsideway ethay epotday. Ontrolcay-ickclay illway areshay ethay ordersway
-STR_980B_SHIP_MUST_BE_STOPPED_IN                                :{WHITE}Ipshay ustmay ebay oppedstay inway epotday
-STR_980C_CAN_T_SELL_SHIP                                        :{WHITE}An'tcay ellsay ipshay...
-STR_980D_CAN_T_BUILD_SHIP                                       :{WHITE}An'tcay uildbay ipshay...
-STR_980E_SHIP_IN_THE_WAY                                        :{WHITE}Ipshay inway ethay ayway
-STR_980F                                                        :{WHITE}{VEHICLE}
-STR_9811_DETAILS                                                :{WHITE}{VEHICLE} (Etailsday)
-STR_9812_AGE_RUNNING_COST_YR                                    :{BLACK}Ageway: {LTBLUE}{STRING}{BLACK}   Unningray Ostcay: {LTBLUE}{CURRENCY}/yray
-STR_9813_MAX_SPEED                                              :{BLACK}Axmay. eedspay: {LTBLUE}{VELOCITY}
-STR_9814_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Ofitpray isthay earyay: {LTBLUE}{CURRENCY}  (astlay earyay: {CURRENCY})
-STR_9815_RELIABILITY_BREAKDOWNS                                 :{BLACK}Eliabilityray: {LTBLUE}{COMMA}%  {BLACK}Eakdownsbray incesay astlay ervicesay: {LTBLUE}{COMMA}
-STR_9816_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Uiltbay: {LTBLUE}{NUM}{BLACK} Aluevay: {LTBLUE}{CURRENCY}
-STR_9817_CAPACITY                                               :{BLACK}Apacitycay: {LTBLUE}{CARGO}
-STR_9818_CAN_T_STOP_START_SHIP                                  :{WHITE}An'tcay opstay/artstay ipshay...
-STR_9819_CAN_T_SEND_SHIP_TO_DEPOT                               :{WHITE}An'tcay endsay ipshay otay epotday...
-STR_981A_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Unableway otay indfay ocallay epotday
-STR_HEADING_FOR_SHIP_DEPOT                                      :{ORANGE}Eadinghay orfay {TOWN} Ipshay Epotday
-STR_HEADING_FOR_SHIP_DEPOT_VEL                                  :{ORANGE}Eadinghay orfay {TOWN} Ipshay Epotday, {VELOCITY}
-STR_HEADING_FOR_SHIP_DEPOT_SERVICE                              :{LTBLUE}Ervicesay atway {TOWN} Ipshay Epotday
-STR_HEADING_FOR_SHIP_DEPOT_SERVICE_VEL                          :{LTBLUE}Ervicesay atway {TOWN} Ipshay Epotday, {VELOCITY}
-STR_981C_SHIP_IS_WAITING_IN_DEPOT                               :{WHITE}Ipshay {COMMA} isway aitingway inway epotday
-STR_981D_BUILD_SHIP_DOCK                                        :{BLACK}Uildbay ipshay ockday
-STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING                          :{BLACK}Uildbay ipshay epotday (orfay uildingbay andway ervicingsay ipsshay)
-STR_981F_SHIPS_CLICK_ON_SHIP_FOR                                :{BLACK}Ipsshay - ickclay onway ipshay orfay informationway
-STR_9820_BUILD_NEW_SHIP                                         :{BLACK}Uildbay ewnay ipshay
-STR_9821_DRAG_SHIP_TO_HERE_TO_SELL                              :{BLACK}Agdray ipshay otay erehay otay ellsay itway
-STR_9822_CENTER_MAIN_VIEW_ON_SHIP                               :{BLACK}Entrecay ainmay iewvay onway ipshay epotday ocationlay
-STR_9823_SHIPS_CLICK_ON_SHIP_FOR                                :{BLACK}Ipsshay - ickclay onway ipshay orfay informationway
-STR_9824_BUILD_NEW_SHIPS_REQUIRES                               :{BLACK}Uildbay ewnay ipsshay (equiresray ipshay epotday)
-STR_9825_SHIP_SELECTION_LIST_CLICK                              :{BLACK}Ipshay electionsay istlay - ickclay onway ipshay orfay informationway
-STR_9826_BUILD_THE_HIGHLIGHTED_SHIP                             :{BLACK}Uildbay ethay ighlightedhay ipshay
-STR_9827_CURRENT_SHIP_ACTION_CLICK                              :{BLACK}Urrentcay ipshay actionway - ickclay erehay otay opstay/artstay ipshay
-STR_9828_SHOW_SHIP_S_ORDERS                                     :{BLACK}Owshay ip'sshay ordersway
-STR_9829_CENTER_MAIN_VIEW_ON_SHIP                               :{BLACK}Entrecay ainmay iewvay onway ip'sshay ocationlay
-STR_982A_SEND_SHIP_TO_DEPOT                                     :{BLACK}Endsay ipshay otay epotday. CTRLay+ickclay illway onlyway ervicesay
-STR_982B_SHOW_SHIP_DETAILS                                      :{BLACK}Owshay ipshay etailsday
-STR_982E_COST_MAX_SPEED_CAPACITY                                :{BLACK}Ostcay: {CURRENCY} Axmay. Eedspay: {VELOCITY}{}Apacitycay: {CARGO}{}Unningray Ostcay: {CURRENCY}/yray
-STR_982F_NAME_SHIP                                              :{BLACK}Amenay ipshay
-
-STR_9831_NAME_SHIP                                              :{WHITE}Amenay ipshay
-STR_9832_CAN_T_NAME_SHIP                                        :{WHITE}An'tcay amenay ipshay...
-STR_9833_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay ipshay arrivesway atway {STATION}!
-STR_9834_POSITION_BUOY_WHICH_CAN                                :{BLACK}Aceplay away uoybay ichwhay ancay ebay usedway asway away aypointway
-STR_9835_CAN_T_POSITION_BUOY_HERE                               :{WHITE}An'tcay aceplay uoybay erehay...
-STR_9836_RENAME                                                 :{BLACK}Enameray
-STR_9837_RENAME_SHIP_TYPE                                       :{BLACK}Enameray ipshay ypetay
-STR_9838_RENAME_SHIP_TYPE                                       :{WHITE}Enameray ipshay ypetay
-STR_9839_CAN_T_RENAME_SHIP_TYPE                                 :{WHITE}An'tcay enameray ipshay ypetay...
-STR_983A_REFIT_CARGO_SHIP_TO_CARRY                              :{BLACK}Efitray argocay ipshay otay arrycay away ifferentday argocay ypetay
-STR_983B_REFIT                                                  :{WHITE}{VEHICLE} (Efitray)
-STR_983C_REFIT_SHIP                                             :{BLACK}Efitray ipshay
-STR_983D_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Electsay ypetay ofway argocay orfay ipshay otay arrycay
-STR_983E_REFIT_SHIP_TO_CARRY_HIGHLIGHTED                        :{BLACK}Efitray ipshay otay arrycay ighlightedhay argocay ypetay
-STR_983F_SELECT_CARGO_TYPE_TO_CARRY                             :{GOLD}Electsay argocay ypetay otay arrycay:
-STR_9840_NEW_CAPACITY_COST_OF_REFIT                             :{BLACK}Ewnay apacitycay: {GOLD}{CARGO}{}{BLACK}Ostcay ofway efitray: {GOLD}{CURRENCY}
-STR_9841_CAN_T_REFIT_SHIP                                       :{WHITE}An'tcay efitray ipshay...
-STR_9842_REFITTABLE                                             :(efittableray)
-STR_GO_TO_SHIP_DEPOT                                            :Ogay otay {TOWN} Ipshay Epotday
-SERVICE_AT_SHIP_DEPOT                                           :Ervicesay atway {TOWN} Ipshay Epotday
-
-##id 0xA000
-STR_A000_AIRPORTS                                               :{WHITE}Airportsway
-STR_A001_CAN_T_BUILD_AIRPORT_HERE                               :{WHITE}An'tcay uildbay airportway erehay...
-STR_A002_AIRCRAFT_HANGAR                                        :{WHITE}{STATION} Aircraftway Angarhay
-STR_A003_NEW_AIRCRAFT                                           :{BLACK}Ewnay Aircraftway
-STR_CLONE_AIRCRAFT                                              :{BLACK}Oneclay Aircraftway
-STR_CLONE_AIRCRAFT_INFO                                         :{BLACK}Isthay illway uildbay away opycay ofway ethay aircraftway. Ontrolcay-ickclay illway areshay ethay ordersway
-STR_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW                           :{BLACK}Isthay illway uildbay away opycay ofway anway aircraftway. Ickclay isthay uttonbay andway enthay onway anway aircraftway insideway orway outsideway ethay angarhay. Ontrolcay-ickclay illway areshay ethay ordersway
-STR_A005_NEW_AIRCRAFT                                           :{WHITE}Ewnay Aircraftway
-STR_A006_BUILD_AIRCRAFT                                         :{BLACK}Uildbay Aircraftway
-STR_A008_CAN_T_BUILD_AIRCRAFT                                   :{WHITE}An'tcay uildbay aircraftway...
-STR_A009_AIRCRAFT                                               :{WHITE}{COMPANY} - {COMMA} Aircraftway
-STR_A00A                                                        :{WHITE}{VEHICLE}
-STR_A00B_ORDERS                                                 :{WHITE}{VEHICLE} (Ordersway)
-STR_A00C_DETAILS                                                :{WHITE}{VEHICLE} (Etailsday)
-STR_A00D_AGE_RUNNING_COST_YR                                    :{BLACK}Ageway: {LTBLUE}{STRING}{BLACK}   Unningray Ostcay: {LTBLUE}{CURRENCY}/yray
-STR_A00E_MAX_SPEED                                              :{BLACK}Axmay. eedspay: {LTBLUE}{VELOCITY}
-STR_A00F_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Ofitpray isthay earyay: {LTBLUE}{CURRENCY}  (astlay earyay: {CURRENCY})
-STR_A010_RELIABILITY_BREAKDOWNS                                 :{BLACK}Eliabilityray: {LTBLUE}{COMMA}%  {BLACK}Eakdownsbray incesay astlay ervicesay: {LTBLUE}{COMMA}
-STR_A011_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Uiltbay: {LTBLUE}{NUM}{BLACK} Aluevay: {LTBLUE}{CURRENCY}
-STR_A012_CAN_T_SEND_AIRCRAFT_TO                                 :{WHITE}An'tcay endsay aircraftway otay angarhay...
-STR_HEADING_FOR_HANGAR                                          :{ORANGE}Eadinghay orfay {STATION} Angarhay
-STR_HEADING_FOR_HANGAR_VEL                                      :{ORANGE}Eadinghay orfay {STATION} Angarhay, {VELOCITY}
-STR_HEADING_FOR_HANGAR_SERVICE                                  :{LTBLUE}Ervicesay atway {STATION} Angarhay
-STR_HEADING_FOR_HANGAR_SERVICE_VEL                              :{LTBLUE}Ervicesay atway {STATION} Angarhay, {VELOCITY}
-STR_A014_AIRCRAFT_IS_WAITING_IN                                 :{WHITE}Aircraftway {COMMA} isway aitingway inway ethay aircraftway angarhay
-STR_A015_AIRCRAFT_IN_THE_WAY                                    :{WHITE}Aircraftway inway ethay ayway
-STR_A016_CAN_T_STOP_START_AIRCRAFT                              :{WHITE}An'tcay opstay/artstay aircraftway...
-STR_A017_AIRCRAFT_IS_IN_FLIGHT                                  :{WHITE}Aircraftway isway inway ightflay
-STR_A019_CAPACITY                                               :{BLACK}Apacitycay: {LTBLUE}{CARGO}, {CARGO}
-STR_A01A_CAPACITY                                               :{BLACK}Apacitycay: {LTBLUE}{CARGO}
-STR_A01B_AIRCRAFT_MUST_BE_STOPPED                               :{WHITE}Aircraftway ustmay ebay oppedstay inway angarhay
-STR_A01C_CAN_T_SELL_AIRCRAFT                                    :{WHITE}An'tcay ellsay aircraftway...
-STR_A01D_AIRPORT_CONSTRUCTION                                   :Airportway onstructioncay
-STR_A01E_BUILD_AIRPORT                                          :{BLACK}Uildbay airportway
-STR_A01F_AIRCRAFT_CLICK_ON_AIRCRAFT                             :{BLACK}Aircraftway - ickclay onway aircraftway orfay informationway
-STR_A020_BUILD_NEW_AIRCRAFT_REQUIRES                            :{BLACK}Uildbay ewnay aircraftway (equiresray airportway ithway angarhay)
-STR_A021_AIRCRAFT_CLICK_ON_AIRCRAFT                             :{BLACK}Aircraftway - ickclay onway aircraftway orfay informationway
-STR_A022_BUILD_NEW_AIRCRAFT                                     :{BLACK}Uildbay ewnay aircraftway
-STR_A023_DRAG_AIRCRAFT_TO_HERE_TO                               :{BLACK}Agdray aircraftway otay erehay otay ellsay itway
-STR_A024_CENTER_MAIN_VIEW_ON_HANGAR                             :{BLACK}Entrecay ainmay iewvay onway angarhay ocationlay
-STR_A025_AIRCRAFT_SELECTION_LIST                                :{BLACK}Aircraftway electionsay istlay - ickclay onway aircraftway orfay informationway
-STR_A026_BUILD_THE_HIGHLIGHTED_AIRCRAFT                         :{BLACK}Uildbay ethay ighlightedhay aircraftway
-STR_A027_CURRENT_AIRCRAFT_ACTION                                :{BLACK}Urrentcay aircraftway actionway - ickclay erehay otay opstay/artstay aircraftway
-STR_A028_SHOW_AIRCRAFT_S_ORDERS                                 :{BLACK}Owshay aircraft'sway ordersway
-STR_A029_CENTER_MAIN_VIEW_ON_AIRCRAFT                           :{BLACK}Entrecay ainmay iewvay onway aircraft'sway ocationlay
-STR_A02A_SEND_AIRCRAFT_TO_HANGAR                                :{BLACK}Endsay aircraftway otay angarhay. CTRLay+ickclay illway onlyway ervicesay
-STR_A02B_SHOW_AIRCRAFT_DETAILS                                  :{BLACK}Owshay aircraftway etailsday
-STR_A02E_COST_MAX_SPEED_CAPACITY                                :{BLACK}Ostcay: {CURRENCY} Axmay. Eedspay: {VELOCITY}{}Apacitycay: {COMMA} assengerspay, {COMMA} agsbay ofway ailmay{}Unningray Ostcay: {CURRENCY}/yray
-
-STR_A030_NAME_AIRCRAFT                                          :{WHITE}Amenay aircraftway
-STR_A031_CAN_T_NAME_AIRCRAFT                                    :{WHITE}An'tcay amenay aircraftway...
-STR_A032_NAME_AIRCRAFT                                          :{BLACK}Amenay aircraftway
-STR_A033_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay aircraftway arrivesway atway {STATION}!
-STR_A034_PLANE_CRASH_DIE_IN_FIREBALL                            :{BLACK}{BIGFONT}Aneplay Ashcray!{}{COMMA} ieday inway ireballfay atway {STATION}
-STR_PLANE_CRASH_OUT_OF_FUEL                                     :{BLACK}{BIGFONT}Aneplay Ashcray!{}Aircraftway anray outway ofway uelfay, {COMMA} ieday inway ireballfay!
-STR_A036                                                        :{TINYFONT}{BLACK}{STATION}
-STR_A037_RENAME                                                 :{BLACK}Enameray
-STR_A038_RENAME_AIRCRAFT_TYPE                                   :{BLACK}Enameray aircraftway ypetay
-STR_A039_RENAME_AIRCRAFT_TYPE                                   :{WHITE}Enameray aircraftway ypetay
-STR_A03A_CAN_T_RENAME_AIRCRAFT_TYPE                             :{WHITE}An'tcay enameray aircraftway ypetay...
-STR_A03B_REFIT_AIRCRAFT_TO_CARRY                                :{BLACK}Efitray aircraftway otay arrycay away ifferentday argocay ypetay
-STR_A03C_REFIT                                                  :{WHITE}{VEHICLE} (Efitray)
-STR_A03D_REFIT_AIRCRAFT                                         :{BLACK}Efitray aircraftway
-STR_A03E_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Electsay ypetay ofway argocay orfay aircraftway otay arrycay
-STR_A03F_REFIT_AIRCRAFT_TO_CARRY                                :{BLACK}Efitray aircraftway otay arrycay ighlightedhay argocay ypetay
-STR_A040_SELECT_CARGO_TYPE_TO_CARRY                             :{GOLD}Electsay argocay ypetay otay arrycay:
-STR_A041_NEW_CAPACITY_COST_OF_REFIT                             :{BLACK}Ewnay apacitycay: {GOLD}{STRING}{}{BLACK}Ostcay ofway efitray: {GOLD}{CURRENCY}
-STR_A042_CAN_T_REFIT_AIRCRAFT                                   :{WHITE}An'tcay efitray aircraftway...
-STR_GO_TO_AIRPORT_HANGAR                                        :Ogay otay {STATION} Angarhay
-SERVICE_AT_AIRPORT_HANGAR                                       :Ervicesay atway {STATION} Angarhay
-
-STR_TIMETABLE_TITLE                                             :{WHITE}{VEHICLE} (Imetabletay)
-
-##id 0xB000
-STR_B000_ZEPPELIN_DISASTER_AT                                   :{BLACK}{BIGFONT}Eppelinzay isasterday atway {STATION}!
-STR_B001_ROAD_VEHICLE_DESTROYED                                 :{BLACK}{BIGFONT}Oadray ehiclevay estroyedday inway 'UFO'WAY ollisioncay!
-STR_B002_OIL_REFINERY_EXPLOSION                                 :{BLACK}{BIGFONT}Oilway efineryray explosionway earnay {TOWN}!
-STR_B003_FACTORY_DESTROYED_IN_SUSPICIOUS                        :{BLACK}{BIGFONT}Actoryfay estroyedday inway uspicioussay ircumstancescay earnay {TOWN}!
-STR_B004_UFO_LANDS_NEAR                                         :{BLACK}{BIGFONT}'UFO'WAY andslay earnay {TOWN}!
-STR_B005_COAL_MINE_SUBSIDENCE_LEAVES                            :{BLACK}{BIGFONT}Oalcay inemay ubsidencesay eaveslay ailtray ofway estructionday earnay {TOWN}!
-STR_B006_FLOOD_VEHICLE_DESTROYED                                :{BLACK}{BIGFONT}Oodsflay!{}Atway eastlay {COMMA} issingmay, esumedpray eadday afterway ignificantsay oodingflay!
-
-STR_BRIBE_FAILED                                                :{WHITE}Ouryay attemptedway ibebray ashay eenbay
-STR_BRIBE_FAILED_2                                              :{WHITE}iscoveredday ybay away egionalray investigatorway
-STR_BUILD_DATE                                                  :{BLACK}Uiltbay: {LTBLUE}{DATE_LONG}
-
-STR_PERFORMANCE_DETAIL                                          :{WHITE}Etailedday erformancepay atingray
-STR_PERFORMANCE_DETAIL_KEY                                      :{BLACK}Etailday
-STR_PERFORMANCE_DETAIL_AMOUNT_CURRENCY                          :{BLACK}({CURRCOMPACT}/{CURRCOMPACT})
-STR_PERFORMANCE_DETAIL_AMOUNT_INT                               :{BLACK}({COMMA}/{COMMA})
-STR_PERFORMANCE_DETAIL_PERCENT                                  :{WHITE}{NUM}%
-SET_PERFORMANCE_DETAIL_INT                                      :{BLACK}{NUM}
-############ Those following lines need to be in this order!!
-STR_PERFORMANCE_DETAIL_VEHICLES                                 :{BLACK}Ehiclesvay:
-STR_PERFORMANCE_DETAIL_STATIONS                                 :{BLACK}Ationsstay:
-STR_PERFORMANCE_DETAIL_MIN_PROFIT                               :{BLACK}Inmay. ofitpray:
-STR_PERFORMANCE_DETAIL_MIN_INCOME                               :{BLACK}Inmay. incomeway:
-STR_PERFORMANCE_DETAIL_MAX_INCOME                               :{BLACK}Axmay. incomeway:
-STR_PERFORMANCE_DETAIL_DELIVERED                                :{BLACK}Eliveredday:
-STR_PERFORMANCE_DETAIL_CARGO                                    :{BLACK}Argocay:
-STR_PERFORMANCE_DETAIL_MONEY                                    :{BLACK}Oneymay:
-STR_PERFORMANCE_DETAIL_LOAN                                     :{BLACK}Oanlay:
-STR_PERFORMANCE_DETAIL_TOTAL                                    :{BLACK}Otaltay:
-############ End of order list
-STR_PERFORMANCE_DETAIL_VEHICLES_TIP                             :{BLACK}Umbernay ofway ehiclesvay; isthay includesway oadray ehiclesvay, ainstray, ipsshay andway aircraftway
-STR_PERFORMANCE_DETAIL_STATIONS_TIP                             :{BLACK}Umbernay ofway ationstay artspay. Everyway artpay ofway away ationstay (eway.gay. aintray ationstay, usbay opstay, airportway) isway ountedcay, evenway ifway eythay areway onnectedcay asway oneway ationstay
-STR_PERFORMANCE_DETAIL_MIN_PROFIT_TIP                           :{BLACK}Ethay ofitpray ofway ethay ehiclevay ithway ethay owestlay incomeway (ofway allway ehiclesvay olderway anthay 2 earsyay)
-STR_PERFORMANCE_DETAIL_MIN_INCOME_TIP                           :{BLACK}Amountway ofway ashcay ademay inway ethay onthmay ithway ethay owestlay ofitpray ofway ethay astlay 12 artersquay
-STR_PERFORMANCE_DETAIL_MAX_INCOME_TIP                           :{BLACK}Amountway ofway ashcay ademay inway ethay onthmay ithway ethay ighesthay ofitpray ofway ethay astlay 12 artersquay
-STR_PERFORMANCE_DETAIL_DELIVERED_TIP                            :{BLACK}Unitsway ofway argocay eliveredday inway ethay astlay ourfay artersquay
-STR_PERFORMANCE_DETAIL_CARGO_TIP                                :{BLACK}Umbernay ofway ypestay ofway argocay eliveredday inway ethay astlay arterquay
-STR_PERFORMANCE_DETAIL_MONEY_TIP                                :{BLACK}Amountway ofway oneymay isthay ompanycay ashay inway ethay ankbay
-STR_PERFORMANCE_DETAIL_LOAN_TIP                                 :{BLACK}Ethay amountway ofway oneymay isthay ompanycay ashay akentay onway oanlay
-STR_PERFORMANCE_DETAIL_TOTAL_TIP                                :{BLACK}Otaltay ointspay outway ofway ossiblepay ointspay
-
-STR_NEWGRF_SETTINGS_BUTTON                                      :{BLACK}EwGRFnay Ettingssay
-STR_NEWGRF_SETTINGS_CAPTION                                     :{WHITE}EwGRFnay ettingssay
-STR_NEWGRF_APPLY_CHANGES                                        :{BLACK}Applyway angeschay
-STR_NEWGRF_SET_PARAMETERS                                       :{BLACK}Etsay arameterspay
-STR_NEWGRF_TIP                                                  :{BLACK}Away istlay ofway allway ethay Ewgrfnay etssay atthay ouyay avehay installedway. Ickclay away etsay otay angechay ethay ettingssay
-STR_NEWGRF_NO_FILES_INSTALLED                                   :{BLACK}Erethay areway urrentlycay onay ewgrfnay ilesfay installedway! Easeplay eferray otay ethay anualmay orfay instructionsway onway installingway ewnay aphicsgray
-STR_NEWGRF_FILENAME                                             :{BLACK}Ilenamefay: {SILVER}{STRING}
-STR_NEWGRF_GRF_ID                                               :{BLACK}GRFay IDWAY: {SILVER}{STRING}
-STR_NEWGRF_MD5SUM                                               :{BLACK}MDay5umsay: {SILVER}{STRING}
-STR_NEWGRF_CONFIRMATION_TEXT                                    :{YELLOW}Ouyay areway aboutway otay akemay angeschay otay away unningray amegay; isthay ancay ashcray OpenTTDWAY.{}Areway ouyay absolutelyway uresay aboutway isthay?
-
-STR_NEWGRF_ERROR_MSG_INFO                                       :{SILVER}{STRING}
-STR_NEWGRF_ERROR_MSG_WARNING                                    :{RED}Arningway: {SILVER}{STRING}
-STR_NEWGRF_ERROR_MSG_ERROR                                      :{RED}Errorway: {SILVER}{STRING}
-STR_NEWGRF_ERROR_MSG_FATAL                                      :{RED}Atalfay: {SILVER}{STRING}
-STR_NEWGRF_ERROR_VERSION_NUMBER                                 :{STRING} illway otnay orkway ithway ethay AtchtTDPay ersionvay eportedray ybay OpenTTDWAY.
-STR_NEWGRF_ERROR_DOS_OR_WINDOWS                                 :{STRING} isway orfay ethay {STRING} ersionvay ofway TTDay.
-STR_NEWGRF_ERROR_UNSET_SWITCH                                   :{STRING} isway esignedday otay ebay usedway ithway {STRING}
-STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Invalidway arameterpay orfay {STRING}: arameterpay {STRING} ({NUM})
-STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} ustmay ebay oadedlay eforebay {STRING}.
-STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} ustmay ebay oadedlay afterway {STRING}.
-STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :ethay GRFay ilefay itway asway esignedday otay anslatetray
-
-STR_NEWGRF_ADD                                                  :{BLACK}Addway
-STR_NEWGRF_ADD_TIP                                              :{BLACK}Addway away EwGRFnay ilefay otay ethay istlay
-STR_NEWGRF_REMOVE                                               :{BLACK}Emoveray
-STR_NEWGRF_REMOVE_TIP                                           :{BLACK}Emoveray ethay electedsay EwGRFnay ilefay omfray ethay istlay
-STR_NEWGRF_MOVEUP                                               :{BLACK}Ovemay Upway
-STR_NEWGRF_MOVEUP_TIP                                           :{BLACK}Ovemay ethay electedsay EwGRFnay ilefay upway ethay istlay
-STR_NEWGRF_MOVEDOWN                                             :{BLACK}Ovemay Ownday
-STR_NEWGRF_MOVEDOWN_TIP                                         :{BLACK}Ovemay ethay electedsay EwGRFnay ilefay ownday ethay istlay
-STR_NEWGRF_FILE_TIP                                             :{BLACK}Away istlay ofway ethay EwGRFnay ilesfay atthay areway installedway. Ickclay away ilefay otay angechay itsway arameterspay
-STR_NEWGRF_PARAMETER                                            :{BLACK}Arameterspay: {SILVER}{STRING}
-STR_NEWGRF_PARAMETER_QUERY                                      :{BLACK}Enterway EwGRFnay arameterspay
-STR_NEWGRF_NO_INFO                                              :{BLACK}Onay informationway availableway
-
-STR_NEWGRF_ADD_CAPTION                                          :{WHITE}Availableway EwGRFnay ilesfay
-STR_NEWGRF_ADD_FILE                                             :{BLACK}Addway otay electionsay
-STR_NEWGRF_ADD_FILE_TIP                                         :{BLACK}Addway ethay electedsay EwGRFnay ilefay otay ouryay onfigurationcay
-STR_NEWGRF_RESCAN_FILES                                         :{BLACK}Escanray ilesfay
-STR_NEWGRF_RESCAN_FILES_TIP                                     :{BLACK}Updateway ethay istlay ofway availableway EwGRFnay ilesfay
-STR_NEWGRF_DUPLICATE_GRFID                                      :{WHITE}Annotcay addway ilefay: uplicateday GRFay IDWAY
-
-STR_NEWGRF_NOT_FOUND                                            :{RED}Atchingmay ilefay otnay oundfay
-STR_NEWGRF_DISABLED                                             :{RED}Isabledday
-STR_NEWGRF_COMPATIBLE_LOADED                                    :{ORANGE}Atchingmay ilefay otnay oundfay (ompatiblecay GRFay oadedlay)
-
-STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Ompatiblecay GRFay(say) oadedlay orfay issingmay ilesfay
-STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Issingmay GRFay ilefay(say) avehay eenbay isabledday
-STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Issingmay GRFay ilefay(say) otay ebay ableway otay oadlay amegay
-
-STR_CURRENCY_WINDOW                                             :{WHITE}Ustomcay urrencycay
-STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Exchangeway ateray: {ORANGE}{CURRENCY} = £ {COMMA}
-STR_CURRENCY_SEPARATOR                                          :{LTBLUE}Eparatorsay:
-STR_CURRENCY_PREFIX                                             :{LTBLUE}Efixpray:
-STR_CURRENCY_SUFFIX                                             :{LTBLUE}Uffixsay:
-STR_CURRENCY_SWITCH_TO_EURO                                     :{LTBLUE}Itchsway otay Euroway: {ORANGE}{NUM}
-STR_CURRENCY_SWITCH_TO_EURO_NEVER                               :{LTBLUE}Itchsway otay Euroway: {ORANGE}evernay
-STR_CURRENCY_PREVIEW                                            :{LTBLUE}Eviewpray: {ORANGE}{CURRENCY}
-STR_CURRENCY_CHANGE_PARAMETER                                   :{BLACK}Angechay ustomcay urrencycay arameterpay
-
-STR_TRAIN                                                       :{BLACK}{TRAIN}
-STR_BUS                                                         :{BLACK}{BUS}
-STR_LORRY                                                       :{BLACK}{LORRY}
-STR_PLANE                                                       :{BLACK}{PLANE}
-STR_SHIP                                                        :{BLACK}{SHIP}
-
-STR_SCHEDULED_TRAINS                                            :{WHITE}{STATION} - {COMMA} Ain{P "" s}tray
-STR_SCHEDULED_ROAD_VEHICLES                                     :{WHITE}{STATION} - {COMMA} Oadray Ehicle{P "" s}vay
-STR_SCHEDULED_AIRCRAFT                                          :{WHITE}{STATION} - {COMMA} Aircraftway
-STR_SCHEDULED_SHIPS                                             :{WHITE}{STATION} - {COMMA} Ip{P "" s}shay
-
-STR_SCHEDULED_TRAINS_TIP                                        :{BLACK}Owshay allway ainstray ichwhay avehay isthay ationstay onway eirthay eduleschay
-STR_SCHEDULED_ROAD_VEHICLES_TIP                                 :{BLACK}Owshay allway oadray ehiclesvay ichwhay avehay isthay ationstay onway eirthay eduleschay
-STR_SCHEDULED_AIRCRAFT_TIP                                      :{BLACK}Owshay allway aircraftway ichwhay avehay isthay ationstay onway eirthay eduleschay
-STR_SCHEDULED_SHIPS_TIP                                         :{BLACK}Owshay allway ipsshay ichwhay avehay isthay ationstay onway eirthay eduleschay
-
-STR_VEH_WITH_SHARED_ORDERS_LIST                                 :{WHITE}Aredshay ordersway ofway {COMMA} Ehicle{P "" s}vay
-STR_VEH_WITH_SHARED_ORDERS_LIST_TIP                             :{BLACK}Owshay allway ehiclesvay atthay areshay isthay eduleschay
-
-### depot strings
-STR_DEPOT_SELL_CONFIRMATION_TEXT                                :{YELLOW}Ouyay areway aboutway otay ellsay allway ethay ehiclesvay inway ethay epotday. Areway ouyay uresay?
-STR_DEPOT_WRONG_DEPOT_TYPE                                      :Ongwray epotday ypetay
-
-STR_DEPOT_SELL_ALL_BUTTON_TRAIN_TIP                             :{BLACK}Ellsay allway ainstray inway ethay epotday
-STR_DEPOT_SELL_ALL_BUTTON_ROADVEH_TIP                           :{BLACK}Ellsay allway oadray ehiclesvay inway ethay epotday
-STR_DEPOT_SELL_ALL_BUTTON_SHIP_TIP                              :{BLACK}Ellsay allway ipsshay inway ethay epotday
-STR_DEPOT_SELL_ALL_BUTTON_AIRCRAFT_TIP                          :{BLACK}Ellsay allway aircraftway inway ethay angarhay
-
-STR_DEPOT_VEHICLE_ORDER_LIST_TRAIN_TIP                          :{BLACK}Etgay away istlay ofway allway ainstray ithway ethay urrentcay epotday inway eirthay ordersway
-STR_DEPOT_VEHICLE_ORDER_LIST_ROADVEH_TIP                        :{BLACK}Etgay away istlay ofway allway oadray ehiclesvay ithway ethay urrentcay epotday inway eirthay ordersway
-STR_DEPOT_VEHICLE_ORDER_LIST_SHIP_TIP                           :{BLACK}Etgay away istlay ofway allway ipsshay ithway ethay urrentcay epotday inway eirthay ordersway
-STR_DEPOT_VEHICLE_ORDER_LIST_AIRCRAFT_TIP                       :{BLACK}Etgay away istlay ofway allway aircraftway ithway anyway angarhay atway isthay airportway inway eirthay ordersway
-
-STR_DEPOT_AUTOREPLACE_TRAIN_TIP                                 :{BLACK}Autoreplaceway allway ainstray inway ethay epotday
-STR_DEPOT_AUTOREPLACE_ROADVEH_TIP                               :{BLACK}Autoreplaceway allway oadray ehiclesvay inway ethay epotday
-STR_DEPOT_AUTOREPLACE_SHIP_TIP                                  :{BLACK}Autoreplaceway allway ipsshay inway ethay epotday
-STR_DEPOT_AUTOREPLACE_AIRCRAFT_TIP                              :{BLACK}Autoreplaceway allway aircraftway inway ethay angarhay
-
-STR_VEHICLE_LIST_TRAIN_DEPOT                                    :{BLACK}{STRING} - {COMMA} Ain{P "" s}tray
-STR_VEHICLE_LIST_ROADVEH_DEPOT                                  :{BLACK}{STRING} - {COMMA} Oadray Ehicle{P "" s}vay
-STR_VEHICLE_LIST_SHIP_DEPOT                                     :{BLACK}{STRING} - {COMMA} Ip{P "" s}shay
-STR_VEHICLE_LIST_AIRCRAFT_DEPOT                                 :{BLACK}{STRING} - {COMMA} Aircraftway
-
-STR_REPLACE_VEHICLES_WHITE                                      :{WHITE}Eplaceray {STRING}
-STR_REPLACE_VEHICLES_START                                      :{BLACK}Artstay Eplacingray Ehiclesvay
-STR_REPLACE_VEHICLES_STOP                                       :{BLACK}Opstay Eplacingray Ehiclesvay
-STR_NOT_REPLACING                                               :{BLACK}Otnay eplacingray
-STR_NOT_REPLACING_VEHICLE_SELECTED                              :{BLACK}Onay ehiclevay electedsay
-STR_REPLACE_HELP_LEFT_ARRAY                                     :{BLACK}Electsay ethay engineway ypetay otay eplaceray
-STR_REPLACE_HELP_RIGHT_ARRAY                                    :{BLACK}Electsay ethay ewnay engineway ypetay ouyay ouldway ikelay otay useway inway aceplay ofway ethay eftlay electedsay engineway ypetay
-STR_REPLACE_HELP_STOP_BUTTON                                    :{BLACK}Esspray otay opstay ethay eplacementray ofway ethay engineway ypetay electedsay onway ethay eftlay
-STR_REPLACE_HELP_START_BUTTON                                   :{BLACK}Esspray otay eginbay eplacementray ofway ethay eftlay electedsay engineway ypetay ithway ethay ightray electedsay engineway ypetay
-STR_REPLACE_HELP_RAILTYPE                                       :{BLACK}Oosechay ethay ailtyperay ouyay antway otay eplaceray enginesway orfay
-STR_REPLACE_HELP_REPLACE_INFO_TAB                               :{BLACK}Isplaysday ichwhay engineway ethay eftlay electedsay engineway isway eingbay eplacedray ithway, ifway anyway
-STR_REPLACE_HELP                                                :{BLACK}Isthay allowsway ouyay otay eplaceray oneway engineway ypetay ithway anotherway ypetay, enwhay ainstray ofway ethay originalway ypetay enterway away epotday
-STR_REPLACE_REMOVE_WAGON                                        :{BLACK}Agonway emovalray: {ORANGE}{SKIP}{STRING}
-STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Akemay autoreplaceway eepkay ethay engthlay ofway away aintray ethay amesay ybay emovingray agonsway (artingstay atway ethay ontfray), ifway eplacingray ethay engineway ouldway akemay ethay aintray ongerlay.
-STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Eplacingray: {ORANGE}{SKIP}{SKIP}{STRING}
-STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EXPERIMENTALWAY EATUREFay {}Itchsway etweenbay engineway andway agonway eplacementray indowsway.{}Agonway eplacementray illway onlyway ebay oneday ifway ethay ewnay agonway ancay ebay efittedray intoway arryingcay ethay amesay ypetay ofway argocay asway ethay oldway oneway. Isthay isway eckedchay orfay eachway agonway enwhay ethay actualway eplacementray akestay aceplay.
-STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Ehiclevay isway otnay availableway
-STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Ehiclevay isway otnay availableway
-STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Ipshay isway otnay availableway
-STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Aircraftway isway otnay availableway
-
-STR_ENGINES                                                     :Enginesway
-STR_WAGONS                                                      :Agonsway
-
-STR_MASS_STOP_DEPOT_TRAIN_TIP                                   :{BLACK}Ickclay otay opstay allway ethay ainstray insideway ethay epotday
-STR_MASS_STOP_DEPOT_ROADVEH_TIP                                 :{BLACK}Ickclay otay opstay allway ethay oadray ehiclesvay insideway ethay epotday
-STR_MASS_STOP_DEPOT_SHIP_TIP                                    :{BLACK}Ickclay otay opstay allway ethay ipsshay insideway ethay epotday
-STR_MASS_STOP_HANGAR_TIP                                        :{BLACK}Ickclay otay opstay allway ethay aircraftway insideway ethay angarhay
-
-STR_MASS_START_DEPOT_TRAIN_TIP                                  :{BLACK}Ickclay otay artstay allway ethay ainstray insideway ethay epotday
-STR_MASS_START_DEPOT_ROADVEH_TIP                                :{BLACK}Ickclay otay artstay allway ethay oadray ehiclesvay insideway ethay epotday
-STR_MASS_START_DEPOT_SHIP_TIP                                   :{BLACK}Ickclay otay artstay allway ethay ipsshay insideway ethay epotday
-STR_MASS_START_HANGAR_TIP                                       :{BLACK}Ickclay otay artstay allway ethay aircraftway insideway ethay angarhay
-
-STR_MASS_STOP_LIST_TIP                                          :{BLACK}Ickclay otay opstay allway ethay ehiclesvay inway ethay istlay
-STR_MASS_START_LIST_TIP                                         :{BLACK}Ickclay otay artstay allway ethay ehiclesvay inway ethay istlay
-
-STR_SHORT_DATE                                                  :{WHITE}{DATE_TINY}
-STR_SIGN_LIST_CAPTION                                           :{WHITE}Ignsay Istlay - {COMMA} Ign{P "" s}say
-
-STR_ORDER_REFIT_FAILED                                          :{WHITE}Orderway efitray ailurefay oppedstay {STRING} {COMMA}
-
-############ Lists rail types
-
-STR_RAIL_VEHICLES                                               :Ailray Ehiclesvay
-STR_ELRAIL_VEHICLES                                             :Electrifiedway Ailray Ehiclesvay
-STR_MONORAIL_VEHICLES                                           :Onorailmay Ehiclesvay
-STR_MAGLEV_VEHICLES                                             :Aglevmay Ehiclesvay
-
-############ End of list of rail types
-
-STR_TINY_BLACK                                                  :{BLACK}{TINYFONT}{COMMA}
-
-STR_PURCHASE_INFO_COST_WEIGHT                                   :{BLACK}Ostcay: {GOLD}{CURRENCY}{BLACK} Eightway: {GOLD}{WEIGHT_S}
-STR_PURCHASE_INFO_SPEED_POWER                                   :{BLACK}Eedspay: {GOLD}{VELOCITY}{BLACK}   Owerpay: {GOLD}{POWER}
-STR_PURCHASE_INFO_SPEED                                         :{BLACK}Eedspay: {GOLD}{VELOCITY}
-STR_PURCHASE_INFO_RUNNINGCOST                                   :{BLACK}Unningray Ostcay: {GOLD}{CURRENCY}/yray
-STR_PURCHASE_INFO_CAPACITY                                      :{BLACK}Apacitycay: {GOLD}{CARGO} {STRING}
-STR_PURCHASE_INFO_DESIGNED_LIFE                                 :{BLACK}Esignedday: {GOLD}{NUM}{BLACK} Ifelay: {GOLD}{COMMA} earsyay
-STR_PURCHASE_INFO_RELIABILITY                                   :{BLACK}Axmay. Eliabilityray: {GOLD}{COMMA}%
-STR_PURCHASE_INFO_COST                                          :{BLACK}Ostcay: {GOLD}{CURRENCY}
-STR_PURCHASE_INFO_WEIGHT_CWEIGHT                                :{BLACK}Eightway: {GOLD}{WEIGHT_S}  ({WEIGHT_S})
-STR_PURCHASE_INFO_COST_SPEED                                    :{BLACK}Ostcay: {GOLD}{CURRENCY}{BLACK} Eedspay: {GOLD}{VELOCITY}
-STR_PURCHASE_INFO_AIRCRAFT_CAPACITY                             :{BLACK}Apacitycay: {GOLD}{COMMA} assengerspay, {COMMA} agsbay ofway ailmay
-STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT                          :{BLACK}Oweredpay Agonsway: {GOLD}+{POWER}{BLACK} Eightway: {GOLD}+{WEIGHT_S}
-STR_PURCHASE_INFO_REFITTABLE_TO                                 :{BLACK}Efittableray otay: {GOLD}
-STR_PURCHASE_INFO_ALL_TYPES                                     :Allway argocay ypestay
-STR_PURCHASE_INFO_ALL_BUT                                       :Allway utbay {GOLD}
-STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Axmay. Activetray Effortway: {GOLD}{FORCE}
-
-########### String for New Landscape Generator
-
-STR_GENERATE                                                    :{WHITE}Enerategay
-STR_RANDOM                                                      :{BLACK}Andomiseray
-STR_RANDOM_HELP                                                 :{BLACK}Angechay ethay andomray eedsay usedway orfay Erraintay Enerationgay
-STR_WORLD_GENERATION_CAPTION                                    :{WHITE}Orldway enerationgay
-STR_RANDOM_SEED                                                 :{BLACK}Andomray Eedsay:
-STR_RANDOM_SEED_HELP                                            :{BLACK}Ickclay otay enterway away andomray eedsay
-STR_LAND_GENERATOR                                              :{BLACK}Andlay eneratorgay:
-STR_TREE_PLACER                                                 :{BLACK}Eetray algorithmway:
-STR_HEIGHTMAP_ROTATION                                          :{BLACK}Eightmaphay otationray:
-STR_TERRAIN_TYPE                                                :{BLACK}Erraintay ypetay:
-STR_QUANTITY_OF_SEA_LAKES                                       :{BLACK}Easay evellay:
-STR_SMOOTHNESS                                                  :{BLACK}Oothnesssmay:
-STR_SNOW_LINE_HEIGHT                                            :{BLACK}Owsnay inelay eighthay:
-STR_DATE                                                        :{BLACK}Ateday:
-STR_NUMBER_OF_TOWNS                                             :{BLACK}Onay. ofway ownstay:
-STR_NUMBER_OF_INDUSTRIES                                        :{BLACK}Onay. ofway industriesway:
-STR_GENERATE_DATE                                               :{BLACK}{DATE_LONG}
-STR_SNOW_LINE_UP                                                :{BLACK}Ovemay ethay owsnay inelay eighthay oneway upway
-STR_SNOW_LINE_DOWN                                              :{BLACK}Ovemay ethay owsnay inelay eighthay oneway ownday
-STR_SNOW_LINE_QUERY_CAPT                                        :{WHITE}Angechay owsnay inelay eighthay
-STR_START_DATE_QUERY_CAPT                                       :{WHITE}Angechay artingstay earyay
-STR_HEIGHTMAP_SCALE_WARNING_CAPTION                             :{WHITE}Alescay arningway
-STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Esizingray ourcesay apmay ootay uchmay isway otnay ecommendedray. Ontinuecay ithway ethay enerationgay?
-STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Owntay ayoutlay arningway
-STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Ethay owntay ayoutlay "onay oremay oadsray" isway otnay ecommendedray. Ontinuecay ithway ethay enerationgay?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
-STR_HEIGHTMAP_NAME                                              :{BLACK}Eightmaphay amenay:
-STR_HEIGHTMAP_SIZE                                              :{BLACK}Izesay: {ORANGE}{NUM} xay {NUM}
-STR_GENERATION_WORLD                                            :{WHITE}Eneratinggay orldway...
-STR_GENERATION_ABORT                                            :{BLACK}Abortway
-STR_GENERATION_ABORT_CAPTION                                    :{WHITE}Abortway Orldway Enerationgay
-STR_GENERATION_ABORT_MESSAGE                                    :{YELLOW}Oday ouyay eallyray antway otay abortway ethay enerationgay?
-STR_PROGRESS                                                    :{WHITE}{NUM}% ompletecay
-STR_GENERATION_PROGRESS                                         :{BLACK}{NUM} / {NUM}
-STR_WORLD_GENERATION                                            :{BLACK}Orldway enerationgay
-STR_TREE_GENERATION                                             :{BLACK}Eetray enerationgay
-STR_UNMOVABLE_GENERATION                                        :{BLACK}Unmovableway enerationgay
-STR_CLEARING_TILES                                              :{BLACK}Oughray andway ockyray areaway enerationgay
-STR_SETTINGUP_GAME                                              :{BLACK}Ettingsay upway amegay
-STR_PREPARING_TILELOOP                                          :{BLACK}Unningray iletay-ooplay
-STR_PREPARING_GAME                                              :{BLACK}Eparingpray amegay
-STR_DIFFICULTY_TO_CUSTOM                                        :{WHITE}Isthay actionway angedchay ethay ifficultyday evellay otay ustomcay
-STR_SE_FLAT_WORLD                                               :{WHITE}Atflay andlay
-STR_SE_FLAT_WORLD_TIP                                           :{BLACK}Enerategay away atflay andlay
-STR_SE_RANDOM_LAND                                              :{WHITE}Andomray andlay
-STR_SE_NEW_WORLD                                                :{BLACK}Eatecray ewnay enarioscay
-STR_SE_CAPTION                                                  :{WHITE}Enarioscay ypetay
-STR_FLAT_WORLD_HEIGHT_DOWN                                      :{BLACK}Ovemay ethay eighthay ofway atflay andlay oneway ownday
-STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Ovemay ethay eighthay ofway atflay andlay oneway upway
-STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Angechay eighthay ofway atflay andlay
-STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Eighthay ofway atflay andlay:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
-
-STR_SMALLMAP_CENTER                                             :{BLACK}Entercay ethay allmapsmay onway ethay urrentcay ositionpay
-
-########### String for new airports
-STR_SMALL_AIRPORT                                               :{BLACK}Allsmay
-STR_CITY_AIRPORT                                                :{BLACK}Itycay
-STR_METRO_AIRPORT                                               :{BLACK}Etropolitanmay airportway
-STR_INTERNATIONAL_AIRPORT                                       :{BLACK}Internationalway airportway
-STR_COMMUTER_AIRPORT                                            :{BLACK}Ommutercay
-STR_INTERCONTINENTAL_AIRPORT                                    :{BLACK}Intercontinentalway
-STR_HELIPORT                                                    :{BLACK}Eliporthay
-STR_HELIDEPOT                                                   :{BLACK}Elidepothay
-STR_HELISTATION                                                 :{BLACK}Elistationhay
-
-STR_SMALL_AIRPORTS                                              :{BLACK}Allsmay airportsway
-STR_LARGE_AIRPORTS                                              :{BLACK}Argelay airportsway
-STR_HUB_AIRPORTS                                                :{BLACK}Ubhay airportsway
-STR_HELIPORTS                                                   :{BLACK}Elicopterhay airportsway
-
-############ Tooltip measurment
-
-STR_MEASURE_LENGTH                                              :{BLACK}Engthlay: {NUM}
-STR_MEASURE_AREA                                                :{BLACK}Areaway: {NUM} xay {NUM}
-STR_MEASURE_LENGTH_HEIGHTDIFF                                   :{BLACK}Engthlay: {NUM}{}Eighthay ifferenceday: {NUM} may
-STR_MEASURE_AREA_HEIGHTDIFF                                     :{BLACK}Areaway: {NUM} xay {NUM}{}Eighthay ifferenceday: {NUM} may
-
-############ Date formatting
-STR_DATE_TINY                                                   :{STRING}-{STRING}-{NUM}
-STR_DATE_SHORT                                                  :{STRING} {NUM}
-STR_DATE_LONG                                                   :{STRING} {STRING} {NUM}
-
-########
-
-STR_FEEDER_CARGO_VALUE                                          :{BLACK}Ansfertray Editscray: {LTBLUE}{CURRENCY}
-STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...isthay isway away owntay ownedway oadray
-STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...oadray acingfay inway ethay ongwray irectionday
-
-STR_TRANSPARENCY_TOOLB                                          :{WHITE}Ansparencytray Optionsway
-STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Oggletay ansparencytray orfay ationstay ignssay
-STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Oggletay ansparencytray orfay eestray
-STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Oggletay ansparencytray orfay ouseshay
-STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Oggletay ansparencytray orfay industriesway
-STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Oggletay ansparencytray orfay uildablesbay ikelay ationsstay, epotsday, aypointsway andway atenarycay
-STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Oggletay ansparencytray orfay idgesbray
-STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Oggletay ansparencytray orfay ucturesstray ikelay ighthouseslay andway antennasway, aybemay inway uturefay orfay eyecandyway
-STR_TRANSPARENT_LOADING_DESC                                    :{BLACK}Oggletay ansparencytray orfay oadinglay indicatorsway
-
-STR_PERCENT_UP_SMALL                                            :{TINYFONT}{WHITE}{NUM}%{UPARROW}
-STR_PERCENT_UP                                                  :{WHITE}{NUM}%{UPARROW}
-STR_PERCENT_DOWN_SMALL                                          :{TINYFONT}{WHITE}{NUM}%{DOWNARROW}
-STR_PERCENT_DOWN                                                :{WHITE}{NUM}%{DOWNARROW}
-STR_PERCENT_UP_DOWN_SMALL                                       :{TINYFONT}{WHITE}{NUM}%{UPARROW}{DOWNARROW}
-STR_PERCENT_UP_DOWN                                             :{WHITE}{NUM}%{UPARROW}{DOWNARROW}
-
-##### Mass Order
-STR_GROUP_NAME_FORMAT                                           :Oupgray {COMMA}
-STR_GROUP_TINY_NAME                                             :{TINYFONT}{GROUP}
-STR_GROUP_ALL_TRAINS                                            :Allway ainstray
-STR_GROUP_ALL_ROADS                                             :Allway oadray ehiclesvay
-STR_GROUP_ALL_SHIPS                                             :Allway ipsshay
-STR_GROUP_ALL_AIRCRAFTS                                         :Allway aircraftway
-STR_GROUP_DEFAULT_TRAINS                                        :Ungroupedway ainstray
-STR_GROUP_DEFAULT_ROADS                                         :Ungroupedway oadray ehiclesvay
-STR_GROUP_DEFAULT_SHIPS                                         :Ungroupedway ipsshay
-STR_GROUP_DEFAULT_AIRCRAFTS                                     :Ungroupedway aircraftway
-STR_GROUP_TINY_NUM                                              :{TINYFONT}{COMMA}
-STR_GROUP_ADD_SHARED_VEHICLE                                    :Addway aredshay ehiclesvay
-STR_GROUP_REMOVE_ALL_VEHICLES                                   :Emoveray allway ehiclesvay
-
-STR_GROUP_TRAINS_CAPTION                                        :{WHITE}{GROUP} - {COMMA} Ain{P "" s}tray
-STR_GROUP_ROADVEH_CAPTION                                       :{WHITE}{GROUP} - {COMMA} Oadray Ehicle{P "" s}vay
-STR_GROUP_SHIPS_CAPTION                                         :{WHITE}{GROUP} - {COMMA} Ip{P "" s}shay
-STR_GROUP_AIRCRAFTS_CAPTION                                     :{WHITE}{GROUP} - {COMMA} Aircraftway
-STR_GROUP_RENAME_CAPTION                                        :{BLACK}Enameray away oupgray
-STR_GROUP_REPLACE_CAPTION                                       :{WHITE}Eplaceray Ehiclesvay ofway "{GROUP}"
-
-STR_GROUP_CAN_T_CREATE                                          :{WHITE}An'tcay eatecray oupgray...
-STR_GROUP_CAN_T_DELETE                                          :{WHITE}An'tcay eleteday isthay oupgray...
-STR_GROUP_CAN_T_RENAME                                          :{WHITE}An'tcay enameray oupgray...
-STR_GROUP_CAN_T_REMOVE_ALL_VEHICLES                             :{WHITE}An'tcay emoveray allway ehiclesvay omfray isthay oupgray...
-STR_GROUP_CAN_T_ADD_VEHICLE                                     :{WHITE}An'tcay addway ethay ehiclevay otay isthay oupgray...
-STR_GROUP_CAN_T_ADD_SHARED_VEHICLE                              :{WHITE}An'tcay addway aredshay ehiclesvay otay oupgray...
-
-STR_GROUPS_CLICK_ON_GROUP_FOR_TIP                               :{BLACK}Oupsgray - Ickclay onway away oupgray otay istlay allway ehiclesvay ofway isthay oupgray
-STR_GROUP_CREATE_TIP                                            :{BLACK}Ickclay otay eatecray away oupgray
-STR_GROUP_DELETE_TIP                                            :{BLACK}Eleteday ethay electedsay oupgray
-STR_GROUP_RENAME_TIP                                            :{BLACK}Enameray ethay electedsay oupgray
-STR_GROUP_REPLACE_PROTECTION_TIP                                :{BLACK}Ickclay otay otectpray isthay oupgray omfray obalglay autoreplaceway
-
-STR_COMPANY_NAME                                                :{COMPANY}
-STR_ENGINE_NAME                                                 :{ENGINE}
-STR_GROUP_NAME                                                  :{GROUP}
-STR_PLAYER_NAME                                                 :{PLAYERNAME}
-STR_SIGN_NAME                                                   :{SIGN}
-STR_VEHICLE_NAME                                                :{VEHICLE}
-
-STR_NAME_MUST_BE_UNIQUE                                         :{WHITE}Amenay ustmay ebay uniqueway
-
-#### Improved sign GUI
-STR_NEXT_SIGN_TOOLTIP                                           :{BLACK}Ogay otay extnay ignsay
-STR_PREVIOUS_SIGN_TOOLTIP                                       :{BLACK}Ogay otay eviouspray ignsay
-
-########
-
-STR_FUND_NEW_INDUSTRY                                           :{BLACK}Undfay
-STR_PROSPECT_NEW_INDUSTRY                                       :{BLACK}Ospectpray
-STR_BUILD_NEW_INDUSTRY                                          :{BLACK}Uildbay
-STR_INDUSTRY_SELECTION_HINT                                     :{BLACK}Oosechay ethay appropriateway industryway omfray isthay istlay
+##name Pig latin
+##ownname Igpay atinlay
+##isocode xx_PL
+##plural 0
+
+#
+
+##id 0x0000
+STR_NULL                                                        :
+STR_0001_OFF_EDGE_OF_MAP                                        :{WHITE}Offway edgeway ofway apmay
+STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP                               :{WHITE}Ootay oseclay otay edgeway ofway apmay
+STR_0003_NOT_ENOUGH_CASH_REQUIRES                               :{WHITE}Otnay enoughway ashcay - equiresray {CURRENCY}
+STR_0004                                                        :{WHITE}{CURRENCY}
+STR_EMPTY                                                       :
+STR_0007_FLAT_LAND_REQUIRED                                     :{WHITE}Atflay andlay equiredray
+STR_0008_WAITING                                                :{BLACK}Aitingway: {WHITE}{STRING}
+STR_0009                                                        :{WHITE}{CARGO}
+STR_000A_EN_ROUTE_FROM                                          :{WHITE}{CARGO}{YELLOW}  (enway-outeray omfray
+STR_000B                                                        :{YELLOW}{STATION})
+STR_000C_ACCEPTS                                                :{BLACK}Acceptsway: {WHITE}
+STR_000D_ACCEPTS                                                :{BLACK}Acceptsway: {GOLD}
+STR_000E                                                        :
+STR_000F_PASSENGERS                                             :Assengerspay
+STR_0010_COAL                                                   :Oalcay
+STR_0011_MAIL                                                   :Ailmay
+STR_0012_OIL                                                    :Oilway
+STR_0013_LIVESTOCK                                              :Ivestocklay
+STR_0014_GOODS                                                  :Oodsgay
+STR_0015_GRAIN                                                  :Aingray
+STR_0016_WOOD                                                   :Oodway
+STR_0017_IRON_ORE                                               :Ironway Oreway
+STR_0018_STEEL                                                  :Eelstay
+STR_0019_VALUABLES                                              :Aluablesvay
+STR_001A_COPPER_ORE                                             :Oppercay Oreway
+STR_001B_MAIZE                                                  :Aizemay
+STR_001C_FRUIT                                                  :Uitfray
+STR_001D_DIAMONDS                                               :Iamondsday
+STR_001E_FOOD                                                   :Oodfay
+STR_001F_PAPER                                                  :Aperpay
+STR_0020_GOLD                                                   :Oldgay
+STR_0021_WATER                                                  :Aterway
+STR_0022_WHEAT                                                  :Eatwhay
+STR_0023_RUBBER                                                 :Ubberray
+STR_0024_SUGAR                                                  :Ugarsay
+STR_0025_TOYS                                                   :Oystay
+STR_0026_CANDY                                                  :Eetssway
+STR_0027_COLA                                                   :Olacay
+STR_0028_COTTON_CANDY                                           :Andyflosscay
+STR_0029_BUBBLES                                                :Ubblesbay
+STR_002A_TOFFEE                                                 :Offeetay
+STR_002B_BATTERIES                                              :Atteriesbay
+STR_002C_PLASTIC                                                :Asticplay
+STR_002D_FIZZY_DRINKS                                           :Izzyfay Inksdray
+STR_002E                                                        :
+STR_002F_PASSENGER                                              :Assengerpay
+STR_0030_COAL                                                   :Oalcay
+STR_0031_MAIL                                                   :Ailmay
+STR_0032_OIL                                                    :Oilway
+STR_0033_LIVESTOCK                                              :Ivestocklay
+STR_0034_GOODS                                                  :Oodsgay
+STR_0035_GRAIN                                                  :Aingray
+STR_0036_WOOD                                                   :Oodway
+STR_0037_IRON_ORE                                               :Ironway Oreway
+STR_0038_STEEL                                                  :Eelstay
+STR_0039_VALUABLES                                              :Aluablesvay
+STR_003A_COPPER_ORE                                             :Oppercay Oreway
+STR_003B_MAIZE                                                  :Aizemay
+STR_003C_FRUIT                                                  :Uitfray
+STR_003D_DIAMOND                                                :Iamondday
+STR_003E_FOOD                                                   :Oodfay
+STR_003F_PAPER                                                  :Aperpay
+STR_0040_GOLD                                                   :Oldgay
+STR_0041_WATER                                                  :Aterway
+STR_0042_WHEAT                                                  :Eatwhay
+STR_0043_RUBBER                                                 :Ubberray
+STR_0044_SUGAR                                                  :Ugarsay
+STR_0045_TOY                                                    :Oytay
+STR_0046_CANDY                                                  :Eetsway
+STR_0047_COLA                                                   :Olacay
+STR_0048_COTTON_CANDY                                           :Andyflosscay
+STR_0049_BUBBLE                                                 :Ubblebay
+STR_004A_TOFFEE                                                 :Offeetay
+STR_004B_BATTERY                                                :Atterybay
+STR_004C_PLASTIC                                                :Asticplay
+STR_004D_FIZZY_DRINK                                            :Izzyfay Inkdray
+STR_QUANTITY_NOTHING                                            :
+STR_QUANTITY_PASSENGERS                                         :{COMMA} assenger{P "" s}pay
+STR_QUANTITY_COAL                                               :{WEIGHT} ofway oalcay
+STR_QUANTITY_MAIL                                               :{COMMA} ag{P "" s}bay ofway ailmay
+STR_QUANTITY_OIL                                                :{VOLUME} ofway oilway
+STR_QUANTITY_LIVESTOCK                                          :{COMMA} item{P "" s}WAY ofway ivestocklay
+STR_QUANTITY_GOODS                                              :{COMMA} ate{P "" s}cray ofway oodsgay
+STR_QUANTITY_GRAIN                                              :{WEIGHT} ofway aingray
+STR_QUANTITY_WOOD                                               :{WEIGHT} ofway oodway
+STR_QUANTITY_IRON_ORE                                           :{WEIGHT} ofway ironway oreway
+STR_QUANTITY_STEEL                                              :{WEIGHT} ofway eelstay
+STR_QUANTITY_VALUABLES                                          :{COMMA} ag{P "" s}bay ofway aluablesvay
+STR_QUANTITY_COPPER_ORE                                         :{WEIGHT} ofway oppercay oreway
+STR_QUANTITY_MAIZE                                              :{WEIGHT} ofway aizemay
+STR_QUANTITY_FRUIT                                              :{WEIGHT} ofway uitfray
+STR_QUANTITY_DIAMONDS                                           :{COMMA} ag{P "" s}bay ofway iamondsday
+STR_QUANTITY_FOOD                                               :{WEIGHT} ofway oodfay
+STR_QUANTITY_PAPER                                              :{WEIGHT} ofway aperpay
+STR_QUANTITY_GOLD                                               :{COMMA} ag{P "" s}bay ofway oldgay
+STR_QUANTITY_WATER                                              :{VOLUME} ofway aterway
+STR_QUANTITY_WHEAT                                              :{WEIGHT} ofway eatwhay
+STR_QUANTITY_RUBBER                                             :{VOLUME} ofway ubberray
+STR_QUANTITY_SUGAR                                              :{WEIGHT} ofway ugarsay
+STR_QUANTITY_TOYS                                               :{COMMA} oy{P "" s}tay
+STR_QUANTITY_SWEETS                                             :{COMMA} ag{P "" s}bay ofway eetssway
+STR_QUANTITY_COLA                                               :{VOLUME} ofway olacay
+STR_QUANTITY_CANDYFLOSS                                         :{WEIGHT} ofway andyflosscay
+STR_QUANTITY_BUBBLES                                            :{COMMA} ubble{P "" s}bay
+STR_QUANTITY_TOFFEE                                             :{WEIGHT} ofway offeetay
+STR_QUANTITY_BATTERIES                                          :{COMMA} atter{P y ies}bay
+STR_QUANTITY_PLASTIC                                            :{VOLUME} ofway asticplay
+STR_QUANTITY_FIZZY_DRINKS                                       :{COMMA} izzyfay ink{P "" s}dray
+STR_ABBREV_NOTHING                                              :
+STR_ABBREV_PASSENGERS                                           :{TINYFONT}PSay
+STR_ABBREV_COAL                                                 :{TINYFONT}CLay
+STR_ABBREV_MAIL                                                 :{TINYFONT}MLay
+STR_ABBREV_OIL                                                  :{TINYFONT}OLWAY
+STR_ABBREV_LIVESTOCK                                            :{TINYFONT}LVay
+STR_ABBREV_GOODS                                                :{TINYFONT}GDay
+STR_ABBREV_GRAIN                                                :{TINYFONT}GRay
+STR_ABBREV_WOOD                                                 :{TINYFONT}WDay
+STR_ABBREV_IRON_ORE                                             :{TINYFONT}ORWAY
+STR_ABBREV_STEEL                                                :{TINYFONT}STay
+STR_ABBREV_VALUABLES                                            :{TINYFONT}VLay
+STR_ABBREV_COPPER_ORE                                           :{TINYFONT}OCay
+STR_ABBREV_MAIZE                                                :{TINYFONT}MZay
+STR_ABBREV_FRUIT                                                :{TINYFONT}FTay
+STR_ABBREV_DIAMONDS                                             :{TINYFONT}DMay
+STR_ABBREV_FOOD                                                 :{TINYFONT}FDay
+STR_ABBREV_PAPER                                                :{TINYFONT}PRay
+STR_ABBREV_GOLD                                                 :{TINYFONT}GDay
+STR_ABBREV_WATER                                                :{TINYFONT}WRay
+STR_ABBREV_WHEAT                                                :{TINYFONT}WHay
+STR_ABBREV_RUBBER                                               :{TINYFONT}RBay
+STR_ABBREV_SUGAR                                                :{TINYFONT}SGay
+STR_ABBREV_TOYS                                                 :{TINYFONT}YTay
+STR_ABBREV_SWEETS                                               :{TINYFONT}SWay
+STR_ABBREV_COLA                                                 :{TINYFONT}CLay
+STR_ABBREV_CANDYFLOSS                                           :{TINYFONT}CFay
+STR_ABBREV_BUBBLES                                              :{TINYFONT}UBay
+STR_ABBREV_TOFFEE                                               :{TINYFONT}TFay
+STR_ABBREV_BATTERIES                                            :{TINYFONT}BAay
+STR_ABBREV_PLASTIC                                              :{TINYFONT}PLay
+STR_ABBREV_FIZZY_DRINKS                                         :{TINYFONT}FZay
+STR_ABBREV_NONE                                                 :{TINYFONT}ONay
+STR_ABBREV_ALL                                                  :{TINYFONT}ALLWAY
+STR_00AE                                                        :{WHITE}{DATE_SHORT}
+STR_00AF                                                        :{WHITE}{DATE_LONG}
+STR_00B0_MAP                                                    :{WHITE}Apmay - {STRING}
+STR_00B1_GAME_OPTIONS                                           :{WHITE}Amegay Optionsway
+STR_00B2_MESSAGE                                                :{YELLOW}Essagemay
+STR_00B3_MESSAGE_FROM                                           :{YELLOW}Essagemay omfray {STRING}
+STR_POPUP_CAUTION_CAPTION                                       :{WHITE}Autioncay!
+STR_00B4_CAN_T_DO_THIS                                          :{WHITE}An'tcay oday isthay....
+STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}An'tcay earclay isthay areaway....
+STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Originalway opyrightcay {COPYRIGHT} 1995 Ischray Awyersay, Allway ightsray eservedray
+STR_00B7_VERSION                                                :{BLACK}OpenTTDWAY ersionvay {REV}
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTDWAY {COPYRIGHT}2002-2008 Ethay OpenTTDWAY eamtay
+STR_TRANSLATED_BY                                               :{BLACK}  Anslatortray(say) -
+
+STR_00C5                                                        :{BLACK}{CROSS}
+STR_00C6                                                        :{SILVER}{CROSS}
+STR_00C7_QUIT                                                   :{WHITE}Itquay
+STR_00C8_YES                                                    :{BLACK}Esyay
+STR_00C9_NO                                                     :{BLACK}Onay
+STR_00CA_ARE_YOU_SURE_YOU_WANT_TO                               :{YELLOW}Areway ouyay uresay ouyay antway otay abandonway isthay amegay andway eturnray otay {STRING}?
+STR_00CB_1                                                      :{BLACK}1
+STR_00CC_2                                                      :{BLACK}2
+STR_00CD_3                                                      :{BLACK}3
+STR_00CE_4                                                      :{BLACK}4
+STR_00CF_5                                                      :{BLACK}5
+STR_00D0_NOTHING                                                :Othingnay
+STR_00D1_DARK_BLUE                                              :Arkday Ueblay
+STR_00D2_PALE_GREEN                                             :Alepay Eengray
+STR_00D3_PINK                                                   :Inkpay
+STR_00D4_YELLOW                                                 :Ellowyay
+STR_00D5_RED                                                    :Edray
+STR_00D6_LIGHT_BLUE                                             :Ightlay Ueblay
+STR_00D7_GREEN                                                  :Eengray
+STR_00D8_DARK_GREEN                                             :Arkday Eengray
+STR_00D9_BLUE                                                   :Ueblay
+STR_00DA_CREAM                                                  :Eamcray
+STR_00DB_MAUVE                                                  :Auvemay
+STR_00DC_PURPLE                                                 :Urplepay
+STR_00DD_ORANGE                                                 :Orangeway
+STR_00DE_BROWN                                                  :Ownbray
+STR_00DF_GREY                                                   :Eygray
+STR_00E0_WHITE                                                  :Itewhay
+STR_00E1_TOO_MANY_VEHICLES_IN_GAME                              :{WHITE}Ootay anymay ehiclesvay inway amegay
+STR_00E2                                                        :{BLACK}{COMMA}
+STR_00E3                                                        :{RED}{COMMA}
+STR_00E4_LOCATION                                               :{BLACK}Ocationlay
+STR_00E5_CONTOURS                                               :Ontourscay
+STR_00E6_VEHICLES                                               :Ehiclesvay
+STR_00E7_INDUSTRIES                                             :Industriesway
+STR_00E8_ROUTES                                                 :Outesray
+STR_00E9_VEGETATION                                             :Egetationvay
+STR_00EA_OWNERS                                                 :Ownersway
+STR_00EB_ROADS                                                  :{BLACK}{TINYFONT}Oadsray
+STR_00EC_RAILROADS                                              :{BLACK}{TINYFONT}Ailwaysray
+STR_00ED_STATIONS_AIRPORTS_DOCKS                                :{BLACK}{TINYFONT}Ationsstay/Airportsway/Ocksday
+STR_00EE_BUILDINGS_INDUSTRIES                                   :{BLACK}{TINYFONT}Uildingsbay/Industriesway
+STR_00EF_VEHICLES                                               :{BLACK}{TINYFONT}Ehiclesvay
+STR_00F0_100M                                                   :{BLACK}{TINYFONT}100may
+STR_00F1_200M                                                   :{BLACK}{TINYFONT}200may
+STR_00F2_300M                                                   :{BLACK}{TINYFONT}300may
+STR_00F3_400M                                                   :{BLACK}{TINYFONT}400may
+STR_00F4_500M                                                   :{BLACK}{TINYFONT}500may
+STR_00F5_TRAINS                                                 :{BLACK}{TINYFONT}Ainstray
+STR_00F6_ROAD_VEHICLES                                          :{BLACK}{TINYFONT}Oadray Ehiclesvay
+STR_00F7_SHIPS                                                  :{BLACK}{TINYFONT}Ipsshay
+STR_00F8_AIRCRAFT                                               :{BLACK}{TINYFONT}Aircraftway
+STR_00F9_TRANSPORT_ROUTES                                       :{BLACK}{TINYFONT}Ansporttray Outesray
+STR_00FA_COAL_MINE                                              :{BLACK}{TINYFONT}Oalcay Inemay
+STR_00FB_POWER_STATION                                          :{BLACK}{TINYFONT}Owerpay Ationstay
+STR_00FC_FOREST                                                 :{BLACK}{TINYFONT}Orestfay
+STR_00FD_SAWMILL                                                :{BLACK}{TINYFONT}Awmillsay
+STR_00FE_OIL_REFINERY                                           :{BLACK}{TINYFONT}Oilway Efineryray
+STR_00FF_FARM                                                   :{BLACK}{TINYFONT}Armfay
+STR_0100_FACTORY                                                :{BLACK}{TINYFONT}Actoryfay
+STR_0101_PRINTING_WORKS                                         :{BLACK}{TINYFONT}Intingpray Orksway
+STR_0102_OIL_WELLS                                              :{BLACK}{TINYFONT}Oilway Ellsway
+STR_0103_IRON_ORE_MINE                                          :{BLACK}{TINYFONT}Ironway Oreway Inemay
+STR_0104_STEEL_MILL                                             :{BLACK}{TINYFONT}Eelstay Illmay
+STR_0105_BANK                                                   :{BLACK}{TINYFONT}Ankbay
+STR_0106_PAPER_MILL                                             :{BLACK}{TINYFONT}Aperpay Illmay
+STR_0107_GOLD_MINE                                              :{BLACK}{TINYFONT}Oldgay Inemay
+STR_0108_FOOD_PROCESSING_PLANT                                  :{BLACK}{TINYFONT}Oodfay Ocessingpray Antplay
+STR_0109_DIAMOND_MINE                                           :{BLACK}{TINYFONT}Iamondday Inemay
+STR_010A_COPPER_ORE_MINE                                        :{BLACK}{TINYFONT}Oppercay Oreway Inemay
+STR_010B_FRUIT_PLANTATION                                       :{BLACK}{TINYFONT}Uitfray Antationplay
+STR_010C_RUBBER_PLANTATION                                      :{BLACK}{TINYFONT}Ubberray Antationplay
+STR_010D_WATER_SUPPLY                                           :{BLACK}{TINYFONT}Aterway Upplysay
+STR_010E_WATER_TOWER                                            :{BLACK}{TINYFONT}Aterway Owertay
+STR_010F_LUMBER_MILL                                            :{BLACK}{TINYFONT}Umberlay Illmay
+STR_0110_COTTON_CANDY_FOREST                                    :{BLACK}{TINYFONT}Andyflosscay Orestfay
+STR_0111_CANDY_FACTORY                                          :{BLACK}{TINYFONT}Eetsway Actoryfay
+STR_0112_BATTERY_FARM                                           :{BLACK}{TINYFONT}Atterybay Armfay
+STR_0113_COLA_WELLS                                             :{BLACK}{TINYFONT}Olacay Ellsway
+STR_0114_TOY_SHOP                                               :{BLACK}{TINYFONT}Oytay Opshay
+STR_0115_TOY_FACTORY                                            :{BLACK}{TINYFONT}Oytay Actoryfay
+STR_0116_PLASTIC_FOUNTAINS                                      :{BLACK}{TINYFONT}Asticplay Ountainsfay
+STR_0117_FIZZY_DRINK_FACTORY                                    :{BLACK}{TINYFONT}Izzyfay Inkdray Actoryfay
+STR_0118_BUBBLE_GENERATOR                                       :{BLACK}{TINYFONT}Ubblebay Eneratorgay
+STR_0119_TOFFEE_QUARRY                                          :{BLACK}{TINYFONT}Offeetay Arryquay
+STR_011A_SUGAR_MINE                                             :{BLACK}{TINYFONT}Ugarsay Inemay
+STR_011B_RAILROAD_STATION                                       :{BLACK}{TINYFONT}Ailwayray Ationstay
+STR_011C_TRUCK_LOADING_BAY                                      :{BLACK}{TINYFONT}Orrylay Oadinglay Aybay
+STR_011D_BUS_STATION                                            :{BLACK}{TINYFONT}Usbay Ationstay
+STR_011E_AIRPORT_HELIPORT                                       :{BLACK}{TINYFONT}Airportway/Eliporthay
+STR_011F_DOCK                                                   :{BLACK}{TINYFONT}Ockday
+STR_0120_ROUGH_LAND                                             :{BLACK}{TINYFONT}Oughray Andlay
+STR_0121_GRASS_LAND                                             :{BLACK}{TINYFONT}Assgray Andlay
+STR_0122_BARE_LAND                                              :{BLACK}{TINYFONT}Arebay Andlay
+STR_0123_FIELDS                                                 :{BLACK}{TINYFONT}Ieldsfay
+STR_0124_TREES                                                  :{BLACK}{TINYFONT}Eestray
+STR_0125_ROCKS                                                  :{BLACK}{TINYFONT}Ocksray
+STR_0126_WATER                                                  :{BLACK}{TINYFONT}Aterway
+STR_0127_NO_OWNER                                               :{BLACK}{TINYFONT}Onay Ownerway
+STR_0128_TOWNS                                                  :{BLACK}{TINYFONT}Ownstay
+STR_0129_INDUSTRIES                                             :{BLACK}{TINYFONT}Industriesway
+STR_012A_DESERT                                                 :{BLACK}{TINYFONT}Esertday
+STR_012B_SNOW                                                   :{BLACK}{TINYFONT}Owsnay
+STR_012C_MESSAGE                                                :{WHITE}Essagemay
+STR_012D                                                        :{WHITE}{STRING}
+STR_012E_CANCEL                                                 :{BLACK}Ancelcay
+STR_012F_OK                                                     :{BLACK}OKWAY
+STR_0130_RENAME                                                 :{BLACK}Enameray
+STR_0131_TOO_MANY_NAMES_DEFINED                                 :{WHITE}Ootay anymay amesnay efinedday
+STR_0132_CHOSEN_NAME_IN_USE_ALREADY                             :{WHITE}Osenchay amenay alreadyway inway useway
+
+STR_0133_WINDOWS                                                :Indowsway
+STR_0134_UNIX                                                   :Unixway
+STR_0135_OSX                                                    :OSWAY Xay
+STR_OSNAME_BEOS                                                 :EOSbay
+STR_OSNAME_MORPHOS                                              :OrphOSmay
+STR_OSNAME_AMIGAOS                                              :AmigaOSWAY
+STR_OSNAME_OS2                                                  :OSWAY/2
+STR_OSNAME_SUNOS                                                :UnOSsay
+
+STR_013B_OWNED_BY                                               :{WHITE}...ownedway ybay {STRING}
+STR_013C_CARGO                                                  :{BLACK}Argocay
+STR_013D_INFORMATION                                            :{BLACK}Informationway
+STR_013E_CAPACITIES                                             :{BLACK}Apacitiescay
+STR_013E_TOTAL_CARGO                                            :{BLACK}Otaltay Argocay
+STR_013F_CAPACITY                                               :{BLACK}Apacitycay: {LTBLUE}{CARGO}
+STR_CAPACITY_MULT                                               :{BLACK}Apacitycay: {LTBLUE}{CARGO} (xay{NUM})
+STR_013F_TOTAL_CAPACITY_TEXT                                    :{BLACK}Otaltay argocay apacitycay ofway isthay aintray:
+STR_013F_TOTAL_CAPACITY                                         :{LTBLUE}- {CARGO} ({SHORTCARGO})
+STR_TOTAL_CAPACITY_MULT                                         :{LTBLUE}- {CARGO} ({SHORTCARGO}) (xay{NUM})
+STR_0140_NEW_GAME                                               :{BLACK}Ewnay Amegay
+STR_0141_LOAD_GAME                                              :{BLACK}Oadlay Amegay
+STR_SINGLE_PLAYER                                               :{BLACK}Inglesay ayerplay
+STR_MULTIPLAYER                                                 :{BLACK}Ultiplayermay
+STR_SCENARIO_EDITOR                                             :{BLACK}Enarioscay Editorway
+
+STR_MAPSIZE                                                     :{BLACK}Apmay izesay:
+STR_BY                                                          :{BLACK}*
+STR_0148_GAME_OPTIONS                                           :{BLACK}Amegay Optionsway
+
+STR_0150_SOMEONE                                                :omeonesay{SKIP}{SKIP}
+STR_0151_MAP_OF_WORLD                                           :Apmay ofway orldway
+STR_0152_TOWN_DIRECTORY                                         :Owntay irectoryday
+STR_0153_SUBSIDIES                                              :Ubsidiessay
+
+STR_UNITS_IMPERIAL                                              :Imperialway
+STR_UNITS_METRIC                                                :Etricmay
+STR_UNITS_SI                                                    :ISay
+
+STR_UNITS_VELOCITY_IMPERIAL                                     :{COMMA} mphay
+STR_UNITS_VELOCITY_METRIC                                       :{COMMA} kmay/hay
+STR_UNITS_VELOCITY_SI                                           :{COMMA} may/say
+
+STR_UNITS_POWER_IMPERIAL                                        :{COMMA}hpay
+STR_UNITS_POWER_METRIC                                          :{COMMA}hpay
+STR_UNITS_POWER_SI                                              :{COMMA}kWay
+
+STR_UNITS_WEIGHT_SHORT_IMPERIAL                                 :{COMMA}tay
+STR_UNITS_WEIGHT_SHORT_METRIC                                   :{COMMA}tay
+STR_UNITS_WEIGHT_SHORT_SI                                       :{COMMA}kgay
+
+STR_UNITS_WEIGHT_LONG_IMPERIAL                                  :{COMMA} on{P "" s}tay
+STR_UNITS_WEIGHT_LONG_METRIC                                    :{COMMA} onne{P "" s}tay
+STR_UNITS_WEIGHT_LONG_SI                                        :{COMMA} kgay
+
+STR_UNITS_VOLUME_SHORT_IMPERIAL                                 :{COMMA}algay
+STR_UNITS_VOLUME_SHORT_METRIC                                   :{COMMA}lay
+STR_UNITS_VOLUME_SHORT_SI                                       :{COMMA}may³
+
+STR_UNITS_VOLUME_LONG_IMPERIAL                                  :{COMMA} allon{P "" s}gay
+STR_UNITS_VOLUME_LONG_METRIC                                    :{COMMA} itre{P "" s}lay
+STR_UNITS_VOLUME_LONG_SI                                        :{COMMA} may³
+
+STR_UNITS_FORCE_IMPERIAL                                        :{COMMA}xay10³ lbfay
+STR_UNITS_FORCE_METRIC                                          :{COMMA} ontay orcefay
+STR_UNITS_FORCE_SI                                              :{COMMA} kNay
+
+############ range for menu starts
+STR_0154_OPERATING_PROFIT_GRAPH                                 :Operatingway ofitpray aphgray
+STR_0155_INCOME_GRAPH                                           :Incomeway aphgray
+STR_0156_DELIVERED_CARGO_GRAPH                                  :Eliveredday argocay aphgray
+STR_0157_PERFORMANCE_HISTORY_GRAPH                              :Erformancepay istoryhay aphgray
+STR_0158_COMPANY_VALUE_GRAPH                                    :Ompanycay aluevay aphgray
+STR_0159_CARGO_PAYMENT_RATES                                    :Argocay aymentpay atesray
+STR_015A_COMPANY_LEAGUE_TABLE                                   :Ompanycay eaguelay abletay
+STR_PERFORMANCE_DETAIL_MENU                                     :Etailedday erformancepay atingray
+############ range for menu ends
+
+STR_015B_OPENTTD                                                :{WHITE}Aboutway OpenTTDWAY
+STR_015C_SAVE_GAME                                              :Avesay amegay
+STR_015D_LOAD_GAME                                              :Oadlay amegay
+STR_015E_QUIT_GAME                                              :Abandonway amegay
+STR_015F_QUIT                                                   :Exitway
+STR_ABANDON_GAME_QUERY                                          :{YELLOW}Areway ouyay uresay ouyay antway otay abandonway isthay amegay?
+STR_0161_QUIT_GAME                                              :{WHITE}Abandonway Amegay
+STR_SORT_ORDER_TIP                                              :{BLACK}Electsay ortingsay orderway (escendingday/ascendingway)
+STR_SORT_CRITERIA_TIP                                           :{BLACK}Electsay ortingsay iteriacray
+STR_SORT_BY                                                     :{BLACK}Ortsay ybay
+
+STR_SORT_BY_POPULATION                                          :{BLACK}Opulationpay
+STR_SORT_BY_PRODUCTION                                          :{BLACK}Oductionpray
+STR_SORT_BY_TYPE                                                :{BLACK}Ypetay
+STR_SORT_BY_TRANSPORTED                                         :{BLACK}Ansportedtray
+STR_SORT_BY_NAME                                                :{BLACK}Amenay
+STR_SORT_BY_DROPDOWN_NAME                                       :Amenay
+STR_SORT_BY_DATE                                                :{BLACK}Ateday
+STR_SORT_BY_NUMBER                                              :Umbernay
+STR_SORT_BY_PROFIT_LAST_YEAR                                    :Ofitpray astlay earyay
+STR_SORT_BY_PROFIT_THIS_YEAR                                    :Ofitpray isthay earyay
+STR_SORT_BY_AGE                                                 :Ageway
+STR_SORT_BY_RELIABILITY                                         :Eliabilityray
+STR_SORT_BY_TOTAL_CAPACITY_PER_CARGOTYPE                        :Otaltay apacitycay erpay argocay ypetay
+STR_SORT_BY_MAX_SPEED                                           :Aximummay eedspay
+STR_SORT_BY_MODEL                                               :Odelmay
+STR_SORT_BY_VALUE                                               :Aluevay
+STR_SORT_BY_FACILITY                                            :Ationstay ypetay
+STR_SORT_BY_WAITING                                             :Aitingway argocay aluevay
+STR_SORT_BY_RATING_MAX                                          :Argocay atingray
+STR_ENGINE_SORT_ENGINE_ID                                       :EngineIDWAY (assicclay ortsay)
+STR_ENGINE_SORT_COST                                            :Ostcay
+STR_ENGINE_SORT_POWER                                           :Owerpay
+STR_ENGINE_SORT_INTRO_DATE                                      :Introductionway Ateday
+STR_ENGINE_SORT_RUNNING_COST                                    :Unningray Ostcay
+STR_ENGINE_SORT_POWER_VS_RUNNING_COST                           :Owerpay/Unningray Ostcay
+STR_ENGINE_SORT_CARGO_CAPACITY                                  :Argocay Apacitycay
+STR_NO_WAITING_CARGO                                            :{BLACK}Onay argocay ofway anyway ypetay isway aitingway
+STR_SELECT_ALL_FACILITIES                                       :{BLACK}Electsay allway acilitiesfay
+STR_SELECT_ALL_TYPES                                            :{BLACK}Electsay allway argocay ypestay (includingway onay aitingway argocay)
+STR_AVAILABLE_TRAINS                                            :{BLACK}Availableway Ainstray
+STR_AVAILABLE_ROAD_VEHICLES                                     :{BLACK}Availableway Ehiclesvay
+STR_AVAILABLE_SHIPS                                             :{BLACK}Availableway Ipsshay
+STR_AVAILABLE_AIRCRAFT                                          :{BLACK}Availableway Aircraftway
+STR_AVAILABLE_ENGINES_TIP                                       :{BLACK}Eesay away istlay ofway availableway engineway esignsday orfay isthay ehiclevay ypetay.
+STR_MANAGE_LIST                                                 :{BLACK}Anagemay istlay
+STR_MANAGE_LIST_TIP                                             :{BLACK}Endsay instructionsway otay allway ehiclesvay inway isthay istlay
+STR_REPLACE_VEHICLES                                            :Eplaceray ehiclesvay
+STR_SEND_TRAIN_TO_DEPOT                                         :Endsay otay Epotday
+STR_SEND_ROAD_VEHICLE_TO_DEPOT                                  :Endsay otay Epotday
+STR_SEND_SHIP_TO_DEPOT                                          :Endsay otay Epotday
+STR_SEND_AIRCRAFT_TO_HANGAR                                     :Endsay otay Angarhay
+STR_SEND_FOR_SERVICING                                          :Endsay orfay Ervicingsay
+
+############ range for months starts
+STR_0162_JAN                                                    :Anjay
+STR_0163_FEB                                                    :Ebfay
+STR_0164_MAR                                                    :Armay
+STR_0165_APR                                                    :Aprway
+STR_0166_MAY                                                    :Aymay
+STR_0167_JUN                                                    :Unjay
+STR_0168_JUL                                                    :Uljay
+STR_0169_AUG                                                    :Augway
+STR_016A_SEP                                                    :Epsay
+STR_016B_OCT                                                    :Octway
+STR_016C_NOV                                                    :Ovnay
+STR_016D_DEC                                                    :Ecday
+############ range for months ends
+
+STR_016E                                                        :{TINYFONT}{STRING}{} {STRING}
+STR_016F                                                        :{TINYFONT}{STRING}{} {STRING}{}{NUM}
+STR_0170                                                        :{TINYFONT}{STRING}-
+STR_0171_PAUSE_GAME                                             :{BLACK}Ausepay amegay
+STR_0172_SAVE_GAME_ABANDON_GAME                                 :{BLACK}Avesay amegay, abandonway amegay, itquay
+STR_0173_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Isplayday istlay ofway ompany'scay ationsstay
+STR_0174_DISPLAY_MAP                                            :{BLACK}Isplayday apmay
+STR_0175_DISPLAY_MAP_TOWN_DIRECTORY                             :{BLACK}Isplayday apmay, owntay irectoryday
+STR_0176_DISPLAY_TOWN_DIRECTORY                                 :{BLACK}Isplayday owntay irectoryday
+STR_0177_DISPLAY_COMPANY_FINANCES                               :{BLACK}Isplayday ompanycay inancesfay informationway
+STR_0178_DISPLAY_COMPANY_GENERAL                                :{BLACK}Isplayday eneralgay ompanycay informationway
+STR_0179_DISPLAY_GRAPHS                                         :{BLACK}Isplayday aphsgray
+STR_017A_DISPLAY_COMPANY_LEAGUE                                 :{BLACK}Isplayday ompanycay eaguelay abletay
+STR_017B_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Isplayday istlay ofway ompany'scay ainstray
+STR_017C_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Isplayday istlay ofway ompany'scay oadray ehiclesvay
+STR_017D_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Isplayday istlay ofway ompany'scay ipsshay
+STR_017E_DISPLAY_LIST_OF_COMPANY                                :{BLACK}Isplayday istlay ofway ompany'scay aircraftway
+STR_017F_ZOOM_THE_VIEW_IN                                       :{BLACK}Oomzay ethay iewvay inway
+STR_0180_ZOOM_THE_VIEW_OUT                                      :{BLACK}Oomzay ethay iewvay outway
+STR_0181_BUILD_RAILROAD_TRACK                                   :{BLACK}Uildbay ailwayray acktray
+STR_0182_BUILD_ROADS                                            :{BLACK}Uildbay oadsray
+STR_0183_BUILD_SHIP_DOCKS                                       :{BLACK}Uildbay ipshay ocksday
+STR_0184_BUILD_AIRPORTS                                         :{BLACK}Uildbay airportsway
+STR_0185_PLANT_TREES_PLACE_SIGNS                                :{BLACK}Antplay eestray, aceplay ignssay etcway.
+STR_0186_LAND_BLOCK_INFORMATION                                 :{BLACK}Andlay areaway informationway
+STR_0187_OPTIONS                                                :{BLACK}Optionsway
+STR_0188                                                        :{BLACK}{SMALLUPARROW}
+STR_0189                                                        :{BLACK}{SMALLDOWNARROW}
+STR_018A_CAN_T_CHANGE_SERVICING                                 :{WHITE}An'tcay angechay ervicingsay intervalway...
+STR_018B_CLOSE_WINDOW                                           :{BLACK}Oseclay indowway
+STR_018C_WINDOW_TITLE_DRAG_THIS                                 :{BLACK}Indowway itletay - agdray isthay otay ovemay indowway
+STR_STICKY_BUTTON                                               :{BLACK}Arkmay isthay indowway asway uncloseableway ybay ethay 'Oseclay Allway Indows'way eykay
+STR_RESIZE_BUTTON                                               :{BLACK}Ickclay andway agdray otay esizeray isthay indowway
+STR_SAVELOAD_HOME_BUTTON                                        :{BLACK}Ickclay erehay otay umpjay otay ethay urrentcay efaultday avesay/oadlay irectoryday
+STR_018D_DEMOLISH_BUILDINGS_ETC                                 :{BLACK}Emolishday uildingsbay etcway. onway away aresquay ofway andlay
+STR_018E_LOWER_A_CORNER_OF_LAND                                 :{BLACK}Owerlay away ornercay ofway andlay
+STR_018F_RAISE_A_CORNER_OF_LAND                                 :{BLACK}Aiseray away ornercay ofway andlay
+STR_0190_SCROLL_BAR_SCROLLS_LIST                                :{BLACK}Ollscray arbay - ollsscray istlay upway/ownday
+STR_HSCROLL_BAR_SCROLLS_LIST                                    :{BLACK}Ollscray arbay - ollsscray istlay eftlay/ightray
+STR_0191_SHOW_LAND_CONTOURS_ON_MAP                              :{BLACK}Owshay andlay ontourscay onway apmay
+STR_0192_SHOW_VEHICLES_ON_MAP                                   :{BLACK}Owshay ehiclesvay onway apmay
+STR_0193_SHOW_INDUSTRIES_ON_MAP                                 :{BLACK}Owshay industriesway onway apmay
+STR_0194_SHOW_TRANSPORT_ROUTES_ON                               :{BLACK}Owshay ansporttray outesray onway apmay
+STR_0195_SHOW_VEGETATION_ON_MAP                                 :{BLACK}Owshay egetationvay onway apmay
+STR_0196_SHOW_LAND_OWNERS_ON_MAP                                :{BLACK}Owshay andlay ownersway onway apmay
+STR_0197_TOGGLE_TOWN_NAMES_ON_OFF                               :{BLACK}Oggletay owntay amesnay onway/offway onway apmay
+STR_0198_PROFIT_THIS_YEAR_LAST_YEAR                             :{TINYFONT}{BLACK}Ofitpray isthay earyay: {CURRENCY} (astlay earyay: {CURRENCY})
+
+############ range for service numbers starts
+STR_AGE                                                         :{COMMA} ear{P "" s}yay ({COMMA})
+STR_AGE_RED                                                     :{RED}{COMMA} ear{P "" s}yay ({COMMA})
+############ range for service numbers ends
+
+STR_019C_ROAD_VEHICLE                                           :Oadray ehiclevay
+STR_019D_AIRCRAFT                                               :Aircraftway
+STR_019E_SHIP                                                   :Ipshay
+STR_019F_TRAIN                                                  :Aintray
+STR_01A0_IS_GETTING_OLD                                         :{WHITE}{STRING} {COMMA} isway ettinggay oldway
+STR_01A1_IS_GETTING_VERY_OLD                                    :{WHITE}{STRING} {COMMA} isway ettinggay eryvay oldway
+STR_01A2_IS_GETTING_VERY_OLD_AND                                :{WHITE}{STRING} {COMMA} isway ettinggay eryvay oldway andway urgentlyway eedsnay eplacingray
+STR_01A3_LAND_AREA_INFORMATION                                  :{WHITE}Andlay Areaway Informationway
+STR_01A4_COST_TO_CLEAR_N_A                                      :{BLACK}Ostcay otay earclay: {LTBLUE}Nay/Away
+STR_01A5_COST_TO_CLEAR                                          :{BLACK}Ostcay otay earclay: {LTBLUE}{CURRENCY}
+STR_01A6_N_A                                                    :Nay/Away
+STR_01A7_OWNER                                                  :{BLACK}Ownerway: {LTBLUE}{STRING}
+STR_01A8_LOCAL_AUTHORITY                                        :{BLACK}Ocallay authorityway: {LTBLUE}{STRING}
+STR_01A9_NONE                                                   :Onenay
+STR_01AA_NAME                                                   :{BLACK}Amenay
+STR_01AB                                                        :{BLACK}{TINYFONT}{VEHICLE}
+
+############ range for days starts
+STR_01AC_1ST                                                    :1stay
+STR_01AD_2ND                                                    :2nday
+STR_01AE_3RD                                                    :3rday
+STR_01AF_4TH                                                    :4thay
+STR_01B0_5TH                                                    :5thay
+STR_01B1_6TH                                                    :6thay
+STR_01B2_7TH                                                    :7thay
+STR_01B3_8TH                                                    :8thay
+STR_01B4_9TH                                                    :9thay
+STR_01B5_10TH                                                   :10thay
+STR_01B6_11TH                                                   :11thay
+STR_01B7_12TH                                                   :12thay
+STR_01B8_13TH                                                   :13thay
+STR_01B9_14TH                                                   :14thay
+STR_01BA_15TH                                                   :15thay
+STR_01BB_16TH                                                   :16thay
+STR_01BC_17TH                                                   :17thay
+STR_01BD_18TH                                                   :18thay
+STR_01BE_19TH                                                   :19thay
+STR_01BF_20TH                                                   :20thay
+STR_01C0_21ST                                                   :21stay
+STR_01C1_22ND                                                   :22nday
+STR_01C2_23RD                                                   :23rday
+STR_01C3_24TH                                                   :24thay
+STR_01C4_25TH                                                   :25thay
+STR_01C5_26TH                                                   :26thay
+STR_01C6_27TH                                                   :27thay
+STR_01C7_28TH                                                   :28thay
+STR_01C8_29TH                                                   :29thay
+STR_01C9_30TH                                                   :30thay
+STR_01CA_31ST                                                   :31stay
+############ range for days ends
+
+STR_01CB                                                        :{TINYFONT}{COMMA}
+
+STR_01CE_CARGO_ACCEPTED                                         :{BLACK}Argocay acceptedway: {LTBLUE}
+
+STR_01D1_8                                                      :({COMMA}/8 {STRING})
+STR_01D2_JAZZ_JUKEBOX                                           :{WHITE}Azzjay Ukeboxjay
+STR_01D3_SOUND_MUSIC                                            :Oundsay/usicmay
+STR_01D4_SHOW_SOUND_MUSIC_WINDOW                                :{BLACK}Owshay oundsay/usicmay indowway
+STR_01D5_ALL                                                    :{TINYFONT}Allway
+STR_01D6_OLD_STYLE                                              :{TINYFONT}Oldway Ylestay
+STR_01D7_NEW_STYLE                                              :{TINYFONT}Ewnay Ylestay
+STR_01D8_EZY_STREET                                             :{TINYFONT}Ezyway Eetstray
+STR_01D9_CUSTOM_1                                               :{TINYFONT}Ustomcay 1
+STR_01DA_CUSTOM_2                                               :{TINYFONT}Ustomcay 2
+STR_01DB_MUSIC_VOLUME                                           :{BLACK}{TINYFONT}Usicmay Olumevay
+STR_01DC_EFFECTS_VOLUME                                         :{BLACK}{TINYFONT}Effectsway Olumevay
+STR_01DD_MIN_MAX                                                :{BLACK}{TINYFONT}INMay  '  '  ' '  '  '  MAXay
+STR_01DE_SKIP_TO_PREVIOUS_TRACK                                 :{BLACK}Ipskay otay eviouspray acktray inway electionsay
+STR_01DF_SKIP_TO_NEXT_TRACK_IN_SELECTION                        :{BLACK}Ipskay otay extnay acktray inway electionsay
+STR_01E0_STOP_PLAYING_MUSIC                                     :{BLACK}Opstay ayingplay usicmay
+STR_01E1_START_PLAYING_MUSIC                                    :{BLACK}Artstay ayingplay usicmay
+STR_01E2_DRAG_SLIDERS_TO_SET_MUSIC                              :{BLACK}Agdray idersslay otay etsay usicmay andway oundsay effectway olumesvay
+STR_01E3                                                        :{DKGREEN}{TINYFONT}--
+STR_01E4_0                                                      :{DKGREEN}{TINYFONT}0{COMMA}
+STR_01E5                                                        :{DKGREEN}{TINYFONT}{COMMA}
+STR_01E6                                                        :{DKGREEN}{TINYFONT}------
+STR_01E7                                                        :{DKGREEN}{TINYFONT}"{STRING}"
+STR_01E8_TRACK_XTITLE                                           :{BLACK}{TINYFONT}Acktray{SETX 88}Itletay
+STR_01E9_SHUFFLE                                                :{TINYFONT}Uffleshay
+STR_01EA_PROGRAM                                                :{TINYFONT}{BLACK}Ogrammepray
+STR_01EB_MUSIC_PROGRAM_SELECTION                                :{WHITE}Usicmay Ogrammepray Electionsay
+STR_01EC_0                                                      :{TINYFONT}{LTBLUE}0{COMMA} "{STRING}"
+STR_01ED                                                        :{TINYFONT}{LTBLUE}{COMMA} "{STRING}"
+STR_01EE_TRACK_INDEX                                            :{TINYFONT}{BLACK}Acktray Indexway
+STR_01EF_PROGRAM                                                :{TINYFONT}{BLACK}Ogrammepray - '{STRING}'
+STR_01F0_CLEAR                                                  :{TINYFONT}{BLACK}Earclay
+STR_01F1_SAVE                                                   :{TINYFONT}{BLACK}Avesay
+STR_01F2_CURRENT_PROGRAM_OF_MUSIC                               :{BLACK}Urrentcay ogrammepray ofway usicmay ackstray
+STR_01F3_SELECT_ALL_TRACKS_PROGRAM                              :{BLACK}Electsay 'allway acks'tray ogrammepray
+STR_01F4_SELECT_OLD_STYLE_MUSIC                                 :{BLACK}Electsay 'oldway ylestay usic'may ogrammepray
+STR_01F5_SELECT_NEW_STYLE_MUSIC                                 :{BLACK}Electsay 'ewnay ylestay usic'may ogrammepray
+STR_01F6_SELECT_CUSTOM_1_USER_DEFINED                           :{BLACK}Electsay 'Ustomcay 1' (userway-efinedday) ogrammepray
+STR_01F7_SELECT_CUSTOM_2_USER_DEFINED                           :{BLACK}Electsay 'Ustomcay 2' (userway-efinedday) ogrammepray
+STR_01F8_CLEAR_CURRENT_PROGRAM_CUSTOM1                          :{BLACK}Earclay urrentcay ogrammepray (Ustomcay1 orway Ustomcay2 onlyway)
+STR_01F9_SAVE_MUSIC_SETTINGS                                    :{BLACK}Avesay usicmay ettingssay
+STR_01FA_CLICK_ON_MUSIC_TRACK_TO                                :{BLACK}Ickclay onway usicmay acktray otay addway otay urrentcay ogrammepray (Ustomcay1 orway Ustomcay2 onlyway)
+STR_CLICK_ON_TRACK_TO_REMOVE                                    :{BLACK}Ickclay onway usicmay acktray otay emoveray itway omfray urrentcay ogrammepray (Ustomcay1 orway Ustomcay2 onlyway)
+STR_01FB_TOGGLE_PROGRAM_SHUFFLE                                 :{BLACK}Oggletay ogrammepray uffleshay onway/offway
+STR_01FC_SHOW_MUSIC_TRACK_SELECTION                             :{BLACK}Owshay usicmay acktray electionsay indowway
+STR_01FD_CLICK_ON_SERVICE_TO_CENTER                             :{BLACK}Ickclay onway ervicesay otay entrecay iewvay onway industryway/owntay
+STR_01FE_DIFFICULTY                                             :{BLACK}Ifficultyday ({STRING})
+STR_01FF                                                        :{TINYFONT}{BLACK}{DATE_LONG}
+STR_0200_LAST_MESSAGE_NEWS_REPORT                               :Astlay essagemay/ewsnay eportray
+STR_0201_MESSAGE_SETTINGS                                       :Essagemay ettingssay
+STR_MESSAGE_HISTORY_MENU                                        :Essagemay Istoryhay
+STR_0203_SHOW_LAST_MESSAGE_NEWS                                 :{BLACK}Owshay astlay essagemay/ewsnay eportray, owshay essagemay optionsway
+STR_0204_MESSAGE_OPTIONS                                        :{WHITE}Essagemay Optionsway
+STR_0205_MESSAGE_TYPES                                          :{BLACK}Essagemay ypestay:
+STR_0206_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Arrivalway ofway irstfay ehiclevay atway ayer'splay ationstay
+STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Arrivalway ofway irstfay ehiclevay atway ompetitor'scay ationstay
+STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Accidentsway / isastersday
+STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Ompanycay informationway
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Openway / oseclay ofway industriesway
+STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Economyway angeschay
+STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Adviceway / informationway onway ayer'splay ehiclesvay
+STR_020C_NEW_VEHICLES                                           :{YELLOW}Ewnay ehiclesvay
+STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Angeschay otay argocay acceptanceway
+STR_020E_SUBSIDIES                                              :{YELLOW}Ubsidiessay
+STR_020F_GENERAL_INFORMATION                                    :{YELLOW}Eneralgay informationway
+STR_MESSAGES_ALL                                                :{YELLOW}Etsay allway essagemay ypestay otay: Offway / Ummarysay/ Ullfay
+STR_MESSAGE_SOUND                                               :{YELLOW}Ayplay oundsay orfay ummarisedsay ewsnay essagesmay
+STR_0210_TOO_FAR_FROM_PREVIOUS_DESTINATIO                       :{WHITE}...ootay arfay omfray eviouspray estinationday
+STR_0211_TOP_COMPANIES_WHO_REACHED                              :{BIGFONT}{BLACK}Optay ompaniescay owhay eachedray {NUM}{}({STRING} Evellay)
+STR_TOP_COMPANIES_NETWORK_GAME                                  :{BIGFONT}{BLACK}Ompanycay Eaguelay Abletay inway {NUM}
+STR_0212                                                        :{BIGFONT}{COMMA}.
+STR_0213_BUSINESSMAN                                            :Usinessmanbay
+STR_0214_ENTREPRENEUR                                           :Entrepreneurway
+STR_0215_INDUSTRIALIST                                          :Industrialistway
+STR_0216_CAPITALIST                                             :Apitalistcay
+STR_0217_MAGNATE                                                :Agnatemay
+STR_0218_MOGUL                                                  :Ogulmay
+STR_0219_TYCOON_OF_THE_CENTURY                                  :Ycoontay ofway ethay Enturycay
+STR_HIGHSCORE_NAME                                              :{BIGFONT}{PLAYERNAME}, {COMPANY}
+STR_HIGHSCORE_STATS                                             :{BIGFONT}'{STRING}'   ({COMMA})
+STR_021B_ACHIEVES_STATUS                                        :{BLACK}{BIGFONT}{COMPANY} achievesway '{STRING}' atusstay!
+STR_021C_OF_ACHIEVES_STATUS                                     :{WHITE}{BIGFONT}{PLAYERNAME} ofway {COMPANY} achievesway '{STRING}' atusstay!
+STR_021F                                                        :{BLUE}{COMMA}
+STR_0221_OPENTTD                                                :{YELLOW}OpenTTDWAY
+STR_0222_SCENARIO_EDITOR                                        :{YELLOW}Enarioscay Editorway
+STR_0223_LAND_GENERATION                                        :{WHITE}Andlay Enerationgay
+STR_0224                                                        :{BLACK}{UPARROW}
+STR_0225                                                        :{BLACK}{DOWNARROW}
+STR_0228_INCREASE_SIZE_OF_LAND_AREA                             :{BLACK}Increaseway areaway ofway andlay otay owerlay/aiseray
+STR_0229_DECREASE_SIZE_OF_LAND_AREA                             :{BLACK}Ecreaseday areaway ofway andlay otay owerlay/aiseray
+STR_022A_GENERATE_RANDOM_LAND                                   :{BLACK}Enerategay andomray andlay
+STR_022B_RESET_LANDSCAPE                                        :{BLACK}Esetray andscapelay
+STR_022C_RESET_LANDSCAPE                                        :{WHITE}Esetray Andscapelay
+STR_RESET_LANDSCAPE_TOOLTIP                                     :{BLACK}Emoveray allway ayerplay-ownedway opertypray omfray ethay apmay
+STR_RESET_LANDSCAPE_CONFIRMATION_TEXT                           :{WHITE}Areway ouyay uresay ouyay antway otay emoveray allway ayerplay-ownedway opertypray?
+STR_022E_LANDSCAPE_GENERATION                                   :{BLACK}Andscapelay enerationgay
+STR_022F_TOWN_GENERATION                                        :{BLACK}Owntay enerationgay
+STR_0230_INDUSTRY_GENERATION                                    :{BLACK}Industryway enerationgay
+STR_0231_ROAD_CONSTRUCTION                                      :{BLACK}Oadray onstructioncay
+STR_0233_TOWN_GENERATION                                        :{WHITE}Owntay Enerationgay
+STR_0234_NEW_TOWN                                               :{BLACK}Ewnay Owntay
+STR_0235_CONSTRUCT_NEW_TOWN                                     :{BLACK}Onstructcay ewnay owntay
+STR_0236_CAN_T_BUILD_TOWN_HERE                                  :{WHITE}An'tcay uildbay owntay erehay...
+STR_0237_TOO_CLOSE_TO_EDGE_OF_MAP                               :{WHITE}...ootay oseclay otay edgeway ofway apmay
+STR_0238_TOO_CLOSE_TO_ANOTHER_TOWN                              :{WHITE}...ootay oseclay otay anotherway owntay
+STR_0239_SITE_UNSUITABLE                                        :{WHITE}...itesay unsuitableway
+STR_023A_TOO_MANY_TOWNS                                         :{WHITE}...ootay anymay ownstay
+STR_CANNOT_GENERATE_TOWN                                        :{WHITE}An'tcay uildbay anyway ownstay
+STR_NO_SPACE_FOR_TOWN                                           :{WHITE}...erethay isway onay oremay acespay onway ethay apmay
+STR_023B_INCREASE_SIZE_OF_TOWN                                  :{BLACK}Increaseway izesay ofway owntay
+STR_023C_EXPAND                                                 :{BLACK}Expandway
+STR_023D_RANDOM_TOWN                                            :{BLACK}Andomray Owntay
+STR_023E_BUILD_TOWN_IN_RANDOM_LOCATION                          :{BLACK}Uildbay owntay inway andomray ocationlay
+STR_023F_INDUSTRY_GENERATION                                    :{WHITE}Industryway Enerationgay
+STR_0240_COAL_MINE                                              :{BLACK}Oalcay Inemay
+STR_0241_POWER_STATION                                          :{BLACK}Owerpay Ationstay
+STR_0242_SAWMILL                                                :{BLACK}Awmillsay
+STR_0243_FOREST                                                 :{BLACK}Orestfay
+STR_0244_OIL_REFINERY                                           :{BLACK}Oilway Efineryray
+STR_0245_OIL_RIG                                                :{BLACK}Oilway Igray
+STR_0246_FACTORY                                                :{BLACK}Actoryfay
+STR_0247_STEEL_MILL                                             :{BLACK}Eelstay Illmay
+STR_0248_FARM                                                   :{BLACK}Armfay
+STR_0249_IRON_ORE_MINE                                          :{BLACK}Ironway Oreway Inemay
+STR_024A_OIL_WELLS                                              :{BLACK}Oilway Ellsway
+STR_024B_BANK                                                   :{BLACK}Ankbay
+STR_024C_PAPER_MILL                                             :{BLACK}Aperpay Illmay
+STR_024D_FOOD_PROCESSING_PLANT                                  :{BLACK}Oodfay Ocessingpray Antplay
+STR_024E_PRINTING_WORKS                                         :{BLACK}Intingpray Orksway
+STR_024F_GOLD_MINE                                              :{BLACK}Oldgay Inemay
+STR_0250_LUMBER_MILL                                            :{BLACK}Umberlay Illmay
+STR_0251_FRUIT_PLANTATION                                       :{BLACK}Uitfray Antationplay
+STR_0252_RUBBER_PLANTATION                                      :{BLACK}Ubberray Antationplay
+STR_0253_WATER_SUPPLY                                           :{BLACK}Aterway Upplysay
+STR_0254_WATER_TOWER                                            :{BLACK}Aterway Owertay
+STR_0255_DIAMOND_MINE                                           :{BLACK}Iamondday Inemay
+STR_0256_COPPER_ORE_MINE                                        :{BLACK}Oppercay Oreway Inemay
+STR_0257_COTTON_CANDY_FOREST                                    :{BLACK}Andyflosscay Orestfay
+STR_0258_CANDY_FACTORY                                          :{BLACK}Eetsway Actoryfay
+STR_0259_BATTERY_FARM                                           :{BLACK}Atterybay Armfay
+STR_025A_COLA_WELLS                                             :{BLACK}Olacay Ellsway
+STR_025B_TOY_SHOP                                               :{BLACK}Oytay Opshay
+STR_025C_TOY_FACTORY                                            :{BLACK}Oytay Actoryfay
+STR_025D_PLASTIC_FOUNTAINS                                      :{BLACK}Asticplay Ountainsfay
+STR_025E_FIZZY_DRINK_FACTORY                                    :{BLACK}Izzyfay Inkdray Actoryfay
+STR_025F_BUBBLE_GENERATOR                                       :{BLACK}Ubblebay Eneratorgay
+STR_0260_TOFFEE_QUARRY                                          :{BLACK}Offeetay Arryquay
+STR_0261_SUGAR_MINE                                             :{BLACK}Ugarsay Inemay
+STR_0262_CONSTRUCT_COAL_MINE                                    :{BLACK}Onstructcay Oalcay Inemay
+STR_0263_CONSTRUCT_POWER_STATION                                :{BLACK}Onstructcay Owerpay Ationstay
+STR_0264_CONSTRUCT_SAWMILL                                      :{BLACK}Onstructcay Awmillsay
+STR_0265_PLANT_FOREST                                           :{BLACK}Antplay Orestfay
+STR_0266_CONSTRUCT_OIL_REFINERY                                 :{BLACK}Onstructcay Oilway Efineryray
+STR_0267_CONSTRUCT_OIL_RIG_CAN_ONLY                             :{BLACK}Onstructcay Oilway Igray (Ancay onlyway ebay uiltbay earnay ethay edgesway ofway ethay apmay)
+STR_0268_CONSTRUCT_FACTORY                                      :{BLACK}Onstructcay Actoryfay
+STR_0269_CONSTRUCT_STEEL_MILL                                   :{BLACK}Onstructcay Eelstay Illmay
+STR_026A_CONSTRUCT_FARM                                         :{BLACK}Onstructcay Armfay
+STR_026B_CONSTRUCT_IRON_ORE_MINE                                :{BLACK}Onstructcay Ironway Oreway Inemay
+STR_026C_CONSTRUCT_OIL_WELLS                                    :{BLACK}Onstructcay Oilway Ellsway
+STR_026D_CONSTRUCT_BANK_CAN_ONLY                                :{BLACK}Onstructcay Ankbay (Ancay onlyway ebay uiltbay inway ownstay ithway away opulationpay eatergray anthay 1200)
+STR_026E_CONSTRUCT_PAPER_MILL                                   :{BLACK}Onstructcay Aperpay Illmay
+STR_026F_CONSTRUCT_FOOD_PROCESSING                              :{BLACK}Onstructcay Oodfay Ocessingpray Antplay
+STR_0270_CONSTRUCT_PRINTING_WORKS                               :{BLACK}Onstructcay Intingpray Orksway
+STR_0271_CONSTRUCT_GOLD_MINE                                    :{BLACK}Onstructcay Oldgay Inemay
+STR_0272_CONSTRUCT_BANK_CAN_ONLY                                :{BLACK}Onstructcay Ankbay (Ancay onlyway ebay uiltbay inway ownstay)
+STR_0273_CONSTRUCT_LUMBER_MILL_TO                               :{BLACK}Onstructcay Umberlay Illmay (otay earclay ainforestray andway oducepray Oodway)
+STR_0274_PLANT_FRUIT_PLANTATION                                 :{BLACK}Antplay Uitfray Antationplay
+STR_0275_PLANT_RUBBER_PLANTATION                                :{BLACK}Antplay Ubberray Antationplay
+STR_0276_CONSTRUCT_WATER_SUPPLY                                 :{BLACK}Onstructcay Aterway Upplysay
+STR_0277_CONSTRUCT_WATER_TOWER_CAN                              :{BLACK}Onstructcay Aterway Owertay (Ancay onlyway ebay uiltbay inway ownstay)
+STR_0278_CONSTRUCT_DIAMOND_MINE                                 :{BLACK}Onstructcay Iamondday Inemay
+STR_0279_CONSTRUCT_COPPER_ORE_MINE                              :{BLACK}Onstructcay Oppercay Oreway Inemay
+STR_027A_PLANT_COTTON_CANDY_FOREST                              :{BLACK}Antplay Andyflosscay Orestfay
+STR_027B_CONSTRUCT_CANDY_FACTORY                                :{BLACK}Onstructcay Eetsway Actoryfay
+STR_027C_CONSTRUCT_BATTERY_FARM                                 :{BLACK}Onstructcay Atterybay Armfay
+STR_027D_CONSTRUCT_COLA_WELLS                                   :{BLACK}Onstructcay Olacay Ellsway
+STR_027E_CONSTRUCT_TOY_SHOP                                     :{BLACK}Onstructcay Oytay Opshay
+STR_027F_CONSTRUCT_TOY_FACTORY                                  :{BLACK}Onstructcay Oytay Actoryfay
+STR_0280_CONSTRUCT_PLASTIC_FOUNTAINS                            :{BLACK}Onstructcay Asticplay Ountainsfay
+STR_0281_CONSTRUCT_FIZZY_DRINK_FACTORY                          :{BLACK}Onstructcay Izzyfay Inkdray Actoryfay
+STR_0282_CONSTRUCT_BUBBLE_GENERATOR                             :{BLACK}Onstructcay Ubblebay Eneratorgay
+STR_0283_CONSTRUCT_TOFFEE_QUARRY                                :{BLACK}Onstructcay Offeetay Arryquay
+STR_0284_CONSTRUCT_SUGAR_MINE                                   :{BLACK}Onstructcay Ugarsay Inemay
+STR_0285_CAN_T_BUILD_HERE                                       :{WHITE}An'tcay uildbay {STRING} erehay...
+STR_0286_MUST_BUILD_TOWN_FIRST                                  :{WHITE}...ustmay uildbay owntay irstfay
+STR_0287_ONLY_ONE_ALLOWED_PER_TOWN                              :{WHITE}...onlyway oneway allowedway erpay owntay
+STR_0288_PLANT_TREES                                            :{BLACK}Antplay eestray
+STR_0289_PLACE_SIGN                                             :{BLACK}Aceplay ignsay
+STR_028A_RANDOM_TREES                                           :{BLACK}Andomray Eestray
+STR_028B_PLANT_TREES_RANDOMLY_OVER                              :{BLACK}Antplay eestray andomlyray overway andscapelay
+STR_028C_PLACE_ROCKY_AREAS_ON_LANDSCAPE                         :{BLACK}Aceplay ockyray areasway onway andscapelay
+STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Aceplay ighthouselay
+STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Aceplay ansmittertray
+STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Efineday esertday areaway.{}Esspray andway oldhay CTRLay otay emoveray itway
+STR_CREATE_LAKE                                                 :{BLACK}Efineday aterway areaway.{}Akemay away analcay, unlessway CTRLay isway eldhay ownday atway easay evellay, enwhay itway illway oodflay ethay urroundingssay insteadway
+STR_0290_DELETE                                                 :{BLACK}Eleteday
+STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Eleteday isthay owntay ompletelycay
+STR_0292_SAVE_SCENARIO                                          :Avesay enarioscay
+STR_0293_LOAD_SCENARIO                                          :Oadlay enarioscay
+STR_LOAD_HEIGHTMAP                                              :Oadlay eightmaphay
+STR_0294_QUIT_EDITOR                                            :Itquay editorway
+STR_0295                                                        :
+STR_0296_QUIT                                                   :Itquay
+STR_0297_SAVE_SCENARIO_LOAD_SCENARIO                            :{BLACK}Avesay enarioscay, oadlay enarioscay, abandonway enarioscay editorway, itquay
+STR_0298_LOAD_SCENARIO                                          :{WHITE}Oadlay Enarioscay
+STR_0299_SAVE_SCENARIO                                          :{WHITE}Avesay Enarioscay
+STR_029A_PLAY_SCENARIO                                          :{BLACK}Ayplay Enarioscay
+STR_PLAY_HEIGHTMAP                                              :{BLACK}Ayplay Eightmaphay
+STR_PLAY_HEIGHTMAP_HINT                                         :{BLACK}Artstay away ewnay amegay, usingway away eightmaphay asway andscapelay
+STR_QUIT_SCENARIO_QUERY                                         :{YELLOW}Areway ouyay uresay ouyay antway otay itquay isthay enarioscay ?
+STR_029C_QUIT_EDITOR                                            :{WHITE}Itquay Editorway
+STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...ancay onlyway ebay uiltbay inway ownstay ithway away opulationpay ofway atway eastlay 1200
+STR_029E_MOVE_THE_STARTING_DATE                                 :{BLACK}Ovemay ethay artingstay ateday ackwardbay 1 earyay
+STR_029F_MOVE_THE_STARTING_DATE                                 :{BLACK}Ovemay ethay artingstay ateday orwardfay 1 earyay
+STR_02A0_ENDS_OF_BRIDGE_MUST_BOTH                               :{WHITE}...endsway ofway idgebray ustmay othbay ebay onway andlay
+STR_02A1_SMALL                                                  :{BLACK}Allsmay
+STR_02A2_MEDIUM                                                 :{BLACK}Ediummay
+STR_02A3_LARGE                                                  :{BLACK}Argelay
+STR_SCENARIO_EDITOR_CITY                                        :{BLACK}Itycay
+STR_02A4_SELECT_TOWN_SIZE                                       :{BLACK}Electsay owntay izesay
+STR_02A5_TOWN_SIZE                                              :{YELLOW}Owntay izesay:
+
+STR_02B6                                                        :{STRING}  -  {STRING}
+STR_02B7_SHOW_LAST_MESSAGE_OR_NEWS                              :{BLACK}Owshay astlay essagemay orway ewsnay eportray
+STR_OFF                                                         :Offway
+STR_SUMMARY                                                     :Ummarysay
+STR_FULL                                                        :Ullfay
+STR_02BA                                                        :{SILVER}- -  {COMPANY}  - -
+STR_02BB_TOWN_DIRECTORY                                         :Owntay irectoryday
+STR_02BC_VEHICLE_DESIGN_NAMES                                   :{BLACK}Ehiclevay esignday amesnay
+STR_02BD                                                        :{BLACK}{STRING}
+STR_02BE_DEFAULT                                                :Efaultday
+STR_02BF_CUSTOM                                                 :Ustomcay
+STR_02C0_SAVE_CUSTOM_NAMES                                      :{BLACK}Avesay ustomcay amesnay
+STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION                         :{BLACK}Ehiclevay esignday amesnay electionsay
+STR_02C2_SAVE_CUSTOMIZED_VEHICLE                                :{BLACK}Avesay ustomisedcay ehiclevay esignday amesnay
+
+STR_CHECKMARK                                                   :{CHECKMARK}
+############ range for menu starts
+STR_02C3_GAME_OPTIONS                                           :Amegay optionsway
+STR_02C5_DIFFICULTY_SETTINGS                                    :Ifficultyday ettingssay
+STR_02C7_CONFIG_PATCHES                                         :Onfigurecay atchespay
+STR_NEWGRF_SETTINGS                                             :EwGRFnay ettingssay
+STR_TRANSPARENCY_OPTIONS                                        :Ansparencytray optionsway
+STR_GAMEOPTMENU_0A                                              :
+STR_02CA_TOWN_NAMES_DISPLAYED                                   :{SETX 12}Owntay amesnay isplayedday
+STR_02CC_STATION_NAMES_DISPLAYED                                :{SETX 12}Ationstay amesnay isplayedday
+STR_02CE_SIGNS_DISPLAYED                                        :{SETX 12}Ignssay isplayedday
+STR_WAYPOINTS_DISPLAYED2                                        :{SETX 12}Aypointsway isplayedday
+STR_02D0_FULL_ANIMATION                                         :{SETX 12}Ullfay animationway
+STR_02D2_FULL_DETAIL                                            :{SETX 12}Ullfay etailday
+STR_02D4_TRANSPARENT_BUILDINGS                                  :{SETX 12}Ansparenttray uildingsbay
+STR_TRANSPARENT_SIGNS                                           :{SETX 12}Ansparenttray ationstay ignssay
+############ range ends here
+
+############ range for menu starts
+STR_02D5_LAND_BLOCK_INFO                                        :Andlay areaway informationway
+STR_02D6                                                        :
+STR_CONSOLE_SETTING                                             :Oggletay Onsolecay
+STR_02D7_SCREENSHOT_CTRL_S                                      :Eenshotscray (Ctrlay-Say)
+STR_02D8_GIANT_SCREENSHOT_CTRL_G                                :Iantgay Eenshotscray (Ctrlay-Gay)
+STR_02D9_ABOUT_OPENTTD                                          :Aboutway 'OpenTTD'WAY
+############ range ends here
+
+STR_02DB_OFF                                                    :{BLACK}Offway
+STR_02DA_ON                                                     :{BLACK}Onway
+STR_02DC_DISPLAY_SUBSIDIES                                      :{BLACK}Isplayday ubsidiessay
+STR_02DD_SUBSIDIES                                              :Ubsidiessay
+STR_02DE_MAP_OF_WORLD                                           :Apmay ofway orldway
+STR_EXTRA_VIEW_PORT                                             :Extraway iewportvay
+STR_SIGN_LIST                                                   :Ignsay istlay
+STR_02DF_TOWN_DIRECTORY                                         :Owntay irectoryday
+STR_TOWN_POPULATION                                             :{BLACK}Orldway opulationpay: {COMMA}
+STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Iewportvay {COMMA}
+STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN                                :{BLACK}Opycay otay iewportvay
+STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN_TT                             :{BLACK}Opycay ethay ocationlay ofway ethay obalglay iewvay otay isthay iewportvay
+STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW                                :{BLACK}Astepay omfray iewportvay
+STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT                             :{BLACK}Astepay ethay ocationlay ofway isthay iewportvay otay ethay obalglay iewvay
+
+STR_02E0_CURRENCY_UNITS                                         :{BLACK}Urrencycay unitsway
+STR_02E1                                                        :{BLACK}{SKIP}{STRING}
+STR_02E2_CURRENCY_UNITS_SELECTION                               :{BLACK}Urrencycay unitsway electionsay
+STR_MEASURING_UNITS                                             :{BLACK}Easuringmay unitsway
+STR_02E4                                                        :{BLACK}{SKIP}{SKIP}{STRING}
+STR_MEASURING_UNITS_SELECTION                                   :{BLACK}Easuringmay unitsway electionsay
+STR_02E6_ROAD_VEHICLES                                          :{BLACK}Oadray ehiclesvay
+STR_02E7                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{STRING}
+STR_02E8_SELECT_SIDE_OF_ROAD_FOR                                :{BLACK}Electsay idesay ofway oadray orfay ehiclesvay otay ivedray onway
+STR_02E9_DRIVE_ON_LEFT                                          :Ivedray onway eftlay
+STR_02EA_DRIVE_ON_RIGHT                                         :Ivedray onway ightray
+STR_02EB_TOWN_NAMES                                             :{BLACK}Owntay amesnay
+STR_02EC                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_02ED_SELECT_STYLE_OF_TOWN_NAMES                             :{BLACK}Electsay ylestay ofway owntay amesnay
+
+STR_02F4_AUTOSAVE                                               :{BLACK}Autosaveway
+STR_02F5                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_02F6_SELECT_INTERVAL_BETWEEN                                :{BLACK}Electsay intervalway etweenbay automaticway amegay avessay
+STR_02F7_OFF                                                    :Offway
+STR_02F8_EVERY_3_MONTHS                                         :Everyway 3 onthsmay
+STR_02F9_EVERY_6_MONTHS                                         :Everyway 6 onthsmay
+STR_02FA_EVERY_12_MONTHS                                        :Everyway 12 onthsmay
+STR_02FB_START_A_NEW_GAME                                       :{BLACK}Artstay away ewnay amegay
+STR_02FC_LOAD_A_SAVED_GAME                                      :{BLACK}Oadlay away avedsay amegay
+STR_02FE_CREATE_A_CUSTOMIZED_GAME                               :{BLACK}Eatecray away ustomisedcay amegay orldway/enarioscay
+STR_02FF_SELECT_SINGLE_PLAYER_GAME                              :{BLACK}Electsay inglesay-ayerplay amegay
+STR_0300_SELECT_MULTIPLAYER_GAME                                :{BLACK}Electsay ultiplayermay amegay ofway 2-8 ayersplay
+STR_0301_DISPLAY_GAME_OPTIONS                                   :{BLACK}Isplayday amegay optionsway
+STR_0302_DISPLAY_DIFFICULTY_OPTIONS                             :{BLACK}Isplayday ifficultyday optionsway
+STR_0303_START_A_NEW_GAME_USING                                 :{BLACK}Artstay away ewnay amegay, usingway away ustomisedcay enarioscay
+STR_0304_QUIT                                                   :{BLACK}Itquay
+STR_0305_QUIT_OPENTTD                                           :{BLACK}Itquay 'OpenTTD'WAY
+STR_0307_OPENTTD                                                :{WHITE}OpenTTDWAY {REV}
+STR_030D_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...ancay onlyway ebay uiltbay inway ownstay
+STR_030E_SELECT_TEMPERATE_LANDSCAPE                             :{BLACK}Electsay 'emperate'tay andscapelay ylestay
+STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE                            :{BLACK}Electsay 'ubsay-arctic'WAY andscapelay ylestay
+STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE                          :{BLACK}Electsay 'ubsay-opical'tray andscapelay ylestay
+STR_0311_SELECT_TOYLAND_LANDSCAPE                               :{BLACK}Electsay 'oyland'tay andscapelay ylestay
+STR_0312_FUND_CONSTRUCTION_OF_NEW                               :{BLACK}Undfay onstructioncay ofway ewnay industryway
+
+############ range for menu starts
+STR_INDUSTRY_DIR                                                :Industryway Irectoryday
+STR_0313_FUND_NEW_INDUSTRY                                      :Undfay ewnay industryway
+############ range ends here
+
+STR_0314_FUND_NEW_INDUSTRY                                      :{WHITE}Undfay ewnay industryway
+STR_JUST_STRING                                                 :{STRING}
+STR_0316_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...ancay onlyway ebay uiltbay inway ownstay
+STR_0317_CAN_ONLY_BE_BUILT_IN_RAINFOREST                        :{WHITE}...ancay onlyway ebay uiltbay inway ainforestray areasway
+STR_0318_CAN_ONLY_BE_BUILT_IN_DESERT                            :{WHITE}...ancay onlyway ebay uiltbay inway esertday areasway
+STR_0319_PAUSED                                                 :{YELLOW}* *  USEDPAay  *  *
+
+STR_031B_SCREENSHOT_SUCCESSFULLY                                :{WHITE}Eenshotscray uccessfullysay avedsay asway '{STRING}'
+STR_031C_SCREENSHOT_FAILED                                      :{WHITE}Eenshotscray ailedfay!
+
+STR_0329_PURCHASE_LAND_FOR_FUTURE                               :{BLACK}Urchasepay andlay orfay uturefay useway
+STR_032F_AUTOSAVE                                               :{RED}AUTOSAVEWAY
+STR_SAVING_GAME                                                 :{RED}*  *  INGSAVay EGAMay  *  *
+STR_SAVE_STILL_IN_PROGRESS                                      :{WHITE}Avingsay illstay inway ogresspray,{}easeplay aitway untilway itway isway inishedfay!
+STR_0330_SELECT_EZY_STREET_STYLE                                :{BLACK}Electsay 'Ezyway Eetstray ylestay usic'may ogrammepray
+
+STR_0335_6                                                      :{BLACK}6
+STR_0336_7                                                      :{BLACK}7
+
+############ start of townname region
+STR_TOWNNAME_ORIGINAL_ENGLISH                                   :Englishway (Originalway)
+STR_TOWNNAME_FRENCH                                             :Enchfray
+STR_TOWNNAME_GERMAN                                             :Ermangay
+STR_TOWNNAME_ADDITIONAL_ENGLISH                                 :Englishway (Additionalway)
+STR_TOWNNAME_LATIN_AMERICAN                                     :Atinlay-Americanway
+STR_TOWNNAME_SILLY                                              :Illysay
+STR_TOWNNAME_SWEDISH                                            :Edishsway
+STR_TOWNNAME_DUTCH                                              :Utchday
+STR_TOWNNAME_FINNISH                                            :Innishfay
+STR_TOWNNAME_POLISH                                             :Olishpay
+STR_TOWNNAME_SLOVAKISH                                          :Ovakishslay
+STR_TOWNNAME_NORWEGIAN                                          :Orwegiannay
+STR_TOWNNAME_HUNGARIAN                                          :Ungarianhay
+STR_TOWNNAME_AUSTRIAN                                           :Austrianway
+STR_TOWNNAME_ROMANIAN                                           :Omanianray
+STR_TOWNNAME_CZECH                                              :Echczay
+STR_TOWNNAME_SWISS                                              :Isssway
+STR_TOWNNAME_DANISH                                             :Anishday
+STR_TOWNNAME_TURKISH                                            :Urkishtay
+STR_TOWNNAME_ITALIAN                                            :Italianway
+STR_TOWNNAME_CATALAN                                            :Atalancay
+############ end of townname region
+
+STR_CURR_GBP                                                    :Oundspay (£)
+STR_CURR_USD                                                    :Ollarsday ($)
+STR_CURR_EUR                                                    :Euroway (€)
+STR_CURR_YEN                                                    :Enyay (¥)
+STR_CURR_ATS                                                    :Austrianway Illingshay (ATSWAY)
+STR_CURR_BEF                                                    :Elgianbay Ancfray (EFBay)
+STR_CURR_CHF                                                    :Isssway Ancfray (CHFay)
+STR_CURR_CZK                                                    :Echczay Orunakay (CZKay)
+STR_CURR_DEM                                                    :Eutschmarkday (EMDay)
+STR_CURR_DKK                                                    :Anishday Onekray (DKKay)
+STR_CURR_ESP                                                    :Esetapay (ESPWAY)
+STR_CURR_FIM                                                    :Innishfay Arkkamay (IMFay)
+STR_CURR_FRF                                                    :Ancfray (FRFay)
+STR_CURR_GRD                                                    :Eekgray Achmadray (GRDay)
+STR_CURR_HUF                                                    :Ungarianhay Orintfay (UFHay)
+STR_CURR_ISK                                                    :Icelandicway Onakray (ISKWAY)
+STR_CURR_ITL                                                    :Italianway Iralay (ITLWAY)
+STR_CURR_NLG                                                    :Utchday Uildergay (NLGay)
+STR_CURR_NOK                                                    :Orwegiannay Onekray (OKNay)
+STR_CURR_PLN                                                    :Olishpay Otyzlay (PLNay)
+STR_CURR_ROL                                                    :Omanianray Eulay (OLRay)
+STR_CURR_RUR                                                    :Ussianray Ublesray (URRay)
+STR_CURR_SIT                                                    :Ovenianslay Olartay (ITSay)
+STR_CURR_SEK                                                    :Edishsway Onakray (EKSay)
+STR_CURR_YTL                                                    :Urkishtay Iralay (YTLay)
+STR_CURR_SKK                                                    :Ovakslay Orunakay (SKKay)
+STR_CURR_BRR                                                    :Azilianbray Ealray (BRLay)
+
+STR_CURR_CUSTOM                                                 :Ustomcay...
+
+STR_OPTIONS_LANG                                                :{BLACK}Anguagelay
+STR_OPTIONS_LANG_CBO                                            :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_OPTIONS_LANG_TIP                                            :{BLACK}Electsay ethay interfaceway anguagelay otay useway
+
+STR_OPTIONS_FULLSCREEN                                          :{BLACK}Ullscreenfay
+STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Eckchay isthay oxbay otay ayplay OpenTTDWAY ullscreenfay odemay
+
+STR_OPTIONS_RES                                                 :{BLACK}Eenscray esolutionray
+STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_OPTIONS_RES_TIP                                             :{BLACK}Electsay ethay eenscray esolutionray otay useway
+
+STR_OPTIONS_SCREENSHOT_FORMAT                                   :{BLACK}Eenshotscray ormatfay
+STR_OPTIONS_SCREENSHOT_FORMAT_CBO                               :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_OPTIONS_SCREENSHOT_FORMAT_TIP                               :{BLACK}Electsay ethay eenshotscray ormatfay otay useway
+
+STR_AUTOSAVE_1_MONTH                                            :Everyway onthmay
+STR_AUTOSAVE_FAILED                                             :{WHITE}Autosaveway ailedfay
+
+STR_MONTH_JAN                                                   :Anuaryjay
+STR_MONTH_FEB                                                   :Ebruaryfay
+STR_MONTH_MAR                                                   :Archmay
+STR_MONTH_APR                                                   :Aprilway
+STR_MONTH_MAY                                                   :Aymay
+STR_MONTH_JUN                                                   :Unejay
+STR_MONTH_JUL                                                   :Ulyjay
+STR_MONTH_AUG                                                   :Augustway
+STR_MONTH_SEP                                                   :Eptembersay
+STR_MONTH_OCT                                                   :Octoberway
+STR_MONTH_NOV                                                   :Ovembernay
+STR_MONTH_DEC                                                   :Ecemberday
+
+STR_HEADING_FOR_STATION                                         :{LTBLUE}Eadinghay orfay {STATION}
+STR_HEADING_FOR_STATION_VEL                                     :{LTBLUE}Eadinghay orfay {STATION}, {VELOCITY}
+STR_NO_ORDERS                                                   :{LTBLUE}Onay ordersway
+STR_NO_ORDERS_VEL                                               :{LTBLUE}Onay ordersway, {VELOCITY}
+
+STR_PASSENGERS                                                  :assengerspay
+STR_BAGS                                                        :agsbay
+STR_TONS                                                        :onnestay
+STR_LITERS                                                      :itreslay
+STR_ITEMS                                                       :itemsway
+STR_CRATES                                                      :atescray
+STR_RES_OTHER                                                   :otherway
+STR_NOTHING                                                     :
+
+STR_SMALL_RIGHT_ARROW                                           :{TINYFONT}{RIGHTARROW}
+
+STR_CANT_SHARE_ORDER_LIST                                       :{WHITE}An'tcay areshay orderway istlay...
+STR_CANT_COPY_ORDER_LIST                                        :{WHITE}An'tcay opycay orderway istlay...
+STR_END_OF_SHARED_ORDERS                                        :{SETX 10}- - Endway ofway Aredshay Ordersway - -
+
+STR_TRAIN_IS_LOST                                               :{WHITE}Aintray {COMMA} isway ostlay.
+STR_TRAIN_IS_UNPROFITABLE                                       :{WHITE}Aintray {COMMA}'say ofitpray astlay earyay asway {CURRENCY}
+STR_EURO_INTRODUCE                                              :{BLACK}{BIGFONT}Europeanway Onetarymay Unionway!{}{}Ethay Euroway isway introducedway asway ethay olesay urrencycay orfay everydayway ansactionstray inway ouryay ountrycay!
+
+# Start of order review system.
+# DON'T ADD OR REMOVE LINES HERE
+STR_TRAIN_HAS_TOO_FEW_ORDERS                                    :{WHITE}Aintray {COMMA} ashay ootay ewfay ordersway inway ethay eduleschay
+STR_TRAIN_HAS_VOID_ORDER                                        :{WHITE}Aintray {COMMA} ashay away oidvay orderway
+STR_TRAIN_HAS_DUPLICATE_ENTRY                                   :{WHITE}Aintray {COMMA} ashay uplicateday ordersway
+STR_TRAIN_HAS_INVALID_ENTRY                                     :{WHITE}Aintray {COMMA} ashay anway invalidway ationstay inway itsway ordersway
+STR_ROADVEHICLE_HAS_TOO_FEW_ORDERS                              :{WHITE}Oadray Ehiclevay {COMMA} ashay ootay ewfay ordersway inway ethay eduleschay
+STR_ROADVEHICLE_HAS_VOID_ORDER                                  :{WHITE}Oadray Ehiclevay {COMMA} ashay away oidvay orderway
+STR_ROADVEHICLE_HAS_DUPLICATE_ENTRY                             :{WHITE}Oadray Ehiclevay {COMMA} ashay uplicateday ordersway
+STR_ROADVEHICLE_HAS_INVALID_ENTRY                               :{WHITE}Oadray Ehiclevay {COMMA} ashay anway invalidway ationstay inway itsway ordersway
+STR_SHIP_HAS_TOO_FEW_ORDERS                                     :{WHITE}Ipshay {COMMA} ashay ootay ewfay ordersway inway ethay eduleschay
+STR_SHIP_HAS_VOID_ORDER                                         :{WHITE}Ipshay {COMMA} ashay away oidvay orderway
+STR_SHIP_HAS_DUPLICATE_ENTRY                                    :{WHITE}Ipshay {COMMA} ashay uplicateday ordersway
+STR_SHIP_HAS_INVALID_ENTRY                                      :{WHITE}Ipshay {COMMA} ashay anway invalidway ationstay inway itsway ordersway
+STR_AIRCRAFT_HAS_TOO_FEW_ORDERS                                 :{WHITE}Aircraftway {COMMA} ashay ootay ewfay ordersway inway ethay eduleschay
+STR_AIRCRAFT_HAS_VOID_ORDER                                     :{WHITE}Aircraftway {COMMA} ashay away oidvay orderway
+STR_AIRCRAFT_HAS_DUPLICATE_ENTRY                                :{WHITE}Aircraftway {COMMA} ashay uplicateday ordersway
+STR_AIRCRAFT_HAS_INVALID_ENTRY                                  :{WHITE}Aircraftway {COMMA} ashay anway invalidway ationstay inway itsway ordersway
+# end of order system
+
+STR_TRAIN_AUTORENEW_FAILED                                      :{WHITE}Autorenewway ailedfay onway aintray {COMMA} (oneymay imitlay)
+STR_ROADVEHICLE_AUTORENEW_FAILED                                :{WHITE}Autorenewway ailedfay onway oadray ehiclevay {COMMA} (oneymay imitlay)
+STR_SHIP_AUTORENEW_FAILED                                       :{WHITE}Autorenewway ailedfay onway ipshay {COMMA} (oneymay imitlay)
+STR_AIRCRAFT_AUTORENEW_FAILED                                   :{WHITE}Autorenewway ailedfay onway aircraftway {COMMA} (oneymay imitlay)
+STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT                            :{WHITE}Aintray {COMMA} isway ootay onglay afterway eplacementray
+
+STR_CONFIG_PATCHES                                              :{BLACK}Onfigurecay Atchespay
+STR_CONFIG_PATCHES_TIP                                          :{BLACK}Onfigurecay ethay atchespay
+STR_CONFIG_PATCHES_CAPTION                                      :{WHITE}Onfigurecay Atchespay
+
+STR_CONFIG_PATCHES_OFF                                          :Offway
+STR_CONFIG_PATCHES_ON                                           :Onway
+STR_CONFIG_PATCHES_VEHICLESPEED                                 :{LTBLUE}Owshay ehiclevay eedspay inway atusstay arbay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_BUILDONSLOPES                                :{LTBLUE}Allowway uildingbay onway opesslay andway oastscay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_CATCHMENT                                    :{LTBLUE}Allowway oremay ealisticallyray izedsay atchmentcay areasway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_EXTRADYNAMITE                                :{LTBLUE}Allowway emovalray ofway oremay owntay-ownedway oadsray, idgesbray, etcway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAMMOTHTRAINS                                :{LTBLUE}Enableway uildingbay eryvay onglay ainstray: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_REALISTICACCEL                               :{LTBLUE}Enableway ealisticray accelerationway orfay ainstray: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_FORBID_90_DEG                                :{LTBLUE}Orbidfay ainstray andway ipsshay otay akemay 90 egday urnstay: {ORANGE}{STRING} {LTBLUE} (equiresray NPFay)
+STR_CONFIG_PATCHES_JOINSTATIONS                                 :{LTBLUE}Oinjay aintray ationsstay uiltbay extnay otay eachway otherway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_FULLLOADANY                                  :{LTBLUE}Eavelay ationstay enwhay anyway argocay isway ullfay, ifway 'ullfay oad'lay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_IMPROVEDLOAD                                 :{LTBLUE}Useway improvedway oadinglay algorithmway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_GRADUAL_LOADING                              :{LTBLUE}Oadlay ehiclesvay aduallygray: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_INFLATION                                    :{LTBLUE}Inflationway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SELECTGOODS                                  :{LTBLUE}Eliverday argocay otay away ationstay onlyway enwhay erethay isway away emandday: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LONGBRIDGES                                  :{LTBLUE}Allowway uildingbay eryvay onglay idgesbray: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_GOTODEPOT                                    :{LTBLUE}Allowway otogay epotday ordersway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD             :{LTBLUE}Anualmay imarypray industryway onstructioncay ethodmay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_NONE        :onenay
+STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL      :asway otherway industriesway
+STR_CONFIG_PATCHES_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :ospectingpray
+STR_CONFIG_PATCHES_MULTIPINDTOWN                                :{LTBLUE}Allowway ultiplemay imilarsay industriesway erpay owntay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SAMEINDCLOSE                                 :{LTBLUE}Industriesway ofway ethay amesay ypetay ancay ebay uiltbay oseclay otay eachway otherway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LONGDATE                                     :{LTBLUE}Alwaysway owshay onglay ateday inway ethay atusstay arbay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SIGNALSIDE                                   :{LTBLUE}Owshay ignalssay onway ethay ivedray idesay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SHOWFINANCES                                 :{LTBLUE}Owshay inancesfay indowway atway ethay endway ofway ethay earyay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_NEW_NONSTOP                                  :{LTBLUE}AtchtTDPay ompatiblecay onstopnay andlinghay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ROADVEH_QUEUE                                :{LTBLUE}Oadray ehiclevay eueingquay (ithway antumquay effectsway): {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AUTOSCROLL                                   :{LTBLUE}Anpay indowway enwhay ousemay isway atway ethay edgeway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_BRIBE                                        :{LTBLUE}Allowway ibingbray ofway ethay ocallay authorityway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_NONUNIFORM_STATIONS                          :{LTBLUE}Onuniformnay ationsstay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_NEW_PATHFINDING_ALL                          :{LTBLUE}Ewnay obalglay athfindingpay (NPFay, overridesway NTPay): {ORANGE}{STRING}
+STR_CONFIG_PATCHES_FREIGHT_TRAINS                               :{LTBLUE}Eightway ultipliermay orfay eightfray otay imulatesay eavyhay ainstray: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_STOP_ON_TOWN_ROAD                            :{LTBLUE}Allowway ivedray-oughthray oadray opsstay onway owntay ownedway oadsray: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ADJACENT_STATIONS                            :{LTBLUE}Allowway uildingbay adjacentway ationsstay: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_SMALL_AIRPORTS                               :{LTBLUE}Alwaysway allowway allsmay airportsway: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_WARN_LOST_TRAIN                              :{LTBLUE}Arnway ifway aintray isway ostlay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ORDER_REVIEW                                 :{LTBLUE}Eviewray ehicles'vay ordersway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ORDER_REVIEW_OFF                             :onay
+STR_CONFIG_PATCHES_ORDER_REVIEW_EXDEPOT                         :esyay, utbay excludeway oppedstay ehiclesvay
+STR_CONFIG_PATCHES_ORDER_REVIEW_ON                              :ofway allway ehiclesvay
+STR_CONFIG_PATCHES_WARN_INCOME_LESS                             :{LTBLUE}Arnway ifway away ain'stray incomeway isway egativenay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_NEVER_EXPIRE_VEHICLES                        :{LTBLUE}Ehiclesvay evernay expireway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AUTORENEW_VEHICLE                            :{LTBLUE}Autorenewway ehiclevay enwhay itway etsgay oldway
+STR_CONFIG_PATCHES_AUTORENEW_MONTHS                             :{LTBLUE}Autorenewway enwhay ehicevay isway {ORANGE}{STRING}{LTBLUE} onthsmay eforebay/afterway axmay ageway
+STR_CONFIG_PATCHES_AUTORENEW_MONEY                              :{LTBLUE}Autorenewway inimummay eedednay oneymay orfay enewray: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ERRMSG_DURATION                              :{LTBLUE}Urationday ofway errorway essagemay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_POPULATION_IN_LABEL                          :{LTBLUE}Owshay owntay opulationpay inway ethay owntay amenay abellay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_INVISIBLE_TREES                              :{LTBLUE}Invisibleway eestray (ithway ansparenttray uildingsbay): {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_LAND_GENERATOR                               :{LTBLUE}Andlay eneratorgay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LAND_GENERATOR_ORIGINAL                      :Originalway
+STR_CONFIG_PATCHES_LAND_GENERATOR_TERRA_GENESIS                 :ErraGenesistay
+STR_CONFIG_PATCHES_OIL_REF_EDGE_DISTANCE                        :{LTBLUE}Axmay istanceday omfray edgeway orfay Oilway Efineriesray {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SNOWLINE_HEIGHT                              :{LTBLUE}Owsnay inelay eighthay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN                         :{LTBLUE}Oughnessray ofway erraintay (ErraGenesistay onlyway) : {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH             :Eryvay Oothsmay
+STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_SMOOTH                  :Oothsmay
+STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_ROUGH                   :Oughray
+STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_ROUGH              :Eryvay Oughray
+STR_CONFIG_PATCHES_TREE_PLACER                                  :{LTBLUE}Eetray acerplay algorithmway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_TREE_PLACER_NONE                             :Onenay
+STR_CONFIG_PATCHES_TREE_PLACER_ORIGINAL                         :Originalway
+STR_CONFIG_PATCHES_TREE_PLACER_IMPROVED                         :Improvedway
+STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION                           :{LTBLUE}Eightmaphay otationray: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_COUNTER_CLOCKWISE         :Ountercay ockwiseclay
+STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_CLOCKWISE                 :Ockwiseclay
+STR_CONFIG_PATCHES_SE_FLAT_WORLD_HEIGHT                         :{LTBLUE}Ethay eighthay evellay away atflay enarioscay apmay etsgay: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_STATION_SPREAD                               :{LTBLUE}Axmay ationstay eadspray: {ORANGE}{STRING} {RED}Arningway: Ighhay ettingsay owsslay amegay
+STR_CONFIG_PATCHES_SERVICEATHELIPAD                             :{LTBLUE}Ervicesay elicoptershay atway elipadshay automaticallyway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR                       :{LTBLUE}Inklay andscapelay oolbartay otay ailray/oadray/aterway/airportway oolbarstay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_REVERSE_SCROLLING                            :{LTBLUE}Everseray ollscray irectionday: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SMOOTH_SCROLLING                             :{LTBLUE}Oothsmay iewportvay ollingscray: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MEASURE_TOOLTIP                              :{LTBLUE}Owshay away easurementmay ooltiptay enwhay usingway ariousvay uildbay-oolstay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LIVERIES                                     :{LTBLUE}Owshay ompanycay iverieslay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LIVERIES_NONE                                :Onenay
+STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Ownway ompanycay
+STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Allway ompaniescay
+STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Eferpray eamtay atchay ithway <ENTERWAY>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Unctionfay ofway ollwheelscray: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Oomzay apmay
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Ollscray apmay
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Offway
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Apmay ollwheelscray eedspay: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU                          :{LTBLUE}Ightray-ickclay emulationway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_COMMAND                  :Ommandcay-ickclay
+STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_CONTROL                  :Ontrolcay-ickclay
+STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_OFF                      :Offway
+
+STR_CONFIG_PATCHES_PAUSE_ON_NEW_GAME                            :{LTBLUE}Automaticallyway ausepay enwhay artingstay away ewnay amegay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS                       :{LTBLUE}Useway ethay advancedway ehiclevay istlay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OFF                   :Offway
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OWN                   :Ownway ompanycay
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_ALL                   :Allway ompaniescay
+STR_CONFIG_PATCHES_LOADING_INDICATORS                           :{LTBLUE}Useway oadinglay indicatorsway:{ORANGE}{STRING}
+STR_CONFIG_PATCHES_LOADING_INDICATORS_OFF                       :Offway
+STR_CONFIG_PATCHES_LOADING_INDICATORS_OWN                       :Ownway ompanycay
+STR_CONFIG_PATCHES_LOADING_INDICATORS_ALL                       :Allway ompaniescay
+STR_CONFIG_PATCHES_TIMETABLE_ALLOW                              :{LTBLUE}Enableway imetablingtay orfay ehiclesvay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_TIMETABLE_IN_TICKS                           :{LTBLUE}Owshay imetabletay inway ickstay atherray anthay aysday: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE                            :{LTBLUE}Efaultday ailray ypetay (afterway ewnay amegay/amegay oadlay): {ORANGE}{STRING}
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_RAIL                       :Ormalnay Ailray
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_ELRAIL                     :Electrifiedway Ailray
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MONORAIL                   :Onorailmay
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MAGLEV                     :Aglevmay
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_FIRST                      :Irstfay availableway
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_LAST                       :Astlay availableway
+STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE_MOST_USED                  :Ostmay usedway
+
+STR_CONFIG_PATCHES_ALWAYS_BUILD_INFRASTRUCTURE                  :{LTBLUE}Owshay uildingbay oolstay enwhay onay uitablesay ehiclesvay:{ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Axmay ainstray erpay ayerplay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Axmay oadray ehiclesvay erpay ayerplay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAX_AIRCRAFT                                 :{LTBLUE}Axmay aircraftway erpay ayerplay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAX_SHIPS                                    :{LTBLUE}Axmay ipsshay erpay ayerplay: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_AI_BUILDS_TRAINS                             :{LTBLUE}Isableday ainstray orfay omputercay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AI_BUILDS_ROADVEH                            :{LTBLUE}Isableday oadray ehiclesvay orfay omputercay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AI_BUILDS_AIRCRAFT                           :{LTBLUE}Isableday aircraftway orfay omputercay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AI_BUILDS_SHIPS                              :{LTBLUE}Isableday ipsshay orfay omputercay: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_AINEW_ACTIVE                                 :{LTBLUE}Enableway ewnay AIWAY (alphaway): {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AI_IN_MULTIPLAYER                            :{LTBLUE}Allowway AIsway inway ultiplayermay (experimentalway): {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_SERVINT_TRAINS                               :{LTBLUE}Efaultday ervicesay intervalway orfay ainstray: {ORANGE}{STRING} aysday/%
+STR_CONFIG_PATCHES_SERVINT_TRAINS_DISABLED                      :{LTBLUE}Efaultday ervicesay intervalway orfay ainstray: {ORANGE}isabledday
+STR_CONFIG_PATCHES_SERVINT_ROADVEH                              :{LTBLUE}Efaultday ervicesay intervalway orfay oadray ehiclesvay: {ORANGE}{STRING} aysday/%
+STR_CONFIG_PATCHES_SERVINT_ROADVEH_DISABLED                     :{LTBLUE}Efaultday ervicesay intervalway orfay oadray ehiclesvay: {ORANGE}isabledday
+STR_CONFIG_PATCHES_SERVINT_AIRCRAFT                             :{LTBLUE}Efaultday ervicesay intervalway orfay aircraftway: {ORANGE}{STRING} aysday/%
+STR_CONFIG_PATCHES_SERVINT_AIRCRAFT_DISABLED                    :{LTBLUE}Efaultday ervicesay intervalway orfay aircraftway: {ORANGE}isabledday
+STR_CONFIG_PATCHES_SERVINT_SHIPS                                :{LTBLUE}Efaultday ervicesay intervalway orfay ipsshay: {ORANGE}{STRING} aysday/%
+STR_CONFIG_PATCHES_SERVINT_SHIPS_DISABLED                       :{LTBLUE}Efaultday ervicesay intervalway orfay ipsshay: {ORANGE}isabledday
+STR_CONFIG_PATCHES_NOSERVICE                                    :{LTBLUE}Isableday ervicingsay enwhay eakdownsbray etsay otay onenay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_WAGONSPEEDLIMITS                             :{LTBLUE}Enableway agonway eedspay imitslay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_DISABLE_ELRAILS                              :{LTBLUE}Isableday electricway ailsray: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_COLORED_NEWS_YEAR                            :{LTBLUE}Olouredcay ewsnay appearsway inway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_STARTING_YEAR                                :{LTBLUE}Artingstay earyay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENDING_YEAR                                  :{LTBLUE}Endway amegay inway: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SMOOTH_ECONOMY                               :{LTBLUE}Enableway oothsmay economyway (oremay, allersmay angeschay)
+STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Allowway uyingbay aresshay omfray otherway ompaniescay
+STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Enwhay aggingdray, aceplay ignalssay everyway: {ORANGE}{STRING} iletay(say)
+STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Automaticallyway uildbay emaphoressay eforebay: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Ethay owntay ayoutlay "onay oremay oadsray" isn'tway alidvay inway ethay enarioscay editorway
+STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Electsay owntay-oadray ayoutlay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_TOWN_LAYOUT_NO_ROADS                         :onay oremay oadsray
+STR_CONFIG_PATCHES_TOWN_LAYOUT_DEFAULT                          :efaultday
+STR_CONFIG_PATCHES_TOWN_LAYOUT_BETTER_ROADS                     :etterbay oadsray
+STR_CONFIG_PATCHES_TOWN_LAYOUT_2X2_GRID                         :2xay2 idgray
+STR_CONFIG_PATCHES_TOWN_LAYOUT_3X3_GRID                         :3xay3 idgray
+
+STR_CONFIG_PATCHES_TOOLBAR_POS                                  :{LTBLUE}Ositionpay ofway ainmay oolbartay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT                             :Eftlay
+STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER                           :Entrecay
+STR_CONFIG_PATCHES_TOOLBAR_POS_RIGHT                            :Ightray
+STR_CONFIG_PATCHES_SNAP_RADIUS                                  :{LTBLUE}Indowway apsnay adiusray: {ORANGE}{STRING} pxay
+STR_CONFIG_PATCHES_SNAP_RADIUS_DISABLED                         :{LTBLUE}Indowway apsnay adiusray: {ORANGE}isabledday
+STR_CONFIG_PATCHES_TOWN_GROWTH                                  :{LTBLUE}Owntay owthgray eedspay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_TOWN_GROWTH_NONE                             :Onenay
+STR_CONFIG_PATCHES_TOWN_GROWTH_SLOW                             :Owslay
+STR_CONFIG_PATCHES_TOWN_GROWTH_NORMAL                           :Ormalnay
+STR_CONFIG_PATCHES_TOWN_GROWTH_FAST                             :Astfay
+STR_CONFIG_PATCHES_TOWN_GROWTH_VERY_FAST                        :Eryvay astfay
+STR_CONFIG_PATCHES_LARGER_TOWNS                                 :{LTBLUE}Oportionpray ofway ownstay atthay illway ecomebay itiescay: {ORANGE}1 inway {STRING}
+STR_CONFIG_PATCHES_LARGER_TOWNS_DISABLED                        :{LTBLUE}Oportionpray ofway ownstay atthay illway ecomebay itiescay: {ORANGE}Onenay
+STR_CONFIG_PATCHES_CITY_SIZE_MULTIPLIER                         :{LTBLUE}Initialway itycay izesay ultipliermay: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_GUI                                          :{BLACK}Interfaceway
+STR_CONFIG_PATCHES_CONSTRUCTION                                 :{BLACK}Onstructioncay
+STR_CONFIG_PATCHES_VEHICLES                                     :{BLACK}Ehiclesvay
+STR_CONFIG_PATCHES_STATIONS                                     :{BLACK}Ationsstay
+STR_CONFIG_PATCHES_ECONOMY                                      :{BLACK}Economyway
+STR_CONFIG_PATCHES_AI                                           :{BLACK}Ompetitorscay
+
+STR_CONFIG_PATCHES_DISABLED                                     :isabledday
+STR_CONFIG_PATCHES_INT32                                        :{NUM}
+STR_CONFIG_PATCHES_CURRENCY                                     :{CURRENCY}
+
+STR_CONFIG_PATCHES_QUERY_CAPT                                   :{WHITE}Angechay ettingsay aluevay
+STR_CONFIG_PATCHES_SERVICE_INTERVAL_INCOMPATIBLE                :{WHITE}Omesay orway allway ofway ethay efaultday ervicesay intervalway(say) elowbay areway incompatibleway ithway ethay osenchay ettingsay! 5-90% andway 30-800 aysday areway alidvay
+STR_CONFIG_PATCHES_YAPF_SHIPS                                   :{LTBLUE}Useway YAPFay orfay ipsshay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_YAPF_ROAD                                    :{LTBLUE}Useway YAPFay orfay oadvehsray: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_YAPF_RAIL                                    :{LTBLUE}Useway YAPFay orfay ainstray: {ORANGE}{STRING}
+
+STR_TEMPERATE_LANDSCAPE                                         :Emperatetay andscapelay
+STR_SUB_ARCTIC_LANDSCAPE                                        :Ubsay-arcticway andscapelay
+STR_SUB_TROPICAL_LANDSCAPE                                      :Ubsay-opicaltray andscapelay
+STR_TOYLAND_LANDSCAPE                                           :Oylandtay andscapelay
+
+STR_CHEATS                                                      :{WHITE}Eatschay
+STR_CHEATS_TIP                                                  :{BLACK}Eckboxeschay indicateway ifway ouyay avehay usedway isthay eatchay eforebay
+STR_CHEATS_WARNING                                              :{BLACK}Arningway! Ouyay areway aboutway otay etraybay ouryay ellowfay ompetitorscay. Eepkay inway indmay atthay uchsay away isgraceday illway ebay ememberedray orfay eternityway.
+STR_CHEAT_MONEY                                                 :{LTBLUE}Increaseway oneymay ybay {CURRENCY}
+STR_CHEAT_CHANGE_PLAYER                                         :{LTBLUE}Ayingplay asway ayerplay: {ORANGE}{COMMA}
+STR_CHEAT_EXTRA_DYNAMITE                                        :{LTBLUE}Agicmay ulldozerbay (emoveray industriesway, unmovablesway): {ORANGE}{STRING}
+STR_CHEAT_CROSSINGTUNNELS                                       :{LTBLUE}Unnelstay aymay osscray eachway otherway: {ORANGE}{STRING}
+STR_CHEAT_BUILD_IN_PAUSE                                        :{LTBLUE}Uildbay ilewhay inway ausepay odemay: {ORANGE}{STRING}
+STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Etplanesjay illway otnay ashcray (equentlyfray) onway allsmay airportsway: {ORANGE} {STRING}
+STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Itchsway imateclay: {ORANGE} {STRING}
+STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Angechay ateday: {ORANGE} {DATE_SHORT}
+STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Enableway odifyingmay oductionpray aluesvay: {ORANGE}{STRING}
+
+STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Eadinghay orfay {WAYPOINT}
+STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Eadinghay orfay {WAYPOINT}, {VELOCITY}
+
+STR_GO_TO_WAYPOINT                                              :Ogay iavay {WAYPOINT}
+STR_GO_NON_STOP_TO_WAYPOINT                                     :Ogay onnay-opstay iavay {WAYPOINT}
+
+STR_WAYPOINTNAME_CITY                                           :Aypointway {TOWN}
+STR_WAYPOINTNAME_CITY_SERIAL                                    :Aypointway {TOWN} #{COMMA}
+STR_LANDINFO_WAYPOINT                                           :Aypointway
+
+STR_WAYPOINT                                                    :{WHITE}Aypointway
+STR_WAYPOINT_GRAPHICS_TIP                                       :{BLACK}Electsay aypointway ypetay
+
+STR_WAYPOINT_VIEWPORT                                           :{WHITE}{WAYPOINT}
+STR_WAYPOINT_VIEWPORT_TINY                                      :{TINYFONT}{WHITE}{WAYPOINT}
+STR_WAYPOINT_RAW                                                :{WAYPOINT}
+STR_EDIT_WAYPOINT_NAME                                          :{WHITE}Editway aypointway amenay
+
+STR_CANT_CHANGE_WAYPOINT_NAME                                   :{WHITE}An'tcay angechay aypointway amenay...
+STR_CONVERT_RAIL_TO_WAYPOINT_TIP                                :{BLACK}Onvertcay ailray otay aypointway
+STR_CANT_BUILD_TRAIN_WAYPOINT                                   :{WHITE}An'tcay uildbay aintray aypointway erehay...
+STR_CANT_REMOVE_TRAIN_WAYPOINT                                  :{WHITE}An'tcay emoveray aintray aypointway erehay...
+
+STR_BUILD_AUTORAIL_TIP                                          :{BLACK}Uildbay ailwayray acktray usingway ethay Autorailway odemay
+
+STR_NO_TOWN_IN_SCENARIO                                         :{WHITE}...erethay isway onay owntay inway isthay enarioscay
+
+STR_GENERATE_RANDOM_LANDSCAPE                                   :{WHITE}Areway ouyay uresay ouyay antway otay eatecray away andomray andscapelay?
+STR_MANY_RANDOM_TOWNS                                           :{BLACK}Anymay andomray ownstay
+STR_RANDOM_TOWNS_TIP                                            :{BLACK}Overcay ethay apmay ithway andomlyray acedplay ownstay
+STR_MANY_RANDOM_INDUSTRIES                                      :Anymay andomray industriesway
+STR_RANDOM_INDUSTRIES_TIP                                       :{BLACK}Overcay ethay apmay ithway andomlyray acedplay industriesway
+STR_CAN_T_GENERATE_INDUSTRIES                                   :{WHITE}An'tcay enerategay industriesway...
+
+STR_LANDSCAPING_TOOLBAR_TIP                                     :{BLACK}Openway ethay andscapinglay oolbartay otay aiseray/owerlay andlay, antplay eestray, etcway.
+STR_LANDSCAPING_TOOLBAR                                         :{WHITE}Andscapinglay
+STR_LEVEL_LAND_TOOLTIP                                          :{BLACK}Evellay andlay
+
+
+STR_TREES_RANDOM_TYPE                                           :{BLACK}Eestray ofway andomray ypetay
+STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Aceplay eestray ofway andomray ypetay
+
+STR_CANT_BUILD_CANALS                                           :{WHITE}An'tcay uildbay analscay erehay...
+STR_BUILD_CANALS_TIP                                            :{BLACK}Uildbay analscay.
+STR_LANDINFO_CANAL                                              :Analcay
+
+STR_CANT_BUILD_LOCKS                                            :{WHITE}An'tcay uildbay ockslay erehay...
+STR_BUILD_LOCKS_TIP                                             :{BLACK}Uildbay ockslay
+STR_LANDINFO_LOCK                                               :Ocklay
+
+STR_BUOY_IS_IN_USE                                              :{WHITE}...uoybay isway inway useway!
+
+STR_LANDINFO_COORDS                                             :{BLACK}Oordinatescay: {LTBLUE}{NUM}x{NUM}x{NUM} ({STRING})
+
+STR_CANT_REMOVE_PART_OF_STATION                                 :{WHITE}An'tcay emoveray artpay ofway ationstay...
+STR_CANT_CONVERT_RAIL                                           :{WHITE}An'tcay onvertcay ailtyperay erehay...
+STR_CONVERT_RAIL_TIP                                            :{BLACK}Onvertcay/Upgradeway ethay ypetay ofway ailray
+
+STR_DRAG_WHOLE_TRAIN_TO_SELL_TIP                                :{BLACK}Agdray aintray engineway erehay otay ellsay ethay olewhay aintray
+
+STR_DRAG_DROP                                                   :{BLACK}Agdray & Opdray
+STR_STATION_DRAG_DROP                                           :{BLACK}Uildbay away ationstay usingway agdray & opdray
+STR_SELECT_STATION_CLASS_TIP                                    :{BLACK}Electsay away ationstay assclay otay isplayday
+STR_SELECT_STATION_TYPE_TIP                                     :{BLACK}Electsay ethay ationstay ypetay otay uildbay
+
+STR_FAST_FORWARD                                                :{BLACK}Astfay orwardfay ethay amegay
+STR_MESSAGE_HISTORY                                             :{WHITE}Essagemay Istoryhay
+STR_MESSAGE_HISTORY_TIP                                         :{BLACK}Away istlay ofway ethay ecentray ewsnay essagesmay
+STR_MESSAGES_DISABLE_ALL                                        :{BLACK}Isableday allway
+STR_MESSAGES_ENABLE_ALL                                         :{BLACK}Enableway allway
+
+STR_CONSTRUCT_COAL_MINE_TIP                                     :{BLACK}Onstructcay Oalcay Inemay
+STR_CONSTRUCT_FOREST_TIP                                        :{BLACK}Antplay Orestfay
+STR_CONSTRUCT_OIL_RIG_TIP                                       :{BLACK}Onstructcay Oilway Igray
+STR_CONSTRUCT_FARM_TIP                                          :{BLACK}Undfay Armfay
+STR_CONSTRUCT_COPPER_ORE_MINE_TIP                               :{BLACK}Onstructcay Oppercay Oreway Inemay
+STR_CONSTRUCT_OIL_WELLS_TIP                                     :{BLACK}Illdray orfay Oilway
+STR_CONSTRUCT_GOLD_MINE_TIP                                     :{BLACK}Onstructcay Oldgay Inemay
+STR_CONSTRUCT_DIAMOND_MINE_TIP                                  :{BLACK}Onstructcay Iamondday Inemay
+STR_CONSTRUCT_IRON_ORE_MINE_TIP                                 :{BLACK}Onstructcay Ironway Oreway Inemay
+STR_CONSTRUCT_FRUIT_PLANTATION_TIP                              :{BLACK}Undfay Uitfray Antationplay
+STR_CONSTRUCT_RUBBER_PLANTATION_TIP                             :{BLACK}Undfay Ubberray Antationplay
+STR_CONSTRUCT_WATER_SUPPLY_TIP                                  :{BLACK}Undfay Aterway Upplysay
+STR_CONSTRUCT_COTTON_CANDY_TIP                                  :{BLACK}Antplay Andyflosscay Orestfay
+STR_CONSTRUCT_BATTERY_FARM_TIP                                  :{BLACK}Undfay Atterybay Armfay
+STR_CONSTRUCT_COLA_WELLS_TIP                                    :{BLACK}Illdray orfay Olacay
+STR_CONSTRUCT_PLASTIC_FOUNTAINS_TIP                             :{BLACK}Undfay Asticplay Ountainsfay
+STR_CONSTRUCT_BUBBLE_GENERATOR_TIP                              :{BLACK}Onstructcay Ubblebay Eneratorgay
+STR_CONSTRUCT_TOFFEE_QUARRY_TIP                                 :{BLACK}Undfay Offeetay Arryquay
+STR_CONSTRUCT_SUGAR_MINE_TIP                                    :{BLACK}Onstructcay Ugarsay Inemay
+
+STR_INDUSTRYDIR_CAPTION                                         :{WHITE}Industriesway
+STR_INDUSTRYDIR_ITEM                                            :{ORANGE}{INDUSTRY}{BLACK} ({CARGO}){YELLOW} ({COMMA}% ansportedtray)
+STR_INDUSTRYDIR_ITEM_TWO                                        :{ORANGE}{INDUSTRY}{BLACK} ({CARGO}/{CARGO}){YELLOW} ({COMMA}%/{COMMA}% ansportedtray)
+STR_INDUSTRYDIR_ITEM_NOPROD                                     :{ORANGE}{INDUSTRY}
+
+STR_INDUSTRY_TOO_CLOSE                                          :{WHITE}...ootay oseclay otay anotherway industryway
+
+STR_RAIL_REFIT_VEHICLE_TO_CARRY                                 :{BLACK}Efitray aintray otay arrycay away ifferentday argocay ypetay
+STR_RAIL_REFIT_VEHICLE                                          :{BLACK}Efitray aintray
+STR_RAIL_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Electsay ypetay ofway argocay orfay aintray otay arrycay
+STR_RAIL_REFIT_TO_CARRY_HIGHLIGHTED                             :{BLACK}Efitray aintray otay arrycay ighlightedhay argocay ypetay
+STR_RAIL_CAN_T_REFIT_VEHICLE                                    :{WHITE}An'tcay efitray aintray...
+STR_CONFIG_PATCHES_SERVINT_ISPERCENT                            :{LTBLUE}Ervicesay intervalsway areway inway ercentspay: {ORANGE}{STRING}
+STR_CONFIG_GAME_PRODUCTION                                      :{WHITE}Angechay oductionpray
+
+TEMP_AI_IN_PROGRESS                                             :{WHITE}Elcomeway otay ethay ewnay AIWAY underway evelopmentday. Ifway ouyay encounterway oblemspray, aketay away eenshotscray andway ostpay itway inway ethay orumfay.
+TEMP_AI_ACTIVATED                                               :{WHITE}Arningway: isthay ewnay AIWAY isway illstay alphaway! Urrentlycay, onlyway uckstray andway ussesbay orkway!
+TEMP_AI_MULTIPLAYER                                             :{WHITE}Arningway: implementationway isway illstay experimentalway (usingway ewnay AIWAY). Easeplay eportray anyway oblemspray otay uelighttray@openttdway.orgway.
+
+############ network gui strings
+
+STR_NETWORK_MULTIPLAYER                                         :{WHITE}Ultiplayermay
+
+STR_NETWORK_PLAYER_NAME                                         :{BLACK}Ayerplay amenay:
+STR_NETWORK_ENTER_NAME_TIP                                      :{BLACK}Isthay isway ethay amenay otherway ayersplay illway identifyway ouyay ybay
+STR_NETWORK_CONNECTION                                          :{BLACK}Onnectioncay:
+STR_NETWORK_CONNECTION_TIP                                      :{BLACK}Oosechay etweenbay anway internetway amegay orway away Ocallay Areaway Etworknay (LANay) amegay
+
+STR_NETWORK_START_SERVER                                        :{BLACK}Artstay erversay
+STR_NETWORK_START_SERVER_TIP                                    :{BLACK}Artstay ouryay ownway erversay
+
+STR_NETWORK_GAME_NAME                                           :{BLACK}Amenay
+STR_NETWORK_GAME_NAME_TIP                                       :{BLACK}Amenay ofway ethay amegay
+STR_NETWORK_INFO_ICONS_TIP                                      :{BLACK}Anguagelay, erversay ersionvay, etcway.
+STR_NETWORK_CLICK_GAME_TO_SELECT                                :{BLACK}Ickclay away amegay omfray ethay istlay otay electsay itway
+
+STR_NETWORK_FIND_SERVER                                         :{BLACK}Indfay erversay
+STR_NETWORK_FIND_SERVER_TIP                                     :{BLACK}Earchsay etworknay orfay away erversay
+STR_NETWORK_ADD_SERVER                                          :{BLACK}Addway erversay
+STR_NETWORK_ADD_SERVER_TIP                                      :{BLACK}Addsway away erversay otay ethay istlay ichwhay illway alwaysway ebay eckedchay orfay unningray amesgay.
+STR_NETWORK_ENTER_IP                                            :{BLACK}Enterway ethay addressway ofway ethay osthay
+
+STR_NETWORK_GENERAL_ONLINE                                      :{BLACK}{COMMA}/{COMMA} - {COMMA}/{COMMA}
+STR_NETWORK_CLIENTS_CAPTION                                     :{BLACK}Ientsclay
+STR_NETWORK_CLIENTS_CAPTION_TIP                                 :{BLACK}Ientsclay onlineway / ientsclay axmay{}Ompaniescay onlineway / ompaniescay axmay
+STR_NETWORK_GAME_INFO                                           :{SILVER}EGAMay INFOWAY
+STR_ORANGE                                                      :{ORANGE}{STRING}
+STR_NETWORK_CLIENTS                                             :{SILVER}Ientsclay:  {WHITE}{COMMA} / {COMMA} - {COMMA} / {COMMA}
+STR_NETWORK_LANGUAGE                                            :{SILVER}Anguagelay:  {WHITE}{STRING}
+STR_NETWORK_TILESET                                             :{SILVER}Ilesettay:  {WHITE}{STRING}
+STR_NETWORK_MAP_SIZE                                            :{SILVER}Apmay izesay:  {WHITE}{COMMA}xay{COMMA}
+STR_NETWORK_SERVER_VERSION                                      :{SILVER}Erversay ersionvay:  {WHITE}{STRING}
+STR_NETWORK_SERVER_ADDRESS                                      :{SILVER}Erversay addressway:  {WHITE}{STRING} : {NUM}
+STR_NETWORK_START_DATE                                          :{SILVER}Artstay ateday:  {WHITE}{DATE_SHORT}
+STR_NETWORK_CURRENT_DATE                                        :{SILVER}Urrentcay ateday:  {WHITE}{DATE_SHORT}
+STR_NETWORK_PASSWORD                                            :{SILVER}Asswordpay otectedpray!
+STR_NETWORK_SERVER_OFFLINE                                      :{SILVER}ERVERSay OFFLINEWAY
+STR_NETWORK_SERVER_FULL                                         :{SILVER}ERVERSay ULLFay
+STR_NETWORK_VERSION_MISMATCH                                    :{SILVER}ERSIONVay ISMATCHMay
+STR_NETWORK_GRF_MISMATCH                                        :{SILVER}EWGRFNay ISMATCHMay
+
+STR_NETWORK_JOIN_GAME                                           :{BLACK}Oinjay amegay
+
+
+STR_NETWORK_START_GAME_WINDOW                                   :{WHITE}Artstay ewnay ultiplayermay amegay
+
+STR_NETWORK_NEW_GAME_NAME                                       :{BLACK}Amegay amenay:
+STR_NETWORK_NEW_GAME_NAME_TIP                                   :{BLACK}Ethay amegay amenay illway ebay isplayedday otay otherway ayersplay inway ethay ultiplayermay amegay electionsay enumay
+STR_NETWORK_SET_PASSWORD                                        :{BLACK}Etsay asswordpay
+STR_NETWORK_PASSWORD_TIP                                        :{BLACK}Otectpray ouryay amegay ithway away asswordpay ifway ouyay on'tday antway itway otay ebay ubliclypay accessibleway
+STR_NETWORK_SELECT_MAP                                          :{BLACK}Electsay away apmay:
+STR_NETWORK_SELECT_MAP_TIP                                      :{BLACK}Ichwhay apmay oday ouyay antway otay ayplay?
+STR_NETWORK_LAN_INTERNET_COMBO                                  :{BLACK}{SKIP}{STRING}
+STR_NETWORK_LAN                                                 :LANay
+STR_NETWORK_INTERNET                                            :Internetway
+STR_NETWORK_LAN_INTERNET                                        :LANay / Internetway
+STR_NETWORK_INTERNET_ADVERTISE                                  :Internetway (advertiseway)
+STR_NETWORK_CLIENTS_SELECT                                      :{BLACK}{SKIP}{SKIP}{NUM} ient{P "" s}clay
+STR_NETWORK_NUMBER_OF_CLIENTS                                   :{BLACK}Axmay ientsclay:
+STR_NETWORK_NUMBER_OF_CLIENTS_TIP                               :{BLACK}Oosechay ethay aximummay umbernay ofway ientsclay. Otnay allway otsslay eednay otay ebay illedfay
+STR_NETWORK_COMPANIES_SELECT                                    :{BLACK}{SKIP}{SKIP}{SKIP}{NUM} ompan{P y ies}cay
+STR_NETWORK_NUMBER_OF_COMPANIES                                 :{BLACK}Axmay ompaniescay:
+STR_NETWORK_NUMBER_OF_COMPANIES_TIP                             :{BLACK}Imitlay ethay erversay otay away ertaincay amountway ofway ompaniescay
+STR_NETWORK_SPECTATORS_SELECT                                   :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{NUM} ectator{P "" s}spay
+STR_NETWORK_NUMBER_OF_SPECTATORS                                :{BLACK}Axmay ectatorsspay:
+STR_NETWORK_NUMBER_OF_SPECTATORS_TIP                            :{BLACK}Imitlay ethay erversay otay away ertaincay amountway ofway ectatorsspay
+STR_NETWORK_LANGUAGE_SPOKEN                                     :{BLACK}Anguagelay okenspay:
+STR_NETWORK_LANGUAGE_TIP                                        :{BLACK}Otherway ayersplay illway owknay ichwhay anguagelay isway okenspay onway ethay erversay
+STR_NETWORK_LANGUAGE_COMBO                                      :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_NETWORK_START_GAME                                          :{BLACK}Artstay Amegay
+STR_NETWORK_START_GAME_TIP                                      :{BLACK}Artstay away ewnay etworknay amegay omfray away andomray apmay, orway enarioscay
+STR_NETWORK_LOAD_GAME                                           :{BLACK}Oadlay Amegay
+STR_NETWORK_LOAD_GAME_TIP                                       :{BLACK}Esumeray anway earlierway avedsay ultiplayermay amegay (ebay uresay otay onnectcay asway ethay orrectcay ayerplay)
+
+############ Leave those lines in this order!!
+STR_NETWORK_LANG_ANY                                            :Anyway
+STR_NETWORK_LANG_ENGLISH                                        :Englishway
+STR_NETWORK_LANG_GERMAN                                         :Ermangay
+STR_NETWORK_LANG_FRENCH                                         :Enchfray
+STR_NETWORK_LANG_BRAZILIAN                                      :Azilianbray
+STR_NETWORK_LANG_BULGARIAN                                      :Ulgarianbay
+STR_NETWORK_LANG_CHINESE                                        :Inesechay
+STR_NETWORK_LANG_CZECH                                          :Echczay
+STR_NETWORK_LANG_DANISH                                         :Anishday
+STR_NETWORK_LANG_DUTCH                                          :Utchday
+STR_NETWORK_LANG_ESPERANTO                                      :Esperantoway
+STR_NETWORK_LANG_FINNISH                                        :Innishfay
+STR_NETWORK_LANG_HUNGARIAN                                      :Ungarianhay
+STR_NETWORK_LANG_ICELANDIC                                      :Icelandicway
+STR_NETWORK_LANG_ITALIAN                                        :Italianway
+STR_NETWORK_LANG_JAPANESE                                       :Apanesejay
+STR_NETWORK_LANG_KOREAN                                         :Oreankay
+STR_NETWORK_LANG_LITHUANIAN                                     :Ithuanianlay
+STR_NETWORK_LANG_NORWEGIAN                                      :Orwegiannay
+STR_NETWORK_LANG_POLISH                                         :Olishpay
+STR_NETWORK_LANG_PORTUGUESE                                     :Ortuguesepay
+STR_NETWORK_LANG_ROMANIAN                                       :Omanianray
+STR_NETWORK_LANG_RUSSIAN                                        :Ussianray
+STR_NETWORK_LANG_SLOVAK                                         :Ovakslay
+STR_NETWORK_LANG_SLOVENIAN                                      :Ovenianslay
+STR_NETWORK_LANG_SPANISH                                        :Anishspay
+STR_NETWORK_LANG_SWEDISH                                        :Edishsway
+STR_NETWORK_LANG_TURKISH                                        :Urkishtay
+STR_NETWORK_LANG_UKRAINIAN                                      :Ukrainianway
+############ End of leave-in-this-order
+
+STR_NETWORK_GAME_LOBBY                                          :{WHITE}Ultiplayermay amegay obbylay
+
+STR_NETWORK_PREPARE_TO_JOIN                                     :{BLACK}Eparingpray otay oinjay:   {ORANGE}{STRING}
+STR_NETWORK_COMPANY_LIST_TIP                                    :{BLACK}Away istlay ofway allway ompaniescay urrentlycay inway isthay amegay. Ouyay ancay eitherway oinjay oneway orway artstay away ewnay oneway ifway erethay isway away eefray ompanycay otslay
+STR_NETWORK_NEW_COMPANY                                         :{BLACK}Ewnay ompanycay
+STR_NETWORK_NEW_COMPANY_TIP                                     :{BLACK}Eatecray away ewnay ompanycay
+STR_NETWORK_SPECTATE_GAME                                       :{BLACK}Ectatespay amegay
+STR_NETWORK_SPECTATE_GAME_TIP                                   :{BLACK}Atchway ethay amegay asway away ectatorspay
+STR_NETWORK_JOIN_COMPANY                                        :{BLACK}Oinjay ompanycay
+STR_NETWORK_JOIN_COMPANY_TIP                                    :{BLACK}Elphay anagemay isthay ompanycay
+STR_NETWORK_REFRESH                                             :{BLACK}Efreshray erversay
+STR_NETWORK_REFRESH_TIP                                         :{BLACK}Efreshray ethay erversay infoway
+
+STR_NETWORK_COMPANY_INFO                                        :{SILVER}OMPANYCay INFOWAY
+
+STR_NETWORK_COMPANY_NAME                                        :{SILVER}Ompanycay amenay:  {WHITE}{STRING}
+STR_NETWORK_INAUGURATION_YEAR                                   :{SILVER}Inaugurationway:  {WHITE}{NUM}
+STR_NETWORK_VALUE                                               :{SILVER}Ompanycay aluevay:  {WHITE}{CURRENCY}
+STR_NETWORK_CURRENT_BALANCE                                     :{SILVER}Urrentcay alancebay:  {WHITE}{CURRENCY}
+STR_NETWORK_LAST_YEARS_INCOME                                   :{SILVER}Astlay ear'syay incomeway:  {WHITE}{CURRENCY}
+STR_NETWORK_PERFORMANCE                                         :{SILVER}Erformancepay:  {WHITE}{NUM}
+
+STR_NETWORK_VEHICLES                                            :{SILVER}Ehiclesvay:  {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP}
+STR_NETWORK_STATIONS                                            :{SILVER}Ationsstay:  {WHITE}{NUM} {TRAIN}, {NUM} {LORRY}, {NUM} {BUS}, {NUM} {PLANE}, {NUM} {SHIP}
+STR_NETWORK_PLAYERS                                             :{SILVER}Ayersplay:  {WHITE}{STRING}
+
+STR_NETWORK_CONNECTING                                          :{WHITE}Onnectingcay...
+
+############ Leave those lines in this order!!
+STR_NETWORK_CONNECTING_1                                        :{BLACK}(1/6) Onnectingcay..
+STR_NETWORK_CONNECTING_2                                        :{BLACK}(2/6) Authorisingway..
+STR_NETWORK_CONNECTING_3                                        :{BLACK}(3/6) Aitingway..
+STR_NETWORK_CONNECTING_4                                        :{BLACK}(4/6) Ownloadingday apmay..
+STR_NETWORK_CONNECTING_5                                        :{BLACK}(5/6) Ocessingpray ataday..
+STR_NETWORK_CONNECTING_6                                        :{BLACK}(6/6) Egisteringray..
+
+STR_NETWORK_CONNECTING_SPECIAL_1                                :{BLACK}Etchingfay amegay infoway..
+STR_NETWORK_CONNECTING_SPECIAL_2                                :{BLACK}Etchingfay ompanycay infoway..
+############ End of leave-in-this-order
+STR_NETWORK_CONNECTING_WAITING                                  :{BLACK}{NUM} ient{P "" s}clay inway ontfray ofway ouyay
+STR_NETWORK_CONNECTING_DOWNLOADING                              :{BLACK}{NUM} / {NUM} yteskbay ownloadedday osay arfay
+
+STR_NETWORK_DISCONNECT                                          :{BLACK}Isconnectday
+
+STR_NETWORK_GIVE_MONEY_CAPTION                                  :{WHITE}Enterway ethay amountway ofway oneymay ouyay antway otay ivegay
+STR_NETWORK_NEED_GAME_PASSWORD_CAPTION                          :{WHITE}Erversay isway otectedpray. Enterway asswordpay
+STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION                       :{WHITE}Ompanycay isway otectedpray. Enterway asswordpay
+STR_NETWORK_CLIENT_LIST                                         :{WHITE}Ientclay Istlay
+
+STR_NETWORK_ERR_NOTAVAILABLE                                    :{WHITE} Onay etworknay evicesday oundfay orway ompiledcay ithoutway ENABLEWAY_ETWORKNay
+STR_NETWORK_ERR_NOSERVER                                        :{WHITE} Ouldcay otnay indfay anyway etworknay amesgay
+STR_NETWORK_ERR_NOCONNECTION                                    :{WHITE} Ethay erversay idn'tday answerway ethay equestray
+STR_NETWORK_ERR_NEWGRF_MISMATCH                                 :{WHITE} Ouldcay otnay onnectcay ueday otay EwGRFnay ismatchmay
+STR_NETWORK_ERR_DESYNC                                          :{WHITE} Etworknay-Amegay ynchronisationsay ailedfay
+STR_NETWORK_ERR_LOSTCONNECTION                                  :{WHITE} Etworknay-Amegay onnectioncay ostlay
+STR_NETWORK_ERR_SAVEGAMEERROR                                   :{WHITE} Ouldcay otnay oadlay avegamesay
+STR_NETWORK_ERR_SERVER_START                                    :{WHITE} Ouldcay otnay artstay ethay erversay
+STR_NETWORK_ERR_CLIENT_START                                    :{WHITE} Ouldcay otnay onnectcay
+STR_NETWORK_ERR_TIMEOUT                                         :{WHITE} Onnectioncay #{NUM} imedtay outway
+STR_NETWORK_ERR_SERVER_ERROR                                    :{WHITE} Away otocolpray-errorway asway ademay andway ethay onnectioncay asway osedclay
+STR_NETWORK_ERR_WRONG_REVISION                                  :{WHITE} Ethay evisionray ofway isthay ientclay oesday otnay atchmay ethay erver'ssay evisionray
+STR_NETWORK_ERR_WRONG_PASSWORD                                  :{WHITE} Ongwray asswordpay
+STR_NETWORK_ERR_SERVER_FULL                                     :{WHITE} Ethay erversay isway ullfay
+STR_NETWORK_ERR_SERVER_BANNED                                   :{WHITE} Ouyay areway annedbay omfray isthay erversay
+STR_NETWORK_ERR_KICKED                                          :{WHITE} Ouyay ereway ickedkay outway ofway ethay amegay
+STR_NETWORK_ERR_CHEATER                                         :{WHITE} Eatingchay isway otnay allowedway onway isthay erversay
+
+STR_NETWORK_ERR_LEFT                                            :ashay eftlay ethay amegay
+############ Leave those lines in this order!!
+STR_NETWORK_ERR_CLIENT_GENERAL                                  :eneralgay errorway
+STR_NETWORK_ERR_CLIENT_DESYNC                                   :esyncday errorway
+STR_NETWORK_ERR_CLIENT_SAVEGAME                                 :ouldcay otnay oadlay apmay
+STR_NETWORK_ERR_CLIENT_CONNECTION_LOST                          :onnectioncay ostlay
+STR_NETWORK_ERR_CLIENT_PROTOCOL_ERROR                           :otocolpray errorway
+STR_NETWORK_ERR_CLIENT_NEWGRF_MISMATCH                          :EwGRFnay ismatchmay
+STR_NETWORK_ERR_CLIENT_NOT_AUTHORIZED                           :otnay authorizedway
+STR_NETWORK_ERR_CLIENT_NOT_EXPECTED                             :eceivedray angestray acketpay
+STR_NETWORK_ERR_CLIENT_WRONG_REVISION                           :ongwray evisionray
+STR_NETWORK_ERR_CLIENT_NAME_IN_USE                              :amenay alreadyway inway useway
+STR_NETWORK_ERR_CLIENT_WRONG_PASSWORD                           :ongwray asswordpay
+STR_NETWORK_ERR_CLIENT_PLAYER_MISMATCH                          :ongwray ayerplay-idway inway OCommandday
+STR_NETWORK_ERR_CLIENT_KICKED                                   :ickedkay ybay erversay
+STR_NETWORK_ERR_CLIENT_CHEATER                                  :asway yingtray otay useway away eatchay
+STR_NETWORK_ERR_CLIENT_SERVER_FULL                              :erversay ullfay
+############ End of leave-in-this-order
+STR_NETWORK_CLIENT_JOINED                                       :ashay oinedjay ethay amegay
+STR_NETWORK_GIVE_MONEY                                          :avegay ouryay ompanycay omesay oneymay ({CURRENCY})
+STR_NETWORK_GAVE_MONEY_AWAY                                     :ouyay avegay {STRING} omesay oneymay ({CURRENCY})
+STR_NETWORK_CHAT_COMPANY_CAPTION                                :[Eamtay] :
+STR_NETWORK_CHAT_COMPANY                                        :[Eamtay] {STRING}: {GRAY}{STRING}
+STR_NETWORK_CHAT_TO_COMPANY                                     :[Eamtay] Otay {STRING}: {GRAY}{STRING}
+STR_NETWORK_CHAT_CLIENT_CAPTION                                 :[Ivatepray] :
+STR_NETWORK_CHAT_CLIENT                                         :[Ivatepray] {STRING}: {GRAY}{STRING}
+STR_NETWORK_CHAT_TO_CLIENT                                      :[Ivatepray] Otay {STRING}: {GRAY}{STRING}
+STR_NETWORK_CHAT_ALL_CAPTION                                    :[Allway] :
+STR_NETWORK_CHAT_ALL                                            :[Allway] {STRING}: {GRAY}{STRING}
+STR_NETWORK_NAME_CHANGE                                         :ashay angedchay ishay/erhay amenay otay
+STR_NETWORK_SERVER_SHUTDOWN                                     :{WHITE} Ethay erversay osedclay ethay essionsay
+STR_NETWORK_SERVER_REBOOT                                       :{WHITE} Ethay erversay isway estartingray...{}Easeplay aitway...
+
+STR_NETWORK_SERVER                                              :Erversay
+STR_NETWORK_CLIENT                                              :Ientclay
+STR_NETWORK_SPECTATORS                                          :Ectatorsspay
+
+STR_NETWORK_CLIENTLIST_NONE                                     :(onenay)
+STR_NETWORK_CLIENTLIST_KICK                                     :Ickkay
+STR_NETWORK_CLIENTLIST_GIVE_MONEY                               :Ivegay oneymay
+STR_NETWORK_CLIENTLIST_SPEAK_TO_ALL                             :Eakspay otay allway
+STR_NETWORK_CLIENTLIST_SPEAK_TO_COMPANY                         :Eakspay otay ompanycay
+STR_NETWORK_CLIENTLIST_SPEAK_TO_CLIENT                          :Ivatepray essagemay
+
+
+STR_NETWORK_SEND                                                :{BLACK}Endsay
+
+############ end network gui strings
+
+
+STR_CONFIG_PATCHES_MAP_X                                        :{LTBLUE}Xay-izesay ofway apmay: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAP_Y                                        :{LTBLUE}Yay-izesay ofway apmay: {ORANGE}{STRING}
+
+
+##### PNG-MAP-Loader
+
+STR_PNGMAP_ERROR                                                :{WHITE}Annotcay oadlay andscapelay omfray PNGay...
+STR_PNGMAP_ERR_FILE_NOT_FOUND                                   :{WHITE}...ilefay otnay oundfay.
+STR_PNGMAP_ERR_IMAGE_TYPE                                       :{WHITE}...ouldcay otnay onvertcay imageway ypetay. 8 orway 24-itbay PNGay imageway eedednay.
+STR_PNGMAP_ERR_MISC                                             :{WHITE}...omethingsay ustjay entway ongwray. Orrysay. (obablypray orruptedcay ilefay)
+
+STR_BMPMAP_ERROR                                                :{WHITE}Annotcay oadlay andscapelay omfray BMPay...
+STR_BMPMAP_ERR_IMAGE_TYPE                                       :{WHITE}...ouldcay otnay onvertcay imageway ypetay.
+
+##id 0x0800
+STR_0800_COST                                                   :{TINYFONT}{RED}Ostcay: {CURRENCY}
+STR_0801_COST                                                   :{RED}Ostcay: {CURRENCY}
+STR_0802_INCOME                                                 :{TINYFONT}{GREEN}Incomeway: {CURRENCY}
+STR_0803_INCOME                                                 :{GREEN}Incomeway: {CURRENCY}
+STR_FEEDER_TINY                                                 :{TINYFONT}{YELLOW}Ansfertray: {CURRENCY}
+STR_FEEDER                                                      :{YELLOW}Ansfertray: {CURRENCY}
+STR_0805_ESTIMATED_COST                                         :{WHITE}Estimatedway Ostcay: {CURRENCY}
+STR_0807_ESTIMATED_INCOME                                       :{WHITE}Estimatedway Incomeway: {CURRENCY}
+STR_0808_CAN_T_RAISE_LAND_HERE                                  :{WHITE}An'tcay aiseray andlay erehay...
+STR_0809_CAN_T_LOWER_LAND_HERE                                  :{WHITE}An'tcay owerlay andlay erehay...
+STR_080A_ROCKS                                                  :Ocksray
+STR_080B_ROUGH_LAND                                             :Oughray andlay
+STR_080C_BARE_LAND                                              :Arebay andlay
+STR_080D_GRASS                                                  :Assgray
+STR_080E_FIELDS                                                 :Ieldsfay
+STR_080F_SNOW_COVERED_LAND                                      :Owsnay-overedcay andlay
+STR_0810_DESERT                                                 :Esertday
+
+##id 0x1000
+STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION                         :{WHITE}Andlay opedslay inway ongwray irectionday
+STR_1001_IMPOSSIBLE_TRACK_COMBINATION                           :{WHITE}Impossibleway acktray ombinationcay
+STR_1002_EXCAVATION_WOULD_DAMAGE                                :{WHITE}Excavationway ouldway amageday unneltay
+STR_1003_ALREADY_AT_SEA_LEVEL                                   :{WHITE}Alreadyway atway easay-evellay
+STR_1004_TOO_HIGH                                               :{WHITE}Ootay ighhay
+STR_1005_NO_SUITABLE_RAILROAD_TRACK                             :{WHITE}Onay uitablesay ailwayray acktray
+STR_1007_ALREADY_BUILT                                          :{WHITE}...alreadyway uiltbay
+STR_1008_MUST_REMOVE_RAILROAD_TRACK                             :{WHITE}Ustmay emoveray ailwayray acktray irstfay
+STR_100A_RAILROAD_CONSTRUCTION                                  :{WHITE}Ailwayray Onstructioncay
+STR_TITLE_ELRAIL_CONSTRUCTION                                   :{WHITE}Electrifiedway Ailwayray Onstructioncay
+STR_100B_MONORAIL_CONSTRUCTION                                  :{WHITE}Onorailmay Onstructioncay
+STR_100C_MAGLEV_CONSTRUCTION                                    :{WHITE}AgLevmay Onstructioncay
+STR_100D_SELECT_RAIL_BRIDGE                                     :{WHITE}Electsay Ailray Idgebray
+STR_100E_CAN_T_BUILD_TRAIN_DEPOT                                :{WHITE}An'tcay uildbay aintray epotday erehay...
+STR_100F_CAN_T_BUILD_RAILROAD_STATION                           :{WHITE}An'tcay uildbay ailwayray ationstay erehay...
+STR_1010_CAN_T_BUILD_SIGNALS_HERE                               :{WHITE}An'tcay uildbay ignalssay erehay...
+STR_1011_CAN_T_BUILD_RAILROAD_TRACK                             :{WHITE}An'tcay uildbay ailwayray acktray erehay...
+STR_1012_CAN_T_REMOVE_RAILROAD_TRACK                            :{WHITE}An'tcay emoveray ailwayray acktray omfray erehay...
+STR_1013_CAN_T_REMOVE_SIGNALS_FROM                              :{WHITE}An'tcay emoveray ignalssay omfray erehay...
+STR_1014_TRAIN_DEPOT_ORIENTATION                                :{WHITE}Aintray Epotday Orientationway
+STR_1015_RAILROAD_CONSTRUCTION                                  :Ailwayray onstructioncay
+STR_TOOLB_ELRAIL_CONSTRUCTION                                   :Electrifiedway Ailwayray onstructioncay
+STR_1016_MONORAIL_CONSTRUCTION                                  :Onorailmay onstructioncay
+STR_1017_MAGLEV_CONSTRUCTION                                    :AgLevmay onstructioncay
+STR_1018_BUILD_RAILROAD_TRACK                                   :{BLACK}Uildbay ailwayray acktray
+STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING                         :{BLACK}Uildbay aintray epotday (orfay uildingbay andway ervicingsay ainstray)
+STR_101A_BUILD_RAILROAD_STATION                                 :{BLACK}Uildbay ailwayray ationstay
+STR_101B_BUILD_RAILROAD_SIGNALS                                 :{BLACK}Uildbay ailwayray ignalssay
+STR_101C_BUILD_RAILROAD_BRIDGE                                  :{BLACK}Uildbay ailwayray idgebray
+STR_101D_BUILD_RAILROAD_TUNNEL                                  :{BLACK}Uildbay ailwayray unneltay
+STR_101E_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Oggletay uildbay/emoveray orfay ailwayray acktray andway ignalssay
+STR_101F_BRIDGE_SELECTION_CLICK                                 :{BLACK}Idgebray electionsay - ickclay onway ouryay eferedpray idgebray otay uildbay itway
+STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO                       :{BLACK}Electsay ailwayray epotday orientationway
+STR_1021_RAILROAD_TRACK                                         :Ailwayray acktray
+STR_1023_RAILROAD_TRAIN_DEPOT                                   :Ailwayray aintray epotday
+STR_1024_AREA_IS_OWNED_BY_ANOTHER                               :{WHITE}...areaway isway ownedway ybay anotherway ompanycay
+STR_RAILROAD_TRACK_WITH_NORMAL_SIGNALS                          :Ailwayray acktray ithway ormalnay ignalssay
+STR_RAILROAD_TRACK_WITH_PRESIGNALS                              :Ailwayray acktray ithway epray-ignalssay
+STR_RAILROAD_TRACK_WITH_EXITSIGNALS                             :Ailwayray acktray ithway exitway-ignalssay
+STR_RAILROAD_TRACK_WITH_COMBOSIGNALS                            :Ailwayray acktray ithway ombocay-ignalssay
+STR_RAILROAD_TRACK_WITH_NORMAL_PRESIGNALS                       :Ailwayray acktray ithway ormalnay andway epray-ignalssay
+STR_RAILROAD_TRACK_WITH_NORMAL_EXITSIGNALS                      :Ailwayray acktray ithway ormalnay andway exitway-ignalssay
+STR_RAILROAD_TRACK_WITH_NORMAL_COMBOSIGNALS                     :Ailwayray acktray ithway ormalnay andway ombocay-ignalssay
+STR_RAILROAD_TRACK_WITH_PRE_EXITSIGNALS                         :Ailwayray acktray ithway epray- andway exitway-ignalssay
+STR_RAILROAD_TRACK_WITH_PRE_COMBOSIGNALS                        :Ailwayray acktray ithway epray- andway ombocay-ignalssay
+STR_RAILROAD_TRACK_WITH_EXIT_COMBOSIGNALS                       :Ailwayray acktray ithway exitway- andway ombocay-ignalssay
+STR_MUST_REMOVE_RAILWAY_STATION_FIRST                           :{WHITE}Ustmay emoveray ailwayray ationstay irstfay
+
+
+
+##id 0x1800
+STR_1801_MUST_REMOVE_ROAD_FIRST                                 :{WHITE}Ustmay emoveray oadray irstfay
+STR_ROAD_WORKS_IN_PROGRESS                                      :{WHITE}Oadray orksway inway ogresspray
+STR_1802_ROAD_CONSTRUCTION                                      :{WHITE}Oadray Onstructioncay
+STR_1802_TRAMWAY_CONSTRUCTION                                   :{WHITE}Amwaytray Onstructioncay
+STR_1803_SELECT_ROAD_BRIDGE                                     :{WHITE}Electsay Oadray Idgebray
+STR_ERR_ONEWAY_ROADS_CAN_T_HAVE_JUNCTION                        :{WHITE}... oneway ayway oadsray an'tcay avehay unctionsjay
+STR_1804_CAN_T_BUILD_ROAD_HERE                                  :{WHITE}An'tcay uildbay oadray erehay...
+STR_1804_CAN_T_BUILD_TRAMWAY_HERE                               :{WHITE}An'tcay uildbay amwaytray erehay...
+STR_1805_CAN_T_REMOVE_ROAD_FROM                                 :{WHITE}An'tcay emoveray oadray omfray erehay...
+STR_1805_CAN_T_REMOVE_TRAMWAY_FROM                              :{WHITE}An'tcay emoveray amwaytray omfray erehay...
+STR_1806_ROAD_DEPOT_ORIENTATION                                 :{WHITE}Oadray Epotday Orientationway
+STR_1806_TRAM_DEPOT_ORIENTATION                                 :{WHITE}Amtray Epotday Orientationway
+STR_1807_CAN_T_BUILD_ROAD_VEHICLE                               :{WHITE}An'tcay uildbay oadray ehiclevay epotday erehay...
+STR_1807_CAN_T_BUILD_TRAM_VEHICLE                               :{WHITE}An'tcay uildbay amtray ehiclevay epotday erehay...
+STR_1808_CAN_T_BUILD_BUS_STATION                                :{WHITE}An'tcay uildbay usbay ationstay...
+STR_1809_CAN_T_BUILD_TRUCK_STATION                              :{WHITE}An'tcay uildbay orrylay ationstay...
+STR_1808_CAN_T_BUILD_PASSENGER_TRAM_STATION                     :{WHITE}An'tcay uildbay assengerpay amtray ationstay...
+STR_1809_CAN_T_BUILD_CARGO_TRAM_STATION                         :{WHITE}An'tcay uildbay eightfray amtray ationstay...
+STR_180A_ROAD_CONSTRUCTION                                      :Oadray onstructioncay
+STR_180A_TRAMWAY_CONSTRUCTION                                   :Amwaytray onstructioncay
+STR_180B_BUILD_ROAD_SECTION                                     :{BLACK}Uildbay oadray ectionsay
+STR_BUILD_AUTOROAD_TIP                                          :{BLACK}Uildbay oadray ectionsay usingway ethay Autoroadway odemay
+STR_180B_BUILD_TRAMWAY_SECTION                                  :{BLACK}Uildbay amwaytray ectionsay
+STR_BUILD_AUTOTRAM_TIP                                          :{BLACK}Uildbay amwaytray ectionsay usingway ethay Autotramway odemay
+STR_180C_BUILD_ROAD_VEHICLE_DEPOT                               :{BLACK}Uildbay oadray ehiclevay epotday (orfay uildingbay andway ervicingsay ehiclesvay)
+STR_180C_BUILD_TRAM_VEHICLE_DEPOT                               :{BLACK}Uildbay amtray ehiclevay epotday (orfay uildingbay andway ervicingsay ehiclesvay)
+STR_180D_BUILD_BUS_STATION                                      :{BLACK}Uildbay usbay ationstay
+STR_180E_BUILD_TRUCK_LOADING_BAY                                :{BLACK}Uildbay orrylay oadinglay aybay
+STR_180D_BUILD_PASSENGER_TRAM_STATION                           :{BLACK}Uildbay assengerpay amtray ationstay
+STR_180E_BUILD_CARGO_TRAM_STATION                               :{BLACK}Uildbay eightfray amtray ationstay
+STR_180F_BUILD_ROAD_BRIDGE                                      :{BLACK}Uildbay oadray idgebray
+STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}Uildbay amwaytray idgebray
+STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}Uildbay oadray unneltay
+STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}Uildbay amwaytray unneltay
+STR_TOGGLE_ONE_WAY_ROAD                                         :{BLACK}Activateway/Eactivateday oneway ayway oadsray
+STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Oggletay uildbay/emoveray orfay oadray onstructioncay
+STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}Oggletay uildbay/emoveray orfay amwaytray onstructioncay
+STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}Electsay oadray ehiclevay epotday orientationway
+STR_1813_SELECT_TRAM_VEHICLE_DEPOT                              :{BLACK}Electsay amtray ehiclevay epotday orientationway
+STR_1814_ROAD                                                   :Oadray
+STR_1815_ROAD_WITH_STREETLIGHTS                                 :Oadray ithway eetlightsstray
+STR_1816_TREE_LINED_ROAD                                        :Eetray-inedlay oadray
+STR_1817_ROAD_VEHICLE_DEPOT                                     :Oadray ehiclevay epotday
+STR_1818_ROAD_RAIL_LEVEL_CROSSING                               :Oadray/ailray evellay ossingcray
+STR_CAN_T_REMOVE_BUS_STATION                                    :{WHITE}An'tcay emoveray usbay ationstay...
+STR_CAN_T_REMOVE_TRUCK_STATION                                  :{WHITE}An'tcay emoveray orrylay ationstay...
+STR_CAN_T_REMOVE_PASSENGER_TRAM_STATION                         :{WHITE}An'tcay emoveray assengerpay amtray ationstay...
+STR_CAN_T_REMOVE_CARGO_TRAM_STATION                             :{WHITE}An'tcay emoveray eightfray amtray ationstay...
+
+##id 0x2000
+STR_2000_TOWNS                                                  :{WHITE}Ownstay
+STR_TOWN_LABEL_POP                                              :{WHITE}{TOWN} ({COMMA})
+STR_TOWN_LABEL                                                  :{WHITE}{TOWN}
+STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
+STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
+STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
+STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Uildingbay ustmay ebay emolishedday irstfay
+STR_2005                                                        :{WHITE}{TOWN}
+STR_2006_POPULATION                                             :{BLACK}Opulationpay: {ORANGE}{COMMA}{BLACK}  Ouseshay: {ORANGE}{COMMA}
+STR_2007_RENAME_TOWN                                            :Enameray Owntay
+STR_2008_CAN_T_RENAME_TOWN                                      :{WHITE}An'tcay enameray owntay...
+STR_2009_LOCAL_AUTHORITY_REFUSES                                :{WHITE}{TOWN} ocallay authorityway efusesray otay allowway isthay
+STR_200A_TOWN_NAMES_CLICK_ON_NAME                               :{BLACK}Owntay amesnay - ickclay onway amenay otay entrecay iewvay onway owntay
+STR_200B_CENTER_THE_MAIN_VIEW_ON                                :{BLACK}Entrecay ethay ainmay iewvay onway owntay ocationlay
+STR_200C_CHANGE_TOWN_NAME                                       :{BLACK}Angechay owntay amenay
+STR_200D_PASSENGERS_LAST_MONTH_MAX                              :{BLACK}Assengerspay astlay onthmay: {ORANGE}{COMMA}{BLACK}  axmay: {ORANGE}{COMMA}
+STR_200E_MAIL_LAST_MONTH_MAX                                    :{BLACK}Ailmay astlay onthmay: {ORANGE}{COMMA}{BLACK}  axmay: {ORANGE}{COMMA}
+STR_200F_TALL_OFFICE_BLOCK                                      :Alltay officeway ockblay
+STR_2010_OFFICE_BLOCK                                           :Officeway ockblay
+STR_2011_SMALL_BLOCK_OF_FLATS                                   :Allsmay ockblay ofway atsflay
+STR_2012_CHURCH                                                 :Urchchay
+STR_2013_LARGE_OFFICE_BLOCK                                     :Argelay officeway ockblay
+STR_2014_TOWN_HOUSES                                            :Owntay ouseshay
+STR_2015_HOTEL                                                  :Otelhay
+STR_2016_STATUE                                                 :Atuestay
+STR_2017_FOUNTAIN                                               :Ountainfay
+STR_2018_PARK                                                   :Arkpay
+STR_2019_OFFICE_BLOCK                                           :Officeway ockblay
+STR_201A_SHOPS_AND_OFFICES                                      :Opsshay andway officesway
+STR_201B_MODERN_OFFICE_BUILDING                                 :Odernmay officeway uildingbay
+STR_201C_WAREHOUSE                                              :Arehouseway
+STR_201D_OFFICE_BLOCK                                           :Officeway ockblay
+STR_201E_STADIUM                                                :Adiumstay
+STR_201F_OLD_HOUSES                                             :Oldway ouseshay
+STR_2020_LOCAL_AUTHORITY                                        :{BLACK}Ocallay authorityway
+STR_2021_SHOW_INFORMATION_ON_LOCAL                              :{BLACK}Owshay informationway onway ocallay authorityway
+STR_2022_LOCAL_AUTHORITY                                        :{WHITE}{TOWN} ocallay authorityway
+STR_2023_TRANSPORT_COMPANY_RATINGS                              :{BLACK}Ansporttray ompanycay atingsray:
+STR_2024                                                        :{YELLOW}{COMPANY} {COMPANYNUM}: {ORANGE}{STRING}
+STR_2025_SUBSIDIES                                              :{WHITE}Ubsidiessay
+STR_2026_SUBSIDIES_ON_OFFER_FOR                                 :{BLACK}Ubsidiessay onway offerway orfay ervicessay akingtay:
+STR_2027_FROM_TO                                                :{ORANGE}{STRING} omfray {STRING} otay {STRING}
+STR_2028_BY                                                     :{YELLOW} (ybay {DATE_SHORT})
+STR_202A_NONE                                                   :{ORANGE}Onenay
+STR_202B_SERVICES_ALREADY_SUBSIDISED                            :{BLACK}Ervicessay alreadyway ubsidisedsay:
+STR_202C_FROM_TO                                                :{ORANGE}{STRING} omfray {STATION} otay {STATION}{YELLOW} ({COMPANY}
+STR_202D_UNTIL                                                  :{YELLOW}, untilway {DATE_SHORT})
+STR_202E_OFFER_OF_SUBSIDY_EXPIRED                               :{BLACK}{BIGFONT}Offerway ofway ubsidysay expiredway:{}{}{STRING} omfray {STRING} otay {STRING} illway ownay otnay attractway away ubsidysay.
+STR_202F_SUBSIDY_WITHDRAWN_SERVICE                              :{BLACK}{BIGFONT}Ubsidysay ithdrawnway:{}{}{STRING} ervicesay omfray {STATION} otay {STATION} isway onay ongerlay ubsidisedsay.
+STR_2030_SERVICE_SUBSIDY_OFFERED                                :{BLACK}{BIGFONT}Ervicesay ubsidysay offeredway:{}{}Irstfay {STRING} ervicesay omfray {STRING} otay {STRING} illway attractway away ear'syay ubsidysay omfray ethay ocallay authorityway!
+STR_2031_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Ervicesay ubsidysay awardedway otay {COMPANY}!{}{}{STRING} ervicesay omfray {STATION} otay {STATION} illway aypay 50% extraway orfay ethay extnay earyay!
+STR_2032_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Ervicesay ubsidysay awardedway otay {COMPANY}!{}{}{STRING} ervicesay omfray {STATION} otay {STATION} illway aypay oubleday atesray orfay ethay extnay earyay!
+STR_2033_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Ervicesay ubsidysay awardedway otay {COMPANY}!{}{}{STRING} ervicesay omfray {STATION} otay {STATION} illway aypay ipletray atesray orfay ethay extnay earyay!
+STR_2034_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Ervicesay ubsidysay awardedway otay {COMPANY}!{}{}{STRING} ervicesay omfray {STATION} otay {STATION} illway aypay adruplequay atesray orfay ethay extnay earyay!
+STR_2035_LOCAL_AUTHORITY_REFUSES                                :{WHITE}{TOWN} ocallay authorityway efusesray otay allowway anotherway airportway otay ebay uiltbay inway isthay owntay
+STR_2036_COTTAGES                                               :Ottagescay
+STR_2037_HOUSES                                                 :Ouseshay
+STR_2038_FLATS                                                  :Atsflay
+STR_2039_TALL_OFFICE_BLOCK                                      :Alltay officeway ockblay
+STR_203A_SHOPS_AND_OFFICES                                      :Opsshay andway officesway
+STR_203B_SHOPS_AND_OFFICES                                      :Opsshay andway officesway
+STR_203C_THEATER                                                :Eatrethay
+STR_203D_STADIUM                                                :Adiumstay
+STR_203E_OFFICES                                                :Officesway
+STR_203F_HOUSES                                                 :Ouseshay
+STR_2040_CINEMA                                                 :Inemacay
+STR_2041_SHOPPING_MALL                                          :Oppingshay allmay
+STR_2042_DO_IT                                                  :{BLACK}Oday itway
+STR_2043_LIST_OF_THINGS_TO_DO_AT                                :{BLACK}Istlay ofway ingsthay otay oday atway isthay owntay - ickclay onway itemway orfay oremay etailsday
+STR_2044_CARRY_OUT_THE_HIGHLIGHTED                              :{BLACK}Arrycay outway ethay ighlightedhay actionway inway ethay istlay aboveway
+STR_2045_ACTIONS_AVAILABLE                                      :{BLACK}Actionsway availableway:
+STR_2046_SMALL_ADVERTISING_CAMPAIGN                             :Allsmay advertisingway ampaigncay
+STR_2047_MEDIUM_ADVERTISING_CAMPAIGN                            :Ediummay advertisingway ampaigncay
+STR_2048_LARGE_ADVERTISING_CAMPAIGN                             :Argelay advertisingway ampaigncay
+STR_2049_FUND_LOCAL_ROAD_RECONSTRUCTION                         :Undfay ocallay oadray econstructionray
+STR_204A_BUILD_STATUE_OF_COMPANY                                :Uildbay atuestay ofway ompanycay ownerway
+STR_204B_FUND_NEW_BUILDINGS                                     :Undfay ewnay uildingsbay
+STR_204C_BUY_EXCLUSIVE_TRANSPORT                                :Uybay exclusiveway ansporttray ightsray
+STR_TOWN_BRIBE_THE_LOCAL_AUTHORITY                              :Ibebray ethay ocallay authorityway
+STR_204D_INITIATE_A_SMALL_LOCAL                                 :{WHITE}{STRING}{}{YELLOW} Initiateway away allsmay ocallay advertisingway ampaigncay, otay attractway oremay assengerspay andway argocay otay ouryay ansporttray ervicessay.{}  Ostcay: {CURRENCY}
+STR_204E_INITIATE_A_MEDIUM_LOCAL                                :{WHITE}{STRING}{}{YELLOW} Initiateway away ediummay ocallay advertisingway ampaigncay, otay attractway oremay assengerspay andway argocay otay ouryay ansporttray ervicessay.{}  Ostcay: {CURRENCY}
+STR_204F_INITIATE_A_LARGE_LOCAL                                 :{WHITE}{STRING}{}{YELLOW} Initiateway away argelay ocallay advertisingway ampaigncay, otay attractway oremay assengerspay andway argocay otay ouryay ansporttray ervicessay.{}  Ostcay: {CURRENCY}
+STR_2050_FUND_THE_RECONSTRUCTION                                :{WHITE}{STRING}{}{YELLOW} Undfay ethay econstructionray ofway ethay urbanway oadray etworknay. Ausescay onsiderablecay isruptionday otay oadray affictray orfay upway otay 6 onthsmay.{}  Ostcay: {CURRENCY}
+STR_2051_BUILD_A_STATUE_IN_HONOR                                :{WHITE}{STRING}{}{YELLOW} Uildbay away atuestay inway onourhay ofway ouryay ompanycay.{} Ostcay: {CURRENCY}
+STR_2052_FUND_THE_CONSTRUCTION_OF                               :{WHITE}{STRING}{}{YELLOW} Undfay ethay onstructioncay ofway ewnay ommercialcay uildingsbay inway ethay owntay.{}  Ostcay: {CURRENCY}
+STR_2053_BUY_1_YEAR_S_EXCLUSIVE                                 :{WHITE}{STRING}{}{YELLOW} Uybay 1 ear'syay exclusiveway ansporttray ightsray inway owntay. Owntay authorityway illway onlyway allowway assengerspay andway argocay otay useway ouryay ompany'scay ationsstay.{} Ostcay: {CURRENCY}
+STR_TOWN_BRIBE_THE_LOCAL_AUTHORITY_DESC                         :{WHITE}{STRING}{}{YELLOW} Ibebray ethay ocallay authorityway otay increaseway ouryay atingray, atway ethay iskray ofway away everesay enaltypay ifway aughtcay.{}  Ostcay: {CURRENCY}
+STR_2055_TRAFFIC_CHAOS_IN_ROAD_REBUILDING                       :{BIGFONT}{BLACK}Affictray aoschay inway {TOWN}!{}{}Oadray ebuildingray ogrammepray undedfay ybay {COMPANY} ingsbray 6 onthsmay ofway iserymay otay otoristsmay!
+STR_2056                                                        :{TINYFONT}{WHITE}{TOWN}
+STR_2057                                                        :{ORANGE}{TOWN}{BLACK} ({COMMA})
+STR_2058_UNDER_CONSTRUCTION                                     :{STRING} (underway onstructioncay)
+STR_2059_IGLOO                                                  :Iglooway
+STR_205A_TEPEES                                                 :Epeestay
+STR_205B_TEAPOT_HOUSE                                           :Eapottay-Ousehay
+STR_205C_PIGGY_BANK                                             :Iggypay-Ankbay
+
+STR_INDUSTRY                                                    :{INDUSTRY}
+STR_TOWN                                                        :{TOWN}
+STR_INDUSTRY_FORMAT                                             :{TOWN} {STRING}
+STR_STATION                                                     :{STATION}
+
+##id 0x2800
+STR_LANDSCAPING                                                 :Andscapinglay
+STR_2800_PLANT_TREES                                            :Antplay eestray
+STR_2801_PLACE_SIGN                                             :Aceplay ignsay
+STR_2802_TREES                                                  :{WHITE}Eestray
+STR_2803_TREE_ALREADY_HERE                                      :{WHITE}...eetray alreadyway erehay
+STR_2804_SITE_UNSUITABLE                                        :{WHITE}...itesay unsuitableway
+STR_2805_CAN_T_PLANT_TREE_HERE                                  :{WHITE}An'tcay antplay eetray erehay...
+STR_2806                                                        :{WHITE}{SIGN}
+STR_2808_TOO_MANY_SIGNS                                         :{WHITE}...ootay anymay ignssay
+STR_2809_CAN_T_PLACE_SIGN_HERE                                  :{WHITE}An'tcay aceplay ignsay erehay...
+STR_280A_SIGN                                                   :Ignsay
+STR_280B_EDIT_SIGN_TEXT                                         :{WHITE}Editway ignsay exttay
+STR_280C_CAN_T_CHANGE_SIGN_NAME                                 :{WHITE}An'tcay angechay ignsay amenay...
+STR_280D_SELECT_TREE_TYPE_TO_PLANT                              :{BLACK}Electsay eetray ypetay otay antplay
+STR_280E_TREES                                                  :Eestray
+STR_280F_RAINFOREST                                             :Ainforestray
+STR_2810_CACTUS_PLANTS                                          :Actuscay Antsplay
+
+##id 0x3000
+STR_3000_RAIL_STATION_SELECTION                                 :{WHITE}Ailray Ationstay Electionsay
+STR_3001_AIRPORT_SELECTION                                      :{WHITE}Airportway Electionsay
+STR_3002_ORIENTATION                                            :{BLACK}Orientationway
+STR_3003_NUMBER_OF_TRACKS                                       :{BLACK}Umbernay ofway ackstray
+STR_3004_PLATFORM_LENGTH                                        :{BLACK}Atformplay engthlay
+STR_3005_TOO_CLOSE_TO_ANOTHER_RAILROAD                          :{WHITE}Ootay oseclay otay anotherway ailwayray ationstay
+STR_3006_ADJOINS_MORE_THAN_ONE_EXISTING                         :{WHITE}Adjoinsway oremay anthay oneway existingway ationstay/oadinglay areaway
+STR_3007_TOO_MANY_STATIONS_LOADING                              :{WHITE}Ootay anymay ationsstay/oadinglay areasway inway isthay owntay
+STR_3008_TOO_MANY_STATIONS_LOADING                              :{WHITE}Ootay anymay ationsstay/oadinglay areasway
+STR_3008A_TOO_MANY_BUS_STOPS                                    :{WHITE}Ootay anymay usbay opsstay
+STR_3008B_TOO_MANY_TRUCK_STOPS                                  :{WHITE}Ootay anymay orrylay ationsstay
+STR_3009_TOO_CLOSE_TO_ANOTHER_STATION                           :{WHITE}Ootay oseclay otay anotherway ationstay/oadinglay areaway
+STR_300A_0                                                      :{WHITE}{STATION} {STATIONFEATURES}
+STR_300B_MUST_DEMOLISH_RAILROAD                                 :{WHITE}Ustmay emolishday ailwayray ationstay irstfay
+STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT                           :{WHITE}Ootay oseclay otay anotherway airportway
+STR_300E_MUST_DEMOLISH_AIRPORT_FIRST                            :{WHITE}Ustmay emolishday airportway irstfay
+
+STR_3030_RENAME_STATION_LOADING                                 :Enameray ationstay/oadinglay areaway
+STR_3031_CAN_T_RENAME_STATION                                   :{WHITE}An'tcay enameray ationstay...
+STR_3032_RATINGS                                                :{BLACK}Atingsray
+STR_3033_ACCEPTS                                                :{BLACK}Acceptsway
+STR_3034_LOCAL_RATING_OF_TRANSPORT                              :{BLACK}Ocallay atingray ofway ansporttray ervicesay:
+
+############ range for rating starts
+STR_3035_APPALLING                                              :Appallingway
+STR_3036_VERY_POOR                                              :Eryvay Oorpay
+STR_3037_POOR                                                   :Oorpay
+STR_3038_MEDIOCRE                                               :Ediocremay
+STR_3039_GOOD                                                   :Oodgay
+STR_303A_VERY_GOOD                                              :Eryvay Oodgay
+STR_303B_EXCELLENT                                              :Excellentway
+STR_303C_OUTSTANDING                                            :Outstandingway
+############ range for rating ends
+
+STR_303D                                                        :{WHITE}{STRING}: {YELLOW}{STRING} ({COMMA}%)
+STR_303E_NO_LONGER_ACCEPTS                                      :{WHITE}{STATION} onay ongerlay acceptsway {STRING}
+STR_303F_NO_LONGER_ACCEPTS_OR                                   :{WHITE}{STATION} onay ongerlay acceptsway {STRING} orway {STRING}
+STR_3040_NOW_ACCEPTS                                            :{WHITE}{STATION} ownay acceptsway {STRING}
+STR_3041_NOW_ACCEPTS_AND                                        :{WHITE}{STATION} ownay acceptsway {STRING} andway {STRING}
+STR_3042_BUS_STATION_ORIENTATION                                :{WHITE}Usbay Ationstay Orientationway
+STR_3043_TRUCK_STATION_ORIENT                                   :{WHITE}Orrylay Ationstay Orientationway
+STR_3042_PASSENGER_TRAM_STATION_ORIENTATION                     :{WHITE}Assengerpay Amtray Orientationway
+STR_3043_CARGO_TRAM_STATION_ORIENT                              :{WHITE}Eightfray Amtray Orientationway
+STR_3046_MUST_DEMOLISH_BUS_STATION                              :{WHITE}Ustmay emolishday usbay ationstay irstfay
+STR_3047_MUST_DEMOLISH_TRUCK_STATION                            :{WHITE}Ustmay emolishday orrylay ationstay irstfay
+STR_3046_MUST_DEMOLISH_PASSENGER_TRAM_STATION                   :{WHITE}Ustmay emolishday assengerpay amtray ationstay irstfay
+STR_3047_MUST_DEMOLISH_CARGO_TRAM_STATION                       :{WHITE}Ustmay emolishday eightfray amtray ationstay irstfay
+STR_3048_STATIONS                                               :{WHITE}{COMPANY} - {COMMA} Ation{P "" s}stay
+STR_3049_0                                                      :{YELLOW}{STATION} {STATIONFEATURES}
+STR_304A_NONE                                                   :{YELLOW}- Onenay -
+STR_304B_SITE_UNSUITABLE                                        :{WHITE}...itesay unsuitableway
+STR_304C_TOO_CLOSE_TO_ANOTHER_DOCK                              :{WHITE}Ootay oseclay otay anotherway ockday
+STR_304D_MUST_DEMOLISH_DOCK_FIRST                               :{WHITE}Ustmay emolishday ockday irstfay
+STR_304E_SELECT_RAILROAD_STATION                                :{BLACK}Electsay ailwayray ationstay orientationway
+STR_304F_SELECT_NUMBER_OF_PLATFORMS                             :{BLACK}Electsay umbernay ofway atformsplay orfay ailwayray ationstay
+STR_3050_SELECT_LENGTH_OF_RAILROAD                              :{BLACK}Electsay engthlay ofway ailwayray ationstay
+STR_3051_SELECT_BUS_STATION_ORIENTATION                         :{BLACK}Electsay usbay ationstay orientationway
+STR_3052_SELECT_TRUCK_LOADING_BAY                               :{BLACK}Electsay orrylay oadinglay aybay orientationway
+STR_3051_SELECT_PASSENGER_TRAM_STATION_ORIENTATION              :{BLACK}Electsay assengerpay amtray ationstay orientationway
+STR_3052_SELECT_CARGO_TRAM_STATION_ORIENTATION                  :{BLACK}Electsay eightfray amtray ationstay orientationway
+STR_3053_CENTER_MAIN_VIEW_ON_STATION                            :{BLACK}Entrecay ainmay iewvay onway ationstay ocationlay
+STR_3054_SHOW_STATION_RATINGS                                   :{BLACK}Owshay ationstay atingsray
+STR_3055_CHANGE_NAME_OF_STATION                                 :{BLACK}Angechay amenay ofway ationstay
+STR_3056_SHOW_LIST_OF_ACCEPTED_CARGO                            :{BLACK}Owshay istlay ofway acceptedway argocay
+STR_3057_STATION_NAMES_CLICK_ON                                 :{BLACK}Ationstay amesnay - ickclay onway amenay otay entrecay ainmay iewvay onway ationstay
+STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT                            :{BLACK}Electsay izesay/ypetay ofway airportway
+STR_305C_0                                                      :{STATION} {STATIONFEATURES}
+STR_STATION_SIGN_TINY                                           :{TINYFONT}{STATION}
+STR_305E_RAILROAD_STATION                                       :Ailwayray ationstay
+STR_305F_AIRCRAFT_HANGAR                                        :Aircraftway angarhay
+STR_3060_AIRPORT                                                :Airportway
+STR_3061_TRUCK_LOADING_AREA                                     :Orrylay oadinglay areaway
+STR_3062_BUS_STATION                                            :Usbay ationstay
+STR_3063_SHIP_DOCK                                              :Ipshay ockday
+STR_3064_HIGHLIGHT_COVERAGE_AREA                                :{BLACK}Ighlighthay overagecay areaway ofway oposedpray itesay
+STR_3065_DON_T_HIGHLIGHT_COVERAGE                               :{BLACK}On'tday ighlighthay overagecay areaway ofway oposedpray itesay
+STR_3066_COVERAGE_AREA_HIGHLIGHT                                :{BLACK}Overagecay areaway ighlighthay
+STR_3068_DOCK                                                   :{WHITE}Ockday
+STR_3069_BUOY                                                   :Uoybay
+STR_306A_BUOY_IN_THE_WAY                                        :{WHITE}...uoybay inway ethay ayway
+STR_306C_STATION_TOO_SPREAD_OUT                                 :{WHITE}...ationstay ootay eadspray outway
+STR_306D_NONUNIFORM_STATIONS_DISALLOWED                         :{WHITE}...onuniformnay ationsstay isabledday
+STR_USE_CTRL_TO_SELECT_MORE                                     :{BLACK}Oldhay ownday CTRLay otay electsay oremay anthay oneway itemway
+
+STR_UNDEFINED                                                   :(undefinedway ingstray)
+STR_STAT_CLASS_DFLT                                             :Efaultday ationstay
+STR_STAT_CLASS_WAYP                                             :Aypointsway
+
+##id 0x3800
+STR_3800_SHIP_DEPOT_ORIENTATION                                 :{WHITE}Ipshay Epotday Orientationway
+STR_3801_MUST_BE_BUILT_ON_WATER                                 :{WHITE}...ustmay ebay uiltbay onway aterway
+STR_3802_CAN_T_BUILD_SHIP_DEPOT                                 :{WHITE}An'tcay uildbay ipshay epotday erehay...
+STR_3803_SELECT_SHIP_DEPOT_ORIENTATION                          :{BLACK}Electsay ipshay epotday orientationway
+STR_3804_WATER                                                  :Aterway
+STR_3805_COAST_OR_RIVERBANK                                     :Oastcay orway iverbankray
+STR_3806_SHIP_DEPOT                                             :Ipshay epotday
+STR_3807_CAN_T_BUILD_ON_WATER                                   :{WHITE}...An'tcay uildbay onway aterway
+STR_MUST_DEMOLISH_CANAL_FIRST                                   :{WHITE}Ustmay emolishday analcay irstfay
+
+##id 0x4000
+STR_4000_SAVE_GAME                                              :{WHITE}Avesay Amegay
+STR_4001_LOAD_GAME                                              :{WHITE}Oadlay Amegay
+STR_4002_SAVE                                                   :{BLACK}Avesay
+STR_4003_DELETE                                                 :{BLACK}Eleteday
+STR_4004                                                        :{COMPANY}, {DATE_LONG}
+STR_4005_BYTES_FREE                                             :{BLACK}{COMMA} egabyte{P "" s}may eefray
+STR_4006_UNABLE_TO_READ_DRIVE                                   :{BLACK}Unableway otay eadray ivedray
+STR_4007_GAME_SAVE_FAILED                                       :{WHITE}Amegay Avesay Ailedfay{}{STRING}
+STR_4008_UNABLE_TO_DELETE_FILE                                  :{WHITE}Unableway otay eleteday ilefay
+STR_4009_GAME_LOAD_FAILED                                       :{WHITE}Amegay Oadlay Ailedfay{}{STRING}
+STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR                   :Internalway errorway: {STRING}
+STR_GAME_SAVELOAD_ERROR_BROKEN_SAVEGAME                         :Okenbray avegamesay - {STRING}
+STR_GAME_SAVELOAD_ERROR_TOO_NEW_SAVEGAME                        :Avegamesay isway ademay ithway ewernay ersionvay
+STR_GAME_SAVELOAD_ERROR_FILE_NOT_READABLE                       :Ilefay otnay eadableray
+STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE                      :Ilefay otnay iteablewray
+STR_400A_LIST_OF_DRIVES_DIRECTORIES                             :{BLACK}Istlay ofway ivesdray, irectoriesday andway avedsay-amegay ilesfay
+STR_400B_CURRENTLY_SELECTED_NAME                                :{BLACK}Urrentlycay electedsay amenay orfay avedsay-amegay
+STR_400C_DELETE_THE_CURRENTLY_SELECTED                          :{BLACK}Eleteday ethay urrentlycay electedsay avedsay-amegay
+STR_400D_SAVE_THE_CURRENT_GAME_USING                            :{BLACK}Avesay ethay urrentcay amegay, usingway ethay electedsay amenay
+STR_400E_SELECT_NEW_GAME_TYPE                                   :{WHITE}Electsay Ewnay Amegay Ypetay
+STR_400F_SELECT_SCENARIO_GREEN_PRE                              :{BLACK}Electsay enarioscay (eengray), epray-etsay amegay (ueblay), orway andomray ewnay amegay
+STR_4010_GENERATE_RANDOM_NEW_GAME                               :Enerategay andomray ewnay amegay
+STR_4011_LOAD_HEIGHTMAP                                         :{WHITE}Oadlay Eightmaphay
+
+##id 0x4800
+STR_4800_IN_THE_WAY                                             :{WHITE}{STRING} inway ethay ayway
+STR_4801                                                        :{WHITE}{INDUSTRY}
+STR_4802_COAL_MINE                                              :Oalcay Inemay
+STR_4803_POWER_STATION                                          :Owerpay Ationstay
+STR_4804_SAWMILL                                                :Awmillsay
+STR_4805_FOREST                                                 :Orestfay
+STR_4806_OIL_REFINERY                                           :Oilway Efineryray
+STR_4807_OIL_RIG                                                :Oilway Igray
+STR_4808_FACTORY                                                :Actoryfay
+STR_4809_PRINTING_WORKS                                         :Intingpray Orksway
+STR_480A_STEEL_MILL                                             :Eelstay Illmay
+STR_480B_FARM                                                   :Armfay
+STR_480C_COPPER_ORE_MINE                                        :Oppercay Oreway Inemay
+STR_480D_OIL_WELLS                                              :Oilway Ellsway
+STR_480E_BANK                                                   :Ankbay
+STR_480F_FOOD_PROCESSING_PLANT                                  :Oodfay Ocessingpray Antplay
+STR_4810_PAPER_MILL                                             :Aperpay Illmay
+STR_4811_GOLD_MINE                                              :Oldgay Inemay
+STR_4812_BANK                                                   :Ankbay
+STR_4813_DIAMOND_MINE                                           :Iamondday Inemay
+STR_4814_IRON_ORE_MINE                                          :Ironway Oreway Inemay
+STR_4815_FRUIT_PLANTATION                                       :Uitfray Antationplay
+STR_4816_RUBBER_PLANTATION                                      :Ubberray Antationplay
+STR_4817_WATER_SUPPLY                                           :Aterway Upplysay
+STR_4818_WATER_TOWER                                            :Aterway Owertay
+STR_4819_FACTORY                                                :Actoryfay
+STR_481A_FARM                                                   :Armfay
+STR_481B_LUMBER_MILL                                            :Umberlay Illmay
+STR_481C_COTTON_CANDY_FOREST                                    :Andyflosscay Orestfay
+STR_481D_CANDY_FACTORY                                          :Eetsway Actoryfay
+STR_481E_BATTERY_FARM                                           :Atterybay Armfay
+STR_481F_COLA_WELLS                                             :Olacay Ellsway
+STR_4820_TOY_SHOP                                               :Oytay Opshay
+STR_4821_TOY_FACTORY                                            :Oytay Actoryfay
+STR_4822_PLASTIC_FOUNTAINS                                      :Asticplay Ountainsfay
+STR_4823_FIZZY_DRINK_FACTORY                                    :Izzyfay Inkdray Actoryfay
+STR_4824_BUBBLE_GENERATOR                                       :Ubblebay Eneratorgay
+STR_4825_TOFFEE_QUARRY                                          :Offeetay Arryquay
+STR_4826_SUGAR_MINE                                             :Ugarsay Inemay
+
+############ range for requires starts
+STR_4827_REQUIRES                                               :{BLACK}Equiresray: {YELLOW}{STRING}
+STR_4828_REQUIRES                                               :{BLACK}Equiresray: {YELLOW}{STRING}, {STRING}
+STR_4829_REQUIRES                                               :{BLACK}Equiresray: {YELLOW}{STRING}, {STRING}, {STRING}
+############ range for requires ends
+
+############ range for produces starts
+STR_INDUSTRY_WINDOW_WAITING_FOR_PROCESSING                      :{BLACK}Argocay aitingway otay ebay ocessedpray:
+STR_INDUSTRY_WINDOW_WAITING_STOCKPILE_CARGO                     :{YELLOW}{CARGO}{BLACK}
+STR_4827_PRODUCES                                               :{BLACK}Oducespray: {YELLOW}{STRING}
+STR_4828_PRODUCES                                               :{BLACK}Oducespray: {YELLOW}{STRING}, {STRING}
+############ range for produces ends
+
+STR_482A_PRODUCTION_LAST_MONTH                                  :{BLACK}Oductionpray astlay onthmay:
+STR_482B_TRANSPORTED                                            :{YELLOW}{CARGO}{BLACK} ({COMMA}% ansportedtray)
+STR_482C_CENTER_THE_MAIN_VIEW_ON                                :{BLACK}Entrecay ethay ainmay iewvay onway industryway ocationlay
+STR_482D_NEW_UNDER_CONSTRUCTION                                 :{BLACK}{BIGFONT}Ewnay {STRING} underway onstructioncay earnay {TOWN}!
+STR_482E_NEW_BEING_PLANTED_NEAR                                 :{BLACK}{BIGFONT}Ewnay {STRING} eingbay antedplay earnay {TOWN}!
+STR_482F_COST                                                   :{BLACK}Ostcay: {YELLOW}{CURRENCY}
+STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY                          :{WHITE}An'tcay onstructcay isthay industryway ypetay erehay...
+STR_4831_FOREST_CAN_ONLY_BE_PLANTED                             :{WHITE}...orestfay ancay onlyway ebay antedplay aboveway owsnay-inelay
+STR_4832_ANNOUNCES_IMMINENT_CLOSURE                             :{BLACK}{BIGFONT}{STRING} announcesway imminentway osureclay!
+STR_4833_SUPPLY_PROBLEMS_CAUSE_TO                               :{BLACK}{BIGFONT}Upplysay oblemspray ausecay {STRING} otay announceway imminentway osureclay!
+STR_4834_LACK_OF_NEARBY_TREES_CAUSES                            :{BLACK}{BIGFONT}Acklay ofway earbynay eestray ausescay {STRING} otay announceway imminentway osureclay!
+STR_4835_INCREASES_PRODUCTION                                   :{BLACK}{BIGFONT}{INDUSTRY} increasesway oductionpray!
+STR_4836_NEW_COAL_SEAM_FOUND_AT                                 :{BLACK}{BIGFONT}Ewnay oalcay eamsay oundfay atway {INDUSTRY}!{}Oductionpray isway expectedway otay oubleday!
+STR_4837_NEW_OIL_RESERVES_FOUND                                 :{BLACK}{BIGFONT}Ewnay oilway eservesray oundfay atway {INDUSTRY}!{}Oductionpray isway expectedway otay oubleday!
+STR_4838_IMPROVED_FARMING_METHODS                               :{BLACK}{BIGFONT}Improvedway armingfay ethodsmay atway {INDUSTRY} areway expectedway otay oubleday oductionpray!
+STR_4839_PRODUCTION_DOWN_BY_50                                  :{BLACK}{BIGFONT}{INDUSTRY} oductionpray ownday ybay 50%
+STR_483A_INSECT_INFESTATION_CAUSES                              :{BLACK}{BIGFONT}Insectway infestationway ausescay avochay atway {INDUSTRY}!{}Oductionpray ownday ybay 50%
+STR_483B_CAN_ONLY_BE_POSITIONED                                 :{WHITE}...ancay onlyway ebay ositionedpay earnay edgesway ofway apmay
+STR_INDUSTRY_PROD_GOUP                                          :{BLACK}{BIGFONT}{STRING} oductionpray atway {INDUSTRY} increasesway {COMMA}%!
+STR_INDUSTRY_PROD_GODOWN                                        :{BLACK}{BIGFONT}{STRING} oductionpray atway {INDUSTRY} ecreasesday {COMMA}%!
+
+##id 0x5000
+STR_5000_TRAIN_IN_TUNNEL                                        :{WHITE}Aintray inway unneltay
+STR_5001_ROAD_VEHICLE_IN_TUNNEL                                 :{WHITE}Oadray ehiclevay inway unneltay
+STR_5003_ANOTHER_TUNNEL_IN_THE_WAY                              :{WHITE}Anotherway unneltay inway ethay ayway
+STR_5005_UNABLE_TO_EXCAVATE_LAND                                :{WHITE}Unableway otay excavateway andlay orfay otherway endway ofway unneltay
+STR_5006_MUST_DEMOLISH_TUNNEL_FIRST                             :{WHITE}Ustmay emolishday unneltay irstfay
+STR_5007_MUST_DEMOLISH_BRIDGE_FIRST                             :{WHITE}Ustmay emolishday idgebray irstfay
+STR_5008_CANNOT_START_AND_END_ON                                :{WHITE}Annotcay artstay andway endway inway ethay amesay otspay
+STR_BRIDGEHEADS_NOT_SAME_HEIGHT                                 :{WHITE}Idgebray eadshay otnay atway ethay amesay evellay
+STR_BRIDGE_TOO_LOW_FOR_TERRAIN                                  :{WHITE}Idgebray isway ootay owlay orfay ethay erraintay
+STR_500A_START_AND_END_MUST_BE_IN                               :{WHITE}Artstay andway endway ustmay ebay inway inelay
+STR_500B_SITE_UNSUITABLE_FOR_TUNNEL                             :{WHITE}Itesay unsuitableway orfay unneltay entranceway
+STR_500D                                                        :{GOLD}{STRING},{} {VELOCITY} {WHITE}{CURRENCY}
+STR_500E_SUSPENSION_STEEL                                       :Uspensionsay, Eelstay
+STR_500F_GIRDER_STEEL                                           :Irdergay, Eelstay
+STR_5010_CANTILEVER_STEEL                                       :Antilevercay, Eelstay
+STR_5011_SUSPENSION_CONCRETE                                    :Uspensionsay, Oncretecay
+STR_5012_WOODEN                                                 :Oodenway
+STR_5013_CONCRETE                                               :Oncretecay
+STR_5014_TUBULAR_STEEL                                          :Ubulartay, Eelstay
+STR_BRIDGE_TUBULAR_SILICON                                      :Ubulartay, Iliconsay
+STR_5015_CAN_T_BUILD_BRIDGE_HERE                                :{WHITE}An'tcay uildbay idgebray erehay...
+STR_5016_CAN_T_BUILD_TUNNEL_HERE                                :{WHITE}An'tcay uildbay unneltay erehay...
+STR_5017_RAILROAD_TUNNEL                                        :Ailwayray unneltay
+STR_5018_ROAD_TUNNEL                                            :Oadray unneltay
+STR_501B_STEEL_SUSPENSION_RAIL_BRIDGE                           :Eelstay uspensionsay ailray idgebray
+STR_501C_STEEL_GIRDER_RAIL_BRIDGE                               :Eelstay irdergay ailray idgebray
+STR_501D_STEEL_CANTILEVER_RAIL_BRIDGE                           :Eelstay antilevercay ailray idgebray
+STR_501E_REINFORCED_CONCRETE_SUSPENSION                         :Einforcedray oncretecay uspensionsay ailray idgebray
+STR_501F_WOODEN_RAIL_BRIDGE                                     :Oodenway ailray idgebray
+STR_5020_CONCRETE_RAIL_BRIDGE                                   :Oncretecay ailray idgebray
+STR_5021_STEEL_SUSPENSION_ROAD_BRIDGE                           :Eelstay uspensionsay oadray idgebray
+STR_5022_STEEL_GIRDER_ROAD_BRIDGE                               :Eelstay irdergay oadray idgebray
+STR_5023_STEEL_CANTILEVER_ROAD_BRIDGE                           :Eelstay antilevercay oadray idgebray
+STR_5024_REINFORCED_CONCRETE_SUSPENSION                         :Einforcedray oncretecay uspensionsay oadray idgebray
+STR_5025_WOODEN_ROAD_BRIDGE                                     :Oodenway oadray idgebray
+STR_5026_CONCRETE_ROAD_BRIDGE                                   :Oncretecay oadray idgebray
+STR_5027_TUBULAR_RAIL_BRIDGE                                    :Ubulartay ailray idgebray
+STR_5028_TUBULAR_ROAD_BRIDGE                                    :Ubulartay oadray idgebray
+
+##id 0x5800
+STR_5800_OBJECT_IN_THE_WAY                                      :{WHITE}Objectway inway ethay ayway
+STR_5801_TRANSMITTER                                            :Ansmittertray
+STR_5802_LIGHTHOUSE                                             :Ighthouselay
+STR_5803_COMPANY_HEADQUARTERS                                   :Ompanycay Eadquartershay
+STR_5804_COMPANY_HEADQUARTERS_IN                                :{WHITE}...ompanycay eadquartershay inway ethay ayway
+STR_5805_COMPANY_OWNED_LAND                                     :Ompanycay-ownedway andlay
+STR_5806_CAN_T_PURCHASE_THIS_LAND                               :{WHITE}An'tcay urchasepay isthay andlay areaway...
+STR_5807_YOU_ALREADY_OWN_IT                                     :{WHITE}...ouyay alreadyway ownway itway!
+
+
+############ WARNING, using range 0x6000 for strings that are stored in the savegame
+############ These strings may never get a new id, or savegames will break!
+##id 0x6000
+STR_SV_EMPTY                                                    :
+STR_SV_UNNAMED                                                  :Unnamedway
+STR_SV_TRAIN_NAME                                               :Aintray {COMMA}
+STR_SV_ROADVEH_NAME                                             :Oadray Ehiclevay {COMMA}
+STR_SV_SHIP_NAME                                                :Ipshay {COMMA}
+STR_SV_AIRCRAFT_NAME                                            :Aircraftway {COMMA}
+
+STR_SV_STNAME                                                   :{STRING}
+STR_SV_STNAME_NORTH                                             :{STRING} Orthnay
+STR_SV_STNAME_SOUTH                                             :{STRING} Outhsay
+STR_SV_STNAME_EAST                                              :{STRING} Eastway
+STR_SV_STNAME_WEST                                              :{STRING} Estway
+STR_SV_STNAME_CENTRAL                                           :{STRING} Entralcay
+STR_SV_STNAME_TRANSFER                                          :{STRING} Ansfertray
+STR_SV_STNAME_HALT                                              :{STRING} Althay
+STR_SV_STNAME_VALLEY                                            :{STRING} Alleyvay
+STR_SV_STNAME_HEIGHTS                                           :{STRING} Eightshay
+STR_SV_STNAME_WOODS                                             :{STRING} Oodsway
+STR_SV_STNAME_LAKESIDE                                          :{STRING} Akesidelay
+STR_SV_STNAME_EXCHANGE                                          :{STRING} Exchangeway
+STR_SV_STNAME_AIRPORT                                           :{STRING} Airportway
+STR_SV_STNAME_OILFIELD                                          :{STRING} Oilfieldway
+STR_SV_STNAME_MINES                                             :{STRING} Inesmay
+STR_SV_STNAME_DOCKS                                             :{STRING} Ocksday
+STR_SV_STNAME_BUOY_1                                            :{STRING} Uoybay 1
+STR_SV_STNAME_BUOY_2                                            :{STRING} Uoybay 2
+STR_SV_STNAME_BUOY_3                                            :{STRING} Uoybay 3
+STR_SV_STNAME_BUOY_4                                            :{STRING} Uoybay 4
+STR_SV_STNAME_BUOY_5                                            :{STRING} Uoybay 5
+STR_SV_STNAME_BUOY_6                                            :{STRING} Uoybay 6
+STR_SV_STNAME_BUOY_7                                            :{STRING} Uoybay 7
+STR_SV_STNAME_BUOY_8                                            :{STRING} Uoybay 8
+STR_SV_STNAME_BUOY_9                                            :{STRING} Uoybay 9
+STR_SV_STNAME_ANNEXE                                            :{STRING} Annexeway
+STR_SV_STNAME_SIDINGS                                           :{STRING} Idingssay
+STR_SV_STNAME_BRANCH                                            :{STRING} Anchbray
+STR_SV_STNAME_UPPER                                             :Upperway {STRING}
+STR_SV_STNAME_LOWER                                             :Owerlay {STRING}
+STR_SV_STNAME_HELIPORT                                          :{STRING} Eliporthay
+STR_SV_STNAME_FOREST                                            :{STRING} Orestfay
+STR_SV_STNAME_FALLBACK                                          :{STRING} Ationstay #{NUM}
+
+############ end of savegame specific region!
+
+##id 0x6800
+STR_6800_DIFFICULTY_LEVEL                                       :{WHITE}Ifficultyday Evellay
+STR_OPTIONS_SAVE_CHANGES                                        :{BLACK}Avesay
+
+############ range for difficulty levels starts
+STR_6801_EASY                                                   :{BLACK}Easyway
+STR_6802_MEDIUM                                                 :{BLACK}Ediummay
+STR_6803_HARD                                                   :{BLACK}Ardhay
+STR_6804_CUSTOM                                                 :{BLACK}Ustomcay
+############ range for difficulty levels ends
+
+############ range for difficulty settings starts
+STR_6805_MAXIMUM_NO_COMPETITORS                                 :{LTBLUE}Aximummay onay. ompetitorscay: {ORANGE}{COMMA}
+STR_6806_COMPETITOR_START_TIME                                  :{LTBLUE}Ompetitorcay artstay imetay: {ORANGE}{STRING}
+STR_6807_NO_OF_TOWNS                                            :{LTBLUE}Onay. ofway ownstay: {ORANGE}{STRING}
+STR_6808_NO_OF_INDUSTRIES                                       :{LTBLUE}Onay. ofway industriesway: {ORANGE}{STRING}
+STR_6809_MAXIMUM_INITIAL_LOAN_000                               :{LTBLUE}Aximummay initialway oanlay: {ORANGE}{CURRENCY}
+STR_680A_INITIAL_INTEREST_RATE                                  :{LTBLUE}Initialway interestway ateray: {ORANGE}{COMMA}%
+STR_680B_VEHICLE_RUNNING_COSTS                                  :{LTBLUE}Ehiclevay unningray ostscay: {ORANGE}{STRING}
+STR_680C_CONSTRUCTION_SPEED_OF_COMPETITOR                       :{LTBLUE}Onstructioncay eedspay ofway ompetitorscay: {ORANGE}{STRING}
+STR_680D_INTELLIGENCE_OF_COMPETITORS                            :{LTBLUE}Intelligenceway ofway ompetitorscay: {ORANGE}{STRING}
+STR_680E_VEHICLE_BREAKDOWNS                                     :{LTBLUE}Ehiclevay eakdownsbray: {ORANGE}{STRING}
+STR_680F_SUBSIDY_MULTIPLIER                                     :{LTBLUE}Ubsidysay ultipliermay: {ORANGE}{STRING}
+STR_6810_COST_OF_CONSTRUCTION                                   :{LTBLUE}Ostcay ofway onstructioncay: {ORANGE}{STRING}
+STR_6811_TERRAIN_TYPE                                           :{LTBLUE}Erraintay ypetay: {ORANGE}{STRING}
+STR_6812_QUANTITY_OF_SEA_LAKES                                  :{LTBLUE}Antityquay ofway easay/akeslay: {ORANGE}{STRING}
+STR_6813_ECONOMY                                                :{LTBLUE}Economyway: {ORANGE}{STRING}
+STR_6814_TRAIN_REVERSING                                        :{LTBLUE}Aintray eversingray: {ORANGE}{STRING}
+STR_6815_DISASTERS                                              :{LTBLUE}Isastersday: {ORANGE}{STRING}
+STR_16816_CITY_APPROVAL                                         :{LTBLUE}Itycay ouncil'scay attitudeway owardstay areaway estructuringray: {ORANGE}{STRING}
+############ range for difficulty settings ends
+
+STR_26816_NONE                                                  :Onenay
+STR_NUM_VERY_LOW                                                :Eryvay owlay
+STR_6816_LOW                                                    :Owlay
+STR_6817_NORMAL                                                 :Ormalnay
+STR_6818_HIGH                                                   :Ighhay
+STR_6819                                                        :{BLACK}{SMALLLEFTARROW}
+STR_681A                                                        :{BLACK}{SMALLRIGHTARROW}
+STR_681B_VERY_SLOW                                              :Eryvay Owslay
+STR_681C_SLOW                                                   :Owslay
+STR_681D_MEDIUM                                                 :Ediummay
+STR_681E_FAST                                                   :Astfay
+STR_681F_VERY_FAST                                              :Eryvay Astfay
+STR_VERY_LOW                                                    :Eryvay Owlay
+STR_6820_LOW                                                    :Owlay
+STR_6821_MEDIUM                                                 :Ediummay
+STR_6822_HIGH                                                   :Ighhay
+STR_6823_NONE                                                   :Onenay
+STR_6824_REDUCED                                                :Educedray
+STR_6825_NORMAL                                                 :Ormalnay
+STR_6826_X1_5                                                   :xay1.5
+STR_6827_X2                                                     :xay2
+STR_6828_X3                                                     :xay3
+STR_6829_X4                                                     :xay4
+STR_682A_VERY_FLAT                                              :Eryvay Atflay
+STR_682B_FLAT                                                   :Atflay
+STR_682C_HILLY                                                  :Illyhay
+STR_682D_MOUNTAINOUS                                            :Ountainousmay
+STR_682E_STEADY                                                 :Eadystay
+STR_682F_FLUCTUATING                                            :Uctuatingflay
+STR_6830_IMMEDIATE                                              :Immediateway
+STR_6831_3_MONTHS_AFTER_PLAYER                                  :3 onthsmay afterway ayerplay
+STR_6832_6_MONTHS_AFTER_PLAYER                                  :6 onthsmay afterway ayerplay
+STR_6833_9_MONTHS_AFTER_PLAYER                                  :9 onthsmay afterway ayerplay
+STR_6834_AT_END_OF_LINE_AND_AT_STATIONS                         :Atway endway ofway inelay, andway atway ationsstay
+STR_6835_AT_END_OF_LINE_ONLY                                    :Atway endway ofway inelay onlyway
+STR_6836_OFF                                                    :Offway
+STR_6837_ON                                                     :Onway
+STR_6838_SHOW_HI_SCORE_CHART                                    :{BLACK}Owshay ihay-orescay artchay
+STR_6839_PERMISSIVE                                             :Ermissivepay
+STR_683A_TOLERANT                                               :Oleranttay
+STR_683B_HOSTILE                                                :Ostilehay
+
+##id 0x7000
+STR_7000                                                        :
+STR_7001                                                        :{WHITE}{COMPANY} {BLACK}{COMPANYNUM}
+STR_7002_PLAYER                                                 :(Ayerplay {COMMA})
+STR_7004_NEW_FACE                                               :{BLACK}Ewnay Acefay
+STR_7005_COLOR_SCHEME                                           :{BLACK}Olourcay Emeschay
+STR_7006_COLOR_SCHEME                                           :{GOLD}Olourcay Emeschay:
+STR_7007_NEW_COLOR_SCHEME                                       :{WHITE}Ewnay Olourcay Emeschay
+STR_7008_COMPANY_NAME                                           :{BLACK}Ompanycay Amenay
+STR_7009_PRESIDENT_NAME                                         :{BLACK}Anagermay Amenay
+STR_700A_COMPANY_NAME                                           :Ompanycay Amenay
+STR_700B_PRESIDENT_S_NAME                                       :Anager'smay Amenay
+STR_700C_CAN_T_CHANGE_COMPANY_NAME                              :{WHITE}An'tcay angechay ompanycay amenay...
+STR_700D_CAN_T_CHANGE_PRESIDENT                                 :{WHITE}An'tcay angechay anager'smay amenay...
+STR_700E_FINANCES                                               :{WHITE}{COMPANY} Inancesfay {BLACK}{COMPANYNUM}
+STR_700F_EXPENDITURE_INCOME                                     :{WHITE}Expenditureway/Incomeway
+STR_7010                                                        :{WHITE}{NUM}
+STR_7011_CONSTRUCTION                                           :{GOLD}Onstructioncay
+STR_7012_NEW_VEHICLES                                           :{GOLD}Ewnay Ehiclesvay
+STR_7013_TRAIN_RUNNING_COSTS                                    :{GOLD}Aintray Unningray Ostscay
+STR_7014_ROAD_VEH_RUNNING_COSTS                                 :{GOLD}Oadray Ehvay. Unningray Ostscay
+STR_7015_AIRCRAFT_RUNNING_COSTS                                 :{GOLD}Aircraftway Unningray Ostscay
+STR_7016_SHIP_RUNNING_COSTS                                     :{GOLD}Ipshay Unningray Ostscay
+STR_7017_PROPERTY_MAINTENANCE                                   :{GOLD}Opertypray Aintenancemay
+STR_7018_TRAIN_INCOME                                           :{GOLD}Aintray Incomeway
+STR_7019_ROAD_VEHICLES_INCOME                                   :{GOLD}Oadray Ehiclevay Incomeway
+STR_701A_AIRCRAFT_INCOME                                        :{GOLD}Aircraftway Incomeway
+STR_701B_SHIP_INCOME                                            :{GOLD}Ipshay Incomeway
+STR_701C_LOAN_INTEREST                                          :{GOLD}Oanlay Interestway
+STR_701D_OTHER                                                  :{GOLD}Otherway
+STR_701E                                                        :{BLACK}-{CURRENCY}
+STR_701F                                                        :{BLACK}+{CURRENCY}
+STR_7020_TOTAL                                                  :{WHITE}Otaltay:
+STR_7021                                                        :{COMPANY} {COMPANYNUM}
+STR_7022_INCOME_GRAPH                                           :{WHITE}Incomeway Aphgray
+STR_CURRCOMPACT                                                 :{CURRCOMPACT}
+STR_7024                                                        :{COMMA}
+STR_7025_OPERATING_PROFIT_GRAPH                                 :{WHITE}Operatingway Ofitpray Aphgray
+STR_7026_BANK_BALANCE                                           :{WHITE}Ankbay Alancebay
+STR_7027_LOAN                                                   :{WHITE}Oanlay
+STR_MAX_LOAN                                                    :{WHITE}Axmay Oanlay:  {BLACK}{CURRENCY}
+STR_7028                                                        :{BLACK}{CURRENCY}
+STR_7029_BORROW                                                 :{BLACK}Orrowbay {SKIP}{SKIP}{CURRENCY}
+STR_702A_REPAY                                                  :{BLACK}Epayray {SKIP}{SKIP}{CURRENCY}
+STR_702B_MAXIMUM_PERMITTED_LOAN                                 :{WHITE}...aximummay ermittedpay oanlay izesay isway {CURRENCY}
+STR_702C_CAN_T_BORROW_ANY_MORE_MONEY                            :{WHITE}An'tcay orrowbay anyway oremay oneymay...
+STR_702D_LOAN_ALREADY_REPAYED                                   :{WHITE}...onay oanlay otay epayray
+STR_702E_REQUIRED                                               :{WHITE}...{CURRENCY} equiredray
+STR_702F_CAN_T_REPAY_LOAN                                       :{WHITE}An'tcay epayray oanlay...
+STR_INSUFFICIENT_FUNDS                                          :{WHITE}An'tcay ivegay awayway oneymay atthay isway oanedlay omfray ethay ankbay...
+STR_7030_SELECT_NEW_FACE_FOR_PRESIDENT                          :{BLACK}Electsay ewnay acefay orfay anagermay
+STR_7031_CHANGE_THE_COMPANY_VEHICLE                             :{BLACK}Angechay ethay ompanycay ehiclevay iverylay
+STR_7032_CHANGE_THE_PRESIDENT_S                                 :{BLACK}Angechay ethay anager'smay amenay
+STR_7033_CHANGE_THE_COMPANY_NAME                                :{BLACK}Angechay ethay ompanycay amenay
+STR_7034_CLICK_ON_SELECTED_NEW_COLOR                            :{BLACK}Ickclay onway esiredday olourcay emeschay
+STR_7035_INCREASE_SIZE_OF_LOAN                                  :{BLACK}Increaseway izesay ofway oanlay
+STR_7036_REPAY_PART_OF_LOAN                                     :{BLACK}Epayray artpay ofway oanlay
+STR_7037_PRESIDENT                                              :{WHITE}{PLAYERNAME}{}{GOLD}(Anagermay)
+STR_7038_INAUGURATED                                            :{GOLD}Inauguratedway: {WHITE}{NUM}
+STR_7039_VEHICLES                                               :{GOLD}Ehiclesvay:
+STR_TRAINS                                                      :{WHITE}{COMMA} ain{P "" s}tray
+STR_ROAD_VEHICLES                                               :{WHITE}{COMMA} oadray ehicle{P "" s}vay
+STR_AIRCRAFT                                                    :{WHITE}{COMMA} aircraftway
+STR_SHIPS                                                       :{WHITE}{COMMA} ip{P "" s}shay
+STR_7042_NONE                                                   :{WHITE}Onenay
+STR_7043_FACE_SELECTION                                         :{WHITE}Acefay Electionsay
+STR_7044_MALE                                                   :{BLACK}Alemay
+STR_7045_FEMALE                                                 :{BLACK}Emalefay
+STR_7046_NEW_FACE                                               :{BLACK}Ewnay Acefay
+STR_7047_CANCEL_NEW_FACE_SELECTION                              :{BLACK}Ancelcay ewnay acefay electionsay
+STR_7048_ACCEPT_NEW_FACE_SELECTION                              :{BLACK}Acceptway ewnay acefay electionsay
+STR_7049_SELECT_MALE_FACES                                      :{BLACK}Electsay alemay acesfay
+STR_704A_SELECT_FEMALE_FACES                                    :{BLACK}Electsay emalefay acesfay
+STR_704B_GENERATE_RANDOM_NEW_FACE                               :{BLACK}Enerategay andomray ewnay acefay
+STR_704C_KEY                                                    :{BLACK}Eykay
+STR_704D_SHOW_KEY_TO_GRAPHS                                     :{BLACK}Owshay eykay otay aphsgray
+STR_704E_KEY_TO_COMPANY_GRAPHS                                  :{WHITE}Eykay otay ompanycay aphsgray
+STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY                           :{BLACK}Ickclay erehay otay oggletay ompany'scay entryway onway aphgray onway/offway
+STR_7050_UNITS_OF_CARGO_DELIVERED                               :{WHITE}Unitsway ofway argocay eliveredday
+STR_7051_COMPANY_PERFORMANCE_RATINGS                            :{WHITE}Ompanycay erformancepay atingsray (aximummay atingray=1000)
+STR_7052_COMPANY_VALUES                                         :{WHITE}Ompanycay aluesvay
+STR_7053_COMPANY_LEAGUE_TABLE                                   :{WHITE}Ompanycay Eaguelay Abletay
+STR_7054                                                        :{WHITE}{STRING}{SETX 45}{ORANGE}{COMPANY} {BLACK}{COMPANYNUM} '{STRING}'
+STR_7055                                                        :{YELLOW}{STRING}{SETX 45}{ORANGE}{COMPANY} {BLACK}{COMPANYNUM}  '{STRING}'
+STR_7056_TRANSPORT_COMPANY_IN_TROUBLE                           :{BLACK}{BIGFONT}Ansporttray ompanycay inway oubletray!
+STR_7057_WILL_BE_SOLD_OFF_OR_DECLARED                           :{BLACK}{BIGFONT}{COMPANY} illway ebay oldsay offway orway eclaredday ankruptbay unlessway erformancepay increasesway oonsay!
+STR_7058_PRESIDENT                                              :{BLACK}{PLAYERNAME}{}(Anagermay)
+STR_7059_TRANSPORT_COMPANY_MERGER                               :{BLACK}{BIGFONT}Ansporttray ompanycay ergermay!
+STR_705A_HAS_BEEN_SOLD_TO_FOR                                   :{BLACK}{BIGFONT}{COMPANY} ashay eenbay oldsay otay {COMPANY} orfay {CURRENCY}!
+STR_705B_WE_ARE_LOOKING_FOR_A_TRANSPORT                         :{WHITE}Eway areway ookinglay orfay away ansporttray ompanycay otay aketay-overway ourway ompanycay.{}{}Oday ouyay antway otay urchasepay {COMPANY} orfay {CURRENCY}?
+STR_705C_BANKRUPT                                               :{BLACK}{BIGFONT}Ankruptbay!
+STR_705D_HAS_BEEN_CLOSED_DOWN_BY                                :{BLACK}{BIGFONT}{COMPANY} ashay eenbay osedclay ownday ybay editorscray andway allway assetsway oldsay offway!
+STR_705E_NEW_TRANSPORT_COMPANY_LAUNCHED                         :{BLACK}{BIGFONT}Ewnay ansporttray ompanycay aunchedlay!
+STR_705F_STARTS_CONSTRUCTION_NEAR                               :{BLACK}{BIGFONT}{COMPANY} artsstay onstructioncay earnay {TOWN}!
+STR_7060_CAN_T_BUY_COMPANY                                      :{WHITE}An'tcay uybay ompanycay...
+STR_7061_CARGO_PAYMENT_RATES                                    :{WHITE}Argocay Aymentpay Atesray
+STR_7062_DAYS_IN_TRANSIT                                        :{BLACK}{TINYFONT}Aysday inway ansittray
+STR_7063_PAYMENT_FOR_DELIVERING                                 :{BLACK}{TINYFONT}Aymentpay orfay eliveringday 10 unitsway (orway 10,000 itreslay) ofway argocay away istanceday ofway 20 aressquay
+STR_7064_TOGGLE_GRAPH_FOR_CARGO                                 :{BLACK}Oggletay aphgray orfay argocay ypetay onway/offway
+STR_7065                                                        :{BLACK}{TINYFONT}{STRING}
+STR_7066_ENGINEER                                               :Engineerway
+STR_7067_TRAFFIC_MANAGER                                        :Affictray Anagermay
+STR_7068_TRANSPORT_COORDINATOR                                  :Ansporttray Oordinatorcay
+STR_7069_ROUTE_SUPERVISOR                                       :Outeray Upervisorsay
+STR_706A_DIRECTOR                                               :Irectorday
+STR_706B_CHIEF_EXECUTIVE                                        :Iefchay Executiveway
+STR_706C_CHAIRMAN                                               :Airmanchay
+STR_706D_PRESIDENT                                              :Esidentpray
+STR_706E_TYCOON                                                 :Ycoontay
+STR_706F_BUILD_HQ                                               :{BLACK}Uildbay HQay
+STR_7070_BUILD_COMPANY_HEADQUARTERS                             :{BLACK}Uildbay ompanycay eadquartershay / iewvay ompanycay eadquartershay
+STR_RELOCATE_COMPANY_HEADQUARTERS                               :{BLACK}Ebuildray ompanycay eadquartershay elsewhereway orfay 1% ostcay ofway ompanycay aluevay
+STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS                       :{WHITE}An'tcay uildbay ompanycay eadquartershay...
+STR_7072_VIEW_HQ                                                :{BLACK}Iewvay HQay
+STR_RELOCATE_HQ                                                 :{BLACK}Elocateray HQay
+STR_COMPANY_PASSWORD                                            :{BLACK}Asswordpay
+STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Asswordpay-otectpray ouryay ompanycay otay eventpray unauthorisedway usersway omfray oiningjay.
+STR_SET_COMPANY_PASSWORD                                        :{BLACK}Etsay ompanycay asswordpay
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Oday otnay avesay ethay enteredway asswordpay
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Ivegay ethay ompanycay ethay ewnay asswordpay
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Ompanycay asswordpay
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Efaultday ompanycay asswordpay
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Useway isthay ompanycay asswordpay asway efaultday orfay ewnay ompaniescay
+STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Orldway Ecessionray!{}{}Inancialfay expertsway earfay orstway asway economyway umpsslay!
+STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Ecessionray Overway!{}{}Upturnway inway adetray ivesgay onfidencecay otay industriesway asway economyway engthensstray!
+STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Oggletay argelay/allsmay indowway izesay
+STR_7076_COMPANY_VALUE                                          :{GOLD}Ompanycay aluevay: {WHITE}{CURRENCY}
+STR_7077_BUY_25_SHARE_IN_COMPANY                                :{BLACK}Uybay 25% areshay inway ompanycay
+STR_7078_SELL_25_SHARE_IN_COMPANY                               :{BLACK}Ellsay 25% areshay inway ompanycay
+STR_7079_BUY_25_SHARE_IN_THIS_COMPANY                           :{BLACK}Uybay 25% areshay inway isthay ompanycay
+STR_707A_SELL_25_SHARE_IN_THIS_COMPANY                          :{BLACK}Ellsay 25% areshay inway isthay ompanycay
+STR_707B_CAN_T_BUY_25_SHARE_IN_THIS                             :{WHITE}An'tcay uybay 25% areshay inway isthay ompanycay...
+STR_707C_CAN_T_SELL_25_SHARE_IN                                 :{WHITE}An'tcay ellsay 25% areshay inway isthay ompanycay...
+STR_707D_OWNED_BY                                               :{WHITE}({COMMA}% ownedway ybay {COMPANY})
+STR_707F_HAS_BEEN_TAKEN_OVER_BY                                 :{BLACK}{BIGFONT}{COMPANY} ashay eenbay akentay overway ybay {COMPANY}!
+STR_7080_PROTECTED                                              :{WHITE}Isthay ompanycay isway otnay oldway enoughway otay adetray aresshay etyay...
+
+STR_LIVERY_DEFAULT                                              :Andardstay Iverylay
+STR_LIVERY_STEAM                                                :Eamstay Engineway
+STR_LIVERY_DIESEL                                               :Ieselday Engineway
+STR_LIVERY_ELECTRIC                                             :Electricway Engineway
+STR_LIVERY_MONORAIL                                             :Onorailmay Engineway
+STR_LIVERY_MAGLEV                                               :Aglevmay Engineway
+STR_LIVERY_DMU                                                  :UDMay
+STR_LIVERY_EMU                                                  :EMUWAY
+STR_LIVERY_PASSENGER_WAGON_STEAM                                :Assengerpay Oachcay (Eamstay)
+STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Assengerpay Oachcay (Ieselday)
+STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Assengerpay Oachcay (Electricway)
+STR_LIVERY_FREIGHT_WAGON                                        :Eightfray Agonway
+STR_LIVERY_BUS                                                  :Usbay
+STR_LIVERY_TRUCK                                                :Orrylay
+STR_LIVERY_PASSENGER_SHIP                                       :Assengerpay Erryfay
+STR_LIVERY_FREIGHT_SHIP                                         :Eightfray Ipshay
+STR_LIVERY_HELICOPTER                                           :Elicopterhay
+STR_LIVERY_SMALL_PLANE                                          :Allsmay Aeroplaneway
+STR_LIVERY_LARGE_PLANE                                          :Argelay Aeroplaneway
+STR_LIVERY_PASSENGER_TRAM                                       :Assengerpay Amtray
+STR_LIVERY_FREIGHT_TRAM                                         :Eightfray Amtray
+
+STR_LIVERY_GENERAL_TIP                                          :{BLACK}Owshay eneralgay olourcay emesschay
+STR_LIVERY_TRAIN_TIP                                            :{BLACK}Owshay aintray olourcay emesschay
+STR_LIVERY_ROADVEH_TIP                                          :{BLACK}Owshay oadray ehiclevay olourcay emesschay
+STR_LIVERY_SHIP_TIP                                             :{BLACK}Owshay ipshay olourcay emesschay
+STR_LIVERY_AIRCRAFT_TIP                                         :{BLACK}Owshay aircraftway olourcay emesschay
+STR_LIVERY_PRIMARY_TIP                                          :{BLACK}Oosechay ethay imarypray olourcay orfay ethay electedsay emeschay
+STR_LIVERY_SECONDARY_TIP                                        :{BLACK}Oosechay ethay econdarysay olourcay orfay ethay electedsay emeschay
+STR_LIVERY_PANEL_TIP                                            :{BLACK}Electsay away olourcay emeschay otay angechay, orway ultiplemay emesschay ithway CTRLay+ickclay. Ickclay onway ethay oxbay otay oggletay useway ofway ethay emeschay
+
+##id 0x8000
+STR_8000_KIRBY_PAUL_TANK_STEAM                                  :Irbykay Aulpay Anktay (Eamstay)
+STR_8001_MJS_250_DIESEL                                         :MJSay 250 (Ieselday)
+STR_8002_PLODDYPHUT_CHOO_CHOO                                   :Oddyphutplay Oochay-Oochay
+STR_8003_POWERNAUT_CHOO_CHOO                                    :Owernautpay Oochay-Oochay
+STR_8004_MIGHTYMOVER_CHOO_CHOO                                  :Ightymovermay Oochay-Oochay
+STR_8005_PLODDYPHUT_DIESEL                                      :Oddyphutplay Ieselday
+STR_8006_POWERNAUT_DIESEL                                       :Owernautpay Ieselday
+STR_8007_WILLS_2_8_0_STEAM                                      :Illsway 2-8-0 (Eamstay)
+STR_8008_CHANEY_JUBILEE_STEAM                                   :Aneychay 'Ubilee'jay (Eamstay)
+STR_8009_GINZU_A4_STEAM                                         :Inzugay 'Away4' (Eamstay)
+STR_800A_SH_8P_STEAM                                            :SHay '8P'ay (Eamstay)
+STR_800B_MANLEY_MOREL_DMU_DIESEL                                :Anleymay-Orelmay UDMay (Ieselday)
+STR_800C_DASH_DIESEL                                            :'Ash'day (Ieselday)
+STR_800D_SH_HENDRY_25_DIESEL                                    :SHay/Endryhay '25' (Ieselday)
+STR_800E_UU_37_DIESEL                                           :UUWAY '37' (Ieselday)
+STR_800F_FLOSS_47_DIESEL                                        :Ossflay '47' (Ieselday)
+STR_8010_CS_4000_DIESEL                                         :CSay 4000 (Ieselday)
+STR_8011_CS_2400_DIESEL                                         :CSay 2400 (Ieselday)
+STR_8012_CENTENNIAL_DIESEL                                      :Entennialcay (Ieselday)
+STR_8013_KELLING_3100_DIESEL                                    :Ellingkay 3100 (Ieselday)
+STR_8014_TURNER_TURBO_DIESEL                                    :Urnertay Urbotay (Ieselday)
+STR_8015_MJS_1000_DIESEL                                        :MJSay 1000 (Ieselday)
+STR_8016_SH_125_DIESEL                                          :SHay '125' (Ieselday)
+STR_8017_SH_30_ELECTRIC                                         :SHay '30' (Electricway)
+STR_8018_SH_40_ELECTRIC                                         :SHay '40' (Electricway)
+STR_8019_T_I_M_ELECTRIC                                         :'Tay.Iway.May.' (Electricway)
+STR_801A_ASIASTAR_ELECTRIC                                      :'AsiaStar'WAY (Electricway)
+STR_801B_PASSENGER_CAR                                          :Assengerpay Arriagecay
+STR_801C_MAIL_VAN                                               :Ailmay Anvay
+STR_801D_COAL_CAR                                               :Oalcay Ucktray
+STR_801E_OIL_TANKER                                             :Oilway Ankertay
+STR_801F_LIVESTOCK_VAN                                          :Ivestocklay Anvay
+STR_8020_GOODS_VAN                                              :Oodsgay Anvay
+STR_8021_GRAIN_HOPPER                                           :Aingray Opperhay
+STR_8022_WOOD_TRUCK                                             :Oodway Ucktray
+STR_8023_IRON_ORE_HOPPER                                        :Ironway Oreway Opperhay
+STR_8024_STEEL_TRUCK                                            :Eelstay Ucktray
+STR_8025_ARMORED_VAN                                            :Armouredway Anvay
+STR_8026_FOOD_VAN                                               :Oodfay Anvay
+STR_8027_PAPER_TRUCK                                            :Aperpay Ucktray
+STR_8028_COPPER_ORE_HOPPER                                      :Oppercay Oreway Opperhay
+STR_8029_WATER_TANKER                                           :Aterway Ankertay
+STR_802A_FRUIT_TRUCK                                            :Uitfray Ucktray
+STR_802B_RUBBER_TRUCK                                           :Ubberray Ucktray
+STR_802C_SUGAR_TRUCK                                            :Ugarsay Ucktray
+STR_802D_COTTON_CANDY_HOPPER                                    :Andyflosscay Opperhay
+STR_802E_TOFFEE_HOPPER                                          :Offeetay Opperhay
+STR_802F_BUBBLE_VAN                                             :Ubblebay Anvay
+STR_8030_COLA_TANKER                                            :Olacay Ankertay
+STR_8031_CANDY_VAN                                              :Eetsway Anvay
+STR_8032_TOY_VAN                                                :Oytay Anvay
+STR_8033_BATTERY_TRUCK                                          :Atterybay Ucktray
+STR_8034_FIZZY_DRINK_TRUCK                                      :Izzyfay Inkdray Ucktray
+STR_8035_PLASTIC_TRUCK                                          :Asticplay Ucktray
+STR_8036_X2001_ELECTRIC                                         :'Xay2001' (Electricway)
+STR_8037_MILLENNIUM_Z1_ELECTRIC                                 :'Illenniummay Zay1' (Electricway)
+STR_8038_WIZZOWOW_Z99                                           :Izzowowway Zay99
+STR_8039_PASSENGER_CAR                                          :Assengerpay Arriagecay
+STR_803A_MAIL_VAN                                               :Ailmay Anvay
+STR_803B_COAL_CAR                                               :Oalcay Ucktray
+STR_803C_OIL_TANKER                                             :Oilway Ankertay
+STR_803D_LIVESTOCK_VAN                                          :Ivestocklay Anvay
+STR_803E_GOODS_VAN                                              :Oodsgay Anvay
+STR_803F_GRAIN_HOPPER                                           :Aingray Opperhay
+STR_8040_WOOD_TRUCK                                             :Oodway Ucktray
+STR_8041_IRON_ORE_HOPPER                                        :Ironway Oreway Opperhay
+STR_8042_STEEL_TRUCK                                            :Eelstay Ucktray
+STR_8043_ARMORED_VAN                                            :Armouredway Anvay
+STR_8044_FOOD_VAN                                               :Oodfay Anvay
+STR_8045_PAPER_TRUCK                                            :Aperpay Ucktray
+STR_8046_COPPER_ORE_HOPPER                                      :Oppercay Oreway Opperhay
+STR_8047_WATER_TANKER                                           :Aterway Ankertay
+STR_8048_FRUIT_TRUCK                                            :Uitfray Ucktray
+STR_8049_RUBBER_TRUCK                                           :Ubberray Ucktray
+STR_804A_SUGAR_TRUCK                                            :Ugarsay Ucktray
+STR_804B_COTTON_CANDY_HOPPER                                    :Andyflosscay Opperhay
+STR_804C_TOFFEE_HOPPER                                          :Offeetay Opperhay
+STR_804D_BUBBLE_VAN                                             :Ubblebay Anvay
+STR_804E_COLA_TANKER                                            :Olacay Ankertay
+STR_804F_CANDY_VAN                                              :Eetsway Anvay
+STR_8050_TOY_VAN                                                :Oytay Anvay
+STR_8051_BATTERY_TRUCK                                          :Atterybay Ucktray
+STR_8052_FIZZY_DRINK_TRUCK                                      :Izzyfay Inkdray Ucktray
+STR_8053_PLASTIC_TRUCK                                          :Asticplay Ucktray
+STR_8054_LEV1_LEVIATHAN_ELECTRIC                                :Evlay1 'Eviathan'lay (Electricway)
+STR_8055_LEV2_CYCLOPS_ELECTRIC                                  :Evlay2 'Yclops'cay (Electricway)
+STR_8056_LEV3_PEGASUS_ELECTRIC                                  :Evlay3 'Egasus'pay (Electricway)
+STR_8057_LEV4_CHIMAERA_ELECTRIC                                 :Evlay4 'Imaera'chay (Electricway)
+STR_8058_WIZZOWOW_ROCKETEER                                     :Izzowowway Ocketeerray
+STR_8059_PASSENGER_CAR                                          :Assengerpay Arriagecay
+STR_805A_MAIL_VAN                                               :Ailmay Anvay
+STR_805B_COAL_CAR                                               :Oalcay Ucktray
+STR_805C_OIL_TANKER                                             :Oilway Ankertay
+STR_805D_LIVESTOCK_VAN                                          :Ivestocklay Anvay
+STR_805E_GOODS_VAN                                              :Oodsgay Anvay
+STR_805F_GRAIN_HOPPER                                           :Aingray Opperhay
+STR_8060_WOOD_TRUCK                                             :Oodway Ucktray
+STR_8061_IRON_ORE_HOPPER                                        :Ironway Oreway Opperhay
+STR_8062_STEEL_TRUCK                                            :Eelstay Ucktray
+STR_8063_ARMORED_VAN                                            :Armouredway Anvay
+STR_8064_FOOD_VAN                                               :Oodfay Anvay
+STR_8065_PAPER_TRUCK                                            :Aperpay Ucktray
+STR_8066_COPPER_ORE_HOPPER                                      :Oppercay Oreway Opperhay
+STR_8067_WATER_TANKER                                           :Aterway Ankertay
+STR_8068_FRUIT_TRUCK                                            :Uitfray Ucktray
+STR_8069_RUBBER_TRUCK                                           :Ubberray Ucktray
+STR_806A_SUGAR_TRUCK                                            :Ugarsay Ucktray
+STR_806B_COTTON_CANDY_HOPPER                                    :Andyflosscay Opperhay
+STR_806C_TOFFEE_HOPPER                                          :Offeetay Opperhay
+STR_806D_BUBBLE_VAN                                             :Ubblebay Anvay
+STR_806E_COLA_TANKER                                            :Olacay Ankertay
+STR_806F_CANDY_VAN                                              :Eetsway Anvay
+STR_8070_TOY_VAN                                                :Oytay Anvay
+STR_8071_BATTERY_TRUCK                                          :Atterybay Ucktray
+STR_8072_FIZZY_DRINK_TRUCK                                      :Izzyfay Inkdray Ucktray
+STR_8073_PLASTIC_TRUCK                                          :Asticplay Ucktray
+STR_8074_MPS_REGAL_BUS                                          :MPSay Egalray Usbay
+STR_8075_HEREFORD_LEOPARD_BUS                                   :Erefordhay Eopardlay Usbay
+STR_8076_FOSTER_BUS                                             :Osterfay Usbay
+STR_8077_FOSTER_MKII_SUPERBUS                                   :Osterfay IImkay Uperbussay
+STR_8078_PLODDYPHUT_MKI_BUS                                     :Oddyphutplay Imkay Usbay
+STR_8079_PLODDYPHUT_MKII_BUS                                    :Oddyphutplay IImkay Usbay
+STR_807A_PLODDYPHUT_MKIII_BUS                                   :Oddyphutplay IIImkay Usbay
+STR_807B_BALOGH_COAL_TRUCK                                      :Aloghbay Oalcay Ucktray
+STR_807C_UHL_COAL_TRUCK                                         :Uhlway Oalcay Ucktray
+STR_807D_DW_COAL_TRUCK                                          :DWay Oalcay Ucktray
+STR_807E_MPS_MAIL_TRUCK                                         :MPSay Ailmay Ucktray
+STR_807F_REYNARD_MAIL_TRUCK                                     :Eynardray Ailmay Ucktray
+STR_8080_PERRY_MAIL_TRUCK                                       :Errypay Ailmay Ucktray
+STR_8081_MIGHTYMOVER_MAIL_TRUCK                                 :IghtyMovermay Ailmay Ucktray
+STR_8082_POWERNAUGHT_MAIL_TRUCK                                 :Owernaughtpay Ailmay Ucktray
+STR_8083_WIZZOWOW_MAIL_TRUCK                                    :Izzowowway Ailmay Ucktray
+STR_8084_WITCOMBE_OIL_TANKER                                    :Itcombeway Oilway Ankertay
+STR_8085_FOSTER_OIL_TANKER                                      :Osterfay Oilway Ankertay
+STR_8086_PERRY_OIL_TANKER                                       :Errypay Oilway Ankertay
+STR_8087_TALBOTT_LIVESTOCK_VAN                                  :Albotttay Ivestocklay Anvay
+STR_8088_UHL_LIVESTOCK_VAN                                      :Uhlway Ivestocklay Anvay
+STR_8089_FOSTER_LIVESTOCK_VAN                                   :Osterfay Ivestocklay Anvay
+STR_808A_BALOGH_GOODS_TRUCK                                     :Aloghbay Oodsgay Ucktray
+STR_808B_CRAIGHEAD_GOODS_TRUCK                                  :Aigheadcray Oodsgay Ucktray
+STR_808C_GOSS_GOODS_TRUCK                                       :Ossgay Oodsgay Ucktray
+STR_808D_HEREFORD_GRAIN_TRUCK                                   :Erefordhay Aingray Ucktray
+STR_808E_THOMAS_GRAIN_TRUCK                                     :Omasthay Aingray Ucktray
+STR_808F_GOSS_GRAIN_TRUCK                                       :Ossgay Aingray Ucktray
+STR_8090_WITCOMBE_WOOD_TRUCK                                    :Itcombeway Oodway Ucktray
+STR_8091_FOSTER_WOOD_TRUCK                                      :Osterfay Oodway Ucktray
+STR_8092_MORELAND_WOOD_TRUCK                                    :Orelandmay Oodway Ucktray
+STR_8093_MPS_IRON_ORE_TRUCK                                     :MPSay Ironway Oreway Ucktray
+STR_8094_UHL_IRON_ORE_TRUCK                                     :Uhlway Ironway Oreway Ucktray
+STR_8095_CHIPPY_IRON_ORE_TRUCK                                  :Ippychay Ironway Oreway Ucktray
+STR_8096_BALOGH_STEEL_TRUCK                                     :Aloghbay Eelstay Ucktray
+STR_8097_UHL_STEEL_TRUCK                                        :Uhlway Eelstay Ucktray
+STR_8098_KELLING_STEEL_TRUCK                                    :Ellingkay Eelstay Ucktray
+STR_8099_BALOGH_ARMORED_TRUCK                                   :Aloghbay Armouredway Ucktray
+STR_809A_UHL_ARMORED_TRUCK                                      :Uhlway Armouredway Ucktray
+STR_809B_FOSTER_ARMORED_TRUCK                                   :Osterfay Armouredway Ucktray
+STR_809C_FOSTER_FOOD_VAN                                        :Osterfay Oodfay Anvay
+STR_809D_PERRY_FOOD_VAN                                         :Errypay Oodfay Anvay
+STR_809E_CHIPPY_FOOD_VAN                                        :Ippychay Oodfay Anvay
+STR_809F_UHL_PAPER_TRUCK                                        :Uhlway Aperpay Ucktray
+STR_80A0_BALOGH_PAPER_TRUCK                                     :Aloghbay Aperpay Ucktray
+STR_80A1_MPS_PAPER_TRUCK                                        :MPSay Aperpay Ucktray
+STR_80A2_MPS_COPPER_ORE_TRUCK                                   :MPSay Oppercay Oreway Ucktray
+STR_80A3_UHL_COPPER_ORE_TRUCK                                   :Uhlway Oppercay Oreway Ucktray
+STR_80A4_GOSS_COPPER_ORE_TRUCK                                  :Ossgay Oppercay Oreway Ucktray
+STR_80A5_UHL_WATER_TANKER                                       :Uhlway Aterway Ankertay
+STR_80A6_BALOGH_WATER_TANKER                                    :Aloghbay Aterway Ankertay
+STR_80A7_MPS_WATER_TANKER                                       :MPSay Aterway Ankertay
+STR_80A8_BALOGH_FRUIT_TRUCK                                     :Aloghbay Uitfray Ucktray
+STR_80A9_UHL_FRUIT_TRUCK                                        :Uhlway Uitfray Ucktray
+STR_80AA_KELLING_FRUIT_TRUCK                                    :Ellingkay Uitfray Ucktray
+STR_80AB_BALOGH_RUBBER_TRUCK                                    :Aloghbay Ubberray Ucktray
+STR_80AC_UHL_RUBBER_TRUCK                                       :Uhlway Ubberray Ucktray
+STR_80AD_RMT_RUBBER_TRUCK                                       :RMTay Ubberray Ucktray
+STR_80AE_MIGHTYMOVER_SUGAR_TRUCK                                :IghtyMovermay Ugarsay Ucktray
+STR_80AF_POWERNAUGHT_SUGAR_TRUCK                                :Owernaughtpay Ugarsay Ucktray
+STR_80B0_WIZZOWOW_SUGAR_TRUCK                                   :Izzowowway Ugarsay Ucktray
+STR_80B1_MIGHTYMOVER_COLA_TRUCK                                 :IghtyMovermay Olacay Ucktray
+STR_80B2_POWERNAUGHT_COLA_TRUCK                                 :Owernaughtpay Olacay Ucktray
+STR_80B3_WIZZOWOW_COLA_TRUCK                                    :Izzowowway Olacay Ucktray
+STR_80B4_MIGHTYMOVER_COTTON_CANDY                               :IghtyMovermay Andyflosscay Ucktray
+STR_80B5_POWERNAUGHT_COTTON_CANDY                               :Owernaughtpay Andyflosscay Ucktray
+STR_80B6_WIZZOWOW_COTTON_CANDY_TRUCK                            :Izzowowway Andyflosscay Ucktray
+STR_80B7_MIGHTYMOVER_TOFFEE_TRUCK                               :IghtyMovermay Offeetay Ucktray
+STR_80B8_POWERNAUGHT_TOFFEE_TRUCK                               :Owernaughtpay Offeetay Ucktray
+STR_80B9_WIZZOWOW_TOFFEE_TRUCK                                  :Izzowowway Offeetay Ucktray
+STR_80BA_MIGHTYMOVER_TOY_VAN                                    :IghtyMovermay Oytay Anvay
+STR_80BB_POWERNAUGHT_TOY_VAN                                    :Owernaughtpay Oytay Anvay
+STR_80BC_WIZZOWOW_TOY_VAN                                       :Izzowowway Oytay Anvay
+STR_80BD_MIGHTYMOVER_CANDY_TRUCK                                :IghtyMovermay Eetsway Ucktray
+STR_80BE_POWERNAUGHT_CANDY_TRUCK                                :Owernaughtpay Eetsway Ucktray
+STR_80BF_WIZZOWOW_CANDY_TRUCK                                   :Izzowowway Eetsway Ucktray
+STR_80C0_MIGHTYMOVER_BATTERY_TRUCK                              :IghtyMovermay Atterybay Ucktray
+STR_80C1_POWERNAUGHT_BATTERY_TRUCK                              :Owernaughtpay Atterybay Ucktray
+STR_80C2_WIZZOWOW_BATTERY_TRUCK                                 :Izzowowway Atterybay Ucktray
+STR_80C3_MIGHTYMOVER_FIZZY_DRINK                                :IghtyMovermay Izzyfay Inkdray Ucktray
+STR_80C4_POWERNAUGHT_FIZZY_DRINK                                :Owernaughtpay Izzyfay Inkdray Ucktray
+STR_80C5_WIZZOWOW_FIZZY_DRINK_TRUCK                             :Izzowowway Izzyfay Inkdray Ucktray
+STR_80C6_MIGHTYMOVER_PLASTIC_TRUCK                              :IghtyMovermay Asticplay Ucktray
+STR_80C7_POWERNAUGHT_PLASTIC_TRUCK                              :Owernaughtpay Asticplay Ucktray
+STR_80C8_WIZZOWOW_PLASTIC_TRUCK                                 :Izzowowway Asticplay Ucktray
+STR_80C9_MIGHTYMOVER_BUBBLE_TRUCK                               :IghtyMovermay Ubblebay Ucktray
+STR_80CA_POWERNAUGHT_BUBBLE_TRUCK                               :Owernaughtpay Ubblebay Ucktray
+STR_80CB_WIZZOWOW_BUBBLE_TRUCK                                  :Izzowowway Ubblebay Ucktray
+STR_80CC_MPS_OIL_TANKER                                         :MPSay Oilway Ankertay
+STR_80CD_CS_INC_OIL_TANKER                                      :CSay-Incway. Oilway Ankertay
+STR_80CE_MPS_PASSENGER_FERRY                                    :MPSay Assengerpay Erryfay
+STR_80CF_FFP_PASSENGER_FERRY                                    :FFPay Assengerpay Erryfay
+STR_80D0_BAKEWELL_300_HOVERCRAFT                                :Akewellbay 300 Overcrafthay
+STR_80D1_CHUGGER_CHUG_PASSENGER                                 :Uggerchay-Ugchay Assengerpay Erryfay
+STR_80D2_SHIVERSHAKE_PASSENGER_FERRY                            :Ivershakeshay Assengerpay Erryfay
+STR_80D3_YATE_CARGO_SHIP                                        :Ateyay Argocay ipshay
+STR_80D4_BAKEWELL_CARGO_SHIP                                    :Akewellbay Argocay ipshay
+STR_80D5_MIGHTYMOVER_CARGO_SHIP                                 :Ightymovermay Argocay ipshay
+STR_80D6_POWERNAUT_CARGO_SHIP                                   :Owernautpay Argocay ipshay
+STR_80D7_SAMPSON_U52                                            :Ampsonsay Uway52
+STR_80D8_COLEMAN_COUNT                                          :Olemancay Ountcay
+STR_80D9_FFP_DART                                               :FFPay Artday
+STR_80DA_YATE_HAUGAN                                            :Ateyay Auganhay
+STR_80DB_BAKEWELL_COTSWALD_LB_3                                 :Akewellbay Otswaldcay LBay-3
+STR_80DC_BAKEWELL_LUCKETT_LB_8                                  :Akewellbay Uckettlay LBay-8
+STR_80DD_BAKEWELL_LUCKETT_LB_9                                  :Akewellbay Uckettlay LBay-9
+STR_80DE_BAKEWELL_LUCKETT_LB80                                  :Akewellbay Uckettlay LBay80
+STR_80DF_BAKEWELL_LUCKETT_LB_10                                 :Akewellbay Uckettlay LBay-10
+STR_80E0_BAKEWELL_LUCKETT_LB_11                                 :Akewellbay Uckettlay LBay-11
+STR_80E1_YATE_AEROSPACE_YAC_1_11                                :Ateyay Aerospaceway YACay 1-11
+STR_80E2_DARWIN_100                                             :Arwinday 100
+STR_80E3_DARWIN_200                                             :Arwinday 200
+STR_80E4_DARWIN_300                                             :Arwinday 300
+STR_80E5_DARWIN_400                                             :Arwinday 400
+STR_80E6_DARWIN_500                                             :Arwinday 500
+STR_80E7_DARWIN_600                                             :Arwinday 600
+STR_80E8_GURU_GALAXY                                            :Urugay Alaxygay
+STR_80E9_AIRTAXI_A21                                            :Airtaxiway Away21
+STR_80EA_AIRTAXI_A31                                            :Airtaxiway Away31
+STR_80EB_AIRTAXI_A32                                            :Airtaxiway Away32
+STR_80EC_AIRTAXI_A33                                            :Airtaxiway Away33
+STR_80ED_YATE_AEROSPACE_YAE46                                   :Ateyay Aerospaceway EyAay46
+STR_80EE_DINGER_100                                             :Ingerday 100
+STR_80EF_AIRTAXI_A34_1000                                       :AirTaxiway Away34-1000
+STR_80F0_YATE_Z_SHUTTLE                                         :Ateyay Zay-Uttleshay
+STR_80F1_KELLING_K1                                             :Ellingkay Kay1
+STR_80F2_KELLING_K6                                             :Ellingkay Kay6
+STR_80F3_KELLING_K7                                             :Ellingkay Kay7
+STR_80F4_DARWIN_700                                             :Arwinday 700
+STR_80F5_FFP_HYPERDART_2                                        :FFPay Yperdarthay 2
+STR_80F6_DINGER_200                                             :Ingerday 200
+STR_80F7_DINGER_1000                                            :Ingerday 1000
+STR_80F8_PLODDYPHUT_100                                         :Oddyphutplay 100
+STR_80F9_PLODDYPHUT_500                                         :Oddyphutplay 500
+STR_80FA_FLASHBANG_X1                                           :Ashbangflay Xay1
+STR_80FB_JUGGERPLANE_M1                                         :Uggerplanejay May1
+STR_80FC_FLASHBANG_WIZZER                                       :Ashbangflay Izzerway
+STR_80FD_TRICARIO_HELICOPTER                                    :Icariotray Elicopterhay
+STR_80FE_GURU_X2_HELICOPTER                                     :Urugay Xay2 Elicopterhay
+STR_80FF_POWERNAUT_HELICOPTER                                   :Owernautpay Elicopterhay
+STR_8100_MESSAGE_FROM_VEHICLE_MANUFACTURE                       :{WHITE}Essagemay omfray ehiclevay anufacturermay
+STR_8101_WE_HAVE_JUST_DESIGNED_A                                :{GOLD}Eway avehay ustjay esignedday away ewnay {STRING} - ouldway ouyay ebay interestedway inway away ear'syay exclusiveway useway ofway isthay ehiclevay, osay eway ancay eesay owhay itway erformspay eforebay akingmay itway universallyway availableway?
+STR_8102_RAILROAD_LOCOMOTIVE                                    :ailwayray ocomotivelay
+STR_8103_ROAD_VEHICLE                                           :oadray ehiclevay
+STR_8104_AIRCRAFT                                               :aircraftway
+STR_8105_SHIP                                                   :ipshay
+STR_8106_MONORAIL_LOCOMOTIVE                                    :onorailmay ocomotivelay
+STR_8107_MAGLEV_LOCOMOTIVE                                      :aglevmay ocomotivelay
+
+##id 0x8800
+STR_8800_TRAIN_DEPOT                                            :{WHITE}{TOWN} Aintray Epotday
+STR_8801_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay aintray arrivesway atway {STATION}!
+STR_8802_DETAILS                                                :{WHITE}{VEHICLE} (Etailsday)
+STR_8803_TRAIN_IN_THE_WAY                                       :{WHITE}Aintray inway ethay ayway
+STR_8804                                                        :{SETX 10}{COMMA}: {STRING} {STRING}
+STR_8805                                                        :{RIGHTARROW}{SETX 10}{COMMA}: {STRING} {STRING}
+STR_8806_GO_TO                                                  :Ogay otay {STATION}
+STR_8807_GO_TO_TRANSFER                                         :Ogay otay {STATION} (Ansfertray andway aketay argocay)
+STR_8808_GO_TO_UNLOAD                                           :Ogay otay {STATION} (Unloadway)
+STR_8809_GO_TO_TRANSFER_UNLOAD                                  :Ogay otay {STATION} (Ansfertray andway eavelay emptyway)
+STR_880A_GO_TO_LOAD                                             :Ogay otay {STATION} (Oadlay)
+STR_880B_GO_TO_TRANSFER_LOAD                                    :Ogay otay {STATION} (Ansfertray andway aitway orfay ullfay oadlay)
+STR_880C_GO_NON_STOP_TO                                         :Ogay onnay-opstay otay {STATION}
+STR_880D_GO_TO_NON_STOP_TRANSFER                                :Ogay onnay-opstay otay {STATION} (Ansfertray andway aketay argocay)
+STR_880E_GO_NON_STOP_TO_UNLOAD                                  :Ogay onnay-opstay otay {STATION} (Unloadway)
+STR_880F_GO_TO_NON_STOP_TRANSFER_UNLOAD                         :Ogay onnay-opstay otay {STATION} (Ansfertray andway eavelay emptyway)
+STR_8810_GO_NON_STOP_TO_LOAD                                    :Ogay onnay-opstay otay {STATION} (Oadlay)
+STR_8811_GO_TO_NON_STOP_TRANSFER_LOAD                           :Ogay onnay-opstay otay {STATION} (Ansfertray andway aitway orfay ullfay oadlay)
+STR_GO_TO_TRAIN_DEPOT                                           :Ogay otay {TOWN} Aintray Epotday
+STR_SERVICE_AT_TRAIN_DEPOT                                      :Ervicesay atway {TOWN} Aintray Epotday
+STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT                             :Ogay onnay-opstay otay {TOWN} Aintray Epotday
+STR_SERVICE_NON_STOP_AT_TRAIN_DEPOT                             :Ervicesay onnay-opstay atway {TOWN} Aintray Epotday
+
+STR_TIMETABLE_GO_TO                                             :{STRING} {STRING}
+STR_TIMETABLE_TRAVEL_NOT_TIMETABLED                             :Aveltray (otnay imetabledtay)
+STR_TIMETABLE_TRAVEL_FOR                                        :Aveltray orfay {STRING}
+STR_TIMETABLE_STAY_FOR                                          :andway aystay orfay {STRING}
+STR_TIMETABLE_DAYS                                              :{COMMA} ay{P "" s}day
+STR_TIMETABLE_TICKS                                             :{COMMA} ick{P "" s}tay
+
+STR_HEADING_FOR_TRAIN_DEPOT                                     :{ORANGE}Eadinghay orfay {TOWN} Aintray Epotday
+STR_HEADING_FOR_TRAIN_DEPOT_VEL                                 :{ORANGE}Eadinghay orfay {TOWN} Aintray Epotday, {VELOCITY}
+STR_HEADING_FOR_TRAIN_DEPOT_SERVICE                             :{LTBLUE}Ervicesay atway {TOWN} Aintray Epotday
+STR_HEADING_FOR_TRAIN_DEPOT_SERVICE_VEL                         :{LTBLUE}Ervicesay atway {TOWN} Aintray Epotday, {VELOCITY}
+
+STR_INVALID_ORDER                                               :{RED} (Invalidway Orderway)
+
+STR_UNKNOWN_DESTINATION                                         :unknownway estinationday
+STR_8812_EMPTY                                                  :{LTBLUE}Emptyway
+STR_8813_FROM                                                   :{LTBLUE}{CARGO} omfray {STATION}
+STR_FROM_MULT                                                   :{LTBLUE}{CARGO} omfray {STATION} (xay{NUM})
+STR_8814_TRAIN_IS_WAITING_IN_DEPOT                              :{WHITE}Aintray {COMMA} isway aitingway inway epotday
+STR_8815_NEW_VEHICLES                                           :{BLACK}Ewnay Ehiclesvay
+STR_8816                                                        :{BLACK}-
+STR_8819_TRAIN_TOO_LONG                                         :{WHITE}Aintray ootay onglay
+STR_881A_TRAINS_CAN_ONLY_BE_ALTERED                             :{WHITE}Ainstray ancay onlyway ebay alteredway enwhay oppedstay insideway away epotday
+STR_881B_TRAINS                                                 :{WHITE}{COMPANY} - {COMMA} Ain{P "" s}tray
+
+STR_881C_NEW_RAIL_VEHICLES                                      :{WHITE}Ewnay Ailray Ehiclesvay
+STR_NEW_ELRAIL_VEHICLES                                         :{WHITE}Ewnay Electricway Ailray Ehiclesvay
+STR_881D_NEW_MONORAIL_VEHICLES                                  :{WHITE}Ewnay Onorailmay Ehiclesvay
+STR_881E_NEW_MAGLEV_VEHICLES                                    :{WHITE}Ewnay Aglevmay Ehiclesvay
+STR_ALL_AVAIL_RAIL_VEHICLES                                     :{WHITE}Ailray Ehiclesvay
+
+STR_881F_BUILD_VEHICLE                                          :{BLACK}Uildbay Ehiclevay
+STR_CLONE_ROAD_VEHICLE                                          :{BLACK}Oneclay Ehiclevay
+STR_CLONE_ROAD_VEHICLE_INFO                                     :{BLACK}Isthay illway uildbay away opycay ofway ethay oadray ehiclevay. Ontrolcay-ickclay illway areshay ethay ordersway
+STR_CLONE_ROAD_VEHICLE_DEPOT_INFO                               :{BLACK}Isthay illway uildbay away opycay ofway away oadray ehiclevay. Ickclay isthay uttonbay andway enthay onway away oadray ehiclevay insideway orway outsideway ethay epotday. Ontrolcay-ickclay illway areshay ethay ordersway
+STR_CLONE_TRAIN                                                 :{BLACK}Oneclay Aintray
+STR_CLONE_TRAIN_INFO                                            :{BLACK}Isthay illway uildbay away opycay ofway ethay aintray includingway allway arscay. Ontrolcay-ickclay illway areshay ethay ordersway
+STR_CLONE_TRAIN_DEPOT_INFO                                      :{BLACK}Isthay illway uildbay away opycay ofway away aintray includingway allway arscay. Ickclay isthay uttonbay andway enthay onway away aintray insideway orway outsideway ethay epotday. Ontrolcay-ickclay illway areshay ethay ordersway
+STR_8820_RENAME                                                 :{BLACK}Enameray
+STR_8823_SKIP                                                   :{BLACK}Ipskay
+STR_8824_DELETE                                                 :{BLACK}Eleteday
+STR_8825_NON_STOP                                               :{BLACK}Onnay-Opstay
+STR_8826_GO_TO                                                  :{BLACK}Ogay Otay
+STR_8827_FULL_LOAD                                              :{BLACK}Ullfay Oadlay
+STR_8828_UNLOAD                                                 :{BLACK}Unloadway
+STR_REFIT                                                       :{BLACK}Efitray
+STR_REFIT_TIP                                                   :{BLACK}Electsay atwhay argocay ypetay otay efitray otay inway isthay orderway. Ontrolcay ickclay otay emoveray efitray instructionway
+STR_REFIT_ORDER                                                 :(Efitray otay {STRING})
+STR_TIMETABLE_VIEW                                              :{BLACK}Imetabletay
+STR_TIMETABLE_VIEW_TOOLTIP                                      :{BLACK}Itchsway otay ethay imetabletay iewvay
+STR_8829_ORDERS                                                 :{WHITE}{VEHICLE} (Ordersway)
+STR_882A_END_OF_ORDERS                                          :{SETX 10}- - Endway ofway Ordersway - -
+STR_FULLLOAD_OR_SERVICE                                         :{SKIP}{SKIP}{STRING}
+STR_SERVICE                                                     :{BLACK}Ervicesay
+STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE                           :{WHITE}An'tcay uildbay ailwayray ehiclevay...
+STR_882C_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Uiltbay: {LTBLUE}{NUM}{BLACK} Aluevay: {LTBLUE}{CURRENCY}
+STR_882D_VALUE                                                  :{LTBLUE}{ENGINE}{BLACK}   Aluevay: {LTBLUE}{CURRENCY}
+STR_882E                                                        :{WHITE}{VEHICLE}
+STR_882F_LOADING_UNLOADING                                      :{LTBLUE}Oadinglay / Unloadingway
+STR_TRAIN_MUST_BE_STOPPED                                       :{WHITE}Aintray ustmay ebay oppedstay insideway away epotday
+STR_8830_CAN_T_SEND_TRAIN_TO_DEPOT                              :{WHITE}An'tcay endsay aintray otay epotday...
+STR_8831_NO_MORE_SPACE_FOR_ORDERS                               :{WHITE}Onay oremay acespay orfay ordersway
+STR_8832_TOO_MANY_ORDERS                                        :{WHITE}Ootay anymay ordersway
+STR_8833_CAN_T_INSERT_NEW_ORDER                                 :{WHITE}An'tcay insertway ewnay orderway...
+STR_8834_CAN_T_DELETE_THIS_ORDER                                :{WHITE}An'tcay eleteday isthay orderway...
+STR_8835_CAN_T_MODIFY_THIS_ORDER                                :{WHITE}An'tcay odifymay isthay orderway...
+STR_CAN_T_MOVE_THIS_ORDER                                       :{WHITE}An'tcay ovemay isthay orderway...
+STR_CAN_T_SKIP_ORDER                                            :{WHITE}An'tcay ipskay urrentcay orderway...
+STR_CAN_T_SKIP_TO_ORDER                                         :{WHITE}An'tcay ipskay otay electedsay orderway...
+STR_8837_CAN_T_MOVE_VEHICLE                                     :{WHITE}An'tcay ovemay ehiclevay...
+STR_REAR_ENGINE_FOLLOW_FRONT_ERROR                              :{WHITE}Ethay earray engineway illway alwaysway ollowfay itsway ontfray ounterpartcay
+STR_8838_N_A                                                    :Nay/Away{SKIP}
+STR_8839_CAN_T_SELL_RAILROAD_VEHICLE                            :{WHITE}An'tcay ellsay ailwayray ehiclevay...
+STR_883A_UNABLE_TO_FIND_ROUTE_TO                                :{WHITE}Unableway otay indfay outeray otay ocallay epotday
+STR_883B_CAN_T_STOP_START_TRAIN                                 :{WHITE}An'tcay opstay/artstay aintray...
+STR_883C_SERVICING_INTERVAL_DAYS                                :{BLACK}Ervicingsay intervalway: {LTBLUE}{COMMA}aysday{BLACK}   Astlay ervicesay: {LTBLUE}{DATE_LONG}
+STR_SERVICING_INTERVAL_PERCENT                                  :{BLACK}Ervicingsay intervalway: {LTBLUE}{COMMA}%{BLACK}   Astlay ervicesay: {LTBLUE}{DATE_LONG}
+STR_883D_TRAINS_CLICK_ON_TRAIN_FOR                              :{BLACK}Ainstray - ickclay onway aintray orfay informationway
+STR_883E_BUILD_NEW_TRAINS_REQUIRES                              :{BLACK}Uildbay ewnay ainstray (equiresray aintray epotday)
+STR_883F_TRAINS_CLICK_ON_TRAIN_FOR                              :{BLACK}Ainstray - ickclay onway aintray orfay infoway., agdray ehiclevay otay addway/emoveray omfray aintray
+STR_8840_BUILD_NEW_TRAIN_VEHICLE                                :{BLACK}Uildbay ewnay aintray ehiclevay
+STR_8841_DRAG_TRAIN_VEHICLE_TO_HERE                             :{BLACK}Agdray aintray ehiclevay otay erehay otay ellsay itway
+STR_8842_CENTER_MAIN_VIEW_ON_TRAIN                              :{BLACK}Entrecay ainmay iewvay onway aintray epotday ocationlay
+STR_8843_TRAIN_VEHICLE_SELECTION                                :{BLACK}Aintray ehiclevay electionsay istlay - ickclay onway ehiclevay orfay informationway
+STR_8844_BUILD_THE_HIGHLIGHTED_TRAIN                            :{BLACK}Uildbay ethay ighlightedhay aintray ehiclevay
+STR_8845_RENAME_TRAIN_VEHICLE_TYPE                              :{BLACK}Enameray aintray ehiclevay ypetay
+STR_8846_CURRENT_TRAIN_ACTION_CLICK                             :{BLACK}Urrentcay aintray actionway - ickclay erehay otay opstay/artstay aintray
+STR_8847_SHOW_TRAIN_S_ORDERS                                    :{BLACK}Owshay ain'stray ordersway
+STR_8848_CENTER_MAIN_VIEW_ON_TRAIN                              :{BLACK}Entrecay ainmay iewvay onway ain'stray ocationlay
+STR_8849_SEND_TRAIN_TO_DEPOT                                    :{BLACK}Endsay aintray otay epotday. CTRLay+ickclay illway onlyway ervicesay
+STR_884A_FORCE_TRAIN_TO_PROCEED                                 :{BLACK}Orcefay aintray otay oceedpray ithoutway aitingway orfay ignalsay otay earclay itway
+STR_884B_REVERSE_DIRECTION_OF_TRAIN                             :{BLACK}Everseray irectionday ofway aintray
+STR_884C_SHOW_TRAIN_DETAILS                                     :{BLACK}Owshay aintray etailsday
+STR_884D_INCREASE_SERVICING_INTERVAL                            :{BLACK}Increaseway ervicingsay intervalway
+STR_884E_DECREASE_SERVICING_INTERVAL                            :{BLACK}Ecreaseday ervicingsay intervalway
+STR_884F_SHOW_DETAILS_OF_CARGO_CARRIED                          :{BLACK}Owshay etailsday ofway argocay arriedcay
+STR_8850_SHOW_DETAILS_OF_TRAIN_VEHICLES                         :{BLACK}Owshay etailsday ofway aintray ehiclesvay
+STR_8851_SHOW_CAPACITIES_OF_EACH                                :{BLACK}Owshay apacitiescay ofway eachway ehiclevay
+STR_8852_SHOW_TOTAL_CARGO                                       :{BLACK}Owshay otaltay apacitycay ofway aintray, itsplay ybay argocay ypetay
+STR_8852_ORDERS_LIST_CLICK_ON_ORDER                             :{BLACK}Ordersway istlay - ickclay onway anway orderway otay ighlighthay itway. CTRLay + ickclay ollsscray otay ethay ationstay
+STR_8853_SKIP_THE_CURRENT_ORDER                                 :{BLACK}Ipskay ethay urrentcay orderway, andway artstay ethay extnay. CTRLay + ickclay ipsskay otay ethay electedsay orderway
+STR_8854_DELETE_THE_HIGHLIGHTED                                 :{BLACK}Eleteday ethay ighlightedhay orderway
+STR_8855_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Akemay ethay ighlightedhay orderway onnay-opstay
+STR_8856_INSERT_A_NEW_ORDER_BEFORE                              :{BLACK}Insertway away ewnay orderway eforebay ethay ighlightedhay orderway, orway addway otay endway ofway istlay
+STR_8857_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Akemay ethay ighlightedhay orderway orcefay ethay ehiclevay otay aitway orfay away ullfay oadlay
+STR_8858_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Akemay ethay ighlightedhay orderway orcefay ethay ehiclevay otay unloadway
+STR_TIMETABLE_TOOLTIP                                           :{BLACK}Imetabletay - ickclay onway anway orderway otay ighlighthay itway.
+STR_TIMETABLE_WAIT_TIME_TOOLTIP                                 :{BLACK}Angechay ethay amountway ofway imetay atthay ethay ighlightedhay orderway ouldshay aketay
+STR_TIMETABLE_CLEAR_TIME_TOOLTIP                                :{BLACK}Earclay ethay amountway ofway imetay orfay ethay ighlightedhay orderway
+STR_TIMETABLE_RESET_LATENESS_TOOLTIP                            :{BLACK}Esetray ethay atenesslay ountercay, osay ethay ehiclevay illway ebay onway imetay
+STR_SERVICE_HINT                                                :{BLACK}Ipskay isthay orderway unlessway away ervicesay isway eedednay
+STR_VEHICLE_INFO_COST_WEIGHT_SPEED_POWER                        :{BLACK}Ostcay: {CURRENCY} Eightway: {WEIGHT_S}{}Eedspay: {VELOCITY}  Owerpay: {POWER}{}Unningray Ostcay: {CURRENCY}/yray{}Apacitycay: {CARGO}
+STR_885C_BROKEN_DOWN                                            :{RED}Okenbray ownday
+STR_885D_AGE_RUNNING_COST_YR                                    :{BLACK}Ageway: {LTBLUE}{STRING}{BLACK}   Unningray Ostcay: {LTBLUE}{CURRENCY}/yray
+STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED                         :{BLACK}Eightway: {LTBLUE}{WEIGHT_S}  {BLACK}Owerpay: {LTBLUE}{POWER}{BLACK} Axmay. eedspay: {LTBLUE}{VELOCITY}
+STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE                  :{BLACK}Eightway: {LTBLUE}{WEIGHT_S} {BLACK}Owerpay: {LTBLUE}{POWER}{BLACK} Axmay. eedspay: {LTBLUE}{VELOCITY} {BLACK}Axmay. Tay.Eway.: {LTBLUE}{FORCE}
+STR_885F_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Ofitpray isthay earyay: {LTBLUE}{CURRENCY}  (astlay earyay: {CURRENCY})
+STR_8860_RELIABILITY_BREAKDOWNS                                 :{BLACK}Eliabilityray: {LTBLUE}{COMMA}%  {BLACK}Eakdownsbray incesay astlay ervicesay: {LTBLUE}{COMMA}
+STR_8861_STOPPED                                                :{RED}Oppedstay
+STR_8862_CAN_T_MAKE_TRAIN_PASS_SIGNAL                           :{WHITE}An'tcay akemay aintray asspay ignalsay atway angerday...
+STR_8863_CRASHED                                                :{RED}Ashedcray!
+
+STR_8865_NAME_TRAIN                                             :{WHITE}Amenay aintray
+STR_8866_CAN_T_NAME_TRAIN                                       :{WHITE}An'tcay amenay aintray...
+STR_8867_NAME_TRAIN                                             :{BLACK}Amenay aintray
+STR_8868_TRAIN_CRASH_DIE_IN_FIREBALL                            :{BLACK}{BIGFONT}Aintray Ashcray!{}{COMMA} ieday inway ireballfay afterway ollisioncay
+STR_8869_CAN_T_REVERSE_DIRECTION                                :{WHITE}An'tcay everseray irectionday ofway aintray...
+STR_886A_RENAME_TRAIN_VEHICLE_TYPE                              :{WHITE}Enameray aintray ehiclevay ypetay
+STR_886B_CAN_T_RENAME_TRAIN_VEHICLE                             :{WHITE}An'tcay enameray aintray ehiclevay ypetay...
+STR_886D_MAKE_THE_HIGHLIGHTED_ORDER                             :{BLACK}Akemay ethay ighlightedhay orderway orcefay ethay ehiclevay otay umpday argocay
+STR_886F_TRANSFER                                               :{BLACK}Ansfertray
+STR_CLEAR_TIME                                                  :{BLACK}Angechay Imetay
+STR_RESET_LATENESS                                              :{BLACK}Esetray Atelay Ountercay
+
+STR_TRAIN_STOPPING                                              :{RED}Oppingstay
+STR_TRAIN_STOPPING_VEL                                          :{RED}Oppingstay, {VELOCITY}
+STR_INCOMPATIBLE_RAIL_TYPES                                     :Incompatibleway ailray ypestay
+STR_TRAIN_NO_POWER                                              :{RED}Onay owerpay
+STR_TRAIN_START_NO_CATENARY                                     :Isthay acktray ackslay atenarycay, osay ethay aintray an'tcay artstay
+
+STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}Ewnay {STRING} ownay availableway!
+STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{ENGINE}
+STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Ewnay {STRING} ownay availableway!  -  {ENGINE}
+
+STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}An'tcay ellsay estroyedday ehiclevay...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}An'tcay efitray estroyedday ehiclevay...
+
+STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Ancay otnay imetabletay ehiclevay...
+STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Ehiclesvay ancay onlyway aitway atway ationsstay.
+STR_TIMETABLE_NOT_STOPPING_HERE                                 :{WHITE}Isthay ehiclevay isway otnay oppingstay atway isthay ationstay.
+STR_TIMETABLE_CHANGE_TIME                                       :{BLACK}Angechay Imetay
+STR_TIMETABLE_STATUS_ON_TIME                                    :Isthay ehiclevay isway urrentlycay unningray onway imetay
+STR_TIMETABLE_STATUS_LATE                                       :Isthay ehiclevay isway urrentlycay unningray {STRING} atelay
+STR_TIMETABLE_STATUS_EARLY                                      :Isthay ehiclevay isway urrentlycay unningray {STRING} earlyway
+STR_TIMETABLE_TOTAL_TIME                                        :Isthay imetabletay illway aketay {STRING} otay ompletecay
+STR_TIMETABLE_TOTAL_TIME_INCOMPLETE                             :Isthay imetabletay illway aketay atway eastlay {STRING} otay ompletecay (otnay allway imetabledtay)
+STR_TIMETABLE_AUTOFILL                                          :{BLACK}Autofillway
+STR_TIMETABLE_AUTOFILL_TOOLTIP                                  :{BLACK}Fill thIllfay ethay imetabletay automaticallyway ithway ethay aluesvay omfray ethay irstfay ourneyjay
+
+##id 0x9000
+STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Oadray ehiclevay inway ethay ayway
+STR_9001_ROAD_VEHICLES                                          :{WHITE}{COMPANY} - {COMMA} Oadray Ehicle{P "" s}vay
+STR_9002                                                        :{WHITE}{VEHICLE}
+STR_9003_ROAD_VEHICLE_DEPOT                                     :{WHITE}{TOWN} Oadray Ehiclevay Epotday
+STR_9004_NEW_VEHICLES                                           :{BLACK}Ewnay Ehiclesvay
+STR_9006_NEW_ROAD_VEHICLES                                      :{WHITE}Ewnay Oadray Ehiclesvay
+STR_9007_BUILD_VEHICLE                                          :{BLACK}Uildbay Ehiclevay
+STR_9009_CAN_T_BUILD_ROAD_VEHICLE                               :{WHITE}An'tcay uildbay oadray ehiclevay...
+STR_900C_DETAILS                                                :{WHITE}{VEHICLE} (Etailsday)
+STR_900D_AGE_RUNNING_COST_YR                                    :{BLACK}Ageway: {LTBLUE}{STRING}{BLACK}   Unningray Ostcay: {LTBLUE}{CURRENCY}/yray
+STR_900E_MAX_SPEED                                              :{BLACK}Axmay. eedspay: {LTBLUE}{VELOCITY}
+STR_900F_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Ofitpray isthay earyay: {LTBLUE}{CURRENCY}  (astlay earyay: {CURRENCY})
+STR_9010_RELIABILITY_BREAKDOWNS                                 :{BLACK}Eliabilityray: {LTBLUE}{COMMA}%  {BLACK}Eakdownsbray incesay astlay ervicesay: {LTBLUE}{COMMA}
+STR_9011_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Uiltbay: {LTBLUE}{NUM}{BLACK} Aluevay: {LTBLUE}{CURRENCY}
+STR_9012_CAPACITY                                               :{BLACK}Apacitycay: {LTBLUE}{CARGO}
+STR_9013_MUST_BE_STOPPED_INSIDE                                 :{WHITE}...ustmay ebay oppedstay insideway away oadray ehiclevay epotday
+STR_9014_CAN_T_SELL_ROAD_VEHICLE                                :{WHITE}An'tcay ellsay oadray ehiclevay...
+STR_9015_CAN_T_STOP_START_ROAD_VEHICLE                          :{WHITE}An'tcay opstay/artstay oadray ehiclevay...
+STR_9016_ROAD_VEHICLE_IS_WAITING                                :{WHITE}Oadray ehiclevay {COMMA} isway aitingway inway epotday
+STR_HEADING_FOR_ROAD_DEPOT                                      :{ORANGE}Eadinghay orfay {TOWN} Oadray Epotday
+STR_HEADING_FOR_ROAD_DEPOT_VEL                                  :{ORANGE}Eadinghay orfay {TOWN} Oadray Epotday, {VELOCITY}
+STR_HEADING_FOR_ROAD_DEPOT_SERVICE                              :{LTBLUE}Ervicesay atway {TOWN} Oadray Epotday
+STR_HEADING_FOR_ROAD_DEPOT_SERVICE_VEL                          :{LTBLUE}Ervicesay atway {TOWN} Oadray Epotday, {VELOCITY}
+STR_9018_CAN_T_SEND_VEHICLE_TO_DEPOT                            :{WHITE}An'tcay endsay ehiclevay otay epotday...
+STR_9019_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Unableway otay indfay ocallay epotday
+STR_901A_ROAD_VEHICLES_CLICK_ON                                 :{BLACK}Oadray ehiclesvay - ickclay onway ehiclevay orfay informationway
+STR_901B_BUILD_NEW_ROAD_VEHICLES                                :{BLACK}Uildbay ewnay oadray ehiclesvay (equiresray oadray ehiclevay epotday)
+STR_901C_CURRENT_VEHICLE_ACTION                                 :{BLACK}Urrentcay ehiclevay actionway - ickclay erehay otay opstay/artstay ehiclevay
+STR_901D_SHOW_VEHICLE_S_ORDERS                                  :{BLACK}Owshay ehicle'svay ordersway
+STR_901E_CENTER_MAIN_VIEW_ON_VEHICLE                            :{BLACK}Entrecay ainmay iewvay onway ehicle'svay ocationlay
+STR_901F_SEND_VEHICLE_TO_DEPOT                                  :{BLACK}Endsay ehiclevay otay epotday. CTRLay+ickclay illway onlyway ervicesay
+STR_9020_FORCE_VEHICLE_TO_TURN_AROUND                           :{BLACK}Orcefay ehiclevay otay urntay aroundway
+STR_9021_SHOW_ROAD_VEHICLE_DETAILS                              :{BLACK}Owshay oadray ehiclevay etailsday
+STR_9022_VEHICLES_CLICK_ON_VEHICLE                              :{BLACK}Ehiclesvay - ickclay onway ehiclevay orfay informationway
+STR_9023_BUILD_NEW_ROAD_VEHICLE                                 :{BLACK}Uildbay ewnay oadray ehiclevay
+STR_9024_DRAG_ROAD_VEHICLE_TO_HERE                              :{BLACK}Agdray oadray ehiclevay otay erehay otay ellsay itway
+STR_9025_CENTER_MAIN_VIEW_ON_ROAD                               :{BLACK}Entrecay ainmay iewvay onway oadray ehiclevay epotday ocationlay
+STR_9026_ROAD_VEHICLE_SELECTION                                 :{BLACK}Oadray ehiclevay electionsay istlay - ickclay onway ehiclevay orfay informationway
+STR_9027_BUILD_THE_HIGHLIGHTED_ROAD                             :{BLACK}Uildbay ethay ighlightedhay oadray ehiclevay
+STR_902A_COST_SPEED_RUNNING_COST                                :{BLACK}Ostcay: {CURRENCY}{}Eedspay: {VELOCITY}{}Unningray Ostcay: {CURRENCY}/yray{}Apacitycay: {CARGO}
+STR_ARTICULATED_RV_CAPACITY                                     :{BLACK}Apacitycay: {LTBLUE}
+STR_BARE_CARGO                                                  :{CARGO}
+
+STR_902C_NAME_ROAD_VEHICLE                                      :{WHITE}Amenay oadray ehiclevay
+STR_902D_CAN_T_NAME_ROAD_VEHICLE                                :{WHITE}An'tcay amenay oadray ehiclevay...
+STR_902E_NAME_ROAD_VEHICLE                                      :{BLACK}Amenay oadray ehiclevay
+STR_902F_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay usbay arrivesway atway {STATION}!
+STR_9030_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay ucktray arrivesway atway {STATION}!
+STR_902F_CITIZENS_CELEBRATE_FIRST_TRAM                          :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay assengerpay amtray arrivesway atway {STATION}!
+STR_9030_CITIZENS_CELEBRATE_FIRST_TRAM                          :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay eightfray amtray arrivesway atway {STATION}!
+STR_9031_ROAD_VEHICLE_CRASH_DRIVER                              :{BLACK}{BIGFONT}Oadray Ehiclevay Ashcray!{}Iverdray iesday inway ireballfay afterway ollisioncay ithway aintray
+STR_9032_ROAD_VEHICLE_CRASH_DIE                                 :{BLACK}{BIGFONT}Oadray Ehiclevay Ashcray!{}{COMMA} ieday inway ireballfay afterway ollisioncay ithway aintray
+STR_9033_CAN_T_MAKE_VEHICLE_TURN                                :{WHITE}An'tcay akemay ehiclevay urntay aroundway...
+STR_ONLY_TURN_SINGLE_UNIT                                       :{WHITE}An'tcay urntay ehiclesvay onsistingcay ofway ultiplemay unitsway
+STR_9034_RENAME                                                 :{BLACK}Enameray
+STR_9035_RENAME_ROAD_VEHICLE_TYPE                               :{BLACK}Enameray oadray ehiclevay ypetay
+STR_9036_RENAME_ROAD_VEHICLE_TYPE                               :{WHITE}Enameray oadray ehiclevay ypetay
+STR_9037_CAN_T_RENAME_ROAD_VEHICLE                              :{WHITE}An'tcay enameray oadray ehiclevay ypetay...
+STR_9038_GO_TO_ROADVEH_DEPOT                                    :Ogay otay {TOWN} Oadray Ehiclevay Epotday
+STR_SERVICE_AT_ROADVEH_DEPOT                                    :Ervicesay atway {TOWN} Oadray Ehiclevay Epotday
+
+STR_REFIT_ROAD_VEHICLE_TO_CARRY                                 :{BLACK}Efitray oadray ehiclevay otay arrycay away ifferentday argocay ypetay
+STR_REFIT_ROAD_VEHICLE                                          :{BLACK}Efitray oadray ehiclevay
+STR_REFIT_ROAD_VEHICLE_TO_CARRY_HIGHLIGHTED                     :{BLACK}Efitray oadray ehiclevay otay arrycay ighlightedhay argocay ypetay
+STR_REFIT_ROAD_VEHICLE_CAN_T                                    :{WHITE}An'tcay efitray oadray ehiclevay...
+STR_ROAD_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Electsay ypetay ofway argocay orfay oadray ehiclevay otay arrycay
+
+##id 0x9800
+STR_9800_DOCK_CONSTRUCTION                                      :Ockday onstructioncay
+STR_9801_DOCK_CONSTRUCTION                                      :{WHITE}Ockday onstructioncay
+STR_9802_CAN_T_BUILD_DOCK_HERE                                  :{WHITE}An'tcay uildbay ockday erehay...
+STR_9803_SHIP_DEPOT                                             :{WHITE}{TOWN} Ipshay Epotday
+STR_9804_NEW_SHIPS                                              :{BLACK}Ewnay Ipsshay
+STR_9805_SHIPS                                                  :{WHITE}{COMPANY} - {COMMA} Ip{P "" s}shay
+STR_9808_NEW_SHIPS                                              :{WHITE}Ewnay Ipsshay
+STR_9809_BUILD_SHIP                                             :{BLACK}Uildbay Ipshay
+STR_CLONE_SHIP                                                  :{BLACK}Oneclay Ipshay
+STR_CLONE_SHIP_INFO                                             :{BLACK}Isthay illway uildbay away opycay ofway ethay ipshay. Ontrolcay-ickclay illway areshay ethay ordersway
+STR_CLONE_SHIP_DEPOT_INFO                                       :{BLACK}Isthay illway uildbay away opycay ofway away ipshay. Ickclay isthay uttonbay andway enthay onway away ipshay insideway orway outsideway ethay epotday. Ontrolcay-ickclay illway areshay ethay ordersway
+STR_980B_SHIP_MUST_BE_STOPPED_IN                                :{WHITE}Ipshay ustmay ebay oppedstay inway epotday
+STR_980C_CAN_T_SELL_SHIP                                        :{WHITE}An'tcay ellsay ipshay...
+STR_980D_CAN_T_BUILD_SHIP                                       :{WHITE}An'tcay uildbay ipshay...
+STR_980E_SHIP_IN_THE_WAY                                        :{WHITE}Ipshay inway ethay ayway
+STR_980F                                                        :{WHITE}{VEHICLE}
+STR_9811_DETAILS                                                :{WHITE}{VEHICLE} (Etailsday)
+STR_9812_AGE_RUNNING_COST_YR                                    :{BLACK}Ageway: {LTBLUE}{STRING}{BLACK}   Unningray Ostcay: {LTBLUE}{CURRENCY}/yray
+STR_9813_MAX_SPEED                                              :{BLACK}Axmay. eedspay: {LTBLUE}{VELOCITY}
+STR_9814_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Ofitpray isthay earyay: {LTBLUE}{CURRENCY}  (astlay earyay: {CURRENCY})
+STR_9815_RELIABILITY_BREAKDOWNS                                 :{BLACK}Eliabilityray: {LTBLUE}{COMMA}%  {BLACK}Eakdownsbray incesay astlay ervicesay: {LTBLUE}{COMMA}
+STR_9816_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Uiltbay: {LTBLUE}{NUM}{BLACK} Aluevay: {LTBLUE}{CURRENCY}
+STR_9817_CAPACITY                                               :{BLACK}Apacitycay: {LTBLUE}{CARGO}
+STR_9818_CAN_T_STOP_START_SHIP                                  :{WHITE}An'tcay opstay/artstay ipshay...
+STR_9819_CAN_T_SEND_SHIP_TO_DEPOT                               :{WHITE}An'tcay endsay ipshay otay epotday...
+STR_981A_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Unableway otay indfay ocallay epotday
+STR_HEADING_FOR_SHIP_DEPOT                                      :{ORANGE}Eadinghay orfay {TOWN} Ipshay Epotday
+STR_HEADING_FOR_SHIP_DEPOT_VEL                                  :{ORANGE}Eadinghay orfay {TOWN} Ipshay Epotday, {VELOCITY}
+STR_HEADING_FOR_SHIP_DEPOT_SERVICE                              :{LTBLUE}Ervicesay atway {TOWN} Ipshay Epotday
+STR_HEADING_FOR_SHIP_DEPOT_SERVICE_VEL                          :{LTBLUE}Ervicesay atway {TOWN} Ipshay Epotday, {VELOCITY}
+STR_981C_SHIP_IS_WAITING_IN_DEPOT                               :{WHITE}Ipshay {COMMA} isway aitingway inway epotday
+STR_981D_BUILD_SHIP_DOCK                                        :{BLACK}Uildbay ipshay ockday
+STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING                          :{BLACK}Uildbay ipshay epotday (orfay uildingbay andway ervicingsay ipsshay)
+STR_981F_SHIPS_CLICK_ON_SHIP_FOR                                :{BLACK}Ipsshay - ickclay onway ipshay orfay informationway
+STR_9820_BUILD_NEW_SHIP                                         :{BLACK}Uildbay ewnay ipshay
+STR_9821_DRAG_SHIP_TO_HERE_TO_SELL                              :{BLACK}Agdray ipshay otay erehay otay ellsay itway
+STR_9822_CENTER_MAIN_VIEW_ON_SHIP                               :{BLACK}Entrecay ainmay iewvay onway ipshay epotday ocationlay
+STR_9823_SHIPS_CLICK_ON_SHIP_FOR                                :{BLACK}Ipsshay - ickclay onway ipshay orfay informationway
+STR_9824_BUILD_NEW_SHIPS_REQUIRES                               :{BLACK}Uildbay ewnay ipsshay (equiresray ipshay epotday)
+STR_9825_SHIP_SELECTION_LIST_CLICK                              :{BLACK}Ipshay electionsay istlay - ickclay onway ipshay orfay informationway
+STR_9826_BUILD_THE_HIGHLIGHTED_SHIP                             :{BLACK}Uildbay ethay ighlightedhay ipshay
+STR_9827_CURRENT_SHIP_ACTION_CLICK                              :{BLACK}Urrentcay ipshay actionway - ickclay erehay otay opstay/artstay ipshay
+STR_9828_SHOW_SHIP_S_ORDERS                                     :{BLACK}Owshay ip'sshay ordersway
+STR_9829_CENTER_MAIN_VIEW_ON_SHIP                               :{BLACK}Entrecay ainmay iewvay onway ip'sshay ocationlay
+STR_982A_SEND_SHIP_TO_DEPOT                                     :{BLACK}Endsay ipshay otay epotday. CTRLay+ickclay illway onlyway ervicesay
+STR_982B_SHOW_SHIP_DETAILS                                      :{BLACK}Owshay ipshay etailsday
+STR_982E_COST_MAX_SPEED_CAPACITY                                :{BLACK}Ostcay: {CURRENCY} Axmay. Eedspay: {VELOCITY}{}Apacitycay: {CARGO}{}Unningray Ostcay: {CURRENCY}/yray
+STR_982F_NAME_SHIP                                              :{BLACK}Amenay ipshay
+
+STR_9831_NAME_SHIP                                              :{WHITE}Amenay ipshay
+STR_9832_CAN_T_NAME_SHIP                                        :{WHITE}An'tcay amenay ipshay...
+STR_9833_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay ipshay arrivesway atway {STATION}!
+STR_9834_POSITION_BUOY_WHICH_CAN                                :{BLACK}Aceplay away uoybay ichwhay ancay ebay usedway asway away aypointway
+STR_9835_CAN_T_POSITION_BUOY_HERE                               :{WHITE}An'tcay aceplay uoybay erehay...
+STR_9836_RENAME                                                 :{BLACK}Enameray
+STR_9837_RENAME_SHIP_TYPE                                       :{BLACK}Enameray ipshay ypetay
+STR_9838_RENAME_SHIP_TYPE                                       :{WHITE}Enameray ipshay ypetay
+STR_9839_CAN_T_RENAME_SHIP_TYPE                                 :{WHITE}An'tcay enameray ipshay ypetay...
+STR_983A_REFIT_CARGO_SHIP_TO_CARRY                              :{BLACK}Efitray argocay ipshay otay arrycay away ifferentday argocay ypetay
+STR_983B_REFIT                                                  :{WHITE}{VEHICLE} (Efitray)
+STR_983C_REFIT_SHIP                                             :{BLACK}Efitray ipshay
+STR_983D_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Electsay ypetay ofway argocay orfay ipshay otay arrycay
+STR_983E_REFIT_SHIP_TO_CARRY_HIGHLIGHTED                        :{BLACK}Efitray ipshay otay arrycay ighlightedhay argocay ypetay
+STR_983F_SELECT_CARGO_TYPE_TO_CARRY                             :{GOLD}Electsay argocay ypetay otay arrycay:
+STR_9840_NEW_CAPACITY_COST_OF_REFIT                             :{BLACK}Ewnay apacitycay: {GOLD}{CARGO}{}{BLACK}Ostcay ofway efitray: {GOLD}{CURRENCY}
+STR_9841_CAN_T_REFIT_SHIP                                       :{WHITE}An'tcay efitray ipshay...
+STR_9842_REFITTABLE                                             :(efittableray)
+STR_GO_TO_SHIP_DEPOT                                            :Ogay otay {TOWN} Ipshay Epotday
+SERVICE_AT_SHIP_DEPOT                                           :Ervicesay atway {TOWN} Ipshay Epotday
+
+##id 0xA000
+STR_A000_AIRPORTS                                               :{WHITE}Airportsway
+STR_A001_CAN_T_BUILD_AIRPORT_HERE                               :{WHITE}An'tcay uildbay airportway erehay...
+STR_A002_AIRCRAFT_HANGAR                                        :{WHITE}{STATION} Aircraftway Angarhay
+STR_A003_NEW_AIRCRAFT                                           :{BLACK}Ewnay Aircraftway
+STR_CLONE_AIRCRAFT                                              :{BLACK}Oneclay Aircraftway
+STR_CLONE_AIRCRAFT_INFO                                         :{BLACK}Isthay illway uildbay away opycay ofway ethay aircraftway. Ontrolcay-ickclay illway areshay ethay ordersway
+STR_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW                           :{BLACK}Isthay illway uildbay away opycay ofway anway aircraftway. Ickclay isthay uttonbay andway enthay onway anway aircraftway insideway orway outsideway ethay angarhay. Ontrolcay-ickclay illway areshay ethay ordersway
+STR_A005_NEW_AIRCRAFT                                           :{WHITE}Ewnay Aircraftway
+STR_A006_BUILD_AIRCRAFT                                         :{BLACK}Uildbay Aircraftway
+STR_A008_CAN_T_BUILD_AIRCRAFT                                   :{WHITE}An'tcay uildbay aircraftway...
+STR_A009_AIRCRAFT                                               :{WHITE}{COMPANY} - {COMMA} Aircraftway
+STR_A00A                                                        :{WHITE}{VEHICLE}
+STR_A00B_ORDERS                                                 :{WHITE}{VEHICLE} (Ordersway)
+STR_A00C_DETAILS                                                :{WHITE}{VEHICLE} (Etailsday)
+STR_A00D_AGE_RUNNING_COST_YR                                    :{BLACK}Ageway: {LTBLUE}{STRING}{BLACK}   Unningray Ostcay: {LTBLUE}{CURRENCY}/yray
+STR_A00E_MAX_SPEED                                              :{BLACK}Axmay. eedspay: {LTBLUE}{VELOCITY}
+STR_A00F_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Ofitpray isthay earyay: {LTBLUE}{CURRENCY}  (astlay earyay: {CURRENCY})
+STR_A010_RELIABILITY_BREAKDOWNS                                 :{BLACK}Eliabilityray: {LTBLUE}{COMMA}%  {BLACK}Eakdownsbray incesay astlay ervicesay: {LTBLUE}{COMMA}
+STR_A011_BUILT_VALUE                                            :{LTBLUE}{ENGINE}{BLACK}   Uiltbay: {LTBLUE}{NUM}{BLACK} Aluevay: {LTBLUE}{CURRENCY}
+STR_A012_CAN_T_SEND_AIRCRAFT_TO                                 :{WHITE}An'tcay endsay aircraftway otay angarhay...
+STR_HEADING_FOR_HANGAR                                          :{ORANGE}Eadinghay orfay {STATION} Angarhay
+STR_HEADING_FOR_HANGAR_VEL                                      :{ORANGE}Eadinghay orfay {STATION} Angarhay, {VELOCITY}
+STR_HEADING_FOR_HANGAR_SERVICE                                  :{LTBLUE}Ervicesay atway {STATION} Angarhay
+STR_HEADING_FOR_HANGAR_SERVICE_VEL                              :{LTBLUE}Ervicesay atway {STATION} Angarhay, {VELOCITY}
+STR_A014_AIRCRAFT_IS_WAITING_IN                                 :{WHITE}Aircraftway {COMMA} isway aitingway inway ethay aircraftway angarhay
+STR_A015_AIRCRAFT_IN_THE_WAY                                    :{WHITE}Aircraftway inway ethay ayway
+STR_A016_CAN_T_STOP_START_AIRCRAFT                              :{WHITE}An'tcay opstay/artstay aircraftway...
+STR_A017_AIRCRAFT_IS_IN_FLIGHT                                  :{WHITE}Aircraftway isway inway ightflay
+STR_A019_CAPACITY                                               :{BLACK}Apacitycay: {LTBLUE}{CARGO}, {CARGO}
+STR_A01A_CAPACITY                                               :{BLACK}Apacitycay: {LTBLUE}{CARGO}
+STR_A01B_AIRCRAFT_MUST_BE_STOPPED                               :{WHITE}Aircraftway ustmay ebay oppedstay inway angarhay
+STR_A01C_CAN_T_SELL_AIRCRAFT                                    :{WHITE}An'tcay ellsay aircraftway...
+STR_A01D_AIRPORT_CONSTRUCTION                                   :Airportway onstructioncay
+STR_A01E_BUILD_AIRPORT                                          :{BLACK}Uildbay airportway
+STR_A01F_AIRCRAFT_CLICK_ON_AIRCRAFT                             :{BLACK}Aircraftway - ickclay onway aircraftway orfay informationway
+STR_A020_BUILD_NEW_AIRCRAFT_REQUIRES                            :{BLACK}Uildbay ewnay aircraftway (equiresray airportway ithway angarhay)
+STR_A021_AIRCRAFT_CLICK_ON_AIRCRAFT                             :{BLACK}Aircraftway - ickclay onway aircraftway orfay informationway
+STR_A022_BUILD_NEW_AIRCRAFT                                     :{BLACK}Uildbay ewnay aircraftway
+STR_A023_DRAG_AIRCRAFT_TO_HERE_TO                               :{BLACK}Agdray aircraftway otay erehay otay ellsay itway
+STR_A024_CENTER_MAIN_VIEW_ON_HANGAR                             :{BLACK}Entrecay ainmay iewvay onway angarhay ocationlay
+STR_A025_AIRCRAFT_SELECTION_LIST                                :{BLACK}Aircraftway electionsay istlay - ickclay onway aircraftway orfay informationway
+STR_A026_BUILD_THE_HIGHLIGHTED_AIRCRAFT                         :{BLACK}Uildbay ethay ighlightedhay aircraftway
+STR_A027_CURRENT_AIRCRAFT_ACTION                                :{BLACK}Urrentcay aircraftway actionway - ickclay erehay otay opstay/artstay aircraftway
+STR_A028_SHOW_AIRCRAFT_S_ORDERS                                 :{BLACK}Owshay aircraft'sway ordersway
+STR_A029_CENTER_MAIN_VIEW_ON_AIRCRAFT                           :{BLACK}Entrecay ainmay iewvay onway aircraft'sway ocationlay
+STR_A02A_SEND_AIRCRAFT_TO_HANGAR                                :{BLACK}Endsay aircraftway otay angarhay. CTRLay+ickclay illway onlyway ervicesay
+STR_A02B_SHOW_AIRCRAFT_DETAILS                                  :{BLACK}Owshay aircraftway etailsday
+STR_A02E_COST_MAX_SPEED_CAPACITY                                :{BLACK}Ostcay: {CURRENCY} Axmay. Eedspay: {VELOCITY}{}Apacitycay: {COMMA} assengerspay, {COMMA} agsbay ofway ailmay{}Unningray Ostcay: {CURRENCY}/yray
+
+STR_A030_NAME_AIRCRAFT                                          :{WHITE}Amenay aircraftway
+STR_A031_CAN_T_NAME_AIRCRAFT                                    :{WHITE}An'tcay amenay aircraftway...
+STR_A032_NAME_AIRCRAFT                                          :{BLACK}Amenay aircraftway
+STR_A033_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Itizenscay elebratecay . . .{}Irstfay aircraftway arrivesway atway {STATION}!
+STR_A034_PLANE_CRASH_DIE_IN_FIREBALL                            :{BLACK}{BIGFONT}Aneplay Ashcray!{}{COMMA} ieday inway ireballfay atway {STATION}
+STR_PLANE_CRASH_OUT_OF_FUEL                                     :{BLACK}{BIGFONT}Aneplay Ashcray!{}Aircraftway anray outway ofway uelfay, {COMMA} ieday inway ireballfay!
+STR_A036                                                        :{TINYFONT}{BLACK}{STATION}
+STR_A037_RENAME                                                 :{BLACK}Enameray
+STR_A038_RENAME_AIRCRAFT_TYPE                                   :{BLACK}Enameray aircraftway ypetay
+STR_A039_RENAME_AIRCRAFT_TYPE                                   :{WHITE}Enameray aircraftway ypetay
+STR_A03A_CAN_T_RENAME_AIRCRAFT_TYPE                             :{WHITE}An'tcay enameray aircraftway ypetay...
+STR_A03B_REFIT_AIRCRAFT_TO_CARRY                                :{BLACK}Efitray aircraftway otay arrycay away ifferentday argocay ypetay
+STR_A03C_REFIT                                                  :{WHITE}{VEHICLE} (Efitray)
+STR_A03D_REFIT_AIRCRAFT                                         :{BLACK}Efitray aircraftway
+STR_A03E_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Electsay ypetay ofway argocay orfay aircraftway otay arrycay
+STR_A03F_REFIT_AIRCRAFT_TO_CARRY                                :{BLACK}Efitray aircraftway otay arrycay ighlightedhay argocay ypetay
+STR_A040_SELECT_CARGO_TYPE_TO_CARRY                             :{GOLD}Electsay argocay ypetay otay arrycay:
+STR_A041_NEW_CAPACITY_COST_OF_REFIT                             :{BLACK}Ewnay apacitycay: {GOLD}{STRING}{}{BLACK}Ostcay ofway efitray: {GOLD}{CURRENCY}
+STR_A042_CAN_T_REFIT_AIRCRAFT                                   :{WHITE}An'tcay efitray aircraftway...
+STR_GO_TO_AIRPORT_HANGAR                                        :Ogay otay {STATION} Angarhay
+SERVICE_AT_AIRPORT_HANGAR                                       :Ervicesay atway {STATION} Angarhay
+
+STR_TIMETABLE_TITLE                                             :{WHITE}{VEHICLE} (Imetabletay)
+
+##id 0xB000
+STR_B000_ZEPPELIN_DISASTER_AT                                   :{BLACK}{BIGFONT}Eppelinzay isasterday atway {STATION}!
+STR_B001_ROAD_VEHICLE_DESTROYED                                 :{BLACK}{BIGFONT}Oadray ehiclevay estroyedday inway 'UFO'WAY ollisioncay!
+STR_B002_OIL_REFINERY_EXPLOSION                                 :{BLACK}{BIGFONT}Oilway efineryray explosionway earnay {TOWN}!
+STR_B003_FACTORY_DESTROYED_IN_SUSPICIOUS                        :{BLACK}{BIGFONT}Actoryfay estroyedday inway uspicioussay ircumstancescay earnay {TOWN}!
+STR_B004_UFO_LANDS_NEAR                                         :{BLACK}{BIGFONT}'UFO'WAY andslay earnay {TOWN}!
+STR_B005_COAL_MINE_SUBSIDENCE_LEAVES                            :{BLACK}{BIGFONT}Oalcay inemay ubsidencesay eaveslay ailtray ofway estructionday earnay {TOWN}!
+STR_B006_FLOOD_VEHICLE_DESTROYED                                :{BLACK}{BIGFONT}Oodsflay!{}Atway eastlay {COMMA} issingmay, esumedpray eadday afterway ignificantsay oodingflay!
+
+STR_BRIBE_FAILED                                                :{WHITE}Ouryay attemptedway ibebray ashay eenbay
+STR_BRIBE_FAILED_2                                              :{WHITE}iscoveredday ybay away egionalray investigatorway
+STR_BUILD_DATE                                                  :{BLACK}Uiltbay: {LTBLUE}{DATE_LONG}
+
+STR_PERFORMANCE_DETAIL                                          :{WHITE}Etailedday erformancepay atingray
+STR_PERFORMANCE_DETAIL_KEY                                      :{BLACK}Etailday
+STR_PERFORMANCE_DETAIL_AMOUNT_CURRENCY                          :{BLACK}({CURRCOMPACT}/{CURRCOMPACT})
+STR_PERFORMANCE_DETAIL_AMOUNT_INT                               :{BLACK}({COMMA}/{COMMA})
+STR_PERFORMANCE_DETAIL_PERCENT                                  :{WHITE}{NUM}%
+SET_PERFORMANCE_DETAIL_INT                                      :{BLACK}{NUM}
+############ Those following lines need to be in this order!!
+STR_PERFORMANCE_DETAIL_VEHICLES                                 :{BLACK}Ehiclesvay:
+STR_PERFORMANCE_DETAIL_STATIONS                                 :{BLACK}Ationsstay:
+STR_PERFORMANCE_DETAIL_MIN_PROFIT                               :{BLACK}Inmay. ofitpray:
+STR_PERFORMANCE_DETAIL_MIN_INCOME                               :{BLACK}Inmay. incomeway:
+STR_PERFORMANCE_DETAIL_MAX_INCOME                               :{BLACK}Axmay. incomeway:
+STR_PERFORMANCE_DETAIL_DELIVERED                                :{BLACK}Eliveredday:
+STR_PERFORMANCE_DETAIL_CARGO                                    :{BLACK}Argocay:
+STR_PERFORMANCE_DETAIL_MONEY                                    :{BLACK}Oneymay:
+STR_PERFORMANCE_DETAIL_LOAN                                     :{BLACK}Oanlay:
+STR_PERFORMANCE_DETAIL_TOTAL                                    :{BLACK}Otaltay:
+############ End of order list
+STR_PERFORMANCE_DETAIL_VEHICLES_TIP                             :{BLACK}Umbernay ofway ehiclesvay; isthay includesway oadray ehiclesvay, ainstray, ipsshay andway aircraftway
+STR_PERFORMANCE_DETAIL_STATIONS_TIP                             :{BLACK}Umbernay ofway ationstay artspay. Everyway artpay ofway away ationstay (eway.gay. aintray ationstay, usbay opstay, airportway) isway ountedcay, evenway ifway eythay areway onnectedcay asway oneway ationstay
+STR_PERFORMANCE_DETAIL_MIN_PROFIT_TIP                           :{BLACK}Ethay ofitpray ofway ethay ehiclevay ithway ethay owestlay incomeway (ofway allway ehiclesvay olderway anthay 2 earsyay)
+STR_PERFORMANCE_DETAIL_MIN_INCOME_TIP                           :{BLACK}Amountway ofway ashcay ademay inway ethay onthmay ithway ethay owestlay ofitpray ofway ethay astlay 12 artersquay
+STR_PERFORMANCE_DETAIL_MAX_INCOME_TIP                           :{BLACK}Amountway ofway ashcay ademay inway ethay onthmay ithway ethay ighesthay ofitpray ofway ethay astlay 12 artersquay
+STR_PERFORMANCE_DETAIL_DELIVERED_TIP                            :{BLACK}Unitsway ofway argocay eliveredday inway ethay astlay ourfay artersquay
+STR_PERFORMANCE_DETAIL_CARGO_TIP                                :{BLACK}Umbernay ofway ypestay ofway argocay eliveredday inway ethay astlay arterquay
+STR_PERFORMANCE_DETAIL_MONEY_TIP                                :{BLACK}Amountway ofway oneymay isthay ompanycay ashay inway ethay ankbay
+STR_PERFORMANCE_DETAIL_LOAN_TIP                                 :{BLACK}Ethay amountway ofway oneymay isthay ompanycay ashay akentay onway oanlay
+STR_PERFORMANCE_DETAIL_TOTAL_TIP                                :{BLACK}Otaltay ointspay outway ofway ossiblepay ointspay
+
+STR_NEWGRF_SETTINGS_BUTTON                                      :{BLACK}EwGRFnay Ettingssay
+STR_NEWGRF_SETTINGS_CAPTION                                     :{WHITE}EwGRFnay ettingssay
+STR_NEWGRF_APPLY_CHANGES                                        :{BLACK}Applyway angeschay
+STR_NEWGRF_SET_PARAMETERS                                       :{BLACK}Etsay arameterspay
+STR_NEWGRF_TIP                                                  :{BLACK}Away istlay ofway allway ethay Ewgrfnay etssay atthay ouyay avehay installedway. Ickclay away etsay otay angechay ethay ettingssay
+STR_NEWGRF_NO_FILES_INSTALLED                                   :{BLACK}Erethay areway urrentlycay onay ewgrfnay ilesfay installedway! Easeplay eferray otay ethay anualmay orfay instructionsway onway installingway ewnay aphicsgray
+STR_NEWGRF_FILENAME                                             :{BLACK}Ilenamefay: {SILVER}{STRING}
+STR_NEWGRF_GRF_ID                                               :{BLACK}GRFay IDWAY: {SILVER}{STRING}
+STR_NEWGRF_MD5SUM                                               :{BLACK}MDay5umsay: {SILVER}{STRING}
+STR_NEWGRF_CONFIRMATION_TEXT                                    :{YELLOW}Ouyay areway aboutway otay akemay angeschay otay away unningray amegay; isthay ancay ashcray OpenTTDWAY.{}Areway ouyay absolutelyway uresay aboutway isthay?
+
+STR_NEWGRF_ERROR_MSG_INFO                                       :{SILVER}{STRING}
+STR_NEWGRF_ERROR_MSG_WARNING                                    :{RED}Arningway: {SILVER}{STRING}
+STR_NEWGRF_ERROR_MSG_ERROR                                      :{RED}Errorway: {SILVER}{STRING}
+STR_NEWGRF_ERROR_MSG_FATAL                                      :{RED}Atalfay: {SILVER}{STRING}
+STR_NEWGRF_ERROR_VERSION_NUMBER                                 :{STRING} illway otnay orkway ithway ethay AtchtTDPay ersionvay eportedray ybay OpenTTDWAY.
+STR_NEWGRF_ERROR_DOS_OR_WINDOWS                                 :{STRING} isway orfay ethay {STRING} ersionvay ofway TTDay.
+STR_NEWGRF_ERROR_UNSET_SWITCH                                   :{STRING} isway esignedday otay ebay usedway ithway {STRING}
+STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Invalidway arameterpay orfay {STRING}: arameterpay {STRING} ({NUM})
+STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} ustmay ebay oadedlay eforebay {STRING}.
+STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} ustmay ebay oadedlay afterway {STRING}.
+STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER                            :{STRING} equiresray OpenTTDWAY ersionvay {STRING} orway etterbay.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :ethay GRFay ilefay itway asway esignedday otay anslatetray
+STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED                        :Ootay anymay NewGRFs areway oadedlay.
+
+STR_NEWGRF_ADD                                                  :{BLACK}Addway
+STR_NEWGRF_ADD_TIP                                              :{BLACK}Addway away EwGRFnay ilefay otay ethay istlay
+STR_NEWGRF_REMOVE                                               :{BLACK}Emoveray
+STR_NEWGRF_REMOVE_TIP                                           :{BLACK}Emoveray ethay electedsay EwGRFnay ilefay omfray ethay istlay
+STR_NEWGRF_MOVEUP                                               :{BLACK}Ovemay Upway
+STR_NEWGRF_MOVEUP_TIP                                           :{BLACK}Ovemay ethay electedsay EwGRFnay ilefay upway ethay istlay
+STR_NEWGRF_MOVEDOWN                                             :{BLACK}Ovemay Ownday
+STR_NEWGRF_MOVEDOWN_TIP                                         :{BLACK}Ovemay ethay electedsay EwGRFnay ilefay ownday ethay istlay
+STR_NEWGRF_FILE_TIP                                             :{BLACK}Away istlay ofway ethay EwGRFnay ilesfay atthay areway installedway. Ickclay away ilefay otay angechay itsway arameterspay
+STR_NEWGRF_PARAMETER                                            :{BLACK}Arameterspay: {SILVER}{STRING}
+STR_NEWGRF_PARAMETER_QUERY                                      :{BLACK}Enterway EwGRFnay arameterspay
+STR_NEWGRF_NO_INFO                                              :{BLACK}Onay informationway availableway
+
+STR_NEWGRF_ADD_CAPTION                                          :{WHITE}Availableway EwGRFnay ilesfay
+STR_NEWGRF_ADD_FILE                                             :{BLACK}Addway otay electionsay
+STR_NEWGRF_ADD_FILE_TIP                                         :{BLACK}Addway ethay electedsay EwGRFnay ilefay otay ouryay onfigurationcay
+STR_NEWGRF_RESCAN_FILES                                         :{BLACK}Escanray ilesfay
+STR_NEWGRF_RESCAN_FILES_TIP                                     :{BLACK}Updateway ethay istlay ofway availableway EwGRFnay ilesfay
+STR_NEWGRF_DUPLICATE_GRFID                                      :{WHITE}Annotcay addway ilefay: uplicateday GRFay IDWAY
+
+STR_NEWGRF_NOT_FOUND                                            :{RED}Atchingmay ilefay otnay oundfay
+STR_NEWGRF_DISABLED                                             :{RED}Isabledday
+STR_NEWGRF_COMPATIBLE_LOADED                                    :{ORANGE}Atchingmay ilefay otnay oundfay (ompatiblecay GRFay oadedlay)
+
+STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Ompatiblecay GRFay(say) oadedlay orfay issingmay ilesfay
+STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Issingmay GRFay ilefay(say) avehay eenbay isabledday
+STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Issingmay GRFay ilefay(say) otay ebay ableway otay oadlay amegay
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Issingmay GRF filesay
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Unpausingway ancay ashcray OpenTTD. Oday otnay ilefay ugbay eportsray orfay ubsequentsay ashescray.{}Oday ouyay eallyray antway otay unpauseway?
+
+STR_CURRENCY_WINDOW                                             :{WHITE}Ustomcay urrencycay
+STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Exchangeway ateray: {ORANGE}{CURRENCY} = £ {COMMA}
+STR_CURRENCY_SEPARATOR                                          :{LTBLUE}Eparatorsay:
+STR_CURRENCY_PREFIX                                             :{LTBLUE}Efixpray:
+STR_CURRENCY_SUFFIX                                             :{LTBLUE}Uffixsay:
+STR_CURRENCY_SWITCH_TO_EURO                                     :{LTBLUE}Itchsway otay Euroway: {ORANGE}{NUM}
+STR_CURRENCY_SWITCH_TO_EURO_NEVER                               :{LTBLUE}Itchsway otay Euroway: {ORANGE}evernay
+STR_CURRENCY_PREVIEW                                            :{LTBLUE}Eviewpray: {ORANGE}{CURRENCY}
+STR_CURRENCY_CHANGE_PARAMETER                                   :{BLACK}Angechay ustomcay urrencycay arameterpay
+
+STR_TRAIN                                                       :{BLACK}{TRAIN}
+STR_BUS                                                         :{BLACK}{BUS}
+STR_LORRY                                                       :{BLACK}{LORRY}
+STR_PLANE                                                       :{BLACK}{PLANE}
+STR_SHIP                                                        :{BLACK}{SHIP}
+
+STR_SCHEDULED_TRAINS                                            :{WHITE}{STATION} - {COMMA} Ain{P "" s}tray
+STR_SCHEDULED_ROAD_VEHICLES                                     :{WHITE}{STATION} - {COMMA} Oadray Ehicle{P "" s}vay
+STR_SCHEDULED_AIRCRAFT                                          :{WHITE}{STATION} - {COMMA} Aircraftway
+STR_SCHEDULED_SHIPS                                             :{WHITE}{STATION} - {COMMA} Ip{P "" s}shay
+
+STR_SCHEDULED_TRAINS_TIP                                        :{BLACK}Owshay allway ainstray ichwhay avehay isthay ationstay onway eirthay eduleschay
+STR_SCHEDULED_ROAD_VEHICLES_TIP                                 :{BLACK}Owshay allway oadray ehiclesvay ichwhay avehay isthay ationstay onway eirthay eduleschay
+STR_SCHEDULED_AIRCRAFT_TIP                                      :{BLACK}Owshay allway aircraftway ichwhay avehay isthay ationstay onway eirthay eduleschay
+STR_SCHEDULED_SHIPS_TIP                                         :{BLACK}Owshay allway ipsshay ichwhay avehay isthay ationstay onway eirthay eduleschay
+
+STR_VEH_WITH_SHARED_ORDERS_LIST                                 :{WHITE}Aredshay ordersway ofway {COMMA} Ehicle{P "" s}vay
+STR_VEH_WITH_SHARED_ORDERS_LIST_TIP                             :{BLACK}Owshay allway ehiclesvay atthay areshay isthay eduleschay
+
+### depot strings
+STR_DEPOT_SELL_CONFIRMATION_TEXT                                :{YELLOW}Ouyay areway aboutway otay ellsay allway ethay ehiclesvay inway ethay epotday. Areway ouyay uresay?
+STR_DEPOT_WRONG_DEPOT_TYPE                                      :Ongwray epotday ypetay
+
+STR_DEPOT_SELL_ALL_BUTTON_TRAIN_TIP                             :{BLACK}Ellsay allway ainstray inway ethay epotday
+STR_DEPOT_SELL_ALL_BUTTON_ROADVEH_TIP                           :{BLACK}Ellsay allway oadray ehiclesvay inway ethay epotday
+STR_DEPOT_SELL_ALL_BUTTON_SHIP_TIP                              :{BLACK}Ellsay allway ipsshay inway ethay epotday
+STR_DEPOT_SELL_ALL_BUTTON_AIRCRAFT_TIP                          :{BLACK}Ellsay allway aircraftway inway ethay angarhay
+
+STR_DEPOT_VEHICLE_ORDER_LIST_TRAIN_TIP                          :{BLACK}Etgay away istlay ofway allway ainstray ithway ethay urrentcay epotday inway eirthay ordersway
+STR_DEPOT_VEHICLE_ORDER_LIST_ROADVEH_TIP                        :{BLACK}Etgay away istlay ofway allway oadray ehiclesvay ithway ethay urrentcay epotday inway eirthay ordersway
+STR_DEPOT_VEHICLE_ORDER_LIST_SHIP_TIP                           :{BLACK}Etgay away istlay ofway allway ipsshay ithway ethay urrentcay epotday inway eirthay ordersway
+STR_DEPOT_VEHICLE_ORDER_LIST_AIRCRAFT_TIP                       :{BLACK}Etgay away istlay ofway allway aircraftway ithway anyway angarhay atway isthay airportway inway eirthay ordersway
+
+STR_DEPOT_AUTOREPLACE_TRAIN_TIP                                 :{BLACK}Autoreplaceway allway ainstray inway ethay epotday
+STR_DEPOT_AUTOREPLACE_ROADVEH_TIP                               :{BLACK}Autoreplaceway allway oadray ehiclesvay inway ethay epotday
+STR_DEPOT_AUTOREPLACE_SHIP_TIP                                  :{BLACK}Autoreplaceway allway ipsshay inway ethay epotday
+STR_DEPOT_AUTOREPLACE_AIRCRAFT_TIP                              :{BLACK}Autoreplaceway allway aircraftway inway ethay angarhay
+
+STR_VEHICLE_LIST_TRAIN_DEPOT                                    :{BLACK}{STRING} - {COMMA} Ain{P "" s}tray
+STR_VEHICLE_LIST_ROADVEH_DEPOT                                  :{BLACK}{STRING} - {COMMA} Oadray Ehicle{P "" s}vay
+STR_VEHICLE_LIST_SHIP_DEPOT                                     :{BLACK}{STRING} - {COMMA} Ip{P "" s}shay
+STR_VEHICLE_LIST_AIRCRAFT_DEPOT                                 :{BLACK}{STRING} - {COMMA} Aircraftway
+
+STR_REPLACE_VEHICLES_WHITE                                      :{WHITE}Eplaceray {STRING}
+STR_REPLACE_VEHICLES_START                                      :{BLACK}Artstay Eplacingray Ehiclesvay
+STR_REPLACE_VEHICLES_STOP                                       :{BLACK}Opstay Eplacingray Ehiclesvay
+STR_NOT_REPLACING                                               :{BLACK}Otnay eplacingray
+STR_NOT_REPLACING_VEHICLE_SELECTED                              :{BLACK}Onay ehiclevay electedsay
+STR_REPLACE_HELP_LEFT_ARRAY                                     :{BLACK}Electsay ethay engineway ypetay otay eplaceray
+STR_REPLACE_HELP_RIGHT_ARRAY                                    :{BLACK}Electsay ethay ewnay engineway ypetay ouyay ouldway ikelay otay useway inway aceplay ofway ethay eftlay electedsay engineway ypetay
+STR_REPLACE_HELP_STOP_BUTTON                                    :{BLACK}Esspray otay opstay ethay eplacementray ofway ethay engineway ypetay electedsay onway ethay eftlay
+STR_REPLACE_HELP_START_BUTTON                                   :{BLACK}Esspray otay eginbay eplacementray ofway ethay eftlay electedsay engineway ypetay ithway ethay ightray electedsay engineway ypetay
+STR_REPLACE_HELP_RAILTYPE                                       :{BLACK}Oosechay ethay ailtyperay ouyay antway otay eplaceray enginesway orfay
+STR_REPLACE_HELP_REPLACE_INFO_TAB                               :{BLACK}Isplaysday ichwhay engineway ethay eftlay electedsay engineway isway eingbay eplacedray ithway, ifway anyway
+STR_REPLACE_HELP                                                :{BLACK}Isthay allowsway ouyay otay eplaceray oneway engineway ypetay ithway anotherway ypetay, enwhay ainstray ofway ethay originalway ypetay enterway away epotday
+STR_REPLACE_REMOVE_WAGON                                        :{BLACK}Agonway emovalray: {ORANGE}{SKIP}{STRING}
+STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Akemay autoreplaceway eepkay ethay engthlay ofway away aintray ethay amesay ybay emovingray agonsway (artingstay atway ethay ontfray), ifway eplacingray ethay engineway ouldway akemay ethay aintray ongerlay.
+STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Eplacingray: {ORANGE}{SKIP}{SKIP}{STRING}
+STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} EXPERIMENTALWAY EATUREFay {}Itchsway etweenbay engineway andway agonway eplacementray indowsway.{}Agonway eplacementray illway onlyway ebay oneday ifway ethay ewnay agonway ancay ebay efittedray intoway arryingcay ethay amesay ypetay ofway argocay asway ethay oldway oneway. Isthay isway eckedchay orfay eachway agonway enwhay ethay actualway eplacementray akestay aceplay.
+STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Ehiclevay isway otnay availableway
+STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Ehiclevay isway otnay availableway
+STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Ipshay isway otnay availableway
+STR_AIRCRAFT_NOT_AVAILABLE                                      :{WHITE}Aircraftway isway otnay availableway
+
+STR_ENGINES                                                     :Enginesway
+STR_WAGONS                                                      :Agonsway
+
+STR_MASS_STOP_DEPOT_TRAIN_TIP                                   :{BLACK}Ickclay otay opstay allway ethay ainstray insideway ethay epotday
+STR_MASS_STOP_DEPOT_ROADVEH_TIP                                 :{BLACK}Ickclay otay opstay allway ethay oadray ehiclesvay insideway ethay epotday
+STR_MASS_STOP_DEPOT_SHIP_TIP                                    :{BLACK}Ickclay otay opstay allway ethay ipsshay insideway ethay epotday
+STR_MASS_STOP_HANGAR_TIP                                        :{BLACK}Ickclay otay opstay allway ethay aircraftway insideway ethay angarhay
+
+STR_MASS_START_DEPOT_TRAIN_TIP                                  :{BLACK}Ickclay otay artstay allway ethay ainstray insideway ethay epotday
+STR_MASS_START_DEPOT_ROADVEH_TIP                                :{BLACK}Ickclay otay artstay allway ethay oadray ehiclesvay insideway ethay epotday
+STR_MASS_START_DEPOT_SHIP_TIP                                   :{BLACK}Ickclay otay artstay allway ethay ipsshay insideway ethay epotday
+STR_MASS_START_HANGAR_TIP                                       :{BLACK}Ickclay otay artstay allway ethay aircraftway insideway ethay angarhay
+
+STR_MASS_STOP_LIST_TIP                                          :{BLACK}Ickclay otay opstay allway ethay ehiclesvay inway ethay istlay
+STR_MASS_START_LIST_TIP                                         :{BLACK}Ickclay otay artstay allway ethay ehiclesvay inway ethay istlay
+
+STR_SHORT_DATE                                                  :{WHITE}{DATE_TINY}
+STR_SIGN_LIST_CAPTION                                           :{WHITE}Ignsay Istlay - {COMMA} Ign{P "" s}say
+
+STR_ORDER_REFIT_FAILED                                          :{WHITE}Orderway efitray ailurefay oppedstay {STRING} {COMMA}
+
+############ Lists rail types
+
+STR_RAIL_VEHICLES                                               :Ailray Ehiclesvay
+STR_ELRAIL_VEHICLES                                             :Electrifiedway Ailray Ehiclesvay
+STR_MONORAIL_VEHICLES                                           :Onorailmay Ehiclesvay
+STR_MAGLEV_VEHICLES                                             :Aglevmay Ehiclesvay
+
+############ End of list of rail types
+
+STR_TINY_BLACK                                                  :{BLACK}{TINYFONT}{COMMA}
+
+STR_PURCHASE_INFO_COST_WEIGHT                                   :{BLACK}Ostcay: {GOLD}{CURRENCY}{BLACK} Eightway: {GOLD}{WEIGHT_S}
+STR_PURCHASE_INFO_SPEED_POWER                                   :{BLACK}Eedspay: {GOLD}{VELOCITY}{BLACK}   Owerpay: {GOLD}{POWER}
+STR_PURCHASE_INFO_SPEED                                         :{BLACK}Eedspay: {GOLD}{VELOCITY}
+STR_PURCHASE_INFO_RUNNINGCOST                                   :{BLACK}Unningray Ostcay: {GOLD}{CURRENCY}/yray
+STR_PURCHASE_INFO_CAPACITY                                      :{BLACK}Apacitycay: {GOLD}{CARGO} {STRING}
+STR_PURCHASE_INFO_DESIGNED_LIFE                                 :{BLACK}Esignedday: {GOLD}{NUM}{BLACK} Ifelay: {GOLD}{COMMA} earsyay
+STR_PURCHASE_INFO_RELIABILITY                                   :{BLACK}Axmay. Eliabilityray: {GOLD}{COMMA}%
+STR_PURCHASE_INFO_COST                                          :{BLACK}Ostcay: {GOLD}{CURRENCY}
+STR_PURCHASE_INFO_WEIGHT_CWEIGHT                                :{BLACK}Eightway: {GOLD}{WEIGHT_S}  ({WEIGHT_S})
+STR_PURCHASE_INFO_COST_SPEED                                    :{BLACK}Ostcay: {GOLD}{CURRENCY}{BLACK} Eedspay: {GOLD}{VELOCITY}
+STR_PURCHASE_INFO_AIRCRAFT_CAPACITY                             :{BLACK}Apacitycay: {GOLD}{COMMA} assengerspay, {COMMA} agsbay ofway ailmay
+STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT                          :{BLACK}Oweredpay Agonsway: {GOLD}+{POWER}{BLACK} Eightway: {GOLD}+{WEIGHT_S}
+STR_PURCHASE_INFO_REFITTABLE_TO                                 :{BLACK}Efittableray otay: {GOLD}
+STR_PURCHASE_INFO_ALL_TYPES                                     :Allway argocay ypestay
+STR_PURCHASE_INFO_ALL_BUT                                       :Allway utbay {GOLD}
+STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Axmay. Activetray Effortway: {GOLD}{FORCE}
+
+########### String for New Landscape Generator
+
+STR_GENERATE                                                    :{WHITE}Enerategay
+STR_RANDOM                                                      :{BLACK}Andomiseray
+STR_RANDOM_HELP                                                 :{BLACK}Angechay ethay andomray eedsay usedway orfay Erraintay Enerationgay
+STR_WORLD_GENERATION_CAPTION                                    :{WHITE}Orldway enerationgay
+STR_RANDOM_SEED                                                 :{BLACK}Andomray Eedsay:
+STR_RANDOM_SEED_HELP                                            :{BLACK}Ickclay otay enterway away andomray eedsay
+STR_LAND_GENERATOR                                              :{BLACK}Andlay eneratorgay:
+STR_TREE_PLACER                                                 :{BLACK}Eetray algorithmway:
+STR_HEIGHTMAP_ROTATION                                          :{BLACK}Eightmaphay otationray:
+STR_TERRAIN_TYPE                                                :{BLACK}Erraintay ypetay:
+STR_QUANTITY_OF_SEA_LAKES                                       :{BLACK}Easay evellay:
+STR_SMOOTHNESS                                                  :{BLACK}Oothnesssmay:
+STR_SNOW_LINE_HEIGHT                                            :{BLACK}Owsnay inelay eighthay:
+STR_DATE                                                        :{BLACK}Ateday:
+STR_NUMBER_OF_TOWNS                                             :{BLACK}Onay. ofway ownstay:
+STR_NUMBER_OF_INDUSTRIES                                        :{BLACK}Onay. ofway industriesway:
+STR_GENERATE_DATE                                               :{BLACK}{DATE_LONG}
+STR_SNOW_LINE_UP                                                :{BLACK}Ovemay ethay owsnay inelay eighthay oneway upway
+STR_SNOW_LINE_DOWN                                              :{BLACK}Ovemay ethay owsnay inelay eighthay oneway ownday
+STR_SNOW_LINE_QUERY_CAPT                                        :{WHITE}Angechay owsnay inelay eighthay
+STR_START_DATE_QUERY_CAPT                                       :{WHITE}Angechay artingstay earyay
+STR_HEIGHTMAP_SCALE_WARNING_CAPTION                             :{WHITE}Alescay arningway
+STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Esizingray ourcesay apmay ootay uchmay isway otnay ecommendedray. Ontinuecay ithway ethay enerationgay?
+STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Owntay ayoutlay arningway
+STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Ethay owntay ayoutlay "onay oremay oadsray" isway otnay ecommendedray. Ontinuecay ithway ethay enerationgay?
+STR_HEIGHTMAP_NAME                                              :{BLACK}Eightmaphay amenay:
+STR_HEIGHTMAP_SIZE                                              :{BLACK}Izesay: {ORANGE}{NUM} xay {NUM}
+STR_GENERATION_WORLD                                            :{WHITE}Eneratinggay orldway...
+STR_GENERATION_ABORT                                            :{BLACK}Abortway
+STR_GENERATION_ABORT_CAPTION                                    :{WHITE}Abortway Orldway Enerationgay
+STR_GENERATION_ABORT_MESSAGE                                    :{YELLOW}Oday ouyay eallyray antway otay abortway ethay enerationgay?
+STR_PROGRESS                                                    :{WHITE}{NUM}% ompletecay
+STR_GENERATION_PROGRESS                                         :{BLACK}{NUM} / {NUM}
+STR_WORLD_GENERATION                                            :{BLACK}Orldway enerationgay
+STR_TREE_GENERATION                                             :{BLACK}Eetray enerationgay
+STR_UNMOVABLE_GENERATION                                        :{BLACK}Unmovableway enerationgay
+STR_CLEARING_TILES                                              :{BLACK}Oughray andway ockyray areaway enerationgay
+STR_SETTINGUP_GAME                                              :{BLACK}Ettingsay upway amegay
+STR_PREPARING_TILELOOP                                          :{BLACK}Unningray iletay-ooplay
+STR_PREPARING_GAME                                              :{BLACK}Eparingpray amegay
+STR_DIFFICULTY_TO_CUSTOM                                        :{WHITE}Isthay actionway angedchay ethay ifficultyday evellay otay ustomcay
+STR_SE_FLAT_WORLD                                               :{WHITE}Atflay andlay
+STR_SE_FLAT_WORLD_TIP                                           :{BLACK}Enerategay away atflay andlay
+STR_SE_RANDOM_LAND                                              :{WHITE}Andomray andlay
+STR_SE_NEW_WORLD                                                :{BLACK}Eatecray ewnay enarioscay
+STR_SE_CAPTION                                                  :{WHITE}Enarioscay ypetay
+STR_FLAT_WORLD_HEIGHT_DOWN                                      :{BLACK}Ovemay ethay eighthay ofway atflay andlay oneway ownday
+STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Ovemay ethay eighthay ofway atflay andlay oneway upway
+STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Angechay eighthay ofway atflay andlay
+STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Eighthay ofway atflay andlay:
+
+STR_SMALLMAP_CENTER                                             :{BLACK}Entercay ethay allmapsmay onway ethay urrentcay ositionpay
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
+
+########### String for new airports
+STR_SMALL_AIRPORT                                               :{BLACK}Allsmay
+STR_CITY_AIRPORT                                                :{BLACK}Itycay
+STR_METRO_AIRPORT                                               :{BLACK}Etropolitanmay airportway
+STR_INTERNATIONAL_AIRPORT                                       :{BLACK}Internationalway airportway
+STR_COMMUTER_AIRPORT                                            :{BLACK}Ommutercay
+STR_INTERCONTINENTAL_AIRPORT                                    :{BLACK}Intercontinentalway
+STR_HELIPORT                                                    :{BLACK}Eliporthay
+STR_HELIDEPOT                                                   :{BLACK}Elidepothay
+STR_HELISTATION                                                 :{BLACK}Elistationhay
+
+STR_SMALL_AIRPORTS                                              :{BLACK}Allsmay airportsway
+STR_LARGE_AIRPORTS                                              :{BLACK}Argelay airportsway
+STR_HUB_AIRPORTS                                                :{BLACK}Ubhay airportsway
+STR_HELIPORTS                                                   :{BLACK}Elicopterhay airportsway
+
+############ Tooltip measurment
+
+STR_MEASURE_LENGTH                                              :{BLACK}Engthlay: {NUM}
+STR_MEASURE_AREA                                                :{BLACK}Areaway: {NUM} xay {NUM}
+STR_MEASURE_LENGTH_HEIGHTDIFF                                   :{BLACK}Engthlay: {NUM}{}Eighthay ifferenceday: {NUM} may
+STR_MEASURE_AREA_HEIGHTDIFF                                     :{BLACK}Areaway: {NUM} xay {NUM}{}Eighthay ifferenceday: {NUM} may
+
+############ Date formatting
+STR_DATE_TINY                                                   :{STRING}-{STRING}-{NUM}
+STR_DATE_SHORT                                                  :{STRING} {NUM}
+STR_DATE_LONG                                                   :{STRING} {STRING} {NUM}
+
+########
+
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}Ansfertray Editscray: {LTBLUE}{CURRENCY}
+STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD                            :{WHITE}...isthay isway away owntay ownedway oadray
+STR_DRIVE_THROUGH_ERROR_DIRECTION                               :{WHITE}...oadray acingfay inway ethay ongwray irectionday
+
+STR_TRANSPARENCY_TOOLB                                          :{WHITE}Ansparencytray Optionsway
+STR_TRANSPARENT_SIGNS_DESC                                      :{BLACK}Oggletay ansparencytray orfay ationstay ignssay
+STR_TRANSPARENT_TREES_DESC                                      :{BLACK}Oggletay ansparencytray orfay eestray
+STR_TRANSPARENT_HOUSES_DESC                                     :{BLACK}Oggletay ansparencytray orfay ouseshay
+STR_TRANSPARENT_INDUSTRIES_DESC                                 :{BLACK}Oggletay ansparencytray orfay industriesway
+STR_TRANSPARENT_BUILDINGS_DESC                                  :{BLACK}Oggletay ansparencytray orfay uildablesbay ikelay ationsstay, epotsday, aypointsway andway atenarycay
+STR_TRANSPARENT_BRIDGES_DESC                                    :{BLACK}Oggletay ansparencytray orfay idgesbray
+STR_TRANSPARENT_STRUCTURES_DESC                                 :{BLACK}Oggletay ansparencytray orfay ucturesstray ikelay ighthouseslay andway antennasway, aybemay inway uturefay orfay eyecandyway
+STR_TRANSPARENT_LOADING_DESC                                    :{BLACK}Oggletay ansparencytray orfay oadinglay indicatorsway
+
+STR_PERCENT_UP_SMALL                                            :{TINYFONT}{WHITE}{NUM}%{UPARROW}
+STR_PERCENT_UP                                                  :{WHITE}{NUM}%{UPARROW}
+STR_PERCENT_DOWN_SMALL                                          :{TINYFONT}{WHITE}{NUM}%{DOWNARROW}
+STR_PERCENT_DOWN                                                :{WHITE}{NUM}%{DOWNARROW}
+STR_PERCENT_UP_DOWN_SMALL                                       :{TINYFONT}{WHITE}{NUM}%{UPARROW}{DOWNARROW}
+STR_PERCENT_UP_DOWN                                             :{WHITE}{NUM}%{UPARROW}{DOWNARROW}
+
+##### Mass Order
+STR_GROUP_NAME_FORMAT                                           :Oupgray {COMMA}
+STR_GROUP_TINY_NAME                                             :{TINYFONT}{GROUP}
+STR_GROUP_ALL_TRAINS                                            :Allway ainstray
+STR_GROUP_ALL_ROADS                                             :Allway oadray ehiclesvay
+STR_GROUP_ALL_SHIPS                                             :Allway ipsshay
+STR_GROUP_ALL_AIRCRAFTS                                         :Allway aircraftway
+STR_GROUP_DEFAULT_TRAINS                                        :Ungroupedway ainstray
+STR_GROUP_DEFAULT_ROADS                                         :Ungroupedway oadray ehiclesvay
+STR_GROUP_DEFAULT_SHIPS                                         :Ungroupedway ipsshay
+STR_GROUP_DEFAULT_AIRCRAFTS                                     :Ungroupedway aircraftway
+STR_GROUP_TINY_NUM                                              :{TINYFONT}{COMMA}
+STR_GROUP_ADD_SHARED_VEHICLE                                    :Addway aredshay ehiclesvay
+STR_GROUP_REMOVE_ALL_VEHICLES                                   :Emoveray allway ehiclesvay
+
+STR_GROUP_TRAINS_CAPTION                                        :{WHITE}{GROUP} - {COMMA} Ain{P "" s}tray
+STR_GROUP_ROADVEH_CAPTION                                       :{WHITE}{GROUP} - {COMMA} Oadray Ehicle{P "" s}vay
+STR_GROUP_SHIPS_CAPTION                                         :{WHITE}{GROUP} - {COMMA} Ip{P "" s}shay
+STR_GROUP_AIRCRAFTS_CAPTION                                     :{WHITE}{GROUP} - {COMMA} Aircraftway
+STR_GROUP_RENAME_CAPTION                                        :{BLACK}Enameray away oupgray
+STR_GROUP_REPLACE_CAPTION                                       :{WHITE}Eplaceray Ehiclesvay ofway "{GROUP}"
+
+STR_GROUP_CAN_T_CREATE                                          :{WHITE}An'tcay eatecray oupgray...
+STR_GROUP_CAN_T_DELETE                                          :{WHITE}An'tcay eleteday isthay oupgray...
+STR_GROUP_CAN_T_RENAME                                          :{WHITE}An'tcay enameray oupgray...
+STR_GROUP_CAN_T_REMOVE_ALL_VEHICLES                             :{WHITE}An'tcay emoveray allway ehiclesvay omfray isthay oupgray...
+STR_GROUP_CAN_T_ADD_VEHICLE                                     :{WHITE}An'tcay addway ethay ehiclevay otay isthay oupgray...
+STR_GROUP_CAN_T_ADD_SHARED_VEHICLE                              :{WHITE}An'tcay addway aredshay ehiclesvay otay oupgray...
+
+STR_GROUPS_CLICK_ON_GROUP_FOR_TIP                               :{BLACK}Oupsgray - Ickclay onway away oupgray otay istlay allway ehiclesvay ofway isthay oupgray
+STR_GROUP_CREATE_TIP                                            :{BLACK}Ickclay otay eatecray away oupgray
+STR_GROUP_DELETE_TIP                                            :{BLACK}Eleteday ethay electedsay oupgray
+STR_GROUP_RENAME_TIP                                            :{BLACK}Enameray ethay electedsay oupgray
+STR_GROUP_REPLACE_PROTECTION_TIP                                :{BLACK}Ickclay otay otectpray isthay oupgray omfray obalglay autoreplaceway
+
+STR_COMPANY_NAME                                                :{COMPANY}
+STR_ENGINE_NAME                                                 :{ENGINE}
+STR_GROUP_NAME                                                  :{GROUP}
+STR_PLAYER_NAME                                                 :{PLAYERNAME}
+STR_SIGN_NAME                                                   :{SIGN}
+STR_VEHICLE_NAME                                                :{VEHICLE}
+
+STR_NAME_MUST_BE_UNIQUE                                         :{WHITE}Amenay ustmay ebay uniqueway
+
+#### Improved sign GUI
+STR_NEXT_SIGN_TOOLTIP                                           :{BLACK}Ogay otay extnay ignsay
+STR_PREVIOUS_SIGN_TOOLTIP                                       :{BLACK}Ogay otay eviouspray ignsay
+
+########
+
+STR_FUND_NEW_INDUSTRY                                           :{BLACK}Undfay
+STR_PROSPECT_NEW_INDUSTRY                                       :{BLACK}Ospectpray
+STR_BUILD_NEW_INDUSTRY                                          :{BLACK}Uildbay
+STR_INDUSTRY_SELECTION_HINT                                     :{BLACK}Oosechay ethay appropriateway industryway omfray isthay istlay
+
+############ Face formatting
+STR_FACE_ADVANCED                                               :{BLACK}Advancedway
+STR_FACE_ADVANCED_TIP                                           :{BLACK}Advancedway acefay electionsay.
+########
+
+############ signal GUI
+########
--- a/src/lang/polish.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/polish.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -204,7 +204,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Nie można wyczyścić terenu...
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Prawa Autorskie {COPYRIGHT} 1995 Chris Sawyer, Wszelkie Prawa Zastrzeżone
 STR_00B7_VERSION                                                :{BLACK}OpenTTD wersja {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 Zespół OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 Zespół OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK}  Tłumacz(e) - : Tom PolPot Spooqy MeusH
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -352,12 +352,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Gra Wieloosobowa
 STR_SCENARIO_EDITOR                                             :{BLACK}Edytor Scenariuszy
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Rozmiar Mapy:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Opcje Gry
@@ -647,6 +641,9 @@
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Informacja firmy
 STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Otwarcie / zamknięcie przedsiębiorstw
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Zmiany ekonomiczne
+STR_INDUSTRY_CHANGES_SERVED_BY_PLAYER                           :{YELLOW}Zmiany produkcji przedsiębiorstw obsługiwanych przez gracza
+STR_INDUSTRY_CHANGES_SERVED_BY_OTHER                            :{YELLOW}Zmiany produkcji przedsiębiorstw obsługiwanych przez przeciwników
+STR_OTHER_INDUSTRY_PRODUCTION_CHANGES                           :{YELLOW}Zmiany produkcji pozostałych przedsiębiorstw
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Porady / informacje o pojazdach gracza
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nowe pojazdy
 STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Zamiany w akceptowaniu ładunku
@@ -699,7 +696,7 @@
 STR_023B_INCREASE_SIZE_OF_TOWN                                  :{BLACK}Zwiększ rozmiar miasta
 STR_023C_EXPAND                                                 :{BLACK}Rozszerz
 STR_023D_RANDOM_TOWN                                            :{BLACK}Losowe miasto
-STR_023E_BUILD_TOWN_IN_RANDOM_LOCATION                          :{BLACK}Budowanie miasta w losowym miejscu
+STR_023E_BUILD_TOWN_IN_RANDOM_LOCATION                          :{BLACK}Budowa miasta w losowym miejscu
 STR_023F_INDUSTRY_GENERATION                                    :{WHITE}Tworzenie przedsiębiorstw
 STR_0240_COAL_MINE                                              :{BLACK}{G=f}Kopalnia Węgla
 STR_0240_COAL_MINE.d                                            :{BLACK}{G=f}kopalni węgla
@@ -947,6 +944,7 @@
 
 STR_0314_FUND_NEW_INDUSTRY                                      :{WHITE}Ufunduj nowe przedsięb.
 STR_JUST_STRING                                                 :{STRING}
+STR_JUST_INT                                                    :{NUM}
 STR_0316_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...może być wybudowane tylko w mieście
 STR_0317_CAN_ONLY_BE_BUILT_IN_RAINFOREST                        :{WHITE}...może być wybudowane tylko w lasach deszczowych
 STR_0318_CAN_ONLY_BE_BUILT_IN_DESERT                            :{WHITE}...może być wybudowane tylko na pustyni
@@ -1107,6 +1105,7 @@
 STR_CONFIG_PATCHES_ON                                           :wł.
 STR_CONFIG_PATCHES_VEHICLESPEED                                 :{LTBLUE}Pokazuj prędkość pojazdów w pasku statusu: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_BUILDONSLOPES                                :{LTBLUE}Pozwól budować na pochyłościach i wybrzeżach: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AUTOSLOPE                                    :{LTBLUE}Pozwól na zmiany terenu pod budynkami, torami (autoslope): {ORANGE}{STRING}
 STR_CONFIG_PATCHES_CATCHMENT                                    :{LTBLUE}Zezwól na bardziej realistyczny zasięg obejmowania: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_EXTRADYNAMITE                                :{LTBLUE}Pozwól usuwać drogi, mosty, tunele, itp. należące do miasta: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAMMOTHTRAINS                                :{LTBLUE}Pozwól budować bardzo długie pociągi: {ORANGE}{STRING}
@@ -1133,6 +1132,8 @@
 STR_CONFIG_PATCHES_ROADVEH_QUEUE                                :{LTBLUE}Ustawianie się samochodów w kolejkach (z efektem quantum): {ORANGE}{STRING}
 STR_CONFIG_PATCHES_AUTOSCROLL                                   :{LTBLUE}Przesuń okno, kiedy kursor jest przy krawędzi: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_BRIBE                                        :{LTBLUE}Pozwól dawać łapówki lokalnym władzom: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ALLOW_EXCLUSIVE                              :{LTBLUE}Pozwól na kupno wyłączności transportowej: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ALLOW_GIVE_MONEY                             :{LTBLUE}Pozwól na wysyłanie pieniędzy do innych firm:: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_NONUNIFORM_STATIONS                          :{LTBLUE}Niejednolite stacje: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_NEW_PATHFINDING_ALL                          :{LTBLUE}Nowe szukanie drogi (NPF, zastępuje NTP): {ORANGE}{STRING}
 STR_CONFIG_PATCHES_FREIGHT_TRAINS                               :{LTBLUE}Mnożnik wagi dla symulacji ciężkich pociągów towarowych: {ORANGE}{STRING}
@@ -1190,9 +1191,21 @@
 STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Przesuń widok
 STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Rolka wyłączona
 STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Prędkość przesuwania widoku: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU                          :{LTBLUE}Emulacjia prawego przycisku myszy: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_COMMAND                  :Command-klik
+STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_CONTROL                  :Control-klik
+STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_OFF                      :Wyłączona
+
 STR_CONFIG_PATCHES_PAUSE_ON_NEW_GAME                            :{LTBLUE}Automatycznie włącz pauzę przy rozpoczęciu nowej gry: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS                       :{LTBLUE}Używaj zaawansowanej listy pojazdów: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OFF                   :Nie używaj
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OWN                   :Dla własnej firmy
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_ALL                   :Dla wszystkich firm
 STR_CONFIG_PATCHES_LOADING_INDICATORS                           :{LTBLUE}Pokazuj wskaźniki załadunku: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LOADING_INDICATORS_OFF                       :Nie pokazuj
+STR_CONFIG_PATCHES_LOADING_INDICATORS_OWN                       :Dla własnej firmy
+STR_CONFIG_PATCHES_LOADING_INDICATORS_ALL                       :Dla wszystkich firm
 STR_CONFIG_PATCHES_TIMETABLE_ALLOW                              :{LTBLUE}Uaktywnij rozkłady jazdy pojazdów: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_TIMETABLE_IN_TICKS                           :{LTBLUE}Pokazuj rozkłady jazdy w tickach, a nie w dniach: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE                            :{LTBLUE}Domyślny typ torowiska (w nowej grze/po wczytaniu gry): {ORANGE}{STRING}
@@ -1237,6 +1250,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Pozwól kupować udziały w innych firmach
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}W trakcie przeciągania ustaw sygnały co: {ORANGE}{STRING} kratk{P e i ek}
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Automatycznie buduj semafory przed: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Uaktywnij okno budowania sygnałów: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Plan sieci dróg "bez nowych dróg" nie jest poprawny dla edytora scenariuszy
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Wybierz plan sieci dróg miejskich: {ORANGE}{STRING}
@@ -1261,6 +1275,7 @@
 STR_CONFIG_PATCHES_LARGER_TOWNS                                 :{LTBLUE}Ilość miast które staną się metropoliami: {ORANGE}1 na {STRING}
 STR_CONFIG_PATCHES_LARGER_TOWNS_DISABLED                        :{LTBLUE}Ilość miast które staną się metropoliami: {ORANGE}Brak
 STR_CONFIG_PATCHES_CITY_SIZE_MULTIPLIER                         :{LTBLUE}Początkowy mnożnik rozmiarów metropolii: {ORANGE}{STRING}
+STR_CONFIG_MODIFIED_ROAD_REBUILD                                :{LTBLUE}Usuwaj absurdalne fragmenty ulicy podczas rekonstrukcji dróg
 
 STR_CONFIG_PATCHES_GUI                                          :{BLACK}Interfejs
 STR_CONFIG_PATCHES_CONSTRUCTION                                 :{BLACK}Konstrukcje
@@ -1291,7 +1306,7 @@
 STR_CHEAT_CHANGE_PLAYER                                         :{LTBLUE}Graj jako gracz: {ORANGE}{COMMA}
 STR_CHEAT_EXTRA_DYNAMITE                                        :{LTBLUE}Magiczny buldożer (usuwanie przedsiębiorstw, itp.): {ORANGE}{STRING}
 STR_CHEAT_CROSSINGTUNNELS                                       :{LTBLUE}Tunele mogą się krzyżować: {ORANGE}{STRING}
-STR_CHEAT_BUILD_IN_PAUSE                                        :{LTBLUE}Budowanie w czasie pauzy: {ORANGE}{STRING}
+STR_CHEAT_BUILD_IN_PAUSE                                        :{LTBLUE}Budowa w czasie pauzy: {ORANGE}{STRING}
 STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Odrzutowce nie będą się często rozbijać na małych lotniskach: {ORANGE} {STRING}
 STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Zmień klimat: {ORANGE} {STRING}
 STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Zmień datę: {ORANGE} {DATE_SHORT}
@@ -1320,7 +1335,7 @@
 STR_CANT_BUILD_TRAIN_WAYPOINT                                   :{WHITE}Nie można tutaj zbudować pkt. kontolnego...
 STR_CANT_REMOVE_TRAIN_WAYPOINT                                  :{WHITE}Nie można usunąć pkt. kontrolnego z tego miejsca...
 
-STR_BUILD_AUTORAIL_TIP                                          :{BLACK}Budowanie torów używając trybu Autorail
+STR_BUILD_AUTORAIL_TIP                                          :{BLACK}Budowa torów używając trybu Autorail
 
 STR_NO_TOWN_IN_SCENARIO                                         :{WHITE}...nie ma żadnego miasta w scenariuszu
 
@@ -1358,7 +1373,7 @@
 STR_DRAG_WHOLE_TRAIN_TO_SELL_TIP                                :{BLACK}Przeciągnij tutaj lokomotywę by sprzedać cały pociąg
 
 STR_DRAG_DROP                                                   :{BLACK}Przeciągnij i upuść
-STR_STATION_DRAG_DROP                                           :{BLACK}Budowanie stacji używając przeciągnij i upuść
+STR_STATION_DRAG_DROP                                           :{BLACK}Budowj stację używając "przeciągnij i upuść"
 STR_SELECT_STATION_CLASS_TIP                                    :{BLACK}Wybierz rodzaj stacji do pokazania
 STR_SELECT_STATION_TYPE_TIP                                     :{BLACK}Wybierz typ stacji do zbudowania
 
@@ -1736,8 +1751,10 @@
 STR_1809_CAN_T_BUILD_CARGO_TRAM_STATION                         :{WHITE}Nie można zbudować tramwajowej stacji załadunkowej...
 STR_180A_ROAD_CONSTRUCTION                                      :Budowa drogi
 STR_180A_TRAMWAY_CONSTRUCTION                                   :Budowa torowiska tramwajowego
-STR_180B_BUILD_ROAD_SECTION                                     :{BLACK}Sekcja budowy dróg
+STR_180B_BUILD_ROAD_SECTION                                     :{BLACK}Budowa dróg
+STR_BUILD_AUTOROAD_TIP                                          :{BLACK}Budowa drogi używając trybu Autoroad
 STR_180B_BUILD_TRAMWAY_SECTION                                  :{BLACK}Zbuduj fragment torowiska tramwajowego
+STR_BUILD_AUTOTRAM_TIP                                          :{BLACK}Budowa torów tramwajowych używając trybu Autotram
 STR_180C_BUILD_ROAD_VEHICLE_DEPOT                               :{BLACK}Zbuduj zajezdnię samochodową (do budowania i serwisowania pojazdów)
 STR_180C_BUILD_TRAM_VEHICLE_DEPOT                               :{BLACK}Zbuduj zajezdnię tramwajową (do budowania i serwisowania pojazdów)
 STR_180D_BUILD_BUS_STATION                                      :{BLACK}Budowa przystanku
@@ -1748,6 +1765,7 @@
 STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}Zbuduj most tramwajowy
 STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}Budowa tunelu drogowego
 STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}Zbuduj tunel tramwajowy
+STR_TOGGLE_ONE_WAY_ROAD                                         :{BLACK}Włącz/Wyłącz drogi jednokierunkowe
 STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Przełącz buduj/usuń dla konstrukcji dróg
 STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}Przełącz buduj/usuń dla konstrukcji torowiska tramwajowego
 STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}Wybierz umiejscowienie zajezdni samochodowej
@@ -1769,6 +1787,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Należy najpierw zburzyć budynek
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}Populacja: {ORANGE}{COMMA}{BLACK}  Domów: {ORANGE}{COMMA}
@@ -2127,6 +2146,8 @@
 STR_5006_MUST_DEMOLISH_TUNNEL_FIRST                             :{WHITE}Należy najpierw usunąć tunel
 STR_5007_MUST_DEMOLISH_BRIDGE_FIRST                             :{WHITE}Należy najpierw usunąć most
 STR_5008_CANNOT_START_AND_END_ON                                :{WHITE}Nie można zaczynać i kończyć w tym samym miejscu
+STR_BRIDGEHEADS_NOT_SAME_HEIGHT                                 :{WHITE}Początki mostu nie są na tej samej wysokości
+STR_BRIDGE_TOO_LOW_FOR_TERRAIN                                  :{WHITE}Most jest za nisko dla tego terenu
 STR_500A_START_AND_END_MUST_BE_IN                               :{WHITE}Początek i koniec muszą być w jednej linii
 STR_500B_SITE_UNSUITABLE_FOR_TUNNEL                             :{WHITE}Nieodpowiednie miejsce na wejście tunelu
 STR_500D                                                        :{GOLD}{STRING},{} {VELOCITY} {WHITE}{CURRENCY}
@@ -2407,6 +2428,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Hasło
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Ochrona hasłem Twojej firmy zapobiega nieautoryzowanemu przyłączeniu się
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Ustaw hasło firmy
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Nie zapisuj podanego hasła
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Nadaj firmie nowe hasło
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Hasło firmy
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Hasło domyślne
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Użyj tego hasła jako domyślnego dla nowych firm
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Światowa recesja!{}{}Eksperci finansowi obawiają się najgorszego z powodu kryzysu!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Koniec recesji!{}{}Polepszenie się transakcji handlowych daje pewność przedsiębiorstwom dzięki umacniającej się ekonomii!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Przełącz duży/mały rozmiar okna
@@ -2892,6 +2918,9 @@
 STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{ENGINE}
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Dostępn{G y a e} now{G y a e} {STRING} - {ENGINE}!
 
+STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Nie można sprzedać zniszczonego pojazdu...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Nie można przebudować zniszczonego pojazdu...
+
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Nie można wyznaczyć rozkładu jazdy pojazdu...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Pojazdy mogą czekać tylko na stacjach.
 STR_TIMETABLE_NOT_STOPPING_HERE                                 :{WHITE}Ten pojazd nie zatrzymuje się na tej stacji.
@@ -3098,7 +3127,7 @@
 STR_A032_NAME_AIRCRAFT                                          :{BLACK}Nazwa samolotu
 STR_A033_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Mieszkańcy świętują . . .{}Pierwszy samolot przyleciał na {STATION}!
 STR_A034_PLANE_CRASH_DIE_IN_FIREBALL                            :{BLACK}{BIGFONT}Katastrofa lotnicza!{}{COMMA} ofiar{P a y ""} na {STATION}
-STR_PLANE_CRASH_OUT_OF_FUEL                                     :{BLACK}{BIGFONT}Wypadek lotniczy!{}Samolot rozbił się z powodu braku paliwa, zginęło {COMMA} osób!
+STR_PLANE_CRASH_OUT_OF_FUEL                                     :{BLACK}{BIGFONT}Wypadek lotniczy!{}Samolot rozbił się z powodu braku paliwa, zginęł{P 0 a y o} {COMMA} os{P oba oby ób}!
 STR_A036                                                        :{TINYFONT}{BLACK}{STATION}
 STR_A037_RENAME                                                 :{BLACK}Zmień nazwę
 STR_A038_RENAME_AIRCRAFT_TYPE                                   :{BLACK}Zmień nazwę typu samolotu
@@ -3180,7 +3209,9 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Niewłaściwy parametr dla {STRING}: parametr {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} musi być wczytany przed {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} musi być wczytany po {STRING}.
+STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER                            :{STRING} wymaga OpenTTD w wersji {STRING} lub nowszej.
 STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :pliku GRF który miał być tłumaczony
+STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED                        :Wczytano za dużo NewGRF.
 
 STR_NEWGRF_ADD                                                  :{BLACK}Dodaj
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Dodaj plik NewGRF do listy
@@ -3209,6 +3240,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Wczytano kompatybilne GRF dla brakujących plików
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Brakujące pliki GRF zostały wyłączone
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Brak plików GRF potrzebnych do wczytania gry
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Brakujące pliki GRF
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Wyłączenie pauzy może zawiesić OpenTTD. Nie zgłaszaj błędów o powtarzających się zawieszeniach.{}Czy na pewno chcesz wyłączyć pauzę?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Własna waluta
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Współczynnik wymiany: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3360,7 +3393,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Nie zaleca się zbyt dużej zmiany wielkości mapy źrodłowej. Kontynuować tworzenie?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Ostrzeżenie o planie miasta
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Model rozwoju miasta "bez nowych dróg" nie jest polecany. Kontynuować tworzenie?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Nazwa mapy wysokosci:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Rozmiar: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Tworzenie świata...
@@ -3386,9 +3418,9 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Podnieś wysokość terenu o jeden w górę
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Zmień wysokość płaskiego świata
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Wysokość płaskiego świata:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Wyśrodkuj mapę na aktualnej lokalizacji
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
 
 ########### String for new airports
 STR_SMALL_AIRPORT                                               :{BLACK}Małe
@@ -3495,3 +3527,68 @@
 STR_PROSPECT_NEW_INDUSTRY                                       :{BLACK}Zleć poszukiwanie
 STR_BUILD_NEW_INDUSTRY                                          :{BLACK}Wybuduj
 STR_INDUSTRY_SELECTION_HINT                                     :{BLACK}Wybierz przedsiębiorstwo z listy
+
+############ Face formatting
+STR_FACE_ADVANCED                                               :{BLACK}Zaawansowane
+STR_FACE_ADVANCED_TIP                                           :{BLACK}Zaawansowany widok wyboru twarzy.
+STR_FACE_SIMPLE                                                 :{BLACK}Prosty widok
+STR_FACE_SIMPLE_TIP                                             :{BLACK}Prosty widok wyboru twarzy.
+STR_FACE_LOAD                                                   :{BLACK}Wczytaj
+STR_FACE_LOAD_TIP                                               :{BLACK}Wczytaj ulubioną twarz
+STR_FACE_LOAD_DONE                                              :{WHITE}Twoja ulubiona twarz została wczytana z pliku konfiguracyjnego OpenTTD.
+STR_FACE_FACECODE                                               :{BLACK}Numer twarzy gracza
+STR_FACE_FACECODE_TIP                                           :{BLACK}Obejrzyj i/lub ustaw numer twarzy gracza
+STR_FACE_FACECODE_CAPTION                                       :{WHITE}Obejrzyj i/lub ustaw numer twarzy gracza
+STR_FACE_FACECODE_SET                                           :{WHITE}Ustawiono nowy numer twarzy gracza.
+STR_FACE_FACECODE_ERR                                           :{WHITE}Nie można ustawić numeru twarzy gracza - musi być liczbą pomiędzy 0 a 4'294'967'295!
+STR_FACE_SAVE                                                   :{BLACK}Zapisz
+STR_FACE_SAVE_TIP                                               :{BLACK}Zapisz ulubioną twarz
+STR_FACE_SAVE_DONE                                              :{WHITE}Ta twarz będzie zapisana w pliku konfiguracyjnym OpenTTD jako Twoja ulubiona
+STR_FACE_EUROPEAN                                               :{BLACK}Europejska
+STR_FACE_SELECT_EUROPEAN                                        :{BLACK}Wybierz twarz o karnacji europejskiej
+STR_FACE_AFRICAN                                                :{BLACK}Afrykańska
+STR_FACE_SELECT_AFRICAN                                         :{BLACK}Wybierz twarz o karnacji afrykańskiej
+STR_FACE_YES                                                    :Tak
+STR_FACE_NO                                                     :Nie
+STR_FACE_MOUSTACHE_EARRING_TIP                                  :{BLACK}Pokaż wąsy lub kolczyk
+STR_FACE_HAIR                                                   :Włosy:
+STR_FACE_HAIR_TIP                                               :{BLACK}Zmień włosy
+STR_FACE_EYEBROWS                                               :Rzęsy:
+STR_FACE_EYEBROWS_TIP                                           :{BLACK}Zmień rzęsy
+STR_FACE_EYECOLOUR                                              :Kolor oczu:
+STR_FACE_EYECOLOUR_TIP                                          :{BLACK}Zmień kolor oczu
+STR_FACE_GLASSES                                                :Okulary
+STR_FACE_GLASSES_TIP                                            :{BLACK}Uaktywnij okulary
+STR_FACE_GLASSES_TIP_2                                          :{BLACK}Zmień okulary
+STR_FACE_NOSE                                                   :Nos:
+STR_FACE_NOSE_TIP                                               :{BLACK}Zmień nos
+STR_FACE_LIPS                                                   :Usta:
+STR_FACE_MOUSTACHE                                              :Wąsy:
+STR_FACE_LIPS_MOUSTACHE_TIP                                     :{BLACK}Zmień usta lub wąsy
+STR_FACE_CHIN                                                   :Broda:
+STR_FACE_CHIN_TIP                                               :{BLACK}Zmień brodę
+STR_FACE_JACKET                                                 :Marynarka:
+STR_FACE_JACKET_TIP                                             :{BLACK}Zmień marynarkę
+STR_FACE_COLLAR                                                 :Kołnierz:
+STR_FACE_COLLAR_TIP                                             :{BLACK}Zmień kołnierz
+STR_FACE_TIE                                                    :Krawat:
+STR_FACE_EARRING                                                :Kolczyk:
+STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Zmień krawat lub kolczyk
+########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Wybór sygnałów
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Nie można tutaj zmienić sygnałów...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Zwykły sygnał (semafor){}Sygnały są potrzebne aby uniknąć zderzeń pociągów na liniach z więcej niż jednym pociągiem.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Pre-sygnał (semafor){}Jest zielony jeżeli zielony jest przynajmniej jeden exit-sygnał przy pobliskim skrzyżowaniu. W przeciwnym wypadku, jest czerwony.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Exit-sygnał (semafor){}Zachowuje się tak jak zwykły sygnał, ale wpływa na pobliskie pre- i combo-sygnały.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Combo-sygnał(semafor){}Sygnał combo skupia działanie zarówno pre- jak i exit-sygnałów. Pozwala to na budowę zaawansowanych układów sygnałów.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Zwykły sygnał (świetlny){}Sygnały są potrzebne aby uniknąć zderzeń pociągów na liniach z więcej niż jednym pociągiem.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Pre-sygnał (świetlny){}Jest zielony jeżeli zielony jest przynajmniej jeden exit-sygnał przy pobliskim skrzyżowaniu. W przeciwnym wypadku, jest czerwony.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Exit-sygnał (świetlny){}Zachowuje się tak jak zwykły sygnał, ale wpływa na pobliskie pre- i combo-sygnały.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Combo-sygnał(świetlny){}Sygnał combo skupia działanie zarówno pre- jak i exit-sygnałów. Pozwala to na budowę zaawansowanych układów sygnałów.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Zamiana sygnałów{}Jeżeli włączone, kliknięcie na istniejący sygnał spowoduje zamianę jego typu na wybrany obok. CTRL-klik przełącza wygląd semafor/świetlny.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Gęstość sygnałów przy przeciąganiu. CTRL-przeciągnij aby wypełnić trasę sygnałami.
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Zmniejsz gęstość sygnałów przy przeciąganiu
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Zwiększ gęstość sygnałów przy przeciąganiu
+########
--- a/src/lang/portuguese.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/portuguese.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -160,7 +160,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Não é possível limpar esta área....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Copyright original {COPYRIGHT} 1995 Chris Sawyer, Todos os direitos reservados
 STR_00B7_VERSION                                                :{BLACK}OpenTTD versão {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 A equipa do OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 A equipa do OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK}  Tradutor(es) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Multi-jogador
 STR_SCENARIO_EDITOR                                             :{BLACK}Editor de Cenário
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Dim. do mapa:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Opções do Jogo
@@ -594,6 +588,9 @@
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Informações da empresa
 STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Abertura / Fecho de indústrias
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Alterações económicas
+STR_INDUSTRY_CHANGES_SERVED_BY_PLAYER                           :{YELLOW}Mudanças na produção das industrias servidas pelo jogador
+STR_INDUSTRY_CHANGES_SERVED_BY_OTHER                            :{YELLOW}Mudanças na produção das industrias servidas pelo(s) oponentes
+STR_OTHER_INDUSTRY_PRODUCTION_CHANGES                           :{YELLOW}Mudanças na produção de outras industrias
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Avisos / informações dos veículos do jogador
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Novos veículos
 STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Alterações de aceitação de carga
@@ -860,6 +857,7 @@
 
 STR_0314_FUND_NEW_INDUSTRY                                      :{WHITE}Financiar nova indústria
 STR_JUST_STRING                                                 :{STRING}
+STR_JUST_INT                                                    :{NUM}
 STR_0316_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...só se pode construir em cidades
 STR_0317_CAN_ONLY_BE_BUILT_IN_RAINFOREST                        :{WHITE}...só se pode construir em zonas de floresta
 STR_0318_CAN_ONLY_BE_BUILT_IN_DESERT                            :{WHITE}...só se pode construir em zonas de deserto
@@ -937,6 +935,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Ecrã Inteiro
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Seleccione esta opção para jogar o OpenTTD em modo de ecrã inteiro
+STR_FULLSCREEN_FAILED                                           :{WHITE}Modo de ecrã inteiro falhou
 
 STR_OPTIONS_RES                                                 :{BLACK}Resolução do ecrã
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1020,6 +1019,7 @@
 STR_CONFIG_PATCHES_ON                                           :Ligado
 STR_CONFIG_PATCHES_VEHICLESPEED                                 :{LTBLUE}Mostrar velocidade do veículo na barra de estado: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_BUILDONSLOPES                                :{LTBLUE}Permitir a construção em declives e encostas: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AUTOSLOPE                                    :{LTBLUE}Permitir formação de terra em construções, linhas, etc. (auto-declive): {ORANGE}{STRING}
 STR_CONFIG_PATCHES_CATCHMENT                                    :{LTBLUE}Dimensionamento mais realista de áreas de abrangência: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_EXTRADYNAMITE                                :{LTBLUE}Permitir remoção de mais estradas, pontes, etc: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAMMOTHTRAINS                                :{LTBLUE}Permitir a construção de comboios muito longos: {ORANGE}{STRING}
@@ -1046,6 +1046,8 @@
 STR_CONFIG_PATCHES_ROADVEH_QUEUE                                :{LTBLUE}Fila de veículos de estrada (com efeitos de quantidade): {ORANGE}{STRING}
 STR_CONFIG_PATCHES_AUTOSCROLL                                   :{LTBLUE}Deslocar janela quando o rato está na borda do mapa: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_BRIBE                                        :{LTBLUE}Permitir o suborno da autoridade local: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ALLOW_EXCLUSIVE                              :{LTBLUE}Permitir comprar exclusivo dos direitos de transportes: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ALLOW_GIVE_MONEY                             :{LTBLUE}Permitir enviar dinheiro para outras empresas: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_NONUNIFORM_STATIONS                          :{LTBLUE}Estações não uniformes: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_NEW_PATHFINDING_ALL                          :{LTBLUE}Nova procura de caminho global (NPF, substitui NTP): {ORANGE}{STRING}
 STR_CONFIG_PATCHES_FREIGHT_TRAINS                               :{LTBLUE}Multiplicador de peso para simular comboios pesados: {ORANGE}{STRING}
@@ -1104,6 +1106,7 @@
 STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Desligado
 STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Velocidade do scrollwheel no mapa: {ORANGE}{STRING}
 
+STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU                          :{LTBLUE}Emulação de clique de botão direito: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_COMMAND                  :Clique para comando
 STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_CONTROL                  :Clique para controlo
 STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_OFF                      :Desligado
@@ -1112,7 +1115,11 @@
 STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS                       :{LTBLUE}Usar a lista avançada de veículos: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OFF                   :Desligado
 STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OWN                   :Sua companhia
+STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_ALL                   :Todas as empresas
 STR_CONFIG_PATCHES_LOADING_INDICATORS                           :{LTBLUE}Usar indicadores de carga: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LOADING_INDICATORS_OFF                       :Desligado
+STR_CONFIG_PATCHES_LOADING_INDICATORS_OWN                       :Própria empresa
+STR_CONFIG_PATCHES_LOADING_INDICATORS_ALL                       :Todas as empresas
 STR_CONFIG_PATCHES_TIMETABLE_ALLOW                              :{LTBLUE}Activar plano de horários para veículos: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_TIMETABLE_IN_TICKS                           :{LTBLUE}Mostrar horário em tics em vez dias: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_DEFAULT_RAIL_TYPE                            :{LTBLUE}Tipo padrão de ferrovia (ao criar ou carregar jogo): {ORANGE}{STRING}
@@ -1157,6 +1164,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Permite comprar acções de outras companhias
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Ao arrastar colocar sinais a cada: {ORANGE}{STRING} quadrado(s)
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Construir automaticamente semáforos antes de: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Activar ferramenta de sinais: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}A disposição de cidade "sem mais estradas" não é válida no editor de cenários
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Seleccionar disposição das estradas na cidade: {ORANGE}{STRING}
@@ -1181,6 +1189,7 @@
 STR_CONFIG_PATCHES_LARGER_TOWNS                                 :{LTBLUE}Proporção de cidades que se tornarão metrópoles: {ORANGE}1 em {STRING}
 STR_CONFIG_PATCHES_LARGER_TOWNS_DISABLED                        :{LTBLUE}Proporção de cidades que se tornarão metrópoles: {ORANGE}Nenhuma
 STR_CONFIG_PATCHES_CITY_SIZE_MULTIPLIER                         :{LTBLUE}Multiplicador inicial para dimensão da cidade: {ORANGE}{STRING}
+STR_CONFIG_MODIFIED_ROAD_REBUILD                                :{LTBLUE}Remover partes absurdas durante a construção de estradas
 
 STR_CONFIG_PATCHES_GUI                                          :{BLACK}Interface
 STR_CONFIG_PATCHES_CONSTRUCTION                                 :{BLACK}Construção
@@ -1315,11 +1324,11 @@
 
 STR_INDUSTRY_TOO_CLOSE                                          :{WHITE}...muito perto de outra indústria
 
-STR_RAIL_REFIT_VEHICLE_TO_CARRY                                 :{BLACK}Adaptar comboio para um tipo de carga diferente
-STR_RAIL_REFIT_VEHICLE                                          :{BLACK}Adaptar comboio
+STR_RAIL_REFIT_VEHICLE_TO_CARRY                                 :{BLACK}Converter comboio para um tipo de carga diferente
+STR_RAIL_REFIT_VEHICLE                                          :{BLACK}Converter comboio
 STR_RAIL_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Seleccionar tipo de carga do comboio
-STR_RAIL_REFIT_TO_CARRY_HIGHLIGHTED                             :{BLACK}Adaptar comboio para transportar a carga seleccionada
-STR_RAIL_CAN_T_REFIT_VEHICLE                                    :{WHITE}Não é possível ajustar comboio...
+STR_RAIL_REFIT_TO_CARRY_HIGHLIGHTED                             :{BLACK}Converter comboio para transportar a carga seleccionada
+STR_RAIL_CAN_T_REFIT_VEHICLE                                    :{WHITE}Não é possível converter comboio...
 STR_CONFIG_PATCHES_SERVINT_ISPERCENT                            :{LTBLUE}Os intervalos de serviço são em percentagem: {ORANGE}{STRING}
 STR_CONFIG_GAME_PRODUCTION                                      :{WHITE}Modificar produção
 
@@ -1380,18 +1389,23 @@
 STR_NETWORK_PASSWORD_TIP                                        :{BLACK}Proteja o jogo com uma senha se não desejar que pessoas indesejadas se juntem
 STR_NETWORK_SELECT_MAP                                          :{BLACK}Seleccione um mapa:
 STR_NETWORK_SELECT_MAP_TIP                                      :{BLACK}Em que mapa deseja jogar?
+STR_NETWORK_LAN_INTERNET_COMBO                                  :{BLACK}{SKIP}{STRING}
 STR_NETWORK_LAN                                                 :Rede Local
 STR_NETWORK_INTERNET                                            :Internet
 STR_NETWORK_LAN_INTERNET                                        :Rede Local / Internet
 STR_NETWORK_INTERNET_ADVERTISE                                  :Internet (divulgar)
+STR_NETWORK_CLIENTS_SELECT                                      :{BLACK}{SKIP}{SKIP}{NUM} cliente{P "" s}
 STR_NETWORK_NUMBER_OF_CLIENTS                                   :{BLACK}Máximo de clientes:
 STR_NETWORK_NUMBER_OF_CLIENTS_TIP                               :{BLACK}Escolha o número máximo de clientes. Não necessitam estar todos presentes.
+STR_NETWORK_COMPANIES_SELECT                                    :{BLACK}{SKIP}{SKIP}{SKIP}{NUM} empresa{P "" s}
 STR_NETWORK_NUMBER_OF_COMPANIES                                 :{BLACK}Máximo de Companhias:
 STR_NETWORK_NUMBER_OF_COMPANIES_TIP                             :{BLACK}Limitar o servidor a um certo número de Companhias
+STR_NETWORK_SPECTATORS_SELECT                                   :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{NUM} espectador{P "" es}
 STR_NETWORK_NUMBER_OF_SPECTATORS                                :{BLACK}Máximo de espectadores:
 STR_NETWORK_NUMBER_OF_SPECTATORS_TIP                            :{BLACK}Limitar o servidor a um certo número de espectadores
 STR_NETWORK_LANGUAGE_SPOKEN                                     :{BLACK}Idioma falado:
 STR_NETWORK_LANGUAGE_TIP                                        :{BLACK}Outros jogadores ficarão a conhecer o idioma utilizado no servidor.
+STR_NETWORK_LANGUAGE_COMBO                                      :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
 STR_NETWORK_START_GAME                                          :{BLACK}Iniciar Jogo
 STR_NETWORK_START_GAME_TIP                                      :{BLACK}Iniciar um novo jogo em rede de um mapa aleatório, ou cenário
 STR_NETWORK_LOAD_GAME                                           :{BLACK}Abrir Jogo
@@ -1589,7 +1603,7 @@
 STR_1007_ALREADY_BUILT                                          :{WHITE}...já construído
 STR_1008_MUST_REMOVE_RAILROAD_TRACK                             :{WHITE}Deverá remover a linha férrea primeiro
 STR_100A_RAILROAD_CONSTRUCTION                                  :{WHITE}Construir caminhos-de-ferro
-STR_TITLE_ELRAIL_CONSTRUCTION                                   :{WHITE}Construir Via Férrea Electrificada
+STR_TITLE_ELRAIL_CONSTRUCTION                                   :{WHITE}Construir caminhos-de-ferro electrificados
 STR_100B_MONORAIL_CONSTRUCTION                                  :{WHITE}Construir monocarril
 STR_100C_MAGLEV_CONSTRUCTION                                    :{WHITE}Construir MagLev
 STR_100D_SELECT_RAIL_BRIDGE                                     :{WHITE}Seleccione Ponte Ferroviária
@@ -1601,7 +1615,7 @@
 STR_1013_CAN_T_REMOVE_SIGNALS_FROM                              :{WHITE}Não é possível remover sinais daqui...
 STR_1014_TRAIN_DEPOT_ORIENTATION                                :{WHITE}Orientação do Depósito
 STR_1015_RAILROAD_CONSTRUCTION                                  :Construir caminhos-de-ferro
-STR_TOOLB_ELRAIL_CONSTRUCTION                                   :Construir Via Férrea Electrificada
+STR_TOOLB_ELRAIL_CONSTRUCTION                                   :Construir caminhos-de-ferro electrificados
 STR_1016_MONORAIL_CONSTRUCTION                                  :Construir monocarril
 STR_1017_MAGLEV_CONSTRUCTION                                    :Construir MagLev
 STR_1018_BUILD_RAILROAD_TRACK                                   :{BLACK}Construir linha férrea
@@ -1652,7 +1666,9 @@
 STR_180A_ROAD_CONSTRUCTION                                      :Construir estradas
 STR_180A_TRAMWAY_CONSTRUCTION                                   :Construção de carris para eléctricos
 STR_180B_BUILD_ROAD_SECTION                                     :{BLACK}Construir estradas
+STR_BUILD_AUTOROAD_TIP                                          :{BLACK}Construir estradas usando o modo automático
 STR_180B_BUILD_TRAMWAY_SECTION                                  :{BLACK}Construir secção de carris para eléctricos
+STR_BUILD_AUTOTRAM_TIP                                          :{BLACK}Construir carris para eléctricos usando o modo automático
 STR_180C_BUILD_ROAD_VEHICLE_DEPOT                               :{BLACK}Construir depósito (para criação e manutenção de veículos de estrada)
 STR_180C_BUILD_TRAM_VEHICLE_DEPOT                               :{BLACK}Construir depósito de eléctricos (para construção e manutenção)
 STR_180D_BUILD_BUS_STATION                                      :{BLACK}Construir estação de autocarros
@@ -1663,6 +1679,7 @@
 STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}Construir ponte para eléctricos
 STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}Construir túnel de estrada
 STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}Construir túnel para eléctricos
+STR_TOGGLE_ONE_WAY_ROAD                                         :{BLACK}Activar/Desactivar estradas de sentido único
 STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Alternar entre construir/remover estradas
 STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}Alternar construir/remover linhas de eléctricos e sinais
 STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}Seleccionar a orientação do depósito
@@ -1684,6 +1701,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}O edifício deve ser demolido primeiro
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}População: {ORANGE}{COMMA}{BLACK}  Casas: {ORANGE}{COMMA}
@@ -2006,6 +2024,8 @@
 STR_5006_MUST_DEMOLISH_TUNNEL_FIRST                             :{WHITE}Deverá demolir o túnel primeiro
 STR_5007_MUST_DEMOLISH_BRIDGE_FIRST                             :{WHITE}Deverá demolir a ponte primeiro
 STR_5008_CANNOT_START_AND_END_ON                                :{WHITE}Não é posível iniciar e finalizar no mesmo ponto
+STR_BRIDGEHEADS_NOT_SAME_HEIGHT                                 :{WHITE}Extremos da ponte não estão ao mesmo nível
+STR_BRIDGE_TOO_LOW_FOR_TERRAIN                                  :{WHITE}Ponte muito baixa para o terreno
 STR_500A_START_AND_END_MUST_BE_IN                               :{WHITE}Inicio e fim devem estar alinhados
 STR_500B_SITE_UNSUITABLE_FOR_TUNNEL                             :{WHITE}O sítio não é adequado para a entrada do túnel
 STR_500D                                                        :{GOLD}{STRING},{} {VELOCITY} {WHITE}{CURRENCY}
@@ -2286,6 +2306,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Palavra passe
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Usar palavra passe na empresa para prevenir utilizadores não autorizados.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Definir palavra passe da empresa
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Não gravar a password introduzida
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Atribuir nova password à empresa
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Password da empresa
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Password pre-definida da empresa
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Usar a password desta empresa como pre-definida para novas empresas
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Retrocesso Mundial!{}{}Especialistas financeiros temem crise económica!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Fim do retrocesso!{}{}Melhoras no comércio inspiram confiança nas indústrias à medida que a economia se fortalece!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Alternar entre janela grande/pequena
@@ -2311,6 +2336,8 @@
 STR_LIVERY_PASSENGER_WAGON_STEAM                                :Carruagem de Passageiros (Vapor)
 STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Carruagem de Passageiros (Diesel)
 STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Carruagem de Passageiros (Eléctrica)
+STR_LIVERY_PASSENGER_WAGON_MONORAIL                             :Carruagem de Passageiros (Monocarril)
+STR_LIVERY_PASSENGER_WAGON_MAGLEV                               :Carruagem de Passageiros (Maglev)
 STR_LIVERY_FREIGHT_WAGON                                        :Vagão de Carga
 STR_LIVERY_BUS                                                  :Autocarro
 STR_LIVERY_TRUCK                                                :Veículo de Mercadorias
@@ -2765,6 +2792,8 @@
 STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{ENGINE}
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Novo {STRING} agora disponível! - {ENGINE}
 
+STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Não é possível vender um veículo destruido...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Não é possível converter um veículo destruido...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Impossível programar veículo...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Veículos apenas podem esperar em estações.
@@ -2982,10 +3011,10 @@
 STR_A03C_REFIT                                                  :{WHITE}{VEHICLE} (Adaptar)
 STR_A03D_REFIT_AIRCRAFT                                         :{BLACK}Adaptar aeronave
 STR_A03E_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Seleccionar tipo de carga da aeronave
-STR_A03F_REFIT_AIRCRAFT_TO_CARRY                                :{BLACK}Adaptar aeronave para transportar a carga seleccionada
+STR_A03F_REFIT_AIRCRAFT_TO_CARRY                                :{BLACK}Converter aeronave para transportar a carga seleccionada
 STR_A040_SELECT_CARGO_TYPE_TO_CARRY                             :{GOLD}Seleccionar tipo de carga:
-STR_A041_NEW_CAPACITY_COST_OF_REFIT                             :{BLACK}Nova capacidade: {GOLD}{STRING}{}{BLACK}Custo da adaptação: {GOLD}{CURRENCY}
-STR_A042_CAN_T_REFIT_AIRCRAFT                                   :{WHITE}Não é possível adaptar aeronave...
+STR_A041_NEW_CAPACITY_COST_OF_REFIT                             :{BLACK}Nova capacidade: {GOLD}{STRING}{}{BLACK}Custo da conversão: {GOLD}{CURRENCY}
+STR_A042_CAN_T_REFIT_AIRCRAFT                                   :{WHITE}Não é possível converter aeronave...
 STR_GO_TO_AIRPORT_HANGAR                                        :Ir para o hangar de {STATION}
 SERVICE_AT_AIRPORT_HANGAR                                       :Manutenção no hangar de {STATION}
 
@@ -3054,7 +3083,9 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Parâmetro inválido para {STRING}: parâmetro {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} deve ser carregado antes de {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} deve ser carregado antes de {STRING}.
+STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER                            :{STRING} necessita da versão {STRING} ou superior do OpenTTD.
 STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :O ficheiro GRF foi desenhado para traduzir
+STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED                        :Demasiados NewGRFs carregados.
 
 STR_NEWGRF_ADD                                                  :{BLACK}Adicionar
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Adicionar um ficheiro NewGRF à lista
@@ -3083,6 +3114,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}GRF(s) compatíveis carregados para ficheiros ausentes
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Ficheiro(s) GRF ausentes foram desactivados
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Falta(m) ficheiro(s) GRF para carregar jogo
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Ficheiro(s) GRF em falta
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Sair da pausa pode causar problemas ao OpenTTD. Não envie informações sobre este tipo de problemas.{}Deseja realmente sair da pausa?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Moeda Modificada
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Taxa de troca: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3207,6 +3240,12 @@
 STR_PURCHASE_INFO_ALL_BUT                                       :Todas menos {GOLD}
 STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Máx. Força de Tracção: {GOLD}{FORCE}
 
+########### For showing numbers in widgets
+
+STR_NUM_1                                                       :{BLACK}{SKIP}{NUM}
+STR_NUM_2                                                       :{BLACK}{SKIP}{SKIP}{NUM}
+STR_NUM_3                                                       :{BLACK}{SKIP}{SKIP}{SKIP}{NUM}
+
 ########### String for New Landscape Generator
 
 STR_GENERATE                                                    :{WHITE}Criar
@@ -3234,7 +3273,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Redimensionar muito o mapa não é recomendado. Continuar com a criação?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Aviso de disposição da cidade
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}A disposição de cidade "sem mais estradas" não é recomendado. Continuar a geração?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Nome mapa de alt.:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Tamanho: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}A gerar mundo...
@@ -3260,9 +3298,9 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Mover altura da terra plana um nível acima
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Mudar altura da terra plana
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Altura da terra plana:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centrar o mapa na posição actual
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
 
 ########### String for new airports
 STR_SMALL_AIRPORT                                               :{BLACK}Pequeno
@@ -3371,4 +3409,66 @@
 STR_INDUSTRY_SELECTION_HINT                                     :{BLACK}Escolha a indústria apropriada desta lista
 
 ############ Face formatting
+STR_FACE_ADVANCED                                               :{BLACK}Avançado
+STR_FACE_ADVANCED_TIP                                           :{BLACK}Selecção avançadade de cara
+STR_FACE_SIMPLE                                                 :{BLACK}Simples
+STR_FACE_SIMPLE_TIP                                             :{BLACK}Selecção simples de cara
+STR_FACE_LOAD                                                   :{BLACK}Carregar
+STR_FACE_LOAD_TIP                                               :{BLACK}Carregar cara preferida
+STR_FACE_LOAD_DONE                                              :{WHITE}A sua cara preferida foi carregada a partir do ficheiro de configuração do OpenTTD.
+STR_FACE_FACECODE                                               :{BLACK}Nº de cara
+STR_FACE_FACECODE_TIP                                           :{BLACK}Ver e/ou definir número de cara do jogador
+STR_FACE_FACECODE_CAPTION                                       :{WHITE}Ver e/ou definir número de cara do jogador
+STR_FACE_FACECODE_SET                                           :{WHITE}Novo número de código de cara foi definido
+STR_FACE_FACECODE_ERR                                           :{WHITE}Não foi possível definir o número de cara do jogador - deverá ser numérico entre 0 e 4,294,967,295!
+STR_FACE_SAVE                                                   :{BLACK}Gravar
+STR_FACE_SAVE_TIP                                               :{BLACK}Gravar cara preferida
+STR_FACE_SAVE_DONE                                              :{WHITE}Esta cara será gravada como a sua preferida no ficheiro de configuração do OpenTTD.
+STR_FACE_EUROPEAN                                               :{BLACK}Europeu
+STR_FACE_SELECT_EUROPEAN                                        :{BLACK}Seleccionar caras europeias
+STR_FACE_AFRICAN                                                :{BLACK}Africano
+STR_FACE_SELECT_AFRICAN                                         :{BLACK}Seleccionar caras africanas
+STR_FACE_YES                                                    :Sim
+STR_FACE_NO                                                     :Não
+STR_FACE_MOUSTACHE_EARRING_TIP                                  :{BLACK}Activar bigode ou brinco
+STR_FACE_HAIR                                                   :Cabelo:
+STR_FACE_HAIR_TIP                                               :{BLACK}Mudar cabelo
+STR_FACE_EYEBROWS                                               :Sobrancelhas:
+STR_FACE_EYEBROWS_TIP                                           :{BLACK}Mudar sobrancelhas
+STR_FACE_EYECOLOUR                                              :Cor dos olhos:
+STR_FACE_EYECOLOUR_TIP                                          :{BLACK}Mudar cor dos olhos
+STR_FACE_GLASSES                                                :Óculos:
+STR_FACE_GLASSES_TIP                                            :{BLACK}Activar óculos
+STR_FACE_GLASSES_TIP_2                                          :{BLACK}Mudar óculos
+STR_FACE_NOSE                                                   :Nariz:
+STR_FACE_NOSE_TIP                                               :{BLACK}Mudar nariz
+STR_FACE_LIPS                                                   :Lábios:
+STR_FACE_MOUSTACHE                                              :Bigode:
+STR_FACE_LIPS_MOUSTACHE_TIP                                     :{BLACK}Mudar lábios ou bigode
+STR_FACE_CHIN                                                   :Queixo:
+STR_FACE_CHIN_TIP                                               :{BLACK}Mudar queixo
+STR_FACE_JACKET                                                 :Casaco:
+STR_FACE_JACKET_TIP                                             :{BLACK}Mudar casaco
+STR_FACE_COLLAR                                                 :Colarinho:
+STR_FACE_COLLAR_TIP                                             :{BLACK}Mudar colarinho
+STR_FACE_TIE                                                    :Gravata:
+STR_FACE_EARRING                                                :Brinco:
+STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Mudar gravata ou brinco
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Selecção de Sinal
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Não é possível converter sinais aqui...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Sinal Normal (semáforo){}Os sinais são necessarios para evitar que os comboios choquem nas linhas ferroviárias com mais de um comboio.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Sinal de Entrada (semáforo){}Verde enquanto existir um ou mais sinais de saída verdes no seguimento da linha. De outro modo ficará vermelho.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Sinal de Saída (semáforo){}Funciona da mesma forma que o sinal normal mas é necessário para conseguir a cor correcta nos pre-sinais de entrada e combinado.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Sinal Combinado (semáforo){}O sinal combinado funciona como um sinal de entrada e de saída. Este permite construir grandes "árvores" de pre-sinais.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Sinal Normal(eléctrico){}Os sinais são necessarios para evitar que os comboios choquem nas linhas ferroviárias com mais de um comboio.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Sinal de Entrada (eléctrico){}Verde enquanto existir um ou mais sinais de saída verdes no seguimento da linha. De outro modo ficará vermelho.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Sinal de Saída (eléctrico){}Funciona da mesma forma que o sinal normal mas é necessário para conseguir a cor correcta nos pre-sinais de entrada e combinado.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Sinal Combinado (eléctrico){}O sinal combinado funciona como um sinal de entrada e de saída. Este permite construir grandes "árvores" de pre-sinais.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Converter Sinal{}Quando seleccionado, ao fazer clique em um sinal existente este será convertido no tipo e variante de sinal seleccionado, CTRL-clique irá comutar a variante existente.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Densidade de sinais
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Diminuir densidade de sinais
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Aumentar densidade de sinais
+########
--- a/src/lang/romanian.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/romanian.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -160,7 +160,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Nu pot curăţa terenul....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Copyright original {COPYRIGHT} 1995 Chris Sawyer, toate drepturile rezervate
 STR_00B7_VERSION                                                :{BLACK}OpenTTD versiunea {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 Echipa OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 Echipa OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK}  Translator(i) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Multiplayer
 STR_SCENARIO_EDITOR                                             :{BLACK}Editor harta
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Marime harta:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Optiuni
@@ -594,6 +588,9 @@
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Informatii despre companie
 STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Deschidere / inchidere industrii
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Schimbãri economice
+STR_INDUSTRY_CHANGES_SERVED_BY_PLAYER                           :{YELLOW}Schimbări de producţie la industrii partenere cu jucătorul
+STR_INDUSTRY_CHANGES_SERVED_BY_OTHER                            :{YELLOW}Schimbări de producţie la industrii partenere cu concurenţa
+STR_OTHER_INDUSTRY_PRODUCTION_CHANGES                           :{YELLOW}Alte schimbari in productia industriala
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Sfaturi/informatii despre vehiculele tale
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Vehicule noi
 STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Schimbãri ale acceptãrii mãrfurilor
@@ -938,6 +935,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Ecran intreg
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Bifeaza aceasta casuta pentru a juca in modul
+STR_FULLSCREEN_FAILED                                           :{WHITE}Comutarea in ecran-complet a esuat
 
 STR_OPTIONS_RES                                                 :{BLACK}Rezolutia ecranului
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1166,6 +1164,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Permite cumpararea de actiuni de la alte companii
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Plasare automată a semafoarelor la fiecare: {ORANGE}{STRING} pătrăţele
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Construieste automat semafaore înainte de: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Activare GUI pentru semnale: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Apectul de oras "fara alte drumuri" nu este valid in editorul de scenarii
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Alege aspect drum-de-oras: {ORANGE}{STRING}
@@ -1680,6 +1679,7 @@
 STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}Construieşte pod pentru tramvaie
 STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}Construieşte tunel rutier
 STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}Construieşte tunel pentru tramvaie
+STR_TOGGLE_ONE_WAY_ROAD                                         :{BLACK}Activare/Dezactivare sensuri unice
 STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}Comutator pentru construcţie/înlăturare şosele
 STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}Comuta constructie/stergere pentru constructia de linii de tramvaie
 STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}Alege orientarea autobazei
@@ -1701,6 +1701,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Mai întâi trebuie demolată clădirea
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}Populaţia: {ORANGE}{COMMA}{BLACK}  Locuinţe: {ORANGE}{COMMA}
@@ -2305,6 +2306,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Parola
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Protejeaza-ti compania cu o parola pentru a preveni accesul neautorizat.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Alege parola companiei
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Parola introdusă nu se va salva
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Schimbarea parolei pentru companie
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Parola pentru companie
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Parola implicită pentru companie
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Foloseste implicit parola acestei comanii pentru cele nou create
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Recesiune mondială!{}{}Experţii financiari se tem de ceea ce e mai rău odată cu prăbuşirea economică!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Recesiunea s-a încheiat!{}{}Creşterea comerţului dă încredere industriei, iar economia se redresează!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Comutator pentru mărimea ferestrei
@@ -2785,6 +2791,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Un nou {STRING} este acum disponibil!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Vehiculul distrus nu poate fi vandut...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Nu putem repara vehiculele distruse...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Nu pot programa vehiculul...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Vehiculele pot astepta numai in statii.
@@ -3076,6 +3083,7 @@
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} trebuie sa fie incarcat dupa {STRING}.
 STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER                            :{STRING} necesita OpenTTD versiunea {STRING} sau mai noua.
 STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :fisierul GRF conceput pentru traducere
+STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED                        :Prea multe NewGRF-uri încărcate.
 
 STR_NEWGRF_ADD                                                  :{BLACK}Adauga
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Adauga un fisier NewGRF in lista
@@ -3104,6 +3112,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Fisier(e) GRF compatibil(e) incarcate pentru fisierele lipsa
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Fisierele GRF lipsa au fost dezactivate
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Fisierele GRF lipsa pentru permiterea incarcarii jocului
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Fisier(e) GRF lipsa
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Reluarea jocului poate bloca OpenTTD. Nu raportati raporturi cu probleme pentru blocari succesive.{}Sigur doresti sa reiei jocul?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Monedă proprie
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Curs de schimb: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3160,7 +3170,7 @@
 
 STR_REPLACE_VEHICLES_WHITE                                      :{WHITE}Înlocuieste {STRING}
 STR_REPLACE_VEHICLES_START                                      :{BLACK}Incepere inlocuire vehicule
-STR_REPLACE_VEHICLES_STOP                                       :{BLACK}Oprire inlocuire vehicuke
+STR_REPLACE_VEHICLES_STOP                                       :{BLACK}Oprire inlocuire vehicule
 STR_NOT_REPLACING                                               :{BLACK}Neinlocuire
 STR_NOT_REPLACING_VEHICLE_SELECTED                              :{BLACK}Nici un vehicul selectat
 STR_REPLACE_HELP_LEFT_ARRAY                                     :{BLACK}Alege tipul de motor pentru inlocuire
@@ -3173,7 +3183,7 @@
 STR_REPLACE_REMOVE_WAGON                                        :{BLACK}Retragere vagoane: {ORANGE}{SKIP}{STRING}
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Fã optiunea de autoînlocuire sã pãstreze identicã lungimea unui tren prin eliminarea vagoanelor (începând din fatã), dacã înlocuirea motorului ar face trenul mai lung.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Înlocuire: {ORANGE}{SKIP}{SKIP}{STRING}
-STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} ELEMENT EXPERIMENTAL {}Comutã între ferestrele de ]nlocuire motoare si vagoane.{}Înlocuirea de vagoane va fi efectuatã numai dacã noul vagon poate transporta acelasi tip de încãrcãturã ca cel vechi. Aceast lucru este verificat pentru fiecare vagon atunci când este fãcutã înlocuirea efectivã.
+STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK} ELEMENT EXPERIMENTAL {}Comutã între ferestrele de înlocuire motoare si vagoane.{}Înlocuirea de vagoane va fi efectuatã numai dacã noul vagon poate transporta acelasi tip de încãrcãturã ca cel vechi. Aceast lucru este verificat pentru fiecare vagon atunci când este fãcutã înlocuirea efectivã.
 STR_RAIL_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vehiculul nu este disponibil
 STR_ROAD_VEHICLE_NOT_AVAILABLE                                  :{WHITE}Vehiculul nu este disponibil
 STR_SHIP_NOT_AVAILABLE                                          :{WHITE}Vasul nu este disponibil
@@ -3255,7 +3265,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Redimensionarea excesiva a hartii nu este recomandata. Continui cu generarea?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Avertisment aspect oras
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Aspectul de oras "fara alte drumuri" nu este recomanat. Continui generarea?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Nume harta inaltimi:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Dimensiune: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Generez lumea...
@@ -3281,9 +3290,9 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Muta in sus, cu o unitate, inaltimea terenului plan
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Modifica inaltimea terenului plan
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Inaltimea terenului plat:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centreaza harta mica la pozitia actuala
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
 
 ########### String for new airports
 STR_SMALL_AIRPORT                                               :{BLACK}Mic
@@ -3430,11 +3439,28 @@
 STR_FACE_LIPS_MOUSTACHE_TIP                                     :{BLACK}Schimba buzele sau mustata
 STR_FACE_CHIN                                                   :Barbie:
 STR_FACE_CHIN_TIP                                               :{BLACK}Schimba barbia
-STR_FACE_JACKET                                                 :Jacheta
-STR_FACE_JACKET_TIP                                             :{BLACK}Schimba jacheta
+STR_FACE_JACKET                                                 :Haină:
+STR_FACE_JACKET_TIP                                             :{BLACK}Schimbă haina
 STR_FACE_COLLAR                                                 :Guler:
-STR_FACE_COLLAR_TIP                                             :{BLACK}Schimba gulerul
+STR_FACE_COLLAR_TIP                                             :{BLACK}Schimbă gulerul
 STR_FACE_TIE                                                    :Cravata:
 STR_FACE_EARRING                                                :Cercei:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Schimba cravata sau cerceii
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Alegere Semnal
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Nu se pot transforma semnalele...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Semnal standard (semafor){}Semnalele sunt necesare pentru prevenirea deraierii trenurilor pe retele de cai ferate cu mai mult decat un tren.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Semnal de intrare (semafor){}Verde, atat timp cat exista unul sau mai multe semnale verzi de iesire din sectiunea urmatoare a caii ferate. Altfel indica rosu.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Semnal de iesire (semafor){}Se comporta in acelasi fel ca semnalul normal but este necesar pentru declansarea culorii corecte la intrari si presemnalizatoare combinate.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Semnal combinat (semafor){}Semnalul combinat se comporta atat ca semnal de intrare si iesire. Acest lucru permite constructiile "arborilor" mari de presemnalizare.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Semnal standard (electric){}Semnalele sunt necesare pentru prevenirea deraierii trenurilor pe retele de cai ferate cu mai mult decat un tren.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Semnal de intrare (electric){}Verde atat timp cat exista unul sau mai multe semnale de iesire in sectiunea urmatoare a caii ferate. Altfel indica rosu.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Semnal de iesire (electric){}Se comporta in acelasi fel ca semnalul normal, dar este necesar pentru declansarea culorii corecte la intrari si presemnalizatoare combinate.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Semnal combinat (electric){}Semnalul combinat se comporta atat ca semnalul de intrare si iesire. Acest lucru permite construirea "arborilor" mari de presemnalizare.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Conversie semnal{}Cand este selectat, click-ul pe un semafor existent il va converti in tipul si varianta aleasa de semnalizare, iar CTRL-click va comuta varianta existenta.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Densitate semnal tractare
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Scade densitatea semnalului de tractare
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Mareste densitatea semnalului de tractare
+########
--- a/src/lang/russian.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/russian.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -162,7 +162,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Невозможно расчистить...
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Оригинальные авторские права {COPYRIGHT} 1995 Chris Sawyer, Все права защищены
 STR_00B7_VERSION                                                :{BLACK}OpenTTD v{REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 Команда разработчиков OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 Команда разработчиков OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK}  Переводчики - Назаров Дмитрий (aka Smoky555), Олег Попков (aka Oleg)  - http://forums.ttdrussia.net
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -301,12 +301,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Сетевая игра
 STR_SCENARIO_EDITOR                                             :{BLACK}Редактор сценариев
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Размер карты:
 STR_BY                                                          :{BLACK}×
 STR_0148_GAME_OPTIONS                                           :{BLACK}Настройки игры
@@ -1171,6 +1165,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Разрешить торговлю акциями других компаний
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}При установке светофоров линией, ставить кажд{P 1 ую ые ые}: {ORANGE}{STRING} клет{P 1 ку ки ок}
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Строить семафоры старого стиля: {ORANGE}до {STRING} года
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Включить меню сигналов: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Расположение дорог "не строить дороги" не действительно в редакторе сценариев
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Расположение дорог у городов: {ORANGE}{STRING}
@@ -2116,7 +2111,7 @@
 STR_SV_STNAME_LOWER                                             :Нижняя {STRING}
 STR_SV_STNAME_HELIPORT                                          :Площадка {STRING}
 STR_SV_STNAME_FOREST                                            :Лес {STRING}
-STR_SV_STNAME_FALLBACK                                          :{STRING}-{NUM}
+STR_SV_STNAME_FALLBACK                                          :{STRING} Станция #{NUM}
 
 ############ end of savegame specific region!
 
@@ -2323,6 +2318,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Пароль
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Защитить вашу компанию паролем, чтобы неавторизованные пользователи не могли присоединиться
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Установить пароль компании
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Не сохранять пароль
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Задать новый пароль компании
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Пароль компании
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Пароль компании по умолчанию
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Использовать этот пароль компании по умолчанию для всех новых компаний
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Мировой спад{}{}Финансовые эксперты дают ужасные прогнозы в связи с кризисом экономики!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Спад закончился!{}{}Увеличение объемов торговли внушает уверенность владельцам предприятий. Экономика укрепляет свои позиции.
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Большое/маленькое окно
@@ -3123,6 +3123,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Вместо отсутствующих загружены совместимые файлы NewGRF
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Отсутствующие файлы NewGRF были отключены
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Не найдены файлы NewGRF, необходимые для загрузки игры
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Пропущенные GRF файлы
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Снятие с паузы может привести к ошибке OpenTTD.{}Вы хотите запустить игру?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Своя валюта
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Обменный курс: {ORANGE}{CURRENCY} = £{COMMA}
@@ -3247,6 +3249,9 @@
 STR_PURCHASE_INFO_ALL_BUT                                       :Все, кроме {GOLD}
 STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Макс. тяговое усилие: {GOLD}{FORCE}
 
+########### For showing numbers in widgets
+
+
 ########### String for New Landscape Generator
 
 STR_GENERATE                                                    :{WHITE}Создать
@@ -3274,7 +3279,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Увеличение карты до таких размеров не рекомендуется. Продолжить?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Предупреждение о расположении дорог
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Расположение дорог "не строить дороги" не рекомендуется. Продолжить создание карты?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Имя РЕЛЬЕФА:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Размер: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Создание мира...
@@ -3300,7 +3304,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Опустить уровень ровной земли на 1
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Изменить высоту ровной земли
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Высота над уровнем моря:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Центрировать миникарту по этой позиции
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3460,4 +3463,18 @@
 ########
 
 ############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Выбор сигналов
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Не могу преобразовать сигнал здесь...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Стандартный светофор (семофор){}Сигналы необходимы для предотвращения аварий поездов на путях.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Входной сигнал (семафор){}Горит зеленым, если хотя бы один из выходных сигналов зеленый на следующей секции путей. Во всех других случаях горит красным.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Выходной светофор (семафор).{} Работает как обычный светофор, но его значение (цвет) необходимы для нормальной работы входящих и комбинированных пресигналов.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Комбо-светофор (семафор){}Комбо-светофор работает как сдвоенный входной и выходной светофор. Это позволяет построить большую разветвленную сеть.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Стандартный светофор (электро){}Сигналы необходимы для предотвращения аварий поездов на путях.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Входной светофор (элетро){}Горит зеленым, если хотя бы один из выходных сигналов зеленый на следующей секции путей. Во всех других случаях горит красным.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Выходной светофор (электро){}Работает как обычный светофор, но его значение (цвет) необходимы для нормальной работы входящих и комбинированных пресигналов.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Комбо-светофор (электро){}Комбо-светофор работает как сдвоенный входной и выходной светофор. Это позволяет построить большую разветвленную сеть.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Изменение типа сигнала{}Когда кнопка нажата, щелкните для преобразования существующего сигнала в сигнал выбранного типа и варианта,  или щелкните с нажатым Ctrl для переборов существующих вариантов.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Плотность расстановки сигналов при протягивании.
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Уменьшить плотность сигналов при протягивании
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Увеличить плотность сигналов при протягивании
 ########
--- a/src/lang/simplified_chinese.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/simplified_chinese.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -160,7 +160,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}不能清除这个区域……
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}原始版权由 {COPYRIGHT} 1995 Chris Sawyer 所有,保留一切权力。
 STR_00B7_VERSION                                                :{BLACK}OpenTTD 版本 {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 The OpenTTD team
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 The OpenTTD team
 STR_TRANSLATED_BY                                               :{BLACK}简体中文翻译者:Fishingsnow@yjrg.net
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}多用户
 STR_SCENARIO_EDITOR                                             :{BLACK}场景编辑器
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}地图规模:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}游戏选项
@@ -3116,7 +3110,6 @@
 STR_START_DATE_QUERY_CAPT                                       :{WHITE}改变游戏开始的日期
 STR_HEIGHTMAP_SCALE_WARNING_CAPTION                             :{WHITE}缩放警告
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}不推荐将源图片过度放缩,是否继续生成?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}高度图名称:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}大小: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}正在生成地图……
@@ -3142,7 +3135,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}降低地面高度
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}改变地面的高度
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}地面高度:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}设置小地图的中心位置
 
--- a/src/lang/slovak.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/slovak.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -224,7 +224,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Oblast nie je možné vycistit ...
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Povodný copyright: {COPYRIGHT} 1995 Chris Sawyer, vsetky prava vyhradene
 STR_00B7_VERSION                                                :{BLACK}OpenTTD verzia {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 team OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 team OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK} Preklad - Lukas Lengyel & gpsoft
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -363,12 +363,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Viacero hrácov
 STR_SCENARIO_EDITOR                                             :{BLACK}Editor scenárov
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Velkost mapy:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Nastavenia hry
@@ -1005,6 +999,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Celá obrazovka
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Zaskrtnite, ak chcete hrat OpenTTD na celej obrazovke
+STR_FULLSCREEN_FAILED                                           :{WHITE}Zobrazovanie na celú obrazovku zlyhalo
 
 STR_OPTIONS_RES                                                 :{BLACK}Rozlíšenie obrazovky
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1233,6 +1228,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Povolit kupovanie podielov v ostatných spolocnostiach
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Pri stavbe tahaním umiestnit signály na každé: {ORANGE}{STRING}. pole
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Automaticky stavat semafóry namiesto signálov pred rokom: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Zapnút grafické rozhranie stavby signálov: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Struktúra mesta "žiadne cesty naviac" nie je platná v editore scenárov
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Struktúra mestských ciest: {ORANGE}{STRING}
@@ -2374,6 +2370,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Heslo
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Heslo-ochrana vasej spolocnosti proti neautorizovanemu pripojeniu hracov
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Nastavte heslo spolocnosti
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Neukladat zadané heslo
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Nastavit spolocnosti nové heslo
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Heslo spolocnosti
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Standardné heslo spolocnosti
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Použit toto heslo ako štandardné heslo spolocnosti
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Svetova kriza!{}{}Financni experti maju obavy z prepadu ekonomiky!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Koniec krizy!{}{}Ocakava sa vzostup predaja a posilnenie ekonomiky!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Prepnut velkost okna
@@ -2854,6 +2855,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Nové {STRING} dostupné!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Nie je možné predat znicené vozidlo ...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Nie je možné prestavat znicené vozidlo ...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Vozidlu nie je možné zadat cestovný poriadok ...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Vozidlá možu cakat len v staniciach.
@@ -3174,6 +3176,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Kompatibilné GRF použité namiesto chýbajúcich súborov
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Chýbajúce GRF súbory boli vypnuté
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Cýbajú GRF súbory potrebné pre nahratie hry
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Chýba(jú) GRF súbor(y)
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Odpauzovanie môže spôsobit pád OpenTTD. Nezaznamenávajte nasledujúce chyby.{}Naozaj chcete odpauzovat?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Vlastná mena
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Kurz meny: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3325,7 +3329,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Prilis velka zmena velkosti zdrojovej mapy sa neodporuca. Pokracovat s generovanim?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Upozornenie na štruktúra mesta
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Štruktúra mesta  "žiadne cesty naviac" sa neodporúca. Pokracovat s generovaním?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Nazov vyskovej mapy:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Velkost: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Generujem  krajinu ...
@@ -3351,7 +3354,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Zvysit vysku rovnej krajiny o jedno
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Zmenit vysku rovnej krajiny
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Vyska rovnej krajiny:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Vycentrovat malu mapu na aktualnu poziciu
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3509,3 +3511,20 @@
 STR_FACE_EARRING                                                :Náušnica:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Zmenit kravatu alebo náušnicu
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Výber signálu
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Nie je možné zmenit typ signálov ...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Standardný signál (semafór){}Signály sú nevyhnutné pre zabránenie zrážke v železnicnej sieti s viac ako 1 vlakom.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Vstupný signál (semafór){}Zelený ak je na danom úseku trate 1 alebo viac zelených výstupných signálov, inak je cervený.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Výstupný signál (semafór){}Funguje rovnako ako štandardný signál, avšak je nevyhnutný pre urcenie správnej farby na na vstupných a kombinovaných signáloch.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Kombinovaný signál (semafór){}Funguje jednoducho ako vstupný a výstupný signál zároven, co umožnuje budovat "stromové" štruktúry.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Standardný signál (elektrický){}Signály sú nevyhnutné pre zabránenie zrážke v železnicnej sieti s viac ako 1 vlakom.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Vstupný signál (elektrický){}Zelený ak je na danom úseku trate 1 alebo viac zelených výstupných signálov, inak je cervený.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Výstupný signál (elektrický){}Funguje rovnako ako štandardný signál, avšak je nevyhnutný pre urcenie správnej farby na na vstupných a kombinovaných signáloch.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Kombinovaný signál (elektrický){}Funguje jednoducho ako vstupný a výstupný signál zároven, co umožnuje budovat "stromové" štruktúry.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Konverzia signálu{}Pri vybraní, kliknutie na existujúci signál ho zmení na vybraný typ a variant, CTRL+klik prepne existujúci variant.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Hustota signálov pri stavbe tahaním
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Znižit hustotu signálov
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Zvýšit hustotu signálov
+########
--- a/src/lang/slovenian.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/slovenian.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -341,12 +341,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Več igralcev
 STR_SCENARIO_EDITOR                                             :{BLACK}Urejevalnik ozemlja
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Velikost ozemlja:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Možnosti
@@ -1211,6 +1205,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Dovoli kupovanje delnic od drugih podjetij
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Med vlečenjem postavi signale vsakih: {ORANGE}{STRING} ploščic
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Samodejno postavi semaforje pred: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Omogoči vmesnik signalov: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Mestna razporeditev "nič več cest" ni veljavna v urejevalniku terena
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Izberi razporeditev mestnih cest: {ORANGE}{STRING}
@@ -2390,6 +2385,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Geslo
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Zaščiti svoje podjetje z geslom, da preprečiš priključitev drugih uporabnikov k podjetju.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Nastavi geslo podjetja
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Ne shrani vnešenega gesla
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Dodeli družbi novo geslo
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Geslo družbe
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Privzeto geslo družbe
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Uporabi geslo te družbe kot privzeto za nove družbe
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Svetovna recesija!{}{}Ekonomisti se bojijo najhujšega ob trenutnem poteku dogodkov!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Konec recesije!{}{}Izboljšanje trgovanja povečuje zaupanje domače industrije, gospodarstvo napreduje!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Preklopi veliko/majhno velikost okna
@@ -2870,6 +2870,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Novo! {STRING} sedaj na razpolago!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Ni mogoča prodaja uničenega vozila...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Nemogoča predelava uničenega vozila...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Nemogoče določiti časa vozilu...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Vozila lahko čakajo le na postajah.
@@ -3190,6 +3191,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Kompatibilni GRF-ji so naloženi namesto manjkajočih datotek
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Manjkajoče GRF datoteke so bile onemogočene
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Manjkajoče datoteke GRF, ki omogočajo nalaganje igre
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Manjkajoče GRF datoteke
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Izklop pavze lahko sesuje OpenTTD. Ne poročaj o napaki zaradi takih problemov.{}Zagotovo želiš izklopiti pavzo?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Valuta po meri
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Menjalni tečaj: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3341,7 +3344,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Prevelika sprememba velikosti ozemlja ni priporočena. Nadaljujem?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Opozorilo mestne  razporeditve
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Mestna razporeditev "nič več cest" ni priporočena. Nadaljuješ z ustvarjanjem?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Ime višinskega zemljevida:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Velikost: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Ustvarjanje sveta...
@@ -3367,7 +3369,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Premik višine ravnega terena eno enoto višje
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Spremeni višino ravnega terena
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Višina ravnega terena:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centrira majhen zemljevid na trenutno točko
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3527,4 +3528,18 @@
 ########
 
 ############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Izbor signalov
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Nemogoča sprememba vrste signalov tukaj...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Standardni signal (semafor){}Signali so potrebni, da preprečijo vlaku trčenje na progi z več vlaki.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Vhodni signal (semafor){}Zelen v kolikor je vsaj en ali več  izhodnih signalov v nadaljevanju proge. Če ne, je rdeč.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Izhodni signal (semafor){}Deluje kot normalen semafor, le da mora biti povezan z ustreznim vhodnim ali kombiniranim signalom.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Kombinirani signal (semafor){}Kombinirani signal deluje kot vhodni in izhodni. To omogoča gradnjo velikih vej signalizacije.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Standardni signal (električni){}Signali so potrebni, da preprečijo vlaku trčenje na progi z več vlaki.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Vhodni signal (električni){}Zelen v kolikor je vsaj en ali več  izhodnih signalov v nadaljevanju proge. Če ne, je rdeč.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Izhodni signal (električni){}Deluje kot normalen semafor, le da mora biti povezan z ustreznim vhodnim ali kombiniranim signalom.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Kombinirani signal (električni){}Kombinirani signal deluje kot vhodni in izhodni. To omogoča gradnjo velikih vej signalizacije.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Zamenjava signala{}Ko je možnost izbrana, se ob kliku na obstoječi signal le ta spremeni v izbrano vrsto. CTRL-klik preklaplja obstoječo vrsto.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Gostota vlečnih signalov
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Zmanjšaj gostoto signala za vlečenje
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Povečaj gostoto signala za vlečenjeIncrease dragging signal density
 ########
--- a/src/lang/spanish.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/spanish.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -161,7 +161,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}No se puede desbrozar esta zona....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Copyright Original {COPYRIGHT} 1995 Chris Sawyer, Todos los derechos reservados
 STR_00B7_VERSION                                                :{BLACK}OpenTTD versión {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 El equipo OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 El equipo OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK}  Traductor(es) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -300,12 +300,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Multijugador
 STR_SCENARIO_EDITOR                                             :{BLACK}Editor de Escenario
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Tamaño del mapa:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Opciones de Juego
@@ -942,6 +936,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Pantalla completa
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Marca esta opción para jugar OpenTTD a pantalla completa
+STR_FULLSCREEN_FAILED                                           :{WHITE}El modo de pantalla completa ha fallado
 
 STR_OPTIONS_RES                                                 :{BLACK}Resolución de pantalla
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1170,6 +1165,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Permitir comprar acciones de otras empresas
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Cuando arrastre colocar señales cada: {ORANGE}{STRING} casilla(s)
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Coloca automáticamente semáforos antes de: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Activar la GUI de señales: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}El trazado de ciudad "no más carreteras" no es válido en el editor de escenarios
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Selecciona trazado de carretera en ciudad: {ORANGE}{STRING}
@@ -2311,6 +2307,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Contraseña
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Protege por contraseña tu empresa para prevenir que usuarios no autorizados se unan a ella.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Configurar contraseña de empresa
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}No grabar la contraseña introducida
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Asignar a la empresa una nueva contraseña
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Contraseña de la empresa
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Contraseña por defecto de la empresa
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Usa la contraseña de esta empresa para el resto de nuevas empresas
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}¡Recesión Mundial!{}{}¡Los expertos financieros son pesimistas mientras la economía se hunde!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}¡Fin de la Recesión!{}{}¡Mejora en el comercio da ánimos a las industrias mientras la economía se fortalece!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Cambiar entre tamaño de ventana grande/pequeño
@@ -2336,6 +2337,8 @@
 STR_LIVERY_PASSENGER_WAGON_STEAM                                :Vagón Pasajeros (Vapor)
 STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Vagón Pasajeros (Diesel)
 STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Vagón Pasajeros (Electrico)
+STR_LIVERY_PASSENGER_WAGON_MONORAIL                             :Vagón Pasajeros (Monorail)
+STR_LIVERY_PASSENGER_WAGON_MAGLEV                               :Vagón Pasajeros (Maglev)
 STR_LIVERY_FREIGHT_WAGON                                        :Vagón de Carga
 STR_LIVERY_BUS                                                  :Bus
 STR_LIVERY_TRUCK                                                :Camión
@@ -2791,6 +2794,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Nuevo {STRING} ahora disponible!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}No se puede vender un vehículo destruido...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}No se puede rellenar un vehículo destruido...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}No se puede ajustar horarios al vehículo...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Los vehículos solo pueden esperar en las estaciones.
@@ -3111,6 +3115,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}GRF(s) compatibles cargos para ficheros que faltan
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Fichero(s) GRF perdidos han sido desactivados
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Fichero(s) GRF para poder cargar el juego
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Fichero(s) GRF que faltan
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Quitar la pausa puede hacer que se cierre OpenTTD. No notifique este error.{}¿Desea realmente quitar la pausa?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Moneda personalizada
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Tasa de cambio: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3235,6 +3241,9 @@
 STR_PURCHASE_INFO_ALL_BUT                                       :Todo excepto {GOLD}
 STR_PURCHASE_INFO_MAX_TE                                        :{BLACK}Max. Esfuerzo de Tracción {GOLD}{FORCE}
 
+########### For showing numbers in widgets
+
+
 ########### String for New Landscape Generator
 
 STR_GENERATE                                                    :{WHITE}Generar
@@ -3262,7 +3271,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Cambiar demasiado el tamaño del mapa de origen no está recomendado. ¿Desea continuar con la generación?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Aviso de trazado de ciudad
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}El trazado de ciudad "no más carreteras" no es recomendable. ¿Continuar con la generación?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Nombre del mapa de alturas:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Tamaño: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Generando mundo...
@@ -3288,7 +3296,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Mueve la altura de la tierra llana uno arriba
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Cambia la altura de la tierra llana
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Altura tierra llana:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centrar el mapa pequeño a la posición actual
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3448,4 +3455,18 @@
 ########
 
 ############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Selección de Señales
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}No se pueden convertir las señales aquí...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Señales standard (semaforos){}Las señales son necesarias para evitar los choques de trenes en vías con más de un tren.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Señal de entrada (semáforo){}Verde si existe una o más señales de salida en el tramo en verde, de lo contrario estará en rojo
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Señal de salida (semáforo){}Se comporta de la misma manera que una señal normal, pero es necesario para activar el color correcto a la entrada y antes de la combinación de señales.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Señales combo (semáforos){}Las señales combo simplemente actúan como una señal de entrada y de salida. Esto permite construir grandes "árboles" de preseñales.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Señal normal (eléctrica){}Las señales son necesarias para evitar accidentes de trenes en vías con más de un tren.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Señal de entrada (eléctrica){}Verde si existe una o más señales verdes en el siguiente segmento de vía. Si no, mostrará el rojo.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Señal de salida (eléctrica){}Actua igual que una señal normal solo pero es necesaria para cambiar el color correcto en preseñales de entrada y combo.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Combo señal (eléctrica){}La señal combo actua como señal de entrada y salida. Esto permite construir grandes "árboles" de preseñales.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Convertir señal{}Cuando es seleccionado, pulsando sobre una señal existente la convertiremos a la variante indicada. Pulsa CTRL-click para cambiar de variante.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Arrastrar densidad de señales
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Decrementar arrastre de intensidad de señales
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Incrementar arrastre de intensidad de señales
 ########
--- a/src/lang/swedish.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/swedish.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -160,7 +160,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Kan inte röja området...
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Ursprunglig äganderätt {COPYRIGHT} 1995 Chris Sawyer, Alla rättigheter reserverade
 STR_00B7_VERSION                                                :{BLACK}OpenTTD version {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 OpenTTD-teamet
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 OpenTTD-teamet
 STR_TRANSLATED_BY                                               :{BLACK}  Översättare -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Flera spelare
 STR_SCENARIO_EDITOR                                             :{BLACK}Scenario editor
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Kartstorlek:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Spelinställningar
@@ -941,6 +935,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Helskärm
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Kryssa i den här rutan för att spela OpenTTD i helskärmsläge
+STR_FULLSCREEN_FAILED                                           :{WHITE}Fullskärmsläge misslyckades
 
 STR_OPTIONS_RES                                                 :{BLACK}Skärmupplösning
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1169,6 +1164,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Tillåt inköp av aktier från andra företag
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Vid utdragning av signaler, placera en signal var: {ORANGE}{STRING} ruta
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Bygg automatiskt semaforer innan: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Använd signal-GUI: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Det går ej att använda "inga fler vägar" i scenario editorn
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Välj stadens väg-inställningar: {ORANGE}{STRING}
@@ -1705,6 +1701,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Byggnad måste rivas först
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}Invånare: {ORANGE}{COMMA}{BLACK}  Hus: {ORANGE}{COMMA}
@@ -2309,6 +2306,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Lösenord
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Lösenordsskydda ditt företag för att förhindra att obehöriga spelare ansluter.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Ange företagets lösenord
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Spara inte det inmatade lösenordet
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Ge företaget det nya lösenordet
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Företagslösenord
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Förvalt företagslösenord
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Använd detta företagslösenord som förval för nya företag
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Lågkonjuktur!{}{}Finansexperter befarar det värsta när ekonomin sjunker!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Lågkonjuktur Över!{}{}Uppsving i byteshandeln ger tillförsikt till industrier när ekonomin stärks!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Växla stor/liten fönsterstorlek
@@ -2789,6 +2791,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Nya {STRING} är nu tillgänglig  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Kan inte sälja förstört fordon...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Kan inte bygga om ett förstörd fordon...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Kan inte lägga till fordonet i en tidtabell...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Fordon kan enbart vänta vid stationer.
@@ -3109,6 +3112,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Kompatibel GRF laddad för saknade filer
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Saknad GRF fil har stängts av
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Saknas GRF fil för att kunna ladda spel
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Saknad(e) GRF-fil(er)
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Avpausning kan krascha OpenTTD. Skicka ej igen bugg-rapport för möjlig krasch.{}Är du säker att du vill avpausa?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Egen valuta
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Växlingskurs: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3260,7 +3265,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}För stora storleksändringar av källkarta är inte rekomenderat. Fortsätt med generering?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Varning genererat från stadens väg-inställningar
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Det är ej rekommenderat att använda inställningen "inga fler vägar". Vill du fortsätta ändå?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Namn på höjdkarta:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Storlek: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Genererar värld...
@@ -3286,7 +3290,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Öka höjden av platt land ett upp
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Ändra höjd av platt land
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Höjd av platt land:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centrera den lilla kartan på den nuvarande positionen
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3444,3 +3447,20 @@
 STR_FACE_EARRING                                                :Örhänge:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Ändra slips eller örhänge
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Signalval
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Kan inte konvertera signaler här...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Standardsignal (semafor){}Signaler är nödvändiga för att tåg inte skall krasha i järnvägsnät innehållande mer än ett tåg.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}För-signal (semafor){}Grön så länge det finns en eller flera gröna utfarts-signaler på efterföljande bit av spår, annars visas rött.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Utfarts-signal (semafor){}Fungerar på samma sätt som en vanlig signal men behövs för att utlösa korrekt färg på In- eller kombinations-signaler.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Kombinationssignal (semafor){}Kombinationssignalen fungerar helt enkelt som både en För- och Utfarts-signal. Denna tillåter dig att bygga stora "träd" av För-signaler.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Normal signal (elektrisk){}Signaler behövs för att se till att tåg inte kraschar på nätverk med mer än ett tåg.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}För-signal (elektrisk){}Grön så länge det finns en eller flera gröna utfarts-signaler på efterföljande bit av spår, annars visas rött.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Utfarts-signal (elektrisk){}Fungerar på samma sätt som en vanlig signal men behövs för att utlösa korrekt färg på In- eller kombinations-signaler.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Kombinationssignal (elektrisk){}Kombinationssignalen fungerar helt enkelt som både en För- och Utfarts-signal. Denna tillåter dig att bygga stora "träd" av För-signaler.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Konvertera Signal{}När markerad, klicka på en existerande signal för att konvertera den till vald signal-typ och variant. CTRL-klick ändrar den existerande varianten
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Dragen signals täthet
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Minska dragen signals täthet
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Öka dragen signals täthet
+########
--- a/src/lang/traditional_chinese.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/traditional_chinese.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -160,7 +160,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}不能清除這個地段....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}原著作權為{COPYRIGHT} 1995 Chris Sawyer, 版權所有
 STR_00B7_VERSION                                                :{BLACK}OpenTTD 版本 {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 OpenTTD 小組
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 OpenTTD 小組
 STR_TRANSLATED_BY                                               :{BLACK}  翻譯 -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -213,7 +213,7 @@
 STR_00F4_500M                                                   :{BLACK}{TINYFONT}500米
 STR_00F5_TRAINS                                                 :{BLACK}{TINYFONT}列車
 STR_00F6_ROAD_VEHICLES                                          :{BLACK}{TINYFONT}公車/貨車
-STR_00F7_SHIPS                                                  :{BLACK}{TINYFONT}輪船
+STR_00F7_SHIPS                                                  :{BLACK}{TINYFONT}船隻
 STR_00F8_AIRCRAFT                                               :{BLACK}{TINYFONT}飛機
 STR_00F9_TRANSPORT_ROUTES                                       :{BLACK}{TINYFONT}運輸路線
 STR_00FA_COAL_MINE                                              :{BLACK}{TINYFONT}煤礦場
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}多人遊戲
 STR_SCENARIO_EDITOR                                             :{BLACK}場景編輯器
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}版圖大小:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}遊戲選項
@@ -312,7 +306,7 @@
 STR_0150_SOMEONE                                                :某人{SKIP}{SKIP}
 STR_0151_MAP_OF_WORLD                                           :世界地圖
 STR_0152_TOWN_DIRECTORY                                         :市鎮目錄
-STR_0153_SUBSIDIES                                              :補貼
+STR_0153_SUBSIDIES                                              :補助
 
 STR_UNITS_IMPERIAL                                              :英制
 STR_UNITS_METRIC                                                :公制
@@ -441,7 +435,7 @@
 STR_017A_DISPLAY_COMPANY_LEAGUE                                 :{BLACK}顯示公司排行榜
 STR_017B_DISPLAY_LIST_OF_COMPANY                                :{BLACK}顯示公司擁有的列車
 STR_017C_DISPLAY_LIST_OF_COMPANY                                :{BLACK}顯示公司擁有的公車/貨車
-STR_017D_DISPLAY_LIST_OF_COMPANY                                :{BLACK}顯示公司擁有的輪船
+STR_017D_DISPLAY_LIST_OF_COMPANY                                :{BLACK}顯示公司擁有的船隻
 STR_017E_DISPLAY_LIST_OF_COMPANY                                :{BLACK}顯示公司擁有的飛機
 STR_017F_ZOOM_THE_VIEW_IN                                       :{BLACK}拉近視域
 STR_0180_ZOOM_THE_VIEW_OUT                                      :{BLACK}拉遠視域
@@ -481,7 +475,7 @@
 
 STR_019C_ROAD_VEHICLE                                           :車輛
 STR_019D_AIRCRAFT                                               :飛機
-STR_019E_SHIP                                                   :船舶
+STR_019E_SHIP                                                   :船隻
 STR_019F_TRAIN                                                  :列車
 STR_01A0_IS_GETTING_OLD                                         :{WHITE}{STRING} {COMMA}使用年限將近
 STR_01A1_IS_GETTING_VERY_OLD                                    :{WHITE}{STRING} {COMMA}使用年限已過
@@ -1166,6 +1160,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}可以從對手購入股份
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}拖放時訊號燈之間距離:{ORANGE}{STRING} 格
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}於日期前自動建立舊式號誌臂:{ORANGE}{STRING}年
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}啟用號誌介面:{ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}在場景編輯器中,"市鎮道路不再規劃" 是不可行的
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}選擇市鎮道路規劃:{ORANGE}{STRING}
@@ -1680,6 +1675,7 @@
 STR_180F_BUILD_TRAMWAY_BRIDGE                                   :{BLACK}架設電車橋
 STR_1810_BUILD_ROAD_TUNNEL                                      :{BLACK}挖掘公路隧道
 STR_1810_BUILD_TRAMWAY_TUNNEL                                   :{BLACK}開鐅電車隧道
+STR_TOGGLE_ONE_WAY_ROAD                                         :{BLACK}切換單行道/雙向道
 STR_1811_TOGGLE_BUILD_REMOVE_FOR                                :{BLACK}切換鋪設/移除公路
 STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS                       :{BLACK}鋪設電車軌開關
 STR_1813_SELECT_ROAD_VEHICLE_DEPOT                              :{BLACK}選擇車庫方向
@@ -1701,6 +1697,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}必須先摧毀建物
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}人口:{ORANGE}{COMMA}{BLACK}  房屋:{ORANGE}{COMMA}
@@ -2305,6 +2302,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}密碼
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}以密碼保護您的公司,避免其他玩家隨意接手。
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}設定公司密碼
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}不要儲存輸入的密碼
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}為公司設定新的密碼
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}公司密碼
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}預設公司密碼
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}使用此密碼當作未來新公司的預設密碼
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}世界不景氣!{}{}財務專家對經濟蕭條做出最壞打算!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}景氣回升!{}{}湧現的訂單讓工業對經濟熱絡充滿信心!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}切換大/小視窗
@@ -3076,6 +3078,7 @@
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} 必須在 {STRING} 之後載入。
 STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER                            :{STRING} 需要 {STRING} 或更新的 OpenTTD 版本。
 STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :GRF 檔案翻譯後出現錯誤
+STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED                        :已載入太多的 NewGRF。
 
 STR_NEWGRF_ADD                                                  :{BLACK}新增
 STR_NEWGRF_ADD_TIP                                              :{BLACK}為清單加入新的 NewGRF 檔
@@ -3104,6 +3107,7 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}已為找不到的檔案載入相容 GRF 檔
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}找不到的 GRF 檔已被關閉
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}找不到載入遊戲所需的 GRF 檔案
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}一個或多個 GRF 檔案遺失
 
 STR_CURRENCY_WINDOW                                             :{WHITE}自訂幣值
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}匯率:{ORANGE}{CURRENCY} = £ {COMMA}
@@ -3255,7 +3259,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}不建議過度縮放地圖。繼續產生?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}市鎮規劃警告
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW} "市鎮道路不再規劃" 是不建議的。要繼續產生嗎?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}高度圖名稱:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}大小:{ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}正在產生世界...
@@ -3281,9 +3284,9 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}將平地高度上移一格
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}修改平地高度
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}平地高度:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}將小地圖移到目前地點位置
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
 
 ########### String for new airports
 STR_SMALL_AIRPORT                                               :{BLACK}小
@@ -3438,3 +3441,20 @@
 STR_FACE_EARRING                                                :耳飾:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}改變領帶或耳飾
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}號誌選擇
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}無法轉換這裡的號誌...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}標準號誌 (旗號){}當軌道網路中有多餘一列的列車時,為了避免發生相撞意外,號誌是必要的。
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}入口號誌 (旗號){}當綠燈亮時,代表此號誌後有一個以上的出口號誌呈現綠燈,否則將會是紅燈。
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}出口號誌 (旗號){}與一般號誌類似,但它還得負責切換前頭的入口號誌及組合號誌。
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}組合號誌 (旗號){}組合號誌同時具有入口/出口號誌特性。這可讓玩家設置一卡車的預告號誌。
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}標準號誌 (電氣){}當軌道網路中有多餘一列的列車時,為了避免發生相撞意外,號誌是必要的。
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}入口號誌 (電氣){}當綠燈亮時,代表此號誌後有一個以上的出口號誌呈現綠燈,否則將會是紅燈。
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}出口號誌 (電氣){}與一般號誌類似,但它還得負責切換前頭的入口號誌及組合號誌。
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}組合號誌 (電氣){}組合號誌同時具有入口/出口號誌特性。這可讓玩家設置一卡車的預告號誌。
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}號誌轉換{}當選取時,在現有的號誌上點選,將會轉換成面板上所選取的類型及樣式;若按住 CTRL 點選,只會變更樣式。
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}變更等距號誌拖曳間隔
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}減少 (拉近)
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}增加 (拉遠)
+########
--- a/src/lang/turkish.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/turkish.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -160,7 +160,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Burası temizlenemez....
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Orjinal kopyalama hakkı {COPYRIGHT} 1995 Chris Sawyer, Her Hakkı Saklıdır
 STR_00B7_VERSION                                                :{BLACK}OpenTTD sürüm {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 OpenTTD takımı
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 OpenTTD takımı
 STR_TRANSLATED_BY                                               :{BLACK}  Çevirenler -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -299,12 +299,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Çok Oyunculu
 STR_SCENARIO_EDITOR                                             :{BLACK}Senaryo Düzenleyici
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Harita boyutu:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Seçenekler
@@ -1168,6 +1162,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Diğer şirketlerin hisseleri alınabilsin
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Sürüklerken her: {ORANGE}{STRING} karede bir sinyal koy
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Bu tarihten önce ışık yerine semafor kullan: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Sinyal arayüzünü etkinleştir: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Senaryo düzenleyicisinde "yolsuz" şehir seçeneği kullanılamaz
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Şehir yol yerleşimini seç: {ORANGE}{STRING}
@@ -1704,6 +1699,7 @@
 STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
+STR_2002_WHITE                                                  :{TINYFONT}{WHITE}{SIGN}
 STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Önce bina yıkılmalı
 STR_2005                                                        :{WHITE}{TOWN}
 STR_2006_POPULATION                                             :{BLACK}Nüfus: {ORANGE}{COMMA}{BLACK}  Ev: {ORANGE}{COMMA}
@@ -2308,6 +2304,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Parola
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Başkalarınin girmemesi için parola koy.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Şirket parolası
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Girilen parolayı kaydetme
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Yeni parolayı şirkete ver
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Şirket parolası
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Öntanımlı şirket parolası
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Bu şirketin parolasını yeni şirketlerde öntanımlı olarak kullan
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Dünyada Kriz!{}{}Çok büyük bir ekonomik kriz yaşanacağı öngörüldü!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Kriz Atlatıldı!{}{}Ekonomi yine eski güzel günlerine döndü!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Pencere boyutunu büyült/küçült
@@ -3107,6 +3108,7 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Eksik dosyalar için uyumlu GRF(ler) yüklendi
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Eksik GRF dosyaları etkisizleştirildi
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Oyunu yüklemek için gerekli olan GRF dosyaları eksik
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Eksik GRF dosyası
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Özel Para Birimi
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Çarpan: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -3256,7 +3258,6 @@
 STR_START_DATE_QUERY_CAPT                                       :{WHITE}Başlangıç yılını değiştir
 STR_HEIGHTMAP_SCALE_WARNING_CAPTION                             :{WHITE}Ölcek uyarısı
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Kaynak haritanin boyutunu değiştirmek önerilmez. Harita oluşturmaya devam edilsin mi?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Yükseklik haritası adı:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Boyut: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Harita oluşturuluyor...
@@ -3282,9 +3283,9 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Düzlüğün yüksekliğini bir arttır
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Düzlüğün yüksekliğini değiştir
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Düzlüğün Yüksekliği:
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Küçük haritayı burada ortala
+STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
 
 ########### String for new airports
 STR_SMALL_AIRPORT                                               :{BLACK}Küçük
@@ -3400,19 +3401,47 @@
 STR_FACE_LOAD_TIP                                               :{BLACK}Tercih edilen yüzü yükle
 STR_FACE_LOAD_DONE                                              :{WHITE}Tercih edilen yüz OpenTTD ayar dosyasından yüklendi.
 STR_FACE_FACECODE                                               :{BLACK}Oyuncu yüzü no.
+STR_FACE_FACECODE_SET                                           :{WHITE}Surat numarası ayarlandı.
+STR_FACE_FACECODE_ERR                                           :{WHITE}Oyuncu surat numarası ayarlanamadı - 0 ve 4.294.967.295 arasında bir sayı olmalı!
 STR_FACE_SAVE                                                   :{BLACK}Kaydet
 STR_FACE_SAVE_TIP                                               :{BLACK}Tercih edilen yüzü kaydet
+STR_FACE_SAVE_DONE                                              :{WHITE}Bu surat OpenTTD ayar dosyasına kaydedilecek.
 STR_FACE_EUROPEAN                                               :{BLACK}Avrupalı
+STR_FACE_SELECT_EUROPEAN                                        :{BLACK}Beyaz yüz seç
 STR_FACE_AFRICAN                                                :{BLACK}Afrikalı
+STR_FACE_SELECT_AFRICAN                                         :{BLACK}Siyah yüz seç
 STR_FACE_YES                                                    :Evet
 STR_FACE_NO                                                     :Hayır
+STR_FACE_MOUSTACHE_EARRING_TIP                                  :{BLACK}Bıyık veya küpeyi etkinleştir
 STR_FACE_HAIR                                                   :Saç:
+STR_FACE_HAIR_TIP                                               :{BLACK}Saçı değiştir
 STR_FACE_EYEBROWS                                               :Kaşlar:
+STR_FACE_EYEBROWS_TIP                                           :{BLACK}Kaşları değiştir
 STR_FACE_EYECOLOUR                                              :Göz rengi:
+STR_FACE_EYECOLOUR_TIP                                          :{BLACK}Göz rengini değiştir
 STR_FACE_GLASSES                                                :Gözlük:
+STR_FACE_GLASSES_TIP                                            :{BLACK}Gözlüğü etkinleştir
+STR_FACE_GLASSES_TIP_2                                          :{BLACK}Gözlüğü değiştir
 STR_FACE_NOSE                                                   :Burun:
+STR_FACE_NOSE_TIP                                               :{BLACK}Burnu değiştir
 STR_FACE_LIPS                                                   :Dudak:
 STR_FACE_MOUSTACHE                                              :Bıyık:
+STR_FACE_LIPS_MOUSTACHE_TIP                                     :{BLACK}Dudakları veya bıyığı değiştir
 STR_FACE_CHIN                                                   :Çene:
+STR_FACE_CHIN_TIP                                               :{BLACK}Çeneyi değiştir
 STR_FACE_JACKET                                                 :Ceket:
+STR_FACE_JACKET_TIP                                             :{BLACK}Ceketi değiştir
+STR_FACE_COLLAR                                                 :Yaka:
+STR_FACE_COLLAR_TIP                                             :{BLACK}Yakayı değiştir
+STR_FACE_TIE                                                    :Kravat:
+STR_FACE_EARRING                                                :Küpe:
+STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Kravatı veya küpeyi değiştir
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Sinyal Seçimi
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Buradaki sinyaller dönüştürülemez...
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Sinyal sürükleme yoğunluğu
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Sinyal sürükleme yoğunluğunu azalt
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Sinyal sürükleme yoğunluğunu arttır
+########
--- a/src/lang/ukrainian.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/ukrainian.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -286,7 +286,7 @@
 STR_00B5_CAN_T_CLEAR_THIS_AREA                                  :{WHITE}Неможливо очистити цю ділянку...
 STR_00B6_ORIGINAL_COPYRIGHT                                     :{BLACK}Авторське право {COPYRIGHT} 1995 Кріс Сойєр, Всі права захищені
 STR_00B7_VERSION                                                :{BLACK}OpenTTD версія {REV}
-STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2007 команда OpenTTD
+STR_00BA_COPYRIGHT_OPENTTD                                      :{BLACK}OpenTTD {COPYRIGHT}2002-2008 команда OpenTTD
 STR_TRANSLATED_BY                                               :{BLACK} Перекладач(і) -
 
 STR_00C5                                                        :{BLACK}{CROSS}
@@ -425,12 +425,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Мережна гра
 STR_SCENARIO_EDITOR                                             :{BLACK}Редактор сценарію
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Розмір карти:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Налаштування гри
@@ -1067,6 +1061,7 @@
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}В повний екран
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Натисніть цю кнопку щоб грати в повний екран
+STR_FULLSCREEN_FAILED                                           :{WHITE}Повноекранний режим не працює
 
 STR_OPTIONS_RES                                                 :{BLACK}Роздільна здатність
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
@@ -1295,6 +1290,7 @@
 STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Можна купувати інші компанії
 STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}При протаскуванні сигнали ставляться через:{ORANGE}{STRING} клітки(ок)
 STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Автоматично будувати семафори до: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENABLE_SIGNAL_GUI                            :{LTBLUE}Використовувати графічний інтерфейс для сигналів: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID                          :{WHITE}Схема міста "не треба більше доріг" недійсна у редакторі сценаріїв
 STR_CONFIG_PATCHES_TOWN_LAYOUT                                  :{LTBLUE}Виберіть схему доріг у місті: {ORANGE}{STRING}
@@ -2473,6 +2469,11 @@
 STR_COMPANY_PASSWORD                                            :{BLACK}Пароль
 STR_COMPANY_PASSWORD_TOOLTIP                                    :{BLACK}Пароль захищає вашу компанію від приєднання інших гравців.
 STR_SET_COMPANY_PASSWORD                                        :{BLACK}Встановлення паролю
+STR_COMPANY_PASSWORD_CANCEL                                     :{BLACK}Не запам'ятовувати введений пароль
+STR_COMPANY_PASSWORD_OK                                         :{BLACK}Дати компанії новий пароль
+STR_COMPANY_PASSWORD_CAPTION                                    :{WHITE}Пароль компанії
+STR_MAKE_DEFAULT_COMPANY_PASSWORD                               :{BLACK}Пароль компанії за замовчуванням
+STR_MAKE_DEFAULT_COMPANY_PASSWORD_TIP                           :{BLACK}Використовувати цей пароль компанії за замовчуванням для нових компаній
 STR_7073_WORLD_RECESSION_FINANCIAL                              :{BIGFONT}{BLACK}Світова економічна криза!{}{}Фінансисти очікують спад виробництва та попиту!
 STR_7074_RECESSION_OVER_UPTURN_IN                               :{BIGFONT}{BLACK}Криза минула!{}{}Збільшення виробництва внаслідок стабілізації економіки надає впевненості підприємствам!
 STR_7075_TOGGLE_LARGE_SMALL_WINDOW                              :{BLACK}Розмір вікна великий/малий
@@ -2953,6 +2954,7 @@
 STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Став доступним новий {STRING}!  -  {ENGINE}
 
 STR_CAN_T_SELL_DESTROYED_VEHICLE                                :{WHITE}Не можна продати знищений транспорт...
+STR_CAN_T_REFIT_DESTROYED_VEHICLE                               :{WHITE}Не можна переобладнати знищений транспорт...
 
 STR_CAN_T_TIMETABLE_VEHICLE                                     :{WHITE}Не можна встановити розклад для транспорту...
 STR_TIMETABLE_ONLY_WAIT_AT_STATIONS                             :{WHITE}Транспорт може чекати тільки на станціях.
@@ -3273,6 +3275,8 @@
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Для відсутніх GRF-файлів завантажені сумісні
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Відсутні GRF-файли деактивовані
 STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Відсутні GRF-файли  для завантаження гри
+STR_NEWGRF_UNPAUSE_WARNING_TITLE                                :{YELLOW}Відсутній GRF файл(и)
+STR_NEWGRF_UNPAUSE_WARNING                                      :{WHITE}Зняття з паузи може привести до аварійної відмови OpenTTD. Не рапортуйте про наступні відмови.{}Ви дійсно хочете зняти з паузи?
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Вибір грошової одиниці
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Валютний курс: {ORANGE}{CURRENCY} = Ј {COMMA}
@@ -3424,7 +3428,6 @@
 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Розміри дуже великі. Продовжити генерацію?
 STR_TOWN_LAYOUT_WARNING_CAPTION                                 :{WHITE}Попередження про схему міста
 STR_TOWN_LAYOUT_WARNING_MESSAGE                                 :{YELLOW}Схема міста "не треба більше доріг" небажана. Продовжити генерацію?
-STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Ім'я рельєфа:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Розмір: {ORANGE}{NUM} x {NUM}
 STR_GENERATION_WORLD                                            :{WHITE}Генерація світу...
@@ -3450,7 +3453,6 @@
 STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Опустити рівень рівної землі на 1
 STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Змінити висоту рівня рівної землі
 STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Висота рівня моря
-STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Центрувати мінікарту сюди
 STR_SMALLMAP_INDUSTRY                                           :{TINYFONT}{STRING} ({NUM})
@@ -3608,3 +3610,20 @@
 STR_FACE_EARRING                                                :Сережки:
 STR_FACE_TIE_EARRING_TIP                                        :{BLACK}Змінити комір або сережки
 ########
+
+############ signal GUI
+STR_SIGNAL_SELECTION                                            :{WHITE}Вибір сигналів
+STR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                           :{WHITE}Не можна сконвертувати сигнали тут...
+STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP                             :{BLACK}Звичайний сигнал (семафор){}Сигнали необхідні для того, щоб уникнути зіткнень поїздів на залізницях, де більше одного поїзда.
+STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP                            :{BLACK}Вхідний сигнал (семафор){}Зелений, доки є один або більше зелених вихідних сигналів з наступної секції колії. Якщо нема - червоний.
+STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP                             :{BLACK}Вихідний сигнал (семафор){}Поводиться, як звичайний сигнал, але необхідний для нормальної роботи вхідного або комбінованого сигналів.
+STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP                            :{BLACK}Комбінований сигнал (семафор){}Комбінований сигнал працює як пара вхідний-вихідний сигнал. Це дозволяє будувати великі "дерева" сигналів.
+STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP                              :{BLACK}Звичайний сигнал (електричний){}Сигнали необхідні для того, щоб уникнути зіткнень поїздів на залізницях, де більше одного поїзда.
+STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP                             :{BLACK}Вхідний сигнал (електричний){}Зелений, доки є один або більше зелених вихідних сигналів з наступної секції колії. Якщо нема - червоний.
+STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP                              :{BLACK}Вихідний сигнал (електричний){}Поводиться, як звичайний сигнал, але необхідний для нормальної роботи вхідного або комбінованого сигналів.
+STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP                             :{BLACK}Комбінований сигнал (електричний){}Комбінований сигнал працює як пара вхідний-вихідний сигнал. Це дозволяє будувати великі "дерева" сигналів.
+STR_SIGNAL_CONVERT_TIP                                          :{BLACK}Заміна сигналів{}Якщо активна, натискання на існуючому сигналі замінить його на обраний тип сигналу, CTRL-натискання буде переключати існуючий варіант.
+STR_DRAG_SIGNALS_DENSITY_TIP                                    :{BLACK}Частота сигналів при перетаскуванні
+STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP                           :{BLACK}Зменшити частоту сигналів
+STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP                           :{BLACK}Збільшити частоту сигналів
+########
--- a/src/lang/unfinished/frisian.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/unfinished/frisian.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -231,12 +231,6 @@
 STR_0140_NEW_GAME                                               :{BLACK}Nei Spul
 STR_0141_LOAD_GAME                                              :{BLACK}Laad Spul
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_0148_GAME_OPTIONS                                           :{BLACK}Spul Opsjes
 
 STR_0150_SOMEONE                                                :immen{SKIP}{SKIP}
--- a/src/lang/unfinished/greek.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/unfinished/greek.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -298,12 +298,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Πολοί παίκτες
 STR_SCENARIO_EDITOR                                             :{BLACK}Διαμόρφωση Σεναρίου
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Διάσταση χάρτη:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Επιλογές Παιχνιδιού
--- a/src/lang/unfinished/latvian.txt	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/lang/unfinished/latvian.txt	Tue Jan 22 21:00:30 2008 +0000
@@ -301,12 +301,6 @@
 STR_MULTIPLAYER                                                 :{BLACK}Daudz-spe'le'ta'ju
 STR_SCENARIO_EDITOR                                             :{BLACK}Scenāriju redaktors
 
-STR_64                                                          :64
-STR_128                                                         :128
-STR_256                                                         :256
-STR_512                                                         :512
-STR_1024                                                        :1024
-STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Kartes izme'ri:
 STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Spe'les rez'i'mi
--- a/src/livery.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/livery.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,7 +5,7 @@
 #ifndef LIVERY_H
 #define LIVERY_H
 
-#include "helpers.hpp"
+#include "player_type.h"
 
 /* List of different livery schemes. */
 enum LiveryScheme {
@@ -23,6 +23,8 @@
 	LS_PASSENGER_WAGON_STEAM,
 	LS_PASSENGER_WAGON_DIESEL,
 	LS_PASSENGER_WAGON_ELECTRIC,
+	LS_PASSENGER_WAGON_MONORAIL,
+	LS_PASSENGER_WAGON_MAGLEV,
 	LS_FREIGHT_WAGON,
 
 	/* Road vehicles */
@@ -64,4 +66,11 @@
 	byte colour2; ///< Second colour, for vehicles with 2CC support.
 };
 
+/**
+ * Reset the livery schemes to the player's primary colour.
+ * This is used on loading games without livery information and on new player start up.
+ * @param p Player to reset.
+ */
+void ResetPlayerLivery(Player *p);
+
 #endif /* LIVERY_H */
--- a/src/macros.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/* $Id$ */
-
-/** @file macros.h */
-
-#ifndef MACROS_H
-#define MACROS_H
-
-#include "core/bitmath_func.hpp"
-#include "core/math_func.hpp"
-
-#define GENERAL_SPRITE_COLOR(color) ((color) + PALETTE_RECOLOR_START)
-#define PLAYER_SPRITE_COLOR(owner) (GENERAL_SPRITE_COLOR(_player_colors[owner]))
-
-/**
- * Whether a sprite comes from the original graphics files or a new grf file
- * (either supplied by OpenTTD or supplied by the user).
- *
- * @param sprite The sprite to check
- * @return True if it is a new sprite, or false if it is original.
- */
-#define IS_CUSTOM_SPRITE(sprite) ((sprite) >= SPR_SIGNALS_BASE)
-
-/**
- * Do an operation for each set set bit in a value.
- *
- * This macros is used to do an operation for each set
- * bit in a variable. The first variable can be reused
- * in the operation due to it's the bit position counter.
- * The second variable will be cleared during the usage
- *
- * @param i The position counter
- * @param b The value which we check for set bits
- */
-#define FOR_EACH_SET_BIT(i, b)            \
-	for (i = 0; b != 0; i++, b >>= 1) \
-		if (b & 1)
-
-
-static inline uint16 ReadLE16Aligned(const void* x)
-{
-	return FROM_LE16(*(const uint16*)x);
-}
-
-static inline uint16 ReadLE16Unaligned(const void* x)
-{
-#ifdef OTTD_ALIGNMENT
-	return ((const byte*)x)[0] | ((const byte*)x)[1] << 8;
-#else
-	return FROM_LE16(*(const uint16*)x);
-#endif
-}
-
-
-/** return the largest value that can be entered in a variable.
- */
-#define MAX_UVALUE(type) ((type)~(type)0)
-
-#endif /* MACROS_H */
--- a/src/main_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/main_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,54 +6,57 @@
 #include "openttd.h"
 #include "heightmap.h"
 #include "currency.h"
-#include "functions.h"
 #include "spritecache.h"
-#include "station.h"
-#include "strings.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "map.h"
-#include "tile.h"
-#include "window.h"
 #include "gui.h"
-#include "viewport.h"
-#include "gfx.h"
-#include "player.h"
-#include "road.h"
-#include "command.h"
+#include "window_gui.h"
+#include "window_func.h"
+#include "textbuf_gui.h"
+#include "viewport_func.h"
+#include "command_func.h"
 #include "news.h"
 #include "town.h"
-#include "vehicle.h"
 #include "console.h"
-#include "sound.h"
-#include "network/network.h"
 #include "signs.h"
 #include "waypoint.h"
 #include "variables.h"
 #include "train.h"
 #include "roadveh.h"
 #include "bridge_map.h"
-#include "unmovable_map.h"
-#include "string.h"
 #include "screenshot.h"
 #include "genworld.h"
-#include "settings.h"
-#include "date.h"
 #include "vehicle_gui.h"
 #include "transparency_gui.h"
 #include "newgrf_config.h"
+#include "rail_gui.h"
+#include "road_gui.h"
+#include "date_func.h"
+#include "functions.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "fios.h"
+#include "terraform_gui.h"
+#include "industry.h"
+#include "transparency.h"
+#include "strings_func.h"
+#include "zoom_func.h"
+#include "string_func.h"
+#include "player_base.h"
+#include "player_func.h"
+#include "player_gui.h"
+#include "settings_type.h"
 
+#include "network/network.h"
 #include "network/network_data.h"
 #include "network/network_client.h"
 #include "network/network_server.h"
 #include "network/network_gui.h"
-#include "industry.h"
-#include "transparency.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
 
 static int _rename_id = 1;
 static int _rename_what = -1;
 
-static byte _terraform_size = 1;
 RailType _last_built_railtype;
 RoadType _last_built_roadtype;
 static int _scengen_town_size = 1; // depress medium-sized towns per default
@@ -468,7 +471,7 @@
 
 	case WE_DESTROY: {
 			Window *v = FindWindowById(WC_MAIN_TOOLBAR, 0);
-			v->RaiseWidget(WP(w,menu_d).main_button);
+			v->RaiseWidget(WP(w, menu_d).main_button);
 			SetWindowDirty(v);
 			return;
 		}
@@ -480,11 +483,11 @@
 
 		if (index < 0) {
 			Window *w2 = FindWindowById(WC_MAIN_TOOLBAR,0);
-			if (GetWidgetFromPos(w2, e->we.popupmenu.pt.x - w2->left, e->we.popupmenu.pt.y - w2->top) == WP(w,menu_d).main_button)
-				index = WP(w,menu_d).sel_index;
+			if (GetWidgetFromPos(w2, e->we.popupmenu.pt.x - w2->left, e->we.popupmenu.pt.y - w2->top) == WP(w, menu_d).main_button)
+				index = WP(w, menu_d).sel_index;
 		}
 
-		action_id = WP(w,menu_d).action_id;
+		action_id = WP(w, menu_d).action_id;
 		DeleteWindow(w);
 
 		if (index >= 0) {
@@ -498,9 +501,9 @@
 	case WE_POPUPMENU_OVER: {
 		int index = GetMenuItemIndex(w, e->we.popupmenu.pt.x, e->we.popupmenu.pt.y);
 
-		if (index == -1 || index == WP(w,menu_d).sel_index) return;
+		if (index == -1 || index == WP(w, menu_d).sel_index) return;
 
-		WP(w,menu_d).sel_index = index;
+		WP(w, menu_d).sel_index = index;
 		SetWindowDirty(w);
 		return;
 		}
@@ -538,10 +541,10 @@
 	byte num = ActivePlayerCount();
 
 	/* Increase one to fit in PlayerList in the menu when in network */
-	if (_networking && WP(w,menu_d).main_button == 9) num++;
+	if (_networking && WP(w, menu_d).main_button == 9) num++;
 
-	if (WP(w,menu_d).item_count != num) {
-		WP(w,menu_d).item_count = num;
+	if (WP(w, menu_d).item_count != num) {
+		WP(w, menu_d).item_count = num;
 		SetWindowDirty(w);
 		num = num * 10 + 2;
 		w->height = num;
@@ -565,11 +568,11 @@
 
 		x = 1;
 		y = 1;
-		sel = WP(w,menu_d).sel_index;
-		chk = WP(w,menu_d).checked_items; // let this mean gray items.
+		sel = WP(w, menu_d).sel_index;
+		chk = WP(w, menu_d).checked_items; // let this mean gray items.
 
 		/* 9 = playerlist */
-		if (_networking && WP(w,menu_d).main_button == 9) {
+		if (_networking && WP(w, menu_d).main_button == 9) {
 			if (sel == 0) {
 				GfxFillRect(x, y, x + 238, y + 9, 0);
 			}
@@ -603,18 +606,18 @@
 
 	case WE_DESTROY: {
 		Window *v = FindWindowById(WC_MAIN_TOOLBAR, 0);
-		v->RaiseWidget(WP(w,menu_d).main_button);
+		v->RaiseWidget(WP(w, menu_d).main_button);
 		SetWindowDirty(v);
 		return;
 		}
 
 	case WE_POPUPMENU_SELECT: {
 		int index = GetMenuItemIndex(w, e->we.popupmenu.pt.x, e->we.popupmenu.pt.y);
-		int action_id = WP(w,menu_d).action_id;
+		int action_id = WP(w, menu_d).action_id;
 
 		/* We have a new entry at the top of the list of menu 9 when networking
 		 *  so keep that in count */
-		if (_networking && WP(w,menu_d).main_button == 9) {
+		if (_networking && WP(w, menu_d).main_button == 9) {
 			if (index > 0) index = GetPlayerIndexFromMenu(index - 1) + 1;
 		} else {
 			index = GetPlayerIndexFromMenu(index);
@@ -622,8 +625,8 @@
 
 		if (index < 0) {
 			Window *w2 = FindWindowById(WC_MAIN_TOOLBAR,0);
-			if (GetWidgetFromPos(w2, e->we.popupmenu.pt.x - w2->left, e->we.popupmenu.pt.y - w2->top) == WP(w,menu_d).main_button)
-				index = WP(w,menu_d).sel_index;
+			if (GetWidgetFromPos(w2, e->we.popupmenu.pt.x - w2->left, e->we.popupmenu.pt.y - w2->top) == WP(w, menu_d).main_button)
+				index = WP(w, menu_d).sel_index;
 		}
 
 		DeleteWindow(w);
@@ -641,15 +644,15 @@
 
 		/* We have a new entry at the top of the list of menu 9 when networking
 		 * so keep that in count */
-		if (_networking && WP(w,menu_d).main_button == 9) {
+		if (_networking && WP(w, menu_d).main_button == 9) {
 			if (index > 0) index = GetPlayerIndexFromMenu(index - 1) + 1;
 		} else {
 			index = GetPlayerIndexFromMenu(index);
 		}
 
-		if (index == -1 || index == WP(w,menu_d).sel_index) return;
+		if (index == -1 || index == WP(w, menu_d).sel_index) return;
 
-		WP(w,menu_d).sel_index = index;
+		WP(w, menu_d).sel_index = index;
 		SetWindowDirty(w);
 		return;
 		}
@@ -706,7 +709,7 @@
 
 	assert(disabled_mask == 0 || item_count <= 8);
 	w->LowerWidget(parent_button);
-	InvalidateWidget(w, parent_button);
+	w->InvalidateWidget(parent_button);
 
 	DeleteWindowById(WC_TOOLBAR_MENU, 0);
 
@@ -722,13 +725,13 @@
 	w->widget[0].bottom = item_count * 10 + 1;
 	w->flags4 &= ~WF_WHITE_BORDER_MASK;
 
-	WP(w,menu_d).item_count = item_count;
-	WP(w,menu_d).sel_index = 0;
-	WP(w,menu_d).main_button = GB(parent_button, 0, 8);
-	WP(w,menu_d).action_id = (GB(parent_button, 8, 8) != 0) ? GB(parent_button, 8, 8) : parent_button;
-	WP(w,menu_d).string_id = base_string;
-	WP(w,menu_d).checked_items = 0;
-	WP(w,menu_d).disabled_items = disabled_mask;
+	WP(w, menu_d).item_count = item_count;
+	WP(w, menu_d).sel_index = 0;
+	WP(w, menu_d).main_button = GB(parent_button, 0, 8);
+	WP(w, menu_d).action_id = (GB(parent_button, 8, 8) != 0) ? GB(parent_button, 8, 8) : parent_button;
+	WP(w, menu_d).string_id = base_string;
+	WP(w, menu_d).checked_items = 0;
+	WP(w, menu_d).disabled_items = disabled_mask;
 
 	_popup_menu_active = true;
 
@@ -741,25 +744,25 @@
 	int x = w->widget[main_button].left + w->left;
 
 	w->LowerWidget(main_button);
-	InvalidateWidget(w, main_button);
+	w->InvalidateWidget(main_button);
 
 	DeleteWindowById(WC_TOOLBAR_MENU, 0);
 	w = AllocateWindow(x, 0x16, 0xF1, 0x52, PlayerMenuWndProc, WC_TOOLBAR_MENU, _player_menu_widgets);
 	w->flags4 &= ~WF_WHITE_BORDER_MASK;
-	WP(w,menu_d).item_count = 0;
-	WP(w,menu_d).sel_index = (_local_player != PLAYER_SPECTATOR) ? _local_player : GetPlayerIndexFromMenu(0);
+	WP(w, menu_d).item_count = 0;
+	WP(w, menu_d).sel_index = (_local_player != PLAYER_SPECTATOR) ? _local_player : GetPlayerIndexFromMenu(0);
 	if (_networking && main_button == 9) {
 		if (_local_player != PLAYER_SPECTATOR) {
-			WP(w,menu_d).sel_index++;
+			WP(w, menu_d).sel_index++;
 		} else {
 			/* Select client list by default for spectators */
-			WP(w,menu_d).sel_index = 0;
+			WP(w, menu_d).sel_index = 0;
 		}
 	}
-	WP(w,menu_d).action_id = main_button;
-	WP(w,menu_d).main_button = main_button;
-	WP(w,menu_d).checked_items = gray;
-	WP(w,menu_d).disabled_items = 0;
+	WP(w, menu_d).action_id = main_button;
+	WP(w, menu_d).main_button = main_button;
+	WP(w, menu_d).checked_items = gray;
+	WP(w, menu_d).disabled_items = 0;
 	_popup_menu_active = true;
 	SndPlayFx(SND_15_BEEP);
 	return w;
@@ -872,23 +875,23 @@
 	switch (how) {
 		case ZOOM_IN:
 			if (vp->zoom == ZOOM_LVL_MIN) return false;
-			vp->zoom = (ZoomLevel)((byte)vp->zoom - 1);
+			vp->zoom = (ZoomLevel)((int)vp->zoom - 1);
 			vp->virtual_width >>= 1;
 			vp->virtual_height >>= 1;
 
-			WP(w,vp_d).scrollpos_x += vp->virtual_width >> 1;
-			WP(w,vp_d).scrollpos_y += vp->virtual_height >> 1;
-			WP(w,vp_d).dest_scrollpos_x = WP(w,vp_d).scrollpos_x;
-			WP(w,vp_d).dest_scrollpos_y = WP(w,vp_d).scrollpos_y;
+			WP(w, vp_d).scrollpos_x += vp->virtual_width >> 1;
+			WP(w, vp_d).scrollpos_y += vp->virtual_height >> 1;
+			WP(w, vp_d).dest_scrollpos_x = WP(w,vp_d).scrollpos_x;
+			WP(w, vp_d).dest_scrollpos_y = WP(w,vp_d).scrollpos_y;
 			break;
 		case ZOOM_OUT:
 			if (vp->zoom == ZOOM_LVL_MAX) return false;
-			vp->zoom = (ZoomLevel)((byte)vp->zoom + 1);
+			vp->zoom = (ZoomLevel)((int)vp->zoom + 1);
 
-			WP(w,vp_d).scrollpos_x -= vp->virtual_width >> 1;
-			WP(w,vp_d).scrollpos_y -= vp->virtual_height >> 1;
-			WP(w,vp_d).dest_scrollpos_x = WP(w,vp_d).scrollpos_x;
-			WP(w,vp_d).dest_scrollpos_y = WP(w,vp_d).scrollpos_y;
+			WP(w, vp_d).scrollpos_x -= vp->virtual_width >> 1;
+			WP(w, vp_d).scrollpos_y -= vp->virtual_height >> 1;
+			WP(w, vp_d).dest_scrollpos_x = WP(w,vp_d).scrollpos_x;
+			WP(w, vp_d).dest_scrollpos_y = WP(w,vp_d).scrollpos_y;
 
 			vp->virtual_width <<= 1;
 			vp->virtual_height <<= 1;
@@ -907,7 +910,7 @@
 static void ToolbarZoomInClick(Window *w)
 {
 	if (DoZoomInOutWindow(ZOOM_IN, FindWindowById(WC_MAIN_WINDOW, 0))) {
-		HandleButtonClick(w, 17);
+		w->HandleButtonClick(17);
 		SndPlayFx(SND_15_BEEP);
 	}
 }
@@ -915,7 +918,7 @@
 static void ToolbarZoomOutClick(Window *w)
 {
 	if (DoZoomInOutWindow(ZOOM_OUT,FindWindowById(WC_MAIN_WINDOW, 0))) {
-		HandleButtonClick(w, 18);
+		w->HandleButtonClick(18);
 		SndPlayFx(SND_15_BEEP);
 	}
 }
@@ -979,7 +982,7 @@
 	if (HasBit(_display_opt, DO_FULL_DETAIL))        SetBit(x, 11);
 	if (IsTransparencySet(TO_HOUSES) && IsTransparencySet(TO_TREES)) SetBit(x, 12);
 	if (IsTransparencySet(TO_SIGNS))                     SetBit(x, 13);
-	WP(w,menu_d).checked_items = x;
+	WP(w, menu_d).checked_items = x;
 }
 
 
@@ -992,7 +995,7 @@
 {
 	/* don't allow too fast scrolling */
 	if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
-		HandleButtonClick(w, 6);
+		w->HandleButtonClick(6);
 		SetWindowDirty(w);
 
 		_patches_newgame.starting_year = Clamp(_patches_newgame.starting_year - 1, MIN_YEAR, MAX_YEAR);
@@ -1005,7 +1008,7 @@
 {
 	/* don't allow too fast scrolling */
 	if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
-		HandleButtonClick(w, 7);
+		w->HandleButtonClick(7);
 		SetWindowDirty(w);
 
 		_patches_newgame.starting_year = Clamp(_patches_newgame.starting_year + 1, MIN_YEAR, MAX_YEAR);
@@ -1023,7 +1026,7 @@
 static void ToolbarScenZoomIn(Window *w)
 {
 	if (DoZoomInOutWindow(ZOOM_IN, FindWindowById(WC_MAIN_WINDOW, 0))) {
-		HandleButtonClick(w, 9);
+		w->HandleButtonClick(9);
 		SndPlayFx(SND_15_BEEP);
 	}
 }
@@ -1031,7 +1034,7 @@
 static void ToolbarScenZoomOut(Window *w)
 {
 	if (DoZoomInOutWindow(ZOOM_OUT, FindWindowById(WC_MAIN_WINDOW, 0))) {
-		HandleButtonClick(w, 10);
+		w->HandleButtonClick(10);
 		SndPlayFx(SND_15_BEEP);
 	}
 }
@@ -1058,362 +1061,12 @@
 	}
 }
 
-/**
- * Raise/Lower a bigger chunk of land at the same time in the editor. When
- * raising get the lowest point, when lowering the highest point, and set all
- * tiles in the selection to that height.
- * @todo : Incorporate into game itself to allow for ingame raising/lowering of
- *         larger chunks at the same time OR remove altogether, as we have 'level land' ?
- * @param tile The top-left tile where the terraforming will start
- * @param mode 1 for raising, 0 for lowering land
- */
-static void CommonRaiseLowerBigLand(TileIndex tile, int mode)
-{
-	int sizex, sizey;
-	uint h;
-
-	_generating_world = true; // used to create green terraformed land
-
-	if (_terraform_size == 1) {
-		StringID msg =
-			mode ? STR_0808_CAN_T_RAISE_LAND_HERE : STR_0809_CAN_T_LOWER_LAND_HERE;
-
-		DoCommandP(tile, SLOPE_N, (uint32)mode, CcTerraform, CMD_TERRAFORM_LAND | CMD_MSG(msg));
-	} else {
-		SndPlayTileFx(SND_1F_SPLAT, tile);
-
-		assert(_terraform_size != 0);
-		/* check out for map overflows */
-		sizex = min(MapSizeX() - TileX(tile) - 1, _terraform_size);
-		sizey = min(MapSizeY() - TileY(tile) - 1, _terraform_size);
-
-		if (sizex == 0 || sizey == 0) return;
-
-		if (mode != 0) {
-			/* Raise land */
-			h = 15; // XXX - max height
-			BEGIN_TILE_LOOP(tile2, sizex, sizey, tile) {
-				h = min(h, TileHeight(tile2));
-			} END_TILE_LOOP(tile2, sizex, sizey, tile)
-		} else {
-			/* Lower land */
-			h = 0;
-			BEGIN_TILE_LOOP(tile2, sizex, sizey, tile) {
-				h = max(h, TileHeight(tile2));
-			} END_TILE_LOOP(tile2, sizex, sizey, tile)
-		}
-
-		BEGIN_TILE_LOOP(tile2, sizex, sizey, tile) {
-			if (TileHeight(tile2) == h) {
-				DoCommandP(tile2, SLOPE_N, (uint32)mode, NULL, CMD_TERRAFORM_LAND);
-			}
-		} END_TILE_LOOP(tile2, sizex, sizey, tile)
-	}
-
-	_generating_world = false;
-}
-
-static void PlaceProc_RaiseBigLand(TileIndex tile)
-{
-	CommonRaiseLowerBigLand(tile, 1);
-}
-
-static void PlaceProc_LowerBigLand(TileIndex tile)
-{
-	CommonRaiseLowerBigLand(tile, 0);
-}
-
-static void PlaceProc_RockyArea(TileIndex tile)
-{
-	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_ROCKS);
-}
-
-static void PlaceProc_LightHouse(TileIndex tile)
-{
-	if (!IsTileType(tile, MP_CLEAR) || IsSteepSlope(GetTileSlope(tile, NULL)) || IsBridgeAbove(tile)) {
-		return;
-	}
-
-	MakeLighthouse(tile);
-	MarkTileDirtyByTile(tile);
-	SndPlayTileFx(SND_1F_SPLAT, tile);
-}
-
-static void PlaceProc_Transmitter(TileIndex tile)
-{
-	if (!IsTileType(tile, MP_CLEAR) || IsSteepSlope(GetTileSlope(tile, NULL)) || IsBridgeAbove(tile)) {
-		return;
-	}
-
-	MakeTransmitter(tile);
-	MarkTileDirtyByTile(tile);
-	SndPlayTileFx(SND_1F_SPLAT, tile);
-}
-
-static void PlaceProc_DesertArea(TileIndex tile)
-{
-	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_DESERT);
-}
-
-static void PlaceProc_WaterArea(TileIndex tile)
-{
-	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_WATER);
-}
-
-static const Widget _scen_edit_land_gen_widgets[] = {
-{  WWT_CLOSEBOX,   RESIZE_NONE,     7,     0,    10,     0,    13, STR_00C5,                  STR_018B_CLOSE_WINDOW},
-{   WWT_CAPTION,   RESIZE_NONE,     7,    11,   169,     0,    13, STR_0223_LAND_GENERATION,  STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_STICKYBOX,   RESIZE_NONE,     7,   170,   181,     0,    13, STR_NULL,                  STR_STICKY_BUTTON},
-{     WWT_PANEL,   RESIZE_NONE,     7,     0,   181,    14,   102, 0x0,                       STR_NULL},
-{    WWT_IMGBTN,   RESIZE_NONE,    14,     2,    23,    16,    37, SPR_IMG_DYNAMITE,          STR_018D_DEMOLISH_BUILDINGS_ETC},
-{    WWT_IMGBTN,   RESIZE_NONE,    14,    24,    45,    16,    37, SPR_IMG_TERRAFORM_DOWN,    STR_018E_LOWER_A_CORNER_OF_LAND},
-{    WWT_IMGBTN,   RESIZE_NONE,    14,    46,    67,    16,    37, SPR_IMG_TERRAFORM_UP,      STR_018F_RAISE_A_CORNER_OF_LAND},
-{    WWT_IMGBTN,   RESIZE_NONE,    14,    68,    89,    16,    37, SPR_IMG_LEVEL_LAND,        STR_LEVEL_LAND_TOOLTIP},
-{    WWT_IMGBTN,   RESIZE_NONE,    14,    90,   111,    16,    37, SPR_IMG_BUILD_CANAL,       STR_CREATE_LAKE},
-{    WWT_IMGBTN,   RESIZE_NONE,    14,   112,   134,    16,    37, SPR_IMG_ROCKS,             STR_028C_PLACE_ROCKY_AREAS_ON_LANDSCAPE},
-{    WWT_IMGBTN,   RESIZE_NONE,    14,   135,   157,    16,    37, SPR_IMG_LIGHTHOUSE_DESERT, STR_NULL}, // XXX - dynamic
-{    WWT_IMGBTN,   RESIZE_NONE,    14,   158,   179,    16,    37, SPR_IMG_TRANSMITTER,       STR_028E_PLACE_TRANSMITTER},
-{    WWT_IMGBTN,   RESIZE_NONE,    14,   139,   150,    45,    56, SPR_ARROW_UP,              STR_0228_INCREASE_SIZE_OF_LAND_AREA},
-{    WWT_IMGBTN,   RESIZE_NONE,    14,   139,   150,    58,    69, SPR_ARROW_DOWN,            STR_0229_DECREASE_SIZE_OF_LAND_AREA},
-{   WWT_TEXTBTN,   RESIZE_NONE,    14,    24,   157,    76,    87, STR_SE_NEW_WORLD,          STR_022A_GENERATE_RANDOM_LAND},
-{   WWT_TEXTBTN,   RESIZE_NONE,    14,    24,   157,    89,   100, STR_022B_RESET_LANDSCAPE,  STR_RESET_LANDSCAPE_TOOLTIP},
-{   WIDGETS_END},
-};
-
-static const int8 _multi_terraform_coords[][2] = {
-	{  0, -2},
-	{  4,  0}, { -4,  0}, {  0,  2},
-	{ -8,  2}, { -4,  4}, {  0,  6}, {  4,  4}, {  8,  2},
-	{-12,  0}, { -8, -2}, { -4, -4}, {  0, -6}, {  4, -4}, {  8, -2}, { 12,  0},
-	{-16,  2}, {-12,  4}, { -8,  6}, { -4,  8}, {  0, 10}, {  4,  8}, {  8,  6}, { 12,  4}, { 16,  2},
-	{-20,  0}, {-16, -2}, {-12, -4}, { -8, -6}, { -4, -8}, {  0,-10}, {  4, -8}, {  8, -6}, { 12, -4}, { 16, -2}, { 20,  0},
-	{-24,  2}, {-20,  4}, {-16,  6}, {-12,  8}, { -8, 10}, { -4, 12}, {  0, 14}, {  4, 12}, {  8, 10}, { 12,  8}, { 16,  6}, { 20,  4}, { 24,  2},
-	{-28,  0}, {-24, -2}, {-20, -4}, {-16, -6}, {-12, -8}, { -8,-10}, { -4,-12}, {  0,-14}, {  4,-12}, {  8,-10}, { 12, -8}, { 16, -6}, { 20, -4}, { 24, -2}, { 28,  0},
-};
-
-/**
- * @todo Merge with terraform_gui.cpp (move there) after I have cooled down at its braindeadness
- * and changed OnButtonClick to include the widget as well in the function declaration. Post 0.4.0 - Darkvater
- */
-static void EditorTerraformClick_Dynamite(Window *w)
-{
-	HandlePlacePushButton(w, 4, ANIMCURSOR_DEMOLISH, VHM_RECT, PlaceProc_DemolishArea);
-}
-
-static void EditorTerraformClick_LowerBigLand(Window *w)
-{
-	HandlePlacePushButton(w, 5, ANIMCURSOR_LOWERLAND, VHM_POINT, PlaceProc_LowerBigLand);
-}
-
-static void EditorTerraformClick_RaiseBigLand(Window *w)
-{
-	HandlePlacePushButton(w, 6, ANIMCURSOR_RAISELAND, VHM_POINT, PlaceProc_RaiseBigLand);
-}
-
-static void EditorTerraformClick_LevelLand(Window *w)
-{
-	HandlePlacePushButton(w, 7, SPR_CURSOR_LEVEL_LAND, VHM_POINT, PlaceProc_LevelLand);
-}
-
-static void EditorTerraformClick_WaterArea(Window *w)
-{
-	HandlePlacePushButton(w, 8, SPR_CURSOR_CANAL, VHM_RECT, PlaceProc_WaterArea);
-}
-
-static void EditorTerraformClick_RockyArea(Window *w)
-{
-	HandlePlacePushButton(w, 9, SPR_CURSOR_ROCKY_AREA, VHM_RECT, PlaceProc_RockyArea);
-}
-
-static void EditorTerraformClick_DesertLightHouse(Window *w)
-{
-	HandlePlacePushButton(w, 10, SPR_CURSOR_LIGHTHOUSE, VHM_RECT, (_opt.landscape == LT_TROPIC) ? PlaceProc_DesertArea : PlaceProc_LightHouse);
-}
-
-static void EditorTerraformClick_Transmitter(Window *w)
-{
-	HandlePlacePushButton(w, 11, SPR_CURSOR_TRANSMITTER, VHM_RECT, PlaceProc_Transmitter);
-}
-
-static const uint16 _editor_terraform_keycodes[] = {
-	'D',
-	'Q',
-	'W',
-	'E',
-	'R',
-	'T',
-	'Y',
-	'U'
-};
-
-typedef void OnButtonClick(Window *w);
-static OnButtonClick * const _editor_terraform_button_proc[] = {
-	EditorTerraformClick_Dynamite,
-	EditorTerraformClick_LowerBigLand,
-	EditorTerraformClick_RaiseBigLand,
-	EditorTerraformClick_LevelLand,
-	EditorTerraformClick_WaterArea,
-	EditorTerraformClick_RockyArea,
-	EditorTerraformClick_DesertLightHouse,
-	EditorTerraformClick_Transmitter
-};
-
-
-/** Callback function for the scenario editor 'reset landscape' confirmation window
- * @param w Window unused
- * @param confirmed boolean value, true when yes was clicked, false otherwise */
-static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed)
-{
-	if (confirmed) {
-		Player *p;
-
-		/* Set generating_world to true to get instant-green grass after removing
-		 * player property. */
-		_generating_world = true;
-		/* Delete all players */
-		FOR_ALL_PLAYERS(p) {
-			if (p->is_active) {
-				ChangeOwnershipOfPlayerItems(p->index, PLAYER_SPECTATOR);
-				p->is_active = false;
-			}
-		}
-		_generating_world = false;
-
-		/* Delete all stations owned by a player */
-		Station *st;
-		FOR_ALL_STATIONS(st) {
-			if (IsValidPlayer(st->owner)) delete st;
-		}
-	}
-}
-
-static void ScenEditLandGenWndProc(Window *w, WindowEvent *e)
-{
-	switch (e->event) {
-	case WE_CREATE:
-		/* XXX - lighthouse button is widget 10!! Don't forget when changing */
-		w->widget[10].tooltips = (_opt.landscape == LT_TROPIC) ? STR_028F_DEFINE_DESERT_AREA : STR_028D_PLACE_LIGHTHOUSE;
-		break;
-
-	case WE_PAINT:
-		DrawWindowWidgets(w);
-
-		{
-			int n = _terraform_size * _terraform_size;
-			const int8 *coords = &_multi_terraform_coords[0][0];
-
-			assert(n != 0);
-			do {
-				DrawSprite(SPR_WHITE_POINT, PAL_NONE, 77 + coords[0], 55 + coords[1]);
-				coords += 2;
-			} while (--n);
-		}
-
-		if (w->IsWidgetLowered(5) || w->IsWidgetLowered(6)) // change area-size if raise/lower corner is selected
-			SetTileSelectSize(_terraform_size, _terraform_size);
-
-		break;
-
-	case WE_KEYPRESS: {
-		uint i;
-
-		for (i = 0; i != lengthof(_editor_terraform_keycodes); i++) {
-			if (e->we.keypress.keycode == _editor_terraform_keycodes[i]) {
-				e->we.keypress.cont = false;
-				_editor_terraform_button_proc[i](w);
-				break;
-			}
-		}
-	} break;
-
-	case WE_CLICK:
-		switch (e->we.click.widget) {
-		case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11:
-			_editor_terraform_button_proc[e->we.click.widget - 4](w);
-			break;
-		case 12: case 13: { // Increase/Decrease terraform size
-			int size = (e->we.click.widget == 12) ? 1 : -1;
-			HandleButtonClick(w, e->we.click.widget);
-			size += _terraform_size;
-
-			if (!IsInsideMM(size, 1, 8 + 1)) return;
-			_terraform_size = size;
-
-			SndPlayFx(SND_15_BEEP);
-			SetWindowDirty(w);
-		} break;
-		case 14: // gen random land
-			HandleButtonClick(w, 14);
-			ShowCreateScenario();
-			break;
-		case 15: // Reset landscape
-			ShowQuery(
-			  STR_022C_RESET_LANDSCAPE,
-			  STR_RESET_LANDSCAPE_CONFIRMATION_TEXT,
-			  NULL,
-			  ResetLandscapeConfirmationCallback);
-			break;
-		}
-		break;
-
-	case WE_TIMEOUT: {
-		uint i;
-		for (i = 0; i < w->widget_count; i++) {
-			if (w->IsWidgetLowered(i)) {
-				w->RaiseWidget(i);
-				InvalidateWidget(w, i);
-			}
-			if (i == 3) i = 11;
-		}
-		break;
-	}
-	case WE_PLACE_OBJ:
-		_place_proc(e->we.place.tile);
-		break;
-	case WE_PLACE_DRAG:
-		VpSelectTilesWithMethod(e->we.place.pt.x, e->we.place.pt.y, e->we.place.select_method);
-		break;
-
-	case WE_PLACE_MOUSEUP:
-		if (e->we.place.pt.x != -1) {
-			switch (e->we.place.select_proc) {
-				case DDSP_CREATE_ROCKS:
-				case DDSP_CREATE_DESERT:
-				case DDSP_CREATE_WATER:
-				case DDSP_LEVEL_AREA:
-				case DDSP_DEMOLISH_AREA:
-					GUIPlaceProcDragXY(e);
-					break;
-			}
-		}
-		break;
-
-	case WE_ABORT_PLACE_OBJ:
-		RaiseWindowButtons(w);
-		SetWindowDirty(w);
-		break;
-	}
-}
-
-static const WindowDesc _scen_edit_land_gen_desc = {
-	WDP_AUTO, WDP_AUTO, 182, 103, 182, 103,
-	WC_SCEN_LAND_GEN, WC_NONE,
-	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
-	_scen_edit_land_gen_widgets,
-	ScenEditLandGenWndProc,
-};
-
-static inline void ShowEditorTerraformToolBar()
-{
-	AllocateWindowDescFront(&_scen_edit_land_gen_desc, 0);
-}
-
 static void ToolbarScenGenLand(Window *w)
 {
-	HandleButtonClick(w, 11);
+	w->HandleButtonClick(11);
 	SndPlayFx(SND_15_BEEP);
 
-	ShowEditorTerraformToolBar();
+	ShowEditorTerraformToolbar();
 }
 
 void CcBuildTown(bool success, TileIndex tile, uint32 p1, uint32 p2)
@@ -1469,7 +1122,7 @@
 			uint size = min(_scengen_town_size, (int)TSM_CITY);
 			TownSizeMode mode = _scengen_town_size > TSM_CITY ? TSM_CITY : TSM_FIXED;
 
-			HandleButtonClick(w, 5);
+			w->HandleButtonClick(5);
 			_generating_world = true;
 			t = CreateRandomTown(20, mode, size);
 			_generating_world = false;
@@ -1483,7 +1136,7 @@
 			break;
 		}
 		case 6: {// many random towns
-			HandleButtonClick(w, 6);
+			w->HandleButtonClick(6);
 
 			_generating_world = true;
 			if (!GenerateTowns()) ShowErrorMessage(STR_NO_SPACE_FOR_TOWN, STR_CANNOT_GENERATE_TOWN, 0, 0);
@@ -1509,7 +1162,7 @@
 		_place_proc(e->we.place.tile);
 		break;
 	case WE_ABORT_PLACE_OBJ:
-		RaiseWindowButtons(w);
+		w->RaiseButtons();
 		w->LowerWidget(_scengen_town_size + 7);
 		SetWindowDirty(w);
 		break;
@@ -1526,7 +1179,7 @@
 
 static void ToolbarScenGenTown(Window *w)
 {
-	HandleButtonClick(w, 12);
+	w->HandleButtonClick(12);
 	SndPlayFx(SND_15_BEEP);
 
 	AllocateWindowDescFront(&_scen_edit_town_gen_desc, 0);
@@ -1534,28 +1187,28 @@
 
 static void ToolbarScenGenIndustry(Window *w)
 {
-	HandleButtonClick(w, 13);
+	w->HandleButtonClick(13);
 	SndPlayFx(SND_15_BEEP);
 	ShowBuildIndustryWindow();
 }
 
 static void ToolbarScenBuildRoad(Window *w)
 {
-	HandleButtonClick(w, 14);
+	w->HandleButtonClick(14);
 	SndPlayFx(SND_15_BEEP);
 	ShowBuildRoadScenToolbar();
 }
 
 static void ToolbarScenPlantTrees(Window *w)
 {
-	HandleButtonClick(w, 15);
+	w->HandleButtonClick(15);
 	SndPlayFx(SND_15_BEEP);
 	ShowBuildTreesScenToolbar();
 }
 
 static void ToolbarScenPlaceSign(Window *w)
 {
-	HandleButtonClick(w, 16);
+	w->HandleButtonClick(16);
 	SndPlayFx(SND_15_BEEP);
 	SelectSignTool();
 }
@@ -1679,12 +1332,12 @@
 	case WE_MOUSELOOP:
 		if (w->IsWidgetLowered(0) != !!_pause_game) {
 			w->ToggleWidgetLoweredState(0);
-			InvalidateWidget(w, 0);
+			w->InvalidateWidget(0);
 		}
 
 		if (w->IsWidgetLowered(1) != !!_fast_forward) {
 			w->ToggleWidgetLoweredState(1);
-			InvalidateWidget(w, 1);
+			w->InvalidateWidget(1);
 		}
 		break;
 
@@ -1720,7 +1373,7 @@
 		for (i = 2; i < w->widget_count; i++) {
 			if (w->IsWidgetLowered(i)) {
 				w->RaiseWidget(i);
-				InvalidateWidget(w, i);
+				w->InvalidateWidget(i);
 			}
 		}
 		break;
@@ -1889,7 +1542,22 @@
 			case WKC_F11: PlaceLandBlockInfo(); break;
 			case WKC_CTRL | 'S': MenuClickSmallScreenshot(); break;
 			case WKC_CTRL | 'G': MenuClickWorldScreenshot(); break;
-			case 'L': ShowEditorTerraformToolBar(); break;
+
+			/* those following are all fall through */
+			case WKC_NUM_PLUS:
+			case WKC_EQUALS:
+			case WKC_SHIFT | WKC_EQUALS:
+			case WKC_SHIFT | WKC_F5: ToolbarZoomInClick(w); break;
+
+			/* those following are all fall through */
+			case WKC_NUM_MINUS:
+			case WKC_MINUS:
+			case WKC_SHIFT | WKC_MINUS:
+			case WKC_SHIFT | WKC_F6: ToolbarZoomOutClick(w); break;
+
+			case 'L': ShowEditorTerraformToolbar(); break;
+			case 'M': ShowSmallMap(); break;
+			case 'V': ShowExtraViewPortWindow(); break;
 			default: return;
 		}
 		e->we.keypress.cont = false;
@@ -2070,10 +1738,10 @@
 			DrawStringCenteredTruncated(w->widget[1].left + 1, w->widget[1].right - 1, 1, STR_032F_AUTOSAVE, TC_FROMSTRING);
 		} else if (_pause_game) {
 			DrawStringCenteredTruncated(w->widget[1].left + 1, w->widget[1].right - 1, 1, STR_0319_PAUSED, TC_FROMSTRING);
-		} else if (WP(w,def_d).data_1 > -1280 && FindWindowById(WC_NEWS_WINDOW,0) == NULL && _statusbar_news_item.string_id != 0) {
+		} else if (WP(w, def_d).data_1 > -1280 && FindWindowById(WC_NEWS_WINDOW,0) == NULL && _statusbar_news_item.string_id != 0) {
 			/* Draw the scrolling news text */
-			if (!DrawScrollingStatusText(&_statusbar_news_item, WP(w,def_d).data_1, w->widget[1].right - w->widget[1].left - 2)) {
-				WP(w,def_d).data_1 = -1280;
+			if (!DrawScrollingStatusText(&_statusbar_news_item, WP(w, def_d).data_1, w->widget[1].right - w->widget[1].left - 2)) {
+				WP(w, def_d).data_1 = -1280;
 				if (p != NULL) {
 					/* This is the default text */
 					SetDParam(0, p->index);
@@ -2109,14 +1777,14 @@
 
 		if (WP(w, def_d).data_1 > -1280) { // Scrolling text
 			WP(w, def_d).data_1 -= 2;
-			InvalidateWidget(w, 1);
+			w->InvalidateWidget(1);
 		}
 
 		if (WP(w, def_d).data_2 > 0) { // Red blot to show there are new unread newsmessages
 			WP(w, def_d).data_2 -= 2;
 		} else if (WP(w, def_d).data_2 < 0) {
 			WP(w, def_d).data_2 = 0;
-			InvalidateWidget(w, 1);
+			w->InvalidateWidget(1);
 		}
 
 		break;
@@ -2214,8 +1882,8 @@
 			case 'Z': {
 				Point pt = GetTileBelowCursor();
 				if (pt.x != -1) {
+					if (e->we.keypress.keycode == 'Z') MaxZoomInOut(ZOOM_IN, w);
 					ScrollMainWindowTo(pt.x, pt.y);
-					if (e->we.keypress.keycode == 'Z') MaxZoomInOut(ZOOM_IN, w);
 				}
 				break;
 			}
@@ -2387,7 +2055,7 @@
 	w = AllocateWindowDesc(&_main_status_desc);
 	CLRBITS(w->flags4, WF_WHITE_BORDER_MASK);
 
-	WP(w,def_d).data_1 = -1280;
+	WP(w, def_d).data_1 = -1280;
 }
 
 void GameSizeChanged()
@@ -2409,3 +2077,4 @@
 
 
 
+
--- a/src/map.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/map.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,13 +3,12 @@
 /** @file map.cpp */
 
 #include "stdafx.h"
-#include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "macros.h"
-#include "map.h"
-#include "direction.h"
-#include "helpers.hpp"
+#include "direction_func.h"
+#include "core/bitmath_func.hpp"
+#include "core/alloc_func.hpp"
+#include "core/math_func.hpp"
+#include "map_func.h"
 
 #if defined(_MSC_VER) && _MSC_VER >= 1400 /* VStudio 2005 is stupid! */
 /* Why the hell is that not in all MSVC headers?? */
@@ -52,14 +51,13 @@
 	free(_m);
 	free(_me);
 
-	_m = CallocT<Tile>(_map_size);
-	_me = CallocT<TileExtended>(_map_size);
-
 	/* XXX @todo handle memory shortage more gracefully
+	 * CallocT does the out-of-memory check
 	 * Maybe some attemps could be made to try with smaller maps down to 64x64
 	 * Maybe check for available memory before doing the calls, after all, we know how big
 	 * the map is */
-	if ((_m == NULL) || (_me == NULL)) error("Failed to allocate memory for the map");
+	_m = CallocT<Tile>(_map_size);
+	_me = CallocT<TileExtended>(_map_size);
 }
 
 
@@ -141,7 +139,7 @@
  * @param addy the amount of tiles in the Y direction to add
  * @return translated tile, or INVALID_TILE when it would've wrapped.
  */
-uint TileAddWrap(TileIndex tile, int addx, int addy)
+TileIndex TileAddWrap(TileIndex tile, int addx, int addy)
 {
 	uint x = TileX(tile) + addx;
 	uint y = TileY(tile) + addy;
--- a/src/map.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,428 +0,0 @@
-/* $Id$ */
-
-/** @file map.h */
-
-#ifndef MAP_H
-#define MAP_H
-
-#include "stdafx.h"
-#include "direction.h"
-
-extern uint _map_tile_mask;
-
-/**
- * 'Wraps' the given tile to it is within the map. It does
- * this by masking the 'high' bits of.
- * @param x the tile to 'wrap'
- */
-
-#define TILE_MASK(x) ((x) & _map_tile_mask)
-/**
- * Asserts when the tile is outside of the map.
- * @param x the tile to check
- */
-#define TILE_ASSERT(x) assert(TILE_MASK(x) == (x));
-
-/**
- * Data that is stored per tile. Also used TileExtended for this.
- * Look at docs/landscape.html for the exact meaning of the members.
- */
-struct Tile {
-	byte type_height; ///< The type (bits 4..7) and height of the northern corner
-	byte m1;   ///< Primarily used for ownership information
-	uint16 m2; ///< Primarily used for indices to towns, industries and stations
-	byte m3;   ///< General purpose
-	byte m4;   ///< General purpose
-	byte m5;   ///< General purpose
-	byte m6;   ///< Primarily used for bridges and rainforest/desert
-};
-
-/**
- * Data that is stored per tile. Also used Tile for this.
- * Look at docs/landscape.html for the exact meaning of the members.
- */
-struct TileExtended {
-	byte m7; ///< Primarily used for newgrf support
-};
-
-/**
- * Pointer to the tile-array.
- *
- * This variable points to the tile-array which contains the tiles of
- * the map.
- */
-extern Tile *_m;
-
-/**
- * Pointer to the extended tile-array.
- *
- * This variable points to the extended tile-array which contains the tiles
- * of the map.
- */
-extern TileExtended *_me;
-
-/**
- * Allocate a new map with the given size.
- */
-void AllocateMap(uint size_x, uint size_y);
-
-/**
- * Logarithm of the map size along the X side.
- * @note try to avoid using this one
- * @return 2^"return value" == MapSizeX()
- */
-static inline uint MapLogX()
-{
-	extern uint _map_log_x;
-	return _map_log_x;
-}
-
-/**
- * Get the size of the map along the X
- * @return the number of tiles along the X of the map
- */
-static inline uint MapSizeX()
-{
-	extern uint _map_size_x;
-	return _map_size_x;
-}
-
-/**
- * Get the size of the map along the Y
- * @return the number of tiles along the Y of the map
- */
-static inline uint MapSizeY()
-{
-	extern uint _map_size_y;
-	return _map_size_y;
-}
-
-/**
- * Get the size of the map
- * @return the number of tiles of the map
- */
-static inline uint MapSize()
-{
-	extern uint _map_size;
-	return _map_size;
-}
-
-/**
- * Gets the maximum X coordinate within the map, including MP_VOID
- * @return the maximum X coordinate
- */
-static inline uint MapMaxX()
-{
-	return MapSizeX() - 1;
-}
-
-/**
- * Gets the maximum X coordinate within the map, including MP_VOID
- * @return the maximum X coordinate
- */
-static inline uint MapMaxY()
-{
-	return MapSizeY() - 1;
-}
-
-/**
- * Scales relative to the number of tiles.
- */
-uint ScaleByMapSize(uint);
-
-/**
- * Scale relative to the circumference of the map.
- */
-uint ScaleByMapSize1D(uint);
-
-/**
- * The index/ID of a Tile.
- */
-typedef uint32 TileIndex;
-
-/**
- * An offset value between to tiles.
- *
- * This value is used fro the difference between
- * to tiles. It can be added to a tileindex to get
- * the resulting tileindex of the start tile applied
- * with this saved difference.
- *
- * @see TileDiffXY(int, int)
- */
-typedef int32 TileIndexDiff;
-
-/**
- * Returns the TileIndex of a coordinate.
- *
- * @param x The x coordinate of the tile
- * @param y The y coordinate of the tile
- * @return The TileIndex calculated by the coordinate
- */
-static inline TileIndex TileXY(uint x, uint y)
-{
-	return (y * MapSizeX()) + x;
-}
-
-/**
- * Calculates an offset for the given coordinate(-offset).
- *
- * This function calculate an offset value which can be added to an
- * #TileIndex. The coordinates can be negative.
- *
- * @param x The offset in x direction
- * @param y The offset in y direction
- * @return The resulting offset value of the given coordinate
- * @see ToTileIndexDiff(TileIndexDiffC)
- */
-static inline TileIndexDiff TileDiffXY(int x, int y)
-{
-	/* Multiplication gives much better optimization on MSVC than shifting.
-	 * 0 << shift isn't optimized to 0 properly.
-	 * Typically x and y are constants, and then this doesn't result
-	 * in any actual multiplication in the assembly code.. */
-	return (y * MapSizeX()) + x;
-}
-
-static inline TileIndex TileVirtXY(uint x, uint y)
-{
-	return (y >> 4 << MapLogX()) + (x >> 4);
-}
-
-
-enum {
-	INVALID_TILE = (TileIndex)-1 ///< The very nice invalid tile marker
-};
-
-enum {
-	TILE_SIZE   = 16,   ///< Tiles are 16x16 "units" in size
-	TILE_PIXELS = 32,   ///< a tile is 32x32 pixels
-	TILE_HEIGHT =  8,   ///< The standard height-difference between tiles on two levels is 8 (z-diff 8)
-};
-
-
-/**
- * Get the X component of a tile
- * @param tile the tile to get the X component of
- * @return the X component
- */
-static inline uint TileX(TileIndex tile)
-{
-	return tile & MapMaxX();
-}
-
-/**
- * Get the Y component of a tile
- * @param tile the tile to get the Y component of
- * @return the Y component
- */
-static inline uint TileY(TileIndex tile)
-{
-	return tile >> MapLogX();
-}
-
-/**
- * A pair-construct of a TileIndexDiff.
- *
- * This can be used to save the difference between to
- * tiles as a pair of x and y value.
- */
-struct TileIndexDiffC {
-	int16 x;        ///< The x value of the coordinate
-	int16 y;        ///< The y value of the coordinate
-};
-
-/**
- * Return the offset between to tiles from a TileIndexDiffC struct.
- *
- * This function works like #TileDiffXY(int, int) and returns the
- * difference between two tiles.
- *
- * @param tidc The coordinate of the offset as TileIndexDiffC
- * @return The difference between two tiles.
- * @see TileDiffXY(int, int)
- */
-static inline TileIndexDiff ToTileIndexDiff(TileIndexDiffC tidc)
-{
-	return (tidc.y << MapLogX()) + tidc.x;
-}
-
-
-#ifndef _DEBUG
-        /**
-         * Adds to tiles together.
-         *
-         * @param x One tile
-         * @param y An other tile to add
-         * @return The resulting tile(index)
-         */
-	#define TILE_ADD(x,y) ((x) + (y))
-#else
-	extern TileIndex TileAdd(TileIndex tile, TileIndexDiff add,
-		const char *exp, const char *file, int line);
-	#define TILE_ADD(x, y) (TileAdd((x), (y), #x " + " #y, __FILE__, __LINE__))
-#endif
-
-/**
- * Adds a given offset to a tile.
- *
- * @param tile The tile to add an offset on it
- * @param x The x offset to add to the tile
- * @param y The y offset to add to the tile
- */
-#define TILE_ADDXY(tile, x, y) TILE_ADD(tile, TileDiffXY(x, y))
-
-/**
- * Adds an offset to a tile and check if we are still on the map.
- */
-uint TileAddWrap(TileIndex tile, int addx, int addy);
-
-/**
- * Returns the TileIndexDiffC offset from a DiagDirection.
- *
- * @param dir The given direction
- * @return The offset as TileIndexDiffC value
- */
-static inline TileIndexDiffC TileIndexDiffCByDiagDir(DiagDirection dir)
-{
-	extern const TileIndexDiffC _tileoffs_by_diagdir[DIAGDIR_END];
-
-	assert(IsValidDiagDirection(dir));
-	return _tileoffs_by_diagdir[dir];
-}
-/**
- * Add a TileIndexDiffC to a TileIndex and returns the new one.
- *
- * Returns tile + the diff given in diff. If the result tile would end up
- * outside of the map, INVALID_TILE is returned instead.
- *
- * @param tile The base tile to add the offset on
- * @param diff The offset to add on the tile
- * @return The resulting TileIndex
- */
-static inline TileIndex AddTileIndexDiffCWrap(TileIndex tile, TileIndexDiffC diff)
-{
-	int x = TileX(tile) + diff.x;
-	int y = TileY(tile) + diff.y;
-	if (x < 0 || y < 0 || x > (int)MapMaxX() || y > (int)MapMaxY())
-		return INVALID_TILE;
-	else
-		return TileXY(x, y);
-}
-
-/**
- * Returns the diff between two tiles
- *
- * @param tile_a from tile
- * @param tile_b to tile
- * @return the difference between tila_a and tile_b
- */
-static inline TileIndexDiffC TileIndexToTileIndexDiffC(TileIndex tile_a, TileIndex tile_b)
-{
-	TileIndexDiffC difference;
-
-	difference.x = TileX(tile_a) - TileX(tile_b);
-	difference.y = TileY(tile_a) - TileY(tile_b);
-
-	return difference;
-}
-
-/* Functions to calculate distances */
-uint DistanceManhattan(TileIndex, TileIndex); ///< also known as L1-Norm. Is the shortest distance one could go over diagonal tracks (or roads)
-uint DistanceSquare(TileIndex, TileIndex); ///< euclidian- or L2-Norm squared
-uint DistanceMax(TileIndex, TileIndex); ///< also known as L-Infinity-Norm
-uint DistanceMaxPlusManhattan(TileIndex, TileIndex); ///< Max + Manhattan
-uint DistanceFromEdge(TileIndex); ///< shortest distance from any edge of the map
-
-/**
- * Starts a loop which iterates to a square of tiles
- *
- * This macro starts 2 nested loops which iterates over a square of tiles.
- *
- * @param var The name of the variable which contains the current tile
- * @param w The width (x-width) of the square
- * @param h The heigth (y-width) of the square
- * @param tile The start tile of the square
- */
-#define BEGIN_TILE_LOOP(var, w, h, tile)                      \
-	{                                                        \
-		int h_cur = h;                                         \
-		uint var = tile;                                       \
-		do {                                                   \
-			int w_cur = w;                                       \
-			do {
-/**
- * Ends the square-loop used before
- *
- * @see BEGIN_TILE_LOOP
- */
-#define END_TILE_LOOP(var, w, h, tile)                        \
-			} while (++var, --w_cur != 0);                       \
-		} while (var += TileDiffXY(0, 1) - (w), --h_cur != 0); \
-	}
-/**
- * Convert a DiagDirection to a TileIndexDiff
- *
- * @param dir The DiagDirection
- * @return The resulting TileIndexDiff
- * @see TileIndexDiffCByDiagDir
- */
-static inline TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
-{
-	extern const TileIndexDiffC _tileoffs_by_diagdir[DIAGDIR_END];
-
-	assert(IsValidDiagDirection(dir));
-	return ToTileIndexDiff(_tileoffs_by_diagdir[dir]);
-}
-
-/**
- * Convert a Direction to a TileIndexDiff.
- *
- * @param dir The direction to convert from
- * @return The resulting TileIndexDiff
- */
-static inline TileIndexDiff TileOffsByDir(Direction dir)
-{
-	extern const TileIndexDiffC _tileoffs_by_dir[DIR_END];
-
-	assert(IsValidDirection(dir));
-	return ToTileIndexDiff(_tileoffs_by_dir[dir]);
-}
-
-/**
- * Adds a DiagDir to a tile.
- *
- * @param tile The current tile
- * @param dir The direction in which we want to step
- * @return the moved tile
- */
-static inline TileIndex TileAddByDiagDir(TileIndex tile, DiagDirection dir)
-{
-	return TILE_ADD(tile, TileOffsByDiagDir(dir));
-}
-
-/**
- * A callback function type for searching tiles.
- *
- * @param tile The tile to test
- * @param data additional data for the callback function to use
- * @return A boolean value, depend on the definition of the function.
- */
-typedef bool TestTileOnSearchProc(TileIndex tile, uint32 data);
-
-/**
- * Searches for some cirumstances of a tile around a given tile with a helper function.
- */
-bool CircularTileSearch(TileIndex tile, uint size, TestTileOnSearchProc proc, uint32 data);
-
-/** Approximation of the length of a straight track, relative to a diagonal
- * track (ie the size of a tile side).
- *
- * #defined instead of const so it can
- * stay integer. (no runtime float operations) Is this needed?
- * Watch out! There are _no_ brackets around here, to prevent intermediate
- * rounding! Be careful when using this!
- * This value should be sqrt(2)/2 ~ 0.7071 */
-#define STRAIGHT_TRACK_LENGTH 7071/10000
-
-#endif /* MAP_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/map_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,403 @@
+/* $Id$ */
+
+/** @file map_func.h */
+
+#ifndef MAP_FUNC_H
+#define MAP_FUNC_H
+
+#include "tile_type.h"
+#include "map_type.h"
+#include "direction_func.h"
+
+extern uint _map_tile_mask;
+
+/**
+ * 'Wraps' the given tile to it is within the map. It does
+ * this by masking the 'high' bits of.
+ * @param x the tile to 'wrap'
+ */
+
+#define TILE_MASK(x) ((x) & _map_tile_mask)
+/**
+ * Asserts when the tile is outside of the map.
+ * @param x the tile to check
+ */
+#define TILE_ASSERT(x) assert(TILE_MASK(x) == (x));
+
+/**
+ * Pointer to the tile-array.
+ *
+ * This variable points to the tile-array which contains the tiles of
+ * the map.
+ */
+extern Tile *_m;
+
+/**
+ * Pointer to the extended tile-array.
+ *
+ * This variable points to the extended tile-array which contains the tiles
+ * of the map.
+ */
+extern TileExtended *_me;
+
+/**
+ * Allocate a new map with the given size.
+ */
+void AllocateMap(uint size_x, uint size_y);
+
+/**
+ * Logarithm of the map size along the X side.
+ * @note try to avoid using this one
+ * @return 2^"return value" == MapSizeX()
+ */
+static inline uint MapLogX()
+{
+	extern uint _map_log_x;
+	return _map_log_x;
+}
+
+/**
+ * Get the size of the map along the X
+ * @return the number of tiles along the X of the map
+ */
+static inline uint MapSizeX()
+{
+	extern uint _map_size_x;
+	return _map_size_x;
+}
+
+/**
+ * Get the size of the map along the Y
+ * @return the number of tiles along the Y of the map
+ */
+static inline uint MapSizeY()
+{
+	extern uint _map_size_y;
+	return _map_size_y;
+}
+
+/**
+ * Get the size of the map
+ * @return the number of tiles of the map
+ */
+static inline uint MapSize()
+{
+	extern uint _map_size;
+	return _map_size;
+}
+
+/**
+ * Gets the maximum X coordinate within the map, including MP_VOID
+ * @return the maximum X coordinate
+ */
+static inline uint MapMaxX()
+{
+	return MapSizeX() - 1;
+}
+
+/**
+ * Gets the maximum X coordinate within the map, including MP_VOID
+ * @return the maximum X coordinate
+ */
+static inline uint MapMaxY()
+{
+	return MapSizeY() - 1;
+}
+
+/**
+ * Scales relative to the number of tiles.
+ */
+uint ScaleByMapSize(uint);
+
+/**
+ * Scale relative to the circumference of the map.
+ */
+uint ScaleByMapSize1D(uint);
+
+/**
+ * An offset value between to tiles.
+ *
+ * This value is used fro the difference between
+ * to tiles. It can be added to a tileindex to get
+ * the resulting tileindex of the start tile applied
+ * with this saved difference.
+ *
+ * @see TileDiffXY(int, int)
+ */
+typedef int32 TileIndexDiff;
+
+/**
+ * Returns the TileIndex of a coordinate.
+ *
+ * @param x The x coordinate of the tile
+ * @param y The y coordinate of the tile
+ * @return The TileIndex calculated by the coordinate
+ */
+static inline TileIndex TileXY(uint x, uint y)
+{
+	return (y * MapSizeX()) + x;
+}
+
+/**
+ * Calculates an offset for the given coordinate(-offset).
+ *
+ * This function calculate an offset value which can be added to an
+ * #TileIndex. The coordinates can be negative.
+ *
+ * @param x The offset in x direction
+ * @param y The offset in y direction
+ * @return The resulting offset value of the given coordinate
+ * @see ToTileIndexDiff(TileIndexDiffC)
+ */
+static inline TileIndexDiff TileDiffXY(int x, int y)
+{
+	/* Multiplication gives much better optimization on MSVC than shifting.
+	 * 0 << shift isn't optimized to 0 properly.
+	 * Typically x and y are constants, and then this doesn't result
+	 * in any actual multiplication in the assembly code.. */
+	return (y * MapSizeX()) + x;
+}
+
+static inline TileIndex TileVirtXY(uint x, uint y)
+{
+	return (y >> 4 << MapLogX()) + (x >> 4);
+}
+
+
+/**
+ * Get the X component of a tile
+ * @param tile the tile to get the X component of
+ * @return the X component
+ */
+static inline uint TileX(TileIndex tile)
+{
+	return tile & MapMaxX();
+}
+
+/**
+ * Get the Y component of a tile
+ * @param tile the tile to get the Y component of
+ * @return the Y component
+ */
+static inline uint TileY(TileIndex tile)
+{
+	return tile >> MapLogX();
+}
+
+/**
+ * Return the offset between to tiles from a TileIndexDiffC struct.
+ *
+ * This function works like #TileDiffXY(int, int) and returns the
+ * difference between two tiles.
+ *
+ * @param tidc The coordinate of the offset as TileIndexDiffC
+ * @return The difference between two tiles.
+ * @see TileDiffXY(int, int)
+ */
+static inline TileIndexDiff ToTileIndexDiff(TileIndexDiffC tidc)
+{
+	return (tidc.y << MapLogX()) + tidc.x;
+}
+
+
+#ifndef _DEBUG
+	/**
+	 * Adds to tiles together.
+	 *
+	 * @param x One tile
+	 * @param y An other tile to add
+	 * @return The resulting tile(index)
+	 */
+	#define TILE_ADD(x,y) ((x) + (y))
+#else
+	extern TileIndex TileAdd(TileIndex tile, TileIndexDiff add,
+		const char *exp, const char *file, int line);
+	#define TILE_ADD(x, y) (TileAdd((x), (y), #x " + " #y, __FILE__, __LINE__))
+#endif
+
+/**
+ * Adds a given offset to a tile.
+ *
+ * @param tile The tile to add an offset on it
+ * @param x The x offset to add to the tile
+ * @param y The y offset to add to the tile
+ */
+#define TILE_ADDXY(tile, x, y) TILE_ADD(tile, TileDiffXY(x, y))
+
+/**
+ * Adds an offset to a tile and check if we are still on the map.
+ */
+TileIndex TileAddWrap(TileIndex tile, int addx, int addy);
+
+/**
+ * Returns the TileIndexDiffC offset from a DiagDirection.
+ *
+ * @param dir The given direction
+ * @return The offset as TileIndexDiffC value
+ */
+static inline TileIndexDiffC TileIndexDiffCByDiagDir(DiagDirection dir)
+{
+	extern const TileIndexDiffC _tileoffs_by_diagdir[DIAGDIR_END];
+
+	assert(IsValidDiagDirection(dir));
+	return _tileoffs_by_diagdir[dir];
+}
+
+/**
+ * Returns the TileIndexDiffC offset from a Direction.
+ *
+ * @param dir The given direction
+ * @return The offset as TileIndexDiffC value
+ */
+static inline TileIndexDiffC TileIndexDiffCByDir(Direction dir)
+{
+	extern const TileIndexDiffC _tileoffs_by_dir[DIR_END];
+
+	assert(IsValidDirection(dir));
+	return _tileoffs_by_dir[dir];
+}
+
+/**
+ * Add a TileIndexDiffC to a TileIndex and returns the new one.
+ *
+ * Returns tile + the diff given in diff. If the result tile would end up
+ * outside of the map, INVALID_TILE is returned instead.
+ *
+ * @param tile The base tile to add the offset on
+ * @param diff The offset to add on the tile
+ * @return The resulting TileIndex
+ */
+static inline TileIndex AddTileIndexDiffCWrap(TileIndex tile, TileIndexDiffC diff)
+{
+	int x = TileX(tile) + diff.x;
+	int y = TileY(tile) + diff.y;
+	if (x < 0 || y < 0 || x > (int)MapMaxX() || y > (int)MapMaxY())
+		return INVALID_TILE;
+	else
+		return TileXY(x, y);
+}
+
+/**
+ * Returns the diff between two tiles
+ *
+ * @param tile_a from tile
+ * @param tile_b to tile
+ * @return the difference between tila_a and tile_b
+ */
+static inline TileIndexDiffC TileIndexToTileIndexDiffC(TileIndex tile_a, TileIndex tile_b)
+{
+	TileIndexDiffC difference;
+
+	difference.x = TileX(tile_a) - TileX(tile_b);
+	difference.y = TileY(tile_a) - TileY(tile_b);
+
+	return difference;
+}
+
+/* Functions to calculate distances */
+uint DistanceManhattan(TileIndex, TileIndex); ///< also known as L1-Norm. Is the shortest distance one could go over diagonal tracks (or roads)
+uint DistanceSquare(TileIndex, TileIndex); ///< euclidian- or L2-Norm squared
+uint DistanceMax(TileIndex, TileIndex); ///< also known as L-Infinity-Norm
+uint DistanceMaxPlusManhattan(TileIndex, TileIndex); ///< Max + Manhattan
+uint DistanceFromEdge(TileIndex); ///< shortest distance from any edge of the map
+
+/**
+ * Starts a loop which iterates to a square of tiles
+ *
+ * This macro starts 2 nested loops which iterates over a square of tiles.
+ *
+ * @param var The name of the variable which contains the current tile
+ * @param w The width (x-width) of the square
+ * @param h The heigth (y-width) of the square
+ * @param tile The start tile of the square
+ */
+#define BEGIN_TILE_LOOP(var, w, h, tile)                      \
+	{                                                        \
+		int h_cur = h;                                         \
+		uint var = tile;                                       \
+		do {                                                   \
+			int w_cur = w;                                       \
+			do {
+/**
+ * Ends the square-loop used before
+ *
+ * @see BEGIN_TILE_LOOP
+ */
+#define END_TILE_LOOP(var, w, h, tile)                        \
+			} while (++var, --w_cur != 0);                       \
+		} while (var += TileDiffXY(0, 1) - (w), --h_cur != 0); \
+	}
+/**
+ * Convert a DiagDirection to a TileIndexDiff
+ *
+ * @param dir The DiagDirection
+ * @return The resulting TileIndexDiff
+ * @see TileIndexDiffCByDiagDir
+ */
+static inline TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
+{
+	extern const TileIndexDiffC _tileoffs_by_diagdir[DIAGDIR_END];
+
+	assert(IsValidDiagDirection(dir));
+	return ToTileIndexDiff(_tileoffs_by_diagdir[dir]);
+}
+
+/**
+ * Convert a Direction to a TileIndexDiff.
+ *
+ * @param dir The direction to convert from
+ * @return The resulting TileIndexDiff
+ */
+static inline TileIndexDiff TileOffsByDir(Direction dir)
+{
+	extern const TileIndexDiffC _tileoffs_by_dir[DIR_END];
+
+	assert(IsValidDirection(dir));
+	return ToTileIndexDiff(_tileoffs_by_dir[dir]);
+}
+
+/**
+ * Adds a DiagDir to a tile.
+ *
+ * @param tile The current tile
+ * @param dir The direction in which we want to step
+ * @return the moved tile
+ */
+static inline TileIndex TileAddByDiagDir(TileIndex tile, DiagDirection dir)
+{
+	return TILE_ADD(tile, TileOffsByDiagDir(dir));
+}
+
+/**
+ * A callback function type for searching tiles.
+ *
+ * @param tile The tile to test
+ * @param data additional data for the callback function to use
+ * @return A boolean value, depend on the definition of the function.
+ */
+typedef bool TestTileOnSearchProc(TileIndex tile, uint32 data);
+
+/**
+ * Searches for some cirumstances of a tile around a given tile with a helper function.
+ */
+bool CircularTileSearch(TileIndex tile, uint size, TestTileOnSearchProc proc, uint32 data);
+
+/**
+ * Get a random tile out of a given seed.
+ * @param r the random 'seed'
+ * @return a valid tile
+ */
+static inline TileIndex RandomTileSeed(uint32 r)
+{
+	return TILE_MASK(r);
+}
+
+/**
+ * Get a valid random tile.
+ * @note a define so 'random' gets inserted in the place where it is actually
+ *       called, thus making the random traces more explicit.
+ * @return a valid tile
+ */
+#define RandomTile() RandomTileSeed(Random())
+
+#endif /* MAP_FUNC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/map_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,65 @@
+/* $Id$ */
+
+/** @file map_type.h Types related to maps. */
+
+#ifndef MAP_TYPE_H
+#define MAP_TYPE_H
+
+/**
+ * Data that is stored per tile. Also used TileExtended for this.
+ * Look at docs/landscape.html for the exact meaning of the members.
+ */
+struct Tile {
+	byte   type_height; ///< The type (bits 4..7) and height of the northern corner
+	byte   m1;          ///< Primarily used for ownership information
+	uint16 m2;          ///< Primarily used for indices to towns, industries and stations
+	byte   m3;          ///< General purpose
+	byte   m4;          ///< General purpose
+	byte   m5;          ///< General purpose
+	byte   m6;          ///< Primarily used for bridges and rainforest/desert
+};
+
+/**
+ * Data that is stored per tile. Also used Tile for this.
+ * Look at docs/landscape.html for the exact meaning of the members.
+ */
+struct TileExtended {
+	byte m7; ///< Primarily used for newgrf support
+};
+
+/**
+ * An offset value between to tiles.
+ *
+ * This value is used fro the difference between
+ * to tiles. It can be added to a tileindex to get
+ * the resulting tileindex of the start tile applied
+ * with this saved difference.
+ *
+ * @see TileDiffXY(int, int)
+ */
+typedef int32 TileIndexDiff;
+
+/**
+ * A pair-construct of a TileIndexDiff.
+ *
+ * This can be used to save the difference between to
+ * tiles as a pair of x and y value.
+ */
+struct TileIndexDiffC {
+	int16 x;        ///< The x value of the coordinate
+	int16 y;        ///< The y value of the coordinate
+};
+
+/**
+ * Approximation of the length of a straight track, relative to a diagonal
+ * track (ie the size of a tile side).
+ *
+ * #defined instead of const so it can
+ * stay integer. (no runtime float operations) Is this needed?
+ * Watch out! There are _no_ brackets around here, to prevent intermediate
+ * rounding! Be careful when using this!
+ * This value should be sqrt(2)/2 ~ 0.7071
+ */
+#define STRAIGHT_TRACK_LENGTH 7071/10000
+
+#endif /* MAP_TYPE_H */
--- a/src/md5.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/md5.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -31,7 +31,7 @@
 
   This code implements the MD5 Algorithm defined in RFC 1321, whose
   text is available at
-	http://www.ietf.org/rfc/rfc1321.txt
+  http://www.ietf.org/rfc/rfc1321.txt
   The code is derived from the text of the RFC, including the test suite
   (section A.5) but excluding the rest of Appendix A.  It does not include
   any code or documentation that is identified in the RFC as being
@@ -41,32 +41,27 @@
   <ghost@aladdin.com>.  Other authors are noted in the change history
   that follows (in reverse chronological order):
 
+  2007-12-24 Changed to C++ and adapted to OpenTTD source
   2002-04-13 lpd Clarified derivation from RFC 1321; now handles byte order
-	either statically or dynamically; added missing #include <string.h>
-	in library.
+             either statically or dynamically; added missing #include <string.h>
+             in library.
   2002-03-11 lpd Corrected argument list for main(), and added int return
-	type, in test program and T value program.
+             type, in test program and T value program.
   2002-02-21 lpd Added missing #include <stdio.h> in test program.
   2000-07-03 lpd Patched to eliminate warnings about "constant is
-	unsigned in ANSI C, signed in traditional"; made test program
-	self-checking.
+             unsigned in ANSI C, signed in traditional"; made test program
+             self-checking.
   1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
   1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5).
   1999-05-03 lpd Original version.
  */
 
 #include "stdafx.h"
+#include "core/bitmath_func.hpp"
+#include "core/endian_func.hpp"
 #include "md5.h"
-#include <string.h>
 
-#undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */
-#if defined(TTD_BIG_ENDIAN)
-#  define BYTE_ORDER 1
-#else
-#  define BYTE_ORDER -1
-#endif
-
-#define T_MASK ((md5_word_t)~0)
+#define T_MASK ((uint32)~0)
 #define T1 /* 0xd76aa478 */ (T_MASK ^ 0x28955b87)
 #define T2 /* 0xe8c7b756 */ (T_MASK ^ 0x173848a9)
 #define T3    0x242070db
@@ -132,255 +127,197 @@
 #define T63    0x2ad7d2bb
 #define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e)
 
-
-static void
-md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
+static inline void Md5Set1(const uint32 *X, uint32 *a, const uint32 *b, const uint32 *c, const uint32 *d, const uint8 k, const uint8 s, const uint32 Ti)
 {
-    md5_word_t
-	a = pms->abcd[0], b = pms->abcd[1],
-	c = pms->abcd[2], d = pms->abcd[3];
-    md5_word_t t;
-#if BYTE_ORDER > 0
-    /* Define storage only for big-endian CPUs. */
-    md5_word_t X[16];
-#else
-    /* Define storage for little-endian or both types of CPUs. */
-    md5_word_t xbuf[16];
-    const md5_word_t *X;
-#endif
-
-    {
-#if BYTE_ORDER == 0
-	/*
-	 * Determine dynamically whether this is a big-endian or
-	 * little-endian machine, since we can use a more efficient
-	 * algorithm on the latter.
-	 */
-	static const int w = 1;
-
-	if (*((const md5_byte_t *)&w)) /* dynamic little-endian */
-#endif
-#if BYTE_ORDER <= 0 /* little-endian */
-	{
-	    /*
-	     * On little-endian machines, we can process properly aligned
-	     * data without copying it.
-	     */
-	    if (!((data - (const md5_byte_t *)0) & 3)) {
-		/* data are properly aligned */
-		X = (const md5_word_t *)data;
-	    } else {
-		/* not aligned */
-		memcpy(xbuf, data, 64);
-		X = xbuf;
-	    }
-	}
-#endif
-#if BYTE_ORDER == 0
-	else /* dynamic big-endian */
-#endif
-#if BYTE_ORDER >= 0 /* big-endian */
-	{
-	    /*
-	     * On big-endian machines, we must arrange the bytes in the
-	     * right order.
-	     */
-	    const md5_byte_t *xp = data;
-	    int i;
-
-#  if BYTE_ORDER == 0
-	    X = xbuf; /* (dynamic only) */
-#  else
-#    define xbuf X /* (static only) */
-#  endif
-	    for (i = 0; i < 16; ++i, xp += 4)
-		xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24);
-	}
-#endif
-    }
-
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
-
-    /* Round 1. */
-    /* Let [abcd k s i] denote the operation
-       a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */
-#define F(x, y, z) (((x) & (y)) | (~(x) & (z)))
-#define SET(a, b, c, d, k, s, Ti)\
-  t = a + F(b,c,d) + X[k] + Ti;\
-  a = ROTATE_LEFT(t, s) + b
-    /* Do the following 16 operations. */
-    SET(a, b, c, d,  0,  7,  T1);
-    SET(d, a, b, c,  1, 12,  T2);
-    SET(c, d, a, b,  2, 17,  T3);
-    SET(b, c, d, a,  3, 22,  T4);
-    SET(a, b, c, d,  4,  7,  T5);
-    SET(d, a, b, c,  5, 12,  T6);
-    SET(c, d, a, b,  6, 17,  T7);
-    SET(b, c, d, a,  7, 22,  T8);
-    SET(a, b, c, d,  8,  7,  T9);
-    SET(d, a, b, c,  9, 12, T10);
-    SET(c, d, a, b, 10, 17, T11);
-    SET(b, c, d, a, 11, 22, T12);
-    SET(a, b, c, d, 12,  7, T13);
-    SET(d, a, b, c, 13, 12, T14);
-    SET(c, d, a, b, 14, 17, T15);
-    SET(b, c, d, a, 15, 22, T16);
-#undef SET
-
-     /* Round 2. */
-     /* Let [abcd k s i] denote the operation
-          a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */
-#define G(x, y, z) (((x) & (z)) | ((y) & ~(z)))
-#define SET(a, b, c, d, k, s, Ti)\
-  t = a + G(b,c,d) + X[k] + Ti;\
-  a = ROTATE_LEFT(t, s) + b
-     /* Do the following 16 operations. */
-    SET(a, b, c, d,  1,  5, T17);
-    SET(d, a, b, c,  6,  9, T18);
-    SET(c, d, a, b, 11, 14, T19);
-    SET(b, c, d, a,  0, 20, T20);
-    SET(a, b, c, d,  5,  5, T21);
-    SET(d, a, b, c, 10,  9, T22);
-    SET(c, d, a, b, 15, 14, T23);
-    SET(b, c, d, a,  4, 20, T24);
-    SET(a, b, c, d,  9,  5, T25);
-    SET(d, a, b, c, 14,  9, T26);
-    SET(c, d, a, b,  3, 14, T27);
-    SET(b, c, d, a,  8, 20, T28);
-    SET(a, b, c, d, 13,  5, T29);
-    SET(d, a, b, c,  2,  9, T30);
-    SET(c, d, a, b,  7, 14, T31);
-    SET(b, c, d, a, 12, 20, T32);
-#undef SET
-
-     /* Round 3. */
-     /* Let [abcd k s t] denote the operation
-          a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */
-#define H(x, y, z) ((x) ^ (y) ^ (z))
-#define SET(a, b, c, d, k, s, Ti)\
-  t = a + H(b,c,d) + X[k] + Ti;\
-  a = ROTATE_LEFT(t, s) + b
-     /* Do the following 16 operations. */
-    SET(a, b, c, d,  5,  4, T33);
-    SET(d, a, b, c,  8, 11, T34);
-    SET(c, d, a, b, 11, 16, T35);
-    SET(b, c, d, a, 14, 23, T36);
-    SET(a, b, c, d,  1,  4, T37);
-    SET(d, a, b, c,  4, 11, T38);
-    SET(c, d, a, b,  7, 16, T39);
-    SET(b, c, d, a, 10, 23, T40);
-    SET(a, b, c, d, 13,  4, T41);
-    SET(d, a, b, c,  0, 11, T42);
-    SET(c, d, a, b,  3, 16, T43);
-    SET(b, c, d, a,  6, 23, T44);
-    SET(a, b, c, d,  9,  4, T45);
-    SET(d, a, b, c, 12, 11, T46);
-    SET(c, d, a, b, 15, 16, T47);
-    SET(b, c, d, a,  2, 23, T48);
-#undef SET
-
-     /* Round 4. */
-     /* Let [abcd k s t] denote the operation
-          a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */
-#define I(x, y, z) ((y) ^ ((x) | ~(z)))
-#define SET(a, b, c, d, k, s, Ti)\
-  t = a + I(b,c,d) + X[k] + Ti;\
-  a = ROTATE_LEFT(t, s) + b
-     /* Do the following 16 operations. */
-    SET(a, b, c, d,  0,  6, T49);
-    SET(d, a, b, c,  7, 10, T50);
-    SET(c, d, a, b, 14, 15, T51);
-    SET(b, c, d, a,  5, 21, T52);
-    SET(a, b, c, d, 12,  6, T53);
-    SET(d, a, b, c,  3, 10, T54);
-    SET(c, d, a, b, 10, 15, T55);
-    SET(b, c, d, a,  1, 21, T56);
-    SET(a, b, c, d,  8,  6, T57);
-    SET(d, a, b, c, 15, 10, T58);
-    SET(c, d, a, b,  6, 15, T59);
-    SET(b, c, d, a, 13, 21, T60);
-    SET(a, b, c, d,  4,  6, T61);
-    SET(d, a, b, c, 11, 10, T62);
-    SET(c, d, a, b,  2, 15, T63);
-    SET(b, c, d, a,  9, 21, T64);
-#undef SET
-
-     /* Then perform the following additions. (That is increment each
-        of the four registers by the value it had before this block
-        was started.) */
-    pms->abcd[0] += a;
-    pms->abcd[1] += b;
-    pms->abcd[2] += c;
-    pms->abcd[3] += d;
+	uint32 t = (*b & *c) | (~*b & *d);
+	t += *a + X[k] + Ti;
+	*a = ROL(t, s) + *b;
 }
 
-void
-md5_init(md5_state_t *pms)
+static inline void Md5Set2(const uint32 *X, uint32 *a, const uint32 *b, const uint32 *c, const uint32 *d, const uint8 k, const uint8 s, const uint32 Ti)
 {
-    pms->count[0] = pms->count[1] = 0;
-    pms->abcd[0] = 0x67452301;
-    pms->abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476;
-    pms->abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301;
-    pms->abcd[3] = 0x10325476;
+	uint32 t = (*b & *d) | (*c & ~*d);
+	t += *a + X[k] + Ti;
+	*a = ROL(t, s) + *b;
 }
 
-void
-md5_append(md5_state_t *pms, const void *data, size_t nbytes)
-{
-    const md5_byte_t *p = (const md5_byte_t *)data;
-    size_t left = nbytes;
-    size_t offset = (pms->count[0] >> 3) & 63;
-    md5_word_t nbits = (md5_word_t)(nbytes << 3);
-
-    if (nbytes <= 0)
-	return;
-
-    /* Update the message length. */
-    pms->count[1] += (md5_word_t)(nbytes >> 29);
-    pms->count[0] += nbits;
-    if (pms->count[0] < nbits)
-	pms->count[1]++;
 
-    /* Process an initial partial block. */
-    if (offset) {
-	size_t copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
-
-	memcpy(pms->buf + offset, p, copy);
-	if (offset + copy < 64)
-	    return;
-	p += copy;
-	left -= copy;
-	md5_process(pms, pms->buf);
-    }
-
-    /* Process full blocks. */
-    for (; left >= 64; p += 64, left -= 64)
-	md5_process(pms, p);
-
-    /* Process a final partial block. */
-    if (left)
-	memcpy(pms->buf, p, left);
+static inline void Md5Set3(const uint32 *X, uint32 *a, const uint32 *b, const uint32 *c, const uint32 *d, const uint8 k, const uint8 s, const uint32 Ti)
+{
+	uint32 t = *b ^ *c ^ *d;
+	t += *a + X[k] + Ti;
+	*a = ROL(t, s) + *b;
 }
 
-void
-md5_finish(md5_state_t *pms, md5_byte_t digest[16])
+static inline void Md5Set4(const uint32 *X, uint32 *a, const uint32 *b, const uint32 *c, const uint32 *d, const uint8 k, const uint8 s, const uint32 Ti)
 {
-    static const md5_byte_t pad[64] = {
-	0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-    };
-    md5_byte_t data[8];
-    int i;
+	uint32 t = *c ^ (*b | ~*d);
+	t += *a + X[k] + Ti;
+	*a = ROL(t, s) + *b;
+}
 
-    /* Save the length before padding. */
-    for (i = 0; i < 8; ++i)
-	data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3));
-    /* Pad to 56 bytes mod 64. */
-    md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
-    /* Append the length. */
-    md5_append(pms, data, 8);
-    for (i = 0; i < 16; ++i)
-	digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));
+Md5::Md5()
+{
+	count[0] = 0;
+	count[1] = 0;
+	abcd[0] = 0x67452301;
+	abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476;
+	abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301;
+	abcd[3] = 0x10325476;
 }
+
+void Md5::Process(const uint8 *data /*[64]*/)
+{
+	uint32 a = this->abcd[0];
+	uint32 b = this->abcd[1];
+	uint32 c = this->abcd[2];
+	uint32 d = this->abcd[3];
+
+	uint32 X[16];
+
+	/* Convert the uint8 data to uint32 LE */
+	uint32 *px = (uint32 *)data;
+	for (uint i = 0; i < 16; i++) {
+		X[i] = TO_LE32(*px);
+		px++;
+	}
+
+	/* Round 1. */
+	Md5Set1(X, &a, &b, &c, &d,  0,  7,  T1);
+	Md5Set1(X, &d, &a, &b, &c,  1, 12,  T2);
+	Md5Set1(X, &c, &d, &a, &b,  2, 17,  T3);
+	Md5Set1(X, &b, &c, &d, &a,  3, 22,  T4);
+	Md5Set1(X, &a, &b, &c, &d,  4,  7,  T5);
+	Md5Set1(X, &d, &a, &b, &c,  5, 12,  T6);
+	Md5Set1(X, &c, &d, &a, &b,  6, 17,  T7);
+	Md5Set1(X, &b, &c, &d, &a,  7, 22,  T8);
+	Md5Set1(X, &a, &b, &c, &d,  8,  7,  T9);
+	Md5Set1(X, &d, &a, &b, &c,  9, 12, T10);
+	Md5Set1(X, &c, &d, &a, &b, 10, 17, T11);
+	Md5Set1(X, &b, &c, &d, &a, 11, 22, T12);
+	Md5Set1(X, &a, &b, &c, &d, 12,  7, T13);
+	Md5Set1(X, &d, &a, &b, &c, 13, 12, T14);
+	Md5Set1(X, &c, &d, &a, &b, 14, 17, T15);
+	Md5Set1(X, &b, &c, &d, &a, 15, 22, T16);
+
+	/* Round 2. */
+	Md5Set2(X, &a, &b, &c, &d,  1,  5, T17);
+	Md5Set2(X, &d, &a, &b, &c,  6,  9, T18);
+	Md5Set2(X, &c, &d, &a, &b, 11, 14, T19);
+	Md5Set2(X, &b, &c, &d, &a,  0, 20, T20);
+	Md5Set2(X, &a, &b, &c, &d,  5,  5, T21);
+	Md5Set2(X, &d, &a, &b, &c, 10,  9, T22);
+	Md5Set2(X, &c, &d, &a, &b, 15, 14, T23);
+	Md5Set2(X, &b, &c, &d, &a,  4, 20, T24);
+	Md5Set2(X, &a, &b, &c, &d,  9,  5, T25);
+	Md5Set2(X, &d, &a, &b, &c, 14,  9, T26);
+	Md5Set2(X, &c, &d, &a, &b,  3, 14, T27);
+	Md5Set2(X, &b, &c, &d, &a,  8, 20, T28);
+	Md5Set2(X, &a, &b, &c, &d, 13,  5, T29);
+	Md5Set2(X, &d, &a, &b, &c,  2,  9, T30);
+	Md5Set2(X, &c, &d, &a, &b,  7, 14, T31);
+	Md5Set2(X, &b, &c, &d, &a, 12, 20, T32);
+
+	/* Round 3. */
+	Md5Set3(X, &a, &b, &c, &d,  5,  4, T33);
+	Md5Set3(X, &d, &a, &b, &c,  8, 11, T34);
+	Md5Set3(X, &c, &d, &a, &b, 11, 16, T35);
+	Md5Set3(X, &b, &c, &d, &a, 14, 23, T36);
+	Md5Set3(X, &a, &b, &c, &d,  1,  4, T37);
+	Md5Set3(X, &d, &a, &b, &c,  4, 11, T38);
+	Md5Set3(X, &c, &d, &a, &b,  7, 16, T39);
+	Md5Set3(X, &b, &c, &d, &a, 10, 23, T40);
+	Md5Set3(X, &a, &b, &c, &d, 13,  4, T41);
+	Md5Set3(X, &d, &a, &b, &c,  0, 11, T42);
+	Md5Set3(X, &c, &d, &a, &b,  3, 16, T43);
+	Md5Set3(X, &b, &c, &d, &a,  6, 23, T44);
+	Md5Set3(X, &a, &b, &c, &d,  9,  4, T45);
+	Md5Set3(X, &d, &a, &b, &c, 12, 11, T46);
+	Md5Set3(X, &c, &d, &a, &b, 15, 16, T47);
+	Md5Set3(X, &b, &c, &d, &a,  2, 23, T48);
+
+	/* Round 4. */
+	Md5Set4(X, &a, &b, &c, &d,  0,  6, T49);
+	Md5Set4(X, &d, &a, &b, &c,  7, 10, T50);
+	Md5Set4(X, &c, &d, &a, &b, 14, 15, T51);
+	Md5Set4(X, &b, &c, &d, &a,  5, 21, T52);
+	Md5Set4(X, &a, &b, &c, &d, 12,  6, T53);
+	Md5Set4(X, &d, &a, &b, &c,  3, 10, T54);
+	Md5Set4(X, &c, &d, &a, &b, 10, 15, T55);
+	Md5Set4(X, &b, &c, &d, &a,  1, 21, T56);
+	Md5Set4(X, &a, &b, &c, &d,  8,  6, T57);
+	Md5Set4(X, &d, &a, &b, &c, 15, 10, T58);
+	Md5Set4(X, &c, &d, &a, &b,  6, 15, T59);
+	Md5Set4(X, &b, &c, &d, &a, 13, 21, T60);
+	Md5Set4(X, &a, &b, &c, &d,  4,  6, T61);
+	Md5Set4(X, &d, &a, &b, &c, 11, 10, T62);
+	Md5Set4(X, &c, &d, &a, &b,  2, 15, T63);
+	Md5Set4(X, &b, &c, &d, &a,  9, 21, T64);
+
+	/* Then perform the following additions. (That is increment each
+	 * of the four registers by the value it had before this block
+	 * was started.) */
+	this->abcd[0] += a;
+	this->abcd[1] += b;
+	this->abcd[2] += c;
+	this->abcd[3] += d;
+}
+
+void Md5::Append(const void *data, const size_t nbytes)
+{
+	const uint8 *p = (const uint8 *)data;
+	size_t left = nbytes;
+	const size_t offset = (this->count[0] >> 3) & 63;
+	const uint32 nbits = (uint32)(nbytes << 3);
+
+	if (nbytes <= 0) return;
+
+	/* Update the message length. */
+	this->count[1] += (uint32)(nbytes >> 29);
+	this->count[0] += nbits;
+
+	if (this->count[0] < nbits) this->count[1]++;
+
+	/* Process an initial partial block. */
+	if (offset) {
+		size_t copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
+
+		memcpy(this->buf + offset, p, copy);
+
+		if (offset + copy < 64) return;
+
+		p += copy;
+		left -= copy;
+		this->Process(this->buf);
+	}
+
+	/* Process full blocks. */
+	for (; left >= 64; p += 64, left -= 64) this->Process(p);
+
+	/* Process a final partial block. */
+	if (left) memcpy(this->buf, p, left);
+}
+
+void Md5::Finish(uint8 digest[16])
+{
+	static const uint8 pad[64] = {
+		0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+	};
+	uint8 data[8];
+	uint i;
+
+	/* Save the length before padding. */
+	for (i = 0; i < 8; ++i)
+		data[i] = (uint8)(this->count[i >> 2] >> ((i & 3) << 3));
+
+	/* Pad to 56 bytes mod 64. */
+	this->Append(pad, ((55 - (this->count[0] >> 3)) & 63) + 1);
+	/* Append the length. */
+	this->Append(data, 8);
+
+	for (i = 0; i < 16; ++i)
+		digest[i] = (uint8)(this->abcd[i >> 2] >> ((i & 3) << 3));
+}
--- a/src/md5.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/md5.h	Tue Jan 22 21:00:30 2008 +0000
@@ -31,7 +31,7 @@
 
   This code implements the MD5 Algorithm defined in RFC 1321, whose
   text is available at
-	http://www.ietf.org/rfc/rfc1321.txt
+  http://www.ietf.org/rfc/rfc1321.txt
   The code is derived from the text of the RFC, including the test suite
   (section A.5) but excluding the rest of Appendix A.  It does not include
   any code or documentation that is identified in the RFC as being
@@ -41,13 +41,14 @@
   <ghost@aladdin.com>.  Other authors are noted in the change history
   that follows (in reverse chronological order):
 
+  2007-12-24 Changed to C++ and adapted to OpenTTD source
   2002-04-13 lpd Removed support for non-ANSI compilers; removed
-	references to Ghostscript; clarified derivation from RFC 1321;
-	now handles byte order either statically or dynamically.
+             references to Ghostscript; clarified derivation from RFC 1321;
+             now handles byte order either statically or dynamically.
   1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
   1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
-	added conditionalization for C++ compilation from Martin
-	Purschke <purschke@bnl.gov>.
+             added conditionalization for C++ compilation from Martin
+             Purschke <purschke@bnl.gov>.
   1999-05-03 lpd Original version.
  */
 
@@ -64,23 +65,18 @@
  * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined.
  */
 
-typedef unsigned char md5_byte_t; /* 8-bit byte */
-typedef unsigned int md5_word_t; /* 32-bit word */
+struct Md5 {
+private:
+	uint32 count[2]; ///< message length in bits, lsw first
+	uint32 abcd[4];  ///< digest buffer
+	uint8 buf[64];   ///< accumulate block
 
-/* Define the state of the MD5 Algorithm. */
-struct md5_state_t {
-    md5_word_t count[2]; /* message length in bits, lsw first */
-    md5_word_t abcd[4];  /* digest buffer */
-    md5_byte_t buf[64];  /* accumulate block */
+	void Process(const uint8 *data);
+
+public:
+	Md5();
+	void Append(const void *data, const size_t nbytes);
+	void Finish(uint8 digest[16]);
 };
 
-/* Initialize the algorithm. */
-void md5_init(md5_state_t *pms);
-
-/* Append a string to the message. */
-void md5_append(md5_state_t *pms, const void *data, size_t nbytes);
-
-/* Finish the message and return the digest. */
-void md5_finish(md5_state_t *pms, md5_byte_t digest[16]);
-
 #endif /* MD5_INCLUDED */
--- a/src/misc.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/misc.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,25 +5,30 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "currency.h"
-#include "functions.h"
 #include "landscape.h"
 #include "news.h"
-#include "player.h"
-#include "string.h"
-#include "table/strings.h"
-#include "table/sprites.h"
-#include "map.h"
-#include "vehicle.h"
 #include "saveload.h"
 #include "engine.h"
 #include "vehicle_gui.h"
 #include "variables.h"
 #include "ai/ai.h"
 #include "newgrf_house.h"
-#include "date.h"
 #include "cargotype.h"
 #include "group.h"
-#include "viewport.h"
+#include "viewport_func.h"
+#include "economy_func.h"
+#include "zoom_func.h"
+#include "functions.h"
+#include "map_func.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "texteff.hpp"
+#include "string_func.h"
+#include "gfx_func.h"
+#include "core/alloc_func.hpp"
+
+#include "table/strings.h"
+#include "table/sprites.h"
 
 char _name_array[512][32];
 
@@ -53,8 +58,6 @@
 {
 	AllocateMap(size_x, size_y);
 
-	AddTypeToEngines(); // make sure all engines have a type
-
 	SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, VHM_NONE, WC_MAIN_WINDOW, 0);
 
 	_pause_game = 0;
@@ -114,18 +117,6 @@
 	return GB(id, 11, 5) == 15;
 }
 
-void DeleteName(StringID id)
-{
-	if (IsCustomName(id)) {
-		memset(_name_array[id & 0x1FF], 0, sizeof(_name_array[id & 0x1FF]));
-	}
-}
-
-char *GetName(char *buff, StringID id, const char* last)
-{
-	return strecpy(buff, _name_array[id & ~0x600], last);
-}
-
 
 static void InitializeCheats()
 {
@@ -138,40 +129,22 @@
 	memset(_name_array, 0, sizeof(_name_array));
 }
 
-StringID RealAllocateName(const char *name, byte skip, bool check_double)
+/* Copy and convert old custom names to UTF-8 */
+char *CopyFromOldName(StringID id)
 {
-	char (*free_item)[lengthof(*_name_array)] = NULL;
-	char (*i)[lengthof(*_name_array)];
-
-	for (i = _name_array; i != endof(_name_array); ++i) {
-		if ((*i)[0] == '\0') {
-			if (free_item == NULL) free_item = i;
-		} else if (check_double && strncmp(*i, name, lengthof(*i) - 1) == 0) {
-			_error_message = STR_0132_CHOSEN_NAME_IN_USE_ALREADY;
-			return 0;
-		}
-	}
+	if (!IsCustomName(id)) return NULL;
 
-	if (free_item != NULL) {
-		ttd_strlcpy(*free_item, name, lengthof(*free_item));
-		return (free_item - _name_array) | 0x7800 | (skip << 8);
-	} else {
-		_error_message = STR_0131_TOO_MANY_NAMES_DEFINED;
-		return 0;
-	}
-}
-
-void ConvertNameArray()
-{
-	uint i;
-
-	for (i = 0; i < lengthof(_name_array); i++) {
-		const char *strfrom = _name_array[i];
-		char tmp[sizeof(*_name_array)];
+	if (CheckSavegameVersion(37)) {
+		/* Old names were 32 characters long, so 128 characters should be
+		 * plenty to allow for expansion when converted to UTF-8. */
+		char tmp[128];
+		const char *strfrom = _name_array[GB(id, 0, 9)];
 		char *strto = tmp;
 
 		for (; *strfrom != '\0'; strfrom++) {
 			WChar c = (byte)*strfrom;
+
+			/* Map from non-ISO8859-15 characters to UTF-8. */
 			switch (c) {
 				case 0xA4: c = 0x20AC; break; // Euro
 				case 0xA6: c = 0x0160; break; // S with caron
@@ -183,13 +156,20 @@
 				case 0xBE: c = 0x0178; break; // Y with diaresis
 				default: break;
 			}
+
+			/* Check character will fit into our buffer. */
 			if (strto + Utf8CharLen(c) > lastof(tmp)) break;
+
 			strto += Utf8Encode(strto, c);
 		}
 
 		/* Terminate the new string and copy it back to the name array */
 		*strto = '\0';
-		memcpy(_name_array[i], tmp, sizeof(*_name_array));
+
+		return strdup(tmp);
+	} else {
+		/* Name will already be in UTF-8. */
+		return strdup(_name_array[GB(id, 0, 9)]);
 	}
 }
 
@@ -204,19 +184,6 @@
 	}
 }
 
-
-static void Save_NAME()
-{
-	int i;
-
-	for (i = 0; i != lengthof(_name_array); ++i) {
-		if (_name_array[i][0] != '\0') {
-			SlSetArrayIndex(i);
-			SlArray(_name_array[i], (uint)strlen(_name_array[i]), SLE_UINT8);
-		}
-	}
-}
-
 static void Load_NAME()
 {
 	int index;
@@ -294,196 +261,161 @@
 	AllocateMap(_map_dim_x, _map_dim_y);
 }
 
+enum {
+	MAP_SL_BUF_SIZE = 4096
+};
+
 static void Load_MAPT()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
-	for (i = 0; i != size;) {
-		byte buf[4096];
-		uint j;
-
-		SlArray(buf, lengthof(buf), SLE_UINT8);
-		for (j = 0; j != lengthof(buf); j++) _m[i++].type_height = buf[j];
+	for (TileIndex i = 0; i != size;) {
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) _m[i++].type_height = buf[j];
 	}
 }
 
 static void Save_MAPT()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
 	SlSetLength(size);
-	for (i = 0; i != size;) {
-		byte buf[4096];
-		uint j;
-
-		for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].type_height;
-		SlArray(buf, lengthof(buf), SLE_UINT8);
+	for (TileIndex i = 0; i != size;) {
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = _m[i++].type_height;
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
 	}
 }
 
 static void Load_MAP1()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
-	for (i = 0; i != size;) {
-		byte buf[4096];
-		uint j;
-
-		SlArray(buf, lengthof(buf), SLE_UINT8);
-		for (j = 0; j != lengthof(buf); j++) _m[i++].m1 = buf[j];
+	for (TileIndex i = 0; i != size;) {
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) _m[i++].m1 = buf[j];
 	}
 }
 
 static void Save_MAP1()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
 	SlSetLength(size);
-	for (i = 0; i != size;) {
-		byte buf[4096];
-		uint j;
-
-		for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].m1;
-		SlArray(buf, lengthof(buf), SLE_UINT8);
+	for (TileIndex i = 0; i != size;) {
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = _m[i++].m1;
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
 	}
 }
 
 static void Load_MAP2()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<uint16, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
-	for (i = 0; i != size;) {
-		uint16 buf[4096];
-		uint j;
-
-		SlArray(buf, lengthof(buf),
+	for (TileIndex i = 0; i != size;) {
+		SlArray(buf, MAP_SL_BUF_SIZE,
 			/* In those versions the m2 was 8 bits */
 			CheckSavegameVersion(5) ? SLE_FILE_U8 | SLE_VAR_U16 : SLE_UINT16
 		);
-		for (j = 0; j != lengthof(buf); j++) _m[i++].m2 = buf[j];
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) _m[i++].m2 = buf[j];
 	}
 }
 
 static void Save_MAP2()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<uint16, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
-	SlSetLength(size * sizeof(_m[0].m2));
-	for (i = 0; i != size;) {
-		uint16 buf[4096];
-		uint j;
-
-		for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].m2;
-		SlArray(buf, lengthof(buf), SLE_UINT16);
+	SlSetLength(size * sizeof(uint16));
+	for (TileIndex i = 0; i != size;) {
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = _m[i++].m2;
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT16);
 	}
 }
 
 static void Load_MAP3()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
-	for (i = 0; i != size;) {
-		byte buf[4096];
-		uint j;
-
-		SlArray(buf, lengthof(buf), SLE_UINT8);
-		for (j = 0; j != lengthof(buf); j++) _m[i++].m3 = buf[j];
+	for (TileIndex i = 0; i != size;) {
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) _m[i++].m3 = buf[j];
 	}
 }
 
 static void Save_MAP3()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
 	SlSetLength(size);
-	for (i = 0; i != size;) {
-		byte buf[4096];
-		uint j;
-
-		for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].m3;
-		SlArray(buf, lengthof(buf), SLE_UINT8);
+	for (TileIndex i = 0; i != size;) {
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = _m[i++].m3;
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
 	}
 }
 
 static void Load_MAP4()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
-	for (i = 0; i != size;) {
-		byte buf[4096];
-		uint j;
-
-		SlArray(buf, lengthof(buf), SLE_UINT8);
-		for (j = 0; j != lengthof(buf); j++) _m[i++].m4 = buf[j];
+	for (TileIndex i = 0; i != size;) {
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) _m[i++].m4 = buf[j];
 	}
 }
 
 static void Save_MAP4()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
 	SlSetLength(size);
-	for (i = 0; i != size;) {
-		byte buf[4096];
-		uint j;
-
-		for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].m4;
-		SlArray(buf, lengthof(buf), SLE_UINT8);
+	for (TileIndex i = 0; i != size;) {
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = _m[i++].m4;
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
 	}
 }
 
 static void Load_MAP5()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
-	for (i = 0; i != size;) {
-		byte buf[4096];
-		uint j;
-
-		SlArray(buf, lengthof(buf), SLE_UINT8);
-		for (j = 0; j != lengthof(buf); j++) _m[i++].m5 = buf[j];
+	for (TileIndex i = 0; i != size;) {
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) _m[i++].m5 = buf[j];
 	}
 }
 
 static void Save_MAP5()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
 	SlSetLength(size);
-	for (i = 0; i != size;) {
-		byte buf[4096];
-		uint j;
-
-		for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].m5;
-		SlArray(buf, lengthof(buf), SLE_UINT8);
+	for (TileIndex i = 0; i != size;) {
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = _m[i++].m5;
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
 	}
 }
 
 static void Load_MAP6()
 {
-	/* Still available for loading old games */
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
 	if (CheckSavegameVersion(42)) {
-		for (i = 0; i != size;) {
-			uint8 buf[1024];
-			uint j;
-
-			SlArray(buf, lengthof(buf), SLE_UINT8);
-			for (j = 0; j != lengthof(buf); j++) {
+		for (TileIndex i = 0; i != size;) {
+			/* 1024, otherwise we overflow on 64x64 maps! */
+			SlArray(buf, 1024, SLE_UINT8);
+			for (uint j = 0; j != 1024; j++) {
 				_m[i++].m6 = GB(buf[j], 0, 2);
 				_m[i++].m6 = GB(buf[j], 2, 2);
 				_m[i++].m6 = GB(buf[j], 4, 2);
@@ -491,57 +423,45 @@
 			}
 		}
 	} else {
-		for (i = 0; i != size;) {
-			byte buf[4096];
-			uint j;
-
-			SlArray(buf, lengthof(buf), SLE_UINT8);
-			for (j = 0; j != lengthof(buf); j++) _m[i++].m6 = buf[j];
+		for (TileIndex i = 0; i != size;) {
+			SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
+			for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) _m[i++].m6 = buf[j];
 		}
 	}
 }
 
 static void Save_MAP6()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
 	SlSetLength(size);
-	for (i = 0; i != size;) {
-		uint8 buf[4096];
-		uint j;
-
-		for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].m6;
-		SlArray(buf, lengthof(buf), SLE_UINT8);
+	for (TileIndex i = 0; i != size;) {
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = _m[i++].m6;
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
 	}
 }
 
 static void Load_MAP7()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
-	for (i = 0; i != size;) {
-		uint8 buf[4096];
-		uint j;
-
-		SlArray(buf, lengthof(buf), SLE_UINT8);
-		for (j = 0; j != lengthof(buf); j++) _me[i++].m7 = buf[j];
+	for (TileIndex i = 0; i != size;) {
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) _me[i++].m7 = buf[j];
 	}
 }
 
 static void Save_MAP7()
 {
-	uint size = MapSize();
-	uint i;
+	SmallStackSafeStackAlloc<byte, MAP_SL_BUF_SIZE> buf;
+	TileIndex size = MapSize();
 
 	SlSetLength(size);
-	for (i = 0; i != size;) {
-		uint8 buf[4096];
-		uint j;
-
-		for (j = 0; j != lengthof(buf); j++) buf[j] = _me[i++].m7;
-		SlArray(buf, lengthof(buf), SLE_UINT8);
+	for (TileIndex i = 0; i != size;) {
+		for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = _me[i++].m7;
+		SlArray(buf, MAP_SL_BUF_SIZE, SLE_UINT8);
 	}
 }
 
@@ -582,7 +502,7 @@
 	{ 'MAPE', Save_MAP6,     Load_MAP6,     CH_RIFF },
 	{ 'MAP7', Save_MAP7,     Load_MAP7,     CH_RIFF },
 
-	{ 'NAME', Save_NAME,     Load_NAME,     CH_ARRAY},
+	{ 'NAME', NULL,          Load_NAME,     CH_ARRAY},
 	{ 'DATE', SaveLoad_DATE, SaveLoad_DATE, CH_RIFF},
 	{ 'VIEW', SaveLoad_VIEW, SaveLoad_VIEW, CH_RIFF},
 	{ 'CHTS', Save_CHTS,     Load_CHTS,     CH_RIFF | CH_LAST}
--- a/src/misc/blob.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/misc/blob.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -2,8 +2,10 @@
 
 /** @file blob.hpp */
 
-#ifndef  BLOB_HPP
-#define  BLOB_HPP
+#ifndef BLOB_HPP
+#define BLOB_HPP
+
+#include "../core/alloc_func.hpp"
 
 /** Type-safe version of memcpy().
  * @param d destination buffer
@@ -298,7 +300,7 @@
 	/** all allocation should happen here */
 	static FORCEINLINE CHdr* RawAlloc(bsize_t num_bytes)
 	{
-		return (CHdr*)malloc(num_bytes);
+		return (CHdr*)MallocT<byte>(num_bytes);
 	}
 
 	/** all deallocations should happen here */
--- a/src/misc/countedptr.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/misc/countedptr.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -1,12 +1,10 @@
 /* $Id$ */
 
-/** @file countedptr.hpp */
+/** @file countedptr.hpp CCountedPtr - smart pointer implementation. */
 
 #ifndef COUNTEDPTR_HPP
 #define COUNTEDPTR_HPP
 
-/** @file CCountedPtr - smart pointer implementation */
-
 /** CCountedPtr - simple reference counting smart pointer.
  *
  *     One of the standard ways how to maintain object's lifetime.
--- a/src/misc/dbg_helpers.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/misc/dbg_helpers.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -2,7 +2,8 @@
 
 /** @file dbg_helpers.cpp */
 #include "../stdafx.h"
-#include "../direction.h"
+#include "../openttd.h"
+#include "../direction_type.h"
 #include "../rail.h"
 #include "../rail_map.h"
 #include "dbg_helpers.h"
--- a/src/misc/fixedsizearray.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/misc/fixedsizearray.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -34,7 +34,7 @@
 	CFixedSizeArrayT()
 	{
 		// allocate block for header + items (don't construct items)
-		m_items = (Titem*)(((int8*)malloc(ThdrSize + Tcapacity * sizeof(Titem))) + ThdrSize);
+		m_items = (Titem*)((MallocT<int8>(ThdrSize + Tcapacity * sizeof(Titem))) + ThdrSize);
 		SizeRef() = 0; // initial number of items
 		RefCnt() = 1; // initial reference counter
 	}
--- a/src/misc_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/misc_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,20 +4,26 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
-#include "string.h"
-#include "table/strings.h"
-#include "command.h"
-#include "player.h"
-#include "gfx.h"
-#include "window.h"
+#include "command_func.h"
+#include "economy_func.h"
 #include "gui.h"
-#include "economy.h"
+#include "window_func.h"
+#include "textbuf_gui.h"
 #include "network/network.h"
 #include "variables.h"
 #include "livery.h"
 #include "player_face.h"
-#include "strings.h"
+#include "strings_func.h"
+#include "gfx_func.h"
+#include "functions.h"
+#include "vehicle_func.h"
+#include "string_func.h"
+#include "player_func.h"
+#include "player_base.h"
+#include "player_gui.h"
+#include "settings_type.h"
+
+#include "table/strings.h"
 
 /** Change the player's face.
  * @param tile unused
@@ -155,7 +161,7 @@
 		InvalidatePlayerWindows(p);
 	}
 
-	return CommandCost();
+	return CommandCost(EXPENSES_OTHER);
 }
 
 /** Decrease the loan of your company.
@@ -219,23 +225,17 @@
  */
 CommandCost CmdChangeCompanyName(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	StringID str;
 	Player *p;
 
 	if (StrEmpty(_cmd_text)) return CMD_ERROR;
 
 	if (!IsUniqueCompanyName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
 
-	str = AllocateName(_cmd_text, 4);
-	if (str == 0) return CMD_ERROR;
-
 	if (flags & DC_EXEC) {
 		p = GetPlayer(_current_player);
-		DeleteName(p->name_1);
-		p->name_1 = str;
+		free(p->name);
+		p->name = strdup(_cmd_text);
 		MarkWholeScreenDirty();
-	} else {
-		DeleteName(str);
 	}
 
 	return CommandCost();
@@ -264,20 +264,16 @@
  */
 CommandCost CmdChangePresidentName(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	StringID str;
 	Player *p;
 
 	if (StrEmpty(_cmd_text)) return CMD_ERROR;
 
 	if (!IsUniquePresidentName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
 
-	str = AllocateName(_cmd_text, 4);
-	if (str == 0) return CMD_ERROR;
-
 	if (flags & DC_EXEC) {
 		p = GetPlayer(_current_player);
-		DeleteName(p->president_name_1);
-		p->president_name_1 = str;
+		free(p->president_name);
+		p->president_name = strdup(_cmd_text);
 
 		if (p->name_1 == STR_SV_UNNAMED) {
 			char buf[80];
@@ -287,13 +283,22 @@
 			DoCommand(0, 0, 0, DC_EXEC, CMD_CHANGE_COMPANY_NAME);
 		}
 		MarkWholeScreenDirty();
-	} else {
-		DeleteName(str);
 	}
 
 	return CommandCost();
 }
 
+/**
+ * In case of an unsafe unpause, we want the
+ * user to confirm that it might crash.
+ * @param w         unused
+ * @param confirmed whether the user confirms his/her action
+ */
+static void AskUnsafeUnpauseCallback(Window *w, bool confirmed)
+{
+	DoCommandP(0, confirmed ? 0 : 1, 0, NULL, CMD_PAUSE);
+}
+
 /** Pause/Unpause the game (server-only).
  * Increase or decrease the pause counter. If the counter is zero,
  * the game is unpaused. A counter is used instead of a boolean value
@@ -306,8 +311,25 @@
 CommandCost CmdPause(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	if (flags & DC_EXEC) {
-		_pause_game += (p1 == 1) ? 1 : -1;
-		if (_pause_game == (byte)-1) _pause_game = 0;
+		_pause_game += (p1 == 0) ? -1 : 1;
+
+		switch (_pause_game) {
+			case (byte)-4:
+			case (byte)-1:
+				_pause_game = 0;
+				break;
+			case (byte)-3:
+				ShowQuery(
+					STR_NEWGRF_UNPAUSE_WARNING_TITLE,
+					STR_NEWGRF_UNPAUSE_WARNING,
+					NULL,
+					AskUnsafeUnpauseCallback
+				);
+				break;
+
+			default: break;
+		}
+
 		InvalidateWindow(WC_STATUS_BAR, 0);
 		InvalidateWindow(WC_MAIN_TOOLBAR, 0);
 	}
@@ -327,8 +349,7 @@
 #ifndef _DEBUG
 	if (_networking) return CMD_ERROR;
 #endif
-	SET_EXPENSES_TYPE(EXPENSES_OTHER);
-	return CommandCost(-(Money)p1);
+	return CommandCost(EXPENSES_OTHER, -(Money)p1);
 }
 
 /** Transfer funds (money) from one player to another.
@@ -345,9 +366,7 @@
 	if (!_patches.give_money) return CMD_ERROR;
 
 	const Player *p = GetPlayer(_current_player);
-	CommandCost amount(min((Money)p1, (Money)20000000LL));
-
-	SET_EXPENSES_TYPE(EXPENSES_OTHER);
+	CommandCost amount(EXPENSES_OTHER, min((Money)p1, (Money)20000000LL));
 
 	/* You can only transfer funds that is in excess of your loan */
 	if (p->player_money - p->current_loan < amount.GetCost() || amount.GetCost() <= 0) return CMD_ERROR;
@@ -357,7 +376,7 @@
 		/* Add money to player */
 		PlayerID old_cp = _current_player;
 		_current_player = (PlayerID)p2;
-		SubtractMoneyFromPlayer(CommandCost(-amount.GetCost()));
+		SubtractMoneyFromPlayer(CommandCost(EXPENSES_OTHER, -amount.GetCost()));
 		_current_player = old_cp;
 	}
 
--- a/src/misc_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/misc_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,43 +6,48 @@
 #include "openttd.h"
 #include "heightmap.h"
 #include "debug.h"
-#include "functions.h"
 #include "landscape.h"
 #include "newgrf.h"
 #include "newgrf_text.h"
 #include "saveload.h"
-#include "strings.h"
+#include "tile_map.h"
+#include "gui.h"
+#include "window_gui.h"
+#include "station_gui.h"
+#include "textbuf_gui.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "station.h"
+#include "command_func.h"
+#include "player_func.h"
+#include "player_base.h"
+#include "town.h"
+#include "network/network.h"
+#include "variables.h"
+#include "train.h"
+#include "tgp.h"
+#include "cargotype.h"
+#include "player_face.h"
+#include "strings_func.h"
+#include "fileio.h"
+#include "fios.h"
+#include "tile_cmd.h"
+#include "zoom_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "sound_func.h"
+#include "string_func.h"
+#include "player_gui.h"
+#include "settings_type.h"
+
 #include "table/sprites.h"
 #include "table/strings.h"
-#include "strings.h"
 #include "table/tree_land.h"
-#include "map.h"
-#include "window.h"
-#include "gui.h"
-#include "viewport.h"
-#include "gfx.h"
-#include "station.h"
-#include "command.h"
-#include "player.h"
-#include "town.h"
-#include "sound.h"
-#include "network/network.h"
-#include "string.h"
-#include "variables.h"
-#include "vehicle.h"
-#include "train.h"
-#include "tgp.h"
-#include "settings.h"
-#include "date.h"
-#include "cargotype.h"
-#include "player_face.h"
-#include "fileio.h"
 
-#include "fileio.h"
-#include "fios.h"
 /* Variables to display file lists */
 FiosItem *_fios_list;
-int _saveload_mode;
+SaveLoadDialogMode _saveload_mode;
 
 
 static bool _fios_path_changed;
@@ -210,18 +215,22 @@
 	"Original graphics by Simon Foster",
 	"",
 	"The OpenTTD team (in alphabetical order):",
-	"  Jean-Francois Claeys (Belugas) - In training, not yet specialized",
-	"  Bjarni Corfitzen (Bjarni) - MacOSX port, coder",
-	"  Matthijs Kooijman (blathijs) - Pathfinder-guru",
-	"  Victor Fischer (Celestar) - Programming everywhere you need him to",
-	"  Tamás Faragó (Darkvater) - Lead coder",
-	"  Loïc Guilloux (glx) - In training, not yet specialized",
+	"  Jean-Francois Claeys (Belugas) - GUI, newindustries and more",
+	"  Bjarni Corfitzen (Bjarni) - MacOSX port, coder and vehicles",
+	"  Matthijs Kooijman (blathijs) - Pathfinder-guru, pool rework",
+	"  Loïc Guilloux (glx) - General coding",
 	"  Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;)",
 	"  Jonathan Coome (Maedhros) - High priest of the newGRF Temple",
 	"  Attila Bán (MiHaMiX) - WebTranslator, Nightlies, Wiki and bugtracker host",
 	"  Owen Rudge (orudge) - Forum host, OS/2 port",
-	"  Peter Nelson (peter1138) - Spiritual descendant from newgrf gods",
-	"  Remko Bijker (Rubidium) - THE desync hunter",
+	"  Peter Nelson (peter1138) - Spiritual descendant from newGRF gods",
+	"  Remko Bijker (Rubidium) - Lead coder and way more",
+	"  Benedikt Brüggemeier (skidd13) - Bug fixer and code reworker",
+	"  Zdenek Sojka (SmatZ) - Bug finder and fixer",
+	"",
+	"Inactive Developers:",
+	"  Victor Fischer (Celestar) - Programming everywhere you need him to",
+	"  Tamás Faragó (Darkvater) - Ex-Lead coder",
 	"  Christoph Mallon (Tron) - Programmer, code correctness police",
 	"",
 	"Retired Developers:",
@@ -233,9 +242,9 @@
 	"Special thanks go out to:",
 	"  Josef Drexler - For his great work on TTDPatch",
 	"  Marcin Grzegorczyk - For his documentation of TTD internals",
-	"  Petr Baudis (pasky) - Many patches, newgrf support",
+	"  Petr Baudis (pasky) - Many patches, newGRF support",
 	"  Stefan Meißner (sign_de) - For his work on the console",
-	"  Simon Sasburg (HackyKid) - Many bugfixes he has blessed us with (and PBS)",
+	"  Simon Sasburg (HackyKid) - Many bugfixes he has blessed us with",
 	"  Cian Duffy (MYOB) - BeOS port / manual writing",
 	"  Christian Rosentreter (tokai) - MorphOS / AmigaOS port",
 	"  Richard Kempton (richK) - additional airports, initial TGP implementation",
@@ -256,7 +265,7 @@
 {
 	switch (e->event) {
 	case WE_CREATE: // Set up window counter and start position of scroller
-		WP(w, scroller_d).counter = 0;
+		WP(w, scroller_d).counter = 5;
 		WP(w, scroller_d).height = w->height - 40;
 		break;
 	case WE_PAINT: {
@@ -282,8 +291,9 @@
 		DoDrawStringCentered(210, w->height - 25, "Website: http://www.openttd.org", TC_BLACK);
 		DrawStringCentered(210, w->height - 15, STR_00BA_COPYRIGHT_OPENTTD, TC_FROMSTRING);
 	} break;
-	case WE_MOUSELOOP: // Timer to scroll the text and adjust the new top
-		if (WP(w, scroller_d).counter++ % 3 == 0) {
+	case WE_TICK: // Timer to scroll the text and adjust the new top
+		if (--WP(w, scroller_d).counter == 0) {
+			WP(w, scroller_d).counter = 5;
 			WP(w, scroller_d).height--;
 			SetWindowDirty(w);
 		}
@@ -338,8 +348,8 @@
 
 		DrawWindowWidgets(w);
 
-		WP(w,tree_d).base = i = _tree_base_by_landscape[_opt.landscape];
-		WP(w,tree_d).count = count = _tree_count_by_landscape[_opt.landscape];
+		WP(w, tree_d).base = i = _tree_base_by_landscape[_opt.landscape];
+		WP(w, tree_d).count = count = _tree_count_by_landscape[_opt.landscape];
 
 		x = 18;
 		y = 54;
@@ -364,10 +374,10 @@
 		case 3: case 4: case 5: case 6:
 		case 7: case 8: case 9: case 10:
 		case 11:case 12: case 13: case 14:
-			if (wid - 3 >= WP(w,tree_d).count) break;
+			if (wid - 3 >= WP(w, tree_d).count) break;
 
 			if (HandlePlacePushButton(w, wid, SPR_CURSOR_TREE, VHM_RECT, NULL))
-				_tree_to_plant = WP(w,tree_d).base + wid - 3;
+				_tree_to_plant = WP(w, tree_d).base + wid - 3;
 			break;
 
 		case 15: // tree of random type.
@@ -406,7 +416,7 @@
 		break;
 
 	case WE_ABORT_PLACE_OBJ:
-		RaiseWindowButtons(w);
+		w->RaiseButtons();
 		break;
 	}
 }
@@ -721,7 +731,7 @@
 void GuiShowTooltipsWithArgs(StringID str, uint paramcount, const uint64 params[])
 {
 	char buffer[512];
-	BoundingRect br;
+	Dimension br;
 	Window *w;
 	uint i;
 	int x, y;
@@ -772,7 +782,7 @@
 	b = InlineString(b, STR_000D_ACCEPTS);
 
 	for (CargoID i = 0; i < NUM_CARGO; i++) {
-		if (b >= lastof(_userstring) - 5) break;
+		if (b >= lastof(_userstring) - (1 + 2 * 4)) break; // ',' or ' ' and two calls to Utf8Encode()
 		switch (sct) {
 			case SCT_PASSENGERS_ONLY: if (!IsCargoInClass(i, CC_PASSENGERS)) continue; break;
 			case SCT_NON_PASSENGERS_ONLY: if (IsCargoInClass(i, CC_PASSENGERS)) continue; break;
@@ -795,6 +805,10 @@
 	if (first) b = InlineString(b, STR_00D0_NOTHING);
 
 	*b = '\0';
+
+	/* Make sure we detect any buffer overflow */
+	assert(b < endof(_userstring));
+
 	DrawStringMultiLine(str_x, str_y, STR_SPEC_USERSTRING, 144);
 }
 
@@ -1016,24 +1030,24 @@
 	case WKC_RETURN: case WKC_NUM_ENTER: return 1;
 	case (WKC_CTRL | 'V'):
 		if (InsertTextBufferClipboard(&string->text))
-			InvalidateWidget(w, wid);
+			w->InvalidateWidget(wid);
 		break;
 	case (WKC_CTRL | 'U'):
 		DeleteTextBufferAll(&string->text);
-		InvalidateWidget(w, wid);
+		w->InvalidateWidget(wid);
 		break;
 	case WKC_BACKSPACE: case WKC_DELETE:
 		if (DeleteTextBufferChar(&string->text, e->we.keypress.keycode))
-			InvalidateWidget(w, wid);
+			w->InvalidateWidget(wid);
 		break;
 	case WKC_LEFT: case WKC_RIGHT: case WKC_END: case WKC_HOME:
 		if (MoveTextBufferPos(&string->text, e->we.keypress.keycode))
-			InvalidateWidget(w, wid);
+			w->InvalidateWidget(wid);
 		break;
 	default:
 		if (IsValidChar(e->we.keypress.key, string->afilter)) {
 			if (InsertTextBufferChar(&string->text, e->we.keypress.key)) {
-				InvalidateWidget(w, wid);
+				w->InvalidateWidget(wid);
 			}
 		} else { // key wasn't caught. Continue only if standard entry specified
 			e->we.keypress.cont = (string->afilter == CS_ALPHANUMERAL);
@@ -1057,7 +1071,7 @@
 
 void HandleEditBox(Window *w, querystr_d *string, int wid)
 {
-	if (HandleCaret(&string->text)) InvalidateWidget(w, wid);
+	if (HandleCaret(&string->text)) w->InvalidateWidget(wid);
 }
 
 void DrawEditBox(Window *w, querystr_d *string, int wid)
@@ -1491,11 +1505,7 @@
 		}
 
 		GfxFillRect(w->widget[7].left + 1, w->widget[7].top + 1, w->widget[7].right, w->widget[7].bottom, 0xD7);
-		DoDrawString(
-			_savegame_sort_order & SORT_DESCENDING ? DOWNARROW : UPARROW,
-			_savegame_sort_order & SORT_BY_NAME ? w->widget[2].right - 9 : w->widget[3].right - 9,
-			15, TC_BLACK
-		);
+		DrawSortButtonState(w, _savegame_sort_order & SORT_BY_NAME ? 2 : 3, _savegame_sort_order & SORT_DESCENDING ? SBS_DOWN : SBS_UP);
 
 		y = w->widget[7].top + 1;
 		for (pos = w->vscroll.pos; pos < _fios_num; pos++) {
@@ -1564,7 +1574,7 @@
 					/* SLD_SAVE_GAME, SLD_SAVE_SCENARIO copy clicked name to editbox */
 					ttd_strlcpy(WP(w, querystr_d).text.buf, file->title, WP(w, querystr_d).text.maxlength);
 					UpdateTextBufferSize(&WP(w, querystr_d).text);
-					InvalidateWidget(w, 10);
+					w->InvalidateWidget(10);
 				}
 			} else {
 				/* Changed directory, need repaint. */
@@ -1591,7 +1601,7 @@
 
 		if (_saveload_mode == SLD_SAVE_GAME || _saveload_mode == SLD_SAVE_SCENARIO) {
 			if (HandleEditBoxKey(w, &WP(w, querystr_d), 10, e) == 1) // Press Enter
-					HandleButtonClick(w, 12);
+					w->HandleButtonClick(12);
 		}
 		break;
 	case WE_TIMEOUT:
@@ -1661,7 +1671,18 @@
 	SaveLoadDlgWndProc,
 };
 
-void ShowSaveLoadDialog(int mode)
+/** These values are used to convert the file/operations mode into a corresponding file type.
+ * So each entry, as expressed by the related comment, is based on the enum   */
+static const FileType _file_modetotype[] = {
+	FT_SAVEGAME,  ///< used for SLD_LOAD_GAME
+	FT_SCENARIO,  ///< used for SLD_LOAD_SCENARIO
+	FT_SAVEGAME,  ///< used for SLD_SAVE_GAME
+	FT_SCENARIO,  ///< used for SLD_SAVE_SCENARIO
+	FT_HEIGHTMAP, ///< used for SLD_LOAD_HEIGHTMAP
+	FT_SAVEGAME,  ///< SLD_NEW_GAME
+};
+
+void ShowSaveLoadDialog(SaveLoadDialogMode mode)
 {
 	static const StringID saveload_captions[] = {
 		STR_4001_LOAD_GAME,
@@ -1682,6 +1703,9 @@
 	_saveload_mode = mode;
 	SetBit(_no_scroll, SCROLL_SAVE);
 
+	/* Use an array to define what will be the current file type being handled
+	 * by current file mode */
+	_file_to_saveload.filetype = _file_modetotype[mode];
 	switch (mode) {
 		case SLD_SAVE_GAME:     GenerateFileName(); break;
 		case SLD_SAVE_SCENARIO: strcpy(_edit_str_buf, "UNNAMED"); break;
@@ -1847,7 +1871,7 @@
 {
 	switch (e->event) {
 	case WE_PAINT: {
-		int clk = WP(w,def_d).data_1;
+		int clk = WP(w, def_d).data_1;
 		int x, y;
 		int i;
 
@@ -1926,7 +1950,7 @@
 
 			switch (ce->type) {
 			case SLE_BOOL:
-				if (ce->flags & CE_CLICK) WP(w,def_d).data_1 = btn * 2 + 1;
+				if (ce->flags & CE_CLICK) WP(w, def_d).data_1 = btn * 2 + 1;
 				value ^= 1;
 				if (ce->proc != NULL) ce->proc(value, 0);
 				break;
@@ -1944,7 +1968,7 @@
 				value = ce->proc(value, (x >= 30) ? 1 : -1);
 
 				if (value != oldvalue) {
-					WP(w,def_d).data_1 = btn * 2 + 1 + ((x >= 30) ? 1 : 0);
+					WP(w, def_d).data_1 = btn * 2 + 1 + ((x >= 30) ? 1 : 0);
 				}
 			} break;
 			}
@@ -1960,7 +1984,7 @@
 		}
 		break;
 	case WE_TIMEOUT:
-		WP(w,def_d).data_1 = 0;
+		WP(w, def_d).data_1 = 0;
 		SetWindowDirty(w);
 		break;
 	}
--- a/src/music/dmusic.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/music/dmusic.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -15,6 +15,7 @@
 #include <dmusicc.h>
 #include <dmusicf.h>
 
+static FMusicDriver_DMusic iFMusicDriver_DMusic;
 
 /** the performance object controls manipulation of the segments */
 static IDirectMusicPerformance* performance = NULL;
--- a/src/music/extmidi.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/music/extmidi.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,8 +3,7 @@
 #ifndef __MORPHOS__
 #include "../stdafx.h"
 #include "../openttd.h"
-#include "../sound.h"
-#include "../string.h"
+#include "../sound_func.h"
 #include "../variables.h"
 #include "../debug.h"
 #include "extmidi.h"
--- a/src/music/libtimidity.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/music/libtimidity.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -2,8 +2,7 @@
 
 #include "../stdafx.h"
 #include "../openttd.h"
-#include "../sound.h"
-#include "../string.h"
+#include "../sound_type.h"
 #include "../variables.h"
 #include "../debug.h"
 #include "libtimidity.h"
--- a/src/music/music_driver.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/music/music_driver.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -31,5 +31,6 @@
 };
 
 extern MusicDriver *_music_driver;
+extern char _ini_musicdriver[32];
 
 #endif /* MUSIC_MUSIC_DRIVER_HPP */
--- a/src/music_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/music_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,18 +4,19 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/strings.h"
-#include "table/sprites.h"
-#include "strings.h"
-#include "functions.h"
 #include "fileio.h"
-#include "window.h"
-#include "gfx.h"
-#include "sound.h"
-#include "macros.h"
 #include "variables.h"
 #include "music.h"
 #include "music/music_driver.hpp"
+#include "window_gui.h"
+#include "strings_func.h"
+#include "window_func.h"
+#include "sound_func.h"
+#include "gfx_func.h"
+#include "core/math_func.hpp"
+
+#include "table/strings.h"
+#include "table/sprites.h"
 
 static byte _music_wnd_cursong;
 static bool _song_is_active;
--- a/src/namegen.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/namegen.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,10 +5,10 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "macros.h"
 #include "namegen.h"
+#include "string_func.h"
+
 #include "table/namegen.h"
-#include "string.h"
 
 static inline uint32 SeedChance(int shift_by, int max, uint32 seed)
 {
--- a/src/namegen.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/namegen.h	Tue Jan 22 21:00:30 2008 +0000
@@ -1,6 +1,6 @@
 /* $Id$ */
 
-/** @file src/namegen.h Town name generator stuff */
+/** @file namegen.h Town name generator stuff. */
 
 #ifndef NAMEGEN_H
 #define NAMEGEN_H
--- a/src/network/core/game.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/core/game.h	Tue Jan 22 21:00:30 2008 +0000
@@ -11,8 +11,8 @@
 #ifdef ENABLE_NETWORK
 
 #include "config.h"
-#include "../../date.h"
 #include "../../newgrf_config.h"
+#include "../../date_type.h"
 
 /**
  * This is the struct used by both client and server
--- a/src/network/core/packet.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/core/packet.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -7,9 +7,7 @@
 #ifdef ENABLE_NETWORK
 
 #include "../../stdafx.h"
-#include "../../macros.h"
-#include "../../string.h"
-#include "../../helpers.hpp"
+#include "../../string_func.h"
 
 #include "packet.h"
 
--- a/src/network/core/tcp.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/core/tcp.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -10,13 +10,12 @@
 #include "../../debug.h"
 #include "../../openttd.h"
 #include "../../variables.h"
-#include "table/strings.h"
-#include "../../functions.h"
 
 #include "../network_data.h"
 #include "packet.h"
 #include "tcp.h"
-#include "../../helpers.hpp"
+
+#include "table/strings.h"
 
 /** Very ugly temporary hack !!! */
 void NetworkTCPSocketHandler::Initialize()
--- a/src/network/core/tcp.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/core/tcp.h	Tue Jan 22 21:00:30 2008 +0000
@@ -12,6 +12,7 @@
 #include "os_abstraction.h"
 #include "core.h"
 #include "packet.h"
+#include "../../tile_type.h"
 
 /**
  * Enum with all types of UDP packets.
--- a/src/network/core/udp.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/core/udp.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -8,8 +8,10 @@
 
 #include "../../stdafx.h"
 #include "../../debug.h"
-#include "../../macros.h"
-#include "../../helpers.hpp"
+#include "../../core/bitmath_func.hpp"
+#include "../../core/math_func.hpp"
+#include "../../core/alloc_func.hpp"
+#include "../../date_func.h"
 #include "packet.h"
 #include "udp.h"
 
--- a/src/network/network.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/network.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,21 +3,16 @@
 #include "../stdafx.h"
 #include "network_data.h"
 
-extern const char _openttd_revision[];
-
 #ifdef ENABLE_NETWORK
 
 #include "../openttd.h"
 #include "../debug.h"
-#include "../functions.h"
-#include "../string.h"
-#include "../strings.h"
-#include "../map.h"
-#include "../command.h"
+#include "../strings_func.h"
+#include "../map_func.h"
+#include "../command_func.h"
 #include "../variables.h"
-#include "../date.h"
+#include "../date_func.h"
 #include "../newgrf_config.h"
-#include "table/strings.h"
 #include "network_client.h"
 #include "network_server.h"
 #include "network_udp.h"
@@ -30,6 +25,23 @@
 #include <stdarg.h> /* va_list */
 #include "../md5.h"
 #include "../fileio.h"
+#include "../texteff.hpp"
+#include "../core/random_func.hpp"
+#include "../window_func.h"
+#include "../string_func.h"
+#include "../player_func.h"
+#include "../settings_type.h"
+#ifdef DEBUG_DUMP_COMMANDS
+	#include "../core/alloc_func.hpp"
+#endif /* DEBUG_DUMP_COMMANDS */
+
+#include "table/strings.h"
+
+bool _network_reload_cfg;
+bool _network_server;     ///< network-server is active
+bool _network_available;  ///< is network mode available?
+bool _network_dedicated;  ///< are we a dedicated server?
+bool _network_advertise;  ///< is the server advertising to the master server?
 
 /* Check whether NETWORK_NUM_LANDSCAPES is still in sync with NUM_LANDSCAPE */
 assert_compile((int)NETWORK_NUM_LANDSCAPES == (int)NUM_LANDSCAPE);
@@ -188,9 +200,7 @@
 			break;
 	}
 
-#ifdef DEBUG_DUMP_COMMANDS
-	debug_dump_commands("ddc:cmsg:%d;%d;%s\n", _date, _date_fract, message);
-#endif /* DUMP_COMMANDS */
+	DebugDumpCommands("ddc:cmsg:%d;%d;%s\n", _date, _date_fract, message);
 	IConsolePrintF(color, "%s", message);
 	AddChatMessage(color, duration, "%s", message);
 }
@@ -1194,8 +1204,7 @@
 		if (_frame_counter > cp->frame) {
 			// If we reach here, it means for whatever reason, we've already executed
 			// past the command we need to execute.
-			DEBUG(net, 0, "Trying to execute a packet in the past!");
-			assert(0);
+			error("[net] Trying to execute a packet in the past!");
 		}
 
 		// We can execute this command
@@ -1231,9 +1240,7 @@
 			if (_sync_seed_1 != _random_seeds[0][0]) {
 #endif
 				NetworkError(STR_NETWORK_ERR_DESYNC);
-#ifdef DEBUG_DUMP_COMMANDS
-				debug_dump_commands("ddc:serr:%d;%d\n", _date, _date_fract);
-#endif /* DUMP_COMMANDS */
+				DebugDumpCommands("ddc:serr:%d;%d\n", _date, _date_fract);
 				DEBUG(net, 0, "Sync error detected!");
 				NetworkClientError(NETWORK_RECV_STATUS_DESYNC, DEREF_CLIENT(0));
 				return false;
@@ -1308,7 +1315,7 @@
 			sscanf(&buff[8], "%d;%d;%d;%d;%d;%d;%d;%s", &next_date, &next_date_fract, &player, &cp->tile, &cp->p1, &cp->p2, &cp->cmd, cp->text);
 			cp->player = (Owner)player;
 		}
-#endif /* DUMP_COMMANDS */
+#endif /* DEBUG_DUMP_COMMANDS */
 
 		bool send_frame = false;
 
@@ -1350,8 +1357,8 @@
 
 static void NetworkGenerateUniqueId()
 {
-	md5_state_t state;
-	md5_byte_t digest[16];
+	Md5 checksum;
+	uint8 digest[16];
 	char hex_output[16*2 + 1];
 	char coding_string[NETWORK_NAME_LENGTH];
 	int di;
@@ -1359,9 +1366,8 @@
 	snprintf(coding_string, sizeof(coding_string), "%d%s", (uint)Random(), "OpenTTD Unique ID");
 
 	/* Generate the MD5 hash */
-	md5_init(&state);
-	md5_append(&state, (const md5_byte_t*)coding_string, strlen(coding_string));
-	md5_finish(&state, digest);
+	checksum.Append((const uint8*)coding_string, strlen(coding_string));
+	checksum.Finish(digest);
 
 	for (di = 0; di < 16; ++di)
 		sprintf(hex_output + di * 2, "%02x", digest[di]);
@@ -1463,18 +1469,7 @@
 	return strncmp(_openttd_revision, other, NETWORK_REVISION_LENGTH - 1) == 0;
 }
 
-#ifdef DEBUG_DUMP_COMMANDS
-void CDECL debug_dump_commands(const char *s, ...)
-{
-	static FILE *f = FioFOpenFile("commands-out.log", "wb", SAVE_DIR);
-	if (f == NULL) return;
+#endif /* ENABLE_NETWORK */
 
-	va_list va;
-	va_start(va, s);
-	vfprintf(f, s, va);
-	va_end(va);
-
-	fflush(f);
-}
-#endif /* DEBUG_DUMP_COMMANDS */
-#endif /* ENABLE_NETWORK */
+/* NOTE: this variable needs to be always available */
+PlayerID _network_playas;
--- a/src/network/network.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/network.h	Tue Jan 22 21:00:30 2008 +0000
@@ -3,223 +3,19 @@
 #ifndef NETWORK_H
 #define NETWORK_H
 
+#include "../player_type.h"
+
 #ifdef ENABLE_NETWORK
 
-#include "../player.h"
-#include "core/config.h"
-#include "core/game.h"
-
-// If this line is enable, every frame will have a sync test
-//  this is not needed in normal games. Normal is like 1 sync in 100
-//  frames. You can enable this if you have a lot of desyncs on a certain
-//  game.
-// Remember: both client and server have to be compiled with this
-//  option enabled to make it to work. If one of the two has it disabled
-//  nothing will happen.
-//#define ENABLE_NETWORK_SYNC_EVERY_FRAME
-
-/*
- * Dumps all commands that are sent/received to stderr and saves every month.
- * This log can become quite large over time; say in the order of two to three
- * times the bandwidth used for network games.
- */
-//#define DEBUG_DUMP_COMMANDS
-
-#ifdef DEBUG_DUMP_COMMANDS
-void CDECL debug_dump_commands(const char *s, ...);
-#endif /* DEBUG_DUMP_COMMANDS */
-
-// In theory sending 1 of the 2 seeds is enough to check for desyncs
-//   so in theory, this next define can be left off.
-//#define NETWORK_SEND_DOUBLE_SEED
-
-// How many clients can we have? Like.. MAX_PLAYERS - 1 is the amount of
-//  players that can really play.. so.. a max of 4 spectators.. gives us..
-//  MAX_PLAYERS + 3
-#define MAX_CLIENTS (MAX_PLAYERS + 3)
-
-
-// Do not change this next line. It should _ALWAYS_ be MAX_CLIENTS + 1
-#define MAX_CLIENT_INFO (MAX_CLIENTS + 1)
-
-#define MAX_INTERFACES 9
-
-
-// How many vehicle/station types we put over the network
-#define NETWORK_VEHICLE_TYPES 5
-#define NETWORK_STATION_TYPES 5
-
-struct NetworkPlayerInfo {
-	char company_name[NETWORK_NAME_LENGTH];         // Company name
-	char password[NETWORK_PASSWORD_LENGTH];         // The password for the player
-	Year inaugurated_year;                          // What year the company started in
-	Money company_value;                            // The company value
-	Money money;                                    // The amount of money the company has
-	Money income;                                   // How much did the company earned last year
-	uint16 performance;                             // What was his performance last month?
-	bool use_password;                              // Is there a password
-	uint16 num_vehicle[NETWORK_VEHICLE_TYPES];      // How many vehicles are there of this type?
-	uint16 num_station[NETWORK_STATION_TYPES];      // How many stations are there of this type?
-	char players[NETWORK_PLAYERS_LENGTH];           // The players that control this company (Name1, name2, ..)
-	uint16 months_empty;                            // How many months the company is empty
-};
-
-struct NetworkClientInfo {
-	uint16 client_index;                            // Index of the client (same as ClientState->index)
-	char client_name[NETWORK_CLIENT_NAME_LENGTH];   // Name of the client
-	byte client_lang;                               // The language of the client
-	PlayerID client_playas;                         // As which player is this client playing (PlayerID)
-	uint32 client_ip;                               // IP-address of the client (so he can be banned)
-	Date join_date;                                 // Gamedate the player has joined
-	char unique_id[NETWORK_UNIQUE_ID_LENGTH];       // Every play sends an unique id so we can indentify him
-};
-
-enum NetworkJoinStatus {
-	NETWORK_JOIN_STATUS_CONNECTING,
-	NETWORK_JOIN_STATUS_AUTHORIZING,
-	NETWORK_JOIN_STATUS_WAITING,
-	NETWORK_JOIN_STATUS_DOWNLOADING,
-	NETWORK_JOIN_STATUS_PROCESSING,
-	NETWORK_JOIN_STATUS_REGISTERING,
-
-	NETWORK_JOIN_STATUS_GETTING_COMPANY_INFO,
-};
+void NetworkStartUp();
+void NetworkShutDown();
 
-/* Language ids for server_lang and client_lang. Do NOT modify the order. */
-enum NetworkLanguage {
-	NETLANG_ANY = 0,
-	NETLANG_ENGLISH,
-	NETLANG_GERMAN,
-	NETLANG_FRENCH,
-	NETLANG_BRAZILIAN,
-	NETLANG_BULGARIAN,
-	NETLANG_CHINESE,
-	NETLANG_CZECH,
-	NETLANG_DANISH,
-	NETLANG_DUTCH,
-	NETLANG_ESPERANTO,
-	NETLANG_FINNISH,
-	NETLANG_HUNGARIAN,
-	NETLANG_ICELANDIC,
-	NETLANG_ITALIAN,
-	NETLANG_JAPANESE,
-	NETLANG_KOREAN,
-	NETLANG_LITHUANIAN,
-	NETLANG_NORWEGIAN,
-	NETLANG_POLISH,
-	NETLANG_PORTUGUESE,
-	NETLANG_ROMANIAN,
-	NETLANG_RUSSIAN,
-	NETLANG_SLOVAK,
-	NETLANG_SLOVENIAN,
-	NETLANG_SPANISH,
-	NETLANG_SWEDISH,
-	NETLANG_TURKISH,
-	NETLANG_UKRAINIAN,
-	NETLANG_COUNT
-};
-
-VARDEF NetworkGameInfo _network_game_info;
-VARDEF NetworkPlayerInfo _network_player_info[MAX_PLAYERS];
-VARDEF NetworkClientInfo _network_client_info[MAX_CLIENT_INFO];
-
-VARDEF char _network_player_name[NETWORK_CLIENT_NAME_LENGTH];
-VARDEF char _network_default_ip[NETWORK_HOSTNAME_LENGTH];
-
-VARDEF uint16 _network_own_client_index;
-VARDEF char _network_unique_id[NETWORK_UNIQUE_ID_LENGTH]; // Our own unique ID
-
-VARDEF uint32 _frame_counter_server; // The frame_counter of the server, if in network-mode
-VARDEF uint32 _frame_counter_max; // To where we may go with our clients
-
-VARDEF uint32 _last_sync_frame; // Used in the server to store the last time a sync packet was sent to clients.
-
-// networking settings
-VARDEF uint32 _broadcast_list[MAX_INTERFACES + 1];
-
-VARDEF uint16 _network_server_port;
-/* We use bind_ip and bind_ip_host, where bind_ip_host is the readable form of
-    bind_ip_host, and bind_ip the numeric value, because we want a nice number
-    in the openttd.cfg, but we wants to use the uint32 internally.. */
-VARDEF uint32 _network_server_bind_ip;
-VARDEF char _network_server_bind_ip_host[NETWORK_HOSTNAME_LENGTH];
-VARDEF bool _is_network_server; // Does this client wants to be a network-server?
-VARDEF char _network_server_name[NETWORK_NAME_LENGTH];
-VARDEF char _network_server_password[NETWORK_PASSWORD_LENGTH];
-VARDEF char _network_rcon_password[NETWORK_PASSWORD_LENGTH];
-VARDEF char _network_default_company_pass[NETWORK_PASSWORD_LENGTH];
-
-VARDEF uint16 _network_max_join_time;             ///< Time a client can max take to join
-VARDEF bool _network_pause_on_join;               ///< Pause the game when a client tries to join (more chance of succeeding join)
-
-VARDEF uint16 _redirect_console_to_client;
-
-VARDEF uint16 _network_sync_freq;
-VARDEF uint8 _network_frame_freq;
-
-VARDEF uint32 _sync_seed_1, _sync_seed_2;
-VARDEF uint32 _sync_frame;
-VARDEF bool _network_first_time;
-// Vars needed for the join-GUI
-VARDEF NetworkJoinStatus _network_join_status;
-VARDEF uint8 _network_join_waiting;
-VARDEF uint16 _network_join_kbytes;
-VARDEF uint16 _network_join_kbytes_total;
-
-VARDEF char _network_last_host[NETWORK_HOSTNAME_LENGTH];
-VARDEF short _network_last_port;
-VARDEF uint32 _network_last_host_ip;
-VARDEF uint8 _network_reconnect;
-
-VARDEF bool _network_udp_server;
-VARDEF uint16 _network_udp_broadcast;
-
-VARDEF byte _network_lan_internet;
-
-VARDEF bool _network_need_advertise;
-VARDEF uint32 _network_last_advertise_frame;
-VARDEF uint8 _network_advertise_retries;
-
-VARDEF bool _network_autoclean_companies;
-VARDEF uint8 _network_autoclean_unprotected; // Remove a company after X months
-VARDEF uint8 _network_autoclean_protected;   // Unprotect a company after X months
-
-VARDEF Year _network_restart_game_year;      // If this year is reached, the server automaticly restarts
-VARDEF uint8 _network_min_players;           // Minimum number of players for game to unpause
-
-void NetworkTCPQueryServer(const char* host, unsigned short port);
-
-byte NetworkSpectatorCount();
-
-VARDEF char *_network_host_list[10];
-VARDEF char *_network_ban_list[25];
-
-void ParseConnectionString(const char **player, const char **port, char *connection_string);
-void NetworkUpdateClientInfo(uint16 client_index);
-void NetworkAddServer(const char *b);
-void NetworkRebuildHostList();
-bool NetworkChangeCompanyPassword(byte argc, char *argv[]);
-void NetworkPopulateCompanyInfo();
-void UpdateNetworkGameWindow(bool unselect);
-void CheckMinPlayers();
-void NetworkStartDebugLog(const char *hostname, uint16 port);
-
-void NetworkStartUp();
-void NetworkUDPCloseAll();
-void NetworkShutDown();
-void NetworkGameLoop();
-void NetworkUDPGameLoop();
-bool NetworkServerStart();
-bool NetworkClientConnectGame(const char *host, uint16 port);
-void NetworkReboot();
-void NetworkDisconnect();
-
-bool IsNetworkCompatibleVersion(const char *version);
-
-VARDEF bool _network_server;     ///< network-server is active
-VARDEF bool _network_available;  ///< is network mode available?
-VARDEF bool _network_dedicated;  ///< are we a dedicated server?
-VARDEF bool _network_advertise;  ///< is the server advertising to the master server?
+extern bool _networking;         ///< are we in networking mode?
+extern bool _network_server;     ///< network-server is active
+extern bool _network_available;  ///< is network mode available?
+extern bool _network_dedicated;  ///< are we a dedicated server?
+extern bool _network_advertise;  ///< is the server advertising to the master server?
+extern bool _network_reload_cfg; ///< will we reload the entire config for the next game?
 
 #else /* ENABLE_NETWORK */
 /* Network function stubs when networking is disabled */
@@ -235,7 +31,10 @@
 
 #endif /* ENABLE_NETWORK */
 
-/* Thss variable must always be registered! */
-VARDEF PlayerID _network_playas; ///< an id to play as.. (see players.h:Players)
+/** What is the revision of OpenTTD. */
+extern const char _openttd_revision[];
+
+/** As which player do we play? */
+extern PlayerID _network_playas;
 
 #endif /* NETWORK_H */
--- a/src/network/network_client.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/network_client.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,26 +4,28 @@
 
 #include "../stdafx.h"
 #include "../debug.h"
-#include "../string.h"
 #include "../openttd.h"
-#include "../strings.h"
 #include "network_data.h"
 #include "core/tcp.h"
-#include "../date.h"
-#include "table/strings.h"
-#include "../functions.h"
 #include "network_client.h"
 #include "network_gamelist.h"
 #include "network_gui.h"
 #include "../saveload.h"
-#include "../command.h"
-#include "../window.h"
+#include "../command_func.h"
 #include "../console.h"
 #include "../variables.h"
 #include "../ai/ai.h"
-#include "../helpers.hpp"
+#include "../core/alloc_func.hpp"
 #include "../fileio.h"
 #include "../md5.h"
+#include "../strings_func.h"
+#include "../window_func.h"
+#include "../string_func.h"
+#include "../player_func.h"
+#include "../player_base.h"
+#include "../player_gui.h"
+
+#include "table/strings.h"
 
 // This file handles all the client-commands
 
@@ -55,18 +57,18 @@
 	memset(salted_password, 0, sizeof(salted_password));
 	snprintf(salted_password, sizeof(salted_password), "%s", password);
 	/* Add the game seed and the server's unique ID as the salt. */
-	for (uint i = 0; i < NETWORK_UNIQUE_ID_LENGTH; i++) salted_password[i] ^= _password_server_unique_id[i] ^ (_password_game_seed >> i);
+	for (uint i = 0; i < NETWORK_UNIQUE_ID_LENGTH - 1; i++) salted_password[i] ^= _password_server_unique_id[i] ^ (_password_game_seed >> i);
 
-	md5_state_t state;
-	md5_byte_t digest[16];
+	Md5 checksum;
+	uint8 digest[16];
 	static char hashed_password[NETWORK_UNIQUE_ID_LENGTH];
 
 	/* Generate the MD5 hash */
-	md5_init(&state);
-	md5_append(&state, (const md5_byte_t*)salted_password, sizeof(salted_password));
-	md5_finish(&state, digest);
+	checksum.Append((const uint8*)salted_password, sizeof(salted_password) - 1);
+	checksum.Finish(digest);
 
 	for (int di = 0; di < 16; di++) sprintf(hashed_password + di * 2, "%02x", digest[di]);
+	hashed_password[lengthof(hashed_password) - 1] = '\0';
 
 	return hashed_password;
 }
--- a/src/network/network_data.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/network_data.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,11 +5,13 @@
 #include "../stdafx.h"
 #include "../debug.h"
 #include "network_data.h"
-#include "../string.h"
 #include "network_client.h"
-#include "../command.h"
+#include "../command_func.h"
 #include "../callback_table.h"
-#include "../helpers.hpp"
+#include "../core/alloc_func.hpp"
+#include "../string_func.h"
+#include "../date_func.h"
+#include "../player_func.h"
 
 // Add a command to the local command queue
 void NetworkAddCommandQueue(NetworkTCPSocketHandler *cs, CommandPacket *cp)
@@ -99,9 +101,7 @@
 		cp->callback = 0;
 	}
 
-#ifdef DEBUG_DUMP_COMMANDS
-	debug_dump_commands("ddc:cmd:%d;%d;%d;%d;%d;%d;%d;%s\n", _date, _date_fract, (int)cp->player, cp->tile, cp->p1, cp->p2, cp->cmd, cp->text);
-#endif /* DUMP_COMMANDS */
+	DebugDumpCommands("ddc:cmd:%d;%d;%d;%d;%d;%d;%d;%s\n", _date, _date_fract, (int)cp->player, cp->tile, cp->p1, cp->p2, cp->cmd, cp->text);
 
 	DoCommandP(cp->tile, cp->p1, cp->p2, _callback_table[cp->callback], cp->cmd | CMD_NETWORK_COMMAND, cp->my_cmd);
 }
--- a/src/network/network_data.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/network_data.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,7 @@
 
 #include "../openttd.h"
 #include "network.h"
+#include "network_internal.h"
 
 // Is the network enabled?
 #ifdef ENABLE_NETWORK
--- a/src/network/network_gamelist.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/network_gamelist.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -10,7 +10,7 @@
 #include "../stdafx.h"
 #include "../debug.h"
 #include "../newgrf_config.h"
-#include "../helpers.hpp"
+#include "../core/alloc_func.hpp"
 #include "core/game.h"
 #include "network_udp.h"
 #include "network_gamelist.h"
--- a/src/network/network_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/network_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,35 +3,42 @@
 #ifdef ENABLE_NETWORK
 #include "../stdafx.h"
 #include "../openttd.h"
-#include "../string.h"
-#include "../strings.h"
-#include "../table/sprites.h"
+#include "../strings_func.h"
 #include "network.h"
-#include "../date.h"
-
+#include "../date_func.h"
 #include "../fios.h"
-#include "table/strings.h"
-#include "../functions.h"
 #include "network_data.h"
 #include "network_client.h"
 #include "network_gui.h"
 #include "network_gamelist.h"
-#include "../window.h"
 #include "../gui.h"
-#include "../gfx.h"
-#include "../command.h"
+#include "../window_gui.h"
+#include "../textbuf_gui.h"
 #include "../variables.h"
 #include "network_server.h"
 #include "network_udp.h"
-#include "../settings.h"
-#include "../string.h"
 #include "../town.h"
 #include "../newgrf.h"
-#include "../helpers.hpp"
+#include "../functions.h"
+#include "../window_func.h"
+#include "../core/alloc_func.hpp"
+#include "../string_func.h"
+#include "../gfx_func.h"
+#include "../player_func.h"
+#include "../settings_type.h"
+#include "../widgets/dropdown_func.h"
+
+#include "table/strings.h"
+#include "../table/sprites.h"
 
 #define BGC 5
 #define BTC 15
 
+struct chatquerystr_d : public querystr_d {
+	int dest;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(chatquerystr_d));
+
 struct network_d {
 	PlayerID company;        // select company in network lobby
 	byte field;              // select text-field in start-server and game-listing
@@ -167,7 +174,6 @@
 	/* Create temporary array of games to use for listing */
 	free(nqld->sort_list);
 	nqld->sort_list = MallocT<NetworkGameList*>(n);
-	if (nqld->sort_list == NULL) error("Could not allocate memory for the network-game-sorting-list");
 	nqld->l.list_length = n;
 
 	for (n = 0, ngl_temp = _network_game_list; ngl_temp != NULL; ngl_temp = ngl_temp->next) {
@@ -212,22 +218,21 @@
 /** Enum for NetworkGameWindow, referring to _network_game_window_widgets */
 enum NetworkGameWindowWidgets {
 	NGWW_CLOSE    = 0,  ///< Close 'X' button
-	NGWW_CONN_TXT = 4,  ///< 'Connection' droplist
-	NGWW_CONN_BTN = 5,  ///< 'Connection' droplist button
-	NGWW_PLAYER   = 6,  ///< Panel with editbox to set player name
+	NGWW_CONN_BTN = 4,  ///< 'Connection' droplist button
+	NGWW_PLAYER   = 5,  ///< Panel with editbox to set player name
 
-	NGWW_NAME     = 7,  ///< 'Name' button
+	NGWW_NAME     = 6,  ///< 'Name' button
 	NGWW_CLIENTS,       ///< 'Clients' button
 	NGWW_INFO,          ///< Third button in the game list panel
 
-	NGWW_MATRIX   = 10, ///< Panel with list of games
+	NGWW_MATRIX   = 9,  ///< Panel with list of games
 
-	NGWW_DETAILS  = 12, ///< Panel with game details
-	NGWW_JOIN     = 13, ///< 'Join game' button
-	NGWW_REFRESH  = 14, ///< 'Refresh server' button
-	NGWW_NEWGRF   = 15, ///< 'NewGRF Settings' button
+	NGWW_DETAILS  = 11, ///< Panel with game details
+	NGWW_JOIN     = 12, ///< 'Join game' button
+	NGWW_REFRESH  = 13, ///< 'Refresh server' button
+	NGWW_NEWGRF   = 14, ///< 'NewGRF Settings' button
 
-	NGWW_FIND     = 16, ///< 'Find server' button
+	NGWW_FIND     = 15, ///< 'Find server' button
 	NGWW_ADD,           ///< 'Add server' button
 	NGWW_START,         ///< 'Start server' button
 	NGWW_CANCEL,        ///< 'Cancel' button
@@ -263,7 +268,7 @@
 
 	case WE_PAINT: {
 		const NetworkGameList *sel = nd->server;
-		const char *arrow = (ld->flags & VL_DESC) ? DOWNARROW : UPARROW;
+		const SortButtonState arrow = (ld->flags & VL_DESC) ? SBS_DOWN : SBS_UP;
 
 		if (ld->flags & VL_REBUILD) {
 			BuildNetworkGameList(&WP(w, network_ql_d));
@@ -295,9 +300,9 @@
 
 		/* Sort based on widgets: name, clients, compatibility */
 		switch (ld->sort_type) {
-			case NGWW_NAME    - NGWW_NAME: DoDrawString(arrow, w->widget[NGWW_NAME].right    - 10, 42, TC_BLACK); break;
-			case NGWW_CLIENTS - NGWW_NAME: DoDrawString(arrow, w->widget[NGWW_CLIENTS].right - 10, 42, TC_BLACK); break;
-			case NGWW_INFO    - NGWW_NAME: DoDrawString(arrow, w->widget[NGWW_INFO].right    - 10, 42, TC_BLACK); break;
+			case NGWW_NAME    - NGWW_NAME: DrawSortButtonState(w, NGWW_NAME,    arrow); break;
+			case NGWW_CLIENTS - NGWW_NAME: DrawSortButtonState(w, NGWW_CLIENTS, arrow); break;
+			case NGWW_INFO    - NGWW_NAME: DrawSortButtonState(w, NGWW_INFO,    arrow); break;
 		}
 
 		{ // draw list of games
@@ -423,7 +428,7 @@
 		case NGWW_CANCEL: // Cancel button
 			DeleteWindowById(WC_NETWORK_WINDOW, 0);
 			break;
-		case NGWW_CONN_TXT: case NGWW_CONN_BTN: // 'Connection' droplist
+		case NGWW_CONN_BTN: // 'Connection' droplist
 			ShowDropDownMenu(w, _lan_internet_types_dropdown, _network_lan_internet, NGWW_CONN_BTN, 0, 0); // do it for widget NSSW_CONN_BTN
 			break;
 		case NGWW_NAME: // Sort by name
@@ -566,8 +571,7 @@
 {      WWT_PANEL,   RESIZE_RB,     BGC,     0,   449,    14,   263, 0x0,                            STR_NULL},
 
 {       WWT_TEXT,   RESIZE_NONE,   BGC,     9,    85,    23,    35, STR_NETWORK_CONNECTION,         STR_NULL},
-{      WWT_INSET,   RESIZE_NONE,   BGC,    90,   181,    22,    33, STR_NETWORK_LAN_INTERNET_COMBO, STR_NETWORK_CONNECTION_TIP},       // NGWW_CONN_TXT
-{    WWT_TEXTBTN,   RESIZE_NONE,   BGC,   170,   180,    23,    32, STR_0225,                       STR_NETWORK_CONNECTION_TIP},       // NGWW_CONN_BTN
+{ WWT_DROPDOWNIN,   RESIZE_NONE,   BGC,    90,   181,    22,    33, STR_NETWORK_LAN_INTERNET_COMBO, STR_NETWORK_CONNECTION_TIP},       // NGWW_CONN_BTN
 
 {      WWT_PANEL,   RESIZE_LR,     BGC,   290,   440,    22,    33, 0x0,                            STR_NETWORK_ENTER_NAME_TIP},       // NGWW_PLAYER
 
@@ -649,22 +653,20 @@
 	NSSW_GAMENAME        =  4,   ///< Background for editbox to set game name
 	NSSW_SETPWD          =  5,   ///< 'Set password' button
 	NSSW_SELMAP          =  7,   ///< 'Select map' list
-	NSSW_CONNTYPE_TXT    = 10,   ///< 'Connection type' droplist
-	NSSW_CONNTYPE_BTN    = 11,   ///< 'Connection type' droplist button
-	NSSW_CLIENTS_BTND    = 13,   ///< 'Max clients' downarrow
-	NSSW_CLIENTS_TXT     = 14,   ///< 'Max clients' text
-	NSSW_CLIENTS_BTNU    = 15,   ///< 'Max clients' uparrow
-	NSSW_COMPANIES_BTND  = 17,   ///< 'Max companies' downarrow
-	NSSW_COMPANIES_TXT   = 18,   ///< 'Max companies' text
-	NSSW_COMPANIES_BTNU  = 19,   ///< 'Max companies' uparrow
-	NSSW_SPECTATORS_BTND = 21,   ///< 'Max spectators' downarrow
-	NSSW_SPECTATORS_TXT  = 22,   ///< 'Max spectators' text
-	NSSW_SPECTATORS_BTNU = 23,   ///< 'Max spectators' uparrow
-	NSSW_LANGUAGE_TXT    = 25,   ///< 'Language spoken' droplist
-	NSSW_LANGUAGE_BTN    = 26,   ///< 'Language spoken' droplist button
-	NSSW_START           = 27,   ///< 'Start' button
-	NSSW_LOAD            = 28,   ///< 'Load' button
-	NSSW_CANCEL          = 29,   ///< 'Cancel' button
+	NSSW_CONNTYPE_BTN    = 10,   ///< 'Connection type' droplist button
+	NSSW_CLIENTS_BTND    = 12,   ///< 'Max clients' downarrow
+	NSSW_CLIENTS_TXT     = 13,   ///< 'Max clients' text
+	NSSW_CLIENTS_BTNU    = 14,   ///< 'Max clients' uparrow
+	NSSW_COMPANIES_BTND  = 16,   ///< 'Max companies' downarrow
+	NSSW_COMPANIES_TXT   = 17,   ///< 'Max companies' text
+	NSSW_COMPANIES_BTNU  = 18,   ///< 'Max companies' uparrow
+	NSSW_SPECTATORS_BTND = 20,   ///< 'Max spectators' downarrow
+	NSSW_SPECTATORS_TXT  = 21,   ///< 'Max spectators' text
+	NSSW_SPECTATORS_BTNU = 22,   ///< 'Max spectators' uparrow
+	NSSW_LANGUAGE_BTN    = 24,   ///< 'Language spoken' droplist button
+	NSSW_START           = 25,   ///< 'Start' button
+	NSSW_LOAD            = 26,   ///< 'Load' button
+	NSSW_CANCEL          = 27,   ///< 'Cancel' button
 };
 
 /**
@@ -747,7 +749,7 @@
 			nd->map = (y == 0) ? NULL : _fios_list + y - 1;
 			SetWindowDirty(w);
 			} break;
-		case NSSW_CONNTYPE_TXT: case NSSW_CONNTYPE_BTN: // Connection type
+		case NSSW_CONNTYPE_BTN: // Connection type
 			ShowDropDownMenu(w, _connection_types_dropdown, _network_advertise, NSSW_CONNTYPE_BTN, 0, 0); // do it for widget NSSW_CONNTYPE_BTN
 			break;
 		case NSSW_CLIENTS_BTND:    case NSSW_CLIENTS_BTNU:    // Click on up/down button for number of clients
@@ -755,7 +757,7 @@
 		case NSSW_SPECTATORS_BTND: case NSSW_SPECTATORS_BTNU: // Click on up/down button for number of spectators
 			/* Don't allow too fast scrolling */
 			if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) {
-				HandleButtonClick(w, e->we.click.widget);
+				w->HandleButtonClick(e->we.click.widget);
 				SetWindowDirty(w);
 				switch (e->we.click.widget) {
 					default: NOT_REACHED();
@@ -787,7 +789,7 @@
 			SetDParam(0, _network_game_info.spectators_max);
 			ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_NETWORK_NUMBER_OF_SPECTATORS, 3, 50, w, CS_NUMERAL);
 			break;
-		case NSSW_LANGUAGE_TXT: case NSSW_LANGUAGE_BTN: { // Language
+		case NSSW_LANGUAGE_BTN: { // Language
 			uint sel = 0;
 			for (uint i = 0; i < lengthof(_language_dropdown) - 1; i++) {
 				if (_language_dropdown[i] == STR_NETWORK_LANG_ANY + _network_game_info.server_lang) {
@@ -807,6 +809,7 @@
 				char *name = FiosBrowseTo(nd->map);
 				if (name != NULL) {
 					SetFiosType(nd->map->type);
+					_file_to_saveload.filetype = FT_SCENARIO;
 					ttd_strlcpy(_file_to_saveload.name, name, sizeof(_file_to_saveload.name));
 					ttd_strlcpy(_file_to_saveload.title, nd->map->title, sizeof(_file_to_saveload.title));
 
@@ -860,7 +863,7 @@
 			_network_game_info.use_password = (_network_server_password[0] != '\0');
 		} else {
 			int32 value = atoi(e->we.edittext.str);
-			InvalidateWidget(w, nd->widget_id);
+			w->InvalidateWidget(nd->widget_id);
 			switch (nd->widget_id) {
 				default: NOT_REACHED();
 				case NSSW_CLIENTS_TXT:    _network_game_info.clients_max    = Clamp(value, 2, MAX_CLIENTS); break;
@@ -892,8 +895,7 @@
 
 /* Combo/selection boxes to control Connection Type / Max Clients / Max Companies / Max Observers / Language */
 {       WWT_TEXT,   RESIZE_NONE,   BGC,   280,   419,    63,    75, STR_NETWORK_CONNECTION,           STR_NULL},
-{      WWT_INSET,   RESIZE_NONE,   BGC,   280,   410,    77,    88, STR_NETWORK_LAN_INTERNET_COMBO,   STR_NETWORK_CONNECTION_TIP},           // NSSW_CONNTYPE_TXT
-{    WWT_TEXTBTN,   RESIZE_NONE,   BGC,   399,   409,    78,    87, STR_0225,                         STR_NETWORK_CONNECTION_TIP},           // NSSW_CONNTYPE_BTN
+{ WWT_DROPDOWNIN,   RESIZE_NONE,   BGC,   280,   410,    77,    88, STR_NETWORK_LAN_INTERNET_COMBO,   STR_NETWORK_CONNECTION_TIP},           // NSSW_CONNTYPE_BTN
 
 {       WWT_TEXT,   RESIZE_NONE,   BGC,   280,   419,    95,   107, STR_NETWORK_NUMBER_OF_CLIENTS,    STR_NULL},
 {     WWT_IMGBTN,   RESIZE_NONE,   BGC,   280,   291,   109,   120, SPR_ARROW_DOWN,                   STR_NETWORK_NUMBER_OF_CLIENTS_TIP},    // NSSW_CLIENTS_BTND
@@ -911,8 +913,7 @@
 {     WWT_IMGBTN,   RESIZE_NONE,   BGC,   398,   410,   173,   184, SPR_ARROW_UP,                     STR_NETWORK_NUMBER_OF_SPECTATORS_TIP}, // NSSW_SPECTATORS_BTNU
 
 {       WWT_TEXT,   RESIZE_NONE,   BGC,   280,   419,   191,   203, STR_NETWORK_LANGUAGE_SPOKEN,      STR_NULL},
-{      WWT_INSET,   RESIZE_NONE,   BGC,   280,   410,   205,   216, STR_NETWORK_LANGUAGE_COMBO,       STR_NETWORK_LANGUAGE_TIP},             // NSSW_LANGUAGE_TXT
-{    WWT_TEXTBTN,   RESIZE_NONE,   BGC,   399,   409,   206,   215, STR_0225,                         STR_NETWORK_LANGUAGE_TIP},             // NSSW_LANGUAGE_BTN
+{ WWT_DROPDOWNIN,   RESIZE_NONE,   BGC,   280,   410,   205,   216, STR_NETWORK_LANGUAGE_COMBO,       STR_NETWORK_LANGUAGE_TIP},             // NSSW_LANGUAGE_BTN
 
 /* Buttons Start / Load / Cancel */
 { WWT_PUSHTXTBTN,   RESIZE_NONE,   BTC,    40,   140,   224,   235, STR_NETWORK_START_GAME,           STR_NETWORK_START_GAME_TIP},           // NSSW_START
@@ -1404,10 +1405,10 @@
 	w->widget[0].right = w->widget[0].left + 150;
 
 	w->flags4 &= ~WF_WHITE_BORDER_MASK;
-	WP(w,menu_d).item_count = 0;
+	WP(w, menu_d).item_count = 0;
 	// Save our client
-	WP(w,menu_d).main_button = client_no;
-	WP(w,menu_d).sel_index = 0;
+	WP(w, menu_d).main_button = client_no;
+	WP(w, menu_d).sel_index = 0;
 	// We are a popup
 	_popup_menu_active = true;
 
@@ -1425,7 +1426,7 @@
 		DrawWindowWidgets(w);
 
 		// Draw the actions
-		sel = WP(w,menu_d).sel_index;
+		sel = WP(w, menu_d).sel_index;
 		y = 1;
 		for (i = 0; i < MAX_CLIENTLIST_ACTION; i++, y += CLNWND_ROWSIZE) {
 			if (_clientlist_action[i][0] == '\0') continue;
@@ -1447,7 +1448,7 @@
 		int index = (e->we.popupmenu.pt.y - w->top) / CLNWND_ROWSIZE;
 
 		if (index >= 0 && e->we.popupmenu.pt.y >= w->top)
-			HandleClientListPopupClick(index, WP(w,menu_d).main_button);
+			HandleClientListPopupClick(index, WP(w, menu_d).main_button);
 
 		DeleteWindowById(WC_TOOLBAR_MENU, 0);
 	} break;
@@ -1456,9 +1457,9 @@
 		// Our mouse hoovers over an action? Select it!
 		int index = (e->we.popupmenu.pt.y - w->top) / CLNWND_ROWSIZE;
 
-		if (index == -1 || index == WP(w,menu_d).sel_index) return;
+		if (index == -1 || index == WP(w, menu_d).sel_index) return;
 
-		WP(w,menu_d).sel_index = index;
+		WP(w, menu_d).sel_index = index;
 		SetWindowDirty(w);
 	} break;
 
@@ -1795,11 +1796,23 @@
 {
 	switch (e->event) {
 	case WE_CREATE:
+		SendWindowMessage(WC_NEWS_WINDOW, 0, WE_CREATE, w->height, 0);
+		SetBit(_no_scroll, SCROLL_CHAT); // do not scroll the game with the arrow-keys
 		break;
 
 	case WE_PAINT: {
+		static const StringID chat_captions[] = {
+			STR_NETWORK_CHAT_ALL_CAPTION,
+			STR_NETWORK_CHAT_COMPANY_CAPTION,
+			STR_NETWORK_CHAT_CLIENT_CAPTION
+		};
+		StringID msg;
+
 		DrawWindowWidgets(w);
 
+		assert(WP(w, chatquerystr_d).caption < lengthof(chat_captions));
+		msg = chat_captions[WP(w, chatquerystr_d).caption];
+		DrawStringRightAligned(w->widget[2].left - 2, w->widget[2].top + 1, msg, TC_BLACK);
 		DrawEditBox(w, &WP(w, chatquerystr_d), 2);
 	} break;
 
@@ -1927,7 +1940,11 @@
 		case WE_KEYPRESS:
 			switch (HandleEditBoxKey(w, &WP(w, chatquerystr_d), 4, e)) {
 				case 1: // Return
-					/* FALLTHROUGH */
+					e->event = WE_CLICK;
+					e->we.click.widget = NCPWW_OK;
+					NetworkCompanyPasswordWindowWndProc(w, e);
+					break;
+
 				case 2: // Escape
 					DeleteWindow(w);
 					break;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/network/network_internal.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,208 @@
+/* $Id$ */
+
+#ifndef NETWORK_INTERNAL_H
+#define NETWORK_INTERNAL_H
+
+#ifdef ENABLE_NETWORK
+
+#include "../player_type.h"
+#include "../economy_type.h"
+#include "core/config.h"
+#include "core/game.h"
+
+// If this line is enable, every frame will have a sync test
+//  this is not needed in normal games. Normal is like 1 sync in 100
+//  frames. You can enable this if you have a lot of desyncs on a certain
+//  game.
+// Remember: both client and server have to be compiled with this
+//  option enabled to make it to work. If one of the two has it disabled
+//  nothing will happen.
+//#define ENABLE_NETWORK_SYNC_EVERY_FRAME
+
+// In theory sending 1 of the 2 seeds is enough to check for desyncs
+//   so in theory, this next define can be left off.
+//#define NETWORK_SEND_DOUBLE_SEED
+
+// How many clients can we have? Like.. MAX_PLAYERS - 1 is the amount of
+//  players that can really play.. so.. a max of 4 spectators.. gives us..
+//  MAX_PLAYERS + 3
+#define MAX_CLIENTS (MAX_PLAYERS + 3)
+
+
+// Do not change this next line. It should _ALWAYS_ be MAX_CLIENTS + 1
+#define MAX_CLIENT_INFO (MAX_CLIENTS + 1)
+
+#define MAX_INTERFACES 9
+
+
+// How many vehicle/station types we put over the network
+#define NETWORK_VEHICLE_TYPES 5
+#define NETWORK_STATION_TYPES 5
+
+struct NetworkPlayerInfo {
+	char company_name[NETWORK_NAME_LENGTH];         // Company name
+	char password[NETWORK_PASSWORD_LENGTH];         // The password for the player
+	Year inaugurated_year;                          // What year the company started in
+	Money company_value;                            // The company value
+	Money money;                                    // The amount of money the company has
+	Money income;                                   // How much did the company earned last year
+	uint16 performance;                             // What was his performance last month?
+	bool use_password;                              // Is there a password
+	uint16 num_vehicle[NETWORK_VEHICLE_TYPES];      // How many vehicles are there of this type?
+	uint16 num_station[NETWORK_STATION_TYPES];      // How many stations are there of this type?
+	char players[NETWORK_PLAYERS_LENGTH];           // The players that control this company (Name1, name2, ..)
+	uint16 months_empty;                            // How many months the company is empty
+};
+
+struct NetworkClientInfo {
+	uint16 client_index;                            // Index of the client (same as ClientState->index)
+	char client_name[NETWORK_CLIENT_NAME_LENGTH];   // Name of the client
+	byte client_lang;                               // The language of the client
+	PlayerID client_playas;                         // As which player is this client playing (PlayerID)
+	uint32 client_ip;                               // IP-address of the client (so he can be banned)
+	Date join_date;                                 // Gamedate the player has joined
+	char unique_id[NETWORK_UNIQUE_ID_LENGTH];       // Every play sends an unique id so we can indentify him
+};
+
+enum NetworkJoinStatus {
+	NETWORK_JOIN_STATUS_CONNECTING,
+	NETWORK_JOIN_STATUS_AUTHORIZING,
+	NETWORK_JOIN_STATUS_WAITING,
+	NETWORK_JOIN_STATUS_DOWNLOADING,
+	NETWORK_JOIN_STATUS_PROCESSING,
+	NETWORK_JOIN_STATUS_REGISTERING,
+
+	NETWORK_JOIN_STATUS_GETTING_COMPANY_INFO,
+};
+
+/* Language ids for server_lang and client_lang. Do NOT modify the order. */
+enum NetworkLanguage {
+	NETLANG_ANY = 0,
+	NETLANG_ENGLISH,
+	NETLANG_GERMAN,
+	NETLANG_FRENCH,
+	NETLANG_BRAZILIAN,
+	NETLANG_BULGARIAN,
+	NETLANG_CHINESE,
+	NETLANG_CZECH,
+	NETLANG_DANISH,
+	NETLANG_DUTCH,
+	NETLANG_ESPERANTO,
+	NETLANG_FINNISH,
+	NETLANG_HUNGARIAN,
+	NETLANG_ICELANDIC,
+	NETLANG_ITALIAN,
+	NETLANG_JAPANESE,
+	NETLANG_KOREAN,
+	NETLANG_LITHUANIAN,
+	NETLANG_NORWEGIAN,
+	NETLANG_POLISH,
+	NETLANG_PORTUGUESE,
+	NETLANG_ROMANIAN,
+	NETLANG_RUSSIAN,
+	NETLANG_SLOVAK,
+	NETLANG_SLOVENIAN,
+	NETLANG_SPANISH,
+	NETLANG_SWEDISH,
+	NETLANG_TURKISH,
+	NETLANG_UKRAINIAN,
+	NETLANG_COUNT
+};
+
+VARDEF NetworkGameInfo _network_game_info;
+VARDEF NetworkPlayerInfo _network_player_info[MAX_PLAYERS];
+VARDEF NetworkClientInfo _network_client_info[MAX_CLIENT_INFO];
+
+VARDEF char _network_player_name[NETWORK_CLIENT_NAME_LENGTH];
+VARDEF char _network_default_ip[NETWORK_HOSTNAME_LENGTH];
+
+VARDEF uint16 _network_own_client_index;
+VARDEF char _network_unique_id[NETWORK_UNIQUE_ID_LENGTH]; // Our own unique ID
+
+VARDEF uint32 _frame_counter_server; // The frame_counter of the server, if in network-mode
+VARDEF uint32 _frame_counter_max; // To where we may go with our clients
+
+VARDEF uint32 _last_sync_frame; // Used in the server to store the last time a sync packet was sent to clients.
+
+// networking settings
+VARDEF uint32 _broadcast_list[MAX_INTERFACES + 1];
+
+VARDEF uint16 _network_server_port;
+/* We use bind_ip and bind_ip_host, where bind_ip_host is the readable form of
+    bind_ip_host, and bind_ip the numeric value, because we want a nice number
+    in the openttd.cfg, but we wants to use the uint32 internally.. */
+VARDEF uint32 _network_server_bind_ip;
+VARDEF char _network_server_bind_ip_host[NETWORK_HOSTNAME_LENGTH];
+VARDEF bool _is_network_server; // Does this client wants to be a network-server?
+VARDEF char _network_server_name[NETWORK_NAME_LENGTH];
+VARDEF char _network_server_password[NETWORK_PASSWORD_LENGTH];
+VARDEF char _network_rcon_password[NETWORK_PASSWORD_LENGTH];
+VARDEF char _network_default_company_pass[NETWORK_PASSWORD_LENGTH];
+
+VARDEF uint16 _network_max_join_time;             ///< Time a client can max take to join
+VARDEF bool _network_pause_on_join;               ///< Pause the game when a client tries to join (more chance of succeeding join)
+
+VARDEF uint16 _redirect_console_to_client;
+
+VARDEF uint16 _network_sync_freq;
+VARDEF uint8 _network_frame_freq;
+
+VARDEF uint32 _sync_seed_1, _sync_seed_2;
+VARDEF uint32 _sync_frame;
+VARDEF bool _network_first_time;
+// Vars needed for the join-GUI
+VARDEF NetworkJoinStatus _network_join_status;
+VARDEF uint8 _network_join_waiting;
+VARDEF uint16 _network_join_kbytes;
+VARDEF uint16 _network_join_kbytes_total;
+
+VARDEF char _network_last_host[NETWORK_HOSTNAME_LENGTH];
+VARDEF short _network_last_port;
+VARDEF uint32 _network_last_host_ip;
+VARDEF uint8 _network_reconnect;
+
+VARDEF bool _network_udp_server;
+VARDEF uint16 _network_udp_broadcast;
+
+VARDEF byte _network_lan_internet;
+
+VARDEF bool _network_need_advertise;
+VARDEF uint32 _network_last_advertise_frame;
+VARDEF uint8 _network_advertise_retries;
+
+VARDEF bool _network_autoclean_companies;
+VARDEF uint8 _network_autoclean_unprotected; // Remove a company after X months
+VARDEF uint8 _network_autoclean_protected;   // Unprotect a company after X months
+
+VARDEF Year _network_restart_game_year;      // If this year is reached, the server automaticly restarts
+VARDEF uint8 _network_min_players;           // Minimum number of players for game to unpause
+
+void NetworkTCPQueryServer(const char* host, unsigned short port);
+
+byte NetworkSpectatorCount();
+
+VARDEF char *_network_host_list[10];
+VARDEF char *_network_ban_list[25];
+
+void ParseConnectionString(const char **player, const char **port, char *connection_string);
+void NetworkUpdateClientInfo(uint16 client_index);
+void NetworkAddServer(const char *b);
+void NetworkRebuildHostList();
+bool NetworkChangeCompanyPassword(byte argc, char *argv[]);
+void NetworkPopulateCompanyInfo();
+void UpdateNetworkGameWindow(bool unselect);
+void CheckMinPlayers();
+void NetworkStartDebugLog(const char *hostname, uint16 port);
+
+void NetworkUDPCloseAll();
+void NetworkGameLoop();
+void NetworkUDPGameLoop();
+bool NetworkServerStart();
+bool NetworkClientConnectGame(const char *host, uint16 port);
+void NetworkReboot();
+void NetworkDisconnect();
+
+bool IsNetworkCompatibleVersion(const char *version);
+
+#endif /* ENABLE_NETWORK */
+#endif /* NETWORK_INTERNAL_H */
--- a/src/network/network_server.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/network_server.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,26 +5,29 @@
 #include "../stdafx.h"
 #include "../openttd.h" // XXX StringID
 #include "../debug.h"
-#include "../string.h"
-#include "../strings.h"
+#include "../strings_func.h"
 #include "network_data.h"
 #include "core/tcp.h"
-#include "../train.h"
-#include "../aircraft.h"
-#include "../date.h"
-#include "table/strings.h"
-#include "../functions.h"
+#include "../vehicle_base.h"
+#include "../vehicle_func.h"
+#include "../date_func.h"
 #include "network_server.h"
 #include "network_udp.h"
 #include "../console.h"
-#include "../command.h"
+#include "../command_func.h"
 #include "../saveload.h"
-#include "../vehicle.h"
 #include "../station.h"
 #include "../variables.h"
 #include "../genworld.h"
-#include "../helpers.hpp"
+#include "../core/alloc_func.hpp"
 #include "../fileio.h"
+#include "../string_func.h"
+#include "../player_base.h"
+#include "../player_func.h"
+#include "../player_gui.h"
+#include "../settings_type.h"
+
+#include "table/strings.h"
 
 // This file handles all the server-commands
 
@@ -1298,31 +1301,16 @@
 
 	// Go through all vehicles and count the type of vehicles
 	FOR_ALL_VEHICLES(v) {
-		if (!IsValidPlayer(v->owner)) continue;
-
+		if (!IsValidPlayer(v->owner) || !v->IsPrimaryVehicle()) continue;
+		byte type = 0;
 		switch (v->type) {
-			case VEH_TRAIN:
-				if (IsFrontEngine(v)) _network_player_info[v->owner].num_vehicle[0]++;
-				break;
-
-			case VEH_ROAD:
-				if (v->cargo_type != CT_PASSENGERS) {
-					_network_player_info[v->owner].num_vehicle[1]++;
-				} else {
-					_network_player_info[v->owner].num_vehicle[2]++;
-				}
-				break;
-
-			case VEH_AIRCRAFT:
-				if (IsNormalAircraft(v)) _network_player_info[v->owner].num_vehicle[3]++;
-				break;
-
-			case VEH_SHIP:
-				_network_player_info[v->owner].num_vehicle[4]++;
-				break;
-
-			default: break;
+			case VEH_TRAIN: type = 0; break;
+			case VEH_ROAD: type = (v->cargo_type != CT_PASSENGERS) ? 1 : 2; break;
+			case VEH_AIRCRAFT: type = 3; break;
+			case VEH_SHIP: type = 4; break;
+			default: continue;
 		}
+		_network_player_info[v->owner].num_vehicle[type]++;
 	}
 
 	// Go through all stations and count the types of stations
--- a/src/network/network_udp.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/network/network_udp.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -11,14 +11,18 @@
 
 #include "../stdafx.h"
 #include "../debug.h"
-#include "../string.h"
 #include "network_data.h"
-#include "../date.h"
-#include "../map.h"
+#include "../date_func.h"
+#include "../map_func.h"
 #include "network_gamelist.h"
 #include "network_udp.h"
 #include "../variables.h"
 #include "../newgrf_config.h"
+#include "../core/endian_func.hpp"
+#include "../string_func.h"
+#include "../player_base.h"
+#include "../player_func.h"
+#include "../settings_type.h"
 
 #include "core/udp.h"
 
--- a/src/newgrf.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -8,47 +8,49 @@
 
 #include "openttd.h"
 #include "debug.h"
-#include "gfx.h"
 #include "fileio.h"
-#include "functions.h"
 #include "engine.h"
 #include "spritecache.h"
 #include "station.h"
 #include "sprite.h"
 #include "newgrf.h"
 #include "variables.h"
-#include "string.h"
-#include "strings.h"
-#include "table/strings.h"
 #include "bridge.h"
 #include "town.h"
-#include "economy.h"
 #include "newgrf_engine.h"
-#include "vehicle.h"
 #include "newgrf_text.h"
-#include "table/sprites.h"
 #include "fontcache.h"
-#include "date.h"
 #include "currency.h"
 #include "landscape.h"
-#include "sound.h"
 #include "newgrf_config.h"
 #include "newgrf_house.h"
 #include "newgrf_sound.h"
 #include "newgrf_spritegroup.h"
-#include "helpers.hpp"
-#include "table/town_land.h"
 #include "cargotype.h"
 #include "industry.h"
 #include "newgrf_canal.h"
-#include "table/build_industry.h"
 #include "newgrf_commons.h"
 #include "newgrf_townname.h"
 #include "newgrf_industries.h"
 #include "newgrf_fsmports.h"
-#include "table/landscape_sprite.h"
 #include "gfxinit.h"
 #include "fios.h"
+#include "rail.h"
+#include "strings_func.h"
+#include "gfx_func.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "string_func.h"
+#include "road_func.h"
+#include "player_base.h"
+#include "settings_type.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
+#include "table/town_land.h"
+#include "table/build_industry.h"
+#include "table/landscape_sprite.h"
 
 /* TTDPatch extended GRF format codec
  * (c) Petr Baudis 2004 (GPL'd)
@@ -62,7 +64,6 @@
 
 static int _skip_sprites; // XXX
 static uint _file_index; // XXX
-SpriteID _coast_base;
 
 static GRFFile *_cur_grffile;
 GRFFile *_first_grffile;
@@ -277,12 +278,12 @@
 	TEXID_TO_STRINGID(0x006E, 0x008D, STR_QUANTITY_NOTHING);
 	TEXID_TO_STRINGID(0x008E, 0x00AD, STR_ABBREV_NOTHING);
 
-	/* Map building names according to our lang file changes
-	 * 0x200F = Tall Office Block, first house name in the original data, the one that TTDPatch stil uses
-	 * 0x201F = Old houses is the last house name.
-	 * OpenTTD does not have exactly the same order aymore, so, the code below allows
-	 * to compensate for the difference */
+	/* Map building names according to our lang file changes. There are several
+	 * ranges of house ids, all of which need to be remapped to allow newgrfs
+	 * to use original house names. */
 	TEXID_TO_STRINGID(0x200F, 0x201F, STR_200F_TALL_OFFICE_BLOCK);
+	TEXID_TO_STRINGID(0x2036, 0x2041, STR_2036_COTTAGES);
+	TEXID_TO_STRINGID(0x2059, 0x205C, STR_2059_IGLOO);
 
 	/* Same thing for industries, since the introduction of 4 new strings above STR_482A_PRODUCTION_LAST_MONTH */
 	TEXID_TO_STRINGID(0x482A, 0x483B, STR_482A_PRODUCTION_LAST_MONTH);
@@ -960,6 +961,18 @@
 						ClrBit(dts->ground_pal, 15);
 						SetBit(dts->ground_sprite, SPRITE_MODIFIER_USE_OFFSET);
 					}
+					if (HasBit(dts->ground_pal, 14)) {
+						ClrBit(dts->ground_pal, 14);
+						SetBit(dts->ground_sprite, SPRITE_MODIFIER_OPAQUE);
+					}
+					if (HasBit(dts->ground_sprite, 15)) {
+						ClrBit(dts->ground_sprite, 15);
+						SetBit(dts->ground_sprite, PALETTE_MODIFIER_COLOR);
+					}
+					if (HasBit(dts->ground_sprite, 14)) {
+						ClrBit(dts->ground_sprite, 14);
+						SetBit(dts->ground_sprite, PALETTE_MODIFIER_TRANSPARENT);
+					}
 
 					while (buf < *bufp + len) {
 						DrawTileSeqStruct *dtss;
@@ -983,6 +996,10 @@
 							ClrBit(dtss->pal, 15);
 							SetBit(dtss->image, SPRITE_MODIFIER_USE_OFFSET);
 						}
+						if (HasBit(dtss->pal, 14)) {
+							ClrBit(dtss->pal, 14);
+							SetBit(dtss->image, SPRITE_MODIFIER_OPAQUE);
+						}
 
 						if (HasBit(dtss->image, 15)) {
 							ClrBit(dtss->image, 15);
@@ -1125,6 +1142,38 @@
 	return ret;
 }
 
+static bool CanalChangeInfo(uint id, int numinfo, int prop, byte **bufp, int len)
+{
+	byte *buf = *bufp;
+	bool ret = false;
+
+	if (id + numinfo > CF_END) {
+		grfmsg(1, "CanalChangeInfo: Canal feature %u is invalid, max %u, ignoreing", id + numinfo, CF_END);
+		return false;
+	}
+
+	for (int i = 0; i < numinfo; i++) {
+		WaterFeature *wf = &_water_feature[id + i];
+
+		switch (prop) {
+			case 0x08:
+				wf->callbackmask = grf_load_byte(&buf);
+				break;
+
+			case 0x09:
+				wf->flags = grf_load_byte(&buf);
+				break;
+
+			default:
+				ret = true;
+				break;
+		}
+	}
+
+	*bufp = buf;
+	return ret;
+}
+
 static bool BridgeChangeInfo(uint brid, int numinfo, int prop, byte **bufp, int len)
 {
 	byte *buf = *bufp;
@@ -1334,7 +1383,7 @@
 				break;
 
 			case 0x12: // Building name ID
-				housespec->building_name = MapGRFStringID(_cur_grffile->grfid, grf_load_word(&buf));
+				housespec->building_name = GRFMappedStringID(grf_load_word(&buf), _cur_grffile->grfid);
 				break;
 
 			case 0x13: // Building availability mask
@@ -1587,25 +1636,25 @@
 				break;
 
 			case 0x09: /* String ID for cargo type name */
-				cs->name = grf_load_word(&buf);
+				cs->name = GRFMappedStringID(grf_load_word(&buf), _cur_grffile->grfid);
 				break;
 
 			case 0x0A: /* String for 1 unit of cargo */
-				cs->name_single = grf_load_word(&buf);
+				cs->name_single = GRFMappedStringID(grf_load_word(&buf), _cur_grffile->grfid);
 				break;
 
 			case 0x0B:
 				/* String for units of cargo. This is different in OpenTTD to TTDPatch
 				 * (e.g. 10 tonnes of coal) */
-				cs->units_volume = grf_load_word(&buf);
+				cs->units_volume = GRFMappedStringID(grf_load_word(&buf), _cur_grffile->grfid);
 				break;
 
 			case 0x0C: /* String for quantity of cargo (e.g. 10 tonnes of coal) */
-				cs->quantifier = grf_load_word(&buf);
+				cs->quantifier = GRFMappedStringID(grf_load_word(&buf), _cur_grffile->grfid);
 				break;
 
 			case 0x0D: /* String for two letter cargo abbreviation */
-				cs->abbrev = grf_load_word(&buf);
+				cs->abbrev = GRFMappedStringID(grf_load_word(&buf), _cur_grffile->grfid);
 				break;
 
 			case 0x0E: /* Sprite ID for cargo icon */
@@ -1776,6 +1825,13 @@
 
 					memcpy(tsp, &_industry_tile_specs[subs_id], sizeof(_industry_tile_specs[subs_id]));
 					tsp->enabled = true;
+
+					/* A copied tile should not have the animation infos copied too.
+					 * The anim_state should be left untouched, though
+					 * It is up to the author to animate them himself */
+					tsp->anim_production = INDUSTRYTILE_NOANIM;
+					tsp->anim_next = INDUSTRYTILE_NOANIM;
+
 					tsp->grf_prop.local_id = indtid + i;
 					tsp->grf_prop.subst_id = subs_id;
 					tsp->grf_prop.grffile = _cur_grffile;
@@ -1982,15 +2038,15 @@
 				break;
 
 			case 0x0C: // Industry closure message
-				indsp->closure_text = MapGRFStringID(_cur_grffile->grfid, grf_load_word(&buf));
+				indsp->closure_text = GRFMappedStringID(grf_load_word(&buf), _cur_grffile->grfid);
 				break;
 
 			case 0x0D: // Production increase message
-				indsp->production_up_text = MapGRFStringID(_cur_grffile->grfid, grf_load_word(&buf));
+				indsp->production_up_text = GRFMappedStringID(grf_load_word(&buf), _cur_grffile->grfid);
 				break;
 
 			case 0x0E: // Production decrease message
-				indsp->production_down_text = MapGRFStringID(_cur_grffile->grfid, grf_load_word(&buf));
+				indsp->production_down_text = GRFMappedStringID(grf_load_word(&buf), _cur_grffile->grfid);
 				break;
 
 			case 0x0F: // Fund cost multiplier
@@ -2049,7 +2105,7 @@
 				break;
 
 			case 0x1B: // New industry text ID
-				indsp->new_industry_text = MapGRFStringID(_cur_grffile->grfid, grf_load_word(&buf));
+				indsp->new_industry_text = GRFMappedStringID(grf_load_word(&buf), _cur_grffile->grfid);
 				break;
 
 			case 0x1C: // Input cargo multipliers for the three input cargo types
@@ -2061,7 +2117,7 @@
 				} break;
 
 			case 0x1F: // Industry name
-				indsp->name = MapGRFStringID(_cur_grffile->grfid, grf_load_word(&buf));
+				indsp->name = GRFMappedStringID(grf_load_word(&buf), _cur_grffile->grfid);
 				break;
 
 			case 0x20: // Prospecting success chance
@@ -2447,7 +2503,7 @@
 		/* GSF_SHIP */         ShipVehicleChangeInfo,
 		/* GSF_AIRCRAFT */     AircraftVehicleChangeInfo,
 		/* GSF_STATION */      StationChangeInfo,
-		/* GSF_CANAL */        NULL,
+		/* GSF_CANAL */        CanalChangeInfo,
 		/* GSF_BRIDGE */       BridgeChangeInfo,
 		/* GSF_TOWNHOUSE */    TownHouseChangeInfo,
 		/* GSF_GLOBALVAR */    NULL, /* Global variables are handled during reservation */
@@ -2539,7 +2595,7 @@
 				break;
 		}
 
-		if (ignoring) grfmsg(2, "FeatureChangeInfo: Ignoring property 0x%02X (not implemented)", prop);
+		if (ignoring) grfmsg(1, "FeatureChangeInfo: Ignoring property 0x%02X of feature 0x%02X (not implemented)", prop, feature);
 	}
 }
 
@@ -2668,7 +2724,7 @@
 		_cur_spriteid, feature, num_sets, num_ents, num_sets * num_ents
 	);
 
-	for (uint16 i = 0; i < num_sets * num_ents; i++) {
+	for (int i = 0; i < num_sets * num_ents; i++) {
 		_nfo_line++;
 		LoadNextSprite(_cur_spriteid++, _file_index, _nfo_line);
 	}
@@ -3097,8 +3153,8 @@
 
 static void VehicleMapSpriteGroup(byte *buf, byte feature, uint8 idcount, uint8 cidcount, bool wagover)
 {
-	static byte *last_engines;
-	static int last_engines_count;
+	static EngineID *last_engines;
+	static uint last_engines_count;
 
 	if (!wagover) {
 		if (last_engines_count != idcount) {
@@ -3167,14 +3223,7 @@
 			}
 
 			if (wagover) {
-				/* If the ID for this action 3 is the same as the vehicle ID,
- * this indicates we have a helicopter rotor override. */
-				if (feature == GSF_AIRCRAFT && engine == last_engines[i]) {
-					SetRotorOverrideSprites(engine, _cur_grffile->spritegroups[groupid]);
-				} else {
-					/* TODO: No multiple cargo types per vehicle yet. --pasky */
-					SetWagonOverrideSprites(engine, CT_DEFAULT, _cur_grffile->spritegroups[groupid], last_engines, last_engines_count);
-				}
+				SetWagonOverrideSprites(engine, CT_DEFAULT, _cur_grffile->spritegroups[groupid], last_engines, last_engines_count);
 			} else {
 				SetCustomEngineSprites(engine, CT_DEFAULT, _cur_grffile->spritegroups[groupid]);
 				SetEngineGRF(engine, _cur_grffile);
@@ -3204,7 +3253,7 @@
 			continue;
 		}
 
-		_canal_sg[cf] = _cur_grffile->spritegroups[groupid];
+		_water_feature[cf].group = _cur_grffile->spritegroups[groupid];
 	}
 }
 
@@ -3551,7 +3600,8 @@
 			case GSF_AIRCRAFT:
 				if (id < TOTAL_NUM_ENGINES) {
 					StringID string = AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_8000_KIRBY_PAUL_TANK_STEAM + id);
-					SetCustomEngineName(id, string);
+					EngineInfo *ei = &_engine_info[id];
+					ei->string_id = string;
 				} else {
 					AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, id);
 				}
@@ -3612,7 +3662,7 @@
 						if (_cur_grffile->housespec == NULL || _cur_grffile->housespec[GB(id, 0, 8)] == NULL) {
 							grfmsg(1, "FeatureNewName: Attempt to name undefined house 0x%X, ignoring.", GB(id, 0, 8));
 						} else {
-							_cur_grffile->housespec[GB(id, 0, 8)]->building_name = AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_UNDEFINED);
+							_cur_grffile->housespec[GB(id, 0, 8)]->building_name = GRFMappedStringID(AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_UNDEFINED), 0);
 						}
 						break;
 
@@ -3674,6 +3724,25 @@
 	return 0;
 }
 
+/** Allows to reposition the loaded sprite to its correct placment.
+ * @param load_index SpriteID of the sprite to be relocated */
+static inline void TranslateShoreSprites(SpriteID load_index)
+{
+	/** Contains the displacement required for the corresponding initial sprite*/
+	static const SpriteID shore_dup[8] = {
+		SPR_SHORE_BASE +  4,  ///< 4062
+		SPR_SHORE_BASE +  1,  ///< 4063
+		SPR_SHORE_BASE +  2,  ///< 4064
+		SPR_SHORE_BASE +  8,  ///< 4065
+		SPR_SHORE_BASE +  6,  ///< 4066
+		SPR_SHORE_BASE + 12,  ///< 4067
+		SPR_SHORE_BASE +  3,  ///< 4068
+		SPR_SHORE_BASE +  9,  ///< 4069
+	};
+
+	DupSprite(load_index, shore_dup[load_index - SPR_ORIGINALSHORE_START]);
+}
+
 /* Action 0x05 */
 static void GraphicsNew(byte *buf, int len)
 {
@@ -3684,139 +3753,107 @@
 	 * V other data    Graphics type specific data.  Currently unused. */
 	/* TODO */
 
-	SpriteID replace = 0;
+	enum Action5BlockType {
+		A5BLOCK_FIXED,                ///< Only allow replacing a whole block of sprites. (TTDP compatible)
+		A5BLOCK_ALLOW_OFFSET,         ///< Allow replacing any subset by specifiing an offset.
+		A5BLOCK_INVALID,              ///< unknown/not-implemented type
+	};
+	struct Action5Type {
+		Action5BlockType block_type;  ///< How is this Action5 type processed?
+		SpriteID sprite_base;         ///< Load the sprites starting from this sprite.
+		uint16 min_sprites;           ///< If the Action5 contains less sprites, the whole block will be ignored.
+		uint16 max_sprites;           ///< If the Action5 contains more sprites, only the first max_sprites sprites will be used.
+		const char *name;             ///< Name for error messages.
+	};
+
+	static const Action5Type action5_types[] = {
+		/* Note: min_sprites should not be changed. Therefore these constants are directly here and not in sprites.h */
+		/* 0x00 */ { A5BLOCK_INVALID,      0,                   0, 0,                                           "Type 0x00"             },
+		/* 0x01 */ { A5BLOCK_INVALID,      0,                   0, 0,                                           "Type 0x01"             },
+		/* 0x02 */ { A5BLOCK_INVALID,      0,                   0, 0,                                           "Type 0x02"             },
+		/* 0x03 */ { A5BLOCK_INVALID,      0,                   0, 0,                                           "Type 0x03"             },
+		/* 0x04 */ { A5BLOCK_FIXED,        SPR_SIGNALS_BASE,   48, PRESIGNAL_SEMAPHORE_AND_PBS_SPRITE_COUNT,    "Signal graphics"       },
+		/* 0x05 */ { A5BLOCK_FIXED,        SPR_ELRAIL_BASE,    48, ELRAIL_SPRITE_COUNT,                         "Catenary graphics"     },
+		/* 0x06 */ { A5BLOCK_FIXED,        SPR_SLOPES_BASE,    74, NORMAL_AND_HALFTILE_FOUNDATION_SPRITE_COUNT, "Foundation graphics"   },
+		/* 0x07 */ { A5BLOCK_INVALID,      0,                  75, 0,                                           "TTDP GUI graphics"     }, // Not used by OTTD.
+		/* 0x08 */ { A5BLOCK_FIXED,        SPR_CANALS_BASE,    65, CANALS_SPRITE_COUNT,                         "Canal graphics"        },
+		/* 0x09 */ { A5BLOCK_FIXED,        SPR_ONEWAY_BASE,     6, ONEWAY_SPRITE_COUNT,                         "One way road graphics" },
+		/* 0x0A */ { A5BLOCK_FIXED,        SPR_2CCMAP_BASE,   256, TWOCCMAP_SPRITE_COUNT,                       "2CC colour maps"       },
+		/* 0x0B */ { A5BLOCK_FIXED,        SPR_TRAMWAY_BASE,  113, TRAMWAY_SPRITE_COUNT,                        "Tramway graphics"      },
+		/* 0x0C */ { A5BLOCK_INVALID,      0,                 133, 0,                                           "Snowy temperate tree"  }, // Not yet used by OTTD.
+		/* 0x0D */ { A5BLOCK_FIXED,        SPR_SHORE_BASE,     16, SPR_SHORE_SPRITE_COUNT,                      "Shore graphics"        },
+		/* 0x0E */ { A5BLOCK_INVALID,      0,                   0, 0,                                           "New Signals graphics"  }, // Not yet used by OTTD.
+		/* 0x0F */ { A5BLOCK_INVALID,      0,                  12, 0,                                           "Sloped rail track"     }, // Not yet used by OTTD.
+		/* 0x10 */ { A5BLOCK_FIXED,        SPR_AIRPORTX_BASE,  15, AIRPORTX_SPRITE_COUNT,                       "Airport graphics"      },
+		/* 0x11 */ { A5BLOCK_FIXED,        SPR_ROADSTOP_BASE,   8, ROADSTOP_SPRITE_COUNT,                       "Road stop graphics"    },
+		/* 0x12 */ { A5BLOCK_INVALID,      0,                   8, 0,                                           "Aqueduct graphics"     }, // Not yet used by OTTD.
+		/* 0x13 */ { A5BLOCK_FIXED,        SPR_AUTORAIL_BASE,  55, AUTORAIL_SPRITE_COUNT,                       "Autorail graphics"     },
+		/* 0x14 */ { A5BLOCK_ALLOW_OFFSET, SPR_FLAGS_BASE,      1, FLAGS_SPRITE_COUNT,                          "Flag graphics"         },
+		/* 0x15 */ { A5BLOCK_ALLOW_OFFSET, SPR_OPENTTD_BASE,    1, OPENTTD_SPRITE_COUNT,                        "OpenTTD GUI graphics"  },
+	};
 
 	if (!check_length(len, 2, "GraphicsNew")) return;
 	buf++;
 	uint8 type = grf_load_byte(&buf);
 	uint16 num = grf_load_extended(&buf);
-	uint16 skip_num = 0;
 	uint16 offset = HasBit(type, 7) ? grf_load_extended(&buf) : 0;
 	ClrBit(type, 7); // Clear the high bit as that only indicates whether there is an offset.
 
-	switch (type) {
-		case 0x04: // Signal graphics
-			if (num != PRESIGNAL_SPRITE_COUNT && num != PRESIGNAL_AND_SEMAPHORE_SPRITE_COUNT && num != PRESIGNAL_SEMAPHORE_AND_PBS_SPRITE_COUNT) {
-				grfmsg(1, "GraphicsNew: Signal graphics sprite count must be 48, 112 or 240, skipping");
-				return;
-			}
-			replace = SPR_SIGNALS_BASE;
-			break;
-
-		case 0x05: // Catenary graphics
-			if (num != ELRAIL_SPRITE_COUNT) {
-				grfmsg(1, "GraphicsNew: Catenary graphics sprite count must be 48, skipping");
-				return;
-			}
-			replace = SPR_ELRAIL_BASE;
-			break;
-
-		case 0x06: // Foundations
-			if (num != NORMAL_FOUNDATION_SPRITE_COUNT && num != NORMAL_AND_HALFTILE_FOUNDATION_SPRITE_COUNT) {
-				grfmsg(1, "GraphicsNew: Foundation graphics sprite count must be 74 or 90, skipping");
-				return;
-			}
-			replace = SPR_SLOPES_BASE; break;
-			break;
-
-		/* case 0x07: // TTDP GUI sprites. Not used by OTTD. */
-
-		case 0x08: // Canal graphics
-			if (num != CANALS_SPRITE_COUNT) {
-				grfmsg(1, "GraphicsNew: Canal graphics sprite count must be 65, skipping");
-				return;
-			}
-			replace = SPR_CANALS_BASE;
-			break;
-
-		case 0x09: // One way graphics
-			if (num != ONEWAY_SPRITE_COUNT) {
-				grfmsg(1, "GraphicsNew: One way road graphics sprite count must be 6, skipping");
-				return;
-			}
-			replace = SPR_ONEWAY_BASE;
-			break;
-
-		case 0x0A: // 2CC colour maps
-			if (num != TWOCCMAP_SPRITE_COUNT) {
-				grfmsg(1, "GraphicsNew: 2CC colour maps sprite count must be 256, skipping");
-				return;
-			}
-			replace = SPR_2CCMAP_BASE;
-			break;
-
-		case 0x0B: // tramways
-			if (num != TRAMWAY_SPRITE_COUNT) {
-				grfmsg(1, "GraphicsNew: Tramway graphics sprite count must be 113, skipping");
-				return;
-			}
-			replace = SPR_TRAMWAY_BASE;
-			break;
-
-		/* case 0x0C: // Snowy temperate trees. Not yet used by OTTD. */
-
-		case 0x0D: // Coast graphics
-			if (num != 16) {
-				grfmsg(1, "GraphicsNew: Coast graphics sprite count must be 16, skipping");
-				return;
-			}
-			_coast_base = _cur_spriteid;
-			_loaded_newgrf_features.has_newwater = true;
-			break;
-
-		/* case 0x0E: // New Signals. Not yet used by OTTD. */
-
-		/* case 0x0F: // Tracks for marking sloped rail. Not yet used by OTTD. */
-
-		case 0x10: // New airport sprites
-			if (num != AIRPORTX_SPRITE_COUNT && num != 15) {
-				grfmsg(1, "GraphicsNew: Airport graphics sprite count must be 15 or 24, skipping");
-				return;
-			}
-			replace = SPR_AIRPORTX_BASE;
-			break;
-
-		case 0x11: // Road stop sprites
-			if (num != ROADSTOP_SPRITE_COUNT) {
-				grfmsg(1, "GraphicsNew: Road stop graphics sprite count must be 8, skipping");
-				return;
-			}
-			replace = SPR_ROADSTOP_BASE;
-			break;
-
-		/* case 0x12: // Aqueduct sprites. Not yet used by OTTD. */
-
-		case 0x13: // Autorail sprites
-			if (num != AUTORAIL_SPRITE_COUNT) {
-				grfmsg(1, "GraphicsNew: Autorail graphics sprite count must be 55, skipping");
-				return;
-			}
-			replace = SPR_AUTORAIL_BASE;
-			break;
-
-		case 0x14: // Flag sprites
-			skip_num = SanitizeSpriteOffset(num, offset, FLAGS_SPRITE_COUNT, "Flag graphics");
-			replace = SPR_FLAGS_BASE + offset;
-			break;
-
-		case 0x15: // OpenTTD GUI sprites
-			skip_num = SanitizeSpriteOffset(num, offset, OPENTTD_SPRITE_COUNT, "OpenTTD graphics");
-			replace = SPR_OPENTTD_BASE + offset;
-			break;
-
-		default:
-			grfmsg(2, "GraphicsNew: Custom graphics (type 0x%02X) sprite block of length %u (unimplemented, ignoring)",
-					type, num);
-			_skip_sprites = num;
-			return;
+	if ((type == 0x0D) && (num == 10) && _cur_grffile->is_ottdfile) {
+		/* Special not-TTDP-compatible case used in openttd(d/w).grf
+		 * Missing shore sprites and initialisation of SPR_SHORE_BASE */
+		grfmsg(2, "GraphicsNew: Loading 10 missing shore sprites from openttd(d/w).grf.");
+		LoadNextSprite(       SPR_SHORE_BASE          +  0, _file_index, _nfo_line++); // SLOPE_STEEP_S
+		TranslateShoreSprites(SPR_ORIGINALSHORE_START +  1);                           // SLOPE_W
+		TranslateShoreSprites(SPR_ORIGINALSHORE_START +  2);                           // SLOPE_S
+		TranslateShoreSprites(SPR_ORIGINALSHORE_START +  6);                           // SLOPE_SW
+		TranslateShoreSprites(SPR_ORIGINALSHORE_START     );                           // SLOPE_E
+		LoadNextSprite(       SPR_SHORE_BASE          +  5, _file_index, _nfo_line++); // SLOPE_STEEP_W
+		TranslateShoreSprites(SPR_ORIGINALSHORE_START +  4);                           // SLOPE_SE
+		LoadNextSprite(       SPR_SHORE_BASE          +  7, _file_index, _nfo_line++); // SLOPE_WSE
+		TranslateShoreSprites(SPR_ORIGINALSHORE_START +  3);                           // SLOPE_N
+		TranslateShoreSprites(SPR_ORIGINALSHORE_START +  7);                           // SLOPE_NW
+		LoadNextSprite(       SPR_SHORE_BASE          + 10, _file_index, _nfo_line++); // SLOPE_STEEP_N
+		LoadNextSprite(       SPR_SHORE_BASE          + 11, _file_index, _nfo_line++); // SLOPE_NWS
+		TranslateShoreSprites(SPR_ORIGINALSHORE_START +  5);                           // SLOPE_NE
+		LoadNextSprite(       SPR_SHORE_BASE          + 13, _file_index, _nfo_line++); // SLOPE_ENW
+		LoadNextSprite(       SPR_SHORE_BASE          + 14, _file_index, _nfo_line++); // SLOPE_SEN
+		LoadNextSprite(       SPR_SHORE_BASE          + 15, _file_index, _nfo_line++); // SLOPE_STEEP_E
+		LoadNextSprite(       SPR_SHORE_BASE          + 16, _file_index, _nfo_line++); // SLOPE_EW
+		LoadNextSprite(       SPR_SHORE_BASE          + 17, _file_index, _nfo_line++); // SLOPE_NS
+		return;
 	}
 
-	if (replace == 0) {
-		grfmsg(2, "GraphicsNew: Loading %u sprites of type 0x%02X at SpriteID 0x%04X", num, type, _cur_spriteid);
-	} else {
-		grfmsg(2, "GraphicsNew: Replacing %u sprites of type 0x%02X at SpriteID 0x%04X", num, type, replace);
+	/* Supported type? */
+	if ((type >= lengthof(action5_types)) || (action5_types[type].block_type == A5BLOCK_INVALID)) {
+		grfmsg(2, "GraphicsNew: Custom graphics (type 0x%02X) sprite block of length %u (unimplemented, ignoring)", type, num);
+		_skip_sprites = num;
+		return;
 	}
 
+	const Action5Type *action5_type = &action5_types[type];
+
+	/* Ignore offset if not allowed */
+	if ((action5_type->block_type != A5BLOCK_ALLOW_OFFSET) && (offset != 0)) {
+		grfmsg(1, "GraphicsNew: %s (type 0x%02X) do not allow an <offset> field. Ignoring offset.", action5_type->name, type);
+		offset = 0;
+	}
+
+	/* Ignore action5 if too few sprites are specified. (for TTDP compatibility)
+	 * This does not make sense, if <offset> is allowed */
+	if ((action5_type->block_type == A5BLOCK_FIXED) && (num < action5_type->min_sprites)) {
+		grfmsg(1, "GraphicsNew: %s (type 0x%02X) count must be at least %d. Only %d were specified. Skipping.", action5_type->name, type, action5_type->min_sprites, num);
+		_skip_sprites = num;
+		return;
+	}
+
+	/* Load at most max_sprites sprites. Skip remaining sprites. (for compatibility with TTDP and future extentions) */
+	uint16 skip_num = SanitizeSpriteOffset(num, offset, action5_type->max_sprites, action5_type->name);
+	SpriteID replace = action5_type->sprite_base + offset;
+
+	/* Load <num> sprites starting from <replace>, then skip <skip_num> sprites. */
+	grfmsg(2, "GraphicsNew: Replacing sprites %d to %d of %s (type 0x%02X) at SpriteID 0x%04X", offset, offset + num - 1, action5_type->name, type, replace);
+
 	for (; num > 0; num--) {
 		_nfo_line++;
 		LoadNextSprite(replace == 0 ? _cur_spriteid++ : replace++, _file_index, _nfo_line);
@@ -4151,7 +4188,7 @@
 		_skip_sprites = -1;
 
 		/* If an action 8 hasn't been encountered yet, disable the grf. */
-		if (_cur_grfconfig->status != GCS_ACTIVATED && _cur_grfconfig->status != GCS_INITIALISED) {
+		if (_cur_grfconfig->status != GCS_ACTIVATED) {
 			_cur_grfconfig->status = GCS_DISABLED;
 		}
 	}
@@ -4232,8 +4269,13 @@
 		);
 
 		for (uint j = 0; j < num_sprites; j++) {
+			int load_index = first_sprite + j;
 			_nfo_line++;
-			LoadNextSprite(first_sprite + j, _file_index, _nfo_line); // XXX
+			LoadNextSprite(load_index, _file_index, _nfo_line); // XXX
+
+			/*  Shore sprites now located at different addresses.
+			 * So apply the required displacements */
+			if (IsInsideMM(load_index, SPR_ORIGINALSHORE_START, SPR_ORIGINALSHORE_END + 1)) TranslateShoreSprites(load_index);
 		}
 	}
 }
@@ -5406,11 +5448,7 @@
 	CleanUpGRFTownNames();
 
 	/* Copy/reset original engine info data */
-	memcpy(&_engine_info, &orig_engine_info, sizeof(orig_engine_info));
-	memcpy(&_rail_vehicle_info, &orig_rail_vehicle_info, sizeof(orig_rail_vehicle_info));
-	memcpy(&_ship_vehicle_info, &orig_ship_vehicle_info, sizeof(orig_ship_vehicle_info));
-	memcpy(&_aircraft_vehicle_info, &orig_aircraft_vehicle_info, sizeof(orig_aircraft_vehicle_info));
-	memcpy(&_road_vehicle_info, &orig_road_vehicle_info, sizeof(orig_road_vehicle_info));
+	SetupEngines();
 
 	/* Copy/reset original bridge info data
 	 * First, free sprite table data */
@@ -5432,9 +5470,7 @@
 
 	/* Unload sprite group data */
 	UnloadWagonOverrides();
-	UnloadRotorOverrideSprites();
 	UnloadCustomEngineSprites();
-	UnloadCustomEngineNames();
 	ResetEngineListOrder();
 
 	/* Reset price base data */
@@ -5458,8 +5494,8 @@
 	/* Reset FSMports classes */
 	ResetFSMportsClasses();
 
-	/* Reset canal sprite groups */
-	memset(_canal_sg, 0, sizeof(_canal_sg));
+	/* Reset canal sprite groups and flags */
+	memset(_water_feature, 0, sizeof(_water_feature));
 
 	/* Reset the snowline table. */
 	ClearSnowLine();
@@ -5470,9 +5506,6 @@
 	/* Reset NewGRF errors. */
 	ResetNewGRFErrors();
 
-	/* Add engine type to engine data. This is needed for the refit precalculation. */
-	AddTypeToEngines();
-
 	/* Set up the default cargo types */
 	SetupCargoForClimate(_opt.landscape);
 
@@ -5487,8 +5520,6 @@
 	_loaded_newgrf_features.has_2CC           = false;
 	_loaded_newgrf_features.has_newhouses     = false;
 	_loaded_newgrf_features.has_newindustries = false;
-	_loaded_newgrf_features.has_newwater      = false;
-	_coast_base = 0;
 
 	InitializeSoundPool();
 	InitializeSpriteGroupPool();
@@ -5698,8 +5729,11 @@
 	 * compatible with TTDPatch, where if no houses have start dates before
 	 * 1930 and the date is before 1930, the game pretends that this is 1930.
 	 * If there have been any houses defined with start dates before 1930 then
-	 * the dates are left alone. */
-	bool reset_dates = true;
+	 * the dates are left alone.
+	 * On the other hand, why 1930? Just 'fix' the houses with the lowest
+	 * minimum introduction date to 0.
+	 */
+	Year min_date = MAX_YEAR;
 
 	for (GRFFile *file = _first_grffile; file != NULL; file = file->next) {
 		if (file->housespec == NULL) continue;
@@ -5707,17 +5741,18 @@
 		for (int i = 0; i < HOUSE_MAX; i++) {
 			HouseSpec *hs = file->housespec[i];
 			if (hs != NULL) {
+				hs->building_name.MapString();
 				_house_mngr.SetEntitySpec(hs);
-				if (hs->min_date < 1930) reset_dates = false;
+				if (hs->min_date < min_date) min_date = hs->min_date;
 			}
 		}
 	}
 
-	if (reset_dates) {
-		for (int i = NEW_HOUSE_OFFSET; i < HOUSE_MAX; i++) {
+	if (min_date != 0) {
+		for (int i = 0; i < HOUSE_MAX; i++) {
 			HouseSpec *hs = GetHouseSpecs(i);
 
-			if (hs->enabled && hs->min_date == 1930) hs->min_date = 0;
+			if (hs->enabled && hs->min_date == min_date) hs->min_date = 0;
 		}
 	}
 }
@@ -5737,18 +5772,23 @@
 					/* process the conversion of text at the end, so to be sure everything will be fine
 					 * and available.  Check if it does not return undefind marker, which is a very good sign of a
 					 * substitute industry who has not changed the string been examined, thus using it as such */
+					indsp->name.MapString();
 					strid = GetGRFStringID(indsp->grf_prop.grffile->grfid, indsp->name);
 					if (strid != STR_UNDEFINED) indsp->name = strid;
 
+					indsp->closure_text.MapString();
 					strid = GetGRFStringID(indsp->grf_prop.grffile->grfid, indsp->closure_text);
 					if (strid != STR_UNDEFINED) indsp->closure_text = strid;
 
+					indsp->production_up_text.MapString();
 					strid = GetGRFStringID(indsp->grf_prop.grffile->grfid, indsp->production_up_text);
 					if (strid != STR_UNDEFINED) indsp->production_up_text = strid;
 
+					indsp->production_down_text.MapString();
 					strid = GetGRFStringID(indsp->grf_prop.grffile->grfid, indsp->production_down_text);
 					if (strid != STR_UNDEFINED) indsp->production_down_text = strid;
 
+					indsp->new_industry_text.MapString();
 					strid = GetGRFStringID(indsp->grf_prop.grffile->grfid, indsp->new_industry_text);
 					if (strid != STR_UNDEFINED) indsp->new_industry_text = strid;
 
@@ -5788,11 +5828,11 @@
 		/* Don't map if the cargo is unavailable or not from NewGRF */
 		if (cs->grfid == 0) continue;
 
-		cs->name         = MapGRFStringID(cs->grfid, cs->name);
-		cs->name_single  = MapGRFStringID(cs->grfid, cs->name_single);
-		cs->units_volume = MapGRFStringID(cs->grfid, cs->units_volume);
-		cs->quantifier   = MapGRFStringID(cs->grfid, cs->quantifier);
-		cs->abbrev       = MapGRFStringID(cs->grfid, cs->abbrev);
+		cs->name.MapString();
+		cs->name_single.MapString();
+		cs->units_volume.MapString();
+		cs->quantifier.MapString();
+		cs->abbrev.MapString();
 	}
 }
 
@@ -5846,7 +5886,6 @@
 		/* No preloaded sprite to work with; allocate and read the
 		 * pseudo sprite content. */
 		buf = MallocT<byte>(num);
-		if (buf == NULL) error("DecodeSpecialSprite: Could not allocate memory");
 		FioReadBlock(buf, num);
 	} else {
 		/* Use the preloaded sprite data. */
@@ -5897,6 +5936,7 @@
 		if (_cur_grffile == NULL) error("File '%s' lost in cache.\n", filename);
 		if (stage == GLS_RESERVE && config->status != GCS_INITIALISED) return;
 		if (stage == GLS_ACTIVATION && !HasBit(config->flags, GCF_RESERVED)) return;
+		_cur_grffile->is_ottdfile = config->IsOpenTTDBaseGRF();
 	}
 
 	if (file_index > LAST_GRF_SLOT) {
@@ -5972,7 +6012,7 @@
 
 void InitDepotWindowBlockSizes();
 
-extern void SortTownGeneratorNames();
+extern void InitGRFTownGeneratorNames();
 
 static void AfterLoadGRFs()
 {
@@ -6003,7 +6043,7 @@
 	MapNewCargoStrings();
 
 	/* Update the townname generators list */
-	SortTownGeneratorNames();
+	InitGRFTownGeneratorNames();
 
 	/* Update references for oil rigs and dummy airport */
 	AirportFTAClass::oil_rig = GetCustomFSMportsSpecByGrf(0x4450414F, 3)->portFSM;
@@ -6016,6 +6056,17 @@
 
 	ResetNewGRFData();
 
+	/*
+	 * Reset the status of all files, so we can 'retry' to load them.
+	 * This is needed when one for example rearranges the NewGRFs in-game
+	 * and a previously disabled NewGRF becomes useable. If it would not
+	 * be reset, the NewGRF would remain disabled even though it should
+	 * have been enabled.
+	 */
+	for (GRFConfig *c = _grfconfig; c != NULL; c = c->next) {
+		if (c->status != GCS_NOT_FOUND) c->status = GCS_UNKNOWN;
+	}
+
 	/* Load newgrf sprites
 	 * in each loading stage, (try to) open each file specified in the config
 	 * and load information from it. */
@@ -6052,3 +6103,11 @@
 {
 	return HasBit(_misc_grf_features, bit);
 }
+
+void GRFMappedStringID::MapString()
+{
+	if (this->grfid == 0) return;
+
+	this->string = MapGRFStringID(this->grfid, this->string);
+	this->grfid = 0;
+}
--- a/src/newgrf.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,11 +6,10 @@
 #define NEWGRF_H
 
 #include "station.h"
-#include "town.h"
+#include "town_type.h"
 #include "newgrf_config.h"
-#include "helpers.hpp"
 #include "cargotype.h"
-#include "industry.h"
+#include "industry_type.h"
 #include "newgrf_fsmports.h"
 
 enum GrfLoadingStage {
@@ -43,6 +42,7 @@
 
 struct GRFFile {
 	char *filename;
+	bool is_ottdfile;
 	uint32 grfid;
 	uint16 sprite_offset;
 	byte grf_version;
@@ -87,13 +87,10 @@
 
 extern GRFFile *_first_grffile;
 
-extern SpriteID _coast_base;
-
 struct GRFLoadedFeatures {
 	bool has_2CC;             ///< Set if any vehicle is loaded which uses 2cc (two company colours).
 	bool has_newhouses;       ///< Set if there are any newhouses loaded.
 	bool has_newindustries;   ///< Set if there are any newindustries loaded.
-	bool has_newwater;        ///< Set it there are any newwater grf loaded
 };
 
 /* Indicates which are the newgrf features currently loaded ingame */
--- a/src/newgrf_callbacks.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_callbacks.h	Tue Jan 22 21:00:30 2008 +0000
@@ -297,10 +297,11 @@
 };
 
 /**
- * Result of a failed callback.
+ * Different values for Callback result evaluations
  */
 enum {
-	CALLBACK_FAILED = 0xFFFF
+	CALLBACK_FAILED              = 0xFFFF,  ///< Result of a failed callback.
+	CALLBACK_HOUSEPRODCARGO_END  = 0x20FF,  ///< Sentinel indicating that the loop for CBID_HOUSE_PRODUCE_CARGO has ended
 };
 
 #endif /* NEWGRF_CALLBACKS_H */
--- a/src/newgrf_canal.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_canal.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -10,17 +10,19 @@
 #include "newgrf_commons.h"
 #include "newgrf_spritegroup.h"
 #include "newgrf_canal.h"
+#include "tile_map.h"
+#include "water_map.h"
 
 
 /** Table of canal 'feature' sprite groups */
-const SpriteGroup *_canal_sg[CF_END];
+WaterFeature _water_feature[CF_END];
 
 
 /* Random bits and triggers are not supported for canals, so the following
  * three functions are stubs. */
 static uint32 CanalGetRandomBits(const ResolverObject *object)
 {
-	return 0;
+	return GetWaterTileRandomBits(object->u.canal.tile);
 }
 
 
@@ -46,6 +48,9 @@
 
 		case 0x81:
 			return GetTerrainType(tile);
+
+		case 0x83:
+			return GetWaterTileRandomBits(tile);
 	}
 
 	DEBUG(grf, 1, "Unhandled canal property 0x%02X", variable);
@@ -89,7 +94,7 @@
 
 	NewCanalResolver(&object, tile);
 
-	group = Resolve(_canal_sg[feature], &object);
+	group = Resolve(_water_feature[feature].group, &object);
 	if (group == NULL || group->type != SGT_RESULT) return 0;
 
 	return group->g.result.sprite;
--- a/src/newgrf_canal.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_canal.h	Tue Jan 22 21:00:30 2008 +0000
@@ -11,12 +11,21 @@
 	CF_DIKES,
 	CF_ICON,
 	CF_DOCKS,
+	CF_RIVER_SLOPE,
+	CF_RIVER_EDGE,
 	CF_END,
 };
 
 
+struct WaterFeature {
+	const SpriteGroup *group;
+	uint8 callbackmask;
+	uint8 flags;
+};
+
+
 /** Table of canal 'feature' sprite groups */
-extern const SpriteGroup *_canal_sg[CF_END];
+extern WaterFeature _water_feature[CF_END];
 
 
 /** Lookup the base sprite to use for a canal.
--- a/src/newgrf_cargo.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_cargo.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,17 +6,22 @@
 #define NEWGRF_CARGO_H
 
 #include "newgrf_callbacks.h"
+#include "cargo_type.h"
+#include "gfx_type.h"
 
 enum {
-	CC_NOAVAILABLE  = 0,
-	CC_PASSENGERS   = 1 << 0,
-	CC_MAIL         = 1 << 1,
-	CC_EXPRESS      = 1 << 2,
-	CC_ARMOURED     = 1 << 3,
-	CC_BULK         = 1 << 4,
-	CC_PIECE_GOODS  = 1 << 5,
-	CC_LIQUID       = 1 << 6,
-	CC_REFRIGERATED = 1 << 7,
+	CC_NOAVAILABLE  = 0,       ///< No cargo class has been specified
+	CC_PASSENGERS   = 1 <<  0, ///< Passengers
+	CC_MAIL         = 1 <<  1, ///< Mail
+	CC_EXPRESS      = 1 <<  2, ///< Express cargo (Goods, Food, Candy, but also possible for passengers)
+	CC_ARMOURED     = 1 <<  3, ///< Armoured cargo (Valuables, Gold, Diamonds)
+	CC_BULK         = 1 <<  4, ///< Bulk cargo (Coal, Grain etc., Ores, Fruit)
+	CC_PIECE_GOODS  = 1 <<  5, ///< Piece goods (Livestock, Wood, Steel, Paper)
+	CC_LIQUID       = 1 <<  6, ///< Liquids (Oil, Water, Rubber)
+	CC_REFRIGERATED = 1 <<  7, ///< Refrigerated cargo (Food, Fruit)
+	CC_HAZARDOUS    = 1 <<  8, ///< Hazardous cargo (Nucleair Fuel, Explosives, etc.)
+	CC_COVERED      = 1 <<  9, ///< Covered/Sheltered Freight (Transporation in Box Vans, Silo Wagons, etc.)
+	CC_SPECIAL      = 1 << 15  ///< Special bit used for livery refit tricks instead of normal cargoes.
 };
 
 static const CargoID CT_DEFAULT      = NUM_CARGO + 0;
--- a/src/newgrf_commons.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_commons.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -12,6 +12,9 @@
 #include "industry.h"
 #include "newgrf.h"
 #include "newgrf_commons.h"
+#include "tile_map.h"
+#include "station_map.h"
+#include "settings_type.h"
 
 /** Constructor of generic class
  * @param offset end of original data for this entity. i.e: houses = 110
@@ -276,6 +279,9 @@
 	if (x >= 8) x -= 16;
 	if (y >= 8) y -= 16;
 
+	/* Swap width and height depending on axis for railway stations */
+	if (IsRailwayStationTile(tile) && GetRailStationAxis(tile) == AXIS_X) Swap(x, y);
+
 	/* Make sure we never roam outside of the map */
 	return TILE_MASK(tile + TileDiffXY(x, y));
 }
--- a/src/newgrf_config.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_config.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,17 +4,15 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
-#include "macros.h"
 #include "debug.h"
 #include "variables.h"
-#include "string.h"
 #include "saveload.h"
 #include "md5.h"
 #include "network/network_data.h"
 #include "newgrf.h"
 #include "newgrf_config.h"
-#include "helpers.hpp"
+#include "core/alloc_func.hpp"
+#include "string_func.h"
 
 #include "fileio.h"
 #include "fios.h"
@@ -35,8 +33,8 @@
 static bool CalcGRFMD5Sum(GRFConfig *config)
 {
 	FILE *f;
-	md5_state_t md5state;
-	md5_byte_t buffer[1024];
+	Md5 checksum;
+	uint8 buffer[1024];
 	size_t len, size;
 
 	/* open the file */
@@ -44,12 +42,11 @@
 	if (f == NULL) return false;
 
 	/* calculate md5sum */
-	md5_init(&md5state);
 	while ((len = fread(buffer, 1, (size > sizeof(buffer)) ? sizeof(buffer) : size, f)) != 0 && size != 0) {
 		size -= len;
-		md5_append(&md5state, buffer, len);
+		checksum.Append(buffer, len);
 	}
-	md5_finish(&md5state, config->md5sum);
+	checksum.Finish(config->md5sum);
 
 	FioFCloseFile(f);
 
--- a/src/newgrf_config.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_config.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,7 +5,7 @@
 #ifndef NEWGRF_CONFIG_H
 #define NEWGRF_CONFIG_H
 
-#include "openttd.h"
+#include "strings_type.h"
 
 /* GRF config bit flags */
 enum GCF_Flags {
--- a/src/newgrf_engine.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_engine.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,10 +6,10 @@
 #include "openttd.h"
 #include "variables.h"
 #include "debug.h"
-#include "functions.h"
 #include "engine.h"
 #include "train.h"
-#include "player.h"
+#include "player_func.h"
+#include "player_base.h"
 #include "station.h"
 #include "airport.h"
 #include "newgrf.h"
@@ -18,29 +18,31 @@
 #include "newgrf_station.h"
 #include "newgrf_spritegroup.h"
 #include "newgrf_cargo.h"
-#include "date.h"
-#include "helpers.hpp"
 #include "cargotype.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "core/random_func.hpp"
+#include "direction_func.h"
 
 
 int _traininfo_vehicle_pitch = 0;
 int _traininfo_vehicle_width = 29;
 
 struct WagonOverride {
-	byte *train_id;
-	int trains;
+	EngineID *train_id;
+	uint trains;
 	CargoID cargo;
 	const SpriteGroup *group;
 };
 
 struct WagonOverrides {
-	int overrides_count;
+	uint overrides_count;
 	WagonOverride *overrides;
 };
 
 static WagonOverrides _engine_wagon_overrides[TOTAL_NUM_ENGINES];
 
-void SetWagonOverrideSprites(EngineID engine, CargoID cargo, const SpriteGroup *group, byte *train_id, int trains)
+void SetWagonOverrideSprites(EngineID engine, CargoID cargo, const SpriteGroup *group, EngineID *train_id, uint trains)
 {
 	WagonOverrides *wos;
 	WagonOverride *wo;
@@ -59,11 +61,11 @@
 	wo->group = group;
 	wo->cargo = cargo;
 	wo->trains = trains;
-	wo->train_id = MallocT<byte>(trains);
-	memcpy(wo->train_id, train_id, trains);
+	wo->train_id = MallocT<EngineID>(trains);
+	memcpy(wo->train_id, train_id, trains * sizeof *train_id);
 }
 
-const SpriteGroup *GetWagonOverrideSpriteSet(EngineID engine, CargoID cargo, byte overriding_engine)
+const SpriteGroup *GetWagonOverrideSpriteSet(EngineID engine, CargoID cargo, EngineID overriding_engine)
 {
 	const WagonOverrides *wos = &_engine_wagon_overrides[engine];
 
@@ -72,12 +74,12 @@
 	 * for O(1). Or O(logMlogN) and searching binary tree or smt. like
 	 * that. --pasky */
 
-	for (int i = 0; i < wos->overrides_count; i++) {
+	for (uint i = 0; i < wos->overrides_count; i++) {
 		const WagonOverride *wo = &wos->overrides[i];
 
 		if (wo->cargo != cargo && wo->cargo != CT_DEFAULT) continue;
 
-		for (int j = 0; j < wo->trains; j++) {
+		for (uint j = 0; j < wo->trains; j++) {
 			if (wo->train_id[j] == overriding_engine) return wo->group;
 		}
 	}
@@ -89,16 +91,10 @@
  */
 void UnloadWagonOverrides()
 {
-	WagonOverrides *wos;
-	WagonOverride *wo;
-	EngineID engine;
-	int i;
-
-	for (engine = 0; engine < TOTAL_NUM_ENGINES; engine++) {
-		wos = &_engine_wagon_overrides[engine];
-		for (i = 0; i < wos->overrides_count; i++) {
-			wo = &wos->overrides[i];
-			wo->group = NULL;
+	for (EngineID engine = 0; engine < TOTAL_NUM_ENGINES; engine++) {
+		WagonOverrides *wos = &_engine_wagon_overrides[engine];
+		for (uint i = 0; i < wos->overrides_count; i++) {
+			WagonOverride *wo = &wos->overrides[i];
 			free(wo->train_id);
 		}
 		free(wos->overrides);
@@ -131,33 +127,6 @@
 	memset(_engine_grf, 0, sizeof(_engine_grf));
 }
 
-static const SpriteGroup *heli_rotor_custom_sprites[NUM_AIRCRAFT_ENGINES];
-
-/** Load a rotor override sprite group for an aircraft */
-void SetRotorOverrideSprites(EngineID engine, const SpriteGroup *group)
-{
-	assert(engine >= AIRCRAFT_ENGINES_INDEX);
-	assert(engine < AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES);
-
-	if (heli_rotor_custom_sprites[engine - AIRCRAFT_ENGINES_INDEX] != NULL) {
-		grfmsg(6, "SetRotorOverrideSprites: engine %d already has group -- replacing.", engine);
-	}
-	heli_rotor_custom_sprites[engine - AIRCRAFT_ENGINES_INDEX] = group;
-}
-
-/** Unload all rotor override sprite groups */
-void UnloadRotorOverrideSprites()
-{
-	EngineID engine;
-
-	/* Starting at AIRCRAFT_ENGINES_INDEX may seem pointless, but it means
-	 * the context of EngineID is correct */
-	for (engine = AIRCRAFT_ENGINES_INDEX; engine < AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES; engine++) {
-		heli_rotor_custom_sprites[engine - AIRCRAFT_ENGINES_INDEX] = NULL;
-	}
-}
-
-
 /**
  * Tie a GRFFile entry to an engine, to allow us to retrieve GRF parameters
  * etc during a game.
@@ -722,8 +691,6 @@
 		case 0x5D: return GB(ClampToI32(v->value),  8, 24);
 		case 0x5E: return GB(ClampToI32(v->value), 16, 16);
 		case 0x5F: return GB(ClampToI32(v->value), 24,  8);
-		case 0x60: return v->string_id;
-		case 0x61: return GB(v->string_id, 8, 8);
 		case 0x72: return v->cargo_subtype;
 		case 0x7A: return v->random_bits;
 		case 0x7B: return v->waiting_triggers;
@@ -788,7 +755,7 @@
 
 	totalsets = in_motion ? group->g.real.num_loaded : group->g.real.num_loading;
 
-	if (v->cargo.Count() == v->cargo_cap || totalsets == 1) {
+	if (v->cargo.Count() >= v->cargo_cap || totalsets == 1) {
 		set = totalsets - 1;
 	} else if (v->cargo.Empty() || totalsets == 2) {
 		set = 0;
@@ -888,7 +855,7 @@
 
 	object.info_view = info_view;
 
-	group = heli_rotor_custom_sprites[engine - AIRCRAFT_ENGINES_INDEX];
+	group = GetWagonOverrideSpriteSet(engine, CT_DEFAULT, engine);
 	group = Resolve(group, &object);
 
 	if (group == NULL || group->type != SGT_RESULT) return 0;
@@ -1056,27 +1023,6 @@
 	DoTriggerVehicle(v, trigger, 0, true);
 }
 
-StringID _engine_custom_names[TOTAL_NUM_ENGINES];
-
-void SetCustomEngineName(EngineID engine, StringID name)
-{
-	assert(engine < lengthof(_engine_custom_names));
-	_engine_custom_names[engine] = name;
-}
-
-void UnloadCustomEngineNames()
-{
-	EngineID i;
-	for (i = 0; i < TOTAL_NUM_ENGINES; i++) {
-		_engine_custom_names[i] = 0;
-	}
-}
-
-StringID GetCustomEngineName(EngineID engine)
-{
-	return _engine_custom_names[engine] == 0 ? _engine_name_strings[engine] : _engine_custom_names[engine];
-}
-
 /* Functions for changing the order of vehicle purchase lists
  * This is currently only implemented for rail vehicles. */
 static EngineID _engine_list_order[NUM_TRAIN_ENGINES];
--- a/src/newgrf_engine.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_engine.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,17 +6,16 @@
 #define NEWGRF_ENGINE_H
 
 #include "newgrf.h"
-#include "direction.h"
+#include "direction_type.h"
 #include "newgrf_cargo.h"
 
 extern int _traininfo_vehicle_pitch;
 extern int _traininfo_vehicle_width;
 
 
-void SetWagonOverrideSprites(EngineID engine, CargoID cargo, const struct SpriteGroup *group, byte *train_id, int trains);
-const SpriteGroup *GetWagonOverrideSpriteSet(EngineID engine, CargoID cargo, byte overriding_engine);
+void SetWagonOverrideSprites(EngineID engine, CargoID cargo, const struct SpriteGroup *group, EngineID *train_id, uint trains);
+const SpriteGroup *GetWagonOverrideSpriteSet(EngineID engine, CargoID cargo, EngineID overriding_engine);
 void SetCustomEngineSprites(EngineID engine, byte cargo, const struct SpriteGroup *group);
-void SetRotorOverrideSprites(EngineID engine, const struct SpriteGroup *group);
 SpriteID GetCustomEngineSprite(EngineID engine, const Vehicle* v, Direction direction);
 SpriteID GetRotorOverrideSprite(EngineID engine, const Vehicle* v, bool info_view);
 #define GetCustomRotorSprite(v, i) GetRotorOverrideSprite(v->engine_type, v, i)
@@ -54,13 +53,8 @@
 };
 void TriggerVehicle(Vehicle *veh, VehicleTrigger trigger);
 
-void SetCustomEngineName(EngineID engine, StringID name);
-StringID GetCustomEngineName(EngineID engine);
-
 void UnloadWagonOverrides();
-void UnloadRotorOverrideSprites();
 void UnloadCustomEngineSprites();
-void UnloadCustomEngineNames();
 
 void ResetEngineListOrder();
 EngineID GetRailVehAtPosition(EngineID pos);
--- a/src/newgrf_fsmports.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_fsmports.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -18,11 +18,11 @@
 #include "newgrf_commons.h"
 #include "newgrf_station.h"
 #include "newgrf_spritegroup.h"
-#include "date.h"
-#include "helpers.hpp"
 #include "cargotype.h"
 #include "town_map.h"
 #include "newgrf_town.h"
+#include "player_func.h"
+#include "gfx_func.h"
 
 static FSMportsClass fsmports_classes[FSMPORTS_CLASS_MAX];
 
--- a/src/newgrf_fsmports.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_fsmports.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,9 +5,13 @@
 #ifndef NEWGRF_FSMPORTS_H
 #define NEWGRF_FSMPORTS_H
 
+#include "core/enum_type.hpp"
+#include "tile_type.h"
+#include "map_type.h"
+#include "map_func.h"
+#include "tile_map.h"
 #include "engine.h"
 #include "newgrf_cargo.h"
-#include "helpers.hpp"
 #include "sprite.h"
 #include "airport.h"
 
--- a/src/newgrf_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,17 +4,20 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
 #include "variables.h"
-#include "gfx.h"
 #include "gui.h"
-#include "window.h"
+#include "window_gui.h"
+#include "textbuf_gui.h"
+#include "newgrf.h"
+#include "newgrf_config.h"
+#include "strings_func.h"
+#include "window_func.h"
+#include "core/alloc_func.hpp"
+#include "string_func.h"
+#include "gfx_func.h"
+
 #include "table/strings.h"
 #include "table/sprites.h"
-#include "newgrf.h"
-#include "newgrf_config.h"
-#include "strings.h"
-#include "helpers.hpp"
 
 /** Parse an integerlist string and set each found value
  * @param p the string to be parsed. Each element in the list is seperated by a
@@ -112,31 +115,41 @@
 	const GRFConfig *sel;
 };
 
+/* Names of the add a newgrf window widgets */
+enum AddNewGRFWindowWidgets {
+	ANGRFW_CLOSEBOX = 0,
+	ANGRFW_CAPTION,
+	ANGRFW_BACKGROUND,
+	ANGRFW_GRF_LIST,
+	ANGRFW_SCROLLBAR,
+	ANGRFW_GRF_INFO,
+	ANGRFW_ADD,
+	ANGRFW_RESCAN,
+	ANGRFW_RESIZE,
+};
 
 static void NewGRFAddDlgWndProc(Window *w, WindowEvent *e)
 {
 	switch (e->event) {
 		case WE_PAINT: {
 			const GRFConfig *c;
-			int y;
+			const Widget *wl = &w->widget[ANGRFW_GRF_LIST];
 			int n = 0;
 
 			/* Count the number of GRFs */
 			for (c = _all_grfs; c != NULL; c = c->next) n++;
 
-			w->vscroll.cap = (w->widget[3].bottom - w->widget[3].top) / 10;
+			w->vscroll.cap = (wl->bottom - wl->top) / 10;
 			SetVScrollCount(w, n);
 
-			w->SetWidgetDisabledState(6, WP(w, newgrf_add_d).sel == NULL || WP(w, newgrf_add_d).sel->IsOpenTTDBaseGRF());
+			w->SetWidgetDisabledState(ANGRFW_ADD, WP(w, newgrf_add_d).sel == NULL || WP(w, newgrf_add_d).sel->IsOpenTTDBaseGRF());
 			DrawWindowWidgets(w);
 
-			GfxFillRect(w->widget[3].left + 1, w->widget[3].top + 1, w->widget[3].right, w->widget[3].bottom, 0xD7);
+			GfxFillRect(wl->left + 1, wl->top + 1, wl->right, wl->bottom, 0xD7);
 
-			n = 0;
-			y = w->widget[3].top + 1;
-
-			for (c = _all_grfs; c != NULL; c = c->next) {
-				if (n >= w->vscroll.pos && n < w->vscroll.pos + w->vscroll.cap) {
+			uint y = wl->top + 1;
+			for (c = _all_grfs, n = 0; c != NULL && n < (w->vscroll.pos + w->vscroll.cap); c = c->next, n++) {
+				if (n >= w->vscroll.pos) {
 					bool h = c == WP(w, newgrf_add_d).sel;
 					const char *text = (c->name != NULL && !StrEmpty(c->name)) ? c->name : c->filename;
 
@@ -145,27 +158,26 @@
 					DoDrawStringTruncated(text, 4, y, h ? TC_WHITE : TC_ORANGE, w->width - 18);
 					y += 10;
 				}
-				n++;
 			}
 
 			if (WP(w, newgrf_add_d).sel != NULL) {
-				const Widget *wi = &w->widget[5];
+				const Widget *wi = &w->widget[ANGRFW_GRF_INFO];
 				ShowNewGRFInfo(WP(w, newgrf_add_d).sel, wi->left + 2, wi->top + 2, wi->right - wi->left - 2, wi->bottom, false);
 			}
 			break;
 		}
 
 		case WE_DOUBLE_CLICK:
-			if (e->we.click.widget != 3) break;
-			e->we.click.widget = 6;
+			if (e->we.click.widget != ANGRFW_GRF_LIST) break;
+			e->we.click.widget = ANGRFW_ADD;
 			/* Fall through */
 
 		case WE_CLICK:
 			switch (e->we.click.widget) {
-				case 3: {
+				case ANGRFW_GRF_LIST: {
 					/* Get row... */
 					const GRFConfig *c;
-					uint i = (e->we.click.pt.y - w->widget[3].top) / 10 + w->vscroll.pos;
+					uint i = (e->we.click.pt.y - w->widget[ANGRFW_GRF_LIST].top) / 10 + w->vscroll.pos;
 
 					for (c = _all_grfs; c != NULL && i > 0; c = c->next, i--);
 					WP(w, newgrf_add_d).sel = c;
@@ -173,7 +185,7 @@
 					break;
 				}
 
-				case 6: // Add selection to list
+				case ANGRFW_ADD: // Add selection to list
 					if (WP(w, newgrf_add_d).sel != NULL) {
 						const GRFConfig *src = WP(w, newgrf_add_d).sel;
 						GRFConfig **list;
@@ -202,7 +214,7 @@
 					}
 					break;
 
-				case 7: // Rescan list
+				case ANGRFW_RESCAN: // Rescan list
 					WP(w, newgrf_add_d).sel = NULL;
 					ScanNewGRFFiles();
 					SetWindowDirty(w);
@@ -212,26 +224,21 @@
 	}
 }
 
-
+/* Widget definition for the add a newgrf window */
 static const Widget _newgrf_add_dlg_widgets[] = {
-{   WWT_CLOSEBOX,    RESIZE_NONE, 14,   0,  10,   0,  13, STR_00C5,                STR_018B_CLOSE_WINDOW },
-{    WWT_CAPTION,   RESIZE_RIGHT, 14,  11, 306,   0,  13, STR_NEWGRF_ADD_CAPTION,  STR_018C_WINDOW_TITLE_DRAG_THIS },
-
-/* List of files */
-{      WWT_PANEL,      RESIZE_RB, 14,   0, 294,  14, 121, 0x0,                     STR_NULL },
-{      WWT_INSET,      RESIZE_RB, 14,   2, 292,  16, 119, 0x0,                     STR_NULL },
-{  WWT_SCROLLBAR,     RESIZE_LRB, 14, 295, 306,  14, 121, 0x0,                     STR_NULL },
-
-/* NewGRF file info */
-{      WWT_PANEL,     RESIZE_RTB, 14,   0, 306, 122, 224, 0x0,                     STR_NULL },
-
-{ WWT_PUSHTXTBTN,     RESIZE_RTB, 14,   0, 146, 225, 236, STR_NEWGRF_ADD_FILE,     STR_NEWGRF_ADD_FILE_TIP },
-{ WWT_PUSHTXTBTN,    RESIZE_LRTB, 14, 147, 294, 225, 236, STR_NEWGRF_RESCAN_FILES, STR_NEWGRF_RESCAN_FILES_TIP },
-{  WWT_RESIZEBOX,    RESIZE_LRTB, 14, 295, 306, 225, 236, 0x0,                     STR_RESIZE_BUTTON },
+{   WWT_CLOSEBOX,    RESIZE_NONE, 14,   0,  10,   0,  13, STR_00C5,                STR_018B_CLOSE_WINDOW },           // ANGRFW_CLOSEBOX
+{    WWT_CAPTION,   RESIZE_RIGHT, 14,  11, 306,   0,  13, STR_NEWGRF_ADD_CAPTION,  STR_018C_WINDOW_TITLE_DRAG_THIS }, // ANGRFW_CAPTION
+{      WWT_PANEL,      RESIZE_RB, 14,   0, 294,  14, 121, 0x0,                     STR_NULL },                        // ANGRFW_BACKGROUND
+{      WWT_INSET,      RESIZE_RB, 14,   2, 292,  16, 119, 0x0,                     STR_NULL },                        // ANGRFW_GRF_LIST
+{  WWT_SCROLLBAR,     RESIZE_LRB, 14, 295, 306,  14, 121, 0x0,                     STR_NULL },                        // ANGRFW_SCROLLBAR
+{      WWT_PANEL,     RESIZE_RTB, 14,   0, 306, 122, 224, 0x0,                     STR_NULL },                        // ANGRFW_GRF_INFO
+{ WWT_PUSHTXTBTN,     RESIZE_RTB, 14,   0, 146, 225, 236, STR_NEWGRF_ADD_FILE,     STR_NEWGRF_ADD_FILE_TIP },         // ANGRFW_ADD
+{ WWT_PUSHTXTBTN,    RESIZE_LRTB, 14, 147, 294, 225, 236, STR_NEWGRF_RESCAN_FILES, STR_NEWGRF_RESCAN_FILES_TIP },     // ANGRFW_RESCAN
+{  WWT_RESIZEBOX,    RESIZE_LRTB, 14, 295, 306, 225, 236, 0x0,                     STR_RESIZE_BUTTON },               // ANGRFW_RESIZE
 {   WIDGETS_END },
 };
 
-
+/* Window definition for the add a newgrf window */
 static const WindowDesc _newgrf_add_dlg_desc = {
 	WDP_CENTER, WDP_CENTER, 307, 237, 307, 337,
 	WC_SAVELOAD, WC_NONE,
@@ -253,18 +260,23 @@
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(newgrf_d));
 
 
+/* Names of the manage newgrfs window widgets */
 enum ShowNewGRFStateWidgets {
-	SNGRFS_ADD = 3,
+	SNGRFS_CLOSEBOX = 0,
+	SNGRFS_CAPTION,
+	SNGRFS_BACKGROUND,
+	SNGRFS_ADD,
 	SNGRFS_REMOVE,
 	SNGRFS_MOVE_UP,
 	SNGRFS_MOVE_DOWN,
-	SNGRFS_FILE_LIST = 7,
-	SNGRFS_NEWGRF_INFO = 9,
+	SNGRFS_FILE_LIST,
+	SNGRFS_SCROLLBAR,
+	SNGRFS_NEWGRF_INFO,
 	SNGRFS_SET_PARAMETERS,
 	SNGRFS_APPLY_CHANGES,
+	SNGRFS_RESIZE,
 };
 
-
 static void SetupNewGRFState(Window *w)
 {
 	bool disable_all = WP(w, newgrf_d).sel == NULL || !WP(w, newgrf_d).editable;
@@ -525,35 +537,25 @@
 	}
 }
 
-
+/* Widget definition of the manage newgrfs window */
 static const Widget _newgrf_widgets[] = {
-{   WWT_CLOSEBOX,  RESIZE_NONE, 10,   0,  10,   0,  13, STR_00C5,                    STR_018B_CLOSE_WINDOW },
-{    WWT_CAPTION, RESIZE_RIGHT, 10,  11, 299,   0,  13, STR_NEWGRF_SETTINGS_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS },
-
-/* NewGRF file Add, Remove, Move up, Move down */
-{      WWT_PANEL, RESIZE_RIGHT, 10,   0, 299,  14,  29, STR_NULL,                    STR_NULL },
-{ WWT_PUSHTXTBTN,  RESIZE_NONE,  3,  10,  79,  16,  27, STR_NEWGRF_ADD,              STR_NEWGRF_ADD_TIP },
-{ WWT_PUSHTXTBTN,  RESIZE_NONE,  3,  80, 149,  16,  27, STR_NEWGRF_REMOVE,           STR_NEWGRF_REMOVE_TIP },
-{ WWT_PUSHTXTBTN,  RESIZE_NONE,  3, 150, 219,  16,  27, STR_NEWGRF_MOVEUP,           STR_NEWGRF_MOVEUP_TIP },
-{ WWT_PUSHTXTBTN,  RESIZE_NONE,  3, 220, 289,  16,  27, STR_NEWGRF_MOVEDOWN,         STR_NEWGRF_MOVEDOWN_TIP },
-
-/* NewGRF file list */
-{     WWT_MATRIX,    RESIZE_RB, 10,   0, 287,  30,  99, 0x501,                       STR_NEWGRF_FILE_TIP },
-{  WWT_SCROLLBAR,   RESIZE_LRB, 10, 288, 299,  30,  99, 0x0,                         STR_0190_SCROLL_BAR_SCROLLS_LIST },
-
-/* NewGRF file info */
-{      WWT_PANEL,   RESIZE_RTB, 10,   0, 299, 100, 212, STR_NULL,                    STR_NULL },
-
-/* Edit parameter and apply changes button... */
-{ WWT_PUSHTXTBTN,    RESIZE_TB, 10,   0, 143, 213, 224, STR_NEWGRF_SET_PARAMETERS,   STR_NULL },
-{ WWT_PUSHTXTBTN,   RESIZE_RTB, 10, 144, 287, 213, 224, STR_NEWGRF_APPLY_CHANGES,    STR_NULL },
-
-{  WWT_RESIZEBOX,  RESIZE_LRTB, 10, 288, 299, 213, 224, 0x0,                         STR_RESIZE_BUTTON },
-
+{   WWT_CLOSEBOX,  RESIZE_NONE, 10,   0,  10,   0,  13, STR_00C5,                    STR_018B_CLOSE_WINDOW },            // SNGRFS_CLOSEBOX
+{    WWT_CAPTION, RESIZE_RIGHT, 10,  11, 299,   0,  13, STR_NEWGRF_SETTINGS_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS },  // SNGRFS_CAPTION
+{      WWT_PANEL, RESIZE_RIGHT, 10,   0, 299,  14,  29, STR_NULL,                    STR_NULL },                         // SNGRFS_BACKGROUND
+{ WWT_PUSHTXTBTN,  RESIZE_NONE,  3,  10,  79,  16,  27, STR_NEWGRF_ADD,              STR_NEWGRF_ADD_TIP },               // SNGRFS_ADD
+{ WWT_PUSHTXTBTN,  RESIZE_NONE,  3,  80, 149,  16,  27, STR_NEWGRF_REMOVE,           STR_NEWGRF_REMOVE_TIP },            // SNGRFS_REMOVE
+{ WWT_PUSHTXTBTN,  RESIZE_NONE,  3, 150, 219,  16,  27, STR_NEWGRF_MOVEUP,           STR_NEWGRF_MOVEUP_TIP },            // SNGRFS_MOVE_UP
+{ WWT_PUSHTXTBTN,  RESIZE_NONE,  3, 220, 289,  16,  27, STR_NEWGRF_MOVEDOWN,         STR_NEWGRF_MOVEDOWN_TIP },          // SNGRFS_MOVE_DOWN
+{     WWT_MATRIX,    RESIZE_RB, 10,   0, 287,  30,  99, 0x501,                       STR_NEWGRF_FILE_TIP },              // SNGRFS_FILE_LIST
+{  WWT_SCROLLBAR,   RESIZE_LRB, 10, 288, 299,  30,  99, 0x0,                         STR_0190_SCROLL_BAR_SCROLLS_LIST }, // SNGRFS_SCROLLBAR
+{      WWT_PANEL,   RESIZE_RTB, 10,   0, 299, 100, 212, STR_NULL,                    STR_NULL },                         // SNGRFS_NEWGRF_INFO
+{ WWT_PUSHTXTBTN,    RESIZE_TB, 10,   0, 143, 213, 224, STR_NEWGRF_SET_PARAMETERS,   STR_NULL },                         // SNGRFS_SET_PARAMETERS
+{ WWT_PUSHTXTBTN,   RESIZE_RTB, 10, 144, 287, 213, 224, STR_NEWGRF_APPLY_CHANGES,    STR_NULL },                         // SNGRFS_APPLY_CHANGES
+{  WWT_RESIZEBOX,  RESIZE_LRTB, 10, 288, 299, 213, 224, 0x0,                         STR_RESIZE_BUTTON },                // SNGRFS_RESIZE
 { WIDGETS_END },
 };
 
-
+/* Window definition of the manage newgrfs window */
 static const WindowDesc _newgrf_desc = {
 	WDP_CENTER, WDP_CENTER, 300, 225, 300, 225,
 	WC_GAME_OPTIONS, WC_NONE,
--- a/src/newgrf_house.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_house.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,20 +4,13 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
 #include "variables.h"
 #include "debug.h"
-#include "viewport.h"
+#include "viewport_func.h"
 #include "landscape.h"
-#include "date.h"
 #include "town.h"
 #include "town_map.h"
-#include "sound.h"
 #include "sprite.h"
-#include "strings.h"
-#include "table/strings.h"
-#include "table/sprites.h"
-#include "table/town_land.h"
 #include "newgrf.h"
 #include "newgrf_house.h"
 #include "newgrf_spritegroup.h"
@@ -26,6 +19,12 @@
 #include "newgrf_sound.h"
 #include "newgrf_commons.h"
 #include "transparency.h"
+#include "functions.h"
+#include "player_func.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
+#include "table/town_land.h"
 
 static BuildingCounts    _building_counts;
 static HouseClassMapping _class_mapping[HOUSE_CLASS_MAX];
@@ -34,8 +33,12 @@
 
 void CheckHouseIDs()
 {
+	Town *town;
 	InitializeBuildingCounts();
 
+	/* Reset town population */
+	FOR_ALL_TOWNS(town) town->population = 0;
+
 	for (TileIndex t = 0; t < MapSize(); t++) {
 		HouseID house_id;
 
@@ -48,7 +51,9 @@
 			house_id = _house_mngr.GetSubstituteID(house_id);
 			SetHouseType(t, house_id);
 		}
-		IncreaseBuildingCount(GetTownByTile(t), house_id);
+		town = GetTownByTile(t);
+		IncreaseBuildingCount(town, house_id);
+		if (IsHouseCompleted(t)) town->population += GetHouseSpecs(house_id)->population;
 	}
 }
 
@@ -123,22 +128,6 @@
 	if (_building_counts.class_count[class_id] > 0)   _building_counts.class_count[class_id]--;
 }
 
-/**
- * AfterLoadCountBuildings()
- *
- * After a savegame has been loaded, count the number of buildings on the map.
- */
-void AfterLoadCountBuildings()
-{
-	if (!_loaded_newgrf_features.has_newhouses) return;
-
-	for (TileIndex t = 0; t < MapSize(); t++) {
-		if (!IsTileType(t, MP_HOUSE)) continue;
-		IncreaseBuildingCount(GetTownByTile(t), GetHouseType(t));
-	}
-}
-
-
 static uint32 HouseGetRandomBits(const ResolverObject *object)
 {
 	const TileIndex tile = object->u.house.tile;
--- a/src/newgrf_house.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_house.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,7 +5,7 @@
 #ifndef NEWGRF_HOUSE_H
 #define NEWGRF_HOUSE_H
 
-#include "town.h"
+#include "town_type.h"
 #include "newgrf_callbacks.h"
 
 /**
@@ -33,7 +33,6 @@
 void InitializeBuildingCounts();
 void IncreaseBuildingCount(Town *t, HouseID house_id);
 void DecreaseBuildingCount(Town *t, HouseID house_id);
-void AfterLoadCountBuildings();
 
 void DrawNewHouseTile(TileInfo *ti, HouseID house_id);
 void AnimateNewHouseTile(TileIndex tile);
--- a/src/newgrf_industries.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_industries.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,11 +5,8 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "macros.h"
 #include "variables.h"
 #include "landscape.h"
-#include "table/strings.h"
 #include "industry.h"
 #include "industry_map.h"
 #include "newgrf.h"
@@ -20,7 +17,13 @@
 #include "newgrf_commons.h"
 #include "newgrf_text.h"
 #include "newgrf_town.h"
-#include "date.h"
+#include "window_func.h"
+#include "town.h"
+#include "player_func.h"
+#include "player_base.h"
+#include "command_func.h"
+
+#include "table/strings.h"
 
 /* Since the industry IDs defined by the GRF file don't necessarily correlate
  * to those used by the game, the IDs used for overriding old industries must be
@@ -36,6 +39,15 @@
 	return _industry_mngr.GetID(GB(grf_type, 0, 6), grf_id);
 }
 
+static uint32 GetGRFParameter(IndustryType ind_id, byte parameter)
+{
+	const IndustrySpec *indspec = GetIndustrySpec(ind_id);
+	const GRFFile *file = indspec->grf_prop.grffile;
+
+	if (parameter >= file->param_end) return 0;
+	return file->param[parameter];
+}
+
 /**
  * Finds the distance for the closest tile with water/land given a tile
  * @param tile  the tile to find the distance too
@@ -193,7 +205,23 @@
 {
 	const Industry *industry = object->u.industry.ind;
 	TileIndex tile = object->u.industry.tile;
-	const IndustrySpec *indspec = GetIndustrySpec(industry->type);
+	IndustryType type = object->u.industry.type;
+	const IndustrySpec *indspec = GetIndustrySpec(type);
+
+	if (industry == NULL) {
+		/* industry does not exist, only use those variables that are "safe" */
+		switch (variable) {
+			/* Read GRF parameter */
+			case 0x7F: return GetGRFParameter(type, parameter);
+			/* Manhattan distance of closes dry/water tile */
+			case 0x43: return GetClosestWaterDistance(tile, (indspec->behaviour & INDUSTRYBEH_BUILT_ONWATER) == 0);
+		}
+
+		DEBUG(grf, 1, "Unhandled property 0x%X (no available industry) in callback 0x%x", variable, object->callback);
+
+		*available = false;
+		return UINT_MAX;
+	}
 
 	switch (variable) {
 		case 0x40:
@@ -269,6 +297,9 @@
 		/* Get a variable from the persistent storage */
 		case 0x7C: return industry->psa.Get(parameter);
 
+		/* Read GRF parameter */
+		case 0x7F: return GetGRFParameter(type, parameter);
+
 		/* Industry structure access*/
 		case 0x80: return industry->xy;
 		case 0x81: return GB(industry->xy, 8, 8);
@@ -319,7 +350,7 @@
 		case 0xA6: return industry->type;
 		case 0xA7: return industry->founder;
 		case 0xA8: return industry->random_color;
-		case 0xA9: return Clamp(0, industry->last_prod_year - 1920, 255);
+		case 0xA9: return Clamp(0, industry->last_prod_year - ORIGINAL_BASE_YEAR, 255);
 		case 0xAA: return industry->counter;
 		case 0xAB: return GB(industry->counter, 8, 8);
 		case 0xAC: return industry->was_cargo_delivered;
@@ -357,7 +388,7 @@
 	object->u.industry.ind->random_triggers = triggers;
 }
 
-static void NewIndustryResolver(ResolverObject *res, TileIndex tile, Industry *indus)
+static void NewIndustryResolver(ResolverObject *res, TileIndex tile, Industry *indus, IndustryType type)
 {
 	res->GetRandomBits = IndustryGetRandomBits;
 	res->GetTriggers   = IndustryGetTriggers;
@@ -369,6 +400,7 @@
 	res->u.industry.tile = tile;
 	res->u.industry.ind  = indus;
 	res->u.industry.gfx  = INVALID_INDUSTRYTILE;
+	res->u.industry.type = type;
 
 	res->callback        = CBID_NO_CALLBACK;
 	res->callback_param1 = 0;
@@ -383,7 +415,7 @@
 	ResolverObject object;
 	const SpriteGroup *group;
 
-	NewIndustryResolver(&object, tile, industry);
+	NewIndustryResolver(&object, tile, industry, type);
 	object.callback = callback;
 	object.callback_param1 = param1;
 	object.callback_param2 = param2;
@@ -454,7 +486,7 @@
 	ind.selected_layout = itspec_index;
 	ind.town = ClosestTownFromTile(tile, (uint)-1);
 
-	NewIndustryResolver(&object, tile, &ind);
+	NewIndustryResolver(&object, tile, &ind, type);
 	object.GetVariable = IndustryLocationGetVariable;
 	object.callback = CBID_INDUSTRY_LOCATION;
 
@@ -507,7 +539,7 @@
 {
 	const IndustrySpec *spec = GetIndustrySpec(ind->type);
 	ResolverObject object;
-	NewIndustryResolver(&object, ind->xy, ind);
+	NewIndustryResolver(&object, ind->xy, ind, ind->type);
 	if ((spec->behaviour & INDUSTRYBEH_PRODCALLBACK_RANDOM) != 0) object.callback_param1 = Random();
 	int multiplier = 1;
 	if ((spec->behaviour & INDUSTRYBEH_PROD_MULTI_HNDLING) != 0) multiplier = ind->prod_level;
@@ -535,19 +567,3 @@
 
 	InvalidateWindow(WC_INDUSTRY_VIEW, ind->index);
 }
-
-void DoTriggerIndustry(Industry *ind, IndustryTileTrigger trigger)
-{
-	ResolverObject object;
-
-	NewIndustryResolver(&object, ind->xy, ind);
-	object.callback = CBID_RANDOM_TRIGGER;
-	object.trigger = trigger;
-
-	const SpriteGroup *group = Resolve(GetIndustrySpec(ind->type)->grf_prop.spritegroup, &object);
-	if (group == NULL) return;
-
-	byte new_random_bits = Random();
-	ind->random &= ~object.reseed;
-	ind->random |= new_random_bits & object.reseed;
-}
--- a/src/newgrf_industries.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_industries.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,7 +5,7 @@
 #ifndef NEWGRF_INDUSTRIES_H
 #define NEWGRF_INDUSTRIES_H
 
-#include "industry.h"
+#include "industry_type.h"
 #include "newgrf_spritegroup.h"
 
 /** When should the industry(tile) be triggered for random bits? */
@@ -18,6 +18,13 @@
 	INDUSTRY_TRIGGER_CARGO_DELIVERY   = 4,
 };
 
+/** From where is callback CBID_INDUSTRY_AVAILABLE been called */
+enum IndustryAvailabilityCallType {
+	IACT_MAPGENERATION,   ///< during random map generation
+	IACT_RANDOMCREATION,  ///< during creation of random ingame industry
+	IACT_USERCREATION,    ///< from the Fund/build window
+};
+
 /* in newgrf_industry.cpp */
 uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available);
 uint16 GetIndustryCallback(CallbackID callback, uint32 param1, uint32 param2, Industry *industry, IndustryType type, TileIndex tile);
--- a/src/newgrf_industrytiles.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_industrytiles.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,10 +4,9 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
 #include "variables.h"
 #include "debug.h"
-#include "viewport.h"
+#include "viewport_func.h"
 #include "landscape.h"
 #include "newgrf.h"
 #include "industry.h"
@@ -19,10 +18,23 @@
 #include "newgrf_text.h"
 #include "industry_map.h"
 #include "clear_map.h"
+#include "sprite.h"
+#include "transparency.h"
+#include "functions.h"
+#include "town.h"
+#include "command_func.h"
+
 #include "table/sprites.h"
 #include "table/strings.h"
-#include "sprite.h"
-#include "transparency.h"
+
+static uint32 GetGRFParameter(IndustryGfx indtile_id, byte parameter)
+{
+	const IndustryTileSpec *indtspec = GetIndustryTileSpec(indtile_id);
+	const GRFFile *file = indtspec->grf_prop.grffile;
+
+	if (parameter >= file->param_end) return 0;
+	return file->param[parameter];
+}
 
 /**
  * Based on newhouses equivalent, but adapted for newindustries
@@ -101,6 +113,9 @@
 
 		/* Get industry tile ID at offset */
 		case 0x62 : return GetIndustryIDAtOffset(GetNearbyTile(parameter, tile), inds);
+
+		/* Read GRF parameter */
+		case 0x7F: return GetGRFParameter(GetIndustryGfx(tile), parameter);
 	}
 
 	DEBUG(grf, 1, "Unhandled industry tile property 0x%X", variable);
@@ -153,6 +168,7 @@
 	res->u.industry.tile = tile;
 	res->u.industry.ind  = indus;
 	res->u.industry.gfx  = gfx;
+	res->u.industry.type = indus->type;
 
 	res->callback        = CBID_NO_CALLBACK;
 	res->callback_param1 = 0;
@@ -413,8 +429,6 @@
 	DoTriggerIndustryTile(tile, trigger, GetIndustryByTile(tile));
 }
 
-extern void DoTriggerIndustry(Industry *ind, IndustryTileTrigger trigger);
-
 void TriggerIndustry(Industry *ind, IndustryTileTrigger trigger)
 {
 	BEGIN_TILE_LOOP(tile, ind->width, ind->height, ind->xy)
@@ -422,6 +436,4 @@
 			DoTriggerIndustryTile(tile, trigger, ind);
 		}
 	END_TILE_LOOP(tile, ind->width, ind->height, ind->xy)
-
-	DoTriggerIndustry(ind, trigger);
 }
--- a/src/newgrf_sound.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_sound.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,12 +5,12 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "oldpool.h"
-#include "sound.h"
 #include "engine.h"
-#include "vehicle.h"
 #include "newgrf_callbacks.h"
 #include "newgrf_engine.h"
 #include "newgrf_sound.h"
+#include "vehicle_base.h"
+#include "sound_func.h"
 
 static uint _sound_count = 0;
 STATIC_OLD_POOL(SoundInternal, FileEntry, 3, 1000, NULL, NULL)
--- a/src/newgrf_sound.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_sound.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,8 @@
 #ifndef NEWGRF_SOUND_H
 #define NEWGRF_SOUND_H
 
+#include "sound_type.h"
+
 enum VehicleSoundEvent {
 	VSE_START        = 1,
 	VSE_TUNNEL       = 2,
--- a/src/newgrf_spritegroup.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_spritegroup.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,13 +5,13 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "variables.h"
-#include "macros.h"
 #include "landscape.h"
 #include "oldpool.h"
 #include "newgrf_callbacks.h"
 #include "newgrf_spritegroup.h"
-#include "date.h"
 #include "sprite.h"
+#include "date_func.h"
+#include "settings_type.h"
 
 static void SpriteGroupPoolCleanBlock(uint start_item, uint end_item);
 
--- a/src/newgrf_spritegroup.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_spritegroup.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,9 +5,11 @@
 #ifndef NEWGRF_SPRITEGROUP_H
 #define NEWGRF_SPRITEGROUP_H
 
-#include "town.h"
-#include "industry.h"
+#include "town_type.h"
+#include "industry_type.h"
 #include "newgrf_storage.h"
+#include "core/bitmath_func.hpp"
+#include "gfx_type.h"
 
 /**
  * Gets the value of a so-called newgrf "register".
@@ -230,6 +232,7 @@
 			TileIndex tile;
 			Industry *ind;
 			IndustryGfx gfx;
+			IndustryType type;
 		} industry;
 		struct {
 			const struct CargoSpec *cs;
--- a/src/newgrf_station.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_station.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,12 +5,10 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "variables.h"
-#include "functions.h"
+#include "tile_cmd.h"
 #include "landscape.h"
 #include "debug.h"
 #include "sprite.h"
-#include "table/sprites.h"
-#include "table/strings.h"
 #include "station.h"
 #include "station_map.h"
 #include "newgrf.h"
@@ -18,13 +16,17 @@
 #include "newgrf_commons.h"
 #include "newgrf_station.h"
 #include "newgrf_spritegroup.h"
-#include "date.h"
-#include "helpers.hpp"
 #include "cargotype.h"
 #include "town_map.h"
 #include "newgrf_town.h"
+#include "gfx_func.h"
+#include "date_func.h"
+#include "player_func.h"
 
-static StationClass station_classes[STAT_CLASS_MAX];
+#include "table/sprites.h"
+#include "table/strings.h"
+
+static StationClass _station_classes[STAT_CLASS_MAX];
 
 enum {
 	MAX_SPECLIST = 255,
@@ -38,42 +40,42 @@
 void ResetStationClasses()
 {
 	for (StationClassID i = STAT_CLASS_BEGIN; i < STAT_CLASS_MAX; i++) {
-		station_classes[i].id = 0;
-		station_classes[i].name = STR_EMPTY;
-		station_classes[i].stations = 0;
+		_station_classes[i].id = 0;
+		_station_classes[i].name = STR_EMPTY;
+		_station_classes[i].stations = 0;
 
-		free(station_classes[i].spec);
-		station_classes[i].spec = NULL;
+		free(_station_classes[i].spec);
+		_station_classes[i].spec = NULL;
 	}
 
 	/* Set up initial data */
-	station_classes[0].id = 'DFLT';
-	station_classes[0].name = STR_STAT_CLASS_DFLT;
-	station_classes[0].stations = 1;
-	station_classes[0].spec = MallocT<StationSpec*>(1);
-	station_classes[0].spec[0] = NULL;
+	_station_classes[0].id = 'DFLT';
+	_station_classes[0].name = STR_STAT_CLASS_DFLT;
+	_station_classes[0].stations = 1;
+	_station_classes[0].spec = MallocT<StationSpec*>(1);
+	_station_classes[0].spec[0] = NULL;
 
-	station_classes[1].id = 'WAYP';
-	station_classes[1].name = STR_STAT_CLASS_WAYP;
-	station_classes[1].stations = 1;
-	station_classes[1].spec = MallocT<StationSpec*>(1);
-	station_classes[1].spec[0] = NULL;
+	_station_classes[1].id = 'WAYP';
+	_station_classes[1].name = STR_STAT_CLASS_WAYP;
+	_station_classes[1].stations = 1;
+	_station_classes[1].spec = MallocT<StationSpec*>(1);
+	_station_classes[1].spec[0] = NULL;
 }
 
 /**
  * Allocate a station class for the given class id.
  * @param cls A 32 bit value identifying the class.
- * @return Index into station_classes of allocated class.
+ * @return Index into _station_classes of allocated class.
  */
 StationClassID AllocateStationClass(uint32 cls)
 {
 	for (StationClassID i = STAT_CLASS_BEGIN; i < STAT_CLASS_MAX; i++) {
-		if (station_classes[i].id == cls) {
+		if (_station_classes[i].id == cls) {
 			/* ClassID is already allocated, so reuse it. */
 			return i;
-		} else if (station_classes[i].id == 0) {
+		} else if (_station_classes[i].id == 0) {
 			/* This class is empty, so allocate it to the ClassID. */
-			station_classes[i].id = cls;
+			_station_classes[i].id = cls;
 			return i;
 		}
 	}
@@ -86,33 +88,14 @@
 void SetStationClassName(StationClassID sclass, StringID name)
 {
 	assert(sclass < STAT_CLASS_MAX);
-	station_classes[sclass].name = name;
+	_station_classes[sclass].name = name;
 }
 
 /** Retrieve the name of a custom station class */
 StringID GetStationClassName(StationClassID sclass)
 {
 	assert(sclass < STAT_CLASS_MAX);
-	return station_classes[sclass].name;
-}
-
-/** Build a list of station class name StringIDs to use in a dropdown list
- * @return Pointer to a (static) array of StringIDs
- */
-StringID *BuildStationClassDropdown()
-{
-	/* Allow room for all station classes, plus a terminator entry */
-	static StringID names[STAT_CLASS_MAX + 1];
-	uint i;
-
-	/* Add each name */
-	for (i = 0; i < STAT_CLASS_MAX && station_classes[i].id != 0; i++) {
-		names[i] = station_classes[i].name;
-	}
-	/* Terminate the list */
-	names[i] = INVALID_STRING_ID;
-
-	return names;
+	return _station_classes[sclass].name;
 }
 
 /**
@@ -122,7 +105,7 @@
 uint GetNumStationClasses()
 {
 	uint i;
-	for (i = 0; i < STAT_CLASS_MAX && station_classes[i].id != 0; i++);
+	for (i = 0; i < STAT_CLASS_MAX && _station_classes[i].id != 0; i++);
 	return i;
 }
 
@@ -134,7 +117,7 @@
 uint GetNumCustomStations(StationClassID sclass)
 {
 	assert(sclass < STAT_CLASS_MAX);
-	return station_classes[sclass].stations;
+	return _station_classes[sclass].stations;
 }
 
 /**
@@ -150,7 +133,7 @@
 	if (statspec->allocated) return;
 
 	assert(statspec->sclass < STAT_CLASS_MAX);
-	station_class = &station_classes[statspec->sclass];
+	station_class = &_station_classes[statspec->sclass];
 
 	i = station_class->stations++;
 	station_class->spec = ReallocT(station_class->spec, station_class->stations);
@@ -168,8 +151,8 @@
 const StationSpec *GetCustomStationSpec(StationClassID sclass, uint station)
 {
 	assert(sclass < STAT_CLASS_MAX);
-	if (station < station_classes[sclass].stations)
-		return station_classes[sclass].spec[station];
+	if (station < _station_classes[sclass].stations)
+		return _station_classes[sclass].spec[station];
 
 	/* If the custom station isn't defined any more, then the GRF file
 	 * probably was not loaded. */
@@ -182,8 +165,8 @@
 	uint j;
 
 	for (StationClassID i = STAT_CLASS_BEGIN; i < STAT_CLASS_MAX; i++) {
-		for (j = 0; j < station_classes[i].stations; j++) {
-			const StationSpec *statspec = station_classes[i].spec[j];
+		for (j = 0; j < _station_classes[i].stations; j++) {
+			const StationSpec *statspec = _station_classes[i].spec[j];
 			if (statspec == NULL) continue;
 			if (statspec->grffile->grfid == grfid && statspec->localidx == localidx) return statspec;
 		}
@@ -439,6 +422,34 @@
 
 		/* Variables which use the parameter */
 		/* Variables 0x60 to 0x65 are handled separately below */
+		case 0x67: { // Land info of nearby tiles
+			Axis axis = GetRailStationAxis(tile);
+
+			if (parameter != 0) tile = GetNearbyTile(parameter, tile); // only perform if it is required
+			byte tile_type = GetTerrainType(tile) << 2 | (IsTileType(tile, MP_WATER) ? 1 : 0) << 1;
+
+			uint z;
+			Slope tileh = GetTileSlope(tile, &z);
+			bool swap = (axis == AXIS_Y && HasBit(tileh, 0) != HasBit(tileh, 2));
+			return GetTileType(tile) << 24 | z << 16 | tile_type << 8 | (tileh ^ (swap ? 5 : 0));
+		}
+
+		case 0x68: { // Station info of nearby tiles
+			TileIndex nearby_tile = GetNearbyTile(parameter, tile);
+
+			if (!IsRailwayStationTile(nearby_tile)) return 0xFFFFFFFF;
+
+			uint32 grfid = st->speclist[GetCustomStationSpecIndex(tile)].grfid;
+			bool perpendicular = GetRailStationAxis(tile) != GetRailStationAxis(nearby_tile);
+			bool same_station = st->TileBelongsToRailStation(nearby_tile);
+			uint32 res = GB(GetStationGfx(nearby_tile), 1, 2) << 12 | !!perpendicular << 11 | !!same_station << 10;
+
+			if (IsCustomStationSpecIndex(nearby_tile)) {
+				const StationSpecList ssl = GetStationByTile(nearby_tile)->speclist[GetCustomStationSpecIndex(nearby_tile)];
+				res |= 1 << (ssl.grfid != grfid ? 9 : 8) | ssl.localidx;
+			}
+			return res;
+		}
 
 		/* General station properties */
 		case 0x82: return 50;
--- a/src/newgrf_station.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_station.h	Tue Jan 22 21:00:30 2008 +0000
@@ -8,7 +8,8 @@
 #include "engine.h"
 #include "newgrf_callbacks.h"
 #include "newgrf_cargo.h"
-#include "helpers.hpp"
+#include "tile_type.h"
+#include "strings_type.h"
 
 enum StationClassID {
 	STAT_CLASS_BEGIN = 0,    ///< the lowest valid value
@@ -101,7 +102,6 @@
 StationClassID AllocateStationClass(uint32 cls);
 void SetStationClassName(StationClassID sclass, StringID name);
 StringID GetStationClassName(StationClassID sclass);
-StringID *BuildStationClassDropdown();
 
 uint GetNumStationClasses();
 uint GetNumCustomStations(StationClassID sclass);
--- a/src/newgrf_storage.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_storage.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,7 +3,6 @@
 /** @file newgrf_storage.cpp Functionality related to the temporary and persistent storage arrays for NewGRFs. */
 
 #include "stdafx.h"
-#include "helpers.hpp"
 #include "newgrf_storage.h"
 #include <set>
 
--- a/src/newgrf_storage.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_storage.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,8 @@
 #ifndef NEWGRF_STORAGE_H
 #define NEWGRF_STORAGE_H
 
+#include "core/alloc_func.hpp"
+
 /**
  * Base class for all NewGRF storage arrays. Nothing fancy, only here
  * so we have a generalised class to use.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/newgrf_string_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,54 @@
+/* $Id$ */
+
+/** @file newgrf_string_type.h */
+
+#ifndef NEWGRF_STRING_TYPE_H
+#define NEWGRF_STRING_TYPE_H
+
+#include "strings_type.h"
+
+/**
+ * A string with the required information to perform a GRF string remapping.
+ */
+struct GRFMappedStringID
+{
+private:
+	/** The GRF ID associated to the to-be-remapped string */
+	uint32 grfid;
+	/** The string; when grfid != 0 it should be remapped */
+	StringID string;
+
+public:
+	/**
+	 * Create the struct.
+	 * @param str    the string to store (or remap)
+	 * @param grf_id the GRF to remap it with
+	 */
+	GRFMappedStringID(StringID str, uint32 grf_id) : grfid(grf_id), string(str) {}
+
+	/**
+	 * An empty string.
+	 */
+	GRFMappedStringID() {}
+
+	/** Cast operator, returns the string */
+	inline operator StringID() const
+	{
+		return string;
+	}
+
+	/** Assigns the string and resets the GRF ID. */
+	GRFMappedStringID& operator = (StringID str)
+	{
+		string = str;
+		grfid = 0;
+		return *this;
+	}
+
+	/**
+	 * Map the string.
+	 */
+	void MapString();
+};
+
+#endif /* NEWGRF_STRING_TYPE_H */
--- a/src/newgrf_text.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_text.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -12,16 +12,16 @@
 #include "stdafx.h"
 #include "debug.h"
 #include "openttd.h"
-#include "string.h"
-#include "strings.h"
 #include "variables.h"
-#include "macros.h"
-#include "table/strings.h"
 #include "newgrf.h"
 #include "newgrf_text.h"
+#include "strings_func.h"
+#include "core/alloc_func.hpp"
+#include "newgrf_storage.h"
+#include "string_func.h"
+
+#include "table/strings.h"
 #include "table/control_codes.h"
-#include "helpers.hpp"
-#include "date.h"
 
 #define GRFTAB  28
 #define TABSIZE 11
@@ -207,9 +207,13 @@
 	}
 
 	for (;;) {
-		const char *tmp = str; // Used for UTF-8 decoding
-
-		c = (byte)*str++;
+		if (unicode && Utf8EncodedCharLen(*str) != 0) {
+			c = Utf8Consume(&str);
+			/* 'Magic' range of control codes. */
+			if (GB(c, 8, 8) == 0xE0) c = GB(c, 0, 8);
+		} else {
+			c = (byte)*str++;
+		}
 		if (c == 0) break;
 
 		switch (c) {
@@ -290,12 +294,6 @@
 			case 0xB7: d += Utf8Encode(d, SCC_PLANE); break;
 			case 0xB8: d += Utf8Encode(d, SCC_SHIP); break;
 			default:
-				if (unicode) {
-					d += Utf8Encode(d, Utf8Consume(&tmp));
-					str = tmp;
-					break;
-				}
-
 				/* Validate any unhandled character */
 				if (!IsValidChar(c, CS_ALPHANUMERAL)) c = '?';
 				d += Utf8Encode(d, c);
@@ -507,13 +505,25 @@
 	uint8  PopUnsignedByte()  { assert(this->position < lengthof(this->stack)); return this->stack[this->position++]; }
 	int8   PopSignedByte()    { return (int8)this->PopUnsignedByte(); }
 
-	uint16 PopUnsignedWord()  { return this->PopUnsignedByte()  | (((uint16)this->PopUnsignedByte())  <<  8); }
+	uint16 PopUnsignedWord()
+	{
+		uint16 val = this->PopUnsignedByte();
+		return val | (this->PopUnsignedByte() << 8);
+	}
 	int16  PopSignedWord()    { return (int32)this->PopUnsignedWord(); }
 
-	uint32 PopUnsignedDWord() { return this->PopUnsignedWord()  | (((uint32)this->PopUnsignedWord())  << 16); }
+	uint32 PopUnsignedDWord()
+	{
+		uint32 val = this->PopUnsignedWord();
+		return val | (this->PopUnsignedWord() << 16);
+	}
 	int32  PopSignedDWord()   { return (int32)this->PopUnsignedDWord(); }
 
-	uint64 PopUnsignedQWord() { return this->PopUnsignedDWord() | (((uint64)this->PopUnsignedDWord()) << 32); }
+	uint64 PopUnsignedQWord()
+	{
+		uint64 val = this->PopUnsignedDWord();
+		return val | (((uint64)this->PopUnsignedDWord()) << 32);
+	}
 	int64  PopSignedQWord()   { return (int64)this->PopUnsignedQWord(); }
 
 	/** Rotate the top four words down: W1, W2, W3, W4 -> W4, W1, W2, W3 */
--- a/src/newgrf_town.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_town.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,9 +4,9 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "variables.h"
+#include "settings_type.h"
 #include "debug.h"
-#include "functions.h"
+#include "core/bitmath_func.hpp"
 #include "town.h"
 
 /** This function implements the town variables that newGRF defines.
--- a/src/newgrf_townname.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_townname.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -8,9 +8,11 @@
 
 #include "stdafx.h"
 #include "openttd.h"
+#include "newgrf_townname.h"
+#include "core/alloc_func.hpp"
+#include "string_func.h"
+
 #include "table/strings.h"
-#include "newgrf_townname.h"
-#include "string.h"
 
 static GRFTownName *_grf_townnames = NULL;
 
--- a/src/newgrf_townname.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_townname.h	Tue Jan 22 21:00:30 2008 +0000
@@ -2,6 +2,8 @@
 #ifndef NEWGRF_TOWNNAME_H
 #define NEWGRF_TOWNNAME_H
 
+#include "strings_type.h"
+
 /** @file newgrf_townname.h
  * Header of Action 0F "universal holder" structure and functions
  */
--- a/src/news.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/news.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,12 @@
 #ifndef NEWS_H
 #define NEWS_H
 
+#include "window_type.h"
+#include "vehicle_type.h"
+#include "tile_type.h"
+#include "date_type.h"
+#include "strings_type.h"
+
 struct NewsItem {
 	StringID string_id; ///< Message text (sometimes also used for storing other info)
 	uint16 duration;    ///< Remaining time for showing this news message
@@ -43,7 +49,9 @@
 void DrawNewsBorder(const Window *w);
 void InitNewsItemStructs();
 
-VARDEF NewsItem _statusbar_news_item;
+extern NewsItem _statusbar_news_item;
+extern uint32 _news_display_opt;
+extern bool _news_ticker_sound;
 
 /** Type of news. */
 enum NewsType {
--- a/src/news_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/news_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,21 +3,22 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
-#include "strings.h"
+#include "gui.h"
+#include "window_gui.h"
+#include "viewport_func.h"
+#include "news.h"
+#include "settings_type.h"
+#include "transparency.h"
+#include "strings_func.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "vehicle_base.h"
+#include "sound_func.h"
+#include "string_func.h"
+#include "widgets/dropdown_func.h"
+
 #include "table/sprites.h"
 #include "table/strings.h"
-#include "window.h"
-#include "gui.h"
-#include "viewport.h"
-#include "gfx.h"
-#include "news.h"
-#include "vehicle.h"
-#include "sound.h"
-#include "variables.h"
-#include "date.h"
-#include "string.h"
-#include "transparency.h"
 
 /** @file news_gui.cpp
  *
@@ -51,6 +52,9 @@
 typedef byte NewsID;
 #define INVALID_NEWS 255
 
+NewsItem _statusbar_news_item;
+uint32 _news_display_opt;
+bool _news_ticker_sound;
 static NewsItem _news_items[MAX_NEWS];      ///< The news FIFO queue
 static NewsID _current_news = INVALID_NEWS; ///< points to news item that should be shown next
 static NewsID _oldest_news = 0;             ///< points to first item in fifo queue
@@ -782,10 +786,9 @@
 
 /** News settings window widget offset constants */
 enum {
-	WIDGET_NEWSOPT_BTN_SUMMARY  = 4,  ///< Button that adjusts at once the level for all settings
-	WIDGET_NEWSOPT_DROP_SUMMARY,      ///< Drop down button for same upper button
-	WIDGET_NEWSOPT_SOUNDTICKER  = 7,  ///< Button activating sound on events
-	WIDGET_NEWSOPT_START_OPTION = 9,  ///< First widget that is part of a group [<] .. [.]
+	WIDGET_NEWSOPT_DROP_SUMMARY = 4,  ///< Dropdown that adjusts at once the level for all settings
+	WIDGET_NEWSOPT_SOUNDTICKER  = 6,  ///< Button activating sound on events
+	WIDGET_NEWSOPT_START_OPTION = 8,  ///< First widget that is part of a group [<] .. [.]
 };
 
 /**
@@ -837,6 +840,8 @@
 			int i, y;
 
 			if (_news_ticker_sound) w->LowerWidget(WIDGET_NEWSOPT_SOUNDTICKER);
+
+			w->widget[WIDGET_NEWSOPT_DROP_SUMMARY].data = message_opt[WP(w, def_d).data_1];
 			DrawWindowWidgets(w);
 
 			/* Draw the string of each setting on each button. */
@@ -845,14 +850,10 @@
 				 * which will give centered position */
 				DrawStringCentered(51, y + 1, message_opt[val & 0x3], TC_BLACK);
 			}
-
-			/* Draw the general bottom button string as well */
-			DrawStringCentered(51, y + 10, message_opt[WP(w, def_d).data_1], TC_BLACK);
 		} break;
 
 		case WE_CLICK:
 			switch (e->we.click.widget) {
-				case WIDGET_NEWSOPT_BTN_SUMMARY:
 				case WIDGET_NEWSOPT_DROP_SUMMARY: // Dropdown menu for all settings
 					ShowDropDownMenu(w, message_opt, WP(w, def_d).data_1, WIDGET_NEWSOPT_DROP_SUMMARY, 0, 0);
 					break;
@@ -860,7 +861,7 @@
 				case WIDGET_NEWSOPT_SOUNDTICKER: // Change ticker sound on/off
 					_news_ticker_sound ^= 1;
 					w->ToggleWidgetLoweredState(e->we.click.widget);
-					InvalidateWidget(w, e->we.click.widget);
+					w->InvalidateWidget(e->we.click.widget);
 					break;
 
 				default: { // Clicked on the [<] .. [>] widgets
@@ -945,14 +946,10 @@
 	STR_0205_MESSAGE_TYPES,   STR_NULL},
 
 /* General drop down and sound button, widgets WIDGET_NEWSOPT_BTN_SUMMARY and WIDGET_NEWSOPT_DROP_SUMMARY */
-{     WWT_PANEL, RESIZE_NONE, COLOUR_YELLOW,
-	  4,  86,  34 + NT_END * NEWS_SETTING_BASELINE_SKIP,  45 + NT_END * NEWS_SETTING_BASELINE_SKIP,
+{  WWT_DROPDOWN, RESIZE_NONE, COLOUR_YELLOW,
+	  4,  98,  34 + NT_END * NEWS_SETTING_BASELINE_SKIP,  45 + NT_END * NEWS_SETTING_BASELINE_SKIP,
 	0x0, STR_NULL},
 
-{   WWT_TEXTBTN, RESIZE_NONE, COLOUR_YELLOW,
-	 87,  98,  34 + NT_END * NEWS_SETTING_BASELINE_SKIP,  45 + NT_END * NEWS_SETTING_BASELINE_SKIP,
-	STR_0225, STR_NULL},
-
 {      WWT_TEXT, RESIZE_NONE, COLOUR_YELLOW,
 	103, 409,  35 + NT_END * NEWS_SETTING_BASELINE_SKIP,  47 + NT_END * NEWS_SETTING_BASELINE_SKIP,
 	STR_MESSAGES_ALL, STR_NULL},
--- a/src/npf.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/npf.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,21 +4,24 @@
 
 #include "stdafx.h"
 #include "openttd.h"
+#include "npf.h"
 #include "bridge_map.h"
 #include "debug.h"
-#include "functions.h"
+#include "tile_cmd.h"
+#include "bridge.h"
 #include "landscape.h"
-#include "npf.h"
 #include "aystar.h"
-#include "macros.h"
 #include "pathfind.h"
 #include "station.h"
 #include "station_map.h"
-#include "tile.h"
 #include "depot.h"
 #include "tunnel_map.h"
 #include "network/network.h"
 #include "water_map.h"
+#include "tunnelbridge_map.h"
+#include "functions.h"
+#include "vehicle_base.h"
+#include "settings_type.h"
 
 static AyStar _npf_aystar;
 
@@ -170,7 +173,7 @@
 {
 	DiagDirection exitdir = TrackdirToExitdir((Trackdir)current->direction);
 	TileIndex tile = current->tile;
-	if (GetTunnelDirection(tile) == ReverseDiagDir(exitdir)) {
+	if (GetTunnelBridgeDirection(tile) == ReverseDiagDir(exitdir)) {
 		/* We just popped out if this tunnel, since were
 		 * facing the tunnel exit */
 		FindLengthOfTunnelResult flotr;
@@ -480,8 +483,7 @@
 			break;
 
 		case MP_TUNNELBRIDGE:
-			if ((IsTunnel(tile) && GetTunnelTransportType(tile) == TRANSPORT_RAIL) ||
-					(IsBridge(tile) && GetBridgeTransportType(tile) == TRANSPORT_RAIL)) {
+			if (GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL) {
 				return IsTileOwner(tile, owner);
 			}
 			break;
@@ -533,14 +535,11 @@
 	DEBUG(npf, 4, "Expanding: (%d, %d, %d) [%d]", TileX(src_tile), TileY(src_tile), src_trackdir, src_tile);
 
 	/* Find dest tile */
-	if (IsTunnelTile(src_tile) && GetTunnelDirection(src_tile) == src_exitdir) {
-		/* This is a tunnel. We know this tunnel is our type,
+	if (IsTileType(src_tile, MP_TUNNELBRIDGE) && GetTunnelBridgeDirection(src_tile) == src_exitdir) {
+		/* This is a tunnel/bridge. We know this tunnel/bridge is our type,
 		 * otherwise we wouldn't have got here. It is also facing us,
 		 * so we should skip it's body */
-		dst_tile = GetOtherTunnelEnd(src_tile);
-		override_dst_check = true;
-	} else if (IsBridgeTile(src_tile) && GetBridgeRampDirection(src_tile) == src_exitdir) {
-		dst_tile = GetOtherBridgeEnd(src_tile);
+		dst_tile = GetOtherTunnelBridgeEnd(src_tile);
 		override_dst_check = true;
 	} else if (type != TRANSPORT_WATER && (IsStandardRoadStopTile(src_tile) || IsTileDepotType(src_tile, type))) {
 		/* This is a road station (non drive-through) or a train or road depot. We can enter and exit
@@ -589,14 +588,9 @@
 	/* I can't enter a tunnel entry/exit tile from a tile above the tunnel. Note
 	 * that I can enter the tunnel from a tile below the tunnel entrance. This
 	 * solves the problem of vehicles wanting to drive off a tunnel entrance */
-	if (!override_dst_check) {
-		if (IsTileType(dst_tile, MP_TUNNELBRIDGE)) {
-			if (IsTunnel(dst_tile)) {
-				if (GetTunnelDirection(dst_tile) != src_exitdir) return;
-			} else {
-				if (GetBridgeRampDirection(dst_tile) != src_exitdir) return;
-			}
-		}
+	if (!override_dst_check && IsTileType(dst_tile, MP_TUNNELBRIDGE) &&
+			GetTunnelBridgeDirection(dst_tile) != src_exitdir) {
+		return;
 	}
 
 	/* check correct rail type (mono, maglev, etc) */
@@ -674,7 +668,7 @@
  * multiple targets that are spread around, we should perform a breadth first
  * search by specifiying CalcZero as our heuristic.
  */
-static NPFFoundTargetData NPFRouteInternal(AyStarNode* start1, AyStarNode* start2, NPFFindStationOrTileData* target, AyStar_EndNodeCheck target_proc, AyStar_CalculateH heuristic_proc, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes, uint reverse_penalty)
+static NPFFoundTargetData NPFRouteInternal(AyStarNode* start1, AyStarNode* start2, NPFFindStationOrTileData* target, AyStar_EndNodeCheck target_proc, AyStar_CalculateH heuristic_proc, TransportType type, uint sub_type, Owner owner, RailTypes railtypes, uint reverse_penalty)
 {
 	int r;
 	NPFFoundTargetData result;
@@ -733,7 +727,7 @@
 	return result;
 }
 
-NPFFoundTargetData NPFRouteToStationOrTileTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes)
+NPFFoundTargetData NPFRouteToStationOrTileTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypes railtypes)
 {
 	AyStarNode start1;
 	AyStarNode start2;
@@ -750,12 +744,12 @@
 	return NPFRouteInternal(&start1, (IsValidTile(tile2) ? &start2 : NULL), target, NPFFindStationOrTile, NPFCalcStationOrTileHeuristic, type, sub_type, owner, railtypes, 0);
 }
 
-NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes)
+NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypes railtypes)
 {
 	return NPFRouteToStationOrTileTwoWay(tile, trackdir, INVALID_TILE, INVALID_TRACKDIR, target, type, sub_type, owner, railtypes);
 }
 
-NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes, uint reverse_penalty)
+NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, TransportType type, uint sub_type, Owner owner, RailTypes railtypes, uint reverse_penalty)
 {
 	AyStarNode start1;
 	AyStarNode start2;
@@ -774,12 +768,12 @@
 	return NPFRouteInternal(&start1, (IsValidTile(tile2) ? &start2 : NULL), NULL, NPFFindDepot, NPFCalcZero, type, sub_type, owner, railtypes, reverse_penalty);
 }
 
-NPFFoundTargetData NPFRouteToDepotBreadthFirst(TileIndex tile, Trackdir trackdir, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes)
+NPFFoundTargetData NPFRouteToDepotBreadthFirst(TileIndex tile, Trackdir trackdir, TransportType type, uint sub_type, Owner owner, RailTypes railtypes)
 {
 	return NPFRouteToDepotBreadthFirstTwoWay(tile, trackdir, INVALID_TILE, INVALID_TRACKDIR, type, sub_type, owner, railtypes, 0);
 }
 
-NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes)
+NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir, TransportType type, uint sub_type, Owner owner, RailTypes railtypes)
 {
 	/* Okay, what we're gonna do. First, we look at all depots, calculate
 	 * the manhatten distance to get to each depot. We then sort them by
--- a/src/npf.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/npf.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,11 +5,12 @@
 #ifndef NPF_H
 #define NPF_H
 
-#include "openttd.h"
 #include "aystar.h"
 #include "station.h"
-#include "vehicle.h"
-#include "tile.h"
+#include "vehicle_type.h"
+#include "tile_type.h"
+#include "track_type.h"
+#include "core/bitmath_func.hpp"
 
 /* mowing grass */
 enum {
@@ -77,28 +78,28 @@
 /* Will search from the given tile and direction, for a route to the given
  * station for the given transport type. See the declaration of
  * NPFFoundTargetData above for the meaning of the result. */
-NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes);
+NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypes railtypes);
 
 /* Will search as above, but with two start nodes, the second being the
  * reverse. Look at the NPF_FLAG_REVERSE flag in the result node to see which
  * direction was taken (NPFGetBit(result.node, NPF_FLAG_REVERSE)) */
-NPFFoundTargetData NPFRouteToStationOrTileTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes);
+NPFFoundTargetData NPFRouteToStationOrTileTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypes railtypes);
 
 /* Will search a route to the closest depot. */
 
 /* Search using breadth first. Good for little track choice and inaccurate
  * heuristic, such as railway/road.*/
-NPFFoundTargetData NPFRouteToDepotBreadthFirst(TileIndex tile, Trackdir trackdir, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes);
+NPFFoundTargetData NPFRouteToDepotBreadthFirst(TileIndex tile, Trackdir trackdir, TransportType type, uint sub_type, Owner owner, RailTypes railtypes);
 /* Same as above but with two start nodes, the second being the reverse. Call
  * NPFGetBit(result.node, NPF_FLAG_REVERSE) to see from which node the path
  * orginated. All pathfs from the second node will have the given
  * reverse_penalty applied (NPF_TILE_LENGTH is the equivalent of one full
  * tile).
  */
-NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes, uint reverse_penalty);
+NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, TransportType type, uint sub_type, Owner owner, RailTypes railtypes, uint reverse_penalty);
 /* Search by trying each depot in order of Manhattan Distance. Good for lots
  * of choices and accurate heuristics, such as water. */
-NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes);
+NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir, TransportType type, uint sub_type, Owner owner, RailTypes railtypes);
 
 void NPFFillWithOrderData(NPFFindStationOrTileData* fstd, Vehicle* v);
 
--- a/src/oldloader.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/oldloader.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,16 +5,12 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "station_map.h"
-#include "table/strings.h"
-#include "functions.h"
-#include "map.h"
 #include "town.h"
 #include "industry.h"
 #include "station.h"
-#include "economy.h"
-#include "player.h"
+#include "player_func.h"
+#include "player_base.h"
 #include "engine.h"
-#include "vehicle.h"
 #include "aircraft.h"
 #include "roadveh.h"
 #include "ship.h"
@@ -24,7 +20,14 @@
 #include "depot.h"
 #include "newgrf_config.h"
 #include "ai/ai.h"
-#include "date.h"
+#include "ai/default/default.h"
+#include "zoom_func.h"
+#include "functions.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "variables.h"
+
+#include "table/strings.h"
 
 enum {
 	HEADER_SIZE = 49,
@@ -811,10 +814,10 @@
 	Player *p = GetPlayer(_current_player_id);
 
 	switch (num) {
-		case 0: return LoadChunk(ls, &p->ai.src, player_ai_build_rec_chunk);
-		case 1: return LoadChunk(ls, &p->ai.dst, player_ai_build_rec_chunk);
-		case 2: return LoadChunk(ls, &p->ai.mid1, player_ai_build_rec_chunk);
-		case 3: return LoadChunk(ls, &p->ai.mid2, player_ai_build_rec_chunk);
+		case 0: return LoadChunk(ls, &_players_ai[p->index].src, player_ai_build_rec_chunk);
+		case 1: return LoadChunk(ls, &_players_ai[p->index].dst, player_ai_build_rec_chunk);
+		case 2: return LoadChunk(ls, &_players_ai[p->index].mid1, player_ai_build_rec_chunk);
+		case 3: return LoadChunk(ls, &_players_ai[p->index].mid2, player_ai_build_rec_chunk);
 	}
 
 	return false;
@@ -924,11 +927,10 @@
 
 static bool OldPlayerAI(LoadgameState *ls, int num)
 {
-	Player *p = GetPlayer(_current_player_id);
-
-	return LoadChunk(ls, &p->ai, player_ai_chunk);
+	return LoadChunk(ls, &_players_ai[_current_player_id], player_ai_chunk);
 }
 
+uint8 ai_tick;
 static const OldChunks player_chunk[] = {
 	OCL_VAR ( OC_UINT16,   1, &_old_string_id ),
 	OCL_SVAR( OC_UINT32, Player, name_2 ),
@@ -958,7 +960,7 @@
 	OCL_CHUNK( 1, OldPlayerAI ),
 
 	OCL_SVAR(  OC_UINT8, Player, block_preview ),
-	OCL_SVAR(  OC_UINT8, Player, ai.tick ),
+	 OCL_VAR(  OC_UINT8,   1, &ai_tick ),
 	OCL_SVAR(  OC_UINT8, Player, avail_railtypes ),
 	OCL_SVAR(   OC_TILE, Player, location_of_house ),
 	OCL_SVAR(  OC_UINT8, Player, share_owners[0] ),
@@ -982,6 +984,7 @@
 	p->name_1 = RemapOldStringID(_old_string_id);
 	p->president_name_1 = RemapOldStringID(_old_string_id_2);
 	p->player_money = p->player_money;
+	_players_ai[_current_player_id].tick = ai_tick;
 
 	if (num == 0) {
 		/* If the first player has no name, make sure we call it UNNAMED */
@@ -1007,10 +1010,10 @@
 		p->location_of_house = 0;
 
 	/* State 20 for AI players is sell vehicle. Since the AI struct is not
-	 * really figured out as of now, p->ai.cur_veh; needed for 'sell vehicle'
+	 * really figured out as of now, _players_ai[p->index].cur_veh; needed for 'sell vehicle'
 	 * is NULL and the function will crash. To fix this, just change the state
 	 * to some harmless state, like 'loop vehicle'; 1 */
-	if (!IsHumanPlayer((PlayerID)num) && p->ai.state == 20) p->ai.state = 1;
+	if (!IsHumanPlayer((PlayerID)num) && _players_ai[p->index].state == 20) _players_ai[p->index].state = 1;
 
 	if (p->is_ai && (!_networking || _network_server) && _ai.enabled)
 		AI_StartNewAI(p->index);
@@ -1233,7 +1236,8 @@
 
 		if (_old_next_ptr != 0xFFFF) v->next = GetVehiclePoolSize() <= _old_next_ptr ? new (_old_next_ptr) InvalidVehicle() : GetVehicle(_old_next_ptr);
 
-		v->string_id = RemapOldStringID(_old_string_id);
+		_old_string_id = RemapOldStringID(_old_string_id);
+		v->name = CopyFromOldName(_old_string_id);
 
 		/* Vehicle-subtype is different in TTD(Patch) */
 		if (v->type == VEH_SPECIAL) v->subtype = v->subtype >> 1;
@@ -1249,7 +1253,7 @@
 }
 
 static const OldChunks sign_chunk[] = {
-	OCL_SVAR( OC_UINT16, Sign, str ),
+	OCL_VAR ( OC_UINT16, 1, &_old_string_id ),
 	OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Sign, x ),
 	OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Sign, y ),
 	OCL_SVAR( OC_FILE_U16 | OC_VAR_I8, Sign, z ),
@@ -1261,7 +1265,13 @@
 
 static bool LoadOldSign(LoadgameState *ls, int num)
 {
-	return LoadChunk(ls, new (num) Sign(), sign_chunk);
+	Sign *si = new (num) Sign();
+	if (!LoadChunk(ls, si, sign_chunk)) return false;
+
+	_old_string_id = RemapOldStringID(_old_string_id);
+	si->name = CopyFromOldName(_old_string_id);
+
+	return true;
 }
 
 static const OldChunks engine_chunk[] = {
@@ -1298,6 +1308,13 @@
 	return true;
 }
 
+static bool LoadOldEngineName(LoadgameState *ls, int num)
+{
+	Engine *e = GetEngine(num);
+	e->name = CopyFromOldName(RemapOldStringID(ReadUint16(ls)));
+	return true;
+}
+
 static const OldChunks subsidy_chunk[] = {
 	OCL_SVAR(  OC_UINT8, Subsidy, cargo_type ),
 	OCL_SVAR(  OC_UINT8, Subsidy, age ),
@@ -1504,7 +1521,7 @@
 
 	OCL_NULL( 144 ),             ///< cargo-stuff, calculated in InitializeLandscapeVariables
 
-	OCL_VAR ( OC_UINT16,  256, &_engine_name_strings[0] ),
+	OCL_CHUNK(256, LoadOldEngineName ),
 
 	OCL_NULL( 144 ),             ///< AI cargo-stuff, calculated in InitializeLandscapeVariables
 	OCL_NULL( 2 ),               ///< Company indexes of players, no longer in use
@@ -1622,7 +1639,6 @@
 	for (Engine *e = _engines; e != endof(_engines); e++) {
 		if (_date >= (e->intro_date + 365)) {
 			e->flags = (e->flags & ~ENGINE_EXCLUSIVE_PREVIEW) | ENGINE_AVAILABLE;
-			AddRemoveEngineFromAutoreplaceAndBuildWindows(e->type);
 			e->player_avail = (byte)-1;
 		}
 	}
@@ -1632,8 +1648,6 @@
 	FixOldStations();
 	FixOldVehicles();
 
-	AddTypeToEngines();
-
 	/* We have a new difficulty setting */
 	_opt.diff.town_council_tolerance = Clamp(_opt.diff_level, 0, 2);
 
--- a/src/oldpool.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/oldpool.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,9 +5,8 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
 #include "oldpool.h"
-#include "helpers.hpp"
+#include "core/alloc_func.hpp"
 
 /**
  * Clean a pool in a safe way (does free all blocks)
@@ -55,12 +54,9 @@
 
 	/* Increase the poolsize */
 	this->blocks = ReallocT(this->blocks, this->current_blocks + 1);
-	if (this->blocks == NULL) error("Pool: (%s) could not allocate memory for blocks", this->name);
 
 	/* Allocate memory to the new block item */
 	this->blocks[this->current_blocks] = MallocT<byte>(this->item_size * (1 << this->block_size_bits));
-	if (this->blocks[this->current_blocks] == NULL)
-		error("Pool: (%s) could not allocate memory for blocks", this->name);
 
 	/* Clean the content of the new block */
 	memset(this->blocks[this->current_blocks], 0, this->item_size * (1 << this->block_size_bits));
--- a/src/oldpool.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/oldpool.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,8 @@
 #ifndef OLDPOOL_H
 #define OLDPOOL_H
 
+#include "core/math_func.hpp"
+
 /* The function that is called after a new block is added
      start_item is the first item of the new made block */
 typedef void OldMemoryPoolNewBlock(uint start_item);
--- a/src/openttd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/openttd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,24 +4,14 @@
 
 #include "stdafx.h"
 #define VARDEF
-#include "string.h"
 #include "debug.h"
 #include "driver.h"
 #include "saveload.h"
-#include "map.h"
-#include "tile.h"
-#include "void_map.h"
-#include "helpers.hpp"
 
 #include "openttd.h"
-#include "table/strings.h"
-#include "strings.h"
 #include "bridge_map.h"
-#include "functions.h"
 #include "mixer.h"
 #include "spritecache.h"
-#include "strings.h"
-#include "gfx.h"
 #include "gfxinit.h"
 #include "gui.h"
 #include "landscape.h"
@@ -29,32 +19,33 @@
 #include "station_map.h"
 #include "town_map.h"
 #include "tunnel_map.h"
-#include "vehicle.h"
-#include "viewport.h"
-#include "window.h"
-#include "player.h"
-#include "command.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "window_func.h"
+#include "window_gui.h"
+#include "player_func.h"
+#include "player_base.h"
+#include "command_func.h"
 #include "town.h"
 #include "industry.h"
 #include "news.h"
 #include "engine.h"
-#include "sound.h"
-#include "economy.h"
 #include "fileio.h"
+#include "fios.h"
 #include "airport.h"
 #include "aircraft.h"
 #include "console.h"
 #include "screenshot.h"
 #include "network/network.h"
+#include "network/network_internal.h"
 #include "signs.h"
 #include "depot.h"
 #include "waypoint.h"
 #include "ai/ai.h"
 #include "train.h"
 #include "yapf/yapf.h"
-#include "settings.h"
+#include "settings_func.h"
 #include "genworld.h"
-#include "date.h"
 #include "clear_map.h"
 #include "fontcache.h"
 #include "newgrf.h"
@@ -69,6 +60,13 @@
 #include "music/music_driver.hpp"
 #include "video/video_driver.hpp"
 #include "newgrf_fsmports.h"
+#include "strings_func.h"
+#include "zoom_func.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "variables.h"
+#include "road_func.h"
 
 #include "bridge_map.h"
 #include "clear_map.h"
@@ -78,9 +76,13 @@
 #include "industry_map.h"
 #include "unmovable_map.h"
 #include "tree_map.h"
+#include "tunnelbridge_map.h"
+#include "void_map.h"
 
 #include <stdarg.h>
 
+#include "table/strings.h"
+
 void CallLandscapeTick();
 void IncreaseDate();
 void DoPaletteAnimations();
@@ -123,34 +125,6 @@
 }
 
 
-void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize)
-{
-	FILE *in;
-	byte *mem;
-	size_t len;
-
-	in = fopen(filename, "rb");
-	if (in == NULL) return NULL;
-
-	fseek(in, 0, SEEK_END);
-	len = ftell(in);
-	fseek(in, 0, SEEK_SET);
-	if (len > maxsize || (mem = MallocT<byte>(len + 1)) == NULL) {
-		fclose(in);
-		return NULL;
-	}
-	mem[len] = 0;
-	if (fread(mem, len, 1, in) != 1) {
-		fclose(in);
-		free(mem);
-		return NULL;
-	}
-	fclose(in);
-
-	*lenp = len;
-	return mem;
-}
-
 extern const char _openttd_revision[];
 static void showhelp()
 {
@@ -339,10 +313,14 @@
 	_cursor.fix_at = false;
 	MarkWholeScreenDirty();
 
+	CheckForMissingGlyphsInLoadedLanguagePack();
+
 	/* Play main theme */
 	if (_music_driver->IsSongPlaying()) ResetMusic();
 }
 
+byte _no_scroll;
+byte _savegame_sort_order;
 #if defined(UNIX) && !defined(__MORPHOS__)
 extern void DedicatedFork();
 #endif
@@ -719,12 +697,14 @@
 	SettingsDisableElrail(_patches.disable_elrails);
 	SetDefaultRailGui();
 
+#ifdef ENABLE_NETWORK
 	/* We are the server, we start a new player (not dedicated),
 	 * so set the default password *if* needed. */
 	if (_network_server && !StrEmpty(_network_default_company_pass)) {
 		char *password = _network_default_company_pass;
 		NetworkChangeCompanyPassword(1, &password);
 	}
+#endif /* ENABLE_NETWORK */
 
 	MarkWholeScreenDirty();
 }
@@ -862,6 +842,13 @@
 		if (_is_network_server) {
 			/* But not if we are going to the menu */
 			if (new_mode != SM_MENU) {
+				/* check if we should reload the config */
+				if (_network_reload_cfg) {
+					LoadFromConfig();
+					_patches = _patches_newgame;
+					_opt = _opt_newgame;
+					ResetGRFConfig(false);
+				}
 				NetworkServerStart();
 			} else {
 				/* This client no longer wants to be a network-server */
@@ -897,6 +884,7 @@
 	case SM_LOAD: { /* Load game, Play Scenario */
 		_opt_ptr = &_opt;
 		ResetGRFConfig(true);
+		ResetWindowSystem();
 
 		if (!SafeSaveOrLoad(_file_to_saveload.name, _file_to_saveload.mode, GM_NORMAL, NO_DIRECTORY)) {
 			LoadIntroGame();
@@ -906,7 +894,8 @@
 			/* Update the local player for a loaded game. It is either always
 			 * player #1 (eg 0) or in the case of a dedicated server a spectator */
 			SetLocalPlayer(_network_dedicated ? PLAYER_SPECTATOR : PLAYER_FIRST);
-			DoCommandP(0, 0, 0, NULL, CMD_PAUSE); // decrease pause counter (was increased from opening load dialog)
+			/* Decrease pause counter (was increased from opening load dialog) */
+			DoCommandP(0, 0, 0, NULL, CMD_PAUSE);
 #ifdef ENABLE_NETWORK
 			if (_network_server) {
 				snprintf(_network_game_info.map_name, lengthof(_network_game_info.map_name), "%s (Loaded game)", _file_to_saveload.title);
@@ -950,12 +939,15 @@
 		break;
 
 	case SM_SAVE: /* Save game */
+		/* Make network saved games on pause compatible to singleplayer */
+		if (_networking && _pause_game == 1) _pause_game = 2;
 		if (SaveOrLoad(_file_to_saveload.name, SL_SAVE, NO_DIRECTORY) != SL_OK) {
 			SetDParamStr(0, GetSaveLoadErrorString());
 			ShowErrorMessage(INVALID_STRING_ID, STR_012D, 0, 0);
 		} else {
 			DeleteWindowById(WC_SAVELOAD, 0);
 		}
+		if (_networking && _pause_game == 2) _pause_game = 1;
 		break;
 
 	case SM_GENRANDLAND: /* Generate random land within scenario editor */
@@ -978,16 +970,21 @@
  * That check is enforced in DoCommand. */
 void StateGameLoop()
 {
-	ClearStorageChanges(false);
+	/* dont execute the state loop during pause */
+	if (_pause_game) {
+		CallWindowTickEvent();
+		return;
+	}
+	if (IsGeneratingWorld()) return;
 
-	/* dont execute the state loop during pause */
-	if (_pause_game) return;
-	if (IsGeneratingWorld()) return;
+	ClearStorageChanges(false);
 
 	if (_game_mode == GM_EDITOR) {
 		RunTileLoop();
 		CallVehicleTicks();
 		CallLandscapeTick();
+		ClearStorageChanges(true);
+
 		CallWindowTickEvent();
 		NewsLoop();
 	} else {
@@ -1001,6 +998,7 @@
 		RunTileLoop();
 		CallVehicleTicks();
 		CallLandscapeTick();
+		ClearStorageChanges(true);
 
 		AI_RunGameLoop();
 
@@ -1045,28 +1043,36 @@
 		Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
 		assert(w);
 
-		WP(w,vp_d).dest_scrollpos_x += ScaleByZoom(x, w->viewport->zoom);
-		WP(w,vp_d).dest_scrollpos_y += ScaleByZoom(y, w->viewport->zoom);
+		WP(w, vp_d).dest_scrollpos_x += ScaleByZoom(x, w->viewport->zoom);
+		WP(w, vp_d).dest_scrollpos_y += ScaleByZoom(y, w->viewport->zoom);
 	}
 }
-
+/**
+ * Describes all the different arrow key combinations the game allows
+ * when it is in scrolling mode.
+ * The real arrow keys are bitwise numbered as
+ * 1 = left
+ * 2 = up
+ * 4 = right
+ * 8 = down
+ */
 static const int8 scrollamt[16][2] = {
-	{ 0,  0},
+	{ 0,  0}, ///<  no key specified
 	{-2,  0}, ///<  1 : left
 	{ 0, -2}, ///<  2 : up
-	{-2, -1}, ///<  3 : left + up
+	{-2, -1}, ///<  3 : left  + up
 	{ 2,  0}, ///<  4 : right
-	{ 0,  0}, ///<  5 : left + right
+	{ 0,  0}, ///<  5 : left  + right = nothing
 	{ 2, -1}, ///<  6 : right + up
-	{ 0, -2}, ///<  7 : left + right + up = up
+	{ 0, -2}, ///<  7 : right + left  + up = up
 	{ 0  ,2}, ///<  8 : down
-	{-2  ,1}, ///<  9 : down+left
-	{ 0,  0}, ///< 10 : impossible
-	{-2,  0}, ///< 11 : left + up + down = left
-	{ 2,  1}, ///< 12 : down+right
-	{ 0,  2}, ///< 13 : left + right + down = down
-	{ 0, -2}, ///< 14 : left + right + up = up
-	{ 0,  0}, ///< 15 : impossible
+	{-2  ,1}, ///<  9 : down  + left
+	{ 0,  0}, ///< 10 : down  + up    = nothing
+	{-2,  0}, ///< 11 : left  + up    +  down = left
+	{ 2,  1}, ///< 12 : down  + right
+	{ 0,  2}, ///< 13 : left  + right +  down = down
+	{ 2,  0}, ///< 14 : right + up    +  down = right
+	{ 0,  0}, ///< 15 : left  + up    +  right + down  = nothing
 };
 
 static void HandleKeyScrolling()
@@ -1298,7 +1304,7 @@
 	WP(w, vp_d).dest_scrollpos_y = _saved_scrollpos_y;
 
 	ViewPort *vp = w->viewport;
-	vp->zoom = (ZoomLevel)min(_saved_scrollpos_zoom, ZOOM_LVL_MAX);
+	vp->zoom = min(_saved_scrollpos_zoom, ZOOM_LVL_MAX);
 	vp->virtual_width = ScaleByZoom(vp->width, vp->zoom);
 	vp->virtual_height = ScaleByZoom(vp->height, vp->zoom);
 
@@ -1328,7 +1334,15 @@
 	Player *players[MAX_PLAYERS];
 	const Vehicle *v;
 
-	for (PlayerID i = PLAYER_FIRST; i < MAX_PLAYERS; i++) players[i] = GetPlayer(i);
+	for (PlayerID i = PLAYER_FIRST; i < MAX_PLAYERS; i++) {
+		players[i] = GetPlayer(i);
+
+		/* For each player, verify (while loading a scenario) that the inauguration date is the current year and set it
+		 * accordingly if it is not the case.  No need to set it on players that are not been used already,
+		 * thus the MIN_YEAR (which is really nothing more than Zero, initialized value) test */
+		if (_file_to_saveload.filetype == FT_SCENARIO && players[i]->inaugurated_year != MIN_YEAR)
+			players[i]->inaugurated_year = _cur_year;
+	}
 
 	FOR_ALL_VEHICLES(v) {
 		if (!IsEngineCountable(v)) continue;
@@ -1367,6 +1381,34 @@
 		}
 	}
 
+	if (CheckSavegameVersion(84)) {
+		Player *p;
+		FOR_ALL_PLAYERS(p) {
+			p->name = CopyFromOldName(p->name_1);
+			if (p->name != NULL) p->name_1 = STR_SV_UNNAMED;
+			p->president_name = CopyFromOldName(p->president_name_1);
+			if (p->president_name != NULL) p->president_name_1 = SPECSTR_PRESIDENT_NAME;
+		}
+
+		Station *st;
+		FOR_ALL_STATIONS(st) {
+			st->name = CopyFromOldName(st->string_id);
+			if (st->name != NULL) st->string_id = STR_EMPTY;
+		}
+
+		Town *t;
+		FOR_ALL_TOWNS(t) {
+			t->name = CopyFromOldName(t->townnametype);
+			if (t->name != NULL) t->townnametype = SPECSTR_TOWNNAME_START + _opt.town_name;
+		}
+
+		Waypoint *wp;
+		FOR_ALL_WAYPOINTS(wp) {
+			wp->name = CopyFromOldName(wp->string);
+			wp->string = STR_EMPTY;
+		}
+	}
+
 	/* convert road side to my format. */
 	if (_opt.road_side) _opt.road_side = 1;
 
@@ -1379,7 +1421,7 @@
 
 	switch (gcf_res) {
 		case GLC_COMPATIBLE: _switch_mode_errorstr = STR_NEWGRF_COMPATIBLE_LOAD_WARNING; break;
-		case GLC_NOT_FOUND: _switch_mode_errorstr = STR_NEWGRF_DISABLED_WARNING; break;
+		case GLC_NOT_FOUND: _switch_mode_errorstr = STR_NEWGRF_DISABLED_WARNING; _pause_game = (byte)-1; break;
 		default: break;
 	}
 
@@ -1402,7 +1444,7 @@
 	InitializeLandscapeVariables(true);
 
 	/* Update all vehicles */
-	AfterLoadVehicles();
+	AfterLoadVehicles(true);
 
 	/* Update all waypoints */
 	if (CheckSavegameVersion(12)) FixOldWaypoints();
@@ -1675,7 +1717,7 @@
 				case MP_TUNNELBRIDGE:
 					/* Middle part of "old" bridges */
 					if (old_bridge && IsBridgeTile(t) && HasBit(_m[t].m5, 6)) break;
-					if ((IsTunnel(t) ? GetTunnelTransportType(t) : (old_bridge ? (TransportType)GB(_m[t].m5, 1, 2) : GetBridgeTransportType(t))) == TRANSPORT_ROAD) {
+					if ((IsTunnel(t) ? GetTunnelBridgeTransportType(t) : (old_bridge ? (TransportType)GB(_m[t].m5, 1, 2) : GetTunnelBridgeTransportType(t))) == TRANSPORT_ROAD) {
 						SetRoadTypes(t, ROADTYPES_ROAD);
 					}
 					break;
@@ -1717,7 +1759,7 @@
 						if (GB(_m[t].m5, 3, 2) == 0) {
 							MakeClear(t, CLEAR_GRASS, 3);
 						} else {
-							MakeCanal(t, (GetTileOwner(t) == OWNER_WATER) ? OWNER_NONE : GetTileOwner(t));
+							MakeCanal(t, (GetTileOwner(t) == OWNER_WATER) ? OWNER_NONE : GetTileOwner(t), Random());
 						}
 					}
 					SetBridgeMiddle(t, axis);
@@ -1735,7 +1777,7 @@
 		FOR_ALL_VEHICLES(v) {
 			if (v->type != VEH_TRAIN && v->type != VEH_ROAD) continue;
 			if (IsBridgeTile(v->tile)) {
-				DiagDirection dir = GetBridgeRampDirection(v->tile);
+				DiagDirection dir = GetTunnelBridgeDirection(v->tile);
 
 				if (dir != DirToDiagDir(v->direction)) continue;
 				switch (dir) {
@@ -1792,14 +1834,8 @@
 					break;
 
 				case MP_TUNNELBRIDGE:
-					if (IsTunnel(t)) {
-						if (GetTunnelTransportType(t) == TRANSPORT_RAIL) {
-							SetRailType(t, UpdateRailType(GetRailType(t), min_rail));
-						}
-					} else {
-						if (GetBridgeTransportType(t) == TRANSPORT_RAIL) {
-							SetRailType(t, UpdateRailType(GetRailType(t), min_rail));
-						}
+					if (GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL) {
+						SetRailType(t, UpdateRailType(GetRailType(t), min_rail));
 					}
 					break;
 
@@ -1992,10 +2028,6 @@
 		}
 	}
 
-	if (CheckSavegameVersion(37)) {
-		ConvertNameArray();
-	}
-
 	/* from version 38 we have optional elrails, since we cannot know the
 	 * preference of a user, let elrails enabled; it can be disabled manually */
 	if (CheckSavegameVersion(38)) _patches.disable_elrails = false;
@@ -2039,8 +2071,8 @@
 		}
 	}
 
-	/* Count the buildings after updating the map array. */
-	AfterLoadCountBuildings();
+	/* Check that house ids are still valid. */
+	CheckHouseIDs();
 
 	if (CheckSavegameVersion(43)) {
 		for (TileIndex t = 0; t < map_size; t++) {
@@ -2251,6 +2283,20 @@
 		}
 	}
 
+	/*
+	 * Add the 'previous' owner to the ship depots so we can reset it with
+	 * the correct values when it gets destroyed. This prevents that
+	 * someone can remove canals owned by somebody else and it prevents
+	 * making floods using the removal of ship depots.
+	 */
+	if (CheckSavegameVersion(83)) {
+		for (TileIndex t = 0; t < map_size; t++) {
+			if (IsTileType(t, MP_WATER) && IsShipDepot(t)) {
+				_m[t].m4 = (TileHeight(t) == 0) ? OWNER_WATER : OWNER_NONE;
+			}
+		}
+	}
+
 	if (CheckSavegameVersion(74)) {
 		Station *st;
 		FOR_ALL_STATIONS(st) {
@@ -2288,6 +2334,42 @@
 		}
 	}
 
+	if (CheckSavegameVersion(84)) {
+		/* Update go to buoy orders because they are just waypoints */
+		Order *order;
+		FOR_ALL_ORDERS(order) {
+			if (order->type == OT_GOTO_STATION && GetStation(order->dest)->IsBuoy()) {
+				order->flags = 0;
+			}
+		}
+
+		/* Set all share owners to PLAYER_SPECTATOR for
+		 * 1) all inactive players
+		 *     (when inactive players were stored in the savegame - TTD, TTDP and some
+		 *      *really* old revisions of OTTD; else it is already set in InitializePlayers())
+		 * 2) shares that are owned by inactive players or self
+		 *     (caused by cheating players in earlier revisions) */
+		Player *p;
+		FOR_ALL_PLAYERS(p) {
+			if (!p->is_active) {
+				for (uint i = 0; i < 4; i++) { p->share_owners[i] = PLAYER_SPECTATOR; }
+			} else {
+				for (uint i = 0; i < 4; i++) {
+					PlayerID o = p->share_owners[i];
+					if (o == PLAYER_SPECTATOR) continue;
+					if (!IsValidPlayer(o) || o == p->index || !GetPlayer(o)->is_active) p->share_owners[i] = PLAYER_SPECTATOR;
+				}
+			}
+		}
+	}
+
+	if (CheckSavegameVersion(86)) {
+		/* Now all crossings should be in correct state */
+		for (TileIndex t = 0; t < map_size; t++) {
+			if (IsLevelCrossingTile(t)) UpdateLevelCrossing(t, false);
+		}
+	}
+
 	return InitializeWindowsAndCaches();
 }
 
@@ -2304,7 +2386,7 @@
 	LoadStringWidthTable();
 	/* reload vehicles */
 	ResetVehiclePosHash();
-	AfterLoadVehicles();
+	AfterLoadVehicles(false);
 	StartupEngines();
 	/* update station and waypoint graphics */
 	AfterLoadWaypoints();
--- a/src/openttd.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/openttd.h	Tue Jan 22 21:00:30 2008 +0000
@@ -8,60 +8,25 @@
 #define VARDEF extern
 #endif
 
-#include "helpers.hpp"
-
-struct Oblong {
-	int x, y;
-	int width, height;
-};
-
-struct BoundingRect {
-	int width;
-	int height;
-};
-
-struct Pair {
-	int a;
-	int b;
-};
-
-#include "map.h"
-#include "slope.h"
-
 // Forward declarations of structs.
-struct Vehicle;
 struct Depot;
 struct Waypoint;
-struct Window;
 struct Station;
 struct ViewPort;
-struct Town;
 struct NewsItem;
-struct Industry;
 struct DrawPixelInfo;
 struct Group;
 typedef byte VehicleOrderID;  ///< The index of an order within its current vehicle (not pool related)
-typedef byte CargoID;
 typedef byte LandscapeID;
-typedef uint32 SpriteID;      ///< The number of a sprite, without mapping bits and colortables
-struct PalSpriteID {
-	SpriteID sprite;
-	SpriteID pal;
-};
 typedef uint16 EngineID;
 typedef uint16 UnitID;
-typedef uint16 StringID;
-static const StringID INVALID_STRING_ID = 0xFFFF;
 
 typedef EngineID *EngineList; ///< engine list type placeholder acceptable for C code (see helpers.cpp)
 
 /* IDs used in Pools */
-typedef uint16 VehicleID;
 typedef uint16 StationID;
 static const StationID INVALID_STATION = 0xFFFF;
 typedef uint16 RoadStopID;
-typedef uint16 TownID;
-typedef uint16 IndustryID;
 typedef uint16 DepotID;
 typedef uint16 WaypointID;
 typedef uint16 OrderID;
@@ -70,28 +35,19 @@
 typedef uint16 EngineRenewID;
 typedef uint16 DestinationID;
 
-typedef OverflowSafeInt<int64, INT64_MAX, INT64_MIN> OverflowSafeInt64;
-typedef OverflowSafeInt64 Money;
-
 /* DestinationID must be at least as large as every these below, because it can
  * be any of them
  */
-assert_compile(sizeof(DestinationID) == sizeof(DepotID));
-assert_compile(sizeof(DestinationID) == sizeof(WaypointID));
-assert_compile(sizeof(DestinationID) == sizeof(StationID));
-
-typedef int32 WindowNumber;
+assert_compile(sizeof(DestinationID) >= sizeof(DepotID));
+assert_compile(sizeof(DestinationID) >= sizeof(WaypointID));
+assert_compile(sizeof(DestinationID) >= sizeof(StationID));
 
-enum {
-	INVALID_YEAR = -1,
-	INVALID_DATE = -1,
+enum GameModes {
+	GM_MENU,
+	GM_NORMAL,
+	GM_EDITOR
 };
 
-typedef int32 Year;
-typedef int32 Date;
-
-typedef uint32 PlayerFace; ///< player face bits, info see in player_face.h
-
 enum SwitchModes {
 	SM_NONE            =  0,
 	SM_NEWGAME         =  1,
@@ -121,33 +77,6 @@
 	IG_DATE_RESET = 1,  /* Reset the date when initializing a game */
 };
 
-enum Owner {
-	PLAYER_INACTIVE_CLIENT = 253,
-	PLAYER_NEW_COMPANY = 254,
-	PLAYER_SPECTATOR = 255,
-	OWNER_BEGIN     = 0x00,
-	PLAYER_FIRST    = 0x00,
-	MAX_PLAYERS     = 8,
-	OWNER_TOWN      = 0x0F, // a town owns the tile
-	OWNER_NONE      = 0x10, // nobody owns the tile
-	OWNER_WATER     = 0x11, // "water" owns the tile
-	OWNER_END       = 0x12,
-	INVALID_OWNER   = 0xFF,
-	INVALID_PLAYER  = 0xFF,
-	/* Player identifiers All players below MAX_PLAYERS are playable
-	* players, above, they are special, computer controlled players */
-};
-
-typedef Owner PlayerID;
-
-DECLARE_POSTFIX_INCREMENT(Owner);
-
-/** Define basic enum properties */
-template <> struct EnumPropsT<Owner> : MakeEnumPropsT<Owner, byte, OWNER_BEGIN, OWNER_END, INVALID_OWNER> {};
-typedef TinyEnumT<Owner> OwnerByte;
-typedef OwnerByte PlayerByte;
-
-
 enum TransportType {
 	/* These constants are for now linked to the representation of bridges
 	 * and tunnels, so they can be used by GetTileTrackStatus_TunnelBridge.
@@ -163,20 +92,6 @@
 	INVALID_TRANSPORT = 0xff,
 };
 
-/** Define basic enum properties */
-template <> struct EnumPropsT<TransportType> : MakeEnumPropsT<TransportType, byte, TRANSPORT_BEGIN, TRANSPORT_END, INVALID_TRANSPORT> {};
-typedef TinyEnumT<TransportType> TransportTypeByte;
-
-
-struct TileInfo {
-	uint x;
-	uint y;
-	Slope tileh;
-	TileIndex tile;
-	uint z;
-};
-
-
 /* Display Options */
 enum {
 	DO_SHOW_TOWN_NAMES    = 0,
@@ -197,476 +112,12 @@
 	NUM_LANDSCAPE = 4,
 };
 
-/**
- * Town Layouts
- */
-enum TownLayout {
-	TL_NO_ROADS     = 0, ///< Build no more roads, but still build houses
-	TL_ORIGINAL,         ///< Original algorithm (min. 1 distance between roads)
-	TL_BETTER_ROADS,     ///< Extended original algorithm (min. 2 distance between roads)
-	TL_2X2_GRID,         ///< Geometric 2x2 grid algorithm
-	TL_3X3_GRID,         ///< Geometric 3x3 grid algorithm
-
-	NUM_TLS,             ///< Number of town layouts
-};
-
-/* It needs to be 8bits, because we save and load it as such */
-/** Define basic enum properties */
-template <> struct EnumPropsT<TownLayout> : MakeEnumPropsT<TownLayout, byte, TL_NO_ROADS, NUM_TLS, NUM_TLS> {};
-typedef TinyEnumT<TownLayout> TownLayoutByte; //typedefing-enumification of TownLayout
-
-enum {
-	NUM_PRICES = 49,
-};
-
-struct Prices {
-	Money station_value;
-	Money build_rail;
-	Money build_road;
-	Money build_signals;
-	Money build_bridge;
-	Money build_train_depot;
-	Money build_road_depot;
-	Money build_ship_depot;
-	Money build_tunnel;
-	Money train_station_track;
-	Money train_station_length;
-	Money build_airport;
-	Money build_bus_station;
-	Money build_truck_station;
-	Money build_dock;
-	Money build_railvehicle;
-	Money build_railwagon;
-	Money aircraft_base;
-	Money roadveh_base;
-	Money ship_base;
-	Money build_trees;
-	Money terraform;
-	Money clear_grass;
-	Money clear_roughland;
-	Money clear_rocks;
-	Money clear_fields;
-	Money remove_trees;
-	Money remove_rail;
-	Money remove_signals;
-	Money clear_bridge;
-	Money remove_train_depot;
-	Money remove_road_depot;
-	Money remove_ship_depot;
-	Money clear_tunnel;
-	Money clear_water;
-	Money remove_rail_station;
-	Money remove_airport;
-	Money remove_bus_station;
-	Money remove_truck_station;
-	Money remove_dock;
-	Money remove_house;
-	Money remove_road;
-	Money running_rail[3];
-	Money aircraft_running;
-	Money roadveh_running;
-	Money ship_running;
-	Money build_industry;
-};
-
-#define GAME_DIFFICULTY_NUM 18
-
-/** Specific type for Game Difficulty to ease changing the type */
-typedef uint16 GDType;
-struct GameDifficulty {
-	GDType max_no_competitors;
-	GDType competitor_start_time;
-	GDType number_towns;
-	GDType number_industries;
-	GDType max_loan;
-	GDType initial_interest;
-	GDType vehicle_costs;
-	GDType competitor_speed;
-	GDType competitor_intelligence; // no longer in use
-	GDType vehicle_breakdowns;
-	GDType subsidy_multiplier;
-	GDType construction_cost;
-	GDType terrain_type;
-	GDType quantity_sea_lakes;
-	GDType economy;
-	GDType line_reverse_mode;
-	GDType disasters;
-	GDType town_council_tolerance; // minimum required town ratings to be allowed to demolish stuff
-};
-
-enum {
-	// Temperate
-	CT_PASSENGERS   =  0,
-	CT_COAL         =  1,
-	CT_MAIL         =  2,
-	CT_OIL          =  3,
-	CT_LIVESTOCK    =  4,
-	CT_GOODS        =  5,
-	CT_GRAIN        =  6,
-	CT_WOOD         =  7,
-	CT_IRON_ORE     =  8,
-	CT_STEEL        =  9,
-	CT_VALUABLES    = 10,
-
-	// Arctic
-	CT_WHEAT        =  6,
-	CT_HILLY_UNUSED =  8,
-	CT_PAPER        =  9,
-	CT_GOLD         = 10,
-	CT_FOOD         = 11,
-
-	// Tropic
-	CT_RUBBER       =  1,
-	CT_FRUIT        =  4,
-	CT_MAIZE        =  6,
-	CT_COPPER_ORE   =  8,
-	CT_WATER        =  9,
-	CT_DIAMONDS     = 10,
-
-	// Toyland
-	CT_SUGAR        =  1,
-	CT_TOYS         =  3,
-	CT_BATTERIES    =  4,
-	CT_CANDY        =  5,
-	CT_TOFFEE       =  6,
-	CT_COLA         =  7,
-	CT_COTTON_CANDY =  8,
-	CT_BUBBLES      =  9,
-	CT_PLASTIC      = 10,
-	CT_FIZZY_DRINKS = 11,
-
-	NUM_CARGO       = 32,
-
-	CT_NO_REFIT     = 0xFE,
-	CT_INVALID      = 0xFF
-};
-
-typedef uint AcceptedCargo[NUM_CARGO];
-
-struct TileDesc {
-	StringID str;
-	Owner owner;
-	Date build_date;
-	uint64 dparam[2];
-};
-
 struct ViewportSign {
 	int32 left;
 	int32 top;
 	byte width_1, width_2;
 };
 
-/**
- * Common return value for all commands. Wraps the cost and
- * a possible error message/state together.
- */
-class CommandCost {
-	Money cost;       ///< The cost of this action
-	StringID message; ///< Warning message for when success is unset
-	bool success;     ///< Whether the comment went fine up to this moment
-
-public:
-	/**
-	 * Creates a command cost return with no cost and no error
-	 */
-	CommandCost() : cost(0), message(INVALID_STRING_ID), success(true) {}
-
-	/**
-	 * Creates a command return value the is failed with the given message
-	 */
-	CommandCost(StringID msg) : cost(0), message(msg), success(false) {}
-
-	/**
-	 * Creates a command return value with the given start cost
-	 * @param cst the initial cost of this command
-	 */
-	CommandCost(Money cst) : cost(cst), message(INVALID_STRING_ID), success(true) {}
-
-	/**
-	 * Adds the cost of the given command return value to this cost.
-	 * Also takes a possible error message when it is set.
-	 * @param ret the command to add the cost of.
-	 * @return this class.
-	 */
-	CommandCost AddCost(CommandCost ret);
-
-	/**
-	 * Adds the given cost to the cost of the command.
-	 * @param cost the cost to add
-	 * @return this class.
-	 */
-	CommandCost AddCost(Money cost);
-
-	/**
-	 * Multiplies the cost of the command by the given factor.
-	 * @param cost factor to multiply the costs with
-	 * @return this class
-	 */
-	CommandCost MultiplyCost(int factor);
-
-	/**
-	 * The costs as made up to this moment
-	 * @return the costs
-	 */
-	Money GetCost() const;
-
-	/**
-	 * Sets the global error message *if* this class has one.
-	 */
-	void SetGlobalErrorMessage() const;
-
-	/**
-	 * Did this command succeed?
-	 * @return true if and only if it succeeded
-	 */
-	bool Succeeded() const;
-
-	/**
-	 * Did this command fail?
-	 * @return true if and only if it failed
-	 */
-	bool Failed() const;
-};
-
-
-typedef void DrawTileProc(TileInfo *ti);
-typedef uint GetSlopeZProc(TileIndex tile, uint x, uint y);
-typedef CommandCost ClearTileProc(TileIndex tile, byte flags);
-typedef void GetAcceptedCargoProc(TileIndex tile, AcceptedCargo res);
-typedef void GetTileDescProc(TileIndex tile, TileDesc *td);
-/**
- * GetTileTrackStatusProcs return a value that contains the possible tracks
- * that can be taken on a given tile by a given transport. The return value is
- * composed as follows: 0xaabbccdd. ccdd and aabb are bitmasks of trackdirs,
- * where bit n corresponds to trackdir n. ccdd are the trackdirs that are
- * present in the tile (1==present, 0==not present), aabb is the signal
- * status, if applicable (0==green/no signal, 1==red, note that this is
- * reversed from map3/2[tile] for railway signals).
- *
- * The result (let's call it ts) is often used as follows:
- * tracks = (byte)(ts | ts >>8)
- * This effectively converts the present part of the result (ccdd) to a
- * track bitmask, which disregards directions. Normally, this is the same as just
- * doing (byte)ts I think, although I am not really sure
- *
- * A trackdir is combination of a track and a dir, where the lower three bits
- * are a track, the fourth bit is the direction. these give 12 (or 14)
- * possible options: 0-5 and 8-13, so we need 14 bits for a trackdir bitmask
- * above.
- * @param tile     the tile to get the track status from
- * @param mode     the mode of transportation
- * @param sub_mode used to differentiate between different kinds within the mode
- * @return the above mentions track status information
- */
-typedef uint32 GetTileTrackStatusProc(TileIndex tile, TransportType mode, uint sub_mode);
-typedef void GetProducedCargoProc(TileIndex tile, CargoID *b);
-typedef void ClickTileProc(TileIndex tile);
-typedef void AnimateTileProc(TileIndex tile);
-typedef void TileLoopProc(TileIndex tile);
-typedef void ChangeTileOwnerProc(TileIndex tile, PlayerID old_player, PlayerID new_player);
-/** @see VehicleEnterTileStatus to see what the return values mean */
-typedef uint32 VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y);
-typedef Foundation GetFoundationProc(TileIndex tile, Slope tileh);
-/**
- * Called when a tile is affected by a terraforming operation.
- * The function has to check if terraforming of the tile is allowed and return extra terraform-cost that depend on the tiletype.
- * With DC_EXEC in flags it has to perform tiletype-specific actions (like clearing land etc., but not the terraforming itself).
- *
- * @note The terraforming has not yet taken place. So GetTileZ() and GetTileSlope() refer to the landscape before the terraforming operation.
- *
- * @param tile      The involved tile.
- * @param flags     Command flags passed to the terraform command (DC_EXEC, DC_QUERY_COST, etc.).
- * @param z_new     TileZ after terraforming.
- * @param tileh_new Slope after terraforming.
- * @return Error code or extra cost for terraforming (like clearing land, building foundations, etc., but not the terraforming itself.)
- */
-typedef CommandCost TerraformTileProc(TileIndex tile, uint32 flags, uint z_new, Slope tileh_new);
-
-struct TileTypeProcs {
-	DrawTileProc *draw_tile_proc;
-	GetSlopeZProc *get_slope_z_proc;
-	ClearTileProc *clear_tile_proc;
-	GetAcceptedCargoProc *get_accepted_cargo_proc;
-	GetTileDescProc *get_tile_desc_proc;
-	GetTileTrackStatusProc *get_tile_track_status_proc;
-	ClickTileProc *click_tile_proc;
-	AnimateTileProc *animate_tile_proc;
-	TileLoopProc *tile_loop_proc;
-	ChangeTileOwnerProc *change_tile_owner_proc;
-	GetProducedCargoProc *get_produced_cargo_proc;
-	VehicleEnterTileProc *vehicle_enter_tile_proc;
-	GetFoundationProc *get_foundation_proc;
-	TerraformTileProc *terraform_tile_proc;
-};
-
-
-enum WindowClass {
-	WC_NONE,
-	WC_MAIN_WINDOW = WC_NONE,
-	WC_MAIN_TOOLBAR,
-	WC_STATUS_BAR,
-	WC_BUILD_TOOLBAR,
-	WC_NEWS_WINDOW,
-	WC_TOWN_DIRECTORY,
-	WC_STATION_LIST,
-	WC_TOWN_VIEW,
-	WC_SMALLMAP,
-	WC_TRAINS_LIST,
-	WC_ROADVEH_LIST,
-	WC_SHIPS_LIST,
-	WC_AIRCRAFT_LIST,
-	WC_VEHICLE_VIEW,
-	WC_VEHICLE_DETAILS,
-	WC_VEHICLE_REFIT,
-	WC_VEHICLE_ORDERS,
-	WC_STATION_VIEW,
-	WC_VEHICLE_DEPOT,
-	WC_BUILD_VEHICLE,
-	WC_BUILD_BRIDGE,
-	WC_ERRMSG,
-	WC_BUILD_STATION,
-	WC_BUS_STATION,
-	WC_TRUCK_STATION,
-	WC_BUILD_DEPOT,
-	WC_COMPANY,
-	WC_FINANCES,
-	WC_PLAYER_COLOR,
-	WC_QUERY_STRING,
-	WC_SAVELOAD,
-	WC_SELECT_GAME,
-	WC_TOOLBAR_MENU,
-	WC_INCOME_GRAPH,
-	WC_OPERATING_PROFIT,
-	WC_TOOLTIPS,
-	WC_INDUSTRY_VIEW,
-	WC_PLAYER_FACE,
-	WC_LAND_INFO,
-	WC_TOWN_AUTHORITY,
-	WC_SUBSIDIES_LIST,
-	WC_GRAPH_LEGEND,
-	WC_DELIVERED_CARGO,
-	WC_PERFORMANCE_HISTORY,
-	WC_COMPANY_VALUE,
-	WC_COMPANY_LEAGUE,
-	WC_BUY_COMPANY,
-	WC_PAYMENT_RATES,
-	WC_ENGINE_PREVIEW,
-	WC_MUSIC_WINDOW,
-	WC_MUSIC_TRACK_SELECTION,
-	WC_SCEN_LAND_GEN,
-	WC_SCEN_TOWN_GEN,
-	WC_SCEN_INDUSTRY,
-	WC_SCEN_BUILD_ROAD,
-	WC_BUILD_TREES,
-	WC_SEND_NETWORK_MSG,
-	WC_DROPDOWN_MENU,
-	WC_BUILD_INDUSTRY,
-	WC_GAME_OPTIONS,
-	WC_NETWORK_WINDOW,
-	WC_INDUSTRY_DIRECTORY,
-	WC_MESSAGE_HISTORY,
-	WC_CHEATS,
-	WC_PERFORMANCE_DETAIL,
-	WC_CONSOLE,
-	WC_EXTRA_VIEW_PORT,
-	WC_CLIENT_LIST,
-	WC_NETWORK_STATUS_WINDOW,
-	WC_CUSTOM_CURRENCY,
-	WC_REPLACE_VEHICLE,
-	WC_HIGHSCORE,
-	WC_ENDSCREEN,
-	WC_SIGN_LIST,
-	WC_GENERATE_LANDSCAPE,
-	WC_GENERATE_PROGRESS_WINDOW,
-	WC_CONFIRM_POPUP_QUERY,
-	WC_TRANSPARENCY_TOOLBAR,
-	WC_VEHICLE_TIMETABLE,
-	WC_BUILD_SIGNAL,
-	WC_COMPANY_PASSWORD_WINDOW,
-};
-
-
-enum ExpensesType {
-	EXPENSES_CONSTRUCTION =  0,
-	EXPENSES_NEW_VEHICLES =  1,
-	EXPENSES_TRAIN_RUN    =  2,
-	EXPENSES_ROADVEH_RUN  =  3,
-	EXPENSES_AIRCRAFT_RUN =  4,
-	EXPENSES_SHIP_RUN     =  5,
-	EXPENSES_PROPERTY     =  6,
-	EXPENSES_TRAIN_INC    =  7,
-	EXPENSES_ROADVEH_INC  =  8,
-	EXPENSES_AIRCRAFT_INC =  9,
-	EXPENSES_SHIP_INC     = 10,
-	EXPENSES_LOAN_INT     = 11,
-	EXPENSES_OTHER        = 12,
-};
-
-enum {
-	MAX_LANG = 64,
-};
-
-// special string constants
-enum SpecialStrings {
-
-	// special strings for town names. the town name is generated dynamically on request.
-	SPECSTR_TOWNNAME_START     = 0x20C0,
-	SPECSTR_TOWNNAME_ENGLISH   = SPECSTR_TOWNNAME_START,
-	SPECSTR_TOWNNAME_FRENCH,
-	SPECSTR_TOWNNAME_GERMAN,
-	SPECSTR_TOWNNAME_AMERICAN,
-	SPECSTR_TOWNNAME_LATIN,
-	SPECSTR_TOWNNAME_SILLY,
-	SPECSTR_TOWNNAME_SWEDISH,
-	SPECSTR_TOWNNAME_DUTCH,
-	SPECSTR_TOWNNAME_FINNISH,
-	SPECSTR_TOWNNAME_POLISH,
-	SPECSTR_TOWNNAME_SLOVAKISH,
-	SPECSTR_TOWNNAME_NORWEGIAN,
-	SPECSTR_TOWNNAME_HUNGARIAN,
-	SPECSTR_TOWNNAME_AUSTRIAN,
-	SPECSTR_TOWNNAME_ROMANIAN,
-	SPECSTR_TOWNNAME_CZECH,
-	SPECSTR_TOWNNAME_SWISS,
-	SPECSTR_TOWNNAME_DANISH,
-	SPECSTR_TOWNNAME_TURKISH,
-	SPECSTR_TOWNNAME_ITALIAN,
-	SPECSTR_TOWNNAME_CATALAN,
-	SPECSTR_TOWNNAME_LAST      = SPECSTR_TOWNNAME_CATALAN,
-
-	// special strings for player names on the form "TownName transport".
-	SPECSTR_PLAYERNAME_START   = 0x70EA,
-	SPECSTR_PLAYERNAME_ENGLISH = SPECSTR_PLAYERNAME_START,
-	SPECSTR_PLAYERNAME_FRENCH,
-	SPECSTR_PLAYERNAME_GERMAN,
-	SPECSTR_PLAYERNAME_AMERICAN,
-	SPECSTR_PLAYERNAME_LATIN,
-	SPECSTR_PLAYERNAME_SILLY,
-	SPECSTR_PLAYERNAME_LAST    = SPECSTR_PLAYERNAME_SILLY,
-
-	SPECSTR_ANDCO_NAME         = 0x70E6,
-	SPECSTR_PRESIDENT_NAME     = 0x70E7,
-	SPECSTR_SONGNAME           = 0x70E8,
-
-	// reserve MAX_LANG strings for the *.lng files
-	SPECSTR_LANGUAGE_START     = 0x7100,
-	SPECSTR_LANGUAGE_END       = SPECSTR_LANGUAGE_START + MAX_LANG - 1,
-
-	// reserve 32 strings for various screen resolutions
-	SPECSTR_RESOLUTION_START   = SPECSTR_LANGUAGE_END + 1,
-	SPECSTR_RESOLUTION_END     = SPECSTR_RESOLUTION_START + 0x1F,
-
-	// reserve 32 strings for screenshot formats
-	SPECSTR_SCREENSHOT_START   = SPECSTR_RESOLUTION_END + 1,
-	SPECSTR_SCREENSHOT_END     = SPECSTR_SCREENSHOT_START + 0x1F,
-
-	// Used to implement SetDParamStr
-	STR_SPEC_DYNSTRING         = 0xF800,
-	STR_SPEC_USERSTRING        = 0xF808,
-};
-
-typedef void PlaceProc(TileIndex tile);
-
 enum {
 	SORT_ASCENDING  = 0,
 	SORT_DESCENDING = 1,
@@ -674,7 +125,7 @@
 	SORT_BY_NAME    = 2
 };
 
-VARDEF byte _savegame_sort_order;
+extern byte _savegame_sort_order;
 
 enum {
 	MAX_SCREEN_WIDTH  = 2048,
@@ -690,7 +141,7 @@
 	SCROLL_SAVE = 2,
 	SCROLL_CHAT = 4,
 };
-VARDEF byte _no_scroll;
+extern byte _no_scroll;
 
 /** To have a concurrently running thread interface with the main program, use
  * the OTTD_SendThreadMessage() function. Actions to perform upon the message are handled
@@ -703,4 +154,8 @@
 
 void OTTD_SendThreadMessage(ThreadMsg msg);
 
+extern byte _game_mode;
+extern bool _exit_game;
+extern byte _pause_game;
+
 #endif /* OPENTTD_H */
--- a/src/order.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/order.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,8 +5,12 @@
 #ifndef ORDER_H
 #define ORDER_H
 
-#include "macros.h"
 #include "oldpool.h"
+#include "core/bitmath_func.hpp"
+#include "cargo_type.h"
+#include "vehicle_type.h"
+#include "tile_type.h"
+#include "date_type.h"
 
 enum {
 	INVALID_VEH_ORDER_ID = 0xFF,
@@ -33,32 +37,32 @@
 typedef TinyEnumT<OrderType> OrderTypeByte;
 
 
-/* Order flags -- please use OFB instead OF and use HASBIT/SETBIT/CLEARBIT */
+/* Order flags -- please use OF instead OF and use HASBIT/SETBIT/CLEARBIT */
 
 /** Order flag masks - these are for direct bit operations */
 enum OrderFlagMasks {
 	//Flags for stations:
 	/** vehicle will transfer cargo (i. e. not deliver to nearby industry/town even if accepted there) */
-	OF_TRANSFER           = 0x1,
-	/** If OF_TRANSFER is not set, drop any cargo loaded. If accepted, deliver, otherwise cargo remains at the station.
+	OFB_TRANSFER           = 0x1,
+	/** If OFB_TRANSFER is not set, drop any cargo loaded. If accepted, deliver, otherwise cargo remains at the station.
       * No new cargo is loaded onto the vehicle whatsoever */
-	OF_UNLOAD             = 0x2,
+	OFB_UNLOAD             = 0x2,
 	/** Wait for full load of all vehicles, or of at least one cargo type, depending on patch setting
 	  * @todo make this two different flags */
-	OF_FULL_LOAD          = 0x4,
+	OFB_FULL_LOAD          = 0x4,
 
 	//Flags for depots:
 	/** The current depot-order was initiated because it was in the vehicle's order list */
-	OF_PART_OF_ORDERS     = 0x2,
-	/** if OF_PART_OF_ORDERS is not set, this will cause the vehicle to be stopped in the depot */
-	OF_HALT_IN_DEPOT      = 0x4,
-	/** if OF_PART_OF_ORDERS is set, this will cause the order only be come active if the vehicle needs servicing */
-	OF_SERVICE_IF_NEEDED  = 0x4, //used when OF_PART_OF_ORDERS is set.
+	OFB_PART_OF_ORDERS     = 0x2,
+	/** if OFB_PART_OF_ORDERS is not set, this will cause the vehicle to be stopped in the depot */
+	OFB_HALT_IN_DEPOT      = 0x4,
+	/** if OFB_PART_OF_ORDERS is set, this will cause the order only be come active if the vehicle needs servicing */
+	OFB_SERVICE_IF_NEEDED  = 0x4, //used when OFB_PART_OF_ORDERS is set.
 
 	//Common flags
 	/** This causes the vehicle not to stop at intermediate OR the destination station (depending on patch settings)
 	  * @todo make this two different flags */
-	OF_NON_STOP           = 0x8
+	OFB_NON_STOP           = 0x8
 };
 
 /** Order flags bits - these are for the *BIT macros
@@ -66,13 +70,13 @@
  * @see OrderFlagMasks
  */
 enum {
-	OFB_TRANSFER          = 0,
-	OFB_UNLOAD            = 1,
-	OFB_FULL_LOAD         = 2,
-	OFB_PART_OF_ORDERS    = 1,
-	OFB_HALT_IN_DEPOT     = 2,
-	OFB_SERVICE_IF_NEEDED = 2,
-	OFB_NON_STOP          = 3
+	OF_TRANSFER          = 0,
+	OF_UNLOAD            = 1,
+	OF_FULL_LOAD         = 2,
+	OF_PART_OF_ORDERS    = 1,
+	OF_HALT_IN_DEPOT     = 2,
+	OF_SERVICE_IF_NEEDED = 2,
+	OF_NON_STOP          = 3
 };
 
 
@@ -117,17 +121,18 @@
 };
 
 struct BackuppedOrders {
-	BackuppedOrders() : order(NULL) { }
+	BackuppedOrders() : order(NULL), name(NULL) { }
+	~BackuppedOrders() { free(order); free(name); }
 
 	VehicleID clone;
 	VehicleOrderID orderindex;
 	Order *order;
 	uint16 service_interval;
-	char name[32];
+	char *name;
 };
 
-VARDEF TileIndex _backup_orders_tile;
-VARDEF BackuppedOrders _backup_orders_data;
+extern TileIndex _backup_orders_tile;
+extern BackuppedOrders _backup_orders_data;
 
 static inline VehicleOrderID GetMaxOrderIndex()
 {
@@ -213,4 +218,18 @@
 
 Order UnpackOldOrder(uint16 packed);
 
+#define MIN_SERVINT_PERCENT  5
+#define MAX_SERVINT_PERCENT 90
+#define MIN_SERVINT_DAYS    30
+#define MAX_SERVINT_DAYS   800
+
+/**
+ * Get the service interval domain.
+ * Get the new proposed service interval for the vehicle is indeed, clamped
+ * within the given bounds. @see MIN_SERVINT_PERCENT ,etc.
+ * @param index proposed service interval
+ * @return service interval
+ */
+Date GetServiceIntervalClamped(uint index);
+
 #endif /* ORDER_H */
--- a/src/order_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/order_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,20 +6,27 @@
 #include "openttd.h"
 #include "order.h"
 #include "airport.h"
-#include "vehicle.h"
 #include "depot.h"
-#include "functions.h"
-#include "table/strings.h"
 #include "waypoint.h"
-#include "command.h"
+#include "command_func.h"
 #include "station.h"
-#include "player.h"
+#include "player_func.h"
 #include "news.h"
 #include "saveload.h"
 #include "vehicle_gui.h"
 #include "cargotype.h"
-#include "strings.h"
 #include "aircraft.h"
+#include "strings_func.h"
+#include "core/alloc_func.hpp"
+#include "functions.h"
+#include "window_func.h"
+#include "settings_type.h"
+#include "string_func.h"
+
+#include "table/strings.h"
+
+TileIndex _backup_orders_tile;
+BackuppedOrders _backup_orders_data;
 
 DEFINE_OLD_POOL_GENERIC(Order, Order)
 
@@ -212,19 +219,19 @@
 			 * non-stop orders (if any) are only valid for trains */
 			switch (new_order.flags) {
 				case 0:
-				case OF_FULL_LOAD:
-				case OF_FULL_LOAD | OF_TRANSFER:
-				case OF_UNLOAD:
-				case OF_UNLOAD | OF_TRANSFER:
-				case OF_TRANSFER:
+				case OFB_FULL_LOAD:
+				case OFB_FULL_LOAD | OFB_TRANSFER:
+				case OFB_UNLOAD:
+				case OFB_UNLOAD | OFB_TRANSFER:
+				case OFB_TRANSFER:
 					break;
 
-				case OF_NON_STOP:
-				case OF_NON_STOP | OF_FULL_LOAD:
-				case OF_NON_STOP | OF_FULL_LOAD | OF_TRANSFER:
-				case OF_NON_STOP | OF_UNLOAD:
-				case OF_NON_STOP | OF_UNLOAD | OF_TRANSFER:
-				case OF_NON_STOP | OF_TRANSFER:
+				case OFB_NON_STOP:
+				case OFB_NON_STOP | OFB_FULL_LOAD:
+				case OFB_NON_STOP | OFB_FULL_LOAD | OFB_TRANSFER:
+				case OFB_NON_STOP | OFB_UNLOAD:
+				case OFB_NON_STOP | OFB_UNLOAD | OFB_TRANSFER:
+				case OFB_NON_STOP | OFB_TRANSFER:
 					if (v->type != VEH_TRAIN) return CMD_ERROR;
 					break;
 
@@ -275,12 +282,12 @@
 			 * order [+ halt] [+ non-stop]
 			 * non-stop orders (if any) are only valid for trains */
 			switch (new_order.flags) {
-				case OF_PART_OF_ORDERS:
-				case OF_PART_OF_ORDERS | OF_HALT_IN_DEPOT:
+				case OFB_PART_OF_ORDERS:
+				case OFB_PART_OF_ORDERS | OFB_HALT_IN_DEPOT:
 					break;
 
-				case OF_NON_STOP | OF_PART_OF_ORDERS:
-				case OF_NON_STOP | OF_PART_OF_ORDERS | OF_HALT_IN_DEPOT:
+				case OFB_NON_STOP | OFB_PART_OF_ORDERS:
+				case OFB_NON_STOP | OFB_PART_OF_ORDERS | OFB_HALT_IN_DEPOT:
 					if (v->type != VEH_TRAIN) return CMD_ERROR;
 					break;
 
@@ -305,7 +312,7 @@
 			switch (new_order.flags) {
 				case 0: break;
 
-				case OF_NON_STOP:
+				case OFB_NON_STOP:
 					if (v->type != VEH_TRAIN) return CMD_ERROR;
 					break;
 
@@ -507,7 +514,7 @@
 			/* NON-stop flag is misused to see if a train is in a station that is
 			 * on his order list or not */
 			if (sel_ord == u->cur_order_index && u->current_order.type == OT_LOADING &&
-					HasBit(u->current_order.flags, OFB_NON_STOP)) {
+					HasBit(u->current_order.flags, OF_NON_STOP)) {
 				u->current_order.flags = 0;
 			}
 
@@ -549,7 +556,7 @@
 			v->LeaveStation();
 			/* NON-stop flag is misused to see if a train is in a station that is
 			 * on his order list or not */
-			if (HasBit(v->current_order.flags, OFB_NON_STOP)) v->current_order.flags = 0;
+			if (HasBit(v->current_order.flags, OF_NON_STOP)) v->current_order.flags = 0;
 		}
 
 		InvalidateVehicleOrder(v);
@@ -666,7 +673,7 @@
 	VehicleID veh   = GB(p1,  0, 16);
 
 	if (!IsValidVehicleID(veh)) return CMD_ERROR;
-	if (p2 != OFB_FULL_LOAD && p2 != OFB_UNLOAD && p2 != OFB_NON_STOP && p2 != OFB_TRANSFER) return CMD_ERROR;
+	if (p2 != OF_FULL_LOAD && p2 != OF_UNLOAD && p2 != OF_NON_STOP && p2 != OF_TRANSFER) return CMD_ERROR;
 
 	v = GetVehicle(veh);
 
@@ -676,27 +683,27 @@
 	if (sel_ord >= v->num_orders) return CMD_ERROR;
 
 	order = GetVehicleOrder(v, sel_ord);
-	if (order->type != OT_GOTO_STATION &&
-			(order->type != OT_GOTO_DEPOT    || p2 == OFB_UNLOAD) &&
-			(order->type != OT_GOTO_WAYPOINT || p2 != OFB_NON_STOP)) {
+	if ((order->type != OT_GOTO_STATION  || GetStation(order->dest)->IsBuoy()) &&
+			(order->type != OT_GOTO_DEPOT    || p2 == OF_UNLOAD) &&
+			(order->type != OT_GOTO_WAYPOINT || p2 != OF_NON_STOP)) {
 		return CMD_ERROR;
 	}
 
 	if (flags & DC_EXEC) {
 		switch (p2) {
-		case OFB_FULL_LOAD:
-			ToggleBit(order->flags, OFB_FULL_LOAD);
-			if (order->type != OT_GOTO_DEPOT) ClrBit(order->flags, OFB_UNLOAD);
+		case OF_FULL_LOAD:
+			ToggleBit(order->flags, OF_FULL_LOAD);
+			if (order->type != OT_GOTO_DEPOT) ClrBit(order->flags, OF_UNLOAD);
 			break;
-		case OFB_UNLOAD:
-			ToggleBit(order->flags, OFB_UNLOAD);
-			ClrBit(order->flags, OFB_FULL_LOAD);
+		case OF_UNLOAD:
+			ToggleBit(order->flags, OF_UNLOAD);
+			ClrBit(order->flags, OF_FULL_LOAD);
 			break;
-		case OFB_NON_STOP:
-			ToggleBit(order->flags, OFB_NON_STOP);
+		case OF_NON_STOP:
+			ToggleBit(order->flags, OF_NON_STOP);
 			break;
-		case OFB_TRANSFER:
-			ToggleBit(order->flags, OFB_TRANSFER);
+		case OF_TRANSFER:
+			ToggleBit(order->flags, OF_TRANSFER);
 			break;
 		default: NOT_REACHED();
 		}
@@ -719,8 +726,8 @@
 				 */
 				if (sel_ord == u->cur_order_index &&
 						u->current_order.type != OT_GOTO_DEPOT &&
-						HasBit(u->current_order.flags, OFB_FULL_LOAD) != HasBit(order->flags, OFB_FULL_LOAD)) {
-					ToggleBit(u->current_order.flags, OFB_FULL_LOAD);
+						HasBit(u->current_order.flags, OF_FULL_LOAD) != HasBit(order->flags, OF_FULL_LOAD)) {
+					ToggleBit(u->current_order.flags, OF_FULL_LOAD);
 				}
 				InvalidateVehicleOrder(u);
 			}
@@ -902,7 +909,7 @@
 			InvalidateVehicleOrder(u);
 
 			/* If the vehicle already got the current depot set as current order, then update current order as well */
-			if (u->cur_order_index == order_number && HasBit(u->current_order.flags, OFB_PART_OF_ORDERS)) {
+			if (u->cur_order_index == order_number && HasBit(u->current_order.flags, OF_PART_OF_ORDERS)) {
 				u->current_order.refit_cargo = cargo;
 				u->current_order.refit_subtype = subtype;
 			}
@@ -923,18 +930,13 @@
 	/* Make sure we always have freed the stuff */
 	free(bak->order);
 	bak->order = NULL;
+	free(bak->name);
+	bak->name = NULL;
 
 	/* Save general info */
 	bak->orderindex       = v->cur_order_index;
 	bak->service_interval = v->service_interval;
-
-	/* Safe custom string, if any */
-	if (!IsCustomName(v->string_id)) {
-		bak->name[0] = '\0';
-	} else {
-		SetDParam(0, v->index);
-		GetString(bak->name, STR_VEHICLE_NAME, lastof(bak->name));
-	}
+	if (v->name != NULL) bak->name = strdup(v->name);
 
 	/* If we have shared orders, store it on a special way */
 	if (IsOrderListShared(v)) {
@@ -976,14 +978,14 @@
 void RestoreVehicleOrders(const Vehicle *v, const BackuppedOrders *bak)
 {
 	/* If we have a custom name, process that */
-	if (!StrEmpty(bak->name)) {
+	if (bak->name != NULL) {
 		_cmd_text = bak->name;
 		DoCommandP(0, v->index, 0, NULL, CMD_NAME_VEHICLE);
 	}
 
 	/* If we had shared orders, recover that */
 	if (bak->clone != INVALID_VEHICLE) {
-		DoCommandP(0, v->index | (bak->clone << 16), 0, NULL, CMD_CLONE_ORDER);
+		DoCommandP(0, v->index | (bak->clone << 16), CO_SHARE, NULL, CMD_CLONE_ORDER);
 	} else {
 
 		/* CMD_NO_TEST_IF_IN_NETWORK is used here, because CMD_INSERT_ORDER checks if the
@@ -1250,6 +1252,11 @@
 	}
 }
 
+Date GetServiceIntervalClamped(uint index)
+{
+	return (_patches.servint_ispercent) ? Clamp(index, MIN_SERVINT_PERCENT, MAX_SERVINT_PERCENT) : Clamp(index, MIN_SERVINT_DAYS, MAX_SERVINT_DAYS);
+}
+
 /**
  *
  * Check if we share our orders with an other vehicle
@@ -1323,10 +1330,8 @@
 		if (CheckSavegameVersion(5)) {
 			/* Pre-version 5 had an other layout for orders
 			    (uint16 instead of uint32) */
-			uint16 orders[5000];
-
 			len /= sizeof(uint16);
-			assert (len <= lengthof(orders));
+			uint16 *orders = MallocT<uint16>(len + 1);
 
 			SlArray(orders, len, SLE_UINT16);
 
@@ -1334,11 +1339,11 @@
 				Order *order = new (i) Order();
 				AssignOrder(order, UnpackVersion4Order(orders[i]));
 			}
+
+			free(orders);
 		} else if (CheckSavegameVersionOldStyle(5, 2)) {
-			uint32 orders[5000];
-
-			len /= sizeof(uint32);
-			assert (len <= lengthof(orders));
+			len /= sizeof(uint16);
+			uint16 *orders = MallocT<uint16>(len + 1);
 
 			SlArray(orders, len, SLE_UINT32);
 
@@ -1346,6 +1351,8 @@
 				Order *order = new (i) Order();
 				AssignOrder(order, UnpackOrder(orders[i]));
 			}
+
+			free(orders);
 		}
 
 		/* Update all the next pointer */
--- a/src/order_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/order_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,20 +6,13 @@
 #include "openttd.h"
 #include "road_map.h"
 #include "station_map.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "functions.h"
-#include "map.h"
-#include "tile.h"
-#include "window.h"
 #include "gui.h"
-#include "gfx.h"
-#include "vehicle.h"
+#include "window_gui.h"
 #include "station.h"
 #include "town.h"
-#include "command.h"
-#include "viewport.h"
+#include "command_func.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
 #include "depot.h"
 #include "waypoint.h"
 #include "train.h"
@@ -27,6 +20,15 @@
 #include "vehicle_gui.h"
 #include "timetable.h"
 #include "cargotype.h"
+#include "order.h"
+#include "strings_func.h"
+#include "window_func.h"
+#include "vehicle_func.h"
+#include "settings_type.h"
+#include "player_func.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
 
 enum OrderWindowWidgets {
 	ORDER_WIDGET_CLOSEBOX = 0,
@@ -57,7 +59,7 @@
 static int OrderGetSel(const Window *w)
 {
 	const Vehicle *v = GetVehicle(w->window_number);
-	int num = WP(w,order_d).sel;
+	int num = WP(w, order_d).sel;
 
 	return (num >= 0 && num < v->num_orders) ? num : v->num_orders;
 }
@@ -152,7 +154,15 @@
 
 	if (order != NULL) {
 		switch (order->type) {
-			case OT_GOTO_STATION: break;
+			case OT_GOTO_STATION:
+				if (!GetStation(order->dest)->IsBuoy()) break;
+				/* Fall-through */
+
+			case OT_GOTO_WAYPOINT:
+				w->DisableWidget(ORDER_WIDGET_FULL_LOAD);
+				w->DisableWidget(ORDER_WIDGET_UNLOAD);
+				w->DisableWidget(ORDER_WIDGET_TRANSFER);
+				break;
 
 			case OT_GOTO_DEPOT:
 				w->DisableWidget(ORDER_WIDGET_TRANSFER);
@@ -163,12 +173,6 @@
 				SetDParam(2,STR_SERVICE);
 				break;
 
-			case OT_GOTO_WAYPOINT:
-				w->DisableWidget(ORDER_WIDGET_FULL_LOAD);
-				w->DisableWidget(ORDER_WIDGET_UNLOAD);
-				w->DisableWidget(ORDER_WIDGET_TRANSFER);
-				break;
-
 			default: // every other orders
 				w->DisableWidget(ORDER_WIDGET_NON_STOP);
 				w->DisableWidget(ORDER_WIDGET_FULL_LOAD);
@@ -211,14 +215,14 @@
 						SetDParam(2, GetDepot(order->dest)->town_index);
 
 						switch (v->type) {
-							case VEH_TRAIN: s = (order->flags & OF_NON_STOP) ? STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT : STR_GO_TO_TRAIN_DEPOT; break;
+							case VEH_TRAIN: s = (order->flags & OFB_NON_STOP) ? STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT : STR_GO_TO_TRAIN_DEPOT; break;
 							case VEH_ROAD:  s = STR_9038_GO_TO_ROADVEH_DEPOT; break;
 							case VEH_SHIP:  s = STR_GO_TO_SHIP_DEPOT; break;
 							default: break;
 						}
 					}
 
-					if (order->flags & OF_FULL_LOAD) s++; /* service at */
+					if (order->flags & OFB_FULL_LOAD) s++; /* service at */
 
 					SetDParam(1, s);
 					if (order->refit_cargo < NUM_CARGO) {
@@ -231,7 +235,7 @@
 				}
 
 				case OT_GOTO_WAYPOINT:
-					SetDParam(1, (order->flags & OF_NON_STOP) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT);
+					SetDParam(1, (order->flags & OFB_NON_STOP) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT);
 					SetDParam(2, order->dest);
 					break;
 
@@ -239,7 +243,7 @@
 			}
 
 			SetDParam(0, i + 1);
-			DrawString(2, y, str, (i == WP(w,order_d).sel) ? TC_WHITE : TC_BLACK);
+			DrawString(2, y, str, (i == WP(w, order_d).sel) ? TC_WHITE : TC_BLACK);
 
 			y += 10;
 		}
@@ -250,7 +254,7 @@
 
 	if (i - w->vscroll.pos < w->vscroll.cap) {
 		str = shared_orders ? STR_END_OF_SHARED_ORDERS : STR_882A_END_OF_ORDERS;
-		DrawString(2, y, str, (i == WP(w,order_d).sel) ? TC_WHITE : TC_BLACK);
+		DrawString(2, y, str, (i == WP(w, order_d).sel) ? TC_WHITE : TC_BLACK);
 	}
 }
 
@@ -269,7 +273,7 @@
 			if (v->type == VEH_TRAIN && IsTileOwner(tile, _local_player)) {
 				if (IsRailDepot(tile)) {
 					order.type = OT_GOTO_DEPOT;
-					order.flags = OF_PART_OF_ORDERS;
+					order.flags = OFB_PART_OF_ORDERS;
 					order.dest = GetDepotByTile(tile)->index;
 					return order;
 				}
@@ -279,7 +283,7 @@
 		case MP_ROAD:
 			if (GetRoadTileType(tile) == ROAD_TILE_DEPOT && v->type == VEH_ROAD && IsTileOwner(tile, _local_player)) {
 				order.type = OT_GOTO_DEPOT;
-				order.flags = OF_PART_OF_ORDERS;
+				order.flags = OFB_PART_OF_ORDERS;
 				order.dest = GetDepotByTile(tile)->index;
 				return order;
 			}
@@ -289,7 +293,7 @@
 			if (v->type != VEH_AIRCRAFT) break;
 			if (IsHangar(tile) && IsTileOwner(tile, _local_player)) {
 				order.type = OT_GOTO_DEPOT;
-				order.flags = OF_PART_OF_ORDERS;
+				order.flags = OFB_PART_OF_ORDERS;
 				order.dest = GetStationIndex(tile);
 				return order;
 			}
@@ -302,7 +306,7 @@
 				TileIndex tile2 = GetOtherShipDepotTile(tile);
 
 				order.type = OT_GOTO_DEPOT;
-				order.flags = OF_PART_OF_ORDERS;
+				order.flags = OFB_PART_OF_ORDERS;
 				order.dest = GetDepotByTile(tile < tile2 ? tile : tile2)->index;
 				return order;
 			}
@@ -362,9 +366,9 @@
 	// obviously if you press CTRL on a non-empty orders vehicle you know what you are doing
 	if (v->num_orders != 0 && _ctrl_pressed == 0) return false;
 
-	if (DoCommandP(v->tile, v->index | (u->index << 16), _ctrl_pressed ? 0 : 1, NULL,
+	if (DoCommandP(v->tile, v->index | (u->index << 16), _ctrl_pressed ? CO_SHARE : CO_COPY, NULL,
 		_ctrl_pressed ? CMD_CLONE_ORDER | CMD_MSG(STR_CANT_SHARE_ORDER_LIST) : CMD_CLONE_ORDER | CMD_MSG(STR_CANT_COPY_ORDER_LIST))) {
-		WP(w,order_d).sel = -1;
+		WP(w, order_d).sel = -1;
 		ResetObjectToPlace();
 	}
 
@@ -384,7 +388,7 @@
 	if (!cmd.IsValid()) return;
 
 	if (DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), PackOrder(&cmd), NULL, CMD_INSERT_ORDER | CMD_MSG(STR_8833_CAN_T_INSERT_NEW_ORDER))) {
-		if (WP(w,order_d).sel != -1) WP(w,order_d).sel++;
+		if (WP(w, order_d).sel != -1) WP(w,order_d).sel++;
 		ResetObjectToPlace();
 	}
 }
@@ -397,7 +401,7 @@
  */
 static void OrderClick_Goto(Window *w, const Vehicle *v)
 {
-	InvalidateWidget(w, ORDER_WIDGET_GOTO);
+	w->InvalidateWidget(ORDER_WIDGET_GOTO);
 	w->ToggleWidgetLoweredState(ORDER_WIDGET_GOTO);
 	if (w->IsWidgetLowered(ORDER_WIDGET_GOTO)) {
 		_place_clicked_vehicle = NULL;
@@ -415,7 +419,7 @@
  */
 static void OrderClick_FullLoad(Window *w, const Vehicle *v)
 {
-	DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), OFB_FULL_LOAD, NULL, CMD_MODIFY_ORDER | CMD_MSG(STR_8835_CAN_T_MODIFY_THIS_ORDER));
+	DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), OF_FULL_LOAD, NULL, CMD_MODIFY_ORDER | CMD_MSG(STR_8835_CAN_T_MODIFY_THIS_ORDER));
 }
 
 /**
@@ -426,7 +430,7 @@
  */
 static void OrderClick_Unload(Window *w, const Vehicle *v)
 {
-	DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), OFB_UNLOAD,    NULL, CMD_MODIFY_ORDER | CMD_MSG(STR_8835_CAN_T_MODIFY_THIS_ORDER));
+	DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), OF_UNLOAD,    NULL, CMD_MODIFY_ORDER | CMD_MSG(STR_8835_CAN_T_MODIFY_THIS_ORDER));
 }
 
 /**
@@ -437,7 +441,7 @@
  */
 static void OrderClick_Nonstop(Window *w, const Vehicle *v)
 {
-	DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), OFB_NON_STOP,  NULL, CMD_MODIFY_ORDER | CMD_MSG(STR_8835_CAN_T_MODIFY_THIS_ORDER));
+	DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), OF_NON_STOP,  NULL, CMD_MODIFY_ORDER | CMD_MSG(STR_8835_CAN_T_MODIFY_THIS_ORDER));
 }
 
 /**
@@ -448,7 +452,7 @@
  */
 static void OrderClick_Transfer(Window* w, const Vehicle* v)
 {
-	DoCommandP(v->tile, v->index + (OrderGetSel(w) <<  16), OFB_TRANSFER, NULL, CMD_MODIFY_ORDER | CMD_MSG(STR_8835_CAN_T_MODIFY_THIS_ORDER));
+	DoCommandP(v->tile, v->index + (OrderGetSel(w) <<  16), OF_TRANSFER, NULL, CMD_MODIFY_ORDER | CMD_MSG(STR_8835_CAN_T_MODIFY_THIS_ORDER));
 }
 
 /**
@@ -491,9 +495,9 @@
 {
 	if (_ctrl_pressed) {
 		/* Cancel refitting */
-		DoCommandP(v->tile, v->index, (WP(w,order_d).sel << 16) | (CT_NO_REFIT << 8) | CT_NO_REFIT, NULL, CMD_ORDER_REFIT);
+		DoCommandP(v->tile, v->index, (WP(w, order_d).sel << 16) | (CT_NO_REFIT << 8) | CT_NO_REFIT, NULL, CMD_ORDER_REFIT);
 	} else {
-		ShowVehicleRefitWindow(v, WP(w,order_d).sel);
+		ShowVehicleRefitWindow(v, WP(w, order_d).sel);
 	}
 }
 
@@ -563,7 +567,7 @@
 			if (sel == INVALID_ORDER) {
 				/* This was a click on an empty part of the orders window, so
 				 * deselect the currently selected order. */
-				WP(w,order_d).sel = -1;
+				WP(w, order_d).sel = -1;
 				SetWindowDirty(w);
 				return;
 			}
@@ -582,12 +586,12 @@
 				if (xy != 0) ScrollMainWindowToTile(xy);
 				return;
 			} else {
-				if (sel == WP(w,order_d).sel) {
+				if (sel == WP(w, order_d).sel) {
 					/* Deselect clicked order */
-					WP(w,order_d).sel = -1;
+					WP(w, order_d).sel = -1;
 				} else {
 					/* Select clicked order */
-					WP(w,order_d).sel = sel;
+					WP(w, order_d).sel = sel;
 
 					if (v->owner == _local_player) {
 						/* Activate drag and drop */
@@ -700,7 +704,7 @@
 
 	case WE_ABORT_PLACE_OBJ: {
 		w->RaiseWidget(ORDER_WIDGET_GOTO);
-		InvalidateWidget( w, ORDER_WIDGET_GOTO);
+		w->InvalidateWidget(ORDER_WIDGET_GOTO);
 	} break;
 
 	// check if a vehicle in a depot was clicked..
@@ -731,7 +735,7 @@
 		for (i = 0; i < w->widget_count; i++) {
 			if (w->IsWidgetLowered(i) && i != ORDER_WIDGET_GOTO) {
 				w->RaiseWidget(i);
-				InvalidateWidget(w, i);
+				w->InvalidateWidget(i);
 			}
 		}
 	} break;
@@ -867,6 +871,6 @@
 		w->caption_color = v->owner;
 		w->vscroll.cap = 6;
 		w->resize.step_height = 10;
-		WP(w,order_d).sel = -1;
+		WP(w, order_d).sel = -1;
 	}
 }
--- a/src/os/macosx/macos.mm	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/os/macosx/macos.mm	Tue Jan 22 21:00:30 2008 +0000
@@ -10,7 +10,7 @@
 #include <mach/machine.h>
 #include <stdio.h>
 #include "../../stdafx.h"
-#include "../../macros.h"
+#include "../../core/bitmath_func.hpp"
 
 #ifndef CPU_SUBTYPE_POWERPC_970
 #define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100)
--- a/src/os/macosx/osx_stdafx.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/os/macosx/osx_stdafx.h	Tue Jan 22 21:00:30 2008 +0000
@@ -10,9 +10,7 @@
 #undef true
 
 /* Name conflict */
-#define Rect		OTTDRect
-#define Point		OTTDPoint
-#define GetTime		OTTDGetTime
+#define GetTime		OTTD_GetTime
 
 #define SL_ERROR OSX_SL_ERROR
 
--- a/src/os/macosx/splash.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/os/macosx/splash.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,10 +3,8 @@
 #include "../../stdafx.h"
 #include "../../openttd.h"
 #include "../../variables.h"
-#include "../../macros.h"
 #include "../../debug.h"
-#include "../../functions.h"
-#include "../../gfx.h"
+#include "../../gfx_func.h"
 #include "../../fileio.h"
 #include "../../blitter/factory.hpp"
 
--- a/src/os2.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/os2.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,14 +5,15 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "variables.h"
-#include "string.h"
-#include "table/strings.h"
-#include "gfx.h"
 #include "gui.h"
-#include "functions.h"
-#include "macros.h"
 #include "fileio.h"
 #include "fios.h" // opendir/readdir/closedir
+#include "functions.h"
+#include "core/random_func.hpp"
+#include "string_func.h"
+#include "textbuf_gui.h"
+
+#include "table/strings.h"
 
 #include <dirent.h>
 #include <unistd.h>
--- a/src/pathfind.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/pathfind.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -7,16 +7,16 @@
 #include "bridge_map.h"
 #include "station_map.h"
 #include "depot.h"
-#include "functions.h"
+#include "tile_cmd.h"
 #include "landscape.h"
-#include "map.h"
-#include "tile.h"
 #include "pathfind.h"
-#include "rail.h"
+#include "rail_type.h"
 #include "debug.h"
 #include "tunnel_map.h"
-#include "variables.h"
+#include "settings_type.h"
 #include "depot.h"
+#include "tunnelbridge_map.h"
+#include "core/random_func.hpp"
 
 /* remember which tiles we have already visited so we don't visit them again. */
 static bool TPFSetTileBit(TrackPathFinder *tpf, TileIndex tile, int dir)
@@ -210,7 +210,7 @@
 		tile += delta;
 	} while(
 		!IsTunnelTile(tile) ||
-		GetTunnelDirection(tile) != dir ||
+		GetTunnelBridgeDirection(tile) != dir ||
 		GetTileZ(tile) != z
 	);
 
@@ -259,16 +259,9 @@
 	/* Check if the new tile is a tunnel or bridge head and that the direction
 	 * and transport type match */
 	if (IsTileType(tile, MP_TUNNELBRIDGE)) {
-		if (IsTunnel(tile)) {
-			if (GetTunnelDirection(tile) != direction ||
-					GetTunnelTransportType(tile) != tpf->tracktype) {
-				return;
-			}
-		} else if (IsBridge(tile)) {
-			if (GetBridgeRampDirection(tile) != direction ||
-					GetBridgeTransportType(tile) != tpf->tracktype) {
-				return;
-			}
+		if (GetTunnelBridgeDirection(tile) != direction ||
+				GetTunnelBridgeTransportType(tile) != tpf->tracktype) {
+			return;
 		}
 	}
 
@@ -307,23 +300,23 @@
 
 	if (IsTileType(tile, MP_TUNNELBRIDGE)) {
 		if (IsTunnel(tile)) {
-			if (GetTunnelTransportType(tile) != tpf->tracktype) {
+			if (GetTunnelBridgeTransportType(tile) != tpf->tracktype) {
 				return;
 			}
 			/* Only skip through the tunnel if heading inwards. We can
 			 * be headed outwards if our starting position was in a
 			 * tunnel and we're pathfinding backwards */
-			if (GetTunnelDirection(tile) == direction) {
+			if (GetTunnelBridgeDirection(tile) == direction) {
 				tile = SkipToEndOfTunnel(tpf, tile, direction);
-			} else if (GetTunnelDirection(tile) != ReverseDiagDir(direction)) {
+			} else if (GetTunnelBridgeDirection(tile) != ReverseDiagDir(direction)) {
 				/* We don't support moving through the sides of a tunnel
 				 * entrance :-) */
 				return;
 			}
 		} else {
 			TileIndex tile_end;
-			if (GetBridgeRampDirection(tile) != direction ||
-					GetBridgeTransportType(tile) != tpf->tracktype) {
+			if (GetTunnelBridgeDirection(tile) != direction ||
+					GetTunnelBridgeTransportType(tile) != tpf->tracktype) {
 				return;
 			}
 			//fprintf(stderr, "%s: Planning over bridge\n", __func__);
@@ -449,7 +442,7 @@
 	TileIndex dest;
 
 	TransportType tracktype;
-	RailTypeMask railtypes;
+	RailTypes railtypes;
 	uint maxlength;
 
 	HashLink *new_link;
@@ -722,12 +715,12 @@
 		 *   need to find the exit of the tunnel. */
 		if (IsTileType(tile, MP_TUNNELBRIDGE)) {
 			if (IsTunnel(tile)) {
-				if (GetTunnelDirection(tile) != ReverseDiagDir(direction)) {
+				if (GetTunnelBridgeDirection(tile) != ReverseDiagDir(direction)) {
 					FindLengthOfTunnelResult flotr;
 
 					/* We are not just driving out of the tunnel */
-					if (GetTunnelDirection(tile) != direction ||
-							GetTunnelTransportType(tile) != tpf->tracktype) {
+					if (GetTunnelBridgeDirection(tile) != direction ||
+							GetTunnelBridgeTransportType(tile) != tpf->tracktype) {
 						/* We are not driving into the tunnel, or it is an invalid tunnel */
 						continue;
 					}
@@ -742,10 +735,10 @@
 				}
 			} else {
 				TileIndex tile_end;
-				if (GetBridgeRampDirection(tile) != ReverseDiagDir(direction)) {
+				if (GetTunnelBridgeDirection(tile) != ReverseDiagDir(direction)) {
 					/* We are not just leaving the bridge */
-					if (GetBridgeRampDirection(tile) != direction ||
-							GetBridgeTransportType(tile) != tpf->tracktype) {
+					if (GetTunnelBridgeDirection(tile) != direction ||
+							GetTunnelBridgeTransportType(tile) != tpf->tracktype) {
 						/* Not entering the bridge or not compatible */
 						continue;
 					}
@@ -945,7 +938,7 @@
 
 
 /** new pathfinder for trains. better and faster. */
-void NewTrainPathfind(TileIndex tile, TileIndex dest, RailTypeMask railtypes, DiagDirection direction, NTPEnumProc* enum_proc, void* data)
+void NewTrainPathfind(TileIndex tile, TileIndex dest, RailTypes railtypes, DiagDirection direction, NTPEnumProc* enum_proc, void* data)
 {
 	NewTrackPathFinder tpf;
 
--- a/src/pathfind.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/pathfind.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,8 +5,7 @@
 #ifndef PATHFIND_H
 #define PATHFIND_H
 
-#include "direction.h"
-#include "openttd.h"
+#include "direction_type.h"
 
 enum {
 	STR_FACTOR  = 2,
@@ -56,7 +55,7 @@
 
 	TrackdirByte the_dir;
 
-	TransportTypeByte tracktype;
+	TransportType tracktype;
 	uint sub_type;
 
 	byte var2;
@@ -77,6 +76,6 @@
 };
 FindLengthOfTunnelResult FindLengthOfTunnel(TileIndex tile, DiagDirection direction);
 
-void NewTrainPathfind(TileIndex tile, TileIndex dest, RailTypeMask railtypes, DiagDirection direction, NTPEnumProc* enum_proc, void* data);
+void NewTrainPathfind(TileIndex tile, TileIndex dest, RailTypes railtypes, DiagDirection direction, NTPEnumProc* enum_proc, void* data);
 
 #endif /* PATHFIND_H */
--- a/src/player.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,382 +0,0 @@
-/* $Id$ */
-
-/** @file player.h */
-
-#ifndef PLAYER_H
-#define PLAYER_H
-
-#include "oldpool.h"
-#include "aystar.h"
-#include "rail.h"
-#include "road.h"
-#include "engine.h"
-#include "livery.h"
-#include "genworld.h"
-#include "gfx.h"
-
-struct PlayerEconomyEntry {
-	Money income;
-	Money expenses;
-	int32 delivered_cargo;
-	int32 performance_history; ///< player score (scale 0-1000)
-	Money company_value;
-};
-
-struct AiBuildRec {
-	TileIndex spec_tile;
-	TileIndex use_tile;
-	byte rand_rng;
-	byte cur_building_rule;
-	byte unk6;
-	byte unk7;
-	byte buildcmd_a;
-	byte buildcmd_b;
-	byte direction;
-	CargoID cargo;
-};
-
-struct PlayerAI {
-	byte state;
-	byte tick;            ///< Used to determine how often to move
-	uint32 state_counter; ///< Can hold tile index!
-	uint16 timeout_counter;
-
-	byte state_mode;
-	byte banned_tile_count;
-	RailTypeByte railtype_to_use;
-
-	CargoID cargo_type;
-	byte num_wagons;
-	byte build_kind;
-	byte num_build_rec;
-	byte num_loco_to_build;
-	byte num_want_fullload;
-
-	byte route_type_mask;
-
-	TileIndex start_tile_a;
-	TileIndex cur_tile_a;
-	DiagDirectionByte cur_dir_a;
-	DiagDirectionByte start_dir_a;
-
-	TileIndex start_tile_b;
-	TileIndex cur_tile_b;
-	DiagDirectionByte cur_dir_b;
-	DiagDirectionByte start_dir_b;
-
-	Vehicle *cur_veh; ///< only used by some states
-
-	AiBuildRec src, dst, mid1, mid2;
-
-	VehicleID wagon_list[9];
-	byte order_list_blocks[20];
-
-	TileIndex banned_tiles[16];
-	byte banned_val[16];
-};
-
-struct Ai_PathFinderInfo {
-	TileIndex start_tile_tl; ///< tl = top-left
-	TileIndex start_tile_br; ///< br = bottom-right
-	TileIndex end_tile_tl;   ///< tl = top-left
-	TileIndex end_tile_br;   ///< br = bottom-right
-	DiagDirection start_direction; ///< 0 to 3 or AI_PATHFINDER_NO_DIRECTION
-	DiagDirection end_direction;   ///< 0 to 3 or AI_PATHFINDER_NO_DIRECTION
-
-	TileIndex route[500];
-	byte route_extra[500];   ///< Some extra information about the route like bridge/tunnel
-	int route_length;
-	int position;            ///< Current position in the build-path, needed to build the path
-
-	bool rail_or_road;       ///< true = rail, false = road
-};
-
-/* The amount of memory reserved for the AI-special-vehicles */
-#define AI_MAX_SPECIAL_VEHICLES 100
-
-struct Ai_SpecialVehicle {
-	VehicleID veh_id;
-	uint32 flag;
-};
-
-struct PlayerAiNew {
-	uint8 state;
-	uint tick;
-	uint idle;
-
-	int temp;    ///< A value used in more than one function, but it just temporary
-	             ///< The use is pretty simple: with this we can 'think' about stuff
-	             ///<   in more than one tick, and more than one AI. A static will not
-	             ///<   do, because they are not saved. This way, the AI is almost human ;)
-	int counter; ///< For the same reason as temp, we have counter. It can count how
-	             ///<  long we are trying something, and just abort if it takes too long
-
-	/* Pathfinder stuff */
-	Ai_PathFinderInfo path_info;
-	AyStar *pathfinder;
-
-	/* Route stuff */
-
-	CargoID cargo;
-	byte tbt;    ///< train/bus/truck 0/1/2 AI_TRAIN/AI_BUS/AI_TRUCK
-	Money new_cost;
-
-	byte action;
-
-	int last_id; ///< here is stored the last id of the searched city/industry
-	Date last_vehiclecheck_date; // Used in CheckVehicle
-	Ai_SpecialVehicle special_vehicles[AI_MAX_SPECIAL_VEHICLES]; ///< Some vehicles have some special flags
-
-	TileIndex from_tile;
-	TileIndex to_tile;
-
-	DiagDirectionByte from_direction;
-	DiagDirectionByte to_direction;
-
-	bool from_deliver; ///< True if this is the station that GIVES cargo
-	bool to_deliver;
-
-	TileIndex depot_tile;
-	DiagDirectionByte depot_direction;
-
-	byte amount_veh;       ///< How many vehicles we are going to build in this route
-	byte cur_veh;          ///< How many vehicles did we bought?
-	VehicleID veh_id;      ///< Used when bought a vehicle
-	VehicleID veh_main_id; ///< The ID of the first vehicle, for shared copy
-
-	int from_ic;           ///< ic = industry/city. This is the ID of them
-	byte from_type;        ///< AI_NO_TYPE/AI_CITY/AI_INDUSTRY
-	int to_ic;
-	byte to_type;
-
-};
-
-
-/* The "steps" in loan size, in British Pounds! */
-enum {
-	LOAN_INTERVAL        = 10000,
-	LOAN_INTERVAL_OLD_AI = 50000,
-};
-
-struct Player {
-	uint32 name_2;
-	uint16 name_1;
-
-	uint16 president_name_1;
-	uint32 president_name_2;
-
-	PlayerFace face;
-
-	Money player_money;
-	Money current_loan;
-
-	byte player_color;
-	Livery livery[LS_END];
-	byte player_money_fraction;
-	byte avail_railtypes;
-	byte avail_roadtypes;
-	byte block_preview;
-	PlayerByte index;
-
-	uint16 cargo_types; ///< which cargo types were transported the last year
-
-	TileIndex location_of_house;
-	TileIndex last_build_coordinate;
-
-	PlayerByte share_owners[4];
-
-	Year inaugurated_year;
-	byte num_valid_stat_ent;
-
-	byte quarters_of_bankrupcy;
-	byte bankrupt_asked; ///< which players were asked about buying it?
-	int16 bankrupt_timeout;
-	Money bankrupt_value;
-
-	bool is_active;
-	bool is_ai;
-	PlayerAI ai;
-	PlayerAiNew ainew;
-
-	Money yearly_expenses[3][13];
-	PlayerEconomyEntry cur_economy;
-	PlayerEconomyEntry old_economy[24];
-	EngineRenewList engine_renew_list; ///< Defined later
-	bool engine_renew;
-	bool renew_keep_length;
-	int16 engine_renew_months;
-	uint32 engine_renew_money;
-	uint16 num_engines[TOTAL_NUM_ENGINES]; ///< caches the number of engines of each type the player owns (no need to save this)
-};
-
-uint16 GetDrawStringPlayerColor(PlayerID player);
-
-void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player);
-void GetNameOfOwner(Owner owner, TileIndex tile);
-Money CalculateCompanyValue(const Player *p);
-void InvalidatePlayerWindows(const Player *p);
-void SetLocalPlayer(PlayerID new_player);
-#define FOR_ALL_PLAYERS(p) for (p = _players; p != endof(_players); p++)
-
-VARDEF PlayerByte _local_player;
-VARDEF PlayerByte _current_player;
-
-VARDEF Player _players[MAX_PLAYERS];
-/* NOSAVE: can be determined from player structs */
-VARDEF byte _player_colors[MAX_PLAYERS];
-
-static inline byte ActivePlayerCount()
-{
-	const Player *p;
-	byte count = 0;
-
-	FOR_ALL_PLAYERS(p) {
-		if (p->is_active) count++;
-	}
-
-	return count;
-}
-
-static inline Player *GetPlayer(PlayerID i)
-{
-	assert(IsInsideBS(i, PLAYER_FIRST, lengthof(_players)));
-	return &_players[i];
-}
-
-static inline bool IsLocalPlayer()
-{
-	return _local_player == _current_player;
-}
-
-static inline bool IsValidPlayer(PlayerID pi)
-{
-	return IsInsideBS(pi, PLAYER_FIRST, MAX_PLAYERS);
-}
-
-byte GetPlayerRailtypes(PlayerID p);
-byte GetPlayerRoadtypes(PlayerID p);
-
-/** Finds out if a Player has a certain railtype available
- * @param p Player in question
- * @param Railtype requested RailType
- * @return true if player has requested RailType available
- */
-static inline bool HasRailtypeAvail(const Player *p, const RailType Railtype)
-{
-	return HasBit(p->avail_railtypes, Railtype);
-}
-
-/** Finds out, whether given player has all given RoadTypes available
- * @param PlayerID ID of player
- * @param rts RoadTypes to test
- * @return true if player has all requested RoadTypes available
- */
-static inline bool HasRoadTypesAvail(const PlayerID p, const RoadTypes rts)
-{
-	RoadTypes avail_roadtypes;
-
-	if (p == OWNER_TOWN || _game_mode == GM_EDITOR || IsGeneratingWorld()) {
-		avail_roadtypes = ROADTYPES_ROAD;
-	} else {
-		if (!IsValidPlayer(p)) return false;
-		avail_roadtypes = (RoadTypes)GetPlayer(p)->avail_roadtypes | ROADTYPES_ROAD; // road is available for always for everybody
-	}
-	return (rts & ~avail_roadtypes) == 0;
-}
-
-static inline bool IsHumanPlayer(PlayerID pi)
-{
-	return !GetPlayer(pi)->is_ai;
-}
-
-static inline bool IsInteractivePlayer(PlayerID pi)
-{
-	return pi == _local_player;
-}
-
-void DrawPlayerIcon(PlayerID p, int x, int y);
-
-/* Validate functions for rail building */
-static inline bool ValParamRailtype(const uint32 rail) { return HasBit(GetPlayer(_current_player)->avail_railtypes, rail);}
-
-/* Validate functions for road building */
-static inline bool ValParamRoadType(const RoadType rt) { return HasRoadTypesAvail(_current_player, RoadTypeToRoadTypes(rt));}
-
-/** Returns the "best" railtype a player can build.
- * As the AI doesn't know what the BEST one is, we have our own priority list
- * here. When adding new railtypes, modify this function
- * @param p the player "in action"
- * @return The "best" railtype a player has available
- */
-static inline RailType GetBestRailtype(const Player *p)
-{
-	if (HasRailtypeAvail(p, RAILTYPE_MAGLEV)) return RAILTYPE_MAGLEV;
-	if (HasRailtypeAvail(p, RAILTYPE_MONO)) return RAILTYPE_MONO;
-	if (HasRailtypeAvail(p, RAILTYPE_ELECTRIC)) return RAILTYPE_ELECTRIC;
-	return RAILTYPE_RAIL;
-}
-
-struct HighScore {
-	char company[100];
-	StringID title; ///< NO_SAVE, has troubles with changing string-numbers.
-	uint16 score;   ///< do NOT change type, will break hs.dat
-};
-
-VARDEF HighScore _highscore_table[5][5]; // 4 difficulty-settings (+ network); top 5
-void SaveToHighScore();
-void LoadFromHighScore();
-int8 SaveHighScoreValue(const Player *p);
-int8 SaveHighScoreValueNetwork();
-
-/* Engine Replacement Functions */
-
-/**
- * Remove all engine replacement settings for the given player.
- * @param p Player.
- */
-static inline void RemoveAllEngineReplacementForPlayer(Player *p) { RemoveAllEngineReplacement(&p->engine_renew_list); }
-
-/**
- * Retrieve the engine replacement for the given player and original engine type.
- * @param p Player.
- * @param engine Engine type.
- * @return The engine type to replace with, or INVALID_ENGINE if no
- * replacement is in the list.
- */
-static inline EngineID EngineReplacementForPlayer(const Player *p, EngineID engine, GroupID group) { return EngineReplacement(p->engine_renew_list, engine, group); }
-
-/**
- * Check if a player has a replacement set up for the given engine.
- * @param p Player.
- * @param  engine Engine type to be replaced.
- * @return true if a replacement was set up, false otherwise.
- */
-static inline bool EngineHasReplacementForPlayer(const Player *p, EngineID engine, GroupID group) { return EngineReplacementForPlayer(p, engine, group) != INVALID_ENGINE; }
-
-/**
- * Add an engine replacement for the player.
- * @param p Player.
- * @param old_engine The original engine type.
- * @param new_engine The replacement engine type.
- * @param flags The calling command flags.
- * @return 0 on success, CMD_ERROR on failure.
- */
-static inline CommandCost AddEngineReplacementForPlayer(Player *p, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags) { return AddEngineReplacement(&p->engine_renew_list, old_engine, new_engine, group, flags); }
-
-/**
- * Remove an engine replacement for the player.
- * @param p Player.
- * @param engine The original engine type.
- * @param flags The calling command flags.
- * @return 0 on success, CMD_ERROR on failure.
- */
-static inline CommandCost RemoveEngineReplacementForPlayer(Player *p, EngineID engine, GroupID group, uint32 flags) {return RemoveEngineReplacement(&p->engine_renew_list, engine, group, flags); }
-
-/**
- * Reset the livery schemes to the player's primary colour.
- * This is used on loading games without livery information and on new player start up.
- * @param p Player to reset.
- */
-void ResetPlayerLivery(Player *p);
-
-#endif /* PLAYER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/player_base.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,99 @@
+/* $Id$ */
+
+/** @file player_base.h Definition of stuff that is very close to a player, like the player struct itself. */
+
+#ifndef PLAYER_BASE_H
+#define PLAYER_BASE_H
+
+#include "road_type.h"
+#include "rail_type.h"
+#include "date_type.h"
+#include "engine.h"
+#include "livery.h"
+#include "autoreplace_type.h"
+#include "economy_type.h"
+#include "tile_type.h"
+
+struct PlayerEconomyEntry {
+	Money income;
+	Money expenses;
+	int32 delivered_cargo;
+	int32 performance_history; ///< player score (scale 0-1000)
+	Money company_value;
+};
+
+struct Player {
+	uint32 name_2;
+	uint16 name_1;
+	char *name;
+
+	uint16 president_name_1;
+	uint32 president_name_2;
+	char *president_name;
+
+	PlayerFace face;
+
+	Money player_money;
+	Money current_loan;
+
+	byte player_color;
+	Livery livery[LS_END];
+	byte player_money_fraction;
+	RailTypes avail_railtypes;
+	RoadTypes avail_roadtypes;
+	byte block_preview;
+	PlayerByte index;
+
+	uint16 cargo_types; ///< which cargo types were transported the last year
+
+	TileIndex location_of_house;
+	TileIndex last_build_coordinate;
+
+	PlayerByte share_owners[4];
+
+	Year inaugurated_year;
+	byte num_valid_stat_ent;
+
+	byte quarters_of_bankrupcy;
+	byte bankrupt_asked; ///< which players were asked about buying it?
+	int16 bankrupt_timeout;
+	Money bankrupt_value;
+
+	bool is_active;
+	bool is_ai;
+
+	Money yearly_expenses[3][13];
+	PlayerEconomyEntry cur_economy;
+	PlayerEconomyEntry old_economy[24];
+	EngineRenewList engine_renew_list; ///< Defined later
+	bool engine_renew;
+	bool renew_keep_length;
+	int16 engine_renew_months;
+	uint32 engine_renew_money;
+	uint16 num_engines[TOTAL_NUM_ENGINES]; ///< caches the number of engines of each type the player owns (no need to save this)
+};
+
+extern Player _players[MAX_PLAYERS];
+#define FOR_ALL_PLAYERS(p) for (p = _players; p != endof(_players); p++)
+
+static inline byte ActivePlayerCount()
+{
+	const Player *p;
+	byte count = 0;
+
+	FOR_ALL_PLAYERS(p) {
+		if (p->is_active) count++;
+	}
+
+	return count;
+}
+
+static inline Player *GetPlayer(PlayerID i)
+{
+	assert(IsInsideBS(i, PLAYER_FIRST, lengthof(_players)));
+	return &_players[i];
+}
+
+Money CalculateCompanyValue(const Player *p);
+
+#endif /* PLAYER_BASE_H */
--- a/src/player_face.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/player_face.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,9 @@
 #ifndef PLAYER_FACE_H
 #define PLAYER_FACE_H
 
+#include "core/random_func.hpp"
+#include "core/bitmath_func.hpp"
+
 /** The gender/race combinations that we have faces for */
 enum GenderEthnicity {
 	GENDER_FEMALE    = 0, ///< This bit set means a female, otherwise male
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/player_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,54 @@
+/* $Id$ */
+
+/** @file player_func.h Functions related to players. */
+
+#ifndef PLAYER_FUNC_H
+#define PLAYER_FUNC_H
+
+#include "core/math_func.hpp"
+#include "player_type.h"
+#include "tile_type.h"
+#include "strings_type.h"
+
+void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player);
+void GetNameOfOwner(Owner owner, TileIndex tile);
+void SetLocalPlayer(PlayerID new_player);
+
+extern PlayerByte _local_player;
+extern PlayerByte _current_player;
+/* NOSAVE: can be determined from player structs */
+extern byte _player_colors[MAX_PLAYERS];
+extern PlayerFace _player_face; ///< for player face storage in openttd.cfg
+
+bool IsHumanPlayer(PlayerID pi);
+
+static inline bool IsLocalPlayer()
+{
+	return _local_player == _current_player;
+}
+
+static inline bool IsValidPlayer(PlayerID pi)
+{
+	return IsInsideBS(pi, PLAYER_FIRST, MAX_PLAYERS);
+}
+
+static inline bool IsInteractivePlayer(PlayerID pi)
+{
+	return pi == _local_player;
+}
+
+
+
+struct HighScore {
+	char company[100];
+	StringID title; ///< NO_SAVE, has troubles with changing string-numbers.
+	uint16 score;   ///< do NOT change type, will break hs.dat
+};
+
+extern HighScore _highscore_table[5][5]; // 4 difficulty-settings (+ network); top 5
+void SaveToHighScore();
+void LoadFromHighScore();
+int8 SaveHighScoreValue(const Player *p);
+int8 SaveHighScoreValueNetwork();
+
+#endif /* PLAYER_FUNC_H */
--- a/src/player_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/player_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,29 +4,41 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "functions.h"
-#include "window.h"
 #include "gui.h"
-#include "viewport.h"
-#include "gfx.h"
-#include "player.h"
-#include "command.h"
-#include "vehicle.h"
-#include "economy.h"
+#include "window_gui.h"
+#include "textbuf_gui.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "player_func.h"
+#include "player_base.h"
+#include "command_func.h"
 #include "network/network.h"
 #include "variables.h"
 #include "roadveh.h"
 #include "train.h"
 #include "aircraft.h"
-#include "date.h"
 #include "newgrf.h"
 #include "network/network_data.h"
 #include "network/network_client.h"
 #include "network/network_gui.h"
 #include "player_face.h"
+#include "strings_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "string_func.h"
+#include "settings_type.h"
+#include "widgets/dropdown_func.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
+
+/* player face selection window */
+struct facesel_d {
+	PlayerFace face; // player face bits
+	bool advanced;   // advance player face selection window
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(facesel_d));
 
 static void DoShowPlayerFinances(PlayerID player, bool show_small, bool show_stickied);
 static void DoSelectPlayerFace(PlayerID player, bool show_big);
@@ -107,6 +119,12 @@
 	DrawStringRightAligned(182, y, STR_7028, TC_FROMSTRING);
 }
 
+enum PlayerFinancesWindowWidgets {
+	PFW_WIDGET_TOGGLE_SIZE   = 2,
+	PFW_WIDGET_INCREASE_LOAN = 6,
+	PFW_WIDGET_REPAY_LOAN    = 7,
+};
+
 static const Widget _player_finances_widgets[] = {
 {   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,               STR_018B_CLOSE_WINDOW},
 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   379,     0,    13, STR_700E_FINANCES,      STR_018C_WINDOW_TITLE_DRAG_THIS},
@@ -147,15 +165,15 @@
 			w->height = new_height;
 			SetWindowDirty(w);
 
-			w->SetWidgetHiddenState(6, player != _local_player);
-			w->SetWidgetHiddenState(7, player != _local_player);
+			w->SetWidgetHiddenState(PFW_WIDGET_INCREASE_LOAN, player != _local_player);
+			w->SetWidgetHiddenState(PFW_WIDGET_REPAY_LOAN,    player != _local_player);
 		}
 
 		/* Borrow button only shows when there is any more money to loan */
-		w->SetWidgetDisabledState(6, p->current_loan == _economy.max_loan);
+		w->SetWidgetDisabledState(PFW_WIDGET_INCREASE_LOAN, p->current_loan == _economy.max_loan);
 
 		/* Repay button only shows when there is any more money to repay */
-		w->SetWidgetDisabledState(7, player != _local_player || p->current_loan == 0);
+		w->SetWidgetDisabledState(PFW_WIDGET_REPAY_LOAN, player != _local_player || p->current_loan == 0);
 
 		SetDParam(0, p->index);
 		SetDParam(1, p->index);
@@ -167,7 +185,7 @@
 
 	case WE_CLICK:
 		switch (e->we.click.widget) {
-		case 2: {/* toggle size */
+		case PFW_WIDGET_TOGGLE_SIZE: {/* toggle size */
 			byte mode = (byte)WP(w, def_d).data_1;
 			bool stickied = !!(w->flags4 & WF_STICKY);
 			PlayerID player = (PlayerID)w->window_number;
@@ -175,11 +193,11 @@
 			DoShowPlayerFinances(player, !HasBit(mode, 0), stickied);
 		} break;
 
-		case 6: /* increase loan */
+		case PFW_WIDGET_INCREASE_LOAN: /* increase loan */
 			DoCommandP(0, 0, _ctrl_pressed, NULL, CMD_INCREASE_LOAN | CMD_MSG(STR_702C_CAN_T_BORROW_ANY_MORE_MONEY));
 			break;
 
-		case 7: /* repay loan */
+		case PFW_WIDGET_REPAY_LOAN: /* repay loan */
 			DoCommandP(0, 0, _ctrl_pressed, NULL, CMD_DECREASE_LOAN | CMD_MSG(STR_702F_CAN_T_REPAY_LOAN));
 			break;
 		}
@@ -244,7 +262,7 @@
 /* Association of liveries to livery classes */
 static const LiveryClass livery_class[LS_END] = {
 	LC_OTHER,
-	LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL,
+	LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL,
 	LC_ROAD, LC_ROAD,
 	LC_SHIP, LC_SHIP,
 	LC_AIRCRAFT, LC_AIRCRAFT, LC_AIRCRAFT,
@@ -254,7 +272,7 @@
 /* Number of liveries in each class, used to determine the height of the livery window */
 static const byte livery_height[] = {
 	1,
-	11,
+	13,
 	4,
 	2,
 	3,
@@ -266,6 +284,19 @@
 };
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(livery_d));
 
+
+enum PlayerLiveryWindowWidgets {
+	PLW_WIDGET_CLASS_GENERAL = 2,
+	PLW_WIDGET_CLASS_RAIL,
+	PLW_WIDGET_CLASS_ROAD,
+	PLW_WIDGET_CLASS_SHIP,
+	PLW_WIDGET_CLASS_AIRCRAFT,
+
+	PLW_WIDGET_PRI_COL_DROPDOWN = 9,
+	PLW_WIDGET_SEC_COL_DROPDOWN,
+	PLW_WIDGET_MATRIX,
+};
+
 static void ShowColourDropDownMenu(Window *w, uint32 widget)
 {
 	uint32 used_colours = 0;
@@ -273,7 +304,7 @@
 	LiveryScheme scheme;
 
 	/* Disallow other player colours for the primary colour */
-	if (HasBit(WP(w, livery_d).sel, LS_DEFAULT) && widget == 10) {
+	if (HasBit(WP(w, livery_d).sel, LS_DEFAULT) && widget == PLW_WIDGET_PRI_COL_DROPDOWN) {
 		const Player *p;
 		FOR_ALL_PLAYERS(p) {
 			if (p->is_active && p->index != _local_player) SetBit(used_colours, p->player_color);
@@ -287,17 +318,16 @@
 	if (scheme == LS_END) scheme = LS_DEFAULT;
 	livery = &GetPlayer((PlayerID)w->window_number)->livery[scheme];
 
-	ShowDropDownMenu(w, _colour_dropdown, widget == 10 ? livery->colour1 : livery->colour2, widget, used_colours, 0);
+	ShowDropDownMenu(w, _colour_dropdown, widget == PLW_WIDGET_PRI_COL_DROPDOWN ? livery->colour1 : livery->colour2, widget, used_colours, 0);
 }
 
 static void SelectPlayerLiveryWndProc(Window *w, WindowEvent *e)
 {
 	switch (e->event) {
 		case WE_CREATE:
-			w->LowerWidget(WP(w, livery_d).livery_class + 2);
+			w->LowerWidget(WP(w, livery_d).livery_class + PLW_WIDGET_CLASS_GENERAL);
 			if (!_loaded_newgrf_features.has_2CC) {
-				w->HideWidget(11);
-				w->HideWidget(12);
+				w->HideWidget(PLW_WIDGET_SEC_COL_DROPDOWN);
 			}
 			break;
 
@@ -307,10 +337,8 @@
 			int y = 51;
 
 			/* Disable dropdown controls if no scheme is selected */
-			w->SetWidgetDisabledState( 9, (WP(w, livery_d).sel == 0));
-			w->SetWidgetDisabledState(10, (WP(w, livery_d).sel == 0));
-			w->SetWidgetDisabledState(11, (WP(w, livery_d).sel == 0));
-			w->SetWidgetDisabledState(12, (WP(w, livery_d).sel == 0));
+			w->SetWidgetDisabledState(PLW_WIDGET_PRI_COL_DROPDOWN, (WP(w, livery_d).sel == 0));
+			w->SetWidgetDisabledState(PLW_WIDGET_SEC_COL_DROPDOWN, (WP(w, livery_d).sel == 0));
 
 			if (!(WP(w, livery_d).sel == 0)) {
 				for (scheme = LS_BEGIN; scheme < LS_END; scheme++) {
@@ -351,17 +379,17 @@
 		case WE_CLICK: {
 			switch (e->we.click.widget) {
 				/* Livery Class buttons */
-				case 2:
-				case 3:
-				case 4:
-				case 5:
-				case 6: {
+				case PLW_WIDGET_CLASS_GENERAL:
+				case PLW_WIDGET_CLASS_RAIL:
+				case PLW_WIDGET_CLASS_ROAD:
+				case PLW_WIDGET_CLASS_SHIP:
+				case PLW_WIDGET_CLASS_AIRCRAFT: {
 					LiveryScheme scheme;
 
-					w->RaiseWidget(WP(w, livery_d).livery_class + 2);
-					WP(w, livery_d).livery_class = (LiveryClass)(e->we.click.widget - 2);
+					w->RaiseWidget(WP(w, livery_d).livery_class + PLW_WIDGET_CLASS_GENERAL);
+					WP(w, livery_d).livery_class = (LiveryClass)(e->we.click.widget - PLW_WIDGET_CLASS_GENERAL);
 					WP(w, livery_d).sel = 0;
-					w->LowerWidget(WP(w, livery_d).livery_class + 2);
+					w->LowerWidget(WP(w, livery_d).livery_class + PLW_WIDGET_CLASS_GENERAL);
 
 					/* Select the first item in the list */
 					for (scheme = LS_DEFAULT; scheme < LS_END; scheme++) {
@@ -371,23 +399,21 @@
 						}
 					}
 					w->height = 49 + livery_height[WP(w, livery_d).livery_class] * 14;
-					w->widget[13].bottom = w->height - 1;
-					w->widget[13].data = livery_height[WP(w, livery_d).livery_class] << 8 | 1;
+					w->widget[PLW_WIDGET_MATRIX].bottom = w->height - 1;
+					w->widget[PLW_WIDGET_MATRIX].data = livery_height[WP(w, livery_d).livery_class] << 8 | 1;
 					MarkWholeScreenDirty();
 					break;
 				}
 
-				case 9:
-				case 10: /* First colour dropdown */
-					ShowColourDropDownMenu(w, 10);
+				case PLW_WIDGET_PRI_COL_DROPDOWN: /* First colour dropdown */
+					ShowColourDropDownMenu(w, PLW_WIDGET_PRI_COL_DROPDOWN);
 					break;
 
-				case 11:
-				case 12: /* Second colour dropdown */
-					ShowColourDropDownMenu(w, 12);
+				case PLW_WIDGET_SEC_COL_DROPDOWN: /* Second colour dropdown */
+					ShowColourDropDownMenu(w, PLW_WIDGET_SEC_COL_DROPDOWN);
 					break;
 
-				case 13: {
+				case PLW_WIDGET_MATRIX: {
 					LiveryScheme scheme;
 					LiveryScheme j = (LiveryScheme)((e->we.click.pt.y - 48) / 14);
 
@@ -419,7 +445,7 @@
 
 			for (scheme = LS_DEFAULT; scheme < LS_END; scheme++) {
 				if (HasBit(WP(w, livery_d).sel, scheme)) {
-					DoCommandP(0, scheme | (e->we.dropdown.button == 10 ? 0 : 256), e->we.dropdown.index, NULL, CMD_SET_PLAYER_COLOR);
+					DoCommandP(0, scheme | (e->we.dropdown.button == PLW_WIDGET_PRI_COL_DROPDOWN ? 0 : 256), e->we.dropdown.index, NULL, CMD_SET_PLAYER_COLOR);
 				}
 			}
 			break;
@@ -437,10 +463,8 @@
 {   WWT_IMGBTN, RESIZE_NONE, 14,  88, 109,  14,  35, SPR_IMG_AIRPLANESLIST,     STR_LIVERY_AIRCRAFT_TIP },
 {    WWT_PANEL, RESIZE_NONE, 14, 110, 399,  14,  35, 0x0,                       STR_NULL },
 {    WWT_PANEL, RESIZE_NONE, 14,   0, 149,  36,  47, 0x0,                       STR_NULL },
-{  WWT_TEXTBTN, RESIZE_NONE, 14, 150, 262,  36,  47, STR_02BD,                  STR_LIVERY_PRIMARY_TIP },
-{  WWT_TEXTBTN, RESIZE_NONE, 14, 263, 274,  36,  47, STR_0225,                  STR_LIVERY_PRIMARY_TIP },
-{  WWT_TEXTBTN, RESIZE_NONE, 14, 275, 387,  36,  47, STR_02E1,                  STR_LIVERY_SECONDARY_TIP },
-{  WWT_TEXTBTN, RESIZE_NONE, 14, 388, 399,  36,  47, STR_0225,                  STR_LIVERY_SECONDARY_TIP },
+{ WWT_DROPDOWN, RESIZE_NONE, 14, 150, 274,  36,  47, STR_02BD,                  STR_LIVERY_PRIMARY_TIP },
+{ WWT_DROPDOWN, RESIZE_NONE, 14, 275, 399,  36,  47, STR_02E1,                  STR_LIVERY_SECONDARY_TIP },
 {   WWT_MATRIX, RESIZE_NONE, 14,   0, 399,  48,  48 + 1 * 14, (1 << 8) | 1,     STR_LIVERY_PANEL_TIP },
 { WIDGETS_END },
 };
@@ -464,10 +488,8 @@
 {   WWT_IMGBTN, RESIZE_NONE, 14,  88, 109,  14,  35, SPR_IMG_AIRPLANESLIST,     STR_LIVERY_AIRCRAFT_TIP },
 {    WWT_PANEL, RESIZE_NONE, 14, 110, 274,  14,  35, 0x0,                       STR_NULL },
 {    WWT_PANEL, RESIZE_NONE, 14,   0, 149,  36,  47, 0x0,                       STR_NULL },
-{  WWT_TEXTBTN, RESIZE_NONE, 14, 150, 262,  36,  47, STR_02BD,                  STR_LIVERY_PRIMARY_TIP },
-{  WWT_TEXTBTN, RESIZE_NONE, 14, 263, 274,  36,  47, STR_0225,                  STR_LIVERY_PRIMARY_TIP },
-{  WWT_TEXTBTN, RESIZE_NONE, 14, 275, 275,  36,  47, STR_02E1,                  STR_LIVERY_SECONDARY_TIP },
-{  WWT_TEXTBTN, RESIZE_NONE, 14, 275, 275,  36,  47, STR_0225,                  STR_LIVERY_SECONDARY_TIP },
+{ WWT_DROPDOWN, RESIZE_NONE, 14, 150, 274,  36,  47, STR_02BD,                  STR_LIVERY_PRIMARY_TIP },
+{ WWT_DROPDOWN, RESIZE_NONE, 14, 275, 275,  36,  47, STR_02E1,                  STR_LIVERY_SECONDARY_TIP },
 {   WWT_MATRIX, RESIZE_NONE, 14,   0, 274,  48,  48 + 1 * 14, (1 << 8) | 1,     STR_LIVERY_PANEL_TIP },
 { WIDGETS_END },
 };
@@ -1179,7 +1201,7 @@
 						SetObjectToPlaceWnd(SPR_CURSOR_HQ, PAL_NONE, VHM_RECT, w);
 						SetTileSelectSize(2, 2);
 						w->LowerWidget(PCW_WIDGET_BUILD_VIEW_HQ);
-						InvalidateWidget(w, PCW_WIDGET_BUILD_VIEW_HQ);
+						w->InvalidateWidget(PCW_WIDGET_BUILD_VIEW_HQ);
 					} else {
 						ScrollMainWindowToTile(tile);
 					}
@@ -1190,7 +1212,7 @@
 					SetObjectToPlaceWnd(SPR_CURSOR_HQ, PAL_NONE, VHM_RECT, w);
 					SetTileSelectSize(2, 2);
 					w->LowerWidget(PCW_WIDGET_RELOCATE_HQ);
-					InvalidateWidget(w, PCW_WIDGET_RELOCATE_HQ);
+					w->InvalidateWidget(PCW_WIDGET_RELOCATE_HQ);
 					break;
 
 				case PCW_WIDGET_BUY_SHARE:
@@ -1218,11 +1240,11 @@
 			if (DoCommandP(e->we.place.tile, 0, 0, NULL, CMD_BUILD_COMPANY_HQ | CMD_NO_WATER | CMD_MSG(STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS)))
 				ResetObjectToPlace();
 				w->widget[PCW_WIDGET_BUILD_VIEW_HQ].type = WWT_PUSHTXTBTN; // this button can now behave as a normal push button
-				RaiseWindowButtons(w);
+				w->RaiseButtons();
 			break;
 
 		case WE_ABORT_PLACE_OBJ:
-			RaiseWindowButtons(w);
+			w->RaiseButtons();
 			break;
 
 		case WE_DESTROY:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/player_gui.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,20 @@
+/* $Id$ */
+
+/** @file player_gui.h GUI Functions related to players. */
+
+#ifndef PLAYER_GUI_H
+#define PLAYER_GUI_H
+
+#include "player_type.h"
+
+uint16 GetDrawStringPlayerColor(PlayerID player);
+void DrawPlayerIcon(PlayerID p, int x, int y);
+
+void ShowPlayerStations(PlayerID player);
+void ShowPlayerFinances(PlayerID player);
+void ShowPlayerCompany(PlayerID player);
+
+void InvalidatePlayerWindows(const Player *p);
+void DeletePlayerWindows(PlayerID pi);
+
+#endif /* PLAYER_GUI_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/player_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,43 @@
+/* $Id$ */
+
+/** @file player_type.h Types related to players. */
+
+#ifndef PLAYER_TYPE_H
+#define PLAYER_TYPE_H
+
+#include "core/enum_type.hpp"
+
+/**
+ * Enum for all players/owners.
+ */
+enum Owner {
+	/* Player identifiers All players below MAX_PLAYERS are playable
+	 * players, above, they are special, computer controlled players */
+	OWNER_BEGIN     = 0x00, ///< First Owner
+	PLAYER_FIRST    = 0x00, ///< First Player, same as owner
+	MAX_PLAYERS     = 0x08, ///< Maximum numbe rof players
+	OWNER_TOWN      = 0x0F, ///< A town owns the tile, or a town is expanding
+	OWNER_NONE      = 0x10, ///< The tile has no ownership
+	OWNER_WATER     = 0x11, ///< The tile/execution is done by "water"
+	OWNER_END,              ///< Last + 1 owner
+	INVALID_OWNER   = 0xFF, ///< An invalid owner
+	INVALID_PLAYER  = 0xFF, ///< And a valid owner
+
+	/* 'Fake' Players used for networks */
+	PLAYER_INACTIVE_CLIENT = 253, ///< The client is joining
+	PLAYER_NEW_COMPANY     = 254, ///< The client wants a new company
+	PLAYER_SPECTATOR       = 255, ///< The client is spectating
+};
+DECLARE_POSTFIX_INCREMENT(Owner);
+
+/** Define basic enum properties */
+template <> struct EnumPropsT<Owner> : MakeEnumPropsT<Owner, byte, OWNER_BEGIN, OWNER_END, INVALID_OWNER> {};
+typedef TinyEnumT<Owner> OwnerByte;
+
+typedef Owner PlayerID;
+typedef OwnerByte PlayerByte;
+
+struct Player;
+typedef uint32 PlayerFace; ///< player face bits, info see in player_face.h
+
+#endif /* PLAYER_TYPE_H */
--- a/src/players.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/players.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,30 +5,46 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "engine.h"
-#include "functions.h"
-#include "string.h"
-#include "strings.h"
-#include "table/strings.h"
-#include "table/sprites.h"
-#include "map.h"
-#include "player.h"
+#include "player_func.h"
+#include "player_gui.h"
 #include "town.h"
-#include "vehicle.h"
 #include "station.h"
-#include "gfx.h"
 #include "news.h"
 #include "saveload.h"
-#include "command.h"
-#include "sound.h"
+#include "command_func.h"
 #include "network/network.h"
+#include "network/network_internal.h"
 #include "variables.h"
 #include "engine.h"
 #include "ai/ai.h"
-#include "date.h"
-#include "window.h"
 #include "player_face.h"
 #include "group.h"
-#include "settings.h"
+#include "window_func.h"
+#include "tile_map.h"
+#include "strings_func.h"
+#include "gfx_func.h"
+#include "functions.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "autoreplace_func.h"
+#include "autoreplace_gui.h"
+#include "string_func.h"
+#include "ai/default/default.h"
+#include "ai/trolly/trolly.h"
+#include "road_func.h"
+#include "rail.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
+
+Player _players[MAX_PLAYERS];
+PlayerByte _local_player;
+PlayerByte _current_player;
+/* NOSAVE: can be determined from player structs */
+byte _player_colors[MAX_PLAYERS];
+PlayerFace _player_face; ///< for player face storage in openttd.cfg
+HighScore _highscore_table[5][5]; // 4 difficulty-settings (+ network); top 5
 
 /**
  * Sets the local player and updates the patch settings that are set on a
@@ -53,6 +69,11 @@
 	}
 }
 
+bool IsHumanPlayer(PlayerID pi)
+{
+	return !GetPlayer(pi)->is_ai;
+}
+
 
 uint16 GetDrawStringPlayerColor(PlayerID player)
 {
@@ -189,30 +210,24 @@
 
 static void SubtractMoneyFromAnyPlayer(Player *p, CommandCost cost)
 {
-	CommandCost tmp(p->player_money);
-	tmp.AddCost(-cost.GetCost());
-	p->player_money = tmp.GetCost();
+	if (cost.GetCost() == 0) return;
+	assert(cost.GetExpensesType() != INVALID_EXPENSES);
 
-	tmp = CommandCost(p->yearly_expenses[0][_yearly_expenses_type]);
-	tmp.AddCost(cost);
-	p->yearly_expenses[0][_yearly_expenses_type] = tmp.GetCost();
+	p->player_money -= cost.GetCost();
+	p->yearly_expenses[0][cost.GetExpensesType()] += cost.GetCost();
 
 	if (HasBit(1 << EXPENSES_TRAIN_INC    |
 	           1 << EXPENSES_ROADVEH_INC  |
 	           1 << EXPENSES_AIRCRAFT_INC |
-	           1 << EXPENSES_SHIP_INC, _yearly_expenses_type)) {
-		tmp = CommandCost(p->cur_economy.income);
-		tmp.AddCost(-cost.GetCost());
-		p->cur_economy.income = tmp.GetCost();
+	           1 << EXPENSES_SHIP_INC, cost.GetExpensesType())) {
+		p->cur_economy.income -= cost.GetCost();
 	} else if (HasBit(1 << EXPENSES_TRAIN_RUN    |
 	                  1 << EXPENSES_ROADVEH_RUN  |
 	                  1 << EXPENSES_AIRCRAFT_RUN |
 	                  1 << EXPENSES_SHIP_RUN     |
 	                  1 << EXPENSES_PROPERTY     |
-	                  1 << EXPENSES_LOAN_INT, _yearly_expenses_type)) {
-		tmp = CommandCost(p->cur_economy.expenses);
-		tmp.AddCost(-cost.GetCost());
-		p->cur_economy.expenses = tmp.GetCost();
+	                  1 << EXPENSES_LOAN_INT, cost.GetExpensesType())) {
+		p->cur_economy.expenses -= cost.GetCost();
 	}
 
 	InvalidatePlayerWindows(p);
@@ -234,7 +249,7 @@
 	p->player_money_fraction = m - (byte)cost;
 	cost >>= 8;
 	if (p->player_money_fraction > m) cost++;
-	if (cost != 0) SubtractMoneyFromAnyPlayer(p, CommandCost(cost));
+	if (cost != 0) SubtractMoneyFromAnyPlayer(p, CommandCost(cst.GetExpensesType(), cost));
 }
 
 void GetNameOfOwner(Owner owner, TileIndex tile)
@@ -440,6 +455,8 @@
 		if (!p->is_active) {
 			PlayerID i = p->index;
 			memset(p, 0, sizeof(Player));
+			memset(&_players_ai[i], 0, sizeof(PlayerAI));
+			memset(&_players_ainew[i], 0, sizeof(PlayerAiNew));
 			p->index = i;
 			return p;
 		}
@@ -479,7 +496,7 @@
 	p->player_money = p->current_loan = 100000;
 
 	p->is_ai = is_ai;
-	p->ai.state = 5; // AIS_WANT_NEW_ROUTE
+	_players_ai[p->index].state = 5; // AIS_WANT_NEW_ROUTE
 	p->share_owners[0] = p->share_owners[1] = p->share_owners[2] = p->share_owners[3] = PLAYER_SPECTATOR;
 
 	p->avail_railtypes = GetPlayerRailtypes(p->index);
@@ -544,7 +561,10 @@
 void InitializePlayers()
 {
 	memset(_players, 0, sizeof(_players));
-	for (PlayerID i = PLAYER_FIRST; i != MAX_PLAYERS; i++) _players[i].index = i;
+	for (PlayerID i = PLAYER_FIRST; i != MAX_PLAYERS; i++) {
+		_players[i].index = i;
+		for (uint j = 0; j < 4; j++) _players[i].share_owners[j] = PLAYER_SPECTATOR;
+	}
 	_cur_player_tick_index = 0;
 }
 
@@ -588,57 +608,18 @@
 	}
 }
 
-byte GetPlayerRailtypes(PlayerID p)
-{
-	byte rt = 0;
-	EngineID i;
-
-	for (i = 0; i != TOTAL_NUM_ENGINES; i++) {
-		const Engine* e = GetEngine(i);
-		const EngineInfo *ei = EngInfo(i);
-
-		if (e->type == VEH_TRAIN && HasBit(ei->climates, _opt.landscape) &&
-				(HasBit(e->player_avail, p) || _date >= e->intro_date + 365)) {
-			const RailVehicleInfo *rvi = RailVehInfo(i);
-
-			if (rvi->railveh_type != RAILVEH_WAGON) {
-				assert(rvi->railtype < RAILTYPE_END);
-				SetBit(rt, rvi->railtype);
-			}
-		}
-	}
-
-	return rt;
-}
-
-byte GetPlayerRoadtypes(PlayerID p)
-{
-	byte rt = 0;
-	EngineID i;
-
-	for (i = 0; i != TOTAL_NUM_ENGINES; i++) {
-		const Engine* e = GetEngine(i);
-		const EngineInfo *ei = EngInfo(i);
-
-		if (e->type == VEH_ROAD && HasBit(ei->climates, _opt.landscape) &&
-				(HasBit(e->player_avail, p) || _date >= e->intro_date + 365)) {
-			SetBit(rt, HasBit(ei->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD);
-		}
-	}
-
-	return rt;
-}
-
 static void DeletePlayerStuff(PlayerID pi)
 {
 	Player *p;
 
 	DeletePlayerWindows(pi);
 	p = GetPlayer(pi);
-	DeleteName(p->name_1);
-	DeleteName(p->president_name_1);
-	p->name_1 = 0;
-	p->president_name_1 = 0;
+	p->name_1 = STR_NULL;
+	p->president_name_1 = STR_NULL;
+	free(p->name);
+	free(p->president_name);
+	p->name = NULL;
+	p->president_name = NULL;
 }
 
 /** Change engine renewal parameters
@@ -848,10 +829,12 @@
 		if (_local_player != _network_playas && _network_playas == p->index) {
 			assert(_local_player == PLAYER_SPECTATOR);
 			SetLocalPlayer(p->index);
+#ifdef ENABLE_NETWORK
 			if (!StrEmpty(_network_default_company_pass)) {
 				char *password = _network_default_company_pass;
 				NetworkChangeCompanyPassword(1, &password);
 			}
+#endif /* ENABLE_NETWORK */
 			MarkWholeScreenDirty();
 		}
 
@@ -926,7 +909,7 @@
 			p->is_active = false;
 		}
 		RemoveAllEngineReplacementForPlayer(p);
-		RemoveAllGroupsForPlayer(p);
+		RemoveAllGroupsForPlayer(p->index);
 
 	} break;
 
@@ -1117,9 +1100,11 @@
 static const SaveLoad _player_desc[] = {
 	    SLE_VAR(Player, name_2,          SLE_UINT32),
 	    SLE_VAR(Player, name_1,          SLE_STRINGID),
+	SLE_CONDSTR(Player, name,            SLE_STR, 0,                       84, SL_MAX_VERSION),
 
 	    SLE_VAR(Player, president_name_1,SLE_UINT16),
 	    SLE_VAR(Player, president_name_2,SLE_UINT32),
+	SLE_CONDSTR(Player, president_name,  SLE_STR, 0,                       84, SL_MAX_VERSION),
 
 	    SLE_VAR(Player, face,            SLE_UINT32),
 
@@ -1189,66 +1174,6 @@
 	SLE_END()
 };
 
-static const SaveLoad _player_ai_desc[] = {
-	    SLE_VAR(PlayerAI, state,             SLE_UINT8),
-	    SLE_VAR(PlayerAI, tick,              SLE_UINT8),
-	SLE_CONDVAR(PlayerAI, state_counter,     SLE_FILE_U16 | SLE_VAR_U32,  0, 12),
-	SLE_CONDVAR(PlayerAI, state_counter,     SLE_UINT32,                 13, SL_MAX_VERSION),
-	    SLE_VAR(PlayerAI, timeout_counter,   SLE_UINT16),
-
-	    SLE_VAR(PlayerAI, state_mode,        SLE_UINT8),
-	    SLE_VAR(PlayerAI, banned_tile_count, SLE_UINT8),
-	    SLE_VAR(PlayerAI, railtype_to_use,   SLE_UINT8),
-
-	    SLE_VAR(PlayerAI, cargo_type,        SLE_UINT8),
-	    SLE_VAR(PlayerAI, num_wagons,        SLE_UINT8),
-	    SLE_VAR(PlayerAI, build_kind,        SLE_UINT8),
-	    SLE_VAR(PlayerAI, num_build_rec,     SLE_UINT8),
-	    SLE_VAR(PlayerAI, num_loco_to_build, SLE_UINT8),
-	    SLE_VAR(PlayerAI, num_want_fullload, SLE_UINT8),
-
-	    SLE_VAR(PlayerAI, route_type_mask,   SLE_UINT8),
-
-	SLE_CONDVAR(PlayerAI, start_tile_a,      SLE_FILE_U16 | SLE_VAR_U32,  0,  5),
-	SLE_CONDVAR(PlayerAI, start_tile_a,      SLE_UINT32,                  6, SL_MAX_VERSION),
-	SLE_CONDVAR(PlayerAI, cur_tile_a,        SLE_FILE_U16 | SLE_VAR_U32,  0,  5),
-	SLE_CONDVAR(PlayerAI, cur_tile_a,        SLE_UINT32,                  6, SL_MAX_VERSION),
-	    SLE_VAR(PlayerAI, start_dir_a,       SLE_UINT8),
-	    SLE_VAR(PlayerAI, cur_dir_a,         SLE_UINT8),
-
-	SLE_CONDVAR(PlayerAI, start_tile_b,      SLE_FILE_U16 | SLE_VAR_U32,  0,  5),
-	SLE_CONDVAR(PlayerAI, start_tile_b,      SLE_UINT32,                  6, SL_MAX_VERSION),
-	SLE_CONDVAR(PlayerAI, cur_tile_b,        SLE_FILE_U16 | SLE_VAR_U32,  0,  5),
-	SLE_CONDVAR(PlayerAI, cur_tile_b,        SLE_UINT32,                  6, SL_MAX_VERSION),
-	    SLE_VAR(PlayerAI, start_dir_b,       SLE_UINT8),
-	    SLE_VAR(PlayerAI, cur_dir_b,         SLE_UINT8),
-
-	    SLE_REF(PlayerAI, cur_veh,           REF_VEHICLE),
-
-	    SLE_ARR(PlayerAI, wagon_list,        SLE_UINT16, 9),
-	    SLE_ARR(PlayerAI, order_list_blocks, SLE_UINT8, 20),
-	    SLE_ARR(PlayerAI, banned_tiles,      SLE_UINT16, 16),
-
-	SLE_CONDNULL(64, 2, SL_MAX_VERSION),
-	SLE_END()
-};
-
-static const SaveLoad _player_ai_build_rec_desc[] = {
-	SLE_CONDVAR(AiBuildRec, spec_tile,         SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
-	SLE_CONDVAR(AiBuildRec, spec_tile,         SLE_UINT32,                 6, SL_MAX_VERSION),
-	SLE_CONDVAR(AiBuildRec, use_tile,          SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
-	SLE_CONDVAR(AiBuildRec, use_tile,          SLE_UINT32,                 6, SL_MAX_VERSION),
-	    SLE_VAR(AiBuildRec, rand_rng,          SLE_UINT8),
-	    SLE_VAR(AiBuildRec, cur_building_rule, SLE_UINT8),
-	    SLE_VAR(AiBuildRec, unk6,              SLE_UINT8),
-	    SLE_VAR(AiBuildRec, unk7,              SLE_UINT8),
-	    SLE_VAR(AiBuildRec, buildcmd_a,        SLE_UINT8),
-	    SLE_VAR(AiBuildRec, buildcmd_b,        SLE_UINT8),
-	    SLE_VAR(AiBuildRec, direction,         SLE_UINT8),
-	    SLE_VAR(AiBuildRec, cargo,             SLE_UINT8),
-	SLE_END()
-};
-
 static const SaveLoad _player_livery_desc[] = {
 	SLE_CONDVAR(Livery, in_use,  SLE_BOOL,  34, SL_MAX_VERSION),
 	SLE_CONDVAR(Livery, colour1, SLE_UINT8, 34, SL_MAX_VERSION),
@@ -1264,10 +1189,7 @@
 
 	/* Write AI? */
 	if (!IsHumanPlayer(p->index)) {
-		SlObject(&p->ai, _player_ai_desc);
-		for (i = 0; i != p->ai.num_build_rec; i++) {
-			SlObject(&p->ai.src + i, _player_ai_build_rec_desc);
-		}
+		SaveLoad_AI(p->index);
 	}
 
 	/* Write economy */
@@ -1279,12 +1201,19 @@
 	}
 
 	/* Write each livery entry. */
-	int num_liveries = CheckSavegameVersion(63) ? LS_END - 2 : LS_END;
+	int num_liveries = CheckSavegameVersion(63) ? LS_END - 4 : (CheckSavegameVersion(85) ? LS_END - 2: LS_END);
 	for (i = 0; i < num_liveries; i++) {
 		SlObject(&p->livery[i], _player_livery_desc);
 	}
 
-	if (num_liveries == LS_END - 2) {
+	if (num_liveries < LS_END) {
+		/* We want to insert some liveries somewhere in between. This means some have to be moved. */
+		memmove(&p->livery[LS_FREIGHT_WAGON], &p->livery[LS_PASSENGER_WAGON_MONORAIL], (LS_END - LS_FREIGHT_WAGON) * sizeof(p->livery[0]));
+		p->livery[LS_PASSENGER_WAGON_MONORAIL] = p->livery[LS_MONORAIL];
+		p->livery[LS_PASSENGER_WAGON_MAGLEV]   = p->livery[LS_MAGLEV];
+	}
+
+	if (num_liveries == LS_END - 4) {
 		/* Copy bus/truck liveries over to trams */
 		p->livery[LS_PASSENGER_TRAM] = p->livery[LS_BUS];
 		p->livery[LS_FREIGHT_TRAM]   = p->livery[LS_TRUCK];
--- a/src/queue.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/queue.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,7 +5,7 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "queue.h"
-#include "helpers.hpp"
+#include "core/alloc_func.hpp"
 
 
 /*
@@ -310,7 +310,7 @@
 	h->hash = hash;
 	h->size = 0;
 	h->num_buckets = num_buckets;
-	h->buckets = (HashNode*)malloc(num_buckets * (sizeof(*h->buckets) + sizeof(*h->buckets_in_use)));
+	h->buckets = (HashNode*)MallocT<byte>(num_buckets * (sizeof(*h->buckets) + sizeof(*h->buckets_in_use)));
 #ifdef HASH_DEBUG
 	debug("Buckets = %p", h->buckets);
 #endif
--- a/src/rail.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/rail.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -8,18 +8,24 @@
 #include "rail.h"
 #include "station_map.h"
 #include "tunnel_map.h"
+#include "tunnelbridge_map.h"
+#include "settings_type.h"
+#include "date_func.h"
+#include "player_func.h"
+#include "player_base.h"
+
 
 /* XXX: Below 3 tables store duplicate data. Maybe remove some? */
 /* Maps a trackdir to the bit that stores its status in the map arrays, in the
  * direction along with the trackdir */
-extern const byte _signal_along_trackdir[] = {
+extern const byte _signal_along_trackdir[TRACKDIR_END] = {
 	0x8, 0x8, 0x8, 0x2, 0x4, 0x1, 0, 0,
 	0x4, 0x4, 0x4, 0x1, 0x8, 0x2
 };
 
 /* Maps a trackdir to the bit that stores its status in the map arrays, in the
  * direction against the trackdir */
-extern const byte _signal_against_trackdir[] = {
+extern const byte _signal_against_trackdir[TRACKDIR_END] = {
 	0x4, 0x4, 0x4, 0x1, 0x8, 0x2, 0, 0,
 	0x8, 0x8, 0x8, 0x2, 0x4, 0x1
 };
@@ -40,13 +46,13 @@
 	TRACKDIR_BIT_Y_NW | TRACKDIR_BIT_RIGHT_N | TRACKDIR_BIT_LOWER_W  /* DIAGDIR_NW */
 };
 
-extern const Trackdir _next_trackdir[] = {
+extern const Trackdir _next_trackdir[TRACKDIR_END] = {
 	TRACKDIR_X_NE,  TRACKDIR_Y_SE,  TRACKDIR_LOWER_E, TRACKDIR_UPPER_E, TRACKDIR_RIGHT_S, TRACKDIR_LEFT_S, INVALID_TRACKDIR, INVALID_TRACKDIR,
 	TRACKDIR_X_SW,  TRACKDIR_Y_NW,  TRACKDIR_LOWER_W, TRACKDIR_UPPER_W, TRACKDIR_RIGHT_N, TRACKDIR_LEFT_N
 };
 
 /* Maps a trackdir to all trackdirs that make 90 deg turns with it. */
-extern const TrackdirBits _track_crosses_trackdirs[] = {
+extern const TrackdirBits _track_crosses_trackdirs[TRACKDIR_END] = {
 	TRACKDIR_BIT_Y_SE     | TRACKDIR_BIT_Y_NW,                                                   /* TRACK_X     */
 	TRACKDIR_BIT_X_NE     | TRACKDIR_BIT_X_SW,                                                   /* TRACK_Y     */
 	TRACKDIR_BIT_RIGHT_N  | TRACKDIR_BIT_RIGHT_S  | TRACKDIR_BIT_LEFT_N  | TRACKDIR_BIT_LEFT_S,  /* TRACK_UPPER */
@@ -67,7 +73,7 @@
 
 /* Maps a trackdir to the (4-way) direction the tile is exited when following
  * that trackdir */
-extern const DiagDirection _trackdir_to_exitdir[] = {
+extern const DiagDirection _trackdir_to_exitdir[TRACKDIR_END] = {
 	DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_SW, DIAGDIR_SE, DIAGDIR_NE, DIAGDIR_NE,
 	DIAGDIR_SW, DIAGDIR_NW, DIAGDIR_NW, DIAGDIR_SW, DIAGDIR_NW, DIAGDIR_NE,
 };
@@ -130,11 +136,7 @@
 			break;
 
 		case MP_TUNNELBRIDGE:
-			if (IsTunnel(tile)) {
-				if (GetTunnelTransportType(tile) == TRANSPORT_RAIL) return GetRailType(tile);
-			} else {
-				if (GetBridgeTransportType(tile) == TRANSPORT_RAIL) return GetRailType(tile);
-			}
+			if (GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL) return GetRailType(tile);
 			break;
 
 		default:
@@ -142,3 +144,43 @@
 	}
 	return INVALID_RAILTYPE;
 }
+
+bool HasRailtypeAvail(const PlayerID p, const RailType railtype)
+{
+	return HasBit(GetPlayer(p)->avail_railtypes, railtype);
+}
+
+bool ValParamRailtype(const RailType rail)
+{
+	return HasRailtypeAvail(_current_player, rail);
+}
+
+RailType GetBestRailtype(const PlayerID p)
+{
+	if (HasRailtypeAvail(p, RAILTYPE_MAGLEV)) return RAILTYPE_MAGLEV;
+	if (HasRailtypeAvail(p, RAILTYPE_MONO)) return RAILTYPE_MONO;
+	if (HasRailtypeAvail(p, RAILTYPE_ELECTRIC)) return RAILTYPE_ELECTRIC;
+	return RAILTYPE_RAIL;
+}
+
+RailTypes GetPlayerRailtypes(PlayerID p)
+{
+	RailTypes rt = RAILTYPES_NONE;
+
+	for (EngineID i = 0; i != TOTAL_NUM_ENGINES; i++) {
+		const Engine* e = GetEngine(i);
+		const EngineInfo *ei = EngInfo(i);
+
+		if (e->type == VEH_TRAIN && HasBit(ei->climates, _opt.landscape) &&
+				(HasBit(e->player_avail, p) || _date >= e->intro_date + 365)) {
+			const RailVehicleInfo *rvi = RailVehInfo(i);
+
+			if (rvi->railveh_type != RAILVEH_WAGON) {
+				assert(rvi->railtype < RAILTYPE_END);
+				SetBit(rt, rvi->railtype);
+			}
+		}
+	}
+
+	return rt;
+}
--- a/src/rail.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/rail.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,200 +5,13 @@
 #ifndef RAIL_H
 #define RAIL_H
 
-#include "gfx.h"
-#include "direction.h"
-#include "tile.h"
-#include "variables.h"
-
-/**
- * Enumeration for all possible railtypes.
- *
- * This enumeration defines all 4 possible railtypes.
- */
-enum RailType {
-	RAILTYPE_BEGIN    = 0,          ///< Used for iterations
-	RAILTYPE_RAIL     = 0,          ///< Standard non-electric rails
-	RAILTYPE_ELECTRIC = 1,          ///< Electric rails
-	RAILTYPE_MONO     = 2,          ///< Monorail
-	RAILTYPE_MAGLEV   = 3,          ///< Maglev
-	RAILTYPE_END,                   ///< Used for iterations
-	INVALID_RAILTYPE  = 0xFF        ///< Flag for invalid railtype
-};
-
-typedef byte RailTypeMask;
-
-/** Allow incrementing of Track variables */
-DECLARE_POSTFIX_INCREMENT(RailType);
-/** Define basic enum properties */
-template <> struct EnumPropsT<RailType> : MakeEnumPropsT<RailType, byte, RAILTYPE_BEGIN, RAILTYPE_END, INVALID_RAILTYPE> {};
-typedef TinyEnumT<RailType> RailTypeByte;
-
-
-/**
- * These are used to specify a single track.
- * Can be translated to a trackbit with TrackToTrackbit
- */
-enum Track {
-	TRACK_BEGIN = 0,        ///< Used for iterations
-	TRACK_X     = 0,        ///< Track along the x-axis (north-east to south-west)
-	TRACK_Y     = 1,        ///< Track along the y-axis (north-west to south-east)
-	TRACK_UPPER = 2,        ///< Track in the upper corner of the tile (north)
-	TRACK_LOWER = 3,        ///< Track in the lower corner of the tile (south)
-	TRACK_LEFT  = 4,        ///< Track in the left corner of the tile (west)
-	TRACK_RIGHT = 5,        ///< Track in the right corner of the tile (east)
-	TRACK_END,              ///< Used for iterations
-	INVALID_TRACK = 0xFF    ///< Flag for an invalid track
-};
-
-/** Allow incrementing of Track variables */
-DECLARE_POSTFIX_INCREMENT(Track);
-/** Define basic enum properties */
-template <> struct EnumPropsT<Track> : MakeEnumPropsT<Track, byte, TRACK_BEGIN, TRACK_END, INVALID_TRACK> {};
-typedef TinyEnumT<Track> TrackByte;
-
-
-/**
- * Convert an Axis to the corresponding Track
- * AXIS_X -> TRACK_X
- * AXIS_Y -> TRACK_Y
- * Uses the fact that they share the same internal encoding
- *
- * @param a the axis to convert
- * @return the track corresponding to the axis
- */
-static inline Track AxisToTrack(Axis a)
-{
-	return (Track)a;
-}
-
-
-/** Bitfield corresponding to Track */
-enum TrackBits {
-	TRACK_BIT_NONE    = 0U,                                                 ///< No track
-	TRACK_BIT_X       = 1U << TRACK_X,                                      ///< X-axis track
-	TRACK_BIT_Y       = 1U << TRACK_Y,                                      ///< Y-axis track
-	TRACK_BIT_UPPER   = 1U << TRACK_UPPER,                                  ///< Upper track
-	TRACK_BIT_LOWER   = 1U << TRACK_LOWER,                                  ///< Lower track
-	TRACK_BIT_LEFT    = 1U << TRACK_LEFT,                                   ///< Left track
-	TRACK_BIT_RIGHT   = 1U << TRACK_RIGHT,                                  ///< Right track
-	TRACK_BIT_CROSS   = TRACK_BIT_X     | TRACK_BIT_Y,                      ///< X-Y-axis cross
-	TRACK_BIT_HORZ    = TRACK_BIT_UPPER | TRACK_BIT_LOWER,                  ///< Upper and lower track
-	TRACK_BIT_VERT    = TRACK_BIT_LEFT  | TRACK_BIT_RIGHT,                  ///< Left and right track
-	TRACK_BIT_3WAY_NE = TRACK_BIT_X     | TRACK_BIT_UPPER | TRACK_BIT_RIGHT,///< "Arrow" to the north-east
-	TRACK_BIT_3WAY_SE = TRACK_BIT_Y     | TRACK_BIT_LOWER | TRACK_BIT_RIGHT,///< "Arrow" to the south-east
-	TRACK_BIT_3WAY_SW = TRACK_BIT_X     | TRACK_BIT_LOWER | TRACK_BIT_LEFT, ///< "Arrow" to the south-west
-	TRACK_BIT_3WAY_NW = TRACK_BIT_Y     | TRACK_BIT_UPPER | TRACK_BIT_LEFT, ///< "Arrow" to the north-west
-	TRACK_BIT_ALL     = TRACK_BIT_CROSS | TRACK_BIT_HORZ  | TRACK_BIT_VERT, ///< All possible tracks
-	TRACK_BIT_MASK    = 0x3FU,                                              ///< Bitmask for the first 6 bits
-	TRACK_BIT_WORMHOLE = 0x40U,                                             ///< Bitflag for a wormhole (used for tunnels)
-	TRACK_BIT_DEPOT   = 0x80U,                                              ///< Bitflag for a depot
-	INVALID_TRACK_BIT = 0xFF                                                ///< Flag for an invalid trackbits value
-};
-
-/** Define basic enum properties */
-template <> struct EnumPropsT<TrackBits> : MakeEnumPropsT<TrackBits, byte, TRACK_BIT_NONE, TRACK_BIT_ALL, INVALID_TRACK_BIT> {};
-typedef TinyEnumT<TrackBits> TrackBitsByte;
-
-DECLARE_ENUM_AS_BIT_SET(TrackBits);
-
-/**
- * Maps a Track to the corresponding TrackBits value
- * @param track the track to convert
- * @return the converted TrackBits value of the track
- */
-static inline TrackBits TrackToTrackBits(Track track)
-{
-	return (TrackBits)(1 << track);
-}
-
-/**
- * Maps an Axis to the corresponding TrackBits value
- * @param a the axis to convert
- * @return the converted TrackBits value of the axis
- */
-static inline TrackBits AxisToTrackBits(Axis a)
-{
-	return TrackToTrackBits(AxisToTrack(a));
-}
-
-/**
- * Returns a single horizontal/vertical trackbit, that is in a specific tile corner.
- *
- * @param corner The corner of a tile.
- * @return The TrackBits of the track in the corner.
- */
-static inline TrackBits CornerToTrackBits(Corner corner)
-{
-	extern const TrackBits _corner_to_trackbits[];
-	assert(IsValidCorner(corner));
-	return _corner_to_trackbits[corner];
-}
-
-
-/**
- * Enumeration for tracks and directions.
- *
- * These are a combination of tracks and directions. Values are 0-5 in one
- * direction (corresponding to the Track enum) and 8-13 in the other direction.
- * 6, 7, 14 and 15 are used to encode the reversing of road vehicles. Those
- * reversing track dirs are not considered to be 'valid' except in a small
- * corner in the road vehicle controller.
- */
-enum Trackdir {
-	TRACKDIR_BEGIN    =  0,         ///< Used for iterations
-	TRACKDIR_X_NE     =  0,         ///< X-axis and direction to north-east
-	TRACKDIR_Y_SE     =  1,         ///< Y-axis and direction to south-east
-	TRACKDIR_UPPER_E  =  2,         ///< Upper track and direction to east
-	TRACKDIR_LOWER_E  =  3,         ///< Lower track and direction to east
-	TRACKDIR_LEFT_S   =  4,         ///< Left track and direction to south
-	TRACKDIR_RIGHT_S  =  5,         ///< Right track and direction to south
-	TRACKDIR_RVREV_NE =  6,         ///< (Road vehicle) reverse direction north-east
-	TRACKDIR_RVREV_SE =  7,         ///< (Road vehicle) reverse direction south-east
-	TRACKDIR_X_SW     =  8,         ///< X-axis and direction to south-west
-	TRACKDIR_Y_NW     =  9,         ///< Y-axis and direction to north-west
-	TRACKDIR_UPPER_W  = 10,         ///< Upper track and direction to west
-	TRACKDIR_LOWER_W  = 11,         ///< Lower track and direction to west
-	TRACKDIR_LEFT_N   = 12,         ///< Left track and direction to north
-	TRACKDIR_RIGHT_N  = 13,         ///< Right track and direction to north
-	TRACKDIR_RVREV_SW = 14,         ///< (Road vehicle) reverse direction south-west
-	TRACKDIR_RVREV_NW = 15,         ///< (Road vehicle) reverse direction north-west
-	TRACKDIR_END,                   ///< Used for iterations
-	INVALID_TRACKDIR  = 0xFF,       ///< Flag for an invalid trackdir
-};
-
-/** Define basic enum properties */
-template <> struct EnumPropsT<Trackdir> : MakeEnumPropsT<Trackdir, byte, TRACKDIR_BEGIN, TRACKDIR_END, INVALID_TRACKDIR> {};
-typedef TinyEnumT<Trackdir> TrackdirByte;
-
-/**
- * Enumeration of bitmasks for the TrackDirs
- *
- * These are a combination of tracks and directions. Values are 0-5 in one
- * direction (corresponding to the Track enum) and 8-13 in the other direction.
- */
-enum TrackdirBits {
-	TRACKDIR_BIT_NONE     = 0x0000, ///< No track build
-	TRACKDIR_BIT_X_NE     = 0x0001, ///< Track x-axis, direction north-east
-	TRACKDIR_BIT_Y_SE     = 0x0002, ///< Track y-axis, direction south-east
-	TRACKDIR_BIT_UPPER_E  = 0x0004, ///< Track upper, direction east
-	TRACKDIR_BIT_LOWER_E  = 0x0008, ///< Track lower, direction east
-	TRACKDIR_BIT_LEFT_S   = 0x0010, ///< Track left, direction south
-	TRACKDIR_BIT_RIGHT_S  = 0x0020, ///< Track right, direction south
-	/* Again, note the two missing values here. This enables trackdir -> track conversion by doing (trackdir & 0xFF) */
-	TRACKDIR_BIT_X_SW     = 0x0100, ///< Track x-axis, direction south-west
-	TRACKDIR_BIT_Y_NW     = 0x0200, ///< Track y-axis, direction north-west
-	TRACKDIR_BIT_UPPER_W  = 0x0400, ///< Track upper, direction west
-	TRACKDIR_BIT_LOWER_W  = 0x0800, ///< Track lower, direction west
-	TRACKDIR_BIT_LEFT_N   = 0x1000, ///< Track left, direction north
-	TRACKDIR_BIT_RIGHT_N  = 0x2000, ///< Track right, direction north
-	TRACKDIR_BIT_MASK     = 0x3F3F, ///< Bitmask for bit-operations
-	INVALID_TRACKDIR_BIT  = 0xFFFF, ///< Flag for an invalid trackdirbit value
-};
-
-/** Define basic enum properties */
-template <> struct EnumPropsT<TrackdirBits> : MakeEnumPropsT<TrackdirBits, uint16, TRACKDIR_BIT_NONE, TRACKDIR_BIT_MASK, INVALID_TRACKDIR_BIT> {};
-typedef TinyEnumT<TrackdirBits> TrackdirBitsShort;
-DECLARE_ENUM_AS_BIT_SET(TrackdirBits);
+#include "rail_type.h"
+#include "track_type.h"
+#include "vehicle_type.h"
+#include "gfx_type.h"
+#include "core/bitmath_func.hpp"
+#include "economy_func.h"
+#include "tile_cmd.h"
 
 /** This struct contains all the info that is needed to draw and construct tracks.
  */
@@ -251,10 +64,10 @@
 	SpriteID snow_offset;
 
 	/** bitmask to the OTHER railtypes on which an engine of THIS railtype generates power */
-	RailTypeMask powered_railtypes;
+	RailTypes powered_railtypes;
 
 	/** bitmask to the OTHER railtypes on which an engine of THIS railtype can physically travel */
-	RailTypeMask compatible_railtypes;
+	RailTypes compatible_railtypes;
 
 	/**
 	 * Offset between the current railtype and normal rail. This means that:<p>
@@ -275,467 +88,13 @@
 	 * Offset to add to ground sprite when drawing custom waypoints / stations
 	 */
 	byte custom_ground_offset;
-};
-
 
-/** these are the maximums used for updating signal blocks, and checking if a depot is in a pbs block */
-enum {
-	NUM_SSD_ENTRY = 256, ///< max amount of blocks
-	NUM_SSD_STACK =  32, ///< max amount of blocks to check recursively
+	/**
+	 * Multiplier for curve maximum speed advantage
+	 */
+	byte curve_speed;
 };
 
-/**
- * Maps a Trackdir to the corresponding TrackdirBits value
- * @param trackdir the track direction to convert
- * @return the converted TrackdirBits value
- */
-static inline TrackdirBits TrackdirToTrackdirBits(Trackdir trackdir)
-{
-	return (TrackdirBits)(1 << trackdir);
-}
-
-/**
- * Removes first Track from TrackBits and returns it
- *
- * This function searchs for the first bit in the TrackBits,
- * remove this bit from the parameter and returns the found
- * bit as Track value. It returns INVALID_TRACK if the
- * parameter was TRACK_BIT_NONE or INVALID_TRACK_BIT. This
- * is basically used in while-loops to get up to 6 possible
- * tracks on a tile until the parameter becomes TRACK_BIT_NONE.
- *
- * @param tracks The value with the TrackBits
- * @return The first Track from the TrackBits value
- * @see FindFirstTrack
- */
-static inline Track RemoveFirstTrack(TrackBits *tracks)
-{
-	if (*tracks != TRACK_BIT_NONE && *tracks != INVALID_TRACK_BIT) {
-		Track first = (Track)FIND_FIRST_BIT(*tracks);
-		ClrBit(*tracks, first);
-		return first;
-	}
-	return INVALID_TRACK;
-}
-
-/**
- * Removes first Trackdir from TrackdirBits and returns it
- *
- * This function searchs for the first bit in the TrackdirBits parameter,
- * remove this bit from the parameter and returns the fnound bit as
- * Trackdir value. It returns INVALID_TRACKDIR if the trackdirs is
- * TRACKDIR_BIT_NONE or INVALID_TRACKDIR_BIT. This is basically used in a
- * while-loop to get all track-directions step by step until the value
- * reaches TRACKDIR_BIT_NONE.
- *
- * @param trackdirs The value with the TrackdirBits
- * @return The first Trackdir from the TrackdirBits value
- * @see FindFirstTrackdir
- */
-static inline Trackdir RemoveFirstTrackdir(TrackdirBits *trackdirs)
-{
-	if (*trackdirs != TRACKDIR_BIT_NONE && *trackdirs != INVALID_TRACKDIR_BIT) {
-		Trackdir first = (Trackdir)FindFirstBit2x64(*trackdirs);
-		ClrBit(*trackdirs, first);
-		return first;
-	}
-	return INVALID_TRACKDIR;
-}
-
-/**
- * Returns first Track from TrackBits or INVALID_TRACK
- *
- * This function returns the first Track found in the TrackBits value as Track-value.
- * It returns INVALID_TRACK if the parameter is TRACK_BIT_NONE or INVALID_TRACK_BIT.
- *
- * @param tracks The TrackBits value
- * @return The first Track found or INVALID_TRACK
- * @see RemoveFirstTrack
- */
-static inline Track FindFirstTrack(TrackBits tracks)
-{
-	return (tracks != TRACK_BIT_NONE && tracks != INVALID_TRACK_BIT) ? (Track)FIND_FIRST_BIT(tracks) : INVALID_TRACK;
-}
-
-/**
- * Converts TrackBits to Track.
- *
- * This function converts a TrackBits value to a Track value. As it
- * is not possible to convert two or more tracks to one track the
- * parameter must contain only one track or be the INVALID_TRACK_BIT value.
- *
- * @param tracks The TrackBits value to convert
- * @return The Track from the value or INVALID_TRACK
- * @pre tracks must contains only one Track or be INVALID_TRACK_BIT
- */
-static inline Track TrackBitsToTrack(TrackBits tracks)
-{
-	assert(tracks == INVALID_TRACK_BIT || (tracks != TRACK_BIT_NONE && KillFirstBit(tracks & TRACK_BIT_MASK) == TRACK_BIT_NONE));
-	return tracks != INVALID_TRACK_BIT ? (Track)FIND_FIRST_BIT(tracks & TRACK_BIT_MASK) : INVALID_TRACK;
-}
-
-/**
- * Returns first Trackdir from TrackdirBits or INVALID_TRACKDIR
- *
- * This function returns the first Trackdir in the given TrackdirBits value or
- * INVALID_TRACKDIR if the value is TRACKDIR_BIT_NONE. The TrackdirBits must
- * not be INVALID_TRACKDIR_BIT.
- *
- * @param trackdirs The TrackdirBits value
- * @return The first Trackdir from the TrackdirBits or INVALID_TRACKDIR on TRACKDIR_BIT_NONE.
- * @pre trackdirs must not be INVALID_TRACKDIR_BIT
- * @see RemoveFirstTrackdir
- */
-static inline Trackdir FindFirstTrackdir(TrackdirBits trackdirs)
-{
-	assert((trackdirs & ~TRACKDIR_BIT_MASK) == TRACKDIR_BIT_NONE);
-	return (trackdirs != TRACKDIR_BIT_NONE) ? (Trackdir)FindFirstBit2x64(trackdirs) : INVALID_TRACKDIR;
-}
-
-/**
- * Checks if a Track is valid.
- *
- * @param track The value to check
- * @return true if the given value is a valid track.
- * @note Use this in an assert()
- */
-static inline bool IsValidTrack(Track track)
-{
-	return track < TRACK_END;
-}
-
-/**
- * Checks if a Trackdir is valid.
- *
- * @param trackdir The value to check
- * @return true if the given valie is a valid Trackdir
- * @note Use this in an assert()
- */
-static inline bool IsValidTrackdir(Trackdir trackdir)
-{
-	return (TrackdirToTrackdirBits(trackdir) & TRACKDIR_BIT_MASK) != 0;
-}
-
-/*
- * Functions to map tracks to the corresponding bits in the signal
- * presence/status bytes in the map. You should not use these directly, but
- * wrapper functions below instead. XXX: Which are these?
- */
-
-/**
- * Maps a trackdir to the bit that stores its status in the map arrays, in the
- * direction along with the trackdir.
- */
-static inline byte SignalAlongTrackdir(Trackdir trackdir)
-{
-	extern const byte _signal_along_trackdir[TRACKDIR_END];
-	return _signal_along_trackdir[trackdir];
-}
-
-/**
- * Maps a trackdir to the bit that stores its status in the map arrays, in the
- * direction against the trackdir.
- */
-static inline byte SignalAgainstTrackdir(Trackdir trackdir)
-{
-	extern const byte _signal_against_trackdir[TRACKDIR_END];
-	return _signal_against_trackdir[trackdir];
-}
-
-/**
- * Maps a Track to the bits that store the status of the two signals that can
- * be present on the given track.
- */
-static inline byte SignalOnTrack(Track track)
-{
-	extern const byte _signal_on_track[TRACK_END];
-	return _signal_on_track[track];
-}
-
-
-/*
- * Functions describing logical relations between Tracks, TrackBits, Trackdirs
- * TrackdirBits, Direction and DiagDirections.
- */
-
-/**
- * Maps a trackdir to the reverse trackdir.
- *
- * Returns the reverse trackdir of a Trackdir value. The reverse trackdir
- * is the same track with the other direction on it.
- *
- * @param trackdir The Trackdir value
- * @return The reverse trackdir
- * @pre trackdir must not be INVALID_TRACKDIR
- */
-static inline Trackdir ReverseTrackdir(Trackdir trackdir)
-{
-	assert(trackdir != INVALID_TRACKDIR);
-	return (Trackdir)(trackdir ^ 8);
-}
-
-/**
- * Returns the Track that a given Trackdir represents
- *
- * This function filters the Track which is used in the Trackdir value and
- * returns it as a Track value.
- *
- * @param trackdir The trackdir value
- * @return The Track which is used in the value
- */
-static inline Track TrackdirToTrack(Trackdir trackdir)
-{
-	return (Track)(trackdir & 0x7);
-}
-
-/**
- * Returns a Trackdir for the given Track
- *
- * Since every Track corresponds to two Trackdirs, we choose the
- * one which points between NE and S. Note that the actual
- * implementation is quite futile, but this might change
- * in the future.
- *
- * @param track The given Track
- * @return The Trackdir from the given Track
- */
-static inline Trackdir TrackToTrackdir(Track track)
-{
-	return (Trackdir)track;
-}
-
-/**
- * Returns a TrackdirBit mask from a given Track
- *
- * The TrackdirBit mask contains the two TrackdirBits that
- * correspond with the given Track (one for each direction).
- *
- * @param track The track to get the TrackdirBits from
- * @return The TrackdirBits which the selected tracks
- */
-static inline TrackdirBits TrackToTrackdirBits(Track track)
-{
-	Trackdir td = TrackToTrackdir(track);
-	return (TrackdirBits)(TrackdirToTrackdirBits(td) | TrackdirToTrackdirBits(ReverseTrackdir(td)));
-}
-
-/**
- * Discards all directional information from a TrackdirBits value
- *
- * Any Track which is present in either direction will be present in the result.
- *
- * @param bits The TrackdirBits to get the TrackBits from
- * @return The TrackBits
- */
-static inline TrackBits TrackdirBitsToTrackBits(TrackdirBits bits)
-{
-	return (TrackBits)((bits | (bits >> 8)) & TRACK_BIT_MASK);
-}
-
-/**
- * Maps a trackdir to the trackdir that you will end up on if you go straight
- * ahead.
- *
- * This will be the same trackdir for diagonal trackdirs, but a
- * different (alternating) one for straight trackdirs
- *
- * @param trackdir The given trackdir
- * @return The next Trackdir value of the next tile.
- */
-static inline Trackdir NextTrackdir(Trackdir trackdir)
-{
-	extern const Trackdir _next_trackdir[TRACKDIR_END];
-	return _next_trackdir[trackdir];
-}
-
-/**
- * Maps a track to all tracks that make 90 deg turns with it.
- *
- * For the diagonal directions these are the complement of the
- * direction, for the straight directions these are the
- * two vertical or horizontal tracks, depend on the given direction
- *
- * @param track The given track
- * @return The TrackBits with the tracks marked which cross the given track by 90 deg.
- */
-static inline TrackBits TrackCrossesTracks(Track track)
-{
-	extern const TrackBits _track_crosses_tracks[TRACK_END];
-	return _track_crosses_tracks[track];
-}
-
-/**
- * Maps a trackdir to the (4-way) direction the tile is exited when following
- * that trackdir.
- *
- * For the diagonal directions these are the same directions. For
- * the straight directions these are the directions from the imagined
- * base-tile to the bordering tile which will be joined if the given
- * straight direction is leaved from the base-tile.
- *
- * @param trackdir The given track direction
- * @return The direction which points to the resulting tile if following the Trackdir
- */
-static inline DiagDirection TrackdirToExitdir(Trackdir trackdir)
-{
-	extern const DiagDirection _trackdir_to_exitdir[TRACKDIR_END];
-	return _trackdir_to_exitdir[trackdir];
-}
-
-/**
- * Maps a track and an (4-way) dir to the trackdir that represents the track
- * with the exit in the given direction.
- *
- * For the diagonal tracks the resulting track direction are clear for a given
- * DiagDirection. It either matches the direction or it returns INVALID_TRACKDIR,
- * as a TRACK_X cannot be applied with DIAG_SE.
- * For the straight tracks the resulting track direction will be the
- * direction which the DiagDirection is pointing. But this will be INVALID_TRACKDIR
- * if the DiagDirection is pointing 'away' the track.
- *
- * @param track The track to applie an direction on
- * @param diagdir The DiagDirection to applie on
- * @return The resulting track direction or INVALID_TRACKDIR if not possible.
- */
-static inline Trackdir TrackExitdirToTrackdir(Track track, DiagDirection diagdir)
-{
-	extern const Trackdir _track_exitdir_to_trackdir[TRACK_END][DIAGDIR_END];
-	return _track_exitdir_to_trackdir[track][diagdir];
-}
-
-/**
- * Maps a track and an (4-way) dir to the trackdir that represents the track
- * with the entry in the given direction.
- *
- * For the diagonal tracks the return value is clear, its either the matching
- * track direction or INVALID_TRACKDIR.
- * For the straight tracks this returns the track direction which results if
- * you follow the DiagDirection and then turn by 45 deg left or right on the
- * next tile. The new direction on the new track will be the returning Trackdir
- * value. If the parameters makes no sense like the track TRACK_UPPER and the
- * diraction DIAGDIR_NE (target track cannot be reached) this function returns
- * INVALID_TRACKDIR.
- *
- * @param track The target track
- * @param diagdir The direction to "come from"
- * @return the resulting Trackdir or INVALID_TRACKDIR if not possible.
- */
-static inline Trackdir TrackEnterdirToTrackdir(Track track, DiagDirection diagdir)
-{
-	extern const Trackdir _track_enterdir_to_trackdir[TRACK_END][DIAGDIR_END];
-	return _track_enterdir_to_trackdir[track][diagdir];
-}
-
-/**
- * Maps a track and a full (8-way) direction to the trackdir that represents
- * the track running in the given direction.
- */
-static inline Trackdir TrackDirectionToTrackdir(Track track, Direction dir)
-{
-	extern const Trackdir _track_direction_to_trackdir[TRACK_END][DIR_END];
-	return _track_direction_to_trackdir[track][dir];
-}
-
-/**
- * Maps a (4-way) direction to the diagonal trackdir that runs in that
- * direction.
- *
- * @param diagdir The direction
- * @return The resulting Trackdir direction
- */
-static inline Trackdir DiagdirToDiagTrackdir(DiagDirection diagdir)
-{
-	extern const Trackdir _dir_to_diag_trackdir[DIAGDIR_END];
-	return _dir_to_diag_trackdir[diagdir];
-}
-
-/**
- * Returns all trackdirs that can be reached when entering a tile from a given
- * (diagonal) direction.
- *
- * This will obviously include 90 degree turns, since no information is available
- * about the exact angle of entering
- *
- * @param diagdir The joining direction
- * @return The TrackdirBits which can be used from the given direction
- * @see DiagdirReachesTracks
- */
-static inline TrackdirBits DiagdirReachesTrackdirs(DiagDirection diagdir)
-{
-	extern const TrackdirBits _exitdir_reaches_trackdirs[DIAGDIR_END];
-	return _exitdir_reaches_trackdirs[diagdir];
-}
-
-/**
- * Returns all tracks that can be reached when entering a tile from a given
- * (diagonal) direction.
- *
- * This will obviously include 90 degree turns, since no
- * information is available about the exact angle of entering
- *
- * @param diagdir The joining irection
- * @return The tracks which can be used
- * @see DiagdirReachesTrackdirs
- */
-static inline TrackBits DiagdirReachesTracks(DiagDirection diagdir) { return TrackdirBitsToTrackBits(DiagdirReachesTrackdirs(diagdir)); }
-
-/**
- * Maps a trackdir to the trackdirs that can be reached from it (ie, when
- * entering the next tile.
- *
- * This will include 90 degree turns!
- *
- * @param trackdir The track direction which will be leaved
- * @return The track directions which can be used from this direction (in the next tile)
- */
-static inline TrackdirBits TrackdirReachesTrackdirs(Trackdir trackdir)
-{
-	extern const TrackdirBits _exitdir_reaches_trackdirs[DIAGDIR_END];
-	return _exitdir_reaches_trackdirs[TrackdirToExitdir(trackdir)];
-}
-/* Note that there is no direct table for this function (there used to be),
- * but it uses two simpeler tables to achieve the result */
-
-/**
- * Maps a trackdir to all trackdirs that make 90 deg turns with it.
- *
- * For the diagonal tracks this returns the track direction bits
- * of the other axis in both directions, which cannot be joined by
- * the given track direction.
- * For the straight tracks this returns all possible 90 deg turns
- * either on the current tile (which no train can joined) or on the
- * bordering tiles.
- *
- * @param trackdir The track direction
- * @return The TrackdirBits which are (more or less) 90 deg turns.
- */
-static inline TrackdirBits TrackdirCrossesTrackdirs(Trackdir trackdir)
-{
-	extern const TrackdirBits _track_crosses_trackdirs[TRACKDIR_END];
-	return _track_crosses_trackdirs[TrackdirToTrack(trackdir)];
-}
-
-/**
- * Checks if a given Track is diagonal
- *
- * @param track The given track to check
- * @return true if diagonal, else false
- */
-static inline bool IsDiagonalTrack(Track track)
-{
-	return (track == TRACK_X) || (track == TRACK_Y);
-}
-
-/**
- * Checks if a given Trackdir is diagonal.
- *
- * @param trackdir The given trackdir
- * @return true if the trackdir use a diagonal track
- */
-static inline bool IsDiagonalTrackdir(Trackdir trackdir)
-{
-	return IsDiagonalTrack(TrackdirToTrack(trackdir));
-}
 
 /**
  * Returns a pointer to the Railtype information for a given railtype
@@ -775,23 +134,6 @@
 	return HasBit(GetRailTypeInfo(enginetype)->powered_railtypes, tiletype);
 }
 
-/**
- * Checks if the given tracks overlap, ie form a crossing. Basically this
- * means when there is more than one track on the tile, exept when there are
- * two parallel tracks.
- * @param  bits The tracks present.
- * @return Whether the tracks present overlap in any way.
- */
-static inline bool TracksOverlap(TrackBits bits)
-{
-	/* With no, or only one track, there is no overlap */
-	if (bits == TRACK_BIT_NONE || KillFirstBit(bits) == TRACK_BIT_NONE) return false;
-	/* We know that there are at least two tracks present. When there are more
-	 * than 2 tracks, they will surely overlap. When there are two, they will
-	 * always overlap unless they are lower & upper or right & left. */
-	return bits != TRACK_BIT_HORZ && bits != TRACK_BIT_VERT;
-}
-
 
 extern int _railtype_cost_multiplier[RAILTYPE_END];
 extern const int _default_railtype_cost_multiplier[RAILTYPE_END];
@@ -807,9 +149,38 @@
 	return (_price.build_rail * _railtype_cost_multiplier[railtype]) >> 3;
 }
 
+/**
+ * Calculates the cost of rail conversion
+ * @param from The railtype we are converting from
+ * @param to   The railtype we are converting to
+ * @return Cost per TrackBit
+ */
+static inline Money RailConvertCost(RailType from, RailType to)
+{
+	/* rail -> el. rail
+	 * calculate the price as 5 / 4 of (cost build el. rail) - (cost build rail)
+	 * (the price of workers to get to place is that 1/4)
+	 */
+	if (HasPowerOnRail(from, to)) {
+		return ((RailBuildCost(to) - RailBuildCost(from)) * 5) >> 2;
+	}
+
+	/* el. rail -> rail
+	 * calculate the price as 1 / 4 of (cost build el. rail) - (cost build rail)
+	 * (the price of workers is 1 / 4 + price of copper sold to a recycle center)
+	 */
+	if (HasPowerOnRail(to, from)) {
+		return (RailBuildCost(from) - RailBuildCost(to)) >> 2;
+	}
+
+	/* make the price the same as remove + build new type */
+	return RailBuildCost(to) + _price.remove_rail;
+}
+
 void *UpdateTrainPowerProc(Vehicle *v, void *data);
 void DrawTrainDepotSprite(int x, int y, int image, RailType railtype);
 void DrawDefaultWaypointSprite(int x, int y, RailType railtype);
+void *EnsureNoTrainOnTrackProc(Vehicle *v, void *data);
 
 /**
  * Draws overhead wires and pylons for electric railways.
@@ -821,8 +192,37 @@
 
 Foundation GetRailFoundation(Slope tileh, TrackBits bits);
 
-void FloodHalftile(TileIndex t);
-
 int32 SettingsDisableElrail(int32 p1); ///< _patches.disable_elrail callback
 
+/**
+ * Finds out if a Player has a certain railtype available
+ * @param p Player in question
+ * @param railtype requested RailType
+ * @return true if player has requested RailType available
+ */
+bool HasRailtypeAvail(const PlayerID p, const RailType railtype);
+
+/**
+ * Validate functions for rail building.
+ * @param rail the railtype to check.
+ * @return true if the current player may build the rail.
+ */
+bool ValParamRailtype(const RailType rail);
+
+/**
+ * Returns the "best" railtype a player can build.
+ * As the AI doesn't know what the BEST one is, we have our own priority list
+ * here. When adding new railtypes, modify this function
+ * @param p the player "in action"
+ * @return The "best" railtype a player has available
+ */
+RailType GetBestRailtype(const PlayerID p);
+
+/**
+ * Get the rail types the given player can build.
+ * @param p the player to get the rail types for.
+ * @return the rail types.
+ */
+RailTypes GetPlayerRailtypes(const PlayerID p);
+
 #endif /* RAIL_H */
--- a/src/rail_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/rail_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -8,30 +8,22 @@
 #include "bridge.h"
 #include "cmd_helper.h"
 #include "debug.h"
-#include "functions.h"
+#include "tile_cmd.h"
 #include "rail_map.h"
 #include "road_map.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "map.h"
 #include "landscape.h"
-#include "tile.h"
 #include "town_map.h"
 #include "tunnel_map.h"
-#include "vehicle.h"
-#include "viewport.h"
-#include "command.h"
+#include "viewport_func.h"
+#include "command_func.h"
 #include "pathfind.h"
 #include "engine.h"
 #include "town.h"
-#include "sound.h"
 #include "station.h"
 #include "sprite.h"
 #include "depot.h"
 #include "waypoint.h"
-#include "window.h"
 #include "rail.h"
-#include "railtypes.h" // include table for railtypes
 #include "newgrf.h"
 #include "yapf/yapf.h"
 #include "newgrf_engine.h"
@@ -39,9 +31,19 @@
 #include "newgrf_station.h"
 #include "train.h"
 #include "misc/autoptr.hpp"
+#include "variables.h"
 #include "autoslope.h"
 #include "transparency.h"
 #include "water.h"
+#include "tunnelbridge_map.h"
+#include "window_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "signal_func.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
+#include "table/railtypes.h"
 
 const byte _track_sloped_sprites[14] = {
 	14, 15, 22, 13,
@@ -82,21 +84,14 @@
  *               11uuuudd => rail depot
  */
 
-/** Struct used in EnsureNoTrainOnTrack() */
-struct TrainOnTrackData {
-	TileIndex tile;       ///< tile to check
-	uint z;               ///< tile max Z
-	TrackBits rail_bits;  ///< trackbits of interest
-};
 
-static void *EnsureNoTrainOnTrackProc(Vehicle *v, void *data)
+void *EnsureNoTrainOnTrackProc(Vehicle *v, void *data)
 {
-	const TrainOnTrackData *info = (const TrainOnTrackData *)data;
+	TrackBits rail_bits = *(TrackBits *)data;
 
-	if (v->tile != info->tile || v->type != VEH_TRAIN) return NULL;
-	if (v->z_pos > info->z) return NULL;
+	if (v->type != VEH_TRAIN) return NULL;
 
-	if ((v->u.rail.track != info->rail_bits) && !TracksOverlap(v->u.rail.track | info->rail_bits)) return NULL;
+	if ((v->u.rail.track != rail_bits) && !TracksOverlap(v->u.rail.track | rail_bits)) return NULL;
 
 	_error_message = VehicleInTheWayErrMsg(v);
 	return v;
@@ -111,13 +106,9 @@
  */
 static bool EnsureNoTrainOnTrack(TileIndex tile, Track track)
 {
-	TrainOnTrackData info;
+	TrackBits rail_bits = TrackToTrackBits(track);
 
-	info.tile = tile;
-	info.z = GetTileMaxZ(tile);
-	info.rail_bits = TrackToTrackBits(track);
-
-	return VehicleFromPos(tile, &info, EnsureNoTrainOnTrackProc) == NULL;
+	return VehicleFromPos(tile, &rail_bits, &EnsureNoTrainOnTrackProc) == NULL;
 }
 
 static bool CheckTrackCombination(TileIndex tile, TrackBits to_build, uint flags)
@@ -298,7 +289,7 @@
 	   ) return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
 
 	Foundation f_old = GetRailFoundation(tileh, existing);
-	return CommandCost(f_new != f_old ? _price.terraform : (Money)0);
+	return CommandCost(EXPENSES_CONSTRUCTION, f_new != f_old ? _price.terraform : (Money)0);
 }
 
 /* Validate functions for rail building */
@@ -313,21 +304,17 @@
 CommandCost CmdBuildSingleRail(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	Slope tileh;
-	RailType railtype;
-	Track track;
+	RailType railtype = (RailType)p1;
+	Track track = (Track)p2;
 	TrackBits trackbit;
-	CommandCost cost;
+	CommandCost cost(EXPENSES_CONSTRUCTION);
 	CommandCost ret;
 
-	if (!ValParamRailtype(p1) || !ValParamTrackOrientation((Track)p2)) return CMD_ERROR;
-	railtype = (RailType)p1;
-	track = (Track)p2;
+	if (!ValParamRailtype(railtype) || !ValParamTrackOrientation(track)) return CMD_ERROR;
 
 	tileh = GetTileSlope(tile, NULL);
 	trackbit = TrackToTrackBits(track);
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	switch (GetTileType(tile)) {
 		case MP_RAILWAY:
 			if (!CheckTrackCombination(tile, trackbit, flags) ||
@@ -396,6 +383,7 @@
 						(track == TRACK_Y && road == ROAD_X)) {
 					if (flags & DC_EXEC) {
 						MakeRoadCrossing(tile, GetRoadOwner(tile, ROADTYPE_ROAD), GetRoadOwner(tile, ROADTYPE_TRAM), GetRoadOwner(tile, ROADTYPE_HWAY), _current_player, (track == TRACK_X ? AXIS_Y : AXIS_X), railtype, roadtypes, GetTownIndex(tile));
+						UpdateLevelCrossing(tile, false);
 					}
 					break;
 				}
@@ -431,7 +419,7 @@
 
 	if (flags & DC_EXEC) {
 		MarkTileDirtyByTile(tile);
-		SetSignalsOnBothDir(tile, track);
+		AddTrackToSignalBuffer(tile, track, _current_player);
 		YapfNotifyTrackLayoutChange(tile, track);
 	}
 
@@ -448,13 +436,17 @@
 {
 	Track track = (Track)p2;
 	TrackBits trackbit;
-	CommandCost cost(_price.remove_rail);
+	CommandCost cost(EXPENSES_CONSTRUCTION, _price.remove_rail );
 	bool crossing = false;
 
 	if (!ValParamTrackOrientation((Track)p2)) return CMD_ERROR;
 	trackbit = TrackToTrackBits(track);
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
+	/* Need to read tile owner now because it may change when the rail is removed
+	 * Also, in case of floods, _current_player != owner
+	 * There may be invalid tiletype even in exec run (when removing long track),
+	 * so do not call GetTileOwner(tile) in any case here */
+	Owner owner = INVALID_OWNER;
 
 	switch (GetTileType(tile)) {
 		case MP_ROAD: {
@@ -466,6 +458,7 @@
 			}
 
 			if (flags & DC_EXEC) {
+				owner = GetTileOwner(tile);
 				MakeRoadNormal(tile, GetCrossingRoadBits(tile), GetRoadTypes(tile), GetTownIndex(tile), GetRoadOwner(tile, ROADTYPE_ROAD), GetRoadOwner(tile, ROADTYPE_TRAM), GetRoadOwner(tile, ROADTYPE_HWAY));
 			}
 			break;
@@ -489,6 +482,7 @@
 				cost.AddCost(DoCommand(tile, track, 0, flags, CMD_REMOVE_SIGNALS));
 
 			if (flags & DC_EXEC) {
+				owner = GetTileOwner(tile);
 				present ^= trackbit;
 				if (present == 0) {
 					if (GetRailGroundType(tile) == RAIL_GROUND_WATER) {
@@ -507,18 +501,21 @@
 	}
 
 	if (flags & DC_EXEC) {
+		/* if we got that far, 'owner' variable is set correctly */
+		assert(IsValidPlayer(owner));
+
 		MarkTileDirtyByTile(tile);
 		if (crossing) {
 			/* crossing is set when only TRACK_BIT_X and TRACK_BIT_Y are set. As we
 			 * are removing one of these pieces, we'll need to update signals for
 			 * both directions explicitly, as after the track is removed it won't
 			 * 'connect' with the other piece. */
-			SetSignalsOnBothDir(tile, TRACK_X);
-			SetSignalsOnBothDir(tile, TRACK_Y);
+			AddTrackToSignalBuffer(tile, TRACK_X, owner);
+			AddTrackToSignalBuffer(tile, TRACK_Y, owner);
 			YapfNotifyTrackLayoutChange(tile, TRACK_X);
 			YapfNotifyTrackLayoutChange(tile, TRACK_Y);
 		} else {
-			SetSignalsOnBothDir(tile, track);
+			AddTrackToSignalBuffer(tile, track, owner);
 			YapfNotifyTrackLayoutChange(tile, track);
 		}
 	}
@@ -532,10 +529,12 @@
  * The function floods the lower halftile, if the tile has a halftile foundation.
  *
  * @param t The tile to flood.
+ * @return true if something was flooded.
  */
-void FloodHalftile(TileIndex t)
+bool FloodHalftile(TileIndex t)
 {
-	if (GetRailGroundType(t) == RAIL_GROUND_WATER) return;
+	bool flooded = false;
+	if (GetRailGroundType(t) == RAIL_GROUND_WATER) return flooded;
 
 	Slope tileh = GetTileSlope(t, NULL);
 	TrackBits rail_bits = GetTrackBits(t);
@@ -546,20 +545,23 @@
 		TrackBits to_remove = lower_track & rail_bits;
 		if (to_remove != 0) {
 			_current_player = OWNER_WATER;
-			if (CmdFailed(DoCommand(t, 0, FIND_FIRST_BIT(to_remove), DC_EXEC, CMD_REMOVE_SINGLE_RAIL))) return; // not yet floodable
+			if (CmdFailed(DoCommand(t, 0, FIND_FIRST_BIT(to_remove), DC_EXEC, CMD_REMOVE_SINGLE_RAIL))) return flooded; // not yet floodable
+			flooded = true;
 			rail_bits = rail_bits & ~to_remove;
 			if (rail_bits == 0) {
 				MakeShore(t);
 				MarkTileDirtyByTile(t);
-				return;
+				return flooded;
 			}
 		}
 
 		if (IsNonContinuousFoundation(GetRailFoundation(tileh, rail_bits))) {
+			flooded = true;
 			SetRailGroundType(t, RAIL_GROUND_WATER);
 			MarkTileDirtyByTile(t);
 		}
 	}
+	return flooded;
 }
 
 static const TileIndexDiffC _trackdelta[] = {
@@ -634,7 +636,7 @@
  */
 static CommandCost CmdRailTrackHelper(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	CommandCost ret, total_cost;
+	CommandCost ret, total_cost(EXPENSES_CONSTRUCTION);
 	Track track = (Track)GB(p2, 4, 3);
 	Trackdir trackdir;
 	byte mode = HasBit(p2, 7);
@@ -646,8 +648,6 @@
 	end_tile = p1;
 	trackdir = TrackToTrackdir(track);
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	if (CmdFailed(ValidateAutoDrag(&trackdir, tile, end_tile))) return CMD_ERROR;
 
 	if (flags & DC_EXEC) SndPlayTileFx(SND_20_SPLAT_2, tile);
@@ -716,13 +716,10 @@
  */
 CommandCost CmdBuildTrainDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	CommandCost cost;
 	Slope tileh;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	/* check railtype and valid direction for depot (0 through 3), 4 in total */
-	if (!ValParamRailtype(p1)) return CMD_ERROR;
+	if (!ValParamRailtype((RailType)p1)) return CMD_ERROR;
 
 	tileh = GetTileSlope(tile, NULL);
 
@@ -745,7 +742,7 @@
 		return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
 	}
 
-	cost = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
+	CommandCost cost = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 	if (CmdFailed(cost)) return CMD_ERROR;
 
 	if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
@@ -761,7 +758,7 @@
 
 		d->town_index = ClosestTownFromTile(tile, (uint)-1)->index;
 
-		UpdateSignalsOnSegment(tile, dir);
+		AddSideToSignalBuffer(tile, INVALID_DIAGDIR, _current_player);
 		YapfNotifyTrackLayoutChange(tile, TrackdirToTrack(DiagdirToDiagTrackdir(dir)));
 		d_auto_delete.Detach();
 	}
@@ -816,21 +813,19 @@
 	/* you can not convert a signal if no signal is on track */
 	if (convert_signal && !HasSignalOnTrack(tile, track)) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	if (!HasSignalOnTrack(tile, track)) {
 		/* build new signals */
-		cost = CommandCost(_price.build_signals);
+		cost = CommandCost(EXPENSES_CONSTRUCTION, _price.build_signals);
 	} else {
 		if (p2 != 0 && sigvar != GetSignalVariant(tile, track)) {
 			/* convert signals <-> semaphores */
-			cost = CommandCost(_price.build_signals + _price.remove_signals);
+			cost = CommandCost(EXPENSES_CONSTRUCTION, _price.build_signals + _price.remove_signals);
 
 		} else if (convert_signal) {
 			/* convert button pressed */
 			if (ctrl_pressed || GetSignalVariant(tile, track) != sigvar) {
 				/* convert electric <-> semaphore */
-				cost = CommandCost(_price.build_signals + _price.remove_signals);
+				cost = CommandCost(EXPENSES_CONSTRUCTION, _price.build_signals + _price.remove_signals);
 			} else {
 				/* it is free to change signal type: normal-pre-exit-combo */
 				cost = CommandCost();
@@ -889,7 +884,7 @@
 		}
 
 		MarkTileDirtyByTile(tile);
-		SetSignalsOnBothDir(tile, track);
+		AddTrackToSignalBuffer(tile, track, _current_player);
 		YapfNotifyTrackLayoutChange(tile, track);
 	}
 
@@ -935,17 +930,15 @@
 			return true;
 
 		case MP_TUNNELBRIDGE: {
-			TileIndex orig_tile = tile;
-			/* Skip to end of tunnel or bridge */
-			if (IsBridge(tile)) {
-				if (GetBridgeTransportType(tile) != TRANSPORT_RAIL) return false;
-				if (GetBridgeRampDirection(tile) != TrackdirToExitdir(trackdir)) return false;
-				tile = GetOtherBridgeEnd(tile);
-			} else {
-				if (GetTunnelTransportType(tile) != TRANSPORT_RAIL) return false;
-				if (GetTunnelDirection(tile) != TrackdirToExitdir(trackdir)) return false;
-				tile = GetOtherTunnelEnd(tile);
-			}
+			TileIndex orig_tile = tile; // backup old value
+
+			if (GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL) return false;
+			if (GetTunnelBridgeDirection(tile) != TrackdirToExitdir(trackdir)) return false;
+
+			/* Skip to end of tunnel or bridge
+			 * note that tile is a parameter by reference, so it must be updated */
+			tile = GetOtherTunnelBridgeEnd(tile);
+
 			signal_ctr += 2 + DistanceMax(orig_tile, tile) * 2;
 			return true;
 		}
@@ -968,7 +961,7 @@
  */
 static CommandCost CmdSignalTrackHelper(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	CommandCost ret, total_cost;
+	CommandCost ret, total_cost(EXPENSES_CONSTRUCTION);
 	int signal_ctr;
 	byte signals;
 	bool error = true;
@@ -989,8 +982,6 @@
 
 	if (!IsTileType(tile, MP_RAILWAY)) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	/* for vertical/horizontal tracks, double the given signals density
 	 * since the original amount will be too dense (shorter tracks) */
 	signal_density *= 2;
@@ -1113,8 +1104,6 @@
 	/* Only water can remove signals from anyone */
 	if (_current_player != OWNER_WATER && !CheckTileOwnership(tile)) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	/* Do it? */
 	if (flags & DC_EXEC) {
 		SetPresentSignals(tile, GetPresentSignals(tile) & ~SignalOnTrack(track));
@@ -1126,13 +1115,13 @@
 			SetSignalVariant(tile, INVALID_TRACK, SIG_ELECTRIC); // remove any possible semaphores
 		}
 
-		SetSignalsOnBothDir(tile, track);
+		AddTrackToSignalBuffer(tile, track, GetTileOwner(tile));
 		YapfNotifyTrackLayoutChange(tile, track);
 
 		MarkTileDirtyByTile(tile);
 	}
 
-	return CommandCost(_price.remove_signals);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_signals);
 }
 
 /** Remove signals on a stretch of track.
@@ -1154,13 +1143,12 @@
 	return CmdSignalTrackHelper(tile, flags, p1, SetBit(p2, 5)); // bit 5 is remove bit
 }
 
-typedef CommandCost DoConvertRailProc(TileIndex tile, RailType totype, bool exec);
-
+/** Update power of train under which is the railtype being converted */
 void *UpdateTrainPowerProc(Vehicle *v, void *data)
 {
 	/* Similiar checks as in TrainPowerChanged() */
 
-	if (v->type == VEH_TRAIN && v->tile == *(TileIndex*)data && !IsArticulatedPart(v)) {
+	if (v->type == VEH_TRAIN && !IsArticulatedPart(v)) {
 		const RailVehicleInfo *rvi = RailVehInfo(v->engine_type);
 		if (GetVehicleProperty(v, 0x0B, rvi->power) != 0) TrainPowerChanged(v->First());
 	}
@@ -1168,46 +1156,6 @@
 	return NULL;
 }
 
-/**
- * Switches the rail type.
- * Railtypes are stored on a per-tile basis, not on a per-track basis, so
- * all the tracks in the given tile will be converted.
- * @param tile        The tile on which the railtype is to be convert.
- * @param totype      The railtype we want to convert to
- * @param exec        Switches between test and execute mode
- * @return            The cost and state of the operation
- * @retval CMD_ERROR  An error occured during the operation.
- */
-static CommandCost DoConvertRail(TileIndex tile, RailType totype, bool exec)
-{
-	/* change type. */
-	if (exec) {
-		SetRailType(tile, totype);
-		MarkTileDirtyByTile(tile);
-
-		/* notify YAPF about the track layout change */
-		TrackBits tracks = GetTrackBits(tile);
-		while (tracks != TRACK_BIT_NONE) {
-			YapfNotifyTrackLayoutChange(tile, RemoveFirstTrack(&tracks));
-		}
-
-		if (IsTileDepotType(tile, TRANSPORT_RAIL)) {
-			/* Update build vehicle window related to this depot */
-			InvalidateWindowData(WC_VEHICLE_DEPOT, tile);
-			InvalidateWindowData(WC_BUILD_VEHICLE, tile);
-		}
-
-		/* update power of train engines on this tile */
-		VehicleFromPos(tile, &tile, UpdateTrainPowerProc);
-	}
-
-	return CommandCost(RailBuildCost(totype) / 2);
-}
-
-extern CommandCost DoConvertStationRail(TileIndex tile, RailType totype, bool exec);
-extern CommandCost DoConvertStreetRail(TileIndex tile, RailType totype, bool exec);
-extern CommandCost DoConvertTunnelBridgeRail(TileIndex tile, RailType totype, bool exec);
-
 /** Convert one rail type to the other. You can convert normal rail to
  * monorail/maglev easily or vice-versa.
  * @param tile end tile of rail conversion drag
@@ -1217,72 +1165,151 @@
  */
 CommandCost CmdConvertRail(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	CommandCost ret, cost;
-	Money money;
-	int ex;
-	int ey;
-	int sx, sy, x, y;
+	CommandCost cost(EXPENSES_CONSTRUCTION);
+	RailType totype = (RailType)p2;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
-	if (!ValParamRailtype(p2)) return CMD_ERROR;
+	if (!ValParamRailtype(totype)) return CMD_ERROR;
 	if (p1 >= MapSize()) return CMD_ERROR;
 
+	uint ex = TileX(tile);
+	uint ey = TileY(tile);
+	uint sx = TileX(p1);
+	uint sy = TileY(p1);
+
 	/* make sure sx,sy are smaller than ex,ey */
-	ex = TileX(tile);
-	ey = TileY(tile);
-	sx = TileX(p1);
-	sy = TileY(p1);
 	if (ex < sx) Swap(ex, sx);
 	if (ey < sy) Swap(ey, sy);
 
-	money = GetAvailableMoneyForCommand();
+	_error_message = STR_1005_NO_SUITABLE_RAILROAD_TRACK; // by default, there is no track to convert
 
-	for (x = sx; x <= ex; ++x) {
-		for (y = sy; y <= ey; ++y) {
+	for (uint x = sx; x <= ex; ++x) {
+		for (uint y = sy; y <= ey; ++y) {
 			TileIndex tile = TileXY(x, y);
-			DoConvertRailProc *proc;
-			RailType totype = (RailType)p2;
+			TileType tt = GetTileType(tile);
 
-			switch (GetTileType(tile)) {
-				case MP_RAILWAY:      proc = DoConvertRail;             break;
-				case MP_STATION:      proc = DoConvertStationRail;      break;
-				case MP_ROAD:         proc = DoConvertStreetRail;       break;
-				case MP_TUNNELBRIDGE: proc = DoConvertTunnelBridgeRail; break;
+			/* Check if there is any track on tile */
+			switch (tt) {
+				case MP_RAILWAY:
+					break;
+				case MP_STATION:
+					if (!IsRailwayStation(tile)) continue;
+					break;
+				case MP_ROAD:
+					if (!IsLevelCrossing(tile)) continue;
+					break;
+				case MP_TUNNELBRIDGE:
+					if (GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL) continue;
+					break;
 				default: continue;
 			}
 
-			/* It is possible that 'type' is invalid when there is no rail on the tile,
-			 * but this situation will be detected in proc()
-			 */
+			/* Original railtype we are converting from */
 			RailType type = GetRailType(tile);
 
-			/* Not own tile or track is already converted */
-			if ((!CheckTileOwnership(tile) || type == totype) ||
-				/* 'hidden' elrails can't be downgraded to normal rail when elrails are disabled */
-				(_patches.disable_elrails && totype == RAILTYPE_RAIL && type == RAILTYPE_ELECTRIC) ||
-				/* Vehicle on a tile while not converting Rail <-> ElRail */
-				(!IsCompatibleRail(type, totype) && !EnsureNoVehicleOnGround(tile))) {
-					ret = CMD_ERROR;
-					continue;
+			/* Converting to the same type or converting 'hidden' elrail -> rail */
+			if (type == totype || (_patches.disable_elrails && totype == RAILTYPE_RAIL && type == RAILTYPE_ELECTRIC)) continue;
+
+			/* Trying to convert other's rail */
+			if (!CheckTileOwnership(tile)) continue;
+
+			/* Vehicle on the tile when not converting Rail <-> ElRail
+			 * Tunnels and bridges have special check later */
+			if (tt != MP_TUNNELBRIDGE) {
+				if (!IsCompatibleRail(type, totype) && !EnsureNoVehicleOnGround(tile)) continue;
+				if (flags & DC_EXEC) { // we can safely convert, too
+					SetRailType(tile, totype);
+					MarkTileDirtyByTile(tile);
+					/* update power of train engines on this tile */
+					VehicleFromPos(tile, NULL, &UpdateTrainPowerProc);
+				}
 			}
 
-			ret = proc(tile, totype, false);
-			if (CmdFailed(ret)) continue;
+			switch (tt) {
+				case MP_RAILWAY:
+					switch (GetRailTileType(tile)) {
+						case RAIL_TILE_WAYPOINT:
+							if (flags & DC_EXEC) {
+								/* notify YAPF about the track layout change */
+								YapfNotifyTrackLayoutChange(tile, AxisToTrack(GetWaypointAxis(tile)));
+							}
+							cost.AddCost(RailConvertCost(type, totype));
+							break;
 
-			if (flags & DC_EXEC) {
-				money -= ret.GetCost();
-				if (money < 0) {
-					_additional_cash_required = ret.GetCost();
-					return cost;
-				}
-				proc(tile, totype, true);
+						case RAIL_TILE_DEPOT:
+							if (flags & DC_EXEC) {
+								/* notify YAPF about the track layout change */
+								YapfNotifyTrackLayoutChange(tile, AxisToTrack(DiagDirToAxis(GetRailDepotDirection(tile))));
+
+								/* Update build vehicle window related to this depot */
+								InvalidateWindowData(WC_VEHICLE_DEPOT, tile);
+								InvalidateWindowData(WC_BUILD_VEHICLE, tile);
+							}
+							cost.AddCost(RailConvertCost(type, totype));
+							break;
+
+						default: // RAIL_TILE_NORMAL, RAIL_TILE_SIGNALS
+							if (flags & DC_EXEC) {
+								/* notify YAPF about the track layout change */
+								TrackBits tracks = GetTrackBits(tile);
+								while (tracks != TRACK_BIT_NONE) {
+									YapfNotifyTrackLayoutChange(tile, RemoveFirstTrack(&tracks));
+								}
+							}
+							cost.AddCost(RailConvertCost(type, totype) * CountBits(GetTrackBits(tile)));
+							break;
+					}
+					break;
+
+				case MP_TUNNELBRIDGE: {
+					TileIndex endtile = GetOtherTunnelBridgeEnd(tile);
+
+					/* If both ends of tunnel/bridge are in the range, do not try to convert twice -
+					 * it would cause assert because of different test and exec runs */
+					if (endtile < tile && TileX(endtile) >= sx && TileX(endtile) <= ex &&
+							TileY(endtile) >= sy && TileY(endtile) <= ey) continue;
+
+					/* When not coverting rail <-> el. rail, any vehicle cannot be in tunnel/bridge */
+					if (!IsCompatibleRail(GetRailType(tile), totype) &&
+							GetVehicleTunnelBridge(tile, endtile) != NULL) continue;
+
+					if (flags & DC_EXEC) {
+						SetRailType(tile, totype);
+						SetRailType(endtile, totype);
+
+						VehicleFromPos(tile, NULL, &UpdateTrainPowerProc);
+						VehicleFromPos(endtile, NULL, &UpdateTrainPowerProc);
+
+						Track track = AxisToTrack(DiagDirToAxis(GetTunnelBridgeDirection(tile)));
+
+						YapfNotifyTrackLayoutChange(tile, track);
+						YapfNotifyTrackLayoutChange(endtile, track);
+
+						MarkTileDirtyByTile(tile);
+						MarkTileDirtyByTile(endtile);
+
+						if (IsBridge(tile)) {
+							TileIndexDiff delta = TileOffsByDiagDir(GetTunnelBridgeDirection(tile));
+							TileIndex t = tile + delta;
+							for (; t != endtile; t += delta) MarkTileDirtyByTile(t); // TODO encapsulate this into a function
+						}
+					}
+
+					cost.AddCost((DistanceManhattan(tile, endtile) + 1) * RailConvertCost(type, totype));
+				} break;
+
+				default: // MP_STATION, MP_ROAD
+					if (flags & DC_EXEC) {
+						Track track = (tt == MP_STATION) ? GetRailStationTrack(tile) : AxisToTrack(OtherAxis(GetCrossingRoadAxis(tile)));
+						YapfNotifyTrackLayoutChange(tile, track);
+					}
+
+					cost.AddCost(RailConvertCost(type, totype));
+					break;
 			}
-			cost.AddCost(ret);
 		}
 	}
 
-	return (cost.GetCost() == 0) ? ret : cost;
+	return (cost.GetCost() == 0) ? CMD_ERROR : cost;
 }
 
 static CommandCost RemoveTrainDepot(TileIndex tile, uint32 flags)
@@ -1294,20 +1321,22 @@
 		return CMD_ERROR;
 
 	if (flags & DC_EXEC) {
+		/* read variables before the depot is removed */
 		DiagDirection dir = GetRailDepotDirection(tile);
+		Owner owner = GetTileOwner(tile);
 
 		DoClearSquare(tile);
 		delete GetDepotByTile(tile);
-		UpdateSignalsOnSegment(tile, dir);
+		AddSideToSignalBuffer(tile, dir, owner);
 		YapfNotifyTrackLayoutChange(tile, TrackdirToTrack(DiagdirToDiagTrackdir(dir)));
 	}
 
-	return CommandCost(_price.remove_train_depot);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_train_depot);
 }
 
 static CommandCost ClearTile_Track(TileIndex tile, byte flags)
 {
-	CommandCost cost;
+	CommandCost cost(EXPENSES_CONSTRUCTION);
 	CommandCost ret;
 
 	if (flags & DC_AUTO) {
@@ -1783,7 +1812,7 @@
 				image += relocation;
 			}
 
-			if (!IsTransparencySet(TO_BUILDINGS) && HasBit(image, PALETTE_MODIFIER_COLOR)) {
+			if (!(!HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_BUILDINGS)) && HasBit(image, PALETTE_MODIFIER_COLOR)) {
 				pal = _drawtile_track_palette;
 			} else {
 				pal = dtss->pal;
@@ -1795,7 +1824,7 @@
 					ti->x + dtss->delta_x, ti->y + dtss->delta_y,
 					dtss->size_x, dtss->size_y,
 					dtss->size_z, ti->z + dtss->delta_z,
-					IsTransparencySet(TO_BUILDINGS)
+					!HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_BUILDINGS)
 				);
 			} else {
 				AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y);
@@ -1837,266 +1866,6 @@
 	DrawTileSequence(x, y, dts->ground_sprite + offset, dts->seq, 0);
 }
 
-struct SetSignalsData {
-	int cur;
-	int cur_stack;
-	bool stop;
-	bool has_presignal;
-
-	/* presignal info */
-	int presignal_exits;
-	int presignal_exits_free;
-
-	/* these are used to keep track of the signals that change. */
-	TrackdirByte bit[NUM_SSD_ENTRY];
-	TileIndex tile[NUM_SSD_ENTRY];
-
-	/* these are used to keep track of the stack that modifies presignals recursively */
-	TileIndex next_tile[NUM_SSD_STACK];
-	DiagDirectionByte next_dir[NUM_SSD_STACK];
-
-};
-
-static bool SetSignalsEnumProc(TileIndex tile, void* data, Trackdir trackdir, uint length, byte* state)
-{
-	SetSignalsData* ssd = (SetSignalsData*)data;
-	Track track = TrackdirToTrack(trackdir);
-
-	if (!IsTileType(tile, MP_RAILWAY)) return false;
-
-	/* the tile has signals? */
-	if (HasSignalOnTrack(tile, track)) {
-		if (HasSignalOnTrackdir(tile, ReverseTrackdir(trackdir))) {
-			/* yes, add the signal to the list of signals */
-			if (ssd->cur != NUM_SSD_ENTRY) {
-				ssd->tile[ssd->cur] = tile; // remember the tile index
-				ssd->bit[ssd->cur] = trackdir; // and the controlling bit number
-				ssd->cur++;
-			}
-
-			/* remember if this block has a presignal. */
-			ssd->has_presignal |= IsPresignalEntry(tile, track);
-		}
-
-		if (HasSignalOnTrackdir(tile, trackdir) && IsPresignalExit(tile, track)) {
-			/* this is an exit signal that points out from the segment */
-			ssd->presignal_exits++;
-			if (GetSignalStateByTrackdir(tile, trackdir) != SIGNAL_STATE_RED)
-				ssd->presignal_exits_free++;
-		}
-
-		return true;
-	} else if (IsTileDepotType(tile, TRANSPORT_RAIL)) {
-		return true; // don't look further if the tile is a depot
-	}
-
-	return false;
-}
-
-/* Struct to parse data from VehicleFromPos to SignalVehicleCheckProc */
-struct SignalVehicleCheckStruct {
-	TileIndex tile;
-	uint track;
-};
-
-static void *SignalVehicleCheckProc(Vehicle *v, void *data)
-{
-	const SignalVehicleCheckStruct* dest = (SignalVehicleCheckStruct*)data;
-
-	if (v->type != VEH_TRAIN) return NULL;
-
-	/* Wrong tile, or no train? Not a match */
-	if (v->tile != dest->tile) return NULL;
-
-	/* Are we on the same piece of track? */
-	if (dest->track & v->u.rail.track * 0x101) return v;
-
-	return NULL;
-}
-
-/* Special check for SetSignalsAfterProc, to see if there is a vehicle on this tile */
-static bool SignalVehicleCheck(TileIndex tile, uint track)
-{
-	SignalVehicleCheckStruct dest;
-
-	dest.tile = tile;
-	dest.track = track;
-
-	/* Locate vehicles in tunnels or on bridges */
-	if (IsTunnelTile(tile) || IsBridgeTile(tile)) {
-		TileIndex end;
-		DiagDirection direction;
-
-		if (IsTunnelTile(tile)) {
-			end = GetOtherTunnelEnd(tile);
-			direction = GetTunnelDirection(tile);
-		} else {
-			end = GetOtherBridgeEnd(tile);
-			direction = GetBridgeRampDirection(tile);
-		}
-
-		dest.track = 1 << (direction & 1); // get the trackbit the vehicle would have if it has not entered the tunnel yet (ie is still visible)
-
-		/* check for a vehicle with that trackdir on the start tile of the tunnel */
-		if (VehicleFromPos(tile, &dest, SignalVehicleCheckProc) != NULL) return true;
-
-		/* check for a vehicle with that trackdir on the end tile of the tunnel */
-		if (VehicleFromPos(end, &dest, SignalVehicleCheckProc) != NULL) return true;
-
-		/* now check all tiles from start to end for a warping vehicle */
-		dest.track = 0x40;   //Vehicle inside a tunnel or on a bridge
-		if (VehicleFromPos(tile, &dest, SignalVehicleCheckProc) != NULL) return true;
-		if (VehicleFromPos(end, &dest, SignalVehicleCheckProc) != NULL) return true;
-
-		/* no vehicle found */
-		return false;
-	}
-
-	return VehicleFromPos(tile, &dest, SignalVehicleCheckProc) != NULL;
-}
-
-static void SetSignalsAfterProc(TrackPathFinder *tpf)
-{
-	SetSignalsData *ssd = (SetSignalsData*)tpf->userdata;
-	const TrackPathFinderLink* link;
-	uint offs;
-	uint i;
-
-	ssd->stop = false;
-
-	/* Go through all the PF tiles */
-	for (i = 0; i < lengthof(tpf->hash_head); i++) {
-		/* Empty hash item */
-		if (tpf->hash_head[i] == 0) continue;
-
-		/* If 0x8000 is not set, there is only 1 item */
-		if (!(tpf->hash_head[i] & 0x8000)) {
-			/* Check if there is a vehicle on this tile */
-			if (SignalVehicleCheck(tpf->hash_tile[i], tpf->hash_head[i])) {
-				ssd->stop = true;
-				return;
-			}
-		} else {
-			/* There are multiple items, where hash_tile points to the first item in the list */
-			offs = tpf->hash_tile[i];
-			do {
-				/* Find the next item */
-				link = PATHFIND_GET_LINK_PTR(tpf, offs);
-				/* Check if there is a vehicle on this tile */
-				if (SignalVehicleCheck(link->tile, link->flags)) {
-					ssd->stop = true;
-					return;
-				}
-				/* Goto the next item */
-			} while ((offs = link->next) != 0xFFFF);
-		}
-	}
-}
-
-static void ChangeSignalStates(SetSignalsData *ssd)
-{
-	int i;
-
-	/* thinking about presignals...
-	 * the presignal is green if,
-	 *   if no train is in the segment AND
-	 *   there is at least one green exit signal OR
-	 *   there are no exit signals in the segment */
-
-	/* then mark the signals in the segment accordingly */
-	for (i = 0; i != ssd->cur; i++) {
-		TileIndex tile = ssd->tile[i];
-		byte bit = SignalAgainstTrackdir(ssd->bit[i]);
-		uint signals = GetSignalStates(tile);
-		Track track = TrackdirToTrack(ssd->bit[i]);
-
-		/* presignals don't turn green if there is at least one presignal exit and none are free */
-		if (IsPresignalEntry(tile, track)) {
-			int ex = ssd->presignal_exits, exfree = ssd->presignal_exits_free;
-
-			/* subtract for dual combo signals so they don't count themselves */
-			if (IsPresignalExit(tile, track) && HasSignalOnTrackdir(tile, ssd->bit[i])) {
-				ex--;
-				if (GetSignalStateByTrackdir(tile, ssd->bit[i]) != SIGNAL_STATE_RED) exfree--;
-			}
-
-			/* if we have exits and none are free, make red. */
-			if (ex && !exfree) goto make_red;
-		}
-
-		/* check if the signal is unaffected. */
-		if (ssd->stop) {
-make_red:
-			/* turn red */
-			if ((bit & signals) == 0) continue;
-		} else {
-			/* turn green */
-			if ((bit & signals) != 0) continue;
-		}
-
-		/* Update signals on the other side of this exit-combo signal; it changed. */
-		if (IsPresignalExit(tile, track)) {
-			if (ssd->cur_stack != NUM_SSD_STACK) {
-				ssd->next_tile[ssd->cur_stack] = tile;
-				ssd->next_dir[ssd->cur_stack] = TrackdirToExitdir(ssd->bit[i]);
-				ssd->cur_stack++;
-			} else {
-				DEBUG(misc, 0, "NUM_SSD_STACK too small"); /// @todo WTF is this???
-			}
-		}
-
-		/* it changed, so toggle it */
-		SetSignalStates(tile, signals ^ bit);
-		MarkTileDirtyByTile(tile);
-	}
-}
-
-
-bool UpdateSignalsOnSegment(TileIndex tile, DiagDirection direction)
-{
-	SetSignalsData ssd;
-	int result = -1;
-
-	ssd.cur_stack = 0;
-
-	for (;;) {
-		/* go through one segment and update all signals pointing into that segment. */
-		ssd.cur = ssd.presignal_exits = ssd.presignal_exits_free = 0;
-		ssd.has_presignal = false;
-
-		FollowTrack(tile, 0xC000 | TRANSPORT_RAIL, 0, direction, SetSignalsEnumProc, SetSignalsAfterProc, &ssd);
-		ChangeSignalStates(&ssd);
-
-		/* remember the result only for the first iteration. */
-		if (result < 0) {
-			/* stay in depot while segment is occupied or while all presignal exits are blocked */
-			result = ssd.stop || (ssd.presignal_exits > 0 && ssd.presignal_exits_free == 0);
-		}
-
-		/* if any exit signals were changed, we need to keep going to modify the stuff behind those. */
-		if (ssd.cur_stack == 0) break;
-
-		/* one or more exit signals were changed, so we need to update another segment too. */
-		tile = ssd.next_tile[--ssd.cur_stack];
-		direction = ssd.next_dir[ssd.cur_stack];
-	}
-
-	return result != 0;
-}
-
-void SetSignalsOnBothDir(TileIndex tile, byte track)
-{
-	static const DiagDirection _search_dir_1[] = {
-		DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_SW, DIAGDIR_SE
-	};
-	static const DiagDirection _search_dir_2[] = {
-		DIAGDIR_SW, DIAGDIR_NW, DIAGDIR_NW, DIAGDIR_SW, DIAGDIR_NW, DIAGDIR_NE
-	};
-
-	UpdateSignalsOnSegment(tile, _search_dir_1[track]);
-	UpdateSignalsOnSegment(tile, _search_dir_2[track]);
-}
-
 static uint GetSlopeZ_Track(TileIndex tile, uint x, uint y)
 {
 	uint z;
@@ -2360,7 +2129,7 @@
 	 0,  1,  0, -1  /* y */
 };
 
-static uint32 VehicleEnter_Track(Vehicle *v, TileIndex tile, int x, int y)
+static VehicleEnterTileStatus VehicleEnter_Track(Vehicle *v, TileIndex tile, int x, int y)
 {
 	byte fract_coord;
 	byte fract_coord_leave;
@@ -2443,7 +2212,7 @@
 		case TRACK_BIT_UPPER: track_corner = CORNER_N; break;
 
 		/* Surface slope must not be changed */
-		default: return (((z_old != z_new) || (tileh_old != tileh_new)) ? CMD_ERROR : _price.terraform);
+		default: return (((z_old != z_new) || (tileh_old != tileh_new)) ? CMD_ERROR : CommandCost(EXPENSES_CONSTRUCTION, _price.terraform));
 	}
 
 	/* The height of the track_corner must not be changed. The rest ensures GetRailFoundation() already. */
@@ -2451,7 +2220,7 @@
 	z_new += GetSlopeZInCorner((Slope)(tileh_new & ~SLOPE_HALFTILE_MASK), track_corner);
 	if (z_old != z_new) return CMD_ERROR;
 
-	CommandCost cost = CommandCost(_price.terraform);
+	CommandCost cost = CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 	/* Make the ground dirty, if surface slope has changed */
 	if (tileh_old != tileh_new) {
 		if (GetRailGroundType(tile) == RAIL_GROUND_WATER) cost.AddCost(_price.clear_water);
@@ -2498,7 +2267,7 @@
 		if ((flags & DC_EXEC) != 0) SetRailGroundType(tile, RAIL_GROUND_BARREN);
 
 		/* allow terraforming */
-		return (was_water ? CommandCost(_price.clear_water) : CommandCost());
+		return CommandCost(EXPENSES_CONSTRUCTION, was_water ? _price.clear_water : (Money)0);
 	} else {
 		if (_patches.build_on_slopes && AutoslopeEnabled()) {
 			switch (GetRailTileType(tile)) {
@@ -2509,7 +2278,7 @@
 				}
 
 				case RAIL_TILE_DEPOT:
-					if (AutoslopeCheckForEntranceEdge(tile, z_new, tileh_new, GetRailDepotDirection(tile))) return _price.terraform;
+					if (AutoslopeCheckForEntranceEdge(tile, z_new, tileh_new, GetRailDepotDirection(tile))) return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 					break;
 
 				default: NOT_REACHED();
--- a/src/rail_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/rail_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,21 +4,15 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "functions.h"
+#include "tile_cmd.h"
 #include "landscape.h"
-#include "date.h"
-#include "map.h"
-#include "tile.h"
-#include "window.h"
 #include "gui.h"
-#include "viewport.h"
-#include "gfx.h"
-#include "sound.h"
-#include "command.h"
-#include "vehicle.h"
+#include "window_gui.h"
+#include "station_gui.h"
+#include "terraform_gui.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "command_func.h"
 #include "station.h"
 #include "waypoint.h"
 #include "debug.h"
@@ -26,12 +20,25 @@
 #include "newgrf_callbacks.h"
 #include "newgrf_station.h"
 #include "train.h"
+#include "strings_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "sound_func.h"
+#include "player_func.h"
+#include "settings_type.h"
+#include "widgets/dropdown_type.h"
+#include "widgets/dropdown_func.h"
 
 #include "bridge_map.h"
 #include "rail_map.h"
 #include "road_map.h"
 #include "station_map.h"
 #include "tunnel_map.h"
+#include "tunnelbridge_map.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
 
 static RailType _cur_railtype;
 static bool _remove_button_clicked;
@@ -578,9 +585,9 @@
 		break;
 
 	case WE_ABORT_PLACE_OBJ:
-		RaiseWindowButtons(w);
+		w->RaiseButtons();
 		w->DisableWidget(RTW_REMOVE);
-		InvalidateWidget(w, RTW_REMOVE);
+		w->InvalidateWidget(RTW_REMOVE);
 
 		w = FindWindowById(WC_BUILD_SIGNAL, 0);
 		if (w != NULL) WP(w, def_d).close = true;
@@ -716,7 +723,6 @@
 	BRSW_HIGHLIGHT_ON,
 
 	BRSW_NEWST_DROPDOWN,
-	BRSW_NEWST_DROPDOWN_TEXT,
 	BRSW_NEWST_LIST,
 	BRSW_NEWST_SCROLL
 };
@@ -768,6 +774,18 @@
 	}
 }
 
+static DropDownList *BuildStationClassDropDown()
+{
+	DropDownList *list = new DropDownList();
+
+	for (uint i = 0; i < GetNumStationClasses(); i++) {
+		if (i == STAT_CLASS_WAYP) continue;
+		list->push_back(new DropDownListStringItem(GetStationClassName((StationClassID)i), i, false));
+	}
+
+	return list;
+}
+
 static void StationBuildWndProc(Window *w, WindowEvent *e)
 {
 	switch (e->event) {
@@ -988,8 +1006,7 @@
 			break;
 
 		case BRSW_NEWST_DROPDOWN:
-		case BRSW_NEWST_DROPDOWN_TEXT:
-			ShowDropDownMenu(w, BuildStationClassDropdown(), _railstation.station_class, 23, 0, 1 << STAT_CLASS_WAYP);
+			ShowDropDownList(w, BuildStationClassDropDown(), _railstation.station_class, BRSW_NEWST_DROPDOWN);
 			break;
 
 		case BRSW_NEWST_LIST: {
@@ -1106,8 +1123,7 @@
 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    74,   133,   242,   253, STR_02DA_ON,                     STR_3064_HIGHLIGHT_COVERAGE_AREA},    // BRSW_HIGHLIGHT_ON
 
 /* newstations gui additions */
-{      WWT_INSET,   RESIZE_NONE,    14,     7,   140,    17,    28, STR_02BD,                        STR_SELECT_STATION_CLASS_TIP},        // BRSW_NEWST_DROPDOWN
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,   129,   139,    18,    27, STR_0225,                        STR_SELECT_STATION_CLASS_TIP},        // BRSW_NEWST_DROPDOWN_TEXT
+{ WWT_DROPDOWNIN,   RESIZE_NONE,    14,     7,   140,    17,    28, STR_02BD,                        STR_SELECT_STATION_CLASS_TIP},        // BRSW_NEWST_DROPDOWN
 {     WWT_MATRIX,   RESIZE_NONE,    14,     7,   128,    32,   102, 0x501,                           STR_SELECT_STATION_TYPE_TIP},         // BRSW_NEWST_LIST
 {  WWT_SCROLLBAR,   RESIZE_NONE,    14,   129,   140,    32,   102, 0x0,                             STR_0190_SCROLL_BAR_SCROLLS_LIST},    // BRSW_NEWST_SCROLL
 {   WIDGETS_END},
@@ -1174,7 +1190,7 @@
  * @param xrel         the relativ x value of the sprite in the grf
  * @param xsize        the width of the sprite
  */
-static const void DrawSignalSprite(const Window *w, byte widget_index, SpriteID image, int8 xrel, uint8 xsize)
+static void DrawSignalSprite(const Window *w, byte widget_index, SpriteID image, int8 xrel, uint8 xsize)
 {
 	DrawSprite(image + w->IsWidgetLowered(widget_index), PAL_NONE,
 			w->widget[widget_index].left + (w->widget[widget_index].right - w->widget[widget_index].left) / 2 - xrel - xsize / 2 +
@@ -1523,12 +1539,8 @@
 			RailType count[RAILTYPE_END];
 			memset(count, 0, sizeof(count));
 			for (TileIndex t = 0; t < MapSize(); t++) {
-				if (IsTileType(t, MP_RAILWAY) ||
-						IsLevelCrossingTile(t) ||
-						IsRailwayStationTile(t) ||
-						(IsTunnelTile(t) && GetTunnelTransportType(t) == TRANSPORT_RAIL) ||
-						(IsBridgeTile(t) && GetBridgeTransportType(t) == TRANSPORT_RAIL)
-						) {
+				if (IsTileType(t, MP_RAILWAY) || IsLevelCrossingTile(t) || IsRailwayStationTile(t) ||
+						(IsTileType(t, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL)) {
 					count[GetRailType(t)]++;
 				}
 			}
@@ -1544,11 +1556,11 @@
 		switch (rt) {
 			case RAILTYPE_END + 0:
 				rt = RAILTYPE_RAIL;
-				while (rt < RAILTYPE_END && !HasRailtypeAvail(GetPlayer(_local_player), rt)) rt++;
+				while (rt < RAILTYPE_END && !HasRailtypeAvail(_local_player, rt)) rt++;
 				break;
 
 			case RAILTYPE_END + 1:
-				rt = GetBestRailtype(GetPlayer(_local_player));
+				rt = GetBestRailtype(_local_player);
 				break;
 
 			default:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/rail_gui.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,13 @@
+/* $Id$ */
+
+/** @file rail_gui.h Functions/types etc. related to the rail GUI. */
+
+#ifndef RAIL_GUI_H
+#define RAIL_GUI_H
+
+#include "rail_type.h"
+
+void ShowBuildRailToolbar(RailType railtype, int button);
+void ReinitGuiAfterToggleElrail(bool disable);
+
+#endif /* RAIL_GUI_H */
--- a/src/rail_map.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/rail_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,9 +5,11 @@
 #ifndef RAIL_MAP_H
 #define RAIL_MAP_H
 
-#include "direction.h"
-#include "rail.h"
-#include "tile.h"
+#include "rail_type.h"
+#include "signal_func.h"
+#include "direction_func.h"
+#include "track_func.h"
+#include "tile_map.h"
 
 
 /** Different types of Rail-related tiles */
@@ -373,6 +375,18 @@
 		SIGNAL_STATE_GREEN : SIGNAL_STATE_RED;
 }
 
+/**
+ * Sets the state of the signal along the given trackdir.
+ */
+static inline void SetSignalStateByTrackdir(TileIndex tile, Trackdir trackdir, SignalState state)
+{
+	if (state == SIGNAL_STATE_GREEN) { // set 1
+		SetSignalStates(tile, GetSignalStates(tile) | SignalAlongTrackdir(trackdir));
+	} else {
+		SetSignalStates(tile, GetSignalStates(tile) & ~SignalAlongTrackdir(trackdir));
+	}
+}
+
 
 /**
  * Return the rail type of tile, or INVALID_RAILTYPE if this is no rail tile.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/rail_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,48 @@
+/* $Id$ */
+
+/** @file rail_type.h The different types of rail */
+
+#ifndef RAIL_TYPE_H
+#define RAIL_TYPE_H
+
+#include "core/enum_type.hpp"
+
+/**
+ * Enumeration for all possible railtypes.
+ *
+ * This enumeration defines all 4 possible railtypes.
+ */
+enum RailType {
+	RAILTYPE_BEGIN    = 0,          ///< Used for iterations
+	RAILTYPE_RAIL     = 0,          ///< Standard non-electric rails
+	RAILTYPE_ELECTRIC = 1,          ///< Electric rails
+	RAILTYPE_MONO     = 2,          ///< Monorail
+	RAILTYPE_MAGLEV   = 3,          ///< Maglev
+	RAILTYPE_END,                   ///< Used for iterations
+	INVALID_RAILTYPE  = 0xFF        ///< Flag for invalid railtype
+};
+
+/** Allow incrementing of Track variables */
+DECLARE_POSTFIX_INCREMENT(RailType);
+/** Define basic enum properties */
+template <> struct EnumPropsT<RailType> : MakeEnumPropsT<RailType, byte, RAILTYPE_BEGIN, RAILTYPE_END, INVALID_RAILTYPE> {};
+typedef TinyEnumT<RailType> RailTypeByte;
+
+/**
+ * The different roadtypes we support, but then a bitmask of them
+ */
+enum RailTypes {
+	RAILTYPES_NONE     = 0,                      ///< No rail types
+	RAILTYPES_RAIL     = 1 << RAILTYPE_RAIL,     ///< Non-electrified rails
+	RAILTYPES_ELECTRIC = 1 << RAILTYPE_ELECTRIC, ///< Electrified rails
+	RAILTYPES_MONO     = 1 << RAILTYPE_MONO,     ///< Monorail!
+	RAILTYPES_MAGLEV   = 1 << RAILTYPE_MAGLEV,   ///< Ever fast maglev
+	RAILTYPES_ALL      = RAILTYPES_RAIL | RAILTYPES_ELECTRIC | RAILTYPES_MONO | RAILTYPES_MAGLEV, ///< All of them
+	RAILTYPES_END,                               ///< Used for iterations?
+	INVALID_RAILTYPES  = 0xFF                    ///< Invalid railtypes
+};
+DECLARE_ENUM_AS_BIT_SET(RailTypes);
+template <> struct EnumPropsT<RailTypes> : MakeEnumPropsT<RailTypes, byte, RAILTYPES_NONE, RAILTYPES_END, INVALID_RAILTYPES> {};
+typedef TinyEnumT<RailTypes> RailTypesByte;
+
+#endif /* RAIL_TYPE_H */
--- a/src/railtypes.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,214 +0,0 @@
-/* $Id$ */
-
-/** @file railtypes.h
- * All the railtype-specific information is stored here.
- */
-
-#ifndef RAILTYPES_H
-#define RAILTYPES_H
-
-/** Global Railtype definition
- */
-RailtypeInfo _railtypes[] = {
-	/** Railway */
-	{ /* Main Sprites */
-		{ SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_N_S, SPR_RAIL_TRACK_BASE, SPR_RAIL_SINGLE_Y, SPR_RAIL_SINGLE_X,
-			SPR_RAIL_SINGLE_NORTH, SPR_RAIL_SINGLE_SOUTH, SPR_RAIL_SINGLE_EAST, SPR_RAIL_SINGLE_WEST,
-			SPR_CROSSING_OFF_X_RAIL,
-			SPR_TUNNEL_ENTRY_REAR_RAIL
-		},
-
-		/* GUI sprites */
-		{ 0x4E3, 0x4E4, 0x4E5, 0x4E6,
-			SPR_IMG_AUTORAIL,
-			SPR_IMG_DEPOT_RAIL,
-			SPR_IMG_TUNNEL_RAIL,
-			SPR_IMG_CONVERT_RAIL
-		},
-
-		{
-			SPR_CURSOR_NS_TRACK,
-			SPR_CURSOR_SWNE_TRACK,
-			SPR_CURSOR_EW_TRACK,
-			SPR_CURSOR_NWSE_TRACK,
-			SPR_CURSOR_AUTORAIL,
-			SPR_CURSOR_RAIL_DEPOT,
-			SPR_CURSOR_TUNNEL_RAIL,
-			SPR_CURSOR_CONVERT_RAIL
-		},
-
-		/* strings */
-		{ STR_100A_RAILROAD_CONSTRUCTION },
-
-		/* Offset of snow tiles */
-		SPR_RAIL_SNOW_OFFSET,
-
-		/* Powered railtypes */
-		1 << RAILTYPE_RAIL | 1 << RAILTYPE_ELECTRIC,
-
-		/* Compatible railtypes */
-		1 << RAILTYPE_RAIL | 1 << RAILTYPE_ELECTRIC,
-
-		/* main offset */
-		0,
-
-		/* bridge offset */
-		0,
-
-		/* custom ground offset */
-		0,
-	},
-
-	/** Electrified railway */
-	{ /* Main Sprites */
-		{ SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_N_S, SPR_RAIL_TRACK_BASE, SPR_RAIL_SINGLE_Y, SPR_RAIL_SINGLE_X,
-			SPR_RAIL_SINGLE_NORTH, SPR_RAIL_SINGLE_SOUTH, SPR_RAIL_SINGLE_EAST, SPR_RAIL_SINGLE_WEST,
-			SPR_CROSSING_OFF_X_RAIL,
-			SPR_TUNNEL_ENTRY_REAR_RAIL
-		},
-
-		/* GUI sprites */
-		{
-			SPR_BUILD_NS_ELRAIL,
-			SPR_BUILD_X_ELRAIL,
-			SPR_BUILD_EW_ELRAIL,
-			SPR_BUILD_Y_ELRAIL,
-			SPR_IMG_AUTOELRAIL,
-			SPR_IMG_DEPOT_ELRAIL,
-			SPR_BUILD_TUNNEL_ELRAIL,
-			SPR_IMG_CONVERT_ELRAIL
-		},
-
-		{
-			SPR_CURSOR_NS_ELRAIL,
-			SPR_CURSOR_SWNE_ELRAIL,
-			SPR_CURSOR_EW_ELRAIL,
-			SPR_CURSOR_NWSE_ELRAIL,
-			SPR_CURSOR_AUTOELRAIL,
-			SPR_CURSOR_ELRAIL_DEPOT,
-			SPR_CURSOR_TUNNEL_ELRAIL,
-			SPR_CURSOR_CONVERT_ELRAIL
-		},
-
-		/* strings */
-		{ STR_TITLE_ELRAIL_CONSTRUCTION },
-
-		/* Offset of snow tiles */
-		SPR_RAIL_SNOW_OFFSET,
-
-		/* Powered railtypes */
-		1 << RAILTYPE_ELECTRIC,
-
-		/* Compatible railtypes */
-		1 << RAILTYPE_ELECTRIC | 1 << RAILTYPE_RAIL,
-
-		/* main offset */
-		0,
-
-		/* bridge offset */
-		0,
-
-		/* custom ground offset */
-		0,
-	},
-
-	/** Monorail */
-	{ /* Main Sprites */
-		{ SPR_MONO_TRACK_Y, SPR_MONO_TRACK_N_S, SPR_MONO_TRACK_BASE, SPR_MONO_SINGLE_Y, SPR_MONO_SINGLE_X,
-			SPR_MONO_SINGLE_NORTH, SPR_MONO_SINGLE_SOUTH, SPR_MONO_SINGLE_EAST, SPR_MONO_SINGLE_WEST,
-			SPR_CROSSING_OFF_X_MONO,
-			SPR_TUNNEL_ENTRY_REAR_MONO
-		},
-
-		/* GUI sprites */
-		{ 0x4E7, 0x4E8, 0x4E9, 0x4EA,
-			SPR_IMG_AUTOMONO,
-			SPR_IMG_DEPOT_MONO,
-			SPR_IMG_TUNNEL_MONO,
-			SPR_IMG_CONVERT_MONO
-		},
-
-		{
-			SPR_CURSOR_NS_MONO,
-			SPR_CURSOR_SWNE_MONO,
-			SPR_CURSOR_EW_MONO,
-			SPR_CURSOR_NWSE_MONO,
-			SPR_CURSOR_AUTOMONO,
-			SPR_CURSOR_MONO_DEPOT,
-			SPR_CURSOR_TUNNEL_MONO,
-			SPR_CURSOR_CONVERT_MONO
-		},
-
-		/* strings */
-		{ STR_100B_MONORAIL_CONSTRUCTION },
-
-		/* Offset of snow tiles */
-		SPR_MONO_SNOW_OFFSET,
-
-		/* Powered railtypes */
-		1 << RAILTYPE_MONO,
-
-		/* Compatible Railtypes */
-		1 << RAILTYPE_MONO,
-
-		/* main offset */
-		82,
-
-		/* bridge offset */
-		16,
-
-		/* custom ground offset */
-		1,
-	},
-
-	/** Maglev */
-	{ /* Main sprites */
-		{ SPR_MGLV_TRACK_Y, SPR_MGLV_TRACK_N_S, SPR_MGLV_TRACK_BASE, SPR_MGLV_SINGLE_Y, SPR_MGLV_SINGLE_X,
-			SPR_MGLV_SINGLE_NORTH, SPR_MGLV_SINGLE_SOUTH, SPR_MGLV_SINGLE_EAST, SPR_MGLV_SINGLE_WEST,
-			SPR_CROSSING_OFF_X_MAGLEV,
-			SPR_TUNNEL_ENTRY_REAR_MAGLEV
-		},
-
-		/* GUI sprites */
-		{ 0x4EB, 0x4EC, 0x4EE, 0x4ED,
-			SPR_IMG_AUTOMAGLEV,
-			SPR_IMG_DEPOT_MAGLEV,
-			SPR_IMG_TUNNEL_MAGLEV,
-			SPR_IMG_CONVERT_MAGLEV
-		},
-
-		{
-			SPR_CURSOR_NS_MAGLEV,
-			SPR_CURSOR_SWNE_MAGLEV,
-			SPR_CURSOR_EW_MAGLEV,
-			SPR_CURSOR_NWSE_MAGLEV,
-			SPR_CURSOR_AUTOMAGLEV,
-			SPR_CURSOR_MAGLEV_DEPOT,
-			SPR_CURSOR_TUNNEL_MAGLEV,
-			SPR_CURSOR_CONVERT_MAGLEV
-		},
-
-		/* strings */
-		{ STR_100C_MAGLEV_CONSTRUCTION },
-
-		/* Offset of snow tiles */
-		SPR_MGLV_SNOW_OFFSET,
-
-		/* Powered railtypes */
-		1 << RAILTYPE_MAGLEV,
-
-		/* Compatible Railtypes */
-		1 << RAILTYPE_MAGLEV,
-
-		/* main offset */
-		164,
-
-		/* bridge offset */
-		24,
-
-		/* custom ground offset */
-		2,
-	},
-};
-
-#endif /* RAILTYPES_H */
--- a/src/road.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/road.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -1,11 +1,17 @@
+/* $Id$ */
+
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
 #include "rail_map.h"
-#include "road.h"
 #include "road_map.h"
+#include "road_internal.h"
 #include "water_map.h"
-#include "macros.h"
+#include "genworld.h"
+#include "player_func.h"
+#include "player_base.h"
+#include "engine.h"
+#include "settings_type.h"
+#include "date_func.h"
 
 bool IsPossibleCrossing(const TileIndex tile, Axis ax)
 {
@@ -67,3 +73,38 @@
 
 	return org_rb;
 }
+
+bool HasRoadTypesAvail(const PlayerID p, const RoadTypes rts)
+{
+	RoadTypes avail_roadtypes;
+
+	if (p == OWNER_TOWN || _game_mode == GM_EDITOR || IsGeneratingWorld()) {
+		avail_roadtypes = ROADTYPES_ROAD;
+	} else {
+		if (!IsValidPlayer(p)) return false;
+		avail_roadtypes = (RoadTypes)GetPlayer(p)->avail_roadtypes | ROADTYPES_ROAD; // road is available for always for everybody
+	}
+	return (rts & ~avail_roadtypes) == 0;
+}
+
+bool ValParamRoadType(const RoadType rt)
+{
+	return HasRoadTypesAvail(_current_player, RoadTypeToRoadTypes(rt));
+}
+
+RoadTypes GetPlayerRoadtypes(PlayerID p)
+{
+	RoadTypes rt = ROADTYPES_NONE;
+
+	for (EngineID i = 0; i != TOTAL_NUM_ENGINES; i++) {
+		const Engine* e = GetEngine(i);
+		const EngineInfo *ei = EngInfo(i);
+
+		if (e->type == VEH_ROAD && HasBit(ei->climates, _opt.landscape) &&
+				(HasBit(e->player_avail, p) || _date >= e->intro_date + 365)) {
+			SetBit(rt, HasBit(ei->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD);
+		}
+	}
+
+	return rt;
+}
--- a/src/road.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-/* $Id$ */
-
-/** @file road.h */
-
-#ifndef ROAD_H
-#define ROAD_H
-
-#include "helpers.hpp"
-
-/**
- * The different roadtypes we support
- *
- * @note currently only ROADTYPE_ROAD and ROADTYPE_TRAM are supported.
- */
-enum RoadType {
-	ROADTYPE_ROAD = 0,      ///< Basic road type
-	ROADTYPE_TRAM = 1,      ///< Trams
-	ROADTYPE_HWAY = 2,      ///< Only a placeholder. Not sure what we are going to do with this road type.
-	ROADTYPE_END,           ///< Used for iterations
-	INVALID_ROADTYPE = 0xFF ///< flag for invalid roadtype
-};
-DECLARE_POSTFIX_INCREMENT(RoadType);
-
-/**
- * The different roadtypes we support, but then a bitmask of them
- * @note currently only roadtypes with ROADTYPE_ROAD and ROADTYPE_TRAM are supported.
- */
-enum RoadTypes {
-	ROADTYPES_NONE     = 0,                                                 ///< No roadtypes
-	ROADTYPES_ROAD     = 1 << ROADTYPE_ROAD,                                ///< Road
-	ROADTYPES_TRAM     = 1 << ROADTYPE_TRAM,                                ///< Trams
-	ROADTYPES_HWAY     = 1 << ROADTYPE_HWAY,                                ///< Highway (or whatever substitute)
-	ROADTYPES_ROADTRAM = ROADTYPES_ROAD | ROADTYPES_TRAM,                   ///< Road + trams
-	ROADTYPES_ROADHWAY = ROADTYPES_ROAD | ROADTYPES_HWAY,                   ///< Road + highway (or whatever substitute)
-	ROADTYPES_TRAMHWAY = ROADTYPES_TRAM | ROADTYPES_HWAY,                   ///< Trams + highway (or whatever substitute)
-	ROADTYPES_ALL      = ROADTYPES_ROAD | ROADTYPES_TRAM | ROADTYPES_HWAY,  ///< Road + trams + highway (or whatever substitute)
-};
-DECLARE_ENUM_AS_BIT_SET(RoadTypes);
-
-/**
- * Whether the given roadtype is valid.
- * @param rt the roadtype to check for validness
- * @return true if and only if valid
- */
-static inline bool IsValidRoadType(RoadType rt)
-{
-	return rt == ROADTYPE_ROAD || rt == ROADTYPE_TRAM;
-}
-
-/**
- * Are the given bits pointing to valid roadtypes?
- * @param rts the roadtypes to check for validness
- * @return true if and only if valid
- */
-static inline bool AreValidRoadTypes(RoadTypes rts)
-{
-	return HasBit(rts, ROADTYPE_ROAD) || HasBit(rts, ROADTYPE_TRAM);
-}
-
-/**
- * Maps a RoadType to the corresponding RoadTypes value
- *
- * @param rt the roadtype to get the roadtypes from
- * @return the roadtypes with the given roadtype
- */
-static inline RoadTypes RoadTypeToRoadTypes(RoadType rt)
-{
-	return (RoadTypes)(1 << rt);
-}
-
-/**
- * Returns the RoadTypes which are not present in the given RoadTypes
- *
- * This function returns the complement of a given RoadTypes.
- *
- * @param r The given RoadTypes
- * @return The complement of the given RoadTypes
- * @note The unused value ROADTYPES_HWAY will be used, too.
- */
-static inline RoadTypes ComplementRoadTypes(RoadTypes r)
-{
-	return (RoadTypes)(ROADTYPES_ALL ^ r);
-}
-
-/**
- * Enumeration for the road parts on a tile.
- *
- * This enumeration defines the possible road parts which
- * can be build on a tile.
- */
-enum RoadBits {
-	ROAD_NONE = 0U,                  ///< No road-part is build
-	ROAD_NW   = 1U,                  ///< North-west part
-	ROAD_SW   = 2U,                  ///< South-west part
-	ROAD_SE   = 4U,                  ///< South-east part
-	ROAD_NE   = 8U,                  ///< North-east part
-	ROAD_X    = ROAD_SW | ROAD_NE,   ///< Full road along the x-axis (south-west + north-east)
-	ROAD_Y    = ROAD_NW | ROAD_SE,   ///< Full road along the y-axis (north-west + south-east)
-	ROAD_ALL  = ROAD_X  | ROAD_Y     ///< Full 4-way crossing
-};
-
-DECLARE_ENUM_AS_BIT_SET(RoadBits);
-
-/**
- * Calculate the complement of a RoadBits value
- *
- * Simply flips all bits in the RoadBits value to get the complement
- * of the RoadBits.
- *
- * @param r The given RoadBits value
- * @return the complement
- */
-static inline RoadBits ComplementRoadBits(RoadBits r)
-{
-	return (RoadBits)(ROAD_ALL ^ r);
-}
-
-/**
- * Calculate the mirrored RoadBits
- *
- * Simply move the bits to their new position.
- *
- * @param r The given RoadBits value
- * @return the mirrored
- */
-static inline RoadBits MirrorRoadBits(RoadBits r)
-{
-	return (RoadBits)(GB(r, 0, 2) << 2 | GB(r, 2, 2));
-}
-
-/**
- * Calculate rotated RoadBits
- *
- * Move the Roadbits clockwise til they are in their final position.
- *
- * @param r The given RoadBits value
- * @param rot The given Rotation angle
- * @return the rotated
- */
-static inline RoadBits RotateRoadBits(RoadBits r, DiagDirDiff rot)
-{
-	for (; rot > (DiagDirDiff)0; rot--){
-		r = (RoadBits)(GB(r, 0, 1) << 3 | GB(r, 1, 3));
-	}
-	return r;
-}
-
-/**
- * Create the road-part which belongs to the given DiagDirection
- *
- * This function returns a RoadBits value which belongs to
- * the given DiagDirection.
- *
- * @param d The DiagDirection
- * @return The result RoadBits which the selected road-part set
- */
-static inline RoadBits DiagDirToRoadBits(DiagDirection d)
-{
-	return (RoadBits)(ROAD_NW << (3 ^ d));
-}
-
-/**
- * Return if the tile is a valid tile for a crossing.
- *
- * @note function is overloaded
- * @param tile the curent tile
- * @param ax the axis of the road over the rail
- * @return true if it is a valid tile
- */
-bool IsPossibleCrossing(const TileIndex tile, Axis ax);
-
-/**
- * Checks whether the trackdir means that we are reversing.
- * @param dir the trackdir to check
- * @return true if it is a reversing road trackdir
- */
-static inline bool IsReversingRoadTrackdir(Trackdir dir)
-{
-	return (dir & 0x07) >= 6;
-}
-
-/**
- * Checks whether the given trackdir is a straight road
- * @param dir the trackdir to check
- * @return true if it is a straight road trackdir
- */
-static inline bool IsStraightRoadTrackdir(Trackdir dir)
-{
-	return (dir & 0x06) == 0;
-}
-
-/**
- * Clean up unneccesary RoadBits of a planed tile.
- * @param tile current tile
- * @param org_rb planed RoadBits
- * @return optimised RoadBits
- */
-RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb);
-
-/**
- * Is it allowed to remove the given road bits from the given tile?
- * @param tile      the tile to remove the road from
- * @param remove    the roadbits that are going to be removed
- * @param owner     the actual owner of the roadbits of the tile
- * @param edge_road are the removed bits from a town?
- * @param rt        the road type to remove the bits from
- * @return true when it is allowed to remove the road bits
- */
-bool CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, Owner owner, bool *edge_road, RoadType rt);
-
-/**
- * Draw the catenary for tram road bits
- * @param ti   information about the tile (position, slope)
- * @param tram the roadbits to draw the catenary for
- */
-void DrawTramCatenary(TileInfo *ti, RoadBits tram);
-
-#endif /* ROAD_H */
--- a/src/road_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/road_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -9,31 +9,33 @@
 #include "cmd_helper.h"
 #include "rail_map.h"
 #include "road_map.h"
+#include "road_internal.h"
 #include "sprite.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "functions.h"
-#include "window.h"
-#include "map.h"
+#include "tile_cmd.h"
 #include "landscape.h"
-#include "tile.h"
 #include "town_map.h"
-#include "vehicle.h"
-#include "viewport.h"
-#include "command.h"
-#include "player.h"
+#include "viewport_func.h"
+#include "command_func.h"
 #include "town.h"
-#include "gfx.h"
-#include "sound.h"
 #include "yapf/yapf.h"
 #include "depot.h"
 #include "newgrf.h"
 #include "station_map.h"
 #include "tunnel_map.h"
 #include "misc/autoptr.hpp"
+#include "variables.h"
 #include "autoslope.h"
 #include "transparency.h"
+#include "tunnelbridge_map.h"
+#include "window_func.h"
+#include "strings_func.h"
+#include "vehicle_func.h"
+#include "vehicle_base.h"
+#include "sound_func.h"
+#include "road_func.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
 
 #define M(x) (1 << (x))
 /* Level crossings may only be built on these slopes */
@@ -112,8 +114,6 @@
 	 * false if it was a center piece. Affects town ratings drop */
 	bool edge_road;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	RoadType rt = (RoadType)GB(p1, 4, 2);
 	if (!IsValidRoadType(rt)) return CMD_ERROR;
 
@@ -121,16 +121,19 @@
 	switch (GetTileType(tile)) {
 		case MP_ROAD:
 			if (_game_mode != GM_EDITOR && GetRoadOwner(tile, rt) == OWNER_TOWN) t = GetTownByTile(tile);
+			if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 			break;
 
 		case MP_STATION:
 			if (!IsDriveThroughStopTile(tile)) return CMD_ERROR;
+			if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 			break;
 
 		case MP_TUNNELBRIDGE:
-			if ((IsTunnel(tile) && GetTunnelTransportType(tile) != TRANSPORT_ROAD) ||
-					(IsBridge(tile) && GetBridgeTransportType(tile) != TRANSPORT_ROAD)) return CMD_ERROR;
-			break;
+			{
+				if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return CMD_ERROR;
+				if (GetVehicleTunnelBridge(tile, GetOtherTunnelBridgeEnd(tile)) != NULL) return CMD_ERROR;
+			} break;
 
 		default:
 			return CMD_ERROR;
@@ -143,8 +146,6 @@
 
 	if (!CheckAllowRemoveRoad(tile, pieces, &edge_road, rt)) return CMD_ERROR;
 
-	if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
-
 	/* check if you're allowed to remove the street owned by a town
 	 * removal allowance depends on difficulty setting */
 	if (!CheckforTownRating(flags, t, ROAD_REMOVE)) return CMD_ERROR;
@@ -153,11 +154,11 @@
 		/* If it's the last roadtype, just clear the whole tile */
 		if (rts == RoadTypeToRoadTypes(rt)) return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 
-		CommandCost cost;
+		CommandCost cost(EXPENSES_CONSTRUCTION);
 		if (IsTileType(tile, MP_TUNNELBRIDGE)) {
-			TileIndex other_end = IsTunnel(tile) ? GetOtherTunnelEnd(tile) : GetOtherBridgeEnd(tile);
+			TileIndex other_end = GetOtherTunnelBridgeEnd(tile);
 			/* Pay for *every* tile of the bridge or tunnel */
-			cost.AddCost((DistanceManhattan(IsTunnel(tile) ? GetOtherTunnelEnd(tile) : GetOtherBridgeEnd(tile), tile) + 1) * _price.remove_road);
+			cost.AddCost((DistanceManhattan(other_end, tile) + 1) * _price.remove_road);
 			if (flags & DC_EXEC) {
 				SetRoadTypes(other_end, GetRoadTypes(other_end) & ~RoadTypeToRoadTypes(rt));
 				SetRoadTypes(tile, GetRoadTypes(tile) & ~RoadTypeToRoadTypes(rt));
@@ -166,7 +167,7 @@
 				MarkTileDirtyByTile(tile);
 				MarkTileDirtyByTile(other_end);
 				if (IsBridge(tile)) {
-					TileIndexDiff delta = TileOffsByDiagDir(GetBridgeRampDirection(tile));
+					TileIndexDiff delta = TileOffsByDiagDir(GetTunnelBridgeDirection(tile));
 
 					for (TileIndex t = tile + delta; t != other_end; t += delta) MarkTileDirtyByTile(t);
 				}
@@ -178,7 +179,7 @@
 				MarkTileDirtyByTile(tile);
 			}
 		}
-		return CommandCost(cost);
+		return cost;
 	}
 
 	switch (GetRoadTileType(tile)) {
@@ -198,9 +199,8 @@
 			c &= present;
 			if (c == ROAD_NONE) return CMD_ERROR;
 
+			ChangeTownRating(t, -road_remove_cost[(byte)edge_road], RATING_ROAD_MINIMUM);
 			if (flags & DC_EXEC) {
-				ChangeTownRating(t, -road_remove_cost[(byte)edge_road], RATING_ROAD_MINIMUM);
-
 				present ^= c;
 				if (present == ROAD_NONE) {
 					RoadTypes rts = GetRoadTypes(tile) & ComplementRoadTypes(RoadTypeToRoadTypes(rt));
@@ -221,7 +221,7 @@
 					MarkTileDirtyByTile(tile);
 				}
 			}
-			return CommandCost(CountBits(c) * _price.remove_road);
+			return CommandCost(EXPENSES_CONSTRUCTION, CountBits(c) * _price.remove_road);
 		}
 
 		case ROAD_TILE_CROSSING: {
@@ -233,11 +233,11 @@
 			 * we can't draw the crossing without trambits ;) */
 			if (rt == ROADTYPE_ROAD && HasBit(GetRoadTypes(tile), ROADTYPE_TRAM) && ((flags & DC_EXEC) || !HasBit(p1, 6))) return CMD_ERROR;
 
+			if (rt == ROADTYPE_ROAD) {
+				ChangeTownRating(t, -road_remove_cost[(byte)edge_road], RATING_ROAD_MINIMUM);
+			}
+
 			if (flags & DC_EXEC) {
-				if (rt == ROADTYPE_ROAD) {
-					ChangeTownRating(t, -road_remove_cost[(byte)edge_road], RATING_ROAD_MINIMUM);
-				}
-
 				RoadTypes rts = GetRoadTypes(tile) & ComplementRoadTypes(RoadTypeToRoadTypes(rt));
 				if (rts == ROADTYPES_NONE) {
 					MakeRailNormal(tile, GetTileOwner(tile), GetCrossingRailBits(tile), GetRailType(tile));
@@ -247,7 +247,7 @@
 				MarkTileDirtyByTile(tile);
 				YapfNotifyTrackLayoutChange(tile, FindFirstTrack(GetTrackBits(tile)));
 			}
-			return CommandCost(_price.remove_road * 2);
+			return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_road * 2);
 		}
 
 		default:
@@ -343,7 +343,7 @@
 		*pieces |= MirrorRoadBits(*pieces);
 
 		if (existing == ROAD_NONE || existing == *pieces) {
-			if (*pieces == ROAD_X || *pieces == ROAD_Y) return _price.terraform;
+			if (*pieces == ROAD_X || *pieces == ROAD_Y) return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 		}
 		return CMD_ERROR;
 	}
@@ -355,7 +355,7 @@
 	if (_patches.build_on_slopes && !_is_old_ai_player &&
 			existing == ROAD_NONE && CountBits(*pieces) == 1 &&
 			(_valid_tileh_slopes_road[2][tileh] & *pieces) == ROAD_NONE) {
-		return CommandCost(_price.terraform);
+		return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 	}
 
 	/* no special foundation */
@@ -367,7 +367,7 @@
 
 	/* foundation is used. Whole tile is leveled up */
 	if ((~_valid_tileh_slopes_road[1][tileh] & road_bits) == ROAD_NONE) {
-		return CommandCost(existing != ROAD_NONE ? (Money)0 : _price.terraform);
+		return CommandCost(EXPENSES_CONSTRUCTION, existing != ROAD_NONE ? (Money)0 : _price.terraform);
 	}
 
 	/* Force straight roads. */
@@ -375,7 +375,7 @@
 
 	/* partly leveled up tile, only if there's no road on that tile */
 	if ((existing == ROAD_NONE || existing == *pieces) && (tileh == SLOPE_W || tileh == SLOPE_S || tileh == SLOPE_E || tileh == SLOPE_N)) {
-		if (*pieces == ROAD_X || *pieces == ROAD_Y) return _price.terraform;
+		if (*pieces == ROAD_X || *pieces == ROAD_Y) return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 	}
 	return CMD_ERROR;
 }
@@ -390,14 +390,12 @@
  */
 CommandCost CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	CommandCost cost;
+	CommandCost cost(EXPENSES_CONSTRUCTION);
 	CommandCost ret;
 	RoadBits existing = ROAD_NONE;
 	RoadBits all_bits = ROAD_NONE;
 	Slope tileh;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	/* Road pieces are max 4 bitset values (NE, NW, SE, SW) and town can only be non-zero
 	 * if a non-player is building the road */
 	if ((IsValidPlayer(_current_player) && p2 != 0) || (_current_player == OWNER_TOWN && !IsValidTownID(p2))) return CMD_ERROR;
@@ -489,9 +487,10 @@
 				YapfNotifyTrackLayoutChange(tile, FindFirstTrack(GetTrackBits(tile)));
 				/* Always add road to the roadtypes (can't draw without it) */
 				MakeRoadCrossing(tile, _current_player, _current_player, _current_player, GetTileOwner(tile), roaddir, GetRailType(tile), RoadTypeToRoadTypes(rt) | ROADTYPES_ROAD, p2);
+				UpdateLevelCrossing(tile, false);
 				MarkTileDirtyByTile(tile);
 			}
-			return CommandCost(_price.build_road * (rt == ROADTYPE_ROAD ? 2 : 4));
+			return CommandCost(EXPENSES_CONSTRUCTION, _price.build_road * (rt == ROADTYPE_ROAD ? 2 : 4));
 		}
 
 		case MP_STATION:
@@ -502,12 +501,13 @@
 			break;
 
 		case MP_TUNNELBRIDGE:
-			if ((IsTunnel(tile) && GetTunnelTransportType(tile) != TRANSPORT_ROAD) ||
-					(IsBridge(tile) && GetBridgeTransportType(tile) != TRANSPORT_ROAD)) return CMD_ERROR;
-			if (HasBit(GetRoadTypes(tile), rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
-			/* Don't allow "upgrading" the bridge/tunnel when vehicles are already driving on it */
-			if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
-			break;
+			{
+				if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return CMD_ERROR;
+				if (HasBit(GetRoadTypes(tile), rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
+
+				/* Don't allow "upgrading" the bridge/tunnel when vehicles are already driving on it */
+				if (GetVehicleTunnelBridge(tile, GetOtherTunnelBridgeEnd(tile)) != NULL) return CMD_ERROR;
+			} break;
 
 		default:
 do_clear:;
@@ -535,7 +535,7 @@
 	cost.AddCost(CountBits(pieces) * _price.build_road);
 	if (IsTileType(tile, MP_TUNNELBRIDGE)) {
 		/* Pay for *every* tile of the bridge or tunnel */
-		cost.MultiplyCost(DistanceManhattan(IsTunnel(tile) ? GetOtherTunnelEnd(tile) : GetOtherBridgeEnd(tile), tile));
+		cost.MultiplyCost(DistanceManhattan(GetOtherTunnelBridgeEnd(tile), tile) + 1);
 	}
 
 	if (flags & DC_EXEC) {
@@ -551,7 +551,7 @@
 			} break;
 
 			case MP_TUNNELBRIDGE: {
-				TileIndex other_end = IsTunnel(tile) ? GetOtherTunnelEnd(tile) : GetOtherBridgeEnd(tile);
+				TileIndex other_end = GetOtherTunnelBridgeEnd(tile);
 
 				SetRoadTypes(other_end, GetRoadTypes(other_end) | RoadTypeToRoadTypes(rt));
 				SetRoadTypes(tile, GetRoadTypes(tile) | RoadTypeToRoadTypes(rt));
@@ -560,7 +560,7 @@
 				MarkTileDirtyByTile(other_end);
 				MarkTileDirtyByTile(tile);
 				if (IsBridge(tile)) {
-					TileIndexDiff delta = TileOffsByDiagDir(GetBridgeRampDirection(tile));
+					TileIndexDiff delta = TileOffsByDiagDir(GetTunnelBridgeDirection(tile));
 
 					for (TileIndex t = tile + delta; t != other_end; t += delta) MarkTileDirtyByTile(t);
 				}
@@ -586,30 +586,6 @@
 	return cost;
 }
 
-/**
- * Switches the rail type on a level crossing.
- * @param tile        The tile on which the railtype is to be convert.
- * @param totype      The railtype we want to convert to
- * @param exec        Switches between test and execute mode
- * @return            The cost and state of the operation
- * @retval CMD_ERROR  An error occured during the operation.
- */
-CommandCost DoConvertStreetRail(TileIndex tile, RailType totype, bool exec)
-{
-	/* not a railroad crossing? */
-	if (!IsLevelCrossing(tile)) return CMD_ERROR;
-
-	if (exec) {
-		SetRailType(tile, totype);
-		MarkTileDirtyByTile(tile);
-		YapfNotifyTrackLayoutChange(tile, FindFirstTrack(GetCrossingRailBits(tile)));
-		VehicleFromPos(tile, &tile, UpdateTrainPowerProc);
-	}
-
-	return CommandCost(RailBuildCost(totype) / 2);
-}
-
-
 /** Build a long piece of road.
  * @param end_tile end tile of drag
  * @param flags operation to perform
@@ -624,14 +600,12 @@
 CommandCost CmdBuildLongRoad(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	TileIndex start_tile, tile;
-	CommandCost cost, ret;
+	CommandCost ret, cost(EXPENSES_CONSTRUCTION);
 	bool had_bridge = false;
 	bool had_tunnel = false;
 	bool had_success = false;
 	DisallowedRoadDirections drd = DRD_NORTHBOUND;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	if (p1 >= MapSize()) return CMD_ERROR;
 
 	start_tile = p1;
@@ -675,12 +649,12 @@
 			/* Only pay for the upgrade on one side of the bridges and tunnels */
 			if (IsTileType(tile, MP_TUNNELBRIDGE)) {
 				if (IsBridge(tile)) {
-					if ((!had_bridge || GetBridgeRampDirection(tile) == DIAGDIR_SE || GetBridgeRampDirection(tile) == DIAGDIR_SW)) {
+					if ((!had_bridge || GetTunnelBridgeDirection(tile) == DIAGDIR_SE || GetTunnelBridgeDirection(tile) == DIAGDIR_SW)) {
 						cost.AddCost(ret);
 					}
 					had_bridge = true;
 				} else {
-					if ((!had_tunnel || GetTunnelDirection(tile) == DIAGDIR_SE || GetTunnelDirection(tile) == DIAGDIR_SW)) {
+					if ((!had_tunnel || GetTunnelBridgeDirection(tile) == DIAGDIR_SE || GetTunnelBridgeDirection(tile) == DIAGDIR_SW)) {
 						cost.AddCost(ret);
 					}
 					had_tunnel = true;
@@ -711,9 +685,8 @@
 CommandCost CmdRemoveLongRoad(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	TileIndex start_tile, tile;
-	CommandCost cost, ret, money;
-
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
+	CommandCost ret, cost(EXPENSES_CONSTRUCTION);
+	Money money;
 
 	if (p1 >= MapSize()) return CMD_ERROR;
 
@@ -733,7 +706,7 @@
 		p2 ^= IsInsideMM(p2 & 3, 1, 3) ? 3 : 0;
 	}
 
-	money.AddCost(GetAvailableMoneyForCommand());
+	money = GetAvailableMoneyForCommand();
 	tile = start_tile;
 	/* Start tile is the small number. */
 	for (;;) {
@@ -747,8 +720,8 @@
 			ret = DoCommand(tile, rt << 4 | bits, 0, flags & ~DC_EXEC, CMD_REMOVE_ROAD);
 			if (CmdSucceeded(ret)) {
 				if (flags & DC_EXEC) {
-					money.AddCost(-ret.GetCost());
-					if (money.GetCost() < 0) {
+					money -= ret.GetCost();
+					if (money < 0) {
 						_additional_cash_required = DoCommand(end_tile, start_tile, p2, flags & ~DC_EXEC, CMD_REMOVE_LONG_ROAD).GetCost();
 						return cost;
 					}
@@ -781,8 +754,6 @@
 	CommandCost cost;
 	Slope tileh;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	DiagDirection dir = Extract<DiagDirection, 0>(p1);
 	RoadType rt = (RoadType)GB(p1, 2, 2);
 
@@ -828,7 +799,7 @@
 		delete GetDepotByTile(tile);
 	}
 
-	return CommandCost(_price.remove_road_depot);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_road_depot);
 }
 
 static CommandCost ClearTile_Road(TileIndex tile, byte flags)
@@ -844,7 +815,7 @@
 			    !(flags & DC_AUTO)
 				) {
 				RoadTypes rts = GetRoadTypes(tile);
-				CommandCost ret;
+				CommandCost ret(EXPENSES_CONSTRUCTION);
 				for (RoadType rt = ROADTYPE_ROAD; rt < ROADTYPE_END; rt++) {
 					if (HasBit(rts, rt)) {
 						CommandCost tmp_ret = DoCommand(tile, rt << 4 | GetRoadBits(tile, rt), 0, flags, CMD_REMOVE_ROAD);
@@ -859,7 +830,7 @@
 
 		case ROAD_TILE_CROSSING: {
 			RoadTypes rts = GetRoadTypes(tile);
-			CommandCost ret;
+			CommandCost ret(EXPENSES_CONSTRUCTION);
 
 			if (flags & DC_AUTO) return_cmd_error(STR_1801_MUST_REMOVE_ROAD_FIRST);
 
@@ -1234,14 +1205,14 @@
 
 	const Town* t = ClosestTownFromTile(tile, (uint)-1);
 	if (!HasRoadWorks(tile)) {
-		int grp = 0;
+		HouseZonesBits grp = HZB_TOWN_EDGE;
 
 		if (t != NULL) {
 			grp = GetTownRadiusGroup(t, tile);
 
 			/* Show an animation to indicate road work */
 			if (t->road_build_months != 0 &&
-					(DistanceManhattan(t->xy, tile) < 8 || grp != 0) &&
+					(DistanceManhattan(t->xy, tile) < 8 || grp != HZB_TOWN_EDGE) &&
 					GetRoadTileType(tile) == ROAD_TILE_NORMAL && CountBits(GetAllRoadBits(tile)) > 1 ) {
 				if (GetTileSlope(tile, NULL) == SLOPE_FLAT && EnsureNoVehicleOnGround(tile) && Chance16(1, 40)) {
 					StartRoadWorks(tile);
@@ -1370,15 +1341,13 @@
 	TRACKDIR_X_SW, TRACKDIR_Y_NW, TRACKDIR_X_NE, TRACKDIR_Y_SE
 };
 
-static uint32 VehicleEnter_Road(Vehicle *v, TileIndex tile, int x, int y)
+static VehicleEnterTileStatus VehicleEnter_Road(Vehicle *v, TileIndex tile, int x, int y)
 {
 	switch (GetRoadTileType(tile)) {
 		case ROAD_TILE_CROSSING:
-			if (v->type == VEH_TRAIN && !IsCrossingBarred(tile)) {
-				/* train crossing a road */
-				SndPlayVehicleFx(SND_0E_LEVEL_CROSSING, v);
-				BarCrossing(tile);
-				MarkTileDirtyByTile(tile);
+			if (v->type == VEH_TRAIN) {
+				/* it should be barred */
+				assert(IsCrossingBarred(tile));
 			}
 			break;
 
@@ -1440,11 +1409,11 @@
 	if (_patches.build_on_slopes && AutoslopeEnabled()) {
 		switch (GetRoadTileType(tile)) {
 			case ROAD_TILE_CROSSING:
-				if (!IsSteepSlope(tileh_new) && (GetTileMaxZ(tile) == z_new + GetSlopeMaxZ(tileh_new)) && HasBit(VALID_LEVEL_CROSSING_SLOPES, tileh_new)) return _price.terraform;
+				if (!IsSteepSlope(tileh_new) && (GetTileMaxZ(tile) == z_new + GetSlopeMaxZ(tileh_new)) && HasBit(VALID_LEVEL_CROSSING_SLOPES, tileh_new)) return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 				break;
 
 			case ROAD_TILE_DEPOT:
-				if (AutoslopeCheckForEntranceEdge(tile, z_new, tileh_new, GetRoadDepotDirection(tile))) return _price.terraform;
+				if (AutoslopeCheckForEntranceEdge(tile, z_new, tileh_new, GetRoadDepotDirection(tile))) return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 				break;
 
 			case ROAD_TILE_NORMAL: {
@@ -1462,7 +1431,7 @@
 						z_new += ApplyFoundationToSlope(GetRoadFoundation(tileh_new, bits), &tileh_new);
 
 						/* The surface slope must not be changed */
-						if ((z_old == z_new) && (tileh_old == tileh_new)) return _price.terraform;
+						if ((z_old == z_new) && (tileh_old == tileh_new)) return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 					}
 				}
 				break;
--- a/src/road_cmd.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/road_cmd.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,7 +5,7 @@
 #ifndef ROAD_CMD_H
 #define ROAD_CMD_H
 
-#include "direction.h"
+#include "direction_type.h"
 
 void DrawRoadDepotSprite(int x, int y, DiagDirection dir, RoadType rt);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/road_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,141 @@
+/* $Id$ */
+
+/** @file road_func.h Functions related to roads. */
+
+#ifndef ROAD_FUNC_H
+#define ROAD_FUNC_H
+
+#include "core/bitmath_func.hpp"
+#include "road_type.h"
+#include "direction_func.h"
+#include "player_type.h"
+
+/**
+ * Whether the given roadtype is valid.
+ * @param rt the roadtype to check for validness
+ * @return true if and only if valid
+ */
+static inline bool IsValidRoadType(RoadType rt)
+{
+	return rt == ROADTYPE_ROAD || rt == ROADTYPE_TRAM;
+}
+
+/**
+ * Are the given bits pointing to valid roadtypes?
+ * @param rts the roadtypes to check for validness
+ * @return true if and only if valid
+ */
+static inline bool AreValidRoadTypes(RoadTypes rts)
+{
+	return HasBit(rts, ROADTYPE_ROAD) || HasBit(rts, ROADTYPE_TRAM);
+}
+
+/**
+ * Maps a RoadType to the corresponding RoadTypes value
+ *
+ * @param rt the roadtype to get the roadtypes from
+ * @return the roadtypes with the given roadtype
+ */
+static inline RoadTypes RoadTypeToRoadTypes(RoadType rt)
+{
+	return (RoadTypes)(1 << rt);
+}
+
+/**
+ * Returns the RoadTypes which are not present in the given RoadTypes
+ *
+ * This function returns the complement of a given RoadTypes.
+ *
+ * @param r The given RoadTypes
+ * @return The complement of the given RoadTypes
+ * @note The unused value ROADTYPES_HWAY will be used, too.
+ */
+static inline RoadTypes ComplementRoadTypes(RoadTypes r)
+{
+	return (RoadTypes)(ROADTYPES_ALL ^ r);
+}
+
+
+/**
+ * Calculate the complement of a RoadBits value
+ *
+ * Simply flips all bits in the RoadBits value to get the complement
+ * of the RoadBits.
+ *
+ * @param r The given RoadBits value
+ * @return the complement
+ */
+static inline RoadBits ComplementRoadBits(RoadBits r)
+{
+	return (RoadBits)(ROAD_ALL ^ r);
+}
+
+/**
+ * Calculate the mirrored RoadBits
+ *
+ * Simply move the bits to their new position.
+ *
+ * @param r The given RoadBits value
+ * @return the mirrored
+ */
+static inline RoadBits MirrorRoadBits(RoadBits r)
+{
+	return (RoadBits)(GB(r, 0, 2) << 2 | GB(r, 2, 2));
+}
+
+/**
+ * Calculate rotated RoadBits
+ *
+ * Move the Roadbits clockwise til they are in their final position.
+ *
+ * @param r The given RoadBits value
+ * @param rot The given Rotation angle
+ * @return the rotated
+ */
+static inline RoadBits RotateRoadBits(RoadBits r, DiagDirDiff rot)
+{
+	for (; rot > (DiagDirDiff)0; rot--){
+		r = (RoadBits)(GB(r, 0, 1) << 3 | GB(r, 1, 3));
+	}
+	return r;
+}
+
+/**
+ * Create the road-part which belongs to the given DiagDirection
+ *
+ * This function returns a RoadBits value which belongs to
+ * the given DiagDirection.
+ *
+ * @param d The DiagDirection
+ * @return The result RoadBits which the selected road-part set
+ */
+static inline RoadBits DiagDirToRoadBits(DiagDirection d)
+{
+	return (RoadBits)(ROAD_NW << (3 ^ d));
+}
+
+/**
+ * Finds out, whether given player has all given RoadTypes available
+ * @param PlayerID ID of player
+ * @param rts RoadTypes to test
+ * @return true if player has all requested RoadTypes available
+ */
+bool HasRoadTypesAvail(const PlayerID p, const RoadTypes rts);
+
+/**
+ * Validate functions for rail building.
+ * @param rt road type to check.
+ * @return true if the current player may build the road.
+ */
+bool ValParamRoadType(const RoadType rt);
+
+/**
+ * Get the road types the given player can build.
+ * @param p the player to get the roadtypes for.
+ * @return the road types.
+ */
+RoadTypes GetPlayerRoadtypes(const PlayerID p);
+
+void UpdateLevelCrossing(TileIndex tile, bool sound = true);
+
+#endif /* ROAD_FUNC_H */
--- a/src/road_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/road_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,26 +4,28 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "functions.h"
-#include "map.h"
-#include "tile.h"
-#include "window.h"
 #include "gui.h"
-#include "viewport.h"
-#include "gfx.h"
-#include "sound.h"
-#include "command.h"
+#include "window_gui.h"
+#include "station_gui.h"
+#include "terraform_gui.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "command_func.h"
 #include "variables.h"
-#include "road.h"
+#include "road_type.h"
 #include "road_cmd.h"
 #include "road_map.h"
 #include "station_map.h"
-//needed for catchments
 #include "station.h"
+#include "functions.h"
+#include "window_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "player_func.h"
+#include "settings_type.h"
 
+#include "table/sprites.h"
+#include "table/strings.h"
 
 static void ShowRVStationPicker(RoadStop::Type rs);
 static void ShowRoadDepotPicker();
@@ -467,9 +469,13 @@
 		break;
 
 	case WE_ABORT_PLACE_OBJ:
-		RaiseWindowButtons(w);
-		w->DisableWidget(RTW_REMOVE);
-		InvalidateWidget(w, RTW_REMOVE);
+		w->RaiseButtons();
+		w->SetWidgetsDisabledState(true,
+			RTW_REMOVE,
+			RTW_ONE_WAY,
+			WIDGET_LIST_END);
+		w->InvalidateWidget(RTW_REMOVE);
+		w->InvalidateWidget(RTW_ONE_WAY);
 
 		w = FindWindowById(WC_BUS_STATION, 0);
 		if (w != NULL) WP(w, def_d).close = true;
@@ -814,13 +820,13 @@
 
 		StationType st = (w->window_class == WC_BUS_STATION) ? STATION_BUS : STATION_TRUCK;
 
-		StationPickerDrawSprite(103, 35, st, RAILTYPE_BEGIN, ROADTYPE_ROAD, 0);
-		StationPickerDrawSprite(103, 85, st, RAILTYPE_BEGIN, ROADTYPE_ROAD, 1);
-		StationPickerDrawSprite( 35, 85, st, RAILTYPE_BEGIN, ROADTYPE_ROAD, 2);
-		StationPickerDrawSprite( 35, 35, st, RAILTYPE_BEGIN, ROADTYPE_ROAD, 3);
+		StationPickerDrawSprite(103, 35, st, INVALID_RAILTYPE, ROADTYPE_ROAD, 0);
+		StationPickerDrawSprite(103, 85, st, INVALID_RAILTYPE, ROADTYPE_ROAD, 1);
+		StationPickerDrawSprite( 35, 85, st, INVALID_RAILTYPE, ROADTYPE_ROAD, 2);
+		StationPickerDrawSprite( 35, 35, st, INVALID_RAILTYPE, ROADTYPE_ROAD, 3);
 
-		StationPickerDrawSprite(171, 35, st, RAILTYPE_BEGIN, _cur_roadtype, 4);
-		StationPickerDrawSprite(171, 85, st, RAILTYPE_BEGIN, _cur_roadtype, 5);
+		StationPickerDrawSprite(171, 35, st, INVALID_RAILTYPE, _cur_roadtype, 4);
+		StationPickerDrawSprite(171, 85, st, INVALID_RAILTYPE, _cur_roadtype, 5);
 
 		DrawStationCoverageAreaText(2, 146,
 			(w->window_class == WC_BUS_STATION) ? SCT_PASSENGERS_ONLY : SCT_NON_PASSENGERS_ONLY,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/road_gui.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,13 @@
+/* $Id$ */
+
+/** @file road_gui.h Functions/types related to the road GUIs. */
+
+#ifndef ROAD_GUI_H
+#define ROAD_GUI_H
+
+#include "road_type.h"
+
+void ShowBuildRoadToolbar(RoadType roadtype);
+void ShowBuildRoadScenToolbar();
+
+#endif /* ROAD_GUI_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/road_internal.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,36 @@
+/* $Id$ */
+
+/** @file road_internal.h Functions used internally by the roads. */
+
+#ifndef ROAD_INTERNAL_H
+#define ROAD_INTERNAL_H
+
+#include "tile_cmd.h"
+
+/**
+ * Clean up unneccesary RoadBits of a planed tile.
+ * @param tile current tile
+ * @param org_rb planed RoadBits
+ * @return optimised RoadBits
+ */
+RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb);
+
+/**
+ * Is it allowed to remove the given road bits from the given tile?
+ * @param tile      the tile to remove the road from
+ * @param remove    the roadbits that are going to be removed
+ * @param owner     the actual owner of the roadbits of the tile
+ * @param edge_road are the removed bits from a town?
+ * @param rt        the road type to remove the bits from
+ * @return true when it is allowed to remove the road bits
+ */
+bool CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, Owner owner, bool *edge_road, RoadType rt);
+
+/**
+ * Draw the catenary for tram road bits
+ * @param ti   information about the tile (position, slope)
+ * @param tram the roadbits to draw the catenary for
+ */
+void DrawTramCatenary(TileInfo *ti, RoadBits tram);
+
+#endif /* ROAD_INTERNAL_H */
--- a/src/road_map.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/road_map.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,13 +5,13 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "bridge_map.h"
-#include "functions.h"
-#include "landscape.h"
+#include "tile_cmd.h"
 #include "road_map.h"
 #include "station.h"
 #include "tunnel_map.h"
 #include "station_map.h"
 #include "depot.h"
+#include "tunnelbridge_map.h"
 
 
 RoadBits GetAnyRoadBits(TileIndex tile, RoadType rt)
@@ -33,13 +33,8 @@
 			return DiagDirToRoadBits(GetRoadStopDir(tile));
 
 		case MP_TUNNELBRIDGE:
-			if (IsTunnel(tile)) {
-				if (GetTunnelTransportType(tile) != TRANSPORT_ROAD) return ROAD_NONE;
-				return DiagDirToRoadBits(ReverseDiagDir(GetTunnelDirection(tile)));
-			} else {
-				if (GetBridgeTransportType(tile) != TRANSPORT_ROAD) return ROAD_NONE;
-				return DiagDirToRoadBits(ReverseDiagDir(GetBridgeRampDirection(tile)));
-			}
+			if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return ROAD_NONE;
+			return DiagDirToRoadBits(ReverseDiagDir(GetTunnelBridgeDirection(tile)));
 
 		default: return ROAD_NONE;
 	}
--- a/src/road_map.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/road_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,10 +5,11 @@
 #ifndef ROAD_MAP_H
 #define ROAD_MAP_H
 
-#include "macros.h"
-#include "rail.h"
-#include "road.h"
-#include "tile.h"
+#include "track_func.h"
+#include "rail_type.h"
+#include "town_type.h"
+#include "road_func.h"
+#include "tile_map.h"
 
 
 enum RoadTileType {
@@ -190,23 +191,26 @@
 	return AxisToTrackBits(OtherAxis(GetCrossingRoadAxis(tile)));
 }
 
+static inline bool IsCrossingBarred(TileIndex t)
+{
+	assert(GetRoadTileType(t) == ROAD_TILE_CROSSING);
+	return HasBit(_m[t].m4, 5);
+}
+
+static inline void SetCrossingBarred(TileIndex t, bool barred)
+{
+	assert(GetRoadTileType(t) == ROAD_TILE_CROSSING);
+	SB(_m[t].m4, 5, 1, barred);
+}
 
 static inline void UnbarCrossing(TileIndex t)
 {
-	assert(GetRoadTileType(t) == ROAD_TILE_CROSSING);
-	ClrBit(_m[t].m4, 5);
+	SetCrossingBarred(t, false);
 }
 
 static inline void BarCrossing(TileIndex t)
 {
-	assert(GetRoadTileType(t) == ROAD_TILE_CROSSING);
-	SetBit(_m[t].m4, 5);
-}
-
-static inline bool IsCrossingBarred(TileIndex t)
-{
-	assert(GetRoadTileType(t) == ROAD_TILE_CROSSING);
-	return HasBit(_m[t].m4, 5);
+	SetCrossingBarred(t, true);
 }
 
 #define IsOnDesert IsOnSnow
@@ -304,6 +308,16 @@
  */
 TrackBits GetAnyRoadTrackBits(TileIndex tile, RoadType rt);
 
+/**
+ * Return if the tile is a valid tile for a crossing.
+ *
+ * @note function is overloaded
+ * @param tile the curent tile
+ * @param ax the axis of the road over the rail
+ * @return true if it is a valid tile
+ */
+bool IsPossibleCrossing(const TileIndex tile, Axis ax);
+
 
 static inline void MakeRoadNormal(TileIndex t, RoadBits bits, RoadTypes rot, TownID town, Owner road, Owner tram, Owner hway)
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/road_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,63 @@
+/* $Id$ */
+
+/** @file road_type.h Enums and other types related to roads. */
+
+#ifndef ROAD_TYPE_H
+#define ROAD_TYPE_H
+
+#include "core/enum_type.hpp"
+
+/**
+ * The different roadtypes we support
+ *
+ * @note currently only ROADTYPE_ROAD and ROADTYPE_TRAM are supported.
+ */
+enum RoadType {
+	ROADTYPE_ROAD = 0,      ///< Basic road type
+	ROADTYPE_TRAM = 1,      ///< Trams
+	ROADTYPE_HWAY = 2,      ///< Only a placeholder. Not sure what we are going to do with this road type.
+	ROADTYPE_END,           ///< Used for iterations
+	INVALID_ROADTYPE = 0xFF ///< flag for invalid roadtype
+};
+DECLARE_POSTFIX_INCREMENT(RoadType);
+
+/**
+ * The different roadtypes we support, but then a bitmask of them
+ * @note currently only roadtypes with ROADTYPE_ROAD and ROADTYPE_TRAM are supported.
+ */
+enum RoadTypes {
+	ROADTYPES_NONE     = 0,                                                 ///< No roadtypes
+	ROADTYPES_ROAD     = 1 << ROADTYPE_ROAD,                                ///< Road
+	ROADTYPES_TRAM     = 1 << ROADTYPE_TRAM,                                ///< Trams
+	ROADTYPES_HWAY     = 1 << ROADTYPE_HWAY,                                ///< Highway (or whatever substitute)
+	ROADTYPES_ROADTRAM = ROADTYPES_ROAD | ROADTYPES_TRAM,                   ///< Road + trams
+	ROADTYPES_ROADHWAY = ROADTYPES_ROAD | ROADTYPES_HWAY,                   ///< Road + highway (or whatever substitute)
+	ROADTYPES_TRAMHWAY = ROADTYPES_TRAM | ROADTYPES_HWAY,                   ///< Trams + highway (or whatever substitute)
+	ROADTYPES_ALL      = ROADTYPES_ROAD | ROADTYPES_TRAM | ROADTYPES_HWAY,  ///< Road + trams + highway (or whatever substitute)
+	ROADTYPES_END,                                                          ///< Used for iterations?
+	INVALID_ROADTYPES  = 0xFF                                               ///< Invalid roadtypes
+};
+DECLARE_ENUM_AS_BIT_SET(RoadTypes);
+template <> struct EnumPropsT<RoadTypes> : MakeEnumPropsT<RoadTypes, byte, ROADTYPES_NONE, ROADTYPES_END, INVALID_ROADTYPES> {};
+typedef TinyEnumT<RoadTypes> RoadTypesByte;
+
+
+/**
+ * Enumeration for the road parts on a tile.
+ *
+ * This enumeration defines the possible road parts which
+ * can be build on a tile.
+ */
+enum RoadBits {
+	ROAD_NONE = 0U,                  ///< No road-part is build
+	ROAD_NW   = 1U,                  ///< North-west part
+	ROAD_SW   = 2U,                  ///< South-west part
+	ROAD_SE   = 4U,                  ///< South-east part
+	ROAD_NE   = 8U,                  ///< North-east part
+	ROAD_X    = ROAD_SW | ROAD_NE,   ///< Full road along the x-axis (south-west + north-east)
+	ROAD_Y    = ROAD_NW | ROAD_SE,   ///< Full road along the y-axis (north-west + south-east)
+	ROAD_ALL  = ROAD_X  | ROAD_Y     ///< Full 4-way crossing
+};
+DECLARE_ENUM_AS_BIT_SET(RoadBits);
+
+#endif /* ROAD_TYPE_H */
--- a/src/roadveh.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/roadveh.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,9 +5,9 @@
 #ifndef ROADVEH_H
 #define ROADVEH_H
 
-#include "vehicle.h"
+#include "vehicle_base.h"
 #include "engine.h"
-#include "variables.h"
+#include "economy_func.h"
 
 enum RoadVehicleSubType {
 	RVST_FRONT,
--- a/src/roadveh_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/roadveh_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,25 +5,20 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
+#include "tile_cmd.h"
 #include "landscape.h"
 #include "road_map.h"
 #include "roadveh.h"
 #include "station_map.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "map.h"
-#include "tile.h"
-#include "vehicle.h"
 #include "timetable.h"
 #include "engine.h"
-#include "command.h"
+#include "command_func.h"
 #include "station.h"
 #include "news.h"
 #include "pathfind.h"
 #include "npf.h"
-#include "player.h"
-#include "sound.h"
+#include "player_func.h"
+#include "player_base.h"
 #include "depot.h"
 #include "bridge.h"
 #include "tunnel_map.h"
@@ -35,8 +30,20 @@
 #include "newgrf_text.h"
 #include "newgrf_sound.h"
 #include "yapf/yapf.h"
-#include "date.h"
 #include "cargotype.h"
+#include "strings_func.h"
+#include "tunnelbridge_map.h"
+#include "functions.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "variables.h"
+#include "autoreplace_gui.h"
+#include "gfx_func.h"
+#include "settings_type.h"
+
+#include "table/strings.h"
 
 static const uint16 _roadveh_images[63] = {
 	0xCD4, 0xCDC, 0xCE4, 0xCEC, 0xCF4, 0xCFC, 0xD0C, 0xD14,
@@ -94,7 +101,7 @@
 	if (is_custom_sprite(img)) {
 		image = GetCustomVehicleSprite(this, (Direction)(direction + 4 * IS_CUSTOM_SECONDHEAD_SPRITE(img)));
 		if (image != 0) return image;
-		img = orig_road_vehicle_info[this->engine_type - ROAD_ENGINES_INDEX].image_index;
+		img = _orig_road_vehicle_info[this->engine_type - ROAD_ENGINES_INDEX].image_index;
 	}
 
 	image = direction + _roadveh_images[img];
@@ -113,14 +120,14 @@
 			DrawSprite(sprite, pal, x, y);
 			return;
 		}
-		spritenum = orig_road_vehicle_info[engine - ROAD_ENGINES_INDEX].image_index;
+		spritenum = _orig_road_vehicle_info[engine - ROAD_ENGINES_INDEX].image_index;
 	}
 	DrawSprite(6 + _roadveh_images[spritenum], pal, x, y);
 }
 
 static CommandCost EstimateRoadVehCost(EngineID engine_type)
 {
-	return CommandCost(((_price.roadveh_base >> 3) * GetEngineProperty(engine_type, 0x11, RoadVehInfo(engine_type)->base_cost)) >> 5);
+	return CommandCost(EXPENSES_NEW_VEHICLES, ((_price.roadveh_base >> 3) * GetEngineProperty(engine_type, 0x11, RoadVehInfo(engine_type)->base_cost)) >> 5);
 }
 
 byte GetRoadVehLength(const Vehicle *v)
@@ -167,8 +174,6 @@
 
 	if (!IsEngineBuildable(p1, VEH_ROAD, _current_player)) return_cmd_error(STR_ROAD_VEHICLE_NOT_AVAILABLE);
 
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
-
 	cost = EstimateRoadVehCost(p1);
 	if (flags & DC_QUERY_COST) return cost;
 
@@ -233,7 +238,7 @@
 
 		v->last_station_visited = INVALID_STATION;
 		v->max_speed = rvi->max_speed;
-		v->engine_type = (byte)p1;
+		v->engine_type = (EngineID)p1;
 
 		e = GetEngine(p1);
 		v->reliability = e->reliability;
@@ -241,7 +246,7 @@
 		v->max_age = e->lifelength * 366;
 		_new_vehicle_id = v->index;
 
-		v->string_id = STR_SV_ROADVEH_NAME;
+		v->name = NULL;
 
 		v->service_interval = _patches.servint_roadveh;
 
@@ -274,7 +279,7 @@
 		GetPlayer(_current_player)->num_engines[p1]++;
 	}
 
-	return CommandCost(cost);
+	return cost;
 }
 
 /** Start/Stop a road vehicle.
@@ -309,7 +314,7 @@
 
 		v->vehstatus ^= VS_STOPPED;
 		v->cur_speed = 0;
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 	}
 
@@ -361,13 +366,11 @@
 
 	if (HASBITS(v->vehstatus, VS_CRASHED)) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE);
 
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
-
 	if (!CheckRoadVehInDepotStopped(v)) {
 		return_cmd_error(STR_9013_MUST_BE_STOPPED_INSIDE);
 	}
 
-	CommandCost ret(-v->value);
+	CommandCost ret(EXPENSES_NEW_VEHICLES, -v->value);
 
 	if (flags & DC_EXEC) {
 		// Invalidate depot
@@ -421,7 +424,7 @@
 		/* See where we are now */
 		Trackdir trackdir = GetVehicleTrackdir(v);
 
-		ftd = NPFRouteToDepotBreadthFirstTwoWay(v->tile, trackdir, v->tile, ReverseTrackdir(trackdir), TRANSPORT_ROAD, v->u.road.compatible_roadtypes, v->owner, INVALID_RAILTYPE, 0);
+		ftd = NPFRouteToDepotBreadthFirstTwoWay(v->tile, trackdir, v->tile, ReverseTrackdir(trackdir), TRANSPORT_ROAD, v->u.road.compatible_roadtypes, v->owner, INVALID_RAILTYPES, 0);
 		if (ftd.best_bird_dist == 0) {
 			return GetDepotByTile(ftd.node.tile); /* Target found */
 		} else {
@@ -476,14 +479,14 @@
 
 	/* If the current orders are already goto-depot */
 	if (v->current_order.type == OT_GOTO_DEPOT) {
-		if (!!(p2 & DEPOT_SERVICE) == HasBit(v->current_order.flags, OFB_HALT_IN_DEPOT)) {
+		if (!!(p2 & DEPOT_SERVICE) == HasBit(v->current_order.flags, OF_HALT_IN_DEPOT)) {
 			/* We called with a different DEPOT_SERVICE setting.
 			 * Now we change the setting to apply the new one and let the vehicle head for the same depot.
 			 * Note: the if is (true for requesting service == true for ordered to stop in depot) */
 			if (flags & DC_EXEC) {
-				ClrBit(v->current_order.flags, OFB_PART_OF_ORDERS);
-				ToggleBit(v->current_order.flags, OFB_HALT_IN_DEPOT);
-				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+				ClrBit(v->current_order.flags, OF_PART_OF_ORDERS);
+				ToggleBit(v->current_order.flags, OF_HALT_IN_DEPOT);
+				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 			}
 			return CommandCost();
 		}
@@ -492,12 +495,12 @@
 		if (flags & DC_EXEC) {
 			/* If the orders to 'goto depot' are in the orders list (forced servicing),
 			 * then skip to the next order; effectively cancelling this forced service */
-			if (HasBit(v->current_order.flags, OFB_PART_OF_ORDERS))
+			if (HasBit(v->current_order.flags, OF_PART_OF_ORDERS))
 				v->cur_order_index++;
 
 			v->current_order.type = OT_DUMMY;
 			v->current_order.flags = 0;
-			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		}
 		return CommandCost();
 	}
@@ -510,12 +513,12 @@
 
 		ClearSlot(v);
 		v->current_order.type = OT_GOTO_DEPOT;
-		v->current_order.flags = OF_NON_STOP;
-		if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OFB_HALT_IN_DEPOT);
+		v->current_order.flags = OFB_NON_STOP;
+		if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OF_HALT_IN_DEPOT);
 		v->current_order.refit_cargo = CT_INVALID;
 		v->current_order.dest = dep->index;
 		v->dest_tile = dep->xy;
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 	}
 
 	return CommandCost();
@@ -549,8 +552,7 @@
 
 	if (IsTileType(v->tile, MP_ROAD) && GetRoadTileType(v->tile) == ROAD_TILE_NORMAL && GetDisallowedRoadDirections(v->tile) != DRD_NONE) return CMD_ERROR;
 
-	if (IsTunnelTile(v->tile) && DirToDiagDir(v->direction) == GetTunnelDirection(v->tile)) return CMD_ERROR;
-	if (IsBridgeTile(v->tile) && DirToDiagDir(v->direction) == GetBridgeRampDirection(v->tile)) return CMD_ERROR;
+	if (IsTileType(v->tile, MP_TUNNELBRIDGE) && DirToDiagDir(v->direction) == GetTunnelBridgeDirection(v->tile)) return CMD_ERROR;
 
 	if (flags & DC_EXEC) v->u.road.reverse_ctr = 180;
 
@@ -562,7 +564,7 @@
 {
 	for (Vehicle *v = this; v != NULL; v = v->Next()) {
 		v->cur_image = v->GetImage(v->direction);
-		MarkAllViewportsDirty(v->left_coord, v->top_coord, v->right_coord + 1, v->bottom_coord + 1);
+		MarkSingleVehicleDirty(v);
 	}
 }
 
@@ -613,8 +615,7 @@
 
 	if (IsTileType(v->tile, MP_STATION)) ClearCrashedStation(v);
 
-	BeginVehicleMove(v);
-	EndVehicleMove(v);
+	MarkSingleVehicleDirty(v);
 
 	delete v;
 }
@@ -688,12 +689,12 @@
 
 		u->vehstatus |= VS_CRASHED;
 
-		MarkAllViewportsDirty(u->left_coord, u->top_coord, u->right_coord + 1, u->bottom_coord + 1);
+		MarkSingleVehicleDirty(u);
 	}
 
 	ClearSlot(v);
 
-	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 
 	SetDParam(0, pass);
 	AddNewsItem(
@@ -762,8 +763,8 @@
 	switch (v->current_order.type) {
 		case OT_GOTO_DEPOT:
 			/* Let a depot order in the orderlist interrupt. */
-			if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return;
-			if (v->current_order.flags & OF_SERVICE_IF_NEEDED &&
+			if (!(v->current_order.flags & OFB_PART_OF_ORDERS)) return;
+			if (v->current_order.flags & OFB_SERVICE_IF_NEEDED &&
 					!VehicleNeedsService(v)) {
 				UpdateVehicleTimetable(v, true);
 				v->cur_order_index++;
@@ -894,6 +895,7 @@
 	rvf.veh = v;
 	if (front->u.road.state == RVSB_WORMHOLE) {
 		u = (Vehicle*)VehicleFromPos(v->tile, &rvf, EnumCheckRoadVehClose);
+		if (u == NULL) u = (Vehicle*)VehicleFromPos(GetOtherTunnelBridgeEnd(v->tile), &rvf, EnumCheckRoadVehClose);
 	} else {
 		u = (Vehicle*)VehicleFromPosXY(x, y, &rvf, EnumCheckRoadVehClose);
 	}
@@ -961,7 +963,7 @@
 	if (spd != v->cur_speed) {
 		v->cur_speed = spd;
 		if (_patches.vehicle_speed) {
-			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		}
 	}
 
@@ -1015,7 +1017,7 @@
 	const OvertakeData* od = (OvertakeData*)data;
 
 	return
-		v->tile == od->tile && v->type == VEH_ROAD && v->First() == v && v != od->u && v != od->v ?
+		v->type == VEH_ROAD && v->First() == v && v != od->u && v != od->v ?
 			v : NULL;
 }
 
@@ -1126,7 +1128,7 @@
 	return false;
 }
 
-static inline NPFFoundTargetData PerfNPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypeMask railtypes)
+static inline NPFFoundTargetData PerfNPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, uint sub_type, Owner owner, RailTypes railtypes)
 {
 
 	void* perf = NpfBeginInterval();
@@ -1228,7 +1230,7 @@
 		trackdir = DiagdirToDiagTrackdir(enterdir);
 		//debug("Finding path. Enterdir: %d, Trackdir: %d", enterdir, trackdir);
 
-		ftd = PerfNPFRouteToStationOrTile(tile - TileOffsByDiagDir(enterdir), trackdir, &fstd, TRANSPORT_ROAD, v->u.road.compatible_roadtypes, v->owner, INVALID_RAILTYPE);
+		ftd = PerfNPFRouteToStationOrTile(tile - TileOffsByDiagDir(enterdir), trackdir, &fstd, TRANSPORT_ROAD, v->u.road.compatible_roadtypes, v->owner, INVALID_RAILTYPES);
 		if (ftd.best_trackdir == INVALID_TRACKDIR) {
 			/* We are already at our target. Just do something
 			 * @todo: maybe display error?
@@ -1310,7 +1312,7 @@
 		fstd.dest_coords = tile;
 		fstd.station_index = INVALID_STATION; // indicates that the destination is a tile, not a station
 
-		dist = NPFRouteToStationOrTile(v->tile, trackdir, &fstd, TRANSPORT_ROAD, v->u.road.compatible_roadtypes, v->owner, INVALID_RAILTYPE).best_path_dist;
+		dist = NPFRouteToStationOrTile(v->tile, trackdir, &fstd, TRANSPORT_ROAD, v->u.road.compatible_roadtypes, v->owner, INVALID_RAILTYPES).best_path_dist;
 		/* change units from NPF_TILE_LENGTH to # of tiles */
 		if (dist != UINT_MAX)
 			dist = (dist + NPF_TILE_LENGTH - 1) / NPF_TILE_LENGTH;
@@ -1405,19 +1407,15 @@
 	if (prev_state == RVSB_WORMHOLE || prev_state == RVSB_IN_DEPOT) {
 		DiagDirection diag_dir = INVALID_DIAGDIR;
 
-		if (IsTunnelTile(tile)) {
-			diag_dir = GetTunnelDirection(tile);
-		} else if (IsBridgeTile(tile)) {
-			diag_dir = GetBridgeRampDirection(tile);
+		if (IsTileType(tile, MP_TUNNELBRIDGE)) {
+			diag_dir = GetTunnelBridgeDirection(tile);
 		} else if (IsTileType(tile, MP_ROAD) && GetRoadTileType(tile) == ROAD_TILE_DEPOT) {
 			diag_dir = ReverseDiagDir(GetRoadDepotDirection(tile));
 		}
 
 		if (diag_dir == INVALID_DIAGDIR) return INVALID_TRACKDIR;
 		dir = DiagdirToDiagTrackdir(diag_dir);
-	} else if (HasBit(prev_state, RVS_IN_DT_ROAD_STOP)) {
-		dir = (Trackdir)(prev_state & RVSB_ROAD_STOP_TRACKDIR_MASK);
-	} else if (prev_state < TRACKDIR_END) {
+	} else {
 		if (already_reversed && prev->tile != tile) {
 			/*
 			 * The vehicle has reversed, but did not go straight back.
@@ -1438,11 +1436,13 @@
 				{ TRACKDIR_UPPER_W, TRACKDIR_RIGHT_N, TRACKDIR_LEFT_N,  TRACKDIR_UPPER_E },
 				{ TRACKDIR_RIGHT_S, TRACKDIR_LOWER_W, TRACKDIR_LOWER_E, TRACKDIR_LEFT_S  }};
 			dir = reversed_turn_lookup[prev->tile < tile ? 0 : 1][ReverseDiagDir(entry_dir)];
-		} else {
+		} else if (HasBit(prev_state, RVS_IN_DT_ROAD_STOP)) {
+			dir = (Trackdir)(prev_state & RVSB_ROAD_STOP_TRACKDIR_MASK);
+		} else if (prev_state < TRACKDIR_END) {
 			dir = (Trackdir)prev_state;
+		} else {
+			return INVALID_TRACKDIR;
 		}
-	} else {
-		return INVALID_TRACKDIR;
 	}
 
 	/* Do some sanity checking. */
@@ -1461,25 +1461,21 @@
 
 /**
  * Can a tram track build without destruction on the given tile?
+ * @param p the player that would be building the tram tracks
  * @param t the tile to build on.
+ * @param r the road bits needed.
  * @return true when a track track can be build on 't'
  */
-static bool CanBuildTramTrackOnTile(TileIndex t)
+static bool CanBuildTramTrackOnTile(PlayerID p, TileIndex t, RoadBits r)
 {
-	switch (GetTileType(t)) {
-		case MP_CLEAR:
-		case MP_TREES:
-			return true;
+	/* The 'current' player is not necessarily the owner of the vehicle. */
+	PlayerID original_player = _current_player;
+	_current_player = p;
 
-		case MP_ROAD:
-			return GetRoadTileType(t) == ROAD_TILE_NORMAL;
+	CommandCost ret = DoCommand(t, ROADTYPE_TRAM << 4 | r, 0, 0, CMD_BUILD_ROAD);
 
-		case MP_WATER:
-			return IsCoast(t);
-
-		default:
-			return false;
-	}
+	_current_player = original_player;
+	return CmdSucceeded(ret);
 }
 
 static bool IndividualRoadVehicleController(Vehicle *v, const Vehicle *prev)
@@ -1491,13 +1487,17 @@
 	uint32 r;
 
 	if (v->u.road.overtaking != 0)  {
-		if (++v->u.road.overtaking_ctr >= 35)
+		if (IsTileType(v->tile, MP_STATION)) {
+			/* Force us to be not overtaking! */
+			v->u.road.overtaking = 0;
+		} else if (++v->u.road.overtaking_ctr >= 35) {
 			/* If overtaking just aborts at a random moment, we can have a out-of-bound problem,
 			 *  if the vehicle started a corner. To protect that, only allow an abort of
 			 *  overtake if we are on straight roads */
 			if (v->u.road.state < RVSB_IN_ROAD_STOP && IsStraightRoadTrackdir((Trackdir)v->u.road.state)) {
 				v->u.road.overtaking = 0;
 			}
+		}
 	}
 
 	/* If this vehicle is in a depot and we've reached this point it must be
@@ -1512,10 +1512,12 @@
 		/* Vehicle is entering a depot or is on a bridge or in a tunnel */
 		GetNewVehiclePosResult gp = GetNewVehiclePos(v);
 
-		const Vehicle *u = RoadVehFindCloseTo(v, gp.x, gp.y, v->direction);
-		if (u != NULL && u->First()->cur_speed < v->cur_speed) {
-			v->cur_speed = u->First()->cur_speed;
-			return false;
+		if (IsRoadVehFront(v)) {
+			const Vehicle *u = RoadVehFindCloseTo(v, gp.x, gp.y, v->direction);
+			if (u != NULL) {
+				v->cur_speed = u->First()->cur_speed;
+				return false;
+			}
 		}
 
 		if ((IsTunnelTile(gp.new_tile) || IsBridgeTile(gp.new_tile)) && HasBit(VehicleEnterTile(v, gp.new_tile, gp.x, gp.y), VETS_ENTERED_WORMHOLE)) {
@@ -1589,7 +1591,7 @@
 					 *   going to cause the tram to split up.
 					 * - Or the front of the tram can drive over the next tile.
 					 */
-				} else if (!IsRoadVehFront(v) || !CanBuildTramTrackOnTile(tile)) {
+				} else if (!IsRoadVehFront(v) || !CanBuildTramTrackOnTile(v->owner, tile, needed)) {
 					/*
 					 * Taking the 'small' corner for trams only happens when:
 					 * - We are not the from vehicle of an articulated tram.
@@ -1890,7 +1892,7 @@
 		}
 
 		StartRoadVehSound(v);
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 	}
 
 	/* Check tile position conditions - i.e. stop position in depot,
@@ -1981,13 +1983,13 @@
 		if (v->current_order.type == OT_GOTO_DEPOT) {
 			v->current_order.type = OT_DUMMY;
 			v->current_order.flags = 0;
-			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		}
 		return;
 	}
 
 	if (v->current_order.type == OT_GOTO_DEPOT &&
-			v->current_order.flags & OF_NON_STOP &&
+			v->current_order.flags & OFB_NON_STOP &&
 			!Chance16(1, 20)) {
 		return;
 	}
@@ -1996,15 +1998,15 @@
 	ClearSlot(v);
 
 	v->current_order.type = OT_GOTO_DEPOT;
-	v->current_order.flags = OF_NON_STOP;
+	v->current_order.flags = OFB_NON_STOP;
 	v->current_order.dest = depot->index;
 	v->dest_tile = depot->xy;
-	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 }
 
 void OnNewDay_RoadVeh(Vehicle *v)
 {
-	CommandCost cost;
+	CommandCost cost(EXPENSES_ROADVEH_RUN);
 
 	if (!IsRoadVehFront(v)) return;
 
@@ -2084,12 +2086,11 @@
 		}
 	}
 
-	cost = RoadVehInfo(v->engine_type)->running_cost * _price.roadveh_running / 364;
+	cost = CommandCost(EXPENSES_ROADVEH_RUN, RoadVehInfo(v->engine_type)->running_cost * _price.roadveh_running / 364);
 
 	v->profit_this_year -= cost.GetCost() >> 8;
 
-	SET_EXPENSES_TYPE(EXPENSES_ROADVEH_RUN);
-	SubtractMoneyFromPlayerFract(v->owner, CommandCost(cost));
+	SubtractMoneyFromPlayerFract(v->owner, cost);
 
 	InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
 	InvalidateWindowClasses(WC_ROADVEH_LIST);
@@ -2122,7 +2123,7 @@
 CommandCost CmdRefitRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	Vehicle *v;
-	CommandCost cost;
+	CommandCost cost(EXPENSES_ROADVEH_RUN);
 	CargoID new_cid = GB(p2, 0, 8);
 	byte new_subtype = GB(p2, 8, 8);
 	bool only_this = HasBit(p2, 16);
@@ -2135,11 +2136,10 @@
 
 	if (v->type != VEH_ROAD || !CheckOwnership(v->owner)) return CMD_ERROR;
 	if (!CheckRoadVehInDepotStopped(v)) return_cmd_error(STR_9013_MUST_BE_STOPPED_INSIDE);
+	if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_CAN_T_REFIT_DESTROYED_VEHICLE);
 
 	if (new_cid >= NUM_CARGO) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_ROADVEH_RUN);
-
 	for (; v != NULL; v = v->Next()) {
 		/* XXX: We refit all the attached wagons en-masse if they can be
 		 * refitted. This is how TTDPatch does it.  TODO: Have some nice
--- a/src/roadveh_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/roadveh_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,20 +5,21 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
 #include "roadveh.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "window.h"
 #include "gui.h"
-#include "strings.h"
-#include "vehicle.h"
-#include "viewport.h"
-#include "command.h"
+#include "window_gui.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "command_func.h"
 #include "depot.h"
 #include "vehicle_gui.h"
 #include "newgrf_engine.h"
+#include "strings_func.h"
+#include "vehicle_func.h"
+#include "string_func.h"
 
+#include "table/sprites.h"
+#include "table/strings.h"
 
 void DrawRoadVehDetails(const Vehicle *v, int x, int y)
 {
@@ -100,7 +101,7 @@
 	return (length * 28) / 8;
 }
 
-void DrawRoadVehImage(const Vehicle *v, int x, int y, int count, VehicleID selection)
+void DrawRoadVehImage(const Vehicle *v, int x, int y, VehicleID selection, int count)
 {
 	/* Road vehicle lengths are measured in eighths of the standard length, so
 	 * count is the number of standard vehicles that should be drawn. If it is
--- a/src/saveload.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/saveload.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -16,18 +16,23 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "vehicle.h"
 #include "station.h"
 #include "thread.h"
 #include "town.h"
-#include "player.h"
 #include "saveload.h"
 #include "network/network.h"
 #include "variables.h"
+#include "window_func.h"
+#include "strings_func.h"
+#include "gfx_func.h"
+#include "core/alloc_func.hpp"
+#include "functions.h"
+#include "core/endian_func.hpp"
+#include "vehicle_base.h"
+#include "autoreplace_base.h"
+#include <list>
+
 #include "table/strings.h"
-#include "strings.h"
-#include <list>
 
 extern const uint16 SAVEGAME_VERSION = NEWGRF_AIRPORTS_SAVEGAME;
 uint16 _sl_version;       ///< the major savegame version identifier
@@ -430,6 +435,7 @@
 	case SLE_VAR_U32: *(uint32*)ptr = val; break;
 	case SLE_VAR_I64: *(int64 *)ptr = val; break;
 	case SLE_VAR_U64: *(uint64*)ptr = val; break;
+	case SLE_VAR_NAME: *(char**)ptr = CopyFromOldName(val); break;
 	case SLE_VAR_NULL: break;
 	default: NOT_REACHED();
 	}
@@ -575,7 +581,7 @@
 				if (len == 0) {
 					*(char**)ptr = NULL;
 				} else {
-					*(char**)ptr = (char*)malloc(len + 1); // terminating '\0'
+					*(char**)ptr = MallocT<char>(len + 1); // terminating '\0'
 					ptr = *(char**)ptr;
 					SlCopyBytes(ptr, len);
 				}
@@ -918,6 +924,9 @@
 {
 	ChunkSaveLoadProc *proc = ch->save_proc;
 
+	/* Don't save any chunk information if there is no save handler. */
+	if (proc == NULL) return;
+
 	SlWriteUint32(ch->id);
 	DEBUG(sl, 2, "Saving chunk %c%c%c%c", ch->id >> 24, ch->id >> 16, ch->id >> 8, ch->id);
 
@@ -1060,7 +1069,7 @@
 static bool InitLZO()
 {
 	_sl.bufsize = LZO_SIZE;
-	_sl.buf = _sl.buf_ori = (byte*)malloc(LZO_SIZE);
+	_sl.buf = _sl.buf_ori = MallocT<byte>(LZO_SIZE);
 	return true;
 }
 
@@ -1085,7 +1094,7 @@
 static bool InitNoComp()
 {
 	_sl.bufsize = LZO_SIZE;
-	_sl.buf = _sl.buf_ori = (byte*)malloc(LZO_SIZE);
+	_sl.buf = _sl.buf_ori = MallocT<byte>(LZO_SIZE);
 	return true;
 }
 
@@ -1099,7 +1108,6 @@
  ********************************************/
 
 #include "table/sprites.h"
-#include "gfx.h"
 #include "gui.h"
 
 struct ThreadedSave {
@@ -1154,7 +1162,7 @@
 	if (inflateInit(&_z) != Z_OK) return false;
 
 	_sl.bufsize = 4096;
-	_sl.buf = _sl.buf_ori = (byte*)malloc(4096 + 4096); // also contains fread buffer
+	_sl.buf = _sl.buf_ori = MallocT<byte>(4096 + 4096); // also contains fread buffer
 	return true;
 }
 
@@ -1194,7 +1202,7 @@
 	if (deflateInit(&_z, 6) != Z_OK) return false;
 
 	_sl.bufsize = 4096;
-	_sl.buf = _sl.buf_ori = (byte*)malloc(4096); // also contains fread buffer
+	_sl.buf = _sl.buf_ori = MallocT<byte>(4096); // also contains fread buffer
 	return true;
 }
 
@@ -1651,9 +1659,7 @@
 			}
 		} else { /* LOAD game */
 			assert(mode == SL_LOAD);
-	#ifdef DEBUG_DUMP_COMMANDS
-			debug_dump_commands("ddc:load:%s\n", filename);
-	#endif /* DUMP_COMMANDS */
+			DebugDumpCommands("ddc:load:%s\n", filename);
 
 			if (fread(hdr, sizeof(hdr), 1, _sl.fh) != 1) SlError(STR_GAME_SAVELOAD_ERROR_FILE_NOT_READABLE);
 
--- a/src/saveload.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/saveload.h	Tue Jan 22 21:00:30 2008 +0000
@@ -13,7 +13,7 @@
 
 #define SIZE_MAX ((size_t)-1)
 
-static const uint NEWGRF_AIRPORTS_SAVEGAME = 83;
+static const uint NEWGRF_AIRPORTS_SAVEGAME = 86;
 
 enum SaveOrLoadResult {
 	SL_OK     = 0, ///< completed successfully
@@ -119,6 +119,7 @@
 	SLE_VAR_STRBQ = 11 << 4, ///< string enclosed in quotes (with pre-allocated buffer)
 	SLE_VAR_STR   = 12 << 4, ///< string pointer
 	SLE_VAR_STRQ  = 13 << 4, ///< string pointer enclosed in quotes
+	SLE_VAR_NAME  = 14 << 4, ///< old custom name to be converted to a char pointer
 	/* 2 more possible memory-primitives */
 
 	/* Shortcut values */
@@ -142,6 +143,7 @@
 	SLE_STRINGBQUOTE = SLE_FILE_STRING   | SLE_VAR_STRBQ,
 	SLE_STRING       = SLE_FILE_STRING   | SLE_VAR_STR,
 	SLE_STRINGQUOTE  = SLE_FILE_STRING   | SLE_VAR_STRQ,
+	SLE_NAME         = SLE_FILE_STRINGID | SLE_VAR_NAME,
 
 	/* Shortcut values */
 	SLE_UINT  = SLE_UINT32,
--- a/src/screenshot.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/screenshot.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,20 +3,23 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "strings.h"
-#include "table/strings.h"
-#include "gfx.h"
 #include "fileio.h"
-#include "viewport.h"
-#include "player.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "core/math_func.hpp"
 #include "screenshot.h"
 #include "variables.h"
-#include "date.h"
-#include "string.h"
-#include "helpers.hpp"
 #include "blitter/factory.hpp"
 #include "fileio.h"
+#include "strings_func.h"
+#include "zoom_func.h"
+#include "core/alloc_func.hpp"
+#include "core/endian_func.hpp"
+#include "map_func.h"
+#include "date_func.h"
+#include "player_func.h"
+
+#include "table/strings.h"
 
 char _screenshot_format_name[8];
 uint _num_screenshot_formats;
@@ -487,13 +490,29 @@
 	blitter->CopyImageToBuffer(src, buf, _screen.width, n, pitch);
 }
 
-/* generate a large piece of the world */
+/** generate a large piece of the world
+ * @param userdata Viewport area to draw
+ * @param buf Videobuffer with same bitdepth as current blitter
+ * @param y First line to render
+ * @param pitch Pitch of the videobuffer
+ * @param n Number of lines to render
+ */
 static void LargeWorldCallback(void *userdata, void *buf, uint y, uint pitch, uint n)
 {
 	ViewPort *vp = (ViewPort *)userdata;
 	DrawPixelInfo dpi, *old_dpi;
 	int wx, left;
 
+	/* We are no longer rendering to the screen */
+	DrawPixelInfo old_screen = _screen;
+	bool old_disable_anim = _screen_disable_anim;
+
+	_screen.dst_ptr = buf;
+	_screen.width = pitch;
+	_screen.height = n;
+	_screen.pitch = pitch;
+	_screen_disable_anim = true;
+
 	old_dpi = _cur_dpi;
 	_cur_dpi = &dpi;
 
@@ -505,6 +524,7 @@
 	dpi.left = 0;
 	dpi.top = y;
 
+	/* Render viewport in blocks of 1600 pixels width */
 	left = 0;
 	while (vp->width - left != 0) {
 		wx = min(vp->width - left, 1600);
@@ -519,6 +539,10 @@
 	}
 
 	_cur_dpi = old_dpi;
+
+	/* Switch back to rendering to the screen */
+	_screen = old_screen;
+	_screen_disable_anim = old_disable_anim;
 }
 
 static char *MakeScreenshotName(const char *ext)
--- a/src/settings.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/settings.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -22,16 +22,12 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "currency.h"
-#include "functions.h"
-#include "macros.h"
 #include "screenshot.h"
-#include "sound.h"
-#include "string.h"
 #include "variables.h"
 #include "network/network.h"
-#include "strings.h"
-#include "settings.h"
-#include "command.h"
+#include "network/network_internal.h"
+#include "settings_internal.h"
+#include "command_func.h"
 #include "console.h"
 #include "saveload.h"
 #include "npf.h"
@@ -39,19 +35,34 @@
 #include "newgrf.h"
 #include "newgrf_config.h"
 #include "genworld.h"
-#include "date.h"
 #include "rail.h"
 #include "train.h"
-#include "helpers.hpp"
 #include "news.h"
+#include "window_func.h"
+#include "strings_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "core/alloc_func.hpp"
+#include "player_func.h"
 #ifdef WITH_FREETYPE
-#include "gfx.h"
 #include "fontcache.h"
 #endif
 #include "spritecache.h"
 #include "transparency.h"
+#include "string_func.h"
+#include "gui.h"
+#include "town.h"
+#include "video/video_driver.hpp"
+#include "sound/sound_driver.hpp"
+#include "music/music_driver.hpp"
+#include "blitter/factory.hpp"
 
-/** The patch values that are used for new games and/or modified in config file */
+#include "table/strings.h"
+
+GameOptions _opt;
+GameOptions _opt_newgame;
+GameOptions *_opt_ptr;
+Patches _patches;
 Patches _patches_newgame;
 
 struct IniFile;
@@ -80,7 +91,7 @@
 	SettingsMemoryPool *p;
 	if (minsize < 4096 - 12) minsize = 4096 - 12;
 
-	p = (SettingsMemoryPool*)malloc(sizeof(SettingsMemoryPool) - 1 + minsize);
+	p = (SettingsMemoryPool*)MallocT<byte>(sizeof(SettingsMemoryPool) - 1 + minsize);
 	p->pos = 0;
 	p->size = minsize;
 	p->next = NULL;
@@ -1082,13 +1093,7 @@
 #define CR SGF_CURRENCY
 #define NN SGF_NO_NETWORK
 
-#include "table/strings.h"
-
 /* Begin - Callback Functions for the various settings */
-#include "window.h"
-#include "gui.h"
-#include "town.h"
-#include "gfx.h"
 /* virtual PositionMainToolbar function, calls the right one.*/
 static int32 v_PositionMainToolbar(int32 p1)
 {
@@ -1307,6 +1312,7 @@
 	  SDTG_VAR("restart_game_year",    SLE_INT32, S,D0, _network_restart_game_year,    0, MIN_YEAR, MAX_YEAR, 1, STR_NULL, NULL),
 	  SDTG_VAR("min_players",          SLE_UINT8, S, 0, _network_min_players,               0, 0, 10,   0, STR_NULL, NULL),
 	SDTG_OMANY("server_lang",          SLE_UINT8, S, 0, _network_game_info.server_lang,     0, 28, "ANY|ENGLISH|GERMAN|FRENCH|BRAZILIAN|BULGARIAN|CHINESE|CZECH|DANISH|DUTCH|ESPERANTO|FINNISH|HUNGARIAN|ICELANDIC|ITALIAN|JAPANESE|KOREAN|LITHUANIAN|NORWEGIAN|POLISH|PORTUGUESE|ROMANIAN|RUSSIAN|SLOVAK|SLOVENIAN|SPANISH|SWEDISH|TURKISH|UKRAINIAN", STR_NULL, NULL),
+	 SDTG_BOOL("reload_cfg",                      S, 0, _network_reload_cfg,           false,              STR_NULL, NULL),
 	  SDTG_END()
 };
 #endif /* ENABLE_NETWORK */
@@ -1365,10 +1371,6 @@
 	SDT_BOOL(Patches, prefer_teamchat,               S, 0, false,        STR_CONFIG_PATCHES_PREFER_TEAMCHAT,       NULL),
 	SDT_VAR(Patches, scrollwheel_scrolling,SLE_UINT8,S,MS, 0,  0,  2, 0, STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING, NULL),
 	SDT_VAR(Patches,scrollwheel_multiplier,SLE_UINT8,S, 0, 5,  1, 15, 1, STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER,NULL),
-#ifdef __APPLE__
-	/* We might need to emulate a right mouse button on mac */
-	SDT_VAR(Patches,right_mouse_btn_emulation,SLE_UINT8,S,MS,0, 0, 2, 0, STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU,   NULL),
-#endif
 	SDT_BOOL(Patches, pause_on_newgame,              S, 0, false,        STR_CONFIG_PATCHES_PAUSE_ON_NEW_GAME,     NULL),
 	 SDT_VAR(Patches,advanced_vehicle_list,SLE_UINT8,S,MS, 1,  0,  2, 0, STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS,NULL),
 	SDT_BOOL(Patches, timetable_in_ticks,            S, 0, false,        STR_CONFIG_PATCHES_TIMETABLE_IN_TICKS,    NULL),
@@ -1582,6 +1584,18 @@
 	SDT_VAR    (Patches,      heightmap_rotation,       SLE_UINT8,                      S, MS,   0,                   0,    1,               0, STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION,       NULL),
 	SDT_VAR    (Patches,      se_flat_world_height,     SLE_UINT8,                      S, 0,    0,                   0,   15,               0, STR_CONFIG_PATCHES_SE_FLAT_WORLD_HEIGHT,     NULL),
 
+	/*
+	 * Since the network code (CmdChangePatchSetting and friends) use the index in this array to decide
+	 * which patch the server is talking about all conditional compilation of this array must be at the
+	 * end. This isn't really the best solution, the patches the server can tell the client about should
+	 * either use a seperate array or some other form of identifier.
+	 */
+
+#ifdef __APPLE__
+	/* We might need to emulate a right mouse button on mac */
+	SDT_VAR(Patches,right_mouse_btn_emulation,SLE_UINT8,S,MS,0, 0, 2, 0, STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU,   NULL),
+#endif
+
 	SDT_END()
 };
 
@@ -1806,6 +1820,7 @@
 	if (sd == NULL) return CMD_ERROR;
 	if (!SlIsObjectCurrentlyValid(sd->save.version_from, sd->save.version_to)) return CMD_ERROR;
 
+	if ((sd->desc.flags & SGF_NETWORK_ONLY) && !_networking) return CMD_ERROR;
 	if ((sd->desc.flags & SGF_NO_NETWORK) && _networking) return CMD_ERROR;
 
 	if (flags & DC_EXEC) {
--- a/src/settings.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/* $Id$ */
-
-/** @file settings.h */
-
-#ifndef SETTINGS_H
-#define SETTINGS_H
-
-#include "saveload.h"
-
-/** Convention/Type of settings. This is then further specified if necessary
- * with the SLE_ (SLE_VAR/SLE_FILE) enums in saveload.h
- * @see VarTypes
- * @see SettingDescBase */
-enum SettingDescTypeLong {
-	/* 4 bytes allocated a maximum of 16 types for GenericType */
-	SDT_BEGIN       = 0,
-	SDT_NUMX        = 0, ///< any number-type
-	SDT_BOOLX       = 1, ///< a boolean number
-	SDT_ONEOFMANY   = 2, ///< bitmasked number where only ONE bit may be set
-	SDT_MANYOFMANY  = 3, ///< bitmasked number where MULTIPLE bits may be set
-	SDT_INTLIST     = 4, ///< list of integers seperated by a comma ','
-	SDT_STRING      = 5, ///< string with a pre-allocated buffer
-	SDT_END,
-	/* 10 more possible primitives */
-};
-
-template <> struct EnumPropsT<SettingDescTypeLong> : MakeEnumPropsT<SettingDescTypeLong, byte, SDT_BEGIN, SDT_END, SDT_END> {};
-typedef TinyEnumT<SettingDescTypeLong> SettingDescType;
-
-
-enum SettingGuiFlagLong {
-	/* 8 bytes allocated for a maximum of 8 flags
-	 * Flags directing saving/loading of a variable */
-	SGF_NONE = 0,
-	SGF_0ISDISABLED  = 1 << 0, ///< a value of zero means the feature is disabled
-	SGF_NOCOMMA      = 1 << 1, ///< number without any thousand seperators (no formatting)
-	SGF_MULTISTRING  = 1 << 2, ///< the value represents a limited number of string-options (internally integer)
-	SGF_NETWORK_ONLY = 1 << 3, ///< this setting only applies to network games
-	SGF_CURRENCY     = 1 << 4, ///< the number represents money, so when reading value multiply by exchange rate
-	SGF_NO_NETWORK   = 1 << 5, ///< this setting does not apply to network games; it may not be changed during the game
-	SGF_END          = 1 << 6,
-	/* 3 more possible flags */
-};
-
-DECLARE_ENUM_AS_BIT_SET(SettingGuiFlagLong);
-template <> struct EnumPropsT<SettingGuiFlagLong> : MakeEnumPropsT<SettingGuiFlagLong, byte, SGF_NONE, SGF_END, SGF_END> {};
-typedef TinyEnumT<SettingGuiFlagLong> SettingGuiFlag;
-
-
-typedef int32 OnChange(int32 var);          ///< callback prototype on data modification
-typedef int32 OnConvert(const char *value); ///< callback prototype for convertion error
-
-struct SettingDescBase {
-	const char *name;       ///< name of the setting. Used in configuration file and for console
-	const void *def;        ///< default value given when none is present
-	SettingDescType cmd;    ///< various flags for the variable
-	SettingGuiFlag flags;   ///< handles how a setting would show up in the GUI (text/currency, etc.)
-	int32 min, max;         ///< minimum and maximum values
-	int32 interval;         ///< the interval to use between settings in the 'patches' window. If interval is '0' the interval is dynamically determined
-	const char *many;       ///< ONE/MANY_OF_MANY: string of possible values for this type
-	StringID str;           ///< (translated) string with descriptive text; gui and console
-	OnChange *proc;         ///< callback procedure for when the value is changed
-	OnConvert *proc_cnvt;   ///< callback procedure when loading value mechanism fails
-};
-
-struct SettingDesc {
-	SettingDescBase desc;   ///< Settings structure (going to configuration file)
-	SaveLoad save;          ///< Internal structure (going to savegame, parts to config)
-};
-
-/* NOTE: The only difference between SettingDesc and SettingDescGlob is
- * that one uses global variables as a source and the other offsets
- * in a struct which are bound to a certain variable during runtime.
- * The only way to differentiate between these two is to check if an object
- * has been passed to the function or not. If not, then it is a global variable
- * and save->variable has its address, otherwise save->variable only holds the
- * offset in a certain struct */
-typedef SettingDesc SettingDescGlobVarList;
-
-enum IniGroupType {
-	IGT_VARIABLES = 0, ///< values of the form "landscape = hilly"
-	IGT_LIST      = 1, ///< a list of values, seperated by \n and terminated by the next group block
-};
-
-/** The patch values that are used for new games and/or modified in config file */
-extern Patches _patches_newgame;
-
-bool IConsoleSetPatchSetting(const char *name, int32 value);
-void IConsoleGetPatchSetting(const char *name);
-void IConsoleListPatches();
-const SettingDesc *GetPatchFromName(const char *name, uint *i);
-bool SetPatchValue(uint index, const Patches *object, int32 value);
-
-#endif /* SETTINGS_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/settings_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,17 @@
+/* $Id$ */
+
+/** @file settings_func.h Functions related to setting/changing the settings. */
+
+#ifndef SETTINGS_FUNC_H
+#define SETTINGS_FUNC_H
+
+bool IConsoleSetPatchSetting(const char *name, int32 value);
+void IConsoleGetPatchSetting(const char *name);
+void IConsoleListPatches();
+
+void LoadFromConfig();
+void SaveToConfig();
+void CheckConfig();
+void UpdatePatches();
+
+#endif /* SETTINGS_FUNC_H */
--- a/src/settings_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/settings_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,26 +5,30 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "currency.h"
-#include "functions.h"
-#include "string.h"
-#include "strings.h" // XXX GetCurrentCurrencyRate()
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "window.h"
 #include "gui.h"
-#include "gfx.h"
-#include "command.h"
+#include "window_gui.h"
+#include "textbuf_gui.h"
+#include "command_func.h"
 #include "engine.h"
 #include "screenshot.h"
 #include "newgrf.h"
 #include "network/network.h"
 #include "town.h"
 #include "variables.h"
-#include "settings.h"
-#include "vehicle.h"
-#include "date.h"
-#include "helpers.hpp"
+#include "settings_internal.h"
 #include "newgrf_townname.h"
+#include "strings_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "vehicle_base.h"
+#include "core/alloc_func.hpp"
+#include "string_func.h"
+#include "gfx_func.h"
+#include "widgets/dropdown_type.h"
+#include "widgets/dropdown_func.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
 
 static uint32 _difficulty_click_a;
 static uint32 _difficulty_click_b;
@@ -68,35 +72,15 @@
 }
 
 int _nb_orig_names = SPECSTR_TOWNNAME_LAST - SPECSTR_TOWNNAME_START + 1;
-static StringID *_town_names = NULL;
 static StringID *_grf_names = NULL;
 static int _nb_grf_names = 0;
 
-void SortTownGeneratorNames()
+void InitGRFTownGeneratorNames()
 {
-	int n = 0;
-
-	/* Get Newgrf generators' names */
 	free(_grf_names);
 	_grf_names = GetGRFTownNameList();
 	_nb_grf_names = 0;
 	for (StringID *s = _grf_names; *s != INVALID_STRING_ID; s++) _nb_grf_names++;
-
-	/* Prepare the list */
-	free(_town_names);
-	_town_names = MallocT<StringID>(_nb_orig_names + _nb_grf_names + 1);
-
-	/* Put the original strings */
-	for (int i = 0; i < _nb_orig_names; i++) _town_names[n++] = STR_TOWNNAME_ORIGINAL_ENGLISH + i;
-
-	/* Put the grf strings */
-	for (int i = 0; i < _nb_grf_names; i++) _town_names[n++] = _grf_names[i];
-
-	/* Put the terminator */
-	_town_names[n] = INVALID_STRING_ID;
-
-	/* Sort the strings */
-	qsort(&_town_names[0], _nb_orig_names + _nb_grf_names, sizeof(StringID), &StringIDSorter);
 }
 
 static inline StringID TownName(int town_name)
@@ -131,147 +115,214 @@
 }
 
 
+enum GameOptionsWidgets {
+	GAMEOPT_CURRENCY_BTN    =  4,
+	GAMEOPT_DISTANCE_BTN    =  6,
+	GAMEOPT_ROADSIDE_BTN    =  8,
+	GAMEOPT_TOWNNAME_BTN    = 10,
+	GAMEOPT_AUTOSAVE_BTN    = 12,
+	GAMEOPT_VEHICLENAME_BTN = 14,
+	GAMEOPT_VEHICLENAME_SAVE,
+	GAMEOPT_LANG_BTN        = 17,
+	GAMEOPT_RESOLUTION_BTN  = 19,
+	GAMEOPT_FULLSCREEN,
+	GAMEOPT_SCREENSHOT_BTN  = 22,
+};
+
+/**
+ * Update/redraw the townnames dropdown
+ * @param w   the window the dropdown belongs to
+ * @param sel the currently selected townname generator
+ */
+static void ShowTownnameDropdown(Window *w, int sel)
+{
+	typedef std::map<StringID, int, StringIDCompare> TownList;
+	TownList townnames;
+
+	/* Add and sort original townnames generators */
+	for (int i = 0; i < _nb_orig_names; i++) townnames[STR_TOWNNAME_ORIGINAL_ENGLISH + i] = i;
+
+	/* Add and sort newgrf townnames generators */
+	for (int i = 0; i < _nb_grf_names; i++) townnames[_grf_names[i]] = _nb_orig_names + i;
+
+	DropDownList *list = new DropDownList();
+	for (TownList::iterator it = townnames.begin(); it != townnames.end(); it++) {
+		list->push_back(new DropDownListStringItem((*it).first, (*it).second, !(_game_mode == GM_MENU || (*it).second == sel)));
+	}
+
+	ShowDropDownList(w, list, sel, GAMEOPT_TOWNNAME_BTN);
+}
+
+/**
+ * Update/redraw the languages dropdown
+ * @param w   the window the dropdown belongs to
+ */
+static void ShowLangDropdown(Window *w)
+{
+	typedef std::map<StringID, int, StringIDCompare> LangList;
+
+	/* Sort language names */
+	LangList langs;
+	for (int i = 0; i < _dynlang.num; i++) langs[SPECSTR_LANGUAGE_START + i] = i;
+
+	DropDownList *list = new DropDownList();
+	for (LangList::iterator it = langs.begin(); it != langs.end(); it++) {
+		list->push_back(new DropDownListStringItem((*it).first, (*it).second, false));
+	}
+
+	ShowDropDownList(w, list, _dynlang.curr, GAMEOPT_LANG_BTN);
+}
+
 static void ShowCustCurrency();
 
 static void GameOptionsWndProc(Window *w, WindowEvent *e)
 {
 	switch (e->event) {
-	case WE_PAINT: {
-		int i;
-		StringID str = STR_02BE_DEFAULT;
-
-		w->SetWidgetDisabledState(21, !(_vehicle_design_names & 1));
-		if (!w->IsWidgetDisabled(21)) str = STR_02BF_CUSTOM;
-		SetDParam(0, str);
-		SetDParam(1, _currency_specs[_opt_ptr->currency].name);
-		SetDParam(2, STR_UNITS_IMPERIAL + _opt_ptr->units);
-		SetDParam(3, STR_02E9_DRIVE_ON_LEFT + _opt_ptr->road_side);
-		SetDParam(4, TownName(_opt_ptr->town_name));
-		SetDParam(5, _autosave_dropdown[_opt_ptr->autosave]);
-		SetDParam(6, SPECSTR_LANGUAGE_START + _dynlang.curr);
-		i = GetCurRes();
-		SetDParam(7, i == _num_resolutions ? STR_RES_OTHER : SPECSTR_RESOLUTION_START + i);
-		SetDParam(8, SPECSTR_SCREENSHOT_START + _cur_screenshot_format);
-		w->SetWidgetLoweredState(28, _fullscreen);
-
-		DrawWindowWidgets(w);
-		DrawString(20, 175, STR_OPTIONS_FULLSCREEN, TC_FROMSTRING); // fullscreen
-	} break;
-
-	case WE_CLICK:
-		switch (e->we.click.widget) {
-		case 4: case 5: /* Setup currencies dropdown */
-			ShowDropDownMenu(w, BuildCurrencyDropdown(), _opt_ptr->currency, 5, _game_mode == GM_MENU ? 0 : ~GetMaskOfAllowedCurrencies(), 0);;
-			return;
-		case 7: case 8: /* Setup distance unit dropdown */
-			ShowDropDownMenu(w, _units_dropdown, _opt_ptr->units, 8, 0, 0);
-			return;
-		case 10: case 11: { /* Setup road-side dropdown */
-			int i = 0;
-
-			/* You can only change the drive side if you are in the menu or ingame with
-			 * no vehicles present. In a networking game only the server can change it */
-			if ((_game_mode != GM_MENU && RoadVehiclesAreBuilt()) || (_networking && !_network_server))
-				i = (-1) ^ (1 << _opt_ptr->road_side); // disable the other value
+		case WE_PAINT: {
+			int i;
+			StringID str = STR_02BE_DEFAULT;
 
-			ShowDropDownMenu(w, _driveside_dropdown, _opt_ptr->road_side, 11, i, 0);
-		} return;
-		case 13: case 14: { /* Setup townname dropdown */
-			uint sel = 0;
-			for (uint i = 0; _town_names[i] != INVALID_STRING_ID; i++) {
-				if (_town_names[i] == TownName(_opt_ptr->town_name)) {
-					sel = i;
+			w->SetWidgetDisabledState(GAMEOPT_VEHICLENAME_SAVE, !(_vehicle_design_names & 1));
+			if (!w->IsWidgetDisabled(GAMEOPT_VEHICLENAME_SAVE)) str = STR_02BF_CUSTOM;
+			SetDParam(0, str);
+			SetDParam(1, _currency_specs[_opt_ptr->currency].name);
+			SetDParam(2, STR_UNITS_IMPERIAL + _opt_ptr->units);
+			SetDParam(3, STR_02E9_DRIVE_ON_LEFT + _opt_ptr->road_side);
+			SetDParam(4, TownName(_opt_ptr->town_name));
+			SetDParam(5, _autosave_dropdown[_opt_ptr->autosave]);
+			SetDParam(6, SPECSTR_LANGUAGE_START + _dynlang.curr);
+			i = GetCurRes();
+			SetDParam(7, i == _num_resolutions ? STR_RES_OTHER : SPECSTR_RESOLUTION_START + i);
+			SetDParam(8, SPECSTR_SCREENSHOT_START + _cur_screenshot_format);
+			w->SetWidgetLoweredState(GAMEOPT_FULLSCREEN, _fullscreen);
+
+			DrawWindowWidgets(w);
+			DrawString(20, 175, STR_OPTIONS_FULLSCREEN, TC_FROMSTRING); // fullscreen
+		} break;
+
+		case WE_CLICK:
+			switch (e->we.click.widget) {
+				case GAMEOPT_CURRENCY_BTN: /* Setup currencies dropdown */
+					ShowDropDownMenu(w, BuildCurrencyDropdown(), _opt_ptr->currency, GAMEOPT_CURRENCY_BTN, _game_mode == GM_MENU ? 0 : ~GetMaskOfAllowedCurrencies(), 0);
 					break;
-				}
-			}
-			ShowDropDownMenu(w, _town_names, sel, 14, (_game_mode == GM_MENU) ? 0 : (-1) ^ (1 << sel), 0);
-			return;
-		}
-		case 16: case 17: /* Setup autosave dropdown */
-			ShowDropDownMenu(w, _autosave_dropdown, _opt_ptr->autosave, 17, 0, 0);
-			return;
-		case 19: case 20: /* Setup customized vehicle-names dropdown */
-			ShowDropDownMenu(w, _designnames_dropdown, (_vehicle_design_names & 1) ? 1 : 0, 20, (_vehicle_design_names & 2) ? 0 : 2, 0);
-			return;
-		case 21: /* Save customized vehicle-names to disk */
-			return;
-		case 23: case 24: /* Setup interface language dropdown */
-			ShowDropDownMenu(w, _dynlang.dropdown, _dynlang.curr, 24, 0, 0);
-			return;
-		case 26: case 27: /* Setup resolution dropdown */
-			ShowDropDownMenu(w, BuildDynamicDropdown(SPECSTR_RESOLUTION_START, _num_resolutions), GetCurRes(), 27, 0, 0);
-			return;
-		case 28: /* Click fullscreen on/off */
-			w->SetWidgetLoweredState(28, !_fullscreen);
-			ToggleFullScreen(!_fullscreen); // toggle full-screen on/off
-			SetWindowDirty(w);
-			return;
-		case 30: case 31: /* Setup screenshot format dropdown */
-			ShowDropDownMenu(w, BuildDynamicDropdown(SPECSTR_SCREENSHOT_START, _num_screenshot_formats), _cur_screenshot_format, 31, 0, 0);
-			return;
-		}
-		break;
 
-	case WE_DROPDOWN_SELECT:
-		switch (e->we.dropdown.button) {
-		case 20: /* Vehicle design names */
-			if (e->we.dropdown.index == 0) {
-				DeleteCustomEngineNames();
-				MarkWholeScreenDirty();
-			} else if (!(_vehicle_design_names & 1)) {
-				LoadCustomEngineNames();
-				MarkWholeScreenDirty();
+				case GAMEOPT_DISTANCE_BTN: /* Setup distance unit dropdown */
+					ShowDropDownMenu(w, _units_dropdown, _opt_ptr->units, GAMEOPT_DISTANCE_BTN, 0, 0);
+					break;
+
+				case GAMEOPT_ROADSIDE_BTN: { /* Setup road-side dropdown */
+					int i = 0;
+
+					/* You can only change the drive side if you are in the menu or ingame with
+					 * no vehicles present. In a networking game only the server can change it */
+					if ((_game_mode != GM_MENU && RoadVehiclesAreBuilt()) || (_networking && !_network_server))
+						i = (-1) ^ (1 << _opt_ptr->road_side); // disable the other value
+
+					ShowDropDownMenu(w, _driveside_dropdown, _opt_ptr->road_side, GAMEOPT_ROADSIDE_BTN, i, 0);
+				} break;
+
+				case GAMEOPT_TOWNNAME_BTN: /* Setup townname dropdown */
+					ShowTownnameDropdown(w, _opt_ptr->town_name);
+					break;
+
+				case GAMEOPT_AUTOSAVE_BTN: /* Setup autosave dropdown */
+					ShowDropDownMenu(w, _autosave_dropdown, _opt_ptr->autosave, GAMEOPT_AUTOSAVE_BTN, 0, 0);
+					break;
+
+				case GAMEOPT_VEHICLENAME_BTN: /* Setup customized vehicle-names dropdown */
+					ShowDropDownMenu(w, _designnames_dropdown, (_vehicle_design_names & 1) ? 1 : 0, GAMEOPT_VEHICLENAME_BTN, (_vehicle_design_names & 2) ? 0 : 2, 0);
+					break;
+
+				case GAMEOPT_VEHICLENAME_SAVE: /* Save customized vehicle-names to disk */
+					break;  // not implemented
+
+				case GAMEOPT_LANG_BTN: /* Setup interface language dropdown */
+					ShowLangDropdown(w);
+					break;
+
+				case GAMEOPT_RESOLUTION_BTN: /* Setup resolution dropdown */
+					ShowDropDownMenu(w, BuildDynamicDropdown(SPECSTR_RESOLUTION_START, _num_resolutions), GetCurRes(), GAMEOPT_RESOLUTION_BTN, 0, 0);
+					break;
+
+				case GAMEOPT_FULLSCREEN: /* Click fullscreen on/off */
+					/* try to toggle full-screen on/off */
+					if (!ToggleFullScreen(!_fullscreen)) {
+						ShowErrorMessage(INVALID_STRING_ID, STR_FULLSCREEN_FAILED, 0, 0);
+					}
+					w->SetWidgetLoweredState(GAMEOPT_FULLSCREEN, _fullscreen);
+					SetWindowDirty(w);
+					break;
+
+				case GAMEOPT_SCREENSHOT_BTN: /* Setup screenshot format dropdown */
+					ShowDropDownMenu(w, BuildDynamicDropdown(SPECSTR_SCREENSHOT_START, _num_screenshot_formats), _cur_screenshot_format, GAMEOPT_SCREENSHOT_BTN, 0, 0);
+					break;
 			}
 			break;
-		case 5: /* Currency */
-			if (e->we.dropdown.index == CUSTOM_CURRENCY_ID) ShowCustCurrency();
-			_opt_ptr->currency = e->we.dropdown.index;
-			MarkWholeScreenDirty();
-			break;
-		case 8: /* Measuring units */
-			_opt_ptr->units = e->we.dropdown.index;
-			MarkWholeScreenDirty();
-			break;
-		case 11: /* Road side */
-			if (_opt_ptr->road_side != e->we.dropdown.index) { // only change if setting changed
-				DoCommandP(0, e->we.dropdown.index, 0, NULL, CMD_SET_ROAD_DRIVE_SIDE | CMD_MSG(STR_00B4_CAN_T_DO_THIS));
-				MarkWholeScreenDirty();
+
+		case WE_DROPDOWN_SELECT:
+			switch (e->we.dropdown.button) {
+				case GAMEOPT_VEHICLENAME_BTN: /* Vehicle design names */
+					if (e->we.dropdown.index == 0) {
+						DeleteCustomEngineNames();
+						MarkWholeScreenDirty();
+					} else if (!(_vehicle_design_names & 1)) {
+						LoadCustomEngineNames();
+						MarkWholeScreenDirty();
+					}
+					break;
+
+				case GAMEOPT_CURRENCY_BTN: /* Currency */
+					if (e->we.dropdown.index == CUSTOM_CURRENCY_ID) ShowCustCurrency();
+					_opt_ptr->currency = e->we.dropdown.index;
+					MarkWholeScreenDirty();
+					break;
+
+				case GAMEOPT_DISTANCE_BTN: /* Measuring units */
+					_opt_ptr->units = e->we.dropdown.index;
+					MarkWholeScreenDirty();
+					break;
+
+				case GAMEOPT_ROADSIDE_BTN: /* Road side */
+					if (_opt_ptr->road_side != e->we.dropdown.index) { // only change if setting changed
+						DoCommandP(0, e->we.dropdown.index, 0, NULL, CMD_SET_ROAD_DRIVE_SIDE | CMD_MSG(STR_00B4_CAN_T_DO_THIS));
+						MarkWholeScreenDirty();
+					}
+					break;
+
+				case GAMEOPT_TOWNNAME_BTN: /* Town names */
+					if (_game_mode == GM_MENU) {
+						_opt_ptr->town_name = e->we.dropdown.index;
+						InvalidateWindow(WC_GAME_OPTIONS, 0);
+					}
+					break;
+
+				case GAMEOPT_AUTOSAVE_BTN: /* Autosave options */
+					_opt.autosave = _opt_newgame.autosave = e->we.dropdown.index;
+					SetWindowDirty(w);
+					break;
+
+				case GAMEOPT_LANG_BTN: /* Change interface language */
+					ReadLanguagePack(e->we.dropdown.index);
+					CheckForMissingGlyphsInLoadedLanguagePack();
+					UpdateAllStationVirtCoord();
+					MarkWholeScreenDirty();
+					break;
+
+				case GAMEOPT_RESOLUTION_BTN: /* Change resolution */
+					if (e->we.dropdown.index < _num_resolutions && ChangeResInGame(_resolutions[e->we.dropdown.index][0],_resolutions[e->we.dropdown.index][1]))
+						SetWindowDirty(w);
+					break;
+
+				case GAMEOPT_SCREENSHOT_BTN: /* Change screenshot format */
+					SetScreenshotFormat(e->we.dropdown.index);
+					SetWindowDirty(w);
+					break;
 			}
 			break;
-		case 14: /* Town names */
-			if (_game_mode == GM_MENU) {
-				for (uint i = 0; _town_names[i] != INVALID_STRING_ID; i++) {
-					if (_town_names[e->we.dropdown.index] == TownName(i)) {
-						_opt_ptr->town_name = i;
-						break;
-					}
-				}
-				InvalidateWindow(WC_GAME_OPTIONS, 0);
-			}
-			break;
-		case 17: /* Autosave options */
-			_opt.autosave = _opt_newgame.autosave = e->we.dropdown.index;
-			SetWindowDirty(w);
+
+		case WE_DESTROY:
+			DeleteWindowById(WC_CUSTOM_CURRENCY, 0);
 			break;
-		case 24: /* Change interface language */
-			ReadLanguagePack(e->we.dropdown.index);
-			UpdateAllStationVirtCoord();
-			MarkWholeScreenDirty();
-			break;
-		case 27: /* Change resolution */
-			if (e->we.dropdown.index < _num_resolutions && ChangeResInGame(_resolutions[e->we.dropdown.index][0],_resolutions[e->we.dropdown.index][1]))
-				SetWindowDirty(w);
-			break;
-		case 31: /* Change screenshot format */
-			SetScreenshotFormat(e->we.dropdown.index);
-			SetWindowDirty(w);
-			break;
-		}
-		break;
-
-	case WE_DESTROY:
-		DeleteWindowById(WC_CUSTOM_CURRENCY, 0);
-		break;
 	}
 
 }
@@ -300,38 +351,29 @@
 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   369,     0,    13, STR_00B1_GAME_OPTIONS,             STR_018C_WINDOW_TITLE_DRAG_THIS},
 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   369,    14,   238, 0x0,                               STR_NULL},
 {      WWT_FRAME,   RESIZE_NONE,    14,    10,   179,    20,    55, STR_02E0_CURRENCY_UNITS,           STR_NULL},
-{      WWT_INSET,   RESIZE_NONE,    14,    20,   169,    34,    45, STR_02E1,                          STR_02E2_CURRENCY_UNITS_SELECTION},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,   158,   168,    35,    44, STR_0225,                          STR_02E2_CURRENCY_UNITS_SELECTION},
+{ WWT_DROPDOWNIN,   RESIZE_NONE,    14,    20,   169,    34,    45, STR_02E1,                          STR_02E2_CURRENCY_UNITS_SELECTION},
 {      WWT_FRAME,   RESIZE_NONE,    14,   190,   359,    20,    55, STR_MEASURING_UNITS,               STR_NULL},
-{      WWT_INSET,   RESIZE_NONE,    14,   200,   349,    34,    45, STR_02E4,                          STR_MEASURING_UNITS_SELECTION},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,   338,   348,    35,    44, STR_0225,                          STR_MEASURING_UNITS_SELECTION},
+{ WWT_DROPDOWNIN,   RESIZE_NONE,    14,   200,   349,    34,    45, STR_02E4,                          STR_MEASURING_UNITS_SELECTION},
 {      WWT_FRAME,   RESIZE_NONE,    14,    10,   179,    62,    97, STR_02E6_ROAD_VEHICLES,            STR_NULL},
-{      WWT_INSET,   RESIZE_NONE,    14,    20,   169,    76,    87, STR_02E7,                          STR_02E8_SELECT_SIDE_OF_ROAD_FOR},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,   158,   168,    77,    86, STR_0225,                          STR_02E8_SELECT_SIDE_OF_ROAD_FOR},
+{ WWT_DROPDOWNIN,   RESIZE_NONE,    14,    20,   169,    76,    87, STR_02E7,                          STR_02E8_SELECT_SIDE_OF_ROAD_FOR},
 {      WWT_FRAME,   RESIZE_NONE,    14,   190,   359,    62,    97, STR_02EB_TOWN_NAMES,               STR_NULL},
-{      WWT_INSET,   RESIZE_NONE,    14,   200,   349,    76,    87, STR_02EC,                          STR_02ED_SELECT_STYLE_OF_TOWN_NAMES},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,   338,   348,    77,    86, STR_0225,                          STR_02ED_SELECT_STYLE_OF_TOWN_NAMES},
+{ WWT_DROPDOWNIN,   RESIZE_NONE,    14,   200,   349,    76,    87, STR_02EC,                          STR_02ED_SELECT_STYLE_OF_TOWN_NAMES},
 {      WWT_FRAME,   RESIZE_NONE,    14,    10,   179,   104,   139, STR_02F4_AUTOSAVE,                 STR_NULL},
-{      WWT_INSET,   RESIZE_NONE,    14,    20,   169,   118,   129, STR_02F5,                          STR_02F6_SELECT_INTERVAL_BETWEEN},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,   158,   168,   119,   128, STR_0225,                          STR_02F6_SELECT_INTERVAL_BETWEEN},
+{ WWT_DROPDOWNIN,   RESIZE_NONE,    14,    20,   169,   118,   129, STR_02F5,                          STR_02F6_SELECT_INTERVAL_BETWEEN},
 
 {      WWT_FRAME,   RESIZE_NONE,    14,    10,   359,   194,   228, STR_02BC_VEHICLE_DESIGN_NAMES,     STR_NULL},
-{      WWT_INSET,   RESIZE_NONE,    14,    20,   119,   207,   218, STR_02BD,                          STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,   108,   118,   208,   217, STR_0225,                          STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION},
+{ WWT_DROPDOWNIN,   RESIZE_NONE,    14,    20,   119,   207,   218, STR_02BD,                          STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION},
 {    WWT_TEXTBTN,   RESIZE_NONE,    14,   130,   349,   207,   218, STR_02C0_SAVE_CUSTOM_NAMES,        STR_02C2_SAVE_CUSTOMIZED_VEHICLE},
 
 {      WWT_FRAME,   RESIZE_NONE,    14,   190,   359,   104,   139, STR_OPTIONS_LANG,                  STR_NULL},
-{      WWT_INSET,   RESIZE_NONE,    14,   200,   349,   118,   129, STR_OPTIONS_LANG_CBO,              STR_OPTIONS_LANG_TIP},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,   338,   348,   119,   128, STR_0225,                          STR_OPTIONS_LANG_TIP},
+{ WWT_DROPDOWNIN,   RESIZE_NONE,    14,   200,   349,   118,   129, STR_OPTIONS_LANG_CBO,              STR_OPTIONS_LANG_TIP},
 
 {      WWT_FRAME,   RESIZE_NONE,    14,    10,   179,   146,   190, STR_OPTIONS_RES,                   STR_NULL},
-{      WWT_INSET,   RESIZE_NONE,    14,    20,   169,   160,   171, STR_OPTIONS_RES_CBO,               STR_OPTIONS_RES_TIP},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,   158,   168,   161,   170, STR_0225,                          STR_OPTIONS_RES_TIP},
+{ WWT_DROPDOWNIN,   RESIZE_NONE,    14,    20,   169,   160,   171, STR_OPTIONS_RES_CBO,               STR_OPTIONS_RES_TIP},
 {    WWT_TEXTBTN,   RESIZE_NONE,    14,   149,   169,   176,   184, STR_EMPTY,                         STR_OPTIONS_FULLSCREEN_TIP},
 
 {      WWT_FRAME,   RESIZE_NONE,    14,   190,   359,   146,   190, STR_OPTIONS_SCREENSHOT_FORMAT,     STR_NULL},
-{      WWT_INSET,   RESIZE_NONE,    14,   200,   349,   160,   171, STR_OPTIONS_SCREENSHOT_FORMAT_CBO, STR_OPTIONS_SCREENSHOT_FORMAT_TIP},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,   338,   348,   161,   170, STR_0225,                          STR_OPTIONS_SCREENSHOT_FORMAT_TIP},
+{ WWT_DROPDOWNIN,   RESIZE_NONE,    14,   200,   349,   160,   171, STR_OPTIONS_SCREENSHOT_FORMAT_CBO, STR_OPTIONS_SCREENSHOT_FORMAT_TIP},
 
 {   WIDGETS_END},
 };
@@ -447,171 +489,187 @@
 // 0x383E = (1 << 13) | (1 << 12) | (1 << 11) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1)
 #define DIFF_INGAME_DISABLED_BUTTONS 0x383E
 
+/* Names of the game difficulty settings window */
+enum GameDifficultyWidgets {
+	GDW_CLOSEBOX = 0,
+	GDW_CAPTION,
+	GDW_UPPER_BG,
+	GDW_LVL_EASY,
+	GDW_LVL_MEDIUM,
+	GDW_LVL_HARD,
+	GDW_LVL_CUSTOM,
+	GDW_HIGHSCORE,
+	GDW_SETTING_BG,
+	GDW_LOWER_BG,
+	GDW_ACCEPT,
+	GDW_CANCEL,
+};
+
 static void GameDifficultyWndProc(Window *w, WindowEvent *e)
 {
 	switch (e->event) {
-	case WE_CREATE: // Setup disabled buttons when creating window
-		/* disable all other difficulty buttons during gameplay except for 'custom' */
-		w->SetWidgetDisabledState( 3, _game_mode == GM_NORMAL);
-		w->SetWidgetDisabledState( 4, _game_mode == GM_NORMAL);
-		w->SetWidgetDisabledState( 5, _game_mode == GM_NORMAL);
-		w->SetWidgetDisabledState( 6, _game_mode == GM_NORMAL);
-		w->SetWidgetDisabledState( 7, _game_mode == GM_EDITOR || _networking); // highscore chart in multiplayer
-		w->SetWidgetDisabledState(10, _networking && !_network_server); // Save-button in multiplayer (and if client)
-		w->LowerWidget(_opt_mod_temp.diff_level + 3);
-
-		break;
-	case WE_PAINT: {
-		uint32 click_a, click_b, disabled;
-		int i;
-		int y, value;
+		case WE_CREATE:
+			/* Hide the closebox to make sure that the user aborts or confirms his changes */
+			w->HideWidget(GDW_CLOSEBOX);
+			w->widget[GDW_CAPTION].left = 0;
+			/* Setup disabled buttons when creating window
+			 * disable all other difficulty buttons during gameplay except for 'custom' */
+			w->SetWidgetsDisabledState(_game_mode == GM_NORMAL,
+				GDW_LVL_EASY,
+				GDW_LVL_MEDIUM,
+				GDW_LVL_HARD,
+				GDW_LVL_CUSTOM,
+				WIDGET_LIST_END);
+			w->SetWidgetDisabledState(GDW_HIGHSCORE, _game_mode == GM_EDITOR || _networking); // highscore chart in multiplayer
+			w->SetWidgetDisabledState(GDW_ACCEPT, _networking && !_network_server); // Save-button in multiplayer (and if client)
+			w->LowerWidget(GDW_LVL_EASY + _opt_mod_temp.diff_level);
+			break;
 
-		DrawWindowWidgets(w);
-
-		click_a = _difficulty_click_a;
-		click_b = _difficulty_click_b;
+		case WE_PAINT: {
+			DrawWindowWidgets(w);
 
-		/* XXX - Disabled buttons in normal gameplay. Bitshifted for each button to see if
-		 * that bit is set. If it is set, the button is disabled */
-		disabled = (_game_mode == GM_NORMAL) ? DIFF_INGAME_DISABLED_BUTTONS : 0;
-
-		y = GAMEDIFF_WND_TOP_OFFSET;
-		for (i = 0; i != GAME_DIFFICULTY_NUM; i++) {
-			DrawFrameRect( 5, y,  5 + 8, y + 8, 3, HasBit(click_a, i) ? FR_LOWERED : FR_NONE);
-			DrawFrameRect(15, y, 15 + 8, y + 8, 3, HasBit(click_b, i) ? FR_LOWERED : FR_NONE);
-			if (HasBit(disabled, i) || (_networking && !_network_server)) {
-				int color = (1 << PALETTE_MODIFIER_GREYOUT) | _colour_gradient[COLOUR_YELLOW][2];
-				GfxFillRect( 6, y + 1,  6 + 8, y + 8, color);
-				GfxFillRect(16, y + 1, 16 + 8, y + 8, color);
+			/* XXX - Disabled buttons in normal gameplay or during muliplayer as non server.
+			 *       Bitshifted for each button to see if that bit is set. If it is set, the
+			 *       button is disabled */
+			uint32 disabled = 0;
+			if (_networking && !_network_server) {
+				disabled = MAX_UVALUE(uint32); // Disable all
+			} else if (_game_mode == GM_NORMAL) {
+				disabled = DIFF_INGAME_DISABLED_BUTTONS;
 			}
 
-			DrawStringCentered(10, y, STR_6819, TC_FROMSTRING);
-			DrawStringCentered(20, y, STR_681A, TC_FROMSTRING);
-
-
-			value = _game_setting_info[i].str + ((GDType*)&_opt_mod_temp.diff)[i];
-			if (i == 4) value *= 1000; // XXX - handle currency option
-			SetDParam(0, value);
-			DrawString(30, y, STR_6805_MAXIMUM_NO_COMPETITORS + i, TC_FROMSTRING);
-
-			y += GAMEDIFF_WND_ROWSIZE + 2; // space items apart a bit
-		}
-	} break;
-
-	case WE_CLICK:
-		switch (e->we.click.widget) {
-		case 8: { /* Difficulty settings widget, decode click */
-			const GameSettingData *info;
-			int x, y;
-			uint btn, dis;
-			int16 val;
-
-			/* Don't allow clients to make any changes */
-			if  (_networking && !_network_server)
-				return;
-
-			x = e->we.click.pt.x - 5;
-			if (!IsInsideMM(x, 0, 21)) // Button area
-				return;
-
-			y = e->we.click.pt.y - GAMEDIFF_WND_TOP_OFFSET;
-			if (y < 0)
-				return;
-
-			/* Get button from Y coord. */
-			btn = y / (GAMEDIFF_WND_ROWSIZE + 2);
-			if (btn >= GAME_DIFFICULTY_NUM || y % (GAMEDIFF_WND_ROWSIZE + 2) >= 9)
-				return;
-
-			/* Clicked disabled button? */
-			dis = (_game_mode == GM_NORMAL) ? DIFF_INGAME_DISABLED_BUTTONS : 0;
-
-			if (HasBit(dis, btn))
-				return;
-
-			_difficulty_timeout = 5;
-
-			val = ((GDType*)&_opt_mod_temp.diff)[btn];
+			int value;
+			int y = GAMEDIFF_WND_TOP_OFFSET;
+			for (uint i = 0; i != GAME_DIFFICULTY_NUM; i++) {
+				const GameSettingData *gsd = &_game_setting_info[i];
+				value = ((GDType*)&_opt_mod_temp.diff)[i];
 
-			info = &_game_setting_info[btn]; // get information about the difficulty setting
-			if (x >= 10) {
-				// Increase button clicked
-				val = min(val + info->step, info->max);
-				SetBit(_difficulty_click_b, btn);
-			} else {
-				// Decrease button clicked
-				val -= info->step;
-				val = max(val,  info->min);
-				SetBit(_difficulty_click_a, btn);
-			}
+				DrawArrowButtons(5, y, 3,
+						!!HasBit(_difficulty_click_a, i) | !!HasBit(_difficulty_click_b, i) << 1,
+						!(HasBit(disabled, i) || gsd->min == value),
+						!(HasBit(disabled, i) || gsd->max == value));
 
-			// save value in temporary variable
-			((GDType*)&_opt_mod_temp.diff)[btn] = val;
-			w->RaiseWidget(_opt_mod_temp.diff_level + 3);
-			SetDifficultyLevel(3, &_opt_mod_temp); // set difficulty level to custom
-			w->LowerWidget(_opt_mod_temp.diff_level + 3);
-			SetWindowDirty(w);
+				value += _game_setting_info[i].str;
+				if (i == 4) value *= 1000; // XXX - handle currency option
+				SetDParam(0, value);
+				DrawString(30, y, STR_6805_MAXIMUM_NO_COMPETITORS + i, TC_FROMSTRING);
+
+				y += GAMEDIFF_WND_ROWSIZE + 2; // space items apart a bit
+			}
 		} break;
-		case 3: case 4: case 5: case 6: /* Easy / Medium / Hard / Custom */
-			// temporarily change difficulty level
-			w->RaiseWidget(_opt_mod_temp.diff_level + 3);
-			SetDifficultyLevel(e->we.click.widget - 3, &_opt_mod_temp);
-			w->LowerWidget(_opt_mod_temp.diff_level + 3);
-			SetWindowDirty(w);
-			break;
-		case 7: /* Highscore Table */
-			ShowHighscoreTable(_opt_mod_temp.diff_level, -1);
+
+		case WE_CLICK:
+			switch (e->we.click.widget) {
+				case GDW_SETTING_BG: { /* Difficulty settings widget, decode click */
+					/* Don't allow clients to make any changes */
+					if (_networking && !_network_server) return;
+
+					const int x = e->we.click.pt.x - 5;
+					if (!IsInsideMM(x, 0, 21)) // Button area
+						return;
+
+					const int y = e->we.click.pt.y - GAMEDIFF_WND_TOP_OFFSET;
+					if (y < 0) return;
+
+					/* Get button from Y coord. */
+					const uint btn = y / (GAMEDIFF_WND_ROWSIZE + 2);
+					if (btn >= GAME_DIFFICULTY_NUM || y % (GAMEDIFF_WND_ROWSIZE + 2) >= 9)
+						return;
+
+					/* Clicked disabled button? */
+					if (_game_mode == GM_NORMAL && HasBit(DIFF_INGAME_DISABLED_BUTTONS, btn))
+						return;
+
+					_difficulty_timeout = 5;
+
+					int16 val = ((GDType*)&_opt_mod_temp.diff)[btn];
+
+					const GameSettingData *info = &_game_setting_info[btn]; // get information about the difficulty setting
+					if (x >= 10) {
+						/* Increase button clicked */
+						val = min(val + info->step, info->max);
+						SetBit(_difficulty_click_b, btn);
+					} else {
+						/* Decrease button clicked */
+						val -= info->step;
+						val = max(val,  info->min);
+						SetBit(_difficulty_click_a, btn);
+					}
+
+					/* save value in temporary variable */
+					((GDType*)&_opt_mod_temp.diff)[btn] = val;
+					w->RaiseWidget(GDW_LVL_EASY + _opt_mod_temp.diff_level);
+					SetDifficultyLevel(3, &_opt_mod_temp); // set difficulty level to custom
+					w->LowerWidget(GDW_LVL_CUSTOM);
+					SetWindowDirty(w);
+				} break;
+
+				case GDW_LVL_EASY:
+				case GDW_LVL_MEDIUM:
+				case GDW_LVL_HARD:
+				case GDW_LVL_CUSTOM:
+					/* temporarily change difficulty level */
+					w->RaiseWidget(GDW_LVL_EASY + _opt_mod_temp.diff_level);
+					SetDifficultyLevel(e->we.click.widget - GDW_LVL_EASY, &_opt_mod_temp);
+					w->LowerWidget(GDW_LVL_EASY + _opt_mod_temp.diff_level);
+					SetWindowDirty(w);
+					break;
+
+				case GDW_HIGHSCORE: // Highscore Table
+					ShowHighscoreTable(_opt_mod_temp.diff_level, -1);
+					break;
+
+				case GDW_ACCEPT: { // Save button - save changes
+					GDType btn, val;
+					for (btn = 0; btn != GAME_DIFFICULTY_NUM; btn++) {
+						val = ((GDType*)&_opt_mod_temp.diff)[btn];
+						/* if setting has changed, change it */
+						if (val != ((GDType*)&_opt_ptr->diff)[btn])
+							DoCommandP(0, btn, val, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
+					}
+					DoCommandP(0, UINT_MAX, _opt_mod_temp.diff_level, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
+					DeleteWindow(w);
+					/* If we are in the editor, we should reload the economy.
+					 * This way when you load a game, the max loan and interest rate
+					 * are loaded correctly. */
+					if (_game_mode == GM_EDITOR) StartupEconomy();
+					break;
+				}
+
+				case GDW_CANCEL: // Cancel button - close window, abandon changes
+					DeleteWindow(w);
+					break;
+			} break;
+
+		case WE_MOUSELOOP: /* Handle the visual 'clicking' of the buttons */
+			if (_difficulty_timeout != 0 && !--_difficulty_timeout) {
+				_difficulty_click_a = 0;
+				_difficulty_click_b = 0;
+				SetWindowDirty(w);
+			}
 			break;
-		case 10: { /* Save button - save changes */
-			GDType btn, val;
-			for (btn = 0; btn != GAME_DIFFICULTY_NUM; btn++) {
-				val = ((GDType*)&_opt_mod_temp.diff)[btn];
-				// if setting has changed, change it
-				if (val != ((GDType*)&_opt_ptr->diff)[btn])
-					DoCommandP(0, btn, val, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
-			}
-			DoCommandP(0, UINT_MAX, _opt_mod_temp.diff_level, NULL, CMD_CHANGE_DIFFICULTY_LEVEL);
-			DeleteWindow(w);
-			// If we are in the editor, we should reload the economy.
-			//  This way when you load a game, the max loan and interest rate
-			//  are loaded correctly.
-			if (_game_mode == GM_EDITOR)
-				StartupEconomy();
-			break;
-		}
-		case 11: /* Cancel button - close window, abandon changes */
-			DeleteWindow(w);
-			break;
-	} break;
-
-	case WE_MOUSELOOP: /* Handle the visual 'clicking' of the buttons */
-		if (_difficulty_timeout != 0 && !--_difficulty_timeout) {
-			_difficulty_click_a = 0;
-			_difficulty_click_b = 0;
-			SetWindowDirty(w);
-		}
-		break;
 	}
 }
-
 #undef DIFF_INGAME_DISABLED_BUTTONS
 
+/* Widget definition for the game difficulty settings window */
 static const Widget _game_difficulty_widgets[] = {
-{   WWT_CLOSEBOX,   RESIZE_NONE,    10,     0,    10,     0,    13, STR_00C5,                     STR_018B_CLOSE_WINDOW},
-{    WWT_CAPTION,   RESIZE_NONE,    10,    11,   369,     0,    13, STR_6800_DIFFICULTY_LEVEL,    STR_018C_WINDOW_TITLE_DRAG_THIS},
-{      WWT_PANEL,   RESIZE_NONE,    10,     0,   369,    14,    29, 0x0,                          STR_NULL},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    10,    96,    16,    27, STR_6801_EASY,                STR_NULL},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    97,   183,    16,    27, STR_6802_MEDIUM,              STR_NULL},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,   184,   270,    16,    27, STR_6803_HARD,                STR_NULL},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,   271,   357,    16,    27, STR_6804_CUSTOM,              STR_NULL},
-{    WWT_TEXTBTN,   RESIZE_NONE,    10,     0,   369,    30,    41, STR_6838_SHOW_HI_SCORE_CHART, STR_NULL},
-{      WWT_PANEL,   RESIZE_NONE,    10,     0,   369,    42,   262, 0x0,                          STR_NULL},
-{      WWT_PANEL,   RESIZE_NONE,    10,     0,   369,   263,   278, 0x0,                          STR_NULL},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,   105,   185,   265,   276, STR_OPTIONS_SAVE_CHANGES,     STR_NULL},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,   186,   266,   265,   276, STR_012E_CANCEL,              STR_NULL},
+{   WWT_CLOSEBOX,   RESIZE_NONE,    10,     0,    10,     0,    13, STR_00C5,                     STR_018B_CLOSE_WINDOW},           // GDW_CLOSEBOX
+{    WWT_CAPTION,   RESIZE_NONE,    10,    11,   369,     0,    13, STR_6800_DIFFICULTY_LEVEL,    STR_018C_WINDOW_TITLE_DRAG_THIS}, // GDW_CAPTION
+{      WWT_PANEL,   RESIZE_NONE,    10,     0,   369,    14,    41, 0x0,                          STR_NULL},                        // GDW_UPPER_BG
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    10,    96,    16,    27, STR_6801_EASY,                STR_NULL},                        // GDW_LVL_EASY
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    97,   183,    16,    27, STR_6802_MEDIUM,              STR_NULL},                        // GDW_LVL_MEDIUM
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,   184,   270,    16,    27, STR_6803_HARD,                STR_NULL},                        // GDW_LVL_HARD
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,   271,   357,    16,    27, STR_6804_CUSTOM,              STR_NULL},                        // GDW_LVL_CUSTOM
+{    WWT_TEXTBTN,   RESIZE_NONE,     6,    10,   357,    28,    39, STR_6838_SHOW_HI_SCORE_CHART, STR_NULL},                        // GDW_HIGHSCORE
+{      WWT_PANEL,   RESIZE_NONE,    10,     0,   369,    42,   262, 0x0,                          STR_NULL},                        // GDW_SETTING_BG
+{      WWT_PANEL,   RESIZE_NONE,    10,     0,   369,   263,   278, 0x0,                          STR_NULL},                        // GDW_LOWER_BG
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,   105,   185,   265,   276, STR_OPTIONS_SAVE_CHANGES,     STR_NULL},                        // GDW_ACCEPT
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,   186,   266,   265,   276, STR_012E_CANCEL,              STR_NULL},                        // GDW_CANCEL
 {   WIDGETS_END},
 };
 
+/* Window definition for the game difficulty settings window */
 static const WindowDesc _game_difficulty_desc = {
 	WDP_CENTER, WDP_CENTER, 370, 279, 370, 279,
 	WC_GAME_OPTIONS, WC_NONE,
@@ -774,6 +832,16 @@
 	{_patches_ai,           NULL, lengthof(_patches_ai)},
 };
 
+enum PatchesSelectionWidgets {
+	PATCHSEL_OPTIONSPANEL = 3,
+	PATCHSEL_INTERFACE,
+	PATCHSEL_CONSTRUCTION,
+	PATCHSEL_VEHICLES,
+	PATCHSEL_STATIONS,
+	PATCHSEL_ECONOMY,
+	PATCHSEL_COMPETITORS
+};
+
 /** The main patches window. Shows a number of categories on top and
  * a selection of patches in that category.
  * Uses WP(w, def_d) macro - data_1, data_2, data_3 */
@@ -782,210 +850,208 @@
 	static Patches *patches_ptr;
 
 	switch (e->event) {
-	case WE_CREATE: {
-		static bool first_time = true;
-
-		patches_ptr = (_game_mode == GM_MENU) ? &_patches_newgame : &_patches;
-
-		/* Build up the dynamic settings-array only once per OpenTTD session */
-		if (first_time) {
-			PatchPage *page;
-			for (page = &_patches_page[0]; page != endof(_patches_page); page++) {
-				uint i;
-
-				page->entries = MallocT<PatchEntry>(page->num);
-				for (i = 0; i != page->num; i++) {
-					uint index;
-					const SettingDesc *sd = GetPatchFromName(page->names[i], &index);
-					assert(sd != NULL);
-
-					page->entries[i].setting = sd;
-					page->entries[i].index = index;
-				}
-			}
-			first_time = false;
-		}
-		w->LowerWidget(4);
-	} break;
-
-	case WE_PAINT: {
-		int x, y;
-		const PatchPage *page = &_patches_page[WP(w,def_d).data_1];
-		uint i;
-
-		/* Set up selected category */
-		DrawWindowWidgets(w);
+		case WE_CREATE: {
+			static bool first_time = true;
 
-		x = 5;
-		y = 47;
-		for (i = 0; i != page->num; i++) {
-			const SettingDesc *sd = page->entries[i].setting;
-			const SettingDescBase *sdb = &sd->desc;
-			const void *var = GetVariableAddress(patches_ptr, &sd->save);
-			bool editable = true;
-			bool disabled = false;
-
-			// We do not allow changes of some items when we are a client in a networkgame
-			if (!(sd->save.conv & SLF_NETWORK_NO) && _networking && !_network_server) editable = false;
-			if ((sdb->flags & SGF_NETWORK_ONLY) && !_networking) editable = false;
-			if ((sdb->flags & SGF_NO_NETWORK) && _networking) editable = false;
-
-			if (sdb->cmd == SDT_BOOLX) {
-				static const int _bool_ctabs[2][2] = {{9, 4}, {7, 6}};
-				/* Draw checkbox for boolean-value either on/off */
-				bool on = (*(bool*)var);
+			patches_ptr = (_game_mode == GM_MENU) ? &_patches_newgame : &_patches;
 
-				DrawFrameRect(x, y, x + 19, y + 8, _bool_ctabs[!!on][!!editable], on ? FR_LOWERED : FR_NONE);
-				SetDParam(0, on ? STR_CONFIG_PATCHES_ON : STR_CONFIG_PATCHES_OFF);
-			} else {
-				int32 value;
-
-				value = (int32)ReadValue(var, sd->save.conv);
-
-				/* Draw [<][>] boxes for settings of an integer-type */
-				DrawArrowButtons(x, y, 3, WP(w,def_d).data_2 - (i * 2), (editable && value != sdb->min), (editable && value != sdb->max));
+			/* Build up the dynamic settings-array only once per OpenTTD session */
+			if (first_time) {
+				PatchPage *page;
+				for (page = &_patches_page[0]; page != endof(_patches_page); page++) {
+					uint i;
 
-				disabled = (value == 0) && (sdb->flags & SGF_0ISDISABLED);
-				if (disabled) {
-					SetDParam(0, STR_CONFIG_PATCHES_DISABLED);
-				} else {
-					if (sdb->flags & SGF_CURRENCY) {
-						SetDParam(0, STR_CONFIG_PATCHES_CURRENCY);
-					} else if (sdb->flags & SGF_MULTISTRING) {
-						SetDParam(0, sdb->str + value + 1);
-					} else {
-						SetDParam(0, (sdb->flags & SGF_NOCOMMA) ? STR_CONFIG_PATCHES_INT32 : STR_7024);
+					page->entries = MallocT<PatchEntry>(page->num);
+					for (i = 0; i != page->num; i++) {
+						uint index;
+						const SettingDesc *sd = GetPatchFromName(page->names[i], &index);
+						assert(sd != NULL);
+
+						page->entries[i].setting = sd;
+						page->entries[i].index = index;
 					}
-					SetDParam(1, value);
 				}
+				first_time = false;
 			}
-			DrawString(30, y, (sdb->str) + disabled, TC_FROMSTRING);
-			y += 11;
-		}
-		break;
-	}
-
-	case WE_CLICK:
-		switch (e->we.click.widget) {
-		case 3: {
-			const PatchPage *page = &_patches_page[WP(w,def_d).data_1];
-			const SettingDesc *sd;
-			void *var;
-			int32 value;
-			int x, y;
-			byte btn;
-
-			y = e->we.click.pt.y - 46 - 1;
-			if (y < 0) return;
-
-			x = e->we.click.pt.x - 5;
-			if (x < 0) return;
-
-			btn = y / 11;
-			if (y % 11 > 9) return;
-			if (btn >= page->num) return;
-
-			sd = page->entries[btn].setting;
-
-			/* return if action is only active in network, or only settable by server */
-			if (!(sd->save.conv & SLF_NETWORK_NO) && _networking && !_network_server) return;
-			if ((sd->desc.flags & SGF_NETWORK_ONLY) && !_networking) return;
-			if ((sd->desc.flags & SGF_NO_NETWORK) && _networking) return;
+			w->LowerWidget(4);
+		} break;
 
-			var = GetVariableAddress(patches_ptr, &sd->save);
-			value = (int32)ReadValue(var, sd->save.conv);
-
-			/* clicked on the icon on the left side. Either scroller or bool on/off */
-			if (x < 21) {
-				const SettingDescBase *sdb = &sd->desc;
-				int32 oldvalue = value;
-
-				switch (sdb->cmd) {
-				case SDT_BOOLX: value ^= 1; break;
-				case SDT_NUMX: {
-					/* Add a dynamic step-size to the scroller. In a maximum of
-					 * 50-steps you should be able to get from min to max,
-					 * unless specified otherwise in the 'interval' variable
-					 * of the current patch. */
-					uint32 step = (sdb->interval == 0) ? ((sdb->max - sdb->min) / 50) : sdb->interval;
-					if (step == 0) step = 1;
+		case WE_PAINT: {
+			int x, y;
+			const PatchPage *page = &_patches_page[WP(w, def_d).data_1];
+			uint i;
 
-					// don't allow too fast scrolling
-					if ((w->flags4 & WF_TIMEOUT_MASK) > 2 << WF_TIMEOUT_SHL) {
-						_left_button_clicked = false;
-						return;
-					}
+			/* Set up selected category */
+			DrawWindowWidgets(w);
 
-					/* Increase or decrease the value and clamp it to extremes */
-					if (x >= 10) {
-						value += step;
-						if (value > sdb->max) value = sdb->max;
+			x = 5;
+			y = 47;
+			for (i = 0; i != page->num; i++) {
+				const SettingDesc *sd = page->entries[i].setting;
+				const SettingDescBase *sdb = &sd->desc;
+				const void *var = GetVariableAddress(patches_ptr, &sd->save);
+				bool editable = true;
+				bool disabled = false;
+
+				// We do not allow changes of some items when we are a client in a networkgame
+				if (!(sd->save.conv & SLF_NETWORK_NO) && _networking && !_network_server) editable = false;
+				if ((sdb->flags & SGF_NETWORK_ONLY) && !_networking) editable = false;
+				if ((sdb->flags & SGF_NO_NETWORK) && _networking) editable = false;
+
+				if (sdb->cmd == SDT_BOOLX) {
+					static const int _bool_ctabs[2][2] = {{9, 4}, {7, 6}};
+					/* Draw checkbox for boolean-value either on/off */
+					bool on = (*(bool*)var);
+
+					DrawFrameRect(x, y, x + 19, y + 8, _bool_ctabs[!!on][!!editable], on ? FR_LOWERED : FR_NONE);
+					SetDParam(0, on ? STR_CONFIG_PATCHES_ON : STR_CONFIG_PATCHES_OFF);
+				} else {
+					int32 value;
+
+					value = (int32)ReadValue(var, sd->save.conv);
+
+					/* Draw [<][>] boxes for settings of an integer-type */
+					DrawArrowButtons(x, y, 3, WP(w, def_d).data_2 - (i * 2), (editable && value != sdb->min), (editable && value != sdb->max));
+
+					disabled = (value == 0) && (sdb->flags & SGF_0ISDISABLED);
+					if (disabled) {
+						SetDParam(0, STR_CONFIG_PATCHES_DISABLED);
 					} else {
-						value -= step;
-						if (value < sdb->min) value = (sdb->flags & SGF_0ISDISABLED) ? 0 : sdb->min;
+						if (sdb->flags & SGF_CURRENCY) {
+							SetDParam(0, STR_CONFIG_PATCHES_CURRENCY);
+						} else if (sdb->flags & SGF_MULTISTRING) {
+							SetDParam(0, sdb->str + value + 1);
+						} else {
+							SetDParam(0, (sdb->flags & SGF_NOCOMMA) ? STR_CONFIG_PATCHES_INT32 : STR_7024);
+						}
+						SetDParam(1, value);
 					}
+				}
+				DrawString(30, y, (sdb->str) + disabled, TC_FROMSTRING);
+				y += 11;
+			}
+		} break;
 
-					/* Set up scroller timeout for numeric values */
-					if (value != oldvalue && !(sd->desc.flags & SGF_MULTISTRING)) {
-						WP(w,def_d).data_2 = btn * 2 + 1 + ((x >= 10) ? 1 : 0);
-						w->flags4 |= 5 << WF_TIMEOUT_SHL;
-						_left_button_clicked = false;
+		case WE_CLICK:
+			switch (e->we.click.widget) {
+				case PATCHSEL_OPTIONSPANEL: {
+					const PatchPage *page = &_patches_page[WP(w, def_d).data_1];
+					const SettingDesc *sd;
+					void *var;
+					int32 value;
+					int x, y;
+					byte btn;
+
+					y = e->we.click.pt.y - 46 - 1;
+					if (y < 0) return;
+
+					x = e->we.click.pt.x - 5;
+					if (x < 0) return;
+
+					btn = y / 11;
+					if (y % 11 > 9) return;
+					if (btn >= page->num) return;
+
+					sd = page->entries[btn].setting;
+
+					/* return if action is only active in network, or only settable by server */
+					if (!(sd->save.conv & SLF_NETWORK_NO) && _networking && !_network_server) return;
+					if ((sd->desc.flags & SGF_NETWORK_ONLY) && !_networking) return;
+					if ((sd->desc.flags & SGF_NO_NETWORK) && _networking) return;
+
+					var = GetVariableAddress(patches_ptr, &sd->save);
+					value = (int32)ReadValue(var, sd->save.conv);
+
+					/* clicked on the icon on the left side. Either scroller or bool on/off */
+					if (x < 21) {
+						const SettingDescBase *sdb = &sd->desc;
+						int32 oldvalue = value;
+
+						switch (sdb->cmd) {
+						case SDT_BOOLX: value ^= 1; break;
+						case SDT_NUMX: {
+							/* Add a dynamic step-size to the scroller. In a maximum of
+							 * 50-steps you should be able to get from min to max,
+							 * unless specified otherwise in the 'interval' variable
+							 * of the current patch. */
+							uint32 step = (sdb->interval == 0) ? ((sdb->max - sdb->min) / 50) : sdb->interval;
+							if (step == 0) step = 1;
+
+							// don't allow too fast scrolling
+							if ((w->flags4 & WF_TIMEOUT_MASK) > 2 << WF_TIMEOUT_SHL) {
+								_left_button_clicked = false;
+								return;
+							}
+
+							/* Increase or decrease the value and clamp it to extremes */
+							if (x >= 10) {
+								value += step;
+								if (value > sdb->max) value = sdb->max;
+							} else {
+								value -= step;
+								if (value < sdb->min) value = (sdb->flags & SGF_0ISDISABLED) ? 0 : sdb->min;
+							}
+
+							/* Set up scroller timeout for numeric values */
+							if (value != oldvalue && !(sd->desc.flags & SGF_MULTISTRING)) {
+								WP(w, def_d).data_2 = btn * 2 + 1 + ((x >= 10) ? 1 : 0);
+								w->flags4 |= 5 << WF_TIMEOUT_SHL;
+								_left_button_clicked = false;
+							}
+						} break;
+						default: NOT_REACHED();
+						}
+
+						if (value != oldvalue) {
+							SetPatchValue(page->entries[btn].index, patches_ptr, value);
+							SetWindowDirty(w);
+						}
+					} else {
+						/* only open editbox for types that its sensible for */
+						if (sd->desc.cmd != SDT_BOOLX && !(sd->desc.flags & SGF_MULTISTRING)) {
+							/* Show the correct currency-translated value */
+							if (sd->desc.flags & SGF_CURRENCY) value *= _currency->rate;
+
+							WP(w, def_d).data_3 = btn;
+							SetDParam(0, value);
+							ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_CONFIG_PATCHES_QUERY_CAPT, 10, 100, w, CS_NUMERAL);
+						}
 					}
 				} break;
-				default: NOT_REACHED();
-				}
-
-				if (value != oldvalue) {
-					SetPatchValue(page->entries[btn].index, patches_ptr, value);
-					SetWindowDirty(w);
-				}
-			} else {
-				/* only open editbox for types that its sensible for */
-				if (sd->desc.cmd != SDT_BOOLX && !(sd->desc.flags & SGF_MULTISTRING)) {
-					/* Show the correct currency-translated value */
-					if (sd->desc.flags & SGF_CURRENCY) value *= _currency->rate;
 
-					WP(w,def_d).data_3 = btn;
-					SetDParam(0, value);
-					ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_CONFIG_PATCHES_QUERY_CAPT, 10, 100, w, CS_NUMERAL);
-				}
+				case PATCHSEL_INTERFACE: case PATCHSEL_CONSTRUCTION: case PATCHSEL_VEHICLES:
+				case PATCHSEL_STATIONS:  case PATCHSEL_ECONOMY:      case PATCHSEL_COMPETITORS:
+					w->RaiseWidget(WP(w, def_d).data_1 + PATCHSEL_INTERFACE);
+					WP(w, def_d).data_1 = e->we.click.widget - PATCHSEL_INTERFACE;
+					w->LowerWidget(WP(w, def_d).data_1 + PATCHSEL_INTERFACE);
+					DeleteWindowById(WC_QUERY_STRING, 0);
+					SetWindowDirty(w);
+					break;
 			}
+			break;
 
-			break;
-		}
-		case 4: case 5: case 6: case 7: case 8: case 9:
-			w->RaiseWidget(WP(w, def_d).data_1 + 4);
-			WP(w, def_d).data_1 = e->we.click.widget - 4;
-			w->LowerWidget(WP(w, def_d).data_1 + 4);
-			DeleteWindowById(WC_QUERY_STRING, 0);
+		case WE_TIMEOUT:
+			WP(w, def_d).data_2 = 0;
 			SetWindowDirty(w);
 			break;
-		}
-		break;
-
-	case WE_TIMEOUT:
-		WP(w,def_d).data_2 = 0;
-		SetWindowDirty(w);
-		break;
 
-	case WE_ON_EDIT_TEXT: {
-		if (e->we.edittext.str != NULL) {
-			const PatchEntry *pe = &_patches_page[WP(w,def_d).data_1].entries[WP(w,def_d).data_3];
-			const SettingDesc *sd = pe->setting;
-			int32 value = atoi(e->we.edittext.str);
-
-			/* Save the correct currency-translated value */
-			if (sd->desc.flags & SGF_CURRENCY) value /= _currency->rate;
+		case WE_ON_EDIT_TEXT:
+			if (e->we.edittext.str != NULL) {
+				const PatchEntry *pe = &_patches_page[WP(w, def_d).data_1].entries[WP(w,def_d).data_3];
+				const SettingDesc *sd = pe->setting;
+				int32 value = atoi(e->we.edittext.str);
 
-			SetPatchValue(pe->index, patches_ptr, value);
-			SetWindowDirty(w);
-		}
-		break;
-	}
+				/* Save the correct currency-translated value */
+				if (sd->desc.flags & SGF_CURRENCY) value /= _currency->rate;
 
-	case WE_DESTROY:
-		DeleteWindowById(WC_QUERY_STRING, 0);
-		break;
+				SetPatchValue(pe->index, patches_ptr, value);
+				SetWindowDirty(w);
+			}
+			break;
+
+		case WE_DESTROY:
+			DeleteWindowById(WC_QUERY_STRING, 0);
+			break;
 	}
 }
 
@@ -1044,6 +1110,17 @@
 		GfxFillRect(x + 11, y + 1, x + 11 + 8, y + 8, color);
 }
 
+/** These are not, strickly speaking, widget enums,
+ *  since they have been changed as line coordinates.
+ *  So, rather, they are more like order of appearance */
+enum CustomCurrenciesWidgets {
+	CUSTCURR_EXCHANGERATE = 0,
+	CUSTCURR_SEPARATOR,
+	CUSTCURR_PREFIX,
+	CUSTCURR_SUFFIX,
+	CUSTCURR_TO_EURO,
+};
+
 static char _str_separator[2];
 
 static void CustCurrencyWndProc(Window *w, WindowEvent *e)
@@ -1052,46 +1129,45 @@
 		case WE_PAINT: {
 			int x;
 			int y = 20;
-			int clk = WP(w,def_d).data_1;
+			int clk = WP(w, def_d).data_1;
 			DrawWindowWidgets(w);
 
-			// exchange rate
+			/* exchange rate */
 			DrawArrowButtons(10, y, 3, GB(clk, 0, 2), true, true);
 			SetDParam(0, 1);
 			SetDParam(1, 1);
 			DrawString(35, y + 1, STR_CURRENCY_EXCHANGE_RATE, TC_FROMSTRING);
 			y += 12;
 
-			// separator
+			/* separator */
 			DrawFrameRect(10, y + 1, 29, y + 9, 0, GB(clk, 2, 2) ? FR_LOWERED : FR_NONE);
 			x = DrawString(35, y + 1, STR_CURRENCY_SEPARATOR, TC_FROMSTRING);
 			DoDrawString(_str_separator, x + 4, y + 1, TC_ORANGE);
 			y += 12;
 
-			// prefix
+			/* prefix */
 			DrawFrameRect(10, y + 1, 29, y + 9, 0, GB(clk, 4, 2) ? FR_LOWERED : FR_NONE);
 			x = DrawString(35, y + 1, STR_CURRENCY_PREFIX, TC_FROMSTRING);
 			DoDrawString(_custom_currency.prefix, x + 4, y + 1, TC_ORANGE);
 			y += 12;
 
-			// suffix
+			/* suffix */
 			DrawFrameRect(10, y + 1, 29, y + 9, 0, GB(clk, 6, 2) ? FR_LOWERED : FR_NONE);
 			x = DrawString(35, y + 1, STR_CURRENCY_SUFFIX, TC_FROMSTRING);
 			DoDrawString(_custom_currency.suffix, x + 4, y + 1, TC_ORANGE);
 			y += 12;
 
-			// switch to euro
+			/* switch to euro */
 			DrawArrowButtons(10, y, 3, GB(clk, 8, 2), true, true);
 			SetDParam(0, _custom_currency.to_euro);
 			DrawString(35, y + 1, (_custom_currency.to_euro != CF_NOEURO) ? STR_CURRENCY_SWITCH_TO_EURO : STR_CURRENCY_SWITCH_TO_EURO_NEVER, TC_FROMSTRING);
 			y += 12;
 
-			// Preview
+			/* Preview */
 			y += 12;
 			SetDParam(0, 10000);
 			DrawString(35, y + 1, STR_CURRENCY_PREVIEW, TC_FROMSTRING);
-			break;
-		}
+		} break;
 
 		case WE_CLICK: {
 			int line = (e->we.click.pt.y - 20) / 12;
@@ -1101,14 +1177,14 @@
 			CharSetFilter afilter = CS_ALPHANUMERAL;
 
 			switch (line) {
-				case 0: // rate
+				case CUSTCURR_EXCHANGERATE:
 					if (IsInsideMM(x, 10, 30)) { // clicked buttons
 						if (x < 20) {
 							if (_custom_currency.rate > 1) _custom_currency.rate--;
-							WP(w,def_d).data_1 = 1 << (line * 2 + 0);
+							WP(w, def_d).data_1 = 1 << (line * 2 + 0);
 						} else {
 							if (_custom_currency.rate < 5000) _custom_currency.rate++;
-							WP(w,def_d).data_1 = 1 << (line * 2 + 1);
+							WP(w, def_d).data_1 = 1 << (line * 2 + 1);
 						}
 					} else { // enter text
 						SetDParam(0, _custom_currency.rate);
@@ -1118,40 +1194,40 @@
 					}
 					break;
 
-				case 1: // separator
+				case CUSTCURR_SEPARATOR:
 					if (IsInsideMM(x, 10, 30)) { // clicked button
-						WP(w,def_d).data_1 = 1 << (line * 2 + 1);
+						WP(w, def_d).data_1 = 1 << (line * 2 + 1);
 					}
 					str = BindCString(_str_separator);
 					len = 1;
 					break;
 
-				case 2: // prefix
+				case CUSTCURR_PREFIX:
 					if (IsInsideMM(x, 10, 30)) { // clicked button
-						WP(w,def_d).data_1 = 1 << (line * 2 + 1);
+						WP(w, def_d).data_1 = 1 << (line * 2 + 1);
 					}
 					str = BindCString(_custom_currency.prefix);
 					len = 12;
 					break;
 
-				case 3: // suffix
+				case CUSTCURR_SUFFIX:
 					if (IsInsideMM(x, 10, 30)) { // clicked button
-						WP(w,def_d).data_1 = 1 << (line * 2 + 1);
+						WP(w, def_d).data_1 = 1 << (line * 2 + 1);
 					}
 					str = BindCString(_custom_currency.suffix);
 					len = 12;
 					break;
 
-				case 4: // to euro
+				case CUSTCURR_TO_EURO:
 					if (IsInsideMM(x, 10, 30)) { // clicked buttons
 						if (x < 20) {
 							_custom_currency.to_euro = (_custom_currency.to_euro <= 2000) ?
 								CF_NOEURO : _custom_currency.to_euro - 1;
-							WP(w,def_d).data_1 = 1 << (line * 2 + 0);
+							WP(w, def_d).data_1 = 1 << (line * 2 + 0);
 						} else {
 							_custom_currency.to_euro =
 								Clamp(_custom_currency.to_euro + 1, 2000, MAX_YEAR);
-							WP(w,def_d).data_1 = 1 << (line * 2 + 1);
+							WP(w, def_d).data_1 = 1 << (line * 2 + 1);
 						}
 					} else { // enter text
 						SetDParam(0, _custom_currency.to_euro);
@@ -1169,44 +1245,41 @@
 
 			w->flags4 |= 5 << WF_TIMEOUT_SHL;
 			SetWindowDirty(w);
-			break;
-		}
+		} break;
 
 		case WE_ON_EDIT_TEXT: {
-				const char *b = e->we.edittext.str;
-
-				switch (WP(w,def_d).data_2) {
-					case 0: /* Exchange rate */
-						_custom_currency.rate = Clamp(atoi(b), 1, 5000);
-						break;
-
-					case 1: /* Thousands seperator */
-						_custom_currency.separator = (b[0] == '\0') ? ' ' : b[0];
-						ttd_strlcpy(_str_separator, b, lengthof(_str_separator));
-						break;
+			const char *b = e->we.edittext.str;
 
-					case 2: /* Currency prefix */
-						ttd_strlcpy(_custom_currency.prefix, b, lengthof(_custom_currency.prefix));
-						break;
-
-					case 3: /* Currency suffix */
-						ttd_strlcpy(_custom_currency.suffix, b, lengthof(_custom_currency.suffix));
-						break;
+			switch (WP(w, def_d).data_2) {
+				case CUSTCURR_EXCHANGERATE:
+					_custom_currency.rate = Clamp(atoi(b), 1, 5000);
+					break;
 
-					case 4: { /* Year to switch to euro */
-						int val = atoi(b);
+				case CUSTCURR_SEPARATOR: /* Thousands seperator */
+					_custom_currency.separator = (b[0] == '\0') ? ' ' : b[0];
+					ttd_strlcpy(_str_separator, b, lengthof(_str_separator));
+					break;
 
-						_custom_currency.to_euro =
-							(val < 2000 ? CF_NOEURO : min(val, MAX_YEAR));
-						break;
-					}
+				case CUSTCURR_PREFIX:
+					ttd_strlcpy(_custom_currency.prefix, b, lengthof(_custom_currency.prefix));
+					break;
+
+				case CUSTCURR_SUFFIX:
+					ttd_strlcpy(_custom_currency.suffix, b, lengthof(_custom_currency.suffix));
+					break;
+
+				case CUSTCURR_TO_EURO: { /* Year to switch to euro */
+					int val = atoi(b);
+
+					_custom_currency.to_euro = (val < 2000 ? CF_NOEURO : min(val, MAX_YEAR));
+					break;
 				}
+			}
 			MarkWholeScreenDirty();
-			break;
-		}
+		} break;
 
 		case WE_TIMEOUT:
-			WP(w,def_d).data_1 = 0;
+			WP(w, def_d).data_1 = 0;
 			SetWindowDirty(w);
 			break;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/settings_internal.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,89 @@
+/* $Id$ */
+
+/** @file settings_internal.h Functions and types used internally for the settings configurations. */
+
+#ifndef SETTINGS_INTERNAL_H
+#define SETTINGS_INTERNAL_H
+
+#include "saveload.h"
+#include "settings_type.h"
+
+/** Convention/Type of settings. This is then further specified if necessary
+ * with the SLE_ (SLE_VAR/SLE_FILE) enums in saveload.h
+ * @see VarTypes
+ * @see SettingDescBase */
+enum SettingDescTypeLong {
+	/* 4 bytes allocated a maximum of 16 types for GenericType */
+	SDT_BEGIN       = 0,
+	SDT_NUMX        = 0, ///< any number-type
+	SDT_BOOLX       = 1, ///< a boolean number
+	SDT_ONEOFMANY   = 2, ///< bitmasked number where only ONE bit may be set
+	SDT_MANYOFMANY  = 3, ///< bitmasked number where MULTIPLE bits may be set
+	SDT_INTLIST     = 4, ///< list of integers seperated by a comma ','
+	SDT_STRING      = 5, ///< string with a pre-allocated buffer
+	SDT_END,
+	/* 10 more possible primitives */
+};
+
+template <> struct EnumPropsT<SettingDescTypeLong> : MakeEnumPropsT<SettingDescTypeLong, byte, SDT_BEGIN, SDT_END, SDT_END> {};
+typedef TinyEnumT<SettingDescTypeLong> SettingDescType;
+
+
+enum SettingGuiFlagLong {
+	/* 8 bytes allocated for a maximum of 8 flags
+	 * Flags directing saving/loading of a variable */
+	SGF_NONE = 0,
+	SGF_0ISDISABLED  = 1 << 0, ///< a value of zero means the feature is disabled
+	SGF_NOCOMMA      = 1 << 1, ///< number without any thousand seperators (no formatting)
+	SGF_MULTISTRING  = 1 << 2, ///< the value represents a limited number of string-options (internally integer)
+	SGF_NETWORK_ONLY = 1 << 3, ///< this setting only applies to network games
+	SGF_CURRENCY     = 1 << 4, ///< the number represents money, so when reading value multiply by exchange rate
+	SGF_NO_NETWORK   = 1 << 5, ///< this setting does not apply to network games; it may not be changed during the game
+	SGF_END          = 1 << 6,
+	/* 3 more possible flags */
+};
+
+DECLARE_ENUM_AS_BIT_SET(SettingGuiFlagLong);
+template <> struct EnumPropsT<SettingGuiFlagLong> : MakeEnumPropsT<SettingGuiFlagLong, byte, SGF_NONE, SGF_END, SGF_END> {};
+typedef TinyEnumT<SettingGuiFlagLong> SettingGuiFlag;
+
+
+typedef int32 OnChange(int32 var);          ///< callback prototype on data modification
+typedef int32 OnConvert(const char *value); ///< callback prototype for convertion error
+
+struct SettingDescBase {
+	const char *name;       ///< name of the setting. Used in configuration file and for console
+	const void *def;        ///< default value given when none is present
+	SettingDescType cmd;    ///< various flags for the variable
+	SettingGuiFlag flags;   ///< handles how a setting would show up in the GUI (text/currency, etc.)
+	int32 min, max;         ///< minimum and maximum values
+	int32 interval;         ///< the interval to use between settings in the 'patches' window. If interval is '0' the interval is dynamically determined
+	const char *many;       ///< ONE/MANY_OF_MANY: string of possible values for this type
+	StringID str;           ///< (translated) string with descriptive text; gui and console
+	OnChange *proc;         ///< callback procedure for when the value is changed
+	OnConvert *proc_cnvt;   ///< callback procedure when loading value mechanism fails
+};
+
+struct SettingDesc {
+	SettingDescBase desc;   ///< Settings structure (going to configuration file)
+	SaveLoad save;          ///< Internal structure (going to savegame, parts to config)
+};
+
+/* NOTE: The only difference between SettingDesc and SettingDescGlob is
+ * that one uses global variables as a source and the other offsets
+ * in a struct which are bound to a certain variable during runtime.
+ * The only way to differentiate between these two is to check if an object
+ * has been passed to the function or not. If not, then it is a global variable
+ * and save->variable has its address, otherwise save->variable only holds the
+ * offset in a certain struct */
+typedef SettingDesc SettingDescGlobVarList;
+
+enum IniGroupType {
+	IGT_VARIABLES = 0, ///< values of the form "landscape = hilly"
+	IGT_LIST      = 1, ///< a list of values, seperated by \n and terminated by the next group block
+};
+
+const SettingDesc *GetPatchFromName(const char *name, uint *i);
+bool SetPatchValue(uint index, const Patches *object, int32 value);
+
+#endif /* SETTINGS_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/settings_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,236 @@
+/* $Id$ */
+
+/** @file settings_type.h Types related to global configuration settings. */
+
+#ifndef SETTINGS_TYPE_H
+#define SETTINGS_TYPE_H
+
+#include "yapf/yapf_settings.h"
+#include "date_type.h"
+#include "town_type.h"
+
+#define GAME_DIFFICULTY_NUM 18
+
+/** Specific type for Game Difficulty to ease changing the type */
+typedef uint16 GDType;
+struct GameDifficulty {
+	GDType max_no_competitors;
+	GDType competitor_start_time;
+	GDType number_towns;
+	GDType number_industries;
+	GDType max_loan;
+	GDType initial_interest;
+	GDType vehicle_costs;
+	GDType competitor_speed;
+	GDType competitor_intelligence; // no longer in use
+	GDType vehicle_breakdowns;
+	GDType subsidy_multiplier;
+	GDType construction_cost;
+	GDType terrain_type;
+	GDType quantity_sea_lakes;
+	GDType economy;
+	GDType line_reverse_mode;
+	GDType disasters;
+	GDType town_council_tolerance; // minimum required town ratings to be allowed to demolish stuff
+};
+
+struct GameOptions {
+	GameDifficulty diff;
+	byte diff_level;
+	byte currency;
+	byte units;
+	byte town_name;
+	byte landscape;
+	byte snow_line;
+	byte autosave;
+	byte road_side;
+};
+
+/* These are the options for the current game
+ * either ingame, or loaded. Also used for networking games */
+extern GameOptions _opt;
+
+/* These are the default options for a new game */
+extern GameOptions _opt_newgame;
+
+/* Pointer to one of the two _opt OR _opt_newgame structs */
+extern GameOptions *_opt_ptr;
+
+struct Patches {
+	bool modified_catchment;            // different-size catchment areas
+	bool vehicle_speed;                 // show vehicle speed
+	bool build_on_slopes;               // allow building on slopes
+	bool mammoth_trains;                // allow very long trains
+	bool join_stations;                 // allow joining of train stations
+	bool full_load_any;                 // new full load calculation, any cargo must be full
+	bool improved_load;                 // improved loading algorithm
+	bool gradual_loading;               // load vehicles gradually
+	byte station_spread;                // amount a station may spread
+	bool inflation;                     // disable inflation
+	bool selectgoods;                   // only send the goods to station if a train has been there
+	bool longbridges;                   // allow 100 tile long bridges
+	bool gotodepot;                     // allow goto depot in orders
+	uint8 raw_industry_construction;    ///< Type of (raw) industry construction (none, "normal", prospecting)
+	bool multiple_industry_per_town;    // allow many industries of the same type per town
+	bool same_industry_close;           // allow same type industries to be built close to each other
+	bool lost_train_warn;               // if a train can't find its destination, show a warning
+	uint8 order_review_system;
+	bool train_income_warn;             // if train is generating little income, show a warning
+	bool status_long_date;              // always show long date in status bar
+	bool signal_side;                   // show signals on right side
+	bool show_finances;                 // show finances at end of year
+	bool new_nonstop;                   // ttdpatch compatible nonstop handling
+	bool roadveh_queue;                 // buggy road vehicle queueing
+	bool autoscroll;                    // scroll when moving mouse to the edge.
+	byte errmsg_duration;               // duration of error message
+	byte land_generator;                // the landscape generator
+	byte oil_refinery_limit;            // distance oil refineries allowed from map edge
+	byte snow_line_height;              // a number 0-15 that configured snow line height
+	byte tgen_smoothness;               // how rough is the terrain from 0-3
+	uint32 generation_seed;             // noise seed for world generation
+	byte tree_placer;                   // the tree placer algorithm
+	byte heightmap_rotation;            // rotation director for the heightmap
+	byte se_flat_world_height;          // land height a flat world gets in SE
+	bool bribe;                         // enable bribing the local authority
+	bool nonuniform_stations;           // allow nonuniform train stations
+	bool adjacent_stations;             // allow stations to be built directly adjacent to other stations
+	bool always_small_airport;          // always allow small airports
+	bool realistic_acceleration;        // realistic acceleration for trains
+	bool wagon_speed_limits;            // enable wagon speed limits
+	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
+	bool reverse_scroll;                // Right-Click-Scrolling scrolls in the opposite direction
+	bool smooth_scroll;                 ///< Smooth scroll viewports
+	bool disable_elrails;               // when true, the elrails are disabled
+	bool measure_tooltip;               // Show a permanent tooltip when dragging tools
+	byte liveries;                      // Options for displaying company liveries, 0=none, 1=self, 2=all
+	bool prefer_teamchat;               // Choose the chat message target with <ENTER>, true=all players, false=your team
+	uint8 advanced_vehicle_list;        // Use the "advanced" vehicle list
+	uint8 loading_indicators;           // Show loading indicators
+	uint8 default_rail_type;            ///< The default rail type for the rail GUI
+
+	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
+
+	bool always_build_infrastructure;   ///< Always allow building of infrastructure, even when you do not have the vehicles for it
+	UnitID max_trains;                  // max trains in game per player (these are 16bit because the unitnumber field can't hold more)
+	UnitID max_roadveh;                 // max trucks in game per player
+	UnitID max_aircraft;                // max planes in game per player
+	UnitID max_ships;                   // max ships in game per player
+
+	bool servint_ispercent;             // service intervals are in percents
+	uint16 servint_trains;              // service interval for trains
+	uint16 servint_roadveh;             // service interval for road vehicles
+	uint16 servint_aircraft;            // service interval for aircraft
+	uint16 servint_ships;               // service interval for ships
+
+	bool autorenew;
+	int16 autorenew_months;
+	int32 autorenew_money;
+
+	byte pf_maxdepth;                   // maximum recursion depth when searching for a train route for new pathfinder
+	uint16 pf_maxlength;                // maximum length when searching for a train route for new pathfinder
+
+	bool bridge_pillars;                // show bridge pillars for high bridges
+
+	bool ai_disable_veh_train;          // disable types for AI
+	bool ai_disable_veh_roadveh;        // disable types for AI
+	bool ai_disable_veh_aircraft;       // disable types for AI
+	bool ai_disable_veh_ship;           // disable types for AI
+	Year starting_year;                 // starting date
+	Year ending_year;                   // end of the game (just show highscore)
+	Year colored_news_year;             // when does newspaper become colored?
+
+	bool keep_all_autosave;             // name the autosave in a different way.
+	bool autosave_on_exit;              // save an autosave when you quit the game, but do not ask "Do you really want to quit?"
+	byte max_num_autosaves;             // controls how many autosavegames are made before the game starts to overwrite (names them 0 to max_num_autosaves - 1)
+	bool extra_dynamite;                // extra dynamite
+	bool road_stop_on_town_road;        // allow building of drive-through road stops on town owned roads
+
+	bool never_expire_vehicles;         // never expire vehicles
+	byte extend_vehicle_life;           // extend vehicle life by this many years
+
+	bool auto_euro;                     // automatically switch to euro in 2002
+	bool serviceathelipad;              // service helicopters at helipads automatically (no need to send to depot)
+	bool smooth_economy;                // smooth economy
+	bool allow_shares;                  // allow the buying/selling of shares
+	byte dist_local_authority;          // distance for town local authority, default 20
+
+	byte wait_oneway_signal;            // waitingtime in days before a oneway signal
+	byte wait_twoway_signal;            // waitingtime in days before a twoway signal
+
+	uint8 map_x;                        // Size of map
+	uint8 map_y;
+
+	byte drag_signals_density;          // many signals density
+	Year semaphore_build_before;        // Build semaphore signals automatically before this year
+	bool ainew_active;                  // Is the new AI active?
+	bool ai_in_multiplayer;             // Do we allow AIs in multiplayer
+
+	/*
+	 * New Path Finding
+	 */
+	bool new_pathfinding_all; /* Use the newest pathfinding algorithm for all */
+
+	/**
+	 * The maximum amount of search nodes a single NPF run should take. This
+	 * limit should make sure performance stays at acceptable levels at the cost
+	 * of not being perfect anymore. This will probably be fixed in a more
+	 * sophisticated way sometime soon
+	 */
+	uint32 npf_max_search_nodes;
+
+	uint32 npf_rail_firstred_penalty;      // The penalty for when the first signal is red (and it is not an exit or combo signal)
+	uint32 npf_rail_firstred_exit_penalty; // The penalty for when the first signal is red (and it is an exit or combo signal)
+	uint32 npf_rail_lastred_penalty;       // The penalty for when the last signal is red
+	uint32 npf_rail_station_penalty;       // The penalty for station tiles
+	uint32 npf_rail_slope_penalty;         // The penalty for sloping upwards
+	uint32 npf_rail_curve_penalty;         // The penalty for curves
+	uint32 npf_rail_depot_reverse_penalty; // The penalty for reversing in depots
+	uint32 npf_buoy_penalty;               // The penalty for going over (through) a buoy
+	uint32 npf_water_curve_penalty;        // The penalty for curves
+	uint32 npf_road_curve_penalty;         // The penalty for curves
+	uint32 npf_crossing_penalty;           // The penalty for level crossings
+	uint32 npf_road_drive_through_penalty; // The penalty for going through a drive-through road stop
+
+	bool population_in_label; // Show the population of a town in his label?
+
+	uint8 freight_trains; // Value to multiply the weight of cargo by
+
+	/** YAPF settings */
+	YapfSettings  yapf;
+
+	uint8 right_mouse_btn_emulation;
+
+	uint8 scrollwheel_scrolling;
+	uint8 scrollwheel_multiplier;
+
+	uint8 town_growth_rate;  ///< Town growth rate
+	uint8 larger_towns;      ///< The number of cities to build. These start off larger and grow twice as fast
+	uint8 initial_city_size; ///< Multiplier for the initial size of the cities compared to towns
+
+	bool pause_on_newgame;   ///< Whether to start new games paused or not.
+
+	TownLayoutByte town_layout;  ///< Select town layout
+
+	bool timetabling;        ///< Whether to allow timetabling.
+	bool timetable_in_ticks; ///< Whether to show the timetable in ticks rather than days.
+
+	bool autoslope;          ///< Allow terraforming under things.
+
+	bool mod_road_rebuild;   ///< Roadworks remove unneccesary RoadBits
+
+	bool exclusive_rights;   ///< allow buying exclusive rights
+	bool give_money;         ///< allow giving other players money
+
+	bool enable_signal_gui;  ///< Show the signal GUI when the signal button is pressed
+};
+
+extern Patches _patches;
+
+/** The patch values that are used for new games and/or modified in config file */
+extern Patches _patches_newgame;
+
+#endif /* SETTINGS_TYPE_H */
--- a/src/ship.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/ship.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,9 +5,9 @@
 #ifndef SHIP_H
 #define SHIP_H
 
-#include "vehicle.h"
+#include "vehicle_base.h"
 #include "engine.h"
-#include "variables.h"
+#include "economy_func.h"
 
 void CcBuildShip(bool success, TileIndex tile, uint32 p1, uint32 p2);
 void RecalcShipStuff(Vehicle *v);
--- a/src/ship_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/ship_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,22 +5,17 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "ship.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "functions.h"
+#include "tile_cmd.h"
 #include "landscape.h"
-#include "map.h"
-#include "tile.h"
-#include "vehicle.h"
 #include "timetable.h"
-#include "command.h"
+#include "command_func.h"
 #include "pathfind.h"
 #include "station_map.h"
 #include "station.h"
 #include "news.h"
 #include "engine.h"
-#include "player.h"
-#include "sound.h"
+#include "player_func.h"
+#include "player_base.h"
 #include "npf.h"
 #include "depot.h"
 #include "vehicle_gui.h"
@@ -31,9 +26,20 @@
 #include "newgrf_callbacks.h"
 #include "newgrf_text.h"
 #include "newgrf_sound.h"
-#include "date.h"
 #include "spritecache.h"
 #include "misc/autoptr.hpp"
+#include "strings_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "variables.h"
+#include "autoreplace_gui.h"
+#include "gfx_func.h"
+#include "settings_type.h"
+
+#include "table/strings.h"
 
 static const uint16 _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D};
 
@@ -61,7 +67,7 @@
 			DrawSprite(sprite, pal, x, y);
 			return;
 		}
-		spritenum = orig_ship_vehicle_info[engine - SHIP_ENGINES_INDEX].image_index;
+		spritenum = _orig_ship_vehicle_info[engine - SHIP_ENGINES_INDEX].image_index;
 	}
 	DrawSprite(6 + _ship_sprites[spritenum], pal, x, y);
 }
@@ -78,7 +84,7 @@
 
 	if (is_custom_sprite(spritenum)) {
 		custom_sprite = GetCustomVehicleIcon(engine, DIR_W);
-		spritenum = orig_ship_vehicle_info[engine - SHIP_ENGINES_INDEX].image_index;
+		spritenum = _orig_ship_vehicle_info[engine - SHIP_ENGINES_INDEX].image_index;
 	}
 	if (custom_sprite == 0) {
 		spritenum = 6 + _ship_sprites[spritenum];
@@ -100,7 +106,7 @@
 		int sprite = GetCustomVehicleSprite(this, direction);
 
 		if (sprite != 0) return sprite;
-		spritenum = orig_ship_vehicle_info[this->engine_type - SHIP_ENGINES_INDEX].image_index;
+		spritenum = _orig_ship_vehicle_info[this->engine_type - SHIP_ENGINES_INDEX].image_index;
 	}
 	return _ship_sprites[spritenum] + direction;
 }
@@ -117,7 +123,7 @@
 	if (_patches.new_pathfinding_all) {
 		NPFFoundTargetData ftd;
 		Trackdir trackdir = GetVehicleTrackdir(v);
-		ftd = NPFRouteToDepotTrialError(v->tile, trackdir, TRANSPORT_WATER, 0, v->owner, INVALID_RAILTYPE);
+		ftd = NPFRouteToDepotTrialError(v->tile, trackdir, TRANSPORT_WATER, 0, v->owner, INVALID_RAILTYPES);
 		if (ftd.best_bird_dist == 0) {
 			best_depot = GetDepotByTile(ftd.node.tile); /* Found target */
 		} else {
@@ -152,21 +158,21 @@
 		if (v->current_order.type == OT_GOTO_DEPOT) {
 			v->current_order.type = OT_DUMMY;
 			v->current_order.flags = 0;
-			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		}
 		return;
 	}
 
 	v->current_order.type = OT_GOTO_DEPOT;
-	v->current_order.flags = OF_NON_STOP;
+	v->current_order.flags = OFB_NON_STOP;
 	v->current_order.dest = depot->index;
 	v->dest_tile = depot->xy;
-	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 }
 
 void OnNewDay_Ship(Vehicle *v)
 {
-	CommandCost cost;
+	CommandCost cost(EXPENSES_SHIP_RUN);
 
 	if ((++v->day_counter & 7) == 0)
 		DecreaseVehicleValue(v);
@@ -182,8 +188,7 @@
 	cost.AddCost(GetVehicleProperty(v, 0x0F, ShipVehInfo(v->engine_type)->running_cost) * _price.ship_running / 364);
 	v->profit_this_year -= cost.GetCost() >> 8;
 
-	SET_EXPENSES_TYPE(EXPENSES_SHIP_RUN);
-	SubtractMoneyFromPlayerFract(v->owner, CommandCost(cost));
+	SubtractMoneyFromPlayerFract(v->owner, cost);
 
 	InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
 	/* we need this for the profit */
@@ -224,7 +229,7 @@
 void Ship::MarkDirty()
 {
 	this->cur_image = this->GetImage(this->direction);
-	MarkAllViewportsDirty(this->left_coord, this->top_coord, this->right_coord + 1, this->bottom_coord + 1);
+	MarkSingleVehicleDirty(this);
 }
 
 static void PlayShipSound(const Vehicle *v)
@@ -245,8 +250,8 @@
 
 	switch (v->current_order.type) {
 		case OT_GOTO_DEPOT:
-			if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return;
-			if (v->current_order.flags & OF_SERVICE_IF_NEEDED &&
+			if (!(v->current_order.flags & OFB_PART_OF_ORDERS)) return;
+			if (v->current_order.flags & OFB_SERVICE_IF_NEEDED &&
 					!VehicleNeedsService(v)) {
 				UpdateVehicleTimetable(v, true);
 				v->cur_order_index++;
@@ -381,7 +386,7 @@
 	if (spd != v->cur_speed) {
 		v->cur_speed = spd;
 		if (_patches.vehicle_speed)
-			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 	}
 
 	/* Decrease somewhat when turning */
@@ -397,7 +402,7 @@
 
 static CommandCost EstimateShipCost(EngineID engine_type)
 {
-	return CommandCost(GetEngineProperty(engine_type, 0x0A, ShipVehInfo(engine_type)->base_cost) * (_price.ship_base >> 3) >> 5);
+	return CommandCost(EXPENSES_NEW_VEHICLES, GetEngineProperty(engine_type, 0x0A, ShipVehInfo(engine_type)->base_cost) * (_price.ship_base >> 3) >> 5);
 }
 
 static void ShipArrivesAt(const Vehicle* v, Station* st)
@@ -505,7 +510,7 @@
 	return best_bird_dist;
 }
 
-static inline NPFFoundTargetData PerfNPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailTypeMask railtypes)
+static inline NPFFoundTargetData PerfNPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailTypes railtypes)
 {
 
 	void* perf = NpfBeginInterval();
@@ -534,7 +539,7 @@
 
 		NPFFillWithOrderData(&fstd, v);
 
-		ftd = PerfNPFRouteToStationOrTile(src_tile, trackdir, &fstd, TRANSPORT_WATER, v->owner, INVALID_RAILTYPE);
+		ftd = PerfNPFRouteToStationOrTile(src_tile, trackdir, &fstd, TRANSPORT_WATER, v->owner, INVALID_RAILTYPES);
 
 		if (ftd.best_trackdir != 0xff) {
 			/* If ftd.best_bird_dist is 0, we found our target and ftd.best_trackdir contains
@@ -678,7 +683,7 @@
 			 * always skip ahead. */
 			if (v->current_order.type == OT_LEAVESTATION) {
 				v->current_order.Free();
-				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 			} else if (v->dest_tile != 0) {
 				/* We have a target, let's see if we reached it... */
 				if (v->current_order.type == OT_GOTO_STATION &&
@@ -806,14 +811,11 @@
 CommandCost CmdBuildShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	CommandCost value;
-	Vehicle *v;
 	UnitID unit_num;
 	Engine *e;
 
 	if (!IsEngineBuildable(p1, VEH_SHIP, _current_player)) return_cmd_error(STR_SHIP_NOT_AVAILABLE);
 
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
-
 	value = EstimateShipCost(p1);
 	if (flags & DC_QUERY_COST) return value;
 
@@ -822,11 +824,9 @@
 	if (!IsTileDepotType(tile, TRANSPORT_WATER)) return CMD_ERROR;
 	if (!IsTileOwner(tile, _current_player)) return CMD_ERROR;
 
-	v = new Ship();
 	unit_num = HasBit(p2, 0) ? 0 : GetFreeUnitNumber(VEH_SHIP);
-	AutoPtrT<Vehicle> v_auto_delete = v;
 
-	if (v == NULL || unit_num > _patches.max_ships)
+	if (!Vehicle::AllocateList(NULL, 1) || unit_num > _patches.max_ships)
 		return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
 
 	if (flags & DC_EXEC) {
@@ -835,7 +835,7 @@
 
 		const ShipVehicleInfo *svi = ShipVehInfo(p1);
 
-		v = new (v) Ship();
+		Vehicle *v = new Ship();
 		v->unitnumber = unit_num;
 
 		v->owner = _current_player;
@@ -865,7 +865,7 @@
 		v->max_age = e->lifelength * 366;
 		_new_vehicle_id = v->index;
 
-		v->string_id = STR_SV_SHIP_NAME;
+		v->name = NULL;
 		v->u.ship.state = TRACK_BIT_DEPOT;
 
 		v->service_interval = _patches.servint_ships;
@@ -888,8 +888,6 @@
 			InvalidateAutoreplaceWindow(v->engine_type, v->group_id); // updates the replace Ship window
 
 		GetPlayer(_current_player)->num_engines[p1]++;
-
-		v_auto_delete.Detach();
 	}
 
 	return value;
@@ -913,13 +911,11 @@
 
 	if (HASBITS(v->vehstatus, VS_CRASHED)) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE);
 
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
-
 	if (!v->IsStoppedInDepot()) {
 		return_cmd_error(STR_980B_SHIP_MUST_BE_STOPPED_IN);
 	}
 
-	CommandCost ret(-v->value);
+	CommandCost ret(EXPENSES_NEW_VEHICLES, -v->value);
 
 	if (flags & DC_EXEC) {
 		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
@@ -965,7 +961,7 @@
 
 		v->vehstatus ^= VS_STOPPED;
 		v->cur_speed = 0;
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 		InvalidateWindowClasses(WC_SHIPS_LIST);
 	}
@@ -1004,14 +1000,14 @@
 
 	/* If the current orders are already goto-depot */
 	if (v->current_order.type == OT_GOTO_DEPOT) {
-		if (!!(p2 & DEPOT_SERVICE) == HasBit(v->current_order.flags, OFB_HALT_IN_DEPOT)) {
+		if (!!(p2 & DEPOT_SERVICE) == HasBit(v->current_order.flags, OF_HALT_IN_DEPOT)) {
 			/* We called with a different DEPOT_SERVICE setting.
 			 * Now we change the setting to apply the new one and let the vehicle head for the same depot.
 			 * Note: the if is (true for requesting service == true for ordered to stop in depot)          */
 			if (flags & DC_EXEC) {
-				ClrBit(v->current_order.flags, OFB_PART_OF_ORDERS);
-				ToggleBit(v->current_order.flags, OFB_HALT_IN_DEPOT);
-				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+				ClrBit(v->current_order.flags, OF_PART_OF_ORDERS);
+				ToggleBit(v->current_order.flags, OF_HALT_IN_DEPOT);
+				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 			}
 			return CommandCost();
 		}
@@ -1020,12 +1016,12 @@
 		if (flags & DC_EXEC) {
 			/* If the orders to 'goto depot' are in the orders list (forced servicing),
 			 * then skip to the next order; effectively cancelling this forced service */
-			if (HasBit(v->current_order.flags, OFB_PART_OF_ORDERS))
+			if (HasBit(v->current_order.flags, OF_PART_OF_ORDERS))
 				v->cur_order_index++;
 
 			v->current_order.type = OT_DUMMY;
 			v->current_order.flags = 0;
-			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		}
 		return CommandCost();
 	}
@@ -1038,11 +1034,11 @@
 
 		v->dest_tile = dep->xy;
 		v->current_order.type = OT_GOTO_DEPOT;
-		v->current_order.flags = OF_NON_STOP;
-		if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OFB_HALT_IN_DEPOT);
+		v->current_order.flags = OFB_NON_STOP;
+		if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OF_HALT_IN_DEPOT);
 		v->current_order.refit_cargo = CT_INVALID;
 		v->current_order.dest = dep->index;
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 	}
 
 	return CommandCost();
@@ -1062,7 +1058,7 @@
 CommandCost CmdRefitShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	Vehicle *v;
-	CommandCost cost;
+	CommandCost cost(EXPENSES_SHIP_RUN);
 	CargoID new_cid = GB(p2, 0, 8); //gets the cargo number
 	byte new_subtype = GB(p2, 8, 8);
 	uint16 capacity = CALLBACK_FAILED;
@@ -1072,17 +1068,13 @@
 	v = GetVehicle(p1);
 
 	if (v->type != VEH_SHIP || !CheckOwnership(v->owner)) return CMD_ERROR;
-
-	if (!v->IsStoppedInDepot()) {
-		return_cmd_error(STR_980B_SHIP_MUST_BE_STOPPED_IN);
-	}
+	if (!v->IsStoppedInDepot()) return_cmd_error(STR_980B_SHIP_MUST_BE_STOPPED_IN);
+	if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_CAN_T_REFIT_DESTROYED_VEHICLE);
 
 	/* Check cargo */
 	if (!ShipVehInfo(v->engine_type)->refittable) return CMD_ERROR;
 	if (new_cid >= NUM_CARGO || !CanRefitTo(v->engine_type, new_cid)) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_SHIP_RUN);
-
 	/* Check the refit capacity callback */
 	if (HasBit(EngInfo(v->engine_type)->callbackmask, CBM_VEHICLE_REFIT_CAPACITY)) {
 		/* Back up the existing cargo type */
--- a/src/ship_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/ship_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,18 +5,19 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
 #include "ship.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "table/sprites.h"
 #include "gui.h"
-#include "vehicle.h"
-#include "viewport.h"
-#include "command.h"
+#include "window_gui.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
 #include "depot.h"
 #include "vehicle_gui.h"
 #include "newgrf_engine.h"
+#include "strings_func.h"
+#include "vehicle_func.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
 
 void DrawShipImage(const Vehicle *v, int x, int y, VehicleID selection)
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/signal.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,656 @@
+/* $Id$ */
+
+/** @file signal.cpp functions related to rail signals updating */
+
+#include "stdafx.h"
+#include "openttd.h"
+#include "debug.h"
+#include "tile_cmd.h"
+#include "rail_map.h"
+#include "road_map.h"
+#include "station_map.h"
+#include "tunnelbridge_map.h"
+#include "vehicle_func.h"
+#include "train.h"
+#include "newgrf_station.h"
+#include "functions.h"
+#include "track_type.h"
+#include "track_func.h"
+#include "signal_func.h"
+#include "player_func.h"
+
+
+/** these are the maximums used for updating signal blocks */
+enum {
+	SIG_TBU_SIZE    =  64, ///< number of signals entering to block
+	SIG_TBD_SIZE    = 256, ///< number of intersections - open nodes in current block
+	SIG_GLOB_SIZE   = 128, ///< number of open blocks (block can be opened more times until detected)
+	SIG_GLOB_UPDATE =  64, ///< how many items need to be in _globset to force update
+};
+
+/* need to typecast to compile with MorphOS */
+assert_compile((int)SIG_GLOB_UPDATE <= (int)SIG_GLOB_SIZE);
+
+/** incidating trackbits with given enterdir */
+static const TrackBitsByte _enterdir_to_trackbits[DIAGDIR_END] = {
+	{TRACK_BIT_3WAY_NE},
+	{TRACK_BIT_3WAY_SE},
+	{TRACK_BIT_3WAY_SW},
+	{TRACK_BIT_3WAY_NW}
+};
+
+/** incidating trackdirbits with given enterdir */
+static const TrackdirBitsShort _enterdir_to_trackdirbits[DIAGDIR_END] = {
+	{TRACKDIR_BIT_X_SW | TRACKDIR_BIT_UPPER_W | TRACKDIR_BIT_RIGHT_S},
+	{TRACKDIR_BIT_Y_NW | TRACKDIR_BIT_LOWER_W | TRACKDIR_BIT_RIGHT_N},
+	{TRACKDIR_BIT_X_NE | TRACKDIR_BIT_LOWER_E | TRACKDIR_BIT_LEFT_N},
+	{TRACKDIR_BIT_Y_SE | TRACKDIR_BIT_UPPER_E | TRACKDIR_BIT_LEFT_S}
+};
+
+/**
+ * Set containing 'items' items of 'tile and Tdir'
+ * No tree structure is used because it would cause
+ * slowdowns in most usual cases
+ */
+template <typename Tdir, uint items>
+struct SmallSet {
+private:
+	uint n;           // actual number of units
+	bool overflowed;  // did we try to oveflow the set?
+	const char *name; // name, used for debugging purposes...
+
+	/** Element of set */
+	struct SSdata {
+		TileIndex tile;
+		Tdir dir;
+	} data[items];
+
+public:
+	/** Constructor - just set default values and 'name' */
+	SmallSet(const char *name) : n(0), overflowed(false), name(name) { }
+
+	/** Reset variables to default values */
+	void Reset()
+	{
+		this->n = 0;
+		this->overflowed = false;
+	}
+
+	/**
+	 * Returns value of 'oveflowed'
+	 * @return did we try to overflow the set?
+	 */
+	bool Overflowed()
+	{
+		return this->overflowed;
+	}
+
+	/**
+	 * Checks for empty set
+	 * @return is the set empty?
+	 */
+	bool IsEmpty()
+	{
+		return this->n == 0;
+	}
+
+	/**
+	 * Checks for full set
+	 * @return is the set full?
+	 */
+	bool IsFull()
+	{
+		return this->n == lengthof(data);
+	}
+
+	/**
+	 * Reads the number of items
+	 * @return current number of items
+	 */
+	uint Items()
+	{
+		return this->n;
+	}
+
+
+	/**
+	 * Tries to remove first instance of given tile and dir
+	 * @param tile tile
+	 * @param dir and dir to remove
+	 * @return element was found and removed
+	 */
+	bool Remove(TileIndex tile, Tdir dir)
+	{
+		for (uint i = 0; i < this->n; i++) {
+			if (this->data[i].tile == tile && this->data[i].dir == dir) {
+				this->data[i] = this->data[--this->n];
+				return true;
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * Tries to find given tile and dir in the set
+	 * @param tile tile
+	 * @param dir and dir to find
+	 * @return true iff the tile & dir elemnt was found
+	 */
+	bool IsIn(TileIndex tile, Tdir dir)
+	{
+		for (uint i = 0; i < this->n; i++) {
+			if (this->data[i].tile == tile && this->data[i].dir == dir) return true;
+		}
+
+		return false;
+	}
+
+	/**
+	 * Adds tile & dir into the set, checks for full set
+	 * Sets the 'overflowed' flag if the set was full
+	 * @param tile tile
+	 * @param dir and dir to add
+	 * @return true iff the item could be added (set wasn't full)
+	 */
+	bool Add(TileIndex tile, Tdir dir)
+	{
+		if (this->IsFull()) {
+			overflowed = true;
+			DEBUG(misc, 0, "SignalSegment too complex. Set %s is full (maximum %d)", name, items);
+			return false; // set is full
+		}
+
+		this->data[this->n].tile = tile;
+		this->data[this->n].dir = dir;
+		this->n++;
+
+		return true;
+	}
+
+	/**
+	 * Reads the last added element into the set
+	 * @param tile pointer where tile is written to
+	 * @param dir pointer where dir is written to
+	 * @return false iff the set was empty
+	 */
+	bool Get(TileIndex *tile, Tdir *dir)
+	{
+		if (this->n == 0) return false;
+
+		this->n--;
+		*tile = this->data[this->n].tile;
+		*dir = this->data[this->n].dir;
+
+		return true;
+	}
+};
+
+static SmallSet<Trackdir, SIG_TBU_SIZE> _tbuset("_tbuset");         ///< set of signals that will be updated
+static SmallSet<DiagDirection, SIG_TBD_SIZE> _tbdset("_tbdset");    ///< set of open nodes in current signal block
+static SmallSet<DiagDirection, SIG_GLOB_SIZE> _globset("_globset"); ///< set of places to be updated in following runs
+
+
+/** Check whether there is a train on rail, not in a depot */
+static void *TrainOnTileEnum(Vehicle *v, void *)
+{
+	if (v->type != VEH_TRAIN || v->u.rail.track == TRACK_BIT_DEPOT) return NULL;
+
+	return v;
+}
+
+
+/**
+ * Perform some operations before adding data into Todo set
+ * The new and reverse direction is removed from _globset, because we are sure
+ * it doesn't need to be checked again
+ * Also, remove reverse direction from _tbdset
+ * This is the 'core' part so the graph seaching won't enter any tile twice
+ *
+ * @param t1 tile we are entering
+ * @param d1 direction (tile side) we are entering
+ * @param t2 tile we are leaving
+ * @param d2 direction (tile side) we are leaving
+ * @return false iff reverse direction was in Todo set
+ */
+static inline bool CheckAddToTodoSet(TileIndex t1, DiagDirection d1, TileIndex t2, DiagDirection d2)
+{
+	_globset.Remove(t1, d1); // it can be in Global but not in Todo
+	_globset.Remove(t2, d2); // remove in all cases
+
+	assert(!_tbdset.IsIn(t1, d1)); // it really shouldn't be there already
+
+	if (_tbdset.Remove(t2, d2)) return false;
+
+	return true;
+}
+
+
+/**
+ * Perform some operations before adding data into Todo set
+ * The new and reverse direction is removed from Global set, because we are sure
+ * it doesn't need to be checked again
+ * Also, remove reverse direction from Todo set
+ * This is the 'core' part so the graph seaching won't enter any tile twice
+ *
+ * @param t1 tile we are entering
+ * @param d1 direction (tile side) we are entering
+ * @param t2 tile we are leaving
+ * @param d2 direction (tile side) we are leaving
+ * @return false iff the Todo buffer would be overrun
+ */
+static inline bool MaybeAddToTodoSet(TileIndex t1, DiagDirection d1, TileIndex t2, DiagDirection d2)
+{
+	if (!CheckAddToTodoSet(t1, d1, t2, d2)) return true;
+
+	return _tbdset.Add(t1, d1);
+}
+
+
+/** Current signal block state flags */
+enum SigFlags {
+	SF_NONE   = 0,
+	SF_TRAIN  = 1 << 0, ///< train found in segment
+	SF_EXIT   = 1 << 1, ///< exitsignal found
+	SF_EXIT2  = 1 << 2, ///< two or more exits found
+	SF_GREEN  = 1 << 3, ///< green exitsignal found
+	SF_GREEN2 = 1 << 4, ///< two or more green exits found
+	SF_FULL   = 1 << 5, ///< some of buffers was full, do not continue
+};
+
+DECLARE_ENUM_AS_BIT_SET(SigFlags)
+
+
+/**
+ * Search signal block
+ *
+ * @param owner owner whose signals we are updating
+ * @return SigFlags
+ */
+static SigFlags ExploreSegment(Owner owner)
+{
+	SigFlags flags = SF_NONE;
+
+	TileIndex tile;
+	DiagDirection enterdir;
+
+	while (_tbdset.Get(&tile, &enterdir)) {
+		TileIndex oldtile = tile; // tile we are leaving
+		DiagDirection exitdir = enterdir == INVALID_DIAGDIR ? INVALID_DIAGDIR : ReverseDiagDir(enterdir); // expected new exit direction (for straight line)
+
+		switch (GetTileType(tile)) {
+			case MP_RAILWAY: {
+				if (GetTileOwner(tile) != owner) continue; // do not propagate signals on others' tiles (remove for tracksharing)
+
+				if (IsRailDepot(tile)) {
+					if (enterdir == INVALID_DIAGDIR) { // from 'inside' - train just entered or left the depot
+						if (!(flags & SF_TRAIN) && VehicleFromPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN;
+						exitdir = GetRailDepotDirection(tile);
+						tile += TileOffsByDiagDir(exitdir);
+						enterdir = ReverseDiagDir(exitdir);
+						break;
+					} else if (enterdir == GetRailDepotDirection(tile)) { // entered a depot
+						if (!(flags & SF_TRAIN) && VehicleFromPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN;
+						continue;
+					} else {
+						continue;
+					}
+				}
+
+				if (GetRailTileType(tile) == RAIL_TILE_WAYPOINT) {
+					if (!(flags & SF_TRAIN) && VehicleFromPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN;
+					tile += TileOffsByDiagDir(exitdir);
+					/* enterdir and exitdir stay the same */
+					break;
+				}
+
+				TrackBits tracks = GetTrackBits(tile); // trackbits of tile
+				TrackBits tracks_masked = (TrackBits)(tracks & _enterdir_to_trackbits[enterdir]); // only incidating trackbits
+
+				if (tracks == TRACK_BIT_HORZ || tracks == TRACK_BIT_VERT) { // there is exactly one incidating track, no need to check
+					tracks = tracks_masked;
+					if (!(flags & SF_TRAIN) && VehicleFromPos(tile, &tracks, &EnsureNoTrainOnTrackProc)) flags |= SF_TRAIN;
+				} else {
+					if (tracks_masked == TRACK_BIT_NONE) continue; // no incidating track
+					if (!(flags & SF_TRAIN) && VehicleFromPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN;
+				}
+
+				if (HasSignals(tile)) { // there is exactly one track - not zero, because there is exit from this tile
+					Track track = TrackBitsToTrack(tracks_masked); // mask TRACK_BIT_X and Y too
+					if (HasSignalOnTrack(tile, track)) { // now check whole track, not trackdir
+						SignalType sig = GetSignalType(tile, track);
+						Trackdir trackdir = (Trackdir)FindFirstBit((tracks * 0x101) & _enterdir_to_trackdirbits[enterdir]);
+						Trackdir reversedir = ReverseTrackdir(trackdir);
+						/* add (tile, reversetrackdir) to 'to-be-updated' set when there is
+						 * ANY signal in REVERSE direction
+						 * (if it is a presignal EXIT and it changes, it will be added to 'to-be-done' set later) */
+						if (HasSignalOnTrackdir(tile, reversedir)) {
+							if (!_tbuset.Add(tile, reversedir)) return flags | SF_FULL;
+						}
+						/* if it is a presignal EXIT in OUR direction and we haven't found 2 green exits yes, do special check */
+						if (!(flags & SF_GREEN2) && (sig & SIGTYPE_EXIT) && HasSignalOnTrackdir(tile, trackdir)) { // found presignal exit
+							if (flags & SF_EXIT) flags |= SF_EXIT2; // found two (or more) exits
+							flags |= SF_EXIT; // found at least one exit - allow for compiler optimizations
+							if (GetSignalStateByTrackdir(tile, trackdir) == SIGNAL_STATE_GREEN) { // found green presignal exit
+								if (flags & SF_GREEN) flags |= SF_GREEN2;
+								flags |= SF_GREEN;
+							}
+						}
+						continue;
+					}
+				}
+
+				for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) { // test all possible exit directions
+					if (dir != enterdir && tracks & _enterdir_to_trackbits[dir]) { // any track incidating?
+						TileIndex newtile = tile + TileOffsByDiagDir(dir);  // new tile to check
+						DiagDirection newdir = ReverseDiagDir(dir); // direction we are entering from
+						if (!MaybeAddToTodoSet(newtile, newdir, tile, dir)) return flags | SF_FULL;
+					}
+				}
+
+				continue; // continue the while() loop
+				}
+
+			case MP_STATION:
+				if (!IsRailwayStation(tile)) continue;
+				if (GetTileOwner(tile) != owner) continue;
+				if (DiagDirToAxis(enterdir) != GetRailStationAxis(tile)) continue; // different axis
+				if (IsStationTileBlocked(tile)) continue; // 'eye-candy' station tile
+
+				if (!(flags & SF_TRAIN) && VehicleFromPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN;
+				tile += TileOffsByDiagDir(exitdir);
+				break;
+
+			case MP_ROAD:
+				if (!IsLevelCrossing(tile)) continue;
+				if (GetTileOwner(tile) != owner) continue;
+				if (DiagDirToAxis(enterdir) == GetCrossingRoadAxis(tile)) continue; // different axis
+
+				if (!(flags & SF_TRAIN) && VehicleFromPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN;
+				tile += TileOffsByDiagDir(exitdir);
+				break;
+
+			case MP_TUNNELBRIDGE: {
+				if (GetTileOwner(tile) != owner) continue;
+				if (GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL) continue;
+				DiagDirection dir = GetTunnelBridgeDirection(tile);
+
+				if (enterdir == INVALID_DIAGDIR) { // incoming from the wormhole
+					if (!(flags & SF_TRAIN) && VehicleFromPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN;
+					enterdir = dir;
+					exitdir = ReverseDiagDir(dir);
+					tile += TileOffsByDiagDir(exitdir); // just skip to next tile
+				} else { // NOT incoming from the wormhole!
+					if (ReverseDiagDir(enterdir) != dir) continue;
+					if (!(flags & SF_TRAIN) && VehicleFromPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN;
+					tile = GetOtherTunnelBridgeEnd(tile); // just skip to exit tile
+					enterdir = INVALID_DIAGDIR;
+					exitdir = INVALID_DIAGDIR;
+				}
+				}
+				break;
+
+			default:
+				continue; // continue the while() loop
+		}
+
+		if (!MaybeAddToTodoSet(tile, enterdir, oldtile, exitdir)) return flags | SF_FULL;
+	}
+
+	return flags;
+}
+
+
+/**
+ * Update signals around segment in _tbuset
+ *
+ * @param flags info about segment
+ */
+static void UpdateSignalsAroundSegment(SigFlags flags)
+{
+	TileIndex tile;
+	Trackdir trackdir;
+
+	while (_tbuset.Get(&tile, &trackdir)) {
+		assert(HasSignalOnTrackdir(tile, trackdir));
+
+		SignalType sig = GetSignalType(tile, TrackdirToTrack(trackdir));
+		SignalState newstate = SIGNAL_STATE_GREEN;
+
+		/* determine whether the new state is red */
+		if (flags & SF_TRAIN) {
+			/* train in the segment */
+			newstate = SIGNAL_STATE_RED;
+		} else {
+ 			/* is it a bidir combo? - then do not count its other signal direction as exit */
+			if (sig == SIGTYPE_COMBO && HasSignalOnTrackdir(tile, ReverseTrackdir(trackdir))) {
+				/* at least one more exit */
+				if (flags & SF_EXIT2 &&
+ 						/* no green exit */
+						(!(flags & SF_GREEN) ||
+						/* only one green exit, and it is this one - so all other exits are red */
+						(!(flags & SF_GREEN2) && GetSignalStateByTrackdir(tile, ReverseTrackdir(trackdir)) == SIGNAL_STATE_GREEN))) {
+					newstate = SIGNAL_STATE_RED;
+				}
+			} else { // entry, at least one exit, no green exit
+				if (sig & SIGTYPE_ENTRY && (flags & SF_EXIT && !(flags & SF_GREEN))) newstate = SIGNAL_STATE_RED;
+			}
+		}
+
+		/* only when the state changes */
+		if (newstate != GetSignalStateByTrackdir(tile, trackdir)) {
+			if (sig & SIGTYPE_EXIT) {
+				/* for pre-signal exits, add block to the global set */
+				DiagDirection exitdir = TrackdirToExitdir(ReverseTrackdir(trackdir));
+				_globset.Add(tile, exitdir); // do not check for full global set, first update all signals
+			}
+			SetSignalStateByTrackdir(tile, trackdir, newstate);
+			MarkTileDirtyByTile(tile);
+		}
+	}
+
+}
+
+
+/** Reset all sets after one set overflowed */
+static inline void ResetSets()
+{
+	_tbuset.Reset();
+	_tbdset.Reset();
+	_globset.Reset();
+}
+
+
+/**
+ * Updates blocks in _globset buffer
+ *
+ * @param owner player whose signals we are updating
+ * @return false iff presignal entry would be green (needed for trains leaving depot)
+ * @pre IsValidPlayer(owner)
+ */
+static bool UpdateSignalsInBuffer(Owner owner)
+{
+	assert(IsValidPlayer(owner));
+
+	bool first = true;  // first block?
+	bool state = false; // value to return
+
+	TileIndex tile;
+	DiagDirection dir;
+
+	while (_globset.Get(&tile, &dir)) {
+		assert(_tbuset.IsEmpty());
+		assert(_tbdset.IsEmpty());
+
+		/* After updating signal, data stored are always MP_RAILWAY with signals.
+		 * Other situations happen when data are from outside functions -
+		 * modification of railbits (including both rail building and removal),
+		 * train entering/leaving block, train leaving depot...
+		 */
+		switch (GetTileType(tile)) {
+			case MP_TUNNELBRIDGE:
+				/* 'optimization assert' - do not try to update signals when it is not needed */
+				assert(GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL);
+				assert(dir == INVALID_DIAGDIR || dir == ReverseDiagDir(GetTunnelBridgeDirection(tile)));
+				_tbdset.Add(tile, INVALID_DIAGDIR);  // we can safely start from wormhole centre
+				_tbdset.Add(GetOtherTunnelBridgeEnd(tile), INVALID_DIAGDIR);
+				break;
+
+			case MP_RAILWAY:
+				if (IsRailDepot(tile)) {
+					/* 'optimization assert' do not try to update signals in other cases */
+					assert(dir == INVALID_DIAGDIR || dir == GetRailDepotDirection(tile));
+					_tbdset.Add(tile, INVALID_DIAGDIR); // start from depot inside
+					break;
+				}
+				/* FALLTHROUGH */
+			case MP_STATION:
+			case MP_ROAD:
+				if ((TrackBits)(GetTileTrackStatus(tile, TRANSPORT_RAIL, 0) & _enterdir_to_trackbits[dir]) != TRACK_BIT_NONE) {
+ 					/* only add to set when there is some 'interesting' track */
+					_tbdset.Add(tile, dir);
+					_tbdset.Add(tile + TileOffsByDiagDir(dir), ReverseDiagDir(dir));
+					break;
+				}
+				/* FALLTHROUGH */
+			default:
+				/* jump to next tile */
+				tile = tile + TileOffsByDiagDir(dir);
+				dir = ReverseDiagDir(dir);
+				if ((TrackBits)(GetTileTrackStatus(tile, TRANSPORT_RAIL, 0) & _enterdir_to_trackbits[dir]) != TRACK_BIT_NONE) {
+					_tbdset.Add(tile, dir);
+					break;
+				}
+				/* happens when removing a rail that wasn't connected at one or both sides */
+				continue; // continue the while() loop
+		}
+
+		assert(!_tbdset.Overflowed()); // it really shouldn't overflow by these one or two items
+		assert(!_tbdset.IsEmpty()); // it wouldn't hurt anyone, but shouldn't happen too
+
+		SigFlags flags = ExploreSegment(owner);
+
+		if (first) {
+			first = false;
+			state = (flags & SF_TRAIN) || (flags & SF_EXIT && !(flags & SF_GREEN)) || (flags & SF_FULL); // true iff train CAN'T leave the depot
+		}
+
+		/* do not do anything when some buffer was full */
+		if (flags & SF_FULL) {
+			ResetSets(); // free all sets
+			break;
+		}
+
+		UpdateSignalsAroundSegment(flags);
+	}
+
+	return state;
+}
+
+
+static Owner _last_owner = INVALID_OWNER; ///< last owner whose track was put into _globset
+
+
+/**
+ * Update signals in buffer
+ * Called from 'outside'
+ */
+void UpdateSignalsInBuffer()
+{
+	if (!_globset.IsEmpty()) {
+		UpdateSignalsInBuffer(_last_owner);
+		_last_owner = INVALID_OWNER; // invalidate
+	}
+}
+
+
+/**
+ * Add track to signal update buffer
+ *
+ * @param tile tile where we start
+ * @param track track at which ends we will update signals
+ * @param owner owner whose signals we will update
+ */
+void AddTrackToSignalBuffer(TileIndex tile, Track track, Owner owner)
+{
+	static const DiagDirection _search_dir_1[] = {
+		DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_SW, DIAGDIR_SE
+	};
+	static const DiagDirection _search_dir_2[] = {
+		DIAGDIR_SW, DIAGDIR_NW, DIAGDIR_NW, DIAGDIR_SW, DIAGDIR_NW, DIAGDIR_NE
+	};
+
+	/* do not allow signal updates for two players in one run */
+	assert(_globset.IsEmpty() || owner == _last_owner);
+
+	_last_owner = owner;
+
+	_globset.Add(tile, _search_dir_1[track]);
+	_globset.Add(tile, _search_dir_2[track]);
+
+	if (_globset.Items() >= SIG_GLOB_UPDATE) {
+		/* too many items, force update */
+		UpdateSignalsInBuffer(_last_owner);
+		_last_owner = INVALID_OWNER;
+	}
+}
+
+
+/**
+ * Add side of tile to signal update buffer
+ *
+ * @param tile tile where we start
+ * @param side side of tile
+ * @param owner owner whose signals we will update
+ */
+void AddSideToSignalBuffer(TileIndex tile, DiagDirection side, Owner owner)
+{
+	/* do not allow signal updates for two players in one run */
+	assert(_globset.IsEmpty() || owner == _last_owner);
+
+	_last_owner = owner;
+
+	_globset.Add(tile, side);
+
+	if (_globset.Items() >= SIG_GLOB_UPDATE) {
+		/* too many items, force update */
+		UpdateSignalsInBuffer(_last_owner);
+		_last_owner = INVALID_OWNER;
+	}
+}
+
+/**
+ * Update signals, starting at one side of a tile
+ * Will check tile next to this at opposite side too
+ *
+ * @see UpdateSignalsInBuffer()
+ * @param tile tile where we start
+ * @param side side of tile
+ * @param owner owner whose signals we will update
+ * @return false iff train can leave depot
+ */
+bool UpdateSignalsOnSegment(TileIndex tile, DiagDirection side, Owner owner)
+{
+	assert(_globset.IsEmpty());
+	_globset.Add(tile, side);
+
+	return UpdateSignalsInBuffer(owner);
+}
+
+
+/**
+ * Update signals at segments that are at both ends of
+ * given (existent or non-existent) track
+ *
+ * @see UpdateSignalsInBuffer()
+ * @param tile tile where we start
+ * @param track track at which ends we will update signals
+ * @param owner owner whose signals we will update
+ */
+void SetSignalsOnBothDir(TileIndex tile, Track track, Owner owner)
+{
+	assert(_globset.IsEmpty());
+
+	AddTrackToSignalBuffer(tile, track, owner);
+	UpdateSignalsInBuffer(owner);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/signal_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,50 @@
+/* $Id$ */
+
+/** @file signal_func.h Functions related to signals. */
+
+#ifndef SIGNAL_FUNC_H
+#define SIGNAL_FUNC_H
+
+#include "track_type.h"
+#include "tile_type.h"
+#include "direction_type.h"
+#include "track_type.h"
+#include "player_type.h"
+
+/**
+ * Maps a trackdir to the bit that stores its status in the map arrays, in the
+ * direction along with the trackdir.
+ */
+static inline byte SignalAlongTrackdir(Trackdir trackdir)
+{
+	extern const byte _signal_along_trackdir[TRACKDIR_END];
+	return _signal_along_trackdir[trackdir];
+}
+
+/**
+ * Maps a trackdir to the bit that stores its status in the map arrays, in the
+ * direction against the trackdir.
+ */
+static inline byte SignalAgainstTrackdir(Trackdir trackdir)
+{
+	extern const byte _signal_against_trackdir[TRACKDIR_END];
+	return _signal_against_trackdir[trackdir];
+}
+
+/**
+ * Maps a Track to the bits that store the status of the two signals that can
+ * be present on the given track.
+ */
+static inline byte SignalOnTrack(Track track)
+{
+	extern const byte _signal_on_track[TRACK_END];
+	return _signal_on_track[track];
+}
+
+bool UpdateSignalsOnSegment(TileIndex tile, DiagDirection side, Owner owner);
+void SetSignalsOnBothDir(TileIndex tile, Track track, Owner owner);
+void AddTrackToSignalBuffer(TileIndex tile, Track track, Owner owner);
+void AddSideToSignalBuffer(TileIndex tile, DiagDirection side, Owner owner);
+void UpdateSignalsInBuffer();
+
+#endif /* SIGNAL_FUNC_H */
--- a/src/signs.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/signs.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,33 +4,39 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "functions.h"
 #include "landscape.h"
-#include "player.h"
+#include "player_func.h"
 #include "signs.h"
 #include "saveload.h"
-#include "command.h"
+#include "command_func.h"
 #include "variables.h"
-#include "string.h"
 #include "misc/autoptr.hpp"
+#include "strings_func.h"
+#include "viewport_func.h"
+#include "zoom_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "map_func.h"
+#include "string_func.h"
+
+#include "table/strings.h"
 
 SignID _new_sign_id;
 uint _total_signs;
+bool _sign_sort_dirty;
 
 /* Initialize the sign-pool */
 DEFINE_OLD_POOL_GENERIC(Sign, Sign)
 
-Sign::Sign(StringID string)
+Sign::Sign(PlayerID owner)
 {
-	this->str = string;
+	this->owner = owner;
 }
 
 Sign::~Sign()
 {
-	DeleteName(this->str);
-	this->str = STR_NULL;
+	free(this->name);
+	this->owner = INVALID_PLAYER;
 }
 
 /**
@@ -91,7 +97,7 @@
 CommandCost CmdPlaceSign(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	/* Try to locate a new sign */
-	Sign *si = new Sign(STR_280A_SIGN);
+	Sign *si = new Sign(_current_player);
 	if (si == NULL) return_cmd_error(STR_2808_TOO_MANY_SIGNS);
 	AutoPtrT<Sign> s_auto_delete = si;
 
@@ -102,7 +108,6 @@
 
 		si->x = x;
 		si->y = y;
-		si->owner = _current_player; // owner of the sign; just eyecandy
 		si->z = GetSlopeZ(x, y);
 		UpdateSignVirtCoords(si);
 		MarkSignDirty(si);
@@ -132,17 +137,13 @@
 	/* If _cmd_text 0 means the new text for the sign is non-empty.
 	 * So rename the sign. If it is empty, it has no name, so delete it */
 	if (!StrEmpty(_cmd_text)) {
-		/* Create the name */
-		StringID str = AllocateName(_cmd_text, 0);
-		if (str == 0) return CMD_ERROR;
-
 		if (flags & DC_EXEC) {
 			Sign *si = GetSign(p1);
 
 			/* Delete the old name */
-			DeleteName(si->str);
+			free(si->name);
 			/* Assign the new one */
-			si->str = str;
+			si->name = strdup(_cmd_text);
 			si->owner = _current_player;
 
 			/* Update; mark sign dirty twice, because it can either becom longer, or shorter */
@@ -151,9 +152,6 @@
 			MarkSignDirty(si);
 			InvalidateWindow(WC_SIGN_LIST, 0);
 			_sign_sort_dirty = true;
-		} else {
-			/* Free the name, because we did not assign it yet */
-			DeleteName(str);
 		}
 	} else { // Delete sign
 		if (flags & DC_EXEC) {
@@ -210,7 +208,8 @@
 }
 
 static const SaveLoad _sign_desc[] = {
-      SLE_VAR(Sign, str,   SLE_UINT16),
+  SLE_CONDVAR(Sign, name,  SLE_NAME,                   0, 83),
+  SLE_CONDSTR(Sign, name,  SLE_STR, 0,                84, SL_MAX_VERSION),
   SLE_CONDVAR(Sign, x,     SLE_FILE_I16 | SLE_VAR_I32, 0, 4),
   SLE_CONDVAR(Sign, y,     SLE_FILE_I16 | SLE_VAR_I32, 0, 4),
   SLE_CONDVAR(Sign, x,     SLE_INT32,                  5, SL_MAX_VERSION),
--- a/src/signs.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/signs.h	Tue Jan 22 21:00:30 2008 +0000
@@ -11,7 +11,7 @@
 DECLARE_OLD_POOL(Sign, Sign, 2, 16000)
 
 struct Sign : PoolItem<Sign, SignID, &_Sign_pool> {
-	StringID     str;
+	char *name;
 	ViewportSign sign;
 	int32        x;
 	int32        y;
@@ -21,12 +21,12 @@
 	/**
 	 * Creates a new sign
 	 */
-	Sign(StringID string = STR_NULL);
+	Sign(PlayerID owner = INVALID_PLAYER);
 
 	/** Destroy the sign */
 	~Sign();
 
-	inline bool IsValid() const { return this->str != STR_NULL; }
+	inline bool IsValid() const { return this->owner != INVALID_PLAYER; }
 };
 
 enum {
@@ -60,7 +60,7 @@
 #define FOR_ALL_SIGNS_FROM(ss, start) for (ss = GetSign(start); ss != NULL; ss = (ss->index + 1U < GetSignPoolSize()) ? GetSign(ss->index + 1U) : NULL) if (ss->IsValid())
 #define FOR_ALL_SIGNS(ss) FOR_ALL_SIGNS_FROM(ss, 0)
 
-VARDEF bool _sign_sort_dirty;
+extern bool _sign_sort_dirty;
 
 void UpdateAllSignVirtCoords();
 void PlaceProc_Sign(TileIndex tile);
--- a/src/signs_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/signs_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,19 +4,23 @@
 
 #include "stdafx.h"
 #include "openttd.h"
+#include "gui.h"
+#include "textbuf_gui.h"
+#include "window_gui.h"
+#include "player_gui.h"
+#include "signs.h"
+#include "debug.h"
+#include "variables.h"
+#include "command_func.h"
+#include "strings_func.h"
+#include "core/alloc_func.hpp"
+#include "window_func.h"
+#include "map_func.h"
+#include "gfx_func.h"
+#include "viewport_func.h"
+
 #include "table/strings.h"
 #include "table/sprites.h"
-#include "functions.h"
-#include "window.h"
-#include "gui.h"
-#include "gfx.h"
-#include "player.h"
-#include "signs.h"
-#include "strings.h"
-#include "debug.h"
-#include "variables.h"
-#include "helpers.hpp"
-#include "command.h"
 
 static const Sign **_sign_sort;
 static uint _num_sign_sort;
@@ -30,11 +34,13 @@
 	const Sign *sign1 = *(const Sign**)b;
 	char buf1[64];
 
-	GetString(buf1, sign0->str, lastof(buf1));
+	SetDParam(0, sign0->index);
+	GetString(buf1, STR_SIGN_NAME, lastof(buf1));
 
 	if (sign1 != _last_sign) {
 		_last_sign = sign1;
-		GetString(_bufcache, sign1->str, lastof(_bufcache));
+		SetDParam(0, sign1->index);
+		GetString(_bufcache, STR_SIGN_NAME, lastof(_bufcache));
 	}
 
 	return strcmp(buf1, _bufcache); // sort by name
@@ -47,7 +53,6 @@
 
 	/* Create array for sorting */
 	_sign_sort = ReallocT(_sign_sort, GetMaxSignIndex() + 1);
-	if (_sign_sort == NULL) error("Could not allocate memory for the sign-sorting-list");
 
 	FOR_ALL_SIGNS(si) _sign_sort[n++] = si;
 	_num_sign_sort = n;
@@ -173,7 +178,7 @@
 static void UpdateSignEditWindow(Window *w, const Sign *si)
 {
 	/* Display an empty string when the sign hasnt been edited yet */
-	if (si->str != STR_280A_SIGN) {
+	if (si->name != NULL) {
 		SetDParam(0, si->index);
 		GetString(_edit_str_buf, STR_SIGN_NAME, lastof(_edit_str_buf));
 	} else {
@@ -184,7 +189,7 @@
 	WP(w, editsign_d).cur_sign = si->index;
 	InitializeTextBuffer(&WP(w, querystr_d).text, _edit_str_buf, 31, 255); // Allow 31 characters (including \0)
 
-	InvalidateWidget(w, QUERY_EDIT_SIGN_WIDGET_TEXT);
+	w->InvalidateWidget(QUERY_EDIT_SIGN_WIDGET_TEXT);
 }
 
 static void RenameSign(SignID index, const char *text)
--- a/src/slope.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,386 +0,0 @@
-/* $Id$ */
-
-/** @file slope.h Definitions of a slope.
- * This file defines the enumeration and helper functions for handling
- * the slope info of a tile.
- */
-
-#ifndef SLOPE_H
-#define SLOPE_H
-
-/**
- * Enumeration of tile corners
- */
-enum Corner {
-	CORNER_W = 0,
-	CORNER_S = 1,
-	CORNER_E = 2,
-	CORNER_N = 3,
-	CORNER_END,
-	CORNER_INVALID = 0xFF
-};
-
-/**
- * Enumeration for the slope-type.
- *
- * This enumeration use the chars N,E,S,W corresponding the
- * direction north, east, south and west. The top corner of a tile
- * is the north-part of the tile. The whole slope is encoded with
- * 5 bits, 4 bits for each corner and 1 bit for a steep-flag.
- *
- * For halftile slopes an extra 3 bits are used to represent this
- * properly; 1 bit for a halftile-flag and 2 bits to encode which
- * extra side (corner) is leveled when the slope of the first 5
- * bits is applied. This means that there can only be one leveled
- * slope for steep slopes, which is logical because two leveled
- * slopes would mean that it is not a steep slope as halftile
- * slopes only span one height level.
- */
-enum Slope {
-	SLOPE_FLAT     = 0x00,                                  ///< a flat tile
-	SLOPE_W        = 0x01,                                  ///< the west corner of the tile is raised
-	SLOPE_S        = 0x02,                                  ///< the south corner of the tile is raised
-	SLOPE_E        = 0x04,                                  ///< the east corner of the tile is raised
-	SLOPE_N        = 0x08,                                  ///< the north corner of the tile is raised
-	SLOPE_STEEP    = 0x10,                                  ///< indicates the slope is steep
-	SLOPE_NW       = SLOPE_N | SLOPE_W,                     ///< north and west corner are raised
-	SLOPE_SW       = SLOPE_S | SLOPE_W,                     ///< south and west corner are raised
-	SLOPE_SE       = SLOPE_S | SLOPE_E,                     ///< south and east corner are raised
-	SLOPE_NE       = SLOPE_N | SLOPE_E,                     ///< north and east corner are raised
-	SLOPE_EW       = SLOPE_E | SLOPE_W,                     ///< east and west corner are raised
-	SLOPE_NS       = SLOPE_N | SLOPE_S,                     ///< north and south corner are raised
-	SLOPE_ELEVATED = SLOPE_N | SLOPE_E | SLOPE_S | SLOPE_W, ///< all corner are raised, similar to SLOPE_FLAT
-	SLOPE_NWS      = SLOPE_N | SLOPE_W | SLOPE_S,           ///< north, west and south corner are raised
-	SLOPE_WSE      = SLOPE_W | SLOPE_S | SLOPE_E,           ///< west, south and east corner are raised
-	SLOPE_SEN      = SLOPE_S | SLOPE_E | SLOPE_N,           ///< south, east and north corner are raised
-	SLOPE_ENW      = SLOPE_E | SLOPE_N | SLOPE_W,           ///< east, north and west corner are raised
-	SLOPE_STEEP_W  = SLOPE_STEEP | SLOPE_NWS,               ///< a steep slope falling to east (from west)
-	SLOPE_STEEP_S  = SLOPE_STEEP | SLOPE_WSE,               ///< a steep slope falling to north (from south)
-	SLOPE_STEEP_E  = SLOPE_STEEP | SLOPE_SEN,               ///< a steep slope falling to west (from east)
-	SLOPE_STEEP_N  = SLOPE_STEEP | SLOPE_ENW,               ///< a steep slope falling to south (from north)
-
-	SLOPE_HALFTILE = 0x20,                                  ///< one halftile is leveled (non continuous slope)
-	SLOPE_HALFTILE_MASK = 0xE0,                             ///< three bits used for halftile slopes
-	SLOPE_HALFTILE_W = SLOPE_HALFTILE | (CORNER_W << 6),    ///< the west halftile is leveled (non continuous slope)
-	SLOPE_HALFTILE_S = SLOPE_HALFTILE | (CORNER_S << 6),    ///< the south halftile is leveled (non continuous slope)
-	SLOPE_HALFTILE_E = SLOPE_HALFTILE | (CORNER_E << 6),    ///< the east halftile is leveled (non continuous slope)
-	SLOPE_HALFTILE_N = SLOPE_HALFTILE | (CORNER_N << 6),    ///< the north halftile is leveled (non continuous slope)
-};
-
-/**
- * Rangecheck for Corner enumeration.
- *
- * @param corner A #Corner.
- * @return true iff corner is in a valid range.
- */
-static inline bool IsValidCorner(Corner corner)
-{
-	return IsInsideMM(corner, 0, CORNER_END);
-}
-
-/**
- * Checks if a slope is steep.
- *
- * @param s The given #Slope.
- * @return True if the slope is steep, else false.
- */
-static inline bool IsSteepSlope(Slope s)
-{
-	return (s & SLOPE_STEEP) != 0;
-}
-
-/**
- * Checks for non-continuous slope on halftile foundations.
- *
- * @param s The given #Slope.
- * @return True if the slope is non-continuous, else false.
- */
-static inline bool IsHalftileSlope(Slope s)
-{
-	return (s & SLOPE_HALFTILE) != 0;
-}
-
-/**
- * Return the complement of a slope.
- *
- * This method returns the complement of a slope. The complement of a
- * slope is a slope with raised corner which aren't raised in the given
- * slope.
- *
- * @pre The slope must neither be steep nor a halftile slope.
- * @param s The #Slope to get the complement.
- * @return a complement Slope of the given slope.
- */
-static inline Slope ComplementSlope(Slope s)
-{
-	assert(!IsSteepSlope(s) && !IsHalftileSlope(s));
-	return (Slope)(0xF ^ s);
-}
-
-/**
- * Tests if a slope has a highest corner (i.e. one corner raised or a steep slope).
- *
- * Note: A halftile slope is ignored.
- *
- * @param s The #Slope.
- * @return  true iff the slope has a highest corner.
- */
-static inline bool HasSlopeHighestCorner(Slope s)
-{
-	s = (Slope)(s & ~SLOPE_HALFTILE_MASK);
-	return IsSteepSlope(s) || (s == SLOPE_W) || (s == SLOPE_S) || (s == SLOPE_E) || (s == SLOPE_N);
-}
-
-/**
- * Returns the highest corner of a slope (one corner raised or a steep slope).
- *
- * @pre      The slope must be a slope with one corner raised or a steep slope. A halftile slope is ignored.
- * @param s  The #Slope.
- * @return   Highest corner.
- */
-static inline Corner GetHighestSlopeCorner(Slope s)
-{
-	switch (s & ~SLOPE_HALFTILE_MASK) {
-		case SLOPE_W:
-		case SLOPE_STEEP_W: return CORNER_W;
-		case SLOPE_S:
-		case SLOPE_STEEP_S: return CORNER_S;
-		case SLOPE_E:
-		case SLOPE_STEEP_E: return CORNER_E;
-		case SLOPE_N:
-		case SLOPE_STEEP_N: return CORNER_N;
-		default: NOT_REACHED();
-	}
-}
-
-/**
- * Returns the leveled halftile of a halftile slope.
- *
- * @pre     The slope must be a halftile slope.
- * @param s The #Slope.
- * @return  The corner of the leveled halftile.
- */
-static inline Corner GetHalftileSlopeCorner(Slope s)
-{
-	assert(IsHalftileSlope(s));
-	return (Corner)((s >> 6) & 3);
-}
-
-/**
- * Returns the height of the highest corner of a slope relative to TileZ (= minimal height)
- *
- * @param s The #Slope.
- * @return Relative height of highest corner.
- */
-static inline uint GetSlopeMaxZ(Slope s)
-{
-	if (s == SLOPE_FLAT) return 0;
-	if (IsSteepSlope(s)) return 2 * TILE_HEIGHT;
-	return TILE_HEIGHT;
-}
-
-/**
- * Returns the opposite corner.
- *
- * @param corner A #Corner.
- * @return The opposite corner to "corner".
- */
-static inline Corner OppositeCorner(Corner corner)
-{
-	return (Corner)(corner ^ 2);
-}
-
-/**
- * Returns the slope with a specific corner raised.
- *
- * @param corner The #Corner.
- * @return The #Slope with corner "corner" raised.
- */
-static inline Slope SlopeWithOneCornerRaised(Corner corner)
-{
-	assert(IsValidCorner(corner));
-	return (Slope)(1 << corner);
-}
-
-/**
- * Returns the slope with all except one corner raised.
- *
- * @param corner The #Corner.
- * @return The #Slope with all corners but "corner" raised.
- */
-static inline Slope SlopeWithThreeCornersRaised(Corner corner)
-{
-	return ComplementSlope(SlopeWithOneCornerRaised(corner));
-}
-
-/**
- * Adds a halftile slope to a slope.
- *
- * @param s #Slope without a halftile slope.
- * @param corner The #Corner of the halftile.
- * @return The #Slope s with the halftile slope added.
- */
-static inline Slope HalftileSlope(Slope s, Corner corner)
-{
-	assert(IsValidCorner(corner));
-	return (Slope)(s | SLOPE_HALFTILE | (corner << 6));
-}
-
-
-/**
- * Enumeration for Foundations.
- */
-enum Foundation {
-	FOUNDATION_NONE,             ///< The tile has no foundation, the slope remains unchanged.
-	FOUNDATION_LEVELED,          ///< The tile is leveled up to a flat slope.
-	FOUNDATION_INCLINED_X,       ///< The tile has an along X-axis inclined foundation.
-	FOUNDATION_INCLINED_Y,       ///< The tile has an along Y-axis inclined foundation.
-	FOUNDATION_STEEP_LOWER,      ///< The tile has a steep slope. The lowest corner is raised by a foundation to allow building railroad on the lower halftile.
-
-/* Halftile foundations */
-	FOUNDATION_STEEP_BOTH,       ///< The tile has a steep slope. The lowest corner is raised by a foundation and the upper halftile is leveled.
-	FOUNDATION_HALFTILE_W,       ///< Level west halftile non-continuously.
-	FOUNDATION_HALFTILE_S,       ///< Level south halftile non-continuously.
-	FOUNDATION_HALFTILE_E,       ///< Level east halftile non-continuously.
-	FOUNDATION_HALFTILE_N,       ///< Level north halftile non-continuously.
-
-/* Special anti-zig-zag foundations for single horizontal/vertical track */
-	FOUNDATION_RAIL_W,           ///< Foundation for TRACK_BIT_LEFT, but not a leveled foundation.
-	FOUNDATION_RAIL_S,           ///< Foundation for TRACK_BIT_LOWER, but not a leveled foundation.
-	FOUNDATION_RAIL_E,           ///< Foundation for TRACK_BIT_RIGHT, but not a leveled foundation.
-	FOUNDATION_RAIL_N,           ///< Foundation for TRACK_BIT_UPPER, but not a leveled foundation.
-
-	FOUNDATION_INVALID = 0xFF    ///< Used inside "rail_cmd.cpp" to indicate invalid slope/track combination.
-};
-
-/**
- * Tests for FOUNDATION_NONE.
- *
- * @param f  Maybe a #Foundation.
- * @return   true iff f is a foundation.
- */
-static inline bool IsFoundation(Foundation f)
-{
-	return f != FOUNDATION_NONE;
-}
-
-/**
- * Tests if the foundation is a leveled foundation.
- *
- * @param f  The #Foundation.
- * @return   true iff f is a leveled foundation.
- */
-static inline bool IsLeveledFoundation(Foundation f)
-{
-	return f == FOUNDATION_LEVELED;
-}
-
-/**
- * Tests if the foundation is an inclined foundation.
- *
- * @param f  The #Foundation.
- * @return   true iff f is an inclined foundation.
- */
-static inline bool IsInclinedFoundation(Foundation f)
-{
-	return (f == FOUNDATION_INCLINED_X) || (f == FOUNDATION_INCLINED_Y);
-}
-
-/**
- * Tests if a foundation is a non-continuous foundation, i.e. halftile-foundation or FOUNDATION_STEEP_BOTH.
- *
- * @param f  The #Foundation.
- * @return   true iff f is a non-continuous foundation
- */
-static inline bool IsNonContinuousFoundation(Foundation f)
-{
-	return IsInsideMM(f, FOUNDATION_STEEP_BOTH, FOUNDATION_HALFTILE_N + 1);
-}
-
-/**
- * Returns the halftile corner of a halftile-foundation
- *
- * @pre f != FOUNDATION_STEEP_BOTH
- *
- * @param f  The #Foundation.
- * @return   The #Corner with track.
- */
-static inline Corner GetHalftileFoundationCorner(Foundation f)
-{
-	assert(IsInsideMM(f, FOUNDATION_HALFTILE_W, FOUNDATION_HALFTILE_N + 1));
-	return (Corner)(f - FOUNDATION_HALFTILE_W);
-}
-
-/**
- * Tests if a foundation is a special rail foundation for single horizontal/vertical track.
- *
- * @param f  The #Foundation.
- * @return   true iff f is a special rail foundation for single horizontal/vertical track.
- */
-static inline bool IsSpecialRailFoundation(Foundation f)
-{
-	return IsInsideMM(f, FOUNDATION_RAIL_W, FOUNDATION_RAIL_N + 1);
-}
-
-/**
- * Returns the track corner of a special rail foundation
- *
- * @param f  The #Foundation.
- * @return   The #Corner with track.
- */
-static inline Corner GetRailFoundationCorner(Foundation f)
-{
-	assert(IsSpecialRailFoundation(f));
-	return (Corner)(f - FOUNDATION_RAIL_W);
-}
-
-/**
- * Returns the foundation needed to flatten a slope.
- * The returned foundation is either FOUNDATION_NONE if the tile was already flat, or FOUNDATION_LEVELED.
- *
- * @pre      The slope must not be steep.
- * @param s  The current #Slope.
- * @return   The needed #Foundation.
- */
-static inline Foundation FlatteningFoundation(Slope s)
-{
-	assert(!IsSteepSlope(s));
-	return (s == SLOPE_FLAT ? FOUNDATION_NONE : FOUNDATION_LEVELED);
-}
-
-/**
- * Returns the along a specific axis inclined foundation.
- *
- * @param axis  The #Axis.
- * @return      The needed #Foundation.
- */
-static inline Foundation InclinedFoundation(Axis axis)
-{
-	return (axis == AXIS_X ? FOUNDATION_INCLINED_X : FOUNDATION_INCLINED_Y);
-}
-
-/**
- * Returns the halftile foundation for single horizontal/vertical track.
- *
- * @param corner The #Corner with the track.
- * @return       The wanted #Foundation.
- */
-static inline Foundation HalftileFoundation(Corner corner)
-{
-	assert(IsValidCorner(corner));
-	return (Foundation)(FOUNDATION_HALFTILE_W + corner);
-}
-
-/**
- * Returns the special rail foundation for single horizontal/vertical track.
- *
- * @param corner The #Corner with the track.
- * @return       The wanted #Foundation.
- */
-static inline Foundation SpecialRailFoundation(Corner corner)
-{
-	assert(IsValidCorner(corner));
-	return (Foundation)(FOUNDATION_RAIL_W + corner);
-}
-
-#endif /* SLOPE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/slope_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,304 @@
+/* $Id$ */
+
+/** @file slope_func.h Functions related to slopes. */
+
+#ifndef SLOPE_FUNC_H
+#define SLOPE_FUNC_H
+
+#include "core/math_func.hpp"
+#include "slope_type.h"
+#include "direction_type.h"
+#include "tile_type.h"
+
+/**
+ * Rangecheck for Corner enumeration.
+ *
+ * @param corner A #Corner.
+ * @return true iff corner is in a valid range.
+ */
+static inline bool IsValidCorner(Corner corner)
+{
+	return IsInsideMM(corner, 0, CORNER_END);
+}
+
+
+/**
+ * Checks if a slope is steep.
+ *
+ * @param s The given #Slope.
+ * @return True if the slope is steep, else false.
+ */
+static inline bool IsSteepSlope(Slope s)
+{
+	return (s & SLOPE_STEEP) != 0;
+}
+
+/**
+ * Checks for non-continuous slope on halftile foundations.
+ *
+ * @param s The given #Slope.
+ * @return True if the slope is non-continuous, else false.
+ */
+static inline bool IsHalftileSlope(Slope s)
+{
+	return (s & SLOPE_HALFTILE) != 0;
+}
+
+/**
+ * Return the complement of a slope.
+ *
+ * This method returns the complement of a slope. The complement of a
+ * slope is a slope with raised corner which aren't raised in the given
+ * slope.
+ *
+ * @pre The slope must neither be steep nor a halftile slope.
+ * @param s The #Slope to get the complement.
+ * @return a complement Slope of the given slope.
+ */
+static inline Slope ComplementSlope(Slope s)
+{
+	assert(!IsSteepSlope(s) && !IsHalftileSlope(s));
+	return (Slope)(0xF ^ s);
+}
+
+/**
+ * Tests if a slope has a highest corner (i.e. one corner raised or a steep slope).
+ *
+ * Note: A halftile slope is ignored.
+ *
+ * @param s The #Slope.
+ * @return  true iff the slope has a highest corner.
+ */
+static inline bool HasSlopeHighestCorner(Slope s)
+{
+	s = (Slope)(s & ~SLOPE_HALFTILE_MASK);
+	return IsSteepSlope(s) || (s == SLOPE_W) || (s == SLOPE_S) || (s == SLOPE_E) || (s == SLOPE_N);
+}
+
+/**
+ * Returns the highest corner of a slope (one corner raised or a steep slope).
+ *
+ * @pre      The slope must be a slope with one corner raised or a steep slope. A halftile slope is ignored.
+ * @param s  The #Slope.
+ * @return   Highest corner.
+ */
+static inline Corner GetHighestSlopeCorner(Slope s)
+{
+	switch (s & ~SLOPE_HALFTILE_MASK) {
+		case SLOPE_W:
+		case SLOPE_STEEP_W: return CORNER_W;
+		case SLOPE_S:
+		case SLOPE_STEEP_S: return CORNER_S;
+		case SLOPE_E:
+		case SLOPE_STEEP_E: return CORNER_E;
+		case SLOPE_N:
+		case SLOPE_STEEP_N: return CORNER_N;
+		default: NOT_REACHED();
+	}
+}
+
+/**
+ * Returns the leveled halftile of a halftile slope.
+ *
+ * @pre     The slope must be a halftile slope.
+ * @param s The #Slope.
+ * @return  The corner of the leveled halftile.
+ */
+static inline Corner GetHalftileSlopeCorner(Slope s)
+{
+	assert(IsHalftileSlope(s));
+	return (Corner)((s >> 6) & 3);
+}
+
+/**
+ * Returns the height of the highest corner of a slope relative to TileZ (= minimal height)
+ *
+ * @param s The #Slope.
+ * @return Relative height of highest corner.
+ */
+static inline uint GetSlopeMaxZ(Slope s)
+{
+	if (s == SLOPE_FLAT) return 0;
+	if (IsSteepSlope(s)) return 2 * TILE_HEIGHT;
+	return TILE_HEIGHT;
+}
+
+/**
+ * Returns the opposite corner.
+ *
+ * @param corner A #Corner.
+ * @return The opposite corner to "corner".
+ */
+static inline Corner OppositeCorner(Corner corner)
+{
+	return (Corner)(corner ^ 2);
+}
+
+/**
+ * Returns the slope with a specific corner raised.
+ *
+ * @param corner The #Corner.
+ * @return The #Slope with corner "corner" raised.
+ */
+static inline Slope SlopeWithOneCornerRaised(Corner corner)
+{
+	assert(IsValidCorner(corner));
+	return (Slope)(1 << corner);
+}
+
+/**
+ * Returns the slope with all except one corner raised.
+ *
+ * @param corner The #Corner.
+ * @return The #Slope with all corners but "corner" raised.
+ */
+static inline Slope SlopeWithThreeCornersRaised(Corner corner)
+{
+	return ComplementSlope(SlopeWithOneCornerRaised(corner));
+}
+
+/**
+ * Adds a halftile slope to a slope.
+ *
+ * @param s #Slope without a halftile slope.
+ * @param corner The #Corner of the halftile.
+ * @return The #Slope s with the halftile slope added.
+ */
+static inline Slope HalftileSlope(Slope s, Corner corner)
+{
+	assert(IsValidCorner(corner));
+	return (Slope)(s | SLOPE_HALFTILE | (corner << 6));
+}
+
+
+/**
+ * Tests for FOUNDATION_NONE.
+ *
+ * @param f  Maybe a #Foundation.
+ * @return   true iff f is a foundation.
+ */
+static inline bool IsFoundation(Foundation f)
+{
+	return f != FOUNDATION_NONE;
+}
+
+/**
+ * Tests if the foundation is a leveled foundation.
+ *
+ * @param f  The #Foundation.
+ * @return   true iff f is a leveled foundation.
+ */
+static inline bool IsLeveledFoundation(Foundation f)
+{
+	return f == FOUNDATION_LEVELED;
+}
+
+/**
+ * Tests if the foundation is an inclined foundation.
+ *
+ * @param f  The #Foundation.
+ * @return   true iff f is an inclined foundation.
+ */
+static inline bool IsInclinedFoundation(Foundation f)
+{
+	return (f == FOUNDATION_INCLINED_X) || (f == FOUNDATION_INCLINED_Y);
+}
+
+/**
+ * Tests if a foundation is a non-continuous foundation, i.e. halftile-foundation or FOUNDATION_STEEP_BOTH.
+ *
+ * @param f  The #Foundation.
+ * @return   true iff f is a non-continuous foundation
+ */
+static inline bool IsNonContinuousFoundation(Foundation f)
+{
+	return IsInsideMM(f, FOUNDATION_STEEP_BOTH, FOUNDATION_HALFTILE_N + 1);
+}
+
+/**
+ * Returns the halftile corner of a halftile-foundation
+ *
+ * @pre f != FOUNDATION_STEEP_BOTH
+ *
+ * @param f  The #Foundation.
+ * @return   The #Corner with track.
+ */
+static inline Corner GetHalftileFoundationCorner(Foundation f)
+{
+	assert(IsInsideMM(f, FOUNDATION_HALFTILE_W, FOUNDATION_HALFTILE_N + 1));
+	return (Corner)(f - FOUNDATION_HALFTILE_W);
+}
+
+/**
+ * Tests if a foundation is a special rail foundation for single horizontal/vertical track.
+ *
+ * @param f  The #Foundation.
+ * @return   true iff f is a special rail foundation for single horizontal/vertical track.
+ */
+static inline bool IsSpecialRailFoundation(Foundation f)
+{
+	return IsInsideMM(f, FOUNDATION_RAIL_W, FOUNDATION_RAIL_N + 1);
+}
+
+/**
+ * Returns the track corner of a special rail foundation
+ *
+ * @param f  The #Foundation.
+ * @return   The #Corner with track.
+ */
+static inline Corner GetRailFoundationCorner(Foundation f)
+{
+	assert(IsSpecialRailFoundation(f));
+	return (Corner)(f - FOUNDATION_RAIL_W);
+}
+
+/**
+ * Returns the foundation needed to flatten a slope.
+ * The returned foundation is either FOUNDATION_NONE if the tile was already flat, or FOUNDATION_LEVELED.
+ *
+ * @pre      The slope must not be steep.
+ * @param s  The current #Slope.
+ * @return   The needed #Foundation.
+ */
+static inline Foundation FlatteningFoundation(Slope s)
+{
+	assert(!IsSteepSlope(s));
+	return (s == SLOPE_FLAT ? FOUNDATION_NONE : FOUNDATION_LEVELED);
+}
+
+/**
+ * Returns the along a specific axis inclined foundation.
+ *
+ * @param axis  The #Axis.
+ * @return      The needed #Foundation.
+ */
+static inline Foundation InclinedFoundation(Axis axis)
+{
+	return (axis == AXIS_X ? FOUNDATION_INCLINED_X : FOUNDATION_INCLINED_Y);
+}
+
+/**
+ * Returns the halftile foundation for single horizontal/vertical track.
+ *
+ * @param corner The #Corner with the track.
+ * @return       The wanted #Foundation.
+ */
+static inline Foundation HalftileFoundation(Corner corner)
+{
+	assert(IsValidCorner(corner));
+	return (Foundation)(FOUNDATION_HALFTILE_W + corner);
+}
+
+/**
+ * Returns the special rail foundation for single horizontal/vertical track.
+ *
+ * @param corner The #Corner with the track.
+ * @return       The wanted #Foundation.
+ */
+static inline Foundation SpecialRailFoundation(Corner corner)
+{
+	assert(IsValidCorner(corner));
+	return (Foundation)(FOUNDATION_RAIL_W + corner);
+}
+
+#endif /* SLOPE_FUNC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/slope_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,101 @@
+/* $Id$ */
+
+/**
+ * @file slope_type.h Definitions of a slope.
+ * This file defines the enumeration and helper functions for handling
+ * the slope info of a tile.
+ */
+
+#ifndef SLOPE_TYPE_H
+#define SLOPE_TYPE_H
+
+#include "core/enum_type.hpp"
+
+/**
+ * Enumeration of tile corners
+ */
+enum Corner {
+	CORNER_W = 0,
+	CORNER_S = 1,
+	CORNER_E = 2,
+	CORNER_N = 3,
+	CORNER_END,
+	CORNER_INVALID = 0xFF
+};
+
+
+/**
+ * Enumeration for the slope-type.
+ *
+ * This enumeration use the chars N,E,S,W corresponding the
+ * direction north, east, south and west. The top corner of a tile
+ * is the north-part of the tile. The whole slope is encoded with
+ * 5 bits, 4 bits for each corner and 1 bit for a steep-flag.
+ *
+ * For halftile slopes an extra 3 bits are used to represent this
+ * properly; 1 bit for a halftile-flag and 2 bits to encode which
+ * extra side (corner) is leveled when the slope of the first 5
+ * bits is applied. This means that there can only be one leveled
+ * slope for steep slopes, which is logical because two leveled
+ * slopes would mean that it is not a steep slope as halftile
+ * slopes only span one height level.
+ */
+enum Slope {
+	SLOPE_FLAT     = 0x00,                                  ///< a flat tile
+	SLOPE_W        = 0x01,                                  ///< the west corner of the tile is raised
+	SLOPE_S        = 0x02,                                  ///< the south corner of the tile is raised
+	SLOPE_E        = 0x04,                                  ///< the east corner of the tile is raised
+	SLOPE_N        = 0x08,                                  ///< the north corner of the tile is raised
+	SLOPE_STEEP    = 0x10,                                  ///< indicates the slope is steep
+	SLOPE_NW       = SLOPE_N | SLOPE_W,                     ///< north and west corner are raised
+	SLOPE_SW       = SLOPE_S | SLOPE_W,                     ///< south and west corner are raised
+	SLOPE_SE       = SLOPE_S | SLOPE_E,                     ///< south and east corner are raised
+	SLOPE_NE       = SLOPE_N | SLOPE_E,                     ///< north and east corner are raised
+	SLOPE_EW       = SLOPE_E | SLOPE_W,                     ///< east and west corner are raised
+	SLOPE_NS       = SLOPE_N | SLOPE_S,                     ///< north and south corner are raised
+	SLOPE_ELEVATED = SLOPE_N | SLOPE_E | SLOPE_S | SLOPE_W, ///< all corner are raised, similar to SLOPE_FLAT
+	SLOPE_NWS      = SLOPE_N | SLOPE_W | SLOPE_S,           ///< north, west and south corner are raised
+	SLOPE_WSE      = SLOPE_W | SLOPE_S | SLOPE_E,           ///< west, south and east corner are raised
+	SLOPE_SEN      = SLOPE_S | SLOPE_E | SLOPE_N,           ///< south, east and north corner are raised
+	SLOPE_ENW      = SLOPE_E | SLOPE_N | SLOPE_W,           ///< east, north and west corner are raised
+	SLOPE_STEEP_W  = SLOPE_STEEP | SLOPE_NWS,               ///< a steep slope falling to east (from west)
+	SLOPE_STEEP_S  = SLOPE_STEEP | SLOPE_WSE,               ///< a steep slope falling to north (from south)
+	SLOPE_STEEP_E  = SLOPE_STEEP | SLOPE_SEN,               ///< a steep slope falling to west (from east)
+	SLOPE_STEEP_N  = SLOPE_STEEP | SLOPE_ENW,               ///< a steep slope falling to south (from north)
+
+	SLOPE_HALFTILE = 0x20,                                  ///< one halftile is leveled (non continuous slope)
+	SLOPE_HALFTILE_MASK = 0xE0,                             ///< three bits used for halftile slopes
+	SLOPE_HALFTILE_W = SLOPE_HALFTILE | (CORNER_W << 6),    ///< the west halftile is leveled (non continuous slope)
+	SLOPE_HALFTILE_S = SLOPE_HALFTILE | (CORNER_S << 6),    ///< the south halftile is leveled (non continuous slope)
+	SLOPE_HALFTILE_E = SLOPE_HALFTILE | (CORNER_E << 6),    ///< the east halftile is leveled (non continuous slope)
+	SLOPE_HALFTILE_N = SLOPE_HALFTILE | (CORNER_N << 6),    ///< the north halftile is leveled (non continuous slope)
+};
+
+
+/**
+ * Enumeration for Foundations.
+ */
+enum Foundation {
+	FOUNDATION_NONE,             ///< The tile has no foundation, the slope remains unchanged.
+	FOUNDATION_LEVELED,          ///< The tile is leveled up to a flat slope.
+	FOUNDATION_INCLINED_X,       ///< The tile has an along X-axis inclined foundation.
+	FOUNDATION_INCLINED_Y,       ///< The tile has an along Y-axis inclined foundation.
+	FOUNDATION_STEEP_LOWER,      ///< The tile has a steep slope. The lowest corner is raised by a foundation to allow building railroad on the lower halftile.
+
+	/* Halftile foundations */
+	FOUNDATION_STEEP_BOTH,       ///< The tile has a steep slope. The lowest corner is raised by a foundation and the upper halftile is leveled.
+	FOUNDATION_HALFTILE_W,       ///< Level west halftile non-continuously.
+	FOUNDATION_HALFTILE_S,       ///< Level south halftile non-continuously.
+	FOUNDATION_HALFTILE_E,       ///< Level east halftile non-continuously.
+	FOUNDATION_HALFTILE_N,       ///< Level north halftile non-continuously.
+
+	/* Special anti-zig-zag foundations for single horizontal/vertical track */
+	FOUNDATION_RAIL_W,           ///< Foundation for TRACK_BIT_LEFT, but not a leveled foundation.
+	FOUNDATION_RAIL_S,           ///< Foundation for TRACK_BIT_LOWER, but not a leveled foundation.
+	FOUNDATION_RAIL_E,           ///< Foundation for TRACK_BIT_RIGHT, but not a leveled foundation.
+	FOUNDATION_RAIL_N,           ///< Foundation for TRACK_BIT_UPPER, but not a leveled foundation.
+
+	FOUNDATION_INVALID = 0xFF    ///< Used inside "rail_cmd.cpp" to indicate invalid slope/track combination.
+};
+
+#endif /* SLOPE_TYPE_H */
--- a/src/smallmap_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/smallmap_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -1,33 +1,36 @@
+
 /* $Id$ */
 
 /** @file smallmap_gui.cpp */
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
 #include "bridge_map.h"
 #include "clear_map.h"
 #include "industry_map.h"
 #include "industry.h"
 #include "station_map.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "table/sprites.h"
 #include "landscape.h"
-#include "map.h"
-#include "tile.h"
 #include "gui.h"
+#include "window_gui.h"
 #include "tree_map.h"
 #include "tunnel_map.h"
-#include "window.h"
-#include "gfx.h"
-#include "viewport.h"
-#include "player.h"
-#include "vehicle.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "player_base.h"
 #include "town.h"
-#include "sound.h"
 #include "variables.h"
 #include "blitter/factory.hpp"
+#include "tunnelbridge_map.h"
+#include "strings_func.h"
+#include "zoom_func.h"
+#include "core/endian_func.hpp"
+#include "vehicle_base.h"
+#include "sound_func.h"
+#include "settings_type.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
 
 static const Widget _smallmap_widgets[] = {
 {  WWT_CLOSEBOX,   RESIZE_NONE,    13,     0,    10,     0,    13, STR_00C5,                STR_018B_CLOSE_WINDOW},
@@ -337,13 +340,8 @@
 	TileType t = GetTileType(tile);
 
 	if (t == MP_TUNNELBRIDGE) {
-		TransportType tt;
+		TransportType tt = GetTunnelBridgeTransportType(tile);
 
-		if (IsTunnel(tile)) {
-			tt = GetTunnelTransportType(tile);
-		} else {
-			tt = GetBridgeTransportType(tile);
-		}
 		switch (tt) {
 			case TRANSPORT_RAIL: t = MP_RAILWAY; break;
 			case TRANSPORT_ROAD: t = MP_ROAD;    break;
@@ -612,10 +610,10 @@
 		}
 	}
 
-	tile_x = WP(w,smallmap_d).scroll_x / TILE_SIZE;
-	tile_y = WP(w,smallmap_d).scroll_y / TILE_SIZE;
+	tile_x = WP(w, smallmap_d).scroll_x / TILE_SIZE;
+	tile_y = WP(w, smallmap_d).scroll_y / TILE_SIZE;
 
-	dx = dpi->left + WP(w,smallmap_d).subscroll;
+	dx = dpi->left + WP(w, smallmap_d).subscroll;
 	tile_x -= dx / 4;
 	tile_y += dx / 4;
 	dx &= 3;
@@ -689,8 +687,8 @@
 					(v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) == 0) {
 				/* Remap into flat coordinates. */
 				Point pt = RemapCoords(
-					v->x_pos / TILE_SIZE - WP(w,smallmap_d).scroll_x / TILE_SIZE, // divide each one separately because (a-b)/c != a/c-b/c in integer world
-					v->y_pos / TILE_SIZE - WP(w,smallmap_d).scroll_y / TILE_SIZE, //    dtto
+					v->x_pos / TILE_SIZE - WP(w, smallmap_d).scroll_x / TILE_SIZE, // divide each one separately because (a-b)/c != a/c-b/c in integer world
+					v->y_pos / TILE_SIZE - WP(w, smallmap_d).scroll_y / TILE_SIZE, //    dtto
 					0);
 				x = pt.x;
 				y = pt.y;
@@ -703,7 +701,7 @@
 				skip = false;
 
 				/* Offset X coordinate */
-				x -= WP(w,smallmap_d).subscroll + 3 + dpi->left;
+				x -= WP(w, smallmap_d).subscroll + 3 + dpi->left;
 
 				if (x < 0) {
 					/* if x+1 is 0, that means we're on the very left edge,
@@ -735,7 +733,7 @@
 				(int)(TileX(t->xy) * TILE_SIZE - WP(w, smallmap_d).scroll_x) / TILE_SIZE,
 				(int)(TileY(t->xy) * TILE_SIZE - WP(w, smallmap_d).scroll_y) / TILE_SIZE,
 				0);
-			x = pt.x - WP(w,smallmap_d).subscroll + 3 - (t->sign.width_2 >> 1);
+			x = pt.x - WP(w, smallmap_d).subscroll + 3 - (t->sign.width_2 >> 1);
 			y = pt.y;
 
 			/* Check if the town sign is within bounds */
@@ -766,8 +764,8 @@
 		x /= TILE_SIZE;
 		y /= TILE_SIZE;
 
-		x -= WP(w,smallmap_d).subscroll;
-		x2 -= WP(w,smallmap_d).subscroll;
+		x -= WP(w, smallmap_d).subscroll;
+		x2 -= WP(w, smallmap_d).subscroll;
 
 		DrawVertMapIndicator(x, y, x, y2);
 		DrawVertMapIndicator(x2, y, x2, y2);
@@ -878,7 +876,7 @@
 					 */
 					_left_button_clicked = false;
 
-					pt = RemapCoords(WP(w,smallmap_d).scroll_x, WP(w,smallmap_d).scroll_y, 0);
+					pt = RemapCoords(WP(w, smallmap_d).scroll_x, WP(w,smallmap_d).scroll_y, 0);
 					WP(w2, vp_d).dest_scrollpos_x = pt.x + ((_cursor.pos.x - w->left + 2) << 4) - (w2->viewport->virtual_width >> 1);
 					WP(w2, vp_d).dest_scrollpos_y = pt.y + ((_cursor.pos.y - w->top - 16) << 4) - (w2->viewport->virtual_height >> 1);
 
--- a/src/sound.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/sound.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,21 +4,20 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
 #include "landscape.h"
-#include "map.h"
 #include "mixer.h"
-#include "sound.h"
-#include "vehicle.h"
-#include "window.h"
-#include "viewport.h"
+#include "sound_func.h"
 #include "fileio.h"
 #include "newgrf_sound.h"
-#include "helpers.hpp"
 #include "fios.h"
+#include "window_gui.h"
+#include "core/alloc_func.hpp"
+#include "map_func.h"
+#include "vehicle_base.h"
 
 static uint _file_count;
 static FileEntry *_files;
+MusicFileSettings msf;
 
 // Number of levels of panning per side
 #define PANNING_LEVELS 16
@@ -157,7 +156,7 @@
 
 
 static const byte _vol_factor_by_zoom[] = {255, 190, 134, 87};
-assert_compile(lengthof(_vol_factor_by_zoom) == ZOOM_LVL_END);
+assert_compile(lengthof(_vol_factor_by_zoom) == ZOOM_LVL_END - ZOOM_LVL_BEGIN);
 
 static const byte _sound_base_vol[] = {
 	128,  90, 128, 128, 128, 128, 128, 128,
@@ -216,7 +215,7 @@
 			StartSound(
 				sound,
 				left / max(1, vp->virtual_width / ((PANNING_LEVELS << 1) + 1)) - PANNING_LEVELS,
-				(GetSound(sound)->volume * msf.effect_vol * _vol_factor_by_zoom[vp->zoom]) >> 15
+				(GetSound(sound)->volume * msf.effect_vol * _vol_factor_by_zoom[vp->zoom - ZOOM_LVL_BEGIN]) >> 15
 			);
 			return;
 		}
--- a/src/sound.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/* $Id$ */
-
-/** @file sound.h */
-
-#ifndef SOUND_H
-#define SOUND_H
-
-#include "helpers.hpp"
-
-struct MusicFileSettings {
-	byte playlist;
-	byte music_vol;
-	byte effect_vol;
-	byte custom_1[33];
-	byte custom_2[33];
-	bool playing;
-	bool shuffle;
-	char extmidi[80];
-};
-
-VARDEF MusicFileSettings msf;
-
-struct FileEntry {
-	uint8 file_slot;
-	uint32 file_offset;
-	uint32 file_size;
-	uint16 rate;
-	uint8 bits_per_sample;
-	uint8 channels;
-	uint8 volume;
-	uint8 priority;
-};
-
-bool SoundInitialize(const char *filename);
-uint GetNumOriginalSounds();
-
-enum SoundFx {
-	SND_BEGIN = 0,
-	SND_02_SPLAT = 0,                          //  0 == 0x00 !
-	SND_03_FACTORY_WHISTLE,
-	SND_04_TRAIN,
-	SND_05_TRAIN_THROUGH_TUNNEL,
-	SND_06_SHIP_HORN,
-	SND_07_FERRY_HORN,
-	SND_08_PLANE_TAKE_OFF,
-	SND_09_JET,
-	SND_0A_TRAIN_HORN,
-	SND_0B_MINING_MACHINERY,
-	SND_0C_ELECTRIC_SPARK,
-	SND_0D_STEAM,
-	SND_0E_LEVEL_CROSSING,
-	SND_0F_VEHICLE_BREAKDOWN,
-	SND_10_TRAIN_BREAKDOWN,
-	SND_11_CRASH,
-	SND_12_EXPLOSION,                      // 16 == 0x10
-	SND_13_BIG_CRASH,
-	SND_14_CASHTILL,
-	SND_15_BEEP,                           // 19 == 0x13
-	SND_16_MORSE,                          // 20 == 0x14
-	SND_17_SKID_PLANE,
-	SND_18_HELICOPTER,
-	SND_19_BUS_START_PULL_AWAY,
-	SND_1A_BUS_START_PULL_AWAY_WITH_HORN,
-	SND_1B_TRUCK_START,
-	SND_1C_TRUCK_START_2,
-	SND_1D_APPLAUSE,
-	SND_1E_OOOOH,
-	SND_1F_SPLAT,                          // 29 == 0x1D
-	SND_20_SPLAT_2,                        // 30 == 0x1E
-	SND_21_JACKHAMMER,
-	SND_22_CAR_HORN,
-	SND_23_CAR_HORN_2,
-	SND_24_SHEEP,
-	SND_25_COW,
-	SND_26_HORSE,
-	SND_27_BLACKSMITH_ANVIL,
-	SND_28_SAWMILL,                        // 38 == 0x26 !
-	SND_00_GOOD_YEAR,                      // 39 == 0x27 !
-	SND_01_BAD_YEAR,                       // 40 == 0x28 !
-	SND_29_RIP,                            // 41 == 0x29 !
-	SND_2A_EXTRACT_AND_POP,
-	SND_2B_COMEDY_HIT,
-	SND_2C_MACHINERY,
-	SND_2D_RIP_2,
-	SND_2E_EXTRACT_AND_POP,
-	SND_2F_POP,
-	SND_30_CARTOON_SOUND,
-	SND_31_EXTRACT,
-	SND_32_POP_2,
-	SND_33_PLASTIC_MINE,
-	SND_34_WIND,
-	SND_35_COMEDY_BREAKDOWN,
-	SND_36_CARTOON_CRASH,
-	SND_37_BALLOON_SQUEAK,
-	SND_38_CHAINSAW,
-	SND_39_HEAVY_WIND,
-	SND_3A_COMEDY_BREAKDOWN_2,
-	SND_3B_JET_OVERHEAD,
-	SND_3C_COMEDY_CAR,
-	SND_3D_ANOTHER_JET_OVERHEAD,
-	SND_3E_COMEDY_CAR_2,
-	SND_3F_COMEDY_CAR_3,
-	SND_40_COMEDY_CAR_START_AND_PULL_AWAY,
-	SND_41_MAGLEV,
-	SND_42_LOON_BIRD,
-	SND_43_LION,
-	SND_44_MONKEYS,
-	SND_45_PLANE_CRASHING,
-	SND_46_PLANE_ENGINE_SPUTTERING,
-	SND_47_MAGLEV_2,
-	SND_48_DISTANT_BIRD,                    // 72 == 0x48
-	SND_END
-};
-
-/** Define basic enum properties */
-template <> struct EnumPropsT<SoundFx> : MakeEnumPropsT<SoundFx, byte, SND_BEGIN, SND_END, SND_END> {};
-typedef TinyEnumT<SoundFx> SoundFxByte;
-
-void SndPlayTileFx(SoundFx sound, TileIndex tile);
-void SndPlayVehicleFx(SoundFx sound, const Vehicle *v);
-void SndPlayFx(SoundFx sound);
-void SndCopyToPool();
-
-#endif /* SOUND_H */
--- a/src/sound/cocoa_s.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/sound/cocoa_s.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -22,6 +22,7 @@
 #include "../debug.h"
 #include "../driver.h"
 #include "../mixer.h"
+#include "../core/endian_func.hpp"
 
 #include "cocoa_s.h"
 
--- a/src/sound/sound_driver.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/sound/sound_driver.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -23,5 +23,6 @@
 };
 
 extern SoundDriver *_sound_driver;
+extern char _ini_sounddriver[32];
 
 #endif /* SOUND_SOUND_DRIVER_HPP */
--- a/src/sound/win32_s.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/sound/win32_s.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,9 +3,8 @@
 #include "../stdafx.h"
 #include "../openttd.h"
 #include "../driver.h"
-#include "../functions.h"
 #include "../mixer.h"
-#include "../helpers.hpp"
+#include "../core/alloc_func.hpp"
 #include "win32_s.h"
 #include <windows.h>
 #include <mmsystem.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/sound_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,22 @@
+/* $Id$ */
+
+/** @file sound_func.h Functions related to sound. */
+
+#ifndef SOUND_FUNC_H
+#define SOUND_FUNC_H
+
+#include "sound_type.h"
+#include "vehicle_type.h"
+#include "tile_type.h"
+
+extern MusicFileSettings msf;
+
+bool SoundInitialize(const char *filename);
+uint GetNumOriginalSounds();
+
+void SndPlayTileFx(SoundFx sound, TileIndex tile);
+void SndPlayVehicleFx(SoundFx sound, const Vehicle *v);
+void SndPlayFx(SoundFx sound);
+void SndCopyToPool();
+
+#endif /* SOUND_FUNC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/sound_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,114 @@
+/* $Id$ */
+
+/** @file sound_type.h Types related to sounds. */
+
+#ifndef SOUND_TYPE_H
+#define SOUND_TYPE_H
+
+#include "core/enum_type.hpp"
+
+struct MusicFileSettings {
+	byte playlist;
+	byte music_vol;
+	byte effect_vol;
+	byte custom_1[33];
+	byte custom_2[33];
+	bool playing;
+	bool shuffle;
+	char extmidi[80];
+};
+
+struct FileEntry {
+	uint8 file_slot;
+	uint32 file_offset;
+	uint32 file_size;
+	uint16 rate;
+	uint8 bits_per_sample;
+	uint8 channels;
+	uint8 volume;
+	uint8 priority;
+};
+
+enum SoundFx {
+	SND_BEGIN = 0,
+	SND_02_SPLAT = 0,                          //  0 == 0x00 !
+	SND_03_FACTORY_WHISTLE,
+	SND_04_TRAIN,
+	SND_05_TRAIN_THROUGH_TUNNEL,
+	SND_06_SHIP_HORN,
+	SND_07_FERRY_HORN,
+	SND_08_PLANE_TAKE_OFF,
+	SND_09_JET,
+	SND_0A_TRAIN_HORN,
+	SND_0B_MINING_MACHINERY,
+	SND_0C_ELECTRIC_SPARK,
+	SND_0D_STEAM,
+	SND_0E_LEVEL_CROSSING,
+	SND_0F_VEHICLE_BREAKDOWN,
+	SND_10_TRAIN_BREAKDOWN,
+	SND_11_CRASH,
+	SND_12_EXPLOSION,                      // 16 == 0x10
+	SND_13_BIG_CRASH,
+	SND_14_CASHTILL,
+	SND_15_BEEP,                           // 19 == 0x13
+	SND_16_MORSE,                          // 20 == 0x14
+	SND_17_SKID_PLANE,
+	SND_18_HELICOPTER,
+	SND_19_BUS_START_PULL_AWAY,
+	SND_1A_BUS_START_PULL_AWAY_WITH_HORN,
+	SND_1B_TRUCK_START,
+	SND_1C_TRUCK_START_2,
+	SND_1D_APPLAUSE,
+	SND_1E_OOOOH,
+	SND_1F_SPLAT,                          // 29 == 0x1D
+	SND_20_SPLAT_2,                        // 30 == 0x1E
+	SND_21_JACKHAMMER,
+	SND_22_CAR_HORN,
+	SND_23_CAR_HORN_2,
+	SND_24_SHEEP,
+	SND_25_COW,
+	SND_26_HORSE,
+	SND_27_BLACKSMITH_ANVIL,
+	SND_28_SAWMILL,                        // 38 == 0x26 !
+	SND_00_GOOD_YEAR,                      // 39 == 0x27 !
+	SND_01_BAD_YEAR,                       // 40 == 0x28 !
+	SND_29_RIP,                            // 41 == 0x29 !
+	SND_2A_EXTRACT_AND_POP,
+	SND_2B_COMEDY_HIT,
+	SND_2C_MACHINERY,
+	SND_2D_RIP_2,
+	SND_2E_EXTRACT_AND_POP,
+	SND_2F_POP,
+	SND_30_CARTOON_SOUND,
+	SND_31_EXTRACT,
+	SND_32_POP_2,
+	SND_33_PLASTIC_MINE,
+	SND_34_WIND,
+	SND_35_COMEDY_BREAKDOWN,
+	SND_36_CARTOON_CRASH,
+	SND_37_BALLOON_SQUEAK,
+	SND_38_CHAINSAW,
+	SND_39_HEAVY_WIND,
+	SND_3A_COMEDY_BREAKDOWN_2,
+	SND_3B_JET_OVERHEAD,
+	SND_3C_COMEDY_CAR,
+	SND_3D_ANOTHER_JET_OVERHEAD,
+	SND_3E_COMEDY_CAR_2,
+	SND_3F_COMEDY_CAR_3,
+	SND_40_COMEDY_CAR_START_AND_PULL_AWAY,
+	SND_41_MAGLEV,
+	SND_42_LOON_BIRD,
+	SND_43_LION,
+	SND_44_MONKEYS,
+	SND_45_PLANE_CRASHING,
+	SND_46_PLANE_ENGINE_SPUTTERING,
+	SND_47_MAGLEV_2,
+	SND_48_DISTANT_BIRD,                    // 72 == 0x48
+	SND_END
+};
+
+/** Define basic enum properties */
+template <> struct EnumPropsT<SoundFx> : MakeEnumPropsT<SoundFx, byte, SND_BEGIN, SND_END, SND_END> {};
+typedef TinyEnumT<SoundFx> SoundFxByte;
+
+#endif /* SOUND_TYPE_H */
--- a/src/sprite.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/sprite.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,19 @@
 #ifndef SPRITE_H
 #define SPRITE_H
 
+#include "gfx_type.h"
+
+#define GENERAL_SPRITE_COLOR(color) ((color) + PALETTE_RECOLOR_START)
+#define PLAYER_SPRITE_COLOR(owner) (GENERAL_SPRITE_COLOR(_player_colors[owner]))
+
+/**
+ * Whether a sprite comes from the original graphics files or a new grf file
+ * (either supplied by OpenTTD or supplied by the user).
+ *
+ * @param sprite The sprite to check
+ * @return True if it is a new sprite, or false if it is original.
+ */
+#define IS_CUSTOM_SPRITE(sprite) ((sprite) >= SPR_SIGNALS_BASE)
 
 /* The following describes bunch of sprites to be drawn together in a single 3D
  * bounding box. Used especially for various multi-sprite buildings (like
--- a/src/spritecache.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/spritecache.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,31 +5,29 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "variables.h"
-#include "string.h"
 #include "debug.h"
-#include "functions.h"
-#include "macros.h"
 #include "spritecache.h"
-#include "table/sprites.h"
 #include "fileio.h"
-#include "helpers.hpp"
 #include "spriteloader/grf.hpp"
+#include "core/alloc_func.hpp"
+#include "core/math_func.hpp"
 #ifdef WITH_PNG
 #include "spriteloader/png.hpp"
 #endif /* WITH_PNG */
 #include "blitter/factory.hpp"
 
+#include "table/sprites.h"
+
 /* Default of 4MB spritecache */
 uint _sprite_cache_size = 4;
 
 
 struct SpriteCache {
-	void *ptr;
-	uint8 file_slot;
-	uint32 file_pos;
-	int16 lru;
+ 	void *ptr;
 	uint32 id;
-	const char *grf_name;
+ 	uint32 file_pos;
+	uint16 file_slot;
+ 	int16 lru;
 };
 
 
@@ -53,10 +51,6 @@
 
 		_spritecache = ReallocT(_spritecache, items);
 
-		if (_spritecache == NULL) {
-			error("Unable to allocate sprite cache of %d items (%d bytes)", items, items * sizeof(*_spritecache));
-		}
-
 		/* Reset the new items and update the count */
 		memset(_spritecache + _spritecache_items, 0, (items - _spritecache_items) * sizeof(*_spritecache));
 		_spritecache_items = items;
@@ -148,7 +142,7 @@
 		SpriteLoaderPNG sprite_loader;
 		SpriteLoader::Sprite sprite;
 
-		if (sprite_loader.LoadSprite(&sprite, sc->grf_name, 0, sc->id)) {
+		if (sprite_loader.LoadSprite(&sprite, file_slot, sc->id)) {
 			sc->ptr = BlitterFactoryBase::GetCurrentBlitter()->Encode(&sprite, &AllocSprite);
 			free(sprite.data);
 
@@ -235,7 +229,7 @@
 	SpriteLoaderGrf sprite_loader;
 	SpriteLoader::Sprite sprite;
 
-	if (!sprite_loader.LoadSprite(&sprite, sc->grf_name, file_slot, file_pos)) return NULL;
+	if (!sprite_loader.LoadSprite(&sprite, file_slot, file_pos)) return NULL;
 	if (id == 142) sprite.height = 10; // Compensate for a TTD bug
 	sc->ptr = BlitterFactoryBase::GetCurrentBlitter()->Encode(&sprite, &AllocSprite);
 	free(sprite.data);
@@ -262,19 +256,6 @@
 	sc->lru = 0;
 	sc->id = file_sprite_id;
 
-	const char *fio_grf_name = FioGetFilename();
-	const char *t = strrchr(fio_grf_name, PATHSEPCHAR);
-	char *grf_name;
-	if (t == NULL) grf_name = strdup(fio_grf_name);
-	else           grf_name = strdup(t);
-	/* Make the string lowercase and strip extension */
-	char *t2 = strrchr(grf_name, '.');
-	if (t2 != NULL) *t2 = '\0';
-	strtolower(grf_name);
-
-	free((char *)sc->grf_name);
-	sc->grf_name = grf_name;
-
 	return true;
 }
 
@@ -288,8 +269,6 @@
 	scnew->file_pos = scold->file_pos;
 	scnew->ptr = NULL;
 	scnew->id = scold->id;
-	free((char *)scnew->grf_name);
-	scnew->grf_name = strdup(scold->grf_name);
 }
 
 
@@ -411,8 +390,7 @@
 
 	/* Display an error message and die, in case we found no sprite at all.
 	 * This shouldn't really happen, unless all sprites are locked. */
-	if (best == (uint)-1)
-		error("Out of sprite memory");
+	if (best == (uint)-1) error("Out of sprite memory");
 
 	/* Mark the block as free (the block must be in use) */
 	s = (MemBlock*)GetSpriteCache(best)->ptr - 1;
@@ -491,7 +469,7 @@
 void GfxInitSpriteMem()
 {
 	/* initialize sprite cache heap */
-	if (_spritecache_ptr == NULL) _spritecache_ptr = (MemBlock*)malloc(_sprite_cache_size * 1024 * 1024);
+	if (_spritecache_ptr == NULL) _spritecache_ptr = (MemBlock*)MallocT<byte>(_sprite_cache_size * 1024 * 1024);
 
 	/* A big free block */
 	_spritecache_ptr->size = ((_sprite_cache_size * 1024 * 1024) - sizeof(MemBlock)) | S_FREE_MASK;
@@ -499,7 +477,6 @@
 	NextBlock(_spritecache_ptr)->size = 0;
 
 	/* Reset the spritecache 'pool' */
-	for (uint i = 0; i < _spritecache_items; i++) free((char *)_spritecache[i].grf_name);
 	free(_spritecache);
 	_spritecache_items = 0;
 	_spritecache = NULL;
--- a/src/spritecache.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/spritecache.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,8 @@
 #ifndef SPRITECACHE_H
 #define SPRITECACHE_H
 
+#include "gfx_type.h"
+
 struct Sprite {
 	byte height;
 	uint16 width;
--- a/src/spriteloader/grf.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/spriteloader/grf.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,12 +3,13 @@
 /** @file grf.cpp */
 
 #include "../stdafx.h"
-#include "../gfx.h"
+#include "../gfx_func.h"
 #include "../fileio.h"
 #include "../debug.h"
+#include "../core/alloc_func.hpp"
 #include "grf.hpp"
 
-bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos)
+bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot, uint32 file_pos)
 {
 	/* Open the right file and go to the correct position */
 	FioSeekToFile(file_slot, file_pos);
--- a/src/spriteloader/grf.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/spriteloader/grf.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -12,7 +12,7 @@
 	/**
 	 * Load a sprite from the disk and return a sprite struct which is the same for all loaders.
 	 */
-	bool LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos);
+	bool LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot, uint32 file_pos);
 };
 
 #endif /* SPRITELOADER_GRF_HPP */
--- a/src/spriteloader/png.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/spriteloader/png.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -1,14 +1,15 @@
 /* $Id$ */
 
-/** @file grf.cpp */
+/** @file png.cpp */
 
 #ifdef WITH_PNG
 
 #include "../stdafx.h"
-#include "../gfx.h"
+#include "../gfx_func.h"
 #include "../fileio.h"
-#include "../variables.h"
 #include "../debug.h"
+#include "../core/alloc_func.hpp"
+#include "../core/endian_func.hpp"
 #include "png.hpp"
 #include <png.h>
 
@@ -144,7 +145,7 @@
 		pixelsize = sizeof(uint8);
 	}
 
-	row_pointer = (png_byte *)malloc(info_ptr->width * pixelsize);
+	row_pointer = (png_byte *)MallocT<byte>(info_ptr->width * pixelsize);
 	if (row_pointer == NULL) {
 		png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
 		return false;
@@ -180,8 +181,9 @@
 	return true;
 }
 
-bool SpriteLoaderPNG::LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos)
+bool SpriteLoaderPNG::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot, uint32 file_pos)
 {
+	const char *filename = FioGetFilename(file_slot);
 	if (!LoadPNG(sprite, filename, file_pos, false)) return false;
 	if (!LoadPNG(sprite, filename, file_pos, true)) return false;
 	return true;
--- a/src/spriteloader/png.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/spriteloader/png.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -12,7 +12,7 @@
 	/**
 	 * Load a sprite from the disk and return a sprite struct which is the same for all loaders.
 	 */
-	bool LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos);
+	bool LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot, uint32 file_pos);
 };
 
 #endif /* SPRITELOADER_PNG_HPP */
--- a/src/spriteloader/spriteloader.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/spriteloader/spriteloader.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -26,7 +26,7 @@
 	/**
 	 * Load a sprite from the disk and return a sprite struct which is the same for all loaders.
 	 */
-	virtual bool LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint8 file_slot, uint32 file_pos) = 0;
+	virtual bool LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot, uint32 file_pos) = 0;
 
 	virtual ~SpriteLoader() { }
 };
--- a/src/station.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/station.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,23 +6,12 @@
 #include "openttd.h"
 #include "bridge_map.h"
 #include "debug.h"
-#include "functions.h"
 #include "station_map.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "map.h"
-#include "tile.h"
 #include "station.h"
-#include "gfx.h"
-#include "window.h"
-#include "viewport.h"
-#include "command.h"
 #include "town.h"
-#include "vehicle.h"
 #include "news.h"
 #include "saveload.h"
-#include "economy.h"
-#include "player.h"
+#include "player_func.h"
 #include "airport.h"
 #include "sprite.h"
 #include "depot.h"
@@ -32,10 +21,19 @@
 #include "newgrf_callbacks.h"
 #include "newgrf_station.h"
 #include "yapf/yapf.h"
-#include "date.h"
-#include "helpers.hpp"
 #include "cargotype.h"
 #include "roadveh.h"
+#include "station_gui.h"
+#include "zoom_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "variables.h"
+#include "settings_type.h"
+#include "command_func.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
 
 Station::Station(TileIndex tile)
 {
@@ -66,7 +64,7 @@
 {
 	DEBUG(station, cDebugCtorLevel, "I-%3d", index);
 
-	DeleteName(this->string_id);
+	free(this->name);
 	free(this->speclist);
 
 	if (CleaningPool()) return;
@@ -133,7 +131,7 @@
 void Station::MarkDirty() const
 {
 	if (sign.width_1 != 0) {
-		InvalidateWindowWidget(WC_STATION_VIEW, index, 1);
+		InvalidateWindowWidget(WC_STATION_VIEW, index, SVW_CAPTION);
 
 		/* We use ZOOM_LVL_MAX here, as every viewport can have an other zoom,
 		 *  and there is no way for us to know which is the biggest. So make the
--- a/src/station.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/station.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,14 +6,15 @@
 #define STATION_H
 
 #include "airport.h"
-#include "player.h"
 #include "oldpool.h"
 #include "sprite.h"
-#include "tile.h"
-#include "road.h"
+#include "road_type.h"
 #include "newgrf_station.h"
 #include "newgrf_fsmports.h"
 #include "cargopacket.h"
+#include "cargo_type.h"
+#include "town_type.h"
+#include "core/geometry_type.hpp"
 #include <list>
 #include <set>
 
@@ -141,7 +142,8 @@
 	TileIndex airport_tile;
 	TileIndex dock_tile;
 	Town *town;
-	uint16 string_id;
+	StringID string_id;     ///< Default name (town area) of station
+	char *name;             ///< Custom name
 
 	ViewportSign sign;
 
@@ -261,10 +263,6 @@
 void ShowStationViewWindow(StationID station);
 void UpdateAllStationVirtCoord();
 
-/* sorter stuff */
-void RebuildStationLists();
-void ResortStationLists();
-
 static inline StationID GetMaxStationIndex()
 {
 	/* TODO - This isn't the real content of the function, but
@@ -310,6 +308,8 @@
 RoadStop * AllocateRoadStop();
 void ClearSlot(Vehicle *v);
 
+bool HasStationInUse(StationID station, PlayerID player);
+
 void DeleteOilRig(TileIndex t);
 
 #endif /* STATION_H */
--- a/src/station_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/station_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -8,24 +8,15 @@
 #include "bridge_map.h"
 #include "cmd_helper.h"
 #include "debug.h"
-#include "functions.h"
+#include "tile_cmd.h"
 #include "landscape.h"
 #include "station_map.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "map.h"
-#include "tile.h"
 #include "station.h"
-#include "gfx.h"
-#include "window.h"
-#include "viewport.h"
-#include "command.h"
+#include "viewport_func.h"
+#include "command_func.h"
 #include "town.h"
-#include "vehicle.h"
 #include "news.h"
 #include "saveload.h"
-#include "economy.h"
-#include "player.h"
 #include "airport.h"
 #include "sprite.h"
 #include "depot.h"
@@ -36,16 +27,26 @@
 #include "newgrf_callbacks.h"
 #include "newgrf_station.h"
 #include "yapf/yapf.h"
-#include "date.h"
-#include "helpers.hpp"
 #include "misc/autoptr.hpp"
-#include "road.h"
+#include "road_type.h"
+#include "road_internal.h" /* For drawing catenary/checking road removal */
 #include "cargotype.h"
-#include "strings.h"
+#include "variables.h"
 #include "autoslope.h"
 #include "newgrf_fsmports.h"
 #include "transparency.h"
 #include "water.h"
+#include "station_gui.h"
+#include "strings_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "string_func.h"
+#include "signal_func.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
 
 DEFINE_OLD_POOL_GENERIC(Station, Station)
 DEFINE_OLD_POOL_GENERIC(RoadStop, RoadStop)
@@ -724,7 +725,7 @@
 	}
 
 	/* redraw the station view since acceptance changed */
-	InvalidateWindowWidget(WC_STATION_VIEW, st->index, 4);
+	InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_ACCEPTLIST);
 }
 
 static void UpdateStationSignCoord(Station *st)
@@ -768,7 +769,7 @@
  */
 CommandCost CheckFlatLandBelow(TileIndex tile, uint w, uint h, uint flags, uint32 invalid_dirs, StationID* station, const FSMportsSpec *fsmportspec, bool check_clear = true)
 {
-	CommandCost cost;
+	CommandCost cost(EXPENSES_CONSTRUCTION);
 	int allowed_z = -1;
 	byte layout_set = GB(invalid_dirs, 0, 3);
 	byte *b = NULL;
@@ -882,6 +883,15 @@
 		curh = max(TileY(st->train_tile) + curh, TileY(tile) + h) - y;
 		tile = TileXY(x, y);
 	} else {
+		/* do not allow modifying non-uniform stations,
+		 * the uniform-stations code wouldn't handle it well */
+		BEGIN_TILE_LOOP(t, st->trainst_w, st->trainst_h, st->train_tile)
+			if (!st->TileBelongsToRailStation(t)) { // there may be adjoined station
+				_error_message = STR_306D_NONUNIFORM_STATIONS_DISALLOWED;
+				return false;
+			}
+		END_TILE_LOOP(t, st->trainst_w, st->trainst_h, st->train_tile)
+
 		/* check so the orientation is the same */
 		if (GetRailStationAxis(st->train_tile) != axis) {
 			_error_message = STR_306D_NONUNIFORM_STATIONS_DISALLOWED;
@@ -983,11 +993,9 @@
 	int w_org, h_org;
 	CommandCost ret;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	/* Does the authority allow this? */
 	if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile_org)) return CMD_ERROR;
-	if (!ValParamRailtype(p2 & 0xF)) return CMD_ERROR;
+	if (!ValParamRailtype((RailType)(p2 & 0xF))) return CMD_ERROR;
 
 	/* unpack parameters */
 	Axis axis = Extract<Axis, 0>(p1);
@@ -1016,7 +1024,7 @@
 	 * https://sourceforge.net/tracker/index.php?func=detail&aid=1029064&group_id=103924&atid=636365 */
 	ret = CheckFlatLandBelow(tile_org, w_org, h_org, flags & ~DC_EXEC, 5 << axis, _patches.nonuniform_stations ? &est : NULL);
 	if (CmdFailed(ret)) return ret;
-	CommandCost cost(ret.GetCost() + (numtracks * _price.train_station_track + _price.train_station_length) * plat_len);
+	CommandCost cost(EXPENSES_CONSTRUCTION, ret.GetCost() + (numtracks * _price.train_station_track + _price.train_station_length) * plat_len);
 
 	Station *st = NULL;
 	bool check_surrounding = true;
@@ -1085,7 +1093,7 @@
 	}
 
 	/* Check if the given station class is valid */
-	if (GB(p2, 8, 8) >= STAT_CLASS_MAX) return CMD_ERROR;
+	if (GB(p2, 8, 8) >= GetNumStationClasses()) return CMD_ERROR;
 
 	/* Check if we can allocate a custom stationspec to this station */
 	const StationSpec *statspec = GetCustomStationSpec((StationClassID)GB(p2, 8, 8), GB(p2, 16, 8));
@@ -1154,7 +1162,7 @@
 
 				tile += tile_delta;
 			} while (--w);
-			SetSignalsOnBothDir(tile_org, track);
+			AddTrackToSignalBuffer(tile_org, track, _current_player);
 			YapfNotifyTrackLayoutChange(tile_org, track);
 			tile_org += tile_delta ^ TileDiffXY(1, 1); // perpendicular to tile_delta
 		} while (--numtracks);
@@ -1164,6 +1172,7 @@
 		UpdateStationAcceptance(st, false);
 		RebuildStationLists();
 		InvalidateWindow(WC_STATION_LIST, st->owner);
+		InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_TRAINS);
 		/* success, so don't delete the new station */
 		st_auto_delete.Detach();
 	}
@@ -1255,30 +1264,41 @@
 	int size_x = ex - sx + 1;
 	int size_y = ey - sy + 1;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	/* Do the action for every tile into the area */
 	BEGIN_TILE_LOOP(tile2, size_x, size_y, tile) {
-		/* Make sure the specified tile belongs to the current player, and that it is a railroad station. */
-		if (!IsTileType(tile2, MP_STATION) || !IsRailwayStation(tile2) || !_patches.nonuniform_stations) {
+		/* Make sure the specified tile is a railroad station */
+		if (!IsTileType(tile2, MP_STATION) || !IsRailwayStation(tile2)) {
+			continue;
+		}
+
+		/* If there is a vehicle on ground, do not allow to remove (flood) the tile */
+		if (!EnsureNoVehicleOnGround(tile2)) {
 			continue;
 		}
 
 		/* Check ownership of station */
 		Station *st = GetStationByTile(tile2);
-		if (_current_player != OWNER_WATER && (!CheckOwnership(st->owner) || !EnsureNoVehicleOnGround(tile2))) {
+		if (_current_player != OWNER_WATER && !CheckOwnership(st->owner)) {
 			continue;
 		}
 
+		/* Do not allow removing from stations if non-uniform stations are not enabled
+		 * The check must be here to give correct error message
+ 		 */
+		if (!_patches.nonuniform_stations) return_cmd_error(STR_306D_NONUNIFORM_STATIONS_DISALLOWED);
+
 		/* If we reached here, the tile is valid so increase the quantity of tiles we will remove */
 		quantity++;
 
 		if (flags & DC_EXEC) {
+			/* read variables before the station tile is removed */
 			uint specindex = GetCustomStationSpecIndex(tile2);
 			Track track = GetRailStationTrack(tile2);
+			Owner owner = GetTileOwner(tile2);
+
 			DoClearSquare(tile2);
 			st->rect.AfterRemoveTile(st, tile2);
-			SetSignalsOnBothDir(tile2, track);
+			AddTrackToSignalBuffer(tile2, track, owner);
 			YapfNotifyTrackLayoutChange(tile2, track);
 
 			DeallocateSpecFromStation(st, specindex);
@@ -1293,6 +1313,7 @@
 			/* if we deleted the whole station, delete the train facility. */
 			if (st->train_tile == 0) {
 				st->facilities &= ~FACIL_TRAIN;
+				InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_TRAINS);
 				UpdateStationVirtCoordDirty(st);
 				DeleteStationIfEmpty(st);
 			}
@@ -1302,7 +1323,7 @@
 	/* If we've not removed any tiles, give an error */
 	if (quantity == 0) return CMD_ERROR;
 
-	return CommandCost(_price.remove_rail_station * quantity);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_rail_station * quantity);
 }
 
 
@@ -1323,20 +1344,22 @@
 
 	assert(w != 0 && h != 0);
 
-	CommandCost cost;
+	CommandCost cost(EXPENSES_CONSTRUCTION);
 	/* clear all areas of the station */
 	do {
 		int w_bak = w;
 		do {
-			// for nonuniform stations, only remove tiles that are actually train station tiles
+			/* for nonuniform stations, only remove tiles that are actually train station tiles */
 			if (st->TileBelongsToRailStation(tile)) {
 				if (!EnsureNoVehicleOnGround(tile))
 					return CMD_ERROR;
 				cost.AddCost(_price.remove_rail_station);
 				if (flags & DC_EXEC) {
+					/* read variables before the station tile is removed */
 					Track track = GetRailStationTrack(tile);
+					Owner owner = GetTileOwner(tile); // _current_player can be OWNER_WATER
 					DoClearSquare(tile);
-					SetSignalsOnBothDir(tile, track);
+					AddTrackToSignalBuffer(tile, track, owner);
 					YapfNotifyTrackLayoutChange(tile, track);
 				}
 			}
@@ -1357,6 +1380,7 @@
 		st->num_specs = 0;
 		st->speclist  = NULL;
 
+		InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_TRAINS);
 		UpdateStationVirtCoordDirty(st);
 		DeleteStationIfEmpty(st);
 	}
@@ -1365,29 +1389,6 @@
 }
 
 /**
- * Switches the rail type at a railway station tile.
- * @param tile        The tile on which the railtype is to be convert.
- * @param totype      The railtype we want to convert to
- * @param exec        Switches between test and execute mode
- * @return            The cost and state of the operation
- * @retval CMD_ERROR  An error occured during the operation.
- */
-CommandCost DoConvertStationRail(TileIndex tile, RailType totype, bool exec)
-{
-	/* Tile is not a railroad station? */
-	if (!IsRailwayStation(tile)) return CMD_ERROR;
-
-	if (exec) {
-		SetRailType(tile, totype);
-		MarkTileDirtyByTile(tile);
-		YapfNotifyTrackLayoutChange(tile, GetRailStationTrack(tile));
-		VehicleFromPos(tile, &tile, UpdateTrainPowerProc);
-	}
-
-	return CommandCost(RailBuildCost(totype) / 2);
-}
-
-/**
  * @param truck_station Determines whether a stop is RoadStop::BUS or RoadStop::TRUCK
  * @param st The Station to do the whole procedure for
  * @return a pointer to where to link a new RoadStop*
@@ -1436,8 +1437,6 @@
 	/* Road bits in the wrong direction */
 	if (build_over_road && (GetAllRoadBits(tile) & ((Axis)p1 == AXIS_X ? ROAD_Y : ROAD_X)) != 0) return_cmd_error(STR_DRIVE_THROUGH_ERROR_DIRECTION);
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile)) return CMD_ERROR;
 
 	CommandCost cost;
@@ -1447,13 +1446,23 @@
 		if (IsTileOwner(tile, OWNER_TOWN) && !_patches.road_stop_on_town_road) return_cmd_error(STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD);
 		if (GetRoadTileType(tile) != ROAD_TILE_NORMAL) return CMD_ERROR;
 
+		RoadTypes cur_rts = GetRoadTypes(tile);
+
+		/* there is a road, check if we can build road+tram stop over it */
+		if (HasBit(cur_rts, ROADTYPE_ROAD)) {
+			Owner road_owner = GetRoadOwner(tile, ROADTYPE_ROAD);
+			if (road_owner != OWNER_TOWN && road_owner != OWNER_NONE && !CheckOwnership(road_owner)) return CMD_ERROR;
+		}
+
+		/* there is a tram, check if we can build road+tram stop over it */
+		if (HasBit(cur_rts, ROADTYPE_TRAM)) {
+			Owner tram_owner = GetRoadOwner(tile, ROADTYPE_TRAM);
+			if (tram_owner != OWNER_NONE && !CheckOwnership(tram_owner)) return CMD_ERROR;
+		}
+
 		/* Don't allow building the roadstop when vehicles are already driving on it */
 		if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 
-		RoadTypes cur_rts = GetRoadTypes(tile);
-		if (GetRoadOwner(tile, ROADTYPE_ROAD) != OWNER_TOWN && HasBit(cur_rts, ROADTYPE_ROAD) && !CheckOwnership(GetRoadOwner(tile, ROADTYPE_ROAD))) return CMD_ERROR;
-		if (HasBit(cur_rts, ROADTYPE_TRAM) && !CheckOwnership(GetRoadOwner(tile, ROADTYPE_TRAM))) return CMD_ERROR;
-
 		/* Do not remove roadtypes! */
 		rts |= cur_rts;
 	}
@@ -1536,6 +1545,7 @@
 		UpdateStationAcceptance(st, false);
 		RebuildStationLists();
 		InvalidateWindow(WC_STATION_LIST, st->owner);
+		InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_ROADVEHS);
 		/* success, so don't delete the new station and the new road stop */
 		st_auto_delete.Detach();
 		rs_auto_delete.Detach();
@@ -1586,6 +1596,7 @@
 			pred->next = cur_stop->next;
 		}
 
+		InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_ROADVEHS);
 		delete cur_stop;
 		DoClearSquare(tile);
 		st->rect.AfterRemoveTile(st, tile);
@@ -1594,7 +1605,7 @@
 		DeleteStationIfEmpty(st);
 	}
 
-	return CommandCost((is_truck) ? _price.remove_truck_station : _price.remove_bus_station);
+	return CommandCost(EXPENSES_CONSTRUCTION, (is_truck) ? _price.remove_truck_station : _price.remove_bus_station);
 }
 
 /** Remove a bus or truck stop
@@ -1648,8 +1659,6 @@
 	byte layout_set = GB(p1, 0, 3);
 	const uint32 airport_type_for_flat_check = (GB(p2, 8, 8) << 3) | layout_set;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	/* Check if a valid, buildable airport was chosen for construction */
 	//if (p1 > lengthof(_airport_sections) || !HasBit(GetValidAirports(), p1)) return CMD_ERROR;
 
@@ -1819,6 +1828,7 @@
 		UpdateStationAcceptance(st, false);
 		RebuildStationLists();
 		InvalidateWindow(WC_STATION_LIST, st->owner);
+		InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_PLANES);
 		/* success, so don't delete the new station */
 		st_auto_delete.Detach();
 	}
@@ -1837,7 +1847,7 @@
 	int w = fsmportsspec->size_x[layout_set];
 	int h = fsmportsspec->size_y[layout_set];
 
-	CommandCost cost(w * h * _price.remove_airport);
+	CommandCost cost(EXPENSES_CONSTRUCTION, w * h * _price.remove_airport);
 
 	Vehicle *v;
 	FOR_ALL_VEHICLES(v) {
@@ -1884,6 +1894,7 @@
 		st->airport_tile = 0;
 		st->facilities &= ~FACIL_AIRPORT;
 
+		InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_PLANES);
 		UpdateStationVirtCoordDirty(st);
 		DeleteStationIfEmpty(st);
 	}
@@ -1899,8 +1910,6 @@
  */
 CommandCost CmdBuildBuoy(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	if (!IsWaterTile(tile) || tile == 0) return_cmd_error(STR_304B_SITE_UNSUITABLE);
 	if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
 
@@ -1932,22 +1941,28 @@
 		UpdateStationAcceptance(st, false);
 		RebuildStationLists();
 		InvalidateWindow(WC_STATION_LIST, st->owner);
+		InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_SHIPS);
 		/* success, so don't delete the new station */
 		st_auto_delete.Detach();
 	}
 
-	return CommandCost(_price.build_dock);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.build_dock);
 }
 
-/* Checks if any ship is servicing the buoy specified. Returns yes or no */
-static bool CheckShipsOnBuoy(Station *st)
+/**
+ * Tests whether the player's vehicles have this station in orders
+ * When player == INVALID_PLAYER, then check all vehicles
+ * @param station station ID
+ * @param player player ID, INVALID_PLAYER to disable the check
+ */
+bool HasStationInUse(StationID station, PlayerID player)
 {
 	const Vehicle *v;
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_SHIP) {
+		if (player == INVALID_PLAYER || v->owner == player) {
 			const Order *order;
 			FOR_VEHICLE_ORDERS(v, order) {
-				if (order->type == OT_GOTO_STATION && order->dest == st->index) {
+				if (order->type == OT_GOTO_STATION && order->dest == station) {
 					return true;
 				}
 			}
@@ -1963,7 +1978,7 @@
 
 	TileIndex tile = st->dock_tile;
 
-	if (CheckShipsOnBuoy(st))   return_cmd_error(STR_BUOY_IS_IN_USE);
+	if (HasStationInUse(st->index, INVALID_PLAYER)) return_cmd_error(STR_BUOY_IS_IN_USE);
 	if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
 
 	if (flags & DC_EXEC) {
@@ -1973,17 +1988,19 @@
 		st->facilities &= ~FACIL_DOCK;
 		st->had_vehicle_of_type &= ~HVOT_BUOY;
 
+		InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_SHIPS);
+
 		/* We have to set the water tile's state to the same state as before the
 		 * buoy was placed. Otherwise one could plant a buoy on a canal edge,
 		 * remove it and flood the land (if the canal edge is at level 0) */
-		MakeWaterOrCanalDependingOnSurroundings(tile, GetTileOwner(tile));
+		MakeWaterOrCanalDependingOnOwner(tile, GetTileOwner(tile));
 		MarkTileDirtyByTile(tile);
 
 		UpdateStationVirtCoordDirty(st);
 		DeleteStationIfEmpty(st);
 	}
 
-	return CommandCost(_price.remove_truck_station);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_truck_station);
 }
 
 static const TileIndexDiffC _dock_tileoffs_chkaround[] = {
@@ -2005,8 +2022,6 @@
 {
 	CommandCost cost;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	DiagDirection direction;
 	switch (GetTileSlope(tile, NULL)) {
 		case SLOPE_SW: direction = DIAGDIR_NE; break;
@@ -2094,10 +2109,11 @@
 		UpdateStationAcceptance(st, false);
 		RebuildStationLists();
 		InvalidateWindow(WC_STATION_LIST, st->owner);
+		InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_SHIPS);
 		/* success, so don't delete the new station */
 		st_auto_delete.Detach();
 	}
-	return CommandCost(_price.build_dock);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.build_dock);
 }
 
 static CommandCost RemoveDock(Station *st, uint32 flags)
@@ -2122,11 +2138,12 @@
 		st->dock_tile = 0;
 		st->facilities &= ~FACIL_DOCK;
 
+		InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_SHIPS);
 		UpdateStationVirtCoordDirty(st);
 		DeleteStationIfEmpty(st);
 	}
 
-	return CommandCost(_price.remove_dock);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_dock);
 }
 
 #include "table/station_land.h"
@@ -2139,16 +2156,20 @@
 static void DrawTile_Station(TileInfo *ti)
 {
 	const DrawTileSprites *t = NULL;
-	RailType railtype;
 	RoadTypes roadtypes;
+	int32 total_offset;
+	int32 custom_ground_offset;
+
 	if (IsRailwayStation(ti->tile)) {
-		railtype = GetRailType(ti->tile);
+		const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile));
 		roadtypes = ROADTYPES_NONE;
+		total_offset = rti->total_offset;
+		custom_ground_offset = rti->custom_ground_offset;
 	} else {
 		roadtypes = GetRoadTypes(ti->tile);
-		railtype = RAILTYPE_BEGIN;
+		total_offset = 0;
+		custom_ground_offset = 0;
 	}
-	const RailtypeInfo *rti = GetRailTypeInfo(railtype);
 	uint32 relocation = 0;
 	const Station *st = NULL;
 	const StationSpec *statspec = NULL;
@@ -2218,9 +2239,9 @@
 	SpriteID image = t->ground_sprite;
 	if (HasBit(image, SPRITE_MODIFIER_USE_OFFSET)) {
 		image += (FSMport)? GetCustomFSMportsGroundRelocation(fsmportspec, st, ti->tile) : GetCustomStationGroundRelocation(statspec, st, ti->tile);
-		image += rti->custom_ground_offset;
+		image += custom_ground_offset;
 	} else {
-		image += rti->total_offset;
+		image += total_offset;
 	}
 
 	// if ground tile 0x0F8D, but tile is desert/snow, then choose desert/snow graphic
@@ -2245,13 +2266,13 @@
 	foreach_draw_tile_seq(dtss, t->seq) {
 		image = dtss->image;
 		if (relocation == 0 || HasBit(image, SPRITE_MODIFIER_USE_OFFSET)) {
-			image += rti->total_offset;
+			image += total_offset;
 		} else {
 			image += relocation;
 		}
 
 		SpriteID pal;
-		if (!IsTransparencySet(TO_BUILDINGS) && HasBit(image, PALETTE_MODIFIER_COLOR)) {
+		if (!(!HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_BUILDINGS)) && HasBit(image, PALETTE_MODIFIER_COLOR)) {
 			pal = palette;
 		} else {
 			pal = dtss->pal;
@@ -2263,7 +2284,7 @@
 				ti->x + dtss->delta_x, ti->y + dtss->delta_y,
 				dtss->size_x, dtss->size_y,
 				dtss->size_z, ti->z + dtss->delta_z,
-				IsTransparencySet(TO_BUILDINGS)
+				!HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_BUILDINGS)
 			);
 		} else {
 			AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y, IsTransparencySet(TO_BUILDINGS));
@@ -2273,12 +2294,17 @@
 
 void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, RoadType roadtype, int image)
 {
-	const RailtypeInfo *rti = GetRailTypeInfo(railtype);
+	int32 total_offset = 0;
 	SpriteID pal = PLAYER_SPRITE_COLOR(_local_player);
 	const DrawTileSprites *t = &_station_display_datas[st][image];
 
+	if (railtype != INVALID_RAILTYPE) {
+		const RailtypeInfo *rti = GetRailTypeInfo(railtype);
+		total_offset = rti->total_offset;
+	}
+
 	SpriteID img = t->ground_sprite;
-	DrawSprite(img + rti->total_offset, HasBit(img, PALETTE_MODIFIER_COLOR) ? pal : PAL_NONE, x, y);
+	DrawSprite(img + total_offset, HasBit(img, PALETTE_MODIFIER_COLOR) ? pal : PAL_NONE, x, y);
 
 	if (roadtype == ROADTYPE_TRAM) {
 		DrawSprite(SPR_TRAMWAY_TRAM + (t->ground_sprite == SPR_ROAD_PAVED_STRAIGHT_X ? 1 : 0), PAL_NONE, x, y);
@@ -2287,7 +2313,7 @@
 	const DrawTileSeqStruct *dtss;
 	foreach_draw_tile_seq(dtss, t->seq) {
 		Point pt = RemapCoords(dtss->delta_x, dtss->delta_y, dtss->delta_z);
-		DrawSprite(dtss->image + rti->total_offset, pal, x + pt.x, y + pt.y);
+		DrawSprite(dtss->image + total_offset, pal, x + pt.x, y + pt.y);
 	}
 }
 
@@ -2437,16 +2463,16 @@
 	215, 195, 175, 155, 135, 115, 95, 75, 55, 35, 15, 0
 };
 
-static uint32 VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y)
+static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y)
 {
 	if (v->type == VEH_TRAIN) {
 		if (IsRailwayStation(tile) && IsFrontEngine(v) &&
 				!IsCompatibleTrainStationTile(tile + TileOffsByDiagDir(DirToDiagDir(v->direction)), tile)) {
 			StationID station_id = GetStationIndex(tile);
 
-			if ((!(v->current_order.flags & OF_NON_STOP) && !_patches.new_nonstop) ||
+			if ((!(v->current_order.flags & OFB_NON_STOP) && !_patches.new_nonstop) ||
 					(v->current_order.type == OT_GOTO_STATION && v->current_order.dest == station_id)) {
-				if (!(_patches.new_nonstop && v->current_order.flags & OF_NON_STOP) &&
+				if (!(_patches.new_nonstop && v->current_order.flags & OFB_NON_STOP) &&
 						v->current_order.type != OT_LEAVESTATION &&
 						v->last_station_visited != station_id) {
 					DiagDirection dir = DirToDiagDir(v->direction);
@@ -2457,7 +2483,7 @@
 					if (DiagDirToAxis(dir) != AXIS_X) Swap(x, y);
 					if (y == TILE_SIZE / 2) {
 						if (dir != DIAGDIR_SE && dir != DIAGDIR_SW) x = TILE_SIZE - 1 - x;
-						if (x == 12) return VETSB_ENTERED_STATION | (station_id << VETS_STATION_ID_OFFSET); /* enter station */
+						if (x == 12) return VETSB_ENTERED_STATION | (VehicleEnterTileStatus)(station_id << VETS_STATION_ID_OFFSET); /* enter station */
 						if (x < 12) {
 							uint16 spd;
 
@@ -2628,9 +2654,9 @@
 
 	StationID index = st->index;
 	if (waiting_changed) {
-		InvalidateWindow(WC_STATION_VIEW, index);
+		InvalidateWindow(WC_STATION_VIEW, index); // update whole window
 	} else {
-		InvalidateWindowWidget(WC_STATION_VIEW, index, 5);
+		InvalidateWindowWidget(WC_STATION_VIEW, index, SVW_RATINGLIST); // update only ratings list
 	}
 }
 
@@ -2720,19 +2746,13 @@
 
 	if (!IsUniqueStationName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
 
-	StringID str = AllocateName(_cmd_text, 6);
-	if (str == 0) return CMD_ERROR;
-
 	if (flags & DC_EXEC) {
-		StringID old_str = st->string_id;
-
-		st->string_id = str;
+		free(st->name);
+		st->name = strdup(_cmd_text);
+
 		UpdateStationVirtCoord(st);
-		DeleteName(old_str);
 		ResortStationLists();
 		MarkWholeScreenDirty();
-	} else {
-		DeleteName(str);
 	}
 
 	return CommandCost();
@@ -3076,11 +3096,11 @@
 					DiagDirection direction = AxisToDiagDir(GetRailStationAxis(tile));
 					if (!AutoslopeCheckForEntranceEdge(tile, z_new, tileh_new, direction)) break;
 					if (!AutoslopeCheckForEntranceEdge(tile, z_new, tileh_new, ReverseDiagDir(direction))) break;
-					return _price.terraform;
+					return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 				}
 
 				case STATION_AIRPORT:
-					return _price.terraform;
+					return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 
 				case STATION_TRUCK:
 				case STATION_BUS: {
@@ -3089,7 +3109,7 @@
 					if (IsDriveThroughStopTile(tile)) {
 						if (!AutoslopeCheckForEntranceEdge(tile, z_new, tileh_new, ReverseDiagDir(direction))) break;
 					}
-					return _price.terraform;
+					return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 				}
 
 				default: break;
@@ -3153,6 +3173,7 @@
 	SLE_CONDNULL(1, 0, 3),
 
 	    SLE_VAR(Station, string_id,                  SLE_STRINGID),
+	SLE_CONDSTR(Station, name,                       SLE_STR, 0,                 84, SL_MAX_VERSION),
 	    SLE_VAR(Station, had_vehicle_of_type,        SLE_UINT16),
 
 	    SLE_VAR(Station, time_since_load,            SLE_UINT8),
--- a/src/station_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/station_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,41 +5,28 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "strings.h"
-#include "table/strings.h"
-#include "window.h"
 #include "gui.h"
+#include "window_gui.h"
+#include "textbuf_gui.h"
 #include "station.h"
-#include "gfx.h"
-#include "player.h"
-#include "economy.h"
+#include "player_func.h"
+#include "economy_func.h"
 #include "town.h"
-#include "command.h"
+#include "command_func.h"
 #include "variables.h"
 #include "vehicle_gui.h"
-#include "date.h"
-#include "vehicle.h"
-#include "table/sprites.h"
-#include "helpers.hpp"
 #include "cargotype.h"
+#include "station_gui.h"
+#include "station.h"
+#include "strings_func.h"
+#include "core/alloc_func.hpp"
+#include "window_func.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "widgets/dropdown_func.h"
 
-enum StationListWidgets {
-	STATIONLIST_WIDGET_CLOSEBOX = 0,
-	STATIONLIST_WIDGET_LIST = 3,
-	STATIONLIST_WIDGET_TRAIN =6,
-	STATIONLIST_WIDGET_TRUCK,
-	STATIONLIST_WIDGET_BUS,
-	STATIONLIST_WIDGET_AIRPLANE,
-	STATIONLIST_WIDGET_SHIP,
-	STATIONLIST_WIDGET_CARGOSTART = 20,
-	STATIONLIST_WIDGET_NOCARGOWAITING = 12,
-	STATIONLIST_WIDGET_FACILALL = 14,
-	STATIONLIST_WIDGET_CARGOALL,
-	STATIONLIST_WIDGET_SORTBY,
-	STATIONLIST_WIDGET_SORTCRITERIA,
-	STATIONLIST_WIDGET_SORTDROPBTN,
-};
+#include "table/strings.h"
+#include "table/sprites.h"
 
 typedef int CDECL StationSortListingTypeFunction(const void*, const void*);
 
@@ -48,23 +35,32 @@
 static StationSortListingTypeFunction StationWaitingSorter;
 static StationSortListingTypeFunction StationRatingMaxSorter;
 
-/** Draw small boxes of cargo amount and ratings data at the given
+bool _station_show_coverage;
+
+/**
+ * Draw small boxes of cargo amount and ratings data at the given
  * coordinates. If amount exceeds 576 units, it is shown 'full', same
  * goes for the rating: at above 90% orso (224) it is also 'full'
- * Each cargo-bar is 16 pixels wide and 6 pixels high
- * Each rating 14 pixels wide and 1 pixel high and is 1 pixel below the cargo-bar
+ *
  * @param x coordinate to draw the box at
  * @param y coordinate to draw the box at
  * @param type Cargo type
  * @param amount Cargo amount
- * @param rating ratings data for that particular cargo */
+ * @param rating ratings data for that particular cargo
+ *
+ * @note Each cargo-bar is 16 pixels wide and 6 pixels high
+ * @note Each rating 14 pixels wide and 1 pixel high and is 1 pixel below the cargo-bar
+ */
 static void StationsWndShowStationRating(int x, int y, CargoID type, uint amount, byte rating)
 {
+	static const uint units_full  = 576; ///< number of units to show station as 'full'
+	static const uint rating_full = 224; ///< rating needed so it is shown as 'full'
+
 	const CargoSpec *cs = GetCargo(type);
 	if (!cs->IsValid()) return;
 
 	int colour = cs->rating_colour;
-	uint w = (minu(amount, 576) + 5) / 36;
+	uint w = (minu(amount, units_full) + 5) / 36;
 
 	/* Draw total cargo (limited) on station (fits into 16 pixels) */
 	if (w != 0) GfxFillRect(x, y, x + w - 1, y + 6, colour);
@@ -84,7 +80,7 @@
 	/* Draw green/red ratings bar (fits into 14 pixels) */
 	y += 8;
 	GfxFillRect(x + 1, y, x + 14, y, 0xB8);
-	rating = minu(rating,  224) / 16;
+	rating = minu(rating, rating_full) / 16;
 	if (rating != 0) GfxFillRect(x + 1, y, x + rating, y, 0xD0);
 }
 
@@ -168,23 +164,28 @@
 	return (_internal_sort_order & 1) ? maxr2 - maxr1 : maxr1 - maxr2;
 }
 
+/** Flags for station list */
 enum StationListFlags {
-	SL_ORDER   = 0x01,
-	SL_RESORT  = 0x02,
-	SL_REBUILD = 0x04,
+	SL_ORDER   = 1 << 0, ///< Order - ascending (=0), descending (=1)
+	SL_RESORT  = 1 << 1, ///< Resort the list
+	SL_REBUILD = 1 << 2, ///< Rebuild the list
 };
 
 DECLARE_ENUM_AS_BIT_SET(StationListFlags);
 
+/** Information about station list */
 struct plstations_d {
-	const Station** sort_list;
-	uint16 list_length;
-	byte sort_type;
-	StationListFlags flags;
-	uint16 resort_timer;  //was byte refresh_counter;
+	const Station** sort_list; ///< Pointer to list of stations
+	uint16 list_length;        ///< Number of stations in list
+	uint16 resort_timer;       ///< Tick counter to resort the list
+	byte sort_type;            ///< Sort type - name, waiting, ...
+	byte flags;                ///< Flags - SL_ORDER, SL_RESORT, SL_REBUILD
 };
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(plstations_d));
 
+/**
+ * Set the 'SL_REBUILD' flag for all station lists
+ */
 void RebuildStationLists()
 {
 	Window* const *wz;
@@ -198,6 +199,9 @@
 	}
 }
 
+/**
+ * Set the 'SL_RESORT' flag for all station lists
+ */
 void ResortStationLists()
 {
 	Window* const *wz;
@@ -211,6 +215,15 @@
 	}
 }
 
+/**
+ * Rebuild station list if the SL_REBUILD flag is set
+ *
+ * @param sl pointer to plstations_d (station list and flags)
+ * @param owner player whose stations are to be in list
+ * @param facilities types of stations of interest
+ * @param cargo_filter bitmap of cargo types to include
+ * @param include_empty whether we should include stations without waiting cargo
+ */
 static void BuildStationsList(plstations_d* sl, PlayerID owner, byte facilities, uint32 cargo_filter, bool include_empty)
 {
 	uint n = 0;
@@ -220,12 +233,11 @@
 
 	/* Create array for sorting */
 	const Station** station_sort = MallocT<const Station*>(GetMaxStationIndex() + 1);
-	if (station_sort == NULL) error("Could not allocate memory for the station-sorting-list");
 
 	DEBUG(misc, 3, "Building station list for player %d", owner);
 
 	FOR_ALL_STATIONS(st) {
-		if (st->owner == owner) {
+		if (st->owner == owner || (st->owner == OWNER_NONE && !st->IsBuoy() && HasStationInUse(st->index, owner))) {
 			if (facilities & st->facilities) { //only stations with selected facilities
 				int num_waiting_cargo = 0;
 				for (CargoID j = 0; j < NUM_CARGO; j++) {
@@ -247,7 +259,6 @@
 
 	free((void*)sl->sort_list);
 	sl->sort_list = MallocT<const Station*>(n);
-	if (n != 0 && sl->sort_list == NULL) error("Could not allocate memory for the station-sorting-list");
 	sl->list_length = n;
 
 	for (uint i = 0; i < n; ++i) sl->sort_list[i] = station_sort[i];
@@ -257,6 +268,12 @@
 	free((void*)station_sort);
 }
 
+
+/**
+ * Sort station list if the SL_RESORT flag is set
+ *
+ * @param sl pointer to plstations_d (station list and flags)
+ */
 static void SortStationsList(plstations_d *sl)
 {
 	static StationSortListingTypeFunction* const _station_sorter[] = {
@@ -276,6 +293,12 @@
 	sl->flags &= ~SL_RESORT;
 }
 
+/**
+ * Fuction called when any WindowEvent occurs for PlayerStations window
+ *
+ * @param w pointer to the PlayerStations window
+ * @param e pointer to window event
+ */
 static void PlayerStationsWndProc(Window *w, WindowEvent *e)
 {
 	const PlayerID owner = (PlayerID)w->window_number;
@@ -286,20 +309,22 @@
 	plstations_d *sl = &WP(w, plstations_d);
 
 	switch (e->event) {
-		case WE_CREATE: /* set up resort timer */
+		case WE_CREATE:
 			if (_cargo_filter == _cargo_filter_max) _cargo_filter = _cargo_mask;
 
 			for (uint i = 0; i < 5; i++) {
-				if (HasBit(facilities, i)) w->LowerWidget(i + STATIONLIST_WIDGET_TRAIN);
+				if (HasBit(facilities, i)) w->LowerWidget(i + SLW_TRAIN);
 			}
-			w->SetWidgetLoweredState(STATIONLIST_WIDGET_FACILALL, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
-			w->SetWidgetLoweredState(STATIONLIST_WIDGET_CARGOALL, _cargo_filter == _cargo_mask && include_empty);
-			w->SetWidgetLoweredState(STATIONLIST_WIDGET_NOCARGOWAITING, include_empty);
+			w->SetWidgetLoweredState(SLW_FACILALL, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
+			w->SetWidgetLoweredState(SLW_CARGOALL, _cargo_filter == _cargo_mask && include_empty);
+			w->SetWidgetLoweredState(SLW_NOCARGOWAITING, include_empty);
 
 			sl->sort_list = NULL;
 			sl->flags = SL_REBUILD;
 			sl->sort_type = station_sort.criteria;
 			if (station_sort.order) sl->flags |= SL_ORDER;
+
+			/* set up resort timer */
 			sl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;
 			break;
 
@@ -312,12 +337,14 @@
 			/* draw widgets, with player's name in the caption */
 			SetDParam(0, owner);
 			SetDParam(1, w->vscroll.count);
+
+			/* Set text of sort by dropdown */
+			w->widget[SLW_SORTDROPBTN].data = _station_sort_listing[sl->sort_type];
+
 			DrawWindowWidgets(w);
 
-			/* draw sorting criteria string */
-			DrawString(85, 26, _station_sort_listing[sl->sort_type], TC_BLACK);
 			/* draw arrow pointing up/down for ascending/descending sorting */
-			DoDrawString(sl->flags & SL_ORDER ? DOWNARROW : UPARROW, 69, 26, TC_BLACK);
+			DrawSortButtonState(w, SLW_SORTBY, sl->flags & SL_ORDER ? SBS_DOWN : SBS_UP);
 
 			int cg_ofst;
 			int x = 89;
@@ -337,13 +364,13 @@
 			}
 
 			x += 6;
-			cg_ofst = w->IsWidgetLowered(STATIONLIST_WIDGET_NOCARGOWAITING) ? 2 : 1;
+			cg_ofst = w->IsWidgetLowered(SLW_NOCARGOWAITING) ? 2 : 1;
 			DrawStringCentered(x + cg_ofst, y + cg_ofst, STR_ABBREV_NONE, TC_BLACK);
 			x += 14;
-			cg_ofst = w->IsWidgetLowered(STATIONLIST_WIDGET_CARGOALL) ? 2 : 1;
+			cg_ofst = w->IsWidgetLowered(SLW_CARGOALL) ? 2 : 1;
 			DrawStringCentered(x + cg_ofst, y + cg_ofst, STR_ABBREV_ALL, TC_BLACK);
 
-			cg_ofst = w->IsWidgetLowered(STATIONLIST_WIDGET_FACILALL) ? 2 : 1;
+			cg_ofst = w->IsWidgetLowered(SLW_FACILALL) ? 2 : 1;
 			DrawString(71 + cg_ofst, y + cg_ofst, STR_ABBREV_ALL, TC_BLACK);
 
 			if (w->vscroll.count == 0) { // player has no stations
@@ -359,7 +386,10 @@
 				int x;
 
 				assert(st->xy != 0);
-				assert(st->owner == owner);
+
+ 				/* Do not do the complex check HasStationInUse here, it may be even false
+				 * when the order had been removed and the station list hasn't been removed yet */
+				assert(st->owner == owner || (st->owner == OWNER_NONE && !st->IsBuoy()));
 
 				SetDParam(0, st->index);
 				SetDParam(1, st->facilities);
@@ -379,7 +409,7 @@
 
 		case WE_CLICK:
 			switch (e->we.click.widget) {
-				case STATIONLIST_WIDGET_LIST: {
+				case SLW_LIST: {
 					uint32 id_v = (e->we.click.pt.y - 41) / 10;
 
 					if (id_v >= w->vscroll.cap) return; // click out of bounds
@@ -389,52 +419,53 @@
 					if (id_v >= sl->list_length) return; // click out of list bound
 
 					const Station *st = sl->sort_list[id_v];
-					assert(st->owner == owner);
+					/* do not check HasStationInUse - it is slow and may be invalid */
+					assert(st->owner == owner || (st->owner == OWNER_NONE && !st->IsBuoy()));
 					ScrollMainWindowToTile(st->xy);
 					break;
 				}
 
-				case STATIONLIST_WIDGET_TRAIN:
-				case STATIONLIST_WIDGET_TRUCK:
-				case STATIONLIST_WIDGET_BUS:
-				case STATIONLIST_WIDGET_AIRPLANE:
-				case STATIONLIST_WIDGET_SHIP:
+				case SLW_TRAIN:
+				case SLW_TRUCK:
+				case SLW_BUS:
+				case SLW_AIRPLANE:
+				case SLW_SHIP:
 					if (_ctrl_pressed) {
-						ToggleBit(facilities, e->we.click.widget - STATIONLIST_WIDGET_TRAIN);
+						ToggleBit(facilities, e->we.click.widget - SLW_TRAIN);
 						w->ToggleWidgetLoweredState(e->we.click.widget);
 					} else {
 						uint i;
 						FOR_EACH_SET_BIT(i, facilities) {
-							w->RaiseWidget(i + STATIONLIST_WIDGET_TRAIN);
+							w->RaiseWidget(i + SLW_TRAIN);
 						}
-						SetBit(facilities, e->we.click.widget - STATIONLIST_WIDGET_TRAIN);
+						SetBit(facilities, e->we.click.widget - SLW_TRAIN);
 						w->LowerWidget(e->we.click.widget);
 					}
-					w->SetWidgetLoweredState(STATIONLIST_WIDGET_FACILALL, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
+					w->SetWidgetLoweredState(SLW_FACILALL, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
 					sl->flags |= SL_REBUILD;
 					SetWindowDirty(w);
 					break;
 
-				case STATIONLIST_WIDGET_FACILALL:
+				case SLW_FACILALL:
 					for (uint i = 0; i < 5; i++) {
-						w->LowerWidget(i + STATIONLIST_WIDGET_TRAIN);
+						w->LowerWidget(i + SLW_TRAIN);
 					}
-					w->LowerWidget(STATIONLIST_WIDGET_FACILALL);
+					w->LowerWidget(SLW_FACILALL);
 
 					facilities = FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK;
 					sl->flags |= SL_REBUILD;
 					SetWindowDirty(w);
 					break;
 
-				case STATIONLIST_WIDGET_CARGOALL: {
+				case SLW_CARGOALL: {
 					uint i = 0;
 					for (CargoID c = 0; c < NUM_CARGO; c++) {
 						if (!GetCargo(c)->IsValid()) continue;
-						w->LowerWidget(i + STATIONLIST_WIDGET_CARGOSTART);
+						w->LowerWidget(i + SLW_CARGOSTART);
 						i++;
 					}
-					w->LowerWidget(STATIONLIST_WIDGET_NOCARGOWAITING);
-					w->LowerWidget(STATIONLIST_WIDGET_CARGOALL);
+					w->LowerWidget(SLW_NOCARGOWAITING);
+					w->LowerWidget(SLW_CARGOALL);
 
 					_cargo_filter = _cargo_mask;
 					include_empty = true;
@@ -443,47 +474,46 @@
 					break;
 				}
 
-				case STATIONLIST_WIDGET_SORTBY: /*flip sorting method asc/desc*/
+				case SLW_SORTBY: // flip sorting method asc/desc
 					sl->flags ^= SL_ORDER; //DESC-flag
 					station_sort.order = HasBit(sl->flags, 0);
 					sl->flags |= SL_RESORT;
 					w->flags4 |= 5 << WF_TIMEOUT_SHL;
-					w->LowerWidget(STATIONLIST_WIDGET_SORTBY);
+					w->LowerWidget(SLW_SORTBY);
 					SetWindowDirty(w);
 					break;
 
-				case STATIONLIST_WIDGET_SORTCRITERIA:
-				case STATIONLIST_WIDGET_SORTDROPBTN: /* select sorting criteria dropdown menu */
-					ShowDropDownMenu(w, _station_sort_listing, sl->sort_type, STATIONLIST_WIDGET_SORTDROPBTN, 0, 0);
+				case SLW_SORTDROPBTN: // select sorting criteria dropdown menu
+					ShowDropDownMenu(w, _station_sort_listing, sl->sort_type, SLW_SORTDROPBTN, 0, 0);
 					break;
 
-				case STATIONLIST_WIDGET_NOCARGOWAITING:
+				case SLW_NOCARGOWAITING:
 					if (_ctrl_pressed) {
 						include_empty = !include_empty;
-						w->ToggleWidgetLoweredState(STATIONLIST_WIDGET_NOCARGOWAITING);
+						w->ToggleWidgetLoweredState(SLW_NOCARGOWAITING);
 					} else {
-						for (uint i = STATIONLIST_WIDGET_CARGOSTART; i < w->widget_count; i++) {
+						for (uint i = SLW_CARGOSTART; i < w->widget_count; i++) {
 							w->RaiseWidget(i);
 						}
 
 						_cargo_filter = 0;
 						include_empty = true;
 
-						w->LowerWidget(STATIONLIST_WIDGET_NOCARGOWAITING);
+						w->LowerWidget(SLW_NOCARGOWAITING);
 					}
 					sl->flags |= SL_REBUILD;
-					w->SetWidgetLoweredState(STATIONLIST_WIDGET_CARGOALL, _cargo_filter == _cargo_mask && include_empty);
+					w->SetWidgetLoweredState(SLW_CARGOALL, _cargo_filter == _cargo_mask && include_empty);
 					SetWindowDirty(w);
 					break;
 
 				default:
-					if (e->we.click.widget >= STATIONLIST_WIDGET_CARGOSTART) { //change cargo_filter
+					if (e->we.click.widget >= SLW_CARGOSTART) { // change cargo_filter
 						/* Determine the selected cargo type */
 						CargoID c;
 						int i = 0;
 						for (c = 0; c < NUM_CARGO; c++) {
 							if (!GetCargo(c)->IsValid()) continue;
-							if (e->we.click.widget - STATIONLIST_WIDGET_CARGOSTART == i) break;
+							if (e->we.click.widget - SLW_CARGOSTART == i) break;
 							i++;
 						}
 
@@ -491,10 +521,10 @@
 							ToggleBit(_cargo_filter, c);
 							w->ToggleWidgetLoweredState(e->we.click.widget);
 						} else {
-							for (uint i = STATIONLIST_WIDGET_CARGOSTART; i < w->widget_count; i++) {
+							for (uint i = SLW_CARGOSTART; i < w->widget_count; i++) {
 								w->RaiseWidget(i);
 							}
-							w->RaiseWidget(STATIONLIST_WIDGET_NOCARGOWAITING);
+							w->RaiseWidget(SLW_NOCARGOWAITING);
 
 							_cargo_filter = 0;
 							include_empty = false;
@@ -503,14 +533,14 @@
 							w->LowerWidget(e->we.click.widget);
 						}
 						sl->flags |= SL_REBUILD;
-						w->SetWidgetLoweredState(STATIONLIST_WIDGET_CARGOALL, _cargo_filter == _cargo_mask && include_empty);
+						w->SetWidgetLoweredState(SLW_CARGOALL, _cargo_filter == _cargo_mask && include_empty);
 						SetWindowDirty(w);
 					}
 					break;
 			}
 			break;
 
-		case WE_DROPDOWN_SELECT: /* we have selected a dropdown item in the list */
+		case WE_DROPDOWN_SELECT: // we have selected a dropdown item in the list
 			if (sl->sort_type != e->we.dropdown.index) {
 				/* value has changed -> resort */
 				sl->sort_type = e->we.dropdown.index;
@@ -521,6 +551,7 @@
 			break;
 
 		case WE_TICK:
+			if (_pause_game != 0) break;
 			if (--sl->resort_timer == 0) {
 				DEBUG(misc, 3, "Periodic rebuild station list player %d", owner);
 				sl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;
@@ -530,7 +561,7 @@
 			break;
 
 		case WE_TIMEOUT:
-			w->RaiseWidget(STATIONLIST_WIDGET_SORTBY);
+			w->RaiseWidget(SLW_SORTBY);
 			SetWindowDirty(w);
 			break;
 
@@ -541,32 +572,28 @@
 }
 
 static const Widget _player_stations_widgets[] = {
-{   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,          STR_018B_CLOSE_WINDOW},
+{   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,          STR_018B_CLOSE_WINDOW},            // SLW_CLOSEBOX
 {    WWT_CAPTION,  RESIZE_RIGHT,    14,    11,   345,     0,    13, STR_3048_STATIONS, STR_018C_WINDOW_TITLE_DRAG_THIS},
 {  WWT_STICKYBOX,     RESIZE_LR,    14,   346,   357,     0,    13, 0x0,               STR_STICKY_BUTTON},
-{      WWT_PANEL,     RESIZE_RB,    14,     0,   345,    37,   161, 0x0,               STR_3057_STATION_NAMES_CLICK_ON},
+{      WWT_PANEL,     RESIZE_RB,    14,     0,   345,    37,   161, 0x0,               STR_3057_STATION_NAMES_CLICK_ON},  // SLW_LIST
 {  WWT_SCROLLBAR,    RESIZE_LRB,    14,   346,   357,    37,   149, 0x0,               STR_0190_SCROLL_BAR_SCROLLS_LIST},
 {  WWT_RESIZEBOX,   RESIZE_LRTB,    14,   346,   357,   150,   161, 0x0,               STR_RESIZE_BUTTON},
-//Index 6
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,     0,    13,    14,    24, STR_TRAIN,         STR_USE_CTRL_TO_SELECT_MORE},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,    14,    27,    14,    24, STR_LORRY,         STR_USE_CTRL_TO_SELECT_MORE},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,    28,    41,    14,    24, STR_BUS,           STR_USE_CTRL_TO_SELECT_MORE},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,    42,    55,    14,    24, STR_PLANE,         STR_USE_CTRL_TO_SELECT_MORE},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,    56,    69,    14,    24, STR_SHIP,          STR_USE_CTRL_TO_SELECT_MORE},
-//Index 11
-{      WWT_PANEL,   RESIZE_NONE,    14,    83,    88,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,    89,   102,    14,    24, 0x0,               STR_NO_WAITING_CARGO},
-{      WWT_PANEL,  RESIZE_RIGHT,    14,   117,   357,    14,    24, 0x0,               STR_NULL},
 
-//14
-{      WWT_PANEL,   RESIZE_NONE,    14,    70,    83,    14,    24, 0x0,               STR_SELECT_ALL_FACILITIES},
-{      WWT_PANEL,   RESIZE_NONE,    14,   103,   116,    14,    24, 0x0,               STR_SELECT_ALL_TYPES},
+{    WWT_TEXTBTN,   RESIZE_NONE,    14,     0,    13,    14,    24, STR_TRAIN,         STR_USE_CTRL_TO_SELECT_MORE},      // SLW_TRAIN
+{    WWT_TEXTBTN,   RESIZE_NONE,    14,    14,    27,    14,    24, STR_LORRY,         STR_USE_CTRL_TO_SELECT_MORE},      // SLW_TRUCK
+{    WWT_TEXTBTN,   RESIZE_NONE,    14,    28,    41,    14,    24, STR_BUS,           STR_USE_CTRL_TO_SELECT_MORE},      // SLW_BUS
+{    WWT_TEXTBTN,   RESIZE_NONE,    14,    42,    55,    14,    24, STR_PLANE,         STR_USE_CTRL_TO_SELECT_MORE},      // SLW_AIRPLANE
+{    WWT_TEXTBTN,   RESIZE_NONE,    14,    56,    69,    14,    24, STR_SHIP,          STR_USE_CTRL_TO_SELECT_MORE},      // SLW_SHIP
+{      WWT_PANEL,   RESIZE_NONE,    14,    70,    83,    14,    24, 0x0,               STR_SELECT_ALL_FACILITIES},        // SLW_FACILALL
 
-//16
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,     0,    80,    25,    36, STR_SORT_BY,       STR_SORT_ORDER_TIP},
-{      WWT_PANEL,   RESIZE_NONE,    14,    81,   232,    25,    36, 0x0,               STR_SORT_CRITERIA_TIP},
-{    WWT_TEXTBTN,   RESIZE_NONE,    14,   233,   243,    25,    36, STR_0225,          STR_SORT_CRITERIA_TIP},
-{      WWT_PANEL,  RESIZE_RIGHT,    14,   244,   357,    25,    36, 0x0,               STR_NULL},
+{      WWT_PANEL,   RESIZE_NONE,    14,    83,    88,    14,    24, 0x0,               STR_NULL},                         // SLW_PAN_BETWEEN
+{      WWT_PANEL,   RESIZE_NONE,    14,    89,   102,    14,    24, 0x0,               STR_NO_WAITING_CARGO},             // SLW_NOCARGOWAITING
+{      WWT_PANEL,   RESIZE_NONE,    14,   103,   116,    14,    24, 0x0,               STR_SELECT_ALL_TYPES},             // SLW_CARGOALL
+{      WWT_PANEL,  RESIZE_RIGHT,    14,   117,   357,    14,    24, 0x0,               STR_NULL},                         // SLW_PAN_RIGHT
+
+{    WWT_TEXTBTN,   RESIZE_NONE,    14,     0,    80,    25,    36, STR_SORT_BY,       STR_SORT_ORDER_TIP},               // SLW_SORTBY
+{   WWT_DROPDOWN,   RESIZE_NONE,    14,    81,   243,    25,    36, 0x0,               STR_SORT_CRITERIA_TIP},            // SLW_SORTDROPBTN
+{      WWT_PANEL,  RESIZE_RIGHT,    14,   244,   357,    25,    36, 0x0,               STR_NULL},                         // SLW_PAN_SORT_RIGHT
 {   WIDGETS_END},
 };
 
@@ -578,7 +605,11 @@
 	PlayerStationsWndProc
 };
 
-
+/**
+ * Opens window with list of player's stations
+ *
+ * @param player player whose stations' list show
+ */
 void ShowPlayerStations(PlayerID player)
 {
 	if (!IsValidPlayer(player)) return;
@@ -605,7 +636,7 @@
 	for (CargoID c = 0; c < NUM_CARGO; c++) {
 		if (!GetCargo(c)->IsValid()) continue;
 
-		Widget *wi = &w->widget[STATIONLIST_WIDGET_CARGOSTART + i];
+		Widget *wi = &w->widget[SLW_CARGOSTART + i];
 		wi->type     = WWT_PANEL;
 		wi->display_flags = RESIZE_NONE;
 		wi->color    = 14;
@@ -616,15 +647,15 @@
 		wi->data     = 0;
 		wi->tooltips = STR_USE_CTRL_TO_SELECT_MORE;
 
-		if (HasBit(_cargo_filter, c)) w->LowerWidget(STATIONLIST_WIDGET_CARGOSTART + i);
+		if (HasBit(_cargo_filter, c)) w->LowerWidget(SLW_CARGOSTART + i);
 		i++;
 	}
 
-	w->widget[STATIONLIST_WIDGET_NOCARGOWAITING].left += num_active * 14;
-	w->widget[STATIONLIST_WIDGET_NOCARGOWAITING].right += num_active * 14;
-	w->widget[STATIONLIST_WIDGET_CARGOALL].left += num_active * 14;
-	w->widget[STATIONLIST_WIDGET_CARGOALL].right += num_active * 14;
-	w->widget[13].left += num_active * 14;
+	w->widget[SLW_NOCARGOWAITING].left += num_active * 14;
+	w->widget[SLW_NOCARGOWAITING].right += num_active * 14;
+	w->widget[SLW_CARGOALL].left += num_active * 14;
+	w->widget[SLW_CARGOALL].right += num_active * 14;
+	w->widget[SLW_PAN_RIGHT].left += num_active * 14;
 
 	if (num_active > 15) {
 		/* Resize and fix the minimum width, if necessary */
@@ -634,45 +665,52 @@
 }
 
 static const Widget _station_view_expanded_widgets[] = {
-{   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,          STR_018B_CLOSE_WINDOW},
+{   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,          STR_018B_CLOSE_WINDOW},                // SVW_CLOSEBOX
 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   236,     0,    13, STR_300A_0,        STR_018C_WINDOW_TITLE_DRAG_THIS},
 {  WWT_STICKYBOX,   RESIZE_NONE,    14,   237,   248,     0,    13, 0x0,               STR_STICKY_BUTTON},
-{      WWT_PANEL,   RESIZE_NONE,    14,     0,   236,    14,    65, 0x0,               STR_NULL},
+{      WWT_PANEL,   RESIZE_NONE,    14,     0,   236,    14,    65, 0x0,               STR_NULL},                             // SVW_WAITING
 {  WWT_SCROLLBAR,   RESIZE_NONE,    14,   237,   248,    14,    65, 0x0,               STR_0190_SCROLL_BAR_SCROLLS_LIST},
-{      WWT_EMPTY,   RESIZE_NONE,     0,     0,     0,     0,     0, 0x0,               STR_NULL},
-{      WWT_PANEL,   RESIZE_NONE,    14,     0,   248,    66,   197, 0x0,               STR_NULL},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,     0,    63,   198,   209, STR_00E4_LOCATION, STR_3053_CENTER_MAIN_VIEW_ON_STATION},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,    64,   128,   198,   209, STR_3033_ACCEPTS,  STR_3056_SHOW_LIST_OF_ACCEPTED_CARGO},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   129,   192,   198,   209, STR_0130_RENAME,   STR_3055_CHANGE_NAME_OF_STATION},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   193,   206,   198,   209, STR_TRAIN,         STR_SCHEDULED_TRAINS_TIP },
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   207,   220,   198,   209, STR_LORRY,         STR_SCHEDULED_ROAD_VEHICLES_TIP },
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   221,   234,   198,   209, STR_PLANE,         STR_SCHEDULED_AIRCRAFT_TIP },
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   235,   248,   198,   209, STR_SHIP,          STR_SCHEDULED_SHIPS_TIP },
+{      WWT_EMPTY,   RESIZE_NONE,     0,     0,     0,     0,     0, 0x0,               STR_NULL},                             // SVW_ACCEPTLIST
+{      WWT_PANEL,   RESIZE_NONE,    14,     0,   248,    66,   197, 0x0,               STR_NULL},                             // SVW_RATINGLIST
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,     0,    63,   198,   209, STR_00E4_LOCATION, STR_3053_CENTER_MAIN_VIEW_ON_STATION}, // SVW_LOCATION
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,    64,   128,   198,   209, STR_3033_ACCEPTS,  STR_3056_SHOW_LIST_OF_ACCEPTED_CARGO}, // SVW_ACCEPTS
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   129,   192,   198,   209, STR_0130_RENAME,   STR_3055_CHANGE_NAME_OF_STATION},      // SVW_RENAME
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   193,   206,   198,   209, STR_TRAIN,         STR_SCHEDULED_TRAINS_TIP },            // SVW_TRAINS
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   207,   220,   198,   209, STR_LORRY,         STR_SCHEDULED_ROAD_VEHICLES_TIP },     // SVW_ROADVEHS
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   221,   234,   198,   209, STR_PLANE,         STR_SCHEDULED_AIRCRAFT_TIP },          // SVW_PLANES
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   235,   248,   198,   209, STR_SHIP,          STR_SCHEDULED_SHIPS_TIP },             // SVW_SHIPS
 {   WIDGETS_END},
 };
 
 static const Widget _station_view_widgets[] = {
-{   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,          STR_018B_CLOSE_WINDOW},
+{   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,          STR_018B_CLOSE_WINDOW},                // SVW_CLOSEBOX
 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   236,     0,    13, STR_300A_0,        STR_018C_WINDOW_TITLE_DRAG_THIS},
 {  WWT_STICKYBOX,   RESIZE_NONE,    14,   237,   248,     0,    13, 0x0,               STR_STICKY_BUTTON},
-{      WWT_PANEL,   RESIZE_NONE,    14,     0,   236,    14,    65, 0x0,               STR_NULL},
+{      WWT_PANEL,   RESIZE_NONE,    14,     0,   236,    14,    65, 0x0,               STR_NULL},                             // SVW_WAITING
 {  WWT_SCROLLBAR,   RESIZE_NONE,    14,   237,   248,    14,    65, 0x0,               STR_0190_SCROLL_BAR_SCROLLS_LIST},
-{      WWT_PANEL,   RESIZE_NONE,    14,     0,   248,    66,    97, 0x0,               STR_NULL},
-{      WWT_EMPTY,   RESIZE_NONE,     0,     0,     0,     0,     0, 0x0,               STR_NULL},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,     0,    63,    98,   109, STR_00E4_LOCATION, STR_3053_CENTER_MAIN_VIEW_ON_STATION},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,    64,   128,    98,   109, STR_3032_RATINGS,  STR_3054_SHOW_STATION_RATINGS},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   129,   192,    98,   109, STR_0130_RENAME,   STR_3055_CHANGE_NAME_OF_STATION},
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   193,   206,    98,   109, STR_TRAIN,         STR_SCHEDULED_TRAINS_TIP },
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   207,   220,    98,   109, STR_LORRY,         STR_SCHEDULED_ROAD_VEHICLES_TIP },
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   221,   234,    98,   109, STR_PLANE,         STR_SCHEDULED_AIRCRAFT_TIP },
-{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   235,   248,    98,   109, STR_SHIP,          STR_SCHEDULED_SHIPS_TIP },
+{      WWT_PANEL,   RESIZE_NONE,    14,     0,   248,    66,    97, 0x0,               STR_NULL},                             // SVW_ACCEPTLIST
+{      WWT_EMPTY,   RESIZE_NONE,     0,     0,     0,     0,     0, 0x0,               STR_NULL},                             // SVW_RATINGLIST
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,     0,    63,    98,   109, STR_00E4_LOCATION, STR_3053_CENTER_MAIN_VIEW_ON_STATION}, // SVW_LOCATION
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,    64,   128,    98,   109, STR_3032_RATINGS,  STR_3054_SHOW_STATION_RATINGS},        // SVW_RATINGS
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   129,   192,    98,   109, STR_0130_RENAME,   STR_3055_CHANGE_NAME_OF_STATION},      // SVW_RENAME
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   193,   206,    98,   109, STR_TRAIN,         STR_SCHEDULED_TRAINS_TIP },            // SVW_TRAINS
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   207,   220,    98,   109, STR_LORRY,         STR_SCHEDULED_ROAD_VEHICLES_TIP },     // SVW_ROADVEHS
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   221,   234,    98,   109, STR_PLANE,         STR_SCHEDULED_AIRCRAFT_TIP },          // SVW_PLANES
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   235,   248,    98,   109, STR_SHIP,          STR_SCHEDULED_SHIPS_TIP },             // SVW_SHIPS
 {   WIDGETS_END},
 };
 
-
+/**
+ * Draws icons of wainting cargo in the StationView window
+ *
+ * @param i type of cargo
+ * @param waiting number of wainting units
+ * @param x x on-screen coordinate where to start with drawing icons
+ * @param y y coordinate
+ */
 static void DrawCargoIcons(CargoID i, uint waiting, int x, int y)
 {
-	uint num = min((waiting + 5) / 10, 23);
+	uint num = min((waiting + 5) / 10, 23); // maximum is 23 icons so it won't overflow
 	if (num == 0) return;
 
 	const CargoSpec *cs = GetCargo(i);
@@ -693,15 +731,21 @@
 	} while (--num);
 }
 
+/**
+ * Redraws whole StationView window
+ *
+ * @param w pointer to window
+ */
 static void DrawStationViewWindow(Window *w)
 {
 	StationID station_id = w->window_number;
 	const Station* st = GetStation(station_id);
-	uint num;
-	int x,y;
-	int pos;
+	uint num;     ///< number of cargo types waiting at station
+	int x, y;     ///< coordinates used for printing waiting/accepted/rating of cargo
+	int pos;      ///< = w->vscroll.pos
 	StringID str;
 
+	/* count types of cargos waiting in station */
 	num = 1;
 	for (CargoID i = 0; i < NUM_CARGO; i++) {
 		if (!st->goods[i].cargo.Empty()) {
@@ -709,13 +753,14 @@
 			if (st->goods[i].cargo.Source() != station_id) num++;
 		}
 	}
-	SetVScrollCount(w, num);
+	SetVScrollCount(w, num); // update scrollbar
 
-	w->SetWidgetDisabledState( 9, st->owner != _local_player);
-	w->SetWidgetDisabledState(10, !(st->facilities & FACIL_TRAIN));
-	w->SetWidgetDisabledState(11, !(st->facilities & FACIL_TRUCK_STOP) && !(st->facilities & FACIL_BUS_STOP));
-	w->SetWidgetDisabledState(12, !(st->facilities & FACIL_AIRPORT));
-	w->SetWidgetDisabledState(13, !(st->facilities & FACIL_DOCK));
+	/* disable some buttons */
+	w->SetWidgetDisabledState(SVW_RENAME,   st->owner != _local_player);
+	w->SetWidgetDisabledState(SVW_TRAINS,   !(st->facilities & FACIL_TRAIN));
+	w->SetWidgetDisabledState(SVW_ROADVEHS, !(st->facilities & FACIL_TRUCK_STOP) && !(st->facilities & FACIL_BUS_STOP));
+	w->SetWidgetDisabledState(SVW_PLANES,   !(st->facilities & FACIL_AIRPORT));
+	w->SetWidgetDisabledState(SVW_SHIPS,    !(st->facilities & FACIL_DOCK));
 
 	SetDParam(0, st->index);
 	SetDParam(1, st->facilities);
@@ -765,14 +810,14 @@
 		}
 	}
 
-	if (IsWindowOfPrototype(w, _station_view_widgets)) {
+	if (IsWindowOfPrototype(w, _station_view_widgets)) { // small window with list of accepted cargo
 		char *b = _userstring;
 		bool first = true;
 
 		b = InlineString(b, STR_000C_ACCEPTS);
 
 		for (CargoID i = 0; i < NUM_CARGO; i++) {
-			if (b >= endof(_userstring) - 5 - 1) break;
+			if (b >= lastof(_userstring) - (1 + 2 * 4)) break; // ',' or ' ' and two calls to Utf8Encode()
 			if (HasBit(st->goods[i].acceptance_pickup, GoodsEntry::ACCEPTANCE)) {
 				if (first) {
 					first = false;
@@ -789,8 +834,12 @@
 		if (first) b = InlineString(b, STR_00D0_NOTHING);
 
 		*b = '\0';
+
+		/* Make sure we detect any buffer overflow */
+		assert(b < endof(_userstring));
+
 		DrawStringMultiLine(2, 67, STR_SPEC_USERSTRING, 245);
-	} else {
+	} else { // extended window with list of cargo ratings
 		DrawString(2, 67, STR_3034_LOCAL_RATING_OF_TRANSPORT, TC_FROMSTRING);
 
 		y = 77;
@@ -811,6 +860,12 @@
 }
 
 
+/**
+ * Fuction called when any WindowEvent occurs for any StationView window
+ *
+ * @param w pointer to the StationView window
+ * @param e pointer to window event
+ */
 static void StationViewWndProc(Window *w, WindowEvent *e)
 {
 	switch (e->event) {
@@ -820,11 +875,11 @@
 
 		case WE_CLICK:
 			switch (e->we.click.widget) {
-				case 7:
+				case SVW_LOCATION:
 					ScrollMainWindowToTile(GetStation(w->window_number)->xy);
 					break;
 
-				case 8:
+				case SVW_RATINGS:
 					SetWindowDirty(w);
 
 					/* toggle height/widget set */
@@ -839,24 +894,24 @@
 					SetWindowDirty(w);
 					break;
 
-				case 9:
+				case SVW_RENAME:
 					SetDParam(0, w->window_number);
 					ShowQueryString(STR_STATION, STR_3030_RENAME_STATION_LOADING, 31, 180, w, CS_ALPHANUMERAL);
 					break;
 
-				case 10: { /* Show a list of scheduled trains to this station */
+				case SVW_TRAINS: { // Show a list of scheduled trains to this station
 					const Station *st = GetStation(w->window_number);
 					ShowVehicleListWindow(st->owner, VEH_TRAIN, (StationID)w->window_number);
 					break;
 				}
 
-				case 11: { /* Show a list of scheduled road-vehicles to this station */
+				case SVW_ROADVEHS: { // Show a list of scheduled road-vehicles to this station
 					const Station *st = GetStation(w->window_number);
 					ShowVehicleListWindow(st->owner, VEH_ROAD, (StationID)w->window_number);
 					break;
 				}
 
-				case 12: { /* Show a list of scheduled aircraft to this station */
+				case SVW_PLANES: { // Show a list of scheduled aircraft to this station
 					const Station *st = GetStation(w->window_number);
 					/* Since oilrigs have no owners, show the scheduled aircraft of current player */
 					PlayerID owner = (st->owner == OWNER_NONE) ? _current_player : st->owner;
@@ -864,7 +919,7 @@
 					break;
 				}
 
-				case 13: { /* Show a list of scheduled ships to this station */
+				case SVW_SHIPS: { // Show a list of scheduled ships to this station
 					const Station *st = GetStation(w->window_number);
 					/* Since oilrigs/bouys have no owners, show the scheduled ships of current player */
 					PlayerID owner = (st->owner == OWNER_NONE) ? _current_player : st->owner;
@@ -904,6 +959,11 @@
 	StationViewWndProc
 };
 
+/**
+ * Opens StationViewWindow for given station
+ *
+ * @param station station which window should be opened
+ */
 void ShowStationViewWindow(StationID station)
 {
 	Window *w = AllocateWindowDescFront(&_station_view_desc, station);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/station_gui.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,65 @@
+/* $Id$ */
+
+/** @file station_gui.h Contains enums and function declarations connected with stations GUI */
+
+#ifndef STATION_GUI_H
+#define STATION_GUI_H
+
+/** Enum for PlayerStations, referring to _player_stations_widgets */
+enum StationListWidgets {
+	SLW_CLOSEBOX       =  0, ///< Close 'X' button
+
+	SLW_LIST           =  3, ///< The main panel, list of stations
+
+	SLW_TRAIN          =  6, ///< 'TRAIN' button - list only facilities where is a railroad station
+	SLW_TRUCK,
+	SLW_BUS,
+	SLW_AIRPLANE,
+	SLW_SHIP,
+	SLW_FACILALL,            ///< 'ALL' button - list all facilities
+
+	SLW_PAN_BETWEEN    = 12, ///< Small panel between list of types of ficilities and list of cargo types
+	SLW_NOCARGOWAITING = 13, ///< 'NO' button - list stations where no cargo is waiting
+	SLW_CARGOALL       = 14, ///< 'ALL' button - list all stations
+	SLW_PAN_RIGHT      = 15, ///< Panel right of list of cargo types
+
+	SLW_SORTBY         = 16, ///< 'Sort by' button - reverse sort direction
+	SLW_SORTDROPBTN    = 17, ///< Dropdown button
+	SLW_PAN_SORT_RIGHT = 18, ///< Panel right of sorting options
+
+	SLW_CARGOSTART     = 19, ///< Widget numbers used for list of cargo types (not present in _player_stations_widgets)
+};
+
+/** Enum for StationView, referring to _station_view_widgets and _station_view_expanded_widgets */
+enum StationViewWidgets {
+	SVW_CLOSEBOX   =  0, ///< Close 'X' button
+	SVW_CAPTION    =  1, ///< Caption of the window
+	SVW_WAITING    =  3, ///< List of waiting cargo
+	SVW_ACCEPTLIST =  5, ///< List of accepted cargos
+	SVW_RATINGLIST =  6, ///< Ratings of cargos
+	SVW_LOCATION   =  7, ///< 'Location' button
+	SVW_RATINGS    =  8, ///< 'Ratings' button
+	SVW_ACCEPTS    =  8, ///< 'Accepts' button
+	SVW_RENAME     =  9, ///< 'Rename' button
+	SVW_TRAINS     = 10, ///< List of scheduled trains button
+	SVW_ROADVEHS,        ///< List of scheduled road vehs button
+	SVW_PLANES,          ///< List of scheduled planes button
+	SVW_SHIPS,           ///< List of scheduled ships button
+};
+
+/* sorter stuff */
+void RebuildStationLists();
+void ResortStationLists();
+
+enum StationCoverageType {
+	SCT_PASSENGERS_ONLY,
+	SCT_NON_PASSENGERS_ONLY,
+	SCT_ALL
+};
+
+void DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad);
+void CheckRedrawStationCoverage(const Window *w);
+
+extern bool _station_show_coverage;
+
+#endif /* STATION_GUI_H */
--- a/src/station_map.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/station_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -8,6 +8,7 @@
 #include "rail_map.h"
 #include "road_map.h"
 #include "station.h"
+#include "rail.h"
 
 typedef byte StationGfx;
 
--- a/src/stdafx.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/stdafx.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,16 @@
 #ifndef STDAFX_H
 #define STDAFX_H
 
+#if defined(__NDS__)
+	#include <nds/jtypes.h>
+	/* NDS' types for uint32/int32 are based on longs, which causes
+	 * trouble all over the place in OpenTTD. */
+	#define uint32 uint32_ugly_hack
+	#define int32 int32_ugly_hack
+	typedef unsigned int uint32_ugly_hack;
+	typedef signed int int32_ugly_hack;
+#endif /* __NDS__ */
+
 /* It seems that we need to include stdint.h before anything else
  * We need INT64_MAX, which for most systems comes from stdint.h. However, MSVC
  * does not have stdint.h and apparently neither does MorphOS, so define
@@ -89,13 +99,6 @@
 
 #if defined(__APPLE__)
 	#include "os/macosx/osx_stdafx.h"
-	/* Make endian swapping use Apple's macros to increase speed (since it will use hardware swapping if available)
-	 * Even though they should return uint16 and uint32, we get warnings if we don't cast those (why?) */
-	#define BSWAP32(x) ((uint32)Endian32_Swap(x))
-	#define BSWAP16(x) ((uint16)Endian16_Swap(x))
-#else
-	#define BSWAP32(x) ((((x) >> 24) & 0xFF) | (((x) >> 8) & 0xFF00) | (((x) << 8) & 0xFF0000) | (((x) << 24) & 0xFF000000))
-	#define BSWAP16(x) ((x) >> 8 | (x) << 8)
 #endif /* __APPLE__ */
 
 #if defined(PSP)
@@ -207,7 +210,13 @@
 		#define strcasecmp stricmp
 		#define strncasecmp strnicmp
 	#endif
-/* suppress: warning C4005: 'offsetof' : macro redefinition (VC8) */
+
+	void SetExceptionString(const char* s, ...);
+
+	#if defined(NDEBUG) && defined(WITH_ASSERT)
+		#undef assert
+		#define assert(expression) if (!(expression)) { SetExceptionString("Assertion failed at %s:%d: %s", __FILE__, __LINE__, #expression); *(byte*)0 = 0; }
+	#endif
 #endif /* defined(_MSC_VER) */
 
 #if defined(WINCE)
@@ -235,20 +244,6 @@
 	#endif /* WIN32 */
 #endif /* STRGEN */
 
-/* Windows has always LITTLE_ENDIAN */
-#if defined(WIN32) || defined(__OS2__) || defined(WIN64)
-	#define TTD_LITTLE_ENDIAN
-#elif defined(TESTING)
-	/* Do noting  */
-#else
-	/* Else include endian[target/host].h, which has the endian-type, autodetected by the Makefile */
-	#if defined(STRGEN)
-		#include "endian_host.h"
-	#else
-		#include "endian_target.h"
-	#endif
-#endif /* WIN32 || __OS2__ || WIN64 */
-
 #if defined(WIN32) || defined(WIN64) || defined(__OS2__) && !defined(__INNOTEK_LIBC__)
 	#define PATHSEP "\\"
 	#define PATHSEPCHAR '\\'
@@ -264,7 +259,7 @@
 	typedef unsigned int uint;
 #endif
 
-#if !defined(__BEOS__) /* Already defined on BEOS */
+#if !defined(__BEOS__) && !defined(__NDS__) /* Already defined on BEOS and NDS */
 	typedef unsigned char    uint8;
 	typedef   signed char     int8;
 	typedef unsigned short   uint16;
@@ -273,36 +268,7 @@
 	typedef   signed int      int32;
 	typedef unsigned __int64 uint64;
 	typedef   signed __int64  int64;
-#endif
-
-#if defined(ARM) || defined(__arm__) || defined(__alpha__)
-	#define OTTD_ALIGNMENT
-#endif
-
-/* Setup alignment and conversion macros */
-#if defined(TTD_BIG_ENDIAN)
-	#define TO_BE32X(x)  (x)
-	#define FROM_BE32(x) (x)
-	#define TO_BE32(x)   (x)
-	#define FROM_BE16(x) (x)
-	#define TO_BE16(x)   (x)
-	#define TO_LE32X(x)  BSWAP32(x)
-	static inline uint32 FROM_LE32(uint32 x) { return BSWAP32(x); }
-	static inline uint32 TO_LE32(uint32 x)   { return BSWAP32(x); }
-	static inline uint16 FROM_LE16(uint16 x) { return BSWAP16(x); }
-	static inline uint16 TO_LE16(uint16 x)   { return BSWAP16(x); }
-#else
-	#define TO_BE32X(x)  BSWAP32(x)
-	static inline uint32 FROM_BE32(uint32 x) { return BSWAP32(x); }
-	static inline uint32 TO_BE32(uint32 x)   { return BSWAP32(x); }
-	static inline uint16 FROM_BE16(uint16 x) { return BSWAP16(x); }
-	static inline uint16 TO_BE16(uint16 x)   { return BSWAP16(x); }
-	#define TO_LE32X(x)  (x)
-	#define FROM_LE32(x) (x)
-	#define TO_LE32(x)   (x)
-	#define FROM_LE16(x) (x)
-	#define TO_LE16(x)   (x)
-#endif /* TTD_BIG_ENDIAN */
+#endif /* !__BEOS__ && !__NDS__ */
 
 #if !defined(WITH_PERSONAL_DIR)
 	#define PERSONAL_DIR ""
@@ -333,14 +299,8 @@
 #if defined(__APPLE__)
 	#define GetString OTTD_GetString
 	#define DrawString OTTD_DrawString
-	#define Random OTTD_Random
 	#define CloseConnection OTTD_CloseConnection
-#endif /* __APPLE */
-
-#if defined(__AMIGA__)
-	/* it seems AmigaOS already have a Point declared */
-	#define Point OTTD_AMIGA_POINT
-#endif
+#endif /* __APPLE__ */
 
 #if !defined(STRGEN)
 	/* In strgen error is not fatal and returns */
@@ -351,21 +311,27 @@
 
 #define NOT_REACHED() error("NOT_REACHED triggered at line %i of %s", __LINE__, __FILE__)
 
-#if defined(MORPHOS)
-	/* MorphOS doesn't have C++ conformant _stricmp... */
+#if defined(MORPHOS) || defined(__NDS__)
+	/* MorphOS and NDS don't have C++ conformant _stricmp... */
 	#define _stricmp stricmp
 #elif defined(OPENBSD)
 	/* OpenBSD uses strcasecmp(3) */
 	#define _stricmp strcasecmp
 #endif
 
-#if !defined(MORPHOS) && !defined(OPENBSD)
-	/* MorphOS & OpenBSD don't know wchars, the rest does :( */
+#if !defined(MORPHOS) && !defined(OPENBSD) && !defined(__NDS__)
+	/* NDS, MorphOS & OpenBSD don't know wchars, the rest does :( */
 	#define HAS_WCHAR
-#endif /* !defined(MORPHOS) && !defined(OPENBSD) */
+#endif /* !defined(MORPHOS) && !defined(OPENBSD) && !defined(__NDS__) */
 
 #if !defined(MAX_PATH)
 	#define MAX_PATH 260
 #endif
 
+/**
+ * The largest value that can be entered in a variable
+ * @param type the type of the variable
+ */
+#define MAX_UVALUE(type) ((type)~(type)0)
+
 #endif /* STDAFX_H */
--- a/src/strgen/strgen.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/strgen/strgen.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -1,10 +1,11 @@
 /* $Id$ */
 
 #include "../stdafx.h"
-#include "../macros.h"
-#include "../string.h"
+#include "../core/alloc_func.hpp"
+#include "../core/endian_func.hpp"
+#include "../string_func.h"
 #include "../table/control_codes.h"
-#include "../helpers.hpp"
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
--- a/src/string.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/string.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,12 +4,11 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
-#include "string.h"
-#include "macros.h"
+#include "debug.h"
+#include "core/alloc_func.hpp"
+#include "string_func.h"
+
 #include "table/control_codes.h"
-#include "helpers.hpp"
-#include "debug.h"
 
 #include <stdarg.h>
 #include <ctype.h> // required for tolower()
@@ -155,6 +154,8 @@
 }
 
 #ifdef WIN32
+/* Since version 3.14, MinGW Runtime has snprintf() and vsnprintf() conform to C99 but it's not the case for older versions */
+#if (__MINGW32_MAJOR_VERSION < 3) || ((__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION < 14))
 int CDECL snprintf(char *str, size_t size, const char *format, ...)
 {
 	va_list ap;
@@ -165,6 +166,7 @@
 	va_end(ap);
 	return ret;
 }
+#endif /* MinGW Runtime < 3.14 */
 
 #ifdef _MSC_VER
 /* *nprintf broken, not POSIX compliant, MSDN description
--- a/src/string.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-/* $Id$ */
-
-/** @file string.h */
-
-#ifndef STRING_H
-#define STRING_H
-
-#include "macros.h"
-
-/**
- * usage ttd_strlcpy(dst, src, lengthof(dst));
- * @param dst destination buffer
- * @param src string to copy/concatenate
- * @param size size of the destination buffer
- */
-void ttd_strlcat(char *dst, const char *src, size_t size);
-void ttd_strlcpy(char *dst, const char *src, size_t size);
-
-/**
- * usage: strecpy(dst, src, lastof(dst));
- * @param dst destination buffer
- * @param src string to copy
- * @param last pointer to the last element in the dst array
- *             if NULL no boundary check is performed
- * @return a pointer to the terminating \0 in the destination buffer
- */
-char *strecat(char *dst, const char *src, const char *last);
-char *strecpy(char *dst, const char *src, const char *last);
-
-char *CDECL str_fmt(const char *str, ...);
-
-/** Scans the string for valid characters and if it finds invalid ones,
- * replaces them with a question mark '?' */
-void str_validate(char *str);
-
-/** Scans the string for colour codes and strips them */
-void str_strip_colours(char *str);
-
-/**
- * Valid filter types for IsValidChar.
- */
-enum CharSetFilter {
-	CS_ALPHANUMERAL,      ///< Both numeric and alphabetic and spaces and stuff
-	CS_NUMERAL,           ///< Only numeric ones
-	CS_ALPHA,             ///< Only alphabetic values
-};
-
-/** Convert the given string to lowercase, only works with ASCII! */
-void strtolower(char *str);
-
-
-static inline bool StrEmpty(const char *s) { return s == NULL || s[0] == '\0'; }
-
-
-/** Get the length of a string, within a limited buffer */
-static inline int ttd_strnlen(const char *str, int maxlen)
-{
-	const char *t;
-	for (t = str; *t != '\0' && t - str < maxlen; t++);
-	return t - str;
-}
-
-/** Convert the md5sum number to a 'hexadecimal' string, return next pos in buffer */
-char *md5sumToString(char *buf, const char *last, const uint8 md5sum[16]);
-
-typedef uint32 WChar;
-
-/**
- * Only allow certain keys. You can define the filter to be used. This makes
- *  sure no invalid keys can get into an editbox, like BELL.
- * @param key character to be checked
- * @param afilter the filter to use
- * @return true or false depending if the character is printable/valid or not
- */
-bool IsValidChar(WChar key, CharSetFilter afilter);
-
-size_t Utf8Decode(WChar *c, const char *s);
-size_t Utf8Encode(char *buf, WChar c);
-size_t Utf8TrimString(char *s, size_t maxlen);
-
-
-static inline WChar Utf8Consume(const char **s)
-{
-	WChar c;
-	*s += Utf8Decode(&c, *s);
-	return c;
-}
-
-
-/** Return the length of a UTF-8 encoded character.
- * @param c Unicode character.
- * @return Length of UTF-8 encoding for character.
- */
-static inline size_t Utf8CharLen(WChar c)
-{
-	if (c < 0x80)       return 1;
-	if (c < 0x800)      return 2;
-	if (c < 0x10000)    return 3;
-	if (c < 0x110000)   return 4;
-
-	/* Invalid valid, we encode as a '?' */
-	return 1;
-}
-
-
-/**
- * Return the length of an UTF-8 encoded value based on a single char. This
- * char should be the first byte of the UTF-8 encoding. If not, or encoding
- * is invalid, return value is 0
- * @param c char to query length of
- * @return requested size
- */
-static inline size_t Utf8EncodedCharLen(char c)
-{
-	if (GB(c, 3, 5) == 0x1E) return 4;
-	if (GB(c, 4, 4) == 0x0E) return 3;
-	if (GB(c, 5, 3) == 0x06) return 2;
-	if (GB(c, 7, 1) == 0x00) return 1;
-
-	/* Invalid UTF8 start encoding */
-	return 0;
-}
-
-
-/* Check if the given character is part of a UTF8 sequence */
-static inline bool IsUtf8Part(char c)
-{
-	return GB(c, 6, 2) == 2;
-}
-
-/**
- * Retrieve the previous UNICODE character in an UTF-8 encoded string.
- * @param s char pointer pointing to (the first char of) the next character
- * @return a pointer in 's' to the previous UNICODE character's first byte
- * @note The function should not be used to determine the length of the previous
- * encoded char because it might be an invalid/corrupt start-sequence
- */
-static inline char *Utf8PrevChar(const char *s)
-{
-	const char *ret = s;
-	while (IsUtf8Part(*--ret));
-	return (char*)ret;
-}
-
-
-static inline bool IsPrintable(WChar c)
-{
-	if (c < 0x20)   return false;
-	if (c < 0xE000) return true;
-	if (c < 0xE200) return false;
-	return true;
-}
-
-/**
- * Check whether UNICODE character is whitespace or not
- * @param c UNICODE character to check
- * @return a boolean value whether 'c' is a whitespace character or not
- * @see http://www.fileformat.info/info/unicode/category/Zs/list.htm
- */
-static inline bool IsWhitespace(WChar c)
-{
-	return
-	  c == 0x0020 /* SPACE */ ||
-	  c == 0x00A0 /* NO-BREAK SPACE */ ||
-	  c == 0x3000 /* IDEOGRAPHIC SPACE */
-	;
-}
-
-
-#endif /* STRING_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/string_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,159 @@
+/* $Id$ */
+
+/** @file string_func.h Functions related to low-level strings. */
+
+#ifndef STRING_FUNC_H
+#define STRING_FUNC_H
+
+#include "core/bitmath_func.hpp"
+#include "string_type.h"
+
+/**
+ * usage ttd_strlcpy(dst, src, lengthof(dst));
+ * @param dst destination buffer
+ * @param src string to copy/concatenate
+ * @param size size of the destination buffer
+ */
+void ttd_strlcat(char *dst, const char *src, size_t size);
+void ttd_strlcpy(char *dst, const char *src, size_t size);
+
+/**
+ * usage: strecpy(dst, src, lastof(dst));
+ * @param dst destination buffer
+ * @param src string to copy
+ * @param last pointer to the last element in the dst array
+ *             if NULL no boundary check is performed
+ * @return a pointer to the terminating \0 in the destination buffer
+ */
+char *strecat(char *dst, const char *src, const char *last);
+char *strecpy(char *dst, const char *src, const char *last);
+
+char *CDECL str_fmt(const char *str, ...);
+
+/** Scans the string for valid characters and if it finds invalid ones,
+ * replaces them with a question mark '?' */
+void str_validate(char *str);
+
+/** Scans the string for colour codes and strips them */
+void str_strip_colours(char *str);
+
+/** Convert the given string to lowercase, only works with ASCII! */
+void strtolower(char *str);
+
+
+static inline bool StrEmpty(const char *s) { return s == NULL || s[0] == '\0'; }
+
+
+/** Get the length of a string, within a limited buffer */
+static inline int ttd_strnlen(const char *str, int maxlen)
+{
+	const char *t;
+	for (t = str; *t != '\0' && t - str < maxlen; t++);
+	return t - str;
+}
+
+/** Convert the md5sum number to a 'hexadecimal' string, return next pos in buffer */
+char *md5sumToString(char *buf, const char *last, const uint8 md5sum[16]);
+
+/**
+ * Only allow certain keys. You can define the filter to be used. This makes
+ *  sure no invalid keys can get into an editbox, like BELL.
+ * @param key character to be checked
+ * @param afilter the filter to use
+ * @return true or false depending if the character is printable/valid or not
+ */
+bool IsValidChar(WChar key, CharSetFilter afilter);
+
+size_t Utf8Decode(WChar *c, const char *s);
+size_t Utf8Encode(char *buf, WChar c);
+size_t Utf8TrimString(char *s, size_t maxlen);
+
+
+static inline WChar Utf8Consume(const char **s)
+{
+	WChar c;
+	*s += Utf8Decode(&c, *s);
+	return c;
+}
+
+
+/** Return the length of a UTF-8 encoded character.
+ * @param c Unicode character.
+ * @return Length of UTF-8 encoding for character.
+ */
+static inline size_t Utf8CharLen(WChar c)
+{
+	if (c < 0x80)       return 1;
+	if (c < 0x800)      return 2;
+	if (c < 0x10000)    return 3;
+	if (c < 0x110000)   return 4;
+
+	/* Invalid valid, we encode as a '?' */
+	return 1;
+}
+
+
+/**
+ * Return the length of an UTF-8 encoded value based on a single char. This
+ * char should be the first byte of the UTF-8 encoding. If not, or encoding
+ * is invalid, return value is 0
+ * @param c char to query length of
+ * @return requested size
+ */
+static inline size_t Utf8EncodedCharLen(char c)
+{
+	if (GB(c, 3, 5) == 0x1E) return 4;
+	if (GB(c, 4, 4) == 0x0E) return 3;
+	if (GB(c, 5, 3) == 0x06) return 2;
+	if (GB(c, 7, 1) == 0x00) return 1;
+
+	/* Invalid UTF8 start encoding */
+	return 0;
+}
+
+
+/* Check if the given character is part of a UTF8 sequence */
+static inline bool IsUtf8Part(char c)
+{
+	return GB(c, 6, 2) == 2;
+}
+
+/**
+ * Retrieve the previous UNICODE character in an UTF-8 encoded string.
+ * @param s char pointer pointing to (the first char of) the next character
+ * @return a pointer in 's' to the previous UNICODE character's first byte
+ * @note The function should not be used to determine the length of the previous
+ * encoded char because it might be an invalid/corrupt start-sequence
+ */
+static inline char *Utf8PrevChar(const char *s)
+{
+	const char *ret = s;
+	while (IsUtf8Part(*--ret));
+	return (char*)ret;
+}
+
+
+static inline bool IsPrintable(WChar c)
+{
+	if (c < 0x20)   return false;
+	if (c < 0xE000) return true;
+	if (c < 0xE200) return false;
+	return true;
+}
+
+/**
+ * Check whether UNICODE character is whitespace or not
+ * @param c UNICODE character to check
+ * @return a boolean value whether 'c' is a whitespace character or not
+ * @see http://www.fileformat.info/info/unicode/category/Zs/list.htm
+ */
+static inline bool IsWhitespace(WChar c)
+{
+	return
+	  c == 0x0020 /* SPACE */ ||
+	  c == 0x00A0 /* NO-BREAK SPACE */ ||
+	  c == 0x3000 /* IDEOGRAPHIC SPACE */
+	;
+}
+
+#endif /* STRING_FUNC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/string_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,19 @@
+/* $Id$ */
+
+/** @file string_type.h Types for strings. */
+
+#ifndef STRING_TYPE_H
+#define STRING_TYPE_H
+
+/**
+ * Valid filter types for IsValidChar.
+ */
+enum CharSetFilter {
+	CS_ALPHANUMERAL,      ///< Both numeric and alphabetic and spaces and stuff
+	CS_NUMERAL,           ///< Only numeric ones
+	CS_ALPHA,             ///< Only alphabetic values
+};
+
+typedef uint32 WChar;
+
+#endif /* STRING_TYPE_H */
--- a/src/strings.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/strings.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,36 +5,41 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "currency.h"
-#include "functions.h"
-#include "string.h"
-#include "strings.h"
-#include "table/strings.h"
 #include "namegen.h"
 #include "station.h"
 #include "town.h"
-#include "vehicle.h"
 #include "news.h"
 #include "screenshot.h"
 #include "waypoint.h"
 #include "industry.h"
 #include "variables.h"
 #include "newgrf_text.h"
-#include "table/control_codes.h"
 #include "music.h"
-#include "date.h"
 #include "industry.h"
 #include "fileio.h"
-#include "helpers.hpp"
 #include "cargotype.h"
 #include "group.h"
 #include "debug.h"
 #include "newgrf_townname.h"
 #include "signs.h"
-#include "vehicle.h"
 #include "newgrf_engine.h"
+#include "spritecache.h"
+#include "fontcache.h"
+#include "gui.h"
+#include "strings_func.h"
+#include "functions.h"
+#include "core/endian_func.hpp"
+#include "date_func.h"
+#include "vehicle_base.h"
+#include "string_func.h"
+#include "player_func.h"
+#include "player_base.h"
+#include "fios.h"
+#include "settings_type.h"
+#include "video/video_driver.hpp"
 
-/* for opendir/readdir/closedir */
-# include "fios.h"
+#include "table/strings.h"
+#include "table/control_codes.h"
 
 DynamicLanguages _dynlang;
 char _userstring[128];
@@ -134,8 +139,7 @@
 			break;
 
 		case 15:
-			/* User defined name */
-			return GetName(buffr, index, last);
+			error("Boo!");
 
 		case 26:
 			/* Include string within newgrf text (format code 81) */
@@ -817,17 +821,20 @@
 				break;
 
 			case SCC_WAYPOINT_NAME: { // {WAYPOINT}
-				int64 temp[2];
 				Waypoint *wp = GetWaypoint(GetInt32(&argv));
-				StringID str;
-				if (wp->string != STR_NULL) {
-					str = wp->string;
+
+				if (!wp->IsValid()) { // waypoint doesn't exist anymore
+					buff = GetStringWithArgs(buff, STR_UNKNOWN_DESTINATION, NULL, last);
+				} else if (wp->name != NULL) {
+					buff = strecpy(buff, wp->name, last);
 				} else {
+					int64 temp[2];
 					temp[0] = wp->town_index;
 					temp[1] = wp->town_cn + 1;
-					str = wp->town_cn == 0 ? STR_WAYPOINTNAME_CITY : STR_WAYPOINTNAME_CITY_SERIAL;
+					StringID str = wp->town_cn == 0 ? STR_WAYPOINTNAME_CITY : STR_WAYPOINTNAME_CITY_SERIAL;
+
+					buff = GetStringWithArgs(buff, str, temp, last);
 				}
-				buff = GetStringWithArgs(buff, str, temp, last);
 				break;
 			}
 
@@ -836,6 +843,8 @@
 
 				if (!st->IsValid()) { // station doesn't exist anymore
 					buff = GetStringWithArgs(buff, STR_UNKNOWN_DESTINATION, NULL, last);
+				} else if (st->name != NULL) {
+					buff = strecpy(buff, st->name, last);
 				} else {
 					int64 temp[3];
 					temp[0] = STR_TOWN;
@@ -855,7 +864,9 @@
 				temp[0] = t->townnameparts;
 				uint32 grfid = t->townnamegrfid;
 
-				if (grfid == 0) {
+				if (t->name != NULL) {
+					buff = strecpy(buff, t->name, last);
+				} else if (grfid == 0) {
 					/* Original town name */
 					buff = GetStringWithArgs(buff, t->townnametype, temp, last);
 				} else {
@@ -873,44 +884,75 @@
 
 			case SCC_GROUP_NAME: { // {GROUP}
 				const Group *g = GetGroup(GetInt32(&argv));
-				int64 args[1];
 
 				assert(g->IsValid());
 
-				args[0] = g->index;
-				buff = GetStringWithArgs(buff, IsCustomName(g->string_id) ? g->string_id : STR_GROUP_NAME_FORMAT, args, last);
+				if (g->name != NULL) {
+					buff = strecpy(buff, g->name, last);
+				} else {
+					int64 args[1];
 
+					args[0] = g->index;
+					buff = GetStringWithArgs(buff, STR_GROUP_NAME_FORMAT, args, last);
+				}
 				break;
 			}
 
 			case SCC_ENGINE_NAME: { // {ENGINE}
 				EngineID engine = (EngineID)GetInt32(&argv);
+				const Engine *e = GetEngine(engine);
 
-				buff = GetString(buff, GetCustomEngineName(engine), last);
+				if (e->name != NULL) {
+					buff = strecpy(buff, e->name, last);
+				} else {
+					buff = GetStringWithArgs(buff, EngInfo(engine)->string_id, NULL, last);
+				}
 				break;
 			}
 
 			case SCC_VEHICLE_NAME: { // {VEHICLE}
 				const Vehicle *v = GetVehicle(GetInt32(&argv));
 
-				int64 args[1];
-				args[0] = v->unitnumber;
+				if (v->name != NULL) {
+					buff = strecpy(buff, v->name, last);
+				} else {
+					int64 args[1];
+					args[0] = v->unitnumber;
 
-				buff = GetStringWithArgs(buff, v->string_id, args, last);
+					StringID str;
+					switch (v->type) {
+						default: NOT_REACHED();
+						case VEH_TRAIN:    str = STR_SV_TRAIN_NAME; break;
+						case VEH_ROAD:     str = STR_SV_ROADVEH_NAME; break;
+						case VEH_SHIP:     str = STR_SV_SHIP_NAME; break;
+						case VEH_AIRCRAFT: str = STR_SV_AIRCRAFT_NAME; break;
+					}
+
+					buff = GetStringWithArgs(buff, str, args, last);
+				}
 				break;
 			}
 
 			case SCC_SIGN_NAME: { // {SIGN}
 				const Sign *si = GetSign(GetInt32(&argv));
-				buff = GetString(buff, si->str, last);
+				if (si->name != NULL) {
+					buff = strecpy(buff, si->name, last);
+				} else {
+					buff = GetStringWithArgs(buff, STR_280A_SIGN, NULL, last);
+				}
 				break;
 			}
 
 			case SCC_COMPANY_NAME: { // {COMPANY}
 				const Player *p = GetPlayer((PlayerID)GetInt32(&argv));
-				int64 args[1];
-				args[0] = p->name_2;
-				buff = GetStringWithArgs(buff, p->name_1, args, last);
+
+				if (p->name != NULL) {
+					buff = strecpy(buff, p->name, last);
+				} else {
+					int64 args[1];
+					args[0] = p->name_2;
+					buff = GetStringWithArgs(buff, p->name_1, args, last);
+				}
 				break;
 			}
 
@@ -928,9 +970,14 @@
 
 			case SCC_PLAYER_NAME: { // {PLAYERNAME}
 				const Player *p = GetPlayer((PlayerID)GetInt32(&argv));
-				int64 args[1];
-				args[0] = p->president_name_2;
-				buff = GetStringWithArgs(buff, p->president_name_1, args, last);
+
+				if (p->president_name != NULL) {
+					buff = strecpy(buff, p->president_name, last);
+				} else {
+					int64 args[1];
+					args[0] = p->president_name_2;
+					buff = GetStringWithArgs(buff, p->president_name_1, args, last);
+				}
 				break;
 			}
 
@@ -1181,7 +1228,6 @@
 #else /* ENABLE_NETWORK */
 static inline void SortNetworkLanguages() {}
 #endif /* ENABLE_NETWORK */
-extern void SortTownGeneratorNames();
 
 bool ReadLanguagePack(int lang_index)
 {
@@ -1239,7 +1285,6 @@
 	_dynlang.curr = lang_index;
 	SetCurrentGrfLangID(_langpack->isocode);
 	SortNetworkLanguages();
-	SortTownGeneratorNames();
 	return true;
 }
 
@@ -1271,14 +1316,6 @@
 }
 #endif /* !(defined(WIN32) || defined(__APPLE__)) */
 
-static int CDECL LanguageCompareFunc(const void *a, const void *b)
-{
-	const Language *cmp1 = (const Language*)a;
-	const Language *cmp2 = (const Language*)b;
-
-	return strcmp(cmp1->file, cmp2->file);
-}
-
 int CDECL StringIDSorter(const void *a, const void *b)
 {
 	const StringID va = *(const StringID*)a;
@@ -1385,9 +1422,6 @@
 	}
 	if (language_count == 0) error("No available language packs (invalid versions?)");
 
-	/* Sort the language names alphabetically */
-	qsort(files, language_count, sizeof(Language), LanguageCompareFunc);
-
 	/* Acquire the locale of the current system */
 	const char *lang = GetCurrentLocale("LC_MESSAGES");
 	if (lang == NULL) lang = "en_GB";
@@ -1406,7 +1440,6 @@
 
 		dl->ent[dl->num].file = files[i].file;
 		dl->ent[dl->num].name = strdup(hdr.name);
-		dl->dropdown[dl->num] = SPECSTR_LANGUAGE_START + dl->num;
 
 		/* We are trying to find a default language. The priority is by
 		 * configuration file, local environment and last, if nothing found,
@@ -1422,8 +1455,6 @@
 
 		dl->num++;
 	}
-	/* Terminate the dropdown list */
-	dl->dropdown[dl->num] = INVALID_STRING_ID;
 
 	if (dl->num == 0) error("Invalid version of language packs");
 
@@ -1435,3 +1466,57 @@
 
 	if (!ReadLanguagePack(chosen_language)) error("Can't read language pack '%s'", dl->ent[chosen_language].file);
 }
+
+/**
+ * Check whether the currently loaded language pack
+ * uses characters that the currently loaded font
+ * does not support. If this is the case an error
+ * message will be shown in English. The error
+ * message will not be localized because that would
+ * mean it might use characters that are not in the
+ * font, which is the whole reason this check has
+ * been added.
+ */
+void CheckForMissingGlyphsInLoadedLanguagePack()
+{
+	const Sprite *question_mark = GetGlyph(FS_NORMAL, '?');
+
+	for (uint i = 0; i != 32; i++) {
+		for (uint j = 0; j < _langtab_num[i]; j++) {
+			const char *string = _langpack_offs[_langtab_start[i] + j];
+			WChar c;
+			while ((c = Utf8Consume(&string)) != '\0') {
+				if (c == SCC_SETX) {
+					/*
+					 * SetX is, together with SetXY as special character that
+					 * uses the next (two) characters as data points. We have
+					 * to skip those, otherwise the UTF8 reading will go
+					 * haywire.
+					 */
+					string++;
+				} else if (c == SCC_SETXY) {
+					string += 2;
+				} else if (IsPrintable(c) && c != '?' && GetGlyph(FS_NORMAL, c) == question_mark) {
+					/*
+					 * The character is printable, but not in the normal font.
+					 * This is the case we were testing for. In this case we
+					 * have to show the error. As we do not want the string to
+					 * be translated by the translators, we 'force' it into the
+					 * binary and 'load' it via a BindCString. To do this
+					 * properly we have to set the color of the string,
+					 * otherwise we end up with a lot of artefacts. The color
+					 * 'character' might change in the future, so for safety
+					 * we just Utf8 Encode it into the string, which takes
+					 * exactly three characters, so it replaces the "XXX" with
+					 * the color marker.
+					 */
+					static char *err_str = strdup("XXXThe current font is missing some of the characters used in the texts for this language. Read the readme to see how to solve this.");
+					Utf8Encode(err_str, SCC_YELLOW);
+					StringID err_msg = BindCString(err_str);
+					ShowErrorMessage(INVALID_STRING_ID, err_msg, 0, 0);
+					return;
+				}
+			}
+		}
+	}
+}
--- a/src/strings.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/* $Id$ */
-
-/** @file strings.h */
-
-#ifndef STRINGS_H
-#define STRINGS_H
-
-char *InlineString(char *buf, StringID string);
-char *GetString(char *buffr, StringID string, const char *last);
-
-extern char _userstring[128];
-
-void InjectDParam(int amount);
-
-static inline void SetDParamX(uint64 *s, uint n, uint64 v)
-{
-	s[n] = v;
-}
-
-static inline void SetDParam(uint n, uint64 v)
-{
-	extern uint64 _decode_parameters[20];
-
-	assert(n < lengthof(_decode_parameters));
-	_decode_parameters[n] = v;
-}
-
-/* Used to bind a C string name to a dparam number.
- * NOTE: This has a short lifetime. You can't
- *       use this string much later or it will be gone. */
-void SetDParamStr(uint n, const char *str);
-
-/** This function takes a C-string and allocates a temporary string ID.
- * The duration of the bound string is valid only until the next call to GetString,
- * so be careful. */
-StringID BindCString(const char *str);
-
-static inline uint64 GetDParamX(const uint64 *s, uint n)
-{
-	return s[n];
-}
-
-static inline uint64 GetDParam(uint n)
-{
-	extern uint64 _decode_parameters[20];
-
-	assert(n < lengthof(_decode_parameters));
-	return _decode_parameters[n];
-}
-
-static inline void CopyInDParam(int offs, const uint64 *src, int num)
-{
-	extern uint64 _decode_parameters[20];
-	memcpy(_decode_parameters + offs, src, sizeof(uint64) * (num));
-}
-
-static inline void CopyOutDParam(uint64 *dst, int offs, int num)
-{
-	extern uint64 _decode_parameters[20];
-	memcpy(dst, _decode_parameters + offs, sizeof(uint64) * (num));
-}
-
-
-/** Information about a language */
-struct Language {
-	char *name; ///< The internal name of the language
-	char *file; ///< The name of the language as it appears on disk
-};
-
-/** Used for dynamic language support */
-struct DynamicLanguages {
-	int num;                         ///< Number of languages
-	int curr;                        ///< Currently selected language index
-	char curr_file[MAX_PATH];        ///< Currently selected language file name without path (needed for saving the filename of the loaded language).
-	StringID dropdown[MAX_LANG + 1]; ///< List of languages in the settings gui
-	Language ent[MAX_LANG];          ///< Information about the languages
-};
-
-extern DynamicLanguages _dynlang; // defined in strings.cpp
-
-bool ReadLanguagePack(int index);
-void InitializeLanguagePacks();
-
-int CDECL StringIDSorter(const void *a, const void *b);
-
-#endif /* STRINGS_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/strings_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,80 @@
+/* $Id$ */
+
+/** @file strings_func.h Functions related to OTTD's strings. */
+
+#ifndef STRINGS_FUNC_H
+#define STRINGS_FUNC_H
+
+#include "strings_type.h"
+
+char *InlineString(char *buf, StringID string);
+char *GetString(char *buffr, StringID string, const char *last);
+
+extern char _userstring[128];
+
+void InjectDParam(int amount);
+
+static inline void SetDParamX(uint64 *s, uint n, uint64 v)
+{
+	s[n] = v;
+}
+
+static inline void SetDParam(uint n, uint64 v)
+{
+	extern uint64 _decode_parameters[20];
+
+	assert(n < lengthof(_decode_parameters));
+	_decode_parameters[n] = v;
+}
+
+/* Used to bind a C string name to a dparam number.
+ * NOTE: This has a short lifetime. You can't
+ *       use this string much later or it will be gone. */
+void SetDParamStr(uint n, const char *str);
+
+/** This function takes a C-string and allocates a temporary string ID.
+ * The duration of the bound string is valid only until the next call to GetString,
+ * so be careful. */
+StringID BindCString(const char *str);
+
+static inline uint64 GetDParamX(const uint64 *s, uint n)
+{
+	return s[n];
+}
+
+static inline uint64 GetDParam(uint n)
+{
+	extern uint64 _decode_parameters[20];
+
+	assert(n < lengthof(_decode_parameters));
+	return _decode_parameters[n];
+}
+
+static inline void CopyInDParam(int offs, const uint64 *src, int num)
+{
+	extern uint64 _decode_parameters[20];
+	memcpy(_decode_parameters + offs, src, sizeof(uint64) * (num));
+}
+
+static inline void CopyOutDParam(uint64 *dst, int offs, int num)
+{
+	extern uint64 _decode_parameters[20];
+	memcpy(dst, _decode_parameters + offs, sizeof(uint64) * (num));
+}
+
+extern DynamicLanguages _dynlang; // defined in strings.cpp
+
+bool ReadLanguagePack(int index);
+void InitializeLanguagePacks();
+
+int CDECL StringIDSorter(const void *a, const void *b);
+
+/** Key comparison function for std::map */
+struct StringIDCompare
+{
+	bool operator()(StringID s1, StringID s2) const { return StringIDSorter(&s1, &s2) < 0; }
+};
+
+void CheckForMissingGlyphsInLoadedLanguagePack();
+
+#endif /* STRINGS_TYPE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/strings_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,88 @@
+/* $Id$ */
+
+/** @file strings_type.h Types related to strings. */
+
+#ifndef STRINGS_TYPE_H
+#define STRINGS_TYPE_H
+
+typedef uint16 StringID;
+static const StringID INVALID_STRING_ID = 0xFFFF;
+
+enum {
+	MAX_LANG = 64,
+};
+
+/** Information about a language */
+struct Language {
+	char *name; ///< The internal name of the language
+	char *file; ///< The name of the language as it appears on disk
+};
+
+/** Used for dynamic language support */
+struct DynamicLanguages {
+	int num;                  ///< Number of languages
+	int curr;                 ///< Currently selected language index
+	char curr_file[MAX_PATH]; ///< Currently selected language file name without path (needed for saving the filename of the loaded language).
+	Language ent[MAX_LANG];   ///< Information about the languages
+};
+
+// special string constants
+enum SpecialStrings {
+
+	// special strings for town names. the town name is generated dynamically on request.
+	SPECSTR_TOWNNAME_START     = 0x20C0,
+	SPECSTR_TOWNNAME_ENGLISH   = SPECSTR_TOWNNAME_START,
+	SPECSTR_TOWNNAME_FRENCH,
+	SPECSTR_TOWNNAME_GERMAN,
+	SPECSTR_TOWNNAME_AMERICAN,
+	SPECSTR_TOWNNAME_LATIN,
+	SPECSTR_TOWNNAME_SILLY,
+	SPECSTR_TOWNNAME_SWEDISH,
+	SPECSTR_TOWNNAME_DUTCH,
+	SPECSTR_TOWNNAME_FINNISH,
+	SPECSTR_TOWNNAME_POLISH,
+	SPECSTR_TOWNNAME_SLOVAKISH,
+	SPECSTR_TOWNNAME_NORWEGIAN,
+	SPECSTR_TOWNNAME_HUNGARIAN,
+	SPECSTR_TOWNNAME_AUSTRIAN,
+	SPECSTR_TOWNNAME_ROMANIAN,
+	SPECSTR_TOWNNAME_CZECH,
+	SPECSTR_TOWNNAME_SWISS,
+	SPECSTR_TOWNNAME_DANISH,
+	SPECSTR_TOWNNAME_TURKISH,
+	SPECSTR_TOWNNAME_ITALIAN,
+	SPECSTR_TOWNNAME_CATALAN,
+	SPECSTR_TOWNNAME_LAST      = SPECSTR_TOWNNAME_CATALAN,
+
+	// special strings for player names on the form "TownName transport".
+	SPECSTR_PLAYERNAME_START   = 0x70EA,
+	SPECSTR_PLAYERNAME_ENGLISH = SPECSTR_PLAYERNAME_START,
+	SPECSTR_PLAYERNAME_FRENCH,
+	SPECSTR_PLAYERNAME_GERMAN,
+	SPECSTR_PLAYERNAME_AMERICAN,
+	SPECSTR_PLAYERNAME_LATIN,
+	SPECSTR_PLAYERNAME_SILLY,
+	SPECSTR_PLAYERNAME_LAST    = SPECSTR_PLAYERNAME_SILLY,
+
+	SPECSTR_ANDCO_NAME         = 0x70E6,
+	SPECSTR_PRESIDENT_NAME     = 0x70E7,
+	SPECSTR_SONGNAME           = 0x70E8,
+
+	// reserve MAX_LANG strings for the *.lng files
+	SPECSTR_LANGUAGE_START     = 0x7100,
+	SPECSTR_LANGUAGE_END       = SPECSTR_LANGUAGE_START + MAX_LANG - 1,
+
+	// reserve 32 strings for various screen resolutions
+	SPECSTR_RESOLUTION_START   = SPECSTR_LANGUAGE_END + 1,
+	SPECSTR_RESOLUTION_END     = SPECSTR_RESOLUTION_START + 0x1F,
+
+	// reserve 32 strings for screenshot formats
+	SPECSTR_SCREENSHOT_START   = SPECSTR_RESOLUTION_END + 1,
+	SPECSTR_SCREENSHOT_END     = SPECSTR_SCREENSHOT_START + 0x1F,
+
+	// Used to implement SetDParamStr
+	STR_SPEC_DYNSTRING         = 0xF800,
+	STR_SPEC_USERSTRING        = 0xF808,
+};
+
+#endif /* STRINGS_TYPE_H */
--- a/src/subsidy_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/subsidy_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,19 +4,19 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "functions.h"
-#include "window.h"
 #include "station.h"
 #include "industry.h"
 #include "town.h"
-#include "player.h"
-#include "gfx.h"
-#include "economy.h"
+#include "economy_func.h"
 #include "variables.h"
-#include "date.h"
 #include "cargotype.h"
+#include "window_gui.h"
+#include "strings_func.h"
+#include "date_func.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+
+#include "table/strings.h"
 
 static void HandleSubsidyClick(int y)
 {
--- a/src/table/autorail.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/table/autorail.h	Tue Jan 22 21:00:30 2008 +0000
@@ -52,21 +52,21 @@
 
 // maps each pixel of a tile (16x16) to a selection type
 // (0,0) is the top corner, (16,16) the bottom corner
-static const byte _AutorailPiece[][16] = {
-	{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
-	{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
-	{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
-	{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
-	{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
-	{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
-	{ 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 },
-	{ 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1 },
-	{ 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1 },
-	{ 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1 },
-	{ 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3 },
-	{ 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3 },
-	{ 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3 },
-	{ 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3 },
-	{ 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3 },
-	{ 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3 }
+static const HighLightStyle _autorail_piece[][16] = {
+	{ HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR },
+	{ HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR },
+	{ HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR },
+	{ HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR },
+	{ HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR },
+	{ HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR },
+	{ HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_Y, HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y  },
+	{ HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y, HT_DIR_X, HT_DIR_Y, HT_DIR_Y, HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y  },
+	{ HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y, HT_DIR_Y, HT_DIR_X, HT_DIR_Y, HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y  },
+	{ HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y  },
+	{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL },
+	{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL },
+	{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL },
+	{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL },
+	{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL },
+	{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL }
 };
--- a/src/table/build_industry.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/table/build_industry.h	Tue Jan 22 21:00:30 2008 +0000
@@ -1176,7 +1176,7 @@
 #define MI(tbl, sndc, snd, d, pc, ai1, ai2, ai3, ai4, ag1, ag2, ag3, ag4, col, \
            c1, c2, c3, proc, p1, r1, p2, r2, m, a1, im1, a2, im2, a3, im3, pr, clim, bev, in, intx, s1, s2, s3) \
 	 {tbl, lengthof(tbl), min(255, d), 0, d, pc, {c1, c2, c3}, proc, {p1, p2}, {r1, r2}, m,            \
-	 {a1, a2, a3}, {{im1, 0}, {im2, 0}, {im3, 0}}, pr, clim, bev, col, in, intx, s1, s2, s3, {ai1, ai2, ai3, ai4}, {ag1, ag2, ag3, ag4}, \
+	 {a1, a2, a3}, {{im1, 0}, {im2, 0}, {im3, 0}}, pr, clim, bev, col, GRFMappedStringID(in, 0), GRFMappedStringID(intx, 0), GRFMappedStringID(s1, 0), GRFMappedStringID(s2, 0), GRFMappedStringID(s3, 0), {ai1, ai2, ai3, ai4}, {ag1, ag2, ag3, ag4}, \
 	 sndc, snd, 0, 0, true, {INVALID_INDUSTRYTYPE, 0, NULL, NULL, INVALID_INDUSTRYTYPE}}
 	/* Format:
 	   tile table                              count and sounds table
--- a/src/table/cargo_const.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/table/cargo_const.h	Tue Jan 22 21:00:30 2008 +0000
@@ -3,7 +3,7 @@
 /* Table of all default cargo types */
 
 #define MK(bt, label, c, e, f, g, h, fr, te, ks1, ks2, ks3, ks4, ks5, l, m) \
-          {bt, label, 0, c, c, e, f, {g, h}, fr, te, 0, 0, ks1, ks2, ks3, ks4, ks5, l, m, NULL}
+          {bt, label, 0, c, c, e, f, {g, h}, fr, te, 0, 0, GRFMappedStringID(ks1, 0), GRFMappedStringID(ks2, 0), GRFMappedStringID(ks3, 0), GRFMappedStringID(ks4, 0), GRFMappedStringID(ks5, 0), l, m, NULL}
 static const CargoSpec _default_cargo[] = {
 	MK(  0, 'PASS', 152,  1, 3185,  0,  24, false, TE_PASSENGERS,
 		STR_000F_PASSENGERS,     STR_002F_PASSENGER,      STR_PASSENGERS, STR_QUANTITY_PASSENGERS,   STR_ABBREV_PASSENGERS,
@@ -141,13 +141,23 @@
 		STR_002D_FIZZY_DRINKS,   STR_004D_FIZZY_DRINK,    STR_NOTHING,    STR_QUANTITY_FIZZY_DRINKS, STR_ABBREV_FIZZY_DRINKS,
 		SPR_CARGO_FIZZYDRINK,    CC_PIECE_GOODS ),
 
+	/* Void slot in temperate */
+	MK( 0xFF,    0,   1,  0, 5688,  0,  30, true,  TE_NONE,
+		STR_000E,                STR_002E,                STR_TONS,       STR_QUANTITY_NOTHING,      STR_ABBREV_NOTHING,
+		SPR_ASCII_SPACE,         CC_NOAVAILABLE ),
+
+	/* Void slot in arctic */
+	MK( 0xFF,    0, 184,  0, 5120,  9, 255, true,  TE_NONE,
+		STR_000E,                STR_002E,                STR_TONS,       STR_QUANTITY_NOTHING,      STR_ABBREV_NOTHING,
+		SPR_ASCII_SPACE,         CC_NOAVAILABLE ),
+
 };
 
 
 /* Table of which cargo types are available in each climate, by default */
 static const CargoLabel _default_climate_cargo[NUM_LANDSCAPE][12] = {
-	{ 'PASS', 'COAL', 'MAIL', 'OIL_', 'LVST', 'GOOD', 'GRAI', 'WOOD', 'IORE', 'STEL', 'VALU', 'VOID', },
-	{ 'PASS', 'COAL', 'MAIL', 'OIL_', 'LVST', 'GOOD', 'WHEA', 'WOOD', 'VOID', 'PAPR', 'GOLD', 'FOOD', },
+	{ 'PASS', 'COAL', 'MAIL', 'OIL_', 'LVST', 'GOOD', 'GRAI', 'WOOD', 'IORE', 'STEL', 'VALU',     33, },
+	{ 'PASS', 'COAL', 'MAIL', 'OIL_', 'LVST', 'GOOD', 'WHEA', 'WOOD',     34, 'PAPR', 'GOLD', 'FOOD', },
 	{ 'PASS', 'RUBR', 'MAIL',      4, 'FRUT', 'GOOD', 'MAIZ',     11, 'CORE', 'WATR', 'DIAM', 'FOOD', },
 	{ 'PASS', 'SUGR', 'MAIL', 'TOYS', 'BATT', 'SWET', 'TOFF', 'COLA', 'CTCD', 'BUBL', 'PLST', 'FZDR', },
 };
--- a/src/table/engines.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/table/engines.h	Tue Jan 22 21:00:30 2008 +0000
@@ -7,8 +7,6 @@
  *  This file contains all the data for vehicles
  */
 
-#include "../sound.h"
-
 /** Writes the properties of a train or road vehicle into the EngineInfo struct.
  * @see EngineInfo
  * @param a Introduction date
@@ -19,7 +17,7 @@
  * @note the 0x80 in parameter b sets the "is carriage bit"
  * @note the 5 between d and e is the load amount
  */
-#define MK(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, e, 0, 8, 0, 0, 0 }
+#define MK(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, e, 0, 8, 0, 0, 0, STR_EMPTY }
 
 /** Writes the properties of a train carriage into the EngineInfo struct.
  * @param a Introduction date
@@ -30,7 +28,7 @@
  * @see MK
  * @note the 5 between d and e is the load amount
  */
-#define MW(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b | 0x80, 5, e, 0, 8, 0, 0, 0 }
+#define MW(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b | 0x80, 5, e, 0, 8, 0, 0, 0, STR_EMPTY }
 
 /** Writes the properties of a ship into the EngineInfo struct.
  * @param a Introduction date
@@ -41,7 +39,7 @@
  * @see MK
  * @note the 10 between d and e is the load amount
  */
-#define MS(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 10, e, 0, 8, 0, 0, 0 }
+#define MS(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 10, e, 0, 8, 0, 0, 0, STR_EMPTY }
 
 /** Writes the properties of an aeroplane into the EngineInfo struct.
  * @param a Introduction date
@@ -52,7 +50,7 @@
  * @see MK
  * @note the 20 between d and e is the load amount
  */
-#define MA(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 20, e, 0, 8, 0, 0, 0 }
+#define MA(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 20, e, 0, 8, 0, 0, 0, STR_EMPTY }
 
 // Climates
 // T = Temperate
@@ -63,7 +61,7 @@
 #define A 2
 #define S 4
 #define Y 8
-const EngineInfo orig_engine_info[] = {
+const EngineInfo _orig_engine_info[] = {
 	MK(  1827,  20,  15,  30, T      ), /*   0 Kirby Paul Tank (Steam) */
 	MK( 12784,  20,  22,  30,   A|S  ), /*   1 MJS 250 (Diesel) */
 	MK(  9497,  20,  20,  50,       Y), /*   2 Ploddyphut Choo-Choo */
@@ -364,7 +362,7 @@
 #define O RAILTYPE_MONO
 #define L RAILTYPE_MAGLEV
 
-const RailVehicleInfo orig_rail_vehicle_info[NUM_TRAIN_ENGINES] = {
+const RailVehicleInfo _orig_rail_vehicle_info[NUM_TRAIN_ENGINES] = {
 	//   image_index  max_speed (kph)      running_cost_base           ai_rank
 	//   |  flags     |        power (hp)  |  running_cost_class       |  railtype
 	//   |  |    base_cost     |    weight |  |   capacity             |  |
@@ -513,7 +511,7 @@
  * @param h refittable
  */
 #define SVI(a, b, c, d, e, f, g, h) { a, b, c, d, e, f, {g}, h }
-const ShipVehicleInfo orig_ship_vehicle_info[NUM_SHIP_ENGINES] = {
+const ShipVehicleInfo _orig_ship_vehicle_info[NUM_SHIP_ENGINES] = {
 	//   image_index  cargo_type     cargo_amount                 refittable
 	//   |    base_cost |              |    running_cost          |
 	//   |    |    max_speed           |    |  sfx                |
@@ -548,7 +546,7 @@
 #define H AIR_HELI
 #define P AIR_CTOL
 #define J AIR_CTOL | AIR_FAST
-const AircraftVehicleInfo orig_aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES] = {
+const AircraftVehicleInfo _orig_aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES] = {
 	//    image_index         sfx                         acceleration
 	//    |   base_cost       |                           |   max_speed
 	//    |   |    running_cost                           |   |    mail_capacity
@@ -612,7 +610,7 @@
  * @param g cargo_type
  */
 #define ROV(a, b, c, d, e, f, g) { a, b, c, {d}, e, f, g }
-const RoadVehicleInfo orig_road_vehicle_info[NUM_ROAD_ENGINES] = {
+const RoadVehicleInfo _orig_road_vehicle_info[NUM_ROAD_ENGINES] = {
 	//    image_index       sfx                                 max_speed
 	//    |    base_cost    |                                   |   capacity
 	//    |    |    running_cost                                |   |  cargo_type
--- a/src/table/files.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/table/files.h	Tue Jan 22 21:00:30 2008 +0000
@@ -33,8 +33,7 @@
 		{ "TRGT.GRF",      {0xfc, 0xde, 0x1d, 0x7e, 0x8a, 0x74, 0x19, 0x7d, 0x72, 0xa6, 0x26, 0x95, 0x88, 0x4b, 0x90, 0x9e} }
 	},
 	{ "SAMPLE.CAT",    {0x42, 0x2e, 0xa3, 0xdd, 0x07, 0x4d, 0x28, 0x59, 0xbb, 0x51, 0x63, 0x9a, 0x6e, 0x0e, 0x85, 0xda} },
-	{ "CHARS.GRF",     {0x5f, 0x2e, 0xbf, 0x05, 0xb6, 0x12, 0x65, 0x81, 0xd2, 0x10, 0xa9, 0x19, 0x62, 0x41, 0x70, 0x64} },
-	{ "OPENTTDD.GRF",  {0x13, 0xb0, 0x8b, 0xfd, 0x01, 0x16, 0x41, 0x0a, 0x0a, 0x35, 0x97, 0x89, 0xd1, 0x5c, 0x83, 0x2e} }
+	{ "OPENTTDD.GRF",  {0xf2, 0xf7, 0x41, 0x00, 0x7d, 0xf6, 0xb0, 0x6c, 0x4a, 0x24, 0x11, 0x07, 0x38, 0x85, 0x94, 0x6b} }
 };
 
 static FileList files_win = {
@@ -47,6 +46,5 @@
 		{ "TRGTR.GRF",     {0xde, 0x53, 0x65, 0x05, 0x17, 0xfe, 0x66, 0x1c, 0xea, 0xa3, 0x13, 0x8c, 0x6e, 0xdb, 0x0e, 0xb8} }
 	},
 	{ "SAMPLE.CAT",    {0x92, 0x12, 0xe8, 0x1e, 0x72, 0xba, 0xdd, 0x4b, 0xbe, 0x1e, 0xae, 0xae, 0x66, 0x45, 0x8e, 0x10} },
-	{ "CHARS.GRF",     {0x5f, 0x2e, 0xbf, 0x05, 0xb6, 0x12, 0x65, 0x81, 0xd2, 0x10, 0xa9, 0x19, 0x62, 0x41, 0x70, 0x64} },
-	{ "OPENTTDW.GRF",  {0x93, 0xb5, 0x07, 0xe7, 0x53, 0xfd, 0x7f, 0x0b, 0x91, 0x40, 0xfe, 0x1f, 0xa2, 0x66, 0xeb, 0xf8} }
+	{ "OPENTTDW.GRF",  {0x7a, 0x92, 0x08, 0x8c, 0xdf, 0xd1, 0x4d, 0x9e, 0x49, 0x97, 0xc1, 0xf1, 0xf5, 0x5b, 0xd2, 0x97} }
 };
--- a/src/table/namegen.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/table/namegen.h	Tue Jan 22 21:00:30 2008 +0000
@@ -2,8 +2,7 @@
 
 /** @file table/namegen.h Namepart tables for the town name generator */
 
-#include "../stdafx.h"
-#include "../openttd.h"
+#include "../core/enum_type.hpp"
 
 static const char *name_original_english_1[] = {
 	"Great ",
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/table/railtypes.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,226 @@
+/* $Id$ */
+
+/** @file railtypes.h
+ * All the railtype-specific information is stored here.
+ */
+
+#ifndef RAILTYPES_H
+#define RAILTYPES_H
+
+/** Global Railtype definition
+ */
+RailtypeInfo _railtypes[] = {
+	/** Railway */
+	{ /* Main Sprites */
+		{ SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_N_S, SPR_RAIL_TRACK_BASE, SPR_RAIL_SINGLE_Y, SPR_RAIL_SINGLE_X,
+			SPR_RAIL_SINGLE_NORTH, SPR_RAIL_SINGLE_SOUTH, SPR_RAIL_SINGLE_EAST, SPR_RAIL_SINGLE_WEST,
+			SPR_CROSSING_OFF_X_RAIL,
+			SPR_TUNNEL_ENTRY_REAR_RAIL
+		},
+
+		/* GUI sprites */
+		{ 0x4E3, 0x4E4, 0x4E5, 0x4E6,
+			SPR_IMG_AUTORAIL,
+			SPR_IMG_DEPOT_RAIL,
+			SPR_IMG_TUNNEL_RAIL,
+			SPR_IMG_CONVERT_RAIL
+		},
+
+		{
+			SPR_CURSOR_NS_TRACK,
+			SPR_CURSOR_SWNE_TRACK,
+			SPR_CURSOR_EW_TRACK,
+			SPR_CURSOR_NWSE_TRACK,
+			SPR_CURSOR_AUTORAIL,
+			SPR_CURSOR_RAIL_DEPOT,
+			SPR_CURSOR_TUNNEL_RAIL,
+			SPR_CURSOR_CONVERT_RAIL
+		},
+
+		/* strings */
+		{ STR_100A_RAILROAD_CONSTRUCTION },
+
+		/* Offset of snow tiles */
+		SPR_RAIL_SNOW_OFFSET,
+
+		/* Powered railtypes */
+		RAILTYPES_RAIL | RAILTYPES_ELECTRIC,
+
+		/* Compatible railtypes */
+		RAILTYPES_RAIL | RAILTYPES_ELECTRIC,
+
+		/* main offset */
+		0,
+
+		/* bridge offset */
+		0,
+
+		/* custom ground offset */
+		0,
+
+		/* curve speed advantage (multiplier) */
+		0,
+	},
+
+	/** Electrified railway */
+	{ /* Main Sprites */
+		{ SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_N_S, SPR_RAIL_TRACK_BASE, SPR_RAIL_SINGLE_Y, SPR_RAIL_SINGLE_X,
+			SPR_RAIL_SINGLE_NORTH, SPR_RAIL_SINGLE_SOUTH, SPR_RAIL_SINGLE_EAST, SPR_RAIL_SINGLE_WEST,
+			SPR_CROSSING_OFF_X_RAIL,
+			SPR_TUNNEL_ENTRY_REAR_RAIL
+		},
+
+		/* GUI sprites */
+		{
+			SPR_BUILD_NS_ELRAIL,
+			SPR_BUILD_X_ELRAIL,
+			SPR_BUILD_EW_ELRAIL,
+			SPR_BUILD_Y_ELRAIL,
+			SPR_IMG_AUTOELRAIL,
+			SPR_IMG_DEPOT_ELRAIL,
+			SPR_BUILD_TUNNEL_ELRAIL,
+			SPR_IMG_CONVERT_ELRAIL
+		},
+
+		{
+			SPR_CURSOR_NS_ELRAIL,
+			SPR_CURSOR_SWNE_ELRAIL,
+			SPR_CURSOR_EW_ELRAIL,
+			SPR_CURSOR_NWSE_ELRAIL,
+			SPR_CURSOR_AUTOELRAIL,
+			SPR_CURSOR_ELRAIL_DEPOT,
+			SPR_CURSOR_TUNNEL_ELRAIL,
+			SPR_CURSOR_CONVERT_ELRAIL
+		},
+
+		/* strings */
+		{ STR_TITLE_ELRAIL_CONSTRUCTION },
+
+		/* Offset of snow tiles */
+		SPR_RAIL_SNOW_OFFSET,
+
+		/* Powered railtypes */
+		RAILTYPES_ELECTRIC,
+
+		/* Compatible railtypes */
+		RAILTYPES_ELECTRIC | RAILTYPES_RAIL,
+
+		/* main offset */
+		0,
+
+		/* bridge offset */
+		0,
+
+		/* custom ground offset */
+		0,
+
+		/* curve speed advantage (multiplier) */
+		0,
+	},
+
+	/** Monorail */
+	{ /* Main Sprites */
+		{ SPR_MONO_TRACK_Y, SPR_MONO_TRACK_N_S, SPR_MONO_TRACK_BASE, SPR_MONO_SINGLE_Y, SPR_MONO_SINGLE_X,
+			SPR_MONO_SINGLE_NORTH, SPR_MONO_SINGLE_SOUTH, SPR_MONO_SINGLE_EAST, SPR_MONO_SINGLE_WEST,
+			SPR_CROSSING_OFF_X_MONO,
+			SPR_TUNNEL_ENTRY_REAR_MONO
+		},
+
+		/* GUI sprites */
+		{ 0x4E7, 0x4E8, 0x4E9, 0x4EA,
+			SPR_IMG_AUTOMONO,
+			SPR_IMG_DEPOT_MONO,
+			SPR_IMG_TUNNEL_MONO,
+			SPR_IMG_CONVERT_MONO
+		},
+
+		{
+			SPR_CURSOR_NS_MONO,
+			SPR_CURSOR_SWNE_MONO,
+			SPR_CURSOR_EW_MONO,
+			SPR_CURSOR_NWSE_MONO,
+			SPR_CURSOR_AUTOMONO,
+			SPR_CURSOR_MONO_DEPOT,
+			SPR_CURSOR_TUNNEL_MONO,
+			SPR_CURSOR_CONVERT_MONO
+		},
+
+		/* strings */
+		{ STR_100B_MONORAIL_CONSTRUCTION },
+
+		/* Offset of snow tiles */
+		SPR_MONO_SNOW_OFFSET,
+
+		/* Powered railtypes */
+		RAILTYPES_MONO,
+
+		/* Compatible Railtypes */
+		RAILTYPES_MONO,
+
+		/* main offset */
+		82,
+
+		/* bridge offset */
+		16,
+
+		/* custom ground offset */
+		1,
+
+		/* curve speed advantage (multiplier) */
+		1,
+	},
+
+	/** Maglev */
+	{ /* Main sprites */
+		{ SPR_MGLV_TRACK_Y, SPR_MGLV_TRACK_N_S, SPR_MGLV_TRACK_BASE, SPR_MGLV_SINGLE_Y, SPR_MGLV_SINGLE_X,
+			SPR_MGLV_SINGLE_NORTH, SPR_MGLV_SINGLE_SOUTH, SPR_MGLV_SINGLE_EAST, SPR_MGLV_SINGLE_WEST,
+			SPR_CROSSING_OFF_X_MAGLEV,
+			SPR_TUNNEL_ENTRY_REAR_MAGLEV
+		},
+
+		/* GUI sprites */
+		{ 0x4EB, 0x4EC, 0x4EE, 0x4ED,
+			SPR_IMG_AUTOMAGLEV,
+			SPR_IMG_DEPOT_MAGLEV,
+			SPR_IMG_TUNNEL_MAGLEV,
+			SPR_IMG_CONVERT_MAGLEV
+		},
+
+		{
+			SPR_CURSOR_NS_MAGLEV,
+			SPR_CURSOR_SWNE_MAGLEV,
+			SPR_CURSOR_EW_MAGLEV,
+			SPR_CURSOR_NWSE_MAGLEV,
+			SPR_CURSOR_AUTOMAGLEV,
+			SPR_CURSOR_MAGLEV_DEPOT,
+			SPR_CURSOR_TUNNEL_MAGLEV,
+			SPR_CURSOR_CONVERT_MAGLEV
+		},
+
+		/* strings */
+		{ STR_100C_MAGLEV_CONSTRUCTION },
+
+		/* Offset of snow tiles */
+		SPR_MGLV_SNOW_OFFSET,
+
+		/* Powered railtypes */
+		RAILTYPES_MAGLEV,
+
+		/* Compatible Railtypes */
+		RAILTYPES_MAGLEV,
+
+		/* main offset */
+		164,
+
+		/* bridge offset */
+		24,
+
+		/* custom ground offset */
+		2,
+
+		/* curve speed advantage (multiplier) */
+		2,
+	},
+};
+
+#endif /* RAILTYPES_H */
--- a/src/table/road_land.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/table/road_land.h	Tue Jan 22 21:00:30 2008 +0000
@@ -33,24 +33,24 @@
 };
 
 static const DrawTileSeqStruct _tram_depot_NE[] = {
-	TILE_SEQ_LINE(SPR_TRAMWAY_BASE + 0x35 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 0, 15, 16, 1)
+	TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x35) | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 0, 15, 16, 1)
 	TILE_SEQ_END()
 };
 
 static const DrawTileSeqStruct _tram_depot_SE[] = {
 	TILE_SEQ_LINE(SPR_TRAMWAY_BASE + 0x31, PAL_NONE, 0, 0, 1, 16)
-	TILE_SEQ_LINE(SPR_TRAMWAY_BASE + 0x32 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 15, 0, 1, 16)
+	TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x32) | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 15, 0, 1, 16)
 	TILE_SEQ_END()
 };
 
 static const DrawTileSeqStruct _tram_depot_SW[] = {
 	TILE_SEQ_LINE(SPR_TRAMWAY_BASE + 0x33, PAL_NONE, 0, 0, 16, 1)
-	TILE_SEQ_LINE(SPR_TRAMWAY_BASE + 0x34 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 0, 15, 16, 1)
+	TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x34) | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 0, 15, 16, 1)
 	TILE_SEQ_END()
 };
 
 static const DrawTileSeqStruct _tram_depot_NW[] = {
-	TILE_SEQ_LINE(SPR_TRAMWAY_BASE + 0x36 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 15, 0, 1, 16)
+	TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x36) | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 15, 0, 1, 16)
 	TILE_SEQ_END()
 };
 
--- a/src/table/sprites.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/table/sprites.h	Tue Jan 22 21:00:30 2008 +0000
@@ -32,6 +32,8 @@
  * @todo Split the "Sprites" enum into smaller chunks and document them
  */
 
+#include "../gfx_type.h"
+
 enum Sprites {
 	SPR_SELECT_TILE  = 752,
 	SPR_DOT          = 774, // corner marker for lower/raise land
@@ -47,7 +49,7 @@
 
 	/* Extra graphic spritenumbers */
 	SPR_OPENTTD_BASE     = 4896,
-	OPENTTD_SPRITE_COUNT = 136,
+	OPENTTD_SPRITE_COUNT = 138,
 
 	/* Halftile-selection sprites */
 	SPR_HALFTILE_SELECTION_FLAT = SPR_OPENTTD_BASE,
@@ -139,22 +141,28 @@
 	SPR_2CCMAP_BASE   = SPR_ELRAIL_BASE + ELRAIL_SPRITE_COUNT,
 	TWOCCMAP_SPRITE_COUNT = 256,
 
-	SPR_AIRPORTX_BASE       = SPR_2CCMAP_BASE + TWOCCMAP_SPRITE_COUNT, // The sprites used for other airport angles
-	SPR_NEWAIRPORT_TARMAC   = SPR_AIRPORTX_BASE,
-	SPR_NSRUNWAY1           = SPR_AIRPORTX_BASE + 1,
-	SPR_NSRUNWAY2           = SPR_AIRPORTX_BASE + 2,
-	SPR_NSRUNWAY3           = SPR_AIRPORTX_BASE + 3,
-	SPR_NSRUNWAY4           = SPR_AIRPORTX_BASE + 4,
-	SPR_NSRUNWAY_END        = SPR_AIRPORTX_BASE + 5,
-	SPR_NEWHANGAR_S         = SPR_AIRPORTX_BASE + 6,
-	SPR_NEWHANGAR_S_WALL    = SPR_AIRPORTX_BASE + 7,
-	SPR_NEWHANGAR_W         = SPR_AIRPORTX_BASE + 8,
-	SPR_NEWHANGAR_W_WALL    = SPR_AIRPORTX_BASE + 9,
-	SPR_NEWHANGAR_N         = SPR_AIRPORTX_BASE + 10,
-	SPR_NEWHANGAR_E         = SPR_AIRPORTX_BASE + 11,
-	SPR_NEWHELIPAD          = SPR_AIRPORTX_BASE + 12,
-	SPR_GRASS_RIGHT         = SPR_AIRPORTX_BASE + 13,
-	SPR_GRASS_LEFT          = SPR_AIRPORTX_BASE + 14,
+	/* shore tiles - action 05-0D */
+	SPR_SHORE_BASE                  = SPR_2CCMAP_BASE + TWOCCMAP_SPRITE_COUNT,
+	SPR_SHORE_SPRITE_COUNT          = 18,
+	SPR_ORIGINALSHORE_START         = 4062,
+	SPR_ORIGINALSHORE_END           = 4069,
+
+	SPR_AIRPORTX_BASE     = SPR_SHORE_BASE + SPR_SHORE_SPRITE_COUNT, // The sprites used for other airport angles
+	SPR_NEWAIRPORT_TARMAC = SPR_AIRPORTX_BASE,
+	SPR_NSRUNWAY1         = SPR_AIRPORTX_BASE + 1,
+	SPR_NSRUNWAY2         = SPR_AIRPORTX_BASE + 2,
+	SPR_NSRUNWAY3         = SPR_AIRPORTX_BASE + 3,
+	SPR_NSRUNWAY4         = SPR_AIRPORTX_BASE + 4,
+	SPR_NSRUNWAY_END      = SPR_AIRPORTX_BASE + 5,
+	SPR_NEWHANGAR_S       = SPR_AIRPORTX_BASE + 6,
+	SPR_NEWHANGAR_S_WALL  = SPR_AIRPORTX_BASE + 7,
+	SPR_NEWHANGAR_W       = SPR_AIRPORTX_BASE + 8,
+	SPR_NEWHANGAR_W_WALL  = SPR_AIRPORTX_BASE + 9,
+	SPR_NEWHANGAR_N       = SPR_AIRPORTX_BASE + 10,
+	SPR_NEWHANGAR_E       = SPR_AIRPORTX_BASE + 11,
+	SPR_NEWHELIPAD        = SPR_AIRPORTX_BASE + 12,
+	SPR_GRASS_RIGHT       = SPR_AIRPORTX_BASE + 13,
+	SPR_GRASS_LEFT        = SPR_AIRPORTX_BASE + 14,
 	SPR_IMG_ARROW_NE_YELLOW = SPR_AIRPORTX_BASE + 15,
 	SPR_IMG_ARROW_SE_YELLOW = SPR_AIRPORTX_BASE + 16,
 	SPR_IMG_ARROW_SW_YELLOW = SPR_AIRPORTX_BASE + 17,
@@ -560,17 +568,6 @@
 	SPR_FARMLAND_STATE_7        = 4259,
 	SPR_FARMLAND_HAYPACKS       = 4278,
 
-	/* Shores */
-	SPR_NO_SHORE                = 0,  //used for tileh which have no shore
-	SPR_SHORE_TILEH_4           = 4062, // SLOPE_E
-	SPR_SHORE_TILEH_1           = 4063, // SLOPE_W
-	SPR_SHORE_TILEH_2           = 4064, // SLOPE_S
-	SPR_SHORE_TILEH_8           = 4065, // SLOPE_N
-	SPR_SHORE_TILEH_6           = 4066, // SLOPE_SE
-	SPR_SHORE_TILEH_12          = 4067, // SLOPE_NE
-	SPR_SHORE_TILEH_3           = 4068, // SLOPE_SW
-	SPR_SHORE_TILEH_9           = 4069, // SLOPE_NW
-
 	/* Water-related sprites */
 	SPR_SHIP_DEPOT_SE_FRONT     = 4070,
 	SPR_SHIP_DEPOT_SW_FRONT     = 4071,
@@ -1029,6 +1026,7 @@
 	SPR_IMG_TRANSMITTER     = 4086,
 	SPR_IMG_LEVEL_LAND      = SPR_OPENTTD_BASE + 91,
 	SPR_IMG_BUILD_CANAL     = SPR_OPENTTD_BASE + 88,
+	SPR_IMG_BUILD_RIVER     = SPR_OPENTTD_BASE + 136,
 	SPR_IMG_BUILD_LOCK      = SPR_CANALS_BASE + 64,
 	SPR_IMG_PAUSE           = 726,
 	SPR_IMG_FASTFORWARD     = SPR_OPENTTD_BASE + 90,
@@ -1331,6 +1329,7 @@
 	SPR_CURSOR_DOCK           = 3668,
 	SPR_CURSOR_CANAL          = SPR_OPENTTD_BASE + 89,
 	SPR_CURSOR_LOCK           = SPR_OPENTTD_BASE + 87,
+	SPR_CURSOR_RIVER          = SPR_OPENTTD_BASE + 137,
 
 	/* shared road & rail cursors */
 	SPR_CURSOR_BRIDGE         = 2593,
@@ -1422,6 +1421,7 @@
 	TRANSPARENT_BIT = 31,       ///< toggles transparency in the sprite
 	RECOLOR_BIT = 30,           ///< toggles recoloring in the sprite
 	OFFSET_BIT = 29,
+	OPAQUE_BIT = 28,
 
 	PALETTE_WIDTH = 24,         ///< number of bits of the sprite containing the recolor palette
 	SPRITE_WIDTH = 24,          ///< number of bits for the sprite number
@@ -1437,7 +1437,8 @@
  */
 enum Modifiers {
 	SPRITE_MODIFIER_USE_OFFSET    = OFFSET_BIT,
-	SPRITE_MODIFIER_OPAQUE        = OFFSET_BIT,
+	/// Set when a sprite must not ever be displayed transparently
+	SPRITE_MODIFIER_OPAQUE        = OPAQUE_BIT,
 	///when a sprite is to be displayed transparently, this bit needs to be set.
 	PALETTE_MODIFIER_TRANSPARENT  = TRANSPARENT_BIT,
 	///this bit is set when a recoloring process is in action
--- a/src/table/station_land.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/table/station_land.h	Tue Jan 22 21:00:30 2008 +0000
@@ -1168,10 +1168,10 @@
 };
 
 static const DrawTileSprites _station_display_datas_dock[] = {
-	{ SPR_SHORE_TILEH_3,              PAL_NONE, _station_display_datas_76 },
-	{ SPR_SHORE_TILEH_9,              PAL_NONE, _station_display_datas_77 },
-	{ SPR_SHORE_TILEH_12,             PAL_NONE, _station_display_datas_78 },
-	{ SPR_SHORE_TILEH_6,              PAL_NONE, _station_display_datas_79 },
+	{ SPR_SHORE_BASE + SLOPE_SW,      PAL_NONE, _station_display_datas_76 },
+	{ SPR_SHORE_BASE + SLOPE_NW,      PAL_NONE, _station_display_datas_77 },
+	{ SPR_SHORE_BASE + SLOPE_NE,      PAL_NONE, _station_display_datas_78 },
+	{ SPR_SHORE_BASE + SLOPE_SE,      PAL_NONE, _station_display_datas_79 },
 	{ SPR_FLAT_WATER_TILE,            PAL_NONE, _station_display_datas_80 },
 	{ SPR_FLAT_WATER_TILE,            PAL_NONE, _station_display_datas_81 },
 };
--- a/src/table/town_land.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/table/town_land.h	Tue Jan 22 21:00:30 2008 +0000
@@ -1803,7 +1803,7 @@
  * @see HouseSpec
  */
 #define MS(mnd, mxd, p, rc, bn, rr, mg, ca1, ca2, ca3, bf, ba, cg1, cg2, cg3) \
-	{mnd, mxd, p, rc, bn, rr, mg, {ca1, ca2, ca3}, {cg1, cg2, cg3}, bf, ba, true, \
+	{mnd, mxd, p, rc, GRFMappedStringID(bn, 0), rr, mg, {ca1, ca2, ca3}, {cg1, cg2, cg3}, bf, ba, true, \
 	 0, NULL, 0, 0, {0, 0, 0, 0}, 16, NO_EXTRA_FLAG, HOUSE_NO_CLASS, 0, 2, 0, 0, 0, NULL}
 /** House specifications from original data */
 static const HouseSpec _original_house_specs[] = {
--- a/src/table/unicode.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/table/unicode.h	Tue Jan 22 21:00:30 2008 +0000
@@ -14,8 +14,4 @@
 
 static DefaultUnicodeMapping _default_unicode_map[] = {
 	{ 0x010D, 0x63 }, /* Small letter c with caron */
-	{ 0x0160, 0xA6 }, /* Capital letter s with caron */
-	{ 0x0161, 0xA8 }, /* Small letter s with caron */
-	{ 0x017E, 0xB8 }, /* Small letter z with caron */
-	{ 0x20AC, 0xA4 }, /* Euro symbol */
 };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/terraform_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,408 @@
+/* $Id$ */
+
+/** @file terraform_cmd.cpp Commands related to terraforming. */
+
+#include "stdafx.h"
+#include "openttd.h"
+#include "strings_type.h"
+#include "command_func.h"
+#include "tile_map.h"
+#include "tunnel_map.h"
+#include "bridge_map.h"
+#include "variables.h"
+#include "functions.h"
+#include "economy_func.h"
+
+#include "table/strings.h"
+
+/*
+ * In one terraforming command all four corners of a initial tile can be raised/lowered (though this is not available to the player).
+ * The maximal amount of height modifications is archieved when raising a complete flat land from sea level to MAX_TILE_HEIGHT or vice versa.
+ * This affects all corners with a manhatten distance smaller than MAX_TILE_HEIGHT to one of the initial 4 corners.
+ * Their maximal amount is computed to 4 * \sum_{i=1}^{h_max} i  =  2 * h_max * (h_max + 1).
+ */
+static const int TERRAFORMER_MODHEIGHT_SIZE = 2 * MAX_TILE_HEIGHT * (MAX_TILE_HEIGHT + 1);
+
+/*
+ * The maximal amount of affected tiles (i.e. the tiles that incident with one of the corners above, is computed similiar to
+ * 1 + 4 * \sum_{i=1}^{h_max} (i+1)  =  1 + 2 * h_max + (h_max + 3).
+ */
+static const int TERRAFORMER_TILE_TABLE_SIZE = 1 + 2 * MAX_TILE_HEIGHT * (MAX_TILE_HEIGHT + 3);
+
+struct TerraformerHeightMod {
+	TileIndex tile;   ///< Referenced tile.
+	byte height;      ///< New TileHeight (height of north corner) of the tile.
+};
+
+struct TerraformerState {
+	int modheight_count;                                         ///< amount of entries in "modheight".
+	int tile_table_count;                                        ///< amount of entries in "tile_table".
+
+	/**
+	 * Dirty tiles, i.e.\ at least one corner changed.
+	 *
+	 * This array contains the tiles which are or will be marked as dirty.
+	 *
+	 * @ingroup dirty
+	 */
+	TileIndex tile_table[TERRAFORMER_TILE_TABLE_SIZE];
+	TerraformerHeightMod modheight[TERRAFORMER_MODHEIGHT_SIZE];  ///< Height modifications.
+};
+
+TileIndex _terraform_err_tile;
+
+/**
+ * Gets the TileHeight (height of north corner) of a tile as of current terraforming progress.
+ *
+ * @param ts TerraformerState.
+ * @param tile Tile.
+ * @return TileHeight.
+ */
+static int TerraformGetHeightOfTile(TerraformerState *ts, TileIndex tile)
+{
+	TerraformerHeightMod *mod = ts->modheight;
+	int count;
+
+	for (count = ts->modheight_count; count != 0; count--, mod++) {
+		if (mod->tile == tile) return mod->height;
+	}
+
+	/* TileHeight unchanged so far, read value from map. */
+	return TileHeight(tile);
+}
+
+/**
+ * Stores the TileHeight (height of north corner) of a tile in a TerraformerState.
+ *
+ * @param ts TerraformerState.
+ * @param tile Tile.
+ * @param height New TileHeight.
+ */
+static void TerraformSetHeightOfTile(TerraformerState *ts, TileIndex tile, int height)
+{
+	/* Find tile in the "modheight" table.
+	 * Note: In a normal user-terraform command the tile will not be found in the "modheight" table.
+	 *       But during house- or industry-construction multiple corners can be terraformed at once. */
+	TerraformerHeightMod *mod = ts->modheight;
+	int count = ts->modheight_count;
+	while ((count > 0) && (mod->tile != tile)) {
+		mod++;
+		count--;
+	}
+
+	/* New entry? */
+	if (count == 0) {
+		assert(ts->modheight_count < TERRAFORMER_MODHEIGHT_SIZE);
+		ts->modheight_count++;
+	}
+
+	/* Finally store the new value */
+	mod->tile = tile;
+	mod->height = (byte)height;
+}
+
+/**
+ * Adds a tile to the "tile_table" in a TerraformerState.
+ *
+ * @param ts TerraformerState.
+ * @param tile Tile.
+ * @ingroup dirty
+ */
+static void TerraformAddDirtyTile(TerraformerState *ts, TileIndex tile)
+{
+	int count;
+	TileIndex *t;
+
+	count = ts->tile_table_count;
+
+	for (t = ts->tile_table; count != 0; count--, t++) {
+		if (*t == tile) return;
+	}
+
+	assert(ts->tile_table_count < TERRAFORMER_TILE_TABLE_SIZE);
+
+	ts->tile_table[ts->tile_table_count++] = tile;
+}
+
+/**
+ * Adds all tiles that incident with the north corner of a specific tile to the "tile_table" in a TerraformerState.
+ *
+ * @param ts TerraformerState.
+ * @param tile Tile.
+ * @ingroup dirty
+ */
+static void TerraformAddDirtyTileAround(TerraformerState *ts, TileIndex tile)
+{
+	TerraformAddDirtyTile(ts, tile + TileDiffXY( 0, -1));
+	TerraformAddDirtyTile(ts, tile + TileDiffXY(-1, -1));
+	TerraformAddDirtyTile(ts, tile + TileDiffXY(-1,  0));
+	TerraformAddDirtyTile(ts, tile);
+}
+
+/**
+ * Terraform the north corner of a tile to a specific height.
+ *
+ * @param ts TerraformerState.
+ * @param tile Tile.
+ * @param height Aimed height.
+ * @param return Error code or cost.
+ */
+static CommandCost TerraformTileHeight(TerraformerState *ts, TileIndex tile, int height)
+{
+	CommandCost total_cost(EXPENSES_CONSTRUCTION);
+
+	assert(tile < MapSize());
+
+	/* Check range of destination height */
+	if (height < 0) return_cmd_error(STR_1003_ALREADY_AT_SEA_LEVEL);
+	if (height > MAX_TILE_HEIGHT) return_cmd_error(STR_1004_TOO_HIGH);
+
+	/*
+	 * Check if the terraforming has any effect.
+	 * This can only be true, if multiple corners of the start-tile are terraformed (i.e. the terraforming is done by towns/industries etc.).
+	 * In this case the terraforming should fail. (Don't know why.)
+	 */
+	if (height == TerraformGetHeightOfTile(ts, tile)) return CMD_ERROR;
+
+	/* Check "too close to edge of map" */
+	uint x = TileX(tile);
+	uint y = TileY(tile);
+	if ((x <= 1) || (y <= 1) || (x >= MapMaxX() - 1) || (y >= MapMaxY() - 1)) {
+		/*
+		 * Determine a sensible error tile
+		 * Note: If x and y are both zero this will disable the error tile. (Tile 0 cannot be highlighted :( )
+		 */
+		if ((x == 1) && (y != 0)) x = 0;
+		if ((y == 1) && (x != 0)) y = 0;
+		_terraform_err_tile = TileXY(x, y);
+		return_cmd_error(STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP);
+	}
+
+	/* Mark incident tiles, that are involved in the terraforming */
+	TerraformAddDirtyTileAround(ts, tile);
+
+	/* Store the height modification */
+	TerraformSetHeightOfTile(ts, tile, height);
+
+	/* Increment cost */
+	total_cost.AddCost(_price.terraform);
+
+	/* Recurse to neighboured corners if height difference is larger than 1 */
+	{
+		const TileIndexDiffC *ttm;
+
+		static const TileIndexDiffC _terraform_tilepos[] = {
+			{ 1,  0}, // move to tile in SE
+			{-2,  0}, // undo last move, and move to tile in NW
+			{ 1,  1}, // undo last move, and move to tile in SW
+			{ 0, -2}  // undo last move, and move to tile in NE
+		};
+
+		for (ttm = _terraform_tilepos; ttm != endof(_terraform_tilepos); ttm++) {
+			tile += ToTileIndexDiff(*ttm);
+
+			/* Get TileHeight of neighboured tile as of current terraform progress */
+			int r = TerraformGetHeightOfTile(ts, tile);
+			int height_diff = height - r;
+
+			/* Is the height difference to the neighboured corner greater than 1? */
+			if (abs(height_diff) > 1) {
+				/* Terraform the neighboured corner. The resulting height difference should be 1. */
+				height_diff += (height_diff < 0 ? 1 : -1);
+				CommandCost cost = TerraformTileHeight(ts, tile, r + height_diff);
+				if (CmdFailed(cost)) return cost;
+				total_cost.AddCost(cost);
+			}
+		}
+	}
+
+	return total_cost;
+}
+
+/** Terraform land
+ * @param tile tile to terraform
+ * @param flags for this command type
+ * @param p1 corners to terraform (SLOPE_xxx)
+ * @param p2 direction; eg up (non-zero) or down (zero)
+ * @return error or cost of terraforming
+ */
+CommandCost CmdTerraformLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+{
+	TerraformerState ts;
+	CommandCost total_cost(EXPENSES_CONSTRUCTION);
+	int direction = (p2 != 0 ? 1 : -1);
+
+	_terraform_err_tile = 0;
+
+	ts.modheight_count = ts.tile_table_count = 0;
+
+	/* Make an extra check for map-bounds cause we add tiles to the originating tile */
+	if (tile + TileDiffXY(1, 1) >= MapSize()) return CMD_ERROR;
+
+	/* Compute the costs and the terraforming result in a model of the landscape */
+	if ((p1 & SLOPE_W) != 0) {
+		TileIndex t = tile + TileDiffXY(1, 0);
+		CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
+		if (CmdFailed(cost)) return cost;
+		total_cost.AddCost(cost);
+	}
+
+	if ((p1 & SLOPE_S) != 0) {
+		TileIndex t = tile + TileDiffXY(1, 1);
+		CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
+		if (CmdFailed(cost)) return cost;
+		total_cost.AddCost(cost);
+	}
+
+	if ((p1 & SLOPE_E) != 0) {
+		TileIndex t = tile + TileDiffXY(0, 1);
+		CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
+		if (CmdFailed(cost)) return cost;
+		total_cost.AddCost(cost);
+	}
+
+	if ((p1 & SLOPE_N) != 0) {
+		TileIndex t = tile + TileDiffXY(0, 0);
+		CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
+		if (CmdFailed(cost)) return cost;
+		total_cost.AddCost(cost);
+	}
+
+	/* Check if the terraforming is valid wrt. tunnels, bridges and objects on the surface */
+	{
+		int count;
+		TileIndex *ti = ts.tile_table;
+
+		for (count = ts.tile_table_count; count != 0; count--, ti++) {
+			TileIndex tile = *ti;
+
+			/* Find new heights of tile corners */
+			uint z_N = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(0, 0));
+			uint z_W = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(1, 0));
+			uint z_S = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(1, 1));
+			uint z_E = TerraformGetHeightOfTile(&ts, tile + TileDiffXY(0, 1));
+
+			/* Find min and max height of tile */
+			uint z_min = min(min(z_N, z_W), min(z_S, z_E));
+			uint z_max = max(max(z_N, z_W), max(z_S, z_E));
+
+			/* Compute tile slope */
+			uint tileh = (z_max > z_min + 1 ? SLOPE_STEEP : SLOPE_FLAT);
+			if (z_W > z_min) tileh += SLOPE_W;
+			if (z_S > z_min) tileh += SLOPE_S;
+			if (z_E > z_min) tileh += SLOPE_E;
+			if (z_N > z_min) tileh += SLOPE_N;
+
+			/* Check if bridge would take damage */
+			if (direction == 1 && MayHaveBridgeAbove(tile) && IsBridgeAbove(tile) &&
+					GetBridgeHeight(GetSouthernBridgeEnd(tile)) <= z_max * TILE_HEIGHT) {
+				_terraform_err_tile = tile; // highlight the tile under the bridge
+				return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
+			}
+			/* Check if tunnel would take damage */
+			if (direction == -1 && IsTunnelInWay(tile, z_min * TILE_HEIGHT)) {
+				_terraform_err_tile = tile; // highlight the tile above the tunnel
+				return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE);
+			}
+			/* Check tiletype-specific things, and add extra-cost */
+			CommandCost cost = _tile_type_procs[GetTileType(tile)]->terraform_tile_proc(tile, flags | DC_AUTO, z_min * TILE_HEIGHT, (Slope) tileh);
+			if (CmdFailed(cost)) {
+				_terraform_err_tile = tile;
+				return cost;
+			}
+			total_cost.AddCost(cost);
+		}
+	}
+
+	if (flags & DC_EXEC) {
+		/* change the height */
+		{
+			int count;
+			TerraformerHeightMod *mod;
+
+			mod = ts.modheight;
+			for (count = ts.modheight_count; count != 0; count--, mod++) {
+				TileIndex til = mod->tile;
+
+				SetTileHeight(til, mod->height);
+			}
+		}
+
+		/* finally mark the dirty tiles dirty */
+		{
+			int count;
+			TileIndex *ti = ts.tile_table;
+			for (count = ts.tile_table_count; count != 0; count--, ti++) {
+				MarkTileDirtyByTile(*ti);
+			}
+		}
+	}
+	return total_cost;
+}
+
+
+/** Levels a selected (rectangle) area of land
+ * @param tile end tile of area-drag
+ * @param flags for this command type
+ * @param p1 start tile of area drag
+ * @param p2 height difference; eg raise (+1), lower (-1) or level (0)
+ * @return  error or cost of terraforming
+ */
+CommandCost CmdLevelLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+{
+	int size_x, size_y;
+	int ex;
+	int ey;
+	int sx, sy;
+	uint h, oldh, curh;
+	CommandCost money;
+	CommandCost ret;
+	CommandCost cost(EXPENSES_CONSTRUCTION);
+
+	if (p1 >= MapSize()) return CMD_ERROR;
+
+	/* remember level height */
+	oldh = TileHeight(p1);
+
+	/* compute new height */
+	h = oldh + p2;
+
+	/* Check range of destination height */
+	if (h > MAX_TILE_HEIGHT) return_cmd_error((oldh == 0) ? STR_1003_ALREADY_AT_SEA_LEVEL : STR_1004_TOO_HIGH);
+
+	/* make sure sx,sy are smaller than ex,ey */
+	ex = TileX(tile);
+	ey = TileY(tile);
+	sx = TileX(p1);
+	sy = TileY(p1);
+	if (ex < sx) Swap(ex, sx);
+	if (ey < sy) Swap(ey, sy);
+	tile = TileXY(sx, sy);
+
+	size_x = ex - sx + 1;
+	size_y = ey - sy + 1;
+
+	money.AddCost(GetAvailableMoneyForCommand());
+
+	BEGIN_TILE_LOOP(tile2, size_x, size_y, tile) {
+		curh = TileHeight(tile2);
+		while (curh != h) {
+			ret = DoCommand(tile2, SLOPE_N, (curh > h) ? 0 : 1, flags & ~DC_EXEC, CMD_TERRAFORM_LAND);
+			if (CmdFailed(ret)) break;
+
+			if (flags & DC_EXEC) {
+				money.AddCost(-ret.GetCost());
+				if (money.GetCost() < 0) {
+					_additional_cash_required = ret.GetCost();
+					return cost;
+				}
+				DoCommand(tile2, SLOPE_N, (curh > h) ? 0 : 1, flags, CMD_TERRAFORM_LAND);
+			}
+
+			cost.AddCost(ret);
+			curh += (curh > h) ? -1 : 1;
+		}
+	} END_TILE_LOOP(tile2, size_x, size_y, tile)
+
+	return (cost.GetCost() == 0) ? CMD_ERROR : cost;
+}
--- a/src/terraform_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/terraform_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,26 +6,32 @@
 #include "openttd.h"
 #include "bridge_map.h"
 #include "clear_map.h"
+#include "player_func.h"
+#include "player_base.h"
+#include "gui.h"
+#include "window_gui.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "command_func.h"
+#include "signs.h"
+#include "variables.h"
+#include "functions.h"
+#include "sound_func.h"
+#include "station.h"
+#include "unmovable_map.h"
+#include "textbuf_gui.h"
+#include "genworld.h"
+#include "settings_type.h"
+
 #include "table/sprites.h"
 #include "table/strings.h"
-#include "functions.h"
-#include "player.h"
-#include "tile.h"
-#include "window.h"
-#include "gui.h"
-#include "viewport.h"
-#include "gfx.h"
-#include "sound.h"
-#include "command.h"
-#include "vehicle.h"
-#include "signs.h"
-#include "variables.h"
 
 void CcTerraform(bool success, TileIndex tile, uint32 p1, uint32 p2)
 {
 	if (success) {
 		SndPlayTileFx(SND_1F_SPLAT, tile);
 	} else {
+		extern TileIndex _terraform_err_tile;
 		SetRedErrorSquare(_terraform_err_tile);
 	}
 }
@@ -108,6 +114,12 @@
 		case DDSP_DEMOLISH_AREA:
 			DoCommandP(end_tile, start_tile, 0, CcPlaySound10, CMD_CLEAR_AREA | CMD_MSG(STR_00B5_CAN_T_CLEAR_THIS_AREA));
 			break;
+		case DDSP_RAISE_AND_LEVEL_AREA:
+			DoCommandP(end_tile, start_tile, 1, CcTerraform, CMD_LEVEL_LAND | CMD_MSG(STR_0808_CAN_T_RAISE_LAND_HERE));
+			break;
+		case DDSP_LOWER_AND_LEVEL_AREA:
+			DoCommandP(end_tile, start_tile, (uint32)-1, CcTerraform, CMD_LEVEL_LAND | CMD_MSG(STR_0809_CAN_T_LOWER_LAND_HERE));
+			break;
 		case DDSP_LEVEL_AREA:
 			DoCommandP(end_tile, start_tile, 0, CcPlaySound10, CMD_LEVEL_LAND);
 			break;
@@ -120,6 +132,9 @@
 		case DDSP_CREATE_WATER:
 			DoCommandP(end_tile, start_tile, _ctrl_pressed, CcBuildCanal, CMD_BUILD_CANAL | CMD_MSG(STR_CANT_BUILD_CANALS));
 			break;
+		case DDSP_CREATE_RIVER:
+			DoCommandP(end_tile, start_tile, 2, CcBuildCanal, CMD_BUILD_CANAL | CMD_MSG(STR_CANT_BUILD_CANALS));
+			break;
 		default:
 			return false;
 	}
@@ -146,18 +161,12 @@
 
 static void PlaceProc_RaiseLand(TileIndex tile)
 {
-	DoCommandP(
-		tile, SLOPE_N, 1, CcTerraform,
-		CMD_TERRAFORM_LAND | CMD_MSG(STR_0808_CAN_T_RAISE_LAND_HERE)
-	);
+	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_RAISE_AND_LEVEL_AREA);
 }
 
 static void PlaceProc_LowerLand(TileIndex tile)
 {
-	DoCommandP(
-		tile, SLOPE_N, 0, CcTerraform,
-		CMD_TERRAFORM_LAND | CMD_MSG(STR_0809_CAN_T_LOWER_LAND_HERE)
-	);
+	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_LOWER_AND_LEVEL_AREA);
 }
 
 void PlaceProc_LevelLand(TileIndex tile)
@@ -247,6 +256,8 @@
 		if (e->we.place.pt.x != -1) {
 			switch (e->we.place.select_proc) {
 				case DDSP_DEMOLISH_AREA:
+				case DDSP_RAISE_AND_LEVEL_AREA:
+				case DDSP_LOWER_AND_LEVEL_AREA:
 				case DDSP_LEVEL_AREA:
 					GUIPlaceProcDragXY(e);
 					break;
@@ -255,7 +266,7 @@
 		break;
 
 	case WE_ABORT_PLACE_OBJ:
-		RaiseWindowButtons(w);
+		w->RaiseButtons();
 		break;
 	}
 }
@@ -299,3 +310,367 @@
 		SetWindowDirty(link);
 	}
 }
+
+static byte _terraform_size = 1;
+
+/**
+ * Raise/Lower a bigger chunk of land at the same time in the editor. When
+ * raising get the lowest point, when lowering the highest point, and set all
+ * tiles in the selection to that height.
+ * @todo : Incorporate into game itself to allow for ingame raising/lowering of
+ *         larger chunks at the same time OR remove altogether, as we have 'level land' ?
+ * @param tile The top-left tile where the terraforming will start
+ * @param mode 1 for raising, 0 for lowering land
+ */
+static void CommonRaiseLowerBigLand(TileIndex tile, int mode)
+{
+	int sizex, sizey;
+	uint h;
+
+	_generating_world = true; // used to create green terraformed land
+
+	if (_terraform_size == 1) {
+		StringID msg =
+			mode ? STR_0808_CAN_T_RAISE_LAND_HERE : STR_0809_CAN_T_LOWER_LAND_HERE;
+
+		DoCommandP(tile, SLOPE_N, (uint32)mode, CcTerraform, CMD_TERRAFORM_LAND | CMD_MSG(msg));
+	} else {
+		SndPlayTileFx(SND_1F_SPLAT, tile);
+
+		assert(_terraform_size != 0);
+		/* check out for map overflows */
+		sizex = min(MapSizeX() - TileX(tile) - 1, _terraform_size);
+		sizey = min(MapSizeY() - TileY(tile) - 1, _terraform_size);
+
+		if (sizex == 0 || sizey == 0) return;
+
+		if (mode != 0) {
+			/* Raise land */
+			h = 15; // XXX - max height
+			BEGIN_TILE_LOOP(tile2, sizex, sizey, tile) {
+				h = min(h, TileHeight(tile2));
+			} END_TILE_LOOP(tile2, sizex, sizey, tile)
+		} else {
+			/* Lower land */
+			h = 0;
+			BEGIN_TILE_LOOP(tile2, sizex, sizey, tile) {
+				h = max(h, TileHeight(tile2));
+			} END_TILE_LOOP(tile2, sizex, sizey, tile)
+		}
+
+		BEGIN_TILE_LOOP(tile2, sizex, sizey, tile) {
+			if (TileHeight(tile2) == h) {
+				DoCommandP(tile2, SLOPE_N, (uint32)mode, NULL, CMD_TERRAFORM_LAND);
+			}
+		} END_TILE_LOOP(tile2, sizex, sizey, tile)
+	}
+
+	_generating_world = false;
+}
+
+static void PlaceProc_RaiseBigLand(TileIndex tile)
+{
+	CommonRaiseLowerBigLand(tile, 1);
+}
+
+static void PlaceProc_LowerBigLand(TileIndex tile)
+{
+	CommonRaiseLowerBigLand(tile, 0);
+}
+
+static void PlaceProc_RockyArea(TileIndex tile)
+{
+	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_ROCKS);
+}
+
+static void PlaceProc_LightHouse(TileIndex tile)
+{
+	if (!IsTileType(tile, MP_CLEAR) || IsSteepSlope(GetTileSlope(tile, NULL)) || IsBridgeAbove(tile)) {
+		return;
+	}
+
+	MakeLighthouse(tile);
+	MarkTileDirtyByTile(tile);
+	SndPlayTileFx(SND_1F_SPLAT, tile);
+}
+
+static void PlaceProc_Transmitter(TileIndex tile)
+{
+	if (!IsTileType(tile, MP_CLEAR) || IsSteepSlope(GetTileSlope(tile, NULL)) || IsBridgeAbove(tile)) {
+		return;
+	}
+
+	MakeTransmitter(tile);
+	MarkTileDirtyByTile(tile);
+	SndPlayTileFx(SND_1F_SPLAT, tile);
+}
+
+static void PlaceProc_DesertArea(TileIndex tile)
+{
+	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_DESERT);
+}
+
+static void PlaceProc_WaterArea(TileIndex tile)
+{
+	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_WATER);
+}
+
+static void PlaceProc_RiverArea(TileIndex tile)
+{
+	VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_RIVER);
+}
+
+static const Widget _scen_edit_land_gen_widgets[] = {
+{  WWT_CLOSEBOX,   RESIZE_NONE,     7,     0,    10,     0,    13, STR_00C5,                  STR_018B_CLOSE_WINDOW},
+{   WWT_CAPTION,   RESIZE_NONE,     7,    11,   191,     0,    13, STR_0223_LAND_GENERATION,  STR_018C_WINDOW_TITLE_DRAG_THIS},
+{ WWT_STICKYBOX,   RESIZE_NONE,     7,   192,   203,     0,    13, STR_NULL,                  STR_STICKY_BUTTON},
+{     WWT_PANEL,   RESIZE_NONE,     7,     0,   203,    14,   102, 0x0,                       STR_NULL},
+{    WWT_IMGBTN,   RESIZE_NONE,    14,     2,    23,    16,    37, SPR_IMG_DYNAMITE,          STR_018D_DEMOLISH_BUILDINGS_ETC},
+{    WWT_IMGBTN,   RESIZE_NONE,    14,    24,    45,    16,    37, SPR_IMG_TERRAFORM_DOWN,    STR_018E_LOWER_A_CORNER_OF_LAND},
+{    WWT_IMGBTN,   RESIZE_NONE,    14,    46,    67,    16,    37, SPR_IMG_TERRAFORM_UP,      STR_018F_RAISE_A_CORNER_OF_LAND},
+{    WWT_IMGBTN,   RESIZE_NONE,    14,    68,    89,    16,    37, SPR_IMG_LEVEL_LAND,        STR_LEVEL_LAND_TOOLTIP},
+{    WWT_IMGBTN,   RESIZE_NONE,    14,    90,   111,    16,    37, SPR_IMG_BUILD_CANAL,       STR_CREATE_LAKE},
+{    WWT_IMGBTN,   RESIZE_NONE,    14,   112,   133,    16,    37, SPR_IMG_BUILD_RIVER,       STR_CREATE_RIVER},
+{    WWT_IMGBTN,   RESIZE_NONE,    14,   134,   156,    16,    37, SPR_IMG_ROCKS,             STR_028C_PLACE_ROCKY_AREAS_ON_LANDSCAPE},
+{    WWT_IMGBTN,   RESIZE_NONE,    14,   157,   179,    16,    37, SPR_IMG_LIGHTHOUSE_DESERT, STR_NULL}, // XXX - dynamic
+{    WWT_IMGBTN,   RESIZE_NONE,    14,   180,   201,    16,    37, SPR_IMG_TRANSMITTER,       STR_028E_PLACE_TRANSMITTER},
+{    WWT_IMGBTN,   RESIZE_NONE,    14,   150,   161,    45,    56, SPR_ARROW_UP,              STR_0228_INCREASE_SIZE_OF_LAND_AREA},
+{    WWT_IMGBTN,   RESIZE_NONE,    14,   150,   161,    58,    69, SPR_ARROW_DOWN,            STR_0229_DECREASE_SIZE_OF_LAND_AREA},
+{   WWT_TEXTBTN,   RESIZE_NONE,    14,    24,   179,    76,    87, STR_SE_NEW_WORLD,          STR_022A_GENERATE_RANDOM_LAND},
+{   WWT_TEXTBTN,   RESIZE_NONE,    14,    24,   179,    89,   100, STR_022B_RESET_LANDSCAPE,  STR_RESET_LANDSCAPE_TOOLTIP},
+{   WIDGETS_END},
+};
+
+static const int8 _multi_terraform_coords[][2] = {
+	{  0, -2},
+	{  4,  0}, { -4,  0}, {  0,  2},
+	{ -8,  2}, { -4,  4}, {  0,  6}, {  4,  4}, {  8,  2},
+	{-12,  0}, { -8, -2}, { -4, -4}, {  0, -6}, {  4, -4}, {  8, -2}, { 12,  0},
+	{-16,  2}, {-12,  4}, { -8,  6}, { -4,  8}, {  0, 10}, {  4,  8}, {  8,  6}, { 12,  4}, { 16,  2},
+	{-20,  0}, {-16, -2}, {-12, -4}, { -8, -6}, { -4, -8}, {  0,-10}, {  4, -8}, {  8, -6}, { 12, -4}, { 16, -2}, { 20,  0},
+	{-24,  2}, {-20,  4}, {-16,  6}, {-12,  8}, { -8, 10}, { -4, 12}, {  0, 14}, {  4, 12}, {  8, 10}, { 12,  8}, { 16,  6}, { 20,  4}, { 24,  2},
+	{-28,  0}, {-24, -2}, {-20, -4}, {-16, -6}, {-12, -8}, { -8,-10}, { -4,-12}, {  0,-14}, {  4,-12}, {  8,-10}, { 12, -8}, { 16, -6}, { 20, -4}, { 24, -2}, { 28,  0},
+};
+
+/**
+ * @todo Merge with terraform_gui.cpp (move there) after I have cooled down at its braindeadness
+ * and changed OnButtonClick to include the widget as well in the function declaration. Post 0.4.0 - Darkvater
+ */
+static void EditorTerraformClick_Dynamite(Window *w)
+{
+	HandlePlacePushButton(w, 4, ANIMCURSOR_DEMOLISH, VHM_RECT, PlaceProc_DemolishArea);
+}
+
+static void EditorTerraformClick_LowerBigLand(Window *w)
+{
+	HandlePlacePushButton(w, 5, ANIMCURSOR_LOWERLAND, VHM_POINT, PlaceProc_LowerBigLand);
+}
+
+static void EditorTerraformClick_RaiseBigLand(Window *w)
+{
+	HandlePlacePushButton(w, 6, ANIMCURSOR_RAISELAND, VHM_POINT, PlaceProc_RaiseBigLand);
+}
+
+static void EditorTerraformClick_LevelLand(Window *w)
+{
+	HandlePlacePushButton(w, 7, SPR_CURSOR_LEVEL_LAND, VHM_POINT, PlaceProc_LevelLand);
+}
+
+static void EditorTerraformClick_WaterArea(Window *w)
+{
+	HandlePlacePushButton(w, 8, SPR_CURSOR_CANAL, VHM_RECT, PlaceProc_WaterArea);
+}
+
+static void EditorTerraformClick_RiverArea(Window *w)
+{
+	HandlePlacePushButton(w, 9, SPR_CURSOR_RIVER, VHM_RECT, PlaceProc_RiverArea);
+}
+
+static void EditorTerraformClick_RockyArea(Window *w)
+{
+	HandlePlacePushButton(w, 10, SPR_CURSOR_ROCKY_AREA, VHM_RECT, PlaceProc_RockyArea);
+}
+
+static void EditorTerraformClick_DesertLightHouse(Window *w)
+{
+	HandlePlacePushButton(w, 11, SPR_CURSOR_LIGHTHOUSE, VHM_RECT, (_opt.landscape == LT_TROPIC) ? PlaceProc_DesertArea : PlaceProc_LightHouse);
+}
+
+static void EditorTerraformClick_Transmitter(Window *w)
+{
+	HandlePlacePushButton(w, 12, SPR_CURSOR_TRANSMITTER, VHM_RECT, PlaceProc_Transmitter);
+}
+
+static const uint16 _editor_terraform_keycodes[] = {
+	'D',
+	'Q',
+	'W',
+	'E',
+	'R',
+	'T',
+	'Y',
+	'U',
+	'I'
+};
+
+typedef void OnButtonClick(Window *w);
+static OnButtonClick * const _editor_terraform_button_proc[] = {
+	EditorTerraformClick_Dynamite,
+	EditorTerraformClick_LowerBigLand,
+	EditorTerraformClick_RaiseBigLand,
+	EditorTerraformClick_LevelLand,
+	EditorTerraformClick_WaterArea,
+	EditorTerraformClick_RiverArea,
+	EditorTerraformClick_RockyArea,
+	EditorTerraformClick_DesertLightHouse,
+	EditorTerraformClick_Transmitter
+};
+
+
+/** Callback function for the scenario editor 'reset landscape' confirmation window
+ * @param w Window unused
+ * @param confirmed boolean value, true when yes was clicked, false otherwise */
+static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed)
+{
+	if (confirmed) {
+		Player *p;
+
+		/* Set generating_world to true to get instant-green grass after removing
+		 * player property. */
+		_generating_world = true;
+		/* Delete all players */
+		FOR_ALL_PLAYERS(p) {
+			if (p->is_active) {
+				ChangeOwnershipOfPlayerItems(p->index, PLAYER_SPECTATOR);
+				p->is_active = false;
+			}
+		}
+		_generating_world = false;
+
+		/* Delete all stations owned by a player */
+		Station *st;
+		FOR_ALL_STATIONS(st) {
+			if (IsValidPlayer(st->owner)) delete st;
+		}
+	}
+}
+
+static void ScenEditLandGenWndProc(Window *w, WindowEvent *e)
+{
+	switch (e->event) {
+		case WE_CREATE:
+			/* XXX - lighthouse button is widget 11!! Don't forget when changing */
+			w->widget[11].tooltips = (_opt.landscape == LT_TROPIC) ? STR_028F_DEFINE_DESERT_AREA : STR_028D_PLACE_LIGHTHOUSE;
+			break;
+
+		case WE_PAINT: {
+			DrawWindowWidgets(w);
+
+			int n = _terraform_size * _terraform_size;
+			const int8 *coords = &_multi_terraform_coords[0][0];
+
+			assert(n != 0);
+			do {
+				DrawSprite(SPR_WHITE_POINT, PAL_NONE, 88 + coords[0], 55 + coords[1]);
+				coords += 2;
+			} while (--n);
+
+			if (w->IsWidgetLowered(5) || w->IsWidgetLowered(6)) // change area-size if raise/lower corner is selected
+				SetTileSelectSize(_terraform_size, _terraform_size);
+
+		} break;
+
+		case WE_KEYPRESS:
+			for (uint i = 0; i != lengthof(_editor_terraform_keycodes); i++) {
+				if (e->we.keypress.keycode == _editor_terraform_keycodes[i]) {
+					e->we.keypress.cont = false;
+					_editor_terraform_button_proc[i](w);
+					break;
+				}
+			}
+			break;
+
+		case WE_CLICK:
+			switch (e->we.click.widget) {
+				case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12:
+					_editor_terraform_button_proc[e->we.click.widget - 4](w);
+					break;
+				case 13: case 14: { // Increase/Decrease terraform size
+					int size = (e->we.click.widget == 13) ? 1 : -1;
+					w->HandleButtonClick(e->we.click.widget);
+					size += _terraform_size;
+
+					if (!IsInsideMM(size, 1, 8 + 1)) return;
+					_terraform_size = size;
+
+					SndPlayFx(SND_15_BEEP);
+					SetWindowDirty(w);
+				} break;
+				case 15: // gen random land
+					w->HandleButtonClick(15);
+					ShowCreateScenario();
+					break;
+				case 16: // Reset landscape
+					ShowQuery(
+						STR_022C_RESET_LANDSCAPE,
+						STR_RESET_LANDSCAPE_CONFIRMATION_TEXT,
+						NULL,
+						ResetLandscapeConfirmationCallback);
+					break;
+			}
+			break;
+
+		case WE_TIMEOUT:
+			for (uint i = 0; i < w->widget_count; i++) {
+				if (w->IsWidgetLowered(i)) {
+					w->RaiseWidget(i);
+					w->InvalidateWidget(i);
+				}
+				if (i == 3) i = 12;
+			}
+			break;
+
+		case WE_PLACE_OBJ:
+			_place_proc(e->we.place.tile);
+			break;
+
+		case WE_PLACE_DRAG:
+			VpSelectTilesWithMethod(e->we.place.pt.x, e->we.place.pt.y, e->we.place.select_method);
+			break;
+
+		case WE_PLACE_MOUSEUP:
+			if (e->we.place.pt.x != -1) {
+				switch (e->we.place.select_proc) {
+					case DDSP_CREATE_ROCKS:
+					case DDSP_CREATE_DESERT:
+					case DDSP_CREATE_WATER:
+					case DDSP_CREATE_RIVER:
+					case DDSP_RAISE_AND_LEVEL_AREA:
+					case DDSP_LOWER_AND_LEVEL_AREA:
+					case DDSP_LEVEL_AREA:
+					case DDSP_DEMOLISH_AREA:
+						GUIPlaceProcDragXY(e);
+						break;
+				}
+			}
+			break;
+
+		case WE_ABORT_PLACE_OBJ:
+			w->RaiseButtons();
+			SetWindowDirty(w);
+			break;
+	}
+}
+
+static const WindowDesc _scen_edit_land_gen_desc = {
+	WDP_AUTO, WDP_AUTO, 204, 103, 204, 103,
+	WC_SCEN_LAND_GEN, WC_NONE,
+	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
+	_scen_edit_land_gen_widgets,
+	ScenEditLandGenWndProc,
+};
+
+void ShowEditorTerraformToolbar()
+{
+	AllocateWindowDescFront(&_scen_edit_land_gen_desc, 0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/terraform_gui.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,15 @@
+/* $Id$ */
+
+/** @file terraform_gui.h GUI stuff related to terraforming. */
+
+#ifndef TERRAFORM_GUI_H
+#define TERRAFORM_GUI_H
+
+#include "window_type.h"
+
+void CcTerraform(bool success, TileIndex tile, uint32 p1, uint32 p2);
+
+void ShowTerraformToolbar(Window *link = NULL);
+void ShowEditorTerraformToolbar();
+
+#endif /* GUI_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/textbuf_gui.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,46 @@
+/* $Id$ */
+
+/** @file textbuf_gui.h Stuff related to the text buffer GUI. */
+
+#ifndef TEXTBUF_GUI_H
+#define TEXTBUF_GUI_H
+
+#include "window_type.h"
+#include "string_type.h"
+
+struct Textbuf {
+	char *buf;                  ///< buffer in which text is saved
+	uint16 maxlength, maxwidth; ///< the maximum size of the buffer. Maxwidth specifies screensize in pixels, maxlength is in bytes
+	uint16 length, width;       ///< the current size of the string. Width specifies screensize in pixels, length is in bytes
+	bool caret;                 ///< is the caret ("_") visible or not
+	uint16 caretpos;            ///< the current position of the caret in the buffer, in bytes
+	uint16 caretxoffs;          ///< the current position of the caret in pixels
+};
+
+struct querystr_d {
+	StringID caption;
+	Textbuf text;
+	const char *orig;
+	CharSetFilter afilter;
+	bool handled;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(querystr_d));
+
+
+void DrawEditBox(Window *w, querystr_d *string, int wid);
+void HandleEditBox(Window *w, querystr_d *string, int wid);
+int HandleEditBoxKey(Window *w, querystr_d *string, int wid, WindowEvent *we);
+bool HandleCaret(Textbuf *tb);
+
+void DeleteTextBufferAll(Textbuf *tb);
+bool DeleteTextBufferChar(Textbuf *tb, int delmode);
+bool InsertTextBufferChar(Textbuf *tb, uint32 key);
+bool InsertTextBufferClipboard(Textbuf *tb);
+bool MoveTextBufferPos(Textbuf *tb, int navmode);
+void InitializeTextBuffer(Textbuf *tb, const char *buf, uint16 maxlength, uint16 maxwidth);
+void UpdateTextBufferSize(Textbuf *tb);
+
+void ShowQueryString(StringID str, StringID caption, uint maxlen, uint maxwidth, Window *parent, CharSetFilter afilter);
+void ShowQuery(StringID caption, StringID message, Window *w, void (*callback)(Window*, bool));
+
+#endif /* TEXTBUF_GUI_H */
--- a/src/texteff.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/texteff.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,23 +4,26 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
-#include "macros.h"
-#include "strings.h"
-#include "gfx.h"
+#include "tile_cmd.h"
 #include "landscape.h"
-#include "viewport.h"
+#include "gfx_func.h"
 #include "saveload.h"
 #include "console.h"
-#include "string.h"
 #include "variables.h"
-#include "table/sprites.h"
 #include "blitter/factory.hpp"
-#include <stdarg.h> /* va_list */
-#include "date.h"
 #include "texteff.hpp"
 #include "video/video_driver.hpp"
 #include "transparency.h"
+#include "strings_func.h"
+#include "core/alloc_func.hpp"
+#include "date_func.h"
+#include "functions.h"
+#include "viewport_func.h"
+#include "settings_type.h"
+
+#include "table/sprites.h"
+
+#include <stdarg.h> /* va_list */
 
 enum {
 	MAX_TEXTMESSAGE_LENGTH = 200,
@@ -58,7 +61,7 @@
 
 /* The chatbox grows from the bottom so the coordinates are pixels from
  * the left and pixels from the bottom. The height is the maximum height */
-static const Oblong _chatmsg_box = {10, 30, 500, 150};
+static const PointDimension _chatmsg_box = {10, 30, 500, 150};
 static uint8 _chatmessage_backup[150 * 500 * 6]; // (height * width)
 
 static inline uint GetChatMessageCount()
@@ -292,7 +295,7 @@
 	/* If there is none found, we grow the array */
 	if (i == _num_text_effects) {
 		_num_text_effects += 25;
-		_text_effect_list = (TextEffect*) realloc(_text_effect_list, _num_text_effects * sizeof(TextEffect));
+		_text_effect_list = ReallocT<TextEffect>(_text_effect_list, _num_text_effects);
 		for (; i < _num_text_effects; i++) _text_effect_list[i].string_id = INVALID_STRING_ID;
 		i = _num_text_effects - 1;
 	}
--- a/src/tgp.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/tgp.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,17 +6,17 @@
 #include <math.h>
 #include "openttd.h"
 #include "clear_map.h"
-#include "functions.h"
-#include "map.h"
-#include "table/strings.h"
 #include "clear_map.h"
-#include "tile.h"
 #include "variables.h"
 #include "void_map.h"
 #include "tgp.h"
 #include "console.h"
 #include "genworld.h"
-#include "helpers.hpp"
+#include "core/alloc_func.hpp"
+#include "core/random_func.hpp"
+#include "settings_type.h"
+
+#include "table/strings.h"
 
 /*
  *
--- a/src/thread.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/thread.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,8 +4,8 @@
 
 #include "stdafx.h"
 #include "thread.h"
+#include "core/alloc_func.hpp"
 #include <stdlib.h>
-#include "helpers.hpp"
 
 #if defined(__AMIGA__) || defined(PSP) || defined(NO_THREADS)
 OTTDThread *OTTDCreateThread(OTTDThreadFunc function, void *arg) { return NULL; }
--- a/src/tile.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/* $Id$ */
-
-/** @file tile.cpp */
-
-#include "stdafx.h"
-#include "tile.h"
-
-Slope GetTileSlope(TileIndex tile, uint *h)
-{
-	uint a;
-	uint b;
-	uint c;
-	uint d;
-	uint min;
-	uint r;
-
-	assert(tile < MapSize());
-
-	if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) {
-		if (h != NULL) *h = 0;
-		return SLOPE_FLAT;
-	}
-
-	min = a = TileHeight(tile);
-	b = TileHeight(tile + TileDiffXY(1, 0));
-	if (min > b) min = b;
-	c = TileHeight(tile + TileDiffXY(0, 1));
-	if (min > c) min = c;
-	d = TileHeight(tile + TileDiffXY(1, 1));
-	if (min > d) min = d;
-
-	r = SLOPE_FLAT;
-	if ((a -= min) != 0) r += (--a << 4) + SLOPE_N;
-	if ((c -= min) != 0) r += (--c << 4) + SLOPE_E;
-	if ((d -= min) != 0) r += (--d << 4) + SLOPE_S;
-	if ((b -= min) != 0) r += (--b << 4) + SLOPE_W;
-
-	if (h != NULL) *h = min * TILE_HEIGHT;
-
-	return (Slope)r;
-}
-
-uint GetTileZ(TileIndex tile)
-{
-	if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) return 0;
-
-	uint h = TileHeight(tile);
-	h = min(h, TileHeight(tile + TileDiffXY(1, 0)));
-	h = min(h, TileHeight(tile + TileDiffXY(0, 1)));
-	h = min(h, TileHeight(tile + TileDiffXY(1, 1)));
-
-	return h * TILE_HEIGHT;
-}
-
-
-uint GetTileMaxZ(TileIndex t)
-{
-	if (TileX(t) == MapMaxX() || TileY(t) == MapMaxY()) return 0;
-
-	uint h = TileHeight(t);
-	h = max(h, TileHeight(t + TileDiffXY(1, 0)));
-	h = max(h, TileHeight(t + TileDiffXY(0, 1)));
-	h = max(h, TileHeight(t + TileDiffXY(1, 1)));
-
-	return h * TILE_HEIGHT;
-}
--- a/src/tile.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,229 +0,0 @@
-/* $Id$ */
-
-/** @file tile.h */
-
-#ifndef TILE_H
-#define TILE_H
-
-#include "macros.h"
-#include "openttd.h"
-#include "map.h"
-#include "slope.h"
-
-/** Maximum allowed tile height */
-#define MAX_TILE_HEIGHT 15
-
-/** Maximum allowed snowline height */
-#define MAX_SNOWLINE_HEIGHT (MAX_TILE_HEIGHT - 2)
-
-/**
- * The different type of a tile.
- *
- * Each tile belongs to one type, according whatever is build on it.
- *
- * @note A railway with a crossing street is marked as MP_ROAD.
- */
-enum TileType {
-	MP_CLEAR,               ///< A tile without any structures, i.e. grass, rocks, farm fields etc.
-	MP_RAILWAY,             ///< A railway
-	MP_ROAD,                ///< A tile with road (or tram tracks)
-	MP_HOUSE,               ///< A house by a town
-	MP_TREES,               ///< Tile got trees
-	MP_STATION,             ///< A tile of a station
-	MP_WATER,               ///< Water tile
-	MP_VOID,                ///< Invisible tiles at the SW and SE border
-	MP_INDUSTRY,            ///< Part of an industry
-	MP_TUNNELBRIDGE,        ///< Tunnel entry/exit and bridge heads
-	MP_UNMOVABLE,           ///< Contains an object with cannot be removed like transmitters
-};
-
-/**
- * Additional infos of a tile on a tropic game.
- *
- * Each non-water tile in a tropic game is either a rainforest tile or a
- * desert one.
- */
-enum TropicZone {
-	TROPICZONE_INVALID    = 0,      ///< Invalid tropiczone-type
-	TROPICZONE_DESERT     = 1,      ///< Tile is desert
-	TROPICZONE_RAINFOREST = 2,      ///< Rainforest tile
-};
-
-Slope GetTileSlope(TileIndex tile, uint *h);
-uint GetTileZ(TileIndex tile);
-uint GetTileMaxZ(TileIndex tile);
-
-/**
- * Returns the height of a tile
- *
- * This function returns the height of the northern corner of a tile.
- * This is saved in the global map-array. It does not take affect by
- * any slope-data of the tile.
- *
- * @param tile The tile to get the height from
- * @return the height of the tile
- * @pre tile < MapSize()
- */
-static inline uint TileHeight(TileIndex tile)
-{
-	assert(tile < MapSize());
-	return GB(_m[tile].type_height, 0, 4);
-}
-
-/**
- * Sets the height of a tile.
- *
- * This function sets the height of the northern corner of a tile.
- *
- * @param tile The tile to change the height
- * @param height The new height value of the tile
- * @pre tile < MapSize()
- * @pre heigth <= MAX_TILE_HEIGHT
- */
-static inline void SetTileHeight(TileIndex tile, uint height)
-{
-	assert(tile < MapSize());
-	assert(height <= MAX_TILE_HEIGHT);
-	SB(_m[tile].type_height, 0, 4, height);
-}
-
-/**
- * Returns the height of a tile in pixels.
- *
- * This function returns the height of the northern corner of a tile in pixels.
- *
- * @param tile The tile to get the height
- * @return The height of the tile in pixel
- */
-static inline uint TilePixelHeight(TileIndex tile)
-{
-	return TileHeight(tile) * TILE_HEIGHT;
-}
-
-/**
- * Get the tiletype of a given tile.
- *
- * @param tile The tile to get the TileType
- * @return The tiletype of the tile
- * @pre tile < MapSize()
- */
-static inline TileType GetTileType(TileIndex tile)
-{
-	assert(tile < MapSize());
-	return (TileType)GB(_m[tile].type_height, 4, 4);
-}
-
-/**
- * Set the type of a tile
- *
- * This functions sets the type of a tile. If the type
- * MP_VOID is selected the tile must be at the south-west or
- * south-east edges of the map and vice versa.
- *
- * @param tile The tile to save the new type
- * @param type The type to save
- * @pre tile < MapSize()
- * @pre type MP_VOID <=> tile is on the south-east or south-west edge.
- */
-static inline void SetTileType(TileIndex tile, TileType type)
-{
-	assert(tile < MapSize());
-	/* VOID tiles (and no others) are exactly allowed at the lower left and right
-	 * edges of the map */
-	assert((TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) == (type == MP_VOID));
-	SB(_m[tile].type_height, 4, 4, type);
-}
-
-/**
- * Checks if a tile is a give tiletype.
- *
- * This function checks if a tile got the given tiletype.
- *
- * @param tile The tile to check
- * @param type The type to check agains
- * @return true If the type matches agains the type of the tile
- */
-static inline bool IsTileType(TileIndex tile, TileType type)
-{
-	return GetTileType(tile) == type;
-}
-
-/**
- * Returns the owner of a tile
- *
- * This function returns the owner of a tile. This cannot used
- * for tiles which type is one of MP_HOUSE, MP_VOID and MP_INDUSTRY
- * as no player owned any of these buildings.
- *
- * @param tile The tile to check
- * @return The owner of the tile
- * @pre tile < MapSize()
- * @pre The type of the tile must not be MP_HOUSE, MP_VOID and MP_INDUSTRY
- */
-static inline Owner GetTileOwner(TileIndex tile)
-{
-	assert(tile < MapSize());
-	assert(!IsTileType(tile, MP_HOUSE));
-	assert(!IsTileType(tile, MP_VOID));
-	assert(!IsTileType(tile, MP_INDUSTRY));
-
-	return (Owner)_m[tile].m1;
-}
-
-/**
- * Sets the owner of a tile
- *
- * This function sets the owner status of a tile. Note that you cannot
- * set a owner for tiles of type MP_HOUSE, MP_VOID and MP_INDUSTRY.
- *
- * @param tile The tile to change the owner status.
- * @param owner The new owner.
- * @pre tile < MapSize()
- * @pre The type of the tile must not be MP_HOUSE, MP_VOID and MP_INDUSTRY
- */
-static inline void SetTileOwner(TileIndex tile, Owner owner)
-{
-	assert(tile < MapSize());
-	assert(!IsTileType(tile, MP_HOUSE));
-	assert(!IsTileType(tile, MP_VOID));
-	assert(!IsTileType(tile, MP_INDUSTRY));
-
-	_m[tile].m1 = owner;
-}
-
-/**
- * Checks if a tile belongs to the given owner
- *
- * @param tile The tile to check
- * @param owner The owner to check agains
- * @return True if a tile belongs the the given owner
- */
-static inline bool IsTileOwner(TileIndex tile, Owner owner)
-{
-	return GetTileOwner(tile) == owner;
-}
-
-/**
- * Set the tropic zone
- * @param tile the tile to set the zone of
- * @param type the new type
- * @pre assert(tile < MapSize());
- */
-static inline void SetTropicZone(TileIndex tile, TropicZone type)
-{
-	assert(tile < MapSize());
-	SB(_m[tile].m6, 0, 2, type);
-}
-
-/**
- * Get the tropic zone
- * @param tile the tile to get the zone of
- * @pre assert(tile < MapSize());
- * @return the zone type
- */
-static inline TropicZone GetTropicZone(TileIndex tile)
-{
-	assert(tile < MapSize());
-	return (TropicZone)GB(_m[tile].m6, 0, 2);
-}
-#endif /* TILE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/tile_cmd.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,136 @@
+/* $Id$ */
+
+/** @file tile_cmd.h Generic 'commands' that can be performed on all tiles. */
+
+#ifndef TILE_CMD_H
+#define TILE_CMD_H
+
+#include "slope_type.h"
+#include "tile_type.h"
+#include "command_type.h"
+#include "vehicle_type.h"
+#include "cargo_type.h"
+#include "strings_type.h"
+#include "date_type.h"
+#include "player_type.h"
+
+/** The returned bits of VehicleEnterTile. */
+enum VehicleEnterTileStatus {
+	VETS_ENTERED_STATION  = 1, ///< The vehicle entered a station
+	VETS_ENTERED_WORMHOLE = 2, ///< The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/tunnel)
+	VETS_CANNOT_ENTER     = 3, ///< The vehicle cannot enter the tile
+
+	/**
+	 * Shift the VehicleEnterTileStatus this many bits
+	 * to the right to get the station ID when
+	 * VETS_ENTERED_STATION is set
+	 */
+	VETS_STATION_ID_OFFSET = 8,
+	VETS_STATION_MASK      = 0xFFFF << VETS_STATION_ID_OFFSET,
+
+	/** Bit sets of the above specified bits */
+	VETSB_CONTINUE         = 0,                          ///< The vehicle can continue normally
+	VETSB_ENTERED_STATION  = 1 << VETS_ENTERED_STATION,  ///< The vehicle entered a station
+	VETSB_ENTERED_WORMHOLE = 1 << VETS_ENTERED_WORMHOLE, ///< The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/tunnel)
+	VETSB_CANNOT_ENTER     = 1 << VETS_CANNOT_ENTER,     ///< The vehicle cannot enter the tile
+};
+DECLARE_ENUM_AS_BIT_SET(VehicleEnterTileStatus);
+
+struct TileInfo {
+	uint x;
+	uint y;
+	Slope tileh;
+	TileIndex tile;
+	uint z;
+};
+
+struct TileDesc {
+	StringID str;
+	Owner owner;
+	Date build_date;
+	uint64 dparam[2];
+};
+
+typedef void DrawTileProc(TileInfo *ti);
+typedef uint GetSlopeZProc(TileIndex tile, uint x, uint y);
+typedef CommandCost ClearTileProc(TileIndex tile, byte flags);
+typedef void GetAcceptedCargoProc(TileIndex tile, AcceptedCargo res);
+typedef void GetTileDescProc(TileIndex tile, TileDesc *td);
+
+/**
+ * GetTileTrackStatusProcs return a value that contains the possible tracks
+ * that can be taken on a given tile by a given transport. The return value is
+ * composed as follows: 0xaabbccdd. ccdd and aabb are bitmasks of trackdirs,
+ * where bit n corresponds to trackdir n. ccdd are the trackdirs that are
+ * present in the tile (1==present, 0==not present), aabb is the signal
+ * status, if applicable (0==green/no signal, 1==red, note that this is
+ * reversed from map3/2[tile] for railway signals).
+ *
+ * The result (let's call it ts) is often used as follows:
+ * tracks = (byte)(ts | ts >>8)
+ * This effectively converts the present part of the result (ccdd) to a
+ * track bitmask, which disregards directions. Normally, this is the same as just
+ * doing (byte)ts I think, although I am not really sure
+ *
+ * A trackdir is combination of a track and a dir, where the lower three bits
+ * are a track, the fourth bit is the direction. these give 12 (or 14)
+ * possible options: 0-5 and 8-13, so we need 14 bits for a trackdir bitmask
+ * above.
+ * @param tile     the tile to get the track status from
+ * @param mode     the mode of transportation
+ * @param sub_mode used to differentiate between different kinds within the mode
+ * @return the above mentions track status information
+ */
+typedef uint32 GetTileTrackStatusProc(TileIndex tile, TransportType mode, uint sub_mode);
+typedef void GetProducedCargoProc(TileIndex tile, CargoID *b);
+typedef void ClickTileProc(TileIndex tile);
+typedef void AnimateTileProc(TileIndex tile);
+typedef void TileLoopProc(TileIndex tile);
+typedef void ChangeTileOwnerProc(TileIndex tile, PlayerID old_player, PlayerID new_player);
+
+/** @see VehicleEnterTileStatus to see what the return values mean */
+typedef VehicleEnterTileStatus VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y);
+typedef Foundation GetFoundationProc(TileIndex tile, Slope tileh);
+
+/**
+ * Called when a tile is affected by a terraforming operation.
+ * The function has to check if terraforming of the tile is allowed and return extra terraform-cost that depend on the tiletype.
+ * With DC_EXEC in flags it has to perform tiletype-specific actions (like clearing land etc., but not the terraforming itself).
+ *
+ * @note The terraforming has not yet taken place. So GetTileZ() and GetTileSlope() refer to the landscape before the terraforming operation.
+ *
+ * @param tile      The involved tile.
+ * @param flags     Command flags passed to the terraform command (DC_EXEC, DC_QUERY_COST, etc.).
+ * @param z_new     TileZ after terraforming.
+ * @param tileh_new Slope after terraforming.
+ * @return Error code or extra cost for terraforming (like clearing land, building foundations, etc., but not the terraforming itself.)
+ */
+typedef CommandCost TerraformTileProc(TileIndex tile, uint32 flags, uint z_new, Slope tileh_new);
+
+struct TileTypeProcs {
+	DrawTileProc *draw_tile_proc;
+	GetSlopeZProc *get_slope_z_proc;
+	ClearTileProc *clear_tile_proc;
+	GetAcceptedCargoProc *get_accepted_cargo_proc;
+	GetTileDescProc *get_tile_desc_proc;
+	GetTileTrackStatusProc *get_tile_track_status_proc;
+	ClickTileProc *click_tile_proc;
+	AnimateTileProc *animate_tile_proc;
+	TileLoopProc *tile_loop_proc;
+	ChangeTileOwnerProc *change_tile_owner_proc;
+	GetProducedCargoProc *get_produced_cargo_proc;
+	VehicleEnterTileProc *vehicle_enter_tile_proc;
+	GetFoundationProc *get_foundation_proc;
+	TerraformTileProc *terraform_tile_proc;
+};
+
+extern const TileTypeProcs * const _tile_type_procs[16];
+
+uint32 GetTileTrackStatus(TileIndex tile, TransportType mode, uint sub_mode);
+void GetAcceptedCargo(TileIndex tile, AcceptedCargo ac);
+void ChangeTileOwner(TileIndex tile, PlayerID old_player, PlayerID new_player);
+void AnimateTile(TileIndex tile);
+void ClickTile(TileIndex tile);
+void GetTileDesc(TileIndex tile, TileDesc *td);
+
+#endif /* TILE_CMD_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/tile_map.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,68 @@
+/* $Id$ */
+
+/** @file tile_map.cpp */
+
+#include "stdafx.h"
+#include "openttd.h"
+#include "tile_map.h"
+#include "core/math_func.hpp"
+
+Slope GetTileSlope(TileIndex tile, uint *h)
+{
+	uint a;
+	uint b;
+	uint c;
+	uint d;
+	uint min;
+	uint r;
+
+	assert(tile < MapSize());
+
+	if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) {
+		if (h != NULL) *h = 0;
+		return SLOPE_FLAT;
+	}
+
+	min = a = TileHeight(tile);
+	b = TileHeight(tile + TileDiffXY(1, 0));
+	if (min > b) min = b;
+	c = TileHeight(tile + TileDiffXY(0, 1));
+	if (min > c) min = c;
+	d = TileHeight(tile + TileDiffXY(1, 1));
+	if (min > d) min = d;
+
+	r = SLOPE_FLAT;
+	if ((a -= min) != 0) r += (--a << 4) + SLOPE_N;
+	if ((c -= min) != 0) r += (--c << 4) + SLOPE_E;
+	if ((d -= min) != 0) r += (--d << 4) + SLOPE_S;
+	if ((b -= min) != 0) r += (--b << 4) + SLOPE_W;
+
+	if (h != NULL) *h = min * TILE_HEIGHT;
+
+	return (Slope)r;
+}
+
+uint GetTileZ(TileIndex tile)
+{
+	if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) return 0;
+
+	uint h = TileHeight(tile);
+	h = min(h, TileHeight(tile + TileDiffXY(1, 0)));
+	h = min(h, TileHeight(tile + TileDiffXY(0, 1)));
+	h = min(h, TileHeight(tile + TileDiffXY(1, 1)));
+
+	return h * TILE_HEIGHT;
+}
+
+
+uint GetTileMaxZ(TileIndex t)
+{
+	if (TileX(t) == MapMaxX() || TileY(t) == MapMaxY()) return 0;
+
+	uint h = TileHeight(t);
+	h = max(h, TileHeight(t + TileDiffXY(1, 0)));
+	h = max(h, TileHeight(t + TileDiffXY(0, 1)));
+	h = max(h, TileHeight(t + TileDiffXY(1, 1)));
+
+	return h * TILE_HEIGHT;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/tile_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,192 @@
+/* $Id$ */
+
+/** @file tile_map.h Map writing/reading functions for tiles. */
+
+#ifndef TILE_MAP_H
+#define TILE_MAP_H
+
+#include "tile_type.h"
+#include "slope_type.h"
+#include "player_type.h"
+#include "map_func.h"
+#include "core/bitmath_func.hpp"
+
+/**
+ * Returns the height of a tile
+ *
+ * This function returns the height of the northern corner of a tile.
+ * This is saved in the global map-array. It does not take affect by
+ * any slope-data of the tile.
+ *
+ * @param tile The tile to get the height from
+ * @return the height of the tile
+ * @pre tile < MapSize()
+ */
+static inline uint TileHeight(TileIndex tile)
+{
+	assert(tile < MapSize());
+	return GB(_m[tile].type_height, 0, 4);
+}
+
+/**
+ * Sets the height of a tile.
+ *
+ * This function sets the height of the northern corner of a tile.
+ *
+ * @param tile The tile to change the height
+ * @param height The new height value of the tile
+ * @pre tile < MapSize()
+ * @pre heigth <= MAX_TILE_HEIGHT
+ */
+static inline void SetTileHeight(TileIndex tile, uint height)
+{
+	assert(tile < MapSize());
+	assert(height <= MAX_TILE_HEIGHT);
+	SB(_m[tile].type_height, 0, 4, height);
+}
+
+/**
+ * Returns the height of a tile in pixels.
+ *
+ * This function returns the height of the northern corner of a tile in pixels.
+ *
+ * @param tile The tile to get the height
+ * @return The height of the tile in pixel
+ */
+static inline uint TilePixelHeight(TileIndex tile)
+{
+	return TileHeight(tile) * TILE_HEIGHT;
+}
+
+/**
+ * Get the tiletype of a given tile.
+ *
+ * @param tile The tile to get the TileType
+ * @return The tiletype of the tile
+ * @pre tile < MapSize()
+ */
+static inline TileType GetTileType(TileIndex tile)
+{
+	assert(tile < MapSize());
+	return (TileType)GB(_m[tile].type_height, 4, 4);
+}
+
+/**
+ * Set the type of a tile
+ *
+ * This functions sets the type of a tile. If the type
+ * MP_VOID is selected the tile must be at the south-west or
+ * south-east edges of the map and vice versa.
+ *
+ * @param tile The tile to save the new type
+ * @param type The type to save
+ * @pre tile < MapSize()
+ * @pre type MP_VOID <=> tile is on the south-east or south-west edge.
+ */
+static inline void SetTileType(TileIndex tile, TileType type)
+{
+	assert(tile < MapSize());
+	/* VOID tiles (and no others) are exactly allowed at the lower left and right
+	 * edges of the map */
+	assert((TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) == (type == MP_VOID));
+	SB(_m[tile].type_height, 4, 4, type);
+}
+
+/**
+ * Checks if a tile is a give tiletype.
+ *
+ * This function checks if a tile got the given tiletype.
+ *
+ * @param tile The tile to check
+ * @param type The type to check agains
+ * @return true If the type matches agains the type of the tile
+ */
+static inline bool IsTileType(TileIndex tile, TileType type)
+{
+	return GetTileType(tile) == type;
+}
+
+/**
+ * Returns the owner of a tile
+ *
+ * This function returns the owner of a tile. This cannot used
+ * for tiles which type is one of MP_HOUSE, MP_VOID and MP_INDUSTRY
+ * as no player owned any of these buildings.
+ *
+ * @param tile The tile to check
+ * @return The owner of the tile
+ * @pre tile < MapSize()
+ * @pre The type of the tile must not be MP_HOUSE, MP_VOID and MP_INDUSTRY
+ */
+static inline Owner GetTileOwner(TileIndex tile)
+{
+	assert(tile < MapSize());
+	assert(!IsTileType(tile, MP_HOUSE));
+	assert(!IsTileType(tile, MP_VOID));
+	assert(!IsTileType(tile, MP_INDUSTRY));
+
+	return (Owner)_m[tile].m1;
+}
+
+/**
+ * Sets the owner of a tile
+ *
+ * This function sets the owner status of a tile. Note that you cannot
+ * set a owner for tiles of type MP_HOUSE, MP_VOID and MP_INDUSTRY.
+ *
+ * @param tile The tile to change the owner status.
+ * @param owner The new owner.
+ * @pre tile < MapSize()
+ * @pre The type of the tile must not be MP_HOUSE, MP_VOID and MP_INDUSTRY
+ */
+static inline void SetTileOwner(TileIndex tile, Owner owner)
+{
+	assert(tile < MapSize());
+	assert(!IsTileType(tile, MP_HOUSE));
+	assert(!IsTileType(tile, MP_VOID));
+	assert(!IsTileType(tile, MP_INDUSTRY));
+
+	_m[tile].m1 = owner;
+}
+
+/**
+ * Checks if a tile belongs to the given owner
+ *
+ * @param tile The tile to check
+ * @param owner The owner to check agains
+ * @return True if a tile belongs the the given owner
+ */
+static inline bool IsTileOwner(TileIndex tile, Owner owner)
+{
+	return GetTileOwner(tile) == owner;
+}
+
+/**
+ * Set the tropic zone
+ * @param tile the tile to set the zone of
+ * @param type the new type
+ * @pre assert(tile < MapSize());
+ */
+static inline void SetTropicZone(TileIndex tile, TropicZone type)
+{
+	assert(tile < MapSize());
+	SB(_m[tile].m6, 0, 2, type);
+}
+
+/**
+ * Get the tropic zone
+ * @param tile the tile to get the zone of
+ * @pre assert(tile < MapSize());
+ * @return the zone type
+ */
+static inline TropicZone GetTropicZone(TileIndex tile)
+{
+	assert(tile < MapSize());
+	return (TropicZone)GB(_m[tile].m6, 0, 2);
+}
+
+Slope GetTileSlope(TileIndex tile, uint *h);
+uint GetTileZ(TileIndex tile);
+uint GetTileMaxZ(TileIndex tile);
+
+#endif /* TILE_TYPE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/tile_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,63 @@
+/* $Id$ */
+
+/** @file tile_type.h Types related to tiles. */
+
+#ifndef TILE_TYPE_H
+#define TILE_TYPE_H
+
+#include "core/enum_type.hpp"
+
+enum {
+	TILE_SIZE   = 16,   ///< Tiles are 16x16 "units" in size
+	TILE_PIXELS = 32,   ///< a tile is 32x32 pixels
+	TILE_HEIGHT =  8,   ///< The standard height-difference between tiles on two levels is 8 (z-diff 8)
+
+	MAX_TILE_HEIGHT     = 15,                    ///< Maximum allowed tile height
+	MAX_SNOWLINE_HEIGHT = (MAX_TILE_HEIGHT - 2), ///< Maximum allowed snowline height
+};
+
+
+/**
+ * The different type of a tile.
+ *
+ * Each tile belongs to one type, according whatever is build on it.
+ *
+ * @note A railway with a crossing street is marked as MP_ROAD.
+ */
+enum TileType {
+	MP_CLEAR,               ///< A tile without any structures, i.e. grass, rocks, farm fields etc.
+	MP_RAILWAY,             ///< A railway
+	MP_ROAD,                ///< A tile with road (or tram tracks)
+	MP_HOUSE,               ///< A house by a town
+	MP_TREES,               ///< Tile got trees
+	MP_STATION,             ///< A tile of a station
+	MP_WATER,               ///< Water tile
+	MP_VOID,                ///< Invisible tiles at the SW and SE border
+	MP_INDUSTRY,            ///< Part of an industry
+	MP_TUNNELBRIDGE,        ///< Tunnel entry/exit and bridge heads
+	MP_UNMOVABLE,           ///< Contains an object with cannot be removed like transmitters
+};
+
+/**
+ * Additional infos of a tile on a tropic game.
+ *
+ * Each non-water tile in a tropic game is either a rainforest tile or a
+ * desert one.
+ */
+enum TropicZone {
+	TROPICZONE_INVALID    = 0,      ///< Invalid tropiczone-type
+	TROPICZONE_DESERT     = 1,      ///< Tile is desert
+	TROPICZONE_RAINFOREST = 2,      ///< Rainforest tile
+};
+
+/**
+ * The index/ID of a Tile.
+ */
+typedef uint32 TileIndex;
+
+/**
+ * The very nice invalid tile marker
+ */
+static const TileIndex INVALID_TILE = (TileIndex)-1;
+
+#endif /* TILE_TYPE_H */
--- a/src/timetable_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/timetable_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,14 +4,15 @@
 
 #include "stdafx.h"
 #include "openttd.h"
+#include "variables.h"
+#include "command_func.h"
 #include "functions.h"
-#include "variables.h"
+#include "window_func.h"
+#include "vehicle_func.h"
+#include "vehicle_base.h"
+#include "settings_type.h"
+
 #include "table/strings.h"
-#include "command.h"
-#include "date.h"
-#include "player.h"
-#include "vehicle.h"
-
 
 static void ChangeTimetable(Vehicle *v, VehicleOrderID order_number, uint16 time, bool is_journey)
 {
@@ -23,7 +24,7 @@
 		order->wait_time = time;
 	}
 
-	if (v->cur_order_index == order_number && HasBit(v->current_order.flags, OFB_PART_OF_ORDERS)) {
+	if (v->cur_order_index == order_number && HasBit(v->current_order.flags, OF_PART_OF_ORDERS)) {
 		if (is_journey) {
 			v->current_order.travel_time = time;
 		} else {
@@ -64,7 +65,7 @@
 	bool is_journey = HasBit(p1, 24);
 	if (!is_journey) {
 		if (order->type != OT_GOTO_STATION) return_cmd_error(STR_TIMETABLE_ONLY_WAIT_AT_STATIONS);
-		if (_patches.new_nonstop && (order->flags & OF_NON_STOP)) return_cmd_error(STR_TIMETABLE_NOT_STOPPING_HERE);
+		if (_patches.new_nonstop && (order->flags & OFB_NON_STOP)) return_cmd_error(STR_TIMETABLE_NOT_STOPPING_HERE);
 	}
 
 	if (flags & DC_EXEC) {
--- a/src/timetable_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/timetable_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,19 +4,22 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
 #include "variables.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "command.h"
-#include "date.h"
+#include "command_func.h"
 #include "engine.h"
 #include "gui.h"
-#include "string.h"
-#include "window.h"
-#include "vehicle.h"
+#include "window_gui.h"
+#include "textbuf_gui.h"
 #include "cargotype.h"
 #include "depot.h"
+#include "strings_func.h"
+#include "vehicle_base.h"
+#include "string_func.h"
+#include "gfx_func.h"
+#include "player_func.h"
+#include "settings_type.h"
+
+#include "table/strings.h"
 
 static int GetOrderFromTimetableWndPt(Window *w, int y, const Vehicle *v)
 {
@@ -48,7 +51,7 @@
 static void DrawTimetableWindow(Window *w)
 {
 	const Vehicle *v = GetVehicle(w->window_number);
-	int selected = WP(w,order_d).sel;
+	int selected = WP(w, order_d).sel;
 
 	SetVScrollCount(w, v->num_orders * 2);
 
@@ -61,7 +64,7 @@
 			w->EnableWidget(7);
 		} else {
 			const Order *order = GetVehicleOrder(v, (selected + 1) / 2);
-			bool disable = order == NULL || order->type != OT_GOTO_STATION || (_patches.new_nonstop && (order->flags & OF_NON_STOP));
+			bool disable = order == NULL || order->type != OT_GOTO_STATION || (_patches.new_nonstop && (order->flags & OFB_NON_STOP));
 
 			w->SetWidgetDisabledState(6, disable);
 			w->SetWidgetDisabledState(7, disable);
@@ -101,7 +104,7 @@
 					break;
 
 				case OT_GOTO_STATION:
-					SetDParam(0, (order->flags & OF_NON_STOP) ? STR_880C_GO_NON_STOP_TO : STR_8806_GO_TO);
+					SetDParam(0, (order->flags & OFB_NON_STOP) ? STR_880C_GO_NON_STOP_TO : STR_8806_GO_TO);
 					SetDParam(1, order->dest);
 
 					if (order->wait_time > 0) {
@@ -121,20 +124,20 @@
 						SetDParam(1, GetDepot(order->dest)->town_index);
 
 						switch (v->type) {
-							case VEH_TRAIN: string = (order->flags & OF_NON_STOP) ? STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT : STR_GO_TO_TRAIN_DEPOT; break;
+							case VEH_TRAIN: string = (order->flags & OFB_NON_STOP) ? STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT : STR_GO_TO_TRAIN_DEPOT; break;
 							case VEH_ROAD:  string = STR_9038_GO_TO_ROADVEH_DEPOT; break;
 							case VEH_SHIP:  string = STR_GO_TO_SHIP_DEPOT; break;
 							default: break;
 						}
 					}
 
-					if (order->flags & OF_FULL_LOAD) string++; // Service at orders
+					if (order->flags & OFB_FULL_LOAD) string++; // Service at orders
 
 					SetDParam(0, string);
 				} break;
 
 				case OT_GOTO_WAYPOINT:
-					SetDParam(0, (order->flags & OF_NON_STOP) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT);
+					SetDParam(0, (order->flags & OFB_NON_STOP) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT);
 					SetDParam(1, order->dest);
 					break;
 
@@ -179,7 +182,7 @@
 		for (const Order *order = GetVehicleOrder(v, 0); order != NULL; order = order->next) {
 			total_time += order->travel_time + order->wait_time;
 			if (order->travel_time == 0) complete = false;
-			if (order->wait_time == 0 && order->type == OT_GOTO_STATION && !(_patches.new_nonstop && (order->flags & OF_NON_STOP))) complete = false;
+			if (order->wait_time == 0 && order->type == OT_GOTO_STATION && !(_patches.new_nonstop && (order->flags & OFB_NON_STOP))) complete = false;
 		}
 
 		if (total_time != 0) {
@@ -221,17 +224,17 @@
 				case 3: { /* Main panel. */
 					int selected = GetOrderFromTimetableWndPt(w, we->we.click.pt.y, v);
 
-					if (selected == INVALID_ORDER || selected == WP(w,order_d).sel) {
+					if (selected == INVALID_ORDER || selected == WP(w, order_d).sel) {
 						/* Deselect clicked order */
-						WP(w,order_d).sel = -1;
+						WP(w, order_d).sel = -1;
 					} else {
 						/* Select clicked order */
-						WP(w,order_d).sel = selected;
+						WP(w, order_d).sel = selected;
 					}
 				} break;
 
 				case 6: { /* "Wait For" button. */
-					int selected = WP(w,order_d).sel;
+					int selected = WP(w, order_d).sel;
 					VehicleOrderID real = (selected + 1) / 2;
 
 					if (real >= v->num_orders) real = 0;
@@ -253,7 +256,7 @@
 				} break;
 
 				case 7: { /* Clear waiting time button. */
-					uint32 p1 = PackTimetableArgs(v, WP(w,order_d).sel);
+					uint32 p1 = PackTimetableArgs(v, WP(w, order_d).sel);
 					DoCommandP(0, p1, 0, NULL, CMD_CHANGE_TIMETABLE | CMD_MSG(STR_CAN_T_TIMETABLE_VEHICLE));
 				} break;
 
@@ -272,7 +275,7 @@
 		case WE_ON_EDIT_TEXT: {
 			const Vehicle *v = GetVehicle(w->window_number);
 
-			uint32 p1 = PackTimetableArgs(v, WP(w,order_d).sel);
+			uint32 p1 = PackTimetableArgs(v, WP(w, order_d).sel);
 
 			uint64 time = StrEmpty(we->we.edittext.str) ? 0 : strtoul(we->we.edittext.str, NULL, 10);
 			if (!_patches.timetable_in_ticks) time *= DAY_TICKS;
@@ -327,6 +330,6 @@
 		w->caption_color = v->owner;
 		w->vscroll.cap = 8;
 		w->resize.step_height = 10;
-		WP(w,order_d).sel = -1;
+		WP(w, order_d).sel = -1;
 	}
 }
--- a/src/town.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/town.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,9 +6,13 @@
 #define TOWN_H
 
 #include "oldpool.h"
-#include "player.h"
-#include "functions.h"
-#include "helpers.hpp"
+#include "core/random_func.hpp"
+#include "cargo_type.h"
+#include "tile_type.h"
+#include "date_type.h"
+#include "town_type.h"
+#include "player_type.h"
+#include "newgrf_string_type.h"
 
 enum {
 	HOUSE_NO_CLASS   = 0,
@@ -40,13 +44,21 @@
 
 DECLARE_ENUM_AS_BIT_SET(BuildingFlags)
 
+enum HouseZonesBits {
+	HZB_TOWN_EDGE = 0,
+	HZB_TOWN_OUTSKIRT,
+	HZB_TOWN_OUTER_SUBURB,
+	HZB_TOWN_INNER_SUBURB,
+	HZB_TOWN_CENTRE,
+};
+
 enum HouseZones {                  ///< Bit  Value       Meaning
 	HZ_NOZNS             = 0x0000,  ///<       0          This is just to get rid of zeros, meaning none
-	HZ_ZON1              = 0x0001,  ///< 0..4 1,2,4,8,10  which town zones the building can be built in, Zone1 been the further suburb
-	HZ_ZON2              = 0x0002,
-	HZ_ZON3              = 0x0004,
-	HZ_ZON4              = 0x0008,
-	HZ_ZON5              = 0x0010,  ///<                  center of town
+	HZ_ZON1              = 1U << HZB_TOWN_EDGE,    ///< 0..4 1,2,4,8,10  which town zones the building can be built in, Zone1 been the further suburb
+	HZ_ZON2              = 1U << HZB_TOWN_OUTSKIRT,
+	HZ_ZON3              = 1U << HZB_TOWN_OUTER_SUBURB,
+	HZ_ZON4              = 1U << HZB_TOWN_INNER_SUBURB,
+	HZ_ZON5              = 1U << HZB_TOWN_CENTRE,  ///<  center of town
 	HZ_ZONALL            = 0x001F,  ///<       1F         This is just to englobe all above types at once
 	HZ_SUBARTC_ABOVE     = 0x0800,  ///< 11    800        can appear in sub-arctic climate above the snow line
 	HZ_TEMP              = 0x1000,  ///< 12   1000        can appear in temperate climate
@@ -67,15 +79,11 @@
 
 DECLARE_ENUM_AS_BIT_SET(HouseExtraFlags)
 
-typedef uint16 HouseID;
-typedef uint16 HouseClassID;
-
 struct BuildingCounts {
 	uint8 id_count[HOUSE_MAX];
 	uint8 class_count[HOUSE_CLASS_MAX];
 };
 
-struct Town;
 DECLARE_OLD_POOL(Town, Town, 3, 8000)
 
 struct Town : PoolItem<Town, TownID, &_Town_pool> {
@@ -89,6 +97,7 @@
 	uint32 townnamegrfid;
 	uint16 townnametype;
 	uint32 townnameparts;
+	char *name;
 
 	/* NOSAVE: Location of name sign, UpdateTownVirtCoord updates this. */
 	ViewportSign sign;
@@ -108,6 +117,7 @@
 	PlayerByte exclusivity;      ///< which player has exslusivity
 	uint8 exclusive_counter;     ///< months till the exclusivity expires
 	int16 ratings[MAX_PLAYERS];
+	int16 test_rating;
 
 	/* Maximum amount of passengers and mail that can be transported. */
 	uint32 max_pass;
@@ -168,7 +178,7 @@
 	Year max_date;                     ///< last year it can be built
 	byte population;                   ///< population (Zero on other tiles in multi tile house.)
 	byte removal_cost;                 ///< cost multiplier for removing it
-	StringID building_name;            ///< building name
+	GRFMappedStringID building_name;   ///< building name
 	uint16 remove_rating_decrease;     ///< rating decrease if removed
 	byte mail_generation;              ///< mail generation multiplier (tile based, as the acceptances below)
 	byte cargo_acceptance[3];          ///< acceptance level for the cargo slots
@@ -196,13 +206,7 @@
 	const struct GRFFile *grffile;     ///< grf file that introduced this house
 };
 
-enum TownSizeMode {
-	TSM_RANDOM,
-	TSM_FIXED,
-	TSM_CITY
-};
-
-VARDEF HouseSpec _house_specs[HOUSE_MAX];
+extern HouseSpec _house_specs[HOUSE_MAX];
 
 uint32 GetWorldPopulation();
 
@@ -220,42 +224,6 @@
 	INDUSTRY_REMOVE = 2
 };
 
-enum {
-	/* These refer to the maximums, so Appalling is -1000 to -400
-	 * MAXIMUM RATINGS BOUNDARIES */
-	RATING_MINIMUM     = -1000,
-	RATING_APPALLING   =  -400,
-	RATING_VERYPOOR    =  -200,
-	RATING_POOR        =     0,
-	RATING_MEDIOCRE    =   200,
-	RATING_GOOD        =   400,
-	RATING_VERYGOOD    =   600,
-	RATING_EXCELLENT   =   800,
-	RATING_OUTSTANDING =  1000,         ///< OUTSTANDING
-
-	RATING_MAXIMUM = RATING_OUTSTANDING,
-
-	/* RATINGS AFFECTING NUMBERS */
-	RATING_TREE_DOWN_STEP = -35,
-	RATING_TREE_MINIMUM   = RATING_MINIMUM,
-	RATING_TREE_UP_STEP   = 7,
-	RATING_TREE_MAXIMUM   = 220,
-
-	RATING_TUNNEL_BRIDGE_DOWN_STEP = -250,
-	RATING_TUNNEL_BRIDGE_MINIMUM   = 0,
-
-	RATING_INDUSTRY_DOWN_STEP = -1500,
-	RATING_INDUSTRY_MINIMUM   = RATING_MINIMUM,
-
-	RATING_ROAD_DOWN_STEP = -50,
-	RATING_ROAD_MINIMUM   = -100,
-	RATING_HOUSE_MINIMUM  = RATING_MINIMUM,
-
-	RATING_BRIBE_UP_STEP = 200,
-	RATING_BRIBE_MAXIMUM = 800,
-	RATING_BRIBE_DOWN_TO = -50        // XXX SHOULD BE SOMETHING LOWER?
-};
-
 /** This is the number of ticks between towns being processed for building new
  * houses or roads. This value originally came from the size of the town array
  * in TTD. */
@@ -279,8 +247,6 @@
 
 bool CheckforTownRating(uint32 flags, Town *t, byte type);
 
-VARDEF const Town** _town_sort;
-
 static inline HouseSpec *GetHouseSpecs(HouseID house_id)
 {
 	assert(house_id < HOUSE_MAX);
@@ -297,8 +263,6 @@
 	return index < GetTownPoolSize() && GetTown(index)->IsValid();
 }
 
-VARDEF uint _total_towns;
-
 static inline TownID GetMaxTownIndex()
 {
 	/* TODO - This isn't the real content of the function, but
@@ -311,6 +275,8 @@
 
 static inline uint GetNumTowns()
 {
+	extern uint _total_towns;
+
 	return _total_towns;
 }
 
@@ -336,20 +302,28 @@
 	return GetTown(index);
 }
 
-Town* CalcClosestTownFromTile(TileIndex tile, uint threshold);
+Town *CalcClosestTownFromTile(TileIndex tile, uint threshold);
 
 #define FOR_ALL_TOWNS_FROM(t, start) for (t = GetTown(start); t != NULL; t = (t->index + 1U < GetTownPoolSize()) ? GetTown(t->index + 1U) : NULL) if (t->IsValid())
 #define FOR_ALL_TOWNS(t) FOR_ALL_TOWNS_FROM(t, 0)
 
-VARDEF bool _town_sort_dirty;
-VARDEF byte _town_sort_order;
+extern bool _town_sort_dirty;
+extern byte _town_sort_order;
+extern const Town **_town_sort;
 
-VARDEF Town *_cleared_town;
-VARDEF int _cleared_town_rating;
+extern Town *_cleared_town;
+extern int _cleared_town_rating;
 
 uint OriginalTileRandomiser(uint x, uint y);
 void ResetHouses();
 
 void ClearTownHouse(Town *t, TileIndex tile);
+void AfterLoadTown();
+void UpdateTownMaxPass(Town *t);
+bool CheckIfAuthorityAllows(TileIndex tile);
+Town *ClosestTownFromTile(TileIndex tile, uint threshold);
+void ChangeTownRating(Town *t, int add, int max);
+HouseZonesBits GetTownRadiusGroup(const Town* t, TileIndex tile);
+void SetTownRatingTestMode(bool mode);
 
 #endif /* TOWN_H */
--- a/src/town_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/town_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,36 +4,27 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
+#include "tile_cmd.h"
 #include "debug.h"
-#include "strings.h"
 #include "road_map.h"
-#include "table/strings.h"
-#include "table/sprites.h"
-#include "map.h"
+#include "road_internal.h" /* Cleaning up road bits */
 #include "landscape.h"
-#include "tile.h"
 #include "town_map.h"
 #include "tunnel_map.h"
-#include "viewport.h"
+#include "viewport_func.h"
 #include "town.h"
-#include "command.h"
-#include "gfx.h"
+#include "command_func.h"
 #include "industry.h"
 #include "station.h"
-#include "vehicle.h"
-#include "player.h"
+#include "player_base.h"
 #include "news.h"
 #include "saveload.h"
-#include "economy.h"
 #include "gui.h"
 #include "unmovable_map.h"
 #include "water_map.h"
 #include "variables.h"
 #include "bridge.h"
 #include "bridge_map.h"
-#include "date.h"
-#include "table/town_land.h"
 #include "genworld.h"
 #include "newgrf.h"
 #include "newgrf_callbacks.h"
@@ -44,6 +35,24 @@
 #include "autoslope.h"
 #include "waypoint.h"
 #include "transparency.h"
+#include "tunnelbridge_map.h"
+#include "strings_func.h"
+#include "window_func.h"
+#include "string_func.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
+#include "table/town_land.h"
+
+uint _total_towns;
+HouseSpec _house_specs[HOUSE_MAX];
+
+bool _town_sort_dirty;
+byte _town_sort_order;
+const Town **_town_sort;
+
+Town *_cleared_town;
+int _cleared_town_rating;
 
 /* Initialize the town-pool */
 DEFINE_OLD_POOL_GENERIC(Town, Town)
@@ -56,7 +65,7 @@
 
 Town::~Town()
 {
-	DeleteName(this->townnametype);
+	free(this->name);
 
 	if (CleaningPool()) return;
 
@@ -426,8 +435,7 @@
 		for (uint i = 0; i < 256; i++) {
 			uint16 callback = GetHouseCallback(CBID_HOUSE_PRODUCE_CARGO, i, r, house_id, t, tile);
 
-			if (callback == CALLBACK_FAILED) break;
-			if (callback == 0x20FF) break;
+			if (callback == CALLBACK_FAILED || callback == CALLBACK_HOUSEPRODCARGO_END) break;
 
 			CargoID cargo = GetCargoTranslation(GB(callback, 8, 7), hs->grffile);
 			if (cargo == CT_INVALID) continue;
@@ -503,7 +511,7 @@
 static CommandCost ClearTile_Town(TileIndex tile, byte flags)
 {
 	int rating;
-	CommandCost cost;
+	CommandCost cost(EXPENSES_CONSTRUCTION);
 	Town *t;
 	HouseSpec *hs = GetHouseSpecs(GetHouseType(tile));
 
@@ -523,8 +531,8 @@
 		}
 	}
 
+	ChangeTownRating(t, -rating, RATING_HOUSE_MINIMUM);
 	if (flags & DC_EXEC) {
-		ChangeTownRating(t, -rating, RATING_HOUSE_MINIMUM);
 		ClearTownHouse(t, tile);
 	}
 
@@ -1062,10 +1070,8 @@
 
 		/* Reached a tunnel/bridge? Then continue at the other side of it. */
 		if (IsTileType(tile, MP_TUNNELBRIDGE)) {
-			if (IsTunnel(tile) && GetTunnelTransportType(tile) == TRANSPORT_ROAD) {
-				*tile_ptr = GetOtherTunnelEnd(tile);
-			} else if (IsBridge(tile) && GetBridgeTransportType(tile) == TRANSPORT_ROAD) {
-				*tile_ptr = GetOtherBridgeEnd(tile);
+			if (GetTunnelBridgeTransportType(tile) == TRANSPORT_ROAD) {
+				*tile_ptr = GetOtherTunnelBridgeEnd(tile);
 			}
 			return;
 		}
@@ -1499,8 +1505,6 @@
 	if (_game_mode != GM_EDITOR) return CMD_ERROR;
 	if (p2 > TSM_CITY) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_OTHER);
-
 	/* Check if too close to the edge of map */
 	if (DistanceFromEdge(tile) < 12)
 		return_cmd_error(STR_0237_TOO_CLOSE_TO_EDGE_OF_MAP);
@@ -1599,9 +1603,9 @@
 	int b;
 	Slope slope;
 
-	static const byte _masks[8] = {
-		0xC,0x3,0x9,0x6,
-		0x3,0xC,0x6,0x9,
+	static const Slope _masks[8] = {
+		SLOPE_NE,  SLOPE_SW,  SLOPE_NW,  SLOPE_SE,
+		SLOPE_SW,  SLOPE_NE,  SLOPE_SE,  SLOPE_NW,
 	};
 
 	slope = GetTileSlope(tile, NULL);
@@ -1611,25 +1615,29 @@
 
 	b = 0;
 	if ((slope != SLOPE_FLAT && ~slope & _masks[mode])) b = ~b;
-	if ((tileh != SLOPE_FLAT && ~tileh & _masks[mode+4])) b = ~b;
+	if ((tileh != SLOPE_FLAT && ~tileh & _masks[mode + 4])) b = ~b;
 	if (b)
 		return false;
 
 	return CmdSucceeded(DoCommand(tile, 0, 0, DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR));
 }
 
-
-uint GetTownRadiusGroup(const Town* t, TileIndex tile)
+/** Returns the bit corresponding to the town zone of the specified tile
+ * @param t Town on which radius is to be found
+ * @param tile TileIndex where radius needs to be found
+ * @return the bit position of the given zone, as defined in HouseZones
+ */
+HouseZonesBits GetTownRadiusGroup(const Town* t, TileIndex tile)
 {
 	uint dist = DistanceSquare(tile, t->xy);
-	uint smallest;
+	HouseZonesBits smallest;
 	uint i;
 
-	if (t->fund_buildings_months && dist <= 25) return 4;
-
-	smallest = 0;
+	if (t->fund_buildings_months && dist <= 25) return HZB_TOWN_CENTRE;
+
+	smallest = HZB_TOWN_EDGE;
 	for (i = 0; i != lengthof(t->radius); i++) {
-		if (dist < t->radius[i]) smallest = i;
+		if (dist < t->radius[i]) smallest = (HouseZonesBits)i;
 	}
 
 	return smallest;
@@ -1673,9 +1681,10 @@
 	/* Above snow? */
 	slope = GetTileSlope(tile, &z);
 
-	/* Get the town zone type */
+	/* Get the town zone type of the current tile, as well as the climate.
+	 * This will allow to easily compare with the specs of the new house to build */
 	{
-		uint rad = GetTownRadiusGroup(t, tile);
+		HouseZonesBits rad = GetTownRadiusGroup(t, tile);
 
 		int land = _opt.landscape;
 		if (land == LT_ARCTIC && z >= _opt.snow_line) land = -1;
@@ -1695,6 +1704,7 @@
 		/* Generate a list of all possible houses that can be built. */
 		for (i = 0; i < HOUSE_MAX; i++) {
 			hs = GetHouseSpecs(i);
+			/* Verify that the candidate house spec matches the current tile status */
 			if ((~hs->building_availability & bitmask) == 0 && hs->enabled) {
 				if (_loaded_newgrf_features.has_newhouses) {
 					probability_max += hs->probability;
@@ -1795,7 +1805,7 @@
 				construction_counter = GB(r, 2, 2);
 			}
 		}
-		MakeTownHouse(tile, t->index, construction_counter, construction_stage, house, VehicleRandomBits());
+		MakeTownHouse(tile, t->index, construction_counter, construction_stage, house, Random());
 	}
 }
 
@@ -1893,7 +1903,6 @@
  */
 CommandCost CmdRenameTown(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	StringID str;
 	Town *t;
 
 	if (!IsValidTownID(p1) || StrEmpty(_cmd_text)) return CMD_ERROR;
@@ -1902,21 +1911,15 @@
 
 	if (!IsUniqueTownName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
 
-	str = AllocateName(_cmd_text, 4);
-	if (str == 0) return CMD_ERROR;
-
 	if (flags & DC_EXEC) {
-		DeleteName(t->townnametype);
-		t->townnametype = str;
-		t->townnamegrfid = 0;
+		free(t->name);
+		t->name = strdup(_cmd_text);
 
 		UpdateTownVirtCoord(t);
 		_town_sort_dirty = true;
 		UpdateAllStationVirtCoord();
 		UpdateAllWaypointSigns();
 		MarkWholeScreenDirty();
-	} else {
-		DeleteName(str);
 	}
 	return CommandCost();
 }
@@ -2100,7 +2103,6 @@
  */
 CommandCost CmdDoTownAction(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	CommandCost cost;
 	Town *t;
 
 	if (!IsValidTownID(p1) || p2 > lengthof(_town_action_proc)) return CMD_ERROR;
@@ -2109,9 +2111,7 @@
 
 	if (!HasBit(GetMaskOfTownActions(NULL, _current_player, t), p2)) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_OTHER);
-
-	cost.AddCost((_price.build_industry >> 8) * _town_action_costs[p2]);
+	CommandCost cost(EXPENSES_OTHER, (_price.build_industry >> 8) * _town_action_costs[p2]);
 
 	if (flags & DC_EXEC) {
 		_town_action_proc[p2](t);
@@ -2264,6 +2264,23 @@
 	}
 }
 
+static bool _town_rating_test = false;
+
+void SetTownRatingTestMode(bool mode)
+{
+	static int ref_count = 0;
+	if (mode) {
+		if (ref_count == 0) {
+			Town *t;
+			FOR_ALL_TOWNS(t) t->test_rating = t->ratings[_current_player];
+		}
+		ref_count++;
+	} else {
+		assert(ref_count > 0);
+		ref_count--;
+	}
+	_town_rating_test = !(ref_count == 0);
+}
 
 void ChangeTownRating(Town *t, int add, int max)
 {
@@ -2278,7 +2295,7 @@
 
 	SetBit(t->have_ratings, _current_player);
 
-	rating = t->ratings[_current_player];
+	rating = _town_rating_test ? t->test_rating : t->ratings[_current_player];
 
 	if (add < 0) {
 		if (rating > max) {
@@ -2291,7 +2308,11 @@
 			if (rating > max) rating = max;
 		}
 	}
-	t->ratings[_current_player] = rating;
+	if (_town_rating_test) {
+		t->test_rating = rating;
+	} else {
+		t->ratings[_current_player] = rating;
+	}
 }
 
 /* penalty for removing town-owned stuff */
@@ -2316,7 +2337,7 @@
 	 */
 	modemod = _default_rating_settings[_opt.diff.town_council_tolerance][type];
 
-	if (t->ratings[_current_player] < 16 + modemod && !(flags & DC_NO_TOWN_RATING)) {
+	if ((_town_rating_test ? t->test_rating : t->ratings[_current_player]) < 16 + modemod && !(flags & DC_NO_TOWN_RATING)) {
 		SetDParam(0, t->index);
 		_error_message = STR_2009_LOCAL_AUTHORITY_REFUSES;
 		return false;
@@ -2367,7 +2388,7 @@
 
 		/* Here we differ from TTDP by checking TILE_NOT_SLOPED */
 		if (((hs->building_flags & TILE_NOT_SLOPED) == 0) && !IsSteepSlope(tileh_new) &&
-			(GetTileMaxZ(tile) == z_new + GetSlopeMaxZ(tileh_new))) return _price.terraform;
+			(GetTileMaxZ(tile) == z_new + GetSlopeMaxZ(tileh_new))) return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 	}
 
 	return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
@@ -2396,14 +2417,14 @@
 	SLE_CONDVAR(Town, xy,                    SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
 	SLE_CONDVAR(Town, xy,                    SLE_UINT32,                 6, SL_MAX_VERSION),
 
-	SLE_CONDVAR(Town, population,            SLE_FILE_U16 | SLE_VAR_U32, 0, 2),
-	SLE_CONDVAR(Town, population,            SLE_UINT32,                 3, SL_MAX_VERSION),
-
+	SLE_CONDNULL(2, 0, 2),
+	SLE_CONDNULL(4, 3, 84),
 
 	    SLE_VAR(Town, num_houses,            SLE_UINT16),
 	SLE_CONDVAR(Town, townnamegrfid,         SLE_UINT32, 66, SL_MAX_VERSION),
 	    SLE_VAR(Town, townnametype,          SLE_UINT16),
 	    SLE_VAR(Town, townnameparts,         SLE_UINT32),
+	SLE_CONDSTR(Town, name,                  SLE_STR, 0, 84, SL_MAX_VERSION),
 
 	    SLE_VAR(Town, flags12,               SLE_UINT8),
 	    SLE_VAR(Town, statues,               SLE_UINT8),
@@ -2446,15 +2467,15 @@
 	SLE_CONDVAR(Town, grow_counter,          SLE_UINT8,                  0, 53),
 	SLE_CONDVAR(Town, growth_rate,           SLE_UINT8,                  0, 53),
 
-	SLE_CONDVAR(Town, time_until_rebuild,    SLE_UINT16,                 54, SL_MAX_VERSION),
-	SLE_CONDVAR(Town, grow_counter,          SLE_UINT16,                 54, SL_MAX_VERSION),
-	SLE_CONDVAR(Town, growth_rate,           SLE_INT16,                  54, SL_MAX_VERSION),
+	SLE_CONDVAR(Town, time_until_rebuild,    SLE_UINT16,                54, SL_MAX_VERSION),
+	SLE_CONDVAR(Town, grow_counter,          SLE_UINT16,                54, SL_MAX_VERSION),
+	SLE_CONDVAR(Town, growth_rate,           SLE_INT16,                 54, SL_MAX_VERSION),
 
 	    SLE_VAR(Town, fund_buildings_months, SLE_UINT8),
 	    SLE_VAR(Town, road_build_months,     SLE_UINT8),
 
-	    SLE_VAR(Town, exclusivity,           SLE_UINT8),
-	    SLE_VAR(Town, exclusive_counter,     SLE_UINT8),
+	SLE_CONDVAR(Town, exclusivity,           SLE_UINT8,                  2, SL_MAX_VERSION),
+	SLE_CONDVAR(Town, exclusive_counter,     SLE_UINT8,                  2, SL_MAX_VERSION),
 
 	SLE_CONDVAR(Town, larger_town,           SLE_BOOL,                  56, SL_MAX_VERSION),
 
--- a/src/town_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/town_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,20 +5,25 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "strings.h"
+#include "town.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
+#include "gui.h"
+#include "window_gui.h"
+#include "textbuf_gui.h"
+#include "command_func.h"
+#include "player_func.h"
+#include "player_base.h"
+#include "player_gui.h"
+#include "network/network.h"
+#include "variables.h"
+#include "strings_func.h"
+#include "economy_func.h"
+#include "core/alloc_func.hpp"
+#include "settings_type.h"
+
 #include "table/sprites.h"
 #include "table/strings.h"
-#include "town.h"
-#include "window.h"
-#include "gfx.h"
-#include "viewport.h"
-#include "gui.h"
-#include "command.h"
-#include "player.h"
-#include "network/network.h"
-#include "variables.h"
-#include "helpers.hpp"
 
 enum TownAuthorityWidget {
 	TWA_CLOSEBOX = 0,
@@ -140,8 +145,8 @@
 
 		SetVScrollCount(w, numact + 1);
 
-		if (WP(w,def_d).data_1 != -1 && !HasBit(buttons, WP(w,def_d).data_1))
-			WP(w,def_d).data_1 = -1;
+		if (WP(w, def_d).data_1 != -1 && !HasBit(buttons, WP(w,def_d).data_1))
+			WP(w, def_d).data_1 = -1;
 
 		w->SetWidgetDisabledState(6, WP(w, def_d).data_1 == -1);
 
@@ -206,7 +211,7 @@
 		}
 
 		{
-			int i = WP(w,def_d).data_1;
+			int i = WP(w, def_d).data_1;
 
 			if (i != -1) {
 				SetDParam(1, (_price.build_industry >> 8) * _town_action_costs[i]);
@@ -228,7 +233,7 @@
 
 			y = GetNthSetBit(GetMaskOfTownActions(NULL, _local_player, t), y + w->vscroll.pos - 1);
 			if (y >= 0) {
-				WP(w,def_d).data_1 = y;
+				WP(w, def_d).data_1 = y;
 				SetWindowDirty(w);
 			}
 			/* Fall through to clicking in case we are double-clicked */
@@ -236,7 +241,7 @@
 		}
 
 		case TWA_EXECUTE: {
-			DoCommandP(GetTown(w->window_number)->xy, w->window_number, WP(w,def_d).data_1, NULL, CMD_DO_TOWN_ACTION | CMD_MSG(STR_00B4_CAN_T_DO_THIS));
+			DoCommandP(GetTown(w->window_number)->xy, w->window_number, WP(w, def_d).data_1, NULL, CMD_DO_TOWN_ACTION | CMD_MSG(STR_00B4_CAN_T_DO_THIS));
 			break;
 		}
 		}
@@ -262,7 +267,7 @@
 
 	if (w != NULL) {
 		w->vscroll.cap = 5;
-		WP(w,def_d).data_1 = -1;
+		WP(w, def_d).data_1 = -1;
 	}
 }
 
@@ -449,7 +454,6 @@
 
 	/* Create array for sorting */
 	_town_sort = ReallocT(_town_sort, GetMaxTownIndex() + 1);
-	if (_town_sort == NULL) error("Could not allocate memory for the town-sorting-list");
 
 	FOR_ALL_TOWNS(t) _town_sort[n++] = t;
 
@@ -474,7 +478,7 @@
 		SetVScrollCount(w, _num_town_sort);
 
 		DrawWindowWidgets(w);
-		DoDrawString(_town_sort_order & 1 ? DOWNARROW : UPARROW, (_town_sort_order <= 1) ? 88 : 187, 15, TC_BLACK);
+		DrawSortButtonState(w, (_town_sort_order <= 1) ? 3 : 4, _town_sort_order & 1 ? SBS_DOWN : SBS_UP);
 
 		{
 			int n = 0;
--- a/src/town_map.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/town_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,7 +6,9 @@
 #define TOWN_MAP_H
 
 #include "town.h"
-#include "date.h"
+#include "date_func.h"
+#include "tile_map.h"
+#include "functions.h"
 
 /**
  * Get the index of which town this house/street is attached to.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/town_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,77 @@
+/* $Id$ */
+
+/** @file town_type.h Types related to towns. */
+
+#ifndef TOWN_TYPE_H
+#define TOWN_TYPE_H
+
+#include "core/enum_type.hpp"
+
+typedef uint16 TownID;
+typedef uint16 HouseID;
+typedef uint16 HouseClassID;
+
+struct Town;
+struct HouseSpec;
+
+enum TownSizeMode {
+	TSM_RANDOM,
+	TSM_FIXED,
+	TSM_CITY
+};
+
+enum {
+	/* These refer to the maximums, so Appalling is -1000 to -400
+	 * MAXIMUM RATINGS BOUNDARIES */
+	RATING_MINIMUM     = -1000,
+	RATING_APPALLING   =  -400,
+	RATING_VERYPOOR    =  -200,
+	RATING_POOR        =     0,
+	RATING_MEDIOCRE    =   200,
+	RATING_GOOD        =   400,
+	RATING_VERYGOOD    =   600,
+	RATING_EXCELLENT   =   800,
+	RATING_OUTSTANDING =  1000,         ///< OUTSTANDING
+
+	RATING_MAXIMUM = RATING_OUTSTANDING,
+
+	/* RATINGS AFFECTING NUMBERS */
+	RATING_TREE_DOWN_STEP = -35,
+	RATING_TREE_MINIMUM   = RATING_MINIMUM,
+	RATING_TREE_UP_STEP   = 7,
+	RATING_TREE_MAXIMUM   = 220,
+
+	RATING_TUNNEL_BRIDGE_DOWN_STEP = -250,
+	RATING_TUNNEL_BRIDGE_MINIMUM   = 0,
+
+	RATING_INDUSTRY_DOWN_STEP = -1500,
+	RATING_INDUSTRY_MINIMUM   = RATING_MINIMUM,
+
+	RATING_ROAD_DOWN_STEP = -50,
+	RATING_ROAD_MINIMUM   = -100,
+	RATING_HOUSE_MINIMUM  = RATING_MINIMUM,
+
+	RATING_BRIBE_UP_STEP = 200,
+	RATING_BRIBE_MAXIMUM = 800,
+	RATING_BRIBE_DOWN_TO = -50        // XXX SHOULD BE SOMETHING LOWER?
+};
+
+/**
+ * Town Layouts
+ */
+enum TownLayout {
+	TL_NO_ROADS     = 0, ///< Build no more roads, but still build houses
+	TL_ORIGINAL,         ///< Original algorithm (min. 1 distance between roads)
+	TL_BETTER_ROADS,     ///< Extended original algorithm (min. 2 distance between roads)
+	TL_2X2_GRID,         ///< Geometric 2x2 grid algorithm
+	TL_3X3_GRID,         ///< Geometric 3x3 grid algorithm
+
+	NUM_TLS,             ///< Number of town layouts
+};
+
+/* It needs to be 8bits, because we save and load it as such */
+/** Define basic enum properties */
+template <> struct EnumPropsT<TownLayout> : MakeEnumPropsT<TownLayout, byte, TL_NO_ROADS, NUM_TLS, NUM_TLS> {};
+typedef TinyEnumT<TownLayout> TownLayoutByte; //typedefing-enumification of TownLayout
+
+#endif /* TOWN_TYPE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/track_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,519 @@
+/* $Id$ */
+
+/** @file track_func.h Different conversion functions from one kind of track to another. */
+
+#ifndef TRACK_FUNC_H
+#define TRACK_FUNC_H
+
+#include "core/bitmath_func.hpp"
+#include "track_type.h"
+#include "direction_type.h"
+#include "slope_func.h"
+
+/**
+ * Convert an Axis to the corresponding Track
+ * AXIS_X -> TRACK_X
+ * AXIS_Y -> TRACK_Y
+ * Uses the fact that they share the same internal encoding
+ *
+ * @param a the axis to convert
+ * @return the track corresponding to the axis
+ */
+static inline Track AxisToTrack(Axis a)
+{
+	return (Track)a;
+}
+
+
+
+/**
+ * Maps a Track to the corresponding TrackBits value
+ * @param track the track to convert
+ * @return the converted TrackBits value of the track
+ */
+static inline TrackBits TrackToTrackBits(Track track)
+{
+	return (TrackBits)(1 << track);
+}
+
+/**
+ * Maps an Axis to the corresponding TrackBits value
+ * @param a the axis to convert
+ * @return the converted TrackBits value of the axis
+ */
+static inline TrackBits AxisToTrackBits(Axis a)
+{
+	return TrackToTrackBits(AxisToTrack(a));
+}
+
+/**
+ * Returns a single horizontal/vertical trackbit, that is in a specific tile corner.
+ *
+ * @param corner The corner of a tile.
+ * @return The TrackBits of the track in the corner.
+ */
+static inline TrackBits CornerToTrackBits(Corner corner)
+{
+	extern const TrackBits _corner_to_trackbits[];
+	assert(IsValidCorner(corner));
+	return _corner_to_trackbits[corner];
+}
+
+
+
+/**
+ * Maps a Trackdir to the corresponding TrackdirBits value
+ * @param trackdir the track direction to convert
+ * @return the converted TrackdirBits value
+ */
+static inline TrackdirBits TrackdirToTrackdirBits(Trackdir trackdir)
+{
+	return (TrackdirBits)(1 << trackdir);
+}
+
+/**
+ * Removes first Track from TrackBits and returns it
+ *
+ * This function searchs for the first bit in the TrackBits,
+ * remove this bit from the parameter and returns the found
+ * bit as Track value. It returns INVALID_TRACK if the
+ * parameter was TRACK_BIT_NONE or INVALID_TRACK_BIT. This
+ * is basically used in while-loops to get up to 6 possible
+ * tracks on a tile until the parameter becomes TRACK_BIT_NONE.
+ *
+ * @param tracks The value with the TrackBits
+ * @return The first Track from the TrackBits value
+ * @see FindFirstTrack
+ */
+static inline Track RemoveFirstTrack(TrackBits *tracks)
+{
+	if (*tracks != TRACK_BIT_NONE && *tracks != INVALID_TRACK_BIT) {
+		Track first = (Track)FIND_FIRST_BIT(*tracks);
+		ClrBit(*tracks, first);
+		return first;
+	}
+	return INVALID_TRACK;
+}
+
+/**
+ * Removes first Trackdir from TrackdirBits and returns it
+ *
+ * This function searchs for the first bit in the TrackdirBits parameter,
+ * remove this bit from the parameter and returns the fnound bit as
+ * Trackdir value. It returns INVALID_TRACKDIR if the trackdirs is
+ * TRACKDIR_BIT_NONE or INVALID_TRACKDIR_BIT. This is basically used in a
+ * while-loop to get all track-directions step by step until the value
+ * reaches TRACKDIR_BIT_NONE.
+ *
+ * @param trackdirs The value with the TrackdirBits
+ * @return The first Trackdir from the TrackdirBits value
+ * @see FindFirstTrackdir
+ */
+static inline Trackdir RemoveFirstTrackdir(TrackdirBits *trackdirs)
+{
+	if (*trackdirs != TRACKDIR_BIT_NONE && *trackdirs != INVALID_TRACKDIR_BIT) {
+		Trackdir first = (Trackdir)FindFirstBit2x64(*trackdirs);
+		ClrBit(*trackdirs, first);
+		return first;
+	}
+	return INVALID_TRACKDIR;
+}
+
+/**
+ * Returns first Track from TrackBits or INVALID_TRACK
+ *
+ * This function returns the first Track found in the TrackBits value as Track-value.
+ * It returns INVALID_TRACK if the parameter is TRACK_BIT_NONE or INVALID_TRACK_BIT.
+ *
+ * @param tracks The TrackBits value
+ * @return The first Track found or INVALID_TRACK
+ * @see RemoveFirstTrack
+ */
+static inline Track FindFirstTrack(TrackBits tracks)
+{
+	return (tracks != TRACK_BIT_NONE && tracks != INVALID_TRACK_BIT) ? (Track)FIND_FIRST_BIT(tracks) : INVALID_TRACK;
+}
+
+/**
+ * Converts TrackBits to Track.
+ *
+ * This function converts a TrackBits value to a Track value. As it
+ * is not possible to convert two or more tracks to one track the
+ * parameter must contain only one track or be the INVALID_TRACK_BIT value.
+ *
+ * @param tracks The TrackBits value to convert
+ * @return The Track from the value or INVALID_TRACK
+ * @pre tracks must contains only one Track or be INVALID_TRACK_BIT
+ */
+static inline Track TrackBitsToTrack(TrackBits tracks)
+{
+	assert(tracks == INVALID_TRACK_BIT || (tracks != TRACK_BIT_NONE && KillFirstBit(tracks & TRACK_BIT_MASK) == TRACK_BIT_NONE));
+	return tracks != INVALID_TRACK_BIT ? (Track)FIND_FIRST_BIT(tracks & TRACK_BIT_MASK) : INVALID_TRACK;
+}
+
+/**
+ * Returns first Trackdir from TrackdirBits or INVALID_TRACKDIR
+ *
+ * This function returns the first Trackdir in the given TrackdirBits value or
+ * INVALID_TRACKDIR if the value is TRACKDIR_BIT_NONE. The TrackdirBits must
+ * not be INVALID_TRACKDIR_BIT.
+ *
+ * @param trackdirs The TrackdirBits value
+ * @return The first Trackdir from the TrackdirBits or INVALID_TRACKDIR on TRACKDIR_BIT_NONE.
+ * @pre trackdirs must not be INVALID_TRACKDIR_BIT
+ * @see RemoveFirstTrackdir
+ */
+static inline Trackdir FindFirstTrackdir(TrackdirBits trackdirs)
+{
+	assert((trackdirs & ~TRACKDIR_BIT_MASK) == TRACKDIR_BIT_NONE);
+	return (trackdirs != TRACKDIR_BIT_NONE) ? (Trackdir)FindFirstBit2x64(trackdirs) : INVALID_TRACKDIR;
+}
+
+/**
+ * Checks if a Track is valid.
+ *
+ * @param track The value to check
+ * @return true if the given value is a valid track.
+ * @note Use this in an assert()
+ */
+static inline bool IsValidTrack(Track track)
+{
+	return track < TRACK_END;
+}
+
+/**
+ * Checks if a Trackdir is valid.
+ *
+ * @param trackdir The value to check
+ * @return true if the given valie is a valid Trackdir
+ * @note Use this in an assert()
+ */
+static inline bool IsValidTrackdir(Trackdir trackdir)
+{
+	return (TrackdirToTrackdirBits(trackdir) & TRACKDIR_BIT_MASK) != 0;
+}
+
+
+/*
+ * Functions describing logical relations between Tracks, TrackBits, Trackdirs
+ * TrackdirBits, Direction and DiagDirections.
+ */
+
+/**
+ * Maps a trackdir to the reverse trackdir.
+ *
+ * Returns the reverse trackdir of a Trackdir value. The reverse trackdir
+ * is the same track with the other direction on it.
+ *
+ * @param trackdir The Trackdir value
+ * @return The reverse trackdir
+ * @pre trackdir must not be INVALID_TRACKDIR
+ */
+static inline Trackdir ReverseTrackdir(Trackdir trackdir)
+{
+	assert(trackdir != INVALID_TRACKDIR);
+	return (Trackdir)(trackdir ^ 8);
+}
+
+/**
+ * Returns the Track that a given Trackdir represents
+ *
+ * This function filters the Track which is used in the Trackdir value and
+ * returns it as a Track value.
+ *
+ * @param trackdir The trackdir value
+ * @return The Track which is used in the value
+ */
+static inline Track TrackdirToTrack(Trackdir trackdir)
+{
+	return (Track)(trackdir & 0x7);
+}
+
+/**
+ * Returns a Trackdir for the given Track
+ *
+ * Since every Track corresponds to two Trackdirs, we choose the
+ * one which points between NE and S. Note that the actual
+ * implementation is quite futile, but this might change
+ * in the future.
+ *
+ * @param track The given Track
+ * @return The Trackdir from the given Track
+ */
+static inline Trackdir TrackToTrackdir(Track track)
+{
+	return (Trackdir)track;
+}
+
+/**
+ * Returns a TrackdirBit mask from a given Track
+ *
+ * The TrackdirBit mask contains the two TrackdirBits that
+ * correspond with the given Track (one for each direction).
+ *
+ * @param track The track to get the TrackdirBits from
+ * @return The TrackdirBits which the selected tracks
+ */
+static inline TrackdirBits TrackToTrackdirBits(Track track)
+{
+	Trackdir td = TrackToTrackdir(track);
+	return (TrackdirBits)(TrackdirToTrackdirBits(td) | TrackdirToTrackdirBits(ReverseTrackdir(td)));
+}
+
+/**
+ * Discards all directional information from a TrackdirBits value
+ *
+ * Any Track which is present in either direction will be present in the result.
+ *
+ * @param bits The TrackdirBits to get the TrackBits from
+ * @return The TrackBits
+ */
+static inline TrackBits TrackdirBitsToTrackBits(TrackdirBits bits)
+{
+	return (TrackBits)((bits | (bits >> 8)) & TRACK_BIT_MASK);
+}
+
+/**
+ * Maps a trackdir to the trackdir that you will end up on if you go straight
+ * ahead.
+ *
+ * This will be the same trackdir for diagonal trackdirs, but a
+ * different (alternating) one for straight trackdirs
+ *
+ * @param trackdir The given trackdir
+ * @return The next Trackdir value of the next tile.
+ */
+static inline Trackdir NextTrackdir(Trackdir trackdir)
+{
+	extern const Trackdir _next_trackdir[TRACKDIR_END];
+	return _next_trackdir[trackdir];
+}
+
+/**
+ * Maps a track to all tracks that make 90 deg turns with it.
+ *
+ * For the diagonal directions these are the complement of the
+ * direction, for the straight directions these are the
+ * two vertical or horizontal tracks, depend on the given direction
+ *
+ * @param track The given track
+ * @return The TrackBits with the tracks marked which cross the given track by 90 deg.
+ */
+static inline TrackBits TrackCrossesTracks(Track track)
+{
+	extern const TrackBits _track_crosses_tracks[TRACK_END];
+	return _track_crosses_tracks[track];
+}
+
+/**
+ * Maps a trackdir to the (4-way) direction the tile is exited when following
+ * that trackdir.
+ *
+ * For the diagonal directions these are the same directions. For
+ * the straight directions these are the directions from the imagined
+ * base-tile to the bordering tile which will be joined if the given
+ * straight direction is leaved from the base-tile.
+ *
+ * @param trackdir The given track direction
+ * @return The direction which points to the resulting tile if following the Trackdir
+ */
+static inline DiagDirection TrackdirToExitdir(Trackdir trackdir)
+{
+	extern const DiagDirection _trackdir_to_exitdir[TRACKDIR_END];
+	return _trackdir_to_exitdir[trackdir];
+}
+
+/**
+ * Maps a track and an (4-way) dir to the trackdir that represents the track
+ * with the exit in the given direction.
+ *
+ * For the diagonal tracks the resulting track direction are clear for a given
+ * DiagDirection. It either matches the direction or it returns INVALID_TRACKDIR,
+ * as a TRACK_X cannot be applied with DIAG_SE.
+ * For the straight tracks the resulting track direction will be the
+ * direction which the DiagDirection is pointing. But this will be INVALID_TRACKDIR
+ * if the DiagDirection is pointing 'away' the track.
+ *
+ * @param track The track to applie an direction on
+ * @param diagdir The DiagDirection to applie on
+ * @return The resulting track direction or INVALID_TRACKDIR if not possible.
+ */
+static inline Trackdir TrackExitdirToTrackdir(Track track, DiagDirection diagdir)
+{
+	extern const Trackdir _track_exitdir_to_trackdir[TRACK_END][DIAGDIR_END];
+	return _track_exitdir_to_trackdir[track][diagdir];
+}
+
+/**
+ * Maps a track and an (4-way) dir to the trackdir that represents the track
+ * with the entry in the given direction.
+ *
+ * For the diagonal tracks the return value is clear, its either the matching
+ * track direction or INVALID_TRACKDIR.
+ * For the straight tracks this returns the track direction which results if
+ * you follow the DiagDirection and then turn by 45 deg left or right on the
+ * next tile. The new direction on the new track will be the returning Trackdir
+ * value. If the parameters makes no sense like the track TRACK_UPPER and the
+ * diraction DIAGDIR_NE (target track cannot be reached) this function returns
+ * INVALID_TRACKDIR.
+ *
+ * @param track The target track
+ * @param diagdir The direction to "come from"
+ * @return the resulting Trackdir or INVALID_TRACKDIR if not possible.
+ */
+static inline Trackdir TrackEnterdirToTrackdir(Track track, DiagDirection diagdir)
+{
+	extern const Trackdir _track_enterdir_to_trackdir[TRACK_END][DIAGDIR_END];
+	return _track_enterdir_to_trackdir[track][diagdir];
+}
+
+/**
+ * Maps a track and a full (8-way) direction to the trackdir that represents
+ * the track running in the given direction.
+ */
+static inline Trackdir TrackDirectionToTrackdir(Track track, Direction dir)
+{
+	extern const Trackdir _track_direction_to_trackdir[TRACK_END][DIR_END];
+	return _track_direction_to_trackdir[track][dir];
+}
+
+/**
+ * Maps a (4-way) direction to the diagonal trackdir that runs in that
+ * direction.
+ *
+ * @param diagdir The direction
+ * @return The resulting Trackdir direction
+ */
+static inline Trackdir DiagdirToDiagTrackdir(DiagDirection diagdir)
+{
+	extern const Trackdir _dir_to_diag_trackdir[DIAGDIR_END];
+	return _dir_to_diag_trackdir[diagdir];
+}
+
+/**
+ * Returns all trackdirs that can be reached when entering a tile from a given
+ * (diagonal) direction.
+ *
+ * This will obviously include 90 degree turns, since no information is available
+ * about the exact angle of entering
+ *
+ * @param diagdir The joining direction
+ * @return The TrackdirBits which can be used from the given direction
+ * @see DiagdirReachesTracks
+ */
+static inline TrackdirBits DiagdirReachesTrackdirs(DiagDirection diagdir)
+{
+	extern const TrackdirBits _exitdir_reaches_trackdirs[DIAGDIR_END];
+	return _exitdir_reaches_trackdirs[diagdir];
+}
+
+/**
+ * Returns all tracks that can be reached when entering a tile from a given
+ * (diagonal) direction.
+ *
+ * This will obviously include 90 degree turns, since no
+ * information is available about the exact angle of entering
+ *
+ * @param diagdir The joining irection
+ * @return The tracks which can be used
+ * @see DiagdirReachesTrackdirs
+ */
+static inline TrackBits DiagdirReachesTracks(DiagDirection diagdir) { return TrackdirBitsToTrackBits(DiagdirReachesTrackdirs(diagdir)); }
+
+/**
+ * Maps a trackdir to the trackdirs that can be reached from it (ie, when
+ * entering the next tile.
+ *
+ * This will include 90 degree turns!
+ *
+ * @param trackdir The track direction which will be leaved
+ * @return The track directions which can be used from this direction (in the next tile)
+ */
+static inline TrackdirBits TrackdirReachesTrackdirs(Trackdir trackdir)
+{
+	extern const TrackdirBits _exitdir_reaches_trackdirs[DIAGDIR_END];
+	return _exitdir_reaches_trackdirs[TrackdirToExitdir(trackdir)];
+}
+/* Note that there is no direct table for this function (there used to be),
+ * but it uses two simpeler tables to achieve the result */
+
+/**
+ * Maps a trackdir to all trackdirs that make 90 deg turns with it.
+ *
+ * For the diagonal tracks this returns the track direction bits
+ * of the other axis in both directions, which cannot be joined by
+ * the given track direction.
+ * For the straight tracks this returns all possible 90 deg turns
+ * either on the current tile (which no train can joined) or on the
+ * bordering tiles.
+ *
+ * @param trackdir The track direction
+ * @return The TrackdirBits which are (more or less) 90 deg turns.
+ */
+static inline TrackdirBits TrackdirCrossesTrackdirs(Trackdir trackdir)
+{
+	extern const TrackdirBits _track_crosses_trackdirs[TRACKDIR_END];
+	return _track_crosses_trackdirs[TrackdirToTrack(trackdir)];
+}
+
+/**
+ * Checks if a given Track is diagonal
+ *
+ * @param track The given track to check
+ * @return true if diagonal, else false
+ */
+static inline bool IsDiagonalTrack(Track track)
+{
+	return (track == TRACK_X) || (track == TRACK_Y);
+}
+
+/**
+ * Checks if a given Trackdir is diagonal.
+ *
+ * @param trackdir The given trackdir
+ * @return true if the trackdir use a diagonal track
+ */
+static inline bool IsDiagonalTrackdir(Trackdir trackdir)
+{
+	return IsDiagonalTrack(TrackdirToTrack(trackdir));
+}
+
+
+/**
+ * Checks if the given tracks overlap, ie form a crossing. Basically this
+ * means when there is more than one track on the tile, exept when there are
+ * two parallel tracks.
+ * @param  bits The tracks present.
+ * @return Whether the tracks present overlap in any way.
+ */
+static inline bool TracksOverlap(TrackBits bits)
+{
+	/* With no, or only one track, there is no overlap */
+	if (bits == TRACK_BIT_NONE || KillFirstBit(bits) == TRACK_BIT_NONE) return false;
+	/* We know that there are at least two tracks present. When there are more
+	 * than 2 tracks, they will surely overlap. When there are two, they will
+	 * always overlap unless they are lower & upper or right & left. */
+	return bits != TRACK_BIT_HORZ && bits != TRACK_BIT_VERT;
+}
+
+/**
+ * Checks whether the trackdir means that we are reversing.
+ * @param dir the trackdir to check
+ * @return true if it is a reversing road trackdir
+ */
+static inline bool IsReversingRoadTrackdir(Trackdir dir)
+{
+	return (dir & 0x07) >= 6;
+}
+
+/**
+ * Checks whether the given trackdir is a straight road
+ * @param dir the trackdir to check
+ * @return true if it is a straight road trackdir
+ */
+static inline bool IsStraightRoadTrackdir(Trackdir dir)
+{
+	return (dir & 0x06) == 0;
+}
+
+#endif /* TRACK_FUNC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/track_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,127 @@
+/* $Id$ */
+
+/** @file track_type.h All types related to tracks */
+
+#ifndef TRACK_TYPE_H
+#define TRACK_TYPE_H
+
+#include "core/enum_type.hpp"
+
+/**
+ * These are used to specify a single track.
+ * Can be translated to a trackbit with TrackToTrackbit
+ */
+enum Track {
+	TRACK_BEGIN = 0,        ///< Used for iterations
+	TRACK_X     = 0,        ///< Track along the x-axis (north-east to south-west)
+	TRACK_Y     = 1,        ///< Track along the y-axis (north-west to south-east)
+	TRACK_UPPER = 2,        ///< Track in the upper corner of the tile (north)
+	TRACK_LOWER = 3,        ///< Track in the lower corner of the tile (south)
+	TRACK_LEFT  = 4,        ///< Track in the left corner of the tile (west)
+	TRACK_RIGHT = 5,        ///< Track in the right corner of the tile (east)
+	TRACK_END,              ///< Used for iterations
+	INVALID_TRACK = 0xFF    ///< Flag for an invalid track
+};
+
+/** Allow incrementing of Track variables */
+DECLARE_POSTFIX_INCREMENT(Track);
+/** Define basic enum properties */
+template <> struct EnumPropsT<Track> : MakeEnumPropsT<Track, byte, TRACK_BEGIN, TRACK_END, INVALID_TRACK> {};
+typedef TinyEnumT<Track> TrackByte;
+
+
+/** Bitfield corresponding to Track */
+enum TrackBits {
+	TRACK_BIT_NONE    = 0U,                                                 ///< No track
+	TRACK_BIT_X       = 1U << TRACK_X,                                      ///< X-axis track
+	TRACK_BIT_Y       = 1U << TRACK_Y,                                      ///< Y-axis track
+	TRACK_BIT_UPPER   = 1U << TRACK_UPPER,                                  ///< Upper track
+	TRACK_BIT_LOWER   = 1U << TRACK_LOWER,                                  ///< Lower track
+	TRACK_BIT_LEFT    = 1U << TRACK_LEFT,                                   ///< Left track
+	TRACK_BIT_RIGHT   = 1U << TRACK_RIGHT,                                  ///< Right track
+	TRACK_BIT_CROSS   = TRACK_BIT_X     | TRACK_BIT_Y,                      ///< X-Y-axis cross
+	TRACK_BIT_HORZ    = TRACK_BIT_UPPER | TRACK_BIT_LOWER,                  ///< Upper and lower track
+	TRACK_BIT_VERT    = TRACK_BIT_LEFT  | TRACK_BIT_RIGHT,                  ///< Left and right track
+	TRACK_BIT_3WAY_NE = TRACK_BIT_X     | TRACK_BIT_UPPER | TRACK_BIT_RIGHT,///< "Arrow" to the north-east
+	TRACK_BIT_3WAY_SE = TRACK_BIT_Y     | TRACK_BIT_LOWER | TRACK_BIT_RIGHT,///< "Arrow" to the south-east
+	TRACK_BIT_3WAY_SW = TRACK_BIT_X     | TRACK_BIT_LOWER | TRACK_BIT_LEFT, ///< "Arrow" to the south-west
+	TRACK_BIT_3WAY_NW = TRACK_BIT_Y     | TRACK_BIT_UPPER | TRACK_BIT_LEFT, ///< "Arrow" to the north-west
+	TRACK_BIT_ALL     = TRACK_BIT_CROSS | TRACK_BIT_HORZ  | TRACK_BIT_VERT, ///< All possible tracks
+	TRACK_BIT_MASK    = 0x3FU,                                              ///< Bitmask for the first 6 bits
+	TRACK_BIT_WORMHOLE = 0x40U,                                             ///< Bitflag for a wormhole (used for tunnels)
+	TRACK_BIT_DEPOT   = 0x80U,                                              ///< Bitflag for a depot
+	INVALID_TRACK_BIT = 0xFF                                                ///< Flag for an invalid trackbits value
+};
+
+/** Define basic enum properties */
+template <> struct EnumPropsT<TrackBits> : MakeEnumPropsT<TrackBits, byte, TRACK_BIT_NONE, TRACK_BIT_ALL, INVALID_TRACK_BIT> {};
+typedef TinyEnumT<TrackBits> TrackBitsByte;
+
+DECLARE_ENUM_AS_BIT_SET(TrackBits);
+
+/**
+ * Enumeration for tracks and directions.
+ *
+ * These are a combination of tracks and directions. Values are 0-5 in one
+ * direction (corresponding to the Track enum) and 8-13 in the other direction.
+ * 6, 7, 14 and 15 are used to encode the reversing of road vehicles. Those
+ * reversing track dirs are not considered to be 'valid' except in a small
+ * corner in the road vehicle controller.
+ */
+enum Trackdir {
+	TRACKDIR_BEGIN    =  0,         ///< Used for iterations
+	TRACKDIR_X_NE     =  0,         ///< X-axis and direction to north-east
+	TRACKDIR_Y_SE     =  1,         ///< Y-axis and direction to south-east
+	TRACKDIR_UPPER_E  =  2,         ///< Upper track and direction to east
+	TRACKDIR_LOWER_E  =  3,         ///< Lower track and direction to east
+	TRACKDIR_LEFT_S   =  4,         ///< Left track and direction to south
+	TRACKDIR_RIGHT_S  =  5,         ///< Right track and direction to south
+	TRACKDIR_RVREV_NE =  6,         ///< (Road vehicle) reverse direction north-east
+	TRACKDIR_RVREV_SE =  7,         ///< (Road vehicle) reverse direction south-east
+	TRACKDIR_X_SW     =  8,         ///< X-axis and direction to south-west
+	TRACKDIR_Y_NW     =  9,         ///< Y-axis and direction to north-west
+	TRACKDIR_UPPER_W  = 10,         ///< Upper track and direction to west
+	TRACKDIR_LOWER_W  = 11,         ///< Lower track and direction to west
+	TRACKDIR_LEFT_N   = 12,         ///< Left track and direction to north
+	TRACKDIR_RIGHT_N  = 13,         ///< Right track and direction to north
+	TRACKDIR_RVREV_SW = 14,         ///< (Road vehicle) reverse direction south-west
+	TRACKDIR_RVREV_NW = 15,         ///< (Road vehicle) reverse direction north-west
+	TRACKDIR_END,                   ///< Used for iterations
+	INVALID_TRACKDIR  = 0xFF,       ///< Flag for an invalid trackdir
+};
+
+/** Define basic enum properties */
+template <> struct EnumPropsT<Trackdir> : MakeEnumPropsT<Trackdir, byte, TRACKDIR_BEGIN, TRACKDIR_END, INVALID_TRACKDIR> {};
+typedef TinyEnumT<Trackdir> TrackdirByte;
+
+/**
+ * Enumeration of bitmasks for the TrackDirs
+ *
+ * These are a combination of tracks and directions. Values are 0-5 in one
+ * direction (corresponding to the Track enum) and 8-13 in the other direction.
+ */
+enum TrackdirBits {
+	TRACKDIR_BIT_NONE     = 0x0000, ///< No track build
+	TRACKDIR_BIT_X_NE     = 0x0001, ///< Track x-axis, direction north-east
+	TRACKDIR_BIT_Y_SE     = 0x0002, ///< Track y-axis, direction south-east
+	TRACKDIR_BIT_UPPER_E  = 0x0004, ///< Track upper, direction east
+	TRACKDIR_BIT_LOWER_E  = 0x0008, ///< Track lower, direction east
+	TRACKDIR_BIT_LEFT_S   = 0x0010, ///< Track left, direction south
+	TRACKDIR_BIT_RIGHT_S  = 0x0020, ///< Track right, direction south
+	/* Again, note the two missing values here. This enables trackdir -> track conversion by doing (trackdir & 0xFF) */
+	TRACKDIR_BIT_X_SW     = 0x0100, ///< Track x-axis, direction south-west
+	TRACKDIR_BIT_Y_NW     = 0x0200, ///< Track y-axis, direction north-west
+	TRACKDIR_BIT_UPPER_W  = 0x0400, ///< Track upper, direction west
+	TRACKDIR_BIT_LOWER_W  = 0x0800, ///< Track lower, direction west
+	TRACKDIR_BIT_LEFT_N   = 0x1000, ///< Track left, direction north
+	TRACKDIR_BIT_RIGHT_N  = 0x2000, ///< Track right, direction north
+	TRACKDIR_BIT_MASK     = 0x3F3F, ///< Bitmask for bit-operations
+	INVALID_TRACKDIR_BIT  = 0xFFFF, ///< Flag for an invalid trackdirbit value
+};
+
+/** Define basic enum properties */
+template <> struct EnumPropsT<TrackdirBits> : MakeEnumPropsT<TrackdirBits, uint16, TRACKDIR_BIT_NONE, TRACKDIR_BIT_MASK, INVALID_TRACKDIR_BIT> {};
+typedef TinyEnumT<TrackdirBits> TrackdirBitsShort;
+DECLARE_ENUM_AS_BIT_SET(TrackdirBits);
+
+#endif /* TRACK_TYPE_H */
--- a/src/train.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/train.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,7 +6,8 @@
 #define TRAIN_H
 
 #include "stdafx.h"
-#include "vehicle.h"
+#include "core/bitmath_func.hpp"
+#include "vehicle_base.h"
 
 
 /*
--- a/src/train_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/train_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,27 +6,21 @@
 #include "openttd.h"
 #include "bridge_map.h"
 #include "debug.h"
-#include "functions.h"
+#include "tile_cmd.h"
 #include "landscape.h"
 #include "gui.h"
 #include "station_map.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "map.h"
-#include "tile.h"
 #include "tunnel_map.h"
-#include "vehicle.h"
 #include "timetable.h"
 #include "articulated_vehicles.h"
-#include "command.h"
+#include "command_func.h"
 #include "pathfind.h"
 #include "npf.h"
 #include "station.h"
-#include "table/train_cmd.h"
 #include "news.h"
 #include "engine.h"
-#include "player.h"
-#include "sound.h"
+#include "player_func.h"
+#include "player_base.h"
 #include "depot.h"
 #include "waypoint.h"
 #include "vehicle_gui.h"
@@ -36,19 +30,55 @@
 #include "newgrf_engine.h"
 #include "newgrf_sound.h"
 #include "newgrf_text.h"
-#include "direction.h"
+#include "direction_func.h"
 #include "yapf/yapf.h"
-#include "date.h"
 #include "cargotype.h"
 #include "group.h"
 #include "table/sprites.h"
+#include "tunnelbridge_map.h"
+#include "strings_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "signal_func.h"
+#include "variables.h"
+#include "autoreplace_gui.h"
+#include "gfx_func.h"
+#include "settings_type.h"
+
+#include "table/strings.h"
+#include "table/train_cmd.h"
 
 static bool TrainCheckIfLineEnds(Vehicle *v);
 static void TrainController(Vehicle *v, bool update_image);
+static TileIndex TrainApproachingCrossingTile(const Vehicle *v);
 
 static const byte _vehicle_initial_x_fract[4] = {10, 8, 4,  8};
 static const byte _vehicle_initial_y_fract[4] = { 8, 4, 8, 10};
-static const TrackBits _state_dir_table[4] = { TRACK_BIT_RIGHT, TRACK_BIT_LOWER, TRACK_BIT_LEFT, TRACK_BIT_UPPER };
+
+
+/**
+ * Determine the side in which the train will leave the tile
+ *
+ * @param direction vehicle direction
+ * @param track vehicle track bits
+ * @return side of tile the train will leave
+ */
+static inline DiagDirection TrainExitDir(Direction direction, TrackBits track)
+{
+	static const TrackBits state_dir_table[DIAGDIR_END] = { TRACK_BIT_RIGHT, TRACK_BIT_LOWER, TRACK_BIT_LEFT, TRACK_BIT_UPPER };
+
+	DiagDirection diagdir = DirToDiagDir(direction);
+
+	/* Determine the diagonal direction in which we will exit this tile */
+	if (!HasBit(direction, 0) && track != state_dir_table[diagdir]) {
+		diagdir = ChangeDiagDir(diagdir, DIAGDIRDIFF_90LEFT);
+	}
+
+	return diagdir;
+}
 
 
 /** Return the cargo weight multiplier to use for a rail vehicle
@@ -102,7 +132,7 @@
 		v->u.rail.cached_power = total_power;
 		v->u.rail.cached_max_te = max_te;
 		InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 	}
 }
 
@@ -160,7 +190,9 @@
 	const RailVehicleInfo *rvi_v = RailVehInfo(v->engine_type);
 	EngineID first_engine = IsFrontEngine(v) ? v->engine_type : INVALID_ENGINE;
 	v->u.rail.cached_total_length = 0;
-	v->u.rail.compatible_railtypes = 0;
+	v->u.rail.compatible_railtypes = RAILTYPES_NONE;
+
+	bool train_can_tilt = true;
 
 	for (Vehicle *u = v; u != NULL; u = u->Next()) {
 		const RailVehicleInfo *rvi_u = RailVehInfo(u->engine_type);
@@ -168,6 +200,8 @@
 		/* Check the v->first cache. */
 		assert(u->First() == v);
 
+		if (!HasBit(EngInfo(u->engine_type)->misc_flags, EF_RAIL_TILTS)) train_can_tilt = false;
+
 		/* update the 'first engine' */
 		u->u.rail.first_engine = v == u ? INVALID_ENGINE : first_engine;
 		u->u.rail.railtype = rvi_u->railtype;
@@ -221,7 +255,7 @@
 			 * existing electric engines when elrails are disabled and then re-enabled */
 			if (HasBit(u->u.rail.flags, VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL)) {
 				u->u.rail.railtype = RAILTYPE_RAIL;
-				u->u.rail.compatible_railtypes |= (1 << RAILTYPE_RAIL);
+				u->u.rail.compatible_railtypes |= RAILTYPES_RAIL;
 			}
 
 			/* max speed is the minimum of the speed limits of all vehicles in the consist */
@@ -251,35 +285,12 @@
 
 	/* store consist weight/max speed in cache */
 	v->u.rail.cached_max_speed = max_speed;
+	v->u.rail.cached_tilt = train_can_tilt;
 
 	/* recalculate cached weights and power too (we do this *after* the rest, so it is known which wagons are powered and need extra weight added) */
 	TrainCargoChanged(v);
 }
 
-/* These two arrays are used for realistic acceleration. XXX: How should they
- * be interpreted? */
-static const byte _curve_neighbours45[8][2] = {
-	{7, 1},
-	{0, 2},
-	{1, 3},
-	{2, 4},
-	{3, 5},
-	{4, 6},
-	{5, 7},
-	{6, 0},
-};
-
-static const byte _curve_neighbours90[8][2] = {
-	{6, 2},
-	{7, 3},
-	{0, 4},
-	{1, 5},
-	{2, 6},
-	{3, 7},
-	{4, 0},
-	{5, 1},
-};
-
 enum AccelType {
 	AM_ACCEL,
 	AM_BRAKE
@@ -293,13 +304,13 @@
 	assert(v->type == VEH_TRAIN);
 	/* When does a train drive through a station
 	 * first we deal with the "new nonstop handling" */
-	if (_patches.new_nonstop && o->flags & OF_NON_STOP && sid == o->dest) {
+	if (_patches.new_nonstop && o->flags & OFB_NON_STOP && sid == o->dest) {
 		return false;
 	}
 
 	if (v->last_station_visited == sid) return false;
 
-	if (sid != o->dest && (o->flags & OF_NON_STOP || _patches.new_nonstop)) {
+	if (sid != o->dest && (o->flags & OFB_NON_STOP || _patches.new_nonstop)) {
 		return false;
 	}
 
@@ -309,7 +320,8 @@
 /** new acceleration*/
 static int GetTrainAcceleration(Vehicle *v, bool mode)
 {
-	int max_speed = 2000;
+	static const int absolute_max_speed = 2000;
+	int max_speed = absolute_max_speed;
 	int speed = v->cur_speed * 10 / 16; // km-ish/h -> mp/h
 	int curvecount[2] = {0, 0};
 
@@ -319,57 +331,66 @@
 	int pos = 0;
 	int lastpos = -1;
 	for (const Vehicle *u = v; u->Next() != NULL; u = u->Next(), pos++) {
-		Direction dir = u->direction;
-		Direction ndir = u->Next()->direction;
-		int i;
-
-		for (i = 0; i < 2; i++) {
-			if ( _curve_neighbours45[dir][i] == ndir) {
-				curvecount[i]++;
-				if (lastpos != -1) {
-					numcurve++;
-					sum += pos - lastpos;
-					if (pos - lastpos == 1) {
-						max_speed = 88;
-					}
+		Direction this_dir = u->direction;
+		Direction next_dir = u->Next()->direction;
+
+		DirDiff dirdiff = DirDifference(this_dir, next_dir);
+		if (dirdiff == DIRDIFF_SAME) continue;
+
+		if (dirdiff == DIRDIFF_45LEFT) curvecount[0]++;
+		if (dirdiff == DIRDIFF_45RIGHT) curvecount[1]++;
+		if (dirdiff == DIRDIFF_45LEFT || dirdiff == DIRDIFF_45RIGHT) {
+			if (lastpos != -1) {
+				numcurve++;
+				sum += pos - lastpos;
+				if (pos - lastpos == 1) {
+					max_speed = 88;
 				}
-				lastpos = pos;
 			}
+			lastpos = pos;
 		}
 
 		/*if we have a 90 degree turn, fix the speed limit to 60 */
-		if (_curve_neighbours90[dir][0] == ndir ||
-				_curve_neighbours90[dir][1] == ndir) {
+		if (dirdiff == DIRDIFF_90LEFT || dirdiff == DIRDIFF_90RIGHT) {
 			max_speed = 61;
 		}
 	}
 
-	if (numcurve > 0) sum /= numcurve;
-
 	if ((curvecount[0] != 0 || curvecount[1] != 0) && max_speed > 88) {
 		int total = curvecount[0] + curvecount[1];
 
 		if (curvecount[0] == 1 && curvecount[1] == 1) {
-			max_speed = 0xFFFF;
+			max_speed = absolute_max_speed;
 		} else if (total > 1) {
+			if (numcurve > 0) sum /= numcurve;
 			max_speed = 232 - (13 - Clamp(sum, 1, 12)) * (13 - Clamp(sum, 1, 12));
 		}
 	}
 
-	max_speed += (max_speed / 2) * v->u.rail.railtype;
+	if (max_speed != absolute_max_speed) {
+		/* Apply the engine's rail type curve speed advantage, if it slowed by curves */
+		const RailtypeInfo *rti = GetRailTypeInfo(v->u.rail.railtype);
+		max_speed += (max_speed / 2) * rti->curve_speed;
+
+		if (v->u.rail.cached_tilt) {
+			/* Apply max_speed bonus of 20% for a tilting train */
+			max_speed += max_speed / 5;
+		}
+	}
 
 	if (IsTileType(v->tile, MP_STATION) && IsFrontEngine(v)) {
 		if (TrainShouldStop(v, v->tile)) {
 			int station_length = GetStationByTile(v->tile)->GetPlatformLength(v->tile, DirToDiagDir(v->direction));
-			int delta_v;
-
-			max_speed = 120;
-
-			delta_v = v->cur_speed / (station_length + 1);
-			if (v->max_speed > (v->cur_speed - delta_v))
-				max_speed = v->cur_speed - (delta_v / 10);
-
-			max_speed = max(max_speed, 25 * station_length);
+
+			int st_max_speed = 120;
+
+			int delta_v = v->cur_speed / (station_length + 1);
+			if (v->max_speed > (v->cur_speed - delta_v)) {
+				st_max_speed = v->cur_speed - (delta_v / 10);
+			}
+
+			st_max_speed = max(st_max_speed, 25 * station_length);
+			max_speed = min(max_speed, st_max_speed);
 		}
 	}
 
@@ -468,7 +489,7 @@
 	if (is_custom_sprite(img)) {
 		base = GetCustomVehicleSprite(this, (Direction)(direction + 4 * IS_CUSTOM_SECONDHEAD_SPRITE(img)));
 		if (base != 0) return base;
-		img = orig_rail_vehicle_info[this->engine_type].image_index;
+		img = _orig_rail_vehicle_info[this->engine_type].image_index;
 	}
 
 	base = _engine_sprite_base[img] + ((direction + _engine_sprite_add[img]) & _engine_sprite_and[img]);
@@ -487,7 +508,7 @@
 	if (is_custom_sprite(img)) {
 		image = GetCustomVehicleIcon(engine, DIR_W);
 		if (image == 0) {
-			img = orig_rail_vehicle_info[engine].image_index;
+			img = _orig_rail_vehicle_info[engine].image_index;
 		} else {
 			y += _traininfo_vehicle_pitch;
 		}
@@ -502,7 +523,7 @@
 		image = 0;
 		if (is_custom_sprite(img)) {
 			image = GetCustomVehicleIcon(engine, DIR_E);
-			if (image == 0) img = orig_rail_vehicle_info[engine].image_index;
+			if (image == 0) img = _orig_rail_vehicle_info[engine].image_index;
 		}
 		if (image == 0) {
 			image =
@@ -515,10 +536,8 @@
 
 static CommandCost CmdBuildRailWagon(EngineID engine, TileIndex tile, uint32 flags)
 {
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
-
 	const RailVehicleInfo *rvi = RailVehInfo(engine);
-	CommandCost value((GetEngineProperty(engine, 0x17, rvi->base_cost) * _price.build_railwagon) >> 8);
+	CommandCost value(EXPENSES_NEW_VEHICLES, (GetEngineProperty(engine, 0x17, rvi->base_cost) * _price.build_railwagon) >> 8);
 
 	uint num_vehicles = 1 + CountArticulatedParts(engine, false);
 
@@ -604,7 +623,7 @@
 		}
 	}
 
-	return CommandCost(value);
+	return value;
 }
 
 /** Move all free vehicles in the depot to the train */
@@ -625,7 +644,7 @@
 
 static CommandCost EstimateTrainCost(EngineID engine, const RailVehicleInfo* rvi)
 {
-	return CommandCost(GetEngineProperty(engine, 0x17, rvi->base_cost) * (_price.build_railvehicle >> 3) >> 5);
+	return CommandCost(EXPENSES_NEW_VEHICLES, GetEngineProperty(engine, 0x17, rvi->base_cost) * (_price.build_railvehicle >> 3) >> 5);
 }
 
 static void AddRearEngineToMultiheadedTrain(Vehicle* v, Vehicle* u, bool building)
@@ -675,8 +694,6 @@
 		if (!IsTileOwner(tile, _current_player)) return CMD_ERROR;
 	}
 
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
-
 	const RailVehicleInfo *rvi = RailVehInfo(p1);
 
 	/* Check if depot and new engine uses the same kind of tracks */
@@ -736,7 +753,7 @@
 			v->reliability_spd_dec = e->reliability_spd_dec;
 			v->max_age = e->lifelength * 366;
 
-			v->string_id = STR_SV_TRAIN_NAME;
+			v->name = NULL;
 			v->u.rail.railtype = rvi->railtype;
 			_new_vehicle_id = v->index;
 
@@ -885,6 +902,7 @@
 	if (dest == NULL) return;
 
 	Vehicle *next = dest->Next();
+	v->SetNext(NULL);
 	dest->SetNext(v);
 	v->SetNext(next);
 	ClearFreeWagon(v);
@@ -1024,16 +1042,101 @@
 		if (flags & DC_EXEC) src->unitnumber = unit_num;
 	}
 
-	if (dst_head != NULL) {
-		/* Check NewGRF Callback 0x1D */
-		uint16 callback = GetVehicleCallbackParent(CBID_TRAIN_ALLOW_WAGON_ATTACH, 0, 0, dst_head->engine_type, src, dst_head);
-		if (callback != CALLBACK_FAILED) {
-			if (callback == 0xFD) return_cmd_error(STR_INCOMPATIBLE_RAIL_TYPES);
-			if (callback < 0xFD) {
-				StringID error = GetGRFStringID(GetEngineGRFID(dst_head->engine_type), 0xD000 + callback);
-				return_cmd_error(error);
+	/*
+	 * Check whether the vehicles in the source chain are in the destination
+	 * chain. This can easily be done by checking whether the first vehicle
+	 * of the source chain is in the destination chain as the Next/Previous
+	 * pointers always make a doubly linked list of it where the assumption
+	 * v->Next()->Previous() == v holds (assuming v->Next() != NULL).
+	 */
+	bool src_in_dst = false;
+	for (Vehicle *v = dst_head; !src_in_dst && v != NULL; v = v->Next()) src_in_dst = v == src;
+
+	/*
+	 * If the source chain is in the destination chain then the user is
+	 * only reordering the vehicles, thus not attaching a new vehicle.
+	 * Therefor the 'allow wagon attach' callback does not need to be
+	 * called. If it would be called strange things would happen because
+	 * one 'attaches' an already 'attached' vehicle causing more trouble
+	 * than it actually solves (infinite loops and such).
+	 */
+	if (dst_head != NULL && !src_in_dst) {
+		/*
+		 * When performing the 'allow wagon attach' callback, we have to check
+		 * that for each and every wagon, not only the first one. This means
+		 * that we have to test one wagon, attach it to the train and then test
+		 * the next wagon till we have reached the end. We have to restore it
+		 * to the state it was before we 'tried' attaching the train when the
+		 * attaching fails or succeeds because we are not 'only' doing this
+		 * in the DC_EXEC state.
+		 */
+		Vehicle *dst_tail = dst_head;
+		while (dst_tail->Next() != NULL) dst_tail = dst_tail->Next();
+
+		Vehicle *orig_tail = dst_tail;
+		Vehicle *next_to_attach = src;
+		Vehicle *src_previous = src->Previous();
+
+		while (next_to_attach != NULL) {
+			/* Back up and clear the first_engine data to avoid using wagon override group */
+			EngineID first_engine = next_to_attach->u.rail.first_engine;
+			next_to_attach->u.rail.first_engine = INVALID_ENGINE;
+
+			uint16 callback = GetVehicleCallbackParent(CBID_TRAIN_ALLOW_WAGON_ATTACH, 0, 0, dst_head->engine_type, next_to_attach, dst_head);
+
+			/* Restore original first_engine data */
+			next_to_attach->u.rail.first_engine = first_engine;
+
+			if (callback != CALLBACK_FAILED) {
+				StringID error = STR_NULL;
+
+				if (callback == 0xFD) error = STR_INCOMPATIBLE_RAIL_TYPES;
+				if (callback < 0xFD) error = GetGRFStringID(GetEngineGRFID(dst_head->engine_type), 0xD000 + callback);
+
+				if (error != STR_NULL) {
+					/*
+					 * The attaching is not allowed. In this case 'next_to_attach'
+					 * can contain some vehicles of the 'source' and the destination
+					 * train can have some too. We 'just' add the to-be added wagons
+					 * to the chain and then split it where it was previously
+					 * separated, i.e. the tail of the original destination train.
+					 * Furthermore the 'previous' link of the original source vehicle needs
+					 * to be restored, otherwise the train goes missing in the depot.
+					 */
+					dst_tail->SetNext(next_to_attach);
+					orig_tail->SetNext(NULL);
+					if (src_previous != NULL) src_previous->SetNext(src);
+
+					return_cmd_error(error);
+				}
 			}
+
+			/* Only check further wagons if told to move the chain */
+			if (!HasBit(p2, 0)) break;
+
+			/*
+			 * Adding a next wagon to the chain so we can test the other wagons.
+			 * First 'take' the first wagon from 'next_to_attach' and move it
+			 * to the next wagon. Then add that to the tail of the destination
+			 * train and update the tail with the new vehicle.
+			 */
+			Vehicle *to_add = next_to_attach;
+			next_to_attach = next_to_attach->Next();
+
+			to_add->SetNext(NULL);
+			dst_tail->SetNext(to_add);
+			dst_tail = dst_tail->Next();
 		}
+
+		/*
+		 * When we reach this the attaching is allowed. It also means that the
+		 * chain of vehicles to attach is empty, so we do not need to merge that.
+		 * This means only the splitting needs to be done.
+		 * Furthermore the 'previous' link of the original source vehicle needs
+		 * to be restored, otherwise the train goes missing in the depot.
+		 */
+		orig_tail->SetNext(NULL);
+		if (src_previous != NULL) src_previous->SetNext(src);
 	}
 
 	/* do it? */
@@ -1144,7 +1247,7 @@
 				InvalidateWindow(WC_VEHICLE_DETAILS, src_head->index);
 				/* Update the refit button and window */
 				InvalidateWindow(WC_VEHICLE_REFIT, src_head->index);
-				InvalidateWindowWidget(WC_VEHICLE_VIEW, src_head->index, 12);
+				InvalidateWindowWidget(WC_VEHICLE_VIEW, src_head->index, VVW_WIDGET_REFIT_VEH);
 			}
 			/* Update the depot window */
 			InvalidateWindow(WC_VEHICLE_DEPOT, src_head->tile);
@@ -1158,7 +1261,7 @@
 				UpdateTrainAcceleration(dst_head);
 				InvalidateWindow(WC_VEHICLE_DETAILS, dst_head->index);
 				/* Update the refit button and window */
-				InvalidateWindowWidget(WC_VEHICLE_VIEW, dst_head->index, 12);
+				InvalidateWindowWidget(WC_VEHICLE_VIEW, dst_head->index, VVW_WIDGET_REFIT_VEH);
 				InvalidateWindow(WC_VEHICLE_REFIT, dst_head->index);
 			}
 			/* Update the depot window */
@@ -1201,7 +1304,7 @@
 		}
 
 		v->vehstatus ^= VS_STOPPED;
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 	}
 	return CommandCost();
@@ -1231,8 +1334,6 @@
 
 	if (HASBITS(v->vehstatus, VS_CRASHED)) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE);
 
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
-
 	while (IsArticulatedPart(v)) v = v->Previous();
 	Vehicle *first = v->First();
 
@@ -1252,7 +1353,7 @@
 		RebuildVehicleLists();
 	}
 
-	CommandCost cost;
+	CommandCost cost(EXPENSES_NEW_VEHICLES);
 	switch (p2) {
 		case 0: case 2: { /* Delete given wagon */
 			bool switch_engine = false;    // update second wagon to engine?
@@ -1448,7 +1549,7 @@
 	if (spd != old) {
 		v->u.rail.last_speed = spd;
 		if (_patches.vehicle_speed || (old == 0) != (spd == 0))
-			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 	}
 }
 
@@ -1524,23 +1625,99 @@
 	TrainPowerChanged(v);
 }
 
-/* Check if the vehicle is a train and is on the tile we are testing */
-static void *TestTrainOnCrossing(Vehicle *v, void *data)
+
+/**
+ * Check if the vehicle is a train
+ * @param v vehicle on tile
+ * @return v if it is a train, NULL otherwise
+ */
+static void *TrainOnTileEnum(Vehicle *v, void *)
 {
-	if (v->tile != *(const TileIndex*)data || v->type != VEH_TRAIN) return NULL;
+	return (v->type == VEH_TRAIN) ? v : NULL;
+}
+
+
+/**
+ * Checks if a train is approaching a rail-road crossing
+ * @param v vehicle on tile
+ * @param data tile with crossing we are testing
+ * @return v if it is approaching a crossing, NULL otherwise
+ */
+static void *TrainApproachingCrossingEnum(Vehicle *v, void *data)
+{
+	/* not a train || not front engine || crashed */
+	if (v->type != VEH_TRAIN || !IsFrontEngine(v) || v->vehstatus & VS_CRASHED) return NULL;
+
+	TileIndex tile = *(TileIndex*)data;
+
+	if (TrainApproachingCrossingTile(v) != tile) return NULL;
+
 	return v;
 }
 
-static void DisableTrainCrossing(TileIndex tile)
+
+/**
+ * Finds a vehicle approaching rail-road crossing
+ * @param tile tile to test
+ * @return pointer to vehicle approaching the crossing
+ * @pre tile is a rail-road crossing
+ */
+static Vehicle *TrainApproachingCrossing(TileIndex tile)
 {
-	if (IsLevelCrossingTile(tile) &&
-			VehicleFromPos(tile, &tile, TestTrainOnCrossing) == NULL && // empty?
-			IsCrossingBarred(tile)) {
-		UnbarCrossing(tile);
+	assert(IsLevelCrossingTile(tile));
+
+	DiagDirection dir = AxisToDiagDir(OtherAxis(GetCrossingRoadAxis(tile)));
+	TileIndex tile_from = tile + TileOffsByDiagDir(dir);
+
+	Vehicle *v = (Vehicle *)VehicleFromPos(tile_from, &tile, &TrainApproachingCrossingEnum);
+
+	if (v != NULL) return v;
+
+	dir = ReverseDiagDir(dir);
+	tile_from = tile + TileOffsByDiagDir(dir);
+
+	return (Vehicle *)VehicleFromPos(tile_from, &tile, &TrainApproachingCrossingEnum);
+}
+
+
+/**
+ * Sets correct crossing state
+ * @param tile tile to update
+ * @param sound should we play sound?
+ * @pre tile is a rail-road crossing
+ */
+void UpdateLevelCrossing(TileIndex tile, bool sound)
+{
+	assert(IsLevelCrossingTile(tile));
+
+	/* train on crossing || train approaching crossing */
+	bool new_state = VehicleFromPos(tile, NULL, &TrainOnTileEnum) || TrainApproachingCrossing(tile);
+
+	if (new_state != IsCrossingBarred(tile)) {
+		if (new_state && sound) {
+			SndPlayTileFx(SND_0E_LEVEL_CROSSING, tile);
+		}
+		SetCrossingBarred(tile, new_state);
 		MarkTileDirtyByTile(tile);
 	}
 }
 
+
+/**
+ * Bars crossing and plays ding-ding sound if not barred already
+ * @param tile tile with crossing
+ * @pre tile is a rail-road crossing
+ */
+static inline void MaybeBarCrossingWithSound(TileIndex tile)
+{
+	if (!IsCrossingBarred(tile)) {
+		BarCrossing(tile);
+		SndPlayTileFx(SND_0E_LEVEL_CROSSING, tile);
+		MarkTileDirtyByTile(tile);
+	}
+}
+
+
 /**
  * Advances wagons for train reversing, needed for variable length wagons.
  * Needs to be called once before the train is reversed, and once after it.
@@ -1567,6 +1744,8 @@
 			Vehicle *tempnext = last->Next();
 			last->SetNext(NULL);
 
+			/* do not update images now because the wagons are disconnected
+			 * and that could cause problems with NewGRFs */
 			for (int i = 0; i < differential; i++) TrainController(first, false);
 
 			last->SetNext(tempnext);
@@ -1586,25 +1765,11 @@
 	}
 
 	/* Check if we were approaching a rail/road-crossing */
-	{
-		TileIndex tile = v->tile;
-		DiagDirection dir = DirToDiagDir(v->direction);
-
-		/* Determine the diagonal direction in which we will exit this tile */
-		if (!(v->direction & 1) && v->u.rail.track != _state_dir_table[dir]) {
-			dir = ChangeDiagDir(dir, DIAGDIRDIFF_90LEFT);
-		}
-		/* Calculate next tile */
-		tile += TileOffsByDiagDir(dir);
-
-		/* Check if the train left a rail/road-crossing */
-		DisableTrainCrossing(tile);
-	}
+	TileIndex crossing = TrainApproachingCrossingTile(v);
 
 	/* count number of vehicles */
-	int r = -1;
-	const Vehicle *u = v;
-	do r++; while ((u = u->Next()) != NULL);
+	int r = 0;  ///< number of vehicles - 1
+	for (const Vehicle *u = v; (u = u->Next()) != NULL;) { r++; }
 
 	AdvanceWagons(v, true);
 
@@ -1620,7 +1785,17 @@
 		InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
 	}
 
+	/* update all images */
+	for (Vehicle *u = v; u != NULL; u = u->Next()) { u->cur_image = u->GetImage(u->direction); }
+
 	ClrBit(v->u.rail.flags, VRF_REVERSING);
+
+	/* update crossing we were approaching */
+	if (crossing != INVALID_TILE) UpdateLevelCrossing(crossing);
+
+	/* maybe we are approaching crossing now, after reversal */
+	crossing = TrainApproachingCrossingTile(v);
+	if (crossing != INVALID_TILE) MaybeBarCrossingWithSound(crossing);
 }
 
 /** Reverse train.
@@ -1713,13 +1888,12 @@
 
 	if (v->type != VEH_TRAIN || !CheckOwnership(v->owner)) return CMD_ERROR;
 	if (CheckTrainStoppedInDepot(v) < 0) return_cmd_error(STR_TRAIN_MUST_BE_STOPPED);
+	if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_CAN_T_REFIT_DESTROYED_VEHICLE);
 
 	/* Check cargo */
 	if (new_cid >= NUM_CARGO) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_TRAIN_RUN);
-
-	CommandCost cost;
+	CommandCost cost(EXPENSES_TRAIN_RUN);
 	uint num = 0;
 
 	do {
@@ -1858,18 +2032,12 @@
 		}
 	} else {
 		/* search in the forward direction first. */
-		DiagDirection i = DirToDiagDir(v->direction);
-		if (!(v->direction & 1) && v->u.rail.track != _state_dir_table[i]) {
-			i = ChangeDiagDir(i, DIAGDIRDIFF_90LEFT);
-		}
+		DiagDirection i = TrainExitDir(v->direction, v->u.rail.track);
 		NewTrainPathfind(tile, 0, v->u.rail.compatible_railtypes, i, (NTPEnumProc*)NtpCallbFindDepot, &tfdd);
 		if (tfdd.best_length == (uint)-1){
 			tfdd.reverse = true;
 			/* search in backwards direction */
-			i = ReverseDiagDir(DirToDiagDir(v->direction));
-			if (!(v->direction & 1) && v->u.rail.track != _state_dir_table[i]) {
-				i = ChangeDiagDir(i, DIAGDIRDIFF_90LEFT);
-			}
+			i = TrainExitDir(ReverseDir(v->direction), v->u.rail.track);
 			NewTrainPathfind(tile, 0, v->u.rail.compatible_railtypes, i, (NTPEnumProc*)NtpCallbFindDepot, &tfdd);
 		}
 	}
@@ -1902,27 +2070,27 @@
 	if (v->vehstatus & VS_CRASHED) return CMD_ERROR;
 
 	if (v->current_order.type == OT_GOTO_DEPOT) {
-		if (!!(p2 & DEPOT_SERVICE) == HasBit(v->current_order.flags, OFB_HALT_IN_DEPOT)) {
+		if (!!(p2 & DEPOT_SERVICE) == HasBit(v->current_order.flags, OF_HALT_IN_DEPOT)) {
 			/* We called with a different DEPOT_SERVICE setting.
 			 * Now we change the setting to apply the new one and let the vehicle head for the same depot.
 			 * Note: the if is (true for requesting service == true for ordered to stop in depot)          */
 			if (flags & DC_EXEC) {
-				ClrBit(v->current_order.flags, OFB_PART_OF_ORDERS);
-				ToggleBit(v->current_order.flags, OFB_HALT_IN_DEPOT);
-				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+				ClrBit(v->current_order.flags, OF_PART_OF_ORDERS);
+				ToggleBit(v->current_order.flags, OF_HALT_IN_DEPOT);
+				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 			}
 			return CommandCost();
 		}
 
 		if (p2 & DEPOT_DONT_CANCEL) return CMD_ERROR; // Requested no cancelation of depot orders
 		if (flags & DC_EXEC) {
-			if (HasBit(v->current_order.flags, OFB_PART_OF_ORDERS)) {
+			if (HasBit(v->current_order.flags, OF_PART_OF_ORDERS)) {
 				v->cur_order_index++;
 			}
 
 			v->current_order.type = OT_DUMMY;
 			v->current_order.flags = 0;
-			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		}
 		return CommandCost();
 	}
@@ -1939,11 +2107,11 @@
 
 		v->dest_tile = tfdd.tile;
 		v->current_order.type = OT_GOTO_DEPOT;
-		v->current_order.flags = OF_NON_STOP;
-		if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OFB_HALT_IN_DEPOT);
+		v->current_order.flags = OFB_NON_STOP;
+		if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OF_HALT_IN_DEPOT);
 		v->current_order.dest = GetDepotByTile(tfdd.tile)->index;
 		v->current_order.refit_cargo = CT_INVALID;
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		/* If there is no depot in front, reverse automatically */
 		if (tfdd.reverse) DoCommand(v->tile, v->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION);
 	}
@@ -2077,7 +2245,7 @@
 
 		v->load_unload_time_rem = 0;
 
-		if (UpdateSignalsOnSegment(v->tile, DirToDiagDir(v->direction))) {
+		if (UpdateSignalsOnSegment(v->tile, INVALID_DIAGDIR, v->owner)) {
 			InvalidateWindowClasses(WC_TRAINS_LIST);
 			return true;
 		}
@@ -2096,7 +2264,7 @@
 	v->UpdateDeltaXY(v->direction);
 	v->cur_image = v->GetImage(v->direction);
 	VehiclePositionChanged(v);
-	UpdateSignalsOnSegment(v->tile, DirToDiagDir(v->direction));
+	UpdateSignalsOnSegment(v->tile, INVALID_DIAGDIR, v->owner);
 	UpdateTrainAcceleration(v);
 	InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
 
@@ -2390,8 +2558,8 @@
 {
 	switch (v->current_order.type) {
 		case OT_GOTO_DEPOT:
-			if (!(v->current_order.flags & OF_PART_OF_ORDERS)) return false;
-			if ((v->current_order.flags & OF_SERVICE_IF_NEEDED) &&
+			if (!(v->current_order.flags & OFB_PART_OF_ORDERS)) return false;
+			if ((v->current_order.flags & OFB_SERVICE_IF_NEEDED) &&
 					!VehicleNeedsService(v)) {
 				UpdateVehicleTimetable(v, true);
 				v->cur_order_index++;
@@ -2422,7 +2590,7 @@
 
 	/* check if we've reached a non-stop station while TTDPatch nonstop is enabled.. */
 	if (_patches.new_nonstop &&
-			v->current_order.flags & OF_NON_STOP &&
+			v->current_order.flags & OFB_NON_STOP &&
 			IsTileType(v->tile, MP_STATION) &&
 			v->current_order.dest == GetStationIndex(v->tile)) {
 		UpdateVehicleTimetable(v, true);
@@ -2481,7 +2649,7 @@
 	Vehicle *v = this;
 	do {
 		v->cur_image = v->GetImage(v->direction);
-		MarkAllViewportsDirty(v->left_coord, v->top_coord, v->right_coord + 1, v->bottom_coord + 1);
+		MarkSingleVehicleDirty(v);
 	} while ((v = v->Next()) != NULL);
 
 	/* need to update acceleration and cached values since the goods on the train changed. */
@@ -2594,13 +2762,6 @@
 	return _new_vehicle_direction_table[offs];
 }
 
-static Direction GetNewVehicleDirection(const Vehicle *v, int x, int y)
-{
-	uint offs = (y - v->y_pos + 1) * 4 + (x - v->x_pos + 1);
-	assert(offs < 11);
-	return _new_vehicle_direction_table[offs];
-}
-
 static int GetDirectionToVehicle(const Vehicle *v, int x, int y)
 {
 	byte offs;
@@ -2684,7 +2845,7 @@
 	if (IsTileType(tile, MP_RAILWAY) &&
 			GetRailTileType(tile) == RAIL_TILE_SIGNALS) {
 		uint i = FindFirstBit2x64(GetTrackBits(tile) * 0x101 & _reachable_tracks[dir]);
-		UpdateSignalsOnSegment(tile, _otherside_signal_directions[i]);
+		UpdateSignalsOnSegment(tile, _otherside_signal_directions[i], GetTileOwner(tile));
 	}
 }
 
@@ -2693,14 +2854,27 @@
 {
 	if (v->u.rail.crash_anim_pos != 0) return;
 
+	/* we may need to update crossing we were approaching */
+	TileIndex crossing = TrainApproachingCrossingTile(v);
+
 	v->u.rail.crash_anim_pos++;
 
-	Vehicle *u = v;
+	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
+	InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
+
+	if (v->u.rail.track == TRACK_BIT_DEPOT) {
+		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
+	}
+
+	RebuildVehicleLists();
+
 	BEGIN_ENUM_WAGONS(v)
 		v->vehstatus |= VS_CRASHED;
+		MarkSingleVehicleDirty(v);
 	END_ENUM_WAGONS(v)
 
-	InvalidateWindowWidget(WC_VEHICLE_VIEW, u->index, STATUS_BAR);
+	/* must be updated after the train has been marked crashed */
+	if (crossing != INVALID_TILE) UpdateLevelCrossing(crossing);
 }
 
 static uint CountPassengersInTrain(const Vehicle* v)
@@ -2714,7 +2888,6 @@
 
 struct TrainCollideChecker {
 	Vehicle *v;
-	const Vehicle *v_skip;
 	uint num;
 };
 
@@ -2722,23 +2895,21 @@
 {
 	TrainCollideChecker* tcc = (TrainCollideChecker*)data;
 
-	if (v != tcc->v &&
-			v != tcc->v_skip &&
-			v->type == VEH_TRAIN &&
-			v->u.rail.track != TRACK_BIT_DEPOT &&
-			abs(v->z_pos - tcc->v->z_pos) < 6 &&
-			abs(v->x_pos - tcc->v->x_pos) < 6 &&
-			abs(v->y_pos - tcc->v->y_pos) < 6 ) {
-
-		Vehicle *coll = v->First();
-
-		/* it can't collide with its own wagons */
-		if (tcc->v == coll ||
-			(tcc->v->u.rail.track == TRACK_BIT_WORMHOLE && (tcc->v->direction & 2) != (v->direction & 2)))
-			return NULL;
-
-		/* two drivers + passengers killed in train tcc->v (if it was not crashed already) */
+	if (v->type != VEH_TRAIN) return NULL;
+
+	/* get first vehicle now to make most usual checks faster */
+	Vehicle *coll = v->First();
+
+	/* can't collide with own wagons && can't crash in depot && the same height level */
+	if (coll != tcc->v && v->u.rail.track != TRACK_BIT_DEPOT && abs(v->z_pos - tcc->v->z_pos) < 6) {
+		int x_diff = v->x_pos - tcc->v->x_pos;
+		int y_diff = v->y_pos - tcc->v->y_pos;
+
+		/* needed to disable possible crash of competitor train in station by building diagonal track at its end */
+		if (x_diff * x_diff + y_diff * y_diff > 25) return NULL;
+
 		if (!(tcc->v->vehstatus & VS_CRASHED)) {
+			/* two drivers + passengers killed in train tcc->v (if it was not crashed already) */
 			tcc->num += 2 + CountPassengersInTrain(tcc->v);
 			SetVehicleCrashed(tcc->v);
 		}
@@ -2768,17 +2939,12 @@
 
 	TrainCollideChecker tcc;
 	tcc.v = v;
-	tcc.v_skip = v->Next();
 	tcc.num = 0;
 
 	/* find colliding vehicles */
 	if (v->u.rail.track == TRACK_BIT_WORMHOLE) {
 		VehicleFromPos(v->tile, &tcc, FindTrainCollideEnum);
-		if (IsBridgeTile(v->tile)) {
-			VehicleFromPos(GetOtherBridgeEnd(v->tile), &tcc, FindTrainCollideEnum);
-		} else {
-			VehicleFromPos(GetOtherTunnelEnd(v->tile), &tcc, FindTrainCollideEnum);
-		}
+		VehicleFromPos(GetOtherTunnelBridgeEnd(v->tile), &tcc, FindTrainCollideEnum);
 	} else {
 		VehicleFromPosXY(v->x_pos, v->y_pos, &tcc, FindTrainCollideEnum);
 	}
@@ -2797,17 +2963,12 @@
 	SndPlayVehicleFx(SND_13_BIG_CRASH, v);
 }
 
-struct VehicleAtSignalData {
-	TileIndex tile;
-	Direction direction;
-};
-
 static void *CheckVehicleAtSignal(Vehicle *v, void *data)
 {
-	const VehicleAtSignalData* vasd = (VehicleAtSignalData*)data;
-
-	if (v->type == VEH_TRAIN && IsFrontEngine(v) && v->tile == vasd->tile) {
-		DirDiff diff = ChangeDirDiff(DirDifference(v->direction, vasd->direction), DIRDIFF_90RIGHT);
+	Direction dir = *(Direction*)data;
+
+	if (v->type == VEH_TRAIN && IsFrontEngine(v)) {
+		DirDiff diff = ChangeDirDiff(DirDifference(v->direction, dir), DIRDIFF_90RIGHT);
 
 		if (diff == DIRDIFF_90RIGHT || (v->cur_speed <= 5 && diff <= DIRDIFF_REVERSE)) return v;
 	}
@@ -2821,7 +2982,7 @@
 	/* For every vehicle after and including the given vehicle */
 	for (prev = v->Previous(); v != NULL; prev = v, v = v->Next()) {
 		DiagDirection enterdir = DIAGDIR_BEGIN;
-		bool update_signals = false;
+		bool update_signals_crossing = false; // will we update signals or crossing state?
 		BeginVehicleMove(v);
 
 		GetNewVehiclePosResult gp = GetNewVehiclePos(v);
@@ -2849,7 +3010,7 @@
 
 					if (v->current_order.type == OT_LEAVESTATION) {
 						v->current_order.Free();
-						InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+						InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 					}
 				}
 			} else {
@@ -2906,12 +3067,10 @@
 							v->progress = 255 - 10;
 							if (++v->load_unload_time_rem < _patches.wait_twoway_signal * 73) {
 								TileIndex o_tile = gp.new_tile + TileOffsByDiagDir(enterdir);
-								VehicleAtSignalData vasd;
-								vasd.tile = o_tile;
-								vasd.direction = ReverseDir(dir);
+								Direction rdir = ReverseDir(dir);
 
 								/* check if a train is waiting on the other side */
-								if (VehicleFromPos(o_tile, &vasd, CheckVehicleAtSignal) == NULL) return;
+								if (VehicleFromPos(o_tile, &rdir, &CheckVehicleAtSignal) == NULL) return;
 							}
 						}
 						goto reverse_train_direction;
@@ -2946,11 +3105,6 @@
 					goto invalid_rail;
 				}
 
-				if (IsLevelCrossingTile(v->tile) && v->Next() == NULL) {
-					UnbarCrossing(v->tile);
-					MarkTileDirtyByTile(v->tile);
-				}
-
 				if (IsFrontEngine(v)) v->load_unload_time_rem = 0;
 
 				if (!HasBit(r, VETS_ENTERED_WORMHOLE)) {
@@ -2966,14 +3120,16 @@
 
 				/* We need to update signal status, but after the vehicle position hash
 				 * has been updated by AfterSetTrainPos() */
-				update_signals = true;
+				update_signals_crossing = true;
 
 				if (prev == NULL) AffectSpeedByDirChange(v, chosen_dir);
 
 				v->direction = chosen_dir;
 			}
 		} else {
-			/* In tunnel or on a bridge */
+			/* In a tunnel or on a bridge
+			 * - for tunnels, only the part when the vehicle is not visible (part of enter/exit tile too)
+			 * - for bridges, only the middle part - without the bridge heads */
 			if (!(v->vehstatus & VS_HIDDEN)) {
 				v->cur_speed =
 					min(v->cur_speed, GetBridge(GetBridgeType(v->tile))->speed);
@@ -2989,9 +3145,8 @@
 		}
 
 		/* update image of train, as well as delta XY */
-		Direction newdir = GetNewVehicleDirection(v, gp.x, gp.y);
-		v->UpdateDeltaXY(newdir);
-		if (update_image) v->cur_image = v->GetImage(newdir);
+		v->UpdateDeltaXY(v->direction);
+		if (update_image) v->cur_image = v->GetImage(v->direction);
 
 		v->x_pos = gp.x;
 		v->y_pos = gp.y;
@@ -3004,12 +3159,15 @@
 			AffectSpeedByZChange(v, old_z);
 		}
 
-		if (update_signals) {
+		if (update_signals_crossing) {
 			if (IsFrontEngine(v)) TrainMovedChangeSignals(gp.new_tile, enterdir);
 
 			/* Signals can only change when the first
 			 * (above) or the last vehicle moves. */
-			if (v->Next() == NULL) TrainMovedChangeSignals(gp.old_tile, ReverseDiagDir(enterdir));
+			if (v->Next() == NULL) {
+				TrainMovedChangeSignals(gp.old_tile, ReverseDiagDir(enterdir));
+				if (IsLevelCrossingTile(gp.old_tile)) UpdateLevelCrossing(gp.old_tile);
+			}
 		}
 	}
 	return;
@@ -3025,17 +3183,17 @@
 	ReverseTrainDirection(v);
 }
 
-extern TileIndex CheckTunnelBusy(TileIndex tile, uint *length);
-
 /**
  * Deletes/Clears the last wagon of a crashed train. It takes the engine of the
  * train, then goes to the last wagon and deletes that. Each call to this function
  * will remove the last wagon of a crashed train. If this wagon was on a crossing,
- * or inside a tunnel, recalculate the signals as they might need updating
+ * or inside a tunnel/bridge, recalculate the signals as they might need updating
  * @param v the Vehicle of which last wagon is to be removed
  */
 static void DeleteLastWagon(Vehicle *v)
 {
+	Vehicle *first = v->First();
+
 	/* Go to the last wagon and delete the link pointing there
 	 * *u is then the one-before-last wagon, and *v the last
 	 * one which will physicially be removed */
@@ -3043,44 +3201,41 @@
 	for (; v->Next() != NULL; v = v->Next()) u = v;
 	u->SetNext(NULL);
 
-	InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
-	DeleteWindowById(WC_VEHICLE_VIEW, v->index);
+	if (first == v) {
+		/* Removing front vehicle (the last to go) */
+		DeleteWindowById(WC_VEHICLE_VIEW, v->index);
+		InvalidateWindow(WC_COMPANY, v->owner);
+	} else {
+		/* Recalculate cached train properties */
+		TrainConsistChanged(first);
+		InvalidateWindow(WC_VEHICLE_DETAILS, first->index);
+		/* Update the depot window if the first vehicle is in depot -
+		 * if v == first, then it is updated in PreDestructor() */
+		if (first->u.rail.track == TRACK_BIT_DEPOT) {
+			InvalidateWindow(WC_VEHICLE_DEPOT, first->tile);
+		}
+	}
+
 	RebuildVehicleLists();
-	InvalidateWindow(WC_COMPANY, v->owner);
-
-	BeginVehicleMove(v);
-	EndVehicleMove(v);
+
+	MarkSingleVehicleDirty(v);
+
+	/* 'v' shouldn't be accessed after it has been deleted */
+	TrackBits track = v->u.rail.track;
+	TileIndex tile = v->tile;
+	Owner owner = v->owner;
 
 	delete v;
-
-	if (v->u.rail.track != TRACK_BIT_DEPOT && v->u.rail.track != TRACK_BIT_WORMHOLE)
-		SetSignalsOnBothDir(v->tile, FIND_FIRST_BIT(v->u.rail.track));
-
-	/* Check if the wagon was on a road/rail-crossing and disable it if no
-	 * others are on it */
-	DisableTrainCrossing(v->tile);
-
-	if ((v->u.rail.track == TRACK_BIT_WORMHOLE && v->vehstatus & VS_HIDDEN)) { // inside a tunnel
-		TileIndex endtile = CheckTunnelBusy(v->tile, NULL);
-
-		if (endtile == INVALID_TILE) return; // tunnel is busy (error returned)
-
-		switch (v->direction) {
-			case 1:
-			case 5:
-				SetSignalsOnBothDir(v->tile, 0);
-				SetSignalsOnBothDir(endtile, 0);
-				break;
-
-			case 3:
-			case 7:
-				SetSignalsOnBothDir(v->tile, 1);
-				SetSignalsOnBothDir(endtile, 1);
-				break;
-
-			default:
-				break;
-		}
+	v = NULL; // make sure nobody will won't try to read 'v' anymore
+
+	/* check if the wagon was on a road/rail-crossing */
+	if (IsLevelCrossingTile(tile)) UpdateLevelCrossing(tile);
+
+	/* Update signals */
+	if (IsTileType(tile, MP_TUNNELBRIDGE) || IsTileDepotType(tile, TRANSPORT_RAIL)) {
+		UpdateSignalsOnSegment(tile, INVALID_DIAGDIR, owner);
+	} else {
+		SetSignalsOnBothDir(tile, (Track)(FIND_FIRST_BIT(track)), owner);
 	}
 }
 
@@ -3171,12 +3326,120 @@
 	}
 }
 
-static const byte _breakdown_speeds[16] = {
+/** Maximum speeds for train that is broken down or approaching line end */
+static const uint16 _breakdown_speeds[16] = {
 	225, 210, 195, 180, 165, 150, 135, 120, 105, 90, 75, 60, 45, 30, 15, 15
 };
 
+
+/**
+ * Train is approaching line end, slow down and possibly reverse
+ *
+ * @param v front train engine
+ * @param signal not line end, just a red signal
+ * @return true iff we did NOT have to reverse
+ */
+static bool TrainApproachingLineEnd(Vehicle *v, bool signal)
+{
+	/* Calc position within the current tile */
+	uint x = v->x_pos & 0xF;
+	uint y = v->y_pos & 0xF;
+
+	/* for diagonal directions, 'x' will be 0..15 -
+	 * for other directions, it will be 1, 3, 5, ..., 15 */
+	switch (v->direction) {
+		case DIR_N : x = ~x + ~y + 25; break;
+		case DIR_NW: x = y;            /* FALLTHROUGH */
+		case DIR_NE: x = ~x + 16;      break;
+		case DIR_E : x = ~x + y + 9;   break;
+		case DIR_SE: x = y;            break;
+		case DIR_S : x = x + y - 7;    break;
+		case DIR_W : x = ~y + x + 9;   break;
+		default: break;
+	}
+
+	/* do not reverse when approaching red signal */
+	if (!signal && x + 4 >= TILE_SIZE) {
+		/* we are too near the tile end, reverse now */
+		v->cur_speed = 0;
+		ReverseTrainDirection(v);
+		return false;
+	}
+
+	/* slow down */
+	v->vehstatus |= VS_TRAIN_SLOWING;
+	uint16 break_speed = _breakdown_speeds[x & 0xF];
+	if (break_speed < v->cur_speed) v->cur_speed = break_speed;
+
+	return true;
+}
+
+
+/**
+ * Determines whether train would like to leave the tile
+ * @param v train to test
+ * @return true iff vehicle is NOT entering or inside a depot or tunnel/bridge
+ */
+static bool TrainCanLeaveTile(const Vehicle *v)
+{
+	/* Exit if inside a tunnel/bridge or a depot */
+	if (v->u.rail.track == TRACK_BIT_WORMHOLE || v->u.rail.track == TRACK_BIT_DEPOT) return false;
+
+	TileIndex tile = v->tile;
+
+	/* entering a tunnel/bridge? */
+	if (IsTileType(tile, MP_TUNNELBRIDGE)) {
+		DiagDirection dir = GetTunnelBridgeDirection(tile);
+		if (DiagDirToDir(dir) == v->direction) return false;
+	}
+
+	/* entering a depot? */
+	if (IsTileDepotType(tile, TRANSPORT_RAIL)) {
+		DiagDirection dir = ReverseDiagDir(GetRailDepotDirection(tile));
+		if (DiagDirToDir(dir) == v->direction) return false;
+	}
+
+	return true;
+}
+
+
+/**
+ * Determines whether train is approaching a rail-road crossing
+ *   (thus making it barred)
+ * @param v front engine of train
+ * @return TileIndex of crossing the train is approaching, else INVALID_TILE
+ * @pre v in non-crashed front engine
+ */
+static TileIndex TrainApproachingCrossingTile(const Vehicle *v)
+{
+	assert(IsFrontEngine(v));
+	assert(!(v->vehstatus & VS_CRASHED));
+
+	if (!TrainCanLeaveTile(v)) return INVALID_TILE;
+
+	DiagDirection dir = TrainExitDir(v->direction, v->u.rail.track);
+	TileIndex tile = v->tile + TileOffsByDiagDir(dir);
+
+	/* not a crossing || wrong axis || wrong railtype || wrong owner */
+	if (!IsLevelCrossingTile(tile) || DiagDirToAxis(dir) == GetCrossingRoadAxis(tile) ||
+			!CheckCompatibleRail(v, tile) || GetTileOwner(tile) != v->owner) {
+		return INVALID_TILE;
+	}
+
+	return tile;
+}
+
+
+/**
+ * Checks for line end. Also, bars crossing at next tile if needed
+ *
+ * @param v vehicle we are checking
+ * @return true iff we did NOT have to reverse
+ */
 static bool TrainCheckIfLineEnds(Vehicle *v)
 {
+	/* First, handle broken down train */
+
 	int t = v->breakdown_ctr;
 	if (t > 1) {
 		v->vehstatus |= VS_TRAIN_SLOWING;
@@ -3187,83 +3450,36 @@
 		v->vehstatus &= ~VS_TRAIN_SLOWING;
 	}
 
-	if (v->u.rail.track == TRACK_BIT_WORMHOLE) return true; // exit if inside a tunnel
-	if (v->u.rail.track == TRACK_BIT_DEPOT) return true; // exit if inside a depot
-
-	TileIndex tile = v->tile;
-
-	if (IsTileType(tile, MP_TUNNELBRIDGE)) {
-		DiagDirection dir = IsTunnel(tile) ? GetTunnelDirection(tile) : GetBridgeRampDirection(tile);
-		if (DiagDirToDir(dir) == v->direction) return true;
-	}
-
-	// depot?
-	/* XXX -- When enabled, this makes it possible to crash trains of others
-	     (by building a depot right against a station) */
-/*	if (IsTileType(tile, MP_RAILWAY) && GetRailTileType(tile) == RAIL_TILE_DEPOT_WAYPOINT)
-		return true;*/
+	if (!TrainCanLeaveTile(v)) return true;
 
 	/* Determine the non-diagonal direction in which we will exit this tile */
-	DiagDirection dir = DirToDiagDir(v->direction);
-	if (!(v->direction & 1) && v->u.rail.track != _state_dir_table[dir]) {
-		dir = ChangeDiagDir(dir, DIAGDIRDIFF_90LEFT);
-	}
+	DiagDirection dir = TrainExitDir(v->direction, v->u.rail.track);
 	/* Calculate next tile */
-	tile += TileOffsByDiagDir(dir);
-	// determine the track status on the next tile.
+	TileIndex tile = v->tile + TileOffsByDiagDir(dir);
+
+	/* Determine the track status on the next tile */
 	uint32 ts = GetTileTrackStatus(tile, TRANSPORT_RAIL, 0) & _reachable_tracks[dir];
 
-	/* Calc position within the current tile ?? */
-	uint x = v->x_pos & 0xF;
-	uint y = v->y_pos & 0xF;
-
-	switch (v->direction) {
-		case DIR_N : x = ~x + ~y + 24; break;
-		case DIR_NW: x = y;            /* FALLTHROUGH */
-		case DIR_NE: x = ~x + 16;      break;
-		case DIR_E : x = ~x + y + 8;   break;
-		case DIR_SE: x = y;            break;
-		case DIR_S : x = x + y - 8;    break;
-		case DIR_W : x = ~y + x + 8;   break;
-		default: break;
+	/* We are sure the train is not entering a depot, it is detected above */
+
+	/* no suitable trackbits at all || wrong railtype || not our track ||
+	 *   tunnel/bridge from opposite side || depot from opposite side */
+	if (GB(ts, 0, 16) == 0 || !CheckCompatibleRail(v, tile) || GetTileOwner(tile) != v->owner ||
+			(IsTileType(tile, MP_TUNNELBRIDGE) && GetTunnelBridgeDirection(tile) != dir) ||
+			(IsTileDepotType(tile, TRANSPORT_RAIL) && GetRailDepotDirection(tile) == dir) ) {
+		return TrainApproachingLineEnd(v, false);
 	}
 
-	if (GB(ts, 0, 16) != 0) {
-		/* If we approach a rail-piece which we can't enter, or the back of a depot, don't enter it! */
-		if (x + 4 >= TILE_SIZE &&
-				(!CheckCompatibleRail(v, tile) ||
-				(IsTileDepotType(tile, TRANSPORT_RAIL) &&
-				GetRailDepotDirection(tile) == dir))) {
-			v->cur_speed = 0;
-			ReverseTrainDirection(v);
-			return false;
-		}
-		if ((ts &= (ts >> 16)) == 0) {
-			/* make a rail/road crossing red */
-			if (IsLevelCrossingTile(tile)) {
-				if (!IsCrossingBarred(tile)) {
-					BarCrossing(tile);
-					SndPlayVehicleFx(SND_0E_LEVEL_CROSSING, v);
-					MarkTileDirtyByTile(tile);
-				}
-			}
-			return true;
-		}
-	} else if (x + 4 >= TILE_SIZE) {
-		v->cur_speed = 0;
-		ReverseTrainDirection(v);
-		return false;
-	}
-
-	/* slow down */
-	v->vehstatus |= VS_TRAIN_SLOWING;
-	uint16 break_speed = _breakdown_speeds[x & 0xF];
-	if (!(v->direction & 1)) break_speed >>= 1;
-	if (break_speed < v->cur_speed) v->cur_speed = break_speed;
+	/* approaching red signal */
+	if ((ts & (ts >> 16)) != 0) return TrainApproachingLineEnd(v, true);
+
+	/* approaching a rail/road crossing? then make it red */
+	if (IsLevelCrossingTile(tile)) MaybeBarCrossingWithSound(tile);
 
 	return true;
 }
 
+
 static void TrainLocoHandler(Vehicle *v, bool mode)
 {
 	/* train has crashed? */
@@ -3383,7 +3599,7 @@
 			 * schedule? */
 			v->current_order.type = OT_DUMMY;
 			v->current_order.flags = 0;
-			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		}
 		return;
 	}
@@ -3397,10 +3613,10 @@
 	}
 
 	v->current_order.type = OT_GOTO_DEPOT;
-	v->current_order.flags = OF_NON_STOP;
+	v->current_order.flags = OFB_NON_STOP;
 	v->current_order.dest = depot->index;
 	v->dest_tile = tfdd.tile;
-	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 }
 
 void OnNewDay_Train(Vehicle *v)
@@ -3423,11 +3639,10 @@
 
 		if ((v->vehstatus & VS_STOPPED) == 0) {
 			/* running costs */
-			CommandCost cost(v->GetRunningCost() / 364);
+			CommandCost cost(EXPENSES_TRAIN_RUN, v->GetRunningCost() / 364);
 
 			v->profit_this_year -= cost.GetCost() >> 8;
 
-			SET_EXPENSES_TYPE(EXPENSES_TRAIN_RUN);
 			SubtractMoneyFromPlayerFract(v->owner, cost);
 
 			InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
--- a/src/train_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/train_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,19 +5,20 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "window.h"
 #include "gui.h"
-#include "vehicle.h"
-#include "viewport.h"
-#include "command.h"
+#include "window_gui.h"
+#include "gfx_func.h"
+#include "command_func.h"
 #include "vehicle_gui.h"
 #include "depot.h"
 #include "train.h"
 #include "newgrf_engine.h"
+#include "strings_func.h"
+#include "vehicle_func.h"
+#include "settings_type.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
 
 void CcBuildWagon(bool success, TileIndex tile, uint32 p1, uint32 p2)
 {
@@ -69,7 +70,7 @@
 	return (len * _traininfo_vehicle_width) / 8;
 }
 
-void DrawTrainImage(const Vehicle *v, int x, int y, int count, int skip, VehicleID selection)
+void DrawTrainImage(const Vehicle *v, int x, int y, VehicleID selection, int count, int skip)
 {
 	DrawPixelInfo tmp_dpi, *old_dpi;
 	int dx = -(skip * 8) / _traininfo_vehicle_width;
--- a/src/transparency.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/transparency.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,8 @@
 #ifndef TRANSPARENCY_H
 #define TRANSPARENCY_H
 
+#include "gfx_func.h"
+
 /**
  * Transparency option bits: which position in _transparency_opt stands for which transparency.
  * If you change the order, change the order of the ShowTransparencyToolbar() stuff in transparency_gui.cpp too.
--- a/src/transparency_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/transparency_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -2,16 +2,14 @@
 
 #include "stdafx.h"
 #include "openttd.h"
+#include "gui.h"
+#include "window_gui.h"
+#include "variables.h"
+#include "transparency.h"
+#include "sound_func.h"
+
 #include "table/sprites.h"
 #include "table/strings.h"
-#include "functions.h"
-#include "window.h"
-#include "gui.h"
-#include "viewport.h"
-#include "gfx.h"
-#include "sound.h"
-#include "variables.h"
-#include "transparency.h"
 
 TransparencyOptionBits _transparency_opt;
 
--- a/src/tree_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/tree_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,21 +6,24 @@
 #include "openttd.h"
 #include "bridge_map.h"
 #include "clear_map.h"
+#include "tile_cmd.h"
+#include "landscape.h"
+#include "tree_map.h"
+#include "viewport_func.h"
+#include "command_func.h"
+#include "economy_func.h"
+#include "town.h"
+#include "variables.h"
+#include "genworld.h"
+#include "transparency.h"
+#include "functions.h"
+#include "player_func.h"
+#include "sound_func.h"
+#include "settings_type.h"
+
 #include "table/strings.h"
 #include "table/sprites.h"
 #include "table/tree_land.h"
-#include "functions.h"
-#include "map.h"
-#include "landscape.h"
-#include "tile.h"
-#include "tree_map.h"
-#include "viewport.h"
-#include "command.h"
-#include "town.h"
-#include "sound.h"
-#include "variables.h"
-#include "genworld.h"
-#include "transparency.h"
 
 /**
  * List of tree placer algorithm.
@@ -272,7 +275,7 @@
 CommandCost CmdPlantTree(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	StringID msg = INVALID_STRING_ID;
-	CommandCost cost;
+	CommandCost cost(EXPENSES_OTHER);
 	int ex;
 	int ey;
 	int sx, sy, x, y;
@@ -281,8 +284,6 @@
 	/* Check the tree type. It can be random or some valid value within the current climate */
 	if (p1 != (uint)-1 && p1 - _tree_base_by_landscape[_opt.landscape] >= _tree_count_by_landscape[_opt.landscape]) return CMD_ERROR;
 
-	SET_EXPENSES_TYPE(EXPENSES_OTHER);
-
 	// make sure sx,sy are smaller than ex,ey
 	ex = TileX(tile);
 	ey = TileY(tile);
@@ -329,16 +330,15 @@
 						default: break;
 					}
 
+					if (_game_mode != GM_EDITOR && IsValidPlayer(_current_player)) {
+						Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority);
+						if (t != NULL) ChangeTownRating(t, RATING_TREE_UP_STEP, RATING_TREE_MAXIMUM);
+					}
+
 					if (flags & DC_EXEC) {
 						TreeType treetype;
 						uint growth;
 
-						if (_game_mode != GM_EDITOR && IsValidPlayer(_current_player)) {
-							Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority);
-							if (t != NULL)
-								ChangeTownRating(t, RATING_TREE_UP_STEP, RATING_TREE_MAXIMUM);
-						}
-
 						treetype = (TreeType)p1;
 						if (treetype == TREE_INVALID) {
 							treetype = GetRandomTreeType(tile, GB(Random(), 24, 8));
@@ -487,10 +487,9 @@
 {
 	uint num;
 
-	if ((flags & DC_EXEC) && IsValidPlayer(_current_player)) {
+	if (IsValidPlayer(_current_player)) {
 		Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority);
-		if (t != NULL)
-			ChangeTownRating(t, RATING_TREE_DOWN_STEP, RATING_TREE_MINIMUM);
+		if (t != NULL) ChangeTownRating(t, RATING_TREE_DOWN_STEP, RATING_TREE_MINIMUM);
 	}
 
 	num = GetTreeCount(tile) + 1;
@@ -498,7 +497,7 @@
 
 	if (flags & DC_EXEC) DoClearSquare(tile);
 
-	return CommandCost(num * _price.remove_trees);
+	return CommandCost(EXPENSES_CONSTRUCTION, num * _price.remove_trees);
 }
 
 static void GetAcceptedCargo_Trees(TileIndex tile, AcceptedCargo ac)
--- a/src/tree_map.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/tree_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,8 +5,6 @@
 #ifndef TREE_MAP_H
 #define TREE_MAP_H
 
-#include "macros.h"
-
 /**
  * List of tree types along all landscape types.
  *
--- a/src/tunnel_map.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/tunnel_map.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,8 +4,9 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "tile.h"
 #include "tunnel_map.h"
+#include "tunnelbridge_map.h"
+
 
 /**
  * Gets the other end of the tunnel. Where a vehicle would reappear when it
@@ -15,7 +16,7 @@
  */
 TileIndex GetOtherTunnelEnd(TileIndex tile)
 {
-	DiagDirection dir = GetTunnelDirection(tile);
+	DiagDirection dir = GetTunnelBridgeDirection(tile);
 	TileIndexDiff delta = TileOffsByDiagDir(dir);
 	uint z = GetTileZ(tile);
 
@@ -24,7 +25,7 @@
 		tile += delta;
 	} while (
 		!IsTunnelTile(tile) ||
-		GetTunnelDirection(tile) != dir ||
+		GetTunnelBridgeDirection(tile) != dir ||
 		GetTileZ(tile) != z
 	);
 
@@ -52,7 +53,7 @@
 	return
 		z == height &&
 		IsTunnelTile(tile) &&
-		GetTunnelDirection(tile) == dir;
+		GetTunnelBridgeDirection(tile) == dir;
 }
 
 /**
--- a/src/tunnel_map.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/tunnel_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,11 +5,11 @@
 #ifndef TUNNEL_MAP_H
 #define TUNNEL_MAP_H
 
-#include "direction.h"
-#include "macros.h"
-#include "map.h"
-#include "rail.h"
-#include "road.h"
+#include "direction_func.h"
+#include "rail_type.h"
+#include "road_type.h"
+#include "tile_map.h"
+
 
 /**
  * Is this a tunnel (entrance)?
@@ -23,7 +23,6 @@
 	return !HasBit(_m[t].m5, 7);
 }
 
-
 /**
  * Is this a tunnel (entrance)?
  * @param t the tile that might be a tunnel
@@ -34,62 +33,10 @@
 	return IsTileType(t, MP_TUNNELBRIDGE) && IsTunnel(t);
 }
 
-/**
- * Gets the direction facing out of the tunnel
- * @param t the tile to get the tunnel facing direction of
- * @pre IsTunnelTile(t)
- * @return the direction the tunnel is facing
- */
-static inline DiagDirection GetTunnelDirection(TileIndex t)
-{
-	assert(IsTunnelTile(t));
-	return (DiagDirection)GB(_m[t].m5, 0, 2);
-}
-
-/**
- * Gets the transport type of the tunnel (road or rail)
- * @param t the tunnel entrance tile to get the type of
- * @pre IsTunnelTile(t)
- * @return the transport type in the tunnel
- */
-static inline TransportType GetTunnelTransportType(TileIndex t)
-{
-	assert(IsTunnelTile(t));
-	return (TransportType)GB(_m[t].m5, 2, 2);
-}
-
-/**
- * Is this tunnel entrance in a snowy or desert area?
- * @param t the tunnel entrance tile
- * @pre IsTunnelTile(t)
- * @return true if and only if the tunnel entrance is in a snowy/desert area
- */
-static inline bool HasTunnelSnowOrDesert(TileIndex t)
-{
-	assert(IsTunnelTile(t));
-	return HasBit(_m[t].m4, 7);
-}
-
-/**
- * Places this tunnel entrance in a snowy or desert area,
- * or takes it out of there.
- * @param t the tunnel entrance tile
- * @param snow_or_desert is the entrance in snow or desert (true), when
- *                       not in snow and not in desert false
- * @pre IsTunnelTile(t)
- */
-static inline void SetTunnelSnowOrDesert(TileIndex t, bool snow_or_desert)
-{
-	assert(IsTunnelTile(t));
-	SB(_m[t].m4, 7, 1, snow_or_desert);
-}
-
-
 TileIndex GetOtherTunnelEnd(TileIndex);
 bool IsTunnelInWay(TileIndex, uint z);
 bool IsTunnelInWayDir(TileIndex tile, uint z, DiagDirection dir);
 
-
 /**
  * Makes a road tunnel entrance
  * @param t the entrance of the tunnel
--- a/src/tunnelbridge_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/tunnelbridge_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -10,31 +10,31 @@
 #include "bridge_map.h"
 #include "rail_map.h"
 #include "road_map.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "functions.h"
-#include "map.h"
+#include "tile_cmd.h"
 #include "landscape.h"
-#include "tile.h"
 #include "tunnel_map.h"
 #include "unmovable_map.h"
-#include "vehicle.h"
-#include "viewport.h"
-#include "command.h"
-#include "player.h"
+#include "viewport_func.h"
+#include "command_func.h"
 #include "town.h"
-#include "sound.h"
 #include "variables.h"
 #include "bridge.h"
 #include "train.h"
 #include "water_map.h"
 #include "yapf/yapf.h"
-#include "date.h"
 #include "newgrf_sound.h"
 #include "autoslope.h"
 #include "transparency.h"
+#include "tunnelbridge_map.h"
+#include "strings_func.h"
+#include "date_func.h"
+#include "functions.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "signal_func.h"
 
+#include "table/sprites.h"
+#include "table/strings.h"
 #include "table/bridge_land.h"
 
 const Bridge orig_bridge[] = {
@@ -81,17 +81,28 @@
 	}
 }
 
-#define M(x) (1 << (x))
-enum BridgeFoundation {
-	/* foundation, whole tile is leveled up --> 3 corners raised */
-	BRIDGE_FULL_LEVELED_FOUNDATION = M(SLOPE_WSE) | M(SLOPE_NWS) | M(SLOPE_ENW) | M(SLOPE_SEN),
-	/* foundation, tile is partly leveled up --> 1 corner raised */
-	BRIDGE_PARTLY_LEVELED_FOUNDATION = M(SLOPE_W) | M(SLOPE_S) | M(SLOPE_E) | M(SLOPE_N),
-	/* no foundations (X,Y direction) */
-	BRIDGE_NO_FOUNDATION = M(SLOPE_FLAT) | M(SLOPE_SW) | M(SLOPE_SE) | M(SLOPE_NW) | M(SLOPE_NE),
-	BRIDGE_HORZ_RAMP = (BRIDGE_PARTLY_LEVELED_FOUNDATION | BRIDGE_NO_FOUNDATION) & ~M(SLOPE_FLAT)
-};
-#undef M
+Foundation GetBridgeFoundation(Slope tileh, Axis axis)
+{
+	if ((tileh == SLOPE_FLAT) ||
+	    (((tileh == SLOPE_NE) || (tileh == SLOPE_SW)) && (axis == AXIS_X)) ||
+	    (((tileh == SLOPE_NW) || (tileh == SLOPE_SE)) && (axis == AXIS_Y))) return FOUNDATION_NONE;
+
+	return (HasSlopeHighestCorner(tileh) ? InclinedFoundation(axis) : FlatteningFoundation(tileh));
+}
+
+/**
+ * Determines if the track on a bridge ramp is flat or goes up/down.
+ *
+ * @param tileh Slope of the tile under the bridge head
+ * @param axis Orientation of bridge
+ * @return true iff the track is flat.
+ */
+bool HasBridgeFlatRamp(Slope tileh, Axis axis)
+{
+	ApplyFoundationToSlope(GetBridgeFoundation(tileh, axis), &tileh);
+	/* If the foundation slope is flat the bridge has a non-flat ramp and vice versa. */
+	return (tileh != SLOPE_FLAT);
+}
 
 static inline const PalSpriteID *GetBridgeSpriteTable(int index, byte table)
 {
@@ -107,42 +118,47 @@
 static inline byte GetBridgeFlags(int index) { return _bridge[index].flags;}
 
 
-/** Check the slope at the bridge ramps in three easy steps:
- * - valid slopes without foundation
- * - valid slopes with foundation
- * - rest is invalid
+/**
+ * Determines the foundation for the north bridge head, and tests if the resulting slope is valid.
+ *
+ * @param axis Axis of the bridge
+ * @param tileh Slope of the tile under the north bridge head; returns slope on top of foundation
+ * @param z TileZ corresponding to tileh, gets modified as well
+ * @return Error or cost for bridge foundation
  */
-#define M(x) (1 << (x))
-static CommandCost CheckBridgeSlopeNorth(Axis axis, Slope tileh)
+static CommandCost CheckBridgeSlopeNorth(Axis axis, Slope *tileh, uint *z)
 {
-	uint32 valid;
-
-	valid = M(SLOPE_FLAT) | (axis == AXIS_X ? M(SLOPE_NE) : M(SLOPE_NW));
-	if (HasBit(valid, tileh)) return CommandCost();
+	Foundation f = GetBridgeFoundation(*tileh, axis);
+	*z += ApplyFoundationToSlope(f, tileh);
 
-	valid =
-		BRIDGE_FULL_LEVELED_FOUNDATION | M(SLOPE_N) | M(SLOPE_STEEP_N) |
-		(axis == AXIS_X ? M(SLOPE_E) | M(SLOPE_STEEP_E) : M(SLOPE_W) | M(SLOPE_STEEP_W));
-	if (HasBit(valid, tileh)) return CommandCost(_price.terraform);
+	Slope valid_inclined = (axis == AXIS_X ? SLOPE_NE : SLOPE_NW);
+	if ((*tileh != SLOPE_FLAT) && (*tileh != valid_inclined)) return CMD_ERROR;
 
-	return CMD_ERROR;
+	if (f == FOUNDATION_NONE) return CommandCost();
+
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 }
 
-static CommandCost CheckBridgeSlopeSouth(Axis axis, Slope tileh)
+/**
+ * Determines the foundation for the south bridge head, and tests if the resulting slope is valid.
+ *
+ * @param axis Axis of the bridge
+ * @param tileh Slope of the tile under the south bridge head; returns slope on top of foundation
+ * @param z TileZ corresponding to tileh, gets modified as well
+ * @return Error or cost for bridge foundation
+ */
+static CommandCost CheckBridgeSlopeSouth(Axis axis, Slope *tileh, uint *z)
 {
-	uint32 valid;
-
-	valid = M(SLOPE_FLAT) | (axis == AXIS_X ? M(SLOPE_SW) : M(SLOPE_SE));
-	if (HasBit(valid, tileh)) return CommandCost();
+	Foundation f = GetBridgeFoundation(*tileh, axis);
+	*z += ApplyFoundationToSlope(f, tileh);
 
-	valid =
-		BRIDGE_FULL_LEVELED_FOUNDATION | M(SLOPE_S) | M(SLOPE_STEEP_S) |
-		(axis == AXIS_X ? M(SLOPE_W) | M(SLOPE_STEEP_W) : M(SLOPE_E) | M(SLOPE_STEEP_E));
-	if (HasBit(valid, tileh)) return CommandCost(_price.terraform);
+	Slope valid_inclined = (axis == AXIS_X ? SLOPE_SW : SLOPE_SE);
+	if ((*tileh != SLOPE_FLAT) && (*tileh != valid_inclined)) return CMD_ERROR;
 
-	return CMD_ERROR;
+	if (f == FOUNDATION_NONE) return CommandCost();
+
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 }
-#undef M
 
 
 uint32 GetBridgeLength(TileIndex begin, TileIndex end)
@@ -197,13 +213,11 @@
 	TileIndexDiff delta;
 	uint bridge_len;
 	Axis direction;
-	CommandCost cost, terraformcost, ret;
-	bool allow_on_slopes;
+	CommandCost cost(EXPENSES_CONSTRUCTION);
+	CommandCost ret;
 	bool replace_bridge = false;
 	uint replaced_bridge_type;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	/* unpack parameters */
 	bridge_type = GB(p2, 0, 8);
 
@@ -215,7 +229,7 @@
 		roadtypes = (RoadTypes)GB(p2, 8, 3);
 		if (!AreValidRoadTypes(roadtypes) || !HasRoadTypesAvail(_current_player, roadtypes)) return CMD_ERROR;
 	} else {
-		if (!ValParamRailtype(GB(p2, 8, 8))) return CMD_ERROR;
+		if (!ValParamRailtype((RailType)GB(p2, 8, 8))) return CMD_ERROR;
 		railtype = (RailType)GB(p2, 8, 8);
 		roadtypes = ROADTYPES_NONE;
 	}
@@ -251,22 +265,16 @@
 	tileh_start = GetTileSlope(tile_start, &z_start);
 	tileh_end = GetTileSlope(tile_end, &z_end);
 
-	if (IsSteepSlope(tileh_start)) z_start += TILE_HEIGHT;
-	if (HasBit(BRIDGE_FULL_LEVELED_FOUNDATION, tileh_start)) z_start += TILE_HEIGHT;
-
-	if (IsSteepSlope(tileh_end)) z_end += TILE_HEIGHT;
-	if (HasBit(BRIDGE_FULL_LEVELED_FOUNDATION, tileh_end)) z_end += TILE_HEIGHT;
+	CommandCost terraform_cost_north = CheckBridgeSlopeNorth(direction, &tileh_start, &z_start);
+	CommandCost terraform_cost_south = CheckBridgeSlopeSouth(direction, &tileh_end, &z_end);
 
 	if (z_start != z_end) return_cmd_error(STR_BRIDGEHEADS_NOT_SAME_HEIGHT);
 
-	allow_on_slopes = (!_is_old_ai_player
-	                   && _patches.build_on_slopes);
-
 	TransportType transport_type = railtype == INVALID_RAILTYPE ? TRANSPORT_ROAD : TRANSPORT_RAIL;
 
 	if (IsBridgeTile(tile_start) && IsBridgeTile(tile_end) &&
 			GetOtherBridgeEnd(tile_start) == tile_end &&
-			GetBridgeTransportType(tile_start) == transport_type) {
+			GetTunnelBridgeTransportType(tile_start) == transport_type) {
 		/* Replace a current bridge. */
 
 		/* If this is a railway bridge, make sure the railtypes match. */
@@ -306,15 +314,16 @@
 	} else {
 		/* Build a new bridge. */
 
+		bool allow_on_slopes = (!_is_old_ai_player && _patches.build_on_slopes);
+
 		/* Try and clear the start landscape */
 		ret = DoCommand(tile_start, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 		if (CmdFailed(ret)) return ret;
 		cost = ret;
 
-		terraformcost = CheckBridgeSlopeNorth(direction, tileh_start);
-		if (CmdFailed(terraformcost) || (terraformcost.GetCost() != 0 && !allow_on_slopes))
+		if (CmdFailed(terraform_cost_north) || (terraform_cost_north.GetCost() != 0 && !allow_on_slopes))
 			return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
-		cost.AddCost(terraformcost);
+		cost.AddCost(terraform_cost_north);
 
 		/* Try and clear the end landscape */
 		ret = DoCommand(tile_end, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
@@ -322,10 +331,9 @@
 		cost.AddCost(ret);
 
 		/* false - end tile slope check */
-		terraformcost = CheckBridgeSlopeSouth(direction, tileh_end);
-		if (CmdFailed(terraformcost) || (terraformcost.GetCost() != 0 && !allow_on_slopes))
+		if (CmdFailed(terraform_cost_south) || (terraform_cost_south.GetCost() != 0 && !allow_on_slopes))
 			return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
-		cost.AddCost(terraformcost);
+		cost.AddCost(terraform_cost_south);
 	}
 
 	if (!replace_bridge) {
@@ -365,9 +373,7 @@
 
 	delta = (direction == AXIS_X ? TileDiffXY(1, 0) : TileDiffXY(0, 1));
 	for (tile = tile_start + delta; tile != tile_end; tile += delta) {
-		uint z;
-
-		if (GetTileSlope(tile, &z) != SLOPE_FLAT && z >= z_start) return_cmd_error(STR_BRIDGE_TOO_LOW_FOR_TERRAIN);
+		if (GetTileMaxZ(tile) > z_start) return_cmd_error(STR_BRIDGE_TOO_LOW_FOR_TERRAIN);
 
 		if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile) && !replace_bridge) {
 			/* Disallow crossing bridges for the time being */
@@ -377,7 +383,7 @@
 		switch (GetTileType(tile)) {
 			case MP_WATER:
 				if (!EnsureNoVehicleOnGround(tile)) return_cmd_error(STR_980E_SHIP_IN_THE_WAY);
-				if (!IsWater(tile) && !IsCoast(tile)) goto not_valid_below;
+				if (!IsWater(tile) && !IsCoast(tile) && !IsRiver(tile)) goto not_valid_below;
 				break;
 
 			case MP_RAILWAY:
@@ -391,7 +397,7 @@
 			case MP_TUNNELBRIDGE:
 				if (IsTunnel(tile)) break;
 				if (replace_bridge) break;
-				if (direction == DiagDirToAxis(GetBridgeRampDirection(tile))) goto not_valid_below;
+				if (direction == DiagDirToAxis(GetTunnelBridgeDirection(tile))) goto not_valid_below;
 				if (z_start < GetBridgeHeight(tile)) goto not_valid_below;
 				break;
 
@@ -400,7 +406,6 @@
 				break;
 
 			case MP_CLEAR:
-				if (!replace_bridge && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
 				break;
 
 			default:
@@ -418,9 +423,9 @@
 		}
 	}
 
-	if (flags & DC_EXEC) {
+	if (flags & DC_EXEC && railtype != INVALID_RAILTYPE) {
 		Track track = AxisToTrack(direction);
-		SetSignalsOnBothDir(tile_start, track);
+		AddSideToSignalBuffer(tile_start, INVALID_DIAGDIR, _current_player);
 		YapfNotifyTrackLayoutChange(tile_start, track);
 	}
 
@@ -458,12 +463,12 @@
 	Slope end_tileh;
 	uint start_z;
 	uint end_z;
-	CommandCost cost;
+	CommandCost cost(EXPENSES_CONSTRUCTION);
 	CommandCost ret;
 
 	_build_tunnel_endtile = 0;
 	if (!HasBit(p1, 9)) {
-		if (!ValParamRailtype(p1)) return CMD_ERROR;
+		if (!ValParamRailtype((RailType)p1)) return CMD_ERROR;
 	} else {
 		const RoadTypes rts = (RoadTypes)GB(p1, 0, 3);
 		if (!AreValidRoadTypes(rts) || !HasRoadTypesAvail(_current_player, rts)) return CMD_ERROR;
@@ -550,7 +555,7 @@
 		if (GB(p1, 9, 1) == TRANSPORT_RAIL) {
 			MakeRailTunnel(start_tile, _current_player, direction,                 (RailType)GB(p1, 0, 4));
 			MakeRailTunnel(end_tile,   _current_player, ReverseDiagDir(direction), (RailType)GB(p1, 0, 4));
-			UpdateSignalsOnSegment(start_tile, direction);
+			AddSideToSignalBuffer(start_tile, INVALID_DIAGDIR, _current_player);
 			YapfNotifyTrackLayoutChange(start_tile, AxisToTrack(DiagDirToAxis(direction)));
 		} else {
 			MakeRoadTunnel(start_tile, _current_player, direction,                 (RoadTypes)GB(p1, 0, 3));
@@ -561,34 +566,6 @@
 	return cost;
 }
 
-TileIndex CheckTunnelBusy(TileIndex tile, uint *length)
-{
-	uint z = GetTileZ(tile);
-	DiagDirection dir = GetTunnelDirection(tile);
-	TileIndexDiff delta = TileOffsByDiagDir(dir);
-	uint len = 0;
-	TileIndex starttile = tile;
-	Vehicle *v;
-
-	do {
-		tile += delta;
-		len++;
-	} while (
-		!IsTunnelTile(tile) ||
-		ReverseDiagDir(GetTunnelDirection(tile)) != dir ||
-		GetTileZ(tile) != z
-	);
-
-	v = FindVehicleBetween(starttile, tile, z);
-	if (v != NULL) {
-		_error_message = v->type == VEH_TRAIN ?
-			STR_5000_TRAIN_IN_TUNNEL : STR_5001_ROAD_VEHICLE_IN_TUNNEL;
-		return INVALID_TILE;
-	}
-
-	if (length != NULL) *length = len;
-	return tile;
-}
 
 static inline bool CheckAllowRemoveTunnelBridge(TileIndex tile)
 {
@@ -605,14 +582,12 @@
 {
 	Town *t = NULL;
 	TileIndex endtile;
-	uint length;
-
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
 
 	if (!CheckAllowRemoveTunnelBridge(tile)) return CMD_ERROR;
 
-	endtile = CheckTunnelBusy(tile, &length);
-	if (endtile == INVALID_TILE) return CMD_ERROR;
+	endtile = GetOtherTunnelEnd(tile);
+
+	if (GetVehicleTunnelBridge(tile, endtile) != NULL) return CMD_ERROR;
 
 	_build_tunnel_endtile = endtile;
 
@@ -627,40 +602,37 @@
 		}
 	}
 
-	if (flags & DC_EXEC) {
-		/* We first need to request the direction before calling DoClearSquare
-		 *  else the direction is always 0.. dah!! ;) */
-		DiagDirection dir = GetTunnelDirection(tile);
-		Track track;
+	/* checks if the owner is town then decrease town rating by RATING_TUNNEL_BRIDGE_DOWN_STEP until
+	 * you have a "Poor" (0) town rating */
+	if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR) {
+		ChangeTownRating(t, RATING_TUNNEL_BRIDGE_DOWN_STEP, RATING_TUNNEL_BRIDGE_MINIMUM);
+	}
 
-		/* Adjust the town's player rating. Do this before removing the tile owner info. */
-		if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR)
-			ChangeTownRating(t, RATING_TUNNEL_BRIDGE_DOWN_STEP, RATING_TUNNEL_BRIDGE_MINIMUM);
+	if (flags & DC_EXEC) {
+		if (GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL) {
+			/* We first need to request values before calling DoClearSquare */
+			DiagDirection dir = GetTunnelBridgeDirection(tile);
+			Owner owner = GetTileOwner(tile);
 
-		DoClearSquare(tile);
-		DoClearSquare(endtile);
-		UpdateSignalsOnSegment(tile, ReverseDiagDir(dir));
-		UpdateSignalsOnSegment(endtile, dir);
-		track = AxisToTrack(DiagDirToAxis(dir));
-		YapfNotifyTrackLayoutChange(tile, track);
-		YapfNotifyTrackLayoutChange(endtile, track);
+			DoClearSquare(tile);
+			DoClearSquare(endtile);
+
+			/* cannot use INVALID_DIAGDIR for signal update because the tunnel doesn't exist anymore */
+			AddSideToSignalBuffer(tile, ReverseDiagDir(dir), owner);
+			AddSideToSignalBuffer(endtile, dir, owner);
+
+			Track track = AxisToTrack(DiagDirToAxis(dir));
+			YapfNotifyTrackLayoutChange(tile, track);
+			YapfNotifyTrackLayoutChange(endtile, track);
+		} else {
+			DoClearSquare(tile);
+			DoClearSquare(endtile);
+		}
 	}
-	return CommandCost(_price.clear_tunnel * (length + 1));
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.clear_tunnel * (DistanceManhattan(tile, endtile) + 1));
 }
 
 
-static bool IsVehicleOnBridge(TileIndex starttile, TileIndex endtile, uint z)
-{
-	const Vehicle *v;
-	FOR_ALL_VEHICLES(v) {
-		if ((v->tile == starttile || v->tile == endtile) && v->z_pos == z) {
-			_error_message = VehicleInTheWayErrMsg(v);
-			return true;
-		}
-	}
-	return false;
-}
-
 static CommandCost DoClearBridge(TileIndex tile, uint32 flags)
 {
 	DiagDirection direction;
@@ -668,20 +640,13 @@
 	TileIndex endtile;
 	Town *t = NULL;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	if (!CheckAllowRemoveTunnelBridge(tile)) return CMD_ERROR;
 
 	endtile = GetOtherBridgeEnd(tile);
-	byte bridge_height = GetBridgeHeight(tile);
 
-	if (FindVehicleOnTileZ(tile, bridge_height) != NULL ||
-			FindVehicleOnTileZ(endtile, bridge_height) != NULL ||
-			IsVehicleOnBridge(tile, endtile, bridge_height)) {
-		return CMD_ERROR;
-	}
+	if (GetVehicleTunnelBridge(tile, endtile) != NULL) return CMD_ERROR;
 
-	direction = GetBridgeRampDirection(tile);
+	direction = GetTunnelBridgeDirection(tile);
 	delta = TileOffsByDiagDir(direction);
 
 	if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR) {
@@ -695,30 +660,36 @@
 		}
 	}
 
-	if (flags & DC_EXEC) {
-		TileIndex c;
-		Track track;
+	/* checks if the owner is town then decrease town rating by RATING_TUNNEL_BRIDGE_DOWN_STEP until
+	 * you have a "Poor" (0) town rating */
+	if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR) {
+		ChangeTownRating(t, RATING_TUNNEL_BRIDGE_DOWN_STEP, RATING_TUNNEL_BRIDGE_MINIMUM);
+	}
 
-		/* checks if the owner is town then decrease town rating by RATING_TUNNEL_BRIDGE_DOWN_STEP until
-		 * you have a "Poor" (0) town rating */
-		if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR)
-			ChangeTownRating(t, RATING_TUNNEL_BRIDGE_DOWN_STEP, RATING_TUNNEL_BRIDGE_MINIMUM);
+	if (flags & DC_EXEC) {
+		/* read this value before actual removal of bridge */
+		bool rail = GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL;
+		Owner owner = GetTileOwner(tile);
 
 		DoClearSquare(tile);
 		DoClearSquare(endtile);
-		for (c = tile + delta; c != endtile; c += delta) {
-				ClearBridgeMiddle(c);
+		for (TileIndex c = tile + delta; c != endtile; c += delta) {
+			ClearBridgeMiddle(c);
 			MarkTileDirtyByTile(c);
 		}
 
-		UpdateSignalsOnSegment(tile, ReverseDiagDir(direction));
-		UpdateSignalsOnSegment(endtile, direction);
-		track = AxisToTrack(DiagDirToAxis(direction));
-		YapfNotifyTrackLayoutChange(tile, track);
-		YapfNotifyTrackLayoutChange(endtile, track);
+		if (rail) {
+			/* cannot use INVALID_DIAGDIR for signal update because the bridge doesn't exist anymore */
+			AddSideToSignalBuffer(tile, ReverseDiagDir(direction), owner);
+			AddSideToSignalBuffer(endtile, direction, owner);
+
+			Track track = AxisToTrack(DiagDirToAxis(direction));
+			YapfNotifyTrackLayoutChange(tile, track);
+			YapfNotifyTrackLayoutChange(endtile, track);
+		}
 	}
 
-	return CommandCost((DistanceManhattan(tile, endtile) + 1) * _price.clear_bridge);
+	return CommandCost(EXPENSES_CONSTRUCTION, (DistanceManhattan(tile, endtile) + 1) * _price.clear_bridge);
 }
 
 static CommandCost ClearTile_TunnelBridge(TileIndex tile, byte flags)
@@ -735,85 +706,6 @@
 }
 
 /**
- * Switches the rail type for a tunnel or a bridgehead. As the railtype
- * on the bridge are determined by the one of the bridgehead, this
- * functions converts the railtype on the entire bridge.
- * @param tile        The tile on which the railtype is to be convert.
- * @param totype      The railtype we want to convert to
- * @param exec        Switches between test and execute mode
- * @return            The cost and state of the operation
- * @retval CMD_ERROR  An error occured during the operation.
- */
-CommandCost DoConvertTunnelBridgeRail(TileIndex tile, RailType totype, bool exec)
-{
-	if (IsTunnel(tile) && GetTunnelTransportType(tile) == TRANSPORT_RAIL) {
-		uint length;
-		TileIndex endtile;
-
-		/* If not coverting rail <-> el. rail, any vehicle cannot be in tunnel */
-		if (!IsCompatibleRail(GetRailType(tile), totype)) {
-			endtile = CheckTunnelBusy(tile, &length);
-			if (endtile == INVALID_TILE) return CMD_ERROR;
-		} else {
-			endtile = GetOtherTunnelEnd(tile);
-			length = DistanceManhattan(tile, endtile);
-		}
-
-		if (exec) {
-			SetRailType(tile, totype);
-			SetRailType(endtile, totype);
-			MarkTileDirtyByTile(tile);
-			MarkTileDirtyByTile(endtile);
-
-			Track track = AxisToTrack(DiagDirToAxis(GetTunnelDirection(tile)));
-
-			YapfNotifyTrackLayoutChange(tile, track);
-			YapfNotifyTrackLayoutChange(endtile, track);
-
-			VehicleFromPos(tile, &tile, UpdateTrainPowerProc);
-			VehicleFromPos(endtile, &endtile, UpdateTrainPowerProc);
-		}
-
-		return CommandCost((length + 1) * (RailBuildCost(totype) / 2));
-	} else if (IsBridge(tile) && GetBridgeTransportType(tile) == TRANSPORT_RAIL) {
-		TileIndex endtile = GetOtherBridgeEnd(tile);
-		byte bridge_height = GetBridgeHeight(tile);
-
-		if (!IsCompatibleRail(GetRailType(tile), totype) &&
-				(FindVehicleOnTileZ(tile, bridge_height) != NULL ||
-				FindVehicleOnTileZ(endtile, bridge_height) != NULL ||
-				IsVehicleOnBridge(tile, endtile, bridge_height))) {
-			return CMD_ERROR;
-		}
-
-		if (exec) {
-			SetRailType(tile, totype);
-			SetRailType(endtile, totype);
-			MarkTileDirtyByTile(tile);
-			MarkTileDirtyByTile(endtile);
-
-			Track track = AxisToTrack(DiagDirToAxis(GetBridgeRampDirection(tile)));
-			TileIndexDiff delta = TileOffsByDiagDir(GetBridgeRampDirection(tile));
-
-			YapfNotifyTrackLayoutChange(tile, track);
-			YapfNotifyTrackLayoutChange(endtile, track);
-
-			VehicleFromPos(tile, &tile, UpdateTrainPowerProc);
-			VehicleFromPos(endtile, &endtile, UpdateTrainPowerProc);
-
-			for (tile += delta; tile != endtile; tile += delta) {
-				MarkTileDirtyByTile(tile); // TODO encapsulate this into a function
-			}
-		}
-
-		return CommandCost((DistanceManhattan(tile, endtile) + 1) * (RailBuildCost(totype) / 2));
-	} else {
-		return CMD_ERROR;
-	}
-}
-
-
-/**
  * Draws the pillars under high bridges.
  *
  * @param psid Image and palette of a bridge pillar.
@@ -871,13 +763,6 @@
 	}
 }
 
-Foundation GetBridgeFoundation(Slope tileh, Axis axis)
-{
-	if (HasBit(BRIDGE_NO_FOUNDATION, tileh)) return FOUNDATION_NONE;
-	if (HasBit(BRIDGE_FULL_LEVELED_FOUNDATION, tileh)) return FlatteningFoundation(tileh);
-	return InclinedFoundation(axis);
-}
-
 /**
  * Draws the trambits over an already drawn (lower end) of a bridge.
  * @param x       the x of the bridge
@@ -946,22 +831,22 @@
 			{  1,  0, -15, -14,  0, 15, 16,  1, 0, 1, 16, 15 }, // SW
 			{  0,  1, -14, -15, 15,  0,  1, 16, 1, 0, 15, 16 }, // NW
 		};
-		const int *BB_data = _tunnel_BB[GetTunnelDirection(ti->tile)];
+		const int *BB_data = _tunnel_BB[GetTunnelBridgeDirection(ti->tile)];
 
 		bool catenary = false;
 
-		if (GetTunnelTransportType(ti->tile) == TRANSPORT_RAIL) {
+		if (GetTunnelBridgeTransportType(ti->tile) == TRANSPORT_RAIL) {
 			image = GetRailTypeInfo(GetRailType(ti->tile))->base_sprites.tunnel;
 		} else {
 			image = SPR_TUNNEL_ENTRY_REAR_ROAD;
 		}
 
-		if (HasTunnelSnowOrDesert(ti->tile)) image += 32;
+		if (HasTunnelBridgeSnowOrDesert(ti->tile)) image += 32;
 
-		image += GetTunnelDirection(ti->tile) * 2;
+		image += GetTunnelBridgeDirection(ti->tile) * 2;
 		DrawGroundSprite(image, PAL_NONE);
-		if (GetTunnelTransportType(ti->tile) == TRANSPORT_ROAD) {
-			DiagDirection dir = GetTunnelDirection(ti->tile);
+		if (GetTunnelBridgeTransportType(ti->tile) == TRANSPORT_ROAD) {
+			DiagDirection dir = GetTunnelBridgeDirection(ti->tile);
 			RoadTypes rts = GetRoadTypes(ti->tile);
 
 			if (HasBit(rts, ROADTYPE_TRAM)) {
@@ -993,9 +878,9 @@
 	} else if (IsBridge(ti->tile)) { // XXX is this necessary?
 		const PalSpriteID *psid;
 		int base_offset;
-		bool ice = HasBridgeSnowOrDesert(ti->tile);
+		bool ice = HasTunnelBridgeSnowOrDesert(ti->tile);
 
-		if (GetBridgeTransportType(ti->tile) == TRANSPORT_RAIL) {
+		if (GetTunnelBridgeTransportType(ti->tile) == TRANSPORT_RAIL) {
 			base_offset = GetRailTypeInfo(GetRailType(ti->tile))->bridge_offset;
 			assert(base_offset != 8); // This one is used for roads
 		} else {
@@ -1005,10 +890,10 @@
 		/* as the lower 3 bits are used for other stuff, make sure they are clear */
 		assert( (base_offset & 0x07) == 0x00);
 
-		DrawFoundation(ti, GetBridgeFoundation(ti->tileh, DiagDirToAxis(GetBridgeRampDirection(ti->tile))));
+		DrawFoundation(ti, GetBridgeFoundation(ti->tileh, DiagDirToAxis(GetTunnelBridgeDirection(ti->tile))));
 
 		/* HACK Wizardry to convert the bridge ramp direction into a sprite offset */
-		base_offset += (6 - GetBridgeRampDirection(ti->tile)) % 4;
+		base_offset += (6 - GetTunnelBridgeDirection(ti->tile)) % 4;
 
 		if (ti->tileh == SLOPE_FLAT) base_offset += 4; // sloped bridge head
 
@@ -1024,7 +909,7 @@
 		/* draw ramp */
 
 		/* Draw Trambits as SpriteCombine */
-		if (GetBridgeTransportType(ti->tile) == TRANSPORT_ROAD) StartSpriteCombine();
+		if (GetTunnelBridgeTransportType(ti->tile) == TRANSPORT_ROAD) StartSpriteCombine();
 
 		/* HACK set the height of the BB of a sloped ramp to 1 so a vehicle on
 		 * it doesn't disappear behind it
@@ -1033,11 +918,11 @@
 			psid->sprite, psid->pal, ti->x, ti->y, 16, 16, ti->tileh == SLOPE_FLAT ? 0 : 8, ti->z, IsTransparencySet(TO_BRIDGES)
 		);
 
-		if (GetBridgeTransportType(ti->tile) == TRANSPORT_ROAD) {
+		if (GetTunnelBridgeTransportType(ti->tile) == TRANSPORT_ROAD) {
 			RoadTypes rts = GetRoadTypes(ti->tile);
 
 			if (HasBit(rts, ROADTYPE_TRAM)) {
-				uint offset = GetBridgeRampDirection(ti->tile);
+				uint offset = GetTunnelBridgeDirection(ti->tile);
 				uint z = ti->z;
 				if (ti->tileh != SLOPE_FLAT) {
 					offset = (offset + 1) & 1;
@@ -1136,7 +1021,7 @@
 	);
 	type = GetBridgeType(rampsouth);
 
-	if (GetBridgeTransportType(rampsouth) == TRANSPORT_RAIL) {
+	if (GetTunnelBridgeTransportType(rampsouth) == TRANSPORT_RAIL) {
 		base_offset = GetRailTypeInfo(GetRailType(rampsouth))->bridge_offset;
 	} else {
 		base_offset = 8;
@@ -1154,7 +1039,7 @@
 	AddSortableSpriteToDraw(SPR_EMPTY_BOUNDING_BOX, PAL_NONE, x, y, 16, 16, 1, bridge_z - TILE_HEIGHT + BB_Z_SEPARATOR);
 
 	/* Draw Trambits as SpriteCombine */
-	if (GetBridgeTransportType(rampsouth) == TRANSPORT_ROAD) StartSpriteCombine();
+	if (GetTunnelBridgeTransportType(rampsouth) == TRANSPORT_ROAD) StartSpriteCombine();
 
 	/* Draw floor and far part of bridge*/
 	if (axis == AXIS_X) {
@@ -1165,7 +1050,7 @@
 
 	psid++;
 
-	if (GetBridgeTransportType(rampsouth) == TRANSPORT_ROAD) {
+	if (GetTunnelBridgeTransportType(rampsouth) == TRANSPORT_ROAD) {
 		RoadTypes rts = GetRoadTypes(rampsouth);
 
 		if (HasBit(rts, ROADTYPE_TRAM)) {
@@ -1189,7 +1074,7 @@
 	}
 
 	/* Draw TramFront as SpriteCombine */
-	if (GetBridgeTransportType(rampsouth) == TRANSPORT_ROAD) EndSpriteCombine();
+	if (GetTunnelBridgeTransportType(rampsouth) == TRANSPORT_ROAD) EndSpriteCombine();
 
 	psid++;
 	if (ti->z + 5 == z) {
@@ -1220,12 +1105,12 @@
 	y &= 0xF;
 
 	if (IsTunnel(tile)) {
-		uint pos = (DiagDirToAxis(GetTunnelDirection(tile)) == AXIS_X ? y : x);
+		uint pos = (DiagDirToAxis(GetTunnelBridgeDirection(tile)) == AXIS_X ? y : x);
 
 		/* In the tunnel entrance? */
 		if (5 <= pos && pos <= 10) return z;
 	} else {
-		DiagDirection dir = GetBridgeRampDirection(tile);
+		DiagDirection dir = GetTunnelBridgeDirection(tile);
 		uint pos = (DiagDirToAxis(dir) == AXIS_X ? y : x);
 
 		z += ApplyFoundationToSlope(GetBridgeFoundation(tileh, DiagDirToAxis(dir)), &tileh);
@@ -1234,7 +1119,7 @@
 		if (5 <= pos && pos <= 10) {
 			uint delta;
 
-			if (HasBit(BRIDGE_HORZ_RAMP, tileh)) return z + TILE_HEIGHT;
+			if (tileh != SLOPE_FLAT) return z + TILE_HEIGHT;
 
 			switch (dir) {
 				default: NOT_REACHED();
@@ -1252,7 +1137,7 @@
 
 static Foundation GetFoundation_TunnelBridge(TileIndex tile, Slope tileh)
 {
-	return IsTunnel(tile) ? FOUNDATION_NONE : GetBridgeFoundation(tileh, DiagDirToAxis(GetBridgeRampDirection(tile)));
+	return IsTunnel(tile) ? FOUNDATION_NONE : GetBridgeFoundation(tileh, DiagDirToAxis(GetTunnelBridgeDirection(tile)));
 }
 
 
@@ -1296,10 +1181,10 @@
 static void GetTileDesc_TunnelBridge(TileIndex tile, TileDesc *td)
 {
 	if (IsTunnel(tile)) {
-		td->str = (GetTunnelTransportType(tile) == TRANSPORT_RAIL) ?
+		td->str = (GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL) ?
 			STR_5017_RAILROAD_TUNNEL : STR_5018_ROAD_TUNNEL;
 	} else {
-		td->str = _bridge_tile_str[GetBridgeTransportType(tile) << 4 | GetBridgeType(tile)];
+		td->str = _bridge_tile_str[GetTunnelBridgeTransportType(tile) << 4 | GetBridgeType(tile)];
 	}
 	td->owner = GetTileOwner(tile);
 }
@@ -1312,29 +1197,24 @@
 
 static void TileLoop_TunnelBridge(TileIndex tile)
 {
-	bool snow_or_desert = IsTunnelTile(tile) ? HasTunnelSnowOrDesert(tile) : HasBridgeSnowOrDesert(tile);
+	bool snow_or_desert = HasTunnelBridgeSnowOrDesert(tile);
 	switch (_opt.landscape) {
 		case LT_ARCTIC:
 			if (snow_or_desert != (GetTileZ(tile) > GetSnowLine())) {
-				if (IsTunnelTile(tile)) {
-					SetTunnelSnowOrDesert(tile, !snow_or_desert);
-				} else {
-					SetBridgeSnowOrDesert(tile, !snow_or_desert);
-				}
+				SetTunnelBridgeSnowOrDesert(tile, !snow_or_desert);
 				MarkTileDirtyByTile(tile);
 			}
 			break;
 
 		case LT_TROPIC:
 			if (GetTropicZone(tile) == TROPICZONE_DESERT && !snow_or_desert) {
-				if (IsTunnelTile(tile)) {
-					SetTunnelSnowOrDesert(tile, true);
-				} else {
-					SetBridgeSnowOrDesert(tile, true);
-				}
+				SetTunnelBridgeSnowOrDesert(tile, true);
 				MarkTileDirtyByTile(tile);
 			}
 			break;
+
+		default:
+			break;
 	}
 }
 
@@ -1346,15 +1226,9 @@
 
 static uint32 GetTileTrackStatus_TunnelBridge(TileIndex tile, TransportType mode, uint sub_mode)
 {
-	if (IsTunnel(tile)) {
-		if (GetTunnelTransportType(tile) != mode) return 0;
-		if (GetTunnelTransportType(tile) == TRANSPORT_ROAD && (GetRoadTypes(tile) & sub_mode) == 0) return 0;
-		return AxisToTrackBits(DiagDirToAxis(GetTunnelDirection(tile))) * 0x101;
-	} else {
-		if (GetBridgeTransportType(tile) != mode) return 0;
-		if (GetBridgeTransportType(tile) == TRANSPORT_ROAD && (GetRoadTypes(tile) & sub_mode) == 0) return 0;
-		return AxisToTrackBits(DiagDirToAxis(GetBridgeRampDirection(tile))) * 0x101;
-	}
+	if (GetTunnelBridgeTransportType(tile) != mode) return 0;
+	if (GetTunnelBridgeTransportType(tile) == TRANSPORT_ROAD && (GetRoadTypes(tile) & sub_mode) == 0) return 0;
+	return AxisToTrackBits(DiagDirToAxis(GetTunnelBridgeDirection(tile))) * 0x101;
 }
 
 static void ChangeTileOwner_TunnelBridge(TileIndex tile, PlayerID old_player, PlayerID new_player)
@@ -1369,7 +1243,7 @@
 			 * the bridge/tunnel. As all *our* vehicles are already removed, they
 			 * must be of another owner. Therefor this must be a road bridge/tunnel.
 			 * In that case we can safely reassign the ownership to OWNER_NONE. */
-			assert((IsTunnel(tile) ? GetTunnelTransportType(tile) : GetBridgeTransportType(tile)) == TRANSPORT_ROAD);
+			assert(GetTunnelBridgeTransportType(tile) == TRANSPORT_ROAD);
 			SetTileOwner(tile, OWNER_NONE);
 		}
 	}
@@ -1392,7 +1266,7 @@
 static const byte _tunnel_fractcoord_6[4]    = {0x92, 0x89, 0x56, 0x45};
 static const byte _tunnel_fractcoord_7[4]    = {0x52, 0x85, 0x96, 0x49};
 
-static uint32 VehicleEnter_TunnelBridge(Vehicle *v, TileIndex tile, int x, int y)
+static VehicleEnterTileStatus VehicleEnter_TunnelBridge(Vehicle *v, TileIndex tile, int x, int y)
 {
 	int z = GetSlopeZ(x, y) - v->z_pos;
 
@@ -1406,7 +1280,7 @@
 		if (v->type == VEH_TRAIN) {
 			fc = (x & 0xF) + (y << 4);
 
-			dir = GetTunnelDirection(tile);
+			dir = GetTunnelBridgeDirection(tile);
 			vdir = DirToDiagDir(v->direction);
 
 			if (v->u.rail.track != TRACK_BIT_WORMHOLE && dir == vdir) {
@@ -1434,7 +1308,7 @@
 			}
 		} else if (v->type == VEH_ROAD) {
 			fc = (x & 0xF) + (y << 4);
-			dir = GetTunnelDirection(tile);
+			dir = GetTunnelBridgeDirection(tile);
 			vdir = DirToDiagDir(v->direction);
 
 			/* Enter tunnel? */
@@ -1474,7 +1348,7 @@
 			if (v->cur_speed > spd) v->cur_speed = spd;
 		}
 
-		dir = GetBridgeRampDirection(tile);
+		dir = GetTunnelBridgeDirection(tile);
 		if (DirToDiagDir(v->direction) == dir) {
 			switch (dir) {
 				default: NOT_REACHED();
@@ -1514,27 +1388,23 @@
 static CommandCost TerraformTile_TunnelBridge(TileIndex tile, uint32 flags, uint z_new, Slope tileh_new)
 {
 	if (_patches.build_on_slopes && AutoslopeEnabled() && IsBridge(tile)) {
-		DiagDirection direction = GetBridgeRampDirection(tile);
+		DiagDirection direction = GetTunnelBridgeDirection(tile);
 		Axis axis = DiagDirToAxis(direction);
 		CommandCost res;
+		uint z_old;
+		Slope tileh_old = GetTileSlope(tile, &z_old);
 
 		/* Check if new slope is valid for bridges in general (so we can savely call GetBridgeFoundation()) */
 		if ((direction == DIAGDIR_NW) || (direction == DIAGDIR_NE)) {
-			res = CheckBridgeSlopeSouth(axis, tileh_new);
+			CheckBridgeSlopeSouth(axis, &tileh_old, &z_old);
+			res = CheckBridgeSlopeSouth(axis, &tileh_new, &z_new);
 		} else {
-			res = CheckBridgeSlopeNorth(axis, tileh_new);
+			CheckBridgeSlopeNorth(axis, &tileh_old, &z_old);
+			res = CheckBridgeSlopeNorth(axis, &tileh_new, &z_new);
 		}
 
-		if (!CmdFailed(res)) {
-			uint z_old;
-			Slope tileh_old = GetTileSlope(tile, &z_old);
-
-			z_old += ApplyFoundationToSlope(GetBridgeFoundation(tileh_old, axis), &tileh_old);
-			z_new += ApplyFoundationToSlope(GetBridgeFoundation(tileh_new, axis), &tileh_new);
-
-			/* Surface slope remains unchanged? */
-			if ((z_old == z_new) && (tileh_old == tileh_new)) return _price.terraform;
-		}
+		/* Surface slope is valid and remains unchanged? */
+		if (!CmdFailed(res) && (z_old == z_new) && (tileh_old == tileh_new)) return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 	}
 
 	return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/tunnelbridge_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,80 @@
+/* $Id$ */
+
+/** @file tunnelbridge_map.h Functions that have tunnels and bridges in common */
+
+#ifndef TUNNELBRIDGE_MAP_H
+#define TUNNELBRIDGE_MAP_H
+
+#include "direction_func.h"
+#include "core/bitmath_func.hpp"
+#include "tile_map.h"
+#include "bridge_map.h"
+#include "tunnel_map.h"
+
+
+/**
+ * Tunnel: Get the direction facing out of the tunnel
+ * Bridge: Get the direction pointing onto the bridge
+ * @param t The tile to analyze
+ * @pre IsTileType(t, MP_TUNNELBRIDGE)
+ * @return the above mentionned direction
+ */
+static inline DiagDirection GetTunnelBridgeDirection(TileIndex t)
+{
+	assert(IsTileType(t, MP_TUNNELBRIDGE));
+	return (DiagDirection)GB(_m[t].m5, 0, 2);
+}
+
+/**
+ * Tunnel: Get the transport type of the tunnel (road or rail)
+ * Bridge: Get the transport type of the bridge's ramp
+ * @param t The tile to analyze
+ * @pre IsTileType(t, MP_TUNNELBRIDGE)
+ * @return the transport type in the tunnel/bridge
+ */
+static inline TransportType GetTunnelBridgeTransportType(TileIndex t)
+{
+	assert(IsTileType(t, MP_TUNNELBRIDGE));
+	return (TransportType)GB(_m[t].m5, 2, 2);
+}
+
+/**
+ * Tunnel: Is this tunnel entrance in a snowy or desert area?
+ * Bridge: Does the bridge ramp lie in a snow or desert area?
+ * @param t The tile to analyze
+ * @pre IsTileType(t, MP_TUNNELBRIDGE)
+ * @return true if and only if the tile is in a snowy/desert area
+ */
+static inline bool HasTunnelBridgeSnowOrDesert(TileIndex t)
+{
+	assert(IsTileType(t, MP_TUNNELBRIDGE));
+	return HasBit(_m[t].m4, 7);
+}
+
+/**
+ * Tunnel: Places this tunnel entrance in a snowy or desert area, or takes it out of there.
+ * Bridge: Sets whether the bridge ramp lies in a snow or desert area.
+ * @param t the tunnel entrance / bridge ramp tile
+ * @param snow_or_desert is the entrance/ramp in snow or desert (true), when
+ *                       not in snow and not in desert false
+ * @pre IsTileType(t, MP_TUNNELBRIDGE)
+ */
+static inline void SetTunnelBridgeSnowOrDesert(TileIndex t, bool snow_or_desert)
+{
+	assert(IsTileType(t, MP_TUNNELBRIDGE));
+	SB(_m[t].m4, 7, 1, snow_or_desert);
+}
+
+/**
+ * Determines type of the wormhole and returns its other end
+ * @param t one end
+ * @pre IsTileType(t, MP_TUNNELBRIDGE)
+ * @return other end
+ */
+static inline TileIndex GetOtherTunnelBridgeEnd(TileIndex t)
+{
+	assert(IsTileType(t, MP_TUNNELBRIDGE));
+	return IsTunnel(t) ? GetOtherTunnelEnd(t) : GetOtherBridgeEnd(t);
+}
+
+#endif /* TUNNELBRIDGE_MAP_H */
--- a/src/unix.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/unix.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,11 +4,12 @@
 
 #include "stdafx.h"
 #include "openttd.h"
+#include "variables.h"
+#include "textbuf_gui.h"
 #include "functions.h"
-#include "window.h"
-#include "string.h"
+#include "core/random_func.hpp"
+
 #include "table/strings.h"
-#include "variables.h"
 
 #include <dirent.h>
 #include <unistd.h>
@@ -203,6 +204,7 @@
 #include <iconv.h>
 #include <errno.h>
 #include "debug.h"
+#include "string_func.h"
 
 #define INTERNALCODE "UTF-8"
 
--- a/src/unmovable_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/unmovable_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,28 +4,31 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "table/strings.h"
-#include "table/sprites.h"
-#include "functions.h"
+#include "tile_cmd.h"
 #include "landscape.h"
-#include "map.h"
-#include "tile.h"
-#include "command.h"
-#include "viewport.h"
-#include "player.h"
+#include "command_func.h"
+#include "viewport_func.h"
+#include "player_func.h"
+#include "player_base.h"
 #include "gui.h"
 #include "station.h"
-#include "economy.h"
 #include "town.h"
 #include "sprite.h"
 #include "bridge_map.h"
 #include "unmovable_map.h"
 #include "variables.h"
-#include "table/unmovable_land.h"
 #include "genworld.h"
 #include "bridge.h"
 #include "autoslope.h"
 #include "transparency.h"
+#include "functions.h"
+#include "window_func.h"
+#include "vehicle_func.h"
+#include "player_gui.h"
+
+#include "table/strings.h"
+#include "table/sprites.h"
+#include "table/unmovable_land.h"
 
 /** Destroy a HQ.
  * During normal gameplay you can only implicitely destroy a HQ when you are
@@ -38,8 +41,6 @@
 {
 	Player* p = GetPlayer(pid);
 
-	SET_EXPENSES_TYPE(EXPENSES_PROPERTY);
-
 	if (flags & DC_EXEC) {
 		TileIndex t = p->location_of_house;
 
@@ -52,7 +53,7 @@
 	}
 
 	/* cost of relocating company is 1% of company value */
-	return CommandCost(CalculateCompanyValue(p) / 100);
+	return CommandCost(EXPENSES_PROPERTY, CalculateCompanyValue(p) / 100);
 }
 
 void UpdateCompanyHQ(Player *p, uint score)
@@ -87,9 +88,7 @@
 CommandCost CmdBuildCompanyHQ(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	Player *p = GetPlayer(_current_player);
-	CommandCost cost;
-
-	SET_EXPENSES_TYPE(EXPENSES_PROPERTY);
+	CommandCost cost(EXPENSES_PROPERTY);
 
 	cost = CheckFlatLandBelow(tile, 2, 2, flags, 0, NULL);
 	if (CmdFailed(cost)) return cost;
@@ -112,6 +111,54 @@
 	return cost;
 }
 
+/** Purchase a land area. Actually you only purchase one tile, so
+ * the name is a bit confusing ;p
+ * @param tile the tile the player is purchasing
+ * @param flags for this command type
+ * @param p1 unused
+ * @param p2 unused
+ * @return error of cost of operation
+ */
+CommandCost CmdPurchaseLandArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+{
+	CommandCost cost(EXPENSES_CONSTRUCTION);
+
+	if (IsOwnedLandTile(tile) && IsTileOwner(tile, _current_player)) {
+		return_cmd_error(STR_5807_YOU_ALREADY_OWN_IT);
+	}
+
+	cost = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
+	if (CmdFailed(cost)) return CMD_ERROR;
+
+	if (flags & DC_EXEC) {
+		MakeOwnedLand(tile, _current_player);
+		MarkTileDirtyByTile(tile);
+	}
+
+	return cost.AddCost(_price.clear_roughland * 10);
+}
+
+/** Sell a land area. Actually you only sell one tile, so
+ * the name is a bit confusing ;p
+ * @param tile the tile the player is selling
+ * @param flags for this command type
+ * @param p1 unused
+ * @param p2 unused
+ * @return error or cost of operation
+ */
+CommandCost CmdSellLandArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+{
+	if (!IsOwnedLandTile(tile)) return CMD_ERROR;
+	if (!CheckTileOwnership(tile) && _current_player != OWNER_WATER) return CMD_ERROR;
+
+
+	if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
+
+	if (flags & DC_EXEC) DoClearSquare(tile);
+
+	return CommandCost(EXPENSES_CONSTRUCTION,- _price.clear_roughland * 2);
+}
+
 static Foundation GetFoundation_Unmovable(TileIndex tile, Slope tileh);
 
 static void DrawTile_Unmovable(TileInfo *ti)
@@ -411,7 +458,7 @@
 	if (IsOwnedLand(tile) && CheckTileOwnership(tile)) return CommandCost();
 
 	if (AutoslopeEnabled() && (IsStatue(tile) || IsCompanyHQ(tile))) {
-		if (!IsSteepSlope(tileh_new) && (z_new + GetSlopeMaxZ(tileh_new) == GetTileMaxZ(tile))) return _price.terraform;
+		if (!IsSteepSlope(tileh_new) && (z_new + GetSlopeMaxZ(tileh_new) == GetTileMaxZ(tile))) return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
 	}
 
 	return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
--- a/src/unmovable_map.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/unmovable_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,9 @@
 #ifndef UNMOVABLE_MAP_H
 #define UNMOVABLE_MAP_H
 
+#include "core/bitmath_func.hpp"
+#include "tile_map.h"
+
 enum {
 	HQ_NUM_TILE = 4, ///< Number of HQ tiles
 	HQ_NUM_SIZE = 5  ///< Number of stages of an HQ
--- a/src/variables.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/variables.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,47 +5,12 @@
 #ifndef VARIABLES_H
 #define VARIABLES_H
 
-#include "yapf/yapf_settings.h"
-
-/* ********* START OF SAVE REGION */
-
-#include "gfx.h"
-
-/* Prices and also the fractional part. */
-VARDEF Prices _price;
-VARDEF uint16 _price_frac[NUM_PRICES];
-
-VARDEF Money  _cargo_payment_rates[NUM_CARGO];
-VARDEF uint16 _cargo_payment_rates_frac[NUM_CARGO];
-
-struct GameOptions {
-	GameDifficulty diff;
-	byte diff_level;
-	byte currency;
-	byte units;
-	byte town_name;
-	byte landscape;
-	byte snow_line;
-	byte autosave;
-	byte road_side;
-};
-
-/* These are the options for the current game
- * either ingame, or loaded. Also used for networking games */
-VARDEF GameOptions _opt;
-
-/* These are the default options for a new game */
-VARDEF GameOptions _opt_newgame;
-
-/* Pointer to one of the two _opt OR _opt_newgame structs */
-VARDEF GameOptions *_opt_ptr;
+#include "tile_type.h"
+#include "strings_type.h"
 
 /* Amount of game ticks */
 VARDEF uint16 _tick_counter;
 
-/* This one is not used anymore. */
-VARDEF VehicleID _vehicle_id_ctr_day;
-
 /* Skip aging of cargo? */
 VARDEF byte _age_cargo_skip_counter;
 
@@ -59,8 +24,6 @@
  *  tick handler. */
 VARDEF uint16 _station_tick_ctr;
 
-VARDEF uint32 _random_seeds[2][2];
-
 /* Iterator through all towns in OnTick_Town */
 VARDEF uint32 _cur_town_ctr;
 /* Frequency iterator at the same place */
@@ -76,184 +39,6 @@
 VARDEF int _saved_scrollpos_x;
 VARDEF int _saved_scrollpos_y;
 
-/* ********* END OF SAVE REGION */
-
-struct Patches {
-	bool modified_catchment;            // different-size catchment areas
-	bool vehicle_speed;                 // show vehicle speed
-	bool build_on_slopes;               // allow building on slopes
-	bool mammoth_trains;                // allow very long trains
-	bool join_stations;                 // allow joining of train stations
-	bool full_load_any;                 // new full load calculation, any cargo must be full
-	bool improved_load;                 // improved loading algorithm
-	bool gradual_loading;               // load vehicles gradually
-	byte station_spread;                // amount a station may spread
-	bool inflation;                     // disable inflation
-	bool selectgoods;                   // only send the goods to station if a train has been there
-	bool longbridges;                   // allow 100 tile long bridges
-	bool gotodepot;                     // allow goto depot in orders
-	uint8 raw_industry_construction;    ///< Type of (raw) industry construction (none, "normal", prospecting)
-	bool multiple_industry_per_town;    // allow many industries of the same type per town
-	bool same_industry_close;           // allow same type industries to be built close to each other
-	bool lost_train_warn;               // if a train can't find its destination, show a warning
-	uint8 order_review_system;
-	bool train_income_warn;             // if train is generating little income, show a warning
-	bool status_long_date;              // always show long date in status bar
-	bool signal_side;                   // show signals on right side
-	bool show_finances;                 // show finances at end of year
-	bool new_nonstop;                   // ttdpatch compatible nonstop handling
-	bool roadveh_queue;                 // buggy road vehicle queueing
-	bool autoscroll;                    // scroll when moving mouse to the edge.
-	byte errmsg_duration;               // duration of error message
-	byte land_generator;                // the landscape generator
-	byte oil_refinery_limit;            // distance oil refineries allowed from map edge
-	byte snow_line_height;              // a number 0-15 that configured snow line height
-	byte tgen_smoothness;               // how rough is the terrain from 0-3
-	uint32 generation_seed;             // noise seed for world generation
-	byte tree_placer;                   // the tree placer algorithm
-	byte heightmap_rotation;            // rotation director for the heightmap
-	byte se_flat_world_height;          // land height a flat world gets in SE
-	bool bribe;                         // enable bribing the local authority
-	bool nonuniform_stations;           // allow nonuniform train stations
-	bool adjacent_stations;             // allow stations to be built directly adjacent to other stations
-	bool always_small_airport;          // always allow small airports
-	bool realistic_acceleration;        // realistic acceleration for trains
-	bool wagon_speed_limits;            // enable wagon speed limits
-	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
-	bool reverse_scroll;                // Right-Click-Scrolling scrolls in the opposite direction
-	bool smooth_scroll;                 ///< Smooth scroll viewports
-	bool disable_elrails;               // when true, the elrails are disabled
-	bool measure_tooltip;               // Show a permanent tooltip when dragging tools
-	byte liveries;                      // Options for displaying company liveries, 0=none, 1=self, 2=all
-	bool prefer_teamchat;               // Choose the chat message target with <ENTER>, true=all players, false=your team
-	uint8 advanced_vehicle_list;        // Use the "advanced" vehicle list
-	uint8 loading_indicators;           // Show loading indicators
-	uint8 default_rail_type;            ///< The default rail type for the rail GUI
-
-	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
-
-	bool always_build_infrastructure;   ///< Always allow building of infrastructure, even when you do not have the vehicles for it
-	UnitID max_trains;                  // max trains in game per player (these are 16bit because the unitnumber field can't hold more)
-	UnitID max_roadveh;                 // max trucks in game per player
-	UnitID max_aircraft;                // max planes in game per player
-	UnitID max_ships;                   // max ships in game per player
-
-	bool servint_ispercent;             // service intervals are in percents
-	uint16 servint_trains;              // service interval for trains
-	uint16 servint_roadveh;             // service interval for road vehicles
-	uint16 servint_aircraft;            // service interval for aircraft
-	uint16 servint_ships;               // service interval for ships
-
-	bool autorenew;
-	int16 autorenew_months;
-	int32 autorenew_money;
-
-	byte pf_maxdepth;                   // maximum recursion depth when searching for a train route for new pathfinder
-	uint16 pf_maxlength;                // maximum length when searching for a train route for new pathfinder
-
-
-	bool bridge_pillars;                // show bridge pillars for high bridges
-
-	bool ai_disable_veh_train;          // disable types for AI
-	bool ai_disable_veh_roadveh;        // disable types for AI
-	bool ai_disable_veh_aircraft;       // disable types for AI
-	bool ai_disable_veh_ship;           // disable types for AI
-	Year starting_year;                 // starting date
-	Year ending_year;                   // end of the game (just show highscore)
-	Year colored_news_year;             // when does newspaper become colored?
-
-	bool keep_all_autosave;             // name the autosave in a different way.
-	bool autosave_on_exit;              // save an autosave when you quit the game, but do not ask "Do you really want to quit?"
-	byte max_num_autosaves;             // controls how many autosavegames are made before the game starts to overwrite (names them 0 to max_num_autosaves - 1)
-	bool extra_dynamite;                // extra dynamite
-	bool road_stop_on_town_road;        // allow building of drive-through road stops on town owned roads
-
-	bool never_expire_vehicles;         // never expire vehicles
-	byte extend_vehicle_life;           // extend vehicle life by this many years
-
-	bool auto_euro;                     // automatically switch to euro in 2002
-	bool serviceathelipad;              // service helicopters at helipads automatically (no need to send to depot)
-	bool smooth_economy;                // smooth economy
-	bool allow_shares;                  // allow the buying/selling of shares
-	byte dist_local_authority;          // distance for town local authority, default 20
-
-	byte wait_oneway_signal;            // waitingtime in days before a oneway signal
-	byte wait_twoway_signal;            // waitingtime in days before a twoway signal
-
-	uint8 map_x;                        // Size of map
-	uint8 map_y;
-
-	byte drag_signals_density;          // many signals density
-	Year semaphore_build_before;        // Build semaphore signals automatically before this year
-	bool ainew_active;                  // Is the new AI active?
-	bool ai_in_multiplayer;             // Do we allow AIs in multiplayer
-
-	/*
-	 * New Path Finding
-	 */
-	bool new_pathfinding_all; /* Use the newest pathfinding algorithm for all */
-
-	/**
-	 * The maximum amount of search nodes a single NPF run should take. This
-	 * limit should make sure performance stays at acceptable levels at the cost
-	 * of not being perfect anymore. This will probably be fixed in a more
-	 * sophisticated way sometime soon
-	 */
-	uint32 npf_max_search_nodes;
-
-	uint32 npf_rail_firstred_penalty;      // The penalty for when the first signal is red (and it is not an exit or combo signal)
-	uint32 npf_rail_firstred_exit_penalty; // The penalty for when the first signal is red (and it is an exit or combo signal)
-	uint32 npf_rail_lastred_penalty;       // The penalty for when the last signal is red
-	uint32 npf_rail_station_penalty;       // The penalty for station tiles
-	uint32 npf_rail_slope_penalty;         // The penalty for sloping upwards
-	uint32 npf_rail_curve_penalty;         // The penalty for curves
-	uint32 npf_rail_depot_reverse_penalty; // The penalty for reversing in depots
-	uint32 npf_buoy_penalty;               // The penalty for going over (through) a buoy
-	uint32 npf_water_curve_penalty;        // The penalty for curves
-	uint32 npf_road_curve_penalty;         // The penalty for curves
-	uint32 npf_crossing_penalty;           // The penalty for level crossings
-	uint32 npf_road_drive_through_penalty; // The penalty for going through a drive-through road stop
-
-	bool population_in_label; // Show the population of a town in his label?
-
-	uint8 freight_trains; // Value to multiply the weight of cargo by
-
-	/** YAPF settings */
-	YapfSettings  yapf;
-
-	uint8 right_mouse_btn_emulation;
-
-	uint8 scrollwheel_scrolling;
-	uint8 scrollwheel_multiplier;
-
-	uint8 town_growth_rate;  ///< Town growth rate
-	uint8 larger_towns;      ///< The number of cities to build. These start off larger and grow twice as fast
-	uint8 initial_city_size; ///< Multiplier for the initial size of the cities compared to towns
-
-	bool pause_on_newgame;   ///< Whether to start new games paused or not.
-
-	TownLayoutByte town_layout;  ///< Select town layout
-
-	bool timetabling;        ///< Whether to allow timetabling.
-	bool timetable_in_ticks; ///< Whether to show the timetable in ticks rather than days.
-
-	bool autoslope;          ///< Allow terraforming under things.
-
-	bool mod_road_rebuild;   ///< Roadworks remove unneccesary RoadBits
-
-	bool exclusive_rights;   ///< allow buying exclusive rights
-	bool give_money;         ///< allow giving other players money
-
-	bool enable_signal_gui;  ///< Show the signal GUI when the signal button is pressed
-};
-
-VARDEF Patches _patches;
-
-
 struct Cheat {
 	bool been_used; // has this cheat been used before?
 	bool value;     // tells if the bool cheat is active or not
@@ -293,43 +78,16 @@
 
 VARDEF byte _display_opt;
 VARDEF int _caret_timer;
-VARDEF uint32 _news_display_opt;
-VARDEF bool _news_ticker_sound;
-
-VARDEF StringID _error_message;
-VARDEF Money _additional_cash_required;
 
 VARDEF bool _rightclick_emulate;
 
-VARDEF PlayerFace _player_face; ///< for player face storage in openttd.cfg
-
 /* IN/OUT parameters to commands */
-VARDEF byte _yearly_expenses_type;
-VARDEF TileIndex _terraform_err_tile;
 VARDEF TileIndex _build_tunnel_endtile;
 VARDEF bool _generating_world;
 
-/* Deals with the type of the savegame, independent of extension */
-struct SmallFiosItem {
-	int mode;             // savegame/scenario type (old, new)
-	char name[MAX_PATH];  // name
-	char title[255];      // internal name of the game
-};
-
 /* Used when switching from the intro menu. */
 VARDEF byte _switch_mode;
 VARDEF StringID _switch_mode_errorstr;
-VARDEF SmallFiosItem _file_to_saveload;
-
-
-
-VARDEF Vehicle *_place_clicked_vehicle;
-
-VARDEF char _ini_videodriver[32], _ini_musicdriver[32], _ini_sounddriver[32], _ini_blitter[32];
-
-VARDEF int _num_resolutions;
-VARDEF uint16 _resolutions[32][2];
-VARDEF uint16 _cur_resolution[2];
 
 VARDEF char _savegame_format[8];
 
@@ -337,14 +95,9 @@
 VARDEF char *_highscore_file;
 VARDEF char *_log_file;
 
-
-#define SET_EXPENSES_TYPE(x) _yearly_expenses_type = x;
-
 /* landscape.cpp */
 extern const byte _tileh_to_sprite[32];
 
-extern const TileTypeProcs * const _tile_type_procs[16];
-
 extern bool _draw_bounding_boxes;
 
 /* misc */
--- a/src/vehicle.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/vehicle.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -8,27 +8,21 @@
 #include "roadveh.h"
 #include "ship.h"
 #include "spritecache.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "functions.h"
+#include "tile_cmd.h"
 #include "landscape.h"
-#include "map.h"
-#include "tile.h"
-#include "vehicle.h"
 #include "timetable.h"
-#include "gfx.h"
-#include "viewport.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
 #include "news.h"
-#include "command.h"
+#include "command_func.h"
 #include "saveload.h"
-#include "player.h"
+#include "player_func.h"
 #include "engine.h"
-#include "sound.h"
 #include "debug.h"
 #include "vehicle_gui.h"
 #include "depot.h"
 #include "station.h"
-#include "rail.h"
+#include "rail_type.h"
 #include "train.h"
 #include "aircraft.h"
 #include "industry_map.h"
@@ -36,18 +30,36 @@
 #include "water_map.h"
 #include "network/network.h"
 #include "yapf/yapf.h"
-#include "date.h"
 #include "newgrf_callbacks.h"
 #include "newgrf_engine.h"
 #include "newgrf_sound.h"
-#include "helpers.hpp"
 #include "group.h"
-#include "economy.h"
-#include "strings.h"
+#include "order.h"
+#include "strings_func.h"
+#include "zoom_func.h"
+#include "functions.h"
+#include "date_func.h"
+#include "window_func.h"
+#include "vehicle_func.h"
+#include "signal_func.h"
+#include "sound_func.h"
+#include "variables.h"
+#include "autoreplace_func.h"
+#include "autoreplace_gui.h"
+#include "string_func.h"
+#include "settings_type.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
 
 #define INVALID_COORD (0x7fffffff)
 #define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6))
 
+VehicleID _vehicle_id_ctr_day;
+Vehicle *_place_clicked_vehicle;
+VehicleID _new_vehicle_id;
+uint16 _returned_refit_capacity;
+
 
 /* Tables used in vehicle.h to find the right command for a certain vehicle type */
 const uint32 _veh_build_proc_table[] = {
@@ -92,10 +104,10 @@
 bool VehicleNeedsService(const Vehicle *v)
 {
 	if (v->vehstatus & (VS_STOPPED | VS_CRASHED))       return false;
-	if (v->current_order.type != OT_GOTO_DEPOT || !(v->current_order.flags & OF_PART_OF_ORDERS)) { // Don't interfere with a depot visit by the order list
+	if (v->current_order.type != OT_GOTO_DEPOT || !(v->current_order.flags & OFB_PART_OF_ORDERS)) { // Don't interfere with a depot visit by the order list
 		if (_patches.gotodepot && VehicleHasDepotOrders(v)) return false;
 		if (v->current_order.type == OT_LOADING)            return false;
-		if (v->current_order.type == OT_GOTO_DEPOT && v->current_order.flags & OF_HALT_IN_DEPOT) return false;
+		if (v->current_order.type == OT_GOTO_DEPOT && v->current_order.flags & OFB_HALT_IN_DEPOT) return false;
 	}
 
 	if (_patches.no_servicing_if_no_breakdowns && _opt.diff.vehicle_breakdowns == 0) {
@@ -119,33 +131,23 @@
 
 static void *EnsureNoVehicleProcZ(Vehicle *v, void *data)
 {
-	const TileInfo *ti = (const TileInfo*)data;
-
-	if (v->tile != ti->tile || v->type == VEH_DISASTER || (v->type == VEH_AIRCRAFT && v->subtype == AIR_SHADOW)) return NULL;
-	if (v->z_pos > ti->z) return NULL;
+	byte z = *(byte*)data;
+
+	if (v->type == VEH_DISASTER || (v->type == VEH_AIRCRAFT && v->subtype == AIR_SHADOW)) return NULL;
+	if (v->z_pos > z) return NULL;
 
 	_error_message = VehicleInTheWayErrMsg(v);
 	return v;
 }
 
+Vehicle *FindVehicleOnTileZ(TileIndex tile, byte z)
+{
+	return (Vehicle*)VehicleFromPos(tile, &z, &EnsureNoVehicleProcZ);
+}
 
 bool EnsureNoVehicleOnGround(TileIndex tile)
 {
-	TileInfo ti;
-
-	ti.tile = tile;
-	ti.z = GetTileMaxZ(tile);
-	return VehicleFromPos(tile, &ti, EnsureNoVehicleProcZ) == NULL;
-}
-
-Vehicle *FindVehicleOnTileZ(TileIndex tile, byte z)
-{
-	TileInfo ti;
-
-	ti.tile = tile;
-	ti.z = z;
-
-	return (Vehicle*)VehicleFromPos(tile, &ti, EnsureNoVehicleProcZ);
+	return FindVehicleOnTileZ(tile, GetTileMaxZ(tile)) == NULL;
 }
 
 Vehicle *FindVehicleBetween(TileIndex from, TileIndex to, byte z, bool without_crashed)
@@ -174,6 +176,30 @@
 }
 
 
+/** Procedure called for every vehicle found in tunnel/bridge in the hash map */
+static void *GetVehicleTunnelBridgeProc(Vehicle *v, void *data)
+{
+	if (v->type != VEH_TRAIN && v->type != VEH_ROAD) return NULL;
+
+	_error_message = VehicleInTheWayErrMsg(v);
+	return v;
+}
+
+/**
+ * Finds vehicle in tunnel / bridge
+ * @param tile first end
+ * @param endtile second end
+ * @return pointer to vehicle found
+ */
+Vehicle *GetVehicleTunnelBridge(TileIndex tile, TileIndex endtile)
+{
+	Vehicle *v = (Vehicle*)VehicleFromPos(tile, NULL, &GetVehicleTunnelBridgeProc);
+	if (v != NULL) return v;
+
+	return (Vehicle*)VehicleFromPos(endtile, NULL, &GetVehicleTunnelBridgeProc);
+}
+
+
 static void UpdateVehiclePosHash(Vehicle* v, int x, int y);
 
 void VehiclePositionChanged(Vehicle *v)
@@ -194,7 +220,7 @@
 }
 
 /** Called after load to update coordinates */
-void AfterLoadVehicles()
+void AfterLoadVehicles(bool clear_te_id)
 {
 	Vehicle *v;
 
@@ -204,7 +230,7 @@
 
 		v->UpdateDeltaXY(v->direction);
 
-		v->fill_percent_te_id = INVALID_TE_ID;
+		if (clear_te_id) v->fill_percent_te_id = INVALID_TE_ID;
 		v->first = NULL;
 		if (v->type == VEH_TRAIN) v->u.rail.first_engine = INVALID_ENGINE;
 		if (v->type == VEH_ROAD)  v->u.road.first_engine = INVALID_ENGINE;
@@ -537,16 +563,16 @@
 		delete this->Next();
 	}
 
-	Window *w = FindWindowById(WC_VEHICLE_VIEW, this->index);
-	if (w != NULL && WP(w, vp_d).follow_vehicle == this->index) {
-		ScrollMainWindowTo(this->x_pos, this->y_pos); // lock the main view on the vehicle's last position
+	Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
+	if (WP(w, vp_d).follow_vehicle == this->index) {
+		ScrollMainWindowTo(this->x_pos, this->y_pos, true); // lock the main view on the vehicle's last position
 		WP(w, vp_d).follow_vehicle = INVALID_VEHICLE;
 	}
 }
 
 Vehicle::~Vehicle()
 {
-	DeleteName(this->string_id);
+	free(this->name);
 
 	if (CleaningPool()) return;
 
@@ -570,6 +596,9 @@
 
 	do {
 		Vehicle *u = v;
+		/* sometimes, eg. for disaster vehicles, when company bankrupts, when removing crashed/flooded vehicles,
+		 * it may happen that vehicle chain is deleted when visible */
+		if (!(v->vehstatus & VS_HIDDEN)) MarkSingleVehicleDirty(v);
 		v = v->Next();
 		delete u;
 	} while (v != NULL);
@@ -584,7 +613,7 @@
 void VehicleEnteredDepotThisTick(Vehicle *v)
 {
 	/* we need to set v->leave_depot_instantly as we have no control of it's contents at this time */
-	if (HasBit(v->current_order.flags, OFB_HALT_IN_DEPOT) && !HasBit(v->current_order.flags, OFB_PART_OF_ORDERS) && v->current_order.type == OT_GOTO_DEPOT) {
+	if (HasBit(v->current_order.flags, OF_HALT_IN_DEPOT) && !HasBit(v->current_order.flags, OF_PART_OF_ORDERS) && v->current_order.type == OT_GOTO_DEPOT) {
 		/* we keep the vehicle in the depot since the user ordered it to stay */
 		v->leave_depot_instantly = false;
 	} else {
@@ -678,19 +707,33 @@
 */
 CommandCost GetRefitCost(EngineID engine_type)
 {
-	CommandCost base_cost;
-
+	Money base_cost;
+	ExpensesType expense_type;
 	switch (GetEngine(engine_type)->type) {
-		case VEH_SHIP: base_cost.AddCost(_price.ship_base); break;
-		case VEH_ROAD: base_cost.AddCost(_price.roadveh_base); break;
-		case VEH_AIRCRAFT: base_cost.AddCost(_price.aircraft_base); break;
+		case VEH_SHIP:
+			base_cost = _price.ship_base;
+			expense_type = EXPENSES_SHIP_RUN;
+			break;
+
+		case VEH_ROAD:
+			base_cost = _price.roadveh_base;
+			expense_type = EXPENSES_ROADVEH_RUN;
+			break;
+
+		case VEH_AIRCRAFT:
+			base_cost = _price.aircraft_base;
+			expense_type = EXPENSES_AIRCRAFT_RUN;
+			break;
+
 		case VEH_TRAIN:
-			base_cost.AddCost(2 * ((RailVehInfo(engine_type)->railveh_type == RAILVEH_WAGON) ?
-							 _price.build_railwagon : _price.build_railvehicle));
+			base_cost = 2 * ((RailVehInfo(engine_type)->railveh_type == RAILVEH_WAGON) ?
+							 _price.build_railwagon : _price.build_railvehicle);
+			expense_type = EXPENSES_TRAIN_RUN;
 			break;
-		default: NOT_REACHED(); break;
+
+		default: NOT_REACHED();
 	}
-	return CommandCost((EngInfo(engine_type)->refit_cost * base_cost.GetCost()) >> 10);
+	return CommandCost(expense_type, (EngInfo(engine_type)->refit_cost * base_cost) >> 10);
 }
 
 static void DoDrawVehicle(const Vehicle *v)
@@ -1584,7 +1627,7 @@
 	uint16 wagon_list_length = 0;
 	uint16 wagon_count = 0;
 
-	CommandCost cost;
+	CommandCost cost(EXPENSES_NEW_VEHICLES);
 	uint i, sell_command, total_number_vehicles;
 	VehicleType vehicle_type = (VehicleType)GB(p1, 0, 8);
 
@@ -1669,7 +1712,6 @@
 			 * Because of this, we can't estimate costs due to wagon removal and we will have to always return 0 and pay manually
 			 * Since we pay after each vehicle is replaced and MaybeReplaceVehicle() check if the player got enough money
 			 * we should never reach a condition where the player will end up with negative money from doing this */
-			SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 			SubtractMoneyFromPlayer(ret);
 		}
 	}
@@ -1698,7 +1740,7 @@
 {
 	Vehicle *v_front, *v;
 	Vehicle *w_front, *w, *w_rear;
-	CommandCost cost, total_cost;
+	CommandCost cost, total_cost(EXPENSES_NEW_VEHICLES);
 	uint32 build_argument = 2;
 
 	if (!IsValidVehicleID(p1)) return CMD_ERROR;
@@ -1852,9 +1894,6 @@
 		return CMD_ERROR;
 	}
 
-	/* Set the expense type last as refitting will make the cost go towards
-	 * running costs... */
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 	return total_cost;
 }
 
@@ -2115,7 +2154,7 @@
 		max += v->cargo_cap;
 		if (v->cargo_cap != 0) {
 			unloading += HasBit(v->vehicle_flags, VF_CARGO_UNLOADING) ? 1 : 0;
-			loading |= (u->current_order.flags & OF_UNLOAD) == 0 && st->goods[v->cargo_type].days_since_pickup != 255;
+			loading |= (u->current_order.flags & OFB_UNLOAD) == 0 && st->goods[v->cargo_type].days_since_pickup != 255;
 			cars++;
 		}
 	}
@@ -2137,7 +2176,7 @@
 		case VEH_TRAIN:
 			InvalidateWindowClasses(WC_TRAINS_LIST);
 			if (!IsFrontEngine(v)) v = v->First();
-			UpdateSignalsOnSegment(v->tile, GetRailDepotDirection(v->tile));
+			UpdateSignalsOnSegment(v->tile, INVALID_DIAGDIR, v->owner);
 			v->load_unload_time_rem = 0;
 			break;
 
@@ -2201,11 +2240,11 @@
 			}
 		}
 
-		if (HasBit(t.flags, OFB_PART_OF_ORDERS)) {
+		if (HasBit(t.flags, OF_PART_OF_ORDERS)) {
 			/* Part of orders */
 			UpdateVehicleTimetable(v, true);
 			v->cur_order_index++;
-		} else if (HasBit(t.flags, OFB_HALT_IN_DEPOT)) {
+		} else if (HasBit(t.flags, OF_HALT_IN_DEPOT)) {
 			/* Force depot visit */
 			v->vehstatus |= VS_STOPPED;
 			if (v->owner == _local_player) {
@@ -2269,7 +2308,6 @@
 CommandCost CmdNameVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	Vehicle *v;
-	StringID str;
 
 	if (!IsValidVehicleID(p1) || StrEmpty(_cmd_text)) return CMD_ERROR;
 
@@ -2279,17 +2317,11 @@
 
 	if (!IsUniqueVehicleName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
 
-	str = AllocateName(_cmd_text, 2);
-	if (str == 0) return CMD_ERROR;
-
 	if (flags & DC_EXEC) {
-		StringID old_str = v->string_id;
-		v->string_id = str;
-		DeleteName(old_str);
+		free(v->name);
+		v->name = strdup(_cmd_text);
 		ResortVehicleLists();
 		MarkWholeScreenDirty();
-	} else {
-		DeleteName(str);
 	}
 
 	return CommandCost();
@@ -2322,26 +2354,51 @@
 }
 
 
-static Rect _old_vehicle_coords;
-
-void BeginVehicleMove(Vehicle *v)
+static Rect _old_vehicle_coords; ///< coords of vehicle before it has moved
+
+/**
+ * Stores the vehicle image coords for later call to EndVehicleMove()
+ * @param v vehicle which image's coords to store
+ * @see _old_vehicle_coords
+ * @see EndVehicleMove()
+ */
+void BeginVehicleMove(const Vehicle *v)
 {
-	_old_vehicle_coords.left = v->left_coord;
-	_old_vehicle_coords.top = v->top_coord;
-	_old_vehicle_coords.right = v->right_coord;
+	_old_vehicle_coords.left   = v->left_coord;
+	_old_vehicle_coords.top    = v->top_coord;
+	_old_vehicle_coords.right  = v->right_coord;
 	_old_vehicle_coords.bottom = v->bottom_coord;
 }
 
-void EndVehicleMove(Vehicle *v)
+/**
+ * Marks screen dirty after a vehicle has moved
+ * @param v vehicle which is marked dirty
+ * @see _old_vehicle_coords
+ * @see BeginVehicleMove()
+ */
+void EndVehicleMove(const Vehicle *v)
 {
 	MarkAllViewportsDirty(
-		min(_old_vehicle_coords.left,v->left_coord),
-		min(_old_vehicle_coords.top,v->top_coord),
-		max(_old_vehicle_coords.right,v->right_coord)+1,
-		max(_old_vehicle_coords.bottom,v->bottom_coord)+1
+		min(_old_vehicle_coords.left,   v->left_coord),
+		min(_old_vehicle_coords.top,    v->top_coord),
+		max(_old_vehicle_coords.right,  v->right_coord) + 1,
+		max(_old_vehicle_coords.bottom, v->bottom_coord) + 1
 	);
 }
 
+/**
+ * Marks viewports dirty where the vehicle's image is
+ * In fact, it equals
+ *   BeginVehicleMove(v); EndVehicleMove(v);
+ * @param v vehicle to mark dirty
+ * @see BeginVehicleMove()
+ * @see EndVehicleMove()
+ */
+void MarkSingleVehicleDirty(const Vehicle *v)
+{
+	MarkAllViewportsDirty(v->left_coord, v->top_coord, v->right_coord + 1, v->bottom_coord + 1);
+}
+
 /* returns true if staying in the same tile */
 GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v)
 {
@@ -2547,42 +2604,35 @@
 			case VEH_TRAIN: {
 				const RailVehicleInfo *rvi = RailVehInfo(engine_type);
 
-				switch (rvi->railtype) {
-					default: NOT_REACHED();
-					case RAILTYPE_RAIL:
-					case RAILTYPE_ELECTRIC:
-					{
-						if (cargo_type == CT_INVALID) cargo_type = rvi->cargo_type;
-						if (rvi->railveh_type == RAILVEH_WAGON) {
-							if (!GetCargo(cargo_type)->is_freight) {
-								if (parent_engine_type == INVALID_ENGINE) {
-									scheme = LS_PASSENGER_WAGON_STEAM;
-								} else {
-									switch (RailVehInfo(parent_engine_type)->engclass) {
-										default: NOT_REACHED();
-										case EC_STEAM:    scheme = LS_PASSENGER_WAGON_STEAM;    break;
-										case EC_DIESEL:   scheme = LS_PASSENGER_WAGON_DIESEL;   break;
-										case EC_ELECTRIC: scheme = LS_PASSENGER_WAGON_ELECTRIC; break;
-									}
-								}
-							} else {
-								scheme = LS_FREIGHT_WAGON;
-							}
+				if (cargo_type == CT_INVALID) cargo_type = rvi->cargo_type;
+				if (rvi->railveh_type == RAILVEH_WAGON) {
+					if (!GetCargo(cargo_type)->is_freight) {
+						if (parent_engine_type == INVALID_ENGINE) {
+							scheme = LS_PASSENGER_WAGON_STEAM;
 						} else {
-							bool is_mu = HasBit(EngInfo(engine_type)->misc_flags, EF_RAIL_IS_MU);
-
-							switch (rvi->engclass) {
+							switch (RailVehInfo(parent_engine_type)->engclass) {
 								default: NOT_REACHED();
-								case EC_STEAM:    scheme = LS_STEAM; break;
-								case EC_DIESEL:   scheme = is_mu ? LS_DMU : LS_DIESEL;   break;
-								case EC_ELECTRIC: scheme = is_mu ? LS_EMU : LS_ELECTRIC; break;
+								case EC_STEAM:    scheme = LS_PASSENGER_WAGON_STEAM;    break;
+								case EC_DIESEL:   scheme = LS_PASSENGER_WAGON_DIESEL;   break;
+								case EC_ELECTRIC: scheme = LS_PASSENGER_WAGON_ELECTRIC; break;
+								case EC_MONORAIL: scheme = LS_PASSENGER_WAGON_MONORAIL; break;
+								case EC_MAGLEV:   scheme = LS_PASSENGER_WAGON_MAGLEV;   break;
 							}
 						}
-						break;
+					} else {
+						scheme = LS_FREIGHT_WAGON;
 					}
-
-					case RAILTYPE_MONO: scheme = LS_MONORAIL; break;
-					case RAILTYPE_MAGLEV: scheme = LS_MAGLEV; break;
+				} else {
+					bool is_mu = HasBit(EngInfo(engine_type)->misc_flags, EF_RAIL_IS_MU);
+
+					switch (rvi->engclass) {
+						default: NOT_REACHED();
+						case EC_STEAM:    scheme = LS_STEAM; break;
+						case EC_DIESEL:   scheme = is_mu ? LS_DMU : LS_DIESEL;   break;
+						case EC_ELECTRIC: scheme = is_mu ? LS_EMU : LS_ELECTRIC; break;
+						case EC_MONORAIL: scheme = LS_MONORAIL; break;
+						case EC_MAGLEV:   scheme = LS_MAGLEV; break;
+					}
 				}
 				break;
 			}
@@ -2702,7 +2752,8 @@
 	    SLE_VAR(Vehicle, subtype,              SLE_UINT8),
 
 	    SLE_REF(Vehicle, next,                 REF_VEHICLE_OLD),
-	    SLE_VAR(Vehicle, string_id,            SLE_STRINGID),
+	SLE_CONDVAR(Vehicle, name,                 SLE_NAME,                    0, 83),
+	SLE_CONDSTR(Vehicle, name,                 SLE_STR, 0,                 84, SL_MAX_VERSION),
 	SLE_CONDVAR(Vehicle, unitnumber,           SLE_FILE_U8  | SLE_VAR_U16,  0, 7),
 	SLE_CONDVAR(Vehicle, unitnumber,           SLE_UINT16,                  8, SL_MAX_VERSION),
 	    SLE_VAR(Vehicle, owner,                SLE_UINT8),
@@ -3062,14 +3113,14 @@
 			this->current_order.dest == this->last_station_visited) {
 		/* Arriving at the ordered station.
 		 * Keep the load/unload flags, as we (obviously) still need them. */
-		this->current_order.flags &= OF_FULL_LOAD | OF_UNLOAD | OF_TRANSFER;
+		this->current_order.flags &= OFB_FULL_LOAD | OFB_UNLOAD | OFB_TRANSFER;
 
 		/* Furthermore add the Non Stop flag to mark that this station
 		 * is the actual destination of the vehicle, which is (for example)
 		 * necessary to be known for HandleTrainLoading to determine
 		 * whether the train is lost or not; not marking a train lost
 		 * that arrives at random stations is bad. */
-		this->current_order.flags |= OF_NON_STOP;
+		this->current_order.flags |= OFB_NON_STOP;
 		UpdateVehicleTimetable(this, true);
 	} else {
 		/* This is just an unordered intermediate stop */
@@ -3079,11 +3130,10 @@
 	current_order.type = OT_LOADING;
 	GetStation(this->last_station_visited)->loading_vehicles.push_back(this);
 
-	SET_EXPENSES_TYPE(this->GetExpenseType(true));
 	VehiclePayment(this);
 
 	InvalidateWindow(this->GetVehicleListWindowClass(), this->owner);
-	InvalidateWindowWidget(WC_VEHICLE_VIEW, this->index, STATUS_BAR);
+	InvalidateWindowWidget(WC_VEHICLE_VIEW, this->index, VVW_WIDGET_START_STOP_VEH);
 	InvalidateWindow(WC_VEHICLE_DETAILS, this->index);
 	InvalidateWindow(WC_STATION_VIEW, this->last_station_visited);
 
@@ -3096,7 +3146,7 @@
 	assert(current_order.type == OT_LOADING);
 
 	/* Only update the timetable if the vehicle was supposed to stop here. */
-	if (current_order.flags & OF_NON_STOP) UpdateVehicleTimetable(this, false);
+	if (current_order.flags & OFB_NON_STOP) UpdateVehicleTimetable(this, false);
 
 	current_order.type = OT_LEAVESTATION;
 	current_order.flags = 0;
@@ -3123,7 +3173,7 @@
 			this->LeaveStation();
 
 			/* If this was not the final order, don't remove it from the list. */
-			if (!(b.flags & OF_NON_STOP)) return;
+			if (!(b.flags & OFB_NON_STOP)) return;
 			break;
 		}
 
@@ -3166,3 +3216,15 @@
 	this->sprite_height = 1;
 	this->z_height      = 1;
 }
+
+void StopAllVehicles()
+{
+	Vehicle *v;
+	FOR_ALL_VEHICLES(v) {
+		/* Code ripped from CmdStartStopTrain. Can't call it, because of
+		 * ownership problems, so we'll duplicate some code, for now */
+		v->vehstatus |= VS_STOPPED;
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
+		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
+	}
+}
--- a/src/vehicle.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,845 +0,0 @@
-/* $Id$ */
-
-/** @vehicle.h */
-
-#ifndef VEHICLE_H
-#define VEHICLE_H
-
-#include "oldpool.h"
-#include "order.h"
-#include "rail.h"
-#include "road.h"
-#include "cargopacket.h"
-#include "texteff.hpp"
-#include "fsmblockmap.h"
-
-/** The returned bits of VehicleEnterTile. */
-enum VehicleEnterTileStatus {
-	VETS_ENTERED_STATION  = 1, ///< The vehicle entered a station
-	VETS_ENTERED_WORMHOLE = 2, ///< The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/tunnel)
-	VETS_CANNOT_ENTER     = 3, ///< The vehicle cannot enter the tile
-
-	/**
-	 * Shift the VehicleEnterTileStatus this many bits
-	 * to the right to get the station ID when
-	 * VETS_ENTERED_STATION is set
-	 */
-	VETS_STATION_ID_OFFSET = 8,
-
-	/** Bit sets of the above specified bits */
-	VETSB_CONTINUE         = 0,                          ///< The vehicle can continue normally
-	VETSB_ENTERED_STATION  = 1 << VETS_ENTERED_STATION,  ///< The vehicle entered a station
-	VETSB_ENTERED_WORMHOLE = 1 << VETS_ENTERED_WORMHOLE, ///< The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/tunnel)
-	VETSB_CANNOT_ENTER     = 1 << VETS_CANNOT_ENTER,     ///< The vehicle cannot enter the tile
-};
-
-/** Road vehicle states */
-enum RoadVehicleStates {
-	/*
-	 * Lower 4 bits are used for vehicle track direction. (Trackdirs)
-	 * When in a road stop (bit 5 or bit 6 set) these bits give the
-	 * track direction of the entry to the road stop.
-	 * As the entry direction will always be a diagonal
-	 * direction (X_NE, Y_SE, X_SW or Y_NW) only bits 0 and 3
-	 * are needed to hold this direction. Bit 1 is then used to show
-	 * that the vehicle is using the second road stop bay.
-	 * Bit 2 is then used for drive-through stops to show the vehicle
-	 * is stopping at this road stop.
-	 */
-
-	/* Numeric values */
-	RVSB_IN_DEPOT                = 0xFE,                      ///< The vehicle is in a depot
-	RVSB_WORMHOLE                = 0xFF,                      ///< The vehicle is in a tunnel and/or bridge
-
-	/* Bit numbers */
-	RVS_USING_SECOND_BAY         =    1,                      ///< Only used while in a road stop
-	RVS_IS_STOPPING              =    2,                      ///< Only used for drive-through stops. Vehicle will stop here
-	RVS_DRIVE_SIDE               =    4,                      ///< Only used when retrieving move data
-	RVS_IN_ROAD_STOP             =    5,                      ///< The vehicle is in a road stop
-	RVS_IN_DT_ROAD_STOP          =    6,                      ///< The vehicle is in a drive-through road stop
-
-	/* Bit sets of the above specified bits */
-	RVSB_IN_ROAD_STOP            = 1 << RVS_IN_ROAD_STOP,     ///< The vehicle is in a road stop
-	RVSB_IN_ROAD_STOP_END        = RVSB_IN_ROAD_STOP + TRACKDIR_END,
-	RVSB_IN_DT_ROAD_STOP         = 1 << RVS_IN_DT_ROAD_STOP,  ///< The vehicle is in a drive-through road stop
-	RVSB_IN_DT_ROAD_STOP_END     = RVSB_IN_DT_ROAD_STOP + TRACKDIR_END,
-
-	RVSB_TRACKDIR_MASK           = 0x0F,                      ///< The mask used to extract track dirs
-	RVSB_ROAD_STOP_TRACKDIR_MASK = 0x09                       ///< Only bits 0 and 3 are used to encode the trackdir for road stops
-};
-
-enum VehicleType {
-	VEH_TRAIN,
-	VEH_ROAD,
-	VEH_SHIP,
-	VEH_AIRCRAFT,
-	VEH_SPECIAL,
-	VEH_DISASTER,
-	VEH_END,
-	VEH_INVALID = 0xFF,
-};
-DECLARE_POSTFIX_INCREMENT(VehicleType);
-template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID> {};
-typedef TinyEnumT<VehicleType> VehicleTypeByte;
-
-enum VehStatus {
-	VS_HIDDEN          = 0x01,
-	VS_STOPPED         = 0x02,
-	VS_UNCLICKABLE     = 0x04,
-	VS_DEFPAL          = 0x08,
-	VS_TRAIN_SLOWING   = 0x10,
-	VS_SHADOW          = 0x20,
-	VS_AIRCRAFT_BROKEN = 0x40,
-	VS_CRASHED         = 0x80,
-};
-
-enum VehicleFlags {
-	VF_LOADING_FINISHED,
-	VF_CARGO_UNLOADING,
-	VF_BUILT_AS_PROTOTYPE,
-	VF_TIMETABLE_STARTED,  ///< Whether the vehicle has started running on the timetable yet.
-	VF_AUTOFILL_TIMETABLE, ///< Whether the vehicle should fill in the timetable automatically.
-};
-
-/* Effect vehicle types */
-enum EffectVehicle {
-	EV_CHIMNEY_SMOKE   = 0,
-	EV_STEAM_SMOKE     = 1,
-	EV_DIESEL_SMOKE    = 2,
-	EV_ELECTRIC_SPARK  = 3,
-	EV_SMOKE           = 4,
-	EV_EXPLOSION_LARGE = 5,
-	EV_BREAKDOWN_SMOKE = 6,
-	EV_EXPLOSION_SMALL = 7,
-	EV_BULLDOZER       = 8,
-	EV_BUBBLE          = 9
-};
-
-struct VehicleRail {
-	uint16 last_speed; // NOSAVE: only used in UI
-	uint16 crash_anim_pos;
-
-	/* cached values, recalculated on load and each time a vehicle is added to/removed from the consist. */
-	uint16 cached_max_speed;  // max speed of the consist. (minimum of the max speed of all vehicles in the consist)
-	uint32 cached_power;      // total power of the consist.
-	uint8 cached_veh_length;  // length of this vehicle in units of 1/8 of normal length, cached because this can be set by a callback
-	uint16 cached_total_length; ///< Length of the whole train, valid only for first engine.
-
-	/* cached values, recalculated when the cargo on a train changes (in addition to the conditions above) */
-	uint32 cached_weight;     // total weight of the consist.
-	uint32 cached_veh_weight; // weight of the vehicle.
-	uint32 cached_max_te;     // max tractive effort of consist
-	/**
-	 * Position/type of visual effect.
-	 * bit 0 - 3 = position of effect relative to vehicle. (0 = front, 8 = centre, 15 = rear)
-	 * bit 4 - 5 = type of effect. (0 = default for engine class, 1 = steam, 2 = diesel, 3 = electric)
-	 * bit     6 = disable visual effect.
-	 * bit     7 = disable powered wagons.
-	 */
-	byte cached_vis_effect;
-	byte user_def_data;
-
-	/* NOSAVE: for wagon override - id of the first engine in train
-	 * 0xffff == not in train */
-	EngineID first_engine;
-
-	TrackBitsByte track;
-	byte force_proceed;
-	RailTypeByte railtype;
-	RailTypeMask compatible_railtypes;
-
-	byte flags;
-
-	/* Link between the two ends of a multiheaded engine */
-	Vehicle *other_multiheaded_part;
-
-	/* Cached wagon override spritegroup */
-	const struct SpriteGroup *cached_override;
-};
-
-enum {
-	VRF_REVERSING         = 0,
-
-	/* used to calculate if train is going up or down */
-	VRF_GOINGUP           = 1,
-	VRF_GOINGDOWN         = 2,
-
-	/* used to store if a wagon is powered or not */
-	VRF_POWEREDWAGON      = 3,
-
-	/* used to reverse the visible direction of the vehicle */
-	VRF_REVERSE_DIRECTION = 4,
-
-	/* used to mark train as lost because PF can't find the route */
-	VRF_NO_PATH_TO_DESTINATION = 5,
-
-	/* used to mark that electric train engine is allowed to run on normal rail */
-	VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL = 6,
-};
-
-struct VehicleAir {
-	uint16 crashed_counter;
-	uint16 cached_max_speed;
-	byte pos;
-	byte previous_pos;
-	StationID targetairport;
-	byte state;
-	FSMblockmap owned_blocks;
-};
-
-struct VehicleRoad {
-	byte state;             ///< @see RoadVehicleStates
-	byte frame;
-	uint16 blocked_ctr;
-	byte overtaking;
-	byte overtaking_ctr;
-	uint16 crashed_ctr;
-	byte reverse_ctr;
-	struct RoadStop *slot;
-	byte slot_age;
-	EngineID first_engine;
-	byte cached_veh_length;
-
-	RoadType roadtype;
-	RoadTypes compatible_roadtypes;
-};
-
-struct VehicleSpecial {
-	uint16 animation_state;
-	byte animation_substate;
-};
-
-struct VehicleDisaster {
-	uint16 image_override;
-	VehicleID big_ufo_destroyer_target;
-};
-
-struct VehicleShip {
-	TrackBitsByte state;
-};
-
-struct Vehicle;
-DECLARE_OLD_POOL(Vehicle, Vehicle, 9, 125)
-
-/* Some declarations of functions, so we can make them friendly */
-struct SaveLoad;
-extern const SaveLoad *GetVehicleDescription(VehicleType vt);
-extern void AfterLoadVehicles();
-struct LoadgameState;
-extern bool LoadOldVehicle(LoadgameState *ls, int num);
-
-struct Vehicle : PoolItem<Vehicle, VehicleID, &_Vehicle_pool> {
-	VehicleTypeByte type;    ///< Type of vehicle
-	byte subtype;            // subtype (Filled with values from EffectVehicles/TrainSubTypes/AircraftSubTypes)
-
-private:
-	Vehicle *next;           // pointer to the next vehicle in the chain
-	Vehicle *previous;       // NOSAVE: pointer to the previous vehicle in the chain
-	Vehicle *first;          // NOSAVE: pointer to the first vehicle in the chain
-public:
-	friend const SaveLoad *GetVehicleDescription(VehicleType vt); // So we can use private/protected variables in the saveload code
-	friend void AfterLoadVehicles();                              // So we can set the previous and first pointers while loading
-	friend bool LoadOldVehicle(LoadgameState *ls, int num);       // So we can set the proper next pointer while loading
-
-	Vehicle *depot_list;     // NOSAVE: linked list to tell what vehicles entered a depot during the last tick. Used by autoreplace
-
-	StringID string_id;      // Displayed string
-
-	UnitID unitnumber;       // unit number, for display purposes only
-	PlayerByte owner;        // which player owns the vehicle?
-
-	TileIndex tile;          // Current tile index
-	TileIndex dest_tile;     // Heading for this tile
-
-	int32 x_pos;             // coordinates
-	int32 y_pos;
-	byte z_pos;
-	DirectionByte direction; // facing
-
-	byte spritenum;          // currently displayed sprite index
-	                         // 0xfd == custom sprite, 0xfe == custom second head sprite
-	                         // 0xff == reserved for another custom sprite
-	uint16 cur_image;        // sprite number for this vehicle
-	byte sprite_width;       // width of vehicle sprite
-	byte sprite_height;      // height of vehicle sprite
-	byte z_height;           // z-height of vehicle sprite
-	int8 x_offs;             // x offset for vehicle sprite
-	int8 y_offs;             // y offset for vehicle sprite
-	EngineID engine_type;
-
-	TextEffectID fill_percent_te_id; // a text-effect id to a loading indicator object
-
-	/* for randomized variational spritegroups
-	 * bitmask used to resolve them; parts of it get reseeded when triggers
-	 * of corresponding spritegroups get matched */
-	byte random_bits;
-	byte waiting_triggers;   // triggers to be yet matched
-
-	uint16 max_speed;        // maximum speed
-	uint16 cur_speed;        // current speed
-	byte subspeed;           // fractional speed
-	byte acceleration;       // used by train & aircraft
-	byte progress;
-	uint32 motion_counter;
-
-	byte vehstatus;          // Status
-	StationID last_station_visited;
-
-	CargoID cargo_type;      // type of cargo this vehicle is carrying
-	uint16 cargo_cap;        // total capacity
-	byte cargo_subtype;      ///< Used for livery refits (NewGRF variations)
-	CargoList cargo;         ///< The cargo this vehicle is carrying
-
-
-	byte day_counter;        // increased by one for each day
-	byte tick_counter;       // increased by one for each tick
-
-	/* Begin Order-stuff */
-	Order current_order;     ///< The current order (+ status, like: loading)
-	VehicleOrderID cur_order_index; ///< The index to the current order
-
-	Order *orders;           ///< Pointer to the first order for this vehicle
-	VehicleOrderID num_orders;      ///< How many orders there are in the list
-
-	Vehicle *next_shared;    ///< If not NULL, this points to the next vehicle that shared the order
-	Vehicle *prev_shared;    ///< If not NULL, this points to the prev vehicle that shared the order
-	/* End Order-stuff */
-
-	/* Boundaries for the current position in the world and a next hash link.
-	 * NOSAVE: All of those can be updated with VehiclePositionChanged() */
-	int32 left_coord;
-	int32 top_coord;
-	int32 right_coord;
-	int32 bottom_coord;
-	Vehicle *next_hash;
-	Vehicle *next_new_hash;
-	Vehicle **old_new_hash;
-
-	/* Related to age and service time */
-	Date age;     // Age in days
-	Date max_age; // Maximum age
-	Date date_of_last_service;
-	Date service_interval;
-	uint16 reliability;
-	uint16 reliability_spd_dec;
-	byte breakdown_ctr;
-	byte breakdown_delay;
-	byte breakdowns_since_last_service;
-	byte breakdown_chance;
-	Year build_year;
-
-	bool leave_depot_instantly; // NOSAVE: stores if the vehicle needs to leave the depot it just entered. Used by autoreplace
-
-	uint16 load_unload_time_rem;
-	byte vehicle_flags;         // Used for gradual loading and other miscellaneous things (@see VehicleFlags enum)
-
-	Money profit_this_year;
-	Money profit_last_year;
-	Money value;
-
-	GroupID group_id;              ///< Index of group Pool array
-
-	/* Used for timetabling. */
-	uint32 current_order_time;     ///< How many ticks have passed since this order started.
-	int32 lateness_counter;        ///< How many ticks late (or early if negative) this vehicle is.
-
-	SpriteID colormap; // NOSAVE: cached color mapping
-
-	union {
-		VehicleRail rail;
-		VehicleAir air;
-		VehicleRoad road;
-		VehicleSpecial special;
-		VehicleDisaster disaster;
-		VehicleShip ship;
-	} u;
-
-
-	/**
-	 * Allocates a lot of vehicles.
-	 * @param vl pointer to an array of vehicles to get allocated. Can be NULL if the vehicles aren't needed (makes it test only)
-	 * @param num number of vehicles to allocate room for
-	 * @return true if there is room to allocate all the vehicles
-	 */
-	static bool AllocateList(Vehicle **vl, int num);
-
-	/** Create a new vehicle */
-	Vehicle();
-
-	/** Destroy all stuff that (still) needs the virtual functions to work properly */
-	void PreDestructor();
-	/** We want to 'destruct' the right class. */
-	virtual ~Vehicle();
-
-	void BeginLoading();
-	void LeaveStation();
-
-	/**
-	 * Handle the loading of the vehicle; when not it skips through dummy
-	 * orders and does nothing in all other cases.
-	 * @param mode is the non-first call for this vehicle in this tick?
-	 */
-	void HandleLoading(bool mode = false);
-
-	/**
-	 * Get a string 'representation' of the vehicle type.
-	 * @return the string representation.
-	 */
-	virtual const char* GetTypeString() const { return "base vehicle"; }
-
-	/**
-	 * Marks the vehicles to be redrawn and updates cached variables
-	 *
-	 * This method marks the area of the vehicle on the screen as dirty.
-	 * It can be use to repaint the vehicle.
-	 *
-	 * @ingroup dirty
-	 */
-	virtual void MarkDirty() {}
-
-	/**
-	 * Updates the x and y offsets and the size of the sprite used
-	 * for this vehicle.
-	 * @param direction the direction the vehicle is facing
-	 */
-	virtual void UpdateDeltaXY(Direction direction) {}
-
-	/**
-	 * Sets the expense type associated to this vehicle type
-	 * @param income whether this is income or (running) expenses of the vehicle
-	 */
-	virtual ExpensesType GetExpenseType(bool income) const { return EXPENSES_OTHER; }
-
-	/**
-	 * Invalidates the vehicle list window of this type of vehicle
-	 */
-	virtual WindowClass GetVehicleListWindowClass() const { return WC_NONE; }
-
-	/**
-	 * Play the sound associated with leaving the station
-	 */
-	virtual void PlayLeaveStationSound() const {}
-
-	/**
-	 * Whether this is the primary vehicle in the chain.
-	 */
-	virtual bool IsPrimaryVehicle() const { return false; }
-
-	/**
-	 * Gets the sprite to show for the given direction
-	 * @param direction the direction the vehicle is facing
-	 * @return the sprite for the given vehicle in the given direction
-	 */
-	virtual int GetImage(Direction direction) const { return 0; }
-
-	/**
-	 * Gets the speed in mph that can be sent into SetDParam for string processing.
-	 * @return the vehicle's speed
-	 */
-	virtual int GetDisplaySpeed() const { return 0; }
-
-	/**
-	 * Gets the maximum speed in mph that can be sent into SetDParam for string processing.
-	 * @return the vehicle's maximum speed
-	 */
-	virtual int GetDisplayMaxSpeed() const { return 0; }
-
-	/**
-	 * Gets the running cost of a vehicle
-	 * @return the vehicle's running cost
-	 */
-	virtual Money GetRunningCost() const { return 0; }
-
-	/**
-	 * Check whether the vehicle is in the depot.
-	 * @return true if and only if the vehicle is in the depot.
-	 */
-	virtual bool IsInDepot() const { return false; }
-
-	/**
-	 * Check whether the vehicle is in the depot *and* stopped.
-	 * @return true if and only if the vehicle is in the depot and stopped.
-	 */
-	virtual bool IsStoppedInDepot() const { return this->IsInDepot() && (this->vehstatus & VS_STOPPED) != 0; }
-
-	/**
-	 * Calls the tick handler of the vehicle
-	 */
-	virtual void Tick() {};
-
-	/**
-	 * Gets the running cost of a vehicle  that can be sent into SetDParam for string processing.
-	 * @return the vehicle's running cost
-	 */
-	Money GetDisplayRunningCost() const { return (this->GetRunningCost() >> 8); }
-
-	/**
-	 * Is this vehicle a valid vehicle?
-	 * @return true if and only if the vehicle is valid.
-	 */
-	inline bool IsValid() const { return this->type != VEH_INVALID; }
-
-	/**
-	 * Set the next vehicle of this vehicle.
-	 * @param next the next vehicle. NULL removes the next vehicle.
-	 */
-	void SetNext(Vehicle *next);
-
-	/**
-	 * Get the next vehicle of this vehicle.
-	 * @note articulated parts are also counted as vehicles.
-	 * @return the next vehicle or NULL when there isn't a next vehicle.
-	 */
-	inline Vehicle *Next() const { return this->next; }
-
-	/**
-	 * Get the previous vehicle of this vehicle.
-	 * @note articulated parts are also counted as vehicles.
-	 * @return the previous vehicle or NULL when there isn't a previous vehicle.
-	 */
-	inline Vehicle *Previous() const { return this->previous; }
-
-	/**
-	 * Get the first vehicle of this vehicle chain.
-	 * @return the first vehicle of the chain.
-	 */
-	inline Vehicle *First() const { return this->first; }
-};
-
-/**
- * This class 'wraps' Vehicle; you do not actually instantiate this class.
- * You create a Vehicle using AllocateVehicle, so it is added to the pool
- * and you reinitialize that to a Train using:
- *   v = new (v) Train();
- *
- * As side-effect the vehicle type is set correctly.
- *
- * A special vehicle is one of the following:
- *  - smoke
- *  - electric sparks for trains
- *  - explosions
- *  - bulldozer (road works)
- *  - bubbles (industry)
- */
-struct SpecialVehicle : public Vehicle {
-	/** Initializes the Vehicle to a special vehicle */
-	SpecialVehicle() { this->type = VEH_SPECIAL; }
-
-	/** We want to 'destruct' the right class. */
-	virtual ~SpecialVehicle() {}
-
-	const char *GetTypeString() const { return "special vehicle"; }
-	void UpdateDeltaXY(Direction direction);
-	void Tick();
-};
-
-/**
- * This class 'wraps' Vehicle; you do not actually instantiate this class.
- * You create a Vehicle using AllocateVehicle, so it is added to the pool
- * and you reinitialize that to a Train using:
- *   v = new (v) Train();
- *
- * As side-effect the vehicle type is set correctly.
- */
-struct DisasterVehicle : public Vehicle {
-	/** Initializes the Vehicle to a disaster vehicle */
-	DisasterVehicle() { this->type = VEH_DISASTER; }
-
-	/** We want to 'destruct' the right class. */
-	virtual ~DisasterVehicle() {}
-
-	const char *GetTypeString() const { return "disaster vehicle"; }
-	void UpdateDeltaXY(Direction direction);
-	void Tick();
-};
-
-/**
- * This class 'wraps' Vehicle; you do not actually instantiate this class.
- * You create a Vehicle using AllocateVehicle, so it is added to the pool
- * and you reinitialize that to a Train using:
- *   v = new (v) Train();
- *
- * As side-effect the vehicle type is set correctly.
- */
-struct InvalidVehicle : public Vehicle {
-	/** Initializes the Vehicle to a invalid vehicle */
-	InvalidVehicle() { this->type = VEH_INVALID; }
-
-	/** We want to 'destruct' the right class. */
-	virtual ~InvalidVehicle() {}
-
-	const char *GetTypeString() const { return "invalid vehicle"; }
-	void Tick() {}
-};
-
-#define is_custom_sprite(x) (x >= 0xFD)
-#define IS_CUSTOM_FIRSTHEAD_SPRITE(x) (x == 0xFD)
-#define IS_CUSTOM_SECONDHEAD_SPRITE(x) (x == 0xFE)
-
-typedef void *VehicleFromPosProc(Vehicle *v, void *data);
-
-void VehicleServiceInDepot(Vehicle *v);
-void VehiclePositionChanged(Vehicle *v);
-Vehicle *GetLastVehicleInChain(Vehicle *v);
-uint CountVehiclesInChain(const Vehicle *v);
-bool IsEngineCountable(const Vehicle *v);
-void DeleteVehicleChain(Vehicle *v);
-void *VehicleFromPos(TileIndex tile, void *data, VehicleFromPosProc *proc);
-void *VehicleFromPosXY(int x, int y, void *data, VehicleFromPosProc *proc);
-void CallVehicleTicks();
-Vehicle *FindVehicleOnTileZ(TileIndex tile, byte z);
-uint8 CalcPercentVehicleFilled(Vehicle *v, StringID *color);
-
-void InitializeTrains();
-byte VehicleRandomBits();
-void ResetVehiclePosHash();
-void ResetVehicleColorMap();
-void CheckVehicle32Day(Vehicle *v);
-
-bool CanRefitTo(EngineID engine_type, CargoID cid_to);
-CargoID FindFirstRefittableCargo(EngineID engine_type);
-CommandCost GetRefitCost(EngineID engine_type);
-
-void ViewportAddVehicles(DrawPixelInfo *dpi);
-
-SpriteID GetRotorImage(const Vehicle *v);
-
-Vehicle *CreateEffectVehicle(int x, int y, int z, EffectVehicle type);
-Vehicle *CreateEffectVehicleAbove(int x, int y, int z, EffectVehicle type);
-Vehicle *CreateEffectVehicleRel(const Vehicle *v, int x, int y, int z, EffectVehicle type);
-
-uint32 VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y);
-
-StringID VehicleInTheWayErrMsg(const Vehicle* v);
-Vehicle *FindVehicleBetween(TileIndex from, TileIndex to, byte z, bool without_crashed = false);
-
-bool UpdateSignalsOnSegment(TileIndex tile, DiagDirection direction);
-void SetSignalsOnBothDir(TileIndex tile, byte track);
-
-Vehicle *CheckClickOnVehicle(const ViewPort *vp, int x, int y);
-
-void DecreaseVehicleValue(Vehicle *v);
-void CheckVehicleBreakdown(Vehicle *v);
-void AgeVehicle(Vehicle *v);
-void VehicleEnteredDepotThisTick(Vehicle *v);
-
-void BeginVehicleMove(Vehicle *v);
-void EndVehicleMove(Vehicle *v);
-
-UnitID GetFreeUnitNumber(VehicleType type);
-
-void TrainConsistChanged(Vehicle *v);
-void TrainPowerChanged(Vehicle *v);
-Money GetTrainRunningCost(const Vehicle *v);
-
-bool VehicleNeedsService(const Vehicle *v);
-
-uint GenerateVehicleSortList(const Vehicle*** sort_list, uint16 *length_of_array, VehicleType type, PlayerID owner, uint32 index, uint16 window_type);
-void BuildDepotVehicleList(VehicleType type, TileIndex tile, Vehicle ***engine_list, uint16 *engine_list_length, uint16 *engine_count, Vehicle ***wagon_list, uint16 *wagon_list_length, uint16 *wagon_count);
-CommandCost SendAllVehiclesToDepot(VehicleType type, uint32 flags, bool service, PlayerID owner, uint16 vlw_flag, uint32 id);
-void VehicleEnterDepot(Vehicle *v);
-
-void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g);
-
-CommandCost MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs);
-bool CanBuildVehicleInfrastructure(VehicleType type);
-
-void CcCloneVehicle(bool success, TileIndex tile, uint32 p1, uint32 p2);
-
-/* Flags to add to p2 for goto depot commands */
-/* Note: bits 8-10 are used for VLW flags */
-enum {
-	DEPOT_SERVICE       = (1 << 0), // The vehicle will leave the depot right after arrival (serivce only)
-	DEPOT_MASS_SEND     = (1 << 1), // Tells that it's a mass send to depot command (type in VLW flag)
-	DEPOT_DONT_CANCEL   = (1 << 2), // Don't cancel current goto depot command if any
-	DEPOT_LOCATE_HANGAR = (1 << 3), // Find another airport if the target one lacks a hangar
-};
-
-struct GetNewVehiclePosResult {
-	int x, y;
-	TileIndex old_tile;
-	TileIndex new_tile;
-};
-
-/**
- * Returns the Trackdir on which the vehicle is currently located.
- * Works for trains and ships.
- * Currently works only sortof for road vehicles, since they have a fuzzy
- * concept of being "on" a trackdir. Dunno really what it returns for a road
- * vehicle that is halfway a tile, never really understood that part. For road
- * vehicles that are at the beginning or end of the tile, should just return
- * the diagonal trackdir on which they are driving. I _think_.
- * For other vehicles types, or vehicles with no clear trackdir (such as those
- * in depots), returns 0xFF.
- */
-Trackdir GetVehicleTrackdir(const Vehicle* v);
-
-/* returns true if staying in the same tile */
-GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v);
-Direction GetDirectionTowards(const Vehicle *v, int x, int y);
-
-#define BEGIN_ENUM_WAGONS(v) do {
-#define END_ENUM_WAGONS(v) } while ((v = v->Next()) != NULL);
-
-static inline VehicleID GetMaxVehicleIndex()
-{
-	/* TODO - This isn't the real content of the function, but
-	 *  with the new pool-system this will be replaced with one that
-	 *  _really_ returns the highest index. Now it just returns
-	 *  the next safe value we are sure about everything is below.
-	 */
-	return GetVehiclePoolSize() - 1;
-}
-
-static inline uint GetNumVehicles()
-{
-	return GetVehiclePoolSize();
-}
-
-static inline bool IsPlayerBuildableVehicleType(VehicleType type)
-{
-	switch (type) {
-		case VEH_TRAIN:
-		case VEH_ROAD:
-		case VEH_SHIP:
-		case VEH_AIRCRAFT:
-			return true;
-
-		default: return false;
-	}
-}
-
-static inline bool IsPlayerBuildableVehicleType(const Vehicle *v)
-{
-	return IsPlayerBuildableVehicleType(v->type);
-}
-
-#define FOR_ALL_VEHICLES_FROM(v, start) for (v = GetVehicle(start); v != NULL; v = (v->index + 1U < GetVehiclePoolSize()) ? GetVehicle(v->index + 1) : NULL) if (v->IsValid())
-#define FOR_ALL_VEHICLES(v) FOR_ALL_VEHICLES_FROM(v, 0)
-
-/**
- * Check if an index is a vehicle-index (so between 0 and max-vehicles)
- * @param index of the vehicle to query
- * @return Returns true if the vehicle-id is in range
- */
-static inline bool IsValidVehicleID(uint index)
-{
-	return index < GetVehiclePoolSize() && GetVehicle(index)->IsValid();
-}
-
-/* Returns order 'index' of a vehicle or NULL when it doesn't exists */
-static inline Order *GetVehicleOrder(const Vehicle *v, int index)
-{
-	Order *order = v->orders;
-
-	if (index < 0) return NULL;
-
-	while (order != NULL && index-- > 0)
-		order = order->next;
-
-	return order;
-}
-
-/**
- * Returns the last order of a vehicle, or NULL if it doesn't exists
- * @param v Vehicle to query
- * @return last order of a vehicle, if available
- */
-static inline Order *GetLastVehicleOrder(const Vehicle *v)
-{
-	Order *order = v->orders;
-
-	if (order == NULL) return NULL;
-
-	while (order->next != NULL)
-		order = order->next;
-
-	return order;
-}
-
-/** Get the first vehicle of a shared-list, so we only have to walk forwards
- * @param v Vehicle to query
- * @return first vehicle of a shared-list
- */
-static inline Vehicle *GetFirstVehicleFromSharedList(const Vehicle *v)
-{
-	Vehicle *u = (Vehicle *)v;
-	while (u->prev_shared != NULL) u = u->prev_shared;
-
-	return u;
-}
-
-/* NOSAVE: Return values from various commands. */
-VARDEF VehicleID _new_vehicle_id;
-VARDEF uint16 _returned_refit_capacity;
-
-static const VehicleID INVALID_VEHICLE = 0xFFFF;
-
-const struct Livery *GetEngineLivery(EngineID engine_type, PlayerID player, EngineID parent_engine_type, const Vehicle *v);
-
-/**
- * Get the colour map for an engine. This used for unbuilt engines in the user interface.
- * @param engine_type ID of engine
- * @param player ID of player
- * @return A ready-to-use palette modifier
- */
-SpriteID GetEnginePalette(EngineID engine_type, PlayerID player);
-
-/**
- * Get the colour map for a vehicle.
- * @param v Vehicle to get colour map for
- * @return A ready-to-use palette modifier
- */
-SpriteID GetVehiclePalette(const Vehicle *v);
-
-/* A lot of code calls for the invalidation of the status bar, which is widget 5.
- * Best is to have a virtual value for it when it needs to change again */
-#define STATUS_BAR 5
-
-extern const uint32 _veh_build_proc_table[];
-extern const uint32 _veh_sell_proc_table[];
-extern const uint32 _veh_refit_proc_table[];
-extern const uint32 _send_to_depot_proc_table[];
-
-/* Functions to find the right command for certain vehicle type */
-static inline uint32 GetCmdBuildVeh(VehicleType type)
-{
-	return _veh_build_proc_table[type];
-}
-
-static inline uint32 GetCmdBuildVeh(const Vehicle *v)
-{
-	return GetCmdBuildVeh(v->type);
-}
-
-static inline uint32 GetCmdSellVeh(VehicleType type)
-{
-	return _veh_sell_proc_table[type];
-}
-
-static inline uint32 GetCmdSellVeh(const Vehicle *v)
-{
-	return GetCmdSellVeh(v->type);
-}
-
-static inline uint32 GetCmdRefitVeh(VehicleType type)
-{
-	return _veh_refit_proc_table[type];
-}
-
-static inline uint32 GetCmdRefitVeh(const Vehicle *v)
-{
-	return GetCmdRefitVeh(v->type);
-}
-
-static inline uint32 GetCmdSendToDepot(VehicleType type)
-{
-	return _send_to_depot_proc_table[type];
-}
-
-static inline uint32 GetCmdSendToDepot(const Vehicle *v)
-{
-	return GetCmdSendToDepot(v->type);
-}
-
-#endif /* VEHICLE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/vehicle_base.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,617 @@
+/* $Id$ */
+
+/** @file  vehicle_base.h Base class for all vehicles. */
+
+#ifndef VEHICLE_BASE_H
+#define VEHICLE_BASE_H
+
+#include "vehicle_type.h"
+#include "track_type.h"
+#include "rail_type.h"
+#include "road_type.h"
+#include "cargo_type.h"
+#include "direction_type.h"
+#include "window_type.h"
+#include "gfx_type.h"
+#include "command_type.h"
+#include "date_type.h"
+#include "player_type.h"
+#include "oldpool.h"
+#include "order.h"
+#include "cargopacket.h"
+#include "texteff.hpp"
+#include "fsmblockmap.h"
+
+/** Road vehicle states */
+enum RoadVehicleStates {
+	/*
+	 * Lower 4 bits are used for vehicle track direction. (Trackdirs)
+	 * When in a road stop (bit 5 or bit 6 set) these bits give the
+	 * track direction of the entry to the road stop.
+	 * As the entry direction will always be a diagonal
+	 * direction (X_NE, Y_SE, X_SW or Y_NW) only bits 0 and 3
+	 * are needed to hold this direction. Bit 1 is then used to show
+	 * that the vehicle is using the second road stop bay.
+	 * Bit 2 is then used for drive-through stops to show the vehicle
+	 * is stopping at this road stop.
+	 */
+
+	/* Numeric values */
+	RVSB_IN_DEPOT                = 0xFE,                      ///< The vehicle is in a depot
+	RVSB_WORMHOLE                = 0xFF,                      ///< The vehicle is in a tunnel and/or bridge
+
+	/* Bit numbers */
+	RVS_USING_SECOND_BAY         =    1,                      ///< Only used while in a road stop
+	RVS_IS_STOPPING              =    2,                      ///< Only used for drive-through stops. Vehicle will stop here
+	RVS_DRIVE_SIDE               =    4,                      ///< Only used when retrieving move data
+	RVS_IN_ROAD_STOP             =    5,                      ///< The vehicle is in a road stop
+	RVS_IN_DT_ROAD_STOP          =    6,                      ///< The vehicle is in a drive-through road stop
+
+	/* Bit sets of the above specified bits */
+	RVSB_IN_ROAD_STOP            = 1 << RVS_IN_ROAD_STOP,     ///< The vehicle is in a road stop
+	RVSB_IN_ROAD_STOP_END        = RVSB_IN_ROAD_STOP + TRACKDIR_END,
+	RVSB_IN_DT_ROAD_STOP         = 1 << RVS_IN_DT_ROAD_STOP,  ///< The vehicle is in a drive-through road stop
+	RVSB_IN_DT_ROAD_STOP_END     = RVSB_IN_DT_ROAD_STOP + TRACKDIR_END,
+
+	RVSB_TRACKDIR_MASK           = 0x0F,                      ///< The mask used to extract track dirs
+	RVSB_ROAD_STOP_TRACKDIR_MASK = 0x09                       ///< Only bits 0 and 3 are used to encode the trackdir for road stops
+};
+
+enum VehStatus {
+	VS_HIDDEN          = 0x01,
+	VS_STOPPED         = 0x02,
+	VS_UNCLICKABLE     = 0x04,
+	VS_DEFPAL          = 0x08,
+	VS_TRAIN_SLOWING   = 0x10,
+	VS_SHADOW          = 0x20,
+	VS_AIRCRAFT_BROKEN = 0x40,
+	VS_CRASHED         = 0x80,
+};
+
+enum VehicleFlags {
+	VF_LOADING_FINISHED,
+	VF_CARGO_UNLOADING,
+	VF_BUILT_AS_PROTOTYPE,
+	VF_TIMETABLE_STARTED,  ///< Whether the vehicle has started running on the timetable yet.
+	VF_AUTOFILL_TIMETABLE, ///< Whether the vehicle should fill in the timetable automatically.
+};
+
+struct VehicleRail {
+	uint16 last_speed; // NOSAVE: only used in UI
+	uint16 crash_anim_pos;
+
+	/* cached values, recalculated on load and each time a vehicle is added to/removed from the consist. */
+	uint16 cached_max_speed;  // max speed of the consist. (minimum of the max speed of all vehicles in the consist)
+	uint32 cached_power;      // total power of the consist.
+	bool cached_tilt;         // train can tilt; feature provides a bonus in curves
+	uint8 cached_veh_length;  // length of this vehicle in units of 1/8 of normal length, cached because this can be set by a callback
+	uint16 cached_total_length; ///< Length of the whole train, valid only for first engine.
+
+	/* cached values, recalculated when the cargo on a train changes (in addition to the conditions above) */
+	uint32 cached_weight;     // total weight of the consist.
+	uint32 cached_veh_weight; // weight of the vehicle.
+	uint32 cached_max_te;     // max tractive effort of consist
+	/**
+	 * Position/type of visual effect.
+	 * bit 0 - 3 = position of effect relative to vehicle. (0 = front, 8 = centre, 15 = rear)
+	 * bit 4 - 5 = type of effect. (0 = default for engine class, 1 = steam, 2 = diesel, 3 = electric)
+	 * bit     6 = disable visual effect.
+	 * bit     7 = disable powered wagons.
+	 */
+	byte cached_vis_effect;
+	byte user_def_data;
+
+	/* NOSAVE: for wagon override - id of the first engine in train
+	 * 0xffff == not in train */
+	EngineID first_engine;
+
+	TrackBitsByte track;
+	byte force_proceed;
+	RailTypeByte railtype;
+	RailTypes compatible_railtypes;
+
+	byte flags;
+
+	/* Link between the two ends of a multiheaded engine */
+	Vehicle *other_multiheaded_part;
+
+	/* Cached wagon override spritegroup */
+	const struct SpriteGroup *cached_override;
+};
+
+enum {
+	VRF_REVERSING         = 0,
+
+	/* used to calculate if train is going up or down */
+	VRF_GOINGUP           = 1,
+	VRF_GOINGDOWN         = 2,
+
+	/* used to store if a wagon is powered or not */
+	VRF_POWEREDWAGON      = 3,
+
+	/* used to reverse the visible direction of the vehicle */
+	VRF_REVERSE_DIRECTION = 4,
+
+	/* used to mark train as lost because PF can't find the route */
+	VRF_NO_PATH_TO_DESTINATION = 5,
+
+	/* used to mark that electric train engine is allowed to run on normal rail */
+	VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL = 6,
+};
+
+struct VehicleAir {
+	uint16 crashed_counter;
+	uint16 cached_max_speed;
+	byte pos;
+	byte previous_pos;
+	StationID targetairport;
+	byte state;
+	FSMblockmap owned_blocks;
+};
+
+struct VehicleRoad {
+	byte state;             ///< @see RoadVehicleStates
+	byte frame;
+	uint16 blocked_ctr;
+	byte overtaking;
+	byte overtaking_ctr;
+	uint16 crashed_ctr;
+	byte reverse_ctr;
+	struct RoadStop *slot;
+	byte slot_age;
+	EngineID first_engine;
+	byte cached_veh_length;
+
+	RoadType roadtype;
+	RoadTypes compatible_roadtypes;
+};
+
+struct VehicleSpecial {
+	uint16 animation_state;
+	byte animation_substate;
+};
+
+struct VehicleDisaster {
+	uint16 image_override;
+	VehicleID big_ufo_destroyer_target;
+};
+
+struct VehicleShip {
+	TrackBitsByte state;
+};
+
+DECLARE_OLD_POOL(Vehicle, Vehicle, 9, 125)
+
+/* Some declarations of functions, so we can make them friendly */
+struct SaveLoad;
+extern const SaveLoad *GetVehicleDescription(VehicleType vt);
+extern void AfterLoadVehicles(bool clear_te_id);
+struct LoadgameState;
+extern bool LoadOldVehicle(LoadgameState *ls, int num);
+
+struct Vehicle : PoolItem<Vehicle, VehicleID, &_Vehicle_pool>, BaseVehicle {
+	byte subtype;            // subtype (Filled with values from EffectVehicles/TrainSubTypes/AircraftSubTypes)
+
+private:
+	Vehicle *next;           // pointer to the next vehicle in the chain
+	Vehicle *previous;       // NOSAVE: pointer to the previous vehicle in the chain
+	Vehicle *first;          // NOSAVE: pointer to the first vehicle in the chain
+public:
+	friend const SaveLoad *GetVehicleDescription(VehicleType vt); // So we can use private/protected variables in the saveload code
+	friend void AfterLoadVehicles(bool clear_te_id);              // So we can set the previous and first pointers while loading
+	friend bool LoadOldVehicle(LoadgameState *ls, int num);       // So we can set the proper next pointer while loading
+
+	Vehicle *depot_list;     // NOSAVE: linked list to tell what vehicles entered a depot during the last tick. Used by autoreplace
+
+	char *name;              ///< Name of vehicle
+
+	UnitID unitnumber;       // unit number, for display purposes only
+	PlayerByte owner;        // which player owns the vehicle?
+
+	TileIndex tile;          // Current tile index
+	TileIndex dest_tile;     // Heading for this tile
+
+	int32 x_pos;             // coordinates
+	int32 y_pos;
+	byte z_pos;
+	DirectionByte direction; // facing
+
+	byte spritenum;          // currently displayed sprite index
+	                         // 0xfd == custom sprite, 0xfe == custom second head sprite
+	                         // 0xff == reserved for another custom sprite
+	uint16 cur_image;        // sprite number for this vehicle
+	byte sprite_width;       // width of vehicle sprite
+	byte sprite_height;      // height of vehicle sprite
+	byte z_height;           // z-height of vehicle sprite
+	int8 x_offs;             // x offset for vehicle sprite
+	int8 y_offs;             // y offset for vehicle sprite
+	EngineID engine_type;
+
+	TextEffectID fill_percent_te_id; // a text-effect id to a loading indicator object
+
+	/* for randomized variational spritegroups
+	 * bitmask used to resolve them; parts of it get reseeded when triggers
+	 * of corresponding spritegroups get matched */
+	byte random_bits;
+	byte waiting_triggers;   // triggers to be yet matched
+
+	uint16 max_speed;        // maximum speed
+	uint16 cur_speed;        // current speed
+	byte subspeed;           // fractional speed
+	byte acceleration;       // used by train & aircraft
+	byte progress;
+	uint32 motion_counter;
+
+	byte vehstatus;          // Status
+	StationID last_station_visited;
+
+	CargoID cargo_type;      // type of cargo this vehicle is carrying
+	uint16 cargo_cap;        // total capacity
+	byte cargo_subtype;      ///< Used for livery refits (NewGRF variations)
+	CargoList cargo;         ///< The cargo this vehicle is carrying
+
+
+	byte day_counter;        // increased by one for each day
+	byte tick_counter;       // increased by one for each tick
+
+	/* Begin Order-stuff */
+	Order current_order;     ///< The current order (+ status, like: loading)
+	VehicleOrderID cur_order_index; ///< The index to the current order
+
+	Order *orders;           ///< Pointer to the first order for this vehicle
+	VehicleOrderID num_orders;      ///< How many orders there are in the list
+
+	Vehicle *next_shared;    ///< If not NULL, this points to the next vehicle that shared the order
+	Vehicle *prev_shared;    ///< If not NULL, this points to the prev vehicle that shared the order
+	/* End Order-stuff */
+
+	/* Boundaries for the current position in the world and a next hash link.
+	 * NOSAVE: All of those can be updated with VehiclePositionChanged() */
+	int32 left_coord;
+	int32 top_coord;
+	int32 right_coord;
+	int32 bottom_coord;
+	Vehicle *next_hash;
+	Vehicle *next_new_hash;
+	Vehicle **old_new_hash;
+
+	/* Related to age and service time */
+	Date age;     // Age in days
+	Date max_age; // Maximum age
+	Date date_of_last_service;
+	Date service_interval;
+	uint16 reliability;
+	uint16 reliability_spd_dec;
+	byte breakdown_ctr;
+	byte breakdown_delay;
+	byte breakdowns_since_last_service;
+	byte breakdown_chance;
+	Year build_year;
+
+	bool leave_depot_instantly; // NOSAVE: stores if the vehicle needs to leave the depot it just entered. Used by autoreplace
+
+	uint16 load_unload_time_rem;
+	byte vehicle_flags;         // Used for gradual loading and other miscellaneous things (@see VehicleFlags enum)
+
+	Money profit_this_year;
+	Money profit_last_year;
+	Money value;
+
+	GroupID group_id;              ///< Index of group Pool array
+
+	/* Used for timetabling. */
+	uint32 current_order_time;     ///< How many ticks have passed since this order started.
+	int32 lateness_counter;        ///< How many ticks late (or early if negative) this vehicle is.
+
+	SpriteID colormap; // NOSAVE: cached color mapping
+
+	union {
+		VehicleRail rail;
+		VehicleAir air;
+		VehicleRoad road;
+		VehicleSpecial special;
+		VehicleDisaster disaster;
+		VehicleShip ship;
+	} u;
+
+
+	/**
+	 * Allocates a lot of vehicles.
+	 * @param vl pointer to an array of vehicles to get allocated. Can be NULL if the vehicles aren't needed (makes it test only)
+	 * @param num number of vehicles to allocate room for
+	 * @return true if there is room to allocate all the vehicles
+	 */
+	static bool AllocateList(Vehicle **vl, int num);
+
+	/** Create a new vehicle */
+	Vehicle();
+
+	/** Destroy all stuff that (still) needs the virtual functions to work properly */
+	void PreDestructor();
+	/** We want to 'destruct' the right class. */
+	virtual ~Vehicle();
+
+	void BeginLoading();
+	void LeaveStation();
+
+	/**
+	 * Handle the loading of the vehicle; when not it skips through dummy
+	 * orders and does nothing in all other cases.
+	 * @param mode is the non-first call for this vehicle in this tick?
+	 */
+	void HandleLoading(bool mode = false);
+
+	/**
+	 * Get a string 'representation' of the vehicle type.
+	 * @return the string representation.
+	 */
+	virtual const char* GetTypeString() const { return "base vehicle"; }
+
+	/**
+	 * Marks the vehicles to be redrawn and updates cached variables
+	 *
+	 * This method marks the area of the vehicle on the screen as dirty.
+	 * It can be use to repaint the vehicle.
+	 *
+	 * @ingroup dirty
+	 */
+	virtual void MarkDirty() {}
+
+	/**
+	 * Updates the x and y offsets and the size of the sprite used
+	 * for this vehicle.
+	 * @param direction the direction the vehicle is facing
+	 */
+	virtual void UpdateDeltaXY(Direction direction) {}
+
+	/**
+	 * Sets the expense type associated to this vehicle type
+	 * @param income whether this is income or (running) expenses of the vehicle
+	 */
+	virtual ExpensesType GetExpenseType(bool income) const { return EXPENSES_OTHER; }
+
+	/**
+	 * Invalidates the vehicle list window of this type of vehicle
+	 */
+	virtual WindowClass GetVehicleListWindowClass() const { return WC_NONE; }
+
+	/**
+	 * Play the sound associated with leaving the station
+	 */
+	virtual void PlayLeaveStationSound() const {}
+
+	/**
+	 * Whether this is the primary vehicle in the chain.
+	 */
+	virtual bool IsPrimaryVehicle() const { return false; }
+
+	/**
+	 * Gets the sprite to show for the given direction
+	 * @param direction the direction the vehicle is facing
+	 * @return the sprite for the given vehicle in the given direction
+	 */
+	virtual int GetImage(Direction direction) const { return 0; }
+
+	/**
+	 * Gets the speed in mph that can be sent into SetDParam for string processing.
+	 * @return the vehicle's speed
+	 */
+	virtual int GetDisplaySpeed() const { return 0; }
+
+	/**
+	 * Gets the maximum speed in mph that can be sent into SetDParam for string processing.
+	 * @return the vehicle's maximum speed
+	 */
+	virtual int GetDisplayMaxSpeed() const { return 0; }
+
+	/**
+	 * Gets the running cost of a vehicle
+	 * @return the vehicle's running cost
+	 */
+	virtual Money GetRunningCost() const { return 0; }
+
+	/**
+	 * Check whether the vehicle is in the depot.
+	 * @return true if and only if the vehicle is in the depot.
+	 */
+	virtual bool IsInDepot() const { return false; }
+
+	/**
+	 * Check whether the vehicle is in the depot *and* stopped.
+	 * @return true if and only if the vehicle is in the depot and stopped.
+	 */
+	virtual bool IsStoppedInDepot() const { return this->IsInDepot() && (this->vehstatus & VS_STOPPED) != 0; }
+
+	/**
+	 * Calls the tick handler of the vehicle
+	 */
+	virtual void Tick() {};
+
+	/**
+	 * Gets the running cost of a vehicle  that can be sent into SetDParam for string processing.
+	 * @return the vehicle's running cost
+	 */
+	Money GetDisplayRunningCost() const { return (this->GetRunningCost() >> 8); }
+
+	/**
+	 * Set the next vehicle of this vehicle.
+	 * @param next the next vehicle. NULL removes the next vehicle.
+	 */
+	void SetNext(Vehicle *next);
+
+	/**
+	 * Get the next vehicle of this vehicle.
+	 * @note articulated parts are also counted as vehicles.
+	 * @return the next vehicle or NULL when there isn't a next vehicle.
+	 */
+	inline Vehicle *Next() const { return this->next; }
+
+	/**
+	 * Get the previous vehicle of this vehicle.
+	 * @note articulated parts are also counted as vehicles.
+	 * @return the previous vehicle or NULL when there isn't a previous vehicle.
+	 */
+	inline Vehicle *Previous() const { return this->previous; }
+
+	/**
+	 * Get the first vehicle of this vehicle chain.
+	 * @return the first vehicle of the chain.
+	 */
+	inline Vehicle *First() const { return this->first; }
+};
+
+/**
+ * This class 'wraps' Vehicle; you do not actually instantiate this class.
+ * You create a Vehicle using AllocateVehicle, so it is added to the pool
+ * and you reinitialize that to a Train using:
+ *   v = new (v) Train();
+ *
+ * As side-effect the vehicle type is set correctly.
+ *
+ * A special vehicle is one of the following:
+ *  - smoke
+ *  - electric sparks for trains
+ *  - explosions
+ *  - bulldozer (road works)
+ *  - bubbles (industry)
+ */
+struct SpecialVehicle : public Vehicle {
+	/** Initializes the Vehicle to a special vehicle */
+	SpecialVehicle() { this->type = VEH_SPECIAL; }
+
+	/** We want to 'destruct' the right class. */
+	virtual ~SpecialVehicle() {}
+
+	const char *GetTypeString() const { return "special vehicle"; }
+	void UpdateDeltaXY(Direction direction);
+	void Tick();
+};
+
+/**
+ * This class 'wraps' Vehicle; you do not actually instantiate this class.
+ * You create a Vehicle using AllocateVehicle, so it is added to the pool
+ * and you reinitialize that to a Train using:
+ *   v = new (v) Train();
+ *
+ * As side-effect the vehicle type is set correctly.
+ */
+struct DisasterVehicle : public Vehicle {
+	/** Initializes the Vehicle to a disaster vehicle */
+	DisasterVehicle() { this->type = VEH_DISASTER; }
+
+	/** We want to 'destruct' the right class. */
+	virtual ~DisasterVehicle() {}
+
+	const char *GetTypeString() const { return "disaster vehicle"; }
+	void UpdateDeltaXY(Direction direction);
+	void Tick();
+};
+
+/**
+ * This class 'wraps' Vehicle; you do not actually instantiate this class.
+ * You create a Vehicle using AllocateVehicle, so it is added to the pool
+ * and you reinitialize that to a Train using:
+ *   v = new (v) Train();
+ *
+ * As side-effect the vehicle type is set correctly.
+ */
+struct InvalidVehicle : public Vehicle {
+	/** Initializes the Vehicle to a invalid vehicle */
+	InvalidVehicle() { this->type = VEH_INVALID; }
+
+	/** We want to 'destruct' the right class. */
+	virtual ~InvalidVehicle() {}
+
+	const char *GetTypeString() const { return "invalid vehicle"; }
+	void Tick() {}
+};
+
+#define BEGIN_ENUM_WAGONS(v) do {
+#define END_ENUM_WAGONS(v) } while ((v = v->Next()) != NULL);
+
+static inline VehicleID GetMaxVehicleIndex()
+{
+	/* TODO - This isn't the real content of the function, but
+	 *  with the new pool-system this will be replaced with one that
+	 *  _really_ returns the highest index. Now it just returns
+	 *  the next safe value we are sure about everything is below.
+	 */
+	return GetVehiclePoolSize() - 1;
+}
+
+static inline uint GetNumVehicles()
+{
+	return GetVehiclePoolSize();
+}
+
+#define FOR_ALL_VEHICLES_FROM(v, start) for (v = GetVehicle(start); v != NULL; v = (v->index + 1U < GetVehiclePoolSize()) ? GetVehicle(v->index + 1) : NULL) if (v->IsValid())
+#define FOR_ALL_VEHICLES(v) FOR_ALL_VEHICLES_FROM(v, 0)
+
+/**
+ * Check if an index is a vehicle-index (so between 0 and max-vehicles)
+ * @param index of the vehicle to query
+ * @return Returns true if the vehicle-id is in range
+ */
+static inline bool IsValidVehicleID(uint index)
+{
+	return index < GetVehiclePoolSize() && GetVehicle(index)->IsValid();
+}
+
+/* Returns order 'index' of a vehicle or NULL when it doesn't exists */
+static inline Order *GetVehicleOrder(const Vehicle *v, int index)
+{
+	Order *order = v->orders;
+
+	if (index < 0) return NULL;
+
+	while (order != NULL && index-- > 0)
+		order = order->next;
+
+	return order;
+}
+
+/**
+ * Returns the last order of a vehicle, or NULL if it doesn't exists
+ * @param v Vehicle to query
+ * @return last order of a vehicle, if available
+ */
+static inline Order *GetLastVehicleOrder(const Vehicle *v)
+{
+	Order *order = v->orders;
+
+	if (order == NULL) return NULL;
+
+	while (order->next != NULL)
+		order = order->next;
+
+	return order;
+}
+
+/** Get the first vehicle of a shared-list, so we only have to walk forwards
+ * @param v Vehicle to query
+ * @return first vehicle of a shared-list
+ */
+static inline Vehicle *GetFirstVehicleFromSharedList(const Vehicle *v)
+{
+	Vehicle *u = (Vehicle *)v;
+	while (u->prev_shared != NULL) u = u->prev_shared;
+
+	return u;
+}
+
+/**
+ * Returns the Trackdir on which the vehicle is currently located.
+ * Works for trains and ships.
+ * Currently works only sortof for road vehicles, since they have a fuzzy
+ * concept of being "on" a trackdir. Dunno really what it returns for a road
+ * vehicle that is halfway a tile, never really understood that part. For road
+ * vehicles that are at the beginning or end of the tile, should just return
+ * the diagonal trackdir on which they are driving. I _think_.
+ * For other vehicles types, or vehicles with no clear trackdir (such as those
+ * in depots), returns 0xFF.
+ */
+Trackdir GetVehicleTrackdir(const Vehicle* v);
+
+void CheckVehicle32Day(Vehicle *v);
+
+#endif /* VEHICLE_BASE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/vehicle_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,194 @@
+/* $Id$ */
+
+/** @vehicle.h Functions related to vehicles. */
+
+#ifndef VEHICLE_FUNC_H
+#define VEHICLE_FUNC_H
+
+#include "tile_type.h"
+#include "strings_type.h"
+#include "gfx_type.h"
+#include "direction_type.h"
+#include "cargo_type.h"
+#include "command_type.h"
+#include "vehicle_type.h"
+
+#define is_custom_sprite(x) (x >= 0xFD)
+#define IS_CUSTOM_FIRSTHEAD_SPRITE(x) (x == 0xFD)
+#define IS_CUSTOM_SECONDHEAD_SPRITE(x) (x == 0xFE)
+
+typedef void *VehicleFromPosProc(Vehicle *v, void *data);
+
+void VehicleServiceInDepot(Vehicle *v);
+void VehiclePositionChanged(Vehicle *v);
+Vehicle *GetLastVehicleInChain(Vehicle *v);
+uint CountVehiclesInChain(const Vehicle *v);
+bool IsEngineCountable(const Vehicle *v);
+void DeleteVehicleChain(Vehicle *v);
+void *VehicleFromPos(TileIndex tile, void *data, VehicleFromPosProc *proc);
+void *VehicleFromPosXY(int x, int y, void *data, VehicleFromPosProc *proc);
+void CallVehicleTicks();
+Vehicle *FindVehicleOnTileZ(TileIndex tile, byte z);
+uint8 CalcPercentVehicleFilled(Vehicle *v, StringID *color);
+
+void InitializeTrains();
+byte VehicleRandomBits();
+void ResetVehiclePosHash();
+void ResetVehicleColorMap();
+
+bool CanRefitTo(EngineID engine_type, CargoID cid_to);
+CargoID FindFirstRefittableCargo(EngineID engine_type);
+CommandCost GetRefitCost(EngineID engine_type);
+
+void ViewportAddVehicles(DrawPixelInfo *dpi);
+
+SpriteID GetRotorImage(const Vehicle *v);
+
+uint32 VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y);
+
+StringID VehicleInTheWayErrMsg(const Vehicle* v);
+Vehicle *FindVehicleBetween(TileIndex from, TileIndex to, byte z, bool without_crashed = false);
+Vehicle *GetVehicleTunnelBridge(TileIndex tile, TileIndex endtile);
+
+Vehicle *CheckClickOnVehicle(const ViewPort *vp, int x, int y);
+
+void DecreaseVehicleValue(Vehicle *v);
+void CheckVehicleBreakdown(Vehicle *v);
+void AgeVehicle(Vehicle *v);
+void VehicleEnteredDepotThisTick(Vehicle *v);
+
+void BeginVehicleMove(const Vehicle *v);
+void EndVehicleMove(const Vehicle *v);
+void MarkSingleVehicleDirty(const Vehicle *v);
+
+UnitID GetFreeUnitNumber(VehicleType type);
+
+void TrainConsistChanged(Vehicle *v);
+void TrainPowerChanged(Vehicle *v);
+Money GetTrainRunningCost(const Vehicle *v);
+
+bool VehicleNeedsService(const Vehicle *v);
+
+uint GenerateVehicleSortList(const Vehicle*** sort_list, uint16 *length_of_array, VehicleType type, PlayerID owner, uint32 index, uint16 window_type);
+void BuildDepotVehicleList(VehicleType type, TileIndex tile, Vehicle ***engine_list, uint16 *engine_list_length, uint16 *engine_count, Vehicle ***wagon_list, uint16 *wagon_list_length, uint16 *wagon_count);
+CommandCost SendAllVehiclesToDepot(VehicleType type, uint32 flags, bool service, PlayerID owner, uint16 vlw_flag, uint32 id);
+void VehicleEnterDepot(Vehicle *v);
+
+CommandCost MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs);
+bool CanBuildVehicleInfrastructure(VehicleType type);
+
+void CcCloneVehicle(bool success, TileIndex tile, uint32 p1, uint32 p2);
+
+/* Flags to add to p2 for goto depot commands */
+/* Note: bits 8-10 are used for VLW flags */
+enum {
+	DEPOT_SERVICE       = (1 << 0), // The vehicle will leave the depot right after arrival (serivce only)
+	DEPOT_MASS_SEND     = (1 << 1), // Tells that it's a mass send to depot command (type in VLW flag)
+	DEPOT_DONT_CANCEL   = (1 << 2), // Don't cancel current goto depot command if any
+	DEPOT_LOCATE_HANGAR = (1 << 3), // Find another airport if the target one lacks a hangar
+};
+
+struct GetNewVehiclePosResult {
+	int x, y;
+	TileIndex old_tile;
+	TileIndex new_tile;
+};
+
+/* returns true if staying in the same tile */
+GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v);
+Direction GetDirectionTowards(const Vehicle *v, int x, int y);
+
+static inline bool IsPlayerBuildableVehicleType(VehicleType type)
+{
+	switch (type) {
+		case VEH_TRAIN:
+		case VEH_ROAD:
+		case VEH_SHIP:
+		case VEH_AIRCRAFT:
+			return true;
+
+		default: return false;
+	}
+}
+
+static inline bool IsPlayerBuildableVehicleType(const BaseVehicle *v)
+{
+	return IsPlayerBuildableVehicleType(v->type);
+}
+
+const struct Livery *GetEngineLivery(EngineID engine_type, PlayerID player, EngineID parent_engine_type, const Vehicle *v);
+
+/**
+ * Get the colour map for an engine. This used for unbuilt engines in the user interface.
+ * @param engine_type ID of engine
+ * @param player ID of player
+ * @return A ready-to-use palette modifier
+ */
+SpriteID GetEnginePalette(EngineID engine_type, PlayerID player);
+
+/**
+ * Get the colour map for a vehicle.
+ * @param v Vehicle to get colour map for
+ * @return A ready-to-use palette modifier
+ */
+SpriteID GetVehiclePalette(const Vehicle *v);
+
+extern const uint32 _veh_build_proc_table[];
+extern const uint32 _veh_sell_proc_table[];
+extern const uint32 _veh_refit_proc_table[];
+extern const uint32 _send_to_depot_proc_table[];
+
+/* Functions to find the right command for certain vehicle type */
+static inline uint32 GetCmdBuildVeh(VehicleType type)
+{
+	return _veh_build_proc_table[type];
+}
+
+static inline uint32 GetCmdBuildVeh(const BaseVehicle *v)
+{
+	return GetCmdBuildVeh(v->type);
+}
+
+static inline uint32 GetCmdSellVeh(VehicleType type)
+{
+	return _veh_sell_proc_table[type];
+}
+
+static inline uint32 GetCmdSellVeh(const BaseVehicle *v)
+{
+	return GetCmdSellVeh(v->type);
+}
+
+static inline uint32 GetCmdRefitVeh(VehicleType type)
+{
+	return _veh_refit_proc_table[type];
+}
+
+static inline uint32 GetCmdRefitVeh(const BaseVehicle *v)
+{
+	return GetCmdRefitVeh(v->type);
+}
+
+static inline uint32 GetCmdSendToDepot(VehicleType type)
+{
+	return _send_to_depot_proc_table[type];
+}
+
+static inline uint32 GetCmdSendToDepot(const BaseVehicle *v)
+{
+	return GetCmdSendToDepot(v->type);
+}
+
+bool EnsureNoVehicleOnGround(TileIndex tile);
+void StopAllVehicles();
+
+Vehicle *CreateEffectVehicle(int x, int y, int z, EffectVehicle type);
+Vehicle *CreateEffectVehicleAbove(int x, int y, int z, EffectVehicle type);
+Vehicle *CreateEffectVehicleRel(const Vehicle *v, int x, int y, int z, EffectVehicle type);
+
+extern VehicleID _vehicle_id_ctr_day;
+extern Vehicle *_place_clicked_vehicle;
+extern VehicleID _new_vehicle_id;
+extern uint16 _returned_refit_capacity;
+
+#endif /* VEHICLE_H */
--- a/src/vehicle_gui.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/vehicle_gui.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,33 +5,40 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "player.h"
+#include "player_func.h"
 #include "station.h"
-#include "strings.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "vehicle.h"
-#include "window.h"
 #include "engine.h"
 #include "gui.h"
-#include "command.h"
-#include "gfx.h"
+#include "window_gui.h"
+#include "textbuf_gui.h"
+#include "command_func.h"
 #include "variables.h"
 #include "vehicle_gui.h"
-#include "viewport.h"
+#include "viewport_func.h"
+#include "gfx_func.h"
 #include "train.h"
 #include "newgrf_callbacks.h"
 #include "newgrf_engine.h"
 #include "newgrf_text.h"
-#include "date.h"
 #include "ship.h"
 #include "aircraft.h"
 #include "roadveh.h"
 #include "depot.h"
-#include "helpers.hpp"
 #include "cargotype.h"
 #include "group.h"
+#include "group_gui.h"
+#include "strings_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "vehicle_func.h"
+#include "autoreplace_gui.h"
+#include "core/alloc_func.hpp"
+#include "string_func.h"
+#include "settings_type.h"
+#include "widgets/dropdown_func.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
 
 struct Sorting {
 	Listing aircraft;
@@ -506,6 +513,8 @@
 		for (CargoID cid = 0; cid < NUM_CARGO; cid++) {
 			if (!HasBit(cmask, cid)) continue;
 
+			if (b >= lastof(_userstring) - (2 + 2 * 4)) break; // ", " and two calls to Utf8Encode()
+
 			if (!first) b = strecpy(b, ", ", lastof(_userstring));
 			first = false;
 
@@ -515,6 +524,10 @@
 
 	/* Terminate and display the completed string */
 	*b = '\0';
+
+	/* Make sure we detect any buffer overflow */
+	assert(b < endof(_userstring));
+
 	return DrawStringMultiLine(x, y, STR_SPEC_USERSTRING, w);
 }
 
@@ -542,20 +555,14 @@
 
 	if (va != last_vehicle[0]) {
 		last_vehicle[0] = va;
-		if (IsCustomName(va->string_id)) {
-			GetString(last_name[0], va->string_id, lastof(last_name[0]));
-		} else {
-			last_name[0][0] = '\0';
-		}
+		SetDParam(0, va->index);
+		GetString(last_name[0], STR_VEHICLE_NAME, lastof(last_name[0]));
 	}
 
 	if (vb != last_vehicle[1]) {
 		last_vehicle[1] = vb;
-		if (IsCustomName(vb->string_id)) {
-			GetString(last_name[1], vb->string_id, lastof(last_name[1]));
-		} else {
-			last_name[1][0] = '\0';
-		}
+		SetDParam(1, vb->index);
+		GetString(last_name[1], STR_VEHICLE_NAME, lastof(last_name[1]));
 	}
 
 	r = strcmp(last_name[0], last_name[1]); // sort by name
@@ -736,14 +743,12 @@
 	VLW_WIDGET_CAPTION,
 	VLW_WIDGET_STICKY,
 	VLW_WIDGET_SORT_ORDER,
-	VLW_WIDGET_SORT_BY_TEXT,
 	VLW_WIDGET_SORT_BY_PULLDOWN,
 	VLW_WIDGET_EMPTY_TOP_RIGHT,
 	VLW_WIDGET_LIST,
 	VLW_WIDGET_SCROLLBAR,
 	VLW_WIDGET_OTHER_PLAYER_FILLER,
 	VLW_WIDGET_AVAILABLE_VEHICLES,
-	VLW_WIDGET_MANAGE_VEHICLES,
 	VLW_WIDGET_MANAGE_VEHICLES_DROPDOWN,
 	VLW_WIDGET_STOP_ALL,
 	VLW_WIDGET_START_ALL,
@@ -756,8 +761,7 @@
 	{    WWT_CAPTION,  RESIZE_RIGHT,    14,    11,   247,     0,    13, 0x0,                  STR_018C_WINDOW_TITLE_DRAG_THIS},
 	{  WWT_STICKYBOX,     RESIZE_LR,    14,   248,   259,     0,    13, 0x0,                  STR_STICKY_BUTTON},
 	{ WWT_PUSHTXTBTN,   RESIZE_NONE,    14,     0,    80,    14,    25, STR_SORT_BY,          STR_SORT_ORDER_TIP},
-	{      WWT_PANEL,   RESIZE_NONE,    14,    81,   235,    14,    25, 0x0,                  STR_SORT_CRITERIA_TIP},
-	{    WWT_TEXTBTN,   RESIZE_NONE,    14,   236,   247,    14,    25, STR_0225,             STR_SORT_CRITERIA_TIP},
+	{   WWT_DROPDOWN,   RESIZE_NONE,    14,    81,   247,    14,    25, 0x0,                  STR_SORT_CRITERIA_TIP},
 	{      WWT_PANEL,  RESIZE_RIGHT,    14,   248,   259,    14,    25, 0x0,                  STR_NULL},
 	{     WWT_MATRIX,     RESIZE_RB,    14,     0,   247,    26,   169, 0x0,                  STR_NULL},
 	{  WWT_SCROLLBAR,    RESIZE_LRB,    14,   248,   259,    26,   169, 0x0,                  STR_0190_SCROLL_BAR_SCROLLS_LIST},
@@ -765,8 +769,7 @@
 	{      WWT_PANEL,    RESIZE_RTB,    14,     0,   247,   170,   181, 0x0,                  STR_NULL},
 
 	{ WWT_PUSHTXTBTN,     RESIZE_TB,    14,     0,   105,   170,   181, 0x0,                  STR_AVAILABLE_ENGINES_TIP},
-	{    WWT_TEXTBTN,     RESIZE_TB,    14,   106,   211,   170,   181, STR_MANAGE_LIST,      STR_MANAGE_LIST_TIP},
-	{    WWT_TEXTBTN,     RESIZE_TB,    14,   212,   223,   170,   181, STR_0225,             STR_MANAGE_LIST_TIP},
+	{   WWT_DROPDOWN,     RESIZE_TB,    14,   106,   223,   170,   181, STR_MANAGE_LIST,      STR_MANAGE_LIST_TIP},
 
 	{ WWT_PUSHIMGBTN,     RESIZE_TB,    14,   224,   235,   170,   181, SPR_FLAG_VEH_STOPPED, STR_MASS_STOP_LIST_TIP},
 	{ WWT_PUSHIMGBTN,     RESIZE_TB,    14,   236,   247,   170,   181, SPR_FLAG_VEH_RUNNING, STR_MASS_START_LIST_TIP},
@@ -794,7 +797,6 @@
 	} else {
 		w->SetWidgetsHiddenState(true,
 			VLW_WIDGET_AVAILABLE_VEHICLES,
-			VLW_WIDGET_MANAGE_VEHICLES,
 			VLW_WIDGET_MANAGE_VEHICLES_DROPDOWN,
 			VLW_WIDGET_STOP_ALL,
 			VLW_WIDGET_START_ALL,
@@ -929,7 +931,6 @@
 	int max;
 	int i;
 	const PlayerID owner = (PlayerID)w->caption_color;
-	const Player *p = GetPlayer(owner);
 	const uint16 window_type = w->window_number & VLW_MASK;
 	const uint16 index = GB(w->window_number, 16, 16);
 
@@ -949,7 +950,7 @@
 			break;
 
 		case VLW_STANDARD: /* Company Name */
-			SetDParam(0, p->index);
+			SetDParam(0, owner);
 			SetDParam(1, w->vscroll.count);
 			break;
 
@@ -977,7 +978,6 @@
 	}
 
 	w->SetWidgetsDisabledState(vl->l.list_length == 0,
-		VLW_WIDGET_MANAGE_VEHICLES,
 		VLW_WIDGET_MANAGE_VEHICLES_DROPDOWN,
 		VLW_WIDGET_STOP_ALL,
 		VLW_WIDGET_START_ALL,
@@ -988,7 +988,7 @@
 	/* draw sorting criteria string */
 	DrawString(85, 15, _vehicle_sort_listing[vl->l.sort_type], TC_BLACK);
 	/* draw arrow pointing up/down for ascending/descending sorting */
-	DoDrawString(vl->l.flags & VL_DESC ? DOWNARROW : UPARROW, 69, 15, TC_BLACK);
+	DrawSortButtonState(w, VLW_WIDGET_SORT_ORDER, vl->l.flags & VL_DESC ? SBS_DOWN : SBS_UP);
 
 	max = min(w->vscroll.pos + w->vscroll.cap, vl->l.list_length);
 	for (i = w->vscroll.pos; i < max; ++i) {
@@ -998,14 +998,10 @@
 		SetDParam(0, v->profit_this_year);
 		SetDParam(1, v->profit_last_year);
 
-		DrawVehicleImage(v, x + 19, y + 6, w->widget[VLW_WIDGET_LIST].right - w->widget[VLW_WIDGET_LIST].left - 20, 0, INVALID_VEHICLE);
+		DrawVehicleImage(v, x + 19, y + 6, INVALID_VEHICLE, w->widget[VLW_WIDGET_LIST].right - w->widget[VLW_WIDGET_LIST].left - 20, 0);
 		DrawString(x + 19, y + w->resize.step_height - 8, STR_0198_PROFIT_THIS_YEAR_LAST_YEAR, TC_FROMSTRING);
 
-		if ((v->type == VEH_TRAIN    && v->string_id != STR_SV_TRAIN_NAME)   ||
-			(v->type == VEH_ROAD     && v->string_id != STR_SV_ROADVEH_NAME) ||
-			(v->type == VEH_SHIP     && v->string_id != STR_SV_SHIP_NAME)    ||
-			(v->type == VEH_AIRCRAFT && v->string_id != STR_SV_AIRCRAFT_NAME)) {
-
+		if (v->name != NULL) {
 			/* The vehicle got a name so we will print it */
 			SetDParam(0, v->index);
 			DrawString(x + 19, y, STR_01AB, TC_FROMSTRING);
@@ -1057,7 +1053,7 @@
 					vl->_sorting->order = !!(vl->l.flags & VL_DESC);
 					SetWindowDirty(w);
 					break;
-				case VLW_WIDGET_SORT_BY_TEXT: case VLW_WIDGET_SORT_BY_PULLDOWN:/* Select sorting criteria dropdown menu */
+				case VLW_WIDGET_SORT_BY_PULLDOWN:/* Select sorting criteria dropdown menu */
 					ShowDropDownMenu(w, _vehicle_sort_listing, vl->l.sort_type, VLW_WIDGET_SORT_BY_PULLDOWN, 0, 0);
 					return;
 				case VLW_WIDGET_LIST: { /* Matrix to show vehicles */
@@ -1079,7 +1075,6 @@
 					ShowBuildVehicleWindow(0, vl->vehicle_type);
 					break;
 
-				case VLW_WIDGET_MANAGE_VEHICLES:
 				case VLW_WIDGET_MANAGE_VEHICLES_DROPDOWN: {
 					static StringID action_str[] = {
 						STR_REPLACE_VEHICLES,
@@ -1123,7 +1118,7 @@
 
 					switch (e->we.dropdown.index) {
 						case 0: /* Replace window */
-							ShowReplaceVehicleWindow(vl->vehicle_type);
+							ShowReplaceGroupVehicleWindow(DEFAULT_GROUP, vl->vehicle_type);
 							break;
 						case 1: /* Send for servicing */
 							DoCommandP(0, GB(w->window_number, 16, 16) /* StationID or OrderID (depending on VLW) */,
@@ -1151,6 +1146,7 @@
 			break;
 
 		case WE_TICK: /* resort the list every 20 seconds orso (10 days) */
+			if (_pause_game != 0) break;
 			if (--vl->l.resort_timer == 0) {
 				StationID station = ((w->window_number & VLW_MASK) == VLW_STATION_LIST) ? GB(w->window_number, 16, 16) : INVALID_STATION;
 				PlayerID owner = (PlayerID)w->caption_color;
@@ -1538,7 +1534,7 @@
 		case VEH_ROAD:
 		case VEH_SHIP:
 		case VEH_AIRCRAFT:
-			DrawVehicleImage(v, 3, 57, 0, 0, INVALID_VEHICLE);
+			DrawVehicleImage(v, 3, 57, INVALID_VEHICLE, 0, 0);
 			DrawVehicleDetails(v, 75, 57, w->vscroll.pos, w->vscroll.cap, det_tab);
 			break;
 
@@ -1649,26 +1645,6 @@
 
 /* Unified vehicle GUI - Vehicle View Window */
 
-/** Constants of vehicle view widget indices */
-enum VehicleViewWindowWidgets {
-	VVW_WIDGET_CLOSEBOX = 0,
-	VVW_WIDGET_CAPTION,
-	VVW_WIDGET_STICKY,
-	VVW_WIDGET_PANEL,
-	VVW_WIDGET_VIEWPORT,
-	VVW_WIDGET_START_STOP_VEH,
-	VVW_WIDGET_CENTER_MAIN_VIEH,
-	VVW_WIDGET_GOTO_DEPOT,
-	VVW_WIDGET_REFIT_VEH,
-	VVW_WIDGET_SHOW_ORDERS,
-	VVW_WIDGET_SHOW_DETAILS,
-	VVW_WIDGET_CLONE_VEH,
-	VVW_WIDGET_EMPTY_BOTTOM_RIGHT,
-	VVW_WIDGET_RESIZE,
-	VVW_WIDGET_TURN_AROUND,
-	VVW_WIDGET_FORCE_PROCEED,
-};
-
 /** Vehicle view widgets. */
 static const Widget _vehicle_view_widgets[] = {
 	{   WWT_CLOSEBOX,  RESIZE_NONE,  14,   0,  10,   0,  13, STR_00C5,                 STR_018B_CLOSE_WINDOW },           // VVW_WIDGET_CLOSEBOX
@@ -1987,7 +1963,7 @@
 					SetDParam(0, depot->town_index);
 					SetDParam(1, v->GetDisplaySpeed());
 				}
-				if (HasBit(v->current_order.flags, OFB_HALT_IN_DEPOT) && !HasBit(v->current_order.flags, OFB_PART_OF_ORDERS)) {
+				if (HasBit(v->current_order.flags, OF_HALT_IN_DEPOT) && !HasBit(v->current_order.flags, OF_PART_OF_ORDERS)) {
 					str = _heading_for_depot_strings[v->type] + _patches.vehicle_speed;
 				} else {
 					str = _heading_for_depot_service_strings[v->type] + _patches.vehicle_speed;
@@ -2162,3 +2138,14 @@
 		} break;
 	}
 }
+
+void DrawVehicleImage(const Vehicle *v, int x, int y, VehicleID selection, int count, int skip)
+{
+	switch (v->type) {
+		case VEH_TRAIN:    DrawTrainImage(v, x, y, selection, count, skip); break;
+		case VEH_ROAD:     DrawRoadVehImage(v, x, y, selection, count);     break;
+		case VEH_SHIP:     DrawShipImage(v, x, y, selection);               break;
+		case VEH_AIRCRAFT: DrawAircraftImage(v, x, y, selection);           break;
+		default: NOT_REACHED();
+	}
+}
--- a/src/vehicle_gui.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/vehicle_gui.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,8 +5,8 @@
 #ifndef VEHICLE_GUI_H
 #define VEHICLE_GUI_H
 
-#include "window.h"
-#include "vehicle.h"
+#include "window_gui.h"
+#include "vehicle_type.h"
 
 void DrawVehicleProfitButton(const Vehicle *v, int x, int y);
 void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order);
@@ -22,7 +22,27 @@
 
 extern const StringID _vehicle_sort_listing[];
 
-/* Start of functions regarding vehicle list windows */
+/** Constants of vehicle view widget indices */
+enum VehicleViewWindowWidgets {
+	VVW_WIDGET_CLOSEBOX = 0,
+	VVW_WIDGET_CAPTION,
+	VVW_WIDGET_STICKY,
+	VVW_WIDGET_PANEL,
+	VVW_WIDGET_VIEWPORT,
+	VVW_WIDGET_START_STOP_VEH,
+	VVW_WIDGET_CENTER_MAIN_VIEH,
+	VVW_WIDGET_GOTO_DEPOT,
+	VVW_WIDGET_REFIT_VEH,
+	VVW_WIDGET_SHOW_ORDERS,
+	VVW_WIDGET_SHOW_DETAILS,
+	VVW_WIDGET_CLONE_VEH,
+	VVW_WIDGET_EMPTY_BOTTOM_RIGHT,
+	VVW_WIDGET_RESIZE,
+	VVW_WIDGET_TURN_AROUND,
+	VVW_WIDGET_FORCE_PROCEED,
+};
+
+/** Start of functions regarding vehicle list windows */
 enum {
 	PLY_WND_PRC__OFFSET_TOP_WIDGET = 26,
 	PLY_WND_PRC__SIZE_OF_ROW_TINY  = 13,
@@ -31,7 +51,7 @@
 	PLY_WND_PRC__SIZE_OF_ROW_BIG2  = 39,
 };
 
-/* Vehicle List Window type flags */
+/** Vehicle List Window type flags */
 enum {
 	VLW_STANDARD      = 0 << 8,
 	VLW_SHARED_ORDERS = 1 << 8,
@@ -50,8 +70,8 @@
 
 int DrawVehiclePurchaseInfo(int x, int y, uint w, EngineID engine_number);
 
-void DrawTrainImage(const Vehicle *v, int x, int y, int count, int skip, VehicleID selection);
-void DrawRoadVehImage(const Vehicle *v, int x, int y, int count, VehicleID selection);
+void DrawTrainImage(const Vehicle *v, int x, int y, VehicleID selection, int count, int skip);
+void DrawRoadVehImage(const Vehicle *v, int x, int y, VehicleID selection, int count);
 void DrawShipImage(const Vehicle *v, int x, int y, VehicleID selection);
 void DrawAircraftImage(const Vehicle *v, int x, int y, VehicleID selection);
 
@@ -67,20 +87,9 @@
 void ShowVehicleListWindow(PlayerID player, VehicleType vehicle_type, StationID station);
 void ShowVehicleListWindow(PlayerID player, VehicleType vehicle_type, TileIndex depot_tile);
 
-void ShowReplaceVehicleWindow(VehicleType vehicletype);
 void DrawSmallOrderList(const Vehicle *v, int x, int y);
-void ShowReplaceGroupVehicleWindow(GroupID group, VehicleType veh);
 
-static inline void DrawVehicleImage(const Vehicle *v, int x, int y, int count, int skip, VehicleID selection)
-{
-	switch (v->type) {
-		case VEH_TRAIN:    DrawTrainImage(v, x, y, count, skip, selection); break;
-		case VEH_ROAD:     DrawRoadVehImage(v, x, y, count, selection);     break;
-		case VEH_SHIP:     DrawShipImage(v, x, y, selection);               break;
-		case VEH_AIRCRAFT: DrawAircraftImage(v, x, y, selection);           break;
-		default: NOT_REACHED();
-	}
-}
+void DrawVehicleImage(const Vehicle *v, int x, int y, VehicleID selection, int count, int skip);
 
 static inline uint GetVehicleListHeight(VehicleType type)
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/vehicle_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,55 @@
+/* $Id$ */
+
+/** @file vehicle_type.h Types related to vehicles. */
+
+#ifndef VEHICLE_TYPE_H
+#define VEHICLE_TYPE_H
+
+#include "core/enum_type.hpp"
+
+typedef uint16 VehicleID;
+
+enum VehicleType {
+	VEH_TRAIN,
+	VEH_ROAD,
+	VEH_SHIP,
+	VEH_AIRCRAFT,
+	VEH_SPECIAL,
+	VEH_DISASTER,
+	VEH_END,
+	VEH_INVALID = 0xFF,
+};
+DECLARE_POSTFIX_INCREMENT(VehicleType);
+template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID> {};
+typedef TinyEnumT<VehicleType> VehicleTypeByte;
+
+struct Vehicle;
+
+struct BaseVehicle
+{
+	VehicleTypeByte type;    ///< Type of vehicle
+
+	/**
+	 * Is this vehicle a valid vehicle?
+	 * @return true if and only if the vehicle is valid.
+	 */
+	inline bool IsValid() const { return this->type != VEH_INVALID; }
+};
+
+static const VehicleID INVALID_VEHICLE = 0xFFFF;
+
+/* Effect vehicle types */
+enum EffectVehicle {
+	EV_CHIMNEY_SMOKE   = 0,
+	EV_STEAM_SMOKE     = 1,
+	EV_DIESEL_SMOKE    = 2,
+	EV_ELECTRIC_SPARK  = 3,
+	EV_SMOKE           = 4,
+	EV_EXPLOSION_LARGE = 5,
+	EV_BREAKDOWN_SMOKE = 6,
+	EV_EXPLOSION_SMALL = 7,
+	EV_BULLDOZER       = 8,
+	EV_BUBBLE          = 9
+};
+
+#endif /* VEHICLE_TYPE_H */
--- a/src/video/cocoa/cocoa_v.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/cocoa/cocoa_v.h	Tue Jan 22 21:00:30 2008 +0000
@@ -19,7 +19,7 @@
 
 	/* virtual */ bool ChangeResolution(int w, int h);
 
-	/* virtual */ void ToggleFullscreen(bool fullscreen);
+	/* virtual */ bool ToggleFullscreen(bool fullscreen);
 };
 
 class FVideoDriver_Cocoa: public VideoDriverFactory<FVideoDriver_Cocoa> {
@@ -40,7 +40,7 @@
 	virtual void MakeDirty(int left, int top, int width, int height) = 0;
 	virtual void UpdatePalette(uint first_color, uint num_colors) = 0;
 
-	virtual uint ListModes(OTTDPoint* modes, uint max_modes) = 0;
+	virtual uint ListModes(OTTD_Point* modes, uint max_modes) = 0;
 
 	virtual bool ChangeResolution(int w, int h) = 0;
 
@@ -61,11 +61,16 @@
 extern CocoaSubdriver* _cocoa_subdriver;
 
 CocoaSubdriver *QZ_CreateFullscreenSubdriver(int width, int height, int bpp);
+
+#ifdef ENABLE_COCOA_QUICKDRAW
 CocoaSubdriver *QZ_CreateWindowQuickdrawSubdriver(int width, int height, int bpp);
+#endif
 
+#ifdef ENABLE_COCOA_QUARTZ
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
 CocoaSubdriver *QZ_CreateWindowQuartzSubdriver(int width, int height, int bpp);
 #endif
+#endif
 
 void QZ_GameSizeChanged();
 
@@ -74,4 +79,6 @@
 void QZ_ShowMouse();
 void QZ_HideMouse();
 
+uint QZ_ListModes(OTTD_Point* modes, uint max_modes, CGDirectDisplayID display_id, int display_depth);
+
 #endif /* VIDEO_COCOA_H */
--- a/src/video/cocoa/cocoa_v.mm	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/cocoa/cocoa_v.mm	Tue Jan 22 21:00:30 2008 +0000
@@ -57,12 +57,11 @@
 #include "../../openttd.h"
 #include "../../debug.h"
 #include "../../variables.h"
+#include "../../core/geometry_type.hpp"
 #include "cocoa_v.h"
 #include "../../blitter/factory.hpp"
 #include "../../fileio.h"
-
-#undef Point
-#undef Rect
+#include "../../gfx_func.h"
 
 
 @interface OTTDMain : NSObject
@@ -199,7 +198,7 @@
 static void QZ_UpdateVideoModes()
 {
 	uint i, count;
-	OTTDPoint modes[32];
+	OTTD_Point modes[32];
 
 	assert(_cocoa_subdriver != NULL);
 
@@ -232,15 +231,33 @@
 {
 	CocoaSubdriver *ret;
 
+#ifdef ENABLE_COCOA_QUARTZ
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
-	if (MacOSVersionIsAtLeast(10, 4, 0)) {
+	/* The reason for the version mismatch is due to the fact that the 10.4 binary needs to work on 10.5 as well. */
+	if (MacOSVersionIsAtLeast(10, 5, 0)) {
 		ret = QZ_CreateWindowQuartzSubdriver(width, height, bpp);
 		if (ret != NULL) return ret;
 	}
 #endif
+#endif
 
+#ifdef ENABLE_COCOA_QUICKDRAW
 	ret = QZ_CreateWindowQuickdrawSubdriver(width, height, bpp);
 	if (ret != NULL) return ret;
+#endif
+
+#ifdef ENABLE_COCOA_QUARTZ
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+        /*
+	 * If we get here we are running 10.4 or earlier and either openttd was compiled without the quickdraw driver
+	 * or it failed to load for some reason. Fall back to Quartz if possible even though that driver is slower.
+	 */
+        if (MacOSVersionIsAtLeast(10, 4, 0)) {
+                ret = QZ_CreateWindowQuartzSubdriver(width, height, bpp);
+                if (ret != NULL) return ret;
+        }
+#endif
+#endif
 
 	return NULL;
 }
@@ -344,7 +361,7 @@
 	return ret;
 }
 
-void VideoDriver_Cocoa::ToggleFullscreen(bool full_screen)
+bool VideoDriver_Cocoa::ToggleFullscreen(bool full_screen)
 {
 	bool oldfs;
 
@@ -369,6 +386,7 @@
 	QZ_GameSizeChanged();
 
 	QZ_UpdateVideoModes();
+	return _cocoa_subdriver->IsFullscreen() == full_screen;
 }
 
 
--- a/src/video/cocoa/event.mm	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/cocoa/event.mm	Tue Jan 22 21:00:30 2008 +0000
@@ -40,12 +40,14 @@
 #include "../../debug.h"
 #include "../../os/macosx/splash.h"
 #include "../../variables.h"
+#include "../../settings_type.h"
+#include "../../core/geometry_type.hpp"
 #include "cocoa_v.h"
 #include "cocoa_keys.h"
 #include "../../blitter/factory.hpp"
+#include "../../gfx_func.h"
+#include "../../network/network.h"
 
-#undef Point
-#undef Rect
 
 /* Right Mouse Button Emulation enum */
 enum {
--- a/src/video/cocoa/fullscreen.mm	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/cocoa/fullscreen.mm	Tue Jan 22 21:00:30 2008 +0000
@@ -41,10 +41,10 @@
 
 #include "../../stdafx.h"
 #include "../../debug.h"
-#include "../../variables.h"
+#include "../../core/geometry_type.hpp"
 #include "cocoa_v.h"
+#include "../../gfx_func.h"
 
-#undef Point
 #undef Rect
 
 
@@ -76,6 +76,86 @@
 @end
 
 
+
+uint QZ_ListModes(OTTD_Point* modes, uint max_modes, CGDirectDisplayID display_id, int display_depth)
+{
+	CFArrayRef mode_list;
+	CFIndex num_modes;
+	CFIndex i;
+	uint count = 0;
+
+	mode_list  = CGDisplayAvailableModes(display_id);
+	num_modes = CFArrayGetCount(mode_list);
+
+	/* Build list of modes with the requested bpp */
+	for (i = 0; i < num_modes && count < max_modes; i++) {
+		CFDictionaryRef onemode;
+		CFNumberRef     number;
+		int bpp;
+		int intvalue;
+		bool hasMode;
+		uint16 width, height;
+
+		onemode = (const __CFDictionary*)CFArrayGetValueAtIndex(mode_list, i);
+		number = (const __CFNumber*)CFDictionaryGetValue(onemode, kCGDisplayBitsPerPixel);
+		CFNumberGetValue (number, kCFNumberSInt32Type, &bpp);
+
+		if (bpp != display_depth) continue;
+
+		number = (const __CFNumber*)CFDictionaryGetValue(onemode, kCGDisplayWidth);
+		CFNumberGetValue(number, kCFNumberSInt32Type, &intvalue);
+		width = (uint16)intvalue;
+
+		number = (const __CFNumber*)CFDictionaryGetValue(onemode, kCGDisplayHeight);
+		CFNumberGetValue(number, kCFNumberSInt32Type, &intvalue);
+		height = (uint16)intvalue;
+
+		/* Check if mode is already in the list */
+		{
+			uint i;
+			hasMode = false;
+			for (i = 0; i < count; i++) {
+				if (modes[i].x == width &&  modes[i].y == height) {
+					hasMode = true;
+					break;
+				}
+			}
+		}
+
+		if (hasMode) continue;
+
+		/* Add mode to the list */
+		modes[count].x = width;
+		modes[count].y = height;
+		count++;
+	}
+
+	/* Sort list smallest to largest */
+	{
+		uint i, j;
+		for (i = 0; i < count; i++) {
+			for (j = 0; j < count-1; j++) {
+				if (modes[j].x > modes[j + 1].x || (
+					modes[j].x == modes[j + 1].x &&
+					modes[j].y >  modes[j + 1].y
+					)) {
+					uint tmpw = modes[j].x;
+					uint tmph = modes[j].y;
+
+					modes[j].x = modes[j + 1].x;
+					modes[j].y = modes[j + 1].y;
+
+					modes[j + 1].x = tmpw;
+					modes[j + 1].y = tmph;
+				}
+			}
+		}
+	}
+
+	return count;
+}
+
+
 class FullscreenSubdriver: public CocoaSubdriver {
 	int                display_width;
 	int                display_height;
@@ -447,82 +527,9 @@
 		CGDisplaySetPalette(display_id, palette);
 	}
 
-	virtual uint ListModes(OTTDPoint* modes, uint max_modes)
+	virtual uint ListModes(OTTD_Point* modes, uint max_modes)
 	{
-		CFArrayRef mode_list;
-		CFIndex num_modes;
-		CFIndex i;
-		uint count = 0;
-
-		mode_list  = CGDisplayAvailableModes(display_id);
-		num_modes = CFArrayGetCount(mode_list);
-
-		/* Build list of modes with the requested bpp */
-		for (i = 0; i < num_modes && count < max_modes; i++) {
-			CFDictionaryRef onemode;
-			CFNumberRef     number;
-			int bpp;
-			int intvalue;
-			bool hasMode;
-			uint16 width, height;
-
-			onemode = (const __CFDictionary*)CFArrayGetValueAtIndex(mode_list, i);
-			number = (const __CFNumber*)CFDictionaryGetValue(onemode, kCGDisplayBitsPerPixel);
-			CFNumberGetValue (number, kCFNumberSInt32Type, &bpp);
-
-			if (bpp != display_depth) continue;
-
-			number = (const __CFNumber*)CFDictionaryGetValue(onemode, kCGDisplayWidth);
-			CFNumberGetValue(number, kCFNumberSInt32Type, &intvalue);
-			width = (uint16)intvalue;
-
-			number = (const __CFNumber*)CFDictionaryGetValue(onemode, kCGDisplayHeight);
-			CFNumberGetValue(number, kCFNumberSInt32Type, &intvalue);
-			height = (uint16)intvalue;
-
-			/* Check if mode is already in the list */
-			{
-				uint i;
-				hasMode = false;
-				for (i = 0; i < count; i++) {
-					if (modes[i].x == width &&  modes[i].y == height) {
-						hasMode = true;
-						break;
-					}
-				}
-			}
-
-			if (hasMode) continue;
-
-			/* Add mode to the list */
-			modes[count].x = width;
-			modes[count].y = height;
-			count++;
-		}
-
-		/* Sort list smallest to largest */
-		{
-			uint i, j;
-			for (i = 0; i < count; i++) {
-				for (j = 0; j < count-1; j++) {
-					if (modes[j].x > modes[j + 1].x || (
-						modes[j].x == modes[j + 1].x &&
-						modes[j].y >  modes[j + 1].y
-						)) {
-						uint tmpw = modes[j].x;
-						uint tmph = modes[j].y;
-
-						modes[j].x = modes[j + 1].x;
-						modes[j].y = modes[j + 1].y;
-
-						modes[j + 1].x = tmpw;
-						modes[j + 1].y = tmph;
-					}
-				}
-			}
-		}
-
-		return count;
+		return QZ_ListModes(modes, max_modes, display_id, display_depth);
 	}
 
 	virtual bool ChangeResolution(int w, int h)
--- a/src/video/cocoa/wnd_quartz.mm	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/cocoa/wnd_quartz.mm	Tue Jan 22 21:00:30 2008 +0000
@@ -7,6 +7,7 @@
  ******************************************************************************/
 
 #ifdef WITH_COCOA
+#ifdef ENABLE_COCOA_QUARTZ
 
 #include <AvailabilityMacros.h>
 
@@ -38,10 +39,11 @@
 
 #include "../../stdafx.h"
 #include "../../debug.h"
-#include "../../variables.h"
+#include "../../core/geometry_type.hpp"
 #include "cocoa_v.h"
+#include "../../core/math_func.hpp"
+#include "../../gfx_func.h"
 
-#undef Point
 #undef Rect
 
 
@@ -135,7 +137,7 @@
 	virtual void MakeDirty(int left, int top, int width, int height);
 	virtual void UpdatePalette(uint first_color, uint num_colors);
 
-	virtual uint ListModes(OTTDPoint* modes, uint max_modes);
+	virtual uint ListModes(OTTD_Point* modes, uint max_modes);
 
 	virtual bool ChangeResolution(int w, int h);
 
@@ -656,14 +658,9 @@
 	num_dirty_rects = MAX_DIRTY_RECTS;
 }
 
-uint WindowQuartzSubdriver::ListModes(OTTDPoint* modes, uint max_modes)
+uint WindowQuartzSubdriver::ListModes(OTTD_Point* modes, uint max_modes)
 {
-	if (max_modes == 0) return 0;
-
-	modes[0].x = window_width;
-	modes[0].y = window_height;
-
-	return 1;
+	return QZ_ListModes(modes, max_modes, kCGDirectMainDisplay, buffer_depth);
 }
 
 bool WindowQuartzSubdriver::ChangeResolution(int w, int h)
@@ -802,5 +799,7 @@
 	return ret;
 }
 
+
 #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 */
+#endif /* ENABLE_COCOA_QUARTZ */
 #endif /* WITH_COCOA */
--- a/src/video/cocoa/wnd_quickdraw.mm	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/cocoa/wnd_quickdraw.mm	Tue Jan 22 21:00:30 2008 +0000
@@ -7,6 +7,7 @@
  ******************************************************************************/
 
 #ifdef WITH_COCOA
+#ifdef ENABLE_COCOA_QUICKDRAW
 
 #define MAC_OS_X_VERSION_MIN_REQUIRED    MAC_OS_X_VERSION_10_3
 #define MAC_OS_X_VERSION_MAX_ALLOWED     MAC_OS_X_VERSION_10_3
@@ -38,10 +39,11 @@
 
 #include "../../stdafx.h"
 #include "../../debug.h"
-#include "../../variables.h"
+#include "../../core/geometry_type.hpp"
 #include "cocoa_v.h"
+#include "../../core/math_func.hpp"
+#include "../../gfx_func.h"
 
-#undef Point
 #undef Rect
 
 
@@ -150,7 +152,7 @@
 	virtual void MakeDirty(int left, int top, int width, int height);
 	virtual void UpdatePalette(uint first_color, uint num_colors);
 
-	virtual uint ListModes(OTTDPoint* modes, uint max_modes);
+	virtual uint ListModes(OTTD_Point* modes, uint max_modes);
 
 	virtual bool ChangeResolution(int w, int h);
 
@@ -681,14 +683,9 @@
 	num_dirty_rects = MAX_DIRTY_RECTS;
 }
 
-uint WindowQuickdrawSubdriver::ListModes(OTTDPoint* modes, uint max_modes)
+uint WindowQuickdrawSubdriver::ListModes(OTTD_Point* modes, uint max_modes)
 {
-	if (max_modes == 0) return 0;
-
-	modes[0].x = window_width;
-	modes[0].y = window_height;
-
-	return 1;
+	return QZ_ListModes(modes, max_modes, kCGDirectMainDisplay, buffer_depth);
 }
 
 bool WindowQuickdrawSubdriver::ChangeResolution(int w, int h)
@@ -798,8 +795,8 @@
 {
 	WindowQuickdrawSubdriver *ret;
 
-	if (MacOSVersionIsAtLeast(10, 4, 0)) {
-		DEBUG(driver, 0, "The cocoa quickdraw subdriver is not recommended for Mac OS X 10.4 or later.");
+	if (MacOSVersionIsAtLeast(10, 5, 0)) {
+		DEBUG(driver, 0, "The cocoa quickdraw subdriver is not recommended for Mac OS X 10.5 or later.");
 	}
 
 	if (bpp != 8 && bpp != 32) {
@@ -817,4 +814,5 @@
 	return ret;
 }
 
+#endif /* ENABLE_COCOA_QUICKDRAW */
 #endif /* WITH_COCOA */
--- a/src/video/dedicated_v.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/dedicated_v.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,15 +6,17 @@
 
 #include "../openttd.h"
 #include "../debug.h"
-#include "../functions.h"
-#include "../gfx.h"
+#include "../gfx_func.h"
 #include "../network/network.h"
-#include "../window.h"
+#include "../network/network_internal.h"
 #include "../console.h"
 #include "../variables.h"
 #include "../genworld.h"
 #include "../fileio.h"
+#include "../fios.h"
 #include "../blitter/factory.hpp"
+#include "../core/alloc_func.hpp"
+#include "../player_func.h"
 #include "dedicated_v.h"
 
 #ifdef BEOS_NET_SERVER
@@ -133,7 +135,7 @@
 {
 	int bpp = BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth();
 	if (bpp == 0) _dedicated_video_mem = NULL;
-	else          _dedicated_video_mem = malloc(_cur_resolution[0] * _cur_resolution[1] * (bpp / 8));
+	else          _dedicated_video_mem = MallocT<byte>(_cur_resolution[0] * _cur_resolution[1] * (bpp / 8));
 
 	_screen.width = _screen.pitch = _cur_resolution[0];
 	_screen.height = _cur_resolution[1];
@@ -168,7 +170,7 @@
 
 void VideoDriver_Dedicated::MakeDirty(int left, int top, int width, int height) {}
 bool VideoDriver_Dedicated::ChangeResolution(int w, int h) { return false; }
-void VideoDriver_Dedicated::ToggleFullscreen(bool fs) {}
+bool VideoDriver_Dedicated::ToggleFullscreen(bool fs) { return false; }
 
 #if defined(UNIX) || defined(__OS2__) || defined(PSP)
 static bool InputWaiting()
--- a/src/video/dedicated_v.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/dedicated_v.h	Tue Jan 22 21:00:30 2008 +0000
@@ -17,12 +17,18 @@
 
 	/* virtual */ bool ChangeResolution(int w, int h);
 
-	/* virtual */ void ToggleFullscreen(bool fullscreen);
+	/* virtual */ bool ToggleFullscreen(bool fullscreen);
 };
 
 class FVideoDriver_Dedicated: public VideoDriverFactory<FVideoDriver_Dedicated> {
 public:
+#ifdef DEDICATED
+	/* Automatically select this dedicated driver when making a dedicated
+	 * server build. */
+	static const int priority = 10;
+#else
 	static const int priority = 0;
+#endif
 	/* virtual */ const char *GetName() { return "dedicated"; }
 	/* virtual */ const char *GetDescription() { return "Dedicated Video Driver"; }
 	/* virtual */ Driver *CreateInstance() { return new VideoDriver_Dedicated(); }
--- a/src/video/null_v.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/null_v.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -2,9 +2,8 @@
 
 #include "../stdafx.h"
 #include "../openttd.h"
-#include "../gfx.h"
+#include "../gfx_func.h"
 #include "../variables.h"
-#include "../window.h"
 #include "../debug.h"
 #include "../blitter/factory.hpp"
 #include "null_v.h"
@@ -39,4 +38,4 @@
 
 bool VideoDriver_Null::ChangeResolution(int w, int h) { return false; }
 
-void VideoDriver_Null::ToggleFullscreen(bool fs) {}
+bool VideoDriver_Null::ToggleFullscreen(bool fs) { return false; }
--- a/src/video/null_v.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/null_v.h	Tue Jan 22 21:00:30 2008 +0000
@@ -20,7 +20,7 @@
 
 	/* virtual */ bool ChangeResolution(int w, int h);
 
-	/* virtual */ void ToggleFullscreen(bool fullscreen);
+	/* virtual */ bool ToggleFullscreen(bool fullscreen);
 };
 
 class FVideoDriver_Null: public VideoDriverFactory<FVideoDriver_Null> {
--- a/src/video/sdl_v.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/sdl_v.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,14 +6,12 @@
 
 #include "../openttd.h"
 #include "../debug.h"
-#include "../functions.h"
-#include "../gfx.h"
-#include "../macros.h"
+#include "../gfx_func.h"
 #include "../sdl.h"
-#include "../window.h"
-#include "../network/network.h"
 #include "../variables.h"
 #include "../blitter/factory.hpp"
+#include "../network/network.h"
+#include "../core/math_func.hpp"
 #include "sdl_v.h"
 #include <SDL.h>
 
@@ -524,14 +522,16 @@
 	return CreateMainSurface(w, h);
 }
 
-void VideoDriver_SDL::ToggleFullscreen(bool fullscreen)
+bool VideoDriver_SDL::ToggleFullscreen(bool fullscreen)
 {
 	_fullscreen = fullscreen;
 	GetVideoModes(); // get the list of available video modes
 	if (_num_resolutions == 0 || !this->ChangeResolution(_cur_resolution[0], _cur_resolution[1])) {
 		// switching resolution failed, put back full_screen to original status
 		_fullscreen ^= true;
+		return false;
 	}
+	return true;
 }
 
 #endif /* WITH_SDL */
--- a/src/video/sdl_v.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/sdl_v.h	Tue Jan 22 21:00:30 2008 +0000
@@ -17,7 +17,7 @@
 
 	/* virtual */ bool ChangeResolution(int w, int h);
 
-	/* virtual */ void ToggleFullscreen(bool fullscreen);
+	/* virtual */ bool ToggleFullscreen(bool fullscreen);
 };
 
 class FVideoDriver_SDL: public VideoDriverFactory<FVideoDriver_SDL> {
--- a/src/video/video_driver.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/video_driver.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -13,7 +13,7 @@
 
 	virtual bool ChangeResolution(int w, int h) = 0;
 
-	virtual void ToggleFullscreen(bool fullscreen) = 0;
+	virtual bool ToggleFullscreen(bool fullscreen) = 0;
 };
 
 class VideoDriverFactoryBase: public DriverFactoryBase {
@@ -31,5 +31,9 @@
 };
 
 extern VideoDriver *_video_driver;
+extern char _ini_videodriver[32];
+extern int _num_resolutions;
+extern uint16 _resolutions[32][2];
+extern uint16 _cur_resolution[2];
 
 #endif /* VIDEO_VIDEO_DRIVER_HPP */
--- a/src/video/win32_v.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/win32_v.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -2,14 +2,12 @@
 
 #include "../stdafx.h"
 #include "../openttd.h"
-#include "../functions.h"
-#include "../gfx.h"
-#include "../macros.h"
-#include "../network/network.h"
+#include "../gfx_func.h"
 #include "../variables.h"
 #include "../win32.h"
-#include "../window.h"
 #include "../blitter/factory.hpp"
+#include "../network/network.h"
+#include "../core/math_func.hpp"
 #include "win32_v.h"
 #include <windows.h>
 #include <tchar.h>
@@ -213,7 +211,7 @@
 	}
 }
 
-static void MakeWindow(bool full_screen)
+static bool MakeWindow(bool full_screen)
 {
 	_fullscreen = full_screen;
 
@@ -245,8 +243,8 @@
 		settings.dmDisplayFrequency = _display_hz;
 
 		if (ChangeDisplaySettings(&settings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) {
-			MakeWindow(false);
-			return;
+			MakeWindow(false);  // don't care about the result
+			return false;  // the request failed
 		}
 	} else if (_wnd.fullscreen) {
 		// restore display?
@@ -294,6 +292,7 @@
 		}
 	}
 	GameSizeChanged(); // invalidate all windows, force redraw
+	return true; // the request succedded
 }
 
 static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -898,12 +897,10 @@
 	_wnd.width = _wnd.width_org = w;
 	_wnd.height = _wnd.height_org = h;
 
-	MakeWindow(_fullscreen); // _wnd.fullscreen screws up ingame resolution switching
-
-	return true;
+	return MakeWindow(_fullscreen); // _wnd.fullscreen screws up ingame resolution switching
 }
 
-void VideoDriver_Win32::ToggleFullscreen(bool full_screen)
+bool VideoDriver_Win32::ToggleFullscreen(bool full_screen)
 {
-	MakeWindow(full_screen);
+	return MakeWindow(full_screen);
 }
--- a/src/video/win32_v.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/video/win32_v.h	Tue Jan 22 21:00:30 2008 +0000
@@ -17,7 +17,7 @@
 
 	/* virtual */ bool ChangeResolution(int w, int h);
 
-	/* virtual */ void ToggleFullscreen(bool fullscreen);
+	/* virtual */ bool ToggleFullscreen(bool fullscreen);
 };
 
 class FVideoDriver_Win32: public VideoDriverFactory<FVideoDriver_Win32> {
--- a/src/viewport.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/viewport.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,19 +5,12 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
+#include "tile_cmd.h"
 #include "gui.h"
 #include "spritecache.h"
-#include "strings.h"
-#include "table/sprites.h"
-#include "table/strings.h"
 #include "landscape.h"
-#include "map.h"
-#include "viewport.h"
-#include "window.h"
-#include "vehicle.h"
+#include "viewport_func.h"
 #include "station.h"
-#include "gfx.h"
 #include "town.h"
 #include "signs.h"
 #include "waypoint.h"
@@ -28,13 +21,37 @@
 #include "blitter/factory.hpp"
 #include "newgrf_fsmports.h"
 #include "transparency.h"
+#include "strings_func.h"
+#include "zoom_func.h"
+#include "vehicle_func.h"
+#include "player_func.h"
+#include "settings_type.h"
+
+#include "table/sprites.h"
+#include "table/strings.h"
 
 #define VIEWPORT_DRAW_MEM (65536 * 2)
 
+PlaceProc *_place_proc;
+Point _tile_fract_coords;
 ZoomLevel _saved_scrollpos_zoom;
 
-/* XXX - maximum viewports is maximum windows - 2 (main toolbar + status bar) */
-static ViewPort _viewports[25 - 2];
+/**
+ * The maximum number of viewports depends on the maximum number
+ * of windows. Technically is could be the maximum number of
+ * windows, but there is always at least one window that does
+ * not need a viewport. Not having 'support' for that viewport
+ * saves some time and memory.
+ * For the introduction GUI and create game GUIs there is no
+ * need for more than one viewport, however in the normal game
+ * and scenario editor one can make a lot of viewports. For the
+ * normal game one always has a main toolbar and a status bar,
+ * however the statusbar does not exist on the scenario editor.
+ *
+ * This means that we can only safely assume that there is one
+ * window without viewport.
+ */
+static ViewPort _viewports[MAX_NUMBER_OF_WINDOWS - 1];
 static uint32 _active_viewports;    ///< bitmasked variable where each bit signifies if a viewport is in use or not
 assert_compile(lengthof(_viewports) < sizeof(_active_viewports) * 8);
 
@@ -444,10 +461,10 @@
 void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out)
 {
 	w->SetWidgetDisabledState(widget_zoom_in, vp->zoom == ZOOM_LVL_MIN);
-	InvalidateWidget(w, widget_zoom_in);
+	w->InvalidateWidget(widget_zoom_in);
 
 	w->SetWidgetDisabledState(widget_zoom_out, vp->zoom == ZOOM_LVL_MAX);
-	InvalidateWidget(w, widget_zoom_out);
+	w->InvalidateWidget(widget_zoom_out);
 }
 
 /**
@@ -854,23 +871,22 @@
 	px -= _thd.selstart.x;
 	py -= _thd.selstart.y;
 
-	switch (_thd.drawstyle) {
-	case HT_LINE | HT_DIR_X:  return py == 0; // x direction
-	case HT_LINE | HT_DIR_Y:  return px == 0; // y direction
-	case HT_LINE | HT_DIR_HU: return px == -py || px == -py - 16; // horizontal upper
-	case HT_LINE | HT_DIR_HL: return px == -py || px == -py + 16; // horizontal lower
-	case HT_LINE | HT_DIR_VL: return px == py || px == py + 16; // vertival left
-	case HT_LINE | HT_DIR_VR: return px == py || px == py - 16; // vertical right
-	default:
-		NOT_REACHED();
+	if ((_thd.drawstyle & ~HT_DIR_MASK) != HT_LINE) return false;
+
+	switch (_thd.drawstyle & HT_DIR_MASK) {
+		case HT_DIR_X:  return py == 0; // x direction
+		case HT_DIR_Y:  return px == 0; // y direction
+		case HT_DIR_HU: return px == -py || px == -py - 16; // horizontal upper
+		case HT_DIR_HL: return px == -py || px == -py + 16; // horizontal lower
+		case HT_DIR_VL: return px == py || px == py + 16; // vertival left
+		case HT_DIR_VR: return px == py || px == py - 16; // vertical right
+		default:
+			NOT_REACHED();
 	}
-
-	/* useless, but avoids compiler warning this way */
-	return 0;
 }
 
 // [direction][side]
-static const int _AutorailType[6][2] = {
+static const HighLightStyle _autorail_type[6][2] = {
 	{ HT_DIR_X,  HT_DIR_X },
 	{ HT_DIR_Y,  HT_DIR_Y },
 	{ HT_DIR_HU, HT_DIR_HL },
@@ -982,7 +998,7 @@
 			/* autorail highlight piece under cursor */
 			uint type = _thd.drawstyle & 0xF;
 			assert(type <= 5);
-			DrawAutorailSelection(ti, _AutorailType[type][0]);
+			DrawAutorailSelection(ti, _autorail_type[type][0]);
 		} else if (IsPartOfAutoLine(ti->x, ti->y)) {
 			/* autorail highlighting long line */
 			int dir = _thd.drawstyle & ~0xF0;
@@ -995,7 +1011,7 @@
 				side = Delta(Delta(TileX(start), TileX(ti->tile)), Delta(TileY(start), TileY(ti->tile)));
 			}
 
-			DrawAutorailSelection(ti, _AutorailType[dir][side]);
+			DrawAutorailSelection(ti, _autorail_type[dir][side]);
 		}
 		return;
 	}
@@ -1691,7 +1707,7 @@
 	const ViewPort *vp = w->viewport;
 
 	if (WP(w, vp_d).follow_vehicle != INVALID_VEHICLE) {
-		const Vehicle* veh = GetVehicle(WP(w,vp_d).follow_vehicle);
+		const Vehicle* veh = GetVehicle(WP(w, vp_d).follow_vehicle);
 		Point pt = MapXYZToViewport(vp, veh->x_pos, veh->y_pos, veh->z_pos);
 
 		SetViewportPosition(w, pt.x, pt.y);
@@ -2242,9 +2258,9 @@
 }
 
 /** returns the best autorail highlight type from map coordinates */
-static byte GetAutorailHT(int x, int y)
+static HighLightStyle GetAutorailHT(int x, int y)
 {
-	return HT_RAIL | _AutorailPiece[x & 0xF][y & 0xF];
+	return HT_RAIL | _autorail_piece[x & 0xF][y & 0xF];
 }
 
 /**
@@ -2389,7 +2405,7 @@
 
 /** returns information about the 2x1 piece to be build.
  * The lower bits (0-3) are the track type. */
-static byte Check2x1AutoRail(int mode)
+static HighLightStyle Check2x1AutoRail(int mode)
 {
 	int fxpy = _tile_fract_coords.x + _tile_fract_coords.y;
 	int sxpy = (_thd.selend.x & 0xF) + (_thd.selend.y & 0xF);
@@ -2397,28 +2413,27 @@
 	int sxmy = (_thd.selend.x & 0xF) - (_thd.selend.y & 0xF);
 
 	switch (mode) {
-	case 0: // end piece is lower right
-		if (fxpy >= 20 && sxpy <= 12) { /*SwapSelection(); DoRailroadTrack(0); */return 3; }
-		if (fxmy < -3 && sxmy > 3) {/* DoRailroadTrack(0); */return 5; }
-		return 1;
-
-	case 1:
-		if (fxmy > 3 && sxmy < -3) { /*SwapSelection(); DoRailroadTrack(0); */return 4; }
-		if (fxpy <= 12 && sxpy >= 20) { /*DoRailroadTrack(0); */return 2; }
-		return 1;
-
-	case 2:
-		if (fxmy > 3 && sxmy < -3) { /*DoRailroadTrack(3);*/ return 4; }
-		if (fxpy >= 20 && sxpy <= 12) { /*SwapSelection(); DoRailroadTrack(0); */return 3; }
-		return 0;
-
-	case 3:
-		if (fxmy < -3 && sxmy > 3) { /*SwapSelection(); DoRailroadTrack(3);*/ return 5; }
-		if (fxpy <= 12 && sxpy >= 20) { /*DoRailroadTrack(0); */return 2; }
-		return 0;
+		default: NOT_REACHED();
+		case 0: // end piece is lower right
+			if (fxpy >= 20 && sxpy <= 12) { /*SwapSelection(); DoRailroadTrack(0); */return HT_DIR_HL; }
+			if (fxmy < -3 && sxmy > 3) {/* DoRailroadTrack(0); */return HT_DIR_VR; }
+			return HT_DIR_Y;
+
+		case 1:
+			if (fxmy > 3 && sxmy < -3) { /*SwapSelection(); DoRailroadTrack(0); */return HT_DIR_VL; }
+			if (fxpy <= 12 && sxpy >= 20) { /*DoRailroadTrack(0); */return HT_DIR_HU; }
+			return HT_DIR_Y;
+
+		case 2:
+			if (fxmy > 3 && sxmy < -3) { /*DoRailroadTrack(3);*/ return HT_DIR_VL; }
+			if (fxpy >= 20 && sxpy <= 12) { /*SwapSelection(); DoRailroadTrack(0); */return HT_DIR_HL; }
+			return HT_DIR_X;
+
+		case 3:
+			if (fxmy < -3 && sxmy > 3) { /*SwapSelection(); DoRailroadTrack(3);*/ return HT_DIR_VR; }
+			if (fxpy <= 12 && sxpy >= 20) { /*DoRailroadTrack(0); */return HT_DIR_HU; }
+			return HT_DIR_X;
 	}
-
-	return 0; // avoids compiler warnings
 }
 
 /** Check if the direction of start and end tile should be swapped based on
@@ -2762,7 +2777,7 @@
 
 				/* If dragging an area (eg dynamite tool) and it is actually a single
 				 * row/column, change the type to 'line' to get proper calculation for height */
-				style = _thd.next_drawstyle;
+				style = (HighLightStyle)_thd.next_drawstyle;
 				if (style & HT_RECT) {
 					if (dx == 1) {
 						style = HT_LINE | HT_DIR_Y;
--- a/src/viewport.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/* $Id$ */
-
-/** @file viewport.h */
-
-#ifndef VIEWPORT_H
-#define VIEWPORT_H
-
-#include "zoom.hpp"
-#include "newgrf_fsmports.h"
-
-struct ViewPort {
-	int left,top;                       // screen coordinates for the viewport
-	int width, height;                  // screen width/height for the viewport
-
-	int virtual_left, virtual_top;      // virtual coordinates
-	int virtual_width, virtual_height;  // these are just width << zoom, height << zoom
-
-	ZoomLevel zoom;
-};
-
-void SetSelectionRed(bool);
-
-/* viewport.cpp */
-void InitViewports();
-void DeleteWindowViewport(Window *w);
-void AssignWindowViewport(Window *w, int x, int y,
-	int width, int height, uint32 follow_flags, ZoomLevel zoom);
-ViewPort *IsPtInWindowViewport(const Window *w, int x, int y);
-Point GetTileBelowCursor();
-void UpdateViewportPosition(Window *w);
-
-enum {
-	ZOOM_IN   = 0,
-	ZOOM_OUT  = 1,
-	ZOOM_NONE = 2, // hack, used to update the button status
-};
-
-bool DoZoomInOutWindow(int how, Window *w);
-void ZoomInOrOutToCursorWindow(bool in, Window * w);
-Point GetTileZoomCenterWindow(bool in, Window * w);
-void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out);
-
-static inline void MaxZoomInOut(int how, Window *w)
-{
-	while (DoZoomInOutWindow(how, w)) {};
-}
-
-/**
- * Some values for constructing bounding boxes (BB). The Z positions under bridges are:
- * z=0..5  Everything that can be built under low bridges.
- * z=6     reserved, currently unused.
- * z=7     Z separator between bridge/tunnel and the things under/above it.
- */
-enum {
-	BB_HEIGHT_UNDER_BRIDGE = 6, ///< Everything that can be built under low bridges, must not exceed this Z height.
-	BB_Z_SEPARATOR  = 7,        ///< Separates the bridge/tunnel from the things under/above it.
-};
-
-void OffsetGroundSprite(int x, int y);
-
-void DrawGroundSprite(SpriteID image, SpriteID pal, const SubSprite *sub = NULL);
-void DrawGroundSpriteAt(SpriteID image, SpriteID pal, int32 x, int32 y, byte z, const SubSprite *sub = NULL);
-void AddSortableSpriteToDraw(SpriteID image, SpriteID pal, int x, int y, int w, int h, int dz, int z, bool transparent = false, int bb_offset_x = 0, int bb_offset_y = 0, int bb_offset_z = 0, const SubSprite *sub = NULL);
-void *AddStringToDraw(int x, int y, StringID string, uint64 params_1, uint64 params_2);
-void AddChildSpriteScreen(SpriteID image, SpriteID pal, int x, int y, bool transparent = false, const SubSprite *sub = NULL);
-
-
-void StartSpriteCombine();
-void EndSpriteCombine();
-
-void HandleViewportClicked(const ViewPort *vp, int x, int y);
-void PlaceObject();
-void SetRedErrorSquare(TileIndex tile);
-void SetTileSelectSize(int w, int h);
-void SetTileSelectBigSize(int ox, int oy, int sx, int sy);
-
-Vehicle *CheckMouseOverVehicle();
-
-/** Viewport place method (type of highlighted area and placed objects) */
-enum ViewportPlaceMethod {
-	VPM_X_OR_Y          = 0, ///< drag in X or Y direction
-	VPM_FIX_X           = 1, ///< drag only in X axis
-	VPM_FIX_Y           = 2, ///< drag only in Y axis
-	VPM_RAILDIRS        = 3, ///< all rail directions
-	VPM_X_AND_Y         = 4, ///< area of land in X and Y directions
-	VPM_X_AND_Y_LIMITED = 5, ///< area of land of limited size
-	VPM_SIGNALDIRS      = 6, ///< similiar to VMP_RAILDIRS, but with different cursor
-};
-
-/** Viewport highlight mode (for highlighting tiles below cursor) */
-enum ViewportHighlightMode {
-	VHM_NONE    = 0, ///< default
-	VHM_RECT    = 1, ///< rectangle (stations, depots, ...)
-	VHM_POINT   = 2, ///< point (lower land, raise land, level land, ...)
-	VHM_SPECIAL = 3, ///< special mode used for highlighting while dragging (and for tunnels/docks)
-	VHM_DRAG    = 4, ///< dragging items in the depot windows
-	VHM_RAIL    = 5, ///< rail pieces
-};
-
-void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method);
-void VpStartPlaceSizing(TileIndex tile, ViewportPlaceMethod method, byte process);
-void VpSetPresizeRange(uint from, uint to);
-void VpSetPlaceSizingLimit(int limit);
-
-/* highlighting draw styles */
-typedef byte HighLightStyle;
-enum HighLightStyles {
-	HT_NONE   = 0x00,
-	HT_RECT   = 0x80,
-	HT_POINT  = 0x40,
-	HT_LINE   = 0x20,    ///< used for autorail highlighting (longer streches)
-	                     ///< (uses lower bits to indicate direction)
-	HT_RAIL   = 0x10,    ///< autorail (one piece)
-	                     ///< (uses lower bits to indicate direction)
-	HT_DRAG_MASK = 0xF0, ///< masks the drag-type
-
-	/* lower bits (used with HT_LINE and HT_RAIL):
-	 * (see ASCII art in autorail.h for a visual interpretation) */
-	HT_DIR_X  = 0,    ///< X direction
-	HT_DIR_Y  = 1,    ///< Y direction
-	HT_DIR_HU = 2,    ///< horizontal upper
-	HT_DIR_HL = 3,    ///< horizontal lower
-	HT_DIR_VL = 4,    ///< vertical left
-	HT_DIR_VR = 5,    ///< vertical right
-	HT_DIR_MASK = 0x7 ///< masks the drag-direction
-};
-
-struct TileHighlightData {
-	Point size;
-	Point outersize;
-	Point pos;
-	Point offs;
-
-	Point new_pos;
-	Point new_size;
-	Point new_outersize;
-
-	Point selend, selstart;
-
-	byte dirty;
-	byte sizelimit;
-
-	byte drawstyle;      // lower bits 0-3 are reserved for detailed highlight information information
-	byte new_drawstyle;  // only used in UpdateTileSelection() to as a buffer to compare if there was a change between old and new
-	byte next_drawstyle; // queued, but not yet drawn style
-
-	FSMportsLayout *FSMportLayout; ///< used to identify the airport construction data to allow for holes in airport designs
-	FSMportsLayout *FSMportMask;   ///< used to identify the airport construction mask for blue/green water/land colouring of highlight
-
-	ViewportHighlightMode place_mode;
-	bool make_square_red;
-	WindowClass window_class;
-	WindowNumber window_number;
-
-	ViewportPlaceMethod select_method;
-	byte select_proc;
-
-	TileIndex redsq;
-};
-
-
-/* common button handler */
-bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, ViewportHighlightMode mode, PlaceProc *placeproc);
-
-VARDEF Point _tile_fract_coords;
-
-extern TileHighlightData _thd;
-
-
-void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom);
-
-#endif /* VIEWPORT_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/viewport_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,82 @@
+/* $Id$ */
+
+/** @file viewport_func.h Functions related to (drawing on) viewports. */
+
+#ifndef VIEWPORT_FUNC_H
+#define VIEWPORT_FUNC_H
+
+#include "gfx_type.h"
+#include "viewport_type.h"
+#include "vehicle_type.h"
+#include "strings_type.h"
+
+void SetSelectionRed(bool);
+
+void InitViewports();
+void DeleteWindowViewport(Window *w);
+void AssignWindowViewport(Window *w, int x, int y, int width, int height, uint32 follow_flags, ZoomLevel zoom);
+ViewPort *IsPtInWindowViewport(const Window *w, int x, int y);
+Point GetTileBelowCursor();
+void UpdateViewportPosition(Window *w);
+
+bool DoZoomInOutWindow(int how, Window *w);
+void ZoomInOrOutToCursorWindow(bool in, Window * w);
+Point GetTileZoomCenterWindow(bool in, Window * w);
+void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out);
+
+static inline void MaxZoomInOut(int how, Window *w)
+{
+	while (DoZoomInOutWindow(how, w)) {};
+}
+
+void OffsetGroundSprite(int x, int y);
+
+void DrawGroundSprite(SpriteID image, SpriteID pal, const SubSprite *sub = NULL);
+void DrawGroundSpriteAt(SpriteID image, SpriteID pal, int32 x, int32 y, byte z, const SubSprite *sub = NULL);
+void AddSortableSpriteToDraw(SpriteID image, SpriteID pal, int x, int y, int w, int h, int dz, int z, bool transparent = false, int bb_offset_x = 0, int bb_offset_y = 0, int bb_offset_z = 0, const SubSprite *sub = NULL);
+void *AddStringToDraw(int x, int y, StringID string, uint64 params_1, uint64 params_2);
+void AddChildSpriteScreen(SpriteID image, SpriteID pal, int x, int y, bool transparent = false, const SubSprite *sub = NULL);
+
+
+void StartSpriteCombine();
+void EndSpriteCombine();
+
+void HandleViewportClicked(const ViewPort *vp, int x, int y);
+void PlaceObject();
+void SetRedErrorSquare(TileIndex tile);
+void SetTileSelectSize(int w, int h);
+void SetTileSelectBigSize(int ox, int oy, int sx, int sy);
+
+Vehicle *CheckMouseOverVehicle();
+
+void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method);
+void VpStartPlaceSizing(TileIndex tile, ViewportPlaceMethod method, byte process);
+void VpSetPresizeRange(TileIndex from, TileIndex to);
+void VpSetPlaceSizingLimit(int limit);
+
+typedef void PlaceProc(TileIndex tile);
+void PlaceProc_DemolishArea(TileIndex tile);
+void PlaceProc_LevelLand(TileIndex tile);
+void PlaceProc_BuyLand(TileIndex tile);
+bool GUIPlaceProcDragXY(const WindowEvent *e);
+
+/* common button handler */
+bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, ViewportHighlightMode mode, PlaceProc *placeproc);
+
+void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom);
+
+void SetObjectToPlaceWnd(CursorID icon, SpriteID pal, ViewportHighlightMode mode, Window *w);
+void SetObjectToPlace(CursorID icon, SpriteID pal, ViewportHighlightMode mode, WindowClass window_class, WindowNumber window_num);
+
+void ResetObjectToPlace();
+
+bool ScrollWindowTo(int x, int y, Window *w, bool instant = false);
+
+bool ScrollMainWindowToTile(TileIndex tile, bool instant = false);
+bool ScrollMainWindowTo(int x, int y, bool instant = false);
+
+extern PlaceProc *_place_proc;
+extern Point _tile_fract_coords;
+extern TileHighlightData _thd;
+
+#endif /* VIEWPORT_FUNC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/viewport_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,119 @@
+/* $Id$ */
+
+/** @file viewport_type.h Types related to viewports. */
+
+#ifndef VIEWPORT_TYPE_H
+#define VIEWPORT_TYPE_H
+
+#include "core/geometry_type.hpp"
+#include "zoom_type.h"
+#include "window_type.h"
+#include "tile_type.h"
+#include "newgrf_fsmports.h"
+
+struct ViewPort {
+	int left,top;                       // screen coordinates for the viewport
+	int width, height;                  // screen width/height for the viewport
+
+	int virtual_left, virtual_top;      // virtual coordinates
+	int virtual_width, virtual_height;  // these are just width << zoom, height << zoom
+
+	ZoomLevel zoom;
+};
+
+enum {
+	ZOOM_IN   = 0,
+	ZOOM_OUT  = 1,
+	ZOOM_NONE = 2, // hack, used to update the button status
+};
+
+/**
+ * Some values for constructing bounding boxes (BB). The Z positions under bridges are:
+ * z=0..5  Everything that can be built under low bridges.
+ * z=6     reserved, currently unused.
+ * z=7     Z separator between bridge/tunnel and the things under/above it.
+ */
+enum {
+	BB_HEIGHT_UNDER_BRIDGE = 6, ///< Everything that can be built under low bridges, must not exceed this Z height.
+	BB_Z_SEPARATOR  = 7,        ///< Separates the bridge/tunnel from the things under/above it.
+};
+
+/** Viewport place method (type of highlighted area and placed objects) */
+enum ViewportPlaceMethod {
+	VPM_X_OR_Y          = 0, ///< drag in X or Y direction
+	VPM_FIX_X           = 1, ///< drag only in X axis
+	VPM_FIX_Y           = 2, ///< drag only in Y axis
+	VPM_RAILDIRS        = 3, ///< all rail directions
+	VPM_X_AND_Y         = 4, ///< area of land in X and Y directions
+	VPM_X_AND_Y_LIMITED = 5, ///< area of land of limited size
+	VPM_SIGNALDIRS      = 6, ///< similiar to VMP_RAILDIRS, but with different cursor
+};
+
+/** Viewport highlight mode (for highlighting tiles below cursor) */
+enum ViewportHighlightMode {
+	VHM_NONE    = 0, ///< default
+	VHM_RECT    = 1, ///< rectangle (stations, depots, ...)
+	VHM_POINT   = 2, ///< point (lower land, raise land, level land, ...)
+	VHM_SPECIAL = 3, ///< special mode used for highlighting while dragging (and for tunnels/docks)
+	VHM_DRAG    = 4, ///< dragging items in the depot windows
+	VHM_RAIL    = 5, ///< rail pieces
+};
+
+/* highlighting draw styles */
+enum HighLightStyle {
+	HT_NONE   = 0x00,
+	HT_RECT   = 0x80,
+	HT_POINT  = 0x40,
+	HT_LINE   = 0x20,    ///< used for autorail highlighting (longer streches)
+	                     ///< (uses lower bits to indicate direction)
+	HT_RAIL   = 0x10,    ///< autorail (one piece)
+	                     ///< (uses lower bits to indicate direction)
+	HT_DRAG_MASK = 0xF0, ///< masks the drag-type
+
+	/* lower bits (used with HT_LINE and HT_RAIL):
+	 * (see ASCII art in autorail.h for a visual interpretation) */
+	HT_DIR_X  = 0,    ///< X direction
+	HT_DIR_Y  = 1,    ///< Y direction
+	HT_DIR_HU = 2,    ///< horizontal upper
+	HT_DIR_HL = 3,    ///< horizontal lower
+	HT_DIR_VL = 4,    ///< vertical left
+	HT_DIR_VR = 5,    ///< vertical right
+	HT_DIR_MASK = 0x7 ///< masks the drag-direction
+};
+DECLARE_ENUM_AS_BIT_SET(HighLightStyle);
+
+
+struct TileHighlightData {
+	Point size;
+	Point outersize;
+	Point pos;
+	Point offs;
+
+	Point new_pos;
+	Point new_size;
+	Point new_outersize;
+
+	Point selend, selstart;
+
+	byte dirty;
+	byte sizelimit;
+
+	byte drawstyle;      // lower bits 0-3 are reserved for detailed highlight information information
+	byte new_drawstyle;  // only used in UpdateTileSelection() to as a buffer to compare if there was a change between old and new
+	byte next_drawstyle; // queued, but not yet drawn style
+
+	ViewportHighlightMode place_mode;
+	bool make_square_red;
+	WindowClass window_class;
+	WindowNumber window_number;
+
+	ViewportPlaceMethod select_method;
+	byte select_proc;
+
+	TileIndex redsq;
+
+	FSMportsLayout *FSMportLayout;
+	FSMportsLayout *FSMportMask;
+};
+
+#endif /* VIEWPORT_TYPE_H */
--- a/src/void_map.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/void_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,8 @@
 #ifndef VOID_MAP_H
 #define VOID_MAP_H
 
+#include "tile_map.h"
+
 /**
  * Make a nice void tile ;)
  * @param t the tile to make void
--- a/src/water.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/water.h	Tue Jan 22 21:00:30 2008 +0000
@@ -6,8 +6,15 @@
 #define WATER_H
 
 void TileLoop_Water(TileIndex tile);
+bool FloodHalftile(TileIndex t);
+
+void ConvertGroundTilesIntoWaterTiles();
+
 void DrawShipDepotSprite(int x, int y, int image);
 void DrawCanalWater(TileIndex tile);
+void DrawShoreTile(Slope tileh);
+
+void MakeWaterOrCanalDependingOnOwner(TileIndex tile, Owner o);
 void MakeWaterOrCanalDependingOnSurroundings(TileIndex t, Owner o);
 
 #endif /* WATER_H */
--- a/src/water_cmd.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/water_cmd.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -8,52 +8,71 @@
 #include "bridge.h"
 #include "cmd_helper.h"
 #include "station_map.h"
-#include "table/sprites.h"
-#include "table/strings.h"
-#include "strings.h"
-#include "functions.h"
+#include "tile_cmd.h"
 #include "landscape.h"
-#include "map.h"
-#include "tile.h"
-#include "vehicle.h"
-#include "viewport.h"
-#include "command.h"
+#include "viewport_func.h"
+#include "command_func.h"
 #include "town.h"
 #include "news.h"
-#include "sound.h"
 #include "depot.h"
 #include "vehicle_gui.h"
 #include "train.h"
 #include "roadveh.h"
+#include "water.h"
 #include "water_map.h"
 #include "industry_map.h"
 #include "newgrf.h"
 #include "newgrf_canal.h"
 #include "misc/autoptr.hpp"
 #include "transparency.h"
+#include "strings_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "vehicle_func.h"
+#include "sound_func.h"
+#include "variables.h"
+#include "player_func.h"
+#include "settings_type.h"
+#include "clear_map.h"
 
-/** Array for the shore sprites */
-static const SpriteID _water_shore_sprites[] = {
-	0,
-	SPR_SHORE_TILEH_1,  // SLOPE_W
-	SPR_SHORE_TILEH_2,  // SLOPE_S
-	SPR_SHORE_TILEH_3,  // SLOPE_SW
-	SPR_SHORE_TILEH_4,  // SLOPE_E
-	0,
-	SPR_SHORE_TILEH_6,  // SLOPE_SE
-	0,
-	SPR_SHORE_TILEH_8,  // SLOPE_N
-	SPR_SHORE_TILEH_9,  // SLOPE_NW
-	0,
-	0,
-	SPR_SHORE_TILEH_12, // SLOPE_NE
-	0,
-	0
+#include "table/sprites.h"
+#include "table/strings.h"
+
+/**
+ * Describes the behaviour of a tile during flooding.
+ */
+enum FloodingBehaviour {
+	FLOOD_NONE,    ///< The tile does not flood neighboured tiles.
+	FLOOD_ACTIVE,  ///< The tile floods neighboured tiles.
+	FLOOD_PASSIVE, ///< The tile does not actively flood neighboured tiles, but it prevents them from drying up.
+	FLOOD_DRYUP,   ///< The tile drys up if it is not constantly flooded from neighboured tiles.
 };
 
+/**
+ * Describes from which directions a specific slope can be flooded (if the tile is floodable at all).
+ */
+static const uint8 _flood_from_dirs[] = {
+	(1 << DIR_NW) | (1 << DIR_SW) | (1 << DIR_SE) | (1 << DIR_NE), // SLOPE_FLAT
+	(1 << DIR_NE) | (1 << DIR_SE),                                 // SLOPE_W
+	(1 << DIR_NW) | (1 << DIR_NE),                                 // SLOPE_S
+	(1 << DIR_NE),                                                 // SLOPE_SW
+	(1 << DIR_NW) | (1 << DIR_SW),                                 // SLOPE_E
+	0,                                                             // SLOPE_EW
+	(1 << DIR_NW),                                                 // SLOPE_SE
+	(1 << DIR_N ) | (1 << DIR_NW) | (1 << DIR_NE),                 // SLOPE_WSE, SLOPE_STEEP_S
+	(1 << DIR_SW) | (1 << DIR_SE),                                 // SLOPE_N
+	(1 << DIR_SE),                                                 // SLOPE_NW
+	0,                                                             // SLOPE_NS
+	(1 << DIR_E ) | (1 << DIR_NE) | (1 << DIR_SE),                 // SLOPE_NWS, SLOPE_STEEP_W
+	(1 << DIR_SW),                                                 // SLOPE_NE
+	(1 << DIR_S ) | (1 << DIR_SW) | (1 << DIR_SE),                 // SLOPE_ENW, SLOPE_STEEP_N
+	(1 << DIR_W ) | (1 << DIR_SW) | (1 << DIR_NW),                 // SLOPE_SEN, SLOPE_STEEP_E
+};
 
-static Vehicle *FindFloodableVehicleOnTile(TileIndex tile);
-static void FloodVehicle(Vehicle *v);
+/**
+ * Slopes that contain flat water and not only shore.
+ */
+static const uint32 _active_water_slopes = (1 << SLOPE_FLAT) | (1 << SLOPE_W) | (1 << SLOPE_S) | (1 << SLOPE_E) | (1 << SLOPE_N);
 
 /**
  * Makes a tile canal or water depending on the surroundings.
@@ -66,9 +85,12 @@
 {
 	assert(GetTileSlope(t, NULL) == SLOPE_FLAT);
 
+	/* Mark tile dirty in all cases */
+	MarkTileDirtyByTile(t);
+
 	/* Non-sealevel -> canal */
 	if (TileHeight(t) != 0) {
-		MakeCanal(t, o);
+		MakeCanal(t, o, Random());
 		return;
 	}
 
@@ -78,16 +100,15 @@
 	for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) {
 		TileIndex neighbour = TileAddByDiagDir(t, dir);
 		if (IsTileType(neighbour, MP_WATER)) {
-			has_water |= IsSea(neighbour) || IsCoast(neighbour);
-			has_canal |= IsCanal(neighbour);
+			has_water |= IsSea(neighbour) || IsCoast(neighbour) || (IsShipDepot(neighbour) && GetShipDepotWaterOwner(neighbour) == OWNER_WATER);
+			has_canal |= IsCanal(neighbour) || (IsShipDepot(neighbour) && GetShipDepotWaterOwner(neighbour) != OWNER_WATER);
 		}
 	}
 	if (has_canal || !has_water) {
-		MakeCanal(t, o);
+		MakeCanal(t, o, Random());
 	} else {
 		MakeWater(t);
 	}
-	MarkTileDirtyByTile(t);
 }
 
 
@@ -101,9 +122,7 @@
 {
 	TileIndex tile2;
 
-	CommandCost cost, ret;
-
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
+	CommandCost ret;
 
 	Axis axis = Extract<Axis, 0>(p1);
 
@@ -114,6 +133,8 @@
 
 	if (IsBridgeAbove(tile) || IsBridgeAbove(tile2)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
 
+	Owner o1 = GetTileOwner(tile);
+	Owner o2 = GetTileOwner(tile2);
 	ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 	if (CmdFailed(ret)) return CMD_ERROR;
 	ret = DoCommand(tile2, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
@@ -126,14 +147,23 @@
 	if (flags & DC_EXEC) {
 		depot->town_index = ClosestTownFromTile(tile, (uint)-1)->index;
 
-		MakeShipDepot(tile,  _current_player, DEPOT_NORTH, axis);
-		MakeShipDepot(tile2, _current_player, DEPOT_SOUTH, axis);
+		MakeShipDepot(tile,  _current_player, DEPOT_NORTH, axis, o1);
+		MakeShipDepot(tile2, _current_player, DEPOT_SOUTH, axis, o2);
 		MarkTileDirtyByTile(tile);
 		MarkTileDirtyByTile(tile2);
 		d_auto_delete.Detach();
 	}
 
-	return cost.AddCost(_price.build_ship_depot);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.build_ship_depot);
+}
+
+void MakeWaterOrCanalDependingOnOwner(TileIndex tile, Owner o)
+{
+	if (o == OWNER_WATER) {
+		MakeWater(tile);
+	} else {
+		MakeCanal(tile, o, Random());
+	}
 }
 
 static CommandCost RemoveShipDepot(TileIndex tile, uint32 flags)
@@ -152,13 +182,13 @@
 		/* Kill the depot, which is registered at the northernmost tile. Use that one */
 		delete GetDepotByTile(tile2 < tile ? tile2 : tile);
 
-		MakeWater(tile);
-		MakeWater(tile2);
+		MakeWaterOrCanalDependingOnOwner(tile,  GetShipDepotWaterOwner(tile));
+		MakeWaterOrCanalDependingOnOwner(tile2, GetShipDepotWaterOwner(tile2));
 		MarkTileDirtyByTile(tile);
 		MarkTileDirtyByTile(tile2);
 	}
 
-	return CommandCost(_price.remove_ship_depot);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_ship_depot);
 }
 
 /** build a shiplift */
@@ -199,7 +229,7 @@
 		MarkTileDirtyByTile(tile + delta);
 	}
 
-	return CommandCost(_price.clear_water * 22 >> 3);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.clear_water * 22 >> 3);
 }
 
 static CommandCost RemoveShiplift(TileIndex tile, uint32 flags)
@@ -218,7 +248,7 @@
 		MakeWaterOrCanalDependingOnSurroundings(tile - delta, _current_player);
 	}
 
-	return CommandCost(_price.clear_water * 2);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.clear_water * 2);
 }
 
 /**
@@ -248,8 +278,6 @@
 {
 	DiagDirection dir;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	switch (GetTileSlope(tile, NULL)) {
 		case SLOPE_SW: dir = DIAGDIR_SW; break;
 		case SLOPE_SE: dir = DIAGDIR_SE; break;
@@ -268,23 +296,22 @@
  */
 CommandCost CmdBuildCanal(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	CommandCost cost;
+	CommandCost cost(EXPENSES_CONSTRUCTION);
 	int size_x, size_y;
 	int x;
 	int y;
 	int sx, sy;
 
 	if (p1 >= MapSize()) return CMD_ERROR;
+
 	/* Outside of the editor you can only build canals, not oceans */
-	if (HasBit(p2, 0) && _game_mode != GM_EDITOR) return CMD_ERROR;
+	if (p2 != 0 && _game_mode != GM_EDITOR) return CMD_ERROR;
 
 	x = TileX(tile);
 	y = TileY(tile);
 	sx = TileX(p1);
 	sy = TileY(p1);
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	if (x < sx) Swap(x, sx);
 	if (y < sy) Swap(y, sy);
 	size_x = (x - sx) + 1;
@@ -296,22 +323,25 @@
 	BEGIN_TILE_LOOP(tile, size_x, size_y, TileXY(sx, sy)) {
 		CommandCost ret;
 
-		if (GetTileSlope(tile, NULL) != SLOPE_FLAT) {
+		Slope slope = GetTileSlope(tile, NULL);
+		if (slope != SLOPE_FLAT && (p2 != 2 || (slope != SLOPE_NW && slope != SLOPE_NE && slope != SLOPE_SW && slope != SLOPE_SE))) {
 			return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
 		}
 
 		/* can't make water of water! */
-		if (IsTileType(tile, MP_WATER) && (!IsTileOwner(tile, OWNER_WATER) || HasBit(p2, 0))) continue;
+		if (IsTileType(tile, MP_WATER) && (!IsTileOwner(tile, OWNER_WATER) || p2 == 1)) continue;
 
 		ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 		if (CmdFailed(ret)) return ret;
 		cost.AddCost(ret);
 
 		if (flags & DC_EXEC) {
-			if (TileHeight(tile) == 0 && HasBit(p2, 0)) {
+			if (TileHeight(tile) == 0 && p2 == 1) {
 				MakeWater(tile);
+			} else if (p2 == 2) {
+				MakeRiver(tile, Random());
 			} else {
-				MakeCanal(tile, _current_player);
+				MakeCanal(tile, _current_player, Random());
 			}
 			MarkTileDirtyByTile(tile);
 			MarkTilesAroundDirty(tile);
@@ -331,6 +361,7 @@
 {
 	switch (GetWaterTileType(tile)) {
 		case WATER_TILE_CLEAR:
+		case WATER_TILE_RIVER:
 			if (flags & DC_NO_WATER) return_cmd_error(STR_3807_CAN_T_BUILD_ON_WATER);
 
 			/* Make sure it's not an edge tile. */
@@ -345,7 +376,7 @@
 			if (GetTileOwner(tile) != OWNER_WATER && GetTileOwner(tile) != OWNER_NONE && !CheckTileOwnership(tile)) return CMD_ERROR;
 
 			if (flags & DC_EXEC) DoClearSquare(tile);
-			return CommandCost(_price.clear_water);
+			return CommandCost(EXPENSES_CONSTRUCTION, _price.clear_water);
 
 		case WATER_TILE_COAST: {
 			Slope slope = GetTileSlope(tile, NULL);
@@ -355,9 +386,9 @@
 
 			if (flags & DC_EXEC) DoClearSquare(tile);
 			if (slope == SLOPE_N || slope == SLOPE_E || slope == SLOPE_S || slope == SLOPE_W) {
-				return CommandCost(_price.clear_water);
+				return CommandCost(EXPENSES_CONSTRUCTION, _price.clear_water);
 			} else {
-				return CommandCost(_price.clear_roughland);
+				return CommandCost(EXPENSES_CONSTRUCTION, _price.clear_roughland);
 			}
 		}
 
@@ -401,57 +432,63 @@
 					return false;
 			}
 
+		case MP_RAILWAY:  return GetRailGroundType(tile) == RAIL_GROUND_WATER;
 		case MP_STATION:  return IsCustomFSMportsSpecIndex(tile) || IsOilRig(tile) || IsDock(tile) || IsBuoy(tile);
 		case MP_INDUSTRY: return (GetIndustrySpec(GetIndustryType(tile))->behaviour & INDUSTRYBEH_BUILT_ONWATER) != 0;
 		default:          return false;
 	}
 }
 
-/** draw a canal styled water tile with dikes around */
-void DrawCanalWater(TileIndex tile)
+static void DrawWaterEdges(SpriteID base, TileIndex tile)
 {
 	uint wa;
 
-	/* Test for custom graphics, else use the default */
-	SpriteID dikes_base = GetCanalSprite(CF_DIKES, tile);
-	if (dikes_base == 0) dikes_base = SPR_CANAL_DIKES_BASE;
-
 	/* determine the edges around with water. */
 	wa  = IsWateredTile(TILE_ADDXY(tile, -1,  0)) << 0;
 	wa += IsWateredTile(TILE_ADDXY(tile,  0,  1)) << 1;
 	wa += IsWateredTile(TILE_ADDXY(tile,  1,  0)) << 2;
 	wa += IsWateredTile(TILE_ADDXY(tile,  0, -1)) << 3;
 
-	if (!(wa & 1)) DrawGroundSprite(dikes_base,     PAL_NONE);
-	if (!(wa & 2)) DrawGroundSprite(dikes_base + 1, PAL_NONE);
-	if (!(wa & 4)) DrawGroundSprite(dikes_base + 2, PAL_NONE);
-	if (!(wa & 8)) DrawGroundSprite(dikes_base + 3, PAL_NONE);
+	if (!(wa & 1)) DrawGroundSprite(base,     PAL_NONE);
+	if (!(wa & 2)) DrawGroundSprite(base + 1, PAL_NONE);
+	if (!(wa & 4)) DrawGroundSprite(base + 2, PAL_NONE);
+	if (!(wa & 8)) DrawGroundSprite(base + 3, PAL_NONE);
 
 	/* right corner */
 	switch (wa & 0x03) {
-		case 0: DrawGroundSprite(dikes_base + 4, PAL_NONE); break;
-		case 3: if (!IsWateredTile(TILE_ADDXY(tile, -1, 1))) DrawGroundSprite(dikes_base + 8, PAL_NONE); break;
+		case 0: DrawGroundSprite(base + 4, PAL_NONE); break;
+		case 3: if (!IsWateredTile(TILE_ADDXY(tile, -1, 1))) DrawGroundSprite(base + 8, PAL_NONE); break;
 	}
 
 	/* bottom corner */
 	switch (wa & 0x06) {
-		case 0: DrawGroundSprite(dikes_base + 5, PAL_NONE); break;
-		case 6: if (!IsWateredTile(TILE_ADDXY(tile, 1, 1))) DrawGroundSprite(dikes_base + 9, PAL_NONE); break;
+		case 0: DrawGroundSprite(base + 5, PAL_NONE); break;
+		case 6: if (!IsWateredTile(TILE_ADDXY(tile, 1, 1))) DrawGroundSprite(base + 9, PAL_NONE); break;
 	}
 
 	/* left corner */
 	switch (wa & 0x0C) {
-		case  0: DrawGroundSprite(dikes_base + 6, PAL_NONE); break;
-		case 12: if (!IsWateredTile(TILE_ADDXY(tile, 1, -1))) DrawGroundSprite(dikes_base + 10, PAL_NONE); break;
+		case  0: DrawGroundSprite(base + 6, PAL_NONE); break;
+		case 12: if (!IsWateredTile(TILE_ADDXY(tile, 1, -1))) DrawGroundSprite(base + 10, PAL_NONE); break;
 	}
 
 	/* upper corner */
 	switch (wa & 0x09) {
-		case 0: DrawGroundSprite(dikes_base + 7, PAL_NONE); break;
-		case 9: if (!IsWateredTile(TILE_ADDXY(tile, -1, -1))) DrawGroundSprite(dikes_base + 11, PAL_NONE); break;
+		case 0: DrawGroundSprite(base + 7, PAL_NONE); break;
+		case 9: if (!IsWateredTile(TILE_ADDXY(tile, -1, -1))) DrawGroundSprite(base + 11, PAL_NONE); break;
 	}
 }
 
+/** draw a canal styled water tile with dikes around */
+void DrawCanalWater(TileIndex tile)
+{
+	/* Test for custom graphics, else use the default */
+	SpriteID dikes_base = GetCanalSprite(CF_DIKES, tile);
+	if (dikes_base == 0) dikes_base = SPR_CANAL_DIKES_BASE;
+
+	DrawWaterEdges(dikes_base, tile);
+}
+
 struct LocksDrawTileStruct {
 	int8 delta_x, delta_y, delta_z;
 	byte width, height, depth;
@@ -490,6 +527,50 @@
 	}
 }
 
+static void DrawRiverWater(const TileInfo *ti)
+{
+	SpriteID image = SPR_FLAT_WATER_TILE;
+	SpriteID edges_base = GetCanalSprite(CF_RIVER_EDGE, ti->tile);
+
+	if (ti->tileh != SLOPE_FLAT) {
+		image = GetCanalSprite(CF_RIVER_SLOPE, ti->tile);
+		if (image == 0) {
+			image = SPR_FLAT_WATER_TILE;
+		} else {
+			switch (ti->tileh) {
+				default: NOT_REACHED();
+				case SLOPE_SE:             edges_base += 12; break;
+				case SLOPE_NE: image += 1; edges_base += 24; break;
+				case SLOPE_SW: image += 2; edges_base += 36; break;
+				case SLOPE_NW: image += 3; edges_base += 48; break;
+			}
+		}
+	}
+
+	DrawGroundSprite(image, PAL_NONE);
+
+	/* Draw canal dikes if there are no river edges to draw. */
+	if (edges_base <= 48) edges_base = SPR_CANAL_DIKES_BASE;
+	DrawWaterEdges(edges_base, ti->tile);
+}
+
+void DrawShoreTile(Slope tileh)
+{
+	/* Converts the enum Slope into an offset based on SPR_SHORE_BASE.
+	 * This allows to calculate the proper sprite to display for this Slope */
+	static const byte tileh_to_shoresprite[32] = {
+		0, 1, 2, 3, 4, 16, 6, 7, 8, 9, 17, 11, 12, 13, 14, 0,
+		0, 0, 0, 0, 0,  0, 0, 0, 0, 0,  0,  5,  0, 10, 15, 0,
+	};
+
+	assert(!IsHalftileSlope(tileh)); // Halftile slopes need to get handled earlier.
+	assert(tileh != SLOPE_FLAT);     // Shore is never flat
+
+	assert((tileh != SLOPE_EW) && (tileh != SLOPE_NS)); // No suitable sprites for current flooding behaviour
+
+	DrawGroundSprite(SPR_SHORE_BASE + tileh_to_shoresprite[tileh], PAL_NONE);
+}
+
 static void DrawTile_Water(TileInfo *ti)
 {
 	switch (GetWaterTileType(ti->tile)) {
@@ -499,15 +580,10 @@
 			DrawBridgeMiddle(ti);
 			break;
 
-		case WATER_TILE_COAST:
-			assert(!IsSteepSlope(ti->tileh));
-			if (_loaded_newgrf_features.has_newwater) {
-				DrawGroundSprite(_coast_base + ti->tileh, PAL_NONE);
-			} else {
-				DrawGroundSprite(_water_shore_sprites[ti->tileh], PAL_NONE);
-			}
+		case WATER_TILE_COAST: {
+			DrawShoreTile(ti->tileh);
 			DrawBridgeMiddle(ti);
-			break;
+		} break;
 
 		case WATER_TILE_LOCK: {
 			const WaterDrawTileStruct *t = _shiplift_display_seq[GetSection(ti->tile)];
@@ -517,6 +593,11 @@
 		case WATER_TILE_DEPOT:
 			DrawWaterStuff(ti, _shipdepot_display_seq[GetSection(ti->tile)], PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)), 0);
 			break;
+
+		case WATER_TILE_RIVER:
+			DrawRiverWater(ti);
+			DrawBridgeMiddle(ti);
+			break;
 	}
 }
 
@@ -555,6 +636,7 @@
 {
 	switch (GetWaterTileType(tile)) {
 		case WATER_TILE_CLEAR:
+		case WATER_TILE_RIVER:
 			if (!IsCanal(tile)) {
 				td->str = STR_3804_WATER;
 			} else {
@@ -576,73 +658,16 @@
 }
 
 /**
- * Floods neighboured floodable tiles
+ * Marks tile dirty if it is a canal tile.
+ * Called to avoid glitches when flooding tiles next to canal tile.
  *
- * @param tile The water source tile that causes the flooding.
- * @param offs[0] Destination tile to flood.
- * @param offs[1] First corner of edge between source and dest tile.
- * @param offs[2] Second corder of edge between source and dest tile.
- * @param offs[3] Third corner of dest tile.
- * @param offs[4] Fourth corner of dest tile.
+ * @param tile tile to check
  */
-static void TileLoopWaterHelper(TileIndex tile, const TileIndexDiffC *offs)
+static inline void MarkTileDirtyIfCanal(TileIndex tile)
 {
-	TileIndex target = TILE_ADD(tile, ToTileIndexDiff(offs[0]));
-
-	/* type of this tile mustn't be water already. */
-	if (IsTileType(target, MP_WATER)) return;
-
-	/* Ensure sea-level FSMports do not flood */
-	if (IsTileType(target, MP_STATION) && GetStationByTile(target)->FSMport_flood_protected) return;
-
-	/* Are both corners of the edge between source and dest on height 0 ? */
-	if (TileHeight(TILE_ADD(tile, ToTileIndexDiff(offs[1]))) != 0 ||
-			TileHeight(TILE_ADD(tile, ToTileIndexDiff(offs[2]))) != 0) {
-		return;
-	}
-
-	/* Is any corner of the dest tile raised? (First two corners already checked above. */
-	if (TileHeight(TILE_ADD(tile, ToTileIndexDiff(offs[3]))) != 0 ||
-			TileHeight(TILE_ADD(tile, ToTileIndexDiff(offs[4]))) != 0) {
-		/* make coast.. */
-		switch (GetTileType(target)) {
-			case MP_RAILWAY: {
-				if (!IsPlainRailTile(target)) break;
+	if (IsTileType(tile, MP_WATER) && IsCanal(tile)) MarkTileDirtyByTile(tile);
+}
 
-				FloodHalftile(target);
-
-				Vehicle *v = FindFloodableVehicleOnTile(target);
-				if (v != NULL) FloodVehicle(v);
-
-				break;
-			}
-
-			case MP_CLEAR:
-			case MP_TREES:
-				_current_player = OWNER_WATER;
-				if (CmdSucceeded(DoCommand(target, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR))) {
-					MakeShore(target);
-					MarkTileDirtyByTile(target);
-				}
-				break;
-
-			default:
-				break;
-		}
-	} else {
-		/* Flood vehicles */
-		_current_player = OWNER_WATER;
-
-		Vehicle *v = FindFloodableVehicleOnTile(target);
-		if (v != NULL) FloodVehicle(v);
-
-		/* flood flat tile */
-		if (CmdSucceeded(DoCommand(target, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR))) {
-			MakeWater(target);
-			MarkTileDirtyByTile(target);
-		}
-	}
-}
 
 /**
  * Finds a vehicle to flood.
@@ -670,6 +695,20 @@
 		return NULL;
 	}
 
+	/* if non-uniform stations are disabled, flood some train in this train station (if there is any) */
+	if (!_patches.nonuniform_stations && IsTileType(tile, MP_STATION) && GetStationType(tile) == STATION_RAIL) {
+		const Station *st = GetStationByTile(tile);
+
+		BEGIN_TILE_LOOP(t, st->trainst_w, st->trainst_h, st->train_tile)
+			if (st->TileBelongsToRailStation(t)) {
+				Vehicle *v = FindVehicleOnTileZ(t, 0);
+				if (v != NULL && (v->vehstatus & VS_CRASHED) == 0) return v;
+			}
+		END_TILE_LOOP(t, st->trainst_w, st->trainst_h, st->train_tile)
+
+		return NULL;
+	}
+
 	if (!IsBridgeTile(tile)) return FindVehicleOnTileZ(tile, 0);
 
 	TileIndex end = GetOtherBridgeEnd(tile);
@@ -715,7 +754,7 @@
 			BEGIN_ENUM_WAGONS(v)
 				if (IsCargoInClass(v->cargo_type, CC_PASSENGERS)) pass += v->cargo.Count();
 				v->vehstatus |= VS_CRASHED;
-				MarkAllViewportsDirty(v->left_coord, v->top_coord, v->right_coord + 1, v->bottom_coord + 1);
+				MarkSingleVehicleDirty(v);
 			END_ENUM_WAGONS(v)
 
 			v = u;
@@ -743,7 +782,7 @@
 			return;
 		}
 
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 
 		SetDParam(0, pass);
@@ -757,6 +796,123 @@
 }
 
 /**
+ * Returns the behaviour of a tile during flooding.
+ *
+ * @return Behaviour of the tile
+ */
+static FloodingBehaviour GetFloodingBehaviour(TileIndex tile)
+{
+	/* FLOOD_ACTIVE:  'single-corner-raised'-coast, sea, sea-shipdepots, sea-buoys, rail with flooded halftile
+	 * FLOOD_DRYUP:   coast with more than one corner raised
+	 * FLOOD_PASSIVE: oilrig, dock, water-industries
+	 * FLOOD_NONE:    canals, rivers, everything else
+	 */
+	switch (GetTileType(tile)) {
+		case MP_WATER:
+			if (IsCoast(tile)) {
+				Slope tileh = GetTileSlope(tile, NULL);
+				return (HasBit(_active_water_slopes, tileh) ? FLOOD_ACTIVE : FLOOD_DRYUP);
+			} else {
+				return ((IsSea(tile) || (IsShipDepot(tile) && (GetShipDepotWaterOwner(tile) == OWNER_WATER))) ? FLOOD_ACTIVE : FLOOD_NONE);
+			}
+
+		case MP_RAILWAY:
+			return ((GetRailGroundType(tile) == RAIL_GROUND_WATER) ? FLOOD_ACTIVE : FLOOD_NONE);
+
+		case MP_STATION:
+			if (IsSeaBuoyTile(tile)) return FLOOD_ACTIVE;
+			if (IsOilRig(tile) || IsDock(tile)) return FLOOD_PASSIVE;
+			if (GetStationByTile(tile)->FSMport_flood_protected) return FLOOD_PASSIVE;
+			return FLOOD_NONE;
+
+		case MP_INDUSTRY:
+			return ((GetIndustrySpec(GetIndustryType(tile))->behaviour & INDUSTRYBEH_BUILT_ONWATER) != 0 ? FLOOD_PASSIVE : FLOOD_NONE);
+
+		default:
+			return FLOOD_NONE;
+	}
+}
+
+/**
+ * Floods a tile.
+ */
+static void DoFloodTile(TileIndex target)
+{
+	if (IsTileType(target, MP_WATER)) return;
+
+	bool flooded = false; // Will be set to true if something is changed.
+
+	_current_player = OWNER_WATER;
+
+	if (GetTileSlope(target, NULL) != SLOPE_FLAT) {
+		/* make coast.. */
+		switch (GetTileType(target)) {
+			case MP_RAILWAY: {
+				if (!IsPlainRailTile(target)) break;
+
+				flooded = FloodHalftile(target);
+
+				Vehicle *v = FindFloodableVehicleOnTile(target);
+				if (v != NULL) FloodVehicle(v);
+
+				break;
+			}
+
+			case MP_CLEAR:
+			case MP_TREES:
+				if (CmdSucceeded(DoCommand(target, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR))) {
+					MakeShore(target);
+					MarkTileDirtyByTile(target);
+					flooded = true;
+				}
+				break;
+
+			default:
+				break;
+		}
+	} else {
+		/* Flood vehicles */
+		Vehicle *v = FindFloodableVehicleOnTile(target);
+		if (v != NULL) FloodVehicle(v);
+
+		/* flood flat tile */
+		if (CmdSucceeded(DoCommand(target, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR))) {
+			MakeWater(target);
+			MarkTileDirtyByTile(target);
+			flooded = true;
+		}
+	}
+
+	if (flooded) {
+		/* Mark surrounding canal tiles dirty too to avoid glitches */
+		for (Direction dir = DIR_BEGIN; dir < DIR_END; dir++) {
+			MarkTileDirtyIfCanal(target + TileOffsByDir(dir));
+		}
+
+		/* update signals if needed */
+		UpdateSignalsInBuffer();
+	}
+
+	_current_player = OWNER_NONE;
+}
+
+/**
+ * Drys a tile up.
+ */
+static void DoDryUp(TileIndex tile)
+{
+	assert(IsTileType(tile, MP_WATER) && IsCoast(tile));
+	_current_player = OWNER_WATER;
+
+	if (CmdSucceeded(DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR))) {
+		MakeClear(tile, CLEAR_GRASS, 3);
+		MarkTileDirtyByTile(tile);
+	}
+
+	_current_player = OWNER_NONE;
+}
+
+/**
  * Let a water tile floods its diagonal adjoining tiles
  * called from tunnelbridge_cmd, and by TileLoop_Industry() and TileLoop_Track()
  *
@@ -764,47 +920,79 @@
  */
 void TileLoop_Water(TileIndex tile)
 {
-	static const TileIndexDiffC _tile_loop_offs_array[][5] = {
-		// tile to mod              shore?    shore?
-		{{-1,  0}, {0, 0}, {0, 1}, {-1,  0}, {-1,  1}},
-		{{ 0,  1}, {0, 1}, {1, 1}, { 0,  2}, { 1,  2}},
-		{{ 1,  0}, {1, 0}, {1, 1}, { 2,  0}, { 2,  1}},
-		{{ 0, -1}, {0, 0}, {1, 0}, { 0, -1}, { 1, -1}}
-	};
-
-	/* Ensure buoys on canal borders do not flood */
-	if (IsCanalBuoyTile(tile)) return;
-	/* Ensure only sea and coast floods, not canals or rivers */
-	if (IsTileType(tile, MP_WATER) && !(IsSea(tile) || IsCoast(tile))) return;
-
-	/* floods in all four diagonal directions with the exception of the edges */
-	if (IsInsideMM(TileX(tile), 1, MapSizeX() - 3 + 1) &&
-			IsInsideMM(TileY(tile), 1, MapSizeY() - 3 + 1)) {
-		uint i;
+	switch (GetFloodingBehaviour(tile)) {
+		case FLOOD_ACTIVE:
+			for (Direction dir = DIR_BEGIN; dir < DIR_END; dir++) {
+				TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(dir));
+				if (dest == INVALID_TILE) continue;
 
-		for (i = 0; i != lengthof(_tile_loop_offs_array); i++) {
-			TileLoopWaterHelper(tile, _tile_loop_offs_array[i]);
-		}
-	}
-
-	/* _current_player can be changed by TileLoopWaterHelper.. reset it back here */
-	_current_player = OWNER_NONE;
+				uint z_dest;
+				Slope slope_dest = (Slope)(GetFoundationSlope(dest, &z_dest) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP);
+				if (z_dest > 0) continue;
 
-	/* edges */
-	if (TileX(tile) == 0 && IsInsideMM(TileY(tile), 1, MapSizeY() - 3 + 1)) { //NE
-		TileLoopWaterHelper(tile, _tile_loop_offs_array[2]);
-	}
+				if (!HasBit(_flood_from_dirs[slope_dest], ReverseDir(dir))) continue;
 
-	if (TileX(tile) == MapSizeX() - 2 && IsInsideMM(TileY(tile), 1, MapSizeY() - 3 + 1)) { //SW
-		TileLoopWaterHelper(tile, _tile_loop_offs_array[0]);
-	}
+				DoFloodTile(dest);
+			}
+			break;
 
-	if (TileY(tile) == 0 && IsInsideMM(TileX(tile), 1, MapSizeX() - 3 + 1)) { //NW
-		TileLoopWaterHelper(tile, _tile_loop_offs_array[1]);
+		case FLOOD_DRYUP: {
+			Slope slope_here = (Slope)(GetFoundationSlope(tile, NULL) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP);
+			uint check_dirs = _flood_from_dirs[slope_here];
+			uint dir;
+			FOR_EACH_SET_BIT(dir, check_dirs) {
+				TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir((Direction)dir));
+				if (dest == INVALID_TILE) continue;
+
+				FloodingBehaviour dest_behaviour = GetFloodingBehaviour(dest);
+				if ((dest_behaviour == FLOOD_ACTIVE) || (dest_behaviour == FLOOD_PASSIVE)) return;
+			}
+			DoDryUp(tile);
+			break;
+		}
+
+		default: return;
 	}
+}
 
-	if (TileY(tile) == MapSizeY() - 2 && IsInsideMM(TileX(tile), 1, MapSizeX() - 3 + 1)) { //SE
-		TileLoopWaterHelper(tile, _tile_loop_offs_array[3]);
+void ConvertGroundTilesIntoWaterTiles()
+{
+	TileIndex tile;
+	uint z;
+	Slope slope;
+
+	for (tile = 0; tile < MapSize(); ++tile) {
+		slope = GetTileSlope(tile, &z);
+		if (IsTileType(tile, MP_CLEAR) && z == 0) {
+			/* Make both water for tiles at level 0
+			 * and make shore, as that looks much better
+			 * during the generation. */
+			switch (slope) {
+				case SLOPE_FLAT:
+					MakeWater(tile);
+					break;
+
+				case SLOPE_N:
+				case SLOPE_E:
+				case SLOPE_S:
+				case SLOPE_W:
+					MakeShore(tile);
+					break;
+
+				default:
+					uint check_dirs = _flood_from_dirs[slope & ~SLOPE_STEEP];
+					uint dir;
+					FOR_EACH_SET_BIT(dir, check_dirs) {
+						TileIndex dest = TILE_ADD(tile, TileOffsByDir((Direction)dir));
+						Slope slope_dest = (Slope)(GetTileSlope(dest, NULL) & ~SLOPE_STEEP);
+						if (HasBit(_active_water_slopes, slope_dest)) {
+							MakeShore(tile);
+							break;
+						}
+					}
+					break;
+			}
+		}
 	}
 }
 
@@ -821,6 +1009,7 @@
 		case WATER_TILE_COAST: ts = (TrackBits)coast_tracks[GetTileSlope(tile, NULL) & 0xF]; break;
 		case WATER_TILE_LOCK:  ts = AxisToTrackBits(DiagDirToAxis(GetLockDirection(tile))); break;
 		case WATER_TILE_DEPOT: ts = AxisToTrackBits(GetShipDepotAxis(tile)); break;
+		case WATER_TILE_RIVER: ts = (GetTileSlope(tile, NULL) == SLOPE_FLAT) ? TRACK_BIT_ALL : TRACK_BIT_NONE; break;
 		default: return 0;
 	}
 	if (TileX(tile) == 0) {
@@ -856,7 +1045,7 @@
 	}
 }
 
-static uint32 VehicleEnter_Water(Vehicle *v, TileIndex tile, int x, int y)
+static VehicleEnterTileStatus VehicleEnter_Water(Vehicle *v, TileIndex tile, int x, int y)
 {
 	return VETSB_CONTINUE;
 }
--- a/src/water_map.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/water_map.h	Tue Jan 22 21:00:30 2008 +0000
@@ -10,6 +10,7 @@
 	WATER_TILE_COAST,
 	WATER_TILE_LOCK,
 	WATER_TILE_DEPOT,
+	WATER_TILE_RIVER,
 };
 
 enum DepotPart {
@@ -31,6 +32,7 @@
 
 	if (_m[t].m5 == 0) return WATER_TILE_CLEAR;
 	if (_m[t].m5 == 1) return WATER_TILE_COAST;
+	if (_m[t].m5 == 2) return WATER_TILE_RIVER;
 	if (IsInsideMM(_m[t].m5, LOCK_MIDDLE, LOCK_END)) return WATER_TILE_LOCK;
 
 	assert(IsInsideMM(_m[t].m5, DEPOT_NORTH, DEPOT_END));
@@ -60,6 +62,11 @@
 	return GetWaterTileType(t) == WATER_TILE_CLEAR && GetTileOwner(t) != OWNER_WATER;
 }
 
+static inline bool IsRiver(TileIndex t)
+{
+	return GetWaterTileType(t) == WATER_TILE_RIVER;
+}
+
 static inline bool IsWaterTile(TileIndex t)
 {
 	return IsTileType(t, MP_WATER) && IsWater(t);
@@ -85,6 +92,11 @@
 	return XYNSToDiagDir(GetShipDepotAxis(t), GB(_m[t].m5, 0, 1));
 }
 
+static inline Owner GetShipDepotWaterOwner(TileIndex t)
+{
+	return (Owner)_m[t].m4;
+}
+
 static inline DiagDirection GetLockDirection(TileIndex t)
 {
 	return (DiagDirection)GB(_m[t].m5, 0, 2);
@@ -96,6 +108,11 @@
 	return GB(_m[t].m5, 0, 4);
 }
 
+static inline byte GetWaterTileRandomBits(TileIndex t)
+{
+	return _m[t].m4;
+}
+
 
 static inline void MakeWater(TileIndex t)
 {
@@ -117,24 +134,34 @@
 	_m[t].m5 = 1;
 }
 
-static inline void MakeCanal(TileIndex t, Owner o)
+static inline void MakeRiver(TileIndex t, uint8 random_bits)
+{
+	SetTileType(t, MP_WATER);
+	SetTileOwner(t, OWNER_WATER);
+	_m[t].m2 = 0;
+	_m[t].m3 = 0;
+	_m[t].m4 = random_bits;
+	_m[t].m5 = 2;
+}
+
+static inline void MakeCanal(TileIndex t, Owner o, uint8 random_bits)
 {
 	assert(o != OWNER_WATER);
 	SetTileType(t, MP_WATER);
 	SetTileOwner(t, o);
 	_m[t].m2 = 0;
 	_m[t].m3 = 0;
-	_m[t].m4 = 0;
+	_m[t].m4 = random_bits;
 	_m[t].m5 = 0;
 }
 
-static inline void MakeShipDepot(TileIndex t, Owner o, DepotPart base, Axis a)
+static inline void MakeShipDepot(TileIndex t, Owner o, DepotPart base, Axis a, Owner original_owner)
 {
 	SetTileType(t, MP_WATER);
 	SetTileOwner(t, o);
 	_m[t].m2 = 0;
 	_m[t].m3 = 0;
-	_m[t].m4 = 0;
+	_m[t].m4 = original_owner;
 	_m[t].m5 = base + a * 2;
 }
 
--- a/src/waypoint.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/waypoint.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,28 +5,34 @@
 #include "stdafx.h"
 #include "openttd.h"
 
-#include "command.h"
-#include "functions.h"
-#include "gfx.h"
+#include "command_func.h"
 #include "landscape.h"
-#include "map.h"
 #include "order.h"
 #include "rail_map.h"
+#include "rail.h"
 #include "bridge_map.h"
 #include "saveload.h"
 #include "station.h"
-#include "tile.h"
 #include "town.h"
 #include "waypoint.h"
 #include "variables.h"
-#include "table/strings.h"
-#include "vehicle.h"
 #include "yapf/yapf.h"
-#include "date.h"
 #include "newgrf.h"
-#include "string.h"
-#include "strings.h"
 #include "misc/autoptr.hpp"
+#include "strings_func.h"
+#include "gfx_func.h"
+#include "functions.h"
+#include "window_func.h"
+#include "economy_func.h"
+#include "date_func.h"
+#include "vehicle_func.h"
+#include "vehicle_base.h"
+#include "string_func.h"
+#include "signal_func.h"
+#include "player_func.h"
+#include "settings_type.h"
+
+#include "table/strings.h"
 
 enum {
 	MAX_WAYPOINTS_PER_TOWN = 64,
@@ -87,14 +93,14 @@
 	FOR_ALL_WAYPOINTS(local_wp) {
 		if (wp == local_wp) continue;
 
-		if (local_wp->xy && local_wp->string == STR_NULL && local_wp->town_index == wp->town_index)
+		if (local_wp->xy && local_wp->name == NULL && local_wp->town_index == wp->town_index)
 			used_waypoint[local_wp->town_cn] = true;
 	}
 
 	/* Find an empty spot */
 	for (i = 0; used_waypoint[i] && i < MAX_WAYPOINTS_PER_TOWN; i++) {}
 
-	wp->string = STR_NULL;
+	wp->name = NULL;
 	wp->town_cn = i;
 }
 
@@ -161,8 +167,6 @@
 	Slope tileh;
 	Axis axis;
 
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
 	/* if custom gfx are used, make sure it is within bounds */
 	if (p1 >= GetNumCustomStations(STAT_CLASS_WAYP)) return CMD_ERROR;
 
@@ -194,7 +198,7 @@
 		wp_auto_delete = wp;
 
 		wp->town_index = 0;
-		wp->string = STR_NULL;
+		wp->name = NULL;
 		wp->town_cn = 0;
 	} else if (flags & DC_EXEC) {
 		/* Move existing (recently deleted) waypoint to the new location */
@@ -245,7 +249,7 @@
 		wp_auto_delete.Detach();
 	}
 
-	return CommandCost(_price.build_train_depot);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.build_train_depot);
 }
 
 /**
@@ -282,6 +286,7 @@
 
 	if (flags & DC_EXEC) {
 		Track track = GetRailWaypointTrack(tile);
+		Owner owner = GetTileOwner(tile); // cannot use _current_player because of possible floods
 		wp = GetWaypointByTile(tile);
 
 		wp->deleted = 30; // let it live for this many days before we do the actual deletion.
@@ -292,12 +297,12 @@
 			MarkTileDirtyByTile(tile);
 		} else {
 			DoClearSquare(tile);
-			SetSignalsOnBothDir(tile, track);
+			AddTrackToSignalBuffer(tile, track, owner);
 		}
 		YapfNotifyTrackLayoutChange(tile, track);
 	}
 
-	return CommandCost(_price.remove_train_depot);
+	return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_train_depot);
 }
 
 /**
@@ -310,7 +315,6 @@
  */
 CommandCost CmdRemoveTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
 	return RemoveTrainWaypoint(tile, flags, true);
 }
 
@@ -348,24 +352,17 @@
 	if (!StrEmpty(_cmd_text)) {
 		if (!IsUniqueWaypointName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
 
-		StringID str = AllocateName(_cmd_text, 0);
-
-		if (str == 0) return CMD_ERROR;
-
 		if (flags & DC_EXEC) {
-			if (wp->string != STR_NULL) DeleteName(wp->string);
-
-			wp->string = str;
+			free(wp->name);
+			wp->name = strdup(_cmd_text);
 			wp->town_cn = 0;
 
 			UpdateWaypointSign(wp);
 			MarkWholeScreenDirty();
-		} else {
-			DeleteName(str);
 		}
 	} else {
 		if (flags & DC_EXEC) {
-			if (wp->string != STR_NULL) DeleteName(wp->string);
+			free(wp->name);
 
 			MakeDefaultWaypointName(wp);
 			UpdateWaypointSign(wp);
@@ -391,7 +388,6 @@
 
 	stat.train_tile = stat.xy = wp->xy;
 	stat.town = GetTown(wp->town_index);
-	stat.string_id = wp->string;
 	stat.build_date = wp->build_date;
 
 	return &stat;
@@ -421,7 +417,7 @@
 
 Waypoint::~Waypoint()
 {
-	if (this->string != STR_NULL) DeleteName(this->string);
+	free(this->name);
 
 	if (CleaningPool()) return;
 
@@ -460,7 +456,8 @@
 	SLE_CONDVAR(Waypoint, xy,         SLE_UINT32,                  6, SL_MAX_VERSION),
 	SLE_CONDVAR(Waypoint, town_index, SLE_UINT16,                 12, SL_MAX_VERSION),
 	SLE_CONDVAR(Waypoint, town_cn,    SLE_UINT8,                  12, SL_MAX_VERSION),
-	    SLE_VAR(Waypoint, string,     SLE_UINT16),
+	SLE_CONDVAR(Waypoint, string,     SLE_STRINGID,                0, 83),
+	SLE_CONDSTR(Waypoint, name,       SLE_STR, 0,                 84, SL_MAX_VERSION),
 	    SLE_VAR(Waypoint, deleted,    SLE_UINT8),
 
 	SLE_CONDVAR(Waypoint, build_date, SLE_FILE_U16 | SLE_VAR_I32,  3, 30),
--- a/src/waypoint.h	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/waypoint.h	Tue Jan 22 21:00:30 2008 +0000
@@ -7,6 +7,7 @@
 
 #include "oldpool.h"
 #include "rail_map.h"
+#include "command_type.h"
 
 struct Waypoint;
 DECLARE_OLD_POOL(Waypoint, Waypoint, 3, 8000)
@@ -16,7 +17,8 @@
 
 	TownID town_index; ///< Town associated with the waypoint
 	byte town_cn;      ///< The Nth waypoint for this town (consecutive number)
-	StringID string;   ///< If this is zero (i.e. no custom name), town + town_cn is used for naming
+	StringID string;   ///< C000-C03F have special meaning in old games
+	char *name;        ///< Custom name. If not set, town + town_cn is used for naming
 
 	ViewportSign sign; ///< Dimensions of sign (not saved)
 	Date build_date;   ///< Date of construction
--- a/src/widget.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/widget.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -4,13 +4,18 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "functions.h"
-#include "player.h"
+#include "core/math_func.hpp"
+#include "player_func.h"
+#include "gfx_func.h"
+#include "window_gui.h"
+#include "window_func.h"
+#include "widgets/dropdown_func.h"
+
 #include "table/sprites.h"
 #include "table/strings.h"
-#include "window.h"
-#include "gfx.h"
-#include "viewport.h"
+
+static const char *UPARROW   = "\xEE\x8A\x80";
+static const char *DOWNARROW = "\xEE\x8A\xAA";
 
 static Point HandleScrollbarHittest(const Scrollbar *sb, int top, int bottom)
 {
@@ -208,13 +213,13 @@
 			/* show different image when clicked for WWT_IMGBTN_2 */
 			if ((wi->type & WWT_MASK) == WWT_IMGBTN_2 && clicked) img++;
 			DrawSprite(img, PAL_NONE, r.left + 1 + clicked, r.top + 1 + clicked);
-			goto draw_default;
+			break;
 		}
 
 		case WWT_PANEL: {
 			assert(wi->data == 0);
 			DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, (clicked) ? FR_LOWERED : FR_NONE);
-			goto draw_default;
+			break;
 		}
 
 		case WWT_TEXTBTN:
@@ -229,7 +234,7 @@
 			if ((wi->type & WWT_MASK) == WWT_TEXTBTN_2 && clicked) str++;
 
 			DrawStringCentered(((r.left + r.right + 1) >> 1) + clicked, ((r.top + r.bottom + 1) >> 1) - 5 + clicked, str, TC_FROMSTRING);
-			goto draw_default;
+			break;
 		}
 
 		case WWT_TEXT: {
@@ -244,7 +249,7 @@
 			DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, FR_LOWERED | FR_DARKENED);
 
 			if (str != STR_NULL) DrawStringTruncated(r.left + 2, r.top + 1, str, TC_FROMSTRING, r.right - r.left - 10);
-			goto draw_default;
+			break;
 		}
 
 		case WWT_MATRIX: {
@@ -288,7 +293,7 @@
 				GfxFillRect(r.left + 1, x, r.right - 1, x, color);
 			}
 
-			goto draw_default;
+			break;
 		}
 
 		/* vertical scrollbar */
@@ -424,7 +429,7 @@
 			GfxFillRect(r.left + 1, r.bottom - 1, r.right - 1, r.bottom - 1, c1);
 			GfxFillRect(r.left, r.bottom, r.right, r.bottom, c2);
 
-			goto draw_default;
+			break;
 		}
 
 		case WWT_STICKYBOX: {
@@ -468,11 +473,34 @@
 			}
 
 			DrawStringCenteredTruncated(r.left + 2, r.right - 2, r.top + 2, wi->data, 0x84);
-draw_default:;
-			if (w->IsWidgetDisabled(i)) {
-				GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, _colour_gradient[wi->color & 0xF][2] | (1 << PALETTE_MODIFIER_GREYOUT));
-			}
+			break;
 		}
+
+		case WWT_DROPDOWN: {
+			assert(r.bottom - r.top == 11); // ensure consistent size
+
+			StringID str = wi->data;
+			DrawFrameRect(r.left, r.top, r.right - 12, r.bottom, wi->color, FR_NONE);
+			DrawFrameRect(r.right - 11, r.top, r.right, r.bottom, wi->color, clicked ? FR_LOWERED : FR_NONE);
+			DrawString(r.right - (clicked ? 8 : 9), r.top + (clicked ? 2 : 1), STR_0225, TC_BLACK);
+			if (str != STR_NULL) DrawStringTruncated(r.left + 2, r.top + 1, str, TC_BLACK, r.right - r.left - 12);
+			break;
+		}
+
+		case WWT_DROPDOWNIN: {
+			assert(r.bottom - r.top == 11); // ensure consistent size
+
+			StringID str = wi->data;
+			DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, FR_LOWERED | FR_DARKENED);
+			DrawFrameRect(r.right - 11, r.top + 1, r.right - 1, r.bottom - 1, wi->color, clicked ? FR_LOWERED : FR_NONE);
+			DrawString(r.right - (clicked ? 8 : 9), r.top + (clicked ? 2 : 1), STR_0225, TC_BLACK);
+			if (str != STR_NULL) DrawStringTruncated(r.left + 2, r.top + 2, str, TC_BLACK, r.right - r.left - 12);
+			break;
+		}
+		}
+
+		if (w->IsWidgetDisabled(i)) {
+			GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, _colour_gradient[wi->color & 0xF][2] | (1 << PALETTE_MODIFIER_GREYOUT));
 		}
 	}
 
@@ -483,235 +511,6 @@
 
 }
 
-static const Widget _dropdown_menu_widgets[] = {
-{      WWT_PANEL,   RESIZE_NONE,     0,     0, 0,     0, 0, 0x0, STR_NULL},
-{  WWT_SCROLLBAR,   RESIZE_NONE,     0,     0, 0,     0, 0, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
-{   WIDGETS_END},
-};
-
-static int GetDropdownItem(const Window *w)
-{
-	byte item, counter;
-	int y;
-
-	if (GetWidgetFromPos(w, _cursor.pos.x - w->left, _cursor.pos.y - w->top) < 0)
-		return -1;
-
-	y = _cursor.pos.y - w->top - 2 + w->vscroll.pos * 10;
-
-	if (y < 0)
-		return - 1;
-
-	item = y / 10;
-	if (item >= WP(w,dropdown_d).num_items || (HasBit(WP(w,dropdown_d).disabled_state, item) && !HasBit(WP(w,dropdown_d).hidden_state, item)) || WP(w,dropdown_d).items[item] == 0)
-		return - 1;
-
-	/* Skip hidden items -- +1 for each hidden item before the clicked item. */
-	for (counter = 0; item >= counter; ++counter)
-		if (HasBit(WP(w,dropdown_d).hidden_state, counter)) item++;
-
-	return item;
-}
-
-static void DropdownMenuWndProc(Window *w, WindowEvent *e)
-{
-	int item;
-
-	switch (e->event) {
-		case WE_PAINT: {
-			int x,y,i,sel;
-			int width, height;
-
-			DrawWindowWidgets(w);
-
-			x = 1;
-			y = 2 - w->vscroll.pos * 10;
-
-			sel    = WP(w,dropdown_d).selected_index;
-			width  = w->widget[0].right - 3;
-			height = w->widget[0].bottom - 3;
-
-			for (i = 0; WP(w,dropdown_d).items[i] != INVALID_STRING_ID; i++, sel--) {
-				if (HasBit(WP(w,dropdown_d).hidden_state, i)) continue;
-
-				if (y >= 0 && y <= height) {
-					if (WP(w,dropdown_d).items[i] != STR_NULL) {
-						if (sel == 0) GfxFillRect(x + 1, y, x + width, y + 9, 0);
-						DrawStringTruncated(x + 2, y, WP(w,dropdown_d).items[i], sel == 0 ? TC_WHITE : TC_BLACK, x + width);
-
-						if (HasBit(WP(w,dropdown_d).disabled_state, i)) {
-							GfxFillRect(x, y, x + width, y + 9,
-								(1 << PALETTE_MODIFIER_GREYOUT) | _colour_gradient[_dropdown_menu_widgets[0].color][5]
-							);
-						}
-					} else {
-						int c1 = _colour_gradient[_dropdown_menu_widgets[0].color][3];
-						int c2 = _colour_gradient[_dropdown_menu_widgets[0].color][7];
-
-						GfxFillRect(x + 1, y + 3, x + w->width - 5, y + 3, c1);
-						GfxFillRect(x + 1, y + 4, x + w->width - 5, y + 4, c2);
-					}
-				}
-				y += 10;
-			}
-		} break;
-
-		case WE_CLICK: {
-			if (e->we.click.widget != 0) break;
-			item = GetDropdownItem(w);
-			if (item >= 0) {
-				WP(w,dropdown_d).click_delay = 4;
-				WP(w,dropdown_d).selected_index = item;
-				SetWindowDirty(w);
-			}
-		} break;
-
-		case WE_MOUSELOOP: {
-			Window *w2 = FindWindowById(WP(w,dropdown_d).parent_wnd_class, WP(w,dropdown_d).parent_wnd_num);
-			if (w2 == NULL) {
-				DeleteWindow(w);
-				return;
-			}
-
-			if (WP(w,dropdown_d).click_delay != 0 && --WP(w,dropdown_d).click_delay == 0) {
-				WindowEvent e;
-				e.event = WE_DROPDOWN_SELECT;
-				e.we.dropdown.button = WP(w,dropdown_d).parent_button;
-				e.we.dropdown.index  = WP(w,dropdown_d).selected_index;
-				w2->wndproc(w2, &e);
-				DeleteWindow(w);
-				return;
-			}
-
-			if (WP(w,dropdown_d).drag_mode) {
-				item = GetDropdownItem(w);
-
-				if (!_left_button_clicked) {
-					WP(w,dropdown_d).drag_mode = false;
-					if (item < 0) return;
-					WP(w,dropdown_d).click_delay = 2;
-				} else {
-					if (item < 0) return;
-				}
-
-				WP(w,dropdown_d).selected_index = item;
-				SetWindowDirty(w);
-			}
-		} break;
-
-		case WE_DESTROY: {
-			Window *w2 = FindWindowById(WP(w,dropdown_d).parent_wnd_class, WP(w,dropdown_d).parent_wnd_num);
-			if (w2 != NULL) {
-				w2->RaiseWidget(WP(w,dropdown_d).parent_button);
-				InvalidateWidget(w2, WP(w,dropdown_d).parent_button);
-			}
-		} break;
-	}
-}
-
-void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int button, uint32 disabled_mask, uint32 hidden_mask)
-{
-	int i;
-	const Widget *wi;
-	Window *w2;
-	const Window *w3;
-	bool is_dropdown_menu_shown = w->IsWidgetLowered(button);
-	int top, height;
-	int screen_top, screen_bottom;
-	bool scroll = false;
-
-	DeleteWindowById(WC_DROPDOWN_MENU, 0);
-
-	if (is_dropdown_menu_shown) return;
-
-	w->LowerWidget(button);
-
-	InvalidateWidget(w, button);
-
-	for (i = 0; strings[i] != INVALID_STRING_ID; i++) {}
-	if (i == 0) return;
-
-	wi = &w->widget[button];
-
-	if (hidden_mask != 0) {
-		uint j;
-
-		for (j = 0; strings[j] != INVALID_STRING_ID; j++) {
-			if (HasBit(hidden_mask, j)) i--;
-		}
-	}
-
-	/* The preferred position is just below the dropdown calling widget */
-	top = w->top + wi->bottom + 2;
-	height = i * 10 + 4;
-
-	w3 = FindWindowById(WC_STATUS_BAR, 0);
-	screen_bottom = w3 == NULL ? _screen.height : w3->top;
-
-	/* Check if the dropdown will fully fit below the widget */
-	if (top + height >= screen_bottom) {
-		w3 = FindWindowById(WC_MAIN_TOOLBAR, 0);
-		screen_top = w3 == NULL ? 0 : w3->top + w3->height;
-
-		/* If not, check if it will fit above the widget */
-		if (w->top + wi->top - height - 1 > screen_top) {
-			top = w->top + wi->top - height - 1;
-		} else {
-			/* ... and lastly if it won't, enable the scroll bar and fit the
-			 * list in below the widget */
-			int rows = (screen_bottom - 4 - top) / 10;
-			height = rows * 10 + 4;
-			scroll = true;
-		}
-	}
-
-	w2 = AllocateWindow(
-		w->left + wi[-1].left + 1,
-		top,
-		wi->right - wi[-1].left + 1,
-		height,
-		DropdownMenuWndProc,
-		WC_DROPDOWN_MENU,
-		_dropdown_menu_widgets);
-
-	w2->widget[0].color = wi->color;
-	w2->widget[0].right = wi->right - wi[-1].left;
-	w2->widget[0].bottom = height - 1;
-
-	w2->SetWidgetHiddenState(1, !scroll);
-
-	if (scroll) {
-		/* We're scrolling, so enable the scroll bar and shrink the list by
-		 * the scrollbar's width */
-		w2->widget[1].color  = wi->color;
-		w2->widget[1].right  = w2->widget[0].right;
-		w2->widget[1].left   = w2->widget[1].right - 11;
-		w2->widget[1].bottom = height - 1;
-		w2->widget[0].right -= 12;
-
-		w2->vscroll.cap   = (height - 4) / 10;
-		w2->vscroll.count = i;
-	}
-
-	w2->desc_flags = WDF_DEF_WIDGET;
-	w2->flags4 &= ~WF_WHITE_BORDER_MASK;
-
-	WP(w2,dropdown_d).disabled_state = disabled_mask;
-	WP(w2,dropdown_d).hidden_state = hidden_mask;
-
-	WP(w2,dropdown_d).parent_wnd_class = w->window_class;
-	WP(w2,dropdown_d).parent_wnd_num = w->window_number;
-	WP(w2,dropdown_d).parent_button = button;
-
-	WP(w2,dropdown_d).num_items = i;
-	WP(w2,dropdown_d).selected_index = selected;
-	WP(w2,dropdown_d).items = strings;
-
-	WP(w2,dropdown_d).click_delay = 0;
-	WP(w2,dropdown_d).drag_mode = true;
-}
-
-
 static void ResizeWidgets(Window *w, byte a, byte b)
 {
 	int16 offset = w->widget[a].left;
@@ -783,3 +582,16 @@
 		}
 	}
 }
+
+/** Draw a sort button's up or down arrow symbol.
+ * @param w Window of widget
+ * @param widget Sort button widget
+ * @param state State of sort button
+ */
+void DrawSortButtonState(const Window *w, int widget, SortButtonState state)
+{
+	if (state == SBS_OFF) return;
+
+	int offset = w->IsWidgetLowered(widget) ? 1 : 0;
+	DoDrawString(state == SBS_DOWN ? DOWNARROW : UPARROW, w->widget[widget].right - 11 + offset, w->widget[widget].top + 1 + offset, TC_BLACK);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/widgets/dropdown.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,329 @@
+/* $Id$ */
+
+#include "../stdafx.h"
+#include "../openttd.h"
+#include "../strings_type.h"
+#include "../window_gui.h"
+#include "../strings_func.h"
+#include "../strings_type.h"
+#include "../gfx_func.h"
+#include "../window_func.h"
+#include "../core/math_func.hpp"
+#include "dropdown_type.h"
+#include "dropdown_func.h"
+
+#include "../table/sprites.h"
+#include "table/strings.h"
+
+StringID DropDownListItem::String() const
+{
+	return STR_NULL;
+}
+
+StringID DropDownListStringItem::String() const
+{
+	return this->string;
+}
+
+StringID DropDownListParamStringItem::String() const
+{
+	for (uint i = 0; i < lengthof(this->decode_params); i++) SetDParam(i, this->decode_params[i]);
+	return this->string;
+}
+
+/**
+ * Delete all items of a drop down list and the list itself
+ * @param list List to delete.
+ */
+static void DeleteDropDownList(DropDownList *list)
+{
+	for (DropDownList::iterator it = list->begin(); it != list->end(); ++it) {
+		DropDownListItem *item = *it;
+		delete item;
+	}
+	delete list;
+}
+
+struct dropdown_d {
+	WindowClass parent_wnd_class;
+	WindowNumber parent_wnd_num;
+	byte parent_button;
+	DropDownList *list;
+	byte selected_index;
+	byte click_delay;
+	bool drag_mode;
+	int scrolling;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(dropdown_d));
+
+static const Widget _dropdown_menu_widgets[] = {
+{      WWT_PANEL,   RESIZE_NONE,     0,     0, 0,     0, 0, 0x0, STR_NULL},
+{  WWT_SCROLLBAR,   RESIZE_NONE,     0,     0, 0,     0, 0, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
+{   WIDGETS_END},
+};
+
+static int GetDropDownItem(const Window *w)
+{
+	if (GetWidgetFromPos(w, _cursor.pos.x - w->left, _cursor.pos.y - w->top) < 0) return -1;
+
+	int y = _cursor.pos.y - w->top - 2 + w->vscroll.pos * 10;
+	if (y < 0) return -1;
+
+	uint selected_row = y / 10;
+	const DropDownList *list = WP(w, dropdown_d).list;
+
+	if (selected_row >= list->size()) return -1;
+
+	for (DropDownList::const_iterator it = list->begin(); it != list->end(); ++it, selected_row--) {
+		if (selected_row == 0) {
+			const DropDownListItem *item = *it;
+			if (item->masked || item->String() == STR_NULL) return -1;
+			return item->result;
+		}
+	}
+
+	return -1;
+}
+
+static void DropDownMenuWndProc(Window *w, WindowEvent *e)
+{
+	switch (e->event) {
+		case WE_PAINT: {
+			DrawWindowWidgets(w);
+
+			int x = 1;
+			int y = 2 - w->vscroll.pos * 10;
+
+			int sel    = WP(w, dropdown_d).selected_index;
+			int width  = w->widget[0].right - 3;
+			int height = w->widget[0].bottom - 3;
+
+			DropDownList *list = WP(w, dropdown_d).list;
+
+			for (DropDownList::const_iterator it = list->begin(); it != list->end(); ++it) {
+				if (y >= 0 && y <= height) {
+					const DropDownListItem *item = *it;
+					if (item->String() != STR_NULL) {
+						if (sel == item->result) GfxFillRect(x + 1, y, x + width, y + 9, 0);
+
+						DrawStringTruncated(x + 2, y, item->String(), sel == item->result ? TC_WHITE : TC_BLACK, x + width);
+
+						if (item->masked) {
+							GfxFillRect(x, y, x + width, y + 9,
+								(1 << PALETTE_MODIFIER_GREYOUT) | _colour_gradient[w->widget[0].color][5]
+							);
+						}
+					} else {
+						int c1 = _colour_gradient[w->widget[0].color][3];
+						int c2 = _colour_gradient[w->widget[0].color][7];
+
+						GfxFillRect(x + 1, y + 3, x + w->width - 5, y + 3, c1);
+						GfxFillRect(x + 1, y + 4, x + w->width - 5, y + 4, c2);
+					}
+				}
+				y += 10;
+			}
+		} break;
+
+		case WE_CLICK: {
+			if (e->we.click.widget != 0) break;
+			int item = GetDropDownItem(w);
+			if (item >= 0) {
+				WP(w, dropdown_d).click_delay = 4;
+				WP(w, dropdown_d).selected_index = item;
+				SetWindowDirty(w);
+			}
+		} break;
+
+		case WE_TICK:
+			if (WP(w, dropdown_d).scrolling == -1) {
+				w->vscroll.pos = max(0, w->vscroll.pos - 1);
+				SetWindowDirty(w);
+			} else if (WP(w, dropdown_d).scrolling == 1) {
+				w->vscroll.pos = min(w->vscroll.count - w->vscroll.cap, w->vscroll.pos + 1);
+				SetWindowDirty(w);
+			}
+			WP(w, dropdown_d).scrolling = 0;
+			break;
+
+		case WE_MOUSELOOP: {
+			Window *w2 = FindWindowById(WP(w, dropdown_d).parent_wnd_class, WP(w,dropdown_d).parent_wnd_num);
+			if (w2 == NULL) {
+				DeleteWindow(w);
+				return;
+			}
+
+			if (WP(w, dropdown_d).click_delay != 0 && --WP(w,dropdown_d).click_delay == 0) {
+				WindowEvent e;
+				e.event = WE_DROPDOWN_SELECT;
+				e.we.dropdown.button = WP(w, dropdown_d).parent_button;
+				e.we.dropdown.index  = WP(w, dropdown_d).selected_index;
+				w2->wndproc(w2, &e);
+				DeleteWindow(w);
+				return;
+			}
+
+			if (WP(w, dropdown_d).drag_mode) {
+				int item = GetDropDownItem(w);
+
+				if (!_left_button_clicked) {
+					WP(w, dropdown_d).drag_mode = false;
+					if (item < 0) return;
+					WP(w, dropdown_d).click_delay = 2;
+				} else {
+					if (_cursor.pos.y <= w->top + 2) {
+						/* Cursor is above the list, set scroll up */
+						WP(w, dropdown_d).scrolling = -1;
+						return;
+					} else if (_cursor.pos.y >= w->top + w->height - 2) {
+						/* Cursor is below list, set scroll down */
+						WP(w, dropdown_d).scrolling = 1;
+						return;
+					}
+
+					if (item < 0) return;
+				}
+
+				WP(w, dropdown_d).selected_index = item;
+				SetWindowDirty(w);
+			}
+		} break;
+
+		case WE_DESTROY: {
+			Window *w2 = FindWindowById(WP(w, dropdown_d).parent_wnd_class, WP(w,dropdown_d).parent_wnd_num);
+			if (w2 != NULL) {
+				w2->RaiseWidget(WP(w, dropdown_d).parent_button);
+				w2->InvalidateWidget(WP(w, dropdown_d).parent_button);
+			}
+
+			DeleteDropDownList(WP(w, dropdown_d).list);
+		} break;
+	}
+}
+
+void ShowDropDownList(Window *w, DropDownList *list, int selected, int button)
+{
+	bool is_dropdown_menu_shown = w->IsWidgetLowered(button);
+
+	DeleteWindowById(WC_DROPDOWN_MENU, 0);
+
+	if (is_dropdown_menu_shown) {
+		DeleteDropDownList(list);
+		return;
+	}
+
+	w->LowerWidget(button);
+	w->InvalidateWidget(button);
+
+	/* Our parent's button widget is used to determine where to place the drop
+	 * down list window. */
+	const Widget *wi = &w->widget[button];
+
+	/* The preferred position is just below the dropdown calling widget */
+	int top = w->top + wi->bottom + 1;
+	int height = list->size() * 10 + 4;
+
+	/* Check if the status bar is visible, as we don't want to draw over it */
+	Window *w3 = FindWindowById(WC_STATUS_BAR, 0);
+	int screen_bottom = w3 == NULL ? _screen.height : w3->top;
+
+	bool scroll = false;
+
+	/* Check if the dropdown will fully fit below the widget */
+	if (top + height >= screen_bottom) {
+		w3 = FindWindowById(WC_MAIN_TOOLBAR, 0);
+		int screen_top = w3 == NULL ? 0 : w3->top + w3->height;
+
+		/* If not, check if it will fit above the widget */
+		if (w->top + wi->top - height > screen_top) {
+			top = w->top + wi->top - height;
+		} else {
+			/* ... and lastly if it won't, enable the scroll bar and fit the
+			 * list in below the widget */
+			int rows = (screen_bottom - 4 - top) / 10;
+			height = rows * 10 + 4;
+			scroll = true;
+		}
+	}
+
+	Window *dw = AllocateWindow(
+		w->left + wi->left,
+		top,
+		wi->right - wi->left + 1,
+		height,
+		DropDownMenuWndProc,
+		WC_DROPDOWN_MENU,
+		_dropdown_menu_widgets);
+
+	dw->widget[0].color = wi->color;
+	dw->widget[0].right = wi->right - wi->left;
+	dw->widget[0].bottom = height - 1;
+
+	dw->SetWidgetHiddenState(1, !scroll);
+
+	if (scroll) {
+		/* We're scrolling, so enable the scroll bar and shrink the list by
+		 * the scrollbar's width */
+		dw->widget[1].color  = wi->color;
+		dw->widget[1].right  = dw->widget[0].right;
+		dw->widget[1].left   = dw->widget[1].right - 11;
+		dw->widget[1].bottom = height - 1;
+		dw->widget[0].right -= 12;
+
+		dw->vscroll.cap   = (height - 4) / 10;
+		dw->vscroll.count = list->size();
+	}
+
+	dw->desc_flags = WDF_DEF_WIDGET;
+	dw->flags4 &= ~WF_WHITE_BORDER_MASK;
+
+	WP(dw, dropdown_d).parent_wnd_class = w->window_class;
+	WP(dw, dropdown_d).parent_wnd_num   = w->window_number;
+	WP(dw, dropdown_d).parent_button    = button;
+	WP(dw, dropdown_d).list             = list;
+	WP(dw, dropdown_d).selected_index   = selected;
+	WP(dw, dropdown_d).click_delay      = 0;
+	WP(dw, dropdown_d).drag_mode        = true;
+}
+
+void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int button, uint32 disabled_mask, uint32 hidden_mask)
+{
+	/* Don't create a new list if we're just closing an existing menu */
+	if (w->IsWidgetLowered(button)) {
+		DeleteWindowById(WC_DROPDOWN_MENU, 0);
+		return;
+	}
+
+	uint result = 0;
+	DropDownList *list = new DropDownList();
+
+	for (uint i = 0; strings[i] != INVALID_STRING_ID; i++) {
+		if (!HasBit(hidden_mask, i)) {
+			list->push_back(new DropDownListStringItem(strings[i], result, HasBit(disabled_mask, i)));
+		}
+		result++;
+	}
+
+	/* No entries in the list? */
+	if (list->size() == 0) {
+		DeleteDropDownList(list);
+		return;
+	}
+
+	ShowDropDownList(w, list, selected, button);
+}
+
+void HideDropDownMenu(Window *pw)
+{
+	Window **wz;
+	FOR_ALL_WINDOWS(wz) {
+		if ((*wz)->window_class != WC_DROPDOWN_MENU) continue;
+
+		if (pw->window_class == WP(*wz, dropdown_d).parent_wnd_class &&
+				pw->window_number == WP(*wz, dropdown_d).parent_wnd_num) {
+			DeleteWindow(*wz);
+			break;
+		}
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/widgets/dropdown_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,12 @@
+/* $Id$ */
+
+#ifndef WIDGETS_DROPDOWN_FUNC_H
+#define WIDGETS_DROPDOWN_FUNC_H
+
+/* Show drop down menu containing a fixed list of strings */
+void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int button, uint32 disabled_mask, uint32 hidden_mask);
+
+/* Hide drop down menu of a parent window */
+void HideDropDownMenu(Window *pw);
+
+#endif /* WIDGETS_DROPDOWN_FUNC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/widgets/dropdown_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,66 @@
+/* $Id$ */
+
+#ifndef WIDGETS_DROPDOWN_TYPE_H
+#define WIDGETS_DROPDOWN_TYPE_H
+
+#include "../window_type.h"
+#include <list>
+
+/**
+ * Base list item class from which others are derived. If placed in a list it
+ * will appear as a horizontal line in the menu.
+ */
+class DropDownListItem {
+public:
+	int result;  ///< Result code to return to window on selection
+	bool masked; ///< Masked and unselectable item
+
+	DropDownListItem(int result, bool masked) : result(result), masked(masked) {}
+	virtual ~DropDownListItem() {}
+	virtual StringID String() const;
+};
+
+/**
+ * Common string list item.
+ */
+class DropDownListStringItem : public DropDownListItem {
+public:
+	StringID string; ///< String ID of item
+
+	DropDownListStringItem(StringID string, int result, bool masked) : DropDownListItem(result, masked), string(string) {}
+	virtual ~DropDownListStringItem() {}
+
+	StringID String() const;
+};
+
+/**
+ * String list item with parameters.
+ */
+class DropDownListParamStringItem : public DropDownListStringItem {
+public:
+	uint64 decode_params[10]; ///< Parameters of the string
+
+	DropDownListParamStringItem(StringID string, int result, bool masked) : DropDownListStringItem(string, result, masked) {}
+	virtual ~DropDownListParamStringItem() {}
+
+	StringID String() const;
+	void SetParam(uint index, uint64 value) { decode_params[index] = value; }
+};
+
+/**
+ * A drop down list is a collection of drop down list items.
+ */
+typedef std::list<DropDownListItem *> DropDownList;
+
+/**
+ * Show a drop down list.
+ * @param w        Parent window for the list.
+ * @param list     Prepopulated DropDownList. Will be deleted when the list is
+ *                 closed.
+ * @param selected The initially selected list item.
+ * @param button   The widget within the parent window that is used to determine
+ *                 the list's location.
+ */
+void ShowDropDownList(Window *w, DropDownList *list, int selected, int button);
+
+#endif /* WIDGETS_DROPDOWN_TYPE_H */
--- a/src/win32.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/win32.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,13 +5,9 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "macros.h"
-#include "helpers.hpp"
 #include "saveload.h"
-#include "string.h"
-#include "gfx.h"
-#include "window.h"
+#include "gfx_func.h"
+#include "textbuf_gui.h"
 #include "fileio.h"
 #include <windows.h>
 #include <winnt.h>
@@ -23,12 +19,16 @@
 #include "win32.h"
 #include "fios.h" // opendir/readdir/closedir
 #include "fileio.h"
+#include "core/alloc_func.hpp"
+#include "functions.h"
+#include "core/random_func.hpp"
+#include "core/bitmath_func.hpp"
+#include "string_func.h"
 #include <ctype.h>
 #include <tchar.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <shlobj.h>
 #if defined(_MSC_VER) && !defined(WINCE)
 	#include <dbghelp.h>
 #endif
@@ -81,6 +81,17 @@
 
 #ifdef _MSC_VER
 static const char *_exception_string = NULL;
+void SetExceptionString(const char *s, ...)
+{
+	va_list va;
+	char buf[512];
+
+	va_start(va, s);
+	vsnprintf(buf, lengthof(buf), s, va);
+	va_end(va);
+
+	_exception_string = strdup(buf);
+}
 #endif
 
 void ShowOSErrorBox(const char *buf)
@@ -322,7 +333,7 @@
 	size = GetFileSize(h, NULL);
 	if (size > 500000) goto error1;
 
-	mem = malloc(size);
+	mem = MallocT<byte>(size);
 	if (mem == NULL) goto error1;
 
 	if (!ReadFile(h, mem, size, &read, NULL) || read != size) goto error2;
--- a/src/window.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/window.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -6,79 +6,41 @@
 #include <stdarg.h>
 #include "openttd.h"
 #include "debug.h"
-#include "functions.h"
-#include "map.h"
-#include "player.h"
-#include "window.h"
-#include "gfx.h"
-#include "viewport.h"
+#include "player_func.h"
+#include "gfx_func.h"
 #include "console.h"
+#include "viewport_func.h"
 #include "variables.h"
+#include "genworld.h"
+#include "blitter/factory.hpp"
+#include "window_gui.h"
+#include "zoom_func.h"
+#include "core/alloc_func.hpp"
+#include "map_func.h"
+#include "vehicle_base.h"
+#include "settings_type.h"
+
 #include "table/sprites.h"
-#include "genworld.h"
-#include "helpers.hpp"
-#include "blitter/factory.hpp"
 
 /* delta between mouse cursor and upper left corner of dragged window */
 static Point _drag_delta;
 
-static Window _windows[25];
+static Window _windows[MAX_NUMBER_OF_WINDOWS];
 Window *_z_windows[lengthof(_windows)];
 Window **_last_z_window; ///< always points to the next free space in the z-array
 
-void CDECL SetWindowWidgetsDisabledState(Window *w, bool disab_stat, int widgets, ...)
-{
-	va_list wdg_list;
-
-	va_start(wdg_list, widgets);
-
-	while (widgets != WIDGET_LIST_END) {
-		w->SetWidgetDisabledState(widgets, disab_stat);
-		widgets = va_arg(wdg_list, int);
-	}
-
-	va_end(wdg_list);
-}
-
-void CDECL SetWindowWidgetsHiddenState(Window *w, bool hidden_stat, int widgets, ...)
-{
-	va_list wdg_list;
-
-	va_start(wdg_list, widgets);
-
-	while (widgets != WIDGET_LIST_END) {
-		w->SetWidgetHiddenState(widgets, hidden_stat);
-		widgets = va_arg(wdg_list, int);
-	}
+Point _cursorpos_drag_start;
 
-	va_end(wdg_list);
-}
-
-void CDECL SetWindowWidgetsLoweredState(Window *w, bool lowered_stat, int widgets, ...)
-{
-	va_list wdg_list;
-
-	va_start(wdg_list, widgets);
-
-	while (widgets != WIDGET_LIST_END) {
-		w->SetWidgetLoweredState(widgets, lowered_stat);
-		widgets = va_arg(wdg_list, int);
-	}
+int _scrollbar_start_pos;
+int _scrollbar_size;
+byte _scroller_click_timeout;
 
-	va_end(wdg_list);
-}
-
-void RaiseWindowButtons(Window *w)
-{
-	uint i;
+bool _scrolling_scrollbar;
+bool _scrolling_viewport;
+bool _popup_menu_active;
 
-	for (i = 0; i < w->widget_count; i++) {
-		if (w->IsWidgetLowered(i)) {
-			w->RaiseWidget(i);
-			InvalidateWidget(w, i);
-		}
-	}
-}
+byte _special_mouse_mode;
+
 
 void CDECL Window::SetWidgetsDisabledState(bool disab_stat, int widgets, ...)
 {
@@ -127,14 +89,14 @@
 	uint i;
 
 	for (i = 0; i < this->widget_count; i++) {
-		if (IsWidgetLowered(i)) {
-			RaiseWidget(i);
-			InvalidateWidget(i);
+		if (this->IsWidgetLowered(i)) {
+			this->RaiseWidget(i);
+			this->InvalidateWidget(i);
 		}
 	}
 }
 
-void Window::InvalidateWidget(byte widget_index)
+void Window::InvalidateWidget(byte widget_index) const
 {
 	const Widget *wi = &this->widget[widget_index];
 
@@ -144,14 +106,13 @@
 	SetDirtyBlocks(this->left + wi->left, this->top + wi->top, this->left + wi->right + 1, this->top + wi->bottom + 1);
 }
 
-void HandleButtonClick(Window *w, byte widget)
+void Window::HandleButtonClick(byte widget)
 {
-	w->LowerWidget(widget);
-	w->flags4 |= 5 << WF_TIMEOUT_SHL;
-	InvalidateWidget(w, widget);
+	this->LowerWidget(widget);
+	this->flags4 |= 5 << WF_TIMEOUT_SHL;
+	this->InvalidateWidget(widget);
 }
 
-
 static void StartWindowDrag(Window *w);
 static void StartWindowSizing(Window *w);
 
@@ -179,7 +140,7 @@
 				case WWT_PANEL   | WWB_PUSHBUTTON: /* WWT_PUSHBTN */
 				case WWT_IMGBTN  | WWB_PUSHBUTTON: /* WWT_PUSHIMGBTN */
 				case WWT_TEXTBTN | WWB_PUSHBUTTON: /* WWT_PUSHTXTBTN */
-					HandleButtonClick(w, e.we.click.widget);
+					w->HandleButtonClick(e.we.click.widget);
 					break;
 			}
 		} else if (wi->type == WWT_SCROLLBAR || wi->type == WWT_SCROLL2BAR || wi->type == WWT_HSCROLLBAR) {
@@ -200,13 +161,13 @@
 
 		if (w->desc_flags & WDF_RESIZABLE && wi->type == WWT_RESIZEBOX) {
 			StartWindowSizing(w);
-			InvalidateWidget(w, e.we.click.widget);
+			w->InvalidateWidget(e.we.click.widget);
 			return;
 		}
 
 		if (w->desc_flags & WDF_STICKY_BUTTON && wi->type == WWT_STICKYBOX) {
 			w->flags4 ^= WF_STICKY;
-			InvalidateWidget(w, e.we.click.widget);
+			w->InvalidateWidget(e.we.click.widget);
 			return;
 		}
 	}
@@ -1083,7 +1044,7 @@
 
 		if (w->flags4&WF_TIMEOUT_MASK && !(--w->flags4&WF_TIMEOUT_MASK)) {
 			CallWindowEventNP(w, WE_TIMEOUT);
-			if (w->desc_flags & WDF_UNCLICK_BUTTONS) RaiseWindowButtons(w);
+			if (w->desc_flags & WDF_UNCLICK_BUTTONS) w->RaiseButtons();
 		}
 	}
 }
@@ -1698,6 +1659,20 @@
 	e.we.keypress.keycode = GB(key, 16, 16);
 	e.we.keypress.cont = true;
 
+	/*
+	 * The Unicode standard defines an area called the private use area. Code points in this
+	 * area are reserved for private use and thus not portable between systems. For instance,
+	 * Apple defines code points for the arrow keys in this area, but these are only printable
+	 * on a system running OS X. We don't want these keys to show up in text fields and such,
+	 * and thus we have to clear the unicode character when we encounter such a key.
+	 */
+	if (e.we.keypress.key >= 0xE000 && e.we.keypress.key <= 0xF8FF) e.we.keypress.key = 0;
+
+	/*
+	 * If both key and keycode is zero, we don't bother to process the event.
+	 */
+	if (e.we.keypress.key == 0 && e.we.keypress.keycode == 0) return;
+
 	/* check if we have a query string window open before allowing hotkeys */
 	if (FindWindowById(WC_QUERY_STRING,            0) != NULL ||
 			FindWindowById(WC_SEND_NETWORK_MSG,        0) != NULL ||
@@ -1991,16 +1966,6 @@
 	}
 }
 
-void InvalidateWidget(const Window *w, byte widget_index)
-{
-	const Widget *wi = &w->widget[widget_index];
-
-	/* Don't redraw the window if the widget is invisible or of no-type */
-	if (wi->type == WWT_EMPTY || w->IsWidgetHidden(widget_index)) return;
-
-	SetDirtyBlocks(w->left + wi->left, w->top + wi->top, w->left + wi->right + 1, w->top + wi->bottom + 1);
-}
-
 void InvalidateWindowWidget(WindowClass cls, WindowNumber number, byte widget_index)
 {
 	Window* const *wz;
@@ -2008,7 +1973,7 @@
 	FOR_ALL_WINDOWS(wz) {
 		const Window *w = *wz;
 		if (w->window_class == cls && w->window_number == number) {
-			InvalidateWidget(w, widget_index);
+			w->InvalidateWidget(widget_index);
 		}
 	}
 }
@@ -2197,8 +2162,11 @@
 			default:
 				left = w->left;
 				if (left + (w->width >> 1) >= neww) left = neww - w->width;
+				if (left < 0) left = 0;
+
 				top = w->top;
 				if (top + (w->height >> 1) >= newh) top = newh - w->height;
+				if (top < 0) top = 0;
 				break;
 		}
 
--- a/src/window.h	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,976 +0,0 @@
-/* $Id$ */
-
-/** @file window.h regroups declarations for all windowing system, as well as a few helper functions */
-
-#ifndef WINDOW_H
-#define WINDOW_H
-
-#include "macros.h"
-#include "string.h"
-#include "order.h"
-#include "rail.h"
-#include "road.h"
-#include "airport.h"
-#include "vehicle.h"
-#include "viewport.h"
-
-struct WindowEvent;
-
-typedef void WindowProc(Window *w, WindowEvent *e);
-
-/* How the resize system works:
-    First, you need to add a WWT_RESIZEBOX to the widgets, and you need
-     to add the flag WDF_RESIZABLE to the window. Now the window is ready
-     to resize itself.
-    As you may have noticed, all widgets have a RESIZE_XXX in their line.
-     This lines controls how the widgets behave on resize. RESIZE_NONE means
-     it doesn't do anything. Any other option let's one of the borders
-     move with the changed width/height. So if a widget has
-     RESIZE_RIGHT, and the window is made 5 pixels wider by the user,
-     the right of the window will also be made 5 pixels wider.
-    Now, what if you want to clamp a widget to the bottom? Give it the flag
-     RESIZE_TB. This is RESIZE_TOP + RESIZE_BOTTOM. Now if the window gets
-     5 pixels bigger, both the top and bottom gets 5 bigger, so the whole
-     widgets moves downwards without resizing, and appears to be clamped
-     to the bottom. Nice aint it?
-   You should know one more thing about this system. Most windows can't
-    handle an increase of 1 pixel. So there is a step function, which
-    let the windowsize only be changed by X pixels. You configure this
-    after making the window, like this:
-      w->resize.step_height = 10;
-    Now the window will only change in height in steps of 10.
-   You can also give a minimum width and height. The default value is
-    the default height/width of the window itself. You can change this
-    AFTER window-creation, with:
-     w->resize.width or w->resize.height.
-   That was all.. good luck, and enjoy :) -- TrueLight */
-
-enum ResizeFlag {
-	RESIZE_NONE   = 0,  ///< no resize required
-
-	RESIZE_LEFT   = 1,  ///< left resize flag
-	RESIZE_RIGHT  = 2,  ///< rigth resize flag
-	RESIZE_TOP    = 4,  ///< top resize flag
-	RESIZE_BOTTOM = 8,  ///< bottom resize flag
-
-	RESIZE_LR     = RESIZE_LEFT  | RESIZE_RIGHT,   ///<  combination of left and right resize flags
-	RESIZE_RB     = RESIZE_RIGHT | RESIZE_BOTTOM,  ///<  combination of right and bottom resize flags
-	RESIZE_TB     = RESIZE_TOP   | RESIZE_BOTTOM,  ///<  combination of top and bottom resize flags
-	RESIZE_LRB    = RESIZE_LEFT  | RESIZE_RIGHT  | RESIZE_BOTTOM, ///< combination of left, right and bottom resize flags
-	RESIZE_LRTB   = RESIZE_LEFT  | RESIZE_RIGHT  | RESIZE_TOP | RESIZE_BOTTOM,  ///<  combination of all resize flags
-	RESIZE_RTB    = RESIZE_RIGHT | RESIZE_TOP    | RESIZE_BOTTOM, ///<  combination of right, top and bottom resize flag
-
-	/* The following flags are used by the system to specify what is disabled, hidden, or clicked
-	 * They are used in the same place as the above RESIZE_x flags, Widget visual_flags.
-	 * These states are used in exceptions. If nothing is specified, they will indicate
-	 * Enabled, visible or unclicked widgets*/
-	WIDG_DISABLED = 4,  ///< widget is greyed out, not available
-	WIDG_HIDDEN   = 5,  ///< widget is made invisible
-	WIDG_LOWERED  = 6,  ///< widget is paint lowered, a pressed button in fact
-};
-
-enum {
-	WIDGET_LIST_END = -1, ///< indicate the end of widgets' list for vararg functions
-};
-
-struct Widget {
-	byte type;                        ///< Widget type, see WindowWidgetTypes
-	byte display_flags;               ///< Resize direction, alignment, etc. during resizing, see ResizeFlags
-	byte color;                       ///< Widget colour, see docs/ottd-colourtext-palette.png
-	int16 left, right, top, bottom;   ///< The position offsets inside the window
-	uint16 data;                      ///< The String/Image or special code (list-matrixes) of a widget
-	StringID tooltips;                ///< Tooltips that are shown when rightclicking on a widget
-};
-
-enum FrameFlags {
-	FR_NONE         = 0x00,
-	FR_TRANSPARENT  = 0x01,  ///< Makes the background transparent if set
-	FR_BORDERONLY   = 0x10,  ///< Draw border only, no background
-	FR_LOWERED      = 0x20,  ///< If set the frame is lowered and the background color brighter (ie. buttons when pressed)
-	FR_DARKENED     = 0x40,  ///< If set the background is darker, allows for lowered frames with normal background color when used with FR_LOWERED (ie. dropdown boxes)
-};
-
-DECLARE_ENUM_AS_BIT_SET(FrameFlags);
-
-void DrawFrameRect(int left, int top, int right, int bottom, int color, FrameFlags flags);
-
-enum WindowEventCodes {
-	WE_CREATE,
-	WE_DESTROY,
-	WE_PAINT,
-	WE_KEYPRESS,
-	WE_CLICK,
-	WE_DOUBLE_CLICK,
-	WE_RCLICK,
-	WE_MOUSEOVER,
-	WE_MOUSELOOP,
-	WE_MOUSEWHEEL,
-	WE_TICK,
-	WE_4,
-	WE_TIMEOUT,
-	WE_PLACE_OBJ,
-	WE_ABORT_PLACE_OBJ,
-	WE_ON_EDIT_TEXT,
-	WE_ON_EDIT_TEXT_CANCEL,
-	WE_POPUPMENU_SELECT,
-	WE_POPUPMENU_OVER,
-	WE_DRAGDROP,
-	WE_PLACE_DRAG,
-	WE_PLACE_MOUSEUP,
-	WE_PLACE_PRESIZE,
-	WE_DROPDOWN_SELECT,
-	WE_RESIZE,
-	WE_MESSAGE,
-	WE_SCROLL,
-	WE_INVALIDATE_DATA,
-};
-
-struct WindowEvent {
-	byte event;
-	union {
-		struct {
-			void *data;
-		} create;
-
-		struct {
-			Point pt;
-			int widget;
-		} click;
-
-		struct {
-			Point pt;
-			TileIndex tile;
-			TileIndex starttile;
-			ViewportPlaceMethod select_method;
-			byte select_proc;
-		} place;
-
-		struct {
-			Point pt;
-			int widget;
-		} dragdrop;
-
-		struct {
-			Point size;
-			Point diff;
-		} sizing;
-
-		struct {
-			char *str;
-		} edittext;
-
-		struct {
-			Point pt;
-		} popupmenu;
-
-		struct {
-			int button;
-			int index;
-		} dropdown;
-
-		struct {
-			Point pt;
-			int widget;
-		} mouseover;
-
-		struct {
-			bool cont;      ///< continue the search? (default true)
-			uint16 key;     ///< 16-bit Unicode value of the key
-			uint16 keycode; ///< untranslated key (including shift-state)
-		} keypress;
-
-		struct {
-			int msg;      ///< message to be sent
-			int wparam;   ///< additional message-specific information
-			int lparam;   ///< additional message-specific information
-		} message;
-
-		struct {
-			Point delta;   ///< delta position against position of last call
-		} scroll;
-
-		struct {
-			int wheel;     ///< how much was 'wheel'd'
-		} wheel;
-	} we;
-};
-
-struct WindowDesc {
-	int16 left, top, minimum_width, minimum_height, default_width, default_height;
-	WindowClass cls;
-	WindowClass parent_cls;
-	uint32 flags;
-	const Widget *widgets;
-	WindowProc *proc;
-};
-
-enum WindowDefaultFlag {
-	WDF_STD_TOOLTIPS    =   1, ///< use standard routine when displaying tooltips
-	WDF_DEF_WIDGET      =   2, ///< default widget control for some widgets in the on click event
-	WDF_STD_BTN         =   4, ///< default handling for close and drag widgets (widget no 0 and 1)
-
-	WDF_UNCLICK_BUTTONS =  16, ///< Unclick buttons when the window event times out */
-	WDF_STICKY_BUTTON   =  32, ///< Set window to sticky mode; they are not closed unless closed with 'X' (widget 2)
-	WDF_RESIZABLE       =  64, ///< A window can be resized
-	WDF_MODAL           = 128, ///< The window is a modal child of some other window, meaning the parent is 'inactive'
-};
-
-/* can be used as x or y coordinates to cause a specific placement */
-enum WindowDefaultPosition {
-	WDP_AUTO      = -1, ///< Find a place automatically
-	WDP_CENTER    = -2, ///< Center the window (left/right or top/bottom)
-	WDP_ALIGN_TBR = -3, ///< Align the right side of the window with the right side of the main toolbar
-	WDP_ALIGN_TBL = -4, ///< Align the left side of the window with the left side of the main toolbar
-};
-
-struct Textbuf {
-	char *buf;                  ///< buffer in which text is saved
-	uint16 maxlength, maxwidth; ///< the maximum size of the buffer. Maxwidth specifies screensize in pixels, maxlength is in bytes
-	uint16 length, width;       ///< the current size of the string. Width specifies screensize in pixels, length is in bytes
-	bool caret;                 ///< is the caret ("_") visible or not
-	uint16 caretpos;            ///< the current position of the caret in the buffer, in bytes
-	uint16 caretxoffs;          ///< the current position of the caret in pixels
-};
-
-#define WP(ptr,str) (*(str*)(ptr)->custom)
-/* You cannot 100% reliably calculate the biggest custom struct as
- * the number of pointers in it and alignment will have a huge impact.
- * 96 is the largest window-size for 64-bit machines currently */
-#define WINDOW_CUSTOM_SIZE 96
-
-struct Scrollbar {
-	uint16 count, cap, pos;
-};
-
-struct ResizeInfo {
-	uint width; ///< Minimum width and height
-	uint height;
-	uint step_width; ///< In how big steps the width and height go
-	uint step_height;
-};
-
-struct WindowMessage {
-	int msg;
-	int wparam;
-	int lparam;
-};
-
-struct Window {
-	uint16 flags4;
-	WindowClass window_class;
-	WindowNumber window_number;
-
-	int left, top;
-	int width, height;
-
-	Scrollbar hscroll, vscroll, vscroll2;
-	ResizeInfo resize;
-
-	byte caption_color;
-
-	WindowProc *wndproc;
-	ViewPort *viewport;
-	const Widget *original_widget;
-	Widget *widget;
-	uint widget_count;
-	uint32 desc_flags;
-
-	WindowMessage message;
-	Window *parent;
-	byte custom[WINDOW_CUSTOM_SIZE];
-
-	void SetWidgetDisabledState(byte widget_index, bool disab_stat);
-	void DisableWidget(byte widget_index);
-	void EnableWidget(byte widget_index);
-	bool IsWidgetDisabled(byte widget_index) const;
-	void SetWidgetHiddenState(byte widget_index, bool hidden_stat);
-	void HideWidget(byte widget_index);
-	void ShowWidget(byte widget_index);
-	bool IsWidgetHidden(byte widget_index) const;
-	void SetWidgetLoweredState(byte widget_index, bool lowered_stat);
-	void ToggleWidgetLoweredState(byte widget_index);
-	void LowerWidget(byte widget_index);
-	void RaiseWidget(byte widget_index);
-	bool IsWidgetLowered(byte widget_index) const;
-
-	void RaiseButtons();
-	void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets, ...);
-	void CDECL SetWidgetsHiddenState(bool hidden_stat, int widgets, ...);
-	void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets, ...);
-	void InvalidateWidget(byte widget_index);
-};
-
-struct querystr_d {
-	StringID caption;
-	Textbuf text;
-	const char *orig;
-	CharSetFilter afilter;
-	bool handled;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(querystr_d));
-
-struct chatquerystr_d : public querystr_d {
-	int dest;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(chatquerystr_d));
-
-struct menu_d {
-	byte item_count;      ///< follow_vehicle
-	byte sel_index;       ///< scrollpos_x
-	byte main_button;     ///< scrollpos_y
-	byte action_id;
-	StringID string_id;   ///< unk30
-	uint16 checked_items; ///< unk32
-	byte disabled_items;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(menu_d));
-
-struct def_d {
-	int16 data_1, data_2, data_3;
-	int16 data_4, data_5;
-	bool close;
-	byte byte_1;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(def_d));
-
-struct void_d {
-	void *data;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(void_d));
-
-struct tree_d {
-	uint16 base;
-	uint16 count;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(tree_d));
-
-struct tooltips_d {
-	StringID string_id;
-	byte paramcount;
-	uint64 params[5];
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(tooltips_d));
-
-struct buildvehicle_d {
-	VehicleType vehicle_type;
-	union {
-		RailTypeByte railtype;
-		AirportFTAClass::Flags flags;
-		RoadTypes roadtypes;
-	} filter;
-	byte sel_index;  ///< deprecated value, used for 'unified' ship and road
-	bool descending_sort_order;
-	byte sort_criteria;
-	bool regenerate_list;
-	EngineID sel_engine;
-	EngineID rename_engine;
-	EngineList eng_list;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(buildvehicle_d));
-
-struct replaceveh_d {
-	byte sel_index[2];
-	EngineID sel_engine[2];
-	uint16 count[2];
-	bool wagon_btnstate; ///< true means engine is selected
-	EngineList list[2];
-	bool update_left;
-	bool update_right;
-	bool init_lists;
-	GroupID sel_group;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(replaceveh_d));
-
-struct depot_d {
-	VehicleID sel;
-	VehicleType type;
-	bool generate_list;
-	uint16 engine_list_length;
-	uint16 wagon_list_length;
-	uint16 engine_count;
-	uint16 wagon_count;
-	Vehicle **vehicle_list;
-	Vehicle **wagon_list;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(depot_d));
-
-struct order_d {
-	int sel;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(order_d));
-
-struct vehicledetails_d {
-	byte tab;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vehicledetails_d));
-
-struct smallmap_d {
-	int32 scroll_x;
-	int32 scroll_y;
-	int32 subscroll;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(smallmap_d));
-
-/* player face selection window */
-struct facesel_d {
-	PlayerFace face; // player face bits
-	bool advanced;   // advance player face selection window
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(facesel_d));
-
-struct refit_d {
-	int sel;
-	struct RefitOption *cargo;
-	struct RefitList *list;
-	uint length;
-	VehicleOrderID order;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(refit_d));
-
-struct vp_d {
-	VehicleID follow_vehicle;
-	int32 scrollpos_x;
-	int32 scrollpos_y;
-	int32 dest_scrollpos_x;
-	int32 dest_scrollpos_y;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vp_d));
-
-struct news_d {
-	uint16 follow_vehicle;
-	int32 scrollpos_x;
-	int32 scrollpos_y;
-	int32 dest_scrollpos_x;
-	int32 dest_scrollpos_y;
-	NewsItem *ni;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(news_d));
-
-struct highscore_d {
-	uint32 background_img;
-	int8 rank;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(highscore_d));
-
-struct scroller_d {
-	int height;
-	uint16 counter;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(scroller_d));
-
-enum SortListFlags {
-	VL_NONE    = 0x00,  ///< no sort
-	VL_DESC    = 0x01,  ///< sort descending or ascending
-	VL_RESORT  = 0x02,  ///< instruct the code to resort the list in the next loop
-	VL_REBUILD = 0x04,  ///< create sort-listing to use for qsort and friends
-	VL_END     = 0x08
-};
-
-DECLARE_ENUM_AS_BIT_SET(SortListFlags);
-
-struct Listing {
-	bool order;    ///< Ascending/descending
-	byte criteria; ///< Sorting criteria
-};
-
-struct list_d {
-	uint16 list_length;  ///< length of the list being sorted
-	byte sort_type;      ///< what criteria to sort on
-	SortListFlags flags; ///< used to control sorting/resorting/etc.
-	uint16 resort_timer; ///< resort list after a given amount of ticks if set
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(list_d));
-
-struct message_d {
-	int msg;
-	int wparam;
-	int lparam;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(message_d));
-
-struct dropdown_d {
-	uint32 disabled_state;
-	uint32 hidden_state;
-	WindowClass parent_wnd_class;
-	WindowNumber parent_wnd_num;
-	byte parent_button;
-	byte num_items;
-	byte selected_index;
-	const StringID *items;
-	byte click_delay;
-	bool drag_mode;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(dropdown_d));
-
-struct vehiclelist_d {
-	const Vehicle** sort_list;  // List of vehicles (sorted)
-	Listing *_sorting;          // pointer to the appropiate subcategory of _sorting
-	uint16 length_of_sort_list; // Keeps track of how many vehicle pointers sort list got space for
-	VehicleType vehicle_type;   // The vehicle type that is sorted
-	list_d l;                   // General list struct
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vehiclelist_d));
-
-struct grouplist_d {
-	const Group **sort_list;
-	list_d l;                   // General list struct
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(grouplist_d));
-
-struct groupveh_d : vehiclelist_d {
-	GroupID group_sel;
-	VehicleID vehicle_sel;
-
-	grouplist_d gl;
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(groupveh_d));
-
-/****************** THESE ARE NOT WIDGET TYPES!!!!! *******************/
-enum WindowWidgetBehaviours {
-	WWB_PUSHBUTTON  = 1 << 5,
-
-	WWB_MASK        = 0xE0,
-};
-
-
-enum WindowWidgetTypes {
-	WWT_EMPTY,
-
-	WWT_PANEL,      ///< simple depressed panel
-	WWT_INSET,      ///< pressed (inset) panel, most commonly used as combo box _text_ area
-	WWT_IMGBTN,     ///< button with image
-	WWT_IMGBTN_2,   ///< button with diff image when clicked
-
-	WWT_TEXTBTN,    ///< button with text
-	WWT_TEXTBTN_2,  ///< button with diff text when clicked
-	WWT_LABEL,      ///< centered label
-	WWT_TEXT,       ///< pure simple text
-	WWT_MATRIX,
-	WWT_SCROLLBAR,
-	WWT_FRAME,      ///< frame
-	WWT_CAPTION,
-
-	WWT_HSCROLLBAR,
-	WWT_STICKYBOX,
-	WWT_SCROLL2BAR, ///< 2nd vertical scrollbar
-	WWT_RESIZEBOX,
-	WWT_CLOSEBOX,
-	WWT_LAST,       ///< Last Item. use WIDGETS_END to fill up padding!!
-
-	WWT_MASK = 0x1F,
-
-	WWT_PUSHBTN     = WWT_PANEL   | WWB_PUSHBUTTON,
-	WWT_PUSHTXTBTN  = WWT_TEXTBTN | WWB_PUSHBUTTON,
-	WWT_PUSHIMGBTN  = WWT_IMGBTN  | WWB_PUSHBUTTON,
-};
-
-#define WIDGETS_END WWT_LAST,   RESIZE_NONE,     0,     0,     0,     0,     0, 0, STR_NULL
-
-enum WindowFlags {
-	WF_TIMEOUT_SHL       = 0,
-	WF_TIMEOUT_MASK      = 7,
-	WF_DRAGGING          = 1 <<  3,
-	WF_SCROLL_UP         = 1 <<  4,
-	WF_SCROLL_DOWN       = 1 <<  5,
-	WF_SCROLL_MIDDLE     = 1 <<  6,
-	WF_HSCROLL           = 1 <<  7,
-	WF_SIZING            = 1 <<  8,
-	WF_STICKY            = 1 <<  9,
-
-	WF_DISABLE_VP_SCROLL = 1 << 10,
-
-	WF_WHITE_BORDER_ONE  = 1 << 11,
-	WF_WHITE_BORDER_MASK = 1 << 12 | WF_WHITE_BORDER_ONE,
-	WF_SCROLL2           = 1 << 13,
-};
-
-/* window.cpp */
-void CallWindowEventNP(Window *w, int event);
-void CallWindowTickEvent();
-
-/**
- * Marks the window as dirty for repaint.
- *
- * @ingroup dirty
- */
-void SetWindowDirty(const Window *w);
-void SendWindowMessage(WindowClass wnd_class, WindowNumber wnd_num, int msg, int wparam, int lparam);
-void SendWindowMessageClass(WindowClass wnd_class, int msg, int wparam, int lparam);
-
-Window *FindWindowById(WindowClass cls, WindowNumber number);
-void DeleteWindow(Window *w);
-void DeletePlayerWindows(PlayerID pi);
-void ChangeWindowOwner(PlayerID old_player, PlayerID new_player);
-Window *BringWindowToFrontById(WindowClass cls, WindowNumber number);
-Window *FindWindowFromPt(int x, int y);
-
-bool IsWindowOfPrototype(const Window *w, const Widget *widget);
-void AssignWidgetToWindow(Window *w, const Widget *widget);
-Window *AllocateWindow(
-							int x,
-							int y,
-							int width,
-							int height,
-							WindowProc *proc,
-							WindowClass cls,
-							const Widget *widget,
-							void *data = NULL);
-
-Window *AllocateWindowDesc(const WindowDesc *desc, void *data = NULL);
-Window *AllocateWindowDescFront(const WindowDesc *desc, int window_number, void *data = NULL);
-
-void DrawWindowViewport(const Window *w);
-void ResizeWindow(Window *w, int x, int y);
-
-/**
- * Sets the enabled/disabled status of a widget.
- * By default, widgets are enabled.
- * On certain conditions, they have to be disabled.
- * @param w : Window on which the widget is located
- * @param widget_index : index of this widget in the window
- * @param disab_stat : status to use ie: disabled = true, enabled = false
- */
-static inline void SetWindowWidgetDisabledState(Window *w, byte widget_index, bool disab_stat)
-{
-	assert(widget_index < w->widget_count);
-	SB(w->widget[widget_index].display_flags, WIDG_DISABLED, 1, !!disab_stat);
-}
-
-/**
- * Sets a widget to disabled.
- * @param w : Window on which the widget is located
- * @param widget_index : index of this widget in the window
- */
-static inline void DisableWindowWidget(Window *w, byte widget_index)
-{
-	SetWindowWidgetDisabledState(w, widget_index, true);
-}
-
-/**
- * Sets a widget to Enabled.
- * @param w : Window on which the widget is located
- * @param widget_index : index of this widget in the window
- */
-static inline void EnableWindowWidget(Window *w, byte widget_index)
-{
-	SetWindowWidgetDisabledState(w, widget_index, false);
-}
-
-/**
- * Gets the enabled/disabled status of a widget.
- * @param w : Window on which the widget is located
- * @param widget_index : index of this widget in the window
- * @return status of the widget ie: disabled = true, enabled = false
- */
-static inline bool IsWindowWidgetDisabled(const Window *w, byte widget_index)
-{
-	assert(widget_index < w->widget_count);
-	return HasBit(w->widget[widget_index].display_flags, WIDG_DISABLED);
-}
-
-/**
- * Sets the hidden/shown status of a widget.
- * By default, widgets are visible.
- * On certain conditions, they have to be hidden.
- * @param w Window on which the widget is located
- * @param widget_index index of this widget in the window
- * @param hidden_stat status to use ie. hidden = true, visible = false
- */
-static inline void SetWindowWidgetHiddenState(Window *w, byte widget_index, bool hidden_stat)
-{
-	assert(widget_index < w->widget_count);
-	SB(w->widget[widget_index].display_flags, WIDG_HIDDEN, 1, !!hidden_stat);
-}
-
-/**
- * Sets a widget hidden.
- * @param w : Window on which the widget is located
- * @param widget_index : index of this widget in the window
- */
-static inline void HideWindowWidget(Window *w, byte widget_index)
-{
-	SetWindowWidgetHiddenState(w, widget_index, true);
-}
-
-/**
- * Sets a widget visible.
- * @param w : Window on which the widget is located
- * @param widget_index : index of this widget in the window
- */
-static inline void ShowWindowWidget(Window *w, byte widget_index)
-{
-	SetWindowWidgetHiddenState(w, widget_index, false);
-}
-
-/**
- * Gets the visibility of a widget.
- * @param w : Window on which the widget is located
- * @param widget_index : index of this widget in the window
- * @return status of the widget ie: hidden = true, visible = false
- */
-static inline bool IsWindowWidgetHidden(const Window *w, byte widget_index)
-{
-	assert(widget_index < w->widget_count);
-	return HasBit(w->widget[widget_index].display_flags, WIDG_HIDDEN);
-}
-
-/**
- * Sets the lowered/raised status of a widget.
- * @param w : Window on which the widget is located
- * @param widget_index : index of this widget in the window
- * @param lowered_stat : status to use ie: lowered = true, raised = false
- */
-static inline void SetWindowWidgetLoweredState(Window *w, byte widget_index, bool lowered_stat)
-{
-	assert(widget_index < w->widget_count);
-	SB(w->widget[widget_index].display_flags, WIDG_LOWERED, 1, !!lowered_stat);
-}
-
-/**
- * Invert the lowered/raised  status of a widget.
- * @param w : Window on which the widget is located
- * @param widget_index : index of this widget in the window
- */
-static inline void ToggleWidgetLoweredState(Window *w, byte widget_index)
-{
-	assert(widget_index < w->widget_count);
-	ToggleBit(w->widget[widget_index].display_flags, WIDG_LOWERED);
-}
-
-/**
- * Marks a widget as lowered.
- * @param w : Window on which the widget is located
- * @param widget_index : index of this widget in the window
- */
-static inline void LowerWindowWidget(Window *w, byte widget_index)
-{
-	SetWindowWidgetLoweredState(w, widget_index, true);
-}
-
-/**
- * Marks a widget as raised.
- * @param w : Window on which the widget is located
- * @param widget_index : index of this widget in the window
- */
-static inline void RaiseWindowWidget(Window *w, byte widget_index)
-{
-	SetWindowWidgetLoweredState(w, widget_index, false);
-}
-
-/**
- * Gets the lowered state of a widget.
- * @param w : Window on which the widget is located
- * @param widget_index : index of this widget in the window
- * @return status of the widget ie: lowered = true, raised= false
- */
-static inline bool IsWindowWidgetLowered(const Window *w, byte widget_index)
-{
-	assert(widget_index < w->widget_count);
-	return HasBit(w->widget[widget_index].display_flags, WIDG_LOWERED);
-}
-
-void InitWindowSystem();
-void UnInitWindowSystem();
-void ResetWindowSystem();
-int GetMenuItemIndex(const Window *w, int x, int y);
-void InputLoop();
-void InvalidateWidget(const Window *w, byte widget_index);
-void InvalidateThisWindowData(Window *w);
-void InvalidateWindowData(WindowClass cls, WindowNumber number);
-void RaiseWindowButtons(Window *w);
-void RelocateAllWindows(int neww, int newh);
-int PositionMainToolbar(Window *w);
-void CDECL SetWindowWidgetsDisabledState(Window *w, bool disab_stat, int widgets, ...);
-void CDECL SetWindowWidgetsHiddenState(Window *w, bool hidden_stat, int widgets, ...);
-void CDECL SetWindowWidgetsLoweredState(Window *w, bool lowered_stat, int widgets, ...);
-
-/* misc_gui.cpp */
-void GuiShowTooltipsWithArgs(StringID str, uint paramcount, const uint64 params[]);
-static inline void GuiShowTooltips(StringID str)
-{
-	GuiShowTooltipsWithArgs(str, 0, NULL);
-}
-
-/* widget.cpp */
-int GetWidgetFromPos(const Window *w, int x, int y);
-void DrawWindowWidgets(const Window *w);
-void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int button, uint32 disabled_mask, uint32 hidden_mask);
-
-void HandleButtonClick(Window *w, byte widget);
-
-Window *GetCallbackWnd();
-void DeleteNonVitalWindows();
-void DeleteAllNonVitalWindows();
-void HideVitalWindows();
-void ShowVitalWindows();
-Window **FindWindowZPosition(const Window *w);
-
-/* window.cpp */
-extern Window *_z_windows[];
-extern Window **_last_z_window;
-#define FOR_ALL_WINDOWS(wz) for (wz = _z_windows; wz != _last_z_window; wz++)
-
-VARDEF Point _cursorpos_drag_start;
-
-VARDEF int _scrollbar_start_pos;
-VARDEF int _scrollbar_size;
-VARDEF byte _scroller_click_timeout;
-
-VARDEF bool _scrolling_scrollbar;
-VARDEF bool _scrolling_viewport;
-VARDEF bool _popup_menu_active;
-
-VARDEF byte _special_mouse_mode;
-enum SpecialMouseMode {
-	WSM_NONE     = 0,
-	WSM_DRAGDROP = 1,
-	WSM_SIZING   = 2,
-	WSM_PRESIZE  = 3,
-};
-
-void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y);
-
-/** Evenly distribute some widgets when resizing horizontally (often a button row)
- *  The widgets are presumed to be in a line and numberef from left to right (without gaps)
- * @param w widow to modify
- * @param left The leftmost widget to resize
- * @param right The rightmost widget to resize. Since right side of it is used, remember to set it to RESIZE_RIGHT
- */
-void ResizeButtons(Window *w, byte left, byte right);
-
-
-/**
- * Sets the enabled/disabled status of a widget.
- * By default, widgets are enabled.
- * On certain conditions, they have to be disabled.
- * @param widget_index : index of this widget in the window
- * @param disab_stat : status to use ie: disabled = true, enabled = false
- */
-inline void Window::SetWidgetDisabledState(byte widget_index, bool disab_stat)
-{
-	assert(widget_index < this->widget_count);
-	SB(this->widget[widget_index].display_flags, WIDG_DISABLED, 1, !!disab_stat);
-}
-
-/**
- * Sets a widget to disabled.
- * @param widget_index : index of this widget in the window
- */
-inline void Window::DisableWidget(byte widget_index)
-{
-	SetWidgetDisabledState(widget_index, true);
-}
-
-/**
- * Sets a widget to Enabled.
- * @param widget_index : index of this widget in the window
- */
-inline void Window::EnableWidget(byte widget_index)
-{
-	SetWidgetDisabledState(widget_index, false);
-}
-
-/**
- * Gets the enabled/disabled status of a widget.
- * @param widget_index : index of this widget in the window
- * @return status of the widget ie: disabled = true, enabled = false
- */
-inline bool Window::IsWidgetDisabled(byte widget_index) const
-{
-	assert(widget_index < this->widget_count);
-	return HasBit(this->widget[widget_index].display_flags, WIDG_DISABLED);
-}
-
-/**
- * Sets the hidden/shown status of a widget.
- * By default, widgets are visible.
- * On certain conditions, they have to be hidden.
- * @param widget_index index of this widget in the window
- * @param hidden_stat status to use ie. hidden = true, visible = false
- */
-inline void Window::SetWidgetHiddenState(byte widget_index, bool hidden_stat)
-{
-	assert(widget_index < this->widget_count);
-	SB(this->widget[widget_index].display_flags, WIDG_HIDDEN, 1, !!hidden_stat);
-}
-
-/**
- * Sets a widget hidden.
- * @param widget_index : index of this widget in the window
- */
-inline void Window::HideWidget(byte widget_index)
-{
-	SetWidgetHiddenState(widget_index, true);
-}
-
-/**
- * Sets a widget visible.
- * @param widget_index : index of this widget in the window
- */
-inline void Window::ShowWidget(byte widget_index)
-{
-	SetWidgetHiddenState(widget_index, false);
-}
-
-/**
- * Gets the visibility of a widget.
- * @param widget_index : index of this widget in the window
- * @return status of the widget ie: hidden = true, visible = false
- */
-inline bool Window::IsWidgetHidden(byte widget_index) const
-{
-	assert(widget_index < this->widget_count);
-	return HasBit(this->widget[widget_index].display_flags, WIDG_HIDDEN);
-}
-
-/**
- * Sets the lowered/raised status of a widget.
- * @param widget_index : index of this widget in the window
- * @param lowered_stat : status to use ie: lowered = true, raised = false
- */
-inline void Window::SetWidgetLoweredState(byte widget_index, bool lowered_stat)
-{
-	assert(widget_index < this->widget_count);
-	SB(this->widget[widget_index].display_flags, WIDG_LOWERED, 1, !!lowered_stat);
-}
-
-/**
- * Invert the lowered/raised  status of a widget.
- * @param widget_index : index of this widget in the window
- */
-inline void Window::ToggleWidgetLoweredState(byte widget_index)
-{
-	assert(widget_index < this->widget_count);
-	ToggleBit(this->widget[widget_index].display_flags, WIDG_LOWERED);
-}
-
-/**
- * Marks a widget as lowered.
- * @param widget_index : index of this widget in the window
- */
-inline void Window::LowerWidget(byte widget_index)
-{
-	SetWidgetLoweredState(widget_index, true);
-}
-
-/**
- * Marks a widget as raised.
- * @param widget_index : index of this widget in the window
- */
-inline void Window::RaiseWidget(byte widget_index)
-{
-	SetWidgetLoweredState(widget_index, false);
-}
-
-/**
- * Gets the lowered state of a widget.
- * @param widget_index : index of this widget in the window
- * @return status of the widget ie: lowered = true, raised= false
- */
-inline bool Window::IsWidgetLowered(byte widget_index) const
-{
-	assert(widget_index < this->widget_count);
-	return HasBit(this->widget[widget_index].display_flags, WIDG_LOWERED);
-}
-
-#endif /* WINDOW_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/window_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,49 @@
+/* $Id$ */
+
+/** @file window_func.h Window functions not directly related to making/drawing windows. */
+
+#ifndef WINDOW_FUNC_H
+#define WINDOW_FUNC_H
+
+#include "window_type.h"
+#include "player_type.h"
+
+/**
+ * Marks the window as dirty for repaint.
+ *
+ * @ingroup dirty
+ */
+void SetWindowDirty(const Window *w);
+void SendWindowMessage(WindowClass wnd_class, WindowNumber wnd_num, int msg, int wparam, int lparam);
+void SendWindowMessageClass(WindowClass wnd_class, int msg, int wparam, int lparam);
+
+Window *FindWindowById(WindowClass cls, WindowNumber number);
+void DeleteWindow(Window *w);
+void ChangeWindowOwner(PlayerID old_player, PlayerID new_player);
+
+void ResizeWindow(Window *w, int x, int y);
+int PositionMainToolbar(Window *w);
+
+void InitWindowSystem();
+void UnInitWindowSystem();
+void ResetWindowSystem();
+void SetupColorsAndInitialWindow();
+void InputLoop();
+void InvalidateThisWindowData(Window *w);
+void InvalidateWindowData(WindowClass cls, WindowNumber number);
+void RelocateAllWindows(int neww, int newh);
+
+void DeleteNonVitalWindows();
+void DeleteAllNonVitalWindows();
+void HideVitalWindows();
+void ShowVitalWindows();
+Window **FindWindowZPosition(const Window *w);
+
+void InvalidateWindow(WindowClass cls, WindowNumber number);
+void InvalidateWindowWidget(WindowClass cls, WindowNumber number, byte widget_index);
+void InvalidateWindowClasses(WindowClass cls);
+void InvalidateWindowClassesData(WindowClass cls);
+void DeleteWindowById(WindowClass cls, WindowNumber number);
+void DeleteWindowByClass(WindowClass cls);
+
+#endif /* WINDOW_FUNC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/window_gui.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,768 @@
+/* $Id$ */
+
+/** @file window_gui.h Functions, definitions and such used only by the GUI. */
+
+#ifndef WINDOW_GUI_H
+#define WINDOW_GUI_H
+
+#include "core/bitmath_func.hpp"
+#include "vehicle_type.h"
+#include "viewport_type.h"
+#include "player_type.h"
+#include "strings_type.h"
+
+/**
+ * The maximum number of windows that can be opened.
+ */
+static const int MAX_NUMBER_OF_WINDOWS = 25;
+
+typedef void WindowProc(Window *w, WindowEvent *e);
+
+/* How the resize system works:
+    First, you need to add a WWT_RESIZEBOX to the widgets, and you need
+     to add the flag WDF_RESIZABLE to the window. Now the window is ready
+     to resize itself.
+    As you may have noticed, all widgets have a RESIZE_XXX in their line.
+     This lines controls how the widgets behave on resize. RESIZE_NONE means
+     it doesn't do anything. Any other option let's one of the borders
+     move with the changed width/height. So if a widget has
+     RESIZE_RIGHT, and the window is made 5 pixels wider by the user,
+     the right of the window will also be made 5 pixels wider.
+    Now, what if you want to clamp a widget to the bottom? Give it the flag
+     RESIZE_TB. This is RESIZE_TOP + RESIZE_BOTTOM. Now if the window gets
+     5 pixels bigger, both the top and bottom gets 5 bigger, so the whole
+     widgets moves downwards without resizing, and appears to be clamped
+     to the bottom. Nice aint it?
+   You should know one more thing about this system. Most windows can't
+    handle an increase of 1 pixel. So there is a step function, which
+    let the windowsize only be changed by X pixels. You configure this
+    after making the window, like this:
+      w->resize.step_height = 10;
+    Now the window will only change in height in steps of 10.
+   You can also give a minimum width and height. The default value is
+    the default height/width of the window itself. You can change this
+    AFTER window-creation, with:
+     w->resize.width or w->resize.height.
+   That was all.. good luck, and enjoy :) -- TrueLight */
+
+enum ResizeFlag {
+	RESIZE_NONE   = 0,  ///< no resize required
+
+	RESIZE_LEFT   = 1,  ///< left resize flag
+	RESIZE_RIGHT  = 2,  ///< rigth resize flag
+	RESIZE_TOP    = 4,  ///< top resize flag
+	RESIZE_BOTTOM = 8,  ///< bottom resize flag
+
+	RESIZE_LR     = RESIZE_LEFT  | RESIZE_RIGHT,   ///<  combination of left and right resize flags
+	RESIZE_RB     = RESIZE_RIGHT | RESIZE_BOTTOM,  ///<  combination of right and bottom resize flags
+	RESIZE_TB     = RESIZE_TOP   | RESIZE_BOTTOM,  ///<  combination of top and bottom resize flags
+	RESIZE_LRB    = RESIZE_LEFT  | RESIZE_RIGHT  | RESIZE_BOTTOM, ///< combination of left, right and bottom resize flags
+	RESIZE_LRTB   = RESIZE_LEFT  | RESIZE_RIGHT  | RESIZE_TOP | RESIZE_BOTTOM,  ///<  combination of all resize flags
+	RESIZE_RTB    = RESIZE_RIGHT | RESIZE_TOP    | RESIZE_BOTTOM, ///<  combination of right, top and bottom resize flag
+
+	/* The following flags are used by the system to specify what is disabled, hidden, or clicked
+	 * They are used in the same place as the above RESIZE_x flags, Widget visual_flags.
+	 * These states are used in exceptions. If nothing is specified, they will indicate
+	 * Enabled, visible or unclicked widgets*/
+	WIDG_DISABLED = 4,  ///< widget is greyed out, not available
+	WIDG_HIDDEN   = 5,  ///< widget is made invisible
+	WIDG_LOWERED  = 6,  ///< widget is paint lowered, a pressed button in fact
+};
+
+enum {
+	WIDGET_LIST_END = -1, ///< indicate the end of widgets' list for vararg functions
+};
+
+struct Widget {
+	byte type;                        ///< Widget type, see WindowWidgetTypes
+	byte display_flags;               ///< Resize direction, alignment, etc. during resizing, see ResizeFlags
+	byte color;                       ///< Widget colour, see docs/ottd-colourtext-palette.png
+	int16 left, right, top, bottom;   ///< The position offsets inside the window
+	uint16 data;                      ///< The String/Image or special code (list-matrixes) of a widget
+	StringID tooltips;                ///< Tooltips that are shown when rightclicking on a widget
+};
+
+enum FrameFlags {
+	FR_NONE         =  0,
+	FR_TRANSPARENT  =  1 << 0,  ///< Makes the background transparent if set
+	FR_BORDERONLY   =  1 << 4,  ///< Draw border only, no background
+	FR_LOWERED      =  1 << 5,  ///< If set the frame is lowered and the background color brighter (ie. buttons when pressed)
+	FR_DARKENED     =  1 << 6,  ///< If set the background is darker, allows for lowered frames with normal background color when used with FR_LOWERED (ie. dropdown boxes)
+};
+
+DECLARE_ENUM_AS_BIT_SET(FrameFlags);
+
+void DrawFrameRect(int left, int top, int right, int bottom, int color, FrameFlags flags);
+
+enum WindowEventCodes {
+	WE_CREATE,
+	WE_DESTROY,
+	WE_PAINT,
+	WE_KEYPRESS,
+	WE_CLICK,
+	WE_DOUBLE_CLICK,
+	WE_RCLICK,
+	WE_MOUSEOVER,
+	WE_MOUSELOOP,
+	WE_MOUSEWHEEL,
+	WE_TICK,
+	WE_4,
+	WE_TIMEOUT,
+	WE_PLACE_OBJ,
+	WE_ABORT_PLACE_OBJ,
+	WE_ON_EDIT_TEXT,
+	WE_ON_EDIT_TEXT_CANCEL,
+	WE_POPUPMENU_SELECT,
+	WE_POPUPMENU_OVER,
+	WE_DRAGDROP,
+	WE_PLACE_DRAG,
+	WE_PLACE_MOUSEUP,
+	WE_PLACE_PRESIZE,
+	WE_DROPDOWN_SELECT,
+	WE_RESIZE,
+	WE_MESSAGE,
+	WE_SCROLL,
+	WE_INVALIDATE_DATA,
+};
+
+struct WindowEvent {
+	byte event;
+	union {
+		struct {
+			void *data;
+		} create;
+
+		struct {
+			Point pt;
+			int widget;
+		} click;
+
+		struct {
+			Point pt;
+			TileIndex tile;
+			TileIndex starttile;
+			ViewportPlaceMethod select_method;
+			byte select_proc;
+		} place;
+
+		struct {
+			Point pt;
+			int widget;
+		} dragdrop;
+
+		struct {
+			Point size;
+			Point diff;
+		} sizing;
+
+		struct {
+			char *str;
+		} edittext;
+
+		struct {
+			Point pt;
+		} popupmenu;
+
+		struct {
+			int button;
+			int index;
+		} dropdown;
+
+		struct {
+			Point pt;
+			int widget;
+		} mouseover;
+
+		struct {
+			bool cont;      ///< continue the search? (default true)
+			uint16 key;     ///< 16-bit Unicode value of the key
+			uint16 keycode; ///< untranslated key (including shift-state)
+		} keypress;
+
+		struct {
+			int msg;      ///< message to be sent
+			int wparam;   ///< additional message-specific information
+			int lparam;   ///< additional message-specific information
+		} message;
+
+		struct {
+			Point delta;   ///< delta position against position of last call
+		} scroll;
+
+		struct {
+			int wheel;     ///< how much was 'wheel'd'
+		} wheel;
+	} we;
+};
+
+struct WindowDesc {
+	int16 left, top, minimum_width, minimum_height, default_width, default_height;
+	WindowClass cls;
+	WindowClass parent_cls;
+	uint32 flags;
+	const Widget *widgets;
+	WindowProc *proc;
+};
+
+enum WindowDefaultFlag {
+	WDF_STD_TOOLTIPS    =   1 << 0, ///< use standard routine when displaying tooltips
+	WDF_DEF_WIDGET      =   1 << 1, ///< default widget control for some widgets in the on click event
+	WDF_STD_BTN         =   1 << 2, ///< default handling for close and drag widgets (widget no 0 and 1)
+
+	WDF_UNCLICK_BUTTONS =   1 << 4, ///< Unclick buttons when the window event times out */
+	WDF_STICKY_BUTTON   =   1 << 5, ///< Set window to sticky mode; they are not closed unless closed with 'X' (widget 2)
+	WDF_RESIZABLE       =   1 << 6, ///< A window can be resized
+	WDF_MODAL           =   1 << 7, ///< The window is a modal child of some other window, meaning the parent is 'inactive'
+};
+
+/* can be used as x or y coordinates to cause a specific placement */
+enum WindowDefaultPosition {
+	WDP_AUTO      = -1, ///< Find a place automatically
+	WDP_CENTER    = -2, ///< Center the window (left/right or top/bottom)
+	WDP_ALIGN_TBR = -3, ///< Align the right side of the window with the right side of the main toolbar
+	WDP_ALIGN_TBL = -4, ///< Align the left side of the window with the left side of the main toolbar
+};
+
+#define WP(ptr, str) (*(str*)(ptr)->custom)
+
+struct Scrollbar {
+	uint16 count, cap, pos;
+};
+
+struct ResizeInfo {
+	uint width; ///< Minimum width and height
+	uint height;
+	uint step_width; ///< In how big steps the width and height go
+	uint step_height;
+};
+
+struct WindowMessage {
+	int msg;
+	int wparam;
+	int lparam;
+};
+
+struct Window {
+	uint16 flags4;
+	WindowClass window_class;
+	WindowNumber window_number;
+
+	int left, top;
+	int width, height;
+
+	Scrollbar hscroll, vscroll, vscroll2;
+	ResizeInfo resize;
+
+	byte caption_color;
+
+	WindowProc *wndproc;
+	ViewPort *viewport;
+	const Widget *original_widget;
+	Widget *widget;
+	uint widget_count;
+	uint32 desc_flags;
+
+	WindowMessage message;
+	Window *parent;
+	byte custom[WINDOW_CUSTOM_SIZE];
+
+	void HandleButtonClick(byte widget);
+
+	void SetWidgetDisabledState(byte widget_index, bool disab_stat);
+	void DisableWidget(byte widget_index);
+	void EnableWidget(byte widget_index);
+	bool IsWidgetDisabled(byte widget_index) const;
+	void SetWidgetHiddenState(byte widget_index, bool hidden_stat);
+	void HideWidget(byte widget_index);
+	void ShowWidget(byte widget_index);
+	bool IsWidgetHidden(byte widget_index) const;
+	void SetWidgetLoweredState(byte widget_index, bool lowered_stat);
+	void ToggleWidgetLoweredState(byte widget_index);
+	void LowerWidget(byte widget_index);
+	void RaiseWidget(byte widget_index);
+	bool IsWidgetLowered(byte widget_index) const;
+
+	void RaiseButtons();
+	void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets, ...);
+	void CDECL SetWidgetsHiddenState(bool hidden_stat, int widgets, ...);
+	void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets, ...);
+	void InvalidateWidget(byte widget_index) const;
+};
+
+struct menu_d {
+	byte item_count;      ///< follow_vehicle
+	byte sel_index;       ///< scrollpos_x
+	byte main_button;     ///< scrollpos_y
+	byte action_id;
+	StringID string_id;   ///< unk30
+	uint16 checked_items; ///< unk32
+	byte disabled_items;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(menu_d));
+
+struct def_d {
+	int16 data_1, data_2, data_3;
+	int16 data_4, data_5;
+	bool close;
+	byte byte_1;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(def_d));
+
+struct void_d {
+	void *data;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(void_d));
+
+struct tree_d {
+	uint16 base;
+	uint16 count;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(tree_d));
+
+struct tooltips_d {
+	StringID string_id;
+	byte paramcount;
+	uint64 params[5];
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(tooltips_d));
+
+struct replaceveh_d {
+	byte sel_index[2];
+	EngineID sel_engine[2];
+	uint16 count[2];
+	bool wagon_btnstate; ///< true means engine is selected
+	EngineList list[2];
+	bool update_left;
+	bool update_right;
+	bool init_lists;
+	GroupID sel_group;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(replaceveh_d));
+
+struct depot_d {
+	VehicleID sel;
+	VehicleType type;
+	bool generate_list;
+	uint16 engine_list_length;
+	uint16 wagon_list_length;
+	uint16 engine_count;
+	uint16 wagon_count;
+	Vehicle **vehicle_list;
+	Vehicle **wagon_list;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(depot_d));
+
+struct order_d {
+	int sel;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(order_d));
+
+struct vehicledetails_d {
+	byte tab;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vehicledetails_d));
+
+struct smallmap_d {
+	int32 scroll_x;
+	int32 scroll_y;
+	int32 subscroll;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(smallmap_d));
+
+struct refit_d {
+	int sel;
+	struct RefitOption *cargo;
+	struct RefitList *list;
+	uint length;
+	VehicleOrderID order;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(refit_d));
+
+struct vp_d {
+	VehicleID follow_vehicle;
+	int32 scrollpos_x;
+	int32 scrollpos_y;
+	int32 dest_scrollpos_x;
+	int32 dest_scrollpos_y;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vp_d));
+
+struct news_d {
+	uint16 follow_vehicle;
+	int32 scrollpos_x;
+	int32 scrollpos_y;
+	int32 dest_scrollpos_x;
+	int32 dest_scrollpos_y;
+	NewsItem *ni;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(news_d));
+
+struct highscore_d {
+	uint32 background_img;
+	int8 rank;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(highscore_d));
+
+struct scroller_d {
+	int height;
+	uint16 counter;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(scroller_d));
+
+enum SortListFlags {
+	VL_NONE    = 0,      ///< no sort
+	VL_DESC    = 1 << 0, ///< sort descending or ascending
+	VL_RESORT  = 1 << 1, ///< instruct the code to resort the list in the next loop
+	VL_REBUILD = 1 << 2, ///< create sort-listing to use for qsort and friends
+	VL_END     = 1 << 3,
+};
+
+DECLARE_ENUM_AS_BIT_SET(SortListFlags);
+
+struct Listing {
+	bool order;    ///< Ascending/descending
+	byte criteria; ///< Sorting criteria
+};
+
+struct list_d {
+	uint16 list_length;  ///< length of the list being sorted
+	byte sort_type;      ///< what criteria to sort on
+	SortListFlags flags; ///< used to control sorting/resorting/etc.
+	uint16 resort_timer; ///< resort list after a given amount of ticks if set
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(list_d));
+
+struct message_d {
+	int msg;
+	int wparam;
+	int lparam;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(message_d));
+
+struct vehiclelist_d {
+	const Vehicle** sort_list;  // List of vehicles (sorted)
+	Listing *_sorting;          // pointer to the appropiate subcategory of _sorting
+	uint16 length_of_sort_list; // Keeps track of how many vehicle pointers sort list got space for
+	VehicleType vehicle_type;   // The vehicle type that is sorted
+	list_d l;                   // General list struct
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vehiclelist_d));
+
+struct grouplist_d {
+	const Group **sort_list;
+	list_d l;                   // General list struct
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(grouplist_d));
+
+struct groupveh_d : vehiclelist_d {
+	GroupID group_sel;
+	VehicleID vehicle_sel;
+
+	grouplist_d gl;
+};
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(groupveh_d));
+
+/****************** THESE ARE NOT WIDGET TYPES!!!!! *******************/
+enum WindowWidgetBehaviours {
+	WWB_PUSHBUTTON  = 1 << 5,
+
+	WWB_MASK        = 0xE0,
+};
+
+
+enum WindowWidgetTypes {
+	WWT_EMPTY,
+
+	WWT_PANEL,      ///< simple depressed panel
+	WWT_INSET,      ///< pressed (inset) panel, most commonly used as combo box _text_ area
+	WWT_IMGBTN,     ///< button with image
+	WWT_IMGBTN_2,   ///< button with diff image when clicked
+
+	WWT_TEXTBTN,    ///< button with text
+	WWT_TEXTBTN_2,  ///< button with diff text when clicked
+	WWT_LABEL,      ///< centered label
+	WWT_TEXT,       ///< pure simple text
+	WWT_MATRIX,
+	WWT_SCROLLBAR,
+	WWT_FRAME,      ///< frame
+	WWT_CAPTION,
+
+	WWT_HSCROLLBAR,
+	WWT_STICKYBOX,
+	WWT_SCROLL2BAR, ///< 2nd vertical scrollbar
+	WWT_RESIZEBOX,
+	WWT_CLOSEBOX,
+	WWT_DROPDOWN,   ///< Raised drop down list (regular)
+	WWT_DROPDOWNIN, ///< Inset drop down list (used on game options only)
+	WWT_LAST,       ///< Last Item. use WIDGETS_END to fill up padding!!
+
+	WWT_MASK = 0x1F,
+
+	WWT_PUSHBTN     = WWT_PANEL   | WWB_PUSHBUTTON,
+	WWT_PUSHTXTBTN  = WWT_TEXTBTN | WWB_PUSHBUTTON,
+	WWT_PUSHIMGBTN  = WWT_IMGBTN  | WWB_PUSHBUTTON,
+};
+
+#define WIDGETS_END WWT_LAST,   RESIZE_NONE,     0,     0,     0,     0,     0, 0, STR_NULL
+
+enum WindowFlags {
+	WF_TIMEOUT_SHL       = 0,
+	WF_TIMEOUT_MASK      = 7,
+	WF_DRAGGING          = 1 <<  3,
+	WF_SCROLL_UP         = 1 <<  4,
+	WF_SCROLL_DOWN       = 1 <<  5,
+	WF_SCROLL_MIDDLE     = 1 <<  6,
+	WF_HSCROLL           = 1 <<  7,
+	WF_SIZING            = 1 <<  8,
+	WF_STICKY            = 1 <<  9,
+
+	WF_DISABLE_VP_SCROLL = 1 << 10,
+
+	WF_WHITE_BORDER_ONE  = 1 << 11,
+	WF_WHITE_BORDER_MASK = 1 << 12 | WF_WHITE_BORDER_ONE,
+	WF_SCROLL2           = 1 << 13,
+};
+
+/* window.cpp */
+void CallWindowEventNP(Window *w, int event);
+void CallWindowTickEvent();
+
+/**
+ * Marks the window as dirty for repaint.
+ *
+ * @ingroup dirty
+ */
+void SetWindowDirty(const Window *w);
+void SendWindowMessage(WindowClass wnd_class, WindowNumber wnd_num, int msg, int wparam, int lparam);
+void SendWindowMessageClass(WindowClass wnd_class, int msg, int wparam, int lparam);
+
+Window *FindWindowById(WindowClass cls, WindowNumber number);
+void DeleteWindow(Window *w);
+void DeletePlayerWindows(PlayerID pi);
+void ChangeWindowOwner(PlayerID old_player, PlayerID new_player);
+Window *BringWindowToFrontById(WindowClass cls, WindowNumber number);
+Window *FindWindowFromPt(int x, int y);
+
+bool IsWindowOfPrototype(const Window *w, const Widget *widget);
+void AssignWidgetToWindow(Window *w, const Widget *widget);
+Window *AllocateWindow(
+							int x,
+							int y,
+							int width,
+							int height,
+							WindowProc *proc,
+							WindowClass cls,
+							const Widget *widget,
+							void *data = NULL);
+
+Window *AllocateWindowDesc(const WindowDesc *desc, void *data = NULL);
+Window *AllocateWindowDescFront(const WindowDesc *desc, int window_number, void *data = NULL);
+
+void DrawWindowViewport(const Window *w);
+void ResizeWindow(Window *w, int x, int y);
+
+void InitWindowSystem();
+void UnInitWindowSystem();
+void ResetWindowSystem();
+int GetMenuItemIndex(const Window *w, int x, int y);
+void InputLoop();
+void InvalidateThisWindowData(Window *w);
+void InvalidateWindowData(WindowClass cls, WindowNumber number);
+void RelocateAllWindows(int neww, int newh);
+
+/* misc_gui.cpp */
+void GuiShowTooltipsWithArgs(StringID str, uint paramcount, const uint64 params[]);
+static inline void GuiShowTooltips(StringID str)
+{
+	GuiShowTooltipsWithArgs(str, 0, NULL);
+}
+
+/* widget.cpp */
+int GetWidgetFromPos(const Window *w, int x, int y);
+void DrawWindowWidgets(const Window *w);
+
+enum SortButtonState {
+	SBS_OFF,
+	SBS_DOWN,
+	SBS_UP,
+};
+
+void DrawSortButtonState(const Window *w, int widget, SortButtonState state);
+
+
+Window *GetCallbackWnd();
+void DeleteNonVitalWindows();
+void DeleteAllNonVitalWindows();
+void HideVitalWindows();
+void ShowVitalWindows();
+Window **FindWindowZPosition(const Window *w);
+
+/* window.cpp */
+extern Window *_z_windows[];
+extern Window **_last_z_window;
+#define FOR_ALL_WINDOWS(wz) for (wz = _z_windows; wz != _last_z_window; wz++)
+
+extern Point _cursorpos_drag_start;
+
+extern int _scrollbar_start_pos;
+extern int _scrollbar_size;
+extern byte _scroller_click_timeout;
+
+extern bool _scrolling_scrollbar;
+extern bool _scrolling_viewport;
+extern bool _popup_menu_active;
+
+extern byte _special_mouse_mode;
+enum SpecialMouseMode {
+	WSM_NONE     = 0,
+	WSM_DRAGDROP = 1,
+	WSM_SIZING   = 2,
+	WSM_PRESIZE  = 3,
+};
+
+void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y);
+
+/** Evenly distribute some widgets when resizing horizontally (often a button row)
+ *  The widgets are presumed to be in a line and numberef from left to right (without gaps)
+ * @param w widow to modify
+ * @param left The leftmost widget to resize
+ * @param right The rightmost widget to resize. Since right side of it is used, remember to set it to RESIZE_RIGHT
+ */
+void ResizeButtons(Window *w, byte left, byte right);
+
+
+/**
+ * Sets the enabled/disabled status of a widget.
+ * By default, widgets are enabled.
+ * On certain conditions, they have to be disabled.
+ * @param widget_index : index of this widget in the window
+ * @param disab_stat : status to use ie: disabled = true, enabled = false
+ */
+inline void Window::SetWidgetDisabledState(byte widget_index, bool disab_stat)
+{
+	assert(widget_index < this->widget_count);
+	SB(this->widget[widget_index].display_flags, WIDG_DISABLED, 1, !!disab_stat);
+}
+
+/**
+ * Sets a widget to disabled.
+ * @param widget_index : index of this widget in the window
+ */
+inline void Window::DisableWidget(byte widget_index)
+{
+	SetWidgetDisabledState(widget_index, true);
+}
+
+/**
+ * Sets a widget to Enabled.
+ * @param widget_index : index of this widget in the window
+ */
+inline void Window::EnableWidget(byte widget_index)
+{
+	SetWidgetDisabledState(widget_index, false);
+}
+
+/**
+ * Gets the enabled/disabled status of a widget.
+ * @param widget_index : index of this widget in the window
+ * @return status of the widget ie: disabled = true, enabled = false
+ */
+inline bool Window::IsWidgetDisabled(byte widget_index) const
+{
+	assert(widget_index < this->widget_count);
+	return HasBit(this->widget[widget_index].display_flags, WIDG_DISABLED);
+}
+
+/**
+ * Sets the hidden/shown status of a widget.
+ * By default, widgets are visible.
+ * On certain conditions, they have to be hidden.
+ * @param widget_index index of this widget in the window
+ * @param hidden_stat status to use ie. hidden = true, visible = false
+ */
+inline void Window::SetWidgetHiddenState(byte widget_index, bool hidden_stat)
+{
+	assert(widget_index < this->widget_count);
+	SB(this->widget[widget_index].display_flags, WIDG_HIDDEN, 1, !!hidden_stat);
+}
+
+/**
+ * Sets a widget hidden.
+ * @param widget_index : index of this widget in the window
+ */
+inline void Window::HideWidget(byte widget_index)
+{
+	SetWidgetHiddenState(widget_index, true);
+}
+
+/**
+ * Sets a widget visible.
+ * @param widget_index : index of this widget in the window
+ */
+inline void Window::ShowWidget(byte widget_index)
+{
+	SetWidgetHiddenState(widget_index, false);
+}
+
+/**
+ * Gets the visibility of a widget.
+ * @param widget_index : index of this widget in the window
+ * @return status of the widget ie: hidden = true, visible = false
+ */
+inline bool Window::IsWidgetHidden(byte widget_index) const
+{
+	assert(widget_index < this->widget_count);
+	return HasBit(this->widget[widget_index].display_flags, WIDG_HIDDEN);
+}
+
+/**
+ * Sets the lowered/raised status of a widget.
+ * @param widget_index : index of this widget in the window
+ * @param lowered_stat : status to use ie: lowered = true, raised = false
+ */
+inline void Window::SetWidgetLoweredState(byte widget_index, bool lowered_stat)
+{
+	assert(widget_index < this->widget_count);
+	SB(this->widget[widget_index].display_flags, WIDG_LOWERED, 1, !!lowered_stat);
+}
+
+/**
+ * Invert the lowered/raised  status of a widget.
+ * @param widget_index : index of this widget in the window
+ */
+inline void Window::ToggleWidgetLoweredState(byte widget_index)
+{
+	assert(widget_index < this->widget_count);
+	ToggleBit(this->widget[widget_index].display_flags, WIDG_LOWERED);
+}
+
+/**
+ * Marks a widget as lowered.
+ * @param widget_index : index of this widget in the window
+ */
+inline void Window::LowerWidget(byte widget_index)
+{
+	SetWidgetLoweredState(widget_index, true);
+}
+
+/**
+ * Marks a widget as raised.
+ * @param widget_index : index of this widget in the window
+ */
+inline void Window::RaiseWidget(byte widget_index)
+{
+	SetWidgetLoweredState(widget_index, false);
+}
+
+/**
+ * Gets the lowered state of a widget.
+ * @param widget_index : index of this widget in the window
+ * @return status of the widget ie: lowered = true, raised= false
+ */
+inline bool Window::IsWidgetLowered(byte widget_index) const
+{
+	assert(widget_index < this->widget_count);
+	return HasBit(this->widget[widget_index].display_flags, WIDG_LOWERED);
+}
+
+#endif /* WINDOW_GUI_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/window_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,106 @@
+/* $Id$ */
+
+/** @file window_type.h Types related to windows */
+
+#ifndef WINDOW_TYPE_H
+#define WINDOW_TYPE_H
+
+#include "core/enum_type.hpp"
+
+enum WindowClass {
+	WC_NONE,
+	WC_MAIN_WINDOW = WC_NONE,
+	WC_MAIN_TOOLBAR,
+	WC_STATUS_BAR,
+	WC_BUILD_TOOLBAR,
+	WC_NEWS_WINDOW,
+	WC_TOWN_DIRECTORY,
+	WC_STATION_LIST,
+	WC_TOWN_VIEW,
+	WC_SMALLMAP,
+	WC_TRAINS_LIST,
+	WC_ROADVEH_LIST,
+	WC_SHIPS_LIST,
+	WC_AIRCRAFT_LIST,
+	WC_VEHICLE_VIEW,
+	WC_VEHICLE_DETAILS,
+	WC_VEHICLE_REFIT,
+	WC_VEHICLE_ORDERS,
+	WC_STATION_VIEW,
+	WC_VEHICLE_DEPOT,
+	WC_BUILD_VEHICLE,
+	WC_BUILD_BRIDGE,
+	WC_ERRMSG,
+	WC_BUILD_STATION,
+	WC_BUS_STATION,
+	WC_TRUCK_STATION,
+	WC_BUILD_DEPOT,
+	WC_COMPANY,
+	WC_FINANCES,
+	WC_PLAYER_COLOR,
+	WC_QUERY_STRING,
+	WC_SAVELOAD,
+	WC_SELECT_GAME,
+	WC_TOOLBAR_MENU,
+	WC_INCOME_GRAPH,
+	WC_OPERATING_PROFIT,
+	WC_TOOLTIPS,
+	WC_INDUSTRY_VIEW,
+	WC_PLAYER_FACE,
+	WC_LAND_INFO,
+	WC_TOWN_AUTHORITY,
+	WC_SUBSIDIES_LIST,
+	WC_GRAPH_LEGEND,
+	WC_DELIVERED_CARGO,
+	WC_PERFORMANCE_HISTORY,
+	WC_COMPANY_VALUE,
+	WC_COMPANY_LEAGUE,
+	WC_BUY_COMPANY,
+	WC_PAYMENT_RATES,
+	WC_ENGINE_PREVIEW,
+	WC_MUSIC_WINDOW,
+	WC_MUSIC_TRACK_SELECTION,
+	WC_SCEN_LAND_GEN,
+	WC_SCEN_TOWN_GEN,
+	WC_SCEN_INDUSTRY,
+	WC_SCEN_BUILD_ROAD,
+	WC_BUILD_TREES,
+	WC_SEND_NETWORK_MSG,
+	WC_DROPDOWN_MENU,
+	WC_BUILD_INDUSTRY,
+	WC_GAME_OPTIONS,
+	WC_NETWORK_WINDOW,
+	WC_INDUSTRY_DIRECTORY,
+	WC_MESSAGE_HISTORY,
+	WC_CHEATS,
+	WC_PERFORMANCE_DETAIL,
+	WC_CONSOLE,
+	WC_EXTRA_VIEW_PORT,
+	WC_CLIENT_LIST,
+	WC_NETWORK_STATUS_WINDOW,
+	WC_CUSTOM_CURRENCY,
+	WC_REPLACE_VEHICLE,
+	WC_HIGHSCORE,
+	WC_ENDSCREEN,
+	WC_SIGN_LIST,
+	WC_GENERATE_LANDSCAPE,
+	WC_GENERATE_PROGRESS_WINDOW,
+	WC_CONFIRM_POPUP_QUERY,
+	WC_TRANSPARENCY_TOOLBAR,
+	WC_VEHICLE_TIMETABLE,
+	WC_BUILD_SIGNAL,
+	WC_COMPANY_PASSWORD_WINDOW,
+};
+
+struct Window;
+struct WindowEvent;
+typedef int32 WindowNumber;
+
+/**
+ * You cannot 100% reliably calculate the biggest custom struct as
+ * the number of pointers in it and alignment will have a huge impact.
+ * 96 is the largest window-size for 64-bit machines currently.
+ */
+#define WINDOW_CUSTOM_SIZE 96
+
+#endif /* WINDOW_TYPE_H */
--- a/src/yapf/follow_track.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/yapf/follow_track.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -78,7 +78,7 @@
 
 		// extra handling for tunnels in our direction
 		if (IsTunnelTile(m_old_tile)) {
-			DiagDirection tunnel_enterdir = GetTunnelDirection(m_old_tile);
+			DiagDirection tunnel_enterdir = GetTunnelBridgeDirection(m_old_tile);
 			if (tunnel_enterdir == m_exitdir) {
 				// we are entering the tunnel
 				FindLengthOfTunnelResult flotr = FindLengthOfTunnel(m_old_tile, m_exitdir);
@@ -92,7 +92,7 @@
 
 		// extra handling for bridge ramp in our direction
 		if (IsBridgeTile(m_old_tile)) {
-			DiagDirection bridge_enterdir = GetBridgeRampDirection(m_old_tile);
+			DiagDirection bridge_enterdir = GetTunnelBridgeDirection(m_old_tile);
 			if (bridge_enterdir == m_exitdir) {
 				// we are entering the bridge ramp
 				m_new_tile = GetOtherBridgeEnd(m_old_tile);
@@ -208,7 +208,7 @@
 		if (!IsWaterTT() && IsTileType(m_new_tile, MP_TUNNELBRIDGE)) {
 			if (IsTunnel(m_new_tile)) {
 				if (!m_is_tunnel) {
-					DiagDirection tunnel_enterdir = GetTunnelDirection(m_new_tile);
+					DiagDirection tunnel_enterdir = GetTunnelBridgeDirection(m_new_tile);
 					if (tunnel_enterdir != m_exitdir) {
 						m_err = EC_NO_WAY;
 						return false;
@@ -216,7 +216,7 @@
 				}
 			} else if (IsBridge(m_new_tile)) {
 				if (!m_is_bridge) {
-					DiagDirection ramp_enderdir = GetBridgeRampDirection(m_new_tile);
+					DiagDirection ramp_enderdir = GetTunnelBridgeDirection(m_new_tile);
 					if (ramp_enderdir != m_exitdir) {
 						m_err = EC_NO_WAY;
 						return false;
--- a/src/yapf/track_dir.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/yapf/track_dir.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -3,9 +3,6 @@
 #ifndef  TRACK_DIR_HPP
 #define  TRACK_DIR_HPP
 
-#include "../tile.h"
 #include "../openttd.h"
-#include "../map.h"
-#include "../rail.h"
 
 #endif /* TRACK_DIR_HPP */
--- a/src/yapf/yapf.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/yapf/yapf.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -7,23 +7,23 @@
 
 #include "track_dir.hpp"
 
-#include "../vehicle.h"
+#include "../vehicle_base.h"
 #include "../depot.h"
 #include "../road_map.h"
 #include "../tunnel_map.h"
 #include "../bridge_map.h"
+#include "../tunnelbridge_map.h"
 #include "../bridge.h"
 #include "../station.h"
 #include "../station_map.h"
-#include "../date.h"
-#include "../functions.h"
+#include "../tile_cmd.h"
 #include "../landscape.h"
 #include "yapf.h"
 #include "../pathfind.h"
 #include "../waypoint.h"
 #include "../debug.h"
+#include "../settings_type.h"
 
-extern Patches _patches_newgame;
 extern uint64 _rdtsc();
 
 #include <limits.h>
--- a/src/yapf/yapf_costbase.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/yapf/yapf_costbase.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -11,13 +11,11 @@
 		if (IsDiagonalTrackdir(td)) {
 			if (IsBridgeTile(tile)) {
 				// it is bridge ramp, check if we are entering the bridge
-				if (GetBridgeRampDirection(tile) != TrackdirToExitdir(td)) return false; // no, we are living it, no penalty
+				if (GetTunnelBridgeDirection(tile) != TrackdirToExitdir(td)) return false; // no, we are living it, no penalty
 				// we are entering the bridge
-				// if the tile slope is downwards, then bridge ramp has not upward slope
-				uint tile_slope = GetTileSlope(tile, NULL) & 0x0F;
-				if ((c_upwards_slopes[tile_slope] & TrackdirToTrackdirBits(ReverseTrackdir(td))) != 0) return false; // tile under ramp goes down, no penalty
-				// tile under ramp isn't going down, so ramp must go up
-				return true;
+				Slope tile_slope = GetTileSlope(tile, NULL);
+				Axis axis = DiagDirToAxis(GetTunnelBridgeDirection(tile));
+				return !HasBridgeFlatRamp(tile_slope, axis);
 			} else {
 				// not bridge ramp
 				if (IsTunnelTile(tile)) return false; // tunnel entry/exit doesn't slope
--- a/src/yapf/yapf_costcache.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/yapf/yapf_costcache.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -5,6 +5,7 @@
 #ifndef  YAPF_COSTCACHE_HPP
 #define  YAPF_COSTCACHE_HPP
 
+#include "../date_func.h"
 
 /** CYapfSegmentCostCacheNoneT - the formal only yapf cost cache provider that implements
  * PfNodeCacheFetch() and PfNodeCacheFlush() callbacks. Used when nodes don't have CachedData
--- a/src/yapf/yapf_destrail.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/yapf/yapf_destrail.hpp	Tue Jan 22 21:00:30 2008 +0000
@@ -8,7 +8,7 @@
 class CYapfDestinationRailBase
 {
 protected:
-	RailTypeMask m_compatible_railtypes;
+	RailTypes m_compatible_railtypes;
 
 public:
 	void SetDestination(Vehicle* v)
--- a/src/yapf/yapf_rail.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/yapf/yapf_rail.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -8,6 +8,7 @@
 #include "yapf_node_rail.hpp"
 #include "yapf_costrail.hpp"
 #include "yapf_destrail.hpp"
+#include "../vehicle_func.h"
 
 #define DEBUG_YAPF_CACHE 0
 
--- a/src/zoom.hpp	Mon Dec 03 23:39:38 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/* $Id$ */
-
-/** @file zoom.hpp */
-
-#ifndef ZOOM_HPP
-#define ZOOM_HPP
-
-enum ZoomLevel {
-	/* Our possible zoom-levels */
-	ZOOM_LVL_NORMAL = 0,
-	ZOOM_LVL_OUT_2X,
-	ZOOM_LVL_OUT_4X,
-	ZOOM_LVL_OUT_8X,
-	ZOOM_LVL_END,
-
-	/* Here we define in which zoom viewports are */
-	ZOOM_LVL_VIEWPORT = ZOOM_LVL_NORMAL,
-	ZOOM_LVL_NEWS     = ZOOM_LVL_NORMAL,
-	ZOOM_LVL_INDUSTRY = ZOOM_LVL_OUT_2X,
-	ZOOM_LVL_TOWN     = ZOOM_LVL_OUT_2X,
-	ZOOM_LVL_AIRCRAFT = ZOOM_LVL_NORMAL,
-	ZOOM_LVL_SHIP     = ZOOM_LVL_NORMAL,
-	ZOOM_LVL_TRAIN    = ZOOM_LVL_NORMAL,
-	ZOOM_LVL_ROADVEH  = ZOOM_LVL_NORMAL,
-	ZOOM_LVL_WORLD_SCREENSHOT = ZOOM_LVL_NORMAL,
-
-	ZOOM_LVL_DETAIL   = ZOOM_LVL_OUT_2X, ///< All zoomlevels below or equal to this, will result in details on the screen, like road-work, ...
-
-	ZOOM_LVL_MIN      = ZOOM_LVL_NORMAL,
-	ZOOM_LVL_MAX      = ZOOM_LVL_OUT_8X,
-};
-
-extern ZoomLevel _saved_scrollpos_zoom;
-
-/**
- * Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL)
- * When shifting right, value is rounded up
- * @param value value to shift
- * @param zoom  zoom level to shift to
- * @return shifted value
- */
-static inline int ScaleByZoom(int value, ZoomLevel zoom)
-{
-	if (zoom == ZOOM_LVL_NORMAL) return value;
-	int izoom = (int)zoom - (int)ZOOM_LVL_NORMAL;
-	return (zoom > ZOOM_LVL_NORMAL) ? value << izoom : (value + (1 << -izoom) - 1) >> -izoom;
-}
-
-/**
- * Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL)
- * When shifting right, value is rounded up
- * @param value value to shift
- * @param zoom  zoom level to shift to
- * @return shifted value
- */
-static inline int UnScaleByZoom(int value, ZoomLevel zoom)
-{
-	if (zoom == ZOOM_LVL_NORMAL) return value;
-	int izoom = (int)zoom - (int)ZOOM_LVL_NORMAL;
-	return (zoom > ZOOM_LVL_NORMAL) ? (value + (1 << izoom) - 1) >> izoom : value << -izoom;
-}
-
-/**
- * Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL)
- * @param value value to shift
- * @param zoom  zoom level to shift to
- * @return shifted value
- */
-static inline int ScaleByZoomLower(int value, ZoomLevel zoom)
-{
-	if (zoom == ZOOM_LVL_NORMAL) return value;
-	int izoom = (int)zoom - (int)ZOOM_LVL_NORMAL;
-	return (zoom > ZOOM_LVL_NORMAL) ? value << izoom : value >> -izoom;
-}
-
-/**
- * Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL)
- * @param value value to shift
- * @param zoom  zoom level to shift to
- * @return shifted value
- */
-static inline int UnScaleByZoomLower(int value, ZoomLevel zoom)
-{
-	if (zoom == ZOOM_LVL_NORMAL) return value;
-	int izoom = (int)zoom - (int)ZOOM_LVL_NORMAL;
-	return (zoom > ZOOM_LVL_NORMAL) ? value >> izoom : value << -izoom;
-}
-
-#endif /* ZOOM_HPP */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/zoom_func.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,66 @@
+/* $Id$ */
+
+/** @file zoom_func.hpp */
+
+#ifndef ZOOM_FUNC_H
+#define ZOOM_FUNC_H
+
+#include "zoom_type.h"
+
+extern ZoomLevel _saved_scrollpos_zoom;
+
+/**
+ * Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL)
+ * When shifting right, value is rounded up
+ * @param value value to shift
+ * @param zoom  zoom level to shift to
+ * @return shifted value
+ */
+static inline int ScaleByZoom(int value, ZoomLevel zoom)
+{
+	if (zoom == ZOOM_LVL_NORMAL) return value;
+	int izoom = zoom - ZOOM_LVL_NORMAL;
+	return (zoom > ZOOM_LVL_NORMAL) ? value << izoom : (value + (1 << -izoom) - 1) >> -izoom;
+}
+
+/**
+ * Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL)
+ * When shifting right, value is rounded up
+ * @param value value to shift
+ * @param zoom  zoom level to shift to
+ * @return shifted value
+ */
+static inline int UnScaleByZoom(int value, ZoomLevel zoom)
+{
+	if (zoom == ZOOM_LVL_NORMAL) return value;
+	int izoom = zoom - ZOOM_LVL_NORMAL;
+	return (zoom > ZOOM_LVL_NORMAL) ? (value + (1 << izoom) - 1) >> izoom : value << -izoom;
+}
+
+/**
+ * Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL)
+ * @param value value to shift
+ * @param zoom  zoom level to shift to
+ * @return shifted value
+ */
+static inline int ScaleByZoomLower(int value, ZoomLevel zoom)
+{
+	if (zoom == ZOOM_LVL_NORMAL) return value;
+	int izoom = zoom - ZOOM_LVL_NORMAL;
+	return (zoom > ZOOM_LVL_NORMAL) ? value << izoom : value >> -izoom;
+}
+
+/**
+ * Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL)
+ * @param value value to shift
+ * @param zoom  zoom level to shift to
+ * @return shifted value
+ */
+static inline int UnScaleByZoomLower(int value, ZoomLevel zoom)
+{
+	if (zoom == ZOOM_LVL_NORMAL) return value;
+	int izoom = zoom - ZOOM_LVL_NORMAL;
+	return (zoom > ZOOM_LVL_NORMAL) ? value >> izoom : value << -izoom;
+}
+
+#endif /* ZOOM_FUNC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/zoom_type.h	Tue Jan 22 21:00:30 2008 +0000
@@ -0,0 +1,37 @@
+/* $Id$ */
+
+/** @file zoom_type.h Types related to zooming in and out. */
+
+#ifndef ZOOM_TYPE_H
+#define ZOOM_TYPE_H
+
+#include "core/enum_type.hpp"
+
+enum ZoomLevel {
+	/* Our possible zoom-levels */
+	ZOOM_LVL_BEGIN  = 0,
+	ZOOM_LVL_NORMAL = 0,
+	ZOOM_LVL_OUT_2X,
+	ZOOM_LVL_OUT_4X,
+	ZOOM_LVL_OUT_8X,
+	ZOOM_LVL_END,
+
+	/* Here we define in which zoom viewports are */
+	ZOOM_LVL_VIEWPORT = ZOOM_LVL_NORMAL,
+	ZOOM_LVL_NEWS     = ZOOM_LVL_NORMAL,
+	ZOOM_LVL_INDUSTRY = ZOOM_LVL_OUT_2X,
+	ZOOM_LVL_TOWN     = ZOOM_LVL_OUT_2X,
+	ZOOM_LVL_AIRCRAFT = ZOOM_LVL_NORMAL,
+	ZOOM_LVL_SHIP     = ZOOM_LVL_NORMAL,
+	ZOOM_LVL_TRAIN    = ZOOM_LVL_NORMAL,
+	ZOOM_LVL_ROADVEH  = ZOOM_LVL_NORMAL,
+	ZOOM_LVL_WORLD_SCREENSHOT = ZOOM_LVL_NORMAL,
+
+	ZOOM_LVL_DETAIL   = ZOOM_LVL_OUT_2X, ///< All zoomlevels below or equal to this, will result in details on the screen, like road-work, ...
+
+	ZOOM_LVL_MIN      = ZOOM_LVL_NORMAL,
+	ZOOM_LVL_MAX      = ZOOM_LVL_OUT_8X,
+};
+DECLARE_POSTFIX_INCREMENT(ZoomLevel)
+
+#endif /* ZOOM_TYPE_H */