diff options
author | bjarni <bjarni@openttd.org> | 2005-01-26 12:42:29 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2005-01-26 12:42:29 +0000 |
commit | 5665d51bb31bd2c8860e9b48989fa145ad01e193 (patch) | |
tree | 8330c76d86cc47f1e087d757bc229fd72a7497f9 /vehicle_gui.c | |
parent | 518034d28d3664a3f3f6bb865eb8a8c4d0d3ccfe (diff) | |
download | openttd-5665d51bb31bd2c8860e9b48989fa145ad01e193.tar.xz |
(svn r1680) Feature: Replace train GUI now remembers the railtype selected in the dropdown menu
Diffstat (limited to 'vehicle_gui.c')
-rw-r--r-- | vehicle_gui.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c index d3f3178b1..c4e85bfe7 100644 --- a/vehicle_gui.c +++ b/vehicle_gui.c @@ -373,7 +373,7 @@ static void SetupScrollStuffForReplaceWindow(Window *w) switch (WP(w,replaceveh_d).vehicletype) { case VEH_Train: { - railtype = WP(w,replaceveh_d).railtype; + railtype = _railtype_selected_in_replace_gui; w->widget[13].color = _player_colors[_local_player]; // sets the colour of that art thing w->widget[16].color = _player_colors[_local_player]; // sets the colour of that art thing for (engine_id = 0; engine_id < NUM_TRAIN_ENGINES; engine_id++) { @@ -524,7 +524,7 @@ static void DrawEngineArrayInReplaceWindow(Window *w, int x, int y, int x2, int switch (WP(w,replaceveh_d).vehicletype) { case VEH_Train: { - byte railtype = WP(w,replaceveh_d).railtype; + byte railtype = _railtype_selected_in_replace_gui; DrawString(157, 89 + (14 * w->vscroll.cap), _rail_types_list[railtype], 0x10); /* draw sorting criteria string */ @@ -834,7 +834,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e) if ( !(HASBIT(DEREF_ENGINE(NUM_NORMAL_RAIL_ENGINES)->player_avail, _local_player))) engine_avail = 6; } - ShowDropDownMenu(w, _rail_types_list, WP(w,replaceveh_d).railtype, 15, engine_avail, 1); + ShowDropDownMenu(w, _rail_types_list, _railtype_selected_in_replace_gui, 15, engine_avail, 1); break; } case 4: { @@ -867,7 +867,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e) } break; case WE_DROPDOWN_SELECT: { /* we have selected a dropdown item in the list */ - WP(w,replaceveh_d).railtype = e->dropdown.index; + _railtype_selected_in_replace_gui = e->dropdown.index; SetWindowDirty(w); } break; |