diff --git a/script/engine.js b/script/engine.js index 3c1c776..e1a159f 100644 --- a/script/engine.js +++ b/script/engine.js @@ -275,7 +275,7 @@ buttons: { 'export': { text: _('export'), - onChoose: Engine.export64 + nextScene: {1: 'inputExport'} }, 'import': { text: _('import'), @@ -287,6 +287,18 @@ } } }, + 'inputExport': { + text: [_('save this.')], + textarea: Engine.export64(), + readonly: true, + buttons: { + 'done': { + text: _('got it'), + nextScene: 'end', + onChoose: Engine.disableSelection + } + } + }, 'confirm': { text: [ _('are you sure?'), @@ -301,7 +313,7 @@ }, 'no': { text: _('no'), - nextScene: 'end' + nextScene: {1: 'start'} } } }, @@ -335,26 +347,8 @@ export64: function() { Engine.saveGame(); - var string64 = Engine.generateExport64(); Engine.enableSelection(); - Events.startEvent({ - title: _('Export'), - scenes: { - start: { - text: [_('save this.')], - textarea: string64, - readonly: true, - buttons: { - 'done': { - text: _('got it'), - nextScene: 'end', - onChoose: Engine.disableSelection - } - } - } - } - }); - Engine.autoSelect('#description textarea'); + return Engine.generateExport64(); }, import64: function(string64) { diff --git a/script/events.js b/script/events.js index 480bea7..a719a19 100644 --- a/script/events.js +++ b/script/events.js @@ -651,6 +651,7 @@ var Events = { if(scene.readonly) { ta.attr('readonly', true); } + Engine.autoSelect('#description textarea'); } // Draw any loot