98 lines
3.1 KiB
JavaScript
98 lines
3.1 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, 'a6985cismpH/btGoZV1cpAd', 'cmp.pvp.ladder.worship.wnd');
|
|
// Scripts/mod/pvp/ladder/cmp/cmp.pvp.ladder.worship.wnd.js
|
|
|
|
"use strict";
|
|
|
|
var BridgeWindow = require("bridge.window");
|
|
var LadderController = require("ladder_controller");
|
|
var SVCItem = require("nx.fx.sv.expand.item");
|
|
var RoleEvent = require("role_event");
|
|
var TipsController = require("tips_controller");
|
|
var LadderEvent = require("ladder_event");
|
|
|
|
/***********************
|
|
*
|
|
* 膜拜排行面板
|
|
*
|
|
***********************/
|
|
|
|
cc.Class({
|
|
"extends": BridgeWindow,
|
|
properties: {
|
|
nodSeason: {
|
|
"default": null,
|
|
type: cc.Node,
|
|
displayName: "赛季信息节点"
|
|
},
|
|
nodWorship: {
|
|
"default": [],
|
|
type: cc.Node,
|
|
displayName: "膜拜排行"
|
|
}
|
|
},
|
|
onLoad: function onLoad() {
|
|
this.bindGEvent(LadderEvent.UpdateLadderTopThreeRoleData, this.freshAll.bind(this));
|
|
this.bindGEvent(RoleEvent.WorshipOtherRole, this.freshOneWorship.bind(this));
|
|
this.bindGEvent(LadderEvent.GetLadderEnemyData, this.showFightNod.bind(this));
|
|
},
|
|
onOpenConfigs: function onOpenConfigs(_params) {
|
|
// 获取膜拜信息等
|
|
var LC = LadderController.getInstance();
|
|
LC.requestTopThreeRoleData();
|
|
},
|
|
// 重载:关闭前
|
|
onPreClosed: function onPreClosed() {},
|
|
freshOneWorship: function freshOneWorship(_data) {
|
|
var chd = this.nodWorship;
|
|
// {"code":1,"msg":"","type":0,"rid":79,"srv_id":"dev_2","idx":7}
|
|
for (var i = 0; i < chd.length; i++) {
|
|
var item = chd[i];
|
|
var cmp = item.getComponent(SVCItem);
|
|
if (cmp) {
|
|
if (cmp.mdata && cmp.mdata.rid == _data.rid) {
|
|
var data = nx.dt.objClone(cmp.mdata);
|
|
data.worship = cmp.mdata.worship + 1;
|
|
data.worship_status = cmp.mdata.worship_status + 1;
|
|
cmp.rebind(i, data);
|
|
}
|
|
}
|
|
}
|
|
},
|
|
freshAll: function freshAll(_data) {
|
|
if (!_data) {
|
|
this.close();
|
|
return;
|
|
}
|
|
// [{"rid":281,"srv_id":"fx_1","name":"Dhizoztyd","lev":90,"rank":1,"score":1427,"sex":2,"lookid":110401,"face_update_time":0,"face_file":"","worship":3,"worship_status":1},
|
|
// {"rid":140,"srv_id":"fx_1","name":"Myuokok","lev":90,"rank":2,"score":1105,"sex":2,"lookid":110401,"face_update_time":0,"face_file":"","worship":4,"worship_status":1},
|
|
// {"rid":282,"srv_id":"fx_1","name":"Frmalfew","lev":90,"rank":3,"score":1022,"sex":2,"lookid":110401,"face_update_time":0,"face_file":"","worship":3,"worship_status":1}]
|
|
var lst = _data;
|
|
var chd = this.nodWorship;
|
|
for (var i = 0; i < chd.length; i++) {
|
|
var item = chd[i];
|
|
var data = lst[i] || {};
|
|
if (data) {
|
|
var cmp = item.getComponent(SVCItem);
|
|
if (cmp) {
|
|
cmp.rebind(i, data);
|
|
}
|
|
}
|
|
}
|
|
},
|
|
// 规则说明
|
|
onTouchTip: function onTouchTip() {
|
|
var desc = game.configs.arena_data.data_explain[3];
|
|
var TC = TipsController.getInstance();
|
|
if (TC) {
|
|
TC.showTextPanel(desc.title, desc.desc);
|
|
}
|
|
},
|
|
// 点击 显示对应的对手数据
|
|
showFightNod: function showFightNod(_fightinfo) {
|
|
var LC = LadderController.getInstance();
|
|
LC.openLadderRoleInfoWindow(true, _fightinfo);
|
|
}
|
|
});
|
|
|
|
cc._RF.pop(); |