Deploying to gh-pages from @ VickScarlet/lifeRestart@f12a147093 🚀

This commit is contained in:
VickScarlet
2026-03-30 09:50:02 +00:00
parent cbe5a5a8ca
commit 3b37b960fa
53 changed files with 77 additions and 80 deletions
+1
View File
@@ -0,0 +1 @@
var e=class extends ui.view.CyberTheme.CyberTalentUI{constructor(){super(),this.btnDrawCard.on(Laya.Event.CLICK,this,this.onClickDrawCard),this.btnNext.on(Laya.Event.CLICK,this,this.onClickNext),this.listTalents.renderHandler=Laya.Handler.create(this,this.renderTalent,null,!1),this.listTalents.scrollBar.elasticDistance=150,this.on(Laya.Event.RESIZE,this,()=>{let e=this.listTalents?._itemRender?.props?.width;if(e){let t=Math.max(Math.floor((this.width-40)/e),1);this.listTalents.width=t*e+(t-1)*(this.listTalents.spaceY||0)}})}#e=new Set;static load(){return[`images/background/background_2@3x.png`]}init(){this.pageDrawCard.visible=!0,this.pageResult.visible=!1,this.btnNext.label=`UI_Talent_Select_Uncomplete`,this.#e.clear()}close(){}onClickDrawCard(){this.pageDrawCard.visible=!1,this.pageResult.visible=!0,this.listTalents.array=core.talentRandom()}onClickNext(){if(this.#e.size<core.talentSelectLimit)return $$event(`message`,[`F_TalentSelectNotComplect`,core.talentSelectLimit]);let e=[...this.#e].map(e=>this.listTalents.array[e]);$ui.switchView(UI.pages.PROPERTY,{talents:e,enableExtend:!0})}renderTalent(e,t){let n=e.dataSource,r=e.getChildByName(`hboxTitle`),i=r.getChildByName(`labTitle`),a=r.getChildByName(`grades`),o=a.getChildByName(`grade1`),s=a.getChildByName(`grade2`),c=a.getChildByName(`grade3`),l=e.getChildByName(`labDescription`),u=e.getChildByName(`unselected`),d=e.getChildByName(`selected`);switch(n.grade){case 1:a.x=0,i.x=1,o.visible=!0,s.visible=!1,c.visible=!1;break;case 2:a.x=0,i.x=1,o.visible=!1,s.visible=!0,c.visible=!1;break;case 3:a.x=0,i.x=1,o.visible=!1,s.visible=!1,c.visible=!0;break;default:a.x=1,i.x=0,o.visible=!1,s.visible=!1,c.visible=!1;break}i.text=n.name,i.event(Laya.Event.RESIZE),l.text=n.description,u.visible=!(d.visible=this.#e.has(t)),e.offAll(Laya.Event.CLICK),e.on(Laya.Event.CLICK,this,()=>{if(this.#e.has(t))this.#e.delete(t);else{if(this.#e.size>=core.talentSelectLimit)return $$event(`message`,[`F_TalentSelectLimit`,core.talentSelectLimit]);let e=core.exclude([...this.#e].map(e=>this.listTalents.array[e].id),this.listTalents.array[t].id);if(e!=null){for(let{name:t,id:n}of this.listTalents.array)if(e==n)return $$event(`message`,[`F_TalentConflict`,t]);return}this.#e.add(t)}this.btnNext.label=this.#e.size===core.talentSelectLimit?`UI_Next`:`UI_Talent_Select_Uncomplete`,u.visible=!(d.visible=this.#e.has(t))})}};export{e as default};