diff options
author | bjarni <bjarni@openttd.org> | 2006-09-08 12:10:37 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2006-09-08 12:10:37 +0000 |
commit | 7d9ab2e4e2a229add17f646e348a85d6ae707f3d (patch) | |
tree | 2afe7c40c7fded92ce00e32023fbfdaaea34a485 | |
parent | d9e07719f4383e6efbe9aa40021f9b2b83f89078 (diff) | |
download | openttd-7d9ab2e4e2a229add17f646e348a85d6ae707f3d.tar.xz |
(svn r6429) -Fix: [autoreplace GUI] selecting an empty line will now deselect the engine instead of selecting the first in the list (consistent with all other windows)
-Fix: [autoreplace GUI] engine info is now drawn in the right side even if the left list is empty
-rw-r--r-- | vehicle_gui.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c index 341cb78df..ab020d88d 100644 --- a/vehicle_gui.c +++ b/vehicle_gui.c @@ -792,34 +792,6 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e) selected_id[0] = WP(w,replaceveh_d).sel_engine[0]; selected_id[1] = WP(w,replaceveh_d).sel_engine[1]; - // sets the selected left item to the top one if it's greater than the number of vehicles in the left side - - if (WP(w,replaceveh_d).count[0] <= sel[0]) { - if (WP(w,replaceveh_d).count[0]) { - sel[0] = 0; - WP(w,replaceveh_d).sel_index[0] = 0; - w->vscroll.pos = 0; - // now we go back to set selected_id[1] properly - SetWindowDirty(w); - return; - } else { //there are no vehicles in the left window - selected_id[1] = INVALID_ENGINE; - } - } - - if (WP(w,replaceveh_d).count[1] <= sel[1]) { - if (WP(w,replaceveh_d).count[1]) { - sel[1] = 0; - WP(w,replaceveh_d).sel_index[1] = 0; - w->vscroll2.pos = 0; - // now we go back to set selected_id[1] properly - SetWindowDirty(w); - return; - } else { //there are no vehicles in the right window - selected_id[1] = INVALID_ENGINE; - } - } - // Disable the "Start Replacing" button if: // Either list is empty // or Both lists have the same vehicle selected |