new(core.gbapp): SHOW MENU BASIC keyword added.

This commit is contained in:
Rodrigo Rodriguez 2020-12-11 07:35:55 -03:00
parent 233881b5ff
commit df42da1bff
2 changed files with 11 additions and 2 deletions

View file

@ -479,9 +479,11 @@ export class DialogClass {
return [year, month, day].join('/'); return [year, month, day].join('/');
} }
} }
public async isAffirmative(step, text) { public async isAffirmative(step, text) {
return text.toLowerCase().match(Messages['pt-BR'].affirmative_sentences); // TODO: Dynamitize. return text.toLowerCase().match(Messages['pt-BR'].affirmative_sentences); // TODO: Dynamitize.
} }
public async exit(step) { public async exit(step) {
await step.endDialog(); await step.endDialog();
} }
@ -539,8 +541,8 @@ export class DialogClass {
} }
} }
public async askEmail(step) { public async showMenu(step) {
return await step.beginDialog('/gbasic-email'); return await step.beginDialog('/menu');
} }
public async transfer(step) { public async transfer(step) {

View file

@ -257,6 +257,10 @@ export class GBVMService extends GBService {
return `exit (step)\n`; return `exit (step)\n`;
}); });
code = code.replace(/(show menu)/gi, () => {
return `showMenu (step)\n`;
});
code = code.replace(/(talk to)(\s)(.*)/gi, ($0, $1, $2, $3) => { code = code.replace(/(talk to)(\s)(.*)/gi, ($0, $1, $2, $3) => {
return `sys().talkTo(${$3})\n`; return `sys().talkTo(${$3})\n`;
}); });
@ -425,6 +429,9 @@ export class GBVMService extends GBService {
code = code.replace(/("[^"]*"|'[^']*')|\bexit\b/gi, ($0, $1) => { code = code.replace(/("[^"]*"|'[^']*')|\bexit\b/gi, ($0, $1) => {
return $1 === undefined ? 'this.exit' : $1; return $1 === undefined ? 'this.exit' : $1;
}); });
code = code.replace(/("[^"]*"|'[^']*')|\bmenu\b/gi, ($0, $1) => {
return $1 === undefined ? 'this.menu' : $1;
});
// await insertion. // await insertion.