diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/NewCarbon/CarbonsPanel.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/NewCarbon/CarbonsPanel.lua index 9bb1c7f157..0e36c50199 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/NewCarbon/CarbonsPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/NewCarbon/CarbonsPanel.lua @@ -375,6 +375,7 @@ function CarbonsPanel:BtnClick(id) end elseif id == FUNCTION_OPEN_TYPE.FIGHTLEVEL then if ActTimeCtrlManager.SingleFuncState(id) then + FightLevelManager.curSelect = 0 UIManager.OpenPanel(UIName.FightLevelChapterPanel) else PopupTipPanel.ShowTip(ActTimeCtrlManager.SystemOpenTip(id)) diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelChapterPanel.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelChapterPanel.lua index ef756e7ac5..cc0ecf7fef 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelChapterPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelChapterPanel.lua @@ -35,6 +35,7 @@ end function FightLevelChapterPanel:BindEvent() Util.AddClick(self.btnBack, function() + FightLevelManager.curSelect = 0 self:ClosePanel() end) Util.AddClick(self.helpBtn, function() @@ -104,15 +105,19 @@ function this.OnShowPanel() curChapterId = FightLevelManager.GetCurChapterId() local allData = FightLevelManager.GetChapterData() this.ScrollView:SetData(allData, function (index, go) - this.SingleChapterDataShow(go, allData[index]) + this.SingleChapterDataShow(go, allData[index],index) end,true,true) - local curIndex = FightLevelManager.GetCurChapterId() - this.ScrollView:SetShow(curIndex) + if FightLevelManager.curSelect > 0 then + this.ScrollView:SetShow(FightLevelManager.curSelect) + else + local curIndex = FightLevelManager.GetCurChapterId() + this.ScrollView:SetShow(curIndex) + end -- 设置每日奖励显示 this:SetDailyRewardShow() end -function this.SingleChapterDataShow(go, data) +function this.SingleChapterDataShow(go, data,index) local playerParent = Util.GetGameObject(go, "playerParent") local cur = Util.GetGameObject(go, "cur") @@ -172,6 +177,7 @@ function this.SingleChapterDataShow(go, data) if PlayerManager.level >= data.config.Open then if curChapterId >= data.chapterId then UIManager.OpenPanel(UIName.FightLevelSingleChapterPanel,data.chapterId) + FightLevelManager.curSelect = index elseif curChapterId < data.chapterId then PopupTipPanel.ShowTip("通关上一章后解锁!") end @@ -203,6 +209,7 @@ end --界面关闭时调用(用于子类重写) function FightLevelChapterPanel:OnClose() + FightLevelManager.curSelect = 0 end --界面销毁时调用(用于子类重写) diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua index 40695b23f9..a8739f9520 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua @@ -47,6 +47,7 @@ function this.Initialize() allChapterData[config.Id] = singleChapterData end end + this.curSelect = 0 end --后端更新章节信息 function this.UpdataChapterData(msg,_isShowChapterOpenPopup)