Minetest  5.4.0
ChatBackend Class Reference

#include <chat.h>

+ Collaboration diagram for ChatBackend:

Public Member Functions

 ChatBackend ()
 
 ~ChatBackend ()=default
 
void addMessage (const std::wstring &name, std::wstring text)
 
void addUnparsedMessage (std::wstring line)
 
ChatBuffergetConsoleBuffer ()
 
ChatBuffergetRecentBuffer ()
 
EnrichedString getRecentChat () const
 
ChatPromptgetPrompt ()
 
void reformat (u32 cols, u32 rows)
 
void clearRecentChat ()
 
void step (float dtime)
 
void scroll (s32 rows)
 
void scrollPageDown ()
 
void scrollPageUp ()
 
void applySettings ()
 

Private Attributes

ChatBuffer m_console_buffer
 
ChatBuffer m_recent_buffer
 
ChatPrompt m_prompt
 

Constructor & Destructor Documentation

◆ ChatBackend()

ChatBackend::ChatBackend ( )

◆ ~ChatBackend()

ChatBackend::~ChatBackend ( )
default

Member Function Documentation

◆ addMessage()

void ChatBackend::addMessage ( const std::wstring &  name,
std::wstring  text 
)

References ChatBuffer::addLine(), BasicStrfnd< T >::at_end(), m_console_buffer, m_recent_buffer, BasicStrfnd< T >::next(), and translate_string().

Referenced by addUnparsedMessage(), Game::shutdown(), and Game::updateChat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUnparsedMessage()

void ChatBackend::addUnparsedMessage ( std::wstring  line)

References addMessage().

Referenced by Game::updateChat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applySettings()

void ChatBackend::applySettings ( )

References g_settings, Settings::getU32(), m_recent_buffer, rangelim, and ChatBuffer::resize().

Referenced by Game::initGui().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clearRecentChat()

void ChatBackend::clearRecentChat ( )

References ChatBuffer::clear(), and m_recent_buffer.

Referenced by Game::initGui().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getConsoleBuffer()

ChatBuffer & ChatBackend::getConsoleBuffer ( )

References m_console_buffer.

Referenced by GUIChatConsole::drawPrompt(), and GUIChatConsole::drawText().

+ Here is the caller graph for this function:

◆ getPrompt()

ChatPrompt & ChatBackend::getPrompt ( )

References m_prompt.

Referenced by GUIChatConsole::drawPrompt(), GUIChatConsole::OnEvent(), and GUIChatConsole::replaceAndAddToHistory().

+ Here is the caller graph for this function:

◆ getRecentBuffer()

ChatBuffer & ChatBackend::getRecentBuffer ( )

References m_recent_buffer.

Referenced by Game::updateChat().

+ Here is the caller graph for this function:

◆ getRecentChat()

EnrichedString ChatBackend::getRecentChat ( ) const

References EnrichedString::empty(), ChatBuffer::getLine(), ChatBuffer::getLineCount(), m_recent_buffer, ChatLine::name, and ChatLine::text.

Referenced by Game::updateChat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reformat()

void ChatBackend::reformat ( u32  cols,
u32  rows 
)

References m_console_buffer, m_prompt, ChatPrompt::reformat(), and ChatBuffer::reformat().

Referenced by GUIChatConsole::reformatConsole().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scroll()

void ChatBackend::scroll ( s32  rows)

References m_console_buffer, and ChatBuffer::scroll().

Referenced by GUIChatConsole::OnEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scrollPageDown()

void ChatBackend::scrollPageDown ( )

References ChatBuffer::getRows(), m_console_buffer, and ChatBuffer::scroll().

Referenced by GUIChatConsole::OnEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scrollPageUp()

void ChatBackend::scrollPageUp ( )

References ChatBuffer::getRows(), m_console_buffer, and ChatBuffer::scroll().

Referenced by GUIChatConsole::OnEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ step()

void ChatBackend::step ( float  dtime)

References ChatBuffer::deleteByAge(), m_recent_buffer, and ChatBuffer::step().

Referenced by Game::updateChat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_console_buffer

ChatBuffer ChatBackend::m_console_buffer
private

◆ m_prompt

ChatPrompt ChatBackend::m_prompt
private

Referenced by getPrompt(), and reformat().

◆ m_recent_buffer

ChatBuffer ChatBackend::m_recent_buffer
private

The documentation for this class was generated from the following files: