summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-07-18 13:05:27 +0300
committerAndrei Karas <akaras@inbox.ru>2012-07-18 13:07:03 +0300
commitc32bbeb3674cef43df33bd1f7a249e95868b7ded (patch)
tree408be46ed94ab750fae3a60d729e9bd7c4dddbb9 /src
parente28e0566b6141df26fc1632f5ff67da47d4cd350 (diff)
downloadmanaverse-c32bbeb3674cef43df33bd1f7a249e95868b7ded.tar.gz
manaverse-c32bbeb3674cef43df33bd1f7a249e95868b7ded.tar.bz2
manaverse-c32bbeb3674cef43df33bd1f7a249e95868b7ded.tar.xz
manaverse-c32bbeb3674cef43df33bd1f7a249e95868b7ded.zip
Add close button to npc dialog in menu selection.
Diffstat (limited to 'src')
-rw-r--r--src/gui/npcdialog.cpp13
-rw-r--r--src/gui/npcdialog.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp
index ebcd02e7e..71a884d88 100644
--- a/src/gui/npcdialog.cpp
+++ b/src/gui/npcdialog.cpp
@@ -129,6 +129,7 @@ NpcDialog::NpcDialog(int npcId) :
// Setup button
mButton = new Button("", "ok", this);
+ mButton2 = new Button(_("Close"), "close", this);
//Setup more and less buttons (int input)
mPlusButton = new Button(_("+"), "inc", this);
@@ -175,6 +176,8 @@ NpcDialog::~NpcDialog()
mClearButton = nullptr;
delete mButton;
mButton = nullptr;
+ delete mButton2;
+ mButton2 = nullptr;
// These might not actually be in the layout, so lets be safe
delete mScrollArea;
@@ -321,6 +324,14 @@ void NpcDialog::action(const gcn::ActionEvent &event)
// mTextBox->addRow(mNewText);
// setText(mNewText);
}
+ else if (event.getId() == "close")
+ {
+ if (mActionState == NPC_ACTION_INPUT)
+ {
+ Net::getNpcHandler()->listInput(mNpcId, 255);
+ closeDialog();
+ }
+ }
}
void NpcDialog::nextDialog()
@@ -507,6 +518,7 @@ void NpcDialog::placeMenuControls()
place(0, 0, mPlayerBox);
place(1, 0, mScrollArea, 6, 3);
place(0, 3, mListScrollArea, 7, 3);
+ place(1, 6, mButton2, 2);
place(3, 6, mClearButton, 2);
place(5, 6, mButton, 2);
}
@@ -514,6 +526,7 @@ void NpcDialog::placeMenuControls()
{
place(0, 0, mScrollArea, 6, 3);
place(0, 3, mListScrollArea, 6, 3);
+ place(0, 6, mButton2, 2);
place(2, 6, mClearButton, 2);
place(4, 6, mButton, 2);
}
diff --git a/src/gui/npcdialog.h b/src/gui/npcdialog.h
index 68ee17e33..75c55ae96 100644
--- a/src/gui/npcdialog.h
+++ b/src/gui/npcdialog.h
@@ -238,6 +238,8 @@ class NpcDialog : public Window, public gcn::ActionListener,
// Used for the button
Button *mButton;
+ Button *mButton2;
+
// Will reset the text and integer input to the provided default
Button *mResetButton;