mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-05 04:07:23 +02:00
show_art module can now take Buffer to display
This commit is contained in:
parent
50d108b44c
commit
9018bc363c
2 changed files with 22 additions and 8 deletions
|
@ -27,6 +27,7 @@ exports.getAvailableThemes = getAvailableThemes;
|
|||
exports.getRandomTheme = getRandomTheme;
|
||||
exports.setClientTheme = setClientTheme;
|
||||
exports.initAvailableThemes = initAvailableThemes;
|
||||
exports.displayPreparedArt = displayPreparedArt;
|
||||
exports.displayThemeArt = displayThemeArt;
|
||||
exports.displayThemedPause = displayThemedPause;
|
||||
exports.displayThemedPrompt = displayThemedPrompt;
|
||||
|
@ -510,6 +511,17 @@ function getThemeArt(options, cb) {
|
|||
);
|
||||
}
|
||||
|
||||
function displayPreparedArt(options, artInfo, cb) {
|
||||
const displayOpts = {
|
||||
sauce : artInfo.sauce,
|
||||
font : options.font,
|
||||
trailingLF : options.trailingLF,
|
||||
};
|
||||
art.display(options.client, artInfo.data, displayOpts, (err, mciMap, extraInfo) => {
|
||||
return cb(err, { mciMap : mciMap, artInfo : artInfo, extraInfo : extraInfo } );
|
||||
});
|
||||
}
|
||||
|
||||
function displayThemeArt(options, cb) {
|
||||
assert(_.isObject(options));
|
||||
assert(_.isObject(options.client));
|
||||
|
@ -537,14 +549,7 @@ function displayThemeArt(options, cb) {
|
|||
}
|
||||
},
|
||||
function disp(artInfo, callback) {
|
||||
const displayOpts = {
|
||||
sauce : artInfo.sauce,
|
||||
font : options.font,
|
||||
trailingLF : options.trailingLF,
|
||||
};
|
||||
art.display(options.client, artInfo.data, displayOpts, (err, mciMap, extraInfo) => {
|
||||
return callback(err, { mciMap : mciMap, artInfo : artInfo, extraInfo : extraInfo } );
|
||||
});
|
||||
return displayPreparedArt(options, artInfo, callback);
|
||||
}
|
||||
],
|
||||
(err, artData) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue