This commit is contained in:
libccy 2016-08-06 18:27:03 +08:00
parent f47dff8e38
commit 3bcac99de6
1 changed files with 42 additions and 29 deletions

View File

@ -58,7 +58,7 @@
configprefix:'noname_0.9_', configprefix:'noname_0.9_',
versionOL:12, versionOL:12,
updateURL:localStorage.getItem('noname_update_url')||'http://websha.cn/', updateURL:localStorage.getItem('noname_update_url')||'http://websha.cn/',
devURL:'https://raw.githubusercontent.com/libccy/noname/master/', devURL:'https://rawgit.com/libccy/noname/master/',
assetURL:'', assetURL:'',
hallURL:'websha.cn', hallURL:'websha.cn',
changeLog:[], changeLog:[],
@ -146,27 +146,6 @@
general:{ general:{
name:'通用', name:'通用',
config:{ config:{
cheat:{
name:'开发者模式',
init:false,
onclick:function(bool){
game.saveConfig('cheat',bool);
if(_status.connectMode) return;
if(bool){
lib.cheat.i();
}
else{
delete window.cheat;
delete window.game;
delete window.ui;
delete window.get;
delete window.ai;
delete window.lib;
delete window._status;
}
},
unfrequent:true,
},
low_performance:{ low_performance:{
name:'流畅模式', name:'流畅模式',
init:false, init:false,
@ -389,6 +368,27 @@
init:false, init:false,
unfrequent:true unfrequent:true
}, },
cheat:{
name:'开发者模式',
init:false,
onclick:function(bool){
game.saveConfig('cheat',bool);
if(_status.connectMode) return;
if(bool){
lib.cheat.i();
}
else{
delete window.cheat;
delete window.game;
delete window.ui;
delete window.get;
delete window.ai;
delete window.lib;
delete window._status;
}
},
unfrequent:true,
},
update:function(config,map){ update:function(config,map){
if(config.touchscreen){ if(config.touchscreen){
map.mousewheel.hide(); map.mousewheel.hide();
@ -23921,7 +23921,7 @@
}; };
var script=lib.init.js(lib.updateURL,'game/update',function(){ var script=lib.init.js(dev?lib.devURL:lib.updateURL,'game/update',function(){
button1.disabled=false; button1.disabled=false;
button1.innerHTML='检查游戏更新'; button1.innerHTML='检查游戏更新';
button3.disabled=false; button3.disabled=false;
@ -23945,7 +23945,7 @@
else{ else{
bool=(update.version!=lib.version); bool=(update.version!=lib.version);
} }
if(bool){ if(bool||dev){
var files; var files;
var version=lib.version; var version=lib.version;
if(version.indexOf('beta')!=-1){ if(version.indexOf('beta')!=-1){
@ -23954,12 +23954,25 @@
if(update.files&&update.files[version]){ if(update.files&&update.files[version]){
files=update.files.global.concat(update.files[version]); files=update.files.global.concat(update.files[version]);
} }
var str='有新版本'+update.version+'可用,是否下载?'; var str;
if(dev){
str='开发版仅供测试使用,可能存在风险,是否确定更新?'
}
else{
str='有新版本'+update.version+'可用,是否下载?';
}
if(navigator.notification&&navigator.notification.confirm){ if(navigator.notification&&navigator.notification.confirm){
var str2=update.changeLog[0]; var str2;
for(var i=1;i<update.changeLog.length;i++){ if(dev){
str2+=''+update.changeLog[i]; str2=str;
} str='更新到开发版';
}
else{
str2=update.changeLog[0];
for(var i=1;i<update.changeLog.length;i++){
str2+=''+update.changeLog[i];
}
}
navigator.notification.confirm( navigator.notification.confirm(
str2, str2,
function(index){ function(index){