Art asset ACS conditional cleanup: Make more general purpose
This commit is contained in:
parent
0f35b0c58e
commit
b3ec97cc5c
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue