#1235 -- option to skip the intro dialog

This commit is contained in:
Peter Cottle 2025-03-30 09:02:20 -06:00
parent 79b5471273
commit 55fa0a4f35
3 changed files with 9 additions and 6 deletions

View file

@ -46,10 +46,12 @@ var LevelBuilder = Level.extend({
this.options = options;
var locale = LocaleStore.getLocale();
options.level.startDialog = {};
options.level.startDialog[locale] = {
childViews: intl.getDialog(require('../dialogs/levelBuilder'))
};
if (!options.skipIntro) {
options.level.startDialog = {};
options.level.startDialog[locale] = {
childViews: intl.getDialog(require('../dialogs/levelBuilder')),
};
}
// if we are editing a level our behavior is a bit different
var editLevelJSON;

View file

@ -184,7 +184,7 @@ var regexMap = {
'level': /^level\s?([a-zA-Z0-9]*)/,
'levels': /^levels($|\s)/,
'mobileAlert': /^mobile alert($|\s)/,
'build level': /^build +level\s?([a-zA-Z0-9]*)$/,
'build level': /^build +level\s?([a-zA-Z0-9]*)( +--skipIntro)?$/,
'export tree': /^export +tree$/,
'importTreeNow': /^importTreeNow($|\s)/,
'importLevelNow': /^importLevelNow($|\s)/,

View file

@ -210,7 +210,8 @@ var Sandbox = Backbone.View.extend({
var toEdit = regexResults[1] || false;
this.levelBuilder = new LevelBuilder({
deferred: whenBuilderOpen,
editLevel: toEdit
editLevel: toEdit,
skipIntro: command.attributes.rawStr.indexOf('skipIntro') !== -1,
});
whenBuilderOpen.promise.then(function() {
command.finishWith(deferred);