',importExtension);
- promptnode.style.display='none';
- importExtension.firstChild.lastChild.onclick=function(){
- if(promptnode.style.display!='none') return;
- var fileToLoad=this.previousSibling.files[0];
- if(fileToLoad){
- promptnode.style.display='';
- promptnode.firstChild.innerHTML='正在解压...';
- var fileReader = new FileReader();
- fileReader.onload = function(fileLoadedEvent)
- {
- var data = fileLoadedEvent.target.result;
- var loadData=function(){
- var zip=new JSZip();
- zip.load(data);
- var images=[],audios=[],fonts=[],directories={},directorylist=[];
- for(var i in zip.files){
- var ext=i.slice(i.lastIndexOf('.')+1);
- if(i.indexOf('audio/')==0&&(ext=='mp3'||ext=='ogg')){
- audios.push(i);
- }
- else if(i.indexOf('font/')==0&&ext=='ttf'){
- fonts.push(i);
- }
- else if(i.indexOf('image/')==0&&(ext=='jpg'||ext=='png')){
- images.push(i);
- }
- else{
- continue;
- }
- var index=i.lastIndexOf('/');
- var str=i.slice(0,index);
- if(!directories[str]){
- directories[str]=[];
- directorylist.push(str);
- }
- directories[str].push(i.slice(index+1));
- }
- if(audios.length||fonts.length||images.length){
- var str='';
- if(audios.length){
- str+=audios.length+'个音频文件';
- }
- if(fonts.length){
- if(str.length) str+='、'
- str+=fonts.length+'个字体文件';
- }
- if(images.length){
- if(str.length) str+='、'
- str+=images.length+'个图片文件';
- }
- var filelist=audios.concat(fonts).concat(images);
- if(filelist.length>200){
- str+=',导入时间可能较长';
- }
- var assetLoaded=function(){
- promptnode.firstChild.innerHTML='导入成功。
重新启动×';
- promptnode.firstChild.querySelectorAll('span')[0].onclick=game.reload;
- promptnode.firstChild.querySelectorAll('span')[1].onclick=function(){
- promptnode.style.display='none';
+ var importextensionexpanded=false;
+ var importExtension;
+ var extensionnode=ui.create.div('.config.more','导入素材包
>
',pageboard,function(){
+ if(importextensionexpanded){
+ this.classList.remove('on');
+ importExtension.style.display='none';
+ }
+ else{
+ this.classList.add('on');
+ importExtension.style.display='';
+ }
+ importextensionexpanded=!importextensionexpanded;
+ });
+ extensionnode.style.padding='13px 33px 4px';
+ extensionnode.style.left='0px';
+ importExtension=ui.create.div('.new_character.export.import',pageboard);
+ importExtension.style.padding='0px 33px 10px';
+ importExtension.style.display='none';
+ importExtension.style.width='100%';
+ importExtension.style.textAlign='left';
+ ui.create.div('','
',importExtension);
+ var promptnode=ui.create.div('','
',importExtension);
+ promptnode.style.display='none';
+ importExtension.firstChild.lastChild.onclick=function(){
+ if(promptnode.style.display!='none') return;
+ var fileToLoad=this.previousSibling.files[0];
+ if(fileToLoad){
+ promptnode.style.display='';
+ promptnode.firstChild.innerHTML='正在解压...';
+ var fileReader = new FileReader();
+ fileReader.onload = function(fileLoadedEvent)
+ {
+ var data = fileLoadedEvent.target.result;
+ var loadData=function(){
+ var zip=new JSZip();
+ zip.load(data);
+ var images=[],audios=[],fonts=[],directories={},directorylist=[];
+ for(var i in zip.files){
+ var ext=i.slice(i.lastIndexOf('.')+1);
+ if(i.indexOf('audio/')==0&&(ext=='mp3'||ext=='ogg')){
+ audios.push(i);
}
- };
- if(confirm('本次将导入'+str+',是否继续?')){
- promptnode.firstChild.innerHTML='正在导入...
详细信息';
- promptnode.firstChild.querySelector('span.hrefnode').onclick=ui.click.consoleMenu;
- if(lib.node&&lib.node.fs){
- var writeFile=function(){
- if(filelist.length){
- var str=filelist.shift();
- game.print(str.slice(str.lastIndexOf('/')+1));
- lib.node.fs.writeFile(__dirname+'/'+str,zip.files[str].asNodeBuffer(),null,writeFile);
- }
- else{
- assetLoaded();
- }
- };
- game.ensureDirectory(directorylist,writeFile);
-
+ else if(i.indexOf('font/')==0&&ext=='ttf'){
+ fonts.push(i);
+ }
+ else if(i.indexOf('image/')==0&&(ext=='jpg'||ext=='png')){
+ images.push(i);
}
else{
- var getDirectory=function(){
- if(directorylist.length){
- var dir=directorylist.shift();
- var filelist=directories[dir];
- window.resolveLocalFileSystemURL(lib.assetURL+dir,function(entry){
- var writeFile=function(){
- if(filelist.length){
- var filename=filelist.shift();
- game.print(filename);
- entry.getFile(filename,{create:true},function(fileEntry){
- fileEntry.createWriter(function(fileWriter){
- fileWriter.onwriteend=writeFile;
- fileWriter.onerror = function(e) {
- game.print('Write failed: ' + e.toString());
- };
- fileWriter.write(zip.files[dir+'/'+filename].asArrayBuffer());
+ continue;
+ }
+ var index=i.lastIndexOf('/');
+ var str=i.slice(0,index);
+ if(!directories[str]){
+ directories[str]=[];
+ directorylist.push(str);
+ }
+ directories[str].push(i.slice(index+1));
+ }
+ if(audios.length||fonts.length||images.length){
+ var str='';
+ if(audios.length){
+ str+=audios.length+'个音频文件';
+ }
+ if(fonts.length){
+ if(str.length) str+='、'
+ str+=fonts.length+'个字体文件';
+ }
+ if(images.length){
+ if(str.length) str+='、'
+ str+=images.length+'个图片文件';
+ }
+ var filelist=audios.concat(fonts).concat(images);
+ if(filelist.length>200){
+ str+=',导入时间可能较长';
+ }
+ var assetLoaded=function(){
+ promptnode.firstChild.innerHTML='导入成功。
重新启动×';
+ promptnode.firstChild.querySelectorAll('span')[0].onclick=game.reload;
+ promptnode.firstChild.querySelectorAll('span')[1].onclick=function(){
+ promptnode.style.display='none';
+ }
+ };
+ if(confirm('本次将导入'+str+',是否继续?')){
+ promptnode.firstChild.innerHTML='正在导入...
详细信息';
+ promptnode.firstChild.querySelector('span.hrefnode').onclick=ui.click.consoleMenu;
+ if(lib.node&&lib.node.fs){
+ var writeFile=function(){
+ if(filelist.length){
+ var str=filelist.shift();
+ game.print(str.slice(str.lastIndexOf('/')+1));
+ lib.node.fs.writeFile(__dirname+'/'+str,zip.files[str].asNodeBuffer(),null,writeFile);
+ }
+ else{
+ assetLoaded();
+ }
+ };
+ game.ensureDirectory(directorylist,writeFile);
+
+ }
+ else{
+ var getDirectory=function(){
+ if(directorylist.length){
+ var dir=directorylist.shift();
+ var filelist=directories[dir];
+ window.resolveLocalFileSystemURL(lib.assetURL+dir,function(entry){
+ var writeFile=function(){
+ if(filelist.length){
+ var filename=filelist.shift();
+ game.print(filename);
+ entry.getFile(filename,{create:true},function(fileEntry){
+ fileEntry.createWriter(function(fileWriter){
+ fileWriter.onwriteend=writeFile;
+ fileWriter.onerror = function(e) {
+ game.print('Write failed: ' + e.toString());
+ };
+ fileWriter.write(zip.files[dir+'/'+filename].asArrayBuffer());
+ });
});
- });
- }
- else{
- getDirectory();
- }
- };
- writeFile();
- });
- }
- else{
- assetLoaded();
- }
- };
- game.ensureDirectory(directorylist,getDirectory);
+ }
+ else{
+ getDirectory();
+ }
+ };
+ writeFile();
+ });
+ }
+ else{
+ assetLoaded();
+ }
+ };
+ game.ensureDirectory(directorylist,getDirectory);
+ }
+ }
+ else{
+ promptnode.style.display='none';
}
}
else{
- promptnode.style.display='none';
+ alert('没有检测到素材');
}
}
- else{
- alert('没有检测到素材');
+ if(!window.JSZip){
+ lib.init.js(lib.assetURL+'game','jszip',loadData);
}
- }
- if(!window.JSZip){
- lib.init.js(lib.assetURL+'game','jszip',loadData);
- }
- else{
- loadData();
- }
- };
- fileReader.readAsArrayBuffer(fileToLoad, "UTF-8");
- }
- }
-
- var dashboard=ui.create.div(pageboard);
- var clickDash=function(){
- ui.create.templayer();
- pageboard.hide();
- this.link.show();
- if(this.link.init){
- this.link.init();
- }
- };
- var createDash=function(str1,str2,node){
- var dash=ui.create.div('.menubutton.large.dashboard');
- dashboard.appendChild(dash);
- page.appendChild(node);
- dash.link=node;
- node.link=dash;
- dash.listen(clickDash);
- lib.setScroll(node);
- ui.create.div('',str1,dash);
- ui.create.div('',str2,dash);
- };
- var createDash2=function(str1,str2,path,page){
- var dash=ui.create.div('.menubutton.large.dashboard.dashboard2');
- page.appendChild(dash);
- dash.listen(function(){
- page.path=path;
- enterDirectory(page,path);
- });
- ui.create.div('',str1,dash);
- ui.create.div('',str2,dash);
- };
- var removeFile=function(selected,page){
- if(lib.node&&lib.node.fs){
- var unlink=function(){
- if(selected.length){
- lib.node.fs.unlink(__dirname+'/'+selected.shift().path,unlink);
- }
- else{
- enterDirectory(page,page.currentpath);
- }
+ else{
+ loadData();
+ }
+ };
+ fileReader.readAsArrayBuffer(fileToLoad, "UTF-8");
}
- unlink();
}
- else{
- window.resolveLocalFileSystemURL(lib.assetURL+page.currentpath,function(entry){
+
+ var dashboard=ui.create.div(pageboard);
+ var clickDash=function(){
+ ui.create.templayer();
+ pageboard.hide();
+ this.link.show();
+ if(this.link.init){
+ this.link.init();
+ }
+ };
+ var createDash=function(str1,str2,node){
+ var dash=ui.create.div('.menubutton.large.dashboard');
+ dashboard.appendChild(dash);
+ page.appendChild(node);
+ dash.link=node;
+ node.link=dash;
+ dash.listen(clickDash);
+ lib.setScroll(node);
+ ui.create.div('',str1,dash);
+ ui.create.div('',str2,dash);
+ };
+ var createDash2=function(str1,str2,path,page){
+ var dash=ui.create.div('.menubutton.large.dashboard.dashboard2');
+ page.appendChild(dash);
+ dash.listen(function(){
+ page.path=path;
+ enterDirectory(page,path);
+ });
+ ui.create.div('',str1,dash);
+ ui.create.div('',str2,dash);
+ };
+ var removeFile=function(selected,page){
+ if(lib.node&&lib.node.fs){
var unlink=function(){
if(selected.length){
- entry.getFile(selected.shift().filename,{create:false},function(fileEntry){
- fileEntry.remove(unlink);
- });
+ lib.node.fs.unlink(__dirname+'/'+selected.shift().path,unlink);
}
else{
enterDirectory(page,page.currentpath);
}
}
unlink();
- });
- }
- };
- var clickDirectory=function(){
- if(_status.dragged) return;
- var page=this.parentNode.parentNode.parentNode;
- if(page.deletebutton.classList.contains('active')){
- if(confirm('确认删除'+this.innerHTML+'文件夹?(此操作不可撤销)')){
- if(lib.node&&lib.node.fs){
- try{
- var removeDirectory=function(path,callback){
- lib.node.fs.readdir(__dirname+'/'+path,function(err,list){
- if(err){
- console.log(err);
- return;
- }
- var removeFile=function(){
- if(list.length){
- var filename=list.shift();
- var url=__dirname+'/'+path+'/'+filename;
- if(lib.node.fs.statSync(url).isDirectory()){
- removeDirectory(path+'/'+filename,removeFile);
- }
- else{
- lib.node.fs.unlink(url,removeFile);
- }
- }
- else{
- lib.node.fs.rmdir(__dirname+'/'+path,callback);
- }
- }
- removeFile();
+ }
+ else{
+ window.resolveLocalFileSystemURL(lib.assetURL+page.currentpath,function(entry){
+ var unlink=function(){
+ if(selected.length){
+ entry.getFile(selected.shift().filename,{create:false},function(fileEntry){
+ fileEntry.remove(unlink);
});
- };
- removeDirectory(this.path,function(){
+ }
+ else{
enterDirectory(page,page.currentpath);
- });
+ }
}
- catch(e){
- console.log(e);
- }
- }
- else{
- window.resolveLocalFileSystemURL(lib.assetURL+this.path,function(entry){
- entry.removeRecursively(function(){
- enterDirectory(page,page.currentpath);
- });
- });
- }
- }
- return;
- }
- enterDirectory(page,this.path);
- };
- var clickFile=function(){
- if(_status.dragged) return;
- var page=this.parentNode.parentNode.parentNode;
- if(page.deletebutton.classList.contains('active')){
- if(confirm('确认删除'+this.innerHTML+'?(此操作不可撤销)')){
- removeFile([this],page);
- }
- return;
- }
- this.classList.toggle('thundertext');
- page.clicked=true;
- if(this.ext=='jpg'||this.ext=='png'){
- if(this.classList.contains('thundertext')){
- if(!this.previewnode){
- this.previewnode=document.createElement('img');
- this.previewnode.src=lib.assetURL+this.path;
- this.previewnode.width='60';
- this.previewnode.style.maxHeight='120px';
- this.parentNode.appendChild(this.previewnode);
- }
- }
- else{
- if(this.previewnode){
- this.previewnode.remove();
- delete this.previewnode;
- }
- }
- }
- else if(this.ext=='mp3'||this.ext=='ogg'){
- if(this.classList.contains('thundertext')){
- if(!this.previewnode){
- this.previewnode=game.playAudio(this.path.slice(6));
- }
- }
- else{
- if(this.previewnode){
- this.previewnode.remove();
- delete this.previewnode;
- }
- }
- }
- };
- var clickFileList=function(){
- if(!this.parentNode) return;
- if(this.parentNode.clicked){
- this.parentNode.clicked=false;
- }
- else{
- var selected=Array.from(this.querySelectorAll('span.thundertext'));
- for(var i=0;i
b) return 1;
- if(a'+folders[i],filelist);
- entry.firstChild.addEventListener(lib.config.touchscreen?'touchend':'click',clickDirectory);
- entry.firstChild.path=parent+folders[i]
- }
- for(var i=0;i'+files[i],filelist);
- entry.firstChild.addEventListener(lib.config.touchscreen?'touchend':'click',clickFile);
- entry.firstChild.ext=files[i].slice(files[i].lastIndexOf('.')+1);
- entry.firstChild.path=parent+files[i];
- entry.firstChild.filename=files[i];
}
- });
+ };
+ var enterDirectory=function(page,path){
+ page.innerHTML='';
+ page.currentpath=path;
+ var backbutton=ui.create.div('.menubutton.round','返',page,function(){
+ page.clicked=false;
+ clickFileList.call(filelist);
+ if(page.path==path){
+ page.reset();
+ }
+ else{
+ if(path.indexOf('/')==-1){
+ enterDirectory(page,'');
+ }
+ else{
+ enterDirectory(page,path.slice(0,path.lastIndexOf('/')));
+ }
+ }
+ });
+ backbutton.style.zIndex=1;
+ backbutton.style.right='10px';
+ backbutton.style.bottom='15px';
+
+
+ var refresh=function(){
+ enterDirectory(page,path);
+ };
+ var addbutton=ui.create.div('.menubutton.round','添',page,function(){
+ var pos1=this.getBoundingClientRect();
+ var pos2=ui.window.getBoundingClientRect();
+ openMenu(this.menu,{
+ clientX:pos1.left+pos1.width+5-pos2.left,
+ clientY:pos1.top-pos2.top
+ });
+ });
+ addbutton.menu=ui.create.div('.menu');
+ ui.create.div('','添加文件',addbutton.menu,function(){
+ popupContainer.noclose=true;
+ });
+ var createDir=function(str){
+ if(lib.node&&lib.node.fs){
+ lib.node.fs.mkdir(__dirname+'/'+path+'/'+str,refresh);
+ }
+ else{
+ window.resolveLocalFileSystemURL(lib.assetURL+path,function(entry){
+ entry.getDirectory(str,{create:true},refresh);
+ });
+ }
+ };
+ ui.create.div('','添加目录',addbutton.menu,function(){
+ ui.create.templayer();
+ game.prompt('输入目录名称',function(str){
+ if(str){
+ createDir(str);
+ }
+ });
+ });
+ var input=document.createElement('input');
+ input.className='fileinput';
+ input.type='file';
+ input.onchange=function(){
+ var fileToLoad=input.files[0];
+ game.print(fileToLoad.name);
+ if(fileToLoad){
+ var fileReader = new FileReader();
+ fileReader.onload = function(e){
+ game.writeFile(e.target.result,path,fileToLoad.name,refresh);
+ };
+ fileReader.readAsArrayBuffer(fileToLoad, "UTF-8");
+ }
+ };
+ addbutton.menu.firstChild.appendChild(input);
+ addbutton.style.zIndex=1;
+ addbutton.style.right='10px';
+ addbutton.style.bottom='80px';
+
+ var deletebutton=ui.create.div('.menubutton.round','删',page,function(){
+ if(!this.parentNode) return;
+ if(!this.classList.contains('active')){
+ var selected=Array.from(filelist.querySelectorAll('span.thundertext'));
+ if(selected.length){
+ if(confirm('一共要删除'+selected.length+'个文件,此操作不可撤销,是否确定?')){
+ removeFile(selected,page);
+ }
+ }
+ else{
+ this.classList.add('active');
+ }
+ }
+ else{
+ this.classList.remove('active');
+ }
+ });
+ deletebutton.style.zIndex=1;
+ deletebutton.style.right='10px';
+ deletebutton.style.bottom='145px';
+
+ page.backbutton=backbutton;
+ page.addbutton=addbutton;
+ page.deletebutton=deletebutton;
+ var filelist=ui.create.div(page);
+ filelist.classList.add('file-container');
+ filelist.listen(clickFileList);
+ lib.setScroll(filelist);
+ game.getFileList(path,function(folders,files){
+ var sort=function(a,b){
+ if(a>b) return 1;
+ if(a'+folders[i],filelist);
+ entry.firstChild.addEventListener(lib.config.touchscreen?'touchend':'click',clickDirectory);
+ entry.firstChild.path=parent+folders[i]
+ }
+ for(var i=0;i'+files[i],filelist);
+ entry.firstChild.addEventListener(lib.config.touchscreen?'touchend':'click',clickFile);
+ entry.firstChild.ext=files[i].slice(files[i].lastIndexOf('.')+1);
+ entry.firstChild.path=parent+files[i];
+ entry.firstChild.filename=files[i];
+ }
+ });
+ };
+ var dash1=(function(){
+ var page=ui.create.div('.hidden.menu-buttons');
+ page.reset=function(){
+ page.innerHTML='';
+ var backbutton=ui.create.div('.menubutton.round','返',page,function(){
+ ui.create.templayer();
+ page.hide();
+ pageboard.show();
+ });
+ backbutton.style.zIndex=1;
+ backbutton.style.right='10px';
+ backbutton.style.bottom='15px';
+ var placeholder=ui.create.div('.placeholder',page);
+ placeholder.style.position='relative';
+ placeholder.style.display='block';
+ placeholder.style.width='100%';
+ placeholder.style.height='14px';
+ createDash2('将','武将图片','image/character',page);
+ createDash2('肤','皮肤图片','image/skin',page);
+ createDash2('卡','卡牌图片','image/card',page);
+ createDash2('模','模式图片','image/mode',page);
+ createDash2('始','开始图片','image/splash',page);
+ createDash2('景','背景图片','image/background',page);
+ };
+ page.reset();
+ return page;
+ }());
+ var dash2=(function(){
+ var page=ui.create.div('.hidden.menu-buttons');
+ page.reset=function(){
+ page.innerHTML='';
+ var backbutton=ui.create.div('.menubutton.round','返',page,function(){
+ ui.create.templayer();
+ page.hide();
+ pageboard.show();
+ });
+ backbutton.style.zIndex=1;
+ backbutton.style.right='10px';
+ backbutton.style.bottom='15px';
+ var placeholder=ui.create.div('.placeholder',page);
+ placeholder.style.position='relative';
+ placeholder.style.display='block';
+ placeholder.style.width='100%';
+ placeholder.style.height='14px';
+ createDash2('技','技能配音','audio/skill',page);
+ createDash2('卡','男性卡牌','audio/card/male',page);
+ createDash2('牌','女性卡牌','audio/card/female',page);
+ createDash2('亡','阵亡配音','audio/die',page);
+ createDash2('效','游戏音效','audio/effect',page);
+ createDash2('景','背景音乐','audio/background',page);
+ };
+ page.reset();
+ return page;
+ }());
+ var dash3=(function(){
+ var page=ui.create.div('.hidden.menu-buttons');
+ page.path='font';
+ page.reset=function(){
+ ui.create.templayer();
+ page.hide();
+ pageboard.show();
+ };
+ page.init=function(){
+ enterDirectory(page,'font');
+ };
+ return page;
+ }());
+ var dash4=(function(){
+ var page=ui.create.div('.hidden.menu-buttons');
+ page.path='';
+ page.reset=function(){
+ ui.create.templayer();
+ page.hide();
+ pageboard.show();
+ };
+ page.init=function(){
+ enterDirectory(page,'');
+ };
+ return page;
+ }());
+ createDash('图','图片文件',dash1);
+ createDash('音','音频文件',dash2);
+ createDash('字','字体文件',dash3);
+ createDash('全','全部文件',dash4);
};
- var dash1=(function(){
- var page=ui.create.div('.hidden.menu-buttons');
- page.reset=function(){
- page.innerHTML='';
- var backbutton=ui.create.div('.menubutton.round','返',page,function(){
- ui.create.templayer();
- page.hide();
- pageboard.show();
- });
- backbutton.style.zIndex=1;
- backbutton.style.right='10px';
- backbutton.style.bottom='15px';
- var placeholder=ui.create.div('.placeholder',page);
- placeholder.style.position='relative';
- placeholder.style.display='block';
- placeholder.style.width='100%';
- placeholder.style.height='14px';
- createDash2('将','武将图片','image/character',page);
- createDash2('肤','皮肤图片','image/skin',page);
- createDash2('卡','卡牌图片','image/card',page);
- createDash2('模','模式图片','image/mode',page);
- createDash2('始','开始图片','image/splash',page);
- createDash2('景','背景图片','image/background',page);
- };
- page.reset();
- return page;
- }());
- var dash2=(function(){
- var page=ui.create.div('.hidden.menu-buttons');
- page.reset=function(){
- page.innerHTML='';
- var backbutton=ui.create.div('.menubutton.round','返',page,function(){
- ui.create.templayer();
- page.hide();
- pageboard.show();
- });
- backbutton.style.zIndex=1;
- backbutton.style.right='10px';
- backbutton.style.bottom='15px';
- var placeholder=ui.create.div('.placeholder',page);
- placeholder.style.position='relative';
- placeholder.style.display='block';
- placeholder.style.width='100%';
- placeholder.style.height='14px';
- createDash2('技','技能配音','audio/skill',page);
- createDash2('卡','男性卡牌','audio/card/male',page);
- createDash2('牌','女性卡牌','audio/card/female',page);
- createDash2('亡','阵亡配音','audio/die',page);
- createDash2('效','游戏音效','audio/effect',page);
- createDash2('景','背景音乐','audio/background',page);
- };
- page.reset();
- return page;
- }());
- var dash3=(function(){
- var page=ui.create.div('.hidden.menu-buttons');
- page.path='font';
- page.reset=function(){
- ui.create.templayer();
- page.hide();
- pageboard.show();
- };
- page.init=function(){
- enterDirectory(page,'font');
- };
- return page;
- }());
- var dash4=(function(){
- var page=ui.create.div('.hidden.menu-buttons');
- page.path='';
- page.reset=function(){
- ui.create.templayer();
- page.hide();
- pageboard.show();
- };
- page.init=function(){
- enterDirectory(page,'');
- };
- return page;
- }());
- createDash('图','图片文件',dash1);
- createDash('音','音频文件',dash2);
- createDash('字','字体文件',dash3);
- createDash('全','全部文件',dash4);
}());
createModeConfig('others',start.firstChild);
@@ -40626,6 +40642,7 @@
active=start.firstChild.firstChild;
active.classList.add('active');
}
+ if(!active.link) active._initLink();
rightPane.appendChild(active.link);
}());
@@ -40644,7 +40661,11 @@
}
this.classList.add('active');
updateActive(this);
- rightPane.appendChild(this.link);
+ if(this.link) rightPane.appendChild(this.link);
+ else{
+ this._initLink();
+ rightPane.appendChild(this.link);
+ }
};
updateActive=function(node){
if(!node){
@@ -40653,6 +40674,9 @@
return;
}
}
+ if (!node.link) {
+ node._initLink();
+ }
for(var i=0;i=5){
@@ -40721,228 +40744,250 @@
if(position2){
position.insertBefore(node,position2);
}
- node.link=page;
- node.mode=mode;
- page.node=node;
- var list=[];
- var boolAI=true;
- var alterableSkills=[];
- var alterableCharacters=[];
- var charactersToAlter=[];
- for(var i in info){
- if(info[i][4]&&info[i][4].contains('unseen')) continue;
- if(connectMenu&&lib.connectBanned.contains(i)) continue;
- list.push(i);
- if(boolAI&&!lib.config.forbidai_user.contains(i)) boolAI=false;
- for(var j=0;jb?1:-1;
- }
- return aa>bb?1:-1;
- });
- var list2=list.slice(0);
- var cfgnode=createConfig({
- name:'开启',
- _name:mode,
- init:lib.config.characters.contains(mode),
- onclick:togglePack
- });
- var cfgnodeAI=createConfig({
- name:'仅点将可用',
- _name:mode,
- init:boolAI,
- intro:'将该武将包内的武将全部设置为仅点将可用',
- onclick:function(bool){
- if(bool){
- for(var i=0;ib?1:-1;
+ }
+ return aa>bb?1:-1;
+ });
+ var list2=list.slice(0);
+ var cfgnode=createConfig({
+ name:'开启',
+ _name:mode,
+ init:lib.config.characters.contains(mode),
+ onclick:togglePack
+ });
+ var cfgnodeAI=createConfig({
+ name:'仅点将可用',
+ _name:mode,
+ init:boolAI,
+ intro:'将该武将包内的武将全部设置为仅点将可用',
+ onclick:function(bool){
+ if(bool){
+ for(var i=0;i该武将包不可被隐藏',page);
}
- }
- }
- page.classList.add('menu-buttons');
- page.classList.add('leftbutton');
- if(!connectMenu){
- if(lib.config.all.sgscharacters.contains(mode)){
- ui.create.div('.config.pointerspan','该武将包不可被隐藏',page);
- }
- else if(mode.indexOf('mode_')!=0){
- ui.create.div('.config.pointerspan','隐藏武将包',page,function(){
- if(this.firstChild.innerHTML=='隐藏武将包'){
- if(confirm('真的要隐藏“'+get.translation(mode+'_character_config')+'”武将包吗?\n建议使用“关闭”而不是“隐藏”功能,否则将会影响其他相关武将包的正常运行!')){
- this.firstChild.innerHTML='武将包将在重启后隐藏';
- lib.config.hiddenCharacterPack.add(mode);
- if(!lib.config.prompt_hidepack){
- alert('隐藏的扩展包可通过选项-其它-重置隐藏内容恢复');
- game.saveConfig('prompt_hidepack',true);
+ else if(mode.indexOf('mode_')!=0){
+ ui.create.div('.config.pointerspan','隐藏武将包',page,function(){
+ if(this.firstChild.innerHTML=='隐藏武将包'){
+ if(confirm('真的要隐藏“'+get.translation(mode+'_character_config')+'”武将包吗?\n建议使用“关闭”而不是“隐藏”功能,否则将会影响其他相关武将包的正常运行!')){
+ this.firstChild.innerHTML='武将包将在重启后隐藏';
+ lib.config.hiddenCharacterPack.add(mode);
+ if(!lib.config.prompt_hidepack){
+ alert('隐藏的扩展包可通过选项-其它-重置隐藏内容恢复');
+ game.saveConfig('prompt_hidepack',true);
+ }
}
}
- }
- else{
- this.firstChild.innerHTML='隐藏武将包';
- lib.config.hiddenCharacterPack.remove(mode);
- }
- game.saveConfig('hiddenCharacterPack',lib.config.hiddenCharacterPack);
- });
+ else{
+ this.firstChild.innerHTML='隐藏武将包';
+ lib.config.hiddenCharacterPack.remove(mode);
+ }
+ game.saveConfig('hiddenCharacterPack',lib.config.hiddenCharacterPack);
+ });
+ }
}
- }
+ };
return node;
};
if(lib.config.show_favourite_menu&&!connectMenu&&Array.isArray(lib.config.favouriteCharacter)){
@@ -41024,7 +41050,9 @@
lib.characterPack.mode_favourite[favname]=lib.character[favname];
}
}
- ui.favouriteCharacter=createModeConfig('mode_favourite',start.firstChild).link;
+ var favouriteCharacterNode=createModeConfig('mode_favourite',start.firstChild);
+ if(!favouriteCharacterNode.link) favouriteCharacterNode._initLink();
+ ui.favouriteCharacter=favouriteCharacterNode.link;
if(get.is.empty(lib.characterPack.mode_favourite)){
ui.favouriteCharacter.node.style.display='none';
}
@@ -41071,6 +41099,7 @@
active.classList.add('active');
updateActive(active);
}
+ if(!active.link) active._initLink();
rightPane.appendChild(active.link);
if(!connectMenu){
@@ -41113,7 +41142,11 @@
if(this.mode=='cardpile'){
this.create();
}
- rightPane.appendChild(this.link);
+ if(this.link) rightPane.appendChild(this.link);
+ else{
+ this._initLink();
+ rightPane.appendChild(this.link);
+ }
};
updateActiveCard=function(node){
if(!node){
@@ -41122,6 +41155,7 @@
return;
}
}
+ if(!node.link) node._initLink();
for(var i=0;i=5){
node.classList.add('smallfont');
}
- node.link=page;
- node.mode=mode;
- var list=[];
- for(var i=0;isort2){
- return 1;
- }
- else{
- return -1;
- }
- });
- var cfgnode=createConfig({
- name:'开启',
- _name:mode,
- init:lib.config.cards.contains(mode),
- onclick:togglePack
- });
- if(mode.indexOf('mode_')!=0){
- page.appendChild(cfgnode);
- }
- else{
- page.style.paddingTop='8px';
- }
- var banCard=function(e){
- if(_status.clicked){
- _status.clicked=false;
- return;
- }
- if(mode.indexOf('mode_')==0&&mode.indexOf('mode_extension_')!=0&&mode!='mode_banned'){
- return;
- }
- ui.click.touchpop();
- this._banning=connectMenu?'online':'offline';
- ui.click.intro.call(this,e);
- _status.clicked=false;
- delete this._banning;
- };
- var updateBanned=function(){
- var list;
- if(connectMenu){
- var mode=menux.pages[0].firstChild.querySelector('.active');
- if(mode&&mode.mode){
- list=lib.config['connect_'+mode.mode+'_bannedcards'];
+ if(lib.cardType[type]){
+ return lib.cardType[type];
+ }
+ switch(type){
+ case 'basic':return 0;
+ case 'chess':return 1.5;
+ case 'trick':return 2;
+ case 'delay':return 3;
+ case 'equip':{
+ switch(lib.card[card[2]].subtype){
+ case 'equip1':return 4.1;
+ case 'equip2':return 4.2;
+ case 'equip3':return 4.3;
+ case 'equip4':return 4.4;
+ case 'equip5':return 4.5;
+ default:return 4;
+ }
+ }
+ case 'zhenfa':return 5;
+ default:return 6;
}
}
- else{
- list=lib.config[get.mode()+'_bannedcards'];
- }
- if(list&&list.contains(this.link[2])){
- this.classList.add('banned');
- }
- else{
- this.classList.remove('banned');
- }
- };
- var buttons=ui.create.buttons(list,'vcard',page);
- for(var i=0;i隐藏卡牌包',page,function(){
- if(this.firstChild.innerHTML=='隐藏卡牌包'){
- this.firstChild.innerHTML='卡牌包将在重启后隐藏';
- lib.config.hiddenCardPack.add(mode);
- if(!lib.config.prompt_hidepack){
- alert('隐藏的扩展包可通过选项-其它-重置隐藏内容恢复');
- game.saveConfig('prompt_hidepack',true);
- }
+ list.sort(function(a,b){
+ var sort1=sortCard(a);
+ var sort2=sortCard(b);
+ if(sort1==sort2){
+ return (b[2]sort2){
+ return 1;
}
else{
- this.firstChild.innerHTML='隐藏卡牌包';
- lib.config.hiddenCardPack.remove(mode);
- }
- game.saveConfig('hiddenCardPack',lib.config.hiddenCardPack);
- });
- }
- if(mode.indexOf('mode_')!=0&&lib.cardPile[mode]){
- var cardpileNodes=[];
- var cardpileexpanded=false;
- if(!lib.config.bannedpile[mode]){
- lib.config.bannedpile[mode]=[];
- }
- if(!lib.config.addedpile[mode]){
- lib.config.addedpile[mode]=[];
- }
- ui.create.div('.config.more.pile','编辑牌堆 >
',page,function(){
- if(cardpileexpanded){
- this.classList.remove('on');
- for(var k=0;k隐藏卡牌包',page,function(){
+ if(this.firstChild.innerHTML=='隐藏卡牌包'){
+ this.firstChild.innerHTML='卡牌包将在重启后隐藏';
+ lib.config.hiddenCardPack.add(mode);
+ if(!lib.config.prompt_hidepack){
+ alert('隐藏的扩展包可通过选项-其它-重置隐藏内容恢复');
+ game.saveConfig('prompt_hidepack',true);
+ }
+ }
+ else{
+ this.firstChild.innerHTML='隐藏卡牌包';
+ lib.config.hiddenCardPack.remove(mode);
+ }
+ game.saveConfig('hiddenCardPack',lib.config.hiddenCardPack);
});
- cfgnode.type='defaultcards';
+ }
+ if(mode.indexOf('mode_')!=0&&lib.cardPile[mode]){
+ var cardpileNodes=[];
+ var cardpileexpanded=false;
+ if(!lib.config.bannedpile[mode]){
+ lib.config.bannedpile[mode]=[];
+ }
+ if(!lib.config.addedpile[mode]){
+ lib.config.addedpile[mode]=[];
+ }
+ ui.create.div('.config.more.pile','编辑牌堆 >
',page,function(){
+ if(cardpileexpanded){
+ this.classList.remove('on');
+ for(var k=0;k=5){
node.classList.add('smallfont');
}
- node.link=page;
- node.mode=mode;
- for(var i in lib.extensionMenu[mode]){
- if(i=='game') continue;
- var cfg=copyObj(lib.extensionMenu[mode][i]);
- var j;
- if(mode.indexOf('extension_')==0){
- j=mode+'_'+i;
- }
- else{
- j=mode+'_'+i+'_playpackconfig';
- }
- cfg._name=j;
- if(!lib.config.hasOwnProperty(j)){
- game.saveConfig(j,cfg.init);
- }
- else{
- cfg.init=lib.config[j];
- }
+ node._initLink=function(){
+ node.link=page;
+ node.mode=mode;
+ for(var i in lib.extensionMenu[mode]){
+ if(i=='game') continue;
+ var cfg=copyObj(lib.extensionMenu[mode][i]);
+ var j;
+ if(mode.indexOf('extension_')==0){
+ j=mode+'_'+i;
+ }
+ else{
+ j=mode+'_'+i+'_playpackconfig';
+ }
+ cfg._name=j;
+ if(!lib.config.hasOwnProperty(j)){
+ game.saveConfig(j,cfg.init);
+ }
+ else{
+ cfg.init=lib.config[j];
+ }
- if(i=='enable'){
- cfg.onclick=togglePack;
+ if(i=='enable'){
+ cfg.onclick=togglePack;
+ }
+ else if(!lib.extensionMenu[mode][i].onclick){
+ cfg.onclick=function(result){
+ var cfg=this._link.config;
+ game.saveConfig(cfg._name,result);
+ };
+ }
+ var cfgnode=createConfig(cfg);
+ if(cfg.onswitch){
+ cfgnode.onswitch=cfg.onswitch;
+ }
+ page.appendChild(cfgnode);
}
- else if(!lib.extensionMenu[mode][i].onclick){
- cfg.onclick=function(result){
- var cfg=this._link.config;
- game.saveConfig(cfg._name,result);
- };
- }
- var cfgnode=createConfig(cfg);
- if(cfg.onswitch){
- cfgnode.onswitch=cfg.onswitch;
- }
- page.appendChild(cfgnode);
- }
+ };
return node;
};
for(var i in lib.extensionMenu){
@@ -41795,1997 +41838,1262 @@
if(lib.config.show_extensionmaker==false) return;
var page=ui.create.div('#create-extension');
var node=ui.create.div('.menubutton.large','制作扩展',start.firstChild,clickMode);
- node.link=page;
- node.mode='create';
- var pageboard=ui.create.div(page);
- var inputExtLine=ui.create.div(pageboard);
- inputExtLine.style.transition='all 0s';
- inputExtLine.style.padding='10px';
- inputExtLine.style.height='22px';
- inputExtLine.style.lineHeight='22px';
- inputExtLine.style.whiteSpace='nowrap';
- inputExtLine.style.overflow='visible';
- var inputExtSpan=document.createElement('span');
- inputExtSpan.innerHTML='扩展名:';
- inputExtLine.appendChild(inputExtSpan);
- var inputExtName=document.createElement('input');
- inputExtName.type='text';
- inputExtName.value='无名扩展';
- inputExtName.style.width='80px';
- inputExtName.style.textAlign='center';
- inputExtLine.appendChild(inputExtName);
-
- var buttonConfirmOnclick=function(){
- buttonConfirm.style.display='none';
- inputExtSpan.style.display='none';
- inputExtName.style.display='none';
- authorExtLine.style.display='none';
- introExtLine.style.display='none';
- forumExtLine.style.display='none';
- diskExtLine.style.display='none';
- versionExtLine.style.display='none';
- okExtLine.style.display='none';
+ node._initLink=function(){
+ node.link=page;
+ node.mode='create';
+ var pageboard=ui.create.div(page);
+ var inputExtLine=ui.create.div(pageboard);
+ inputExtLine.style.transition='all 0s';
inputExtLine.style.padding='10px';
- buttonRename.style.display='';
- buttonSave.style.display='';
- buttonReset.style.display='';
- buttonExport.style.display='';
- inputExtSpan.innerHTML='扩展名称:';
- inputExtName.style.width='100px';
- inputExtName.style.textAlign='';
+ inputExtLine.style.height='22px';
+ inputExtLine.style.lineHeight='22px';
+ inputExtLine.style.whiteSpace='nowrap';
+ inputExtLine.style.overflow='visible';
+ var inputExtSpan=document.createElement('span');
+ inputExtSpan.innerHTML='扩展名:';
+ inputExtLine.appendChild(inputExtSpan);
+ var inputExtName=document.createElement('input');
+ inputExtName.type='text';
+ inputExtName.value='无名扩展';
+ inputExtName.style.width='80px';
+ inputExtName.style.textAlign='center';
+ inputExtLine.appendChild(inputExtName);
- dashboard.style.display='';
- };
- var createExtLine=function(str,str2){
- var infoExtLine=ui.create.div(pageboard);
- infoExtLine.style.display='none';
- infoExtLine.style.padding='0 10px 10px 10px';
- infoExtLine.style.height='22px';
- infoExtLine.style.lineHeight='22px';
- infoExtLine.style.whiteSpace='nowrap';
- infoExtLine.style.overflow='visible';
- if(typeof str=='boolean'){
- var inputConfirm=document.createElement('button');
- inputConfirm.innerHTML='确定';
- inputConfirm.onclick=buttonConfirmOnclick;
- infoExtLine.appendChild(inputConfirm);
- return infoExtLine;
- }
- var infoExtSpan=document.createElement('span');
- infoExtSpan.innerHTML=str+':';
- infoExtLine.appendChild(infoExtSpan);
- var infoExtName=document.createElement('input');
- infoExtName.type='text';
- infoExtName.style.width='100px';
- infoExtName.value=str2||'';
- infoExtLine.appendChild(infoExtName);
- return infoExtLine;
- };
- var authorExtLine=createExtLine('扩展作者',get.connectNickname());
- var introExtLine=createExtLine('扩展描述');
- var versionExtLine=createExtLine('扩展版本','1.0');
- var diskExtLine=createExtLine('网盘地址');
- var forumExtLine=createExtLine('讨论地址');
- var okExtLine=createExtLine(true);
-
- game.editExtension=function(name){
- page.currentExtension=name||'无名扩展';
- inputExtName.value=page.currentExtension;
- if(name&&lib.extensionPack[name]){
- authorExtLine.querySelector('input').value=lib.extensionPack[name].author||'';
- introExtLine.querySelector('input').value=lib.extensionPack[name].intro||'';
- diskExtLine.querySelector('input').value=lib.extensionPack[name].diskURL||'';
- forumExtLine.querySelector('input').value=lib.extensionPack[name].forumURL||'';
- versionExtLine.querySelector('input').value=lib.extensionPack[name].version||'';
- }
- else{
- authorExtLine.querySelector('input').value=get.connectNickname()||'';
- introExtLine.querySelector('input').value='';
- diskExtLine.querySelector('input').value='';
- forumExtLine.querySelector('input').value='';
- versionExtLine.querySelector('input').value='1.0';
- }
- if(name){
- inputExtName.disabled=true;
+ var buttonConfirmOnclick=function(){
buttonConfirm.style.display='none';
inputExtSpan.style.display='none';
inputExtName.style.display='none';
+ authorExtLine.style.display='none';
+ introExtLine.style.display='none';
+ forumExtLine.style.display='none';
+ diskExtLine.style.display='none';
+ versionExtLine.style.display='none';
+ okExtLine.style.display='none';
+ inputExtLine.style.padding='10px';
buttonRename.style.display='';
buttonSave.style.display='';
buttonReset.style.display='';
buttonExport.style.display='';
+ inputExtSpan.innerHTML='扩展名称:';
+ inputExtName.style.width='100px';
+ inputExtName.style.textAlign='';
+
+ dashboard.style.display='';
+ };
+ var createExtLine=function(str,str2){
+ var infoExtLine=ui.create.div(pageboard);
+ infoExtLine.style.display='none';
+ infoExtLine.style.padding='0 10px 10px 10px';
+ infoExtLine.style.height='22px';
+ infoExtLine.style.lineHeight='22px';
+ infoExtLine.style.whiteSpace='nowrap';
+ infoExtLine.style.overflow='visible';
+ if(typeof str=='boolean'){
+ var inputConfirm=document.createElement('button');
+ inputConfirm.innerHTML='确定';
+ inputConfirm.onclick=buttonConfirmOnclick;
+ infoExtLine.appendChild(inputConfirm);
+ return infoExtLine;
+ }
+ var infoExtSpan=document.createElement('span');
+ infoExtSpan.innerHTML=str+':';
+ infoExtLine.appendChild(infoExtSpan);
+ var infoExtName=document.createElement('input');
+ infoExtName.type='text';
+ infoExtName.style.width='100px';
+ infoExtName.value=str2||'';
+ infoExtLine.appendChild(infoExtName);
+ return infoExtLine;
+ };
+ var authorExtLine=createExtLine('扩展作者',get.connectNickname());
+ var introExtLine=createExtLine('扩展描述');
+ var versionExtLine=createExtLine('扩展版本','1.0');
+ var diskExtLine=createExtLine('网盘地址');
+ var forumExtLine=createExtLine('讨论地址');
+ var okExtLine=createExtLine(true);
+
+ game.editExtension=function(name){
+ page.currentExtension=name||'无名扩展';
+ inputExtName.value=page.currentExtension;
+ if(name&&lib.extensionPack[name]){
+ authorExtLine.querySelector('input').value=lib.extensionPack[name].author||'';
+ introExtLine.querySelector('input').value=lib.extensionPack[name].intro||'';
+ diskExtLine.querySelector('input').value=lib.extensionPack[name].diskURL||'';
+ forumExtLine.querySelector('input').value=lib.extensionPack[name].forumURL||'';
+ versionExtLine.querySelector('input').value=lib.extensionPack[name].version||'';
+ }
+ else{
+ authorExtLine.querySelector('input').value=get.connectNickname()||'';
+ introExtLine.querySelector('input').value='';
+ diskExtLine.querySelector('input').value='';
+ forumExtLine.querySelector('input').value='';
+ versionExtLine.querySelector('input').value='1.0';
+ }
+ if(name){
+ inputExtName.disabled=true;
+ buttonConfirm.style.display='none';
+ inputExtSpan.style.display='none';
+ inputExtName.style.display='none';
+ buttonRename.style.display='';
+ buttonSave.style.display='';
+ buttonReset.style.display='';
+ buttonExport.style.display='';
+ }
+ else{
+ inputExtName.disabled=false;
+ buttonConfirm.style.display='';
+ inputExtSpan.innerHTML='扩展名:';
+ inputExtName.style.width='80px';
+ inputExtName.style.textAlign='center';
+ inputExtSpan.style.display='';
+ inputExtName.style.display='';
+ buttonRename.style.display='none';
+ buttonSave.style.display='none';
+ buttonReset.style.display='none';
+ buttonExport.style.display='none';
+ }
+
+ dashboard.style.display='';
+
+ exportExtLine.style.display='none';
+ shareExtLine.style.display='none';
+ authorExtLine.style.display='none';
+ introExtLine.style.display='none';
+ forumExtLine.style.display='none';
+ diskExtLine.style.display='none';
+ versionExtLine.style.display='none';
+ okExtLine.style.display='none';
+ inputExtLine.style.padding='10px';
+ dash1.reset(name);
+ dash2.reset(name);
+ dash3.reset(name);
+ dash4.reset(name);
+ dash1.link.classList.remove('active');
+ dash2.link.classList.remove('active');
+ dash3.link.classList.remove('active');
+ dash4.link.classList.remove('active');
+ var active=node.parentNode.querySelector('.active');
+ if(active===node){
+ return;
+ }
+ active.classList.remove('active');
+ active.link.remove();
+ node.classList.add('active');
+ rightPane.appendChild(node.link);
}
- else{
- inputExtName.disabled=false;
- buttonConfirm.style.display='';
- inputExtSpan.innerHTML='扩展名:';
- inputExtName.style.width='80px';
- inputExtName.style.textAlign='center';
+ var processExtension=function(exportext){
+ if(page.currentExtension){
+ if(page.currentExtension!=inputExtName.value&&!exportext){
+ game.removeExtension(page.currentExtension);
+ }
+ }
+ inputExtName.disabled=true;
+ setTimeout(function(){
+ var ext={};
+ var config=null,help=null;
+ for(var i in dash4.content){
+ try{
+ if(i=='content'||i=='precontent'){
+ eval('ext[i]='+dash4.content[i]);
+ if(typeof ext[i]!='function'){
+ throw('err');
+ }
+ else{
+ ext[i]=ext[i].toString();
+ }
+ }
+ else{
+ eval(dash4.content[i]);
+ eval('ext[i]='+i);
+ if(ext[i]==null||typeof ext[i]!='object'){
+ throw('err');
+ }
+ else{
+ ext[i]=JSON.stringify(ext[i]);
+ }
+ }
+ }
+ catch(e){
+ console.log(e);
+ delete ext[i];
+ }
+ }
+ page.currentExtension=inputExtName.value||'无名扩展';
+ var str='{name:"'+page.currentExtension+'"';
+ for(var i in ext){
+ str+=','+i+':'+ext[i];
+ }
+ dash2.content.pack.list=[];
+ for(var i=0;i←返回',page,function(){
- ui.create.templayer();
- page.hide();
- pageboard.show();
- });
- page.content={
- pack:{
- character:{},
- translate:{}
- },
- image:{}
- };
- var newCharacter;
- var toggle=ui.create.div('.config.more.on','创建武将
>
',page,function(){
- this.classList.toggle('on');
- if(this.classList.contains('on')){
- newCharacter.style.display='';
+ var createButton=function(name,image){
+ var button=ui.create.div('.button.character');
+ button.link=name;
+ button.image=image;
+ button.style.backgroundImage='url('+image+')';
+ button.style.backgroundSize='cover';
+ button.listen(clickButton);
+ button.classList.add('noclick');
+ button.nodename=ui.create.div(button,'.name',get.verticalStr(page.content.pack.translate[name]));
+ button.nodename.style.top='8px';
+ page.insertBefore(button,page.childNodes[1]);
}
- else{
+ page.reset=function(name){
+ resetEditor();
+ var buttons=page.querySelectorAll('.button.character');
+ var list=[];
+ for(var i=0;i
← 返回',page,function(){
+ ui.create.templayer();
+ page.hide();
+ pageboard.show();
+ });
+ page.content={
+ pack:{
+ character:{},
+ translate:{}
+ },
+ image:{}
+ };
+ var newCharacter;
+ var toggle=ui.create.div('.config.more.on','创建武将