mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 01:10:04 +02:00
RAWRRRR next level done
This commit is contained in:
parent
108ab07f93
commit
e4cf2f6faa
6 changed files with 159 additions and 78 deletions
|
@ -429,43 +429,32 @@ var NextLevelConfirm = ConfirmCancelTerminal.extend({
|
|||
var nextLevelName = (options.nextLevel) ?
|
||||
intl.getName(options.nextLevel) :
|
||||
'';
|
||||
var pluralNumCommands = (options.numCommands == 1) ? '' : 's';
|
||||
var pluralBest = (options.best == 1) ? '' : 's';
|
||||
|
||||
var markdowns = [
|
||||
'## Great Job!!',
|
||||
'',
|
||||
'You solved the level in **' + options.numCommands + '** command' + pluralNumCommands + '; ',
|
||||
'our solution uses ' + options.best + '. '
|
||||
];
|
||||
// lol hax
|
||||
var markdowns = intl.getDialog(require('../dialogs/nextLevel'))[0].options.markdowns;
|
||||
var markdown = markdowns.join('\n');
|
||||
markdown = intl.template(markdown, {
|
||||
numCommands: options.numCommands,
|
||||
best: options.best
|
||||
});
|
||||
|
||||
if (options.numCommands <= options.best) {
|
||||
markdowns.push(
|
||||
'Awesome! You matched or exceeded our solution. '
|
||||
);
|
||||
markdown = markdown + '\n\n' + intl.str('finish-dialog-win');
|
||||
} else {
|
||||
markdowns.push(
|
||||
'See if you can whittle it down to ' + options.best + ' command' + pluralBest + ' :D '
|
||||
);
|
||||
markdown = markdown + '\n\n' + intl.str('finish-dialog-lose', {best: options.best});
|
||||
}
|
||||
|
||||
markdown = markdown + '\n\n';
|
||||
if (options.nextLevel) {
|
||||
markdowns = markdowns.concat([
|
||||
'',
|
||||
'Would you like to move onto "' +
|
||||
nextLevelName + '", the next level?'
|
||||
]);
|
||||
markdown = markdown + intl.str('finish-dialog-next', {nextLevel: nextLevelName});
|
||||
} else {
|
||||
markdowns = markdowns.concat([
|
||||
'',
|
||||
'Wow!!! You finished the last level, congratulations!'
|
||||
]);
|
||||
markdown = markdown + intl.str('finish-dialog-finished');
|
||||
}
|
||||
|
||||
options = _.extend(
|
||||
{},
|
||||
options,
|
||||
{ markdowns: markdowns }
|
||||
{ markdown: markdown }
|
||||
);
|
||||
|
||||
NextLevelConfirm.__super__.initialize.apply(this, [options]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue