summaryrefslogtreecommitdiff
path: root/src/gui/chatwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-04 20:05:48 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-04 20:05:48 +0300
commit62ec17f6e489ec50f17219444468aeb8969dc961 (patch)
tree350d7edb5c26c282a4e1906544536d68831228ac /src/gui/chatwindow.cpp
parent71d924d7dcdac067f02a317e9353ee067dbd0bde (diff)
parentfd484fc70fca32ff9065b91c175089b65aa3fd26 (diff)
downloadplus-62ec17f6e489ec50f17219444468aeb8969dc961.tar.gz
plus-62ec17f6e489ec50f17219444468aeb8969dc961.tar.bz2
plus-62ec17f6e489ec50f17219444468aeb8969dc961.tar.xz
plus-62ec17f6e489ec50f17219444468aeb8969dc961.zip
Merge branch 'master' into strippedstripped1.1.9.4
Conflicts: data/fonts/mplus-1p-bold.ttf data/fonts/mplus-1p-regular.ttf src/guichan/basiccontainer.cpp src/guichan/include/guichan/basiccontainer.hpp src/guichan/widgets/window.cpp
Diffstat (limited to 'src/gui/chatwindow.cpp')
-rw-r--r--src/gui/chatwindow.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index 1ef3139db..784fb812a 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -167,6 +167,8 @@ ChatWindow::ChatWindow():
setResizable(true);
setDefaultVisible(true);
setSaveVisible(true);
+ setStickyButtonLock(true);
+
setDefaultSize(600, 123, ImageRect::LOWER_LEFT);
setMinWidth(150);
setMinHeight(90);
@@ -211,6 +213,7 @@ ChatWindow::ChatWindow():
fillCommands();
initTradeFilter();
loadCustomList();
+ parseHighlights();
}
ChatWindow::~ChatWindow()
@@ -659,7 +662,7 @@ void ChatWindow::mouseDragged(gcn::MouseEvent &event)
if (event.isConsumed())
return;
- if (isMovable() && mMoved)
+ if (canMove() && isMovable() && mMoved)
{
int newX = std::max(0, getX() + event.getX() - mDragOffsetX);
int newY = std::max(0, getY() + event.getY() - mDragOffsetY);
@@ -1458,12 +1461,8 @@ void ChatWindow::saveState()
std::string ChatWindow::doReplace(const std::string &msg)
{
- if (Client::getServerName() == "server.themanaworld.org"
- || Client::getServerName() == "themanaworld.org"
- || Client::getServerName() == "81.161.192.4")
- {
+ if (Client::isTmw())
return msg;
- }
std::string str = msg;
replaceSpecialChars(str);
@@ -1503,7 +1502,7 @@ void ChatWindow::addToAwayLog(std::string line)
if (mAwayLog.size() > 20)
mAwayLog.pop_front();
- if (line.find(player_node->getName()) != std::string::npos)
+ if (findI(line, mHighlights) != std::string::npos)
mAwayLog.push_back("##9away:" + line);
}
@@ -1520,3 +1519,20 @@ void ChatWindow::displayAwayLog()
++i;
}
}
+
+void ChatWindow::parseHighlights()
+{
+ mHighlights.clear();
+ if (!player_node)
+ return;
+
+ splitToStringVector(mHighlights, config.getStringValue(
+ "highlightWords"), ',');
+
+ mHighlights.push_back(player_node->getName());
+}
+
+bool ChatWindow::findHighlight(std::string &str)
+{
+ return findI(str, mHighlights) != std::string::npos;
+} \ No newline at end of file