@sprucelabs/spruce-cli
Version:
Command line interface for building Spruce skills.
52 lines • 1.84 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const onboarding_short_script_1 = require("./onboarding.short.script");
const script = [
(player) => player.ui.clear(),
(player) => (0, onboarding_short_script_1.renderEnter)(player),
'You return to the doors in the forest and enter the one on the left.',
'"Welcome back!", shouts Sprucebot.',
'"It looks like you\'re supposed to be running"',
(player) => {
const stage = player.onboardingStore.getStage();
(0, onboarding_short_script_1.renderCommand)(player.ui, `spruce ${stage}`);
},
async (player) => {
const stage = player.onboardingStore.getStage();
const answer = await player.ui.prompt({
type: 'select',
label: "Lemme know what you'd like to do",
options: {
choices: [
{
label: `Run \`spruce ${stage}\` for me!`,
value: 'run',
},
{
label: `Start over`,
value: 'startOver',
},
{
label: `Stop onboarding`,
value: 'stop',
},
],
},
});
switch (answer) {
case 'startOver':
player.onboardingStore.reset();
player.ui.clear();
return player.redirect('onboarding.first');
case 'stop':
player.onboardingStore.reset();
break;
case 'run':
await player.executeCommand(stage);
break;
}
return;
},
];
exports.default = script;
//# sourceMappingURL=onboarding.returning.script.js.map
;