diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-18 22:33:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-04-18 22:33:28 +0300 |
commit | 71ba93abb9436eabc9fed8e4e49ab5cdee47bb38 (patch) | |
tree | 87f9fc99f15d84a8a63b3fbc68950650f9ebc0ed /src/gui/chatwindow.cpp | |
parent | bc39b3c006145c6db41e7fcfac9da512944774f3 (diff) | |
download | manaverse-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.tar.gz manaverse-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.tar.bz2 manaverse-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.tar.xz manaverse-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.zip |
Impliment away log in away mode.
Diffstat (limited to 'src/gui/chatwindow.cpp')
-rw-r--r-- | src/gui/chatwindow.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 372461b29..472c2b531 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -1470,3 +1470,29 @@ void ChatWindow::loadCustomList() listFile.close(); } } + +void ChatWindow::addToAwayLog(std::string line) +{ + if (!player_node || !player_node->getAwayMode()) + return; + + if (mAwayLog.size() > 20) + mAwayLog.pop_front(); + + if (line.find(player_node->getName()) != std::string::npos) + mAwayLog.push_back("##9away:" + line); +} + +void ChatWindow::displayAwayLog() +{ + if (!localChatTab) + return; + + std::list<std::string>::iterator i = mAwayLog.begin(); + + while (i != mAwayLog.end()) + { + localChatTab->addNewRow(*i); + ++i; + } +} |