Files
lifeRestart/public/assets/summary--hmU_JPx.js

2 lines
3.1 KiB
JavaScript

var C=t=>{throw TypeError(t)};var S=(t,s,e)=>s.has(t)||C("Cannot "+e);var h=(t,s,e)=>(S(t,s,"read from private field"),e?e.call(t):s.get(t)),T=(t,s,e)=>s.has(t)?C("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),c=(t,s,e,i)=>(S(t,s,"write to private field"),i?i.call(t,e):s.set(t,e),e);var l,u;class H extends ui.view.CyberTheme.CyberSummaryUI{constructor(){super();T(this,l);T(this,u);this.listSelectedTalents.renderHandler=Laya.Handler.create(this,this.renderTalent,null,!1),this.btnAgain.on(Laya.Event.CLICK,this,this.onAgain)}onAgain(){core.talentExtend(h(this,l)),core.times++,$ui.switchView(UI.pages.MAIN)}init({talents:e,enableExtend:i}){const{summary:n,lastExtendTalent:o}=core;c(this,u,i);const a=$ui.common.filter,r=$ui.common.grade,b=n[core.PropertyTypes.HAGE];this.labAge.text=""+b.value,this.labAgeJudge.text=b.judge,this.labAgeJudge.color=r[b.grade];const g=n[core.PropertyTypes.SUM];this.labTotal.text=""+g.value,this.labTotalJudge.text=g.judge,this.labTotalJudge.color=r[g.grade];const d=n[core.PropertyTypes.HCHR];this.labCharm.text=""+d.value,this.prgCharm.value=d.progress,this.labCharmJudge.text=d.judge,this.labCharmJudge.color=r[d.grade],this.boxCharmGrade.colorFilter=a[d.grade];const y=n[core.PropertyTypes.HINT];this.labIntelligence.text=""+y.value,this.prgIntelligence.value=y.progress,this.labIntelligenceJudge.text=y.judge,this.labIntelligenceJudge.color=r[y.grade],this.boxIntelligenceGrade.colorFilter=a[y.grade];const p=n[core.PropertyTypes.HSTR];this.labStrength.text=""+p.value,this.prgStrength.value=p.progress,this.labStrengthJudge.text=p.judge,this.labStrengthJudge.color=r[p.grade],this.boxStrengthGrade.colorFilter=a[p.grade];const v=n[core.PropertyTypes.HMNY];this.labMoney.text=""+v.value,this.prgMoney.value=v.progress,this.labMoneyJudge.text=v.judge,this.labMoneyJudge.color=r[v.grade],this.boxMoneyGrade.colorFilter=a[v.grade];const m=n[core.PropertyTypes.HSPR];this.labSpirit.text=""+m.value,this.prgSpirit.value=m.progress,this.labSpiritJudge.text=m.judge,this.labSpiritJudge.color=r[m.grade],this.boxSpiritGrade.colorFilter=a[m.grade],e.sort(({id:f,grade:x},{id:J,grade:I})=>f==o?-1:J==o?1:I-x),h(this,u)?c(this,l,e[0].id):c(this,l,o),this.listSelectedTalents.array=e}renderTalent(e){const i=e.dataSource,n=e.getChildByName("labTitle"),o=e.getChildByName("grade1"),a=e.getChildByName("grade2"),r=e.getChildByName("grade3"),b=e.getChildByName("labDescription"),g=e.getChildByName("selected"),d=e.getChildByName("unselected");switch(n.text=i.name,b.text=i.description,i.grade){case 1:o.visible=!0,a.visible=!1,r.visible=!1;break;case 2:o.visible=!1,a.visible=!0,r.visible=!1;break;case 3:o.visible=!1,a.visible=!1,r.visible=!0;break;default:o.visible=!1,a.visible=!1,r.visible=!1;break}g.visible=i.id==h(this,l),d.visible=!g.visible,e.off(Laya.Event.CLICK,this,this.onSelectTalent),e.on(Laya.Event.CLICK,this,this.onSelectTalent,[i.id])}onSelectTalent(e){if(!h(this,u))return $$event("message",["M_DisableExtendTalent"]);e==h(this,l)?c(this,l,null):c(this,l,e),this.listSelectedTalents.refresh()}}l=new WeakMap,u=new WeakMap;export{H as default};