From 0e8ee84d7477416dce4ad0d3fdde893676a9df6f Mon Sep 17 00:00:00 2001 From: "Esteban I. RM" Date: Sun, 15 Oct 2017 20:28:42 -0300 Subject: Implement #6096 --- src/chat.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/chat.cpp') diff --git a/src/chat.cpp b/src/chat.cpp index fd0718707..967e159f8 100644 --- a/src/chat.cpp +++ b/src/chat.cpp @@ -369,6 +369,13 @@ s32 ChatBuffer::getBottomScrollPos() const return formatted_count - rows; } +void ChatBuffer::resize(u32 scrollback) { + m_scrollback = scrollback; + if (m_unformatted.size() > m_scrollback) + { + deleteOldest(m_unformatted.size() - m_scrollback); + } +} ChatPrompt::ChatPrompt(const std::wstring &prompt, u32 history_limit): @@ -731,6 +738,11 @@ void ChatBackend::clearRecentChat() m_recent_buffer.clear(); } + +void ChatBackend::applySettings(Settings* settings) { + m_recent_buffer.resize(settings->getU32("recent_chat_size")); +} + void ChatBackend::step(float dtime) { m_recent_buffer.step(dtime); -- cgit v1.2.3