diff options
author | Roderic Morris <roderic@ccs.neu.edu> | 2008-06-03 16:29:11 +0000 |
---|---|---|
committer | Roderic Morris <roderic@ccs.neu.edu> | 2008-06-03 16:29:11 +0000 |
commit | 0fdbf1d62c1add8800ffc7171a1911e1e243ac2a (patch) | |
tree | c22e6d658d908d3050cfe3dd5970f356e28aa465 /src/gui | |
parent | d4e8401e55c7bc3f5c8545b66167e8c3bf3cd380 (diff) | |
download | mana-0fdbf1d62c1add8800ffc7171a1911e1e243ac2a.tar.gz mana-0fdbf1d62c1add8800ffc7171a1911e1e243ac2a.tar.bz2 mana-0fdbf1d62c1add8800ffc7171a1911e1e243ac2a.tar.xz mana-0fdbf1d62c1add8800ffc7171a1911e1e243ac2a.zip |
channel announcements and leave / enter messages, chat code refactoring
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/chat.cpp | 96 | ||||
-rw-r--r-- | src/gui/chat.h | 71 |
2 files changed, 2 insertions, 165 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 3748b31c..e7b82621 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -203,14 +203,6 @@ ChatWindow::chatLog(std::string line, int own, const std::string &channelName) scroll->logic(); } -#if 0 -void -ChatWindow::chatLog(CHATSKILL act) -{ - chatLog(const_msg(act), BY_SERVER); -} -#endif - void ChatWindow::action(const gcn::ActionEvent &event) { @@ -385,94 +377,6 @@ void ChatWindow::chatSend(std::string const &nick, std::string const &msg, } } -#if 0 -std::string -ChatWindow::const_msg(CHATSKILL act) -{ - std::string msg; - if (act.success == SKILL_FAILED && act.skill == SKILL_BASIC) { - switch (act.bskill) { - case BSKILL_TRADE : - msg = "Trade failed!"; - break; - case BSKILL_EMOTE : - msg = "Emote failed!"; - break; - case BSKILL_SIT : - msg = "Sit failed!"; - break; - case BSKILL_CREATECHAT : - msg = "Chat creating failed!"; - break; - case BSKILL_JOINPARTY : - msg = "Could not join party!"; - break; - case BSKILL_SHOUT : - msg = "Cannot shout!"; - break; - } - - switch (act.reason) { - case RFAIL_SKILLDEP : - msg += " You have not yet reached a high enough lvl!"; - break; - case RFAIL_INSUFHP : - msg += " Insufficient HP!"; - break; - case RFAIL_INSUFSP : - msg += " Insufficient SP!"; - break; - case RFAIL_NOMEMO : - msg += " You have no memos!"; - break; - case RFAIL_SKILLDELAY : - msg += " You cannot do that right now!"; - break; - case RFAIL_ZENY : - msg += " Seems you need more Zeny... ;-)"; - break; - case RFAIL_WEAPON : - msg += " You cannot use this skill with that kind of weapon!"; - break; - case RFAIL_REDGEM : - msg += " You need another red gem!"; - break; - case RFAIL_BLUEGEM : - msg += " You need another blue gem!"; - break; - case RFAIL_OVERWEIGHT : - msg += " You're carrying to much to do this!"; - break; - default : - msg += " Huh? What's that?"; - break; - } - } else { - switch(act.skill) { - case SKILL_WARP : - msg = "Warp failed..."; - break; - case SKILL_STEAL : - msg = "Could not steal anything..."; - break; - case SKILL_ENVENOM : - msg = "Poison had no effect..."; - break; - } - } - - return msg; -} -#endif - -void -ChatWindow::addChannel(short channelId, const std::string &channelName) -{ - Channel *channel = new Channel(channelId); - channel->setName(channelName); - channelManager->addChannel(channel); -} - void ChatWindow::removeChannel(short channelId) { diff --git a/src/gui/chat.h b/src/gui/chat.h index 26e30374..148feb7e 100644 --- a/src/gui/chat.h +++ b/src/gui/chat.h @@ -49,57 +49,6 @@ enum BY_LOGGER }; -#if 0 -/** - * gets in between usernick and message text depending on - * message type - */ -#define CAT_NORMAL ": " -#define CAT_IS "" -#define CAT_WHISPER " says: " - -/** job dependend identifiers (?) */ -#define SKILL_BASIC 0x0001 -#define SKILL_WARP 0x001b -#define SKILL_STEAL 0x0032 -#define SKILL_ENVENOM 0x0034 - -/** basic skills identifiers */ -#define BSKILL_TRADE 0x0000 -#define BSKILL_EMOTE 0x0001 -#define BSKILL_SIT 0x0002 -#define BSKILL_CREATECHAT 0x0003 -#define BSKILL_JOINPARTY 0x0004 -#define BSKILL_SHOUT 0x0005 -#define BSKILL_PK 0x0006 // ?? -#define BSKILL_SETALLIGN 0x0007 // ?? - -/** reasons why action failed */ -#define RFAIL_SKILLDEP 0x00 -#define RFAIL_INSUFHP 0x01 -#define RFAIL_INSUFSP 0x02 -#define RFAIL_NOMEMO 0x03 -#define RFAIL_SKILLDELAY 0x04 -#define RFAIL_ZENY 0x05 -#define RFAIL_WEAPON 0x06 -#define RFAIL_REDGEM 0x07 -#define RFAIL_BLUEGEM 0x08 -#define RFAIL_OVERWEIGHT 0x09 -#define RFAIL_GENERIC 0x0a - -/** should always be zero if failed */ -#define SKILL_FAILED 0x00 - -struct CHATSKILL -{ - short skill; - short bskill; - short unused; - char success; - char reason; -}; -#endif - /** * The chat window. * @@ -126,7 +75,7 @@ class ChatWindow : public Window, */ void widgetResized(const gcn::Event &event); - /* + /** * Adds a line of text to our message list. Parameters: * * @param line Text message. @@ -134,13 +83,6 @@ class ChatWindow : public Window, */ void chatLog(std::string line, int own, const std::string &channelName = "General"); -#if 0 - /* - * Calls original chat_log() after processing the packet. - */ - void chatLog(CHATSKILL); -#endif - /** * Performs action. */ @@ -156,7 +98,7 @@ class ChatWindow : public Window, */ bool isFocused(); - /* + /** * Determines whether to send a command or an ordinary message, then * contructs packets & sends them. * @@ -183,10 +125,6 @@ class ChatWindow : public Window, void chatSend(std::string const &nick, std::string const &msg, std::string const &channelName); - /** Called to add the channel to the channel manager */ - void - addChannel(short channel, const std::string &channelName); - /** Called to remove the channel from the channel manager */ void removeChannel(short channelId); @@ -251,11 +189,6 @@ class ChatWindow : public Window, ScrollArea *scroll; }; -#if 0 - /** Constructs failed messages for actions */ - std::string const_msg(CHATSKILL);*/ -#endif - /** Tabbed area for holding each channel. */ TabbedArea *mChatTabs; |