mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-26 12:38:20 +02:00
* Fix short timeFormat
* Pause prompts now support MCI codes using View Controller * View Controller 'noInput' option for read-only/viewable but no interaction * Ability to omit final trailing CRLF's in ANSI's * Move asset.displayArtAsset -> theme.displayThemedAsset
This commit is contained in:
parent
dd478ed6ba
commit
35a99b7e3e
10 changed files with 125 additions and 154 deletions
|
@ -11,7 +11,6 @@ exports.parseAsset = parseAsset;
|
|||
exports.getArtAsset = getArtAsset;
|
||||
exports.resolveConfigAsset = resolveConfigAsset;
|
||||
exports.getViewPropertyAsset = getViewPropertyAsset;
|
||||
exports.displayArtAsset = displayArtAsset;
|
||||
|
||||
var ALL_ASSETS = [
|
||||
'art',
|
||||
|
@ -85,47 +84,3 @@ function getViewPropertyAsset(src) {
|
|||
|
||||
return parseAsset(src);
|
||||
};
|
||||
|
||||
function displayArtAsset(assetSpec, client, options, cb) {
|
||||
assert(_.isObject(client));
|
||||
|
||||
// options are... optional
|
||||
if(3 === arguments.length) {
|
||||
cb = options;
|
||||
options = {};
|
||||
}
|
||||
|
||||
var artAsset = getArtAsset(assetSpec);
|
||||
if(!artAsset) {
|
||||
cb(new Error('Asset not found: ' + assetSpec));
|
||||
return;
|
||||
}
|
||||
|
||||
var dispOpts = {
|
||||
name : artAsset.asset,
|
||||
client : client,
|
||||
font : options.font,
|
||||
};
|
||||
|
||||
switch(artAsset.type) {
|
||||
case 'art' :
|
||||
theme.displayThemeArt(dispOpts, function displayed(err, artData) {
|
||||
cb(err, err ? null : { mciMap : artData.mciMap, height : artData.extraInfo.height } );
|
||||
});
|
||||
break;
|
||||
|
||||
case 'method' :
|
||||
// :TODO: fetch & render via method
|
||||
break;
|
||||
|
||||
case 'inline ' :
|
||||
// :TODO: think about this more in relation to themes, etc. How can this come
|
||||
// from a theme (with override from menu.json) ???
|
||||
// look @ client.currentTheme.inlineArt[name] -> menu/prompt[name]
|
||||
break;
|
||||
|
||||
default :
|
||||
cb(new Error('Unsupported art asset type: ' + artAsset.type));
|
||||
break;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue