From 11f17fca87b99a69a30e9b5493230848096dd91c Mon Sep 17 00:00:00 2001 From: zhangqiang <657634622@qq.com> Date: Fri, 14 May 2021 19:55:28 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=B1=B1=E6=B2=B3=E7=A4=BE=E7=A8=B7?= =?UTF-8?q?=E5=9B=BE=E3=80=91=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/FightLevel/FightLevelManager.lua | 4 ++++ .../FightLevel/FightLevelSingleChapterPanel.lua | 12 +++++++++++- .../View/FightLevelInfoPopup_MainLevelReward.lua | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua index 5c6f06da86..d4008a42fd 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua @@ -158,6 +158,10 @@ function this.FightLevelFightBattle(_fightLevelData, callBack) elseif _fightLevelData.config.StageType == FIGHTLEVEL_STAGETYPE.AssistantLevelReward then UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function() --刷新数据刷新界面 + if callBack then + callBack() + callBack = nil + end end) end end) diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelSingleChapterPanel.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelSingleChapterPanel.lua index 214f2a520a..d40c289c36 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelSingleChapterPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelSingleChapterPanel.lua @@ -126,6 +126,8 @@ function this.SetSingleLevel(levelDatas) if isOpen == 0 then if levelData.state == 0 then FightLevelManager.FightLevelFightBattle(levelData, function() + this.OnShowPanel() + this.LeftOrRightBtnClickEvent() end) elseif levelData.state == 1 then PopupTipPanel.ShowTip("奖励已领取!") @@ -220,27 +222,35 @@ function this.LeftOrRightBtnClickEvent(index) -- chapterData = FightLevelManager.GetChapterData(chapterId) local upChapterId = chapterData.chapterId - 1 local upChapterData = FightLevelManager.GetChapterData(upChapterId) + LogYellow("upChapterId "..upChapterId.." FightLevelManager.GetCurChapterId() "..FightLevelManager.GetCurChapterId()) if upChapterData and upChapterId <= FightLevelManager.GetCurChapterId() then + LogYellow("this.leftBtn:SetActive(true)") this.leftBtn:SetActive(true) else + LogYellow("this.leftBtn:SetActive(false)") this.leftBtn:SetActive(false) end local downChapterId = chapterData.chapterId + 1 - local downChapterData = FightLevelManager.GetChapterData(upChapterId) + LogYellow("downChapterId "..downChapterId.." FightLevelManager.GetCurChapterId() "..FightLevelManager.GetCurChapterId()) + local downChapterData = FightLevelManager.GetChapterData(downChapterId) if downChapterData and downChapterId <= FightLevelManager.GetCurChapterId() then this.rightBtn:SetActive(true) + LogYellow(" this.rightBtn:SetActive(true)") else this.rightBtn:SetActive(false) + LogYellow(" this.rightBtn:SetActive(false)") end if index and index == 1 then--左 chapterId = upChapterId chapterData = upChapterData this.OnShowPanel() + this.LeftOrRightBtnClickEvent() elseif index and index == 2 then--右 chapterId = downChapterId chapterData = downChapterData this.OnShowPanel() + this.LeftOrRightBtnClickEvent() end end diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/View/FightLevelInfoPopup_MainLevelReward.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/View/FightLevelInfoPopup_MainLevelReward.lua index 1eb469626e..c2525775dc 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/View/FightLevelInfoPopup_MainLevelReward.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/View/FightLevelInfoPopup_MainLevelReward.lua @@ -94,6 +94,13 @@ function this.SingleDataShow(_go,_rewardData,_index) Util.GetGameObject(noButton, "Text"):GetComponent("Text").text = "未达成" noButton:SetActive(not FightLevelManager.GetCurLevelStarState(fightLevelData.state,index)) okButton:SetActive(FightLevelManager.GetCurLevelStarState(fightLevelData.state,index)) + if index == 0 then--首通 + noButton:SetActive(not (fightLevelData.state > 0))--state > 0 说明有星 肯定通关了就 + okButton:SetActive(fightLevelData.state > 0) + else + noButton:SetActive(not FightLevelManager.GetCurLevelStarState(fightLevelData.state,index)) + okButton:SetActive(FightLevelManager.GetCurLevelStarState(fightLevelData.state,index)) + end end function this.OnSortingOrderChange() for i, v in pairs(this.NoviceItemList) do