1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 06:23:53 +00:00

Merge branch 'i-know-what-time-it-is' into 'master'

Fix(Log): Don't Put Timestamps Mid-Message

Closes #6982

See merge request OpenMW/openmw!3593
This commit is contained in:
Zackhasacat 2023-11-21 03:00:36 +00:00
commit f3770a2364

View file

@ -129,6 +129,7 @@ namespace MWGui
static std::mutex sBufferMutex;
static int64_t sLogStartIndex;
static int64_t sLogEndIndex;
static bool hasPrefix = false;
void DebugWindow::startLogRecording()
{
@ -170,11 +171,17 @@ namespace MWGui
addChar(c);
if (c == '#')
addChar(c);
if (c == '\n')
hasPrefix = false;
}
};
for (char c : color)
addChar(c);
addShieldedStr(prefix);
if (!hasPrefix)
{
addShieldedStr(prefix);
hasPrefix = true;
}
addShieldedStr(msg);
if (bufferOverflow)
sLogStartIndex = (sLogEndIndex + 1) % bufSize;