const BridgeWindow = require( "bridge.window" ); const NXExpand = require( "nx.fx.sv.expand" ); const Mod = require( "pvprank.mod" ); const ElitematchEvent = require( "elitematch_event" ); cc.Class({ extends: BridgeWindow, properties: { nodList: {default: null, type: NXExpand }, }, onLoad: function(){ this.bindGEvent( ElitematchEvent.Elite_Challenge_Record_Info_Event, this.freshInfo.bind( this ) ); }, /** * {"type":1,"id":2,"arena_replay_infos":[ * {"order":1,"id":762,"round":1,"ret":1,"time":1713163257,"rid":2079,"srv_id":"fx_1","a_power":53092, * "a_formation_type":1,"a_order":1,"a_end_hp":100,"b_rid":2076,"b_srv_id":"fx_1","b_power":918,"b_formation_type":1, * "b_order":1,"b_end_hp":0, * "a_plist":[ * {"pos":9,"bid":50505,"lev":80,"star":5,"ext":[{"key":5,"val":0},{"key":11,"val":0}]}, * {"pos":7,"bid":20502,"lev":90,"star":5,"ext":[{"key":5,"val":0},{"key":11,"val":0}]}, * {"pos":6,"bid":40505,"lev":1,"star":5,"ext":[{"key":5,"val":0},{"key":11,"val":0}]}, * {"pos":4,"bid":40504,"lev":60,"star":5,"ext":[{"key":5,"val":0},{"key":11,"val":0}]}, * {"pos":2,"bid":10507,"lev":48,"star":5,"ext":[{"key":5,"val":0},{"key":11,"val":0}]}], * "b_plist":[ * {"pos":2,"bid":30404,"lev":1,"star":4,"ext":[{"key":5,"val":0},{"key":11,"val":0}]}], * "hurt_statistics":[ * {"type":2,"partner_hurts":[ * {"rid":2076,"srvid":"fx_1","id":1,"bid":30404,"star":4,"lev":1,"camp_type":3,"dps":0,"cure":0,"ext_data":[{"key":5,"val":0},{"key":11,"val":0}],"be_hurt":3861}]}, * {"type":1,"partner_hurts":[{"rid":2079,"srvid":"fx_1","id":7,"bid":10507,"star":5,"lev":48,"camp_type":1,"dps":0,"cure":0,"ext_data":[{"key":5,"val":0},{"key":11,"val":0}], * "be_hurt":0},{"rid":2079,"srvid":"fx_1","id":4,"bid":40504,"star":5,"lev":60,"camp_type":4,"dps":0,"cure":0,"ext_data":[{"key":5,"val":0},{"key":11,"val":0}],"be_hurt":0}, * {"rid":2079,"srvid":"fx_1","id":123,"bid":40505,"star":5,"lev":1,"camp_type":4,"dps":0,"cure":0,"ext_data":[{"key":5,"val":0},{"key":11,"val":0}],"be_hurt":0}, * {"rid":2079,"srvid":"fx_1","id":6,"bid":20502,"star":5,"lev":90,"camp_type":2,"dps":3861,"cure":0,"ext_data":[{"key":5,"val":0},{"key":11,"val":0}],"be_hurt":0}, * {"rid":2079,"srvid":"fx_1","id":3,"bid":50505,"star":5,"lev":80,"camp_type":5,"dps":0,"cure":0,"ext_data":[{"key":5,"val":0},{"key":11,"val":0}],"be_hurt":0}]}], * "a_sprite_lev":1,"a_sprites":[{"pos":1,"item_bid":0}],"b_sprite_lev":1,"b_sprites":[{"pos":1,"item_bid":0}],"a_add_power":0,"b_add_power":0}]}*** * * */ // sender24931 onOpenConfigs: function( _params ){ this.mod = Mod.getInstance(); if( !this.mod ){ this.delayClose(); return; } let type = _params.type; let id = _params.id; this.infoo = _params.infoo; this.combat_type = _params.combat_type; this.mod.sender24931( type, id ); nx.gui.setString( this, "panel/top/left/elite", nx.text.format( "PvpRankTopDescDiff", this.infoo.srv_id, this.infoo.atk_elite_lev ) ); nx.gui.setString( this, "panel/top/right/elite", nx.text.format( "PvpRankTopDescDiff", this.infoo.def_srv_id, this.infoo.def_elite_lev ) ); nx.gui.setString( this, "panel/top/left/namee", this.infoo.atk_name ); nx.gui.setString( this, "panel/top/right/namee", this.infoo.def_name ); nx.gui.setString( this, "panel/top/score", nx.text.format( "PvpRScore", this.infoo.win_count, this.infoo.lose_count )); }, freshInfo: function( _data ){ if( nx.dt.arrNEmpty( _data.arena_replay_infos ) ){ for (let i = 0; i < _data.arena_replay_infos.length; i++) { let info = _data.arena_replay_infos[i]; info.combat_type = this.combat_type; } } this.nodList.rebuild( _data.arena_replay_infos ); // console.log( "顯示相關的數據" + JSON.stringify( _data )); }, });