'use strict'; game.import('mode',{ name:'brawl', game:{ syncMenu:true, }, start:function(){ ui.auto.hide(); if(!lib.storage.scene){ lib.storage.scene={}; } if(!lib.storage.stage){ lib.storage.stage={}; } if(!_status.extensionmade){ _status.extensionmade=[]; } if(_status.extensionscene){ game.save('scene',lib.storage.scene); } if(_status.extensionstage){ game.save('stage',lib.storage.stage); } var dialog=ui.create.dialog('hidden'); dialog.classList.add('fixed'); dialog.classList.add('scroll1'); dialog.classList.add('scroll2'); dialog.classList.add('fullwidth'); dialog.classList.add('fullheight'); dialog.classList.add('noupdate'); dialog.classList.add('character'); dialog.contentContainer.style.overflow='visible'; dialog.style.overflow='hidden'; dialog.content.style.height='100%'; dialog.contentContainer.style.transition='all 0s'; if(!lib.storage.directStage) dialog.open(); var packnode=ui.create.div('.packnode',dialog); lib.setScroll(packnode); var clickCapt=function(){ var active=this.parentNode.querySelector('.active'); if(this.link=='stage'){ if(get.is.empty(lib.storage.scene)){ alert('请创建至少1个场景'); return; } } if(active){ if(active==this) return; for(var i=0;istage.level){ stage.level=level.index+1; game.save('stage',stagesave,'brawl'); } if(stage.mode!='sequal'){ game.save('lastStage',level.index+1,'brawl'); } } else{ ui.create.control('重新开始',function(){ if(stage.mode=='sequal'&&bool&&level.index==stage.scenes.length-1){ game.save('directStage',[stage.name,0],'brawl'); } else{ game.save('directStage',[stage.name,level.index],'brawl'); } localStorage.setItem(lib.configprefix+'directstart',true); game.reload(); }); if(stage.mode=='sequal'&&level.index==stage.scenes.length-1){ stage.level=0; game.save('stage',stagesave,'brawl'); } if(stage.mode!='sequal'){ game.save('lastStage',level.index,'brawl'); } } delete _status.createControl; }); var scene=stage.scenes[level.index]; info={ name:scene.name, intro:scene.intro, }; for(var i in lib.brawl.scene.template){ info[i]=get.copy(lib.brawl.scene.template[i]); } if(!scene.gameDraw){ info.content.noGameDraw=true; } info.content.scene=scene; } else{ return; } } else{ info=lib.brawl[active.link]; } lib.translate.restart='返回'; dialog.delete(); ui.brawlinfo=ui.create.system('乱斗',null,true); lib.setPopped(ui.brawlinfo,function(){ var uiintro=ui.create.dialog('hidden'); uiintro.add(info.name); var intro; if(Array.isArray(info.intro)){ intro='