mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 22:18:19 +00:00
Merge pull request #8605 from MilkeeyCat/pr_remove_multiline_client_support
Remove multi line chat support
This commit is contained in:
commit
06d16158ba
|
@ -660,13 +660,11 @@ void CChat::AddLine(int ClientId, int Team, const char *pLine)
|
||||||
if(pEnd != 0)
|
if(pEnd != 0)
|
||||||
*(const_cast<char *>(pEnd)) = 0;
|
*(const_cast<char *>(pEnd)) = 0;
|
||||||
|
|
||||||
bool Highlighted = false;
|
if(*pLine == 0)
|
||||||
char *p = const_cast<char *>(pLine);
|
|
||||||
|
|
||||||
// Only empty string left
|
|
||||||
if(*p == 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
bool Highlighted = false;
|
||||||
|
|
||||||
auto &&FChatMsgCheckAndPrint = [this](CLine *pLine_) {
|
auto &&FChatMsgCheckAndPrint = [this](CLine *pLine_) {
|
||||||
if(pLine_->m_ClientId < 0) // server or client message
|
if(pLine_->m_ClientId < 0) // server or client message
|
||||||
{
|
{
|
||||||
|
@ -699,20 +697,6 @@ void CChat::AddLine(int ClientId, int Team, const char *pLine)
|
||||||
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, pLine_->m_Whisper ? "whisper" : (pLine_->m_Team ? "teamchat" : "chat"), aBuf, ChatLogColor);
|
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, pLine_->m_Whisper ? "whisper" : (pLine_->m_Team ? "teamchat" : "chat"), aBuf, ChatLogColor);
|
||||||
};
|
};
|
||||||
|
|
||||||
while(*p)
|
|
||||||
{
|
|
||||||
Highlighted = false;
|
|
||||||
pLine = p;
|
|
||||||
// find line separator and strip multiline
|
|
||||||
while(*p)
|
|
||||||
{
|
|
||||||
if(*p++ == '\n')
|
|
||||||
{
|
|
||||||
*(p - 1) = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CLine *pCurrentLine = &m_aLines[m_CurrentLine];
|
CLine *pCurrentLine = &m_aLines[m_CurrentLine];
|
||||||
|
|
||||||
// Team Number:
|
// Team Number:
|
||||||
|
@ -836,7 +820,6 @@ void CChat::AddLine(int ClientId, int Team, const char *pLine)
|
||||||
}
|
}
|
||||||
|
|
||||||
FChatMsgCheckAndPrint(pCurrentLine);
|
FChatMsgCheckAndPrint(pCurrentLine);
|
||||||
}
|
|
||||||
|
|
||||||
// play sound
|
// play sound
|
||||||
int64_t Now = time();
|
int64_t Now = time();
|
||||||
|
|
Loading…
Reference in a new issue