diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-06-25 17:21:15 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-06-25 17:21:21 +0200 |
commit | cd6a29b5e50e26d03436e18e52fd0bb7a7f60bb9 (patch) | |
tree | 2ae355a8be3c231578144726aed5d18a9795a9b3 | |
parent | 581f56463f6ecf7d72d56106e3893aa549790144 (diff) | |
download | mana-cd6a29b5e50e26d03436e18e52fd0bb7a7f60bb9.tar.gz mana-cd6a29b5e50e26d03436e18e52fd0bb7a7f60bb9.tar.bz2 mana-cd6a29b5e50e26d03436e18e52fd0bb7a7f60bb9.tar.xz mana-cd6a29b5e50e26d03436e18e52fd0bb7a7f60bb9.zip |
Fixed spaces getting added to chat every 50 characters
This reverts part of 087babc2525ddb89e5b31f240a08739d9a3029a9.
It's unclear to me why big words should be split (chat window
force-wraps when necessary anyway) and it's causing issues by adding
spaces in the middle of links, for example.
-rw-r--r-- | src/gui/widgets/chattab.cpp | 25 | ||||
-rw-r--r-- | src/gui/widgets/chattab.h | 2 |
2 files changed, 2 insertions, 25 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index 5975684d..964c7eaf 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -46,8 +46,6 @@ #include <guichan/widgets/tabbedarea.hpp> -#define MAX_WORD_SIZE 50 - ChatTab::ChatTab(const std::string &name) { setCaption(name); @@ -226,12 +224,12 @@ void ChatTab::chatLog(std::string line, Own own, bool ignoreRecord) // at comparison. if (mScrollArea->getVerticalScrollAmount() >= mScrollArea->getVerticalMaxScroll()) { - addRow(line); + mTextOutput->addRow(line); mScrollArea->setVerticalScrollAmount(mScrollArea->getVerticalMaxScroll()); } else { - addRow(line); + mTextOutput->addRow(line); } mScrollArea->logic(); @@ -341,22 +339,3 @@ void ChatTab::saveToLogFile(std::string &msg) if (chatLogger) chatLogger->log(msg); } - -void ChatTab::addRow(std::string &line) -{ - std::string::size_type idx = 0; - - for (unsigned int f = 0; f < line.length(); f++) - { - if (line.at(f) == ' ') - { - idx = f; - } - else if (f - idx > MAX_WORD_SIZE) - { - line.insert(f, " "); - idx = f; - } - } - mTextOutput->addRow(line); -} diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h index 3d19a9ad..3e770fe1 100644 --- a/src/gui/widgets/chattab.h +++ b/src/gui/widgets/chattab.h @@ -129,8 +129,6 @@ class ChatTab : public Tab, public AutoCompleteLister, public EventListener */ void updateTextFormat(int alpha); - void addRow(std::string &line); - ScrollArea *mScrollArea; BrowserBox *mTextOutput; //Recorder *mRecorder; |