mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
don't pass g_settings around, and use it directly
This commit is contained in:
parent
93d185ee5d
commit
792e013eaf
7 changed files with 19 additions and 17 deletions
12
src/chat.cpp
12
src/chat.cpp
|
@ -369,12 +369,11 @@ s32 ChatBuffer::getBottomScrollPos() const
|
|||
return formatted_count - rows;
|
||||
}
|
||||
|
||||
void ChatBuffer::resize(u32 scrollback) {
|
||||
void ChatBuffer::resize(u32 scrollback)
|
||||
{
|
||||
m_scrollback = scrollback;
|
||||
if (m_unformatted.size() > m_scrollback)
|
||||
{
|
||||
deleteOldest(m_unformatted.size() - m_scrollback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -739,8 +738,11 @@ void ChatBackend::clearRecentChat()
|
|||
}
|
||||
|
||||
|
||||
void ChatBackend::applySettings(Settings* settings) {
|
||||
m_recent_buffer.resize(settings->getU32("recent_chat_size"));
|
||||
void ChatBackend::applySettings()
|
||||
{
|
||||
u32 recent_lines = g_settings->getU32("recent_chat_messages");
|
||||
recent_lines = rangelim(recent_lines, 2, 20);
|
||||
m_recent_buffer.resize(recent_lines);
|
||||
}
|
||||
|
||||
void ChatBackend::step(float dtime)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue