summaryrefslogtreecommitdiff
path: root/src/gui/npcdialog.cpp
diff options
context:
space:
mode:
authorAngelo Castellani <udp.castellani@gmail.com>2011-05-22 19:07:41 -0400
committerStefan Dombrowski <stefan@uni-bonn.de>2011-05-25 19:34:25 +0200
commitb02081c00450d274c23b7198620ee7748756bd72 (patch)
treeaadc24f7ce866f916fb24b940eaf1f1db8ea8e88 /src/gui/npcdialog.cpp
parent6d9936d160b197fe68c5bb21972b197fb1b64ba4 (diff)
downloadmana-client-b02081c00450d274c23b7198620ee7748756bd72.tar.gz
mana-client-b02081c00450d274c23b7198620ee7748756bd72.tar.bz2
mana-client-b02081c00450d274c23b7198620ee7748756bd72.tar.xz
mana-client-b02081c00450d274c23b7198620ee7748756bd72.zip
Added more double clickable actions
- double clicking a do_choice item submits it - double clicking the npc chat will hit 'next' - double click to buy/sell a single item - clicking on no item in the inventory now deselects - double click to use/activate items in inventory
Diffstat (limited to 'src/gui/npcdialog.cpp')
-rw-r--r--src/gui/npcdialog.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp
index bb508184..5209d69b 100644
--- a/src/gui/npcdialog.cpp
+++ b/src/gui/npcdialog.cpp
@@ -21,6 +21,7 @@
#include "gui/npcdialog.h"
+#include "client.h"
#include "configuration.h"
#include "event.h"
#include "eventlistener.h"
@@ -399,6 +400,20 @@ void NpcDialog::event(Event::Channel channel, const Event &event)
}
}
+void NpcDialog::mouseClicked(gcn::MouseEvent &mouseEvent)
+{
+ if (mouseEvent.getSource() == mItemList &&
+ isDoubleClick(mItemList->getSelected()))
+ {
+ action(gcn::ActionEvent(mButton, mButton->getActionEventId()));
+ }
+ if (mouseEvent.getSource() == mTextBox && isDoubleClick((int)mTextBox))
+ {
+ if (mActionState == NPC_ACTION_NEXT || mActionState == NPC_ACTION_CLOSE)
+ action(gcn::ActionEvent(mButton, mButton->getActionEventId()));
+ }
+}
+
NpcDialog *NpcDialog::getActive()
{
if (instances.size() == 1)