mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 12:47:13 +02:00
* ENiGMA now require Node.js 6.x LTS+
* Bump version to 0.0.4-alpha * Update package dependencies * Use modified node-buffers that does not use deprecated Array.get() * Update lodash dependency to 4.x & convert to new methods/etc. * Better 'noHistory' support for menu stack * Fix bug in download queue init * Misc code cleanup
This commit is contained in:
parent
1fc9fc1c90
commit
12d4c158c4
19 changed files with 277 additions and 277 deletions
|
@ -133,37 +133,34 @@ module.exports = class MenuStack {
|
|||
currentModuleInfo.savedState = currentModuleInfo.instance.getSaveState();
|
||||
|
||||
currentModuleInfo.instance.leave();
|
||||
|
||||
if(modInst.menuConfig.options.menuFlags.includes('noHistory')) {
|
||||
this.pop().instance.leave(); // leave & remove current
|
||||
}
|
||||
}
|
||||
|
||||
const noHistory = modInst.menuConfig.options.menuFlags.indexOf('noHistory') > -1;
|
||||
|
||||
const stackToLog = _.map(self.stack, stackEntry => stackEntry.name);
|
||||
|
||||
if(!noHistory) {
|
||||
self.push({
|
||||
name : name,
|
||||
instance : modInst,
|
||||
extraArgs : loadOpts.extraArgs,
|
||||
});
|
||||
|
||||
stackToLog.push(name);
|
||||
} else {
|
||||
stackToLog.push(`${name} (noHistory)`);
|
||||
}
|
||||
self.push({
|
||||
name : name,
|
||||
instance : modInst,
|
||||
extraArgs : loadOpts.extraArgs,
|
||||
});
|
||||
|
||||
// restore previous state if requested
|
||||
if(options && options.savedState) {
|
||||
modInst.restoreSavedState(options.savedState);
|
||||
}
|
||||
|
||||
modInst.enter();
|
||||
const stackEntries = self.stack.map(stackEntry => {
|
||||
let name = stackEntry.name;
|
||||
if(stackEntry.instance.menuConfig.options.menuFlags.length > 0) {
|
||||
name += ` (${stackEntry.instance.menuConfig.options.menuFlags.join(', ')})`;
|
||||
}
|
||||
return name;
|
||||
});
|
||||
|
||||
self.client.log.trace(
|
||||
{
|
||||
stack : stackToLog
|
||||
},
|
||||
'Updated menu stack'
|
||||
);
|
||||
self.client.log.trace( { stack : stackEntries }, 'Updated menu stack' );
|
||||
|
||||
modInst.enter();
|
||||
|
||||
if(cb) {
|
||||
cb(null);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue