mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2025-07-13 15:52:44 +08:00
4 lines
3.3 KiB
JavaScript
4 lines
3.3 KiB
JavaScript
var v=s=>{throw TypeError(s)};var x=(s,i,t)=>i.has(s)||v("Cannot "+t);var o=(s,i,t)=>(x(s,i,"read from private field"),t?t.call(s):i.get(s)),n=(s,i,t)=>i.has(s)?v("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,t),r=(s,i,t,e)=>(x(s,i,"write to private field"),e?e.call(s,t):i.set(s,t),t),C=(s,i,t)=>(x(s,i,"access private method"),t);var y,c,u,m,j,p,l,b,g;const d=class d extends ui.view.DefaultTheme.TrajectoryUI{constructor(){super();n(this,m);n(this,y);n(this,c);n(this,p);n(this,l);n(this,b);n(this,g);let t=[0,0];this.panelTrajectory.on(Laya.Event.MOUSE_DOWN,this,e=>t=[e.stageX,e.stageY]),this.panelTrajectory.on(Laya.Event.MOUSE_UP,this,e=>{const a=e.stageX-t[0],h=e.stageY-t[1];Math.sqrt(Math.abs(a)+Math.abs(h))>10||this.onNext()}),this.btnSummary.on(Laya.Event.CLICK,this,this.onSummary),this.panelTrajectory.vScrollBar.elasticDistance=150,this.scbSpeed.on(Laya.Event.CHANGE,this,()=>this.speed=this.scbSpeed.value),this.scbSpeed.on(Laya.Event.MOUSE_UP,this,()=>this.onNext())}static load(){return["images/atlas/images/progress.atlas","images/atlas/images/slider.atlas"]}init({propertyAllocate:t,talents:e,enableExtend:a}){r(this,g,a),this.boxParticle.visible=!1,this.boxSpeed.visible=!0,this.btnSummary.visible=!1,r(this,l,[]),r(this,p,!1),r(this,b,e),core.start(t),this.updateProperty(),this.onNext()}close(){this.scbSpeed.value=0,this.speed=0,o(this,l).forEach(t=>{t.removeSelf(),t.destroy()}),r(this,l,null)}updateProperty(){const t=core.PropertyTypes,e=core.propertys;this.labCharm.text=e[t.CHR],this.labIntelligence.text=e[t.INT],this.labStrength.text=e[t.STR],this.labMoney.text=e[t.MNY],this.labSpirit.text=e[t.SPR]}onNext(){if(o(this,p))return;const{age:t,content:e,isEnd:a}=core.next();r(this,p,a),a&&(this.boxSpeed.visible=!1,this.btnSummary.visible=!0,Laya.timer.frameOnce(1,this,()=>{this.panelTrajectory.scrollTo(0,this.panelTrajectory.contentHeight)})),this.panelTrajectory.scrollTo(0,this.panelTrajectory.contentHeight),this.renderTrajectory(t,e),t>=100&&(this.boxParticle.visible=!0),this.updateProperty()}renderTrajectory(t,e){const a=C(this,m,j).call(this);a.labAge.text=""+t,a.labContent.text=e.map(({type:h,description:S,grade:N,name:E,postEvent:T})=>{switch(h){case"TLT":return`天赋【${E}】发动:${S}`;case"EVT":return S+(T?`
|
|
${T}`:"")}}).join(`
|
|
`),a.grade(e[e.length-1].grade),this.vboxTrajectory.addChild(a),o(this,l).push(a),a.y=this.vboxTrajectory.height}onSummary(){const t=o(this,b);$ui.switchView(UI.pages.SUMMARY,{talents:t,enableExtend:o(this,g)})}get speed(){return o(this,y)}set speed(t){r(this,y,t),this.prgSpeed.value=t/this.scbSpeed.max,clearInterval(o(this,c)),r(this,c,null),t&&r(this,c,setInterval(()=>this.onNext(),3e3*(1-this.prgSpeed.value)+300))}};y=new WeakMap,c=new WeakMap,u=new WeakMap,m=new WeakSet,j=function(){var a;const t=o(a=d,u).call(a,"boxTrajectoryItem");t.labContent=t.getChildByName("labContent"),t.labAge=t.getChildByName("hboxAge").getChildByName("labAge");const e=$ui.common.trajectoryItem;return $_.deepMapSet(t,e.box),t.grade=h=>{$_.deepMapSet(t,e.grade[h||0])},t.getChildByName("hboxAge")._childs.forEach(h=>h.color=e.ageColor),t.labContent.color=e.contentColor,t},p=new WeakMap,l=new WeakMap,b=new WeakMap,g=new WeakMap,n(d,u,Laya.plugin.extractComponents(d.uiView,["boxTrajectoryItem"]));let f=d;export{f as default};
|