|
@@ -19,9 +19,9 @@
|
|
|
#include "../gui/CGuiHandler.h"
|
|
#include "../gui/CGuiHandler.h"
|
|
|
#include "../gui/WindowHandler.h"
|
|
#include "../gui/WindowHandler.h"
|
|
|
#include "../widgets/TextControls.h"
|
|
#include "../widgets/TextControls.h"
|
|
|
|
|
+#include "../widgets/Slider.h"
|
|
|
#include "../widgets/ObjectLists.h"
|
|
#include "../widgets/ObjectLists.h"
|
|
|
|
|
|
|
|
-#include "../../lib/CConfigHandler.h"
|
|
|
|
|
#include "../../lib/Languages.h"
|
|
#include "../../lib/Languages.h"
|
|
|
#include "../../lib/MetaString.h"
|
|
#include "../../lib/MetaString.h"
|
|
|
#include "../../lib/TextOperations.h"
|
|
#include "../../lib/TextOperations.h"
|
|
@@ -51,13 +51,14 @@ void GlobalLobbyWindow::doOpenChannel(const std::string & channelType, const std
|
|
|
currentChannelName = channelName;
|
|
currentChannelName = channelName;
|
|
|
chatHistory.clear();
|
|
chatHistory.clear();
|
|
|
unreadChannels.erase(channelType + "_" + channelName);
|
|
unreadChannels.erase(channelType + "_" + channelName);
|
|
|
- widget->getGameChat()->setText("");
|
|
|
|
|
|
|
|
|
|
auto history = CSH->getGlobalLobby().getChannelHistory(channelType, channelName);
|
|
auto history = CSH->getGlobalLobby().getChannelHistory(channelType, channelName);
|
|
|
|
|
|
|
|
for(const auto & entry : history)
|
|
for(const auto & entry : history)
|
|
|
onGameChatMessage(entry.displayName, entry.messageText, entry.timeFormatted, channelType, channelName);
|
|
onGameChatMessage(entry.displayName, entry.messageText, entry.timeFormatted, channelType, channelName);
|
|
|
|
|
|
|
|
|
|
+ refreshChatText();
|
|
|
|
|
+
|
|
|
MetaString text;
|
|
MetaString text;
|
|
|
text.appendTextID("vcmi.lobby.header.chat." + channelType);
|
|
text.appendTextID("vcmi.lobby.header.chat." + channelType);
|
|
|
text.replaceRawString(roomDescription);
|
|
text.replaceRawString(roomDescription);
|
|
@@ -133,8 +134,12 @@ void GlobalLobbyWindow::onGameChatMessage(const std::string & sender, const std:
|
|
|
chatMessageFormatted.replaceRawString(message);
|
|
chatMessageFormatted.replaceRawString(message);
|
|
|
|
|
|
|
|
chatHistory += chatMessageFormatted.toString();
|
|
chatHistory += chatMessageFormatted.toString();
|
|
|
-
|
|
|
|
|
|
|
+}
|
|
|
|
|
+void GlobalLobbyWindow::refreshChatText()
|
|
|
|
|
+{
|
|
|
widget->getGameChat()->setText(chatHistory);
|
|
widget->getGameChat()->setText(chatHistory);
|
|
|
|
|
+ if (widget->getGameChat()->slider)
|
|
|
|
|
+ widget->getGameChat()->slider->scrollToMax();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
bool GlobalLobbyWindow::isChannelUnread(const std::string & channelType, const std::string & channelName) const
|
|
bool GlobalLobbyWindow::isChannelUnread(const std::string & channelType, const std::string & channelName) const
|