diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-02-19 00:30:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-02-19 00:30:24 +0300 |
commit | e63b10c3a63d93b9a6dfa144624fea8610d7768c (patch) | |
tree | 2c537174bb2134ea7b58cbaa6f648c2acd7a8006 | |
parent | e73c5ecc896c14fa43b19e42e5b24c79766cdb44 (diff) | |
download | manaplus-e63b10c3a63d93b9a6dfa144624fea8610d7768c.tar.gz manaplus-e63b10c3a63d93b9a6dfa144624fea8610d7768c.tar.bz2 manaplus-e63b10c3a63d93b9a6dfa144624fea8610d7768c.tar.xz manaplus-e63b10c3a63d93b9a6dfa144624fea8610d7768c.zip |
Add support for GM tab.
This tab visible all messages from @wgm chat command and
local messages in this tab.
-rw-r--r-- | data/graphics/gui/colors.xml | 3 | ||||
-rw-r--r-- | data/themes/blacknblack/colors.xml | 3 | ||||
-rw-r--r-- | data/themes/blackwood/colors.xml | 3 | ||||
-rw-r--r-- | data/themes/enchilado/colors.xml | 3 | ||||
-rw-r--r-- | data/themes/jewelry/colors.xml | 9 | ||||
-rw-r--r-- | data/themes/mana/colors.xml | 3 | ||||
-rw-r--r-- | data/themes/pink/colors.xml | 3 | ||||
-rw-r--r-- | data/themes/unity/colors.xml | 3 | ||||
-rw-r--r-- | data/themes/wood/colors.xml | 3 | ||||
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/game.cpp | 6 | ||||
-rw-r--r-- | src/gui/theme.cpp | 6 | ||||
-rw-r--r-- | src/gui/theme.h | 6 | ||||
-rw-r--r-- | src/gui/widgets/chattab.h | 3 | ||||
-rw-r--r-- | src/localplayer.cpp | 6 | ||||
-rw-r--r-- | src/net/ea/chathandler.cpp | 20 |
17 files changed, 81 insertions, 3 deletions
diff --git a/data/graphics/gui/colors.xml b/data/graphics/gui/colors.xml index 1efa2a6a4..95f1e66a3 100644 --- a/data/graphics/gui/colors.xml +++ b/data/graphics/gui/colors.xml @@ -30,14 +30,17 @@ <color id="PARTY_SOCIAL_TAB" color="#d06030" /> <color id="GUILD_CHAT_TAB" color="#d06030" /> <color id="GUILD_SOCIAL_TAB" color="#d06030" /> + <color id="GM_CHAT_TAB" color="#d06030" /> <color id="PARTY_CHAT_TAB_HIGHLIGHTED" color="#d06030" /> <color id="PARTY_SOCIAL_TAB_HIGHLIGHTED" color="#d06030" /> <color id="GUILD_CHAT_TAB_HIGHLIGHTED" color="#d06030" /> <color id="GUILD_SOCIAL_TAB_HIGHLIGHTED" color="#d06030" /> + <color id="GM_CHAT_TAB_HIGHLIGHTED" color="#d06030" /> <color id="PARTY_CHAT_TAB_SELECTED" color="#d06030" /> <color id="PARTY_SOCIAL_TAB_SELECTED" color="#d06030" /> <color id="GUILD_CHAT_TAB_SELECTED" color="#d06030" /> <color id="GUILD_SOCIAL_TAB_SELECTED" color="#d06030" /> + <color id="GM_CHAT_TAB_SELECTED" color="#d06030" /> <color id="BACKGROUND" color="#ffffff" /> <color id="BACKGROUND_GRAY" color="#404040" /> <color id="SCROLLBAR_GRAY" color="#000000" /> diff --git a/data/themes/blacknblack/colors.xml b/data/themes/blacknblack/colors.xml index cc41030bb..d31f1f519 100644 --- a/data/themes/blacknblack/colors.xml +++ b/data/themes/blacknblack/colors.xml @@ -30,14 +30,17 @@ <color id="PARTY_SOCIAL_TAB" color="#ff00d8" /> <color id="GUILD_CHAT_TAB" color="#ff00d8" /> <color id="GUILD_SOCIAL_TAB" color="#ff00d8" /> + <color id="GM_CHAT_TAB" color="#ff00d8" /> <color id="PARTY_CHAT_TAB_HIGHLIGHTED" color="#ff00d8" /> <color id="PARTY_SOCIAL_TAB_HIGHLIGHTED" color="#ff00d8" /> <color id="GUILD_CHAT_TAB_HIGHLIGHTED" color="#ff00d8" /> <color id="GUILD_SOCIAL_TAB_HIGHLIGHTED" color="#ff00d8" /> + <color id="GM_CHAT_TAB_HIGHLIGHTED" color="#ff00d8" /> <color id="PARTY_CHAT_TAB_SELECTED" color="#ff00d8" /> <color id="PARTY_SOCIAL_TAB_SELECTED" color="#ff00d8" /> <color id="GUILD_CHAT_TAB_SELECTED" color="#ff00d8" /> <color id="GUILD_SOCIAL_TAB_SELECTED" color="#ff00d8" /> + <color id="GM_CHAT_TAB_SELECTED" color="#ff00d8" /> <color id="BACKGROUND" color="#000000" /> <color id="BACKGROUND_GRAY" color="#005000" /> <color id="SCROLLBAR_GRAY" color="#000000" /> diff --git a/data/themes/blackwood/colors.xml b/data/themes/blackwood/colors.xml index 28bbd9f4f..b56f7e021 100644 --- a/data/themes/blackwood/colors.xml +++ b/data/themes/blackwood/colors.xml @@ -30,14 +30,17 @@ <color id="PARTY_SOCIAL_TAB" color="#ff00d8" /> <color id="GUILD_CHAT_TAB" color="#ff00d8" /> <color id="GUILD_SOCIAL_TAB" color="#ff00d8" /> + <color id="GM_CHAT_TAB" color="#ff00d8" /> <color id="PARTY_CHAT_TAB_HIGHLIGHTED" color="#ff00d8" /> <color id="PARTY_SOCIAL_TAB_HIGHLIGHTED" color="#ff00d8" /> <color id="GUILD_CHAT_TAB_HIGHLIGHTED" color="#ff00d8" /> <color id="GUILD_SOCIAL_TAB_HIGHLIGHTED" color="#ff00d8" /> + <color id="GM_CHAT_TAB_HIGHLIGHTED" color="#ff00d8" /> <color id="PARTY_CHAT_TAB_SELECTED" color="#ff00d8" /> <color id="PARTY_SOCIAL_TAB_SELECTED" color="#ff00d8" /> <color id="GUILD_CHAT_TAB_SELECTED" color="#ff00d8" /> <color id="GUILD_SOCIAL_TAB_SELECTED" color="#ff00d8" /> + <color id="GM_CHAT_TAB_SELECTED" color="#ff00d8" /> <color id="BACKGROUND" color="#ffffff" /> <color id="BACKGROUND_GRAY" color="#404040" /> <color id="SCROLLBAR_GRAY" color="#000000" /> diff --git a/data/themes/enchilado/colors.xml b/data/themes/enchilado/colors.xml index a24e3516b..60b701306 100644 --- a/data/themes/enchilado/colors.xml +++ b/data/themes/enchilado/colors.xml @@ -30,14 +30,17 @@ <color id="PARTY_SOCIAL_TAB" color="#f48055" /> <color id="GUILD_CHAT_TAB" color="#f48055" /> <color id="GUILD_SOCIAL_TAB" color="#f48055" /> + <color id="GM_CHAT_TAB" color="#f48055" /> <color id="PARTY_CHAT_TAB_HIGHLIGHTED" color="#f48055" /> <color id="PARTY_SOCIAL_TAB_HIGHLIGHTED" color="#f48055" /> <color id="GUILD_CHAT_TAB_HIGHLIGHTED" color="#f48055" /> <color id="GUILD_SOCIAL_TAB_HIGHLIGHTED" color="#f48055" /> + <color id="GM_CHAT_TAB_HIGHLIGHTED" color="#f48055" /> <color id="PARTY_CHAT_TAB_SELECTED" color="#f48055" /> <color id="PARTY_SOCIAL_TAB_SELECTED" color="#f48055" /> <color id="GUILD_CHAT_TAB_SELECTED" color="#f48055" /> <color id="GUILD_SOCIAL_TAB_SELECTED" color="#f48055" /> + <color id="GM_CHAT_TAB_SELECTED" color="#f48055" /> <color id="BACKGROUND" color="#ffffff" /> <color id="BACKGROUND_GRAY" color="#404040" /> <color id="SCROLLBAR_GRAY" color="#000000" /> diff --git a/data/themes/jewelry/colors.xml b/data/themes/jewelry/colors.xml index 444ad8c96..d8a36b990 100644 --- a/data/themes/jewelry/colors.xml +++ b/data/themes/jewelry/colors.xml @@ -31,14 +31,17 @@ <color id="PARTY_SOCIAL_TAB" color="#f48055" /> <color id="GUILD_CHAT_TAB" color="#f48055" /> <color id="GUILD_SOCIAL_TAB" color="#f48055" /> + <color id="GM_CHAT_TAB" color="#f48055" /> <color id="PARTY_CHAT_TAB_HIGHLIGHTED" color="#f48055" /> <color id="PARTY_SOCIAL_TAB_HIGHLIGHTED" color="#f48055" /> <color id="GUILD_CHAT_TAB_HIGHLIGHTED" color="#f48055" /> <color id="GUILD_SOCIAL_TAB_HIGHLIGHTED" color="#f48055" /> + <color id="GM_CHAT_TAB_HIGHLIGHTED" color="#f48055" /> <color id="PARTY_CHAT_TAB_SELECTED" color="#f48055" /> <color id="PARTY_SOCIAL_TAB_SELECTED" color="#f48055" /> <color id="GUILD_CHAT_TAB_SELECTED" color="#f48055" /> <color id="GUILD_SOCIAL_TAB_SELECTED" color="#f48055" /> + <color id="GM_CHAT_TAB_SELECTED" color="#f48055" /> <color id="BACKGROUND" color="#ffffff" /> <color id="BACKGROUND_GRAY" color="#404040" /> <color id="SCROLLBAR_GRAY" color="#000000" /> @@ -123,14 +126,17 @@ <color id="PARTY_SOCIAL_TAB" color="#efd7a7" /> <color id="GUILD_CHAT_TAB" color="#efd7a7" /> <color id="GUILD_SOCIAL_TAB" color="#efd7a7" /> + <color id="GM_CHAT_TAB" color="#efd7a7" /> <color id="PARTY_CHAT_TAB_HIGHLIGHTED" color="#fffbed" /> <color id="PARTY_SOCIAL_TAB_HIGHLIGHTED" color="#fffbed" /> <color id="GUILD_CHAT_TAB_HIGHLIGHTED" color="#fffbed" /> <color id="GUILD_SOCIAL_TAB_HIGHLIGHTED" color="#fffbed" /> + <color id="GM_CHAT_TAB_HIGHLIGHTED" color="#fffbed" /> <color id="PARTY_CHAT_TAB_SELECTED" color="#f9eabc" /> <color id="PARTY_SOCIAL_TAB_SELECTED" color="#f9eabc" /> <color id="GUILD_CHAT_TAB_SELECTED" color="#f9eabc" /> <color id="GUILD_SOCIAL_TAB_SELECTED" color="#f9eabc" /> + <color id="GM_CHAT_TAB_SELECTED" color="#f9eabc" /> <color id="BACKGROUND" color="#ffffff" /> <color id="BACKGROUND_GRAY" color="#404040" /> <color id="SCROLLBAR_GRAY" color="#000000" /> @@ -216,14 +222,17 @@ <color id="PARTY_SOCIAL_TAB" color="#f48055" /> <color id="GUILD_CHAT_TAB" color="#f48055" /> <color id="GUILD_SOCIAL_TAB" color="#f48055" /> + <color id="GM_CHAT_TAB" color="#f48055" /> <color id="PARTY_CHAT_TAB_HIGHLIGHTED" color="#f48055" /> <color id="PARTY_SOCIAL_TAB_HIGHLIGHTED" color="#f48055" /> <color id="GUILD_CHAT_TAB_HIGHLIGHTED" color="#f48055" /> <color id="GUILD_SOCIAL_TAB_HIGHLIGHTED" color="#f48055" /> + <color id="GM_CHAT_TAB_HIGHLIGHTED" color="#f48055" /> <color id="PARTY_CHAT_TAB_SELECTED" color="#f48055" /> <color id="PARTY_SOCIAL_TAB_SELECTED" color="#f48055" /> <color id="GUILD_CHAT_TAB_SELECTED" color="#f48055" /> <color id="GUILD_SOCIAL_TAB_SELECTED" color="#f48055" /> + <color id="GM_CHAT_TAB_SELECTED" color="#f48055" /> <color id="BACKGROUND" color="#ffffff" /> <color id="BACKGROUND_GRAY" color="#404040" /> <color id="SCROLLBAR_GRAY" color="#000000" /> diff --git a/data/themes/mana/colors.xml b/data/themes/mana/colors.xml index c15ca9141..520c874c5 100644 --- a/data/themes/mana/colors.xml +++ b/data/themes/mana/colors.xml @@ -30,14 +30,17 @@ <color id="PARTY_SOCIAL_TAB" color="#ff00d8" /> <color id="GUILD_CHAT_TAB" color="#ff00d8" /> <color id="GUILD_SOCIAL_TAB" color="#ff00d8" /> + <color id="GM_CHAT_TAB" color="#ff00d8" /> <color id="PARTY_CHAT_TAB_HIGHLIGHTED" color="#f48055" /> <color id="PARTY_SOCIAL_TAB_HIGHLIGHTED" color="#ff00d8" /> <color id="GUILD_CHAT_TAB_HIGHLIGHTED" color="#ff00d8" /> <color id="GUILD_SOCIAL_TAB_HIGHLIGHTED" color="#ff00d8" /> + <color id="GM_CHAT_TAB_HIGHLIGHTED" color="#ff00d8" /> <color id="PARTY_CHAT_TAB_SELECTED" color="#f48055" /> <color id="PARTY_SOCIAL_TAB_SELECTED" color="#ff00d8" /> <color id="GUILD_CHAT_TAB_SELECTED" color="#ff00d8" /> <color id="GUILD_SOCIAL_TAB_SELECTED" color="#ff00d8" /> + <color id="GM_CHAT_TAB_SELECTED" color="#ff00d8" /> <color id="BACKGROUND" color="#ffffff" /> <color id="BACKGROUND_GRAY" color="#404040" /> <color id="SCROLLBAR_GRAY" color="#000000" /> diff --git a/data/themes/pink/colors.xml b/data/themes/pink/colors.xml index 37823138f..33c226654 100644 --- a/data/themes/pink/colors.xml +++ b/data/themes/pink/colors.xml @@ -30,14 +30,17 @@ <color id="PARTY_SOCIAL_TAB" color="#f48055" /> <color id="GUILD_CHAT_TAB" color="#f48055" /> <color id="GUILD_SOCIAL_TAB" color="#f48055" /> + <color id="GM_CHAT_TAB" color="#f48055" /> <color id="PARTY_CHAT_TAB_HIGHLIGHTED" color="#f48055" /> <color id="PARTY_SOCIAL_TAB_HIGHLIGHTED" color="#f48055" /> <color id="GUILD_CHAT_TAB_HIGHLIGHTED" color="#f48055" /> <color id="GUILD_SOCIAL_TAB_HIGHLIGHTED" color="#f48055" /> + <color id="GM_CHAT_TAB_HIGHLIGHTED" color="#f48055" /> <color id="PARTY_CHAT_TAB_SELECTED" color="#f48055" /> <color id="PARTY_SOCIAL_TAB_SELECTED" color="#f48055" /> <color id="GUILD_CHAT_TAB_SELECTED" color="#f48055" /> <color id="GUILD_SOCIAL_TAB_SELECTED" color="#f48055" /> + <color id="GM_CHAT_TAB_SELECTED" color="#f48055" /> <color id="BACKGROUND" color="#ffffff" /> <color id="BACKGROUND_GRAY" color="#404040" /> <color id="SCROLLBAR_GRAY" color="#000000" /> diff --git a/data/themes/unity/colors.xml b/data/themes/unity/colors.xml index eab87aca2..c7398e045 100644 --- a/data/themes/unity/colors.xml +++ b/data/themes/unity/colors.xml @@ -29,14 +29,17 @@ <color id="PARTY_SOCIAL_TAB" color="#E0E0E0" /> <color id="GUILD_CHAT_TAB" color="#E0E0E0" /> <color id="GUILD_SOCIAL_TAB" color="#E0E0E0" /> + <color id="GM_CHAT_TAB" color="#E0E0E0" /> <color id="PARTY_CHAT_TAB_HIGHLIGHTED" color="#E0E0E0" /> <color id="PARTY_SOCIAL_TAB_HIGHLIGHTED" color="#E0E0E0" /> <color id="GUILD_CHAT_TAB_HIGHLIGHTED" color="#E0E0E0" /> <color id="GUILD_SOCIAL_TAB_HIGHLIGHTED" color="#E0E0E0" /> + <color id="GM_CHAT_TAB_HIGHLIGHTED" color="#E0E0E0" /> <color id="PARTY_CHAT_TAB_SELECTED" color="#E0E0E0" /> <color id="PARTY_SOCIAL_TAB_SELECTED" color="#E0E0E0" /> <color id="GUILD_CHAT_TAB_SELECTED" color="#E0E0E0" /> <color id="GUILD_SOCIAL_TAB_SELECTED" color="#E0E0E0" /> + <color id="GM_CHAT_TAB_SELECTED" color="#E0E0E0" /> <color id="BACKGROUND" color="#4D4D4D" /> <color id="BACKGROUND_GRAY" color="#404040" /> <color id="SCROLLBAR_GRAY" color="#4D4D4D" /> diff --git a/data/themes/wood/colors.xml b/data/themes/wood/colors.xml index 3a7a0ea4d..3517e79e1 100644 --- a/data/themes/wood/colors.xml +++ b/data/themes/wood/colors.xml @@ -30,14 +30,17 @@ <color id="PARTY_SOCIAL_TAB" color="#c04000" /> <color id="GUILD_CHAT_TAB" color="#c04000" /> <color id="GUILD_SOCIAL_TAB" color="#c04000" /> + <color id="GM_CHAT_TAB" color="#c04000" /> <color id="PARTY_CHAT_TAB_HIGHLIGHTED" color="#c04000" /> <color id="PARTY_SOCIAL_TAB_HIGHLIGHTED" color="#c04000" /> <color id="GUILD_CHAT_TAB_HIGHLIGHTED" color="#c04000" /> <color id="GUILD_SOCIAL_TAB_HIGHLIGHTED" color="#c04000" /> + <color id="GM_CHAT_TAB_HIGHLIGHTED" color="#c04000" /> <color id="PARTY_CHAT_TAB_SELECTED" color="#c04000" /> <color id="PARTY_SOCIAL_TAB_SELECTED" color="#c04000" /> <color id="GUILD_CHAT_TAB_SELECTED" color="#c04000" /> <color id="GUILD_SOCIAL_TAB_SELECTED" color="#c04000" /> + <color id="GM_CHAT_TAB_SELECTED" color="#c04000" /> <color id="BACKGROUND" color="#ffffff" /> <color id="BACKGROUND_GRAY" color="#404040" /> <color id="SCROLLBAR_GRAY" color="#000000" /> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 349a0a12c..dc8c83047 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -130,6 +130,8 @@ SET(SRCS gui/widgets/extendednamesmodel.h gui/widgets/flowcontainer.cpp gui/widgets/flowcontainer.h + gui/widgets/gmtab.cpp + gui/widgets/gmtab.h gui/widgets/guildchattab.cpp gui/widgets/guildchattab.h gui/widgets/horizontcontainer.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 6a70ab4d5..63e3247f6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -132,6 +132,8 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ gui/widgets/extendednamesmodel.h \ gui/widgets/flowcontainer.cpp \ gui/widgets/flowcontainer.h \ + gui/widgets/gmtab.cpp \ + gui/widgets/gmtab.h \ gui/widgets/guildchattab.cpp \ gui/widgets/guildchattab.h \ gui/widgets/guitable.cpp \ diff --git a/src/game.cpp b/src/game.cpp index d5cebe6a1..798d6010b 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -73,6 +73,7 @@ #include "gui/widgets/battletab.h" #include "gui/widgets/dropshortcutcontainer.h" #include "gui/widgets/emoteshortcutcontainer.h" +#include "gui/widgets/gmtab.h" #include "gui/widgets/itemshortcutcontainer.h" #include "gui/widgets/spellshortcutcontainer.h" #include "gui/widgets/tradetab.h" @@ -153,6 +154,7 @@ ChatTab *localChatTab = nullptr; ChatTab *debugChatTab = nullptr; TradeTab *tradeChatTab = nullptr; BattleTab *battleChatTab = nullptr; +GmTab *gmChatTab = nullptr; const unsigned adjustDelay = 10; @@ -278,6 +280,9 @@ static void createGuiWindows() battleChatTab = nullptr; } + if (player_node && !gmChatTab && player_node->getGMLevel() > 0) + gmChatTab = new GmTab(chatWindow); + if (config.getBoolValue("logToChat")) logger->setChatWindow(chatWindow); @@ -316,6 +321,7 @@ static void destroyGuiWindows() del_0(debugChatTab) del_0(tradeChatTab) del_0(battleChatTab) + del_0(gmChatTab); logger->log("start deleting"); del_0(chatWindow) logger->log("end deleting"); diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index acd188031..202bfed20 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -757,6 +757,8 @@ static int readColorType(const std::string &type) "GUILD_CHAT_TAB_OUTLINE", "GUILD_SOCIAL_TAB", "GUILD_SOCIAL_TAB_OUTLINE", + "GM_CHAT_TAB", + "GM_CHAT_TAB_OUTLINE", "PARTY_CHAT_TAB_HIGHLIGHTED", "PARTY_CHAT_TAB_HIGHLIGHTED_OUTLINE", "PARTY_SOCIAL_TAB_HIGHLIGHTED", @@ -765,6 +767,8 @@ static int readColorType(const std::string &type) "GUILD_CHAT_TAB_HIGHLIGHTED_OUTLINE", "GUILD_SOCIAL_TAB_HIGHLIGHTED", "GUILD_SOCIAL_TAB_HIGHLIGHTED_OUTLINE", + "GM_CHAT_TAB_HIGHLIGHTED", + "GM_CHAT_TAB_HIGHLIGHTED_OUTLINE", "PARTY_CHAT_TAB_SELECTED", "PARTY_CHAT_TAB_SELECTED_OUTLINE", "PARTY_SOCIAL_TAB_SELECTED", @@ -773,6 +777,8 @@ static int readColorType(const std::string &type) "GUILD_CHAT_TAB_SELECTED_OUTLINE", "GUILD_SOCIAL_TAB_SELECTED", "GUILD_SOCIAL_TAB_SELECTED_OUTLINE", + "GM_CHAT_TAB_SELECTED", + "GM_CHAT_TAB_SELECTED_OUTLINE", "BACKGROUND", "BACKGROUND_GRAY", "SCROLLBAR_GRAY", diff --git a/src/gui/theme.h b/src/gui/theme.h index 213799788..223716057 100644 --- a/src/gui/theme.h +++ b/src/gui/theme.h @@ -228,6 +228,8 @@ class Theme final : public Palette, public ConfigListener GUILD_CHAT_TAB_OUTLINE, GUILD_SOCIAL_TAB, GUILD_SOCIAL_TAB_OUTLINE, + GM_CHAT_TAB, + GM_CHAT_TAB_OUTLINE, PARTY_CHAT_TAB_HIGHLIGHTED, PARTY_CHAT_TAB_HIGHLIGHTED_OUTLINE, PARTY_SOCIAL_TAB_HIGHLIGHTED, @@ -236,6 +238,8 @@ class Theme final : public Palette, public ConfigListener GUILD_CHAT_TAB_HIGHLIGHTED_OUTLINE, GUILD_SOCIAL_TAB_HIGHLIGHTED, GUILD_SOCIAL_TAB_HIGHLIGHTED_OUTLINE, + GM_CHAT_TAB_HIGHLIGHTED, + GM_CHAT_TAB_HIGHLIGHTED_OUTLINE, PARTY_CHAT_TAB_SELECTED, PARTY_CHAT_TAB_SELECTED_OUTLINE, PARTY_SOCIAL_TAB_SELECTED, @@ -244,6 +248,8 @@ class Theme final : public Palette, public ConfigListener GUILD_CHAT_TAB_SELECTED_OUTLINE, GUILD_SOCIAL_TAB_SELECTED, GUILD_SOCIAL_TAB_SELECTED_OUTLINE, + GM_CHAT_TAB_SELECTED, + GM_CHAT_TAB_SELECTED_OUTLINE, BACKGROUND, BACKGROUND_GRAY, SCROLLBAR_GRAY, diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h index 0b3469458..24afffc0f 100644 --- a/src/gui/widgets/chattab.h +++ b/src/gui/widgets/chattab.h @@ -47,7 +47,8 @@ class ChatTab : public Tab TAB_GUILD, TAB_DEBUG, TAB_TRADE, - TAB_BATTLE + TAB_BATTLE, + TAB_GM }; /** diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 99ef5a242..43c15428a 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -51,6 +51,7 @@ #include "gui/socialwindow.h" #include "gui/viewport.h" +#include "gui/widgets/gmtab.h" #include "gui/widgets/whispertab.h" #include "net/beinghandler.h" @@ -392,11 +393,14 @@ void LocalPlayer::setGMLevel(const int level) { setGM(true); if (chatWindow) + { chatWindow->loadGMCommands(); + if (!gmChatTab) + gmChatTab = new GmTab(chatWindow); + } } } - Position LocalPlayer::getNextWalkPosition(const unsigned char dir) const { // Compute where the next tile will be set. diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index d133178b3..61ae2eee7 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -32,6 +32,7 @@ #include "gui/shopwindow.h" #include "gui/widgets/chattab.h" +#include "gui/widgets/gmtab.h" #include "utils/gettext.h" @@ -246,7 +247,24 @@ void ChatHandler::processWhisper(Net::MessageIn &msg) } else if (localChatTab) { - localChatTab->chatLog(chatMsg, BY_SERVER); + if (gmChatTab && strStartWith(chatMsg, "[GM] ")) + { + chatMsg = chatMsg.substr(5); + const size_t pos = chatMsg.find(": ", 0); + if (pos == std::string::npos) + { + gmChatTab->chatLog(chatMsg); + } + else + { + gmChatTab->chatLog(chatMsg.substr(0, pos), + chatMsg.substr(pos + 2)); + } + } + else + { + localChatTab->chatLog(chatMsg, BY_SERVER); + } } } |