// ================================================================ // // 桥接 跳转 // // ================================================================ const HRC = require( "hero_controller" ); const ROC = require( "role_controller" ); const EXC = require( "exchange_controller" ); const VIP = require( "vip_controller" ); const EFC = require( "elfin_controller" ); const EDC = require( "endless_trail_controller" ); const BTC = require( "battle_controller" ); const PLAC = require( "planesafk_controller" ); const FID = require( "bridge.function.ids" ); const MC = require( "mall_controller" ); const MailMod = require( "mail.mod" ); const ChatController = require( "chat_controller" ); const PVPMod = require( "pvp.mod" ); const BKC = require( "backpack_controller" ); const BPC = require( "backpack_const" ); const MCT = require( "mall_const" ); const BattleConst = require( "battle_const" ); const BBT = BPC.tips_btn_type; const BBC = BPC.Bag_Code; const BUT = BPC.item_use_type; const BIT = BPC.item_type; const BTT = BPC.item_sub_type; // ================================================================ // 关键字跳转 // ================================================================ const KeyJumps = {}; // 金币跳转 KeyJumps[ "coin" ] = function() { EXC.getInstance().openExchangeMainView( true ); return true; }; // 钻石跳转 KeyJumps[ "gold" ] = function() { nx.bridge.createPanel( "WndPayment", { key: "recharge" } ); return true; }; // 友情点 KeyJumps[ "friend_point" ] = function() { nx.bridge.createPanel( "WndFriend" ); return true; }; // ================================================================ // 来源跳转 // ================================================================ const SourceJumps = {}; // 召唤跳转 SourceJumps[ FID.Summon ] = function( _args ) { nx.bridge.createPanel( "WndSummon", _args ); }; // 召唤跳转 SourceJumps[ FID.SummonInfinite ] = function( _args ) { let args = _args || {}; args.key = "infinite"; nx.bridge.createPanel( "WndSummon", args ); }; // 召唤跳转 SourceJumps[ FID.SummonStepUp ] = function( _args ) { let args = _args || {}; args.key = "step"; nx.bridge.createPanel( "WndSummon", args ); }; // 水晶召唤 SourceJumps[ FID.SummonCrystal ] = function( _args ) { let args = _args || {}; args.key = "crystal"; nx.bridge.createPanel( "WndSummon", args ); }; // 兑换 道具商店跳转 SourceJumps[ FID.Shop ] = function( _args ) { let args = _args; if( args ) { let extend = args.extend; if( extend ) { if( extend[ 0 ] != MCT.MallType.Recovery && extend[ 0 ] != MCT.MallType.GodShop && extend[ 0 ] != MCT.MallType.SkillShop ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.ScoreShop, extend[ 0 ] ] ); return; } } let p1 = _args.p1; let p2 = _args.p2; if( p1 && p2 ) { MC.getInstance().openMallPanel( true, [ p1, p2 ] ); return; } } MC.getInstance().openMallPanel( true, [ MCT.MallType.GodShop ] ); }; // 召唤家园 SourceJumps[ FID.Home ] = function( _args ) { nx.bridge.createPanel( "WndHome", _args ); }; // 家园兑换商城 SourceJumps[ FID.ThemeShop ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.SummonShop, MCT.MallType.ThemeShop ] ); }; // 限时兑换商城 SourceJumps[ FID.LimitTimeEx ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.LimitTimeChange ] ); }; // 探险 SourceJumps[ FID.MysteryExplore ] = function( _args ) { let acts = nx.bridge.acts.acts; let showcamp = null; if( acts ) { for( let a in acts ) { let act = acts[ a ]; if( act.data.source == FID.MysteryExplore ) { showcamp = act.data; break; } } if( showcamp ) { jump2ActTheme( showcamp.theme_id, showcamp.camp_id ); } } }; // 家园兑换商城 SourceJumps[ FID.PartnerExChange ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.SummonShop, MCT.MallType.LimitStore ] ); }; // 限時祈願兌換商城 SourceJumps[ FID.PartnerPrayShops ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.SummonShop, MCT.MallType.LimitPrayStore ] ); }; // 限時祈願兌換商城 SourceJumps[ FID.PartnerWingsShops ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.SummonShop, MCT.MallType.LimitWingsStore ] ); }; // 派遣跳转 SourceJumps[ FID.Dispatch ] = function( _args ) { nx.bridge.createPanel( "WndDispatchTask", _args ); }; // 图书馆跳转 SourceJumps[ FID.Library ] = function( _args ) { nx.bridge.createPanel( "WndLibrary", _args ); }; // 秘书组跳转 SourceJumps[ FID.Clerk ] = function( _args ) { nx.bridge.createPanel( "WndPersonalClerk", _args ); }; // 联盟界面跳转 SourceJumps[ FID.Guild ] = function( _args ) { let role = ROC.getInstance().getRoleVo(); if( role && role.isHasGuild() ) { nx.bridge.createPanel( "WndGuild" ); } else { nx.bridge.createPanel( "WndGuildList" ); } }; // 联盟捐献界面跳转 SourceJumps[ FID.GuildDonate ] = function( _args ) { nx.bridge.createPanel( "WndGuildDonate", _args ); }; // 競技場兌換商城界面跳转 SourceJumps[ FID.ArenaShop ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.ScoreShop, MCT.MallType.ArenaShop ] ); }; // 联盟兌換商城界面跳转 SourceJumps[ FID.GuildShop ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.ScoreShop, MCT.MallType.UnionShop ] ); }; // 僚机采购界面跳转 SourceJumps[ FID.ElfinSummon ] = function( _args ) { EFC.getInstance().openElfinWishWindow( true ); }; // 伙伴兑换商城界面跳转 SourceJumps[ FID.PertnerShop ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.Recovery ] ); }; // 争夺商店 SourceJumps[ FID.PlanesShop ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.ScoreShop, MCT.MallType.FriendShop ] ); }; // 段位商店 SourceJumps[ FID.EliteShop ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.ScoreShop, MCT.MallType.EliteShop ] ); }; // 跨服和组队竞技商店 SourceJumps[ FID.CrossShop ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.ScoreShop, MCT.MallType.CrossarenaShop ] ); }; // 冠军赛商店 SourceJumps[ FID.ChampionShop ] = function( _args ) { }; // 现金充值 SourceJumps[ FID.Charge ] = function( _args ) { nx.bridge.createPanel( "WndPayment", { page: "vip" } ); }; // 特權商店 SourceJumps[ FID.PrivilegeShop ] = function( _args ) { nx.bridge.createPanel( "WndPayment", { page: "shop" } ); }; // 伙伴背包 SourceJumps[ FID.Partner ] = function( _args ) { HRC.getInstance().openHeroBagWindow( true ); }; // 义肢背包 SourceJumps[ FID.Equip ] = function( _args ) { BKC.getInstance().openMainWindow( true ); }; // 碎片背包 SourceJumps[ FID.Chips ] = function( _args ) { BKC.getInstance().openMainWindow( true, BTT.HERO ); }; // 芯片背包 SourceJumps[ FID.Artifact ] = function( _args ) { BKC.getInstance().openMainWindow( true, BTT.SPECIAL ); }; // 僚机背包 SourceJumps[ FID.WingBag ] = function( _args ) { BKC.getInstance().openMainWindow( true, BTT.ELFIN ); }; // 僚机 SourceJumps[ FID.Wing ] = function( _args ) { HRC.getInstance().openHeroBagWindow( true, "wings" ); }; // 跳转竞技场 SourceJumps[ FID.Arena ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 2 ); }, // 跳转竞技场宝箱 SourceJumps[ FID.ArenaBox ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 2 ); }, // 跳转歼星迷途 SourceJumps[ FID.Adventure ] = function( _args ) { // nx.tbox( "NoImplementation" ); BTC.getInstance().requestOpenBattleRelevanceWindow( 6 ); }, // 歼星迷途冒险情报兑换商店 SourceJumps[ FID.AdventureShop ] = function( _args ) { nx.tbox( "NoImplementation" ); }, // 跳转歼星迷途探索宝箱 SourceJumps[ FID.AdventureBox ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 6 ); }, //家园寝室亲密度跳转 SourceJumps[ FID.BedRoom ] = function( _args ) { nx.bridge.createPanel( "WndBedroom" ); }; // 联盟副本界面跳转 SourceJumps[ FID.GuildCopy ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 9 ); }; // 联盟联赛界面跳转 SourceJumps[ FID.GuildRace ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow(16); // nx.bridge.createPanel( "WndGuildRace", _args ); }; // 联盟秘境界面跳转 SourceJumps[ FID.GuildSArea ] = function( _args ) { nx.bridge.createPanel( "WndGuildSArea", _args ); }; // 联盟宝库界面跳转 SourceJumps[ FID.GuildDepot ] = function( _args ) { nx.bridge.createPanel( "WndGuildMarketMain", _args ); }; // 好友界面跳转 SourceJumps[ FID.Friend ] = function( _args ) { nx.bridge.createPanel( "WndFriend", { type: 1 } ); }; //点金界面跳转 SourceJumps[ FID.Coin ] = function( _args ) { nx.bridge.createPanel( "WndPopBuyCoin" ); }; // 日常任务跳转 SourceJumps[ FID.Daily ] = function( _args ) { nx.bridge.createPanel( "WndTaskDaily", _args ); }; // 开服预告 SourceJumps[ FID.openServerActs ] = function( _args ) { nx.bridge.createPanel( "WndOpenServer", _args ); }; // 日常任务跳转 SourceJumps[ FID.Task ] = function( _args ) { nx.bridge.createPanel( "WndTaskMain", _args ); }; // 成就任务跳转 SourceJumps[ FID.Achievement ] = function( _args ) { nx.bridge.createPanel( "WndAchievement", _args ); }; // 同步中心跳转 SourceJumps[ FID.SyncCenter ] = function( _args ) { nx.bridge.createPanel( "WndSyncCenter", _args ); }; // 同步中心跳转 SourceJumps[ FID.GoExplore ] = function( _args ) { let acts = nx.bridge.acts.acts; let showcamp = null; if( acts ) { for( let a in acts ) { let act = acts[ a ]; if( act.data.source == FID.GoExplore ) { showcamp = act.data; break; } } if( showcamp ) { jump2ActTheme( showcamp.theme_id, showcamp.camp_id ); } } }; // 大富翁跳转 SourceJumps[ FID.Mono ] = function( _args ) { let Mono = require( "monopoly.mod" ); let ret = Mono.getInstance().checkLock(); if( nx.dt.objNEmpty( ret ) ) { nx.tbox( ret.desc ); return; } // 信息请求 Mono.getInstance().fetchData( ( _ret, _data ) => { if( !_ret ) { nx.tbox( _data ); return; } nx.bridge.createPanel( "WndMonopoly" ); } ); }; // 一键领取 SourceJumps[ FID.OnceRewards ] = function( _args ) { nx.bridge.createPanel( "WndOnceRewards", _args ); }; // 一键领取 SourceJumps[ FID.OptionalGift ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 7 ); if( data ) { // let args = nx.dt.objClone( data ); // args.focus = 51027;//夥伴集結 nx.bridge.createPanel( "WndActCustomGift" ); } }; // 超凡段位赛 SourceJumps[ FID.EliteMatch ] = function( _args ) { // nx.tbox( "NoImplementation" ); BTC.getInstance().requestOpenBattleRelevanceWindow( BattleConst.Fight_Type.EliteMatchWar ); }; // 组队竞技场 SourceJumps[ FID.Arenateam ] = function( _args ) { nx.tbox( "NoImplementation" ); }; // 挑战 SourceJumps[ FID.Challange ] = function( _args ) { PVPMod.getInstance().openPVPWindow( true ); }; // 阵营大战 SourceJumps[ FID.CampFitPvP ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( BattleConst.Fight_Type.newYearBoss ); }; //冠军赛跳转 SourceJumps[ FID.CrossChampion ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( BattleConst.Fight_Type.CrossChampion ); }; // 星舰 行星武器 SourceJumps[ FID.Hallows ] = function( _args ) { HRC.getInstance().openHeroBagWindow( true, "hallows" ); }; // 排行榜跳转 SourceJumps[ FID.Rank ] = function( _args ) { if( nx.dt.strEmpty( _args.p1 ) ) { nx.bridge.createPanel( "WndRank", _args ); } else { nx.bridge.createPanel( "WndRankInfo", { type: _args.p1 } ); } }; // 试练塔跳转 SourceJumps[ FID.Tower ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 7 ); }; // 剧情副本跳转 SourceJumps[ FID.Drama ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 3 ); }; // // 充值商城跳转 // SourceJumps[ FID.Shop ] = function ( _args ) { // nx.bridge.createPanel( "WndVipWnd" ); // }; // 无尽试炼跳转 SourceJumps[ FID.Endless ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 11 ); }; // pve副本跳转 SourceJumps[ FID.Esecise ] = function( _args ) { // nx.bridge.createPanel( "WndEndlessMain", _args ); }; // 材料副本 SourceJumps[ FID.Dungeon ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 14 ); }; // 金币副本 SourceJumps[ FID.CoinDun ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 14 ); }; // 夥伴副本 SourceJumps[ FID.PartnerDun ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 14 ); }; // 星艦副本 SourceJumps[ FID.HallowDun ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 14 ); }; // 經驗副本 SourceJumps[ FID.ExpDun ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 14 ); }; // 芯片副本 SourceJumps[ FID.ChipDun ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 14 ); }; // 中心城争夺战(位面征战) SourceJumps[ FID.Planes ] = function( _args ) { PLAC.getInstance().sender28601(); // BTC.getInstance().requestOpenBattleRelevanceWindow( 40 ); }; // 改造 SourceJumps[ FID.Reform ] = function( _args ) { HRC.getInstance().openHeroReformWindow( true ); }; // 置换 SourceJumps[ FID.Swap ] = function( _args ) { HRC.getInstance().openHeroReformWindow( true, { fromOther: "swap" } ); }; // 升星 SourceJumps[ FID.UpStar ] = function( _args ) { HRC.getInstance().openHeroReformWindow( true, { fromOther: "upstar" } ); }; // 回收 SourceJumps[ FID.Recycle ] = function( _args ) { let needAuto = _args ? _args.needAuto : false ; HRC.getInstance().openHeroReformWindow( true, { fromOther: "recycle", needAuto: needAuto } ); }; // 回退 SourceJumps[ FID.Back ] = function( _args ) { // HRC.getInstance().openHeroReformWindow( true, { fromOther: "back" } ); }; // 义肢合成 SourceJumps[ FID.Equips ] = function( _args ) { HRC.getInstance().openHeroReformWindow( true, { fromOther: "equips" } ); }; // 芯片合成 SourceJumps[ FID.ReformArtifact ] = function( _args ) { HRC.getInstance().openHeroReformWindow( true, { fromOther: "artifact" } ); }; // 兑换商城 模组 SourceJumps[ FID.SkillShop ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.SkillShop ] ); }; // 阵营秘境 SourceJumps[ FID.PVEFactionSec ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 25 ); }; // 遗迹探索 SourceJumps[ FID.PVERuins ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 27 ); }; // 跨服竞技场 SourceJumps[ FID.CrossArena ] = function( _args ) { nx.tbox( "NoImplementation" ); }; // 周冠军赛 SourceJumps[ FID.WeekChampion ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 31 ); }; // 周冠军商店 SourceJumps[ FID.ExchangeChamp ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.ScoreShop, MCT.MallType.CrosschampionShop ] ); }; // 阵营乱斗商城 SourceJumps[ FID.CampFitShops ] = function( _args ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.ScoreShop, MCT.MallType.CampFitShop ] ); }; // 巅峰冠军赛 SourceJumps[ FID.PinnacleChamp ] = function( _args ) { nx.tbox( "NoImplementation" ); }; // 跨服时空 SourceJumps[ FID.CrossSpace ] = function( _args ) { nx.tbox( "NoImplementation" ); }; // 跨服天梯 SourceJumps[ FID.CrossLadder ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 18 ); }; // 兑换商城 杂货店 SourceJumps[ FID.VarietyShop ] = function( _args ) { nx.bridge.createPanel( "WndBlackMarket", {} ); }; // 义肢出售 SourceJumps[ FID.EquipSell ] = function( _args ) { }; // 芯片重铸 SourceJumps[ FID.ArtifactReset ] = function( _args ) { let data = {}; if( !nx.dt.objEmpty( _args ) ) { data.item = _args.item; data.config = _args.config; data.pos = _args.pos; } nx.bridge.createPanel( "WndBagItemsReforgot", data ); }; // 芯片分解 SourceJumps[ FID.ArtDecompose ] = function( _args ) { }; // 芯片穿戴 SourceJumps[ FID.ArtWear ] = function( _args ) { HRC.getInstance().openHeroBagWindow( true ); }; // 新手训练 SourceJumps[ FID.NewTrain ] = function( _args ) { BTC.getInstance().requestOpenBattleRelevanceWindow( 36 ); }; // 更換頭像 SourceJumps[ FID.ChangeHead ] = function( _args ) { nx.bridge.createPanel( "WndPersonalAvatarChange", { fromOther: 0 } ); }; // 更換頭像框 SourceJumps[ FID.ChangeAframe ] = function( _args ) { nx.bridge.createPanel( "WndPersonalAvatarChange", { fromOther: 1 } ); }; // 更換聊天氣泡介面 SourceJumps[ FID.ChangeChatBg ] = function( _args ) { nx.bridge.createPanel( "WndPersonalAvatarChange", { fromOther: 2 } ); }; // 更換徽章 SourceJumps[ FID.ChangeHoner ] = function( _args ) { nx.bridge.createPanel( "WndPersonalAvatarChange", { fromOther: 3 } ); }; // 成长自选商城 SourceJumps[ FID.GrowthShop ] = function( _args ) { nx.tbox( "NoImplementation" ); }; // 无尽试炼buff选择 SourceJumps[ FID.EndlessBuff ] = function( _args ) { // nx.tbox( "NoImplementation" ); EDC.getInstance().openEndlessBuffView( true, EDC.getInstance().cache_buff_data ); }; // 战斗义肢 SourceJumps[ FID.HolyEquips ] = function( _args ) { nx.tbox( "NoImplementation" ); }; // 皮肤 SourceJumps[ FID.Skin ] = function( _args ) { HRC.getInstance().openHeroBagWindow( true ); }; // 邮箱跳转 SourceJumps[ FID.Mail ] = function( _args ) { MailMod.getInstance().openMailUI( true, _args ); }; // 聊天跳转 SourceJumps[ FID.Chat ] = function( _args ) { // ChatController.getInstance().openChatPanel( true, _args ); }; // 聯盟天賦 SourceJumps[ FID.GuildTalent ] = function( _args ) { // nx.bridge.createPanel( "WndGuildTalent" ); }; // 家園基礎核心 SourceJumps[ FID.BaseKernel ] = function( _args ) { // nx.bridge.createPanel( "WndKernelMain" ); }; // ================================================================ // 道具操作选项跳转( BackpackConst.tips_btn_type ) // ================================================================ const ItemOpJumps = {}; // 自选礼包批量操作使用 ItemOpJumps[ BBT.SectMoreUse ] = function( _config, _item ) { // 普通使用 // if( _config.use_type != BUT.BATCH_USE ) { // BKC.getInstance().sender10515( _item.id, 1 ); // return; // } // 自选礼包 if( _config.type == BIT.FREE_GIFT ) { BKC.getInstance().openGiftSelectMorePanel( _item ); return; } // 直接/批量使用 // let count = _item.quantity; // if( count == 1 ) { // BKC.getInstance().sender10515( _item.id, 1 ); // } else { // BKC.getInstance().openBatchUseItemView( true, _item ); // } }; // 普通物品使用 ItemOpJumps[ BBT.goods_use ] = function( _config, _item ) { // 普通使用 if( _config.use_type != BUT.BATCH_USE ) { BKC.getInstance().sender10515( _item.id, 1 ); return; } // 自选礼包 if( _config.type == BIT.FREE_GIFT ) { BKC.getInstance().openGiftSelectPanel( _item ); return; } // 直接/批量使用 let count = _item.quantity; if( count == 1 ) { BKC.getInstance().sender10515( _item.id, 1 ); } else { BKC.getInstance().openBatchUseItemView( true, _item ); } }; // 皮膚碎片合成 ItemOpJumps[ BBT.SkinCompound ] = function( _config, _item ) { if( _item ) { BKC.getInstance().reqSkinCombine( _item.base_id ); } }; // 道具使用 魔方招募跳转 ItemOpJumps[ BBT.call_source ] = function( _config, _item ) { nx.bridge.createPanel( "WndSummon" ); }; // 道具出售 ItemOpJumps[ BBT.item_sell ] = function( _config, _item ) { BKC.getInstance().openItemSellPanel( true, _item, BBC.BACKPACK ); }; // 道具出售 模组出售 ItemOpJumps[ BBT.talent_sell ] = function( _config, _item ) { BKC.getInstance().openItemSellPanel( true, _item, BBC.BACKPACK ); }; // 跳转竞技场 ItemOpJumps[ BBT.arena_source ] = function( _config, _item ) { nx.bridge.createPanel( "WndArenaLoopChallenge" ); }, // 戰鬥義肢 洗練 ItemOpJumps[ BBT.GodEquipmentReMake ] = function( _config, _item ) { nx.bridge.createPanel( "WndPartnerHolyRefinement", { eqm: _config, partner: 0 } ); }, // 英雄碎片合成 ItemOpJumps[ BBT.hecheng ] = function( _config, _item ) { let count = gdata( "partner_data", "data_get_compound_info", _item.base_id ).num; if( _item.quantity < count ) { nx.tbox( nx.text.getKey( "tip_noEnoughMaterial" ) ); return; } BKC.getInstance().openItemMergePanel( true, _item, BBC.BACKPACK ); }; // 跳转英雄信息界面 ItemOpJumps[ BBT.hero_source ] = function( _config, _item ) { HRC.getInstance().openHeroBagWindow( true ); }; // 查看--跳转单角色预览界面 ItemOpJumps[ BBT.JumpToSingleHero ] = function( _config, _item ) { HRC.getInstance().openPartnerItem( true, _config.effect[ 0 ].val, _config.quality + 1 ); }; // 符文:穿戴 ItemOpJumps[ BBT.RuneEquip ] = function( _config, _item ) { HRC.getInstance().openHeroBagWindow( true ); }; // 符文:分解 ItemOpJumps[ BBT.RuneSell ] = function( _config, _item ) { BKC.getInstance().openItemDecomposePanel( true, _item, BBC.BACKPACK ); }; // 符文:重铸 ItemOpJumps[ BBT.RuneReMake ] = function( _config, _item ) { nx.bridge.createPanel( "WndBagItemsReforgot", { item: _item, config: _config } ); }; // 符文:升星改造 ItemOpJumps[ BBT.RuneUpStar ] = function( _config, _item ) { HRC.getInstance().openHeroReformWindow( true, _item ); }; // 跳轉到精靈古樹(使用古樹培養道具) ItemOpJumps[ BBT.elfin_rouse ] = function( _config, _item ) { HRC.getInstance().openHeroBagWindow( true, BBC.BACKPACK ); }; // 跳轉到精靈孵化(使用精靈蛋或孵化道具) ItemOpJumps[ BBT.elfin_hatch ] = function( _config, _item ) { let model = EFC.getInstance().getModel(); let lst = model.getElfinHatchList(); if( !lst || nx.dt.objEmpty( lst ) ) { EFC.getInstance().sender26500(); } EFC.getInstance().openWingScientfic( true, BBC.BACKPACK ); }; // 僚机:跳转主界面 ItemOpJumps[ BBT.JumpToWingman ] = function( _config, _item ) { HRC.getInstance().openHeroBagWindow( true, BBC.BACKPACK ); }; // 精靈蛋合成 ItemOpJumps[ BBT.elfin_egg_synthetic ] = function( _config, _item ) { let needCount = game.configs.sprite_data.data_const.liaoji_materials.val[ 1 ]; if( _item.quantity < needCount ) { nx.tbox( nx.text.getKey( "tip_noEnoughMaterial" ) ); return; } EFC.getInstance().openElfinEggSyntheticPanel( true, _item.base_id ); }; // 道具 芯片数据:跳转兑换商城 ItemOpJumps[ BBT.UseExchange ] = function( _config, _item ) { MC.getInstance().openMallPanel( true, [ MCT.MallType.SkillShop ] ); }; // ================================================================ // 活动跳转 // ================================================================ // 活动主题入口功能跳转 const openThemeEntry = function( _theme, _focusCamp = 0 ) { // 无效主题 if( !_theme || !nx.dt.numPositive( _theme.theme_id, false ) ) { nx.error( "活动主题入口功能跳转!" ); return false; } let args = nx.dt.objClone( _theme ); if( nx.dt.numPositive( _focusCamp, false ) ) { args.focus = _focusCamp; } // 特定主题 if( nx.dt.numPositive( args.skin_id, false ) ) { let wid = `WndThemeEntry${ args.skin_id }`; nx.bridge.createPanel( wid, args ); return; } // 默认主题 nx.bridge.createPanel( "WndActs", args ); return true; }; // 八日约定 SourceJumps[ FID.ActAppoint8 ] = function( _args ) { nx.bridge.createPanel( "WndAppoint8" ); }; // 七日特训 SourceJumps[ FID.ActTrain7 ] = function( _args ) { nx.bridge.createPanel( "WndActTraining7", _args ); }; // 限時挑戰 SourceJumps[ FID.PartChallenge ] = function( _args ) { let acts = nx.bridge.acts.acts; let showcamp = null; if( acts ) { for( let a in acts ) { let act = acts[ a ]; if( act.data.source == FID.PartChallenge ) { showcamp = act.data; break; } } if( showcamp ) { jump2ActTheme( showcamp.theme_id, showcamp.camp_id ); } } }; // 星空祈愿 SourceJumps[ FID.ActStarry ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 1 ); if( data ) { // let args = nx.dt.objClone( data ); // args.focus = 1002; // nx.bridge.createPanel( "WndActs", args ); } }; // 每日助力 SourceJumps[ FID.ActDFirst ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 12 ); if( data ) { nx.bridge.createPanel( "WndActDailyFirst" ); } }; // 每日签到 SourceJumps[ FID.ActMonthlySign ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 3 ); if( data ) { let args = nx.dt.objClone( data ); args.focus = 51005; nx.bridge.createPanel( "WndActs", args ); } }; // 成長基金 SourceJumps[ FID.ActFund ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 3 ); if( data ) { let args = nx.dt.objClone( data ); args.focus = 51000; nx.bridge.createPanel( "WndActs", args ); } }; //首充好禮 SourceJumps[ FID.ActFirst ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 4 ); if( data ) { let args = nx.dt.objClone( data ); args.focus = 51001;//首充禮包 nx.bridge.createPanel( "WndFirstCharge", args ); } }; //月卡 SourceJumps[ FID.MonthCard ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 3 ); if( data ) { let args = nx.dt.objClone( data ); args.focus = 50002; //月卡 nx.bridge.createPanel( "WndActs", args ); } }; //神秘人寶藏 SourceJumps[ FID.ActTreasure ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 3 ); if( data ) { let args = nx.dt.objClone( data ); args.focus = 51004;//神秘人寶藏 nx.bridge.createPanel( "WndActs", args ); } }; //殘骸收集 SourceJumps[ FID.ActRocketCol ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 1 ); if( data ) { let args = nx.dt.objClone( data ); args.focus = 1007;//殘骸收集 nx.bridge.createPanel( "WndWreckageCol", args ); } }; //翻倍紅包 SourceJumps[ FID.ActDoubleRed ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 1 ); if( data ) { let args = nx.dt.objClone( data ); args.focus = 1009;//翻倍紅包 nx.bridge.createPanel( "WndActDoubleRedpacketPop", args ); } }; //成長衝刺 SourceJumps[ FID.ActGrowthRush ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 1 ); if( data ) { nx.bridge.createPanel( "WndGrowthRush" ); } }; //夥伴集結 SourceJumps[ FID.ActAssemble ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 1 ); if( data ) { let args = nx.dt.objClone( data ); args.focus = 1005;//夥伴集結 nx.bridge.createPanel( "WndActs", args ); } }; //起航專享 SourceJumps[ FID.ActExclusive ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 1 ); if( data ) { let args = nx.dt.objClone( data ); args.focus = 1005;//夥伴集結 nx.bridge.createPanel( "WndExclusive", args ); } }; //夥伴集結 SourceJumps[ FID.ActAccumulative ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 1 ); if( data ) { // let args = nx.dt.objClone( data ); // args.focus = 1005;//夥伴集結 nx.bridge.createPanel( "WndAccumulative" ); } }; //限時特惠 SourceJumps[ FID.ActLimitedTime ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 8 ); if( data ) { // let args = nx.dt.objClone( data ); // args.focus = 1005;//夥伴集結 nx.bridge.createPanel( "WndLimitedTimeOffer" ); } }; SourceJumps[ FID.NewLimitGift ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 8 ); if( data ) { let args = nx.dt.objClone( data ); args.focus = 51027; nx.bridge.createPanel( "WndActs", args ); } }; //夥伴自選 SourceJumps[ FID.ActOptional ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 1 ); if( data ) { let args = nx.dt.objClone( data ); args.focus = 1010;//陣營自選 nx.bridge.createPanel( "WndActs", args ); } }; //升星好礼 SourceJumps[ FID.ActUpGradeStar ] = function( _args ) { nx.bridge.createPanel( "WndActUpstar", _args ); }; //升星计划 SourceJumps[ FID.TagUpStar ] = function( _args ) { nx.bridge.createPanel( "WndActHeroUpstar", _args ); }; //星空許願 SourceJumps[ FID.ActStarPray ] = function( _args ) { nx.bridge.createPanel( "WndActStarSkyPray", _args ); }; // 限時好禮 SourceJumps[ FID.ActLimitGift ] = function( _args ) { nx.bridge.createPanel( "WndLimitGift", _args ); }; // 七日定制 SourceJumps[ FID.SevenCustomGift ] = function( _args ) { nx.bridge.createPanel( "WndActSevenCustomGift", _args ); }; //星界初体验 SourceJumps[ FID.StarHeroTrial ] = function( _args ) { nx.bridge.createPanel( "WndActPartnertrial", _args ); }; //银河奇遇 SourceJumps[ FID.StarUserTramp ] = function( _args ) { // nx.bridge.createPanel( "WndActEncounter", _args ); }; //星界密令 SourceJumps[ FID.StarOrder ] = function( _args ) { let params = _args.theme; params.focus = _args.args.camp_id; nx.bridge.createPanel( "WndActs", params ); }; //远航见闻录&传说秘典 SourceJumps[ FID.SevenGoal ] = function( _args ) { nx.bridge.createPanel( "WndActsSevenGoals", _args ); }; //群星轨迹(战令) SourceJumps[ FID.ActStarTravel ] = function( _args ) { nx.bridge.createPanel( "WndActStarTravel", _args ); // let data = nx.bridge.acts.queryThemeByType(5); // if( data ) { // let args = nx.dt.objClone( data ); // nx.bridge.createPanel( "WndActs", args ); // } }; // 神秘人商城 SourceJumps[ FID.ActMySteryGift ] = function( _args ) { let data = nx.bridge.acts.queryThemeByType( 13 ); if( data ) { // let args = nx.dt.objClone( data ); // args.focus = 1010;//陣營自選 nx.bridge.createPanel( "WndActMySteryShop", _args ); } }; // 日常 活躍抽獎 SourceJumps[ FID.ActDTreasure ] = function( _args ) { nx.bridge.createPanel( "WndActDailyTreasure", _args ); }; // ============================================================ // 主题活动模板界面跳转 // ============================================================ // 皮肤模板界面跳转 const jumpSkinPanel = function( _wid, _skin, _args ) { if( nx.dt.strEmpty( _wid ) || nx.dt.strEmpty( _skin ) || nx.dt.objEmpty( _args ) ) { nx.error( `$JumpSkinPanel:跳转失败,参数不全! ${ _wid }` ); return; } _args.__keys = { skin: _skin }; nx.bridge.createPanel( _wid, _args ); }; // 活动模板:十五日签到活动 SourceJumps[ FID.Sign15Days ] = function( _args = {} ) { let skin = _args.theme ? "" + _args.theme.skin_id : ""; jumpSkinPanel( "WndActTSign15", skin, _args ); }; // ================================================================ // 对外接口 // ================================================================ // 来源条件检查 const checkSource = function( _sourceId ) { // 无效ID if( !nx.dt.numPositive( _sourceId, false ) ) { return; } // 配置验证 let cfgs = game.configs.source_data.data_source_data[ _sourceId ]; if( !cfgs ) { nx.error( "无效的跳转编号:", _sourceId ); return; } // 功能判断 let ret = nx.bridge.checkConditions( cfgs.lev_limit ); if( nx.dt.objNEmpty( ret ) ) { ret.desc = nx.text.getKey( cfgs.desc1 ) || ret.desc; } return ret; }; // 资产类获取 const jump2GetAsset = function( _key ) { let fn = KeyJumps[ _key ]; if( !nx.dt.fnGood( fn ) ) { nx.warn( "尚未处理的资产类获取:", _key ); return false; } return fn(); }; // 来源UI跳转 const jump2Window = function( _sourceId, _args ) { // 功能判断 let ret = checkSource( _sourceId ); if( nx.dt.objNEmpty( ret ) ) { nx.tbox( ret.desc ); return false; } // 执行处理函数 let fn = SourceJumps[ _sourceId ]; if( !nx.dt.fnGood( fn ) ) { nx.error( "尚未处理来源跳转:", _sourceId ); return false; } return fn( _args ); }; // 来源UI跳转 const jump2WindowByKey = function( _sourceKey, _args ) { let DATA = game.configs.source_data.data_source_data; for( let id in DATA ) { let CFG = DATA[ id ]; if( CFG && CFG.evt_type == _sourceKey ) { return jump2Window( id, _args ); } } nx.error( "尚未处理来源跳转:", _sourceKey ); return false; }; // 道具获取跳转 const jumpGetItem = function( _itemId ) { // 无效ID if( !nx.dt.numPositive( _itemId, false ) ) { return false; } // 资产类查询 let key = game.configs.item_data.data_assets_id2label[ _itemId ]; if( nx.dt.strNEmpty( key ) && jump2GetAsset( key ) ) { return true; } // 道具类跳转界面 let TC = require( "tips_controller" ); if( TC && TC.getInstance() ) { TC.getInstance().showItemTips( _itemId ); return true; } return false; }; // 道具操作跳转( BackpackConst.tips_btn_type ) const jumpOpItem = function( _optype, _args ) { let fn = ItemOpJumps[ _optype ]; if( !nx.dt.fnGood( fn ) ) { nx.warn( "尚未处理的道具操作跳转:", _optype ); return false; } return fn( _args.config, _args.item ); }; // 跳转指定主题 const jump2ActTheme = function( _theme_id, _camp_id ) { if( !nx.bridge.acts ) { nx.warn( "跳转指定主题失败:", _theme_id ); return false; } let theme = nx.bridge.acts.queryTheme( _theme_id ); if( nx.dt.objEmpty( theme ) ) { nx.warn( "跳转指定主题失败:", _theme_id ); return false; } openThemeEntry( theme, _camp_id ); }; // 跳转指定活动 const jump2ActPage = function( _camp_id ) { if( !nx.bridge.acts ) { nx.warn( "跳转指定活动失败:", _camp_id ); return false; } let ret = nx.bridge.acts.searchAct( _camp_id ); if( nx.dt.objEmpty( ret ) ) { nx.warn( "跳转指定活动失败:", _camp_id ); return false; } // 判断是否走功能编号 if( SourceJumps[ ret.infos.source ] ) { jump2Window( ret.infos.source, { theme : ret.theme, args : ret.infos } ); return; } // 走默认活动页 jump2ActTheme( ret.theme.theme_id, _camp_id ); }; // 导出 module.exports = { checkSource, jump2Window, jump2WindowByKey, jump2GetAsset, jumpGetItem, jumpOpItem, jump2ActTheme, jump2ActPage, };