119 lines
3.6 KiB
JavaScript
119 lines
3.6 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, '2b7ffhHb31Hj6sy91kHIGUS', 'cmp.cchampion.challenge.wnd');
|
||
|
|
// Scripts/mod/pvp/crosschampion/cmp/cmp.cchampion.challenge.wnd.js
|
||
|
|
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
var CrossChampionController = require("crosschampion_controller");
|
||
|
|
var ArenaConst = require("arena_const");
|
||
|
|
var HeroController = require("hero_controller");
|
||
|
|
var HeroConst = require("hero_const");
|
||
|
|
var TipsController = require("tips_controller");
|
||
|
|
var ArenaEvent = require("arena_event");
|
||
|
|
var MenuWnd = require("cmp.com.menu.wnd");
|
||
|
|
|
||
|
|
// 标签页对应关系
|
||
|
|
var TabPage = [{
|
||
|
|
key: "MyRace",
|
||
|
|
tab: ArenaConst.champion_index.my_match_ready,
|
||
|
|
"goto": 0
|
||
|
|
}, {
|
||
|
|
key: "Quiz",
|
||
|
|
tab: ArenaConst.champion_index.guess,
|
||
|
|
"goto": 1
|
||
|
|
}, {
|
||
|
|
key: "SFRace",
|
||
|
|
tab: ArenaConst.champion_index.match,
|
||
|
|
"goto": 2
|
||
|
|
}, {
|
||
|
|
key: "SkillShop",
|
||
|
|
tab: ArenaConst.champion_index.rank,
|
||
|
|
"goto": 3
|
||
|
|
}];
|
||
|
|
cc.Class({
|
||
|
|
"extends": MenuWnd,
|
||
|
|
properties: {
|
||
|
|
// nodMenus: { default: null, type: FXTog },
|
||
|
|
nodStep: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node
|
||
|
|
},
|
||
|
|
nodBetOwn: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onLoad: function onLoad() {
|
||
|
|
this.bindGEvent(ArenaEvent.UpdateChampionBaseInfoEvent, this.onstageChange.bind(this));
|
||
|
|
this.bindGEvent(ArenaEvent.UpdateChampionRoleInfoEvent, this.freshOwn.bind(this));
|
||
|
|
},
|
||
|
|
onEnable: function onEnable() {
|
||
|
|
// 视图监听
|
||
|
|
this.vbind([["CChampion", this.showStageChange.bind(this)]]);
|
||
|
|
},
|
||
|
|
// 隐藏
|
||
|
|
onDisable: function onDisable() {
|
||
|
|
// 视图监听解除
|
||
|
|
this.vunbind();
|
||
|
|
},
|
||
|
|
freshGuess: function freshGuess() {
|
||
|
|
nx.gui.setActive(this.nodQuiz, "", true); // 顯示對戰相關數據
|
||
|
|
this.freshMatch();
|
||
|
|
},
|
||
|
|
freshSFRace: function freshSFRace() {
|
||
|
|
nx.gui.setActive(this.nodSFRace, "", true);
|
||
|
|
},
|
||
|
|
showStageChange: function showStageChange(_stagee) {
|
||
|
|
if (_stagee.step_status != ArenaConst.champion_step_status.over) {
|
||
|
|
nx.gui.setString(this.nodStep, "step", ArenaConst.dealDesc(_stagee.step, _stagee.round));
|
||
|
|
} else {
|
||
|
|
nx.gui.setString(this.nodStep, "step", nx.text.getKey("champion_str28"));
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onstageChange: function onstageChange(_stage) {
|
||
|
|
nx.bridge.vset("CChampion", _stage);
|
||
|
|
},
|
||
|
|
// 刷新可操作的相關數據
|
||
|
|
freshOwn: function freshOwn(_own) {
|
||
|
|
nx.gui.setString(this.nodBetOwn, "num", _own.can_bet);
|
||
|
|
var icon = game.configs.arena_cluster_champion_data.data_const.like_reward.val[0][0];
|
||
|
|
nx.bridge.setIconS(this.nodBetOwn, "icon", icon);
|
||
|
|
},
|
||
|
|
freshMatch: function freshMatch() {
|
||
|
|
nx.gui.setActive(this.nodRaceModel, "", true); // 顯示對戰相關數據
|
||
|
|
},
|
||
|
|
|
||
|
|
onTouchReward: function onTouchReward() {
|
||
|
|
var cct = CrossChampionController.getInstance();
|
||
|
|
nx.bridge.createPanel("WndArenaLoopCRankAward", {
|
||
|
|
ops: ["RankNow", "RankAwards"],
|
||
|
|
cb: function cb() {
|
||
|
|
cct.sender26214();
|
||
|
|
},
|
||
|
|
dfg: game.configs.arena_cluster_champion_data.data_awards,
|
||
|
|
show: "RankNow",
|
||
|
|
desc: nx.text.getKey("champion_str39")
|
||
|
|
});
|
||
|
|
},
|
||
|
|
// 點擊編隊
|
||
|
|
onTouchForm: function onTouchForm() {
|
||
|
|
var heros = HeroController.getInstance().getModel().getAllHeroArray();
|
||
|
|
HeroController.getInstance().openFormGoFightPanel(true, 6, {}, HeroConst.FormShowType.eFormSave);
|
||
|
|
// let LC = LadderController.getInstance();
|
||
|
|
// LC.openLadderTopThreeWindow( true );
|
||
|
|
},
|
||
|
|
|
||
|
|
// 规则说明
|
||
|
|
onTouchTip: function onTouchTip() {
|
||
|
|
var TC = TipsController.getInstance();
|
||
|
|
if (TC) {
|
||
|
|
var txt = game.configs.arena_cluster_champion_data.data_explain;
|
||
|
|
TC.showDetailPanel(txt);
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onTouchReport: function onTouchReport() {
|
||
|
|
nx.bridge.createPanel("WndCChampionWarLog");
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
cc._RF.pop();
|