Files
fc/dev/project/library/imports/e2/e2d43917-581e-4fb2-ae70-3c81a061ce91.js
T

131 lines
4.0 KiB
JavaScript
Raw Normal View History

2026-05-24 10:21:26 +08:00
"use strict";
cc._RF.push(module, 'e2d43kXWB5Psq5wPIGgYc6R', 'cmp.cchampion.grecord.item');
// Scripts/mod/pvp/crosschampion/cmp/cmp.cchampion.grecord.item.js
"use strict";
var SVCItem = require("nx.fx.sv.expand.item");
var Header = require("cmp.common.header");
var RoleController = require("role_controller");
var BattleController = require("battle_controller");
var ArenaConst = require("arena_const");
/**********
*
* 各不同类型排行列表单个ui数据显示
*/
cc.Class({
"extends": SVCItem,
properties: {
nodfOtherHeader: {
"default": null,
type: Header,
displayName: "对战者头像1"
},
nodOtherHeader: {
"default": null,
type: Header,
displayName: "对战者头像"
},
nodResult: {
"default": null,
type: cc.Node,
displayName: "输赢显示"
},
nodResultScore: {
"default": null,
type: cc.Node,
displayName: "输赢分数显示"
}
},
// 数据重置
rebind: function rebind(_idx, _data, _key) {
this._super(_idx, _data, _key);
this.freshInfo();
},
// 刷新具体信息
freshInfo: function freshInfo() {
if (!this.mdata) {
return;
}
this.freshHeader();
this.freshContentInfo();
},
freshHeader: function freshHeader() {
var adata = {
face: this.mdata.a_face,
avatar: this.mdata.a_avatar_id == 0 ? 1000 : this.mdata.a_avatar_id
};
this.nodfOtherHeader.setData(adata);
nx.gui.setString(this.nodfOtherHeader, "name", this.mdata.a_name);
nx.gui.setString(this.nodOtherHeader, "name", this.mdata.b_name);
var data = {
face: this.mdata.b_face,
avatar: this.mdata.b_avatar_id == 0 ? 1000 : this.mdata.b_avatar_id
};
this.nodOtherHeader.setData(data);
},
// 根据阶段回合显示相应的说明
dealDesc: function dealDesc(_stage, _round) {
var stage = _stage;
var round = _round;
var desc = "";
switch (stage) {
case ArenaConst.champion_step.score:
{
desc = nx.text.format("TrialsDesc", round);
}
;
break;
case ArenaConst.champion_step.match_64:
{
if (round <= 1) {
desc = nx.text.format("Match64Desc", 32);
} else if (round == 2) {
desc = nx.text.format("Match64Desc", 16);
} else {
desc = nx.text.format("Match64Desc", 8);
}
}
;
break;
case ArenaConst.champion_step.match_8:
{
if (round == 1) {
desc = nx.text.format("Match64Desc", 4);
} else if (round == 2) {
desc = nx.text.getKey("MHalfFianl");
} else if (round == 3) {
desc = nx.text.getKey("FinalRace");
} else {
desc = nx.text.getKey("FinalRace");
}
}
;
break;
}
return desc;
},
freshContentInfo: function freshContentInfo() {
nx.gui.setActive(this.nodResult, "self", this.mdata.ret == 1);
nx.gui.setActive(this.nodResult, "ico", this.mdata.ret == 2);
var clr = this.mdata.get_bet > 0 ? new cc.Color().fromHEX("#0b9014") : new cc.Color().fromHEX("#ff6600");
nx.gui.setString(this, "race", this.dealDesc(this.mdata.step, this.mdata.round));
nx.gui.setString(this.nodResultScore, "title", this.mdata.get_bet > 0 ? nx.text.getKey("champion_str30") : nx.text.getKey("champion_str31"));
nx.gui.setString(this.nodResultScore, "num", this.mdata.get_bet > 0 ? this.mdata.get_bet : this.mdata.bet);
var icon = game.configs.arena_cluster_champion_data.data_const.like_reward.val[0][0];
nx.gui.setColor(this.nodResultScore, "num", clr);
nx.bridge.setIconS(this.nodResultScore, "icon", icon);
},
onTouchRecord: function onTouchRecord() {
var srv_id = nx.bridge.vget("curServer").srv_id;
BattleController.getInstance().sender_20036(this.mdata.replay_id, srv_id);
nx.bridge.closePanel("WndCChampionBet");
},
onTouchHarm: function onTouchHarm() {
nx.bridge.createPanel("WndCChampionPartDetail", this.mdata);
}
});
cc._RF.pop();