【缥缈之旅】bug

dev_chengFeng
zhangqiang 2021-07-05 18:01:31 +08:00
parent f63f411268
commit d25b80dd1b
1 changed files with 17 additions and 18 deletions

View File

@ -61,13 +61,12 @@ end
function JourneyWithWindPanel:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose, this.AutoClose)
end
local curServerDay
--界面打开时调用(用于子类重写)
function JourneyWithWindPanel:OnOpen(_curDayIndex)
allBtnsConFigData = ActivityGiftManager.GetJourneyWithWindAllDayConFigData()
local curServerDay = math.ceil((CalculateSecondsNowTo_N_OClock(0) + GetTimeStamp() - PlayerManager.userCreateTime)/86400)
curServerDay = math.ceil((CalculateSecondsNowTo_N_OClock(0) + GetTimeStamp() - PlayerManager.userCreateTime)/86400)
for i = 1, #allBtnsConFigData do
if curServerDay >= allBtnsConFigData[i].Values[1][2] then
curDay = allBtnsConFigData[i].Values[1][2]
@ -112,22 +111,11 @@ function this.SingleDayBtnDataShow(_go,data,index)
Util.GetGameObject(go, "icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetResourcePath(iconItemId.ResourceID))
local redPoint = Util.GetGameObject(go, "redPoint")
local redState = false
if curDay >= data.Values[1][2] then
if curServerDay >= data.Values[1][2] then
Util.SetGray(Util.GetGameObject(go, "dayBg"),false)
else
Util.SetGray(Util.GetGameObject(go, "dayBg"),true)
end
if activityData then
for j = 1, #activityData.mission do
if activityData.mission[j].missionId == data.Id then
redState = ActivityGiftManager.SingleJourneyWithWindRewardNoGet(activityData.mission[j])
end
end
end
if not redState and curDay >= data.Values[1][2] then
redState = tonumber(ActivityGiftManager.GetJourneyWithWindPlayerPrefs(data.Values[1][2])) == 0
end
redPoint:SetActive(redState)
--上方按钮一个高一个低
if index%2 == 0 then
go.transform.anchoredPosition = Vector3.New(3.05,23,0)
@ -137,8 +125,19 @@ function this.SingleDayBtnDataShow(_go,data,index)
if data.Values[1][2] == curDayIndex then--初始化按钮选中状态
this.selected.transform:SetParent(Util.GetGameObject(go, "selectedParent").transform)
this.selected.transform.anchoredPosition = Vector3.New(4.3,9.4,0)
redPoint:SetActive(false)
ActivityGiftManager.SetJourneyWithWindPlayerPrefs(curDayIndex,1)
end
if activityData then
for j = 1, #activityData.mission do
if activityData.mission[j].missionId == data.Id then
redState = ActivityGiftManager.SingleJourneyWithWindRewardNoGet(activityData.mission[j])
end
end
end
if not redState and curServerDay >= data.Values[1][2] then
redState = tonumber(ActivityGiftManager.GetJourneyWithWindPlayerPrefs(data.Values[1][2])) == 0
end
redPoint:SetActive(redState)
Util.AddOnceClick(go, function()
this.ShowDayData(data.Values[1][2])--点击按钮刷新界面
this.selected.transform:SetParent(Util.GetGameObject(go, "selectedParent").transform)
@ -212,7 +211,7 @@ function this.ShowDayData(_curDayIndex)
end
local progress = curMissionData.progress--任务进度
local state = curMissionData.state--任务状态 0:未完成 1完成未领取 2已达成已领取
isOpenLock = curDay >= curDayIndex
isOpenLock = curServerDay >= curDayIndex
Util.SetGray(btnJump,false)
if isOpenLock then--到天数
btnJump.transform.anchoredPosition = Vector3.New(262.41,44.5,0)
@ -315,7 +314,7 @@ function this.ShowDayDataActivityReward()
local btnText = Util.GetGameObject(getBtn, "get"):GetComponent("Text")
local redPoint = Util.GetGameObject(getBtn, "redPoint")
isGetState = ActivityGiftManager.SingleJourneyWithWindRewardNoGet(curRewardTaskData)
isOpenLock = curDay >= curDayIndex
isOpenLock = curServerDay >= curDayIndex
local imageStr = isGetState and "s_slbz_1anniuongse" or "s_slbz_1anniuhuise"
getBtn:GetComponent("Image").sprite = this.spLoader:LoadSprite(imageStr)
redPoint:SetActive(isGetState)