【山河社稷图优化】优化选关界面操作

dev_chengFeng
ZhangBiao 2021-11-02 17:22:42 +08:00
parent 46247d8224
commit 8f2398c932
3 changed files with 13 additions and 4 deletions

View File

@ -375,6 +375,7 @@ function CarbonsPanel:BtnClick(id)
end end
elseif id == FUNCTION_OPEN_TYPE.FIGHTLEVEL then elseif id == FUNCTION_OPEN_TYPE.FIGHTLEVEL then
if ActTimeCtrlManager.SingleFuncState(id) then if ActTimeCtrlManager.SingleFuncState(id) then
FightLevelManager.curSelect = 0
UIManager.OpenPanel(UIName.FightLevelChapterPanel) UIManager.OpenPanel(UIName.FightLevelChapterPanel)
else else
PopupTipPanel.ShowTip(ActTimeCtrlManager.SystemOpenTip(id)) PopupTipPanel.ShowTip(ActTimeCtrlManager.SystemOpenTip(id))

View File

@ -35,6 +35,7 @@ end
function FightLevelChapterPanel:BindEvent() function FightLevelChapterPanel:BindEvent()
Util.AddClick(self.btnBack, function() Util.AddClick(self.btnBack, function()
FightLevelManager.curSelect = 0
self:ClosePanel() self:ClosePanel()
end) end)
Util.AddClick(self.helpBtn, function() Util.AddClick(self.helpBtn, function()
@ -104,15 +105,19 @@ function this.OnShowPanel()
curChapterId = FightLevelManager.GetCurChapterId() curChapterId = FightLevelManager.GetCurChapterId()
local allData = FightLevelManager.GetChapterData() local allData = FightLevelManager.GetChapterData()
this.ScrollView:SetData(allData, function (index, go) this.ScrollView:SetData(allData, function (index, go)
this.SingleChapterDataShow(go, allData[index]) this.SingleChapterDataShow(go, allData[index],index)
end,true,true) end,true,true)
if FightLevelManager.curSelect > 0 then
this.ScrollView:SetShow(FightLevelManager.curSelect)
else
local curIndex = FightLevelManager.GetCurChapterId() local curIndex = FightLevelManager.GetCurChapterId()
this.ScrollView:SetShow(curIndex) this.ScrollView:SetShow(curIndex)
end
-- 设置每日奖励显示 -- 设置每日奖励显示
this:SetDailyRewardShow() this:SetDailyRewardShow()
end end
function this.SingleChapterDataShow(go, data) function this.SingleChapterDataShow(go, data,index)
local playerParent = Util.GetGameObject(go, "playerParent") local playerParent = Util.GetGameObject(go, "playerParent")
local cur = Util.GetGameObject(go, "cur") local cur = Util.GetGameObject(go, "cur")
@ -172,6 +177,7 @@ function this.SingleChapterDataShow(go, data)
if PlayerManager.level >= data.config.Open then if PlayerManager.level >= data.config.Open then
if curChapterId >= data.chapterId then if curChapterId >= data.chapterId then
UIManager.OpenPanel(UIName.FightLevelSingleChapterPanel,data.chapterId) UIManager.OpenPanel(UIName.FightLevelSingleChapterPanel,data.chapterId)
FightLevelManager.curSelect = index
elseif curChapterId < data.chapterId then elseif curChapterId < data.chapterId then
PopupTipPanel.ShowTip("通关上一章后解锁!") PopupTipPanel.ShowTip("通关上一章后解锁!")
end end
@ -203,6 +209,7 @@ end
--界面关闭时调用(用于子类重写) --界面关闭时调用(用于子类重写)
function FightLevelChapterPanel:OnClose() function FightLevelChapterPanel:OnClose()
FightLevelManager.curSelect = 0
end end
--界面销毁时调用(用于子类重写) --界面销毁时调用(用于子类重写)

View File

@ -47,6 +47,7 @@ function this.Initialize()
allChapterData[config.Id] = singleChapterData allChapterData[config.Id] = singleChapterData
end end
end end
this.curSelect = 0
end end
--后端更新章节信息 --后端更新章节信息
function this.UpdataChapterData(msg,_isShowChapterOpenPopup) function this.UpdataChapterData(msg,_isShowChapterOpenPopup)