Skip to content

Commit

Permalink
Fix screen logging lines ending with space char (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiranDMC authored Nov 15, 2023
1 parent 6265ebf commit b527a7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cleo_plugins/DebugUtils/DebugUtils.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ LegacyDebugOpcodes=0
[ScreenLog]
; Level: 0 - off, 1 - errors and warnings, 2 - debug messages, 3 - all
Level=2
MessageTime=4000
MessagesMax=35
FontSize=55
MessageTime=3000
MessagesMax=45
FontSize=40
7 changes: 6 additions & 1 deletion cleo_plugins/DebugUtils/ScreenLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ class ScreenLog
this->msg.push_back(c);
}
}

if(!this->msg.empty() && this->msg.back() == ' ') // a bug(?) in game prevents drawing texts ending with whitespace
{
this->msg.back() = '_'; // '_' is drawn as empty character too
}
}

ResetTime();
Expand All @@ -101,7 +106,7 @@ class ScreenLog

void ResetTime()
{
timeLeft = min(msg.length(), 200) * 0.08f; // 12 letters peer second reading speed
timeLeft = min(msg.length(), 200) * 0.06f; // 16 letters peer second reading speed
timeLeft = max(timeLeft, 0.001f * ScreenLog::timeDisplay); // not shorter than defined in config
}

Expand Down

0 comments on commit b527a7f

Please sign in to comment.