"use strict"; cc._RF.push(module, '1d70awzjyFOELEx5kpJ0r1p', 'stronger_controller'); // Scripts/mod/stronger/stronger_controller.js "use strict"; // -------------------------------------------------------------------- // @author: xxx@syg.com(必填, 创建模块的人员) // @description: // 这里填写详细说明,主要填写该模块的功能简要 //
Create: 2019-03-29 11:43:16 // -------------------------------------------------------------------- var BridgeController = require("bridge.controller"); var StrongerEvent = require("stronger_event"); // 桥接替换的界面 var StrongerController = cc.Class({ "extends": BridgeController, ctor: function ctor() {}, // 初始化配置数据 initConfig: function initConfig() { var StrongerModel = require("stronger_model"); this.model = new StrongerModel(); this.model.initConfig(); this.is_first = true; }, // 返回当前的model getModel: function getModel() { return this.model; }, // 注册监听事件 registerEvents: function registerEvents() {}, // 注册协议接受事件 registerProtocals: function registerProtocals() { this.RegisterProtocal(11070, this.on11070.bind(this)); // -- 全服最强数据 }, reqBaseFromServer: function reqBaseFromServer(_cb) { // 配置加载 var cfgs = ["stronger_data", // 我要变强 "dailyplay_data"]; this.loadConfigs(cfgs, function (_ret, _data) { nx.dt.fnInvoke(_cb, true); }); }, on11070: function on11070(data) { this.model.setDataByBid(data); gcore.GlobalEvent.fire(StrongerEvent.UPDATE_SCROE, data); }, //--打开我要变强主界面 openMainWin: function openMainWin(status, index, partner_id) { if (status) { nx.bridge.createPanel("WndStronger", { index: index, partner_id: partner_id }); } else { nx.bridge.closePanel("WndStronger"); } }, setIsFirst: function setIsFirst(bool) { this.is_first = bool; }, sender11070: function sender11070(partner_bid) { var protocal = {}; protocal.partner_bid = partner_bid; this.SendProtocal(11070, protocal); }, getStrongerRoot: function getStrongerRoot() { if (this.main_win) return this.main_win.root_wnd; }, setCurHeroVo: function setCurHeroVo(hero_vo) { this.cur_hero_vo = hero_vo; }, clickCallBack: function clickCallBack(evt_type) { nx.bridge.jumper.jump2Window(evt_type); this.openMainWin(false); // if( evt_type == 200 ) {//英雄背包 // nx.bridge.jumper.jump2Window( 19 ); // } else if( evt_type == 201 ) {//神器升级 // nx.bridge.jumper.jump2Window( 20 ); // } else if( evt_type == 202 ) {//联盟技能界面 // nx.bridge.jumper.jump2Window( 32 ); // } else if( evt_type == 203 ) {//玩家英雄信息界面 // if( this.main_win ) { // // var cur_hero_item = this.main_win.view_list[1].getCurHero(); // if( this.cur_hero_vo ) { // var hero_vo = this.cur_hero_vo.getData(); // var HeroController = require( "hero_controller" ); // var HeroConst = require( "hero_const" ); // var all_role_list = HeroController.getInstance().getModel().getAllHeroArray(); // HeroController.getInstance().openHeroMainInfoWindow( true, hero_vo, all_role_list, { show_model_type: HeroConst.BagTab.eBagHero } ) // } // } // } else if( evt_type == 204 ) {//先知殿 // nx.bridge.jumper.jump2Window( 24 ); // } else if( evt_type == 100 ) {//布阵阵法 // nx.bridge.jumper.jump2Window( 30 ); // } else if( evt_type == 120 ) {//召唤 // nx.bridge.jumper.jump2Window( 1 ); // } else if( evt_type == 121 ) {//背包 碎片 // var BackPackConst = require( "backpack_const" ); // nx.bridge.jumper.jump2Window( 8, BackPackConst.item_sub_type.HERO ) // } else if( evt_type == 122 ) {//英雄商城 // var MallConst = require( "mall_const" ); // nx.bridge.jumper.jump2Window( 15, MallConst.MallType.Recovery ) // } else if( evt_type == 123 || evt_type == 162 ) {//金币兑换 // nx.bridge.jumper.jump2Window( 35 ); // } else if( evt_type == 125 ) {//金币出售 // } else if( evt_type == 126 ) {//远航 // nx.bridge.jumper.jump2Window( 18 ); // } else if( evt_type == 128 ) {//银币摆摊 // } else if( evt_type == 129 ) { // nx.bridge.jumper.jump2Window( 41 ); // } else if( evt_type == 130 ) {//成就 // var TaskConst = require( "task_const" ); // nx.bridge.jumper.jump2Window( 41, TaskConst.type.feat ); // } else if( evt_type == 131 ) {//充值 // nx.bridge.jumper.jump2Window( 7, VIPTABCONST.DAILY_GIFT ); // } else if( evt_type == 132 ) {//快速作战 // nx.bridge.jumper.jump2Window( 11 ); // } else if( evt_type == 134 ) {//杂货店 // nx.bridge.jumper.jump2Window( 6 ); // } else if( evt_type == 135 ) {//金币市场 突破 // } else if( evt_type == 138 ) {//钻石商城 // var MallConst = require( "mall_const" ); // nx.bridge.jumper.jump2Window( 15, MallConst.MallType.GodShop ); // } else if( evt_type == 144 ) {//道具背包 // var BackPackConst = require( "backpack_const" ); // nx.bridge.jumper.jump2Window( 8, BackPackConst.item_sub_type.PROPS ); // } else if( evt_type == 145 ) {//联盟捐献 // var RoleController = require( "role_controller" ) // var role_vo = RoleController.getInstance().getRoleVo(); // if( role_vo.isHasGuild() ) { // nx.bridge.jumper.jump2Window( 13 ); // } else { // nx.bridge.jumper.jump2Window( 50 ); // } // } else if( evt_type == 146 ) {//公会副本 // var RoleController = require( "role_controller" ) // var role_vo = RoleController.getInstance().getRoleVo(); // if( role_vo.isHasGuild() ) { // nx.bridge.jumper.jump2Window( 31 ); // } else { // nx.bridge.jumper.jump2Window( 50 ); // } // } else if( evt_type == 150 ) {//星河神殿 // nx.bridge.jumper.jump2Window( 27 ); // } else if( evt_type == 151 ) {//英雄远征 // nx.bridge.jumper.jump2Window( 25 ); // } else if( evt_type == 152 ) {//日常副本 // nx.bridge.jumper.jump2Window( 17 ); // } else if( evt_type == 153 ) {//无尽试炼 // var open_data = game.configs.dailyplay_data.data_exerciseactivity[ 2 ]; // if( open_data == null ) { // nx.tbox( nx.text.getKey( "lab_stronger_controller_tip1" ) ); // return; // } // var Endless_trailController = require( "endless_trail_controller" ); // var is_open = Endless_trailController.getInstance().checkIsOpen(); // if( is_open ) { // nx.bridge.jumper.jump2Window( 43 ); // } // } else if( evt_type == 154 ) {//锻造屋 // nx.bridge.jumper.jump2Window( 26 ); // } else if( evt_type == 155 ) {//融合祭坛 // nx.bridge.jumper.jump2Window( 23 ); // } else if( evt_type == 156 ) {//祭祀小屋 // nx.bridge.jumper.jump2Window( 22 ); // } else if( evt_type == 157 ) {//剧情副本 // nx.bridge.jumper.jump2Window( 5 ); // } else if( evt_type == 158 ) {//竞技场 // nx.bridge.jumper.jump2Window( 3 ); // } else if( evt_type == 159 ) {//冠军赛 // nx.bridge.jumper.jump2Window( 36 ); // } else if( evt_type == 160 ) {//试练塔 // nx.bridge.jumper.jump2Window( 12 ); // } else if( evt_type == 402 ) {//好友 // nx.bridge.jumper.jump2Window( 4 ); // } else if( evt_type == 404 ) {//英雄界面 // nx.bridge.jumper.jump2Window( 19 ); // } else if( evt_type == 405 ) {//幸运探宝 // nx.bridge.jumper.jump2Window( 40 ); // } else if( evt_type == 406 ) {//探宝商店 // var MallConst = require( "mall_const" ); // nx.bridge.jumper.jump2Window( 15, MallConst.MallType.GuessShop ); // } else if( evt_type == 407 ) {//冒险 // nx.bridge.jumper.jump2Window( 34 ); // } else if( evt_type == 408 || evt_type == 161 ) {//锻造坊的符文 // var ForgeHouseConst = require( "forgehouse_const" ); // nx.bridge.jumper.jump2Window( 26, ForgeHouseConst.Tab_Index.Artifact ); // } else if( evt_type == 409 ) { // nx.bridge.jumper.jump2Window( 20 ); // } else if( evt_type == 410 ) {//精英段位赛商店 // var MallConst = require( "mall_const" ); // nx.bridge.jumper.jump2Window( 15, MallConst.MallType.EliteShop ); // } else if( evt_type == 411 ) { // var ActionConst = require( "action_const" ); // nx.bridge.jumper.jump2Window( 45, ActionConst.ActionRankCommonType.time_summon ); // } else if( evt_type == 412 ) {//打开录像馆 // require( "vedio_controller" ).getInstance().openVedioMainWindow( true ); // } else if( evt_type == 413 ) {//打开录像馆个人记录 // require( "vedio_controller" ).getInstance().openVedioMyselfWindow( true ) // } } }); module.exports = StrongerController; cc._RF.pop();