summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}
}