summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-24 20:20:20 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-24 20:20:20 +0300
commit8d9174b86d85474f3ebd6314232864c8d0c575ce (patch)
tree8f88622653bc0f36dcd9d5b32616d722a80f0ba1
parent008209179885ab96ad37252d2b4201eff0aca437 (diff)
downloadmv-8d9174b86d85474f3ebd6314232864c8d0c575ce.tar.gz
mv-8d9174b86d85474f3ebd6314232864c8d0c575ce.tar.bz2
mv-8d9174b86d85474f3ebd6314232864c8d0c575ce.tar.xz
mv-8d9174b86d85474f3ebd6314232864c8d0c575ce.zip
add option to show motd message.
Disabled by default.
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_chat.cpp4
-rw-r--r--src/net/ea/chathandler.cpp8
-rw-r--r--src/net/ea/chathandler.h1
-rw-r--r--src/net/eathena/chathandler.cpp3
-rw-r--r--src/net/tmwa/chathandler.cpp3
6 files changed, 12 insertions, 8 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 9e6716517..0b71b1db7 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -344,6 +344,7 @@ DefaultsData* getConfigDefaults()
AddDEF("inventorySortOrder", 0);
AddDEF("storageSortOrder", 0);
AddDEF("buySortOrder", 0);
+ AddDEF("showmotd", false);
return configData;
}
diff --git a/src/gui/widgets/tabs/setup_chat.cpp b/src/gui/widgets/tabs/setup_chat.cpp
index 121886830..99b470a2c 100644
--- a/src/gui/widgets/tabs/setup_chat.cpp
+++ b/src/gui/widgets/tabs/setup_chat.cpp
@@ -191,6 +191,10 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) :
new SetupItemCheckBox(_("Show emotes button in chat"), "",
"showEmotesButton", this, "showEmotesButtonEvent");
+ // TRANSLATORS: settings option
+ new SetupItemCheckBox(_("Show motd server message on start"), "",
+ "showmotd", this, "showmotdEvent");
+
setDimension(gcn::Rectangle(0, 0, 550, 350));
}
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp
index 90c6be5bc..deaef6984 100644
--- a/src/net/ea/chathandler.cpp
+++ b/src/net/ea/chathandler.cpp
@@ -47,7 +47,8 @@ namespace Ea
ChatHandler::ChatHandler() :
mSentWhispers(),
- mShowAllLang(serverConfig.getValue("showAllLang", 0))
+ mShowAllLang(serverConfig.getValue("showAllLang", 0)),
+ mShowMotd(config.getBoolValue("showmotd"))
{
}
@@ -355,7 +356,10 @@ void ChatHandler::processChat(Net::MessageIn &msg, const bool normalChat,
trim(chatMsg);
if (player_node)
- player_node->setSpeech(chatMsg, channel);
+ {
+ if (chatWindow || mShowMotd)
+ player_node->setSpeech(chatMsg, channel);
+ }
}
else if (localChatTab)
{
diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h
index 124cc41fb..3f0e054a5 100644
--- a/src/net/ea/chathandler.h
+++ b/src/net/ea/chathandler.h
@@ -59,6 +59,7 @@ class ChatHandler : public Net::ChatHandler
typedef std::queue<std::string> WhisperQueue;
WhisperQueue mSentWhispers;
bool mShowAllLang;
+ bool mShowMotd;
};
} // namespace Ea
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index d8b75bfe6..53b98f6a9 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -58,9 +58,6 @@ ChatHandler::ChatHandler() :
void ChatHandler::handleMessage(Net::MessageIn &msg)
{
- if (!localChatTab)
- return;
-
switch (msg.getId())
{
case SMSG_WHISPER_RESPONSE:
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index 833e8d4b7..164b0ddc3 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -62,9 +62,6 @@ ChatHandler::ChatHandler() :
void ChatHandler::handleMessage(Net::MessageIn &msg)
{
- if (!localChatTab)
- return;
-
BLOCK_START("ChatHandler::handleMessage")
switch (msg.getId())
{