You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.8 KiB
70 lines
2.8 KiB
//#region 文件引入
|
|
import { _decorator, Button, Component, Label, Node, sp, Sprite,Animation, RichText } from "cc";
|
|
import BaseUIForm from "../../Mgr_UI/BaseUIForm";
|
|
import FrameScrollView from "../../CComEx/FrameScrollView";
|
|
import { TrialRankData } from "../../const/GameInterface";
|
|
import { MainConfig } from "db://assets/Launch/_MainConfig";
|
|
import hurtrankitem_Proxy from "./hurtrankitem_Proxy";
|
|
import UIMgr from "../../Mgr_UI/UIMgr";
|
|
import { EUIForms } from "../../const/UIFormCnf";
|
|
//#endregion 文件引入
|
|
const {ccclass, property,menu} = _decorator;
|
|
@ccclass("FinalTrialRankUI_Proxy")
|
|
export default class FinalTrialRankUI_Proxy extends BaseUIForm{
|
|
//#region 节点自动生成
|
|
|
|
@property(Label)
|
|
lab_myrank: Label = null;
|
|
@property(Sprite)
|
|
spr_myicon: Sprite = null;
|
|
@property(Label)
|
|
lab_myname: Label = null;
|
|
@property(Label)
|
|
lab_myhurt: Label = null;
|
|
@property(Button)
|
|
btn_reward: Button = null;
|
|
//#endregion 节点自动生成
|
|
|
|
@property(FrameScrollView)
|
|
protected mScrollViewFrame: FrameScrollView;
|
|
|
|
private bossidx: number = -1;
|
|
private rankDatas: TrialRankData[] = [];
|
|
onButtonClick(button:Button){
|
|
|
|
/**点击事件触发*/
|
|
switch (button) {
|
|
case this.btn_reward:
|
|
UIMgr.Ins.ShowUI(EUIForms.FinalTrialReWardUI, { param: this.bossidx })
|
|
break;
|
|
default:
|
|
ConsoleEx.Log(button);
|
|
break;
|
|
}
|
|
}
|
|
|
|
addEvent(): void {
|
|
this.mScrollViewFrame.m_ItemRendererFuntion = this.ItemRenderer.bind(this);
|
|
}
|
|
|
|
protected start(): void {
|
|
this.bossidx = this.param;
|
|
this.rankDatas = this.mDataMgr.Trial.getRTRank(this.bossidx);
|
|
const myrank = this.mDataMgr.Trial.getMyRTRank(this.bossidx);
|
|
const myhurt = this.mDataMgr.Trial.getTrialMyDamage(this.bossidx);
|
|
CNodeUtils.switchText(this.lab_myrank, (myrank > 0 && myrank < 500) ? myrank : "未上榜");
|
|
CNodeUtils.switchText(this.lab_myhurt, myhurt);
|
|
CNodeUtils.switchText(this.lab_myname, (MainConfig.UserInfo.nick_name && MainConfig.UserInfo.nick_name.length > 0)? MainConfig.UserInfo.nick_name : "自己");
|
|
this.reflashScrollView();
|
|
}
|
|
|
|
ItemRenderer(idx:number,tNode:Node){
|
|
const rank = this.rankDatas[idx];
|
|
const ClassPoxy: hurtrankitem_Proxy = tNode.getComponent(hurtrankitem_Proxy);
|
|
ClassPoxy.setInfo((idx + 1), rank);
|
|
}
|
|
|
|
private reflashScrollView(){
|
|
this.mScrollViewFrame.m_ItemCount = this.mDataMgr.Trial.maxruntimeNum;
|
|
}
|
|
}
|