diff options
author | Reid <reidyaro@gmail.com> | 2012-01-30 15:27:30 +0100 |
---|---|---|
committer | Reid <reidyaro@gmail.com> | 2012-01-30 15:27:30 +0100 |
commit | 502a0a0163e702af7334979a2eabfc4826a94091 (patch) | |
tree | 5e80ef76585b1718d7e74a411117c725fe3cb0e9 /src/gui/whoisonline.h | |
parent | 8dea62750ab3a44e0f35f2543bbb6ccf2a9470ce (diff) | |
parent | 193ea898e5f549c14c0e4cd0d060785de4fb4bcf (diff) | |
download | plus-502a0a0163e702af7334979a2eabfc4826a94091.tar.gz plus-502a0a0163e702af7334979a2eabfc4826a94091.tar.bz2 plus-502a0a0163e702af7334979a2eabfc4826a94091.tar.xz plus-502a0a0163e702af7334979a2eabfc4826a94091.zip |
Merge branch 'master' of gitorious.org:manaplus/manaplus
Diffstat (limited to 'src/gui/whoisonline.h')
-rw-r--r-- | src/gui/whoisonline.h | 68 |
1 files changed, 60 insertions, 8 deletions
diff --git a/src/gui/whoisonline.h b/src/gui/whoisonline.h index ade391d5a..d2f0c30d0 100644 --- a/src/gui/whoisonline.h +++ b/src/gui/whoisonline.h @@ -42,6 +42,54 @@ class ScrollArea; struct SDL_Thread; +class OnlinePlayer +{ + public: + OnlinePlayer(std::string nick, unsigned char status, + char level, unsigned char gender, char version) : + mNick(nick), + mText(""), + mStatus(status), + mLevel(level), + mVersion(version), + mGender(gender) + { + } + + const std::string getNick() const + { return mNick; } + + unsigned char getStaus() const + { return mStatus; } + + char getVersion() const + { return mVersion; } + + char getLevel() const + { return mLevel; } + + const std::string getText() + { return mText; } + + void setText(std::string str); + + void setLevel(char level) + { mLevel = level; } + + private: + std::string mNick; + + std::string mText; + + unsigned char mStatus; + + char mLevel; + + char mVersion; + + unsigned char mGender; +}; + /** * Update progress window GUI * @@ -52,7 +100,7 @@ class WhoIsOnline : public Window, public gcn::ActionListener, public ConfigListener { - public: +public: /** * Constructor. */ @@ -68,7 +116,7 @@ class WhoIsOnline : public Window, */ void loadWebList(); - void loadList(std::vector<std::string> &list); + void loadList(std::vector<OnlinePlayer*> &list); void handleLink(const std::string& link, gcn::MouseEvent *event); @@ -78,9 +126,12 @@ class WhoIsOnline : public Window, void widgetResized(const gcn::Event &event); - std::set<std::string> &getOnlinePlayers() + const std::set<OnlinePlayer*> &getOnlinePlayers() { return mOnlinePlayers; } + const std::set<std::string> &getOnlineNicks() + { return mOnlineNicks; } + void setAllowUpdate(bool n) { mAllowUpdate = n; } @@ -109,10 +160,10 @@ private: const std::string prepareNick(std::string nick, int level, std::string color) const; - void updateWindow(std::vector<std::string> &friends, - std::vector<std::string> &neutral, - std::vector<std::string> &disregard, - std::vector<std::string> enemy, + void updateWindow(std::vector<OnlinePlayer*> &friends, + std::vector<OnlinePlayer*> &neutral, + std::vector<OnlinePlayer*> &disregard, + std::vector<OnlinePlayer*> enemy, int numOnline); enum DownloadStatus @@ -143,7 +194,8 @@ private: BrowserBox *mBrowserBox; ScrollArea *mScrollArea; time_t mUpdateTimer; - std::set<std::string> mOnlinePlayers; + std::set<OnlinePlayer*> mOnlinePlayers; + std::set<std::string> mOnlineNicks; gcn::Button *mUpdateButton; bool mAllowUpdate; |