This commit is contained in:
libccy 2016-03-20 10:25:27 +08:00
parent 7d0b30f077
commit 546308e9c5
5 changed files with 39 additions and 18 deletions

View File

@ -57,10 +57,18 @@
} }
window.resetGameTimeout=setTimeout(function(){ window.resetGameTimeout=setTimeout(function(){
if(window.inSplash) return; if(window.inSplash) return;
if(confirm('游戏似乎未正常载入,是否重置游戏?')){ if(window.resetExtension){
localStorage.clear(); if(confirm('游戏似乎未正常载入,是否禁用扩展并重新打开?')){
if(indexedDB) indexedDB.deleteDatabase('noname_0.9_data'); window.resetExtension();
window.location.reload(); window.location.reload();
}
}
else{
if(confirm('游戏似乎未正常载入,是否重置游戏?')){
localStorage.clear();
if(indexedDB) indexedDB.deleteDatabase('noname_0.9_data');
window.location.reload();
}
} }
},5000); },5000);
}()) }())

View File

@ -16,10 +16,9 @@
dieClose:[] dieClose:[]
}; };
var lib={ var lib={
version:'1.7.10', version:'1.7.11',
changeLog:[ changeLog:[
'新武将', '扩展'
'明忠锦囊',
], ],
configprefix:'noname_0.9_', configprefix:'noname_0.9_',
updates:[], updates:[],
@ -2988,21 +2987,34 @@
} }
} }
delete lib.help2; delete lib.help2;
if(lib.config.extensions.length){
window.resetExtension=function(){
for(var i=0;i<lib.config.extensions.length;i++){
game.saveConfig('extension_'+lib.config.extensions[i],false);
}
}
}
for(var i=0;i<lib.config.extensions.length;i++){ for(var i=0;i<lib.config.extensions.length;i++){
try{ try{
eval(localStorage.getItem(lib.configprefix+'extension_'+lib.config.extensions[i])); eval(localStorage.getItem(lib.configprefix+'extension_'+lib.config.extensions[i]));
} }
catch(e){} catch(e){
console.log(e);
}
if(game.importedPack&&lib.config['extension_'+game.importedPack.name]){ if(game.importedPack&&lib.config['extension_'+game.importedPack.name]){
var cfg={}; var cfg={};
for(var i in lib.config){ for(var j in lib.config){
if(i.indexOf('extension_'+game.importedPack.name)==0&& if(j.indexOf('extension_'+game.importedPack.name)==0&&
i!='extension_'+game.importedPack.name){ j!='extension_'+game.importedPack.name){
cfg[i.slice(11+game.importedPack.name.length)]=lib.config[i]; cfg[j.slice(11+game.importedPack.name.length)]=lib.config[j];
} }
} }
game.importedPack.content(cfg); try{
game.importedPack.content(cfg);
}
catch(e){
console.log(e);
}
delete game.importedPack; delete game.importedPack;
} }
} }
@ -17110,6 +17122,7 @@
clearTimeout(window.resetGameTimeout); clearTimeout(window.resetGameTimeout);
delete window.resetGameTimeout; delete window.resetGameTimeout;
delete window.resetExtension;
}, },
system:function(str,func,right){ system:function(str,func,right){
var node=ui.create.div(right?ui.system2:ui.system1); var node=ui.create.div(right?ui.system2:ui.system1);

View File

@ -1,6 +1,6 @@
{ {
"name": "noname", "name": "noname",
"xwalk_version": "1.7.10", "xwalk_version": "1.7.11",
"start_url": "index.html", "start_url": "index.html",
"icons": [ "icons": [
{ {

View File

@ -2139,7 +2139,7 @@ mode.chess={
ui.create.me(); ui.create.me();
ui.create.fakeme(); ui.create.fakeme();
if(!event.video&&_status.mode=='combat'&&get.config('zhu')){ if(!event.video&&_status.mode=='combat'&&get.config('zhu')&&!_status.vsboss&&game.players.length>2){
game.friendZhu=event.friendZhu; game.friendZhu=event.friendZhu;
game.friendZhu.hp++; game.friendZhu.hp++;
game.friendZhu.maxHp++; game.friendZhu.maxHp++;
@ -2157,7 +2157,7 @@ mode.chess={
} }
} }
if(get.config('main_zhu')){ if(get.config('main_zhu')&&event.friendViceZhu){
game.friendViceZhu=event.friendViceZhu; game.friendViceZhu=event.friendViceZhu;
game.friendViceZhu.node.identity.firstChild.innerHTML='仕'; game.friendViceZhu.node.identity.firstChild.innerHTML='仕';
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){

View File

@ -1,5 +1,5 @@
{ {
"name": "无名杀", "name": "无名杀",
"version": "1.7.10", "version": "1.7.11",
"main": "main.js" "main": "main.js"
} }