Files
fc/dev/project/assets/Scripts/mod/pve/adventure/cmp/cmp.adventure.ui.log.js
T

64 lines
1.5 KiB
JavaScript
Raw Normal View History

2026-05-23 22:10:14 +08:00
const BridgeComp = require("bridge.component");
const ADVCT = require("adventure_controller");
const ADEVT = require("adventure_event");
const NxExpand = require("nx.fx.sv.expand");
//日志模塊
cc.Class({
extends: BridgeComp,
properties: {
content:{
default:null,
type:cc.Node
},
item:{
default:null,
type:cc.Node
}
},
// LIFE-CYCLE CALLBACKS:
onLoad () {
this._super();
this.bindGEvent(ADEVT.Update_Fight_Log,this.refreshLogs.bind(this));
},
start () {
},
onEnable(){
this.type = ADVCT.getInstance().getPlayModel();
ADVCT.getInstance().send29543(this.type);
},
onDisable(){
this.unbindGEvents();
nx.bridge.NodeChidrenDestroy(this.content);
},
refreshLogs(data){
nx.bridge.NodeChidrenDestroy(this.content);
let infos = data.log_info;
for(let i = 0;i < infos.length;i++){
let bid = infos[i].item_id;
let cfg = null;
if(this.type == 1){
cfg = game.configs.adventure_endless_data.data_evt_desc[bid];
}else{
cfg = game.configs.adventure_weekly_data.data_adventure_event[bid];
}
let c = cc.instantiate(this.item);
c.parent = this.content;
c.x = 0;
c.active = true;
nx.gui.setString(c,"scroll/txt",cfg.log);
}
}
// update (dt) {},
});