const BridgeWindow = require( "bridge.window" ); const HEACT = require("heaven_controller"); const NxExpand = require("nx.fx.sv.expand"); const HeavenEvent = require("heaven_event"); cc.Class({ extends: BridgeWindow, properties: { list:{ default:null, type:NxExpand } }, // LIFE-CYCLE CALLBACKS: onLoad () { this.ctrl = HEACT.getInstance(); this.model = this.ctrl.getModel(); //獎勵刷新 this.bindGEvent(HeavenEvent.Refresh_Chapter_Award_Event,this.refreshAwards.bind(this)); }, start () { }, onOpenConfigs(params) { this.chapter_id = params.id; this.refreshAwards(); }, refreshAwards(){ let award_list = []; let award_info = game.configs.dungeon_heaven_data.data_star_award[this.chapter_id]; if(award_info){ for(let i in award_info){ let data = award_info[i]; award_list.push(data); } } this.list.rebuild(award_list); }, onPreClosed() { this.list.rebuild([]); }, // update (dt) {}, });