From a5426222cb3447e92a7051cbfe7ec8777648e4ee Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 30 Jun 2017 18:37:33 +0300 Subject: Allow open chat window with debug tab before connecting to game. --- src/gui/windows/chatwindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/gui/windows/chatwindow.cpp') diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index eea0905cf..279d1c712 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -89,7 +89,7 @@ ChatWindow *chatWindow = nullptr; static const char *const ACTION_COLOR_PICKER = "color picker"; -ChatWindow::ChatWindow() : +ChatWindow::ChatWindow(const std::string &name) : // TRANSLATORS: chat window name Window(_("Chat"), Modal_false, nullptr, "chat.xml"), ActionListener(), @@ -127,7 +127,7 @@ ChatWindow::ChatWindow() : mEnableTradeFilter(config.getBoolValue("enableTradeFilter")), mTmpVisible(false) { - setWindowName("Chat"); + setWindowName(name); if (setupWindow != nullptr) setupWindow->registerWindowForReset(this); @@ -669,7 +669,9 @@ void ChatWindow::chatInput(const std::string &message) const } if (tab != nullptr) tab->chatInput(msg); - Game::instance()->setValidSpeed(); + Game *const game = Game::instance(); + if (game) + game->setValidSpeed(); } void ChatWindow::localChatInput(const std::string &msg) const -- cgit v1.2.3-60-g2f50