From a938b217a1ad92988bc4c0e61868bd5c6c99c605 Mon Sep 17 00:00:00 2001 From: zhangqiang <657634622@qq.com> Date: Mon, 5 Jul 2021 10:58:41 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=BC=A5=E7=BC=88=E4=B9=8B=E6=97=85?= =?UTF-8?q?=E3=80=91=E6=8F=90=E4=BA=A47?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActivityGift/ActivityGiftManager.lua | 2 +- .../JourneyWithWind/JourneyWithWindPanel.lua | 28 ++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua index 63b888b0a3..24c26070bc 100644 --- a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua @@ -1350,7 +1350,7 @@ function this.JourneyWithWindCurDayNoOpen() for i = 1, #curJourneyWithWindAllDayConFigData do if curDay >= curJourneyWithWindAllDayConFigData[i].Values[1][2] then local curRedPointState = this.GetJourneyWithWindPlayerPrefs(curJourneyWithWindAllDayConFigData[i].Values[1][2]) - if curRedPointState == 0 then + if tonumber(curRedPointState) == 0 then return true end end diff --git a/Assets/ManagedResources/~Lua/Modules/JourneyWithWind/JourneyWithWindPanel.lua b/Assets/ManagedResources/~Lua/Modules/JourneyWithWind/JourneyWithWindPanel.lua index 5ce9b466f1..fbd3b3e648 100644 --- a/Assets/ManagedResources/~Lua/Modules/JourneyWithWind/JourneyWithWindPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/JourneyWithWind/JourneyWithWindPanel.lua @@ -124,22 +124,23 @@ function this.SingleDayBtnDataShow(_go,data,index) end end end - if not redState then - redState = ActivityGiftManager.GetJourneyWithWindPlayerPrefs(data.Values[1][2]) == 0 + 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) else go.transform.anchoredPosition = Vector3.New(3.05,176.09,0) 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.anchoredPosition = Vector3.New(4.3,9.4,0) + redPoint:SetActive(false) end 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.anchoredPosition = Vector3.New(4.3,9.4,0) end) @@ -164,7 +165,7 @@ function this.ShowDayData(_curDayIndex) end --组当前所有任务的后端数据 local AllTaskData = TaskManager.GetTypeTaskList(TaskTypeDef.JourneyWithWind) - for i = 1, #curDayAllTaskGos-2 do + for i = 1, #curDayAllTaskGos-2 do--curDayAllTaskGos-2 是因为上方任务至多只有五个 其余两个 一个是活动奖励 一个是礼包 if curDayAllTaskConFigData[i] then curDayAllTaskGos[i]: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") headName:GetComponent("Text").text = curDayAllTaskConFigData[i].HeadName 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 headName.transform.sizeDelta = size else @@ -188,7 +189,7 @@ function this.ShowDayData(_curDayIndex) btnFinish:SetActive(false) btnJump:SetActive(false) buyInfo.text = "" - local curMissionData + local curMissionData--获取对应天数的后端活动数据 for j = 1, #AllTaskData do if AllTaskData[j].missionId == curDayAllTaskConFigData[i].Id then curMissionData = AllTaskData[j] @@ -196,7 +197,7 @@ function this.ShowDayData(_curDayIndex) end if curMissionData then 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 isOpen = true else @@ -214,6 +215,7 @@ function this.ShowDayData(_curDayIndex) isOpenLock = curDay >= curDayIndex Util.SetGray(btnJump,false) if isOpenLock then--到天数 + btnJump.transform.anchoredPosition = Vector3.New(262.41,44.5,0) Util.SetGray(btnJump,false) btnJumpText.text = "前往" btnJump:GetComponent("Button").enabled = true @@ -225,7 +227,7 @@ function this.ShowDayData(_curDayIndex) btnJump:GetComponent("Button").enabled = true buyInfo.text = string.format("%s/%s",progress,curDayAllTaskConFigData[i].TaskValue[2][1]) 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 #ExpeditionManager.nodeInfo <= 0 then if ExpeditionManager.expeditionLeve == -1 then @@ -261,11 +263,12 @@ function this.ShowDayData(_curDayIndex) btnJump:SetActive(true) Util.SetGray(btnJump,true) 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]) end end else--未到天数 + btnJump.transform.anchoredPosition = Vector3.New(262.41,27.2,0) btnJump:SetActive(true) Util.SetGray(btnJump,true) btnJumpText.text = "未开启" @@ -276,7 +279,7 @@ function this.ShowDayData(_curDayIndex) curDayAllTaskGos[i]:SetActive(false) end end - this.ShowDayDataActivityReward()--位置1 不变 + this.ShowDayDataActivityReward()--位置1 不变 因为该方法会对界面上的一些数据赋值 this.ShowDayDataGiftBag()--位置2 不变 CheckRedPointStatus(RedPointType.JourneyWithWind) end @@ -438,7 +441,6 @@ end --活动到期自动关闭 function this.AutoClose() - LogYellow("sssssssssssssssssssssssssss") if this.timer then this.timer:Stop() this.timer = nil