From 2a09c2afe8bd1f476ef1901c9c639896534a081c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 19 Feb 2013 00:43:41 +0300 Subject: Add option to enable/disable gm tab. Enabled by default. --- src/defaults.cpp | 1 + src/game.cpp | 5 ++++- src/gui/setup_chat.cpp | 3 +++ src/localplayer.cpp | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') 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); } } -- cgit v1.2.3-70-g09d2