1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Use the console instead of a dedicated window when pressing keymap_chat/cmd

keymap_console opens a full window for chat history browsing.
This commit is contained in:
Esteban I. Ruiz Moreno 2013-06-02 21:16:32 -03:00 committed by ShadowNinja
parent da97969c9b
commit effa24737d
6 changed files with 97 additions and 99 deletions

View file

@ -417,20 +417,18 @@ void ChatPrompt::input(const std::wstring &str)
m_nick_completion_end = 0;
}
std::wstring ChatPrompt::submit()
void ChatPrompt::addToHistory(std::wstring line)
{
std::wstring line = m_line;
m_line.clear();
if (!line.empty())
m_history.push_back(line);
if (m_history.size() > m_history_limit)
m_history.erase(m_history.begin());
m_history_index = m_history.size();
m_view = 0;
m_cursor = 0;
m_nick_completion_start = 0;
m_nick_completion_end = 0;
return line;
}
std::wstring ChatPrompt::getLine()
{
return m_line;
}
void ChatPrompt::clear()
@ -442,13 +440,15 @@ void ChatPrompt::clear()
m_nick_completion_end = 0;
}
void ChatPrompt::replace(std::wstring line)
std::wstring ChatPrompt::replace(std::wstring line)
{
std::wstring old_line = m_line;
m_line = line;
m_view = m_cursor = line.size();
clampView();
m_nick_completion_start = 0;
m_nick_completion_end = 0;
return old_line;
}
void ChatPrompt::historyPrev()