diff options
-rw-r--r-- | src/game.cpp | 2 | ||||
-rw-r--r-- | src/gui/itemamount.cpp | 11 | ||||
-rw-r--r-- | src/gui/itemamount.h | 4 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp index 15d70adc..644da530 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -755,7 +755,7 @@ void Game::handleInput() const int tKey = keyboard.getKeyIndex(event.key.keysym.sym); // Do not activate shortcuts if tradewindow is visible - if (!tradeWindow->isVisible()) + if (!tradeWindow->isVisible() && !setupWindow->isVisible()) { // Checks if any item shortcut is pressed. for (int i = KeyboardConfig::KEY_SHORTCUT_1; diff --git a/src/gui/itemamount.cpp b/src/gui/itemamount.cpp index 20834c54..71e19e3c 100644 --- a/src/gui/itemamount.cpp +++ b/src/gui/itemamount.cpp @@ -33,6 +33,7 @@ #include "gui/widgets/icon.h" #include "item.h" +#include "keyboardconfig.h" #include "net/inventoryhandler.h" #include "net/net.h" @@ -73,6 +74,10 @@ ItemAmountWindow::ItemAmountWindow(Usage usage, Window *parent, Item *item, if (!mMax) mMax = mItem->getQuantity(); + // Save keyboard state + mEnabledKeyboard = keyboard.isEnabled(); + keyboard.setEnabled(false); + // Integer field mItemAmountTextField = new IntTextField(1); mItemAmountTextField->setRange(1, mMax); @@ -224,3 +229,9 @@ void ItemAmountWindow::showWindow(Usage usage, Window *parent, Item *item, new ItemAmountWindow(usage, parent, item, maxRange); } } + +void ItemAmountWindow::scheduleDelete() +{ + keyboard.setEnabled(mEnabledKeyboard); + Window::scheduleDelete(); +} diff --git a/src/gui/itemamount.h b/src/gui/itemamount.h index 214f8b6b..52b72a38 100644 --- a/src/gui/itemamount.h +++ b/src/gui/itemamount.h @@ -77,6 +77,8 @@ class ItemAmountWindow : public Window, static void showWindow(Usage usage, Window *parent, Item *item, int maxRange = 0); + void scheduleDelete(); + private: static void finish(Item *item, int amount, Usage usage); @@ -95,6 +97,8 @@ class ItemAmountWindow : public Window, * Item Amount buttons. */ gcn::Slider *mItemAmountSlide; + + bool mEnabledKeyboard; }; #endif /* ITEM_AMOUNT_WINDOW_H */ |