From b9073838268d48e8d5c6b0a4b644063bb9e09245 Mon Sep 17 00:00:00 2001 From: yuanshuai <243578945@qq.com> Date: Tue, 19 Apr 2022 11:53:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=91=E6=88=98=E5=89=AF=E6=9C=AC=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/View/BattlePanel.lua | 2 ++ .../Modules/Carbon/ChallengeCopyPanel.lua | 35 ++++++++----------- .../Formation/View/ChallengeCopyFormation.lua | 10 +++--- .../~Lua/Modules/Popup/BattleWinPopup.lua | 3 +- .../~Lua/Modules/Shop/ShopManager.lua | 3 ++ 5 files changed, 25 insertions(+), 28 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua index aba3d51179..ffce301f5c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua @@ -594,6 +594,8 @@ function this.ShowBattleResult(result, msg) this.ShowBattleResultByTaSuiLingXiao() elseif fightType == BATTLE_TYPE.LINGMAIMIJING then this:ClosePanel() + elseif fightType == BATTLE_TYPE.CHALLENG_COPY_1 or fightType == BATTLE_TYPE.CHALLENG_COPY_2 then + this:ClosePanel() else LogRed("result:"..tostring(result)) if result == 0 then -- 失败 diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/ChallengeCopyPanel.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/ChallengeCopyPanel.lua index 98918420ba..3d1e84ce15 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/ChallengeCopyPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/ChallengeCopyPanel.lua @@ -2,7 +2,6 @@ require("Base/BasePanel") ChallengeCopyPanel = Inherit(BasePanel) local this = ChallengeCopyPanel -local dailyChallengeConfig=ConfigManager.GetConfig(ConfigName.DailyChallengeConfig) local mainLevelConfig = ConfigManager.GetConfig(ConfigName.MainLevelConfig) local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig) local specialConfig=ConfigManager.GetConfig(ConfigName.SpecialConfig) @@ -11,6 +10,7 @@ local curData={} local orginLayer=0 local carbonIndex=0-- 1 无尽副本 2 金币副本 副本索引id +local fightIndex=1 --关卡索引 local maxForce = 0 --顶部背景图 local titleBg={ @@ -113,7 +113,7 @@ function ChallengeCopyPanel:OnShow() this.TabCtrl:SetTabAdapter(this.TabAdapter) this.TabCtrl:SetTabIsLockCheck(this.TabIsLockCheck) this.TabCtrl:SetChangeTabCallBack(function(index) - this.RefreshShow(index, true,true) + this.RefreshShow(index) end) this.TabCtrl:Init(this.tabBox, _TabData,carbonIndex) -- 音效 @@ -140,41 +140,34 @@ function ChallengeCopyPanel:OnDestroy() end function this.FiveRefresh() - this.RefreshShow(1,false,false) - ChallengeCopyPanel:RefreshRedPotShow() + this.RefreshShow(carbonIndex) end --刷新面板 -function this.RefreshShow(i,isTop,isAni) +function this.RefreshShow(i) carbonIndex = i - LogBlue("~~~-------~carbonIndex:"..carbonIndex) + local challengeStageId=CarbonManager.challengeCopyDataTable[carbonIndex].currentFloor + if challengeStageId>0 then + fightIndex= ConfigManager.GetConfigData(ConfigName.ChallengeStage,challengeStageId).Section + end curData={} curData=ConfigManager.GetAllConfigsDataByKey(ConfigName.ChallengeStage,"Chapter",i) - this.titleBg.sprite=this.spLoader:LoadSprite(titleBg[i].bg) this.titleImg.sprite=this.spLoader:LoadSprite(titleBg[i].titleImg) this.titleTip.text=titleBg[i].titleTip this.SetTimeTip() - this.SetScroll(i,isTop,isAni) + this.SetScroll(fightIndex) + ChallengeCopyPanel:RefreshRedPotShow() end --设置滚动条 -local curMaxOpenId = 0 -function this.SetScroll(i,isTop,isAni) +function this.SetScroll(i) + LogRed("列表索引:"..i) this.scrollView:SetData(curData,function(index,root) this.SetData(root,curData[index], curData[index - 1]) - end,not isTop,not isAni) - for k,v in ipairs(curData) do - if not CarbonManager.IsDailyCarbonPass(v.Id) then - curMaxOpenId = k - break - end - end - if CarbonManager.IsDailyCarbonPass(curData[#curData].Id) then - curMaxOpenId = #curData - end - this.scrollView:SetIndex(curMaxOpenId - 2 < 1 and 1 or (curMaxOpenId - 2)) + end,false,false) + this.scrollView:SetIndex(i) end --设置滚动条数据 root根节点 data本地表数据 diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/ChallengeCopyFormation.lua b/Assets/ManagedResources/~Lua/Modules/Formation/View/ChallengeCopyFormation.lua index eb65ddc1a5..909aaa4186 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/View/ChallengeCopyFormation.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/ChallengeCopyFormation.lua @@ -68,13 +68,11 @@ function this.StartFight() end UIManager.OpenPanel(UIName.BattlePanel, fightData, battleType , function() LogGreen("222222战斗结果:"..msg.result) - UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function() - if msg.result==1 then - CarbonManager.UpdateChallengeCopyFloor(this.data.Chapter) - end - -- this.RefreshShow(carbonIndex,false,false) - end) + UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1) end) + if msg.result==1 then + CarbonManager.UpdateChallengeCopyFloor(this.data.Chapter) + end this.root:ClosePanel() end) end diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/BattleWinPopup.lua b/Assets/ManagedResources/~Lua/Modules/Popup/BattleWinPopup.lua index f63854f098..9a2cfd6f0e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/BattleWinPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/BattleWinPopup.lua @@ -57,7 +57,8 @@ function BattleWinPopup:NextStep() this.ShowBattleResultByExpedition(m_battleResult.drop) elseif m_fightType == BATTLE_TYPE.DAILY_CHALLENGE or m_fightType == BATTLE_TYPE.XUAN_YUAN_MIRROR - or m_fightType == BATTLE_TYPE.TRIAL_FIGHT then -- 日常副本 + or m_fightType == BATTLE_TYPE.TRIAL_FIGHT -- 日常副本 + or m_fightType == BATTLE_TYPE.CHALLENG_COPY_2 then m_battlePanel:ClosePanel() self:ClosePanel(m_battleResult.drop) elseif m_fightType == BATTLE_TYPE.GUILD_CAR_DELAY then -- 车迟 this.ShowBattleResultByCarDeleayType(m_battleResult.drop) diff --git a/Assets/ManagedResources/~Lua/Modules/Shop/ShopManager.lua b/Assets/ManagedResources/~Lua/Modules/Shop/ShopManager.lua index 062a3260f0..ddf7c85444 100644 --- a/Assets/ManagedResources/~Lua/Modules/Shop/ShopManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Shop/ShopManager.lua @@ -862,6 +862,9 @@ end --获取商品已购买次数 function this.GetShopItemHadBuyTimes(shopType, itemId) local shopData = this.GetShopDataByType(shopType) + if not shopData then + return 0 + end for _, v in ipairs(shopData.storeItem) do if v.id == itemId then return v.buyNum