summaryrefslogtreecommitdiff
path: root/src/localplayer.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2010-04-19 20:05:35 +0300
committerBertram <yohanndotferreiraatorange.fr>2010-04-19 23:19:03 +0200
commit959708c60c119e03183ba97177f13e92d61e342c (patch)
tree86c8803ed1751dcf84a4feec9c05e47a695f78d8 /src/localplayer.h
parentd5390fa51b47cc70052902301ade7d137eff9d61 (diff)
downloadmana-client-959708c60c119e03183ba97177f13e92d61e342c.tar.gz
mana-client-959708c60c119e03183ba97177f13e92d61e342c.tar.bz2
mana-client-959708c60c119e03183ba97177f13e92d61e342c.tar.xz
mana-client-959708c60c119e03183ba97177f13e92d61e342c.zip
Add afk mode for player.
Add variable cur_time for current time. Add command /away [text] Reviewed by: Bertram
Diffstat (limited to 'src/localplayer.h')
-rw-r--r--src/localplayer.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/localplayer.h b/src/localplayer.h
index dd7b94d4..2c06dfb5 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -26,15 +26,19 @@
#include "gui/userpalette.h"
+#include <guichan/actionlistener.hpp>
+
#include <memory>
#include <vector>
+class ChatTab;
class Equipment;
class FloorItem;
class ImageSet;
class Inventory;
class Item;
class Map;
+class OkDialog;
struct Special
@@ -44,6 +48,12 @@ struct Special
int recharge;
};
+class AwayListener : public gcn::ActionListener
+{
+ public:
+ void action(const gcn::ActionEvent &event);
+};
+
/**
* Attributes used during combat. Available to all the beings.
@@ -352,6 +362,15 @@ class LocalPlayer : public Player
bool isPathSetByMouse() const
{ return mPathSetByMouse; }
+ void changeAwayMode();
+
+ bool getAwayMode()
+ { return mAwayMode; }
+
+ void setAway(const std::string &message);
+
+ void afkRespond(ChatTab *tab, const std::string &nick);
+
void addMessageToQueue(const std::string &message,
int color = UserPalette::EXP_INFO);
@@ -480,6 +499,11 @@ class LocalPlayer : public Player
/** Queued exp messages*/
std::list<MessagePair> mMessages;
int mMessageTime;
+ AwayListener *mAwayListener;
+ OkDialog *mAwayDialog;
+
+ int mAfkTime;
+ bool mAwayMode;
};
extern LocalPlayer *player_node;