summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-07-21 14:28:06 +0000
committeryexo <yexo@openttd.org>2010-07-21 14:28:06 +0000
commit1ec328f725ee023fcb6d2c94b7612719bd932090 (patch)
treec694b10a8bafa6fe657e0c8ecfce0b2538954d15 /src/order_gui.cpp
parent2828f36aa4c1ee1657b8ae28398d2aa1496493c8 (diff)
downloadopenttd-1ec328f725ee023fcb6d2c94b7612719bd932090.tar.xz
(svn r20201) -Feature [FS#3926]: add several new hotkeys to the global hotkey list and to the order windows. None of them has a default keybinding.
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 4f23a7140..a815cdca4 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -552,6 +552,14 @@ private:
}
/**
+ * Handle the 'no loading' hotkey
+ */
+ void OrderHotkey_NoLoad(int i)
+ {
+ this->OrderClick_FullLoad(OLFB_NO_LOAD);
+ }
+
+ /**
* Handle the click on the service.
*/
void OrderClick_Service(int i)
@@ -612,6 +620,22 @@ private:
}
/**
+ * Handle the transfer hotkey
+ */
+ void OrderHotkey_Transfer(int i)
+ {
+ this->OrderClick_Unload(OUFB_TRANSFER);
+ }
+
+ /**
+ * Handle the 'no unload' hotkey
+ */
+ void OrderHotkey_NoUnload(int i)
+ {
+ this->OrderClick_Unload(OUFB_NO_UNLOAD);
+ }
+
+ /**
* Handle the click on the nonstop button.
* @param non_stop what non-stop type to use; -1 to use the 'next' one.
*/
@@ -677,11 +701,6 @@ private:
ShowVehicleRefitWindow(this->vehicle, this->OrderGetSel(), this);
}
}
- typedef void (OrdersWindow::*Handler)(int);
- struct KeyToEvent {
- uint16 keycode;
- Handler proc;
- };
public:
OrdersWindow(const WindowDesc *desc, const Vehicle *v) : Window()
@@ -1341,6 +1360,12 @@ Hotkey<OrdersWindow> OrdersWindow::order_hotkeys[]= {
Hotkey<OrdersWindow>('H', "nonstop", 0, &OrdersWindow::OrderClick_Nonstop),
Hotkey<OrdersWindow>('J', "fullload", 0, &OrdersWindow::OrderClick_FullLoad),
Hotkey<OrdersWindow>('K', "unload", 0, &OrdersWindow::OrderClick_Unload),
+ Hotkey<OrdersWindow>((uint16)0, "nearest_depot", 0, &OrdersWindow::OrderClick_NearestDepot),
+ Hotkey<OrdersWindow>((uint16)0, "always_service", 0, &OrdersWindow::OrderClick_Service),
+ Hotkey<OrdersWindow>((uint16)0, "force_unload", 0, &OrdersWindow::OrderClick_Unload),
+ Hotkey<OrdersWindow>((uint16)0, "transfer", 0, &OrdersWindow::OrderHotkey_Transfer),
+ Hotkey<OrdersWindow>((uint16)0, "no_unload", 0, &OrdersWindow::OrderHotkey_NoUnload),
+ Hotkey<OrdersWindow>((uint16)0, "no_load", 0, &OrdersWindow::OrderHotkey_NoLoad),
HOTKEY_LIST_END(OrdersWindow)
};
Hotkey<OrdersWindow> *_order_hotkeys = OrdersWindow::order_hotkeys;