Art asset ACS conditional cleanup: Make more general purpose

This commit is contained in:
Bryan Ashby 2018-11-17 18:56:09 -07:00
parent 0f35b0c58e
commit b3ec97cc5c
3 changed files with 11 additions and 5 deletions

View File

@ -542,7 +542,7 @@ exports.FullScreenEditorModule = exports.getModule = class FullScreenEditorModul
theme.displayThemedAsset(
art[n],
self.client,
{ font : self.menuConfig.font, acsCondMember : 'art' },
{ font : self.menuConfig.font },
function displayed(err) {
next(err);
}
@ -622,7 +622,7 @@ exports.FullScreenEditorModule = exports.getModule = class FullScreenEditorModul
theme.displayThemedAsset(
art[n],
self.client,
{ font : self.menuConfig.font, acsCondMember : 'art' },
{ font : self.menuConfig.font },
function displayed(err, artData) {
if(artData) {
mciData[n] = artData;

View File

@ -49,13 +49,18 @@ exports.MenuModule = class MenuModule extends PluginModule {
const mciData = {};
let pausePosition;
const hasArt = () => {
return _.isString(self.menuConfig.art) ||
(Array.isArray(self.menuConfig.art) && _.has(self.menuConfig.art[0], 'acs'));
};
async.series(
[
function beforeDisplayArt(callback) {
self.beforeArt(callback);
},
function displayMenuArt(callback) {
if(!_.isString(self.menuConfig.art)) {
if(!hasArt()) {
return callback(null);
}

View File

@ -682,8 +682,9 @@ function displayThemedAsset(assetSpec, client, options, cb) {
options = {};
}
if(Array.isArray(assetSpec) && _.isString(options.acsCondMember)) {
assetSpec = client.acs.getConditionalValue(assetSpec, options.acsCondMember);
if(Array.isArray(assetSpec)) {
const acsCondMember = options.acsCondMember || 'art';
assetSpec = client.acs.getConditionalValue(assetSpec, acsCondMember);
}
const artAsset = asset.getArtAsset(assetSpec);