//#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 { ResUrlLoad } from "../../CComEx/ResUrlLoad"; import { GameTotalType } from "../../const/GameEnum"; //#endregion 文件引入 const {ccclass, property,menu} = _decorator; @ccclass("MsgBoxUI_Proxy") export default class MsgBoxUI_Proxy extends BaseUIForm{ //#region 节点自动生成 @property(Label) lab_title: Label = null; @property(Label) lab_content: Label = null; @property(Button) btn_No: Button = null; @property(Button) btn_Yes: Button = null; @property(Node) n_coinInfo: Node = null; @property(Label) lab_coindesc: Label = null; @property(Node) n_coin: Node = null; @property(Label) lab_coin: Label = null; //#endregion 节点自动生成 onButtonClick(button:Button){ /**点击事件触发*/ switch (button) { case this.btn_No: this.onClick_bgCloseBtn(); break; case this.btn_Yes: this.CloseUI(); this.param && this.param.okcallback && this.param.okcallback(); break; default: ConsoleEx.Log(button); break; } } onClick_bgCloseBtn(btn?: Node): void { this.CloseUI(btn); this.param && this.param.nocallback && this.param.nocallback(); } protected start(): void { CNodeUtils.switchText(this.lab_title, this.param? this.param.title : "提示"); CNodeUtils.switchText(this.lab_content, this.param? this.param.content : "提示内容?"); CNodeUtils.setActive(this.n_coinInfo, this.param && this.param.coininfo); if(this.param && this.param.coininfo){ CNodeUtils.switchText(this.lab_coindesc, (this.param && this.param.coininfo)? this.param.coininfo.desc: ""); CNodeUtils.switchText(this.lab_coin, (this.param && this.param.coininfo)? this.param.coininfo.coin: ""); const tokenicon = this.n_coin.getComponent(ResUrlLoad); tokenicon.showResInfo(GameTotalType.TOKEN, (this.param && this.param.coininfo)? this.param.coininfo.cointype: ""); } } }