diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/npcdialog.cpp | 11 | ||||
-rw-r--r-- | src/gui/npcdialog.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp index 362d9db9d..1aeb76ec2 100644 --- a/src/gui/npcdialog.cpp +++ b/src/gui/npcdialog.cpp @@ -342,9 +342,20 @@ void NpcDialog::parseListItems(const std::string &itemString) mItems.push_back(tmp); if (!mItems.empty()) + { mItemList->setSelected(0); + mItemList->requestFocus(); + } else + { mItemList->setSelected(-1); + } +} + +void NpcDialog::refocus() +{ + if (!mItems.empty()) + mItemList->requestFocus(); } void NpcDialog::textRequest(const std::string &defaultText) diff --git a/src/gui/npcdialog.h b/src/gui/npcdialog.h index d4288d5c9..7bd2ee76d 100644 --- a/src/gui/npcdialog.h +++ b/src/gui/npcdialog.h @@ -177,6 +177,8 @@ class NpcDialog : public Window, public gcn::ActionListener, void restoreCamera(); + void refocus(); + private: typedef std::list<NpcDialog*> DialogList; static DialogList instances; |