summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2005-01-08 09:40:22 +0000
committercelestar <celestar@openttd.org>2005-01-08 09:40:22 +0000
commitd8b1bbe6dbe8becbcd5471124cb1af40d098738d (patch)
treeb3fef9b1bb39995f7c361d371953ccf1ed473c19
parentedc514dc7eee94ca9dcca53b768382d451ac275c (diff)
downloadopenttd-d8b1bbe6dbe8becbcd5471124cb1af40d098738d.tar.xz
(svn r1425) Added hotkeys for dock and airport toolbar
-rw-r--r--airport_gui.c10
-rw-r--r--dock_gui.c14
2 files changed, 24 insertions, 0 deletions
diff --git a/airport_gui.c b/airport_gui.c
index 175d8658f..d0194c529 100644
--- a/airport_gui.c
+++ b/airport_gui.c
@@ -69,6 +69,16 @@ static void BuildAirToolbWndProc(Window *w, WindowEvent *e)
if (e->click.widget - 3 >= 0)
_build_air_button_proc[e->click.widget - 3](w);
break;
+
+ case WE_KEYPRESS: {
+ switch (e->keypress.keycode) {
+ case '1': BuildAirClick_Airport(w); break;
+ case '2': BuildAirClick_Demolish(w); break;
+ case 'l': BuildAirClick_Landscaping(w); break;
+ default:
+ return;
+ }
+ } break;
case WE_PLACE_OBJ:
_place_proc(e->place.tile);
diff --git a/dock_gui.c b/dock_gui.c
index 7f7c4581c..f7fd23af4 100644
--- a/dock_gui.c
+++ b/dock_gui.c
@@ -118,6 +118,20 @@ static void BuildDocksToolbWndProc(Window *w, WindowEvent *e)
case WE_CLICK: {
if (e->click.widget - 3 >= 0 && e->click.widget != 5) _build_docks_button_proc[e->click.widget - 3](w);
} break;
+
+ case WE_KEYPRESS: {
+ switch(e->keypress.keycode) {
+ case '1': BuildDocksClick_Canal(w); break;
+ case '2': BuildDocksClick_Lock(w); break;
+ case '3': BuildDocksClick_Demolish(w); break;
+ case '4': BuildDocksClick_Depot(w); break;
+ case '5': BuildDocksClick_Dock(w); break;
+ case '6': BuildDocksClick_Buoy(w); break;
+ case 'l': BuildDocksClick_Landscaping(w); break;
+ default:
+ return;
+ }
+ } break;
case WE_PLACE_OBJ:
_place_proc(e->place.tile);