diff options
author | KUDr <kudr@openttd.org> | 2006-11-17 19:31:44 +0000 |
---|---|---|
committer | KUDr <kudr@openttd.org> | 2006-11-17 19:31:44 +0000 |
commit | f2cda44d2e3c55069279ad3e03aeb5d2a7f0f35c (patch) | |
tree | 9c7682092cc873482f869cd11ccca7d20fe73bc2 /rail_gui.c | |
parent | 532271ba65c994ee8bc93752b515b8fc918b6ab5 (diff) | |
download | openttd-f2cda44d2e3c55069279ad3e03aeb5d2a7f0f35c.tar.xz |
(svn r7195) -Feature: [FS#297, optional elrails] New patches/vehicles option 'disable electrified railways'.
(original patch by maedhros, ideas: peter1138, Darkvater, Rubidium, Patrick, Eddi|zuHause, ..)
Diffstat (limited to 'rail_gui.c')
-rw-r--r-- | rail_gui.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/rail_gui.c b/rail_gui.c index 4d9e8ae17..30bf0a034 100644 --- a/rail_gui.c +++ b/rail_gui.c @@ -22,6 +22,7 @@ #include "variables.h" #include "newgrf_callbacks.h" #include "newgrf_station.h" +#include "train.h" static RailType _cur_railtype; static bool _remove_button_clicked; @@ -1150,3 +1151,20 @@ void InitializeRailGui(void) _railstation.platlength = 1; _railstation.dragdrop = true; } + +void ReinitGuiAfterToggleElrail(bool disable) +{ + extern RailType _last_built_railtype; + if (disable && _last_built_railtype == RAILTYPE_ELECTRIC) { + Window *w; + _last_built_railtype = _cur_railtype = RAILTYPE_RAIL; + w = FindWindowById(WC_BUILD_TOOLBAR, 0); + if (w != NULL && w->wndproc == BuildRailToolbWndProc) { + SetupRailToolbar(_cur_railtype, w); + SetWindowDirty(w); + } + } + MarkWholeScreenDirty(); +} + + |