2489 lines
86 KiB
JavaScript
2489 lines
86 KiB
JavaScript
// --------------------------------------------------------------------
|
|
// @author: xxx@syg.com(必填, 创建模块的人员)
|
|
// @description:
|
|
// 这里填写详细说明,主要填写该模块的功能简要
|
|
// <br/>Create: {DATE}
|
|
// --------------------------------------------------------------------
|
|
const BridgeController = require( "bridge.controller" );
|
|
var HeroConst = require( "hero_const" );
|
|
var HeroEvent = require( "hero_event" );
|
|
var PartnerConst = require( "partner_const" );
|
|
var HeroCalculate = require( "hero_calculate" );
|
|
var BackPackConst = require( "backpack_const" );
|
|
var MainuiConst = require( "mainui_const" );
|
|
var MainuiController = require( "mainui_controller" );
|
|
const BackPackController = require( "backpack_controller" );
|
|
|
|
// 桥接替换的界面
|
|
|
|
var HeroController = cc.Class( {
|
|
extends: BridgeController,
|
|
ctor: function() { },
|
|
|
|
// 初始化配置数据
|
|
initConfig: function() {
|
|
var HeroModel = require( "hero_model" );
|
|
|
|
this.model = new HeroModel( this );
|
|
this.model.initConfig();
|
|
},
|
|
|
|
// 返回当前的model
|
|
getModel: function() {
|
|
return this.model;
|
|
},
|
|
|
|
// 注册监听事件
|
|
registerEvents: function() {
|
|
// 断线重连重置一下伙伴及其装备缓存数据
|
|
this.re_link_game_event = gcore.GlobalEvent.bind( EventId.EVT_RE_LINK_GAME, function() {
|
|
// this.sender11000();
|
|
// this.sender11040();
|
|
// this.sender11037();
|
|
}.bind( this ) )
|
|
|
|
// 角色数据创建完毕后,监听资产数据变化情况
|
|
this.login_event_success = gcore.GlobalEvent.bind( EventId.EVT_ROLE_CREATE_SUCCESS, function() {
|
|
gcore.GlobalEvent.unbind( this.login_event_success )
|
|
this.login_event_success = null;
|
|
|
|
var RoleController = require( "role_controller" )
|
|
var role_vo = RoleController.getInstance().getRoleVo();
|
|
this.role_update_evt = role_vo.bind( EventId.UPDATE_ROLE_ATTRIBUTE, function( key, lev ) {
|
|
if( key == "coin" ) {
|
|
this.model.checkLevelRedPointUpdate();
|
|
} else if( key == "hero_exp" ) {
|
|
this.model.checkLevelRedPointUpdate();
|
|
} else if( key == "lev" ) {
|
|
this.model.checkUnlockFormRedPoint( lev );
|
|
}
|
|
}, this );
|
|
|
|
|
|
}.bind( this ) )
|
|
|
|
// 物品道具增加 判断红点
|
|
if( !this.add_goods_event ) {
|
|
this.add_goods_event = gcore.GlobalEvent.bind( EventId.ADD_GOODS, function( bag_code, temp_add ) {
|
|
|
|
if( bag_code == BackPackConst.Bag_Code.EQUIPS ) {
|
|
this.model.is_equip_redpoint_bag_update = true
|
|
this.model.checkEquipRedPointUpdate()
|
|
} else {
|
|
for( var item_i in temp_add ) {
|
|
var item = temp_add[ item_i ];
|
|
if( item.base_id == this.model.upgrade_star_cost_id ) {
|
|
this.model.is_upgradestar_redpoint_bag_update = true;
|
|
this.model.checkUpgradeStarRedPointUpdate();
|
|
this.model.checkLevelRedPointUpdate();
|
|
} else if( item.base_id == this.model.talent_skill_cost_id ) {
|
|
this.model.setUpdateTalentRedpoint();
|
|
this.model.checkTalentRedPointUpdate();
|
|
}
|
|
|
|
// gdata("item_data", "data_skill_item_list", item.base_id);
|
|
|
|
if( Utils.getItemConfig( item.base_id ) ) {
|
|
this.model.setUpdateTalentRedpoint()
|
|
this.model.checkTalentRedPointUpdate()
|
|
}
|
|
}
|
|
}
|
|
}.bind( this ) )
|
|
}
|
|
|
|
// 物品道具删除 判断红点
|
|
if( !this.del_goods_event ) {
|
|
this.del_goods_event = gcore.GlobalEvent.bind( EventId.DELETE_GOODS, function( bag_code, temp_add ) {
|
|
if( bag_code == BackPackConst.Bag_Code.EQUIPS ) {
|
|
this.model.is_equip_redpoint_bag_update = true;
|
|
this.model.checkEquipRedPointUpdate();
|
|
} else {
|
|
for( var item_i in temp_add ) {
|
|
var item = temp_add[ item_i ];
|
|
|
|
if( item.base_id == this.model.upgrade_star_cost_id ) {
|
|
this.model.is_upgradestar_redpoint_bag_update = true
|
|
this.model.checkUpgradeStarRedPointUpdate()
|
|
this.model.checkLevelRedPointUpdate()
|
|
} else if( item.base_id == this.model.talent_skill_cost_id ) {
|
|
this.model.setUpdateTalentRedpoint()
|
|
this.model.checkTalentRedPointUpdate()
|
|
}
|
|
if( Utils.getItemConfig( item.base_id ) ) {
|
|
this.model.setUpdateTalentRedpoint()
|
|
this.model.checkTalentRedPointUpdate()
|
|
}
|
|
}
|
|
}
|
|
}.bind( this ) )
|
|
}
|
|
|
|
// 物品道具改变 判断红点
|
|
if( !this.modify_goods_event ) {
|
|
this.modify_goods_event = gcore.GlobalEvent.bind( EventId.MODIFY_GOODS_NUM, function( bag_code, temp_add ) {
|
|
if( bag_code == BackPackConst.Bag_Code.EQUIPS ) {
|
|
this.model.is_equip_redpoint_bag_update = true;
|
|
this.model.checkEquipRedPointUpdate();
|
|
} else {
|
|
for( var item_i in temp_add ) {
|
|
var item = temp_add[ item_i ];
|
|
|
|
if( item.base_id == this.model.upgrade_star_cost_id ) {
|
|
this.model.is_upgradestar_redpoint_bag_update = true
|
|
this.model.checkUpgradeStarRedPointUpdate()
|
|
this.model.checkLevelRedPointUpdate()
|
|
} else if( item.base_id == this.model.talent_skill_cost_id ) {
|
|
this.model.setUpdateTalentRedpoint()
|
|
this.model.checkTalentRedPointUpdate()
|
|
}
|
|
if( Utils.getItemConfig( item.base_id ) ) {
|
|
this.model.setUpdateTalentRedpoint()
|
|
this.model.checkTalentRedPointUpdate()
|
|
}
|
|
}
|
|
}
|
|
}.bind( this ) )
|
|
}
|
|
|
|
// 激活神器(圣器) 判断红点
|
|
if( !this.update_drama_hallows_event ) {
|
|
var HallowsEvent = require( "hallows_event" );
|
|
this.update_drama_hallows_event = gcore.GlobalEvent.bind( HallowsEvent.HallowsActivityEvent, function() {
|
|
this.model.checkUnlockHallowsRedPoint();
|
|
}.bind( this ) )
|
|
}
|
|
},
|
|
|
|
// 注册协议接受事件
|
|
registerProtocals: function() {
|
|
let self = this;
|
|
// this.RegisterProtocal(1110, this.on1110);
|
|
this.RegisterProtocal( 11000, this.handle11000.bind( this ) ); //请求所有伙伴
|
|
this.RegisterProtocal( 11001, this.handle11001.bind( this ) ); //伙伴增加
|
|
this.RegisterProtocal( 11002, this.handle11002.bind( this ) ); //伙伴属性变更通知(单个伙伴属性)
|
|
this.RegisterProtocal( 11007, this.handle11007.bind( this ) ); //伙伴属性变更通知(list列表伙伴属性)
|
|
|
|
//升级
|
|
this.RegisterProtocal( 11003, this.handle11003.bind( this ) ); //伙伴升级
|
|
this.RegisterProtocal( 11004, this.handle11004.bind( this ) ); //伙伴进阶
|
|
this.RegisterProtocal( 11005, this.handle11005.bind( this ) ); //伙伴升星
|
|
this.RegisterProtocal( 11006, this.handle11006.bind( this ) ); //删除伙伴推送
|
|
|
|
this.RegisterProtocal( 11009, this.handle11009.bind( this ) ); //购买英雄数量上限
|
|
this.RegisterProtocal( 11016, this.handle11016.bind( this ) ); //伙伴下一阶属性
|
|
this.RegisterProtocal( 11017, this.handle11017.bind( this ) ); //推送伙伴最新数量
|
|
|
|
//装备相关
|
|
this.RegisterProtocal( 11010, this.handle11010.bind( this ) ); //穿戴装备
|
|
this.RegisterProtocal( 11011, this.handle11011.bind( this ) ); //卸下装备
|
|
this.RegisterProtocal( 11012, this.handle11012.bind( this ) ); //推送装备改变
|
|
|
|
this.RegisterProtocal( 11013, this.handle11013.bind(this)); //升级 至100
|
|
// this.RegisterProtocal(11014, this.handle11014.bind(this)); //一键精炼
|
|
|
|
this.RegisterProtocal( 11015, this.handle11015.bind( this ) ); //英雄锁定
|
|
|
|
//请求阵法
|
|
// this.RegisterProtocal(11200, this.handle11200.bind(this)); //请求自身阵法
|
|
// this.RegisterProtocal(11201, this.handle11201.bind(this)); //更换自身阵法
|
|
// this.RegisterProtocal(11202, this.handle11202.bind(this)); //伙伴上阵/下阵/交换
|
|
// this.RegisterProtocal(11203, this.handle11203.bind(this)); //阵法数据改变推送
|
|
// this.RegisterProtocal(11204, this.handle11204.bind(this)); //阵法升级/激活
|
|
this.RegisterProtocal( 11211, this.handle11211.bind( this ) ); //请求队伍
|
|
this.RegisterProtocal( 11212, this.handle11212.bind( this ) ); //请求保存队伍协议
|
|
this.RegisterProtocal( 11213, this.handle11213.bind( this ) ); //请求多个队伍
|
|
|
|
// //符文相关
|
|
this.RegisterProtocal( 11030, this.handle11030.bind( this ) ); //符文穿戴
|
|
this.RegisterProtocal( 11031, this.handle11031.bind( this ) ); //推送符文改变
|
|
this.RegisterProtocal( 11032, this.handle11032.bind( this ) ); //符文升星
|
|
this.RegisterProtocal( 11033, this.handle11033.bind( this ) ); //符文重置
|
|
this.RegisterProtocal( 11034, this.handle11034.bind( this ) ); //符文重铸保存
|
|
this.RegisterProtocal( 11035, this.handle11035.bind( this ) ); //符文碎片合成
|
|
this.RegisterProtocal( 11036, this.handle11036.bind( this ) ); //符文合成
|
|
this.RegisterProtocal( 11037, this.handle11037.bind( this ) ); //符文祝福值
|
|
this.RegisterProtocal( 11038, this.handle11038.bind( this ) ); //领取符文祝福值
|
|
|
|
this.RegisterProtocal( 11040, this.handle11040.bind( this ) ); //英雄图鉴信息
|
|
this.RegisterProtocal( 11060, this.handle11060.bind( this ) ); //英雄图鉴信息
|
|
|
|
this.RegisterProtocal( 27605, this.handle27605.bind( this ) ); //英雄阵容推荐信息
|
|
this.RegisterProtocal( 27606, this.handle27606.bind( this ) ); //领取英雄阵容推荐奖励信息
|
|
|
|
this.RegisterProtocal( 11075, this.handle11075.bind( this ) ); //请求英雄遣散 分解材料
|
|
this.RegisterProtocal( 11076, this.handle11076.bind( this ) ); //英雄遣散 分解
|
|
|
|
//重生(針對高星的)
|
|
this.RegisterProtocal( 11065, this.handle11065.bind( this ) ) //夥伴回退"
|
|
this.RegisterProtocal( 11066, this.handle11066.bind( this ) ) //英雄回退返回材料"
|
|
|
|
//重生(針對 100級一下的英雄)
|
|
this.RegisterProtocal( 11067, this.handle11067.bind( this ) ) //英雄重生信息
|
|
this.RegisterProtocal( 11068, this.handle11068.bind( this ) ) //英雄重生
|
|
|
|
|
|
// --天赋相关
|
|
this.RegisterProtocal( 11096, this.handle11096.bind( this ) ) //学习天赋技能
|
|
this.RegisterProtocal( 11097, this.handle11097.bind( this ) ) //天赋技能升级
|
|
this.RegisterProtocal( 11098, this.handle11098.bind( this ) ) //天赋遗忘
|
|
this.RegisterProtocal( 11099, this.handle11099.bind( this ) ) //获取英雄天赋信息
|
|
|
|
this.RegisterProtocal( 11063, this.handle11063.bind( this ) ) //--英雄详细信息
|
|
|
|
this.RegisterProtocal( 11019, this.handle11019.bind( this ) ) //--皮肤
|
|
this.RegisterProtocal( 11020, this.handle11020.bind( this ) ) //--
|
|
|
|
this.RegisterProtocal( 16686, this.handle16686.bind( this ) ) //10置換協議
|
|
|
|
this.RegisterProtocal( 26425, this.handle26425.bind( this ) ) // 水晶信息
|
|
this.RegisterProtocal( 26426, this.handle26426.bind( this ) ) // 放入共鸣英雄
|
|
this.RegisterProtocal( 26427, this.handle26427.bind( this ) ) // 卸下共鸣英雄
|
|
this.RegisterProtocal( 26428, this.handle26428.bind( this ) ) // 刷新槽位冷却时间
|
|
this.RegisterProtocal( 26429, this.handle26429.bind( this ) ) // 解锁共鸣槽位
|
|
this.RegisterProtocal( 11025, this.handle11025.bind( this ) ) // 解锁共鸣槽位
|
|
|
|
//神裝相關
|
|
self.RegisterProtocal( 11090, this.handle11090.bind( this ) ) //神裝保存重置技能"
|
|
self.RegisterProtocal( 11091, this.handle11091.bind( this ) ) //推送神裝改變"
|
|
self.RegisterProtocal( 11092, this.handle11092.bind( this ) ) //請求神裝穿戴信息""
|
|
self.RegisterProtocal( 11093, this.handle11093.bind( this ) ) //神裝穿戴/卸下"
|
|
self.RegisterProtocal( 11094, this.handle11094.bind( this ) ) //神裝重置"
|
|
|
|
self.RegisterProtocal( 11087, this.handle11087.bind( this ) ) //請求英雄升星的材料
|
|
self.RegisterProtocal( 11088, this.handle11088.bind( this ) ) //神裝獲取出售材料
|
|
self.RegisterProtocal( 11089, this.handle11089.bind( this ) ) //神裝出售
|
|
self.RegisterProtocal( 11086, this.handle11086.bind( this ) ) //神裝預覽屬性返回
|
|
|
|
self.RegisterProtocal( 25220, this.handle25220.bind( this ) ) //當前神裝套裝狀態
|
|
self.RegisterProtocal( 25221, this.handle25221.bind( this ) ) //新增神裝套裝
|
|
self.RegisterProtocal( 25223, this.handle25223.bind( this ) ) //購買新的格子
|
|
self.RegisterProtocal( 25224, this.handle25224.bind( this ) ) //應用方案到英雄
|
|
},
|
|
|
|
// 从服务器初始化数据
|
|
reqBaseFromServer: function( _cb ) {
|
|
|
|
// 配置加载
|
|
let cfgs = [
|
|
"partner_artifact_data", // 行星武器重铸、技能模组
|
|
"partner_data", // 英雄
|
|
"partner_eqm_data", // 义肢、合成、评分
|
|
"partner_skill_data", // 技能模组
|
|
"partner_skin_data", // 皮肤
|
|
"partner_holy_eqm_data", // 神装(战斗义肢)数据
|
|
"role_data", // 英雄等级经验、功能开启等级提示
|
|
"skill_data", // 技能
|
|
"skill_data1", //技能
|
|
"skill_data2", //技能
|
|
"skill_data3", //技能
|
|
"skill_data4", //技能
|
|
"skill_data5", //技能
|
|
"skill_data6", //技能
|
|
"holiday_convert_data", // 置换
|
|
"halidom_data", // 阵营核心
|
|
"resonate_data", // 等级同步
|
|
"avatar_data", // 头像框
|
|
"recommend_data", // 推荐阵容
|
|
"weapon_data", // 專屬武器
|
|
];
|
|
this.loadConfigs( cfgs, ( _ret, _data ) => {
|
|
this.sender11025();
|
|
this.sender11000();
|
|
this.sender11040();
|
|
this.sender11037( _cb );
|
|
this.SendProtocal( 11213, { type_list: [ { type: PartnerConst.Fun_Form.Drama }, { type: PartnerConst.Fun_Form.Arena } ] } );
|
|
this.sender27605();
|
|
|
|
} );
|
|
|
|
},
|
|
|
|
sender11063( partner_id, _cb ) {
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
this.SendProtocal( 11063, protocal, _cb )
|
|
},
|
|
handle11063( data ) {
|
|
this.model.updateHeroVoDetailedInfo( data )
|
|
},
|
|
sender11000: function() {
|
|
var protocal = {}
|
|
this.SendProtocal( 11000, protocal );
|
|
},
|
|
|
|
handle11000: function( data ) { //请求所有伙伴
|
|
this.model.setHeroMaxCount( data.num );
|
|
this.model.setHeroBuyNum( data.buy_num );
|
|
this.model.updateHeroList( data.partners );
|
|
|
|
// var calculate = HeroCalculate.getInstance();
|
|
// RedMgr.getInstance().addCalHandler( calculate.checkAllStarFuseRedpoint.bind( calculate ), RedIds.RefuseHero );
|
|
|
|
this.sender11020();
|
|
},
|
|
|
|
handle11001: function( data ) { //伙伴增加
|
|
this.model.updateHeroList( data.partners, true )
|
|
|
|
//消除熔炼祭坛的红点 里面会重新计算红点
|
|
HeroCalculate.getInstance().clearAllStarFuseRedpointRecord();
|
|
|
|
this.model.is_upgradestar_redpoint_bag_update = true;
|
|
this.model.checkUpgradeStarRedPointUpdate();
|
|
},
|
|
|
|
handle11002: function( data ) { //单个伙伴属性变更通知
|
|
this.model.updateSingle( data );
|
|
},
|
|
|
|
handle11007: function( data ) { //list伙伴属性变更通知(
|
|
this.model.updateHeroList( data.ref_partners, null, true );
|
|
},
|
|
|
|
sender11003: function( partner_id, _cb ) { // 伙伴升级
|
|
var protocal = {};
|
|
protocal.partner_id = partner_id;
|
|
this.SendProtocal( 11003, protocal, _cb );
|
|
},
|
|
|
|
handle11003: function( data ) { //伙伴升级
|
|
|
|
if( nx.dt.strNEmpty( data.msg ) ){
|
|
nx.tbox( data.msg );
|
|
}
|
|
|
|
if( data && data.result === 1 ) {
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Level_Up_Success_Event, data );
|
|
}
|
|
},
|
|
|
|
sender11013: function( partner_id, _cb ) { // 伙伴升级特殊
|
|
var protocal = {};
|
|
protocal.partner_id = partner_id;
|
|
this.SendProtocal( 11013, protocal, _cb );
|
|
},
|
|
|
|
handle11013 : function( data ){
|
|
|
|
},
|
|
|
|
sender11004: function( partner_id ) {
|
|
var protocal = {};
|
|
protocal.partner_id = partner_id;
|
|
this.SendProtocal( 11004, protocal );
|
|
},
|
|
|
|
handle11004: function( data ) { //伙伴进阶结果
|
|
if( data && data.result == 1 ) {
|
|
// 显示进阶窗口
|
|
}
|
|
},
|
|
|
|
sender11005: function( partner_id, hero_list, random_list, item_expend ) {
|
|
var protocal = {}
|
|
protocal.partner_id = partner_id;
|
|
protocal.expend1 = hero_list;
|
|
protocal.expend2 = random_list;
|
|
protocal.item_expend = item_expend;
|
|
this.SendProtocal( 11005, protocal );
|
|
},
|
|
|
|
handle11005: function( data ) { //伙伴升星
|
|
|
|
if( nx.dt.strNEmpty( data.msg ) ){
|
|
nx.tbox( data.msg );
|
|
}
|
|
|
|
if( data && data.result === 1 ) {
|
|
gcore.GlobalEvent.fire( HeroEvent.Upgrade_Star_Success_Event );
|
|
} else {
|
|
this.model.setUpgradeStarUpdateRecord( true );
|
|
}
|
|
},
|
|
|
|
handle11006: function( data ) { //删除伙伴推送
|
|
this.model.delHeroDataList( data.expend2 );
|
|
},
|
|
|
|
sender11009: function() {
|
|
this.SendProtocal( 11009, {} );
|
|
},
|
|
|
|
handle11009: function( data ) { //购买英雄数量上限
|
|
|
|
if( nx.dt.strNEmpty( data.msg ) ) {
|
|
nx.tbox( data.msg );
|
|
}
|
|
|
|
if( data.result ) {
|
|
this.model.setHeroMaxCount( data.num );
|
|
this.model.setHeroBuyNum( data.buy_num );
|
|
gcore.GlobalEvent.fire( HeroEvent.Buy_Hero_Max_Count_Event );
|
|
}
|
|
},
|
|
|
|
sender11016: function( partner_id ) {
|
|
var protocal = {};
|
|
protocal.partner_id = partner_id;
|
|
this.SendProtocal( 11016, protocal );
|
|
},
|
|
|
|
handle11016: function( data ) { //伙伴下一阶属性
|
|
gcore.GlobalEvent.fire( HeroEvent.Next_Break_Info_Event, data );
|
|
},
|
|
|
|
handle11017: function( data ) { //推送伙伴最新数量
|
|
},
|
|
|
|
// 0 表示一键穿戴
|
|
sender11010: function( partner_id, item_id ) { //穿戴装备
|
|
this.model.setEquipUpdateRecord( false );
|
|
var protocal = {}
|
|
protocal.partner_id = partner_id
|
|
protocal.item_id = item_id
|
|
this.SendProtocal( 11010, protocal );
|
|
},
|
|
|
|
handle11010: function( data ) {
|
|
// nx.tbox( data.msg );
|
|
if( !data.result )
|
|
this.model.setEquipUpdateRecord( true );
|
|
},
|
|
|
|
sender11011: function( partner_id, pos_id ) {
|
|
this.model.setEquipUpdateRecord( false );
|
|
var protocal = {}
|
|
protocal.partner_id = partner_id
|
|
//此值改成装备唯一id
|
|
protocal.pos_id = pos_id
|
|
this.SendProtocal( 11011, protocal );
|
|
},
|
|
|
|
handle11011: function( data ) { //卸下装备
|
|
nx.tbox( data.msg )
|
|
if( !data.result )
|
|
this.model.setEquipUpdateRecord( true );
|
|
},
|
|
|
|
handle11012: function( data ) { //推送装备改变
|
|
|
|
if( !nx.dt.strEmpty( data.msg ) ){
|
|
nx.tbox( data.msg );
|
|
}
|
|
|
|
if( data ) {
|
|
this.model.updateHeroEquipList( data );
|
|
data = this.model.getHeroById( data.partner_id )
|
|
gcore.GlobalEvent.fire( HeroEvent.Equip_Update_Event, data );
|
|
|
|
this.model.is_equip_redpoint_hero_update = true;
|
|
this.model.checkEquipRedPointUpdate()
|
|
}
|
|
},
|
|
|
|
sender11015: function( partner_id, is_lock ) {
|
|
var protocal = {}
|
|
protocal.partner_id = partner_id;
|
|
protocal.type = is_lock;
|
|
this.SendProtocal( 11015, protocal )
|
|
},
|
|
|
|
handle11015: function( data ) { //英雄锁定
|
|
|
|
if( !nx.dt.strEmpty( data.msg ) ){
|
|
nx.tbox( data.msg );
|
|
}
|
|
|
|
if( data.result == 1 ) {
|
|
this.model.setLockByPartnerid( data.partner_id, data.type )
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Lock_Event )
|
|
}
|
|
},
|
|
|
|
// 请求伙伴所有基本数据 在 function SysController:requestLoginProtocals( ) 统一请求
|
|
sender11025( _cb ) {
|
|
this.SendProtocal( 11025, {}, _cb );
|
|
},
|
|
|
|
handle11025: function( data ) {
|
|
// -- dump(data, "handle11025 协议===================>")
|
|
this.model.setHeroMaxCount( data.num )
|
|
this.model.setHeroBuyNum( data.buy_num )
|
|
this.model.updateHeroList( data.partners )
|
|
|
|
// -- 计算一下圣物红点
|
|
// -- HalidomController:getInstance():getModel():calculateHalidomRedStatus()
|
|
|
|
// --英雄信息有了 可以初始化精英赛布阵信息了
|
|
// ElitematchController:getInstance():loginSendProtoInfo()
|
|
|
|
// --申请11026协议去
|
|
// this.model.batchSendHeroInfo()
|
|
|
|
// --拉取神装套装信息
|
|
this.sender25220()
|
|
// --申请所拥有的皮肤信息
|
|
this.sender11020()
|
|
// --共鸣信息
|
|
this.sender26400()
|
|
// this.sender26410()
|
|
// --原力水晶
|
|
this.sender26425()
|
|
|
|
// // --申请所有英雄的神装信息
|
|
this.model.sendAllHeroHolyEquipInfo()
|
|
|
|
gcore.GlobalEvent.fire( HeroEvent.All_Hero_Base_Info_Event )
|
|
},
|
|
|
|
//-- 請求英雄分解材料
|
|
sender11087( partner_list ) {
|
|
let protocal = {}
|
|
protocal.list = partner_list
|
|
this.SendProtocal( 11087, protocal )
|
|
},
|
|
|
|
handle11087( data ) {
|
|
if( data.code == 1 ) {
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Reset_Star_Event, data )
|
|
}
|
|
},
|
|
|
|
sender11211: function( type ) { // 请求单个布阵信息
|
|
var protocal = {}
|
|
protocal.type = type
|
|
this.SendProtocal( 11211, protocal )
|
|
},
|
|
|
|
handle11211: function( data ) { // 请求单个布阵信息结果
|
|
if( !data || typeof data.type != "number" ) return
|
|
if( data && ( data.type === PartnerConst.Fun_Form.Drama || data.type === PartnerConst.Fun_Form.Arena ) )
|
|
this.model.setFormList( data );
|
|
gcore.GlobalEvent.fire( HeroEvent.Update_Fun_Form, data );
|
|
},
|
|
|
|
sender11212: function( type, formation_type, pos_info, hallows_id ) {
|
|
var protocal = {}
|
|
protocal.type = type
|
|
protocal.formation_type = formation_type
|
|
protocal.pos_info = pos_info
|
|
protocal.hallows_id = hallows_id
|
|
this.SendProtocal( 11212, protocal )
|
|
},
|
|
|
|
handle11212: function( data ) { //请求保存队伍协议
|
|
if( data.code ) {
|
|
if( data.type === PartnerConst.Fun_Form.Drama ) {
|
|
var type_list = [];
|
|
var drma_info = {};
|
|
drma_info[ "type" ] = PartnerConst.Fun_Form.Drama;
|
|
type_list.push( drma_info );
|
|
var arena_info = {};
|
|
arena_info[ "type" ] = PartnerConst.Fun_Form.Arena;
|
|
type_list.push( arena_info );
|
|
this.sender11213( type_list );
|
|
} else if( data.type === PartnerConst.Fun_Form.Arena ) {
|
|
this.sender11211( data.type );
|
|
} else if( data.type === PartnerConst.Fun_Form.LimitExercise ) {
|
|
var LimitExerciseController = require( "limitexercise_controller" )
|
|
LimitExerciseController.getInstance().checkJoinFight()
|
|
}
|
|
gcore.GlobalEvent.fire( HeroEvent.Update_Save_Form, data );
|
|
} else {
|
|
nx.tbox( data.msg )
|
|
}
|
|
},
|
|
|
|
sender11213: function( type_list ) { // 请求多个布阵
|
|
var protocal = {}
|
|
protocal.type_list = type_list;
|
|
this.SendProtocal( 11213, protocal );
|
|
},
|
|
|
|
handle11213: function( data ) { //请求多个布阵结果
|
|
if( !data || !data.info ) return;
|
|
for( var form_i in data.info ) {
|
|
var form_data = data.info[ form_i ];
|
|
if( form_data && ( form_data.type === PartnerConst.Fun_Form.Drama ||
|
|
form_data.type === PartnerConst.Fun_Form.Arena ) )
|
|
this.model.setFormList( form_data );
|
|
}
|
|
},
|
|
|
|
//符文-----------------
|
|
|
|
//符文穿戴/卸下
|
|
sender11030: function( partner_id, pos_id, artifact_id, type ) {
|
|
this.model.setEquipUpdateRecord( false )
|
|
var protocal = {}
|
|
protocal.partner_id = partner_id
|
|
protocal.pos_id = pos_id
|
|
protocal.artifact_id = artifact_id
|
|
protocal.type = type
|
|
this.SendProtocal( 11030, protocal )
|
|
},
|
|
|
|
handle11030: function( data ) { //符文穿戴
|
|
nx.tbox( data.msg );
|
|
if( data.result == 0 ) {
|
|
this.model.setEquipUpdateRecord( true )
|
|
}
|
|
},
|
|
|
|
//推送符文改变
|
|
handle11031: function( data ) {
|
|
nx.tbox( data.msg || "" );
|
|
this.model.updatePartnerArtifactList( data )
|
|
},
|
|
|
|
//符文升星
|
|
sender11032: function( partner_id, artifact_id, expends ) {
|
|
var protocal = {};
|
|
protocal.partner_id = partner_id;
|
|
protocal.artifact_id = artifact_id;
|
|
protocal.expends = expends;
|
|
this.SendProtocal( 11032, protocal )
|
|
},
|
|
|
|
handle11032: function( data ) { //符文升星
|
|
nx.tbox( data.msg );
|
|
if( data.result == 1 ) {
|
|
gcore.GlobalEvent.fire( HeroEvent.Artifact_UpStar_Event, data )
|
|
}
|
|
},
|
|
|
|
//符文重置
|
|
sender11033: function( partner_id, artifact_id, skills, luck_item ) {
|
|
var protocal = {};
|
|
protocal.partner_id = partner_id;
|
|
protocal.artifact_id = artifact_id;
|
|
protocal.skills = skills;
|
|
protocal.luck_item = luck_item;
|
|
this.SendProtocal( 11033, protocal )
|
|
},
|
|
|
|
handle11033: function( data ) { //符文重置
|
|
nx.tbox( data.msg );
|
|
if( data.result == 1 ) {
|
|
gcore.GlobalEvent.fire( HeroEvent.Artifact_Recast_Event )
|
|
}
|
|
},
|
|
|
|
//符文重铸保存
|
|
sender11034: function( partner_id, artifact_id, type ) {
|
|
var protocal = {};
|
|
protocal.partner_id = partner_id;
|
|
protocal.artifact_id = artifact_id;
|
|
protocal.type = type;
|
|
this.SendProtocal( 11034, protocal );
|
|
},
|
|
|
|
|
|
handle11034: function( data ) { //符文重铸保存
|
|
nx.tbox( data.msg )
|
|
if( data.result == 1 ) {
|
|
gcore.GlobalEvent.fire( HeroEvent.Artifact_Save_Event )
|
|
}
|
|
},
|
|
|
|
//符文分解
|
|
sender11035: function( artifact_id ) {
|
|
var protocal = {};
|
|
protocal.artifact_id = artifact_id;
|
|
this.SendProtocal( 11035, protocal )
|
|
},
|
|
|
|
handle11035: function( data ) { //符文碎片合成
|
|
nx.tbox( data.msg )
|
|
},
|
|
|
|
//符文合成
|
|
sender11036: function( item_id, expend ) {
|
|
var protocal = {};
|
|
protocal.item_id = item_id;
|
|
protocal.expends = expend;
|
|
this.SendProtocal( 11036, protocal );
|
|
},
|
|
|
|
handle11036: function( data ) { //符文合成
|
|
nx.tbox( data.msg );
|
|
if( data.result == 1 ) {
|
|
gcore.GlobalEvent.fire( HeroEvent.Artifact_Compound_Event, data.flag )
|
|
}
|
|
},
|
|
|
|
//符文祝福值
|
|
sender11037: function( _cb ) {
|
|
this.SendProtocal( 11037, {}, _cb );
|
|
},
|
|
|
|
handle11037: function( data ) { //符文祝福值
|
|
if( data && data.lucky != null ) {
|
|
this.model.setArtifactLucky( data.lucky );
|
|
gcore.GlobalEvent.fire( HeroEvent.Artifact_Lucky_Event )
|
|
}
|
|
},
|
|
|
|
//领取符文祝福值
|
|
sender11038: function() {
|
|
this.SendProtocal( 11038, {} );
|
|
},
|
|
|
|
handle11038: function( data ) { //领取符文祝福值
|
|
nx.tbox( data.msg )
|
|
},
|
|
|
|
// -- 請求符文重鑄次數相關數據
|
|
sender11048() {
|
|
this.SendProtocal( 11048, {} )
|
|
},
|
|
handle11048( data ) {
|
|
if( data && data.artifact_ref_count ) {
|
|
this.model.updateArtifactRecastCount( data.artifact_ref_count )
|
|
// gcore.GlobalEvent.fire(HeroEvent.Artifact_Recast_Count_Event)
|
|
}
|
|
},
|
|
|
|
sender11040: function() {
|
|
var protocal = {}
|
|
this.SendProtocal( 11040, protocal );
|
|
},
|
|
|
|
handle11040: function( data ) { //英雄图鉴信息
|
|
this.model.setHadHeroInfo( data.partners );
|
|
},
|
|
|
|
sender11060: function( channel, partner_id ) {
|
|
var protocal = {};
|
|
protocal.channel = channel;
|
|
protocal.partner_id = partner_id;
|
|
this.SendProtocal( 11060, protocal );
|
|
},
|
|
|
|
handle11060: function( data ) { //英雄图鉴信息
|
|
nx.tbox( data.msg );
|
|
},
|
|
|
|
sender11075: function( hero_list ) { //请求英雄分解材料
|
|
var protocal = {};
|
|
protocal.list = hero_list;
|
|
this.SendProtocal( 11075, protocal );
|
|
},
|
|
|
|
handle11075: function( data ) {
|
|
if( data.code == 1 ) {
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Reset_Look_Event, data.list );
|
|
}
|
|
},
|
|
|
|
sender11076: function( partner_list ) {
|
|
var protocal = {}
|
|
protocal.list = partner_list
|
|
this.SendProtocal( 11076, protocal );
|
|
},
|
|
|
|
handle11076: function( data ) { //英雄遣散
|
|
nx.tbox( data.msg )
|
|
if( data.code ) {
|
|
this.model.delHeroDataList( data.list );
|
|
}
|
|
},
|
|
//-天赋相关开始
|
|
sender11096( partner_id, pos, skill_id ) {
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
protocal.pos = pos
|
|
protocal.skill_id = skill_id
|
|
this.SendProtocal( 11096, protocal )
|
|
},
|
|
|
|
//-- 10置換活動協議
|
|
sender16686(partner_id, partner_bid, expend){
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
protocal.partner_bid = partner_bid
|
|
protocal.expend = expend
|
|
this.SendProtocal(16686, protocal)
|
|
},
|
|
|
|
handle16686( data ){
|
|
if(data.msg){
|
|
nx.tbox(data.msg)
|
|
}else{
|
|
nx.tbox(nx.text.getKey("btn_guild_action_item_btn_type"))
|
|
}
|
|
},
|
|
|
|
handle11096( data ) {
|
|
if( data.result == true ) {
|
|
this.model.updateHeroVoTalent( [ data ], true )
|
|
data = this.model.getHeroById( data.partner_id )
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Learn_Talent_Event, data )
|
|
HeroCalculate.getInstance().clearAllHeroRecordByRedPointType( HeroConst.RedPointType.eRPTalent )
|
|
} else {
|
|
nx.tbox( data.msg )
|
|
}
|
|
},
|
|
|
|
//-- 10置換活動協議
|
|
sender27605: function( _cb ){
|
|
|
|
this.SendProtocal( 27605, {}, _cb );
|
|
},
|
|
|
|
//-- 10置換活動協議
|
|
sender27606: function( _id ){
|
|
|
|
this.SendProtocal( 27606, {
|
|
id: _id
|
|
})
|
|
},
|
|
|
|
handle27605: function( _data ){
|
|
|
|
nx.bridge.vset( "FormCollectReward", _data.ids );
|
|
let cfg = game.configs.recommend_data.data_recommond;
|
|
this.have = false;
|
|
let have = [];
|
|
for (let r in cfg ) {
|
|
let recommend = cfg[r];
|
|
let camp = recommend.camp;
|
|
let count = 0;
|
|
for (let c = 0; c < camp.length; c++) {
|
|
let partner = camp[c];
|
|
if( this.model.getHadHeroStarBybid( partner ) ){
|
|
count++;
|
|
}
|
|
|
|
}
|
|
if( count >= 5 ){
|
|
have.push( count );
|
|
}
|
|
|
|
}
|
|
this.have = ( have.length != 0 && have.length != _data.ids.length );
|
|
nx.mTip.openTip( "form.recommend", ( have.length != 0 && have.length != _data.ids.length ) );
|
|
|
|
},
|
|
|
|
|
|
handle27606: function( _data ){
|
|
|
|
},
|
|
|
|
// 英雄(伙伴)背包界面
|
|
// @ hero_vo 英雄对应数据对象
|
|
openHeroBagWindow: function( status, _fromOther ) {
|
|
if( !status ) {
|
|
nx.bridge.closePanel( "WndPartnerBag" );
|
|
} else {
|
|
nx.bridge.createPanel( "WndPartnerBag", {
|
|
fromOther: _fromOther
|
|
} );
|
|
|
|
}
|
|
},
|
|
|
|
// 英雄(伙伴)改造界面
|
|
openHeroReformWindow: function( status, _params ) {
|
|
if( !status ) {
|
|
|
|
nx.bridge.closePanel( "WndPartnerReform" );
|
|
|
|
} else {
|
|
nx.bridge.createPanel( "WndPartnerReform", _params );
|
|
}
|
|
},
|
|
|
|
// 英雄(伙伴)置换预览界面
|
|
openHeroConvertPreview: function( status, _items, _cb ) {
|
|
|
|
if( !status ) {
|
|
nx.bridge.closePanel( "WndPartnerReformConverPreview");
|
|
} else {
|
|
nx.bridge.createPanel( "WndPartnerReformConverPreview", {
|
|
items: _items,
|
|
cb: _cb,
|
|
} );
|
|
|
|
}
|
|
},
|
|
|
|
//打开英雄图书馆信息
|
|
openHeroLibraryMainWindow: function( status, bid ) {
|
|
if( status == false ) {
|
|
if( this.hero_library_mainWindow != null ) {
|
|
this.hero_library_mainWindow.close()
|
|
this.hero_library_mainWindow = null
|
|
}
|
|
} else {
|
|
if( this.hero_library_mainWindow == null ) {
|
|
var HeroLibraryMainWindow = require( "hero_library_main_window" )
|
|
this.hero_library_mainWindow = new HeroLibraryMainWindow()
|
|
}
|
|
if( !bid ) {
|
|
let lib_pics = nx.selectresbyname( "library_module", "lib" );
|
|
if( lib_pics ) {
|
|
this.hero_library_mainWindow.open( bid )
|
|
} else {
|
|
nx.loadbox( "library_module", true, () => {
|
|
this.hero_library_mainWindow.open( bid )
|
|
}, null, false, null, true );
|
|
}
|
|
} else {
|
|
this.hero_library_mainWindow.open( bid )
|
|
}
|
|
}
|
|
},
|
|
|
|
|
|
//打开英雄图书馆信息
|
|
openHeroLibraryInfoWindow: function( status, bid ) {
|
|
if( status == false ) {
|
|
if( this.hero_library_info != null ) {
|
|
this.hero_library_info.close()
|
|
this.hero_library_info = null
|
|
}
|
|
} else {
|
|
if( this.hero_library_info == null ) {
|
|
var HeroLibraryInfoWindow = require( "hero_library_info_window" )
|
|
this.hero_library_info = new HeroLibraryInfoWindow()
|
|
}
|
|
this.hero_library_info.open( bid )
|
|
}
|
|
},
|
|
|
|
//打开英雄图书馆传记信息
|
|
openHeroLibraryStoryPanel: function( status, partnerOrBid ) {
|
|
nx.error( "使用showTextPanel替代!" );
|
|
},
|
|
|
|
// -- 英雄(伙伴)主信息 界面
|
|
// --@ hero_vo 英雄对应数据对象
|
|
// --@ hero_list 英雄对象列表
|
|
// --@ setting 结构
|
|
// --setting.showType 显示英雄新的页签类型
|
|
// --setting.show_model_type 显示模式 1:英雄模式 2:图鉴模式 定义参考 HeroConst.BagTab.eBagHero
|
|
openHeroMainInfoWindow: function( status, hero_vo, hero_list, setting ) {
|
|
if( status ) {
|
|
|
|
nx.bridge.createPanel( "WndPartnerInfo", {
|
|
hero_vo : hero_vo,
|
|
hero_list: hero_list,
|
|
setting: setting
|
|
} );
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerInfo");
|
|
}
|
|
},
|
|
|
|
// 打开立绘界面
|
|
openHeroLookDrawWindow: function( status, draw_res_id, name, bid, share_type ) {
|
|
if( status ) {
|
|
if( !this.hero_look_draw_window ) {
|
|
this.hero_look_draw_window = Utils.createClass( "hero_look_draw_window" )
|
|
}
|
|
var data = {
|
|
draw_res_id: draw_res_id,
|
|
name: name,
|
|
bid: bid,
|
|
share_type: share_type,
|
|
}
|
|
this.hero_look_draw_window.open( data )
|
|
} else {
|
|
if( this.hero_look_draw_window ) {
|
|
this.hero_look_draw_window.close();
|
|
this.hero_look_draw_window = null;
|
|
}
|
|
}
|
|
},
|
|
|
|
// 打开立绘界面
|
|
openHeroLookDrawWindowTest: function( status, data ) {
|
|
|
|
if( status ) {
|
|
nx.bridge.createPanel( "WndPartnerDrawPopup", data );
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerDrawPopup" );
|
|
}
|
|
},
|
|
|
|
// --打开进阶界面
|
|
openHeroBreakPanel: function( status, hero_vo ) {
|
|
if( status ) {
|
|
|
|
nx.bridge.createPanel( "WndPartnerUpgrade", hero_vo );
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerUpgrade" );
|
|
}
|
|
},
|
|
|
|
// 打开进阶成功界面 old_vo new_vo 都是heroVo对象
|
|
openBreakExhibitionWindow: function( status, old_vo, new_vo ) {
|
|
|
|
if( status ) {
|
|
nx.bridge.createPanel( "WndPartnerUpgradePopup", {
|
|
old_vo : old_vo,
|
|
new_vo : new_vo,
|
|
} );
|
|
|
|
} else {
|
|
|
|
nx.bridge.closePanel( "WndPartnerUpgradePopup");
|
|
if( old_vo && typeof ( old_vo ) == "number" ) {
|
|
let skill_bid = old_vo
|
|
this.openSkillUnlockWindow( true, skill_bid )
|
|
}
|
|
}
|
|
},
|
|
|
|
|
|
// 打开升星成功界面 old_vo new_vo 都是heroVo对象
|
|
openHeroUpgradeStarExhibitionPanel: function( status, old_vo, new_vo ) {
|
|
if( status ) {
|
|
|
|
nx.bridge.createPanel( "WndPartnerUpstarPopup", {
|
|
old_vo : old_vo,
|
|
new_vo : new_vo,
|
|
} );
|
|
|
|
} else if( this.upgrade_star_exhibition_window ) {
|
|
nx.bridge.closePanel( "WndPartnerUpstarPopup");
|
|
}
|
|
},
|
|
|
|
// --打开天赋技能学习面板
|
|
// openSkillUnlockWindow(status, skill_bid)
|
|
|
|
// if status == true then
|
|
// if not this.unlock_window then
|
|
// this.unlock_window = SkillUnlockWindow.New(skill_bid)
|
|
// end
|
|
// if this.unlock_window and this.unlock_window:isOpen() == false then
|
|
// this.unlock_window:open()
|
|
// end
|
|
// else
|
|
// if this.unlock_window then
|
|
// this.unlock_window:close()
|
|
// this.unlock_window = null
|
|
// end
|
|
// end
|
|
// end
|
|
|
|
|
|
|
|
// --打开英雄过滤
|
|
// openFormFilterHeroPanel(status, dic_filter_camp_type, dic_filter_career_type)
|
|
// if status == true then
|
|
// if not this.form_filter_hero_panel then
|
|
// this.form_filter_hero_panel = FormFilterHeroPanel.New()
|
|
// end
|
|
// if this.form_filter_hero_panel and this.form_filter_hero_panel:isOpen() == false then
|
|
// this.form_filter_hero_panel:open(dic_filter_camp_type, dic_filter_career_type)
|
|
// end
|
|
// else
|
|
// if this.form_filter_hero_panel then
|
|
// this.form_filter_hero_panel:close()
|
|
// this.form_filter_hero_panel = null
|
|
// end
|
|
// end
|
|
// end
|
|
|
|
getFormFightView() {
|
|
if( this.form_go_fight_panel ) {
|
|
return true;
|
|
}
|
|
return false;
|
|
},
|
|
|
|
// --打开布阵出战界面
|
|
// --@fun_form_type 布阵队伍类型
|
|
// --@show_type 出战界面显示类型 1 出战 2 保存布阵 3 頁簽佈陣 4 指定佈陣
|
|
openFormGoFightPanel: function( status, fun_form_type, setting, show_type, from_dramahook = false,cbClose ) {
|
|
if( !status ) {
|
|
nx.bridge.closePanel("WndFromView");
|
|
} else {
|
|
var open_pragma = {}
|
|
open_pragma.fun_form_type = fun_form_type;
|
|
open_pragma.setting = setting;
|
|
open_pragma.show_type = show_type;
|
|
open_pragma.fromDramaHook = from_dramahook;
|
|
open_pragma.cbClose = cbClose;
|
|
nx.bridge.createPanel("WndFromView",open_pragma);
|
|
}
|
|
},
|
|
|
|
// 打开布阵 改成和 布阵出战界面 合二为一
|
|
openFormMainWindow: function( status, fun_form_type, params ) {
|
|
if( params ) {
|
|
this.openFormGoFightPanel( status, fun_form_type, params, HeroConst.FormShowType.eFormSave )
|
|
} else {
|
|
this.openFormGoFightPanel( status, fun_form_type, {}, HeroConst.FormShowType.eFormSave )
|
|
}
|
|
},
|
|
|
|
// 打开选择阵法界面
|
|
// @formation_type 阵法类型 也是配置表的id
|
|
openFormationSelectPanel: function( status, formation_type, callback ) {
|
|
if( status ) {
|
|
var open_pragma = {};
|
|
open_pragma.formation_type = formation_type;
|
|
open_pragma.callback = callback;
|
|
nx.bridge.createPanel("WndFromSelect",open_pragma);
|
|
} else {
|
|
nx.bridge.closePanel("WndFromSelect");
|
|
}
|
|
},
|
|
|
|
// 打开选择神器界面
|
|
// @hallows_id 神器id
|
|
openFormHallowsSelectPanel: function( status, hallows_id, callback ) {
|
|
if(status){
|
|
nx.bridge.createPanel( "WndHallowSelect", {
|
|
hallows_id: hallows_id,
|
|
callback: callback
|
|
} );
|
|
}else{
|
|
nx.bridge.closePanel("WndHallowSelect");
|
|
}
|
|
},
|
|
|
|
// 打开英雄升星界面 4升5 5升6 融合祭坛
|
|
openHeroUpgradeStarFuseWindow: function( status, hero_vo ) {
|
|
if( status ) {
|
|
if( !this.upgrade_star_fuse_window || !this.upgrade_star_fuse_window.root_wnd ) {
|
|
var HeroUpgradeStarFuseWindow = require( "hero_upgrade_star_fuse_window" );
|
|
this.upgrade_star_fuse_window = new HeroUpgradeStarFuseWindow( this );
|
|
}
|
|
this.upgrade_star_fuse_window.open( hero_vo );
|
|
} else {
|
|
if( this.upgrade_star_fuse_window ) {
|
|
this.upgrade_star_fuse_window.close();
|
|
this.upgrade_star_fuse_window = null;
|
|
}
|
|
}
|
|
},
|
|
|
|
/**
|
|
* 选伙伴
|
|
* @param {*} _open
|
|
* @param {*} _args : {
|
|
* partners: 列表,
|
|
* count: 选择上限,
|
|
* selects: 已选择,
|
|
* fixed: 是否固定选择上限数(默认false)
|
|
* flag: 特殊标记 }
|
|
* @param {*} _cb : 返回
|
|
*/
|
|
openPartnerSelector: function( _open, _args, _cb ) {
|
|
|
|
if( _open ) {
|
|
|
|
nx.bridge.createPanel( "WndPartnerSelectPanel", {
|
|
params: _args,
|
|
cb: _cb,
|
|
} )
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerSelectPanel");
|
|
}
|
|
},
|
|
|
|
// @select_data 是模拟hero_vo的数据
|
|
// @dic_other_selected 已经其他被选择的数据 [id] = hero_vo模式
|
|
// @ form_type --来源位置 1: 表示融合祭坛 2: 表示升星界面的
|
|
// @ is_master 是否是主卡(融合祭坛专用)
|
|
openHeroUpgradeStarSelectPanel: function( status, select_data, dic_other_selected, form_type, is_master, select_cb, cur_hero_vo ) {
|
|
if( status ) {
|
|
if( !this.upgrade_star_select_panel ) {
|
|
var HeroUpgradeStarSelectPanel = require( "hero_upgrade_star_select_window" );
|
|
this.upgrade_star_select_panel = new HeroUpgradeStarSelectPanel( this );
|
|
}
|
|
var open_pragma = {};
|
|
open_pragma.select_data = select_data;
|
|
open_pragma.dic_other_selected = dic_other_selected;
|
|
open_pragma.form_type = form_type;
|
|
open_pragma.select_cb = select_cb;
|
|
open_pragma.cur_hero_vo = cur_hero_vo;
|
|
open_pragma.is_master = is_master;
|
|
this.upgrade_star_select_panel.open( open_pragma );
|
|
// if this.upgrade_star_select_panel and this.upgrade_star_select_panel:isOpen() == false then
|
|
} else {
|
|
if( this.upgrade_star_select_panel ) {
|
|
this.upgrade_star_select_panel.close();
|
|
this.upgrade_star_select_panel = null;
|
|
}
|
|
}
|
|
},
|
|
|
|
// --@select_data 是模擬hero_vo的數據
|
|
// --@dic_other_selected 已經其他被選擇的數據 [id] = hero_vo模式
|
|
// --@ form_type --來源位置 1: 表示融合祭壇 2: 表示升星界面的 3:聖物
|
|
// --@ setting.is_master 是否是主卡(融合祭壇專用)
|
|
openHeroUpgradeStarSelectPanel2( status, select_data, dic_other_selected, form_type, setting, select_cb ) {
|
|
let self = this;
|
|
if( status ) {
|
|
if( !self.upgrade_star_select_panel2 ) {
|
|
var HeroUpgradeStarSelectPanel = require( "hero_upgrade_star_select_panel" )
|
|
self.upgrade_star_select_panel2 = new HeroUpgradeStarSelectPanel()
|
|
}
|
|
var open_pragma = {};
|
|
open_pragma.select_data = select_data;
|
|
open_pragma.dic_other_selected = dic_other_selected;
|
|
open_pragma.form_type = form_type;
|
|
open_pragma.setting = setting;
|
|
open_pragma.select_cb = select_cb;
|
|
self.upgrade_star_select_panel2.open( open_pragma )
|
|
} else {
|
|
if( self.upgrade_star_select_panel2 ) {
|
|
self.upgrade_star_select_panel2.close()
|
|
self.upgrade_star_select_panel2 = null
|
|
}
|
|
}
|
|
},
|
|
|
|
// 打开英雄祭坛界面
|
|
openHeroResetWindow: function( status, data ) {
|
|
if( status ) {
|
|
if( !this.hero_reset_window ) {
|
|
var HeroResetWindow = require( "hero_reset_window" );
|
|
this.hero_reset_window = new HeroResetWindow( this );
|
|
}
|
|
if( this.hero_reset_window )
|
|
this.hero_reset_window.open( data );
|
|
} else {
|
|
if( this.hero_reset_window ) {
|
|
this.hero_reset_window.close()
|
|
this.hero_reset_window = null;
|
|
}
|
|
}
|
|
},
|
|
|
|
openHeroSacrificePanel: function( status, data ) {
|
|
if( status ) {
|
|
if( !this.hero_sacrifice_panel ) {
|
|
var HeroSacrificePanel = require( "hero_sacrifice_panel" );
|
|
this.hero_sacrifice_panel = new HeroSacrificePanel( this );
|
|
}
|
|
if( this.hero_sacrifice_panel )
|
|
this.hero_sacrifice_panel.open( data );
|
|
} else {
|
|
if( this.hero_sacrifice_panel ) {
|
|
this.hero_sacrifice_panel.close()
|
|
this.hero_sacrifice_panel = null;
|
|
}
|
|
}
|
|
},
|
|
|
|
openHeroResetReturnPanel: function( bool, item_list ) {
|
|
if( bool ) {
|
|
if( !this.hero_reset_return_panel ) {
|
|
var HeroResetReturnPanel = require( "hero_rest_return_window" );
|
|
this.hero_reset_return_panel = new HeroResetReturnPanel( this );
|
|
}
|
|
var open_pragma = {};
|
|
open_pragma.item_list = item_list;
|
|
this.hero_reset_return_panel.open( open_pragma );
|
|
} else {
|
|
if( this.hero_reset_return_panel ) {
|
|
this.hero_reset_return_panel.close()
|
|
this.hero_reset_return_panel = null;
|
|
}
|
|
}
|
|
},
|
|
|
|
openHeroResetOfferPanel: function( bool, item_list, is_show_tips, callback, reset_type, dec ) {
|
|
if( bool ) {
|
|
if( !this.hero_reset_offer_panel ) {
|
|
var HeroResetOfferPanel = require( "hero_reset_offer_window" );
|
|
this.hero_reset_offer_panel = new HeroResetOfferPanel( this );
|
|
}
|
|
var open_pragma = {};
|
|
open_pragma.item_list = item_list;
|
|
open_pragma.callback = callback;
|
|
open_pragma.is_show_tips = is_show_tips;
|
|
open_pragma.reset_type = reset_type;
|
|
open_pragma.dec = dec;
|
|
this.hero_reset_offer_panel.open( open_pragma );
|
|
} else {
|
|
if( this.hero_reset_offer_panel ) {
|
|
this.hero_reset_offer_panel.close()
|
|
this.hero_reset_offer_panel = null;
|
|
}
|
|
}
|
|
},
|
|
|
|
// 打开当前装备操作面板
|
|
openEquipChangePanel: function( _status, _item, _cb ) {
|
|
|
|
if( _status ) {
|
|
|
|
nx.bridge.createPanel( "WndPartnerEquipChangePanel", {
|
|
data: _item,
|
|
cb: _cb
|
|
} );
|
|
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerEquipChangePanel" );
|
|
}
|
|
},
|
|
|
|
// --打开装备穿戴界面
|
|
openEquipPanel: function( _status, _etype, _cb ) {
|
|
|
|
if( _status ) {
|
|
|
|
nx.bridge.createPanel( "WndPartnerEquipSelectPanel", {
|
|
etype: _etype,
|
|
cb: _cb,
|
|
} );
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerEquipSelectPanel" );
|
|
}
|
|
},
|
|
|
|
// 打开当前战斗义肢操作面板
|
|
openHolyChangePanel: function( _status, _etype, _partner, _holyLst, _cb, _cboff, _planid ) {
|
|
|
|
if( _status ) {
|
|
nx.bridge.createPanel( "WndPartnerHolySelect", {
|
|
etype: _etype,
|
|
partner: _partner,
|
|
holyLst: _holyLst,
|
|
cb: _cb,
|
|
cboff: _cboff,
|
|
planid: _planid
|
|
} );
|
|
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerHolySelect" );
|
|
}
|
|
},
|
|
|
|
|
|
// desc:打开装备tips
|
|
// time:2018-05-24 05:50:42
|
|
// @bool:打开与关闭
|
|
// @data:装备数据
|
|
// @open_type:装备状态,0.其他状态,1: 背包中 3:伙伴身上 具体查看 PartnerConst.EqmTips
|
|
// @partner_id:穿戴在伙伴身上就有伙伴id,其他可不填或填0
|
|
// @return
|
|
openEquipTips: function( status, data, open_type, partner, holy_data ) {
|
|
// if (status) {
|
|
// var TipsController = require("tips_controller");
|
|
// TipsController.getInstance().showEquipTips(data, open_type, partner);
|
|
// }
|
|
if( status ) {
|
|
open_type = open_type || PartnerConst.EqmTips.normal;
|
|
var TipsController = require( "tips_controller" );
|
|
TipsController.getInstance().showEquipTips( data, open_type, partner, holy_data );
|
|
|
|
} else {
|
|
if( this.equip_tips ) {
|
|
this.equip_tips.close();
|
|
this.equip_tips = null;
|
|
}
|
|
}
|
|
},
|
|
|
|
// ----------------------------------------神器相关------------------------------
|
|
// 打开符文重铸界面
|
|
openArtifactRecastWindow: function( status, data, partner_id ) {
|
|
if( status == true ) {
|
|
if( !this.artifact_recast_win ) {
|
|
this.artifact_recast_win = Utils.createClass( "artifact_recast_window" )
|
|
}
|
|
this.artifact_recast_win.open( { data: data, partner_id: partner_id } )
|
|
} else {
|
|
if( this.artifact_recast_win ) {
|
|
this.artifact_recast_win.close()
|
|
this.artifact_recast_win = null
|
|
}
|
|
}
|
|
},
|
|
|
|
//打开神器列表选择界面
|
|
// openArtifactListWindow(bool,artifact_type,partner_id,select_vo)
|
|
// if bool == true then
|
|
// if not this.artifact_list_panel then
|
|
// this.artifact_list_panel = ArtifactListWindow.New()
|
|
// end
|
|
// artifact_type = artifact_type or 0
|
|
// partner_id = partner_id or 0
|
|
// if this.artifact_list_panel and this.artifact_list_panel:isOpen() == false then
|
|
// this.artifact_list_panel:open(artifact_type,partner_id,select_vo)
|
|
// end
|
|
// else
|
|
// if this.artifact_list_panel then
|
|
// this.artifact_list_panel:close()
|
|
// this.artifact_list_panel = null
|
|
// end
|
|
// end
|
|
// end
|
|
openArtifactListWindow: function( bool, artifact_type, partner_id, select_vo ) {
|
|
if( bool == true ) {
|
|
if( !this.artifact_list_window ) {
|
|
this.artifact_list_window = Utils.createClass( "artifact_list_window" )
|
|
}
|
|
artifact_type = artifact_type || 0;
|
|
partner_id = partner_id || 0;
|
|
var data = {};
|
|
data.artifact_type = artifact_type;
|
|
data.partner_id = partner_id;
|
|
data.select_vo = select_vo;
|
|
this.artifact_list_window.open( data )
|
|
} else {
|
|
if( this.artifact_list_window ) {
|
|
this.artifact_list_window.close()
|
|
this.artifact_list_window = null
|
|
}
|
|
}
|
|
},
|
|
|
|
// 符文选择界面
|
|
openArtifactChoseWindow: function( bool, data ) {
|
|
if( bool == true ) {
|
|
if( !this.artifact_chose_window ) {
|
|
this.artifact_chose_window = Utils.createClass( "artifact_chose_window" )
|
|
}
|
|
this.artifact_chose_window.open( data )
|
|
} else {
|
|
if( this.artifact_chose_window ) {
|
|
this.artifact_chose_window.close()
|
|
this.artifact_chose_window = null
|
|
}
|
|
}
|
|
},
|
|
|
|
// --==============================--
|
|
// --desc:打开符文操作界面
|
|
// --time:2018-05-17 05:34:13
|
|
// --@bool:
|
|
// --@data:符文数据,为goods_vo数据
|
|
// --@open_type:打开类型,分为
|
|
// --@return
|
|
// --==============================--
|
|
openArtifactTipsWindow: function( bool, data, open_type, partner_id, pos ) {
|
|
if( bool == true ) {
|
|
if( data == null || data.config == null ) {
|
|
nx.tbox( nx.text.getKey( "lab_hero_controller_tip1" ) )
|
|
return
|
|
}
|
|
if( !this.artifact_tips_window ) {
|
|
this.artifact_tips_window = Utils.createClass( "artifact_tips_window" )
|
|
}
|
|
if( open_type == null ) {
|
|
open_type = PartnerConst.ArtifactTips.backpack;
|
|
}
|
|
var param = { data: data, open_type: open_type, partner_id: partner_id, pos: pos }
|
|
this.artifact_tips_window.open( param )
|
|
} else {
|
|
if( this.artifact_tips_window ) {
|
|
this.artifact_tips_window.close()
|
|
this.artifact_tips_window = null
|
|
}
|
|
}
|
|
},
|
|
|
|
// 打开符文合成tips界面
|
|
openArtifactComTipsWindow: function( status, bid ) {
|
|
if( status == true ) {
|
|
if( !this.artifact_com_win ) {
|
|
this.artifact_com_win = Utils.createClass( "artifact_com_tips_window" )
|
|
}
|
|
this.artifact_com_win.open( bid )
|
|
} else {
|
|
if( this.artifact_com_win ) {
|
|
this.artifact_com_win.close()
|
|
this.artifact_com_win = null
|
|
}
|
|
}
|
|
},
|
|
|
|
// 打开符文祝福奖励领取界面
|
|
openArtifactAwardWindow: function( status ) {
|
|
if( status == true ) {
|
|
if( !this.artifact_award_win ) {
|
|
this.artifact_award_win = Utils.createClass( "artifact_award_window" )
|
|
}
|
|
this.artifact_award_win.open()
|
|
} else {
|
|
if( this.artifact_award_win ) {
|
|
this.artifact_award_win.close()
|
|
this.artifact_award_win = null
|
|
}
|
|
}
|
|
},
|
|
|
|
// 打开符文技能预览界面
|
|
// -@show_type 显示类型 1 是符文技能预览 2 是英雄天赋技能
|
|
openArtifactSkillWindow: function( status, show_type ) {
|
|
if( status == true ) {
|
|
nx.bridge.createPanel( "WndPartnerSkillPreview", show_type );
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerSkillPreview" );
|
|
}
|
|
},
|
|
// ----------------------------------------神器相关结束------------------------------
|
|
|
|
|
|
|
|
// -- 打开英雄tips界面
|
|
// --is_hide_equip 是否隐藏装备
|
|
openHeroTipsPanel( bool, hero_vo, is_hide_equip, showbtn ) {
|
|
if( bool == true ) {
|
|
if( !this.hero_tips_window ) {
|
|
// let HeroTipsWindow = require("hero_tips_window")
|
|
// this.hero_tips_window = new HeroTipsWindow()
|
|
|
|
if( !this.hero_tips_window ) {
|
|
this.hero_tips_window = Utils.createClass( "hero_tips_window", bool )
|
|
}
|
|
this.hero_tips_window.open( { hero_vo: hero_vo, is_hide_equip: is_hide_equip, showbtn: showbtn } )
|
|
|
|
}
|
|
|
|
} else {
|
|
if( this.hero_tips_window ) {
|
|
this.hero_tips_window.close()
|
|
this.hero_tips_window = null
|
|
}
|
|
}
|
|
},
|
|
|
|
// -- 打开英雄属性tips界面
|
|
openHeroTipsAttrPanel( bool, hero_vo, is_my ) {
|
|
if( bool == true ) {
|
|
|
|
nx.bridge.createPanel( "WndPartnerPropDetailsPanel", {
|
|
hero_vo: hero_vo,
|
|
is_my: is_my
|
|
} );
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerPropDetailsPanel" );
|
|
}
|
|
},
|
|
|
|
// -- 打开英雄tips界面根据bid
|
|
openHeroTipsPanelByBid( bid ) {
|
|
let hero_vo = this.model.getMockHeroVoByBid( bid )
|
|
if( hero_vo ) {
|
|
this.showPartnerTips( hero_vo );
|
|
// this.openHeroTipsPanel( true, hero_vo, true )
|
|
}
|
|
},
|
|
// 打开英雄图书馆信息根据bid 和星级
|
|
openHeroInfoWindowByBidStar: function( bid, star, callback ) {
|
|
if( bid == null || star == null ) return
|
|
var key = Utils.getNorKey( bid, star );
|
|
var hero_vo = this.model.getHeroPokedexByBid( key );
|
|
if( hero_vo ) {
|
|
this.openHeroMainInfoWindow( true, hero_vo, [ hero_vo ], { show_model_type: HeroConst.BagTab.eBagPokedex, callback: callback } )
|
|
}
|
|
},
|
|
|
|
// 背包 伙伴碎片预览
|
|
openPartnerItem( status, _bid, _star ) {
|
|
if( status == true ) {
|
|
|
|
nx.bridge.createPanel( "WndItemPartnerDetail", {
|
|
bid: _bid,
|
|
star: _star
|
|
} );
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndItemPartnerDetail");
|
|
}
|
|
},
|
|
|
|
// --请求天赋技能信息
|
|
sender11099( list ) {
|
|
let protocal = {}
|
|
protocal.partner_ids = list
|
|
this.SendProtocal( 11099, protocal )
|
|
},
|
|
handle11099( data ) {
|
|
this.model.updateHeroVoTalent( data.partner_ids )
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Get_Talent_Event, data.partner_ids )
|
|
},
|
|
// --天赋技能升级
|
|
sender11097( partner_id, pos ) {
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
protocal.pos = pos
|
|
this.SendProtocal( 11097, protocal )
|
|
},
|
|
handle11097( data ) {
|
|
if( data.result == true ) {
|
|
this.model.updateHeroVoTalent( [ data ], true )
|
|
data = this.model.getHeroById( data.partner_id )
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Level_Up_Talent_Event, data )
|
|
HeroCalculate.getInstance().clearAllHeroRecordByRedPointType( HeroConst.RedPointType.eRPTalent )
|
|
} else {
|
|
nx.tbox( data.msg )
|
|
}
|
|
},
|
|
// --天赋遗忘
|
|
sender11098( partner_id, pos ) {
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
protocal.pos = pos
|
|
this.SendProtocal( 11098, protocal )
|
|
},
|
|
handle11098( data ) {
|
|
if( data.result == true ) {
|
|
this.model.updateHeroVoTalent( [ data ], true )
|
|
data = this.model.getHeroById( data.partner_id )
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Forget_Talent_Event, data )
|
|
HeroCalculate.getInstance().clearAllHeroRecordByRedPointType( HeroConst.RedPointType.eRPTalent )
|
|
} else {
|
|
nx.tbox( data.msg )
|
|
}
|
|
},
|
|
|
|
// -- 打开英雄学习技能界面
|
|
openHeroTalentSkillLearnPanel( bool, hero_vo, cb ) {
|
|
|
|
if( bool == true ) {
|
|
nx.bridge.createPanel( "WndPartnerSkillLearn", {
|
|
hero_vo: hero_vo,
|
|
cb: cb
|
|
} );
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerSkillLearn");
|
|
}
|
|
},
|
|
// -- 打开英雄学习技能升级界面
|
|
openHeroTalentSkillLevelUpPanel( bool, hero_vo, skill_id, cb ) {
|
|
if( bool == true ) {
|
|
|
|
nx.bridge.createPanel( "WndPartnerSkillUpLevel", {
|
|
hero_vo: hero_vo,
|
|
skill_id: skill_id,
|
|
cb: cb
|
|
} );
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerSkillUpLevel" );
|
|
}
|
|
},
|
|
|
|
//开启新技能
|
|
openSkillUnlockWindow( status, skill_bid ) {
|
|
|
|
if( status == true ) {
|
|
nx.bridge.createPanel( "WndPartnerSkillUnlockPopup", {
|
|
sid: skill_bid
|
|
} );
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerSkillUnlockPopup" );
|
|
}
|
|
},
|
|
|
|
|
|
//播放英雄音效
|
|
onPlayHeroVoice: function( vocie_res, time ) {
|
|
|
|
nx.warn( "onPlayHeroVoice该方法已弃用,遇到再说" );
|
|
|
|
// //默认4秒
|
|
// time = time || 4;
|
|
// //补充1秒时差
|
|
// time += 1;
|
|
|
|
// if( this.voice_time_ticket == null ) {
|
|
// let volume = nx.storage.get( "music_volume" );
|
|
// volume -= 0.6;
|
|
// SoundManager.getInstance().setBackgroundVolume( volume );
|
|
// } else {
|
|
// gcore.Timer.del( this.voice_time_ticket );
|
|
// this.voice_time_ticket = null;
|
|
// }
|
|
|
|
// if( this.hero_music != null ) {
|
|
// if( this.hero_music == "undef" ) {
|
|
// SoundManager.getInstance().removeEffectSound( null );
|
|
// } else {
|
|
// SoundManager.getInstance().removeEffectSound( this.hero_music );
|
|
// }
|
|
// }
|
|
// this.hero_music = SoundManager.getInstance().playHeroEffectOnce( AUDIO_TYPE.DUBBING, vocie_res );
|
|
// if( this.hero_music == undefined ) {
|
|
// this.hero_music = "undef";
|
|
// }
|
|
// this.voice_time_ticket = gcore.Timer.set( function() {
|
|
// let volume = nx.storage.get( "music_volume" );
|
|
// SoundManager.getInstance().setBackgroundVolume( volume );
|
|
// this.voice_time_ticket = null;
|
|
// }.bind( this ), time * 1000, 1 )
|
|
},
|
|
/**
|
|
* 皮肤提示
|
|
* @param {*} status 打开与关闭
|
|
* @param {*} data 皮肤信息
|
|
* @param {*} open_type 装备状态,0.其他状态,1: 背包中 3:伙伴身上 具体查看 PartnerConst.EqmTips
|
|
* @param {*} partner 穿戴在伙伴身上就有伙伴id,其他可不填或填0
|
|
*/
|
|
openHeroSkinTipsPanel( status, data, open_type, partner ) {
|
|
if( status == true ) {
|
|
if( !this.hero_skin_tips_panel ) {
|
|
var HeroSkinTipsPanel = require( "hero_skin_tips_window" )
|
|
this.hero_skin_tips_panel = new HeroSkinTipsPanel( this )
|
|
}
|
|
this.hero_skin_tips_panel.open( { data: data, open_type: open_type, partner: partner } )
|
|
} else {
|
|
if( this.hero_skin_tips_panel ) {
|
|
this.hero_skin_tips_panel.close()
|
|
this.hero_skin_tips_panel = null
|
|
}
|
|
}
|
|
},
|
|
|
|
//---------------------------神裝相關結束-----------------------------------------
|
|
//--神裝保存重置技能"
|
|
sender11090( partner_id, holy_eqm_id, _type ) {
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
protocal.holy_eqm_id = holy_eqm_id //神裝id
|
|
protocal.type = _type
|
|
this.SendProtocal( 11090, protocal )
|
|
},
|
|
|
|
handle11090( data ) {
|
|
if( data.msg ) {
|
|
nx.tbox( data.msg )
|
|
}
|
|
},
|
|
|
|
//推送神裝改變"
|
|
handle11091( data ) {
|
|
this.model.updateHolyEquipmentInfo( data )
|
|
gcore.GlobalEvent.fire( HeroEvent.Holy_Equipment_Update_Event, data )
|
|
},
|
|
//請求神裝穿戴信息""
|
|
sender11092( partner_ids ) {
|
|
let protocal = {}
|
|
protocal.partner_ids = partner_ids
|
|
this.SendProtocal( 11092, protocal )
|
|
},
|
|
|
|
handle11092( data ) {
|
|
this.model.updateHeroVoHolyEquipment( data.partner_ids )
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Get_Holy_Equipment_Event, data.partner_ids )
|
|
},
|
|
|
|
//神裝穿戴/卸下"
|
|
sender11093( partner_id, holy_eqm_id, _type ) {
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
protocal.holy_eqm_id = holy_eqm_id //神裝id
|
|
protocal.type = _type
|
|
this.SendProtocal( 11093, protocal )
|
|
},
|
|
|
|
handle11093( data ) {
|
|
if( data.msg != "" ) {
|
|
nx.tbox( data.msg );
|
|
}
|
|
|
|
},
|
|
|
|
//神裝重置" 洗炼
|
|
sender11094( partner_id, holy_eqm_id, pos ) {
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
protocal.holy_eqm_id = holy_eqm_id
|
|
protocal.pos = pos
|
|
this.SendProtocal( 11094, protocal )
|
|
},
|
|
|
|
handle11094( data ) {
|
|
nx.tbox( data.msg )
|
|
},
|
|
|
|
//神裝獲取出售材料
|
|
sender11088( item_ids ) {
|
|
let protocal = {}
|
|
protocal.item_ids = item_ids
|
|
this.SendProtocal( 11088, protocal )
|
|
},
|
|
|
|
handle11088( data ) {
|
|
nx.tbox( data.msg )
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Sell_Holy_Equipment_Res_Event, data )
|
|
},
|
|
|
|
//神裝出售
|
|
sender11089( item_ids ) {
|
|
let protocal = {}
|
|
protocal.item_ids = item_ids
|
|
this.SendProtocal( 11089, protocal )
|
|
},
|
|
|
|
handle11089( data ) {
|
|
nx.tbox( data.msg )
|
|
},
|
|
|
|
//神裝預覽返回
|
|
sender11086( partner_id, holyequip_suit_data ) {
|
|
//記錄神裝套裝數據
|
|
this.holyequip_suit_data = holyequip_suit_data
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
this.SendProtocal( 11086, protocal )
|
|
},
|
|
|
|
handle11086( data ) {
|
|
this.openHolyequipmentTotalAttrPanel( true, data, this.holyequip_suit_data )
|
|
},
|
|
|
|
//當前神裝套裝狀態
|
|
sender25220() {
|
|
let protocal = {}
|
|
this.SendProtocal( 25220, protocal )
|
|
},
|
|
|
|
handle25220( data ) {
|
|
this.model.updateHolyEquipmentPlan( data )
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Get_Holy_Equipment_Plan_Event, data )
|
|
},
|
|
|
|
//新增神裝套裝方案
|
|
sender25221( suit_id, partner_id, name, holy_eqm_list ) {
|
|
let protocal = {}
|
|
protocal.id = suit_id
|
|
protocal.partner_id = partner_id
|
|
protocal.name = name
|
|
protocal.holy_eqm = holy_eqm_list
|
|
this.SendProtocal( 25221, protocal )
|
|
},
|
|
|
|
handle25221( data ) {
|
|
nx.tbox( data.msg )
|
|
},
|
|
|
|
//購買新的格子
|
|
sender25223() {
|
|
let protocal = {}
|
|
this.SendProtocal( 25223, protocal )
|
|
},
|
|
|
|
handle25223( data ) {
|
|
nx.tbox( data.msg )
|
|
if( data.code ) {
|
|
this.model.updateHolyEquipmentPlan( data, true )
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Open_Holy_Equipment_Cell_Event, data.num )
|
|
}
|
|
},
|
|
|
|
//應用方案到英雄
|
|
sender25224( partner_id, suit_id ) {
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
protocal.id = suit_id
|
|
this.SendProtocal( 25224, protocal )
|
|
},
|
|
|
|
handle25224( data ) {
|
|
nx.tbox( data.msg )
|
|
},
|
|
//---------------------------皮肤协议结束-----------------------------------------
|
|
//皮肤使用
|
|
sender11019: function( partner_id, skin_id, _cb ) {
|
|
let protocal = {};
|
|
protocal.partner_id = partner_id;
|
|
protocal.skin_id = skin_id;
|
|
this.SendProtocal( 11019, protocal, _cb );
|
|
},
|
|
|
|
handle11019: function( data ) {
|
|
// nx.tbox( data.msg );
|
|
if( data.result == 1 ) {
|
|
nx.tbox( nx.text.getKey( "lab_hero_controller_tip2" ) );
|
|
}
|
|
},
|
|
|
|
//皮肤使用
|
|
sender11020: function() {
|
|
let protocal = {};
|
|
this.SendProtocal( 11020, protocal );
|
|
},
|
|
|
|
handle11020: function( data ) {
|
|
// cc.log( "11020", data )
|
|
this.model.initHeroSkin( data );
|
|
|
|
},
|
|
|
|
//---------------------------皮肤协议结束-----------------------------------------
|
|
|
|
//打开皮肤界面
|
|
openHeroSkinWindow: function( status, vo ) {
|
|
if( status == true ) {
|
|
if( !this.hero_skin_window ) {
|
|
this.hero_skin_window = Utils.createClass( "hero_skin_window" );
|
|
}
|
|
this.hero_skin_window.open( vo );
|
|
} else {
|
|
if( this.hero_skin_window ) {
|
|
this.hero_skin_window.close();
|
|
this.hero_skin_window = null;
|
|
}
|
|
}
|
|
},
|
|
// --打开共鸣页面
|
|
openHeroResonateWindow: function( status, setting ) {
|
|
if( status ) {
|
|
if( !this.model.checkResonateIsOpen() ) {
|
|
return
|
|
}
|
|
if( !this.hero_resonate_window ) {
|
|
var heroresonatewindow = require( "hero_resonate_window" )
|
|
this.hero_resonate_window = new heroresonatewindow( this )
|
|
}
|
|
this.hero_resonate_window.open( setting )
|
|
} else {
|
|
if( this.hero_resonate_window ) {
|
|
this.hero_resonate_window.close();
|
|
this.hero_resonate_window = null;
|
|
}
|
|
}
|
|
},
|
|
|
|
// 打开共鸣水晶卸下英雄
|
|
openHeroResonatePutDownPanel: function( status, setting ) {
|
|
if( status ) {
|
|
if( !this.model.checkResonateIsOpen() ) {
|
|
return
|
|
}
|
|
if( !this.hero_resonate_put_down_panel ) {
|
|
var HeroResonatePutDownPanel = require( "hero_resonate_put_down_panel" )
|
|
this.hero_resonate_put_down_panel = new HeroResonatePutDownPanel( this )
|
|
}
|
|
this.hero_resonate_put_down_panel.open( setting )
|
|
} else {
|
|
if( this.hero_resonate_put_down_panel ) {
|
|
this.hero_resonate_put_down_panel.close();
|
|
this.hero_resonate_put_down_panel = null;
|
|
}
|
|
}
|
|
},
|
|
|
|
// --打开选择英雄界面 和 openHeroUpgradeStarSelectPanel 差不多,,操作上简单很多
|
|
openHeroSelectHeroPanel: function( status, setting ) {
|
|
if( status ) {
|
|
if( !this.hero_select_panel ) {
|
|
var heroselectpanel = require( "hero_select_panel" )
|
|
this.hero_select_panel = new heroselectpanel( this )
|
|
}
|
|
this.hero_select_panel.open( setting )
|
|
} else {
|
|
if( this.hero_select_panel ) {
|
|
this.hero_select_panel.close();
|
|
this.hero_select_panel = null;
|
|
}
|
|
}
|
|
|
|
},
|
|
|
|
// --共鸣石碑信息
|
|
sender26400: function() {
|
|
var protocal = {}
|
|
this.SendProtocal( 26400, protocal )
|
|
},
|
|
handle26400: function( data ) {
|
|
this.model.updateResonateLockInfo( data )
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Resonate_Info_Event, data )
|
|
},
|
|
|
|
|
|
// --共鸣石碑上阵/下阵 (成功推送26400)
|
|
sender26401: function( pos, id, _type ) {
|
|
var protocal = {}
|
|
protocal.pos = pos
|
|
protocal.id = id
|
|
protocal.type = _type
|
|
this.SendProtocal( 26401, protocal )
|
|
},
|
|
|
|
handle26401: function( data ) {
|
|
nx.tbox( data.msg )
|
|
},
|
|
|
|
// ========================================================================
|
|
// 同步中心 --- Kevin 05.09
|
|
// ========================================================================
|
|
|
|
// 请求同步中心信息
|
|
sender26425: function() {
|
|
this.SendProtocal( 26425, {} )
|
|
},
|
|
|
|
// 推送水晶信息
|
|
handle26425: function( data ) {
|
|
this.model.updateResonateCystalInfo( data )
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Resonate_Crystal_Info_Event, data )
|
|
},
|
|
|
|
// 放入同步伙伴
|
|
sender26426: function( partner_id, pos ) {
|
|
|
|
this.put_partner_id = partner_id;
|
|
this.put_pos = pos;
|
|
this.SendProtocal( 26426, {
|
|
partner_id: partner_id,
|
|
pos: pos,
|
|
} );
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Resonate_Crystal_Can_List_Event, false )
|
|
},
|
|
|
|
// 放入同步伙伴返回
|
|
handle26426: function( data ) {
|
|
|
|
// 出现错误
|
|
if( nx.dt.objEmpty( data ) || !data.result || nx.dt.strNEmpty( data.msg ) ) {
|
|
nx.tbox( data ? data.msg : "ErrFailed" );
|
|
this.put_pos = null
|
|
return;
|
|
}
|
|
|
|
let id = data.partner_id || this.put_partner_id;
|
|
let hero_vo = this.model.getHeroById( id );
|
|
if( hero_vo && Utils.next( hero_vo ) ) {
|
|
nx.bridge.createPanel( "WndSyncCenterJoin", hero_vo );
|
|
// --可能放入的英雄有升级的红点..要消除他
|
|
hero_vo.red_point[ HeroConst.RedPointType.eRPLevelUp ] = null;
|
|
// --可能是上阵的也要过滤一下
|
|
HeroCalculate.getInstance().checkAllHeroRedPoint();
|
|
}
|
|
this.put_partner_id = null;
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Resonate_Crystal_Update_One_Event, this.put_pos );
|
|
this.put_pos = null
|
|
},
|
|
|
|
// --卸下共鸣英雄"
|
|
sender26427: function( partner_id, pos ) {
|
|
var protocal = {}
|
|
protocal.partner_id = partner_id
|
|
protocal.pos = pos
|
|
this.down_pos = pos
|
|
this.SendProtocal( 26427, protocal )
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Resonate_Crystal_Can_List_Event, false )
|
|
},
|
|
handle26427: function( data ) {
|
|
nx.tbox( data.msg )
|
|
// --可能是上阵的也要过滤一下
|
|
if( data.result ) {
|
|
HeroCalculate.getInstance().checkAllHeroRedPoint()
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Resonate_Crystal_Update_One_Event, this.down_pos )
|
|
}
|
|
this.down_pos = null
|
|
},
|
|
|
|
// --刷新槽位冷却时间"
|
|
sender26428: function( pos ) {
|
|
var protocal = {}
|
|
protocal.pos = pos
|
|
this.SendProtocal( 26428, protocal )
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Resonate_Crystal_Can_List_Event, false )
|
|
},
|
|
|
|
handle26428: function( data ) {
|
|
nx.tbox( data.msg )
|
|
if( data.result ) {
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Resonate_Crystal_Update_One_Event, data.pos )
|
|
}
|
|
},
|
|
|
|
// 解锁共鸣槽位
|
|
sender26429: function( pos, type ) {
|
|
|
|
this.SendProtocal( 26429, {
|
|
pos: pos,
|
|
type: type,
|
|
} );
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Resonate_Crystal_Can_List_Event, false )
|
|
},
|
|
|
|
// 解锁共鸣槽位
|
|
handle26429: function( data ) {
|
|
|
|
// 出现错误
|
|
if( nx.dt.objEmpty( data ) || !data.result || nx.dt.strNEmpty( data.msg ) ) {
|
|
nx.tbox( data ? data.msg : "ErrFailed" );
|
|
return;
|
|
}
|
|
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Resonate_Crystal_Update_One_Event, data.pos );
|
|
gcore.GlobalEvent.fire( HeroEvent.Hero_Resonate_Crystal_Update_One_Event, data.pos + 1 );
|
|
},
|
|
|
|
//夥伴回退
|
|
sender11065( partner_id ) {
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
this.SendProtocal( 11065, protocal )
|
|
},
|
|
|
|
handle11065( data ) {
|
|
let self = this;
|
|
if( data ) {
|
|
nx.tbox( data.msg )
|
|
let items = [];
|
|
for( let i in data.list ) {
|
|
let v = data.list[ i ];
|
|
if( v.is_partner == 1 ) {
|
|
let hero_vo = self.model.getHeroById( data.partner_id )
|
|
if( hero_vo ) {
|
|
let hero_info = nx.dt.objClone( hero_vo )
|
|
// hero_info.show_type = MainuiConst.item_exhibition_type.partner_type
|
|
items.push( hero_info );
|
|
}
|
|
} else {
|
|
items.push( { bid: v.id, num: v.num } );
|
|
}
|
|
}
|
|
|
|
MainuiController.getInstance().openGetItemView( true, items, 0, { is_backpack: true } )
|
|
|
|
gcore.GlobalEvent.fire( HeroEvent.HERO_RESET_EVENT, data )
|
|
}
|
|
|
|
},
|
|
|
|
//夥伴材料回退
|
|
sender11066( partner_id ) {
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
this.SendProtocal( 11066, protocal )
|
|
},
|
|
|
|
handle11066( data ) {
|
|
|
|
if( nx.dt.strNEmpty( data.msg ) ){
|
|
nx.tbox( data.msg );
|
|
}
|
|
if( data && data.code ) {
|
|
gcore.GlobalEvent.fire( HeroEvent.HERO_RESET_ITEM_EVENT, data )
|
|
}
|
|
},
|
|
|
|
//重生 針對 100級以下的
|
|
sender11067( partner_id ) {
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
this.SendProtocal( 11067, protocal )
|
|
},
|
|
|
|
handle11067( data ) {
|
|
this.model.setResetCount( data )
|
|
},
|
|
|
|
//重生 針對 100級以下的
|
|
sender11068( partner_id ) {
|
|
let protocal = {}
|
|
protocal.partner_id = partner_id
|
|
this.SendProtocal( 11068, protocal )
|
|
},
|
|
|
|
handle11068( data ) {
|
|
nx.tbox( data.msg )
|
|
},
|
|
|
|
//-----------------------重生方法處理------------------
|
|
showSingleRowItemList( item_scrollview, item_list2, data_list, setting2 ) {
|
|
// if( !item_scrollview ) {
|
|
// return
|
|
// }
|
|
// if( !data_list ) {
|
|
// return
|
|
// }
|
|
// let item_list = item_list2
|
|
// if( item_list ) {
|
|
// //隱藏物品
|
|
// for( let i in item_list ) {
|
|
// let v = item_list[ i ]
|
|
// if( v.deleteMe ) {
|
|
// v.deleteMe()
|
|
// v = null
|
|
// }
|
|
// }
|
|
// item_list = {}
|
|
// }
|
|
|
|
// if( item_list == null ) {
|
|
// item_list = {}
|
|
// }
|
|
|
|
// if( data_list.length == 0 ) {
|
|
// return
|
|
// }
|
|
// //道具列表
|
|
// let setting = setting2 || {}
|
|
// let scale = setting.scale || 1
|
|
// let start_x = setting.start_x || 5
|
|
// let space_x = setting.space_x || 5
|
|
// let max_count = setting.max_count
|
|
// let item_width = setting.item_width || 120
|
|
// let lock = setting.lock || false
|
|
// let is_show_action = setting.is_show_action || false
|
|
// //點擊返回回調函數
|
|
// let is_tip = setting.is_tip
|
|
// let callback = setting.callback || false
|
|
|
|
// let item_count = data_list.length
|
|
// item_width = item_width * scale
|
|
|
|
// let total_width = start_x * 2 + item_width * item_count + space_x * ( item_count - 1 )
|
|
// let item_scrollview_size = item_scrollview.getContentSize()
|
|
// let max_width = Math.max( item_scrollview_size.width, total_width )
|
|
// item_scrollview.setContentSize( cc.size( max_width, item_scrollview_size.height ) )
|
|
// if( max_count && item_count < max_count ) {
|
|
// // item_scrollview.setTouchEnabled(false)
|
|
// if( setting.is_center ) {
|
|
// start_x = ( item_scrollview_size.width - total_width ) * 0.5
|
|
// if( start_x < 0 ) {
|
|
// start_x = 0
|
|
// }
|
|
// }
|
|
// } else {
|
|
// // item_scrollview.setTouchEnabled(true)
|
|
// }
|
|
// item_scrollview.stopAllActions()
|
|
|
|
// let _setItemData = ( item, v, i ) => {
|
|
// item.setVisible( true )
|
|
// let _x = start_x + ( Number( i ) ) * ( item_width + space_x )//Number(i) - 1
|
|
// item.setPosition( _x, item_scrollview_size.height * 0.5 )
|
|
// item.setData( v[ 0 ], v[ 1 ], true )
|
|
// item.showOrderWarLock( lock )
|
|
// if( callback ) {
|
|
// item.addCallBack( () => {
|
|
// callback()
|
|
// } )
|
|
// }
|
|
// if( v[ 2 ] ) {
|
|
// item.setGoodsName( v[ 2 ], null, 24, null )
|
|
// }
|
|
// item.setDefaultTip( is_tip )
|
|
// if( setting.show_effect_id ) {
|
|
// item.showItemEffect( true, setting.show_effect_id, PlayerAction.action_1, true, 1.1 )
|
|
// } else {
|
|
// item.showItemEffect( false )
|
|
// }
|
|
// }
|
|
// let item = null
|
|
// let size = item_list.length
|
|
|
|
// for( let i in data_list ) {
|
|
// let v = data_list[ i ]
|
|
// let dealey = i - size
|
|
// if( dealey <= 0 ) {
|
|
// dealey = 1
|
|
// }
|
|
// let time = 0
|
|
// if( is_show_action ) {
|
|
// time = 0.1 * dealey
|
|
// } else {
|
|
// time = dealey / 60
|
|
// }
|
|
// Utils.delayRun( item_scrollview, time, () => {
|
|
// if( !item_list[ i ] ) {
|
|
// if( v.show_type != null && v.show_type == MainuiConst.item_exhibition_type.partner_type ) {
|
|
// item = new HeroExhibitionItem()
|
|
// item.setScale( scale );
|
|
// let _x = start_x + space_x;//start_x + (Number(i) - 1) * (item_width + space_x)
|
|
// item.setPosition( _x, item_scrollview_size.height * 0.5 )
|
|
// item.setParent( item_scrollview );
|
|
// item.show();
|
|
// item.addCallBack( () => {
|
|
// // -- if v.rid and v.srv_id then
|
|
// // -- HeroController:getInstance():openHeroTipsPanel(true, v)
|
|
// // -- else
|
|
// // -- HeroController:getInstance():openHeroTipsPanelByBid(v.bid)
|
|
// // -- end
|
|
// } )
|
|
// // item.setAnchorPoint(cc.v2(0.5, 0.5))
|
|
// item.setData( v )
|
|
// item_list[ i ] = item
|
|
// } else {
|
|
// item = new BackPackItem()
|
|
// // item.setAnchorPoint(0, 0.5)
|
|
// item.setScale( scale )
|
|
// // item:setSwallowTouches(false)
|
|
// item.setParent( item_scrollview );
|
|
// item.show();
|
|
// item_list[ i ] = item
|
|
// _setItemData( item, v, i )
|
|
// if( is_show_action ) {
|
|
// item.setScale( scale * 1.3 )
|
|
// }
|
|
// }
|
|
// }
|
|
// } )
|
|
// }
|
|
// return item_list
|
|
},
|
|
|
|
// --打開神裝洗練
|
|
// --@goods_vo
|
|
// --@partner_id 英雄的 partner_id 洗炼
|
|
openHolyequipmentRefreshAttPanel( status, goods_vo, _partner ) {
|
|
|
|
if( status ) {
|
|
nx.bridge.createPanel( "WndPartnerHolyRefinement", {
|
|
eqm: goods_vo,
|
|
partner: _partner
|
|
} );
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerHolyRefinement" );
|
|
}
|
|
},
|
|
|
|
// --打開神裝圖鑒界面 战斗义肢预览
|
|
openHeroClothesLustratWindow( status, _titles ) {
|
|
|
|
if( status ) {
|
|
|
|
nx.bridge.createPanel( "WndPartnerHolyPreview", {
|
|
titles: _titles
|
|
} );
|
|
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerHolyPreview");
|
|
}
|
|
},
|
|
|
|
|
|
// --打開神裝預覽
|
|
openHolyequipmentTotalAttrPanel( status, data, holyequip_suit_data ) {
|
|
|
|
if( status ) {
|
|
|
|
nx.bridge.createPanel( "WndPartnerHolyBonus", data, holyequip_suit_data );
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerHolyBonus" );
|
|
}
|
|
},
|
|
|
|
// --打開神裝方案
|
|
openHolyequipmentPlanPanel( status, _data, _partner ) {
|
|
if( status == true ) {
|
|
|
|
nx.bridge.createPanel( "WndPartnerHolyAssemble", {
|
|
plans: _data,
|
|
partner: _partner
|
|
} );
|
|
|
|
} else {
|
|
nx.bridge.closePanel( "WndPartnerHolyAssemble" );
|
|
}
|
|
},
|
|
|
|
// --打開神裝穿戴界面
|
|
openHeroHolyEquipClothPanel( bool, pos, partner_id, data, holy_data, enter_type, hero_vo, equip_list ) {
|
|
let self = this;
|
|
if( bool ) {
|
|
if( !self.equip_cloth_panel ) {
|
|
var HeroHolyEquipClothPanel = require( "hero_holy_equip_cloth_panel" );
|
|
self.equip_cloth_panel = new HeroHolyEquipClothPanel()
|
|
}
|
|
self.equip_cloth_panel.open( { pos, partner_id, data, holy_data, enter_type, hero_vo, equip_list } )
|
|
} else {
|
|
if( self.equip_cloth_panel ) {
|
|
self.equip_cloth_panel.close()
|
|
self.equip_cloth_panel = null
|
|
}
|
|
}
|
|
},
|
|
|
|
|
|
// --保存神裝套裝提示
|
|
openHolyequipmentSaveTips( status, holy_data ) {
|
|
let self = this;
|
|
if( status ) {
|
|
if( !self.holyequipment_save_tips ) {
|
|
var HolyequipmentSaveTips = require( "holyequipment_save_tips" );
|
|
self.holyequipment_save_tips = new HolyequipmentSaveTips()
|
|
}
|
|
|
|
self.holyequipment_save_tips.open( holy_data )
|
|
} else {
|
|
if( self.holyequipment_save_tips ) {
|
|
self.holyequipment_save_tips.close()
|
|
self.holyequipment_save_tips = null
|
|
}
|
|
}
|
|
},
|
|
|
|
// --裝配神裝套裝提示
|
|
// --@holy_data:待裝配套裝數據 {id, name, hero_vo, item_list}
|
|
openHolyequipmentWearTips( status, holy_data ) {
|
|
let self = this;
|
|
if( status ) {
|
|
if( !self.holyequipment_wear_tips ) {
|
|
var HolyequipmentWearTips = require( "holyequipment_wear_tips" );
|
|
self.holyequipment_wear_tips = new HolyequipmentWearTips()
|
|
}
|
|
|
|
self.holyequipment_wear_tips.open( holy_data )
|
|
} else {
|
|
if( self.holyequipment_wear_tips ) {
|
|
self.holyequipment_wear_tips.close()
|
|
self.holyequipment_wear_tips = null
|
|
}
|
|
}
|
|
},
|
|
|
|
// --保存神裝套裝方案提示
|
|
// --@hero_vo:當前英雄數據
|
|
// --@plan_data:所有神裝套裝數據
|
|
openHolyequipmentChooseTips( status, hero_vo, plan_data ) {
|
|
let self = this;
|
|
if( status ) {
|
|
if( !self.holyequipment_choose_tips ) {
|
|
var HolyequipmentChooseTips = require( "holyequipment_choose_tips" );
|
|
self.holyequipment_choose_tips = new HolyequipmentChooseTips()
|
|
}
|
|
|
|
self.holyequipment_choose_tips.open( { hero_vo, plan_data } )
|
|
} else {
|
|
if( self.holyequipment_choose_tips ) {
|
|
self.holyequipment_choose_tips.close()
|
|
self.holyequipment_choose_tips = null
|
|
}
|
|
}
|
|
},
|
|
|
|
// --重生確定
|
|
openHeroResetComfirmPanel( status, setting ) {
|
|
let self = this;
|
|
if( status ) {
|
|
if( !self.hero_reset_comfirm_panel ) {
|
|
var HeroResetComfirmPanel = require( "hero_reset_comfirm_panel" )
|
|
self.hero_reset_comfirm_panel = new HeroResetComfirmPanel()
|
|
}
|
|
self.hero_reset_comfirm_panel.open( setting )
|
|
} else {
|
|
if( self.hero_reset_comfirm_panel ) {
|
|
self.hero_reset_comfirm_panel.close()
|
|
self.hero_reset_comfirm_panel = null
|
|
}
|
|
}
|
|
},
|
|
} );
|
|
|
|
module.exports = HeroController; |