【缥缈之旅】提交7

dev_chengFeng
zhangqiang 2021-07-05 10:58:41 +08:00
parent 9fa4e26f7e
commit a938b217a1
2 changed files with 16 additions and 14 deletions

View File

@ -1350,7 +1350,7 @@ function this.JourneyWithWindCurDayNoOpen()
for i = 1, #curJourneyWithWindAllDayConFigData do for i = 1, #curJourneyWithWindAllDayConFigData do
if curDay >= curJourneyWithWindAllDayConFigData[i].Values[1][2] then if curDay >= curJourneyWithWindAllDayConFigData[i].Values[1][2] then
local curRedPointState = this.GetJourneyWithWindPlayerPrefs(curJourneyWithWindAllDayConFigData[i].Values[1][2]) local curRedPointState = this.GetJourneyWithWindPlayerPrefs(curJourneyWithWindAllDayConFigData[i].Values[1][2])
if curRedPointState == 0 then if tonumber(curRedPointState) == 0 then
return true return true
end end
end end

View File

@ -124,22 +124,23 @@ function this.SingleDayBtnDataShow(_go,data,index)
end end
end end
end end
if not redState then if not redState and curDay >= data.Values[1][2] then
redState = ActivityGiftManager.GetJourneyWithWindPlayerPrefs(data.Values[1][2]) == 0 redState = tonumber(ActivityGiftManager.GetJourneyWithWindPlayerPrefs(data.Values[1][2])) == 0
end end
redPoint:SetActive(redState) redPoint:SetActive(redState)
--上方按钮一个高一个低
if index%2 == 0 then if index%2 == 0 then
go.transform.anchoredPosition = Vector3.New(3.05,23,0) go.transform.anchoredPosition = Vector3.New(3.05,23,0)
else else
go.transform.anchoredPosition = Vector3.New(3.05,176.09,0) go.transform.anchoredPosition = Vector3.New(3.05,176.09,0)
end end
if data.Values[1][2] == curDayIndex then if data.Values[1][2] == curDayIndex then--初始化按钮选中状态
this.selected.transform:SetParent(Util.GetGameObject(go, "selectedParent").transform) this.selected.transform:SetParent(Util.GetGameObject(go, "selectedParent").transform)
this.selected.transform.anchoredPosition = Vector3.New(4.3,9.4,0) this.selected.transform.anchoredPosition = Vector3.New(4.3,9.4,0)
redPoint:SetActive(false)
end end
Util.AddOnceClick(go, function() Util.AddOnceClick(go, function()
this.ShowDayData(data.Values[1][2]) this.ShowDayData(data.Values[1][2])--点击按钮刷新界面
this.selected.transform:SetParent(Util.GetGameObject(go, "selectedParent").transform) this.selected.transform:SetParent(Util.GetGameObject(go, "selectedParent").transform)
this.selected.transform.anchoredPosition = Vector3.New(4.3,9.4,0) this.selected.transform.anchoredPosition = Vector3.New(4.3,9.4,0)
end) end)
@ -164,7 +165,7 @@ function this.ShowDayData(_curDayIndex)
end end
--组当前所有任务的后端数据 --组当前所有任务的后端数据
local AllTaskData = TaskManager.GetTypeTaskList(TaskTypeDef.JourneyWithWind) local AllTaskData = TaskManager.GetTypeTaskList(TaskTypeDef.JourneyWithWind)
for i = 1, #curDayAllTaskGos-2 do for i = 1, #curDayAllTaskGos-2 do--curDayAllTaskGos-2 是因为上方任务至多只有五个 其余两个 一个是活动奖励 一个是礼包
if curDayAllTaskConFigData[i] then if curDayAllTaskConFigData[i] then
curDayAllTaskGos[i]:SetActive(true) curDayAllTaskGos[i]:SetActive(true)
Util.GetGameObject(curDayAllTaskGos[i], "pre1"):SetActive(true) Util.GetGameObject(curDayAllTaskGos[i], "pre1"):SetActive(true)
@ -178,7 +179,7 @@ function this.ShowDayData(_curDayIndex)
local headName = Util.GetGameObject(curDayAllTaskGos[i], "headImage/name") local headName = Util.GetGameObject(curDayAllTaskGos[i], "headImage/name")
headName:GetComponent("Text").text = curDayAllTaskConFigData[i].HeadName headName:GetComponent("Text").text = curDayAllTaskConFigData[i].HeadName
local size = headName:GetComponent("RectTransform").sizeDelta local size = headName:GetComponent("RectTransform").sizeDelta
if string.len(curDayAllTaskConFigData[i].HeadName) >= 15 then if string.len(curDayAllTaskConFigData[i].HeadName) >= 15 then--每条任务的最前方标题 文字字节长度大于等于15个字节五个字 text 要变宽否则显示不对
size.x = 130.3 size.x = 130.3
headName.transform.sizeDelta = size headName.transform.sizeDelta = size
else else
@ -188,7 +189,7 @@ function this.ShowDayData(_curDayIndex)
btnFinish:SetActive(false) btnFinish:SetActive(false)
btnJump:SetActive(false) btnJump:SetActive(false)
buyInfo.text = "" buyInfo.text = ""
local curMissionData local curMissionData--获取对应天数的后端活动数据
for j = 1, #AllTaskData do for j = 1, #AllTaskData do
if AllTaskData[j].missionId == curDayAllTaskConFigData[i].Id then if AllTaskData[j].missionId == curDayAllTaskConFigData[i].Id then
curMissionData = AllTaskData[j] curMissionData = AllTaskData[j]
@ -196,7 +197,7 @@ function this.ShowDayData(_curDayIndex)
end end
if curMissionData then if curMissionData then
local isOpen = false local isOpen = false
if curDayAllTaskConFigData[i].SystemId == FUNCTION_OPEN_TYPE.EXPEDITION then if curDayAllTaskConFigData[i].SystemId == FUNCTION_OPEN_TYPE.EXPEDITION then--大闹天宫 特殊判断 大闹天宫有 休息期 但不能显示关闭
if ActTimeCtrlManager.SingleFuncState(curDayAllTaskConFigData[i].SystemId) then if ActTimeCtrlManager.SingleFuncState(curDayAllTaskConFigData[i].SystemId) then
isOpen = true isOpen = true
else else
@ -214,6 +215,7 @@ function this.ShowDayData(_curDayIndex)
isOpenLock = curDay >= curDayIndex isOpenLock = curDay >= curDayIndex
Util.SetGray(btnJump,false) Util.SetGray(btnJump,false)
if isOpenLock then--到天数 if isOpenLock then--到天数
btnJump.transform.anchoredPosition = Vector3.New(262.41,44.5,0)
Util.SetGray(btnJump,false) Util.SetGray(btnJump,false)
btnJumpText.text = "前往" btnJumpText.text = "前往"
btnJump:GetComponent("Button").enabled = true btnJump:GetComponent("Button").enabled = true
@ -225,7 +227,7 @@ function this.ShowDayData(_curDayIndex)
btnJump:GetComponent("Button").enabled = true btnJump:GetComponent("Button").enabled = true
buyInfo.text = string.format("%s/%s",progress,curDayAllTaskConFigData[i].TaskValue[2][1]) buyInfo.text = string.format("%s/%s",progress,curDayAllTaskConFigData[i].TaskValue[2][1])
Util.AddOnceClick(btnJump, function() Util.AddOnceClick(btnJump, function()
if curDayAllTaskConFigData[i].SystemId == FUNCTION_OPEN_TYPE.EXPEDITION then if curDayAllTaskConFigData[i].SystemId == FUNCTION_OPEN_TYPE.EXPEDITION then--大闹天宫点击前往做特殊判断 也许是之前的跳转接口写的不合理 之后优化
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.EXPEDITION) then if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.EXPEDITION) then
if #ExpeditionManager.nodeInfo <= 0 then if #ExpeditionManager.nodeInfo <= 0 then
if ExpeditionManager.expeditionLeve == -1 then if ExpeditionManager.expeditionLeve == -1 then
@ -261,11 +263,12 @@ function this.ShowDayData(_curDayIndex)
btnJump:SetActive(true) btnJump:SetActive(true)
Util.SetGray(btnJump,true) Util.SetGray(btnJump,true)
btnJump:GetComponent("Button").enabled = false btnJump:GetComponent("Button").enabled = false
if curDayAllTaskConFigData[i].TaskType ~= 14 then if curDayAllTaskConFigData[i].TaskType ~= 14 then--除了战力 其他任务当对应功能不开启是要显示开启条件
buyInfo.text = string.format(Language[11903],ConfigManager.GetConfigData(ConfigName.GlobalSystemConfig,curDayAllTaskConFigData[i].SystemId).OpenRules[2]) buyInfo.text = string.format(Language[11903],ConfigManager.GetConfigData(ConfigName.GlobalSystemConfig,curDayAllTaskConFigData[i].SystemId).OpenRules[2])
end end
end end
else--未到天数 else--未到天数
btnJump.transform.anchoredPosition = Vector3.New(262.41,27.2,0)
btnJump:SetActive(true) btnJump:SetActive(true)
Util.SetGray(btnJump,true) Util.SetGray(btnJump,true)
btnJumpText.text = "未开启" btnJumpText.text = "未开启"
@ -276,7 +279,7 @@ function this.ShowDayData(_curDayIndex)
curDayAllTaskGos[i]:SetActive(false) curDayAllTaskGos[i]:SetActive(false)
end end
end end
this.ShowDayDataActivityReward()--位置1 不变 this.ShowDayDataActivityReward()--位置1 不变 因为该方法会对界面上的一些数据赋值
this.ShowDayDataGiftBag()--位置2 不变 this.ShowDayDataGiftBag()--位置2 不变
CheckRedPointStatus(RedPointType.JourneyWithWind) CheckRedPointStatus(RedPointType.JourneyWithWind)
end end
@ -438,7 +441,6 @@ end
--活动到期自动关闭 --活动到期自动关闭
function this.AutoClose() function this.AutoClose()
LogYellow("sssssssssssssssssssssssssss")
if this.timer then if this.timer then
this.timer:Stop() this.timer:Stop()
this.timer = nil this.timer = nil