diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/chatwindow.cpp | 22 | ||||
-rw-r--r-- | src/gui/chatwindow.h | 1 | ||||
-rw-r--r-- | src/gui/setup_chat.cpp | 9 | ||||
-rw-r--r-- | src/gui/setup_chat.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/setupitem.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/setupitem.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/setuptabscroll.cpp | 7 | ||||
-rw-r--r-- | src/gui/widgets/setuptabscroll.h | 2 |
8 files changed, 48 insertions, 3 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 074ce2b81..f6035c5dc 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -267,6 +267,7 @@ ChatWindow::ChatWindow(): mAutoHide = config.getBoolValue("autohideChat"); mShowBattleEvents = config.getBoolValue("showBattleEvents"); + mShowAllLang = serverConfig.getValue("showAllLang", 0); enableVisibleSound(true); } @@ -1479,10 +1480,25 @@ void ChatWindow::resortChatLog(std::string line, Own own, } } - if (langChatTab && !channel.empty() - && langChatTab->getChannelName() == channel) + if (langChatTab && !channel.empty()) { - langChatTab->chatLog(line, own, ignoreRecord, tryRemoveColors); + if (langChatTab->getChannelName() == channel) + { + langChatTab->chatLog(line, own, ignoreRecord, tryRemoveColors); + } + else if (mShowAllLang) + { + if (langChatTab) + { + langChatTab->chatLog(prefix + line, own, + ignoreRecord, tryRemoveColors); + } + else if (localChatTab) + { + localChatTab->chatLog(prefix + line, own, + ignoreRecord, tryRemoveColors); + } + } } else if (localChatTab && channel.empty()) { diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h index 7e2426467..1798ac63c 100644 --- a/src/gui/chatwindow.h +++ b/src/gui/chatwindow.h @@ -360,6 +360,7 @@ class ChatWindow final : public Window, bool mHaveMouse; bool mAutoHide; bool mShowBattleEvents; + bool mShowAllLang; }; extern ChatWindow *chatWindow; diff --git a/src/gui/setup_chat.cpp b/src/gui/setup_chat.cpp index 45b9e8748..207ac7464 100644 --- a/src/gui/setup_chat.cpp +++ b/src/gui/setup_chat.cpp @@ -124,6 +124,9 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) : new SetupItemCheckBox(_("Enable language tab"), "", "enableLangTab", this, "enableLangTabEvent", false); + new SetupItemCheckBox(_("Show all languages messages"), "", + "showAllLang", this, "showAllLangEvent", false); + new SetupItemCheckBox(_("Enable battle tab"), "", "enableBattleTab", this, "enableBattleTabEvent"); @@ -160,3 +163,9 @@ void Setup_Chat::apply() chatWindow->parseHighlights(); } } + +void Setup_Chat::externalUpdated() +{ + reread("enableLangTab"); + reread("showAllLang"); +} diff --git a/src/gui/setup_chat.h b/src/gui/setup_chat.h index 6fc6e3896..2e519f11c 100644 --- a/src/gui/setup_chat.h +++ b/src/gui/setup_chat.h @@ -38,6 +38,8 @@ class Setup_Chat final : public SetupTabScroll A_DELETE_COPY(Setup_Chat) void apply(); + + void externalUpdated(); }; #endif diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index 0e9fa993c..fbb24d2b6 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -180,6 +180,12 @@ void SetupItem::fixFirstItemSize(gcn::Widget *const widget) widget->setWidth(maxSize); } +void SetupItem::rereadValue() +{ + load(); + toWidget(); +} + SetupItemCheckBox::SetupItemCheckBox(std::string text, std::string description, std::string keyName, SetupTabScroll *const parent, diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h index f660500a8..d91f0ac2e 100644 --- a/src/gui/widgets/setupitem.h +++ b/src/gui/widgets/setupitem.h @@ -107,6 +107,8 @@ class SetupItem : public gcn::ActionListener, void fixFirstItemSize(gcn::Widget *const widget); + void rereadValue(); + protected: std::string mText; diff --git a/src/gui/widgets/setuptabscroll.cpp b/src/gui/widgets/setuptabscroll.cpp index 89077dd8c..ec8f36eba 100644 --- a/src/gui/widgets/setuptabscroll.cpp +++ b/src/gui/widgets/setuptabscroll.cpp @@ -124,3 +124,10 @@ void SetupTabScroll::widgetResized(const gcn::Event &event A_UNUSED) mScroll->setWidth(getWidth() - 12); mScroll->setHeight(getHeight() - 12 - 12); } + +void SetupTabScroll::reread(const std::string &name) +{ + SetupItem *const item = mItems[name + "Event"]; + if (item) + item->rereadValue(); +} diff --git a/src/gui/widgets/setuptabscroll.h b/src/gui/widgets/setuptabscroll.h index e90ce28c2..2417bd400 100644 --- a/src/gui/widgets/setuptabscroll.h +++ b/src/gui/widgets/setuptabscroll.h @@ -62,6 +62,8 @@ class SetupTabScroll : public SetupTab void widgetResized(const gcn::Event &event) override; + void reread(const std::string &name); + protected: VertContainer *mContainer; ScrollArea *mScroll; |