summaryrefslogtreecommitdiff
path: root/src/depot_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-04-05 11:27:50 +0000
committersmatz <smatz@openttd.org>2008-04-05 11:27:50 +0000
commitb2e4adc2b8e3a06c25f0ad988a3826b6f4ddfc85 (patch)
tree8cac13d3ae9840f5708a9bc585b873cf5bf60343 /src/depot_gui.cpp
parentbdd64495cd7af3fa064ed58a5419845eb78def46 (diff)
downloadopenttd-b2e4adc2b8e3a06c25f0ad988a3826b6f4ddfc85.tar.xz
(svn r12576) -Feature(tte) [FS#337]: highlight vehicle chain when dragging in the group and depot GUI if appropriate
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r--src/depot_gui.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp
index aeda3fb6f..e6f9fbcc5 100644
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -441,6 +441,7 @@ static void DepotClick(Window *w, int x, int y)
WP(w, depot_d).sel = v->index;
SetWindowDirty(w);
SetObjectToPlaceWnd(image, GetVehiclePalette(v), VHM_DRAG, w);
+ _cursor.vehchain = _ctrl_pressed;
}
}
break;
@@ -957,6 +958,7 @@ static void DepotWndProc(Window *w, WindowEvent *e)
WP(w, depot_d).sel = INVALID_VEHICLE;
SetWindowDirty(w);
}
+ _cursor.vehchain = false;
break;
case WE_RESIZE:
@@ -965,6 +967,13 @@ static void DepotWndProc(Window *w, WindowEvent *e)
w->widget[DEPOT_WIDGET_MATRIX].data = (w->vscroll.cap << 8) + (WP(w, depot_d).type == VEH_TRAIN ? 1 : w->hscroll.cap);
ResizeDepotButtons(w);
break;
+
+ case WE_CTRL_CHANGED:
+ if (WP(w, depot_d).sel != INVALID_VEHICLE) {
+ _cursor.vehchain = _ctrl_pressed;
+ w->InvalidateWidget(DEPOT_WIDGET_MATRIX);
+ }
+ break;
}
}