summaryrefslogtreecommitdiff
path: root/src/main_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-06-15 15:28:09 +0000
committerfrosch <frosch@openttd.org>2013-06-15 15:28:09 +0000
commit1b8b1f3f6cbd65b73399b1d39aacb7fb674a091c (patch)
tree555791c9e1370b2caba036286b98f64efe970bd3 /src/main_gui.cpp
parent40c2864e4dd478693ef6c108cc95cd2e6b5e70d0 (diff)
downloadopenttd-1b8b1f3f6cbd65b73399b1d39aacb7fb674a091c.tar.xz
(svn r25410) -Codechange: Put all hotkeys of a window into a static HotkeyList member.
Diffstat (limited to 'src/main_gui.cpp')
-rw-r--r--src/main_gui.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index ae1b3c1b7..dcecfce27 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -289,7 +289,7 @@ struct MainWindow : Window
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
- int num = CheckHotkeyMatch(global_hotkeys, keycode);
+ int num = this->hotkeys.CheckMatch(keycode);
if (num == GHK_QUIT) {
HandleExitGameRequest();
return ES_HANDLED;
@@ -465,7 +465,7 @@ struct MainWindow : Window
InvalidateWindowData(WC_MAIN_TOOLBAR, 0, data, true);
}
- static Hotkey global_hotkeys[];
+ static HotkeyList hotkeys;
};
const uint16 _ghk_quit_keys[] = {'Q' | WKC_CTRL, 'Q' | WKC_META, 0};
@@ -475,7 +475,7 @@ const uint16 _ghk_chat_all_keys[] = {WKC_SHIFT | WKC_RETURN, WKC_SHIFT | 'T', 0}
const uint16 _ghk_chat_company_keys[] = {WKC_CTRL | WKC_RETURN, WKC_CTRL | 'T', 0};
const uint16 _ghk_chat_server_keys[] = {WKC_CTRL | WKC_SHIFT | WKC_RETURN, WKC_CTRL | WKC_SHIFT | 'T', 0};
-Hotkey MainWindow::global_hotkeys[] = {
+static Hotkey global_hotkeys[] = {
Hotkey(_ghk_quit_keys, "quit", GHK_QUIT),
Hotkey(_ghk_abandon_keys, "abandon", GHK_ABANDON),
Hotkey(WKC_BACKQUOTE, "console", GHK_CONSOLE),
@@ -519,7 +519,7 @@ Hotkey MainWindow::global_hotkeys[] = {
#endif
HOTKEY_LIST_END
};
-Hotkey *_global_hotkeys = MainWindow::global_hotkeys;
+HotkeyList MainWindow::hotkeys("global", global_hotkeys);
/**
* Does the given keycode match one of the keycodes bound to 'quit game'?
@@ -528,7 +528,7 @@ Hotkey *_global_hotkeys = MainWindow::global_hotkeys;
*/
bool IsQuitKey(uint16 keycode)
{
- int num = CheckHotkeyMatch(_global_hotkeys, keycode);
+ int num = MainWindow::hotkeys.CheckMatch(keycode);
return num == GHK_QUIT;
}