山河设计图添加开服时间限制

dev_chengFeng
wangzhenxing 2023-06-02 16:09:28 +08:00
parent f0ce97f220
commit a9b13b206c
2 changed files with 20 additions and 5 deletions

View File

@ -124,6 +124,8 @@ function this.SingleChapterDataShow(go, data,index)
curCurIndexImageList[i] = Util.GetGameObject(curIndexImageParent, "curIndexImage (" .. i .. ")")
curCurIndexImageList[i]:SetActive(#data.config.BigNumber == i)
end
local curTime=GetTimeStamp()
local isTimeOpen= curTime>=PlayerManager.GetServerOpenTime()+data.config.OpenTime*24*60*60
Util.GetGameObject(go, "redPoint"):SetActive(FightLevelManager.GetSingleChapterRewardBoxRedPoint(data.chapterId))
if curChapterId == data.chapterId then
if npc then
@ -169,16 +171,23 @@ function this.SingleChapterDataShow(go, data,index)
PopupTipPanel.ShowTip(Language[11131])
return
end
if PlayerManager.level >= data.config.Open then
if PlayerManager.level < data.config.Open then
PopupTipPanel.ShowTip(string.format("到达%s级后解锁",data.config.Open))
return
end
if not isTimeOpen then
PopupTipPanel.ShowTip(string.format("开服%s天后解锁",data.config.OpenTime))
return
end
if curChapterId >= data.chapterId then
UIManager.OpenPanel(UIName.FightLevelSingleChapterPanel,data.chapterId)
FightLevelManager.curSelect = index
elseif curChapterId < data.chapterId then
PopupTipPanel.ShowTip("通关上一章后解锁!")
end
else
PopupTipPanel.ShowTip(string.format("到达%s级后解锁",data.config.Open))
end
end)
end

View File

@ -58,7 +58,13 @@ function this.UpdataChapterData(msg,isEnd,_isShowChapterOpenPopup)
local singleHardStageChapter = allChapterData[msg.chapter[i].chapterId]
----Log("chapterId:"..msg.chapter[i].chapterId)--.." stars"..msg.chapter[i].stars.." node"..#msg.chapter[i].node.."reward:"..#msg.chapter[i].reward.." needStars:"..singleHardStageChapter.stars)
singleHardStageChapter.chapterId = msg.chapter[i].chapterId
if singleHardStageChapter.chapterId > oldChapterId and _isShowChapterOpenPopup then
local timeIsOpen=false
local chapterConfig=ConfigManager.TryGetConfigData(ConfigName.HardStageChapter,singleHardStageChapter.chapterId)
if chapterConfig then
local curTime=GetTimeStamp()
timeIsOpen=curTime>=PlayerManager.GetServerOpenTime()+chapterConfig.OpenTime*24*60*60
end
if singleHardStageChapter.chapterId > oldChapterId and _isShowChapterOpenPopup and timeIsOpen then
this.SetisShowChapterOpenPopup(true)
end
this.SetCurChapterId(singleHardStageChapter.chapterId)