From 5bfb89d2760cb951186964740e8e23382e46e959 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Mon, 27 Dec 2021 13:11:33 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=85=B3=E5=8D=A1=E6=8C=82=E6=9C=BA?= =?UTF-8?q?=E3=80=91=E6=9C=AA=E8=A7=A3=E9=94=81=E8=B7=B3=E8=BD=AC=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Fight/FightPointPassMainPanel.lua | 74 ++++++++++++++++++- .../Modules/Fight/FightPointPassManager.lua | 5 +- 2 files changed, 73 insertions(+), 6 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua index 07bd0c1f32..32912d0bf7 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua @@ -231,7 +231,7 @@ function FightPointPassMainPanel:InitComponent() this.OpenSeverWelfareInfoText = Util.GetGameObject(this.OpenSeverWelfare, "info"):GetComponent("Text") this.OpenSeverWelfareRed = Util.GetGameObject(this.OpenSeverWelfare, "redpot") this.battleUpLvTip = Util.GetGameObject(self.gameObject, "Bg/btnDown/battleUpLvTip") - Util.GetGameObject(self.gameObject, "Bg/btnDown/battleUpLvTip/Text"):GetComponent("Text").text = Language[10610] + this.battleUpLvTipTxt = Util.GetGameObject(self.gameObject, "Bg/btnDown/battleUpLvTip/Text"):GetComponent("Text") --山河社稷图 this.btnFightLevel = Util.GetGameObject(self.gameObject, "Bg/LeftUp/box/btnFightLevel") this.btnFightLevel:SetActive(false) @@ -486,7 +486,6 @@ function FightPointPassMainPanel:OnShow() this.UpdateOpenSeverWelfare() PlayerManager.StarBattleUpLvTipTime(2) - this.battleUpLvTip:SetActive(false) Util.GetGameObject(this.btnXiaoYao,"curValue/num"):GetComponent("Text").text=string.format("%d/%d",BagManager.GetItemCountById(UpViewRechargeType.YunYouVle),PrivilegeManager.GetPrivilegeNumber(39)) -- 刷新一次编队战斗力 @@ -497,6 +496,9 @@ function FightPointPassMainPanel:OnShow() this.refreshVipTask() -- 刷新解锁信息显示 this.RefreshOpenTips() + -- + this.battleUpLvTip:SetActive(false) + this.RefreshBattleUpLvTip(true) end @@ -1042,8 +1044,72 @@ function this.RemainTimeDown(_timeTextExpertgo,_timeTextExpert,timeDown) end end end -function this.RefreshBattleUpLvTip() - this.battleUpLvTip:SetActive(true) +function this.RefreshBattleUpLvTip(isShowUIOpen) + -- + Util.AddOnceClick(this.battleUpLvTip, function() end) + this.battleUpLvTip:GetComponent("Image").raycastTarget = false + -- 么解锁章节不显示 + if not FightPointPassManager.IsChapterClossState() then + return + end + + -- 判断状态 + local curFightId = FightPointPassManager.GetCurFightId() + local isOk, tip, btnTxt, lockState = FightPointPassManager.CheckFightOpenRule(curFightId) + + -- 可以挑战显示 挑战关卡快速升级 + if not isShowUIOpen and isOk then + this.battleUpLvTipTxt.text = Language[10610] + this.battleUpLvTip:SetActive(true) + return + end + + -- 没有解锁条件不显示 + local openRule = fightLevelConfig[curFightId].OpenRule + if not openRule then + return + end + + -- 没有数据不显示 + if not lockState then + return + end + + -- + for index, state in ipairs(lockState) do + if not state and openRule[index] then + local ruleType = openRule[index][1] + if ruleType then + if ruleType == 1 then + -- 山河社稷图 + this.battleUpLvTipTxt.text = "立即前往>>" + this.battleUpLvTip:SetActive(true) + this.battleUpLvTip:GetComponent("Image").raycastTarget = true + Util.AddOnceClick(this.battleUpLvTip, function() + JumpManager.GoJump(36023) + end) + elseif ruleType == 2 then + -- 心魔试炼 + this.battleUpLvTipTxt.text = "立即前往>>" + this.battleUpLvTip:SetActive(true) + this.battleUpLvTip:GetComponent("Image").raycastTarget = true + Util.AddOnceClick(this.battleUpLvTip, function() + JumpManager.GoJump(1011) + end) + elseif ruleType == 4 then + -- 获取神将 + this.battleUpLvTipTxt.text = "立即前往>>" + this.battleUpLvTip:SetActive(true) + this.battleUpLvTip:GetComponent("Image").raycastTarget = true + Util.AddOnceClick(this.battleUpLvTip, function() + JumpManager.GoJump(22001) + end) + end + end + + end + end + end function this.UpdateWordLv() diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua index e3ea95dd66..89f285af26 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua @@ -305,6 +305,7 @@ function this.CheckFightOpenRule(fightId) local tips = {} local btnTxts = {} for index, rule in ipairs(openRule) do + states[index] = true if not rule[1] or rule[1] == 0 then LogRed("当前:没有限制条件1") states[index] = true @@ -374,7 +375,7 @@ function this.CheckFightOpenRule(fightId) local tip = "" local btnTxt = "" local isOk = true - for index, state in pairs(states) do + for index, state in ipairs(states) do if not state then isOk = false -- 提示文字 @@ -391,7 +392,7 @@ function this.CheckFightOpenRule(fightId) end end end - return isOk, tip.."解锁", btnTxt + return isOk, tip.."解锁", btnTxt, states end LogRed("当前:没有限制条件2") return true