summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-19 00:43:41 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-19 00:43:41 +0300
commit2a09c2afe8bd1f476ef1901c9c639896534a081c (patch)
tree89a87faffaf2792cae734c97a1eb01772b996d70 /src
parente63b10c3a63d93b9a6dfa144624fea8610d7768c (diff)
downloadmv-2a09c2afe8bd1f476ef1901c9c639896534a081c.tar.gz
mv-2a09c2afe8bd1f476ef1901c9c639896534a081c.tar.bz2
mv-2a09c2afe8bd1f476ef1901c9c639896534a081c.tar.xz
mv-2a09c2afe8bd1f476ef1901c9c639896534a081c.zip
Add option to enable/disable gm tab.
Enabled by default.
Diffstat (limited to 'src')
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/game.cpp5
-rw-r--r--src/gui/setup_chat.cpp3
-rw-r--r--src/localplayer.cpp2
4 files changed, 9 insertions, 2 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 4c71b36bc..083c9a118 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -306,6 +306,7 @@ DefaultsData* getConfigDefaults()
AddDEF("screenButtonsFormat", 0);
AddDEF("autoresizeminimaps", false);
AddDEF("showGuildOnline", false);
+ AddDEF("enableGmTab", true);
return configData;
}
diff --git a/src/game.cpp b/src/game.cpp
index 798d6010b..c9f12fc66 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -280,8 +280,11 @@ static void createGuiWindows()
battleChatTab = nullptr;
}
- if (player_node && !gmChatTab && player_node->getGMLevel() > 0)
+ if (player_node && !gmChatTab && config.getBoolValue("enableGmTab")
+ && player_node->getGMLevel() > 0)
+ {
gmChatTab = new GmTab(chatWindow);
+ }
if (config.getBoolValue("logToChat"))
logger->setChatWindow(chatWindow);
diff --git a/src/gui/setup_chat.cpp b/src/gui/setup_chat.cpp
index bb0ab0096..63777a9a5 100644
--- a/src/gui/setup_chat.cpp
+++ b/src/gui/setup_chat.cpp
@@ -116,6 +116,9 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) :
new SetupItemCheckBox(_("Enable trade tab"), "",
"enableTradeTab", this, "enableTradeTabEvent");
+ new SetupItemCheckBox(_("Enable gm tab"), "",
+ "enableGmTab", this, "enableGmTabEvent");
+
new SetupItemCheckBox(_("Enable battle tab"), "",
"enableBattleTab", this, "enableBattleTabEvent");
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 43c15428a..003bf4133 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -395,7 +395,7 @@ void LocalPlayer::setGMLevel(const int level)
if (chatWindow)
{
chatWindow->loadGMCommands();
- if (!gmChatTab)
+ if (!gmChatTab && config.getBoolValue("enableGmTab"))
gmChatTab = new GmTab(chatWindow);
}
}