summaryrefslogtreecommitdiff
path: root/train_gui.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-01-06 17:40:57 +0000
committertruelight <truelight@openttd.org>2005-01-06 17:40:57 +0000
commit124a29f7a5370c8cbfbc79ba7fc36200a6c2c676 (patch)
treef7f9f3da92039b27065ab51729b36e613b5e9f4e /train_gui.c
parent8e28e8efc3a3a1f789185560331dc2c4f663ca96 (diff)
downloadopenttd-124a29f7a5370c8cbfbc79ba7fc36200a6c2c676.tar.xz
(svn r1401) -Fix: glitches in train-depot GUI (tnx to Hackykid)
-Fix: glitch in Company Overview GUI (Hackykid)
Diffstat (limited to 'train_gui.c')
-rw-r--r--train_gui.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/train_gui.c b/train_gui.c
index ec7dde994..90d69da58 100644
--- a/train_gui.c
+++ b/train_gui.c
@@ -329,6 +329,10 @@ static void DrawTrainDepotWindow(Window *w)
}
}
}
+
+ /* Always have 1 empty row, so people can change the setting of the train */
+ num++;
+
SetVScrollCount(w, num);
SetHScrollCount(w, hnum);
@@ -397,7 +401,7 @@ static int GetVehicleFromTrainDepotWndPt(Window *w, int x, int y, GetDepotVehicl
}
row = (y - 14) / 14;
- if ( (uint) row >= 6)
+ if ( (uint) row >= w->vscroll.cap)
return 1; /* means err */
row += w->vscroll.pos;
@@ -604,22 +608,22 @@ static const Widget _train_depot_widgets[] = {
{ WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, RESIZE_RIGHT, 14, 11, 336, 0, 13, STR_8800_TRAIN_DEPOT, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, RESIZE_LR, 14, 337, 348, 0, 13, 0x0, STR_STICKY_BUTTON},
-{ WWT_MATRIX, RESIZE_RB, 14, 0, 313, 14, 96, 0x601, STR_883F_TRAINS_CLICK_ON_TRAIN_FOR},
+{ WWT_MATRIX, RESIZE_RB, 14, 0, 313, 14, 97, 0x601, STR_883F_TRAINS_CLICK_ON_TRAIN_FOR},
{ WWT_PANEL, RESIZE_LRB, 14, 314, 336, 14, 13, 0x0, STR_NULL},
{ WWT_PANEL, RESIZE_LRTB, 14, 314, 336, 14, 54, 0x2A9, STR_8841_DRAG_TRAIN_VEHICLE_TO_HERE},
-{ WWT_PANEL, RESIZE_LRTB, 14, 314, 336, 55, 108, 0x2BF, STR_DRAG_WHOLE_TRAIN_TO_SELL_TIP},
-
-{ WWT_SCROLLBAR, RESIZE_LRB, 14, 337, 348, 14, 108, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
-{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 167, 109, 120, STR_8815_NEW_VEHICLES, STR_8840_BUILD_NEW_TRAIN_VEHICLE},
-{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 168, 336, 109, 120, STR_00E4_LOCATION, STR_8842_CENTER_MAIN_VIEW_ON_TRAIN},
-{ WWT_HSCROLLBAR, RESIZE_RTB, 14, 0, 313, 97, 108, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
-{ WWT_PANEL, RESIZE_RTB, 14, 337, 336, 109, 120, 0x0, STR_NULL},
-{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 337, 348, 109, 120, 0x0, STR_RESIZE_BUTTON},
+{ WWT_PANEL, RESIZE_LRTB, 14, 314, 336, 55, 109, 0x2BF, STR_DRAG_WHOLE_TRAIN_TO_SELL_TIP},
+
+{ WWT_SCROLLBAR, RESIZE_LRB, 14, 337, 348, 14, 109, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
+{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 167, 110, 121, STR_8815_NEW_VEHICLES, STR_8840_BUILD_NEW_TRAIN_VEHICLE},
+{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 168, 336, 110, 121, STR_00E4_LOCATION, STR_8842_CENTER_MAIN_VIEW_ON_TRAIN},
+{ WWT_HSCROLLBAR, RESIZE_RTB, 14, 0, 313, 98, 109, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
+{ WWT_PANEL, RESIZE_RTB, 14, 337, 336, 110, 121, 0x0, STR_NULL},
+{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 337, 348, 110, 121, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END},
};
static const WindowDesc _train_depot_desc = {
- -1, -1, 349, 121,
+ -1, -1, 349, 122,
WC_VEHICLE_DEPOT,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_train_depot_widgets,