Fix FILE_ID.DIZ (and other) display issues when ANSI is stored with specific term width in SAUCE

+ Preserve SAUCE records of desc/long_desc during import (in meta)
* Use SAUCE term width for ANSI Prep when displaying desc
This commit is contained in:
Bryan Ashby
2018-12-29 13:15:58 -07:00
parent 046550842b
commit 6b02ddbdae
6 changed files with 59 additions and 22 deletions

View File

@@ -413,16 +413,23 @@ exports.getModule = class FileAreaList extends MenuModule {
//
const desc = controlCodesToAnsi(self.currentFileEntry.desc);
if(desc.length != self.currentFileEntry.desc.length || isAnsi(desc)) {
descView.setAnsi(
desc,
{
prepped : false,
forceLineTerm : true
},
() => {
return callback(null);
}
);
const opts = {
prepped : false,
forceLineTerm : true
};
//
// if SAUCE states a term width, honor it else we may see
// display corruption
//
const sauceTermWidth = _.get(self.currentFileEntry.meta, 'desc_sauce.Character.characterWidth');
if(_.isNumber(sauceTermWidth)) {
opts.termWidth = sauceTermWidth;
}
descView.setAnsi(desc, opts, () => {
return callback(null);
});
} else {
descView.setText(self.currentFileEntry.desc);
return callback(null);