diff options
author | dominik <dominik@openttd.org> | 2004-12-12 22:05:08 +0000 |
---|---|---|
committer | dominik <dominik@openttd.org> | 2004-12-12 22:05:08 +0000 |
commit | 2690ba03b210f45ee154cff4e8417f86eae78e77 (patch) | |
tree | f7395153246eca640ab2e307bfa65b502eff689a | |
parent | 9e3ca26ae60b449ceb6db2e9c8ab4ed459b942c2 (diff) | |
download | openttd-2690ba03b210f45ee154cff4e8417f86eae78e77.tar.xz |
(svn r1040) Fix: All character hotkeys are disabled now when a window for typing is open
-rw-r--r-- | main_gui.c | 11 | ||||
-rw-r--r-- | rail_gui.c | 5 | ||||
-rw-r--r-- | road_gui.c | 4 | ||||
-rw-r--r-- | terraform_gui.c | 5 |
4 files changed, 23 insertions, 2 deletions
diff --git a/main_gui.c b/main_gui.c index 23d3ef55a..011733e53 100644 --- a/main_gui.c +++ b/main_gui.c @@ -1809,7 +1809,6 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e) case WKC_PAUSE: ToolbarPauseClick(w); break; - case 'L': ShowTerraformToolbar(); break; case WKC_F2: ShowGameOptions(); break; case WKC_F3: MenuClickSaveLoad(0); break; case WKC_F4: ShowSmallMap(); break; @@ -1835,7 +1834,6 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e) case WKC_SHIFT | WKC_F12: ShowMusicWindow(); break; case WKC_CTRL | 'S': _make_screenshot = 1; break; case WKC_CTRL | 'G': _make_screenshot = 2; break; - case WKC_BACKQUOTE: IConsoleSwitch(); e->keypress.cont=false; break; case WKC_CTRL | WKC_ALT | 'C': if (!_networking) ShowCheatWindow(); break; } } break; @@ -2324,11 +2322,20 @@ static void MainWindowWndProc(Window *w, WindowEvent *e) { ShowBuildRailToolbar(_last_built_railtype, 0); break; + case 'L': + ShowTerraformToolbar(); + break; + case 'X': _display_opt ^= DO_TRANS_BUILDINGS; MarkWholeScreenDirty(); break; + case WKC_BACKQUOTE: + IConsoleSwitch(); + e->keypress.cont=false; + break; + #ifdef ENABLE_NETWORK case 'T' | WKC_SHIFT: ShowNetworkChatQueryWindow(DESTTYPE_BROADCAST, 0); diff --git a/rail_gui.c b/rail_gui.c index 271fedfb4..ac22977e0 100644 --- a/rail_gui.c +++ b/rail_gui.c @@ -612,6 +612,11 @@ static void BuildRailToolbWndProc(Window *w, WindowEvent *e) case WE_KEYPRESS: { int i; + + // check if we have a query string window open before allowing hotkeys + if(FindWindowById(WC_QUERY_STRING, 0)!=NULL) + break; + for(i=0; i!=lengthof(_rail_keycodes); i++) if (e->keypress.keycode == _rail_keycodes[i]) { e->keypress.cont = false; diff --git a/road_gui.c b/road_gui.c index 8374786b4..b1add67b0 100644 --- a/road_gui.c +++ b/road_gui.c @@ -192,6 +192,10 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) { } break; case WE_KEYPRESS: + // check if we have a query string window open before allowing hotkeys + if(FindWindowById(WC_QUERY_STRING, 0)!=NULL) + break; + switch(e->keypress.keycode) { case '1': BuildRoadClick_NE(w); break; case '2': BuildRoadClick_NW(w); break; diff --git a/terraform_gui.c b/terraform_gui.c index 1f6099501..82cfffd96 100644 --- a/terraform_gui.c +++ b/terraform_gui.c @@ -121,6 +121,11 @@ static void TerraformToolbWndProc(Window *w, WindowEvent *e) case WE_KEYPRESS: { int i; + + // check if we have a query string window open before allowing hotkeys + if(FindWindowById(WC_QUERY_STRING, 0)!=NULL) + break; + for(i=0; i!=lengthof(_terraform_keycodes); i++) if (e->keypress.keycode == _terraform_keycodes[i]) { e->keypress.cont = false; |