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