summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/npcdialog.cpp16
-rw-r--r--src/gui/npcdialog.h2
2 files changed, 18 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);
diff --git a/src/gui/npcdialog.h b/src/gui/npcdialog.h
index bd738e81..ecce0c62 100644
--- a/src/gui/npcdialog.h
+++ b/src/gui/npcdialog.h
@@ -141,6 +141,8 @@ class NpcDialog : public Window, public gcn::ActionListener,
*/
void integerRequest(int defaultValue = 0, int min = 0, int max = 2000);
+ void move(int amount);
+
/**
* Called when resizing the window.
*