diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2005-02-27 02:27:46 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2005-02-27 02:27:46 +0000 |
commit | 2e4a8cf3a0f26d0b915621dc51f44c4883e6adc8 (patch) | |
tree | 91724709aebb953d97fa41a64b38e24bfe715966 /src/gui/chat.cpp | |
parent | d0aedbeaa22104f625483417bcb632a94e552a52 (diff) | |
download | mana-2e4a8cf3a0f26d0b915621dc51f44c4883e6adc8.tar.gz mana-2e4a8cf3a0f26d0b915621dc51f44c4883e6adc8.tar.bz2 mana-2e4a8cf3a0f26d0b915621dc51f44c4883e6adc8.tar.xz mana-2e4a8cf3a0f26d0b915621dc51f44c4883e6adc8.zip |
Speeches too long are now cut into pieces of 60 units. Still to test out more.
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r-- | src/gui/chat.cpp | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index ed1f74d6..e9046cb6 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -74,12 +74,41 @@ void ChatBox::chat_log(std::string line, int own) tmp.nick = ""; } tmp.own = own; - tmp.text = line; + + // A try to get text sentences no too long... + bool Finished = false; + while ( !Finished ) + { + std::string TempText; + if ( line.length() > 60 ) + { std::cout << "long" << std::endl; + + if ( line.length() > 60 ) + TempText = line.substr(0, 60); + else + TempText = line; + + tmp.text = TempText; + + //chatlog_file << tmp.nick << tmp.text << "\n"; + //chatlog_file.flush(); - chatlog_file << tmp.nick << tmp.text << "\n"; - chatlog_file.flush(); + chatlog.push_front(tmp); + + if ( line.length() > 60 ) + line = line.substr(60, line.length() - 60); + } + + else // Normal message + { std::cout << "Normal" << std::endl; + tmp.text = line; + //chatlog_file << tmp.nick << tmp.text << "\n"; + //chatlog_file.flush(); - chatlog.push_front(tmp); + chatlog.push_front(tmp); + Finished = true; + } + } } void ChatBox::chat_log(CHATSKILL action) { |