Files
fc/dev/project/assets/Scripts/mod/battle_drama/cmp/cmp.battledrama.hookreward.js
T
2026-05-23 22:10:14 +08:00

84 lines
1.9 KiB
JavaScript

const BridgeWindow = require("bridge.window");
const FxSVC = require( "nx.fx.sv.expand" );
var PathTool = require("pathtool");
var TimeTool = require("timetool");
var BattleDramaController = require("battle_drama_controller");
var RoleController = require("role_controller");
var DramaEvent = require("battle_drama_event");
cc.Class({
extends: BridgeWindow,
properties: {
SVClist:{
default:null,
type:FxSVC
},
Bonlist:{
default:null,
type:FxSVC
},
time_title:{
default:null,
type:cc.Label
},
time_value:{
default:null,
type:cc.Label
},
},
// LIFE-CYCLE CALLBACKS:
onLoad() {
this.controller = BattleDramaController.getInstance();
this.drama_model = this.controller.getModel();
this.role_vo = RoleController.getInstance().getRoleVo();
//快速战斗数据更新
this.bindGEvent(DramaEvent.UpHookRewardWin, this.upHookData.bind(this));
},
start() {
},
touchGetItems(){
this.controller.requestGetHookTimeAwards((_data)=>{
if(_data){
this.controller.openDramHookRewardView(false);
}
});
},
onOpenConfigs() {
this.time_title.string = nx.text.getKey("action_str27");
this.controller.send13017();
},
onPreClosed() {
this.SVClist.rebuild([]);
this.Bonlist.rebuild([]);
},
setBaseInfo:function(data){
if(!data) return;
this.time_value.string = TimeTool.getTimeFormat(data.hook_time);
},
upHookData(data){
this.setBaseInfo(data);
this.SVClist.rebuild(data.list);
this.Bonlist.rebuild(data.list1);
},
onDisable(){
if( nx.bridge.prompt ) {
nx.bridge.prompt.delPrompt(31);
}
},
// update (dt) {},
});