大侠
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.
 
 
 

72 lines
2.7 KiB

//#region 文件引入
import { _decorator, Button, Component, Label, Node, sp, Sprite,Animation, RichText } from "cc";
import BaseUIForm from "../../Mgr_UI/BaseUIForm";
import UIMgr from "../../Mgr_UI/UIMgr";
import { EUIForms } from "../../const/UIFormCnf";
import GDUtils from "../../ExCUtils/GDUtils";
import { QualityType } from "../../const/GameEnum";
import StringUtils from "../../ExUtils/StringUtils";
//#endregion 文件引入
const {ccclass, property,menu} = _decorator;
@ccclass("PopRstRewardUI_Proxy")
export default class PopRstRewardUI_Proxy extends BaseUIForm{
//#region 节点自动生成
@property(Node)
n_reward_coin: Node = null;
@property(Node)
n_reward_xwf: Node = null;
@property(RichText)
ric_talen: RichText = null;
@property(Label)
lab_taleneffect: Label = null;
@property(Button)
btn_talen: Button = null;
@property(Node)
n_back_xwf: Node = null;
@property(Node)
n_back_exp: Node = null;
//#endregion 节点自动生成
onButtonClick(button:Button){
/**点击事件触发*/
switch (button) {
case this.btn_talen:
UIMgr.Ins.ShowUI(EUIForms.PopTalentDescUI);
break;
default:
ConsoleEx.Log(button);
break;
}
}
protected start(): void {
this.initRewardInfo();
this.initTalenInfo();
this.initBackInfo();
}
initRewardInfo() {
const coin = this.n_reward_coin.getChildByName("coin");
CNodeUtils.switchText(coin, StringUtils.formatLargeNumber(this.param.coin));
const xwf = this.n_reward_xwf.getChildByName("coin");
CNodeUtils.switchText(xwf, this.param.xwf);
}
initTalenInfo() {
const talencfg = this.mDataMgr.Talent.talentData;
if(talencfg){
const name = GDUtils.GetHEXByQualityForStr(talencfg.name, QualityType.ORANGE);
CNodeUtils.switchRichText(this.ric_talen,`${name}已生效`);
const effect = `效果:${StringUtils.format(talencfg.display,talencfg.prop1)}`;
CNodeUtils.switchText(this.lab_taleneffect,effect);
}
}
initBackInfo() {
const exp = this.n_back_exp.getChildByName("exp");
CNodeUtils.switchText(exp, this.param.backexp);
const xwf = this.n_back_xwf.getChildByName("xwf");
CNodeUtils.switchText(xwf, this.param.backxwf);
}
}