From 1afaba7d73a6158abfbbbcc7d881170e5b3ddd50 Mon Sep 17 00:00:00 2001 From: Dennis Friis Date: Thu, 6 Nov 2008 01:53:49 +0000 Subject: Do not activate shortcuts if tradewindow is visible. --- ChangeLog | 4 ++++ src/game.cpp | 21 ++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0bc68213..59b78674 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-11-06 Dennis Friis + + * src/game.cpp: Do not activate shortcuts if tradewindow is visible. + 2008-11-04 Bjørn Lindeijer * src/gui/gui.cpp, data/graphics/gui/sansserif8.png: Applied more diff --git a/src/game.cpp b/src/game.cpp index 3e3cb4b5..fc9183d4 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -664,15 +664,18 @@ void Game::handleInput() if (keyboard.isEnabled() && !chatWindow->isInputFocused()) { const int tKey = keyboard.getKeyIndex(event.key.keysym.sym); - // Checks if any item shortcut is pressed. - for (int i = KeyboardConfig::KEY_SHORTCUT_0; - i <= KeyboardConfig::KEY_SHORTCUT_9; - i++) - { - if (tKey == i && !used) { - itemShortcut->useItem( - i - KeyboardConfig::KEY_SHORTCUT_0); - break; + // Do not activate shortcuts if tradewindow is visible + if (!tradeWindow->isVisible()) + // Checks if any item shortcut is pressed. + for (int i = KeyboardConfig::KEY_SHORTCUT_0; + i <= KeyboardConfig::KEY_SHORTCUT_9; + i++) + { + if (tKey == i && !used) { + itemShortcut->useItem( + i - KeyboardConfig::KEY_SHORTCUT_0); + break; + } } } switch (tKey) { -- cgit v1.2.3-70-g09d2