Fix MRC MLTEV padding bug

This commit is contained in:
David Stephens 2019-05-31 20:34:07 +01:00
parent 136854017a
commit ce16f17081
1 changed files with 6 additions and 3 deletions

View File

@ -178,14 +178,17 @@ exports.getModule = class mrcModule extends MenuModule {
const messageLength = stripMciColorCodes(message).length; const messageLength = stripMciColorCodes(message).length;
const chatWidth = chatLogView.dimens.width; const chatWidth = chatLogView.dimens.width;
let padAmount = 0; let padAmount = 0;
let spaces = 2;
if (messageLength > chatWidth) { if (messageLength > chatWidth) {
padAmount = chatWidth - (messageLength % chatWidth); padAmount = chatWidth - (messageLength % chatWidth) - spaces;
} else { } else {
padAmount = chatWidth - messageLength; padAmount = chatWidth - messageLength - spaces ;
} }
const padding = ' |00' + ' '.repeat(padAmount - 2); if (padAmount < 0) padAmount = 0;
const padding = ' |00' + ' '.repeat(padAmount);
chatLogView.addText(pipeToAnsi(message + padding)); chatLogView.addText(pipeToAnsi(message + padding));
} }