diff options
author | rubidium <rubidium@openttd.org> | 2008-03-27 14:34:29 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-03-27 14:34:29 +0000 |
commit | e9dad7637e36dbbdc2fbb3a7b84809ba33d53832 (patch) | |
tree | 9c12650ca5391cf880b30cab61c47cc1ef1c965b | |
parent | b490a21e503c07da2dc52d0614272845c24e35f1 (diff) | |
download | openttd-e9dad7637e36dbbdc2fbb3a7b84809ba33d53832.tar.xz |
(svn r12441) -Feature: open the time table when pressing the order button while pressing the CTRL key. Patch by Phil Sophus.
-rw-r--r-- | src/gui.h | 3 | ||||
-rw-r--r-- | src/lang/english.txt | 2 | ||||
-rw-r--r-- | src/timetable_gui.cpp | 8 | ||||
-rw-r--r-- | src/vehicle_gui.cpp | 6 |
4 files changed, 17 insertions, 2 deletions
@@ -83,6 +83,9 @@ enum { DDSP_PLACE_AUTOROAD, }; +/* timetable_gui.cpp */ +void ShowTimetableWindow(const Vehicle *v); + /* misc_gui.cpp */ void PlaceLandBlockInfo(); void ShowAboutWindow(); diff --git a/src/lang/english.txt b/src/lang/english.txt index 6a7e53bc6..fe2ca5aa1 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2721,6 +2721,8 @@ STR_REFIT_TIP :{BLACK}Select w STR_REFIT_ORDER :(Refit to {STRING}) STR_TIMETABLE_VIEW :{BLACK}Timetable STR_TIMETABLE_VIEW_TOOLTIP :{BLACK}Switch to the timetable view +STR_ORDER_VIEW :{BLACK}Orders +STR_ORDER_VIEW_TOOLTIP :{BLACK}Switch to the order view STR_8829_ORDERS :{WHITE}{VEHICLE} (Orders) STR_882A_END_OF_ORDERS :{SETX 10}- - End of Orders - - STR_FULLLOAD_OR_SERVICE :{SKIP}{SKIP}{STRING} diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index faf968a23..85db9f1d1 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -24,6 +24,7 @@ enum TimetableViewWindowWidgets { TTV_WIDGET_CLOSEBOX = 0, TTV_CAPTION, + TTV_ORDER_VIEW, TTV_STICKY, TTV_TIMETABLE_PANEL, TTV_SCROLLBAR, @@ -236,6 +237,10 @@ static void TimetableWndProc(Window *w, WindowEvent *we) const Vehicle *v = GetVehicle(w->window_number); switch (we->we.click.widget) { + case TTV_ORDER_VIEW: /* Order view button */ + ShowOrdersWindow(v); + break; + case TTV_TIMETABLE_PANEL: { /* Main panel. */ int selected = GetOrderFromTimetableWndPt(w, we->we.click.pt.y, v); @@ -310,7 +315,8 @@ static void TimetableWndProc(Window *w, WindowEvent *we) static const Widget _timetable_widgets[] = { { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // TTV_WIDGET_CLOSEBOX - { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 387, 0, 13, STR_TIMETABLE_TITLE, STR_018C_WINDOW_TITLE_DRAG_THIS}, // TTV_CAPTION + { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 326, 0, 13, STR_TIMETABLE_TITLE, STR_018C_WINDOW_TITLE_DRAG_THIS}, // TTV_CAPTION + { WWT_PUSHTXTBTN, RESIZE_LR, 14, 327, 387, 0, 13, STR_ORDER_VIEW, STR_ORDER_VIEW_TOOLTIP}, // TTV_ORDER_VIEW { WWT_STICKYBOX, RESIZE_LR, 14, 388, 399, 0, 13, STR_NULL, STR_STICKY_BUTTON}, // TTV_STICKY { WWT_PANEL, RESIZE_RB, 14, 0, 387, 14, 95, STR_NULL, STR_TIMETABLE_TOOLTIP}, // TTV_TIMETABLE_PANEL diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 57fabec4e..c19badd40 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2079,7 +2079,11 @@ static void VehicleViewWndProc(Window *w, WindowEvent *e) ShowVehicleRefitWindow(v, INVALID_VEH_ORDER_ID); break; case VVW_WIDGET_SHOW_ORDERS: /* show orders */ - ShowOrdersWindow(v); + if (_ctrl_pressed) { + ShowTimetableWindow(v); + } else { + ShowOrdersWindow(v); + } break; case VVW_WIDGET_SHOW_DETAILS: /* show details */ ShowVehicleDetailsWindow(v); |