mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-11 07:04:32 +02:00
* Various cleanup + utility methods
This commit is contained in:
parent
d242546458
commit
f2388ceed1
6 changed files with 68 additions and 21 deletions
|
@ -12,6 +12,7 @@ exports.getThemeInfo = getThemeInfo;
|
|||
exports.getThemeArt = getThemeArt;
|
||||
exports.getRandomTheme = getRandomTheme;
|
||||
exports.initAvailableThemes = initAvailableThemes;
|
||||
exports.displayThemeArt = displayThemeArt;
|
||||
|
||||
function getThemeInfo(themeID, cb) {
|
||||
var path = paths.join(Config.paths.themes, themeID, 'theme_info.json');
|
||||
|
@ -108,4 +109,16 @@ function getThemeArt(name, themeID, options, cb) {
|
|||
cb(null, theArt.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function displayThemeArt(name, client, cb) {
|
||||
getThemeArt(name, client.user.properties.art_theme_id, function onArt(err, theArt) {
|
||||
if(err) {
|
||||
cb(err);
|
||||
} else {
|
||||
art.display( { art : theArt, client : client }, function onDisplayed(err, mci) {
|
||||
cb(err, mci);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue