From 64a02c162c995e6555c2b213dc322761f75095fc Mon Sep 17 00:00:00 2001 From: Andrea Rendine Date: Sun, 17 May 2015 16:06:09 +0200 Subject: [PATCH] Modified command destination for save Export dialog replaces selection dialog, rather than overlapping it. Closing it exits the panel and returns to current game. Aborting Import dialog returns the player to the selection screen, so that s/he can save before trying to load. --- script/engine.js | 36 +++++++++++++++--------------------- script/events.js | 1 + 2 files changed, 16 insertions(+), 21 deletions(-) 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