Allow to run user scenarios

This commit is contained in:
Victor 2015-12-22 14:09:28 +02:00
parent 0237933645
commit 3ed231e773

View File

@ -1,4 +1,4 @@
/* global rpyscript, TextUtils */
/* global rpyscript, TextUtils, userscenario */
var baseResDir = '/resources/es/';
var ViewActivity = null;
@ -12,7 +12,7 @@ function run(data) {
}
$(document).ready(function() {
if ( (typeof rpyscript === 'undefined') || TextUtils.isEmpty(rpyscript)) {
if ( (typeof rpyscript === 'undefined') || TextUtils.isEmpty(rpyscript)) {
rpyscript = "undefined";
run('play music music_list["everlasting_summer"]\n' +
'scene bg ext_square_day\n' +
@ -25,6 +25,8 @@ $(document).ready(function() {
'show un smile2 pioneer at center\n' +
'all "Приглашаем тебя в Бесконечное Лето!"');
} else {
$.get("/resources/es/scripts/" + rpyscript + ".rpy", run);
var scriptDir = (typeof userscenario === 'undefined' && userscenario)
? "scripts" : "userscenarios";
$.get("/resources/es/" + scriptDir + "/" + rpyscript + ".rpy", run);
}
});