diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-31 18:29:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-31 18:29:12 +0300 |
commit | 0b1d9c0c58db75a1d4249f7b0fc3320b4de8cfa2 (patch) | |
tree | bfed7c73b8d63bcfaaa411e031bb5ab231807b72 | |
parent | 0249e0c48bfcac25abe46fbaf61103df0984b832 (diff) | |
download | manaverse-0b1d9c0c58db75a1d4249f7b0fc3320b4de8cfa2.tar.gz manaverse-0b1d9c0c58db75a1d4249f7b0fc3320b4de8cfa2.tar.bz2 manaverse-0b1d9c0c58db75a1d4249f7b0fc3320b4de8cfa2.tar.xz manaverse-0b1d9c0c58db75a1d4249f7b0fc3320b4de8cfa2.zip |
Move away message to per server configuration file.
-rw-r--r-- | src/being/localplayer.cpp | 5 | ||||
-rw-r--r-- | src/configuration.cpp | 1 | ||||
-rw-r--r-- | src/gamemodifiers.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_other.cpp | 3 |
4 files changed, 7 insertions, 4 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 33133a376..5153a57ed 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -1891,7 +1891,7 @@ void LocalPlayer::setAfkMessage(std::string message) { config.setValue("afkFormat", 0); } - config.setValue("afkMessage", message); + serverConfig.setValue("afkMessage", message); } } @@ -1909,7 +1909,8 @@ void LocalPlayer::afkRespond(ChatTab *const tab, const std::string &nick) if (mAfkTime == 0 || time < mAfkTime || time - mAfkTime > awayLimitTimer) { - std::string str(config.getStringValue("afkMessage")); + std::string str(serverConfig.getValue("afkMessage", + "I am away from keyboard.")); if (str.find("'NAME'") != std::string::npos) replaceAll(str, "'NAME'", nick); diff --git a/src/configuration.cpp b/src/configuration.cpp index b43dd88cf..bf9244bd5 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -48,6 +48,7 @@ Configuration paths; // XML default paths information reader const std::string unusedKeys[] = { + "afkmessage", "hideShield", "AttackRange", "emoteshortcut0", diff --git a/src/gamemodifiers.cpp b/src/gamemodifiers.cpp index e55c4060f..b55e662c6 100644 --- a/src/gamemodifiers.cpp +++ b/src/gamemodifiers.cpp @@ -446,7 +446,7 @@ void GameModifiers::changeAwayMode(const bool forward A_UNUSED) OkDialog *const dialog = CREATEWIDGETR(OkDialog, // TRANSLATORS: away message box header _("Away"), - config.getStringValue("afkMessage"), + serverConfig.getValue("afkMessage", "I am away from keyboard."), // TRANSLATORS: ok dialog button _("OK"), DialogType::SILENCE, diff --git a/src/gui/widgets/tabs/setup_other.cpp b/src/gui/widgets/tabs/setup_other.cpp index ca9a3230a..daf26f668 100644 --- a/src/gui/widgets/tabs/setup_other.cpp +++ b/src/gui/widgets/tabs/setup_other.cpp @@ -241,7 +241,7 @@ Setup_Other::Setup_Other(const Widget2 *const widget) : // TRANSLATORS: settings option new SetupItemTextField(_("Afk message"), "", - "afkMessage", this, "afkMessageEvent"); + "afkMessage", this, "afkMessageEvent", false); // TRANSLATORS: settings option new SetupItemCheckBox(_("Show job"), "", "showJob", @@ -443,4 +443,5 @@ void Setup_Other::externalUpdated() reread("showJob"); reread("enableGuildBot"); reread("enableBuggyServers"); + reread("afkMessage"); } |