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.
 
 
 
 

53 lines
1.4 KiB

//*********************
// create by 流云
// time: Tue Aug 11 2026
// desc:
//*********************
import { _decorator, Component, Node, find } from 'cc';
import { Auto_PopHelp } from './Auto_PopHelp';
const { ccclass, property } = _decorator;
@ccclass('UIPopHelp')
export class UIPopHelp extends Auto_PopHelp {
onLoad(): void {
super.onLoad();
}
onEnable(): void {
super.onEnable();
}
onDisable(): void {
super.onDisable();
}
onInit(): void {
const param = this._normalizeParam(this.prema);
const type = param?.type ?? 0;
this.ui_HelpDeffLevel.active = type === 1;
this.ui_HelpReplica.active = type === 2;
if (type === 2 && this.lb_desc) {
this.lb_desc.string = param?.desc ?? '';
}
}
/** 兼容旧版直接传副本 desc 字符串 */
private _normalizeParam(raw: unknown): { type: number; desc?: string } | null {
if (raw == null) return null;
if (typeof raw === 'string') {
return { type: 2, desc: raw };
}
if (typeof raw === 'object' && 'type' in raw) {
const type = Number((raw as { type: number }).type);
const desc = (raw as { desc?: string }).desc;
return { type, desc };
}
return null;
}
click_btnClose(): void {
this.close(2);
}
}