mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
Expand import dialog to a textarea
This commit is contained in:
+19
-4
@@ -231,14 +231,29 @@ var Engine = {
|
||||
buttons: {
|
||||
'yes': {
|
||||
text: 'yes',
|
||||
nextScene: 'end',
|
||||
onChoose: Engine.import64
|
||||
nextScene: {1: 'inputImport'},
|
||||
onChoose: Engine.enableSelection
|
||||
},
|
||||
'no': {
|
||||
text: 'no',
|
||||
nextScene: 'end'
|
||||
}
|
||||
}
|
||||
},
|
||||
'inputImport': {
|
||||
text: ['put the save code here.'],
|
||||
textarea: '',
|
||||
buttons: {
|
||||
'okay': {
|
||||
text: 'okay',
|
||||
nextScene: 'end',
|
||||
onChoose: Engine.import64
|
||||
},
|
||||
'cancel': {
|
||||
text: 'cancel',
|
||||
nextScene: 'end'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -269,8 +284,8 @@ var Engine = {
|
||||
});
|
||||
},
|
||||
|
||||
import64: function() {
|
||||
var string64 = prompt("put the save code here.","");
|
||||
import64: function(string64) {
|
||||
Engine.disableSelection();
|
||||
string64 = string64.replace(/\s/g, '');
|
||||
string64 = string64.replace(/\./g, '');
|
||||
string64 = string64.replace(/\n/g, '');
|
||||
|
||||
+3
-2
@@ -611,7 +611,7 @@ var Events = {
|
||||
$('<div>').text(scene.text[i]).appendTo(desc);
|
||||
}
|
||||
|
||||
if(scene.textarea) {
|
||||
if(scene.textarea != null) {
|
||||
$('<textarea>').val(scene.textarea).appendTo(desc);
|
||||
}
|
||||
|
||||
@@ -690,7 +690,8 @@ var Events = {
|
||||
}
|
||||
|
||||
if(typeof info.onChoose == 'function') {
|
||||
info.onChoose();
|
||||
var textarea = Events.eventPanel().find('textarea');
|
||||
info.onChoose(textarea.length > 0 ? textarea.val() : null);
|
||||
}
|
||||
|
||||
// Reward
|
||||
|
||||
Reference in New Issue
Block a user