Files

140 lines
3.6 KiB
JavaScript
Raw Permalink Normal View History

2026-05-23 22:10:14 +08:00
const CrossChampionController = require("crosschampion_controller");
const ArenaConst = require( "arena_const" );
const HeroController = require("hero_controller");
const HeroConst = require( "hero_const" );
const TipsController = require( "tips_controller" );
const ArenaEvent = require( "arena_event" );
const MenuWnd = require( "cmp.com.menu.wnd" );
// 标签页对应关系
const 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() {
this.bindGEvent( ArenaEvent.UpdateChampionBaseInfoEvent, this.onstageChange.bind( this ));
this.bindGEvent( ArenaEvent.UpdateChampionRoleInfoEvent, this.freshOwn.bind( this ) );
},
onEnable: function(){
// 视图监听
this.vbind( [
[ "CChampion", this.showStageChange.bind( this ) ]
] );
},
// 隐藏
onDisable: function() {
// 视图监听解除
this.vunbind();
},
freshGuess: function(){
nx.gui.setActive( this.nodQuiz, "", true ); // 顯示對戰相關數據
this.freshMatch();
},
freshSFRace: function(){
nx.gui.setActive( this.nodSFRace, "", true );
},
showStageChange: function( _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( _stage ){
nx.bridge.vset( "CChampion", _stage );
},
// 刷新可操作的相關數據
freshOwn: function( _own ){
nx.gui.setString( this.nodBetOwn, "num", _own.can_bet );
let icon = game.configs.arena_cluster_champion_data.data_const.like_reward.val[0][0];
nx.bridge.setIconS( this.nodBetOwn, "icon", icon );
},
freshMatch: function(){
nx.gui.setActive( this.nodRaceModel, "", true ); // 顯示對戰相關數據
},
onTouchReward: function() {
let cct = CrossChampionController.getInstance();
nx.bridge.createPanel( "WndArenaLoopCRankAward", {
ops: [ "RankNow","RankAwards" ],
cb: () => {
cct.sender26214();
},
dfg: game.configs.arena_cluster_champion_data.data_awards,
show: "RankNow",
desc : nx.text.getKey( "champion_str39" ),
} );
},
// 點擊編隊
onTouchForm: function(){
let heros = HeroController.getInstance().getModel().getAllHeroArray();
HeroController.getInstance().openFormGoFightPanel( true, 6, {}, HeroConst.FormShowType.eFormSave );
// let LC = LadderController.getInstance();
// LC.openLadderTopThreeWindow( true );
},
// 规则说明
onTouchTip: function() {
let TC = TipsController.getInstance();
if( TC ) {
let txt = game.configs.arena_cluster_champion_data.data_explain;
TC.showDetailPanel( txt );
}
},
onTouchReport: function(){
nx.bridge.createPanel( "WndCChampionWarLog" );
}
});