summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-12-11 19:10:19 +0300
committerAndrei Karas <akaras@inbox.ru>2017-12-11 19:10:19 +0300
commitee1fc0b63cb7f27df85c43474497b805df6e31f5 (patch)
treed233f17e1bfd751b6939646a24f1253ae8d14796 /src/gui
parenta80f4ac5c1c3ef4d3ac5f026591b16074d0bf451 (diff)
downloadmv-ee1fc0b63cb7f27df85c43474497b805df6e31f5.tar.gz
mv-ee1fc0b63cb7f27df85c43474497b805df6e31f5.tar.bz2
mv-ee1fc0b63cb7f27df85c43474497b805df6e31f5.tar.xz
mv-ee1fc0b63cb7f27df85c43474497b805df6e31f5.zip
Remove default parameters from ChatTab::chatLog.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/tabs/chat/chattab.cpp8
-rw-r--r--src/gui/widgets/tabs/chat/chattab.h12
-rw-r--r--src/gui/widgets/tabs/socialguildtab.h8
-rw-r--r--src/gui/widgets/tabs/socialpartytab.h8
-rw-r--r--src/gui/windows/chatwindow.cpp56
-rw-r--r--src/gui/windows/socialwindow.cpp38
-rw-r--r--src/gui/windows/tradewindow.cpp12
7 files changed, 109 insertions, 33 deletions
diff --git a/src/gui/widgets/tabs/chat/chattab.cpp b/src/gui/widgets/tabs/chat/chattab.cpp
index e4f6d751a..3fc6fb252 100644
--- a/src/gui/widgets/tabs/chat/chattab.cpp
+++ b/src/gui/widgets/tabs/chat/chattab.cpp
@@ -552,12 +552,16 @@ void ChatTab::showOnline(const std::string &nick,
{
// TRANSLATORS: chat message
chatLog(strprintf(_("%s is now Online."), nick.c_str()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
else
{
// TRANSLATORS: chat message
chatLog(strprintf(_("%s is now Offline."), nick.c_str()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
}
diff --git a/src/gui/widgets/tabs/chat/chattab.h b/src/gui/widgets/tabs/chat/chattab.h
index 440501af4..6e51ca172 100644
--- a/src/gui/widgets/tabs/chat/chattab.h
+++ b/src/gui/widgets/tabs/chat/chattab.h
@@ -40,7 +40,12 @@ class ScrollArea;
#define debugMsg(str) \
if (debugChatTab) \
- debugChatTab->chatLog(str, ChatMsgType::BY_SERVER);
+ { \
+ debugChatTab->chatLog(str, \
+ ChatMsgType::BY_SERVER, \
+ IgnoreRecord_false, \
+ TryRemoveColors_true); \
+ }
#define setTabColors(name) \
setTabColor(&getThemeColor(name), \
@@ -79,9 +84,8 @@ class ChatTab notfinal : public Tab
*/
void chatLog(std::string line,
ChatMsgTypeT own,
- const IgnoreRecord ignoreRecord = IgnoreRecord_false,
- const TryRemoveColors tryRemoveColors
- = TryRemoveColors_true);
+ const IgnoreRecord ignoreRecord,
+ const TryRemoveColors tryRemoveColors);
/**
* Adds the text to the message list
diff --git a/src/gui/widgets/tabs/socialguildtab.h b/src/gui/widgets/tabs/socialguildtab.h
index 8652a54fe..b2ea74d10 100644
--- a/src/gui/widgets/tabs/socialguildtab.h
+++ b/src/gui/widgets/tabs/socialguildtab.h
@@ -86,7 +86,9 @@ class SocialGuildTab final : public SocialTab,
_("Invited user %s to guild %s."),
name.c_str(),
mGuild->getName().c_str()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
mInviteDialog = nullptr;
}
@@ -103,7 +105,9 @@ class SocialGuildTab final : public SocialTab,
// TRANSLATORS: chat message
_("Guild %s quit requested."),
mGuild->getName().c_str()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
mConfirmDialog = nullptr;
}
diff --git a/src/gui/widgets/tabs/socialpartytab.h b/src/gui/widgets/tabs/socialpartytab.h
index d7f22c1f7..d3ed6d9d8 100644
--- a/src/gui/widgets/tabs/socialpartytab.h
+++ b/src/gui/widgets/tabs/socialpartytab.h
@@ -87,7 +87,9 @@ class SocialPartyTab final : public SocialTab,
// TRANSLATORS: chat message
_("Invited user %s to party."),
name.c_str()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
mInviteDialog = nullptr;
}
@@ -104,7 +106,9 @@ class SocialPartyTab final : public SocialTab,
// TRANSLATORS: tab in social window
_("Party %s quit requested."),
mParty->getName().c_str()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
mConfirmDialog = nullptr;
}
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index aa899202d..2afbe7caf 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -716,7 +716,10 @@ void ChatWindow::doPresent() const
// TRANSLATORS: chat message
_("Present: %s; %d players are present."),
response.c_str(), playercount);
- tab->chatLog(log, ChatMsgType::BY_SERVER);
+ tab->chatLog(log,
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
}
@@ -1018,7 +1021,9 @@ void ChatWindow::attributeChanged(const AttributesT id,
{
battleChatLog(std::string("+").append(toString(
CAST_U64(change))).append(" xp"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
break;
}
@@ -1026,7 +1031,9 @@ void ChatWindow::attributeChanged(const AttributesT id,
battleChatLog(std::string(
"Level: ").append(toString(CAST_S32(
newVal))),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
break;
case Attributes::PLAYER_JOB_EXP:
{
@@ -1043,7 +1050,9 @@ void ChatWindow::attributeChanged(const AttributesT id,
{
battleChatLog(std::string("+").append(toString(CAST_U64(
change))).append(" job"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
break;
}
@@ -1126,7 +1135,10 @@ void ChatWindow::addWhisper(const std::string &restrict nick,
}
else if (own == ChatMsgType::BY_SERVER)
{
- tab->chatLog(mes, ChatMsgType::BY_SERVER);
+ tab->chatLog(mes,
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
else
{
@@ -1149,7 +1161,10 @@ void ChatWindow::addWhisper(const std::string &restrict nick,
{
if (config.getBoolValue("removeColors"))
msg = removeColors(msg);
- tab->chatLog(msg, ChatMsgType::BY_SERVER);
+ tab->chatLog(msg,
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
}
else
@@ -1168,14 +1183,17 @@ void ChatWindow::addWhisper(const std::string &restrict nick,
// TRANSLATORS: chat message
localChatTab->chatLog(strprintf(_("Whispering to %s: %s"),
nick.c_str(), mes.c_str()),
- ChatMsgType::BY_PLAYER);
+ ChatMsgType::BY_PLAYER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
else
{
localChatTab->chatLog(std::string(nick).append(
" : ").append(mes),
ChatMsgType::ACT_WHISPER,
- IgnoreRecord_false);
+ IgnoreRecord_false,
+ TryRemoveColors_true);
if (localPlayer != nullptr)
localPlayer->afkRespond(nullptr, nick);
}
@@ -1694,7 +1712,10 @@ bool ChatWindow::resortChatLog(std::string line,
{
if (langChatTab->getChannelName() == channel)
{
- langChatTab->chatLog(line, own, ignoreRecord, tryRemoveColors);
+ langChatTab->chatLog(line,
+ own,
+ ignoreRecord,
+ tryRemoveColors);
}
else if (mShowAllLang)
{
@@ -2118,11 +2139,17 @@ void ChatWindow::addGlobalMessage(const std::string &line)
if (debugChatTab != nullptr &&
findI(line, mGlobalsFilter) != std::string::npos)
{
- debugChatTab->chatLog(line, ChatMsgType::BY_OTHER);
+ debugChatTab->chatLog(line,
+ ChatMsgType::BY_OTHER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
else
{
- localChatTab->chatLog(line, ChatMsgType::BY_GM);
+ localChatTab->chatLog(line,
+ ChatMsgType::BY_GM,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
}
@@ -2134,7 +2161,12 @@ bool ChatWindow::isTabPresent(const ChatTab *const tab) const
void ChatWindow::debugMessage(const std::string &msg)
{
if (debugChatTab != nullptr)
- debugChatTab->chatLog(msg, ChatMsgType::BY_SERVER);
+ {
+ debugChatTab->chatLog(msg,
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
+ }
}
void ChatWindow::showGMTab()
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp
index 174762100..cbdf1d68d 100644
--- a/src/gui/windows/socialwindow.cpp
+++ b/src/gui/windows/socialwindow.cpp
@@ -276,7 +276,9 @@ void SocialWindow::action(const ActionEvent &event)
// TRANSLATORS: chat message
strprintf(_("Accepted party invite from %s."),
mPartyInviter.c_str()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
partyHandler->inviteResponse(mPartyId, true);
}
@@ -288,7 +290,9 @@ void SocialWindow::action(const ActionEvent &event)
// TRANSLATORS: chat message
strprintf(_("Rejected party invite from %s."),
mPartyInviter.c_str()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
partyHandler->inviteResponse(mPartyId, false);
}
@@ -306,7 +310,9 @@ void SocialWindow::action(const ActionEvent &event)
// TRANSLATORS: chat message
strprintf(_("Accepted guild invite from %s."),
mPartyInviter.c_str()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
#ifdef TMWA_SUPPORT
if (guildManager == nullptr || !GuildManager::getEnableGuildBot())
@@ -326,7 +332,9 @@ void SocialWindow::action(const ActionEvent &event)
// TRANSLATORS: chat message
strprintf(_("Rejected guild invite from %s."),
mPartyInviter.c_str()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
#ifdef TMWA_SUPPORT
if (guildManager == nullptr || !GuildManager::getEnableGuildBot())
@@ -384,7 +392,9 @@ void SocialWindow::showGuildInvite(const std::string &restrict guildName,
// TRANSLATORS: chat message
localChatTab->chatLog(_("Received guild request, but one already "
"exists."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return;
}
@@ -395,7 +405,12 @@ void SocialWindow::showGuildInvite(const std::string &restrict guildName,
inviterName.c_str(), guildName.c_str());
if (localChatTab != nullptr)
- localChatTab->chatLog(msg, ChatMsgType::BY_SERVER);
+ {
+ localChatTab->chatLog(msg,
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
+ }
CREATEWIDGETV(mGuildAcceptDialog, ConfirmDialog,
// TRANSLATORS: guild invite message
@@ -421,7 +436,9 @@ void SocialWindow::showPartyInvite(const std::string &restrict partyName,
// TRANSLATORS: chat message
localChatTab->chatLog(_("Received party request, but one already "
"exists."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return;
}
@@ -458,7 +475,12 @@ void SocialWindow::showPartyInvite(const std::string &restrict partyName,
}
if (localChatTab != nullptr)
- localChatTab->chatLog(msg, ChatMsgType::BY_SERVER);
+ {
+ localChatTab->chatLog(msg,
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
+ }
// show invite
CREATEWIDGETV(mPartyAcceptDialog, ConfirmDialog,
diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp
index 66f4e0550..bd8ba020f 100644
--- a/src/gui/windows/tradewindow.cpp
+++ b/src/gui/windows/tradewindow.cpp
@@ -438,7 +438,9 @@ void TradeWindow::action(const ActionEvent &event)
{
// TRANSLATORS: trade error
localChatTab->chatLog(_("You don't have enough money."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
v = curMoney;
}
@@ -528,7 +530,9 @@ bool TradeWindow::checkItem(const Item *const item) const
// TRANSLATORS: trade error
localChatTab->chatLog(_("Failed adding item. You can not "
"overlap one kind of item on the window."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return false;
}
@@ -540,7 +544,9 @@ bool TradeWindow::checkItem(const Item *const item) const
localChatTab->chatLog(
// TRANSLATORS: trade error
_("Failed adding item. You can not trade equipped items."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return false;
}