diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-05-13 10:57:05 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-05-13 10:57:05 -0600 |
commit | 7cddbca0dcfff234b6c6f124cb91840279c36118 (patch) | |
tree | cce25bc9e93c0bb9bd5b41185d1b32e776f4c2d3 /src/gui/npcdialog.cpp | |
parent | d401dcb26695bddec8c39edc8151dbe309378519 (diff) | |
download | mana-7cddbca0dcfff234b6c6f124cb91840279c36118.tar.gz mana-7cddbca0dcfff234b6c6f124cb91840279c36118.tar.bz2 mana-7cddbca0dcfff234b6c6f124cb91840279c36118.tar.xz mana-7cddbca0dcfff234b6c6f124cb91840279c36118.zip |
Allow more control of NpcDialog using the keyboard
The move up and move down keys will now let you navigate the list mode
and change the value on the integer mode.
Diffstat (limited to 'src/gui/npcdialog.cpp')
-rw-r--r-- | src/gui/npcdialog.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp index eeb76b88..3fa86b28 100644 --- a/src/gui/npcdialog.cpp +++ b/src/gui/npcdialog.cpp @@ -281,6 +281,22 @@ void NpcDialog::integerRequest(int defaultValue, int min, int max) buildLayout(); } +void NpcDialog::move(int amount) +{ + if (mActionState != NPC_ACTION_INPUT) + return; + + switch (mInputState) + { + case NPC_INPUT_INTEGER: + mIntField->setValue(mIntField->getValue() + amount); + break; + case NPC_INPUT_LIST: + mItemList->setSelected(mItemList->getSelected() - amount); + break; + } +} + void NpcDialog::widgetResized(const gcn::Event &event) { Window::widgetResized(event); |