diff options
Diffstat (limited to 'src/road_gui.cpp')
-rw-r--r-- | src/road_gui.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 03267323b..d98df7f9e 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -475,7 +475,7 @@ struct BuildRoadToolbarWindow : Window { virtual EventState OnKeyPress(uint16 key, uint16 keycode) { - int num = CheckHotkeyMatch(roadtoolbar_hotkeys, keycode, this); + int num = CheckHotkeyMatch(roadtoolbar_hotkeys, keycode); if (num == -1 || this->GetWidget<NWidgetBase>(num) == NULL) return ES_NOT_HANDLED; this->OnClick(Point(), num, 1); MarkTileDirtyByTile(TileVirtXY(_thd.pos.x, _thd.pos.y)); // redraw tile selection @@ -660,24 +660,24 @@ struct BuildRoadToolbarWindow : Window { return ES_NOT_HANDLED; } - static Hotkey<BuildRoadToolbarWindow> roadtoolbar_hotkeys[]; + static Hotkey roadtoolbar_hotkeys[]; }; -Hotkey<BuildRoadToolbarWindow> BuildRoadToolbarWindow::roadtoolbar_hotkeys[] = { - Hotkey<BuildRoadToolbarWindow>('1', "build_x", WID_ROT_ROAD_X), - Hotkey<BuildRoadToolbarWindow>('2', "build_y", WID_ROT_ROAD_Y), - Hotkey<BuildRoadToolbarWindow>('3', "autoroad", WID_ROT_AUTOROAD), - Hotkey<BuildRoadToolbarWindow>('4', "demolish", WID_ROT_DEMOLISH), - Hotkey<BuildRoadToolbarWindow>('5', "depot", WID_ROT_DEPOT), - Hotkey<BuildRoadToolbarWindow>('6', "bus_station", WID_ROT_BUS_STATION), - Hotkey<BuildRoadToolbarWindow>('7', "truck_station", WID_ROT_TRUCK_STATION), - Hotkey<BuildRoadToolbarWindow>('8', "oneway", WID_ROT_ONE_WAY), - Hotkey<BuildRoadToolbarWindow>('B', "bridge", WID_ROT_BUILD_BRIDGE), - Hotkey<BuildRoadToolbarWindow>('T', "tunnel", WID_ROT_BUILD_TUNNEL), - Hotkey<BuildRoadToolbarWindow>('R', "remove", WID_ROT_REMOVE), - HOTKEY_LIST_END(BuildRoadToolbarWindow) +Hotkey BuildRoadToolbarWindow::roadtoolbar_hotkeys[] = { + Hotkey('1', "build_x", WID_ROT_ROAD_X), + Hotkey('2', "build_y", WID_ROT_ROAD_Y), + Hotkey('3', "autoroad", WID_ROT_AUTOROAD), + Hotkey('4', "demolish", WID_ROT_DEMOLISH), + Hotkey('5', "depot", WID_ROT_DEPOT), + Hotkey('6', "bus_station", WID_ROT_BUS_STATION), + Hotkey('7', "truck_station", WID_ROT_TRUCK_STATION), + Hotkey('8', "oneway", WID_ROT_ONE_WAY), + Hotkey('B', "bridge", WID_ROT_BUILD_BRIDGE), + Hotkey('T', "tunnel", WID_ROT_BUILD_TUNNEL), + Hotkey('R', "remove", WID_ROT_REMOVE), + HOTKEY_LIST_END }; -Hotkey<BuildRoadToolbarWindow> *_roadtoolbar_hotkeys = BuildRoadToolbarWindow::roadtoolbar_hotkeys; +Hotkey *_roadtoolbar_hotkeys = BuildRoadToolbarWindow::roadtoolbar_hotkeys; static const NWidgetPart _nested_build_road_widgets[] = { @@ -778,7 +778,7 @@ Window *ShowBuildRoadToolbar(RoadType roadtype) EventState RoadToolbarGlobalHotkeys(uint16 key, uint16 keycode) { extern RoadType _last_built_roadtype; - int num = CheckHotkeyMatch<BuildRoadToolbarWindow>(_roadtoolbar_hotkeys, keycode, NULL, true); + int num = CheckHotkeyMatch(_roadtoolbar_hotkeys, keycode, true); if (num == -1) return ES_NOT_HANDLED; Window *w = ShowBuildRoadToolbar(_last_built_roadtype); if (w == NULL) return ES_NOT_HANDLED; @@ -831,7 +831,7 @@ Window *ShowBuildRoadScenToolbar() EventState RoadToolbarEditorGlobalHotkeys(uint16 key, uint16 keycode) { - int num = CheckHotkeyMatch<BuildRoadToolbarWindow>(_roadtoolbar_hotkeys, keycode, NULL, true); + int num = CheckHotkeyMatch(_roadtoolbar_hotkeys, keycode, true); if (num == -1) return ES_NOT_HANDLED; Window *w = ShowBuildRoadScenToolbar(); if (w == NULL) return ES_NOT_HANDLED; |