enigma-bbs/mods/test_module1.js
Bryan Ashby ec5f1836c5 * clearScreen -> cls for nostalgia
* module cleanup: some simple modules moved to general_menu_method.js @methods
* More work on menu configuration & options
- Removed formatting of args for now. Too tied to MCI, not really needed with argName stuff
2015-04-20 22:50:58 -06:00

47 lines
1.1 KiB
JavaScript

/* jslint node: true */
'use strict';
var ansi = require('../core/ansi_term.js');
var theme = require('../core/theme.js');
var viewController = require('../core/view_controller.js');
var art = require('../core/art.js');
var async = require('async');
exports.moduleInfo = {
name : 'Test Module 2',
desc : 'A Test Module',
author : 'NuSkooler',
};
exports.entryPoint = entryPoint;
function entryPoint(client) {
var term = client.term;
term.write(ansi.resetScreen());
async.waterfall(
[
function getArt(callback) {
theme.getThemeArt('MCI_VM1.ANS', client.user.properties.theme_id, function onArt(err, theArt) {
callback(err, theArt);
});
},
function displayArt(theArt, callback) {
art.display( { art : theArt, client : client }, function onDisplayed(err, mci) {
callback(err, mci);
});
},
function artDisplayed(mci, callback) {
var vc = new viewController.ViewController(client);
vc.loadFromMCIMap(mci);
vc.getView(1).setItems(['Item 1', 'Item Two', 'The Third']);
vc.setViewOrder();
vc.switchFocus(1);
}
],
function onComplete(err) {
console.log(err);
}
);
}