mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-28 05:26:10 +02:00
Removed additional cursor position reports.
This commit is contained in:
parent
5cb239157c
commit
77e4425df6
3 changed files with 19 additions and 34 deletions
|
@ -56,7 +56,7 @@ exports.MenuModule = class MenuModule extends PluginModule {
|
|||
initSequence() {
|
||||
const self = this;
|
||||
const mciData = {};
|
||||
let pausePosition;
|
||||
let pausePosition = {row: 0, column: 0};
|
||||
|
||||
const hasArt = () => {
|
||||
return _.isString(self.menuConfig.art) ||
|
||||
|
@ -84,19 +84,14 @@ exports.MenuModule = class MenuModule extends PluginModule {
|
|||
self.client.log.trace('Could not display art', { art : self.menuConfig.art, reason : err.message } );
|
||||
} else {
|
||||
mciData.menu = artData.mciMap;
|
||||
pausePosition.row = artData.height + 1;
|
||||
}
|
||||
|
||||
|
||||
return callback(null); // any errors are non-fatal
|
||||
}
|
||||
);
|
||||
},
|
||||
function moveToPromptLocation(callback) {
|
||||
if(self.menuConfig.prompt) {
|
||||
// :TODO: fetch and move cursor to prompt location, if supplied. See notes/etc. on placements
|
||||
}
|
||||
|
||||
return callback(null);
|
||||
},
|
||||
function displayPromptArt(callback) {
|
||||
if(!_.isString(self.menuConfig.prompt)) {
|
||||
return callback(null);
|
||||
|
@ -106,30 +101,21 @@ exports.MenuModule = class MenuModule extends PluginModule {
|
|||
return callback(Errors.MissingConfig('Prompt specified but no "promptConfig" block found'));
|
||||
}
|
||||
|
||||
|
||||
self.displayAsset(
|
||||
self.menuConfig.promptConfig.art,
|
||||
self.menuConfig.config,
|
||||
(err, artData) => {
|
||||
if(artData) {
|
||||
mciData.prompt = artData.mciMap;
|
||||
(err, promptArtData) => {
|
||||
if(promptArtData) {
|
||||
mciData.prompt = promptArtData.mciMap;
|
||||
}
|
||||
if(promptArtData.height != null) {
|
||||
pausePosition.row = pausePosition.row + promptArtData.height;
|
||||
}
|
||||
return callback(err); // pass err here; prompts *must* have art
|
||||
}
|
||||
);
|
||||
},
|
||||
function recordCursorPosition(callback) {
|
||||
if(!self.shouldPause()) {
|
||||
return callback(null); // cursor position not needed
|
||||
}
|
||||
|
||||
self.client.once('cursor position report', pos => {
|
||||
pausePosition = { row : pos[0], col : 1 };
|
||||
self.client.log.trace('After art position recorded', pausePosition );
|
||||
return callback(null);
|
||||
});
|
||||
|
||||
self.client.term.rawWrite(ansi.queryPos());
|
||||
},
|
||||
function afterArtDisplayed(callback) {
|
||||
return self.mciReady(mciData, callback);
|
||||
},
|
||||
|
@ -512,7 +498,7 @@ exports.MenuModule = class MenuModule extends PluginModule {
|
|||
|
||||
this.optionalMoveToPosition(position);
|
||||
|
||||
return theme.displayThemedPause(this.client, cb);
|
||||
return theme.displayThemedPause(this.client, position, cb);
|
||||
}
|
||||
|
||||
promptForInput( { formName, formId, promptName, prevFormName, position } = {}, options, cb) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue