mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-06-11 15:07:12 +08:00
Fixing whitespace conformity on engine.js
This commit is contained in:
+20
-46
@@ -317,12 +317,18 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
export64: function() {
|
generateExport64: function(){
|
||||||
Engine.saveGame();
|
|
||||||
var string64 = Base64.encode(localStorage.gameState);
|
var string64 = Base64.encode(localStorage.gameState);
|
||||||
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, '');
|
||||||
|
|
||||||
|
return string64;
|
||||||
|
},
|
||||||
|
|
||||||
|
export64: function() {
|
||||||
|
Engine.saveGame();
|
||||||
|
var string64 = Engine.generateExport64();
|
||||||
Engine.enableSelection();
|
Engine.enableSelection();
|
||||||
Events.startEvent({
|
Events.startEvent({
|
||||||
title: _('Export'),
|
title: _('Export'),
|
||||||
@@ -339,51 +345,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
Engine.autoSelect('#description textarea')
|
||||||
},
|
},
|
||||||
|
|
||||||
generateExport64: function(){
|
import64: function(string64) {
|
||||||
var string64 = Base64.encode(localStorage.gameState);
|
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, '');
|
||||||
|
var decodedSave = Base64.decode(string64);
|
||||||
return string64;
|
localStorage.gameState = decodedSave;
|
||||||
},
|
location.reload();
|
||||||
|
},
|
||||||
export64: function() {
|
|
||||||
Engine.saveGame();
|
|
||||||
var string64 = Engine.generateExport64();
|
|
||||||
Engine.enableSelection();
|
|
||||||
Events.startEvent({
|
|
||||||
title: _('Export'),
|
|
||||||
scenes: {
|
|
||||||
start: {
|
|
||||||
text: [_('save this.')],
|
|
||||||
textarea: string64,
|
|
||||||
buttons: {
|
|
||||||
'done': {
|
|
||||||
text: _('got it'),
|
|
||||||
nextScene: 'end',
|
|
||||||
onChoose: Engine.disableSelection
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Engine.autoSelect('#description textarea')
|
|
||||||
},
|
|
||||||
|
|
||||||
import64: function(string64) {
|
|
||||||
Engine.disableSelection();
|
|
||||||
string64 = string64.replace(/\s/g, '');
|
|
||||||
string64 = string64.replace(/\./g, '');
|
|
||||||
string64 = string64.replace(/\n/g, '');
|
|
||||||
var decodedSave = Base64.decode(string64);
|
|
||||||
localStorage.gameState = decodedSave;
|
|
||||||
location.reload();
|
|
||||||
},
|
|
||||||
|
|
||||||
event: function(cat, act) {
|
event: function(cat, act) {
|
||||||
if(typeof ga === 'function') {
|
if(typeof ga === 'function') {
|
||||||
|
|||||||
Reference in New Issue
Block a user