From f0d9f4828f32c822e69affd0ce2f43a0f2087d81 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Sun, 26 Dec 2021 18:13:39 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=85=B3=E5=8D=A1=E6=96=B0=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E3=80=91=E6=9D=A1=E4=BB=B6=E6=98=BE=E7=A4=BA=E5=9C=A8?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Fight/FightPointPassManager.lua | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua index 764941c52b..0e1ab20330 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua @@ -295,13 +295,14 @@ function this.CheckFightOpenRule(fightId) if PlayerManager.level < mainLevelConfig[this.curOpenFight].LevelLimit then local tip = tostring(mainLevelConfig[this.curOpenFight].LevelLimit .. Language[10056]) LogRed(tip .. " 当前:"..PlayerManager.level) - return false, tip + return false, tip, tip end local openRule = mainLevelConfig[fightId].OpenRule if openRule then local states = {} local tips = {} + local btnTxts = {} for index, rule in ipairs(openRule) do if not rule[1] or rule[1] == 0 then LogRed("当前:没有限制条件1") @@ -310,21 +311,24 @@ function this.CheckFightOpenRule(fightId) local star = FightLevelManager.GetAllChapterStars() if star < rule[2] then states[index] = false - tips[index] = string.format("山河社稷图星数达%s", rule[2]) + tips[index] = string.format("山河社稷图星数达%s", rule[2])-- 山河社稷图%s星 + btnTxts[index] = string.format("山河社稷图%s星", rule[2]) LogRed(tips[index]..", 当前:"..star) end elseif rule[1] == 2 then local wave = MonsterCampManager.GetMonsterCampCurWave() if wave <= rule[2] then states[index] = false - tips[index] = string.format("心魔试炼通关%s层", rule[2]) + tips[index] = string.format("心魔试炼通关%s层", rule[2])-- 心魔试炼通关999层 + btnTxts[index] = string.format("心魔试炼通关999层", rule[2]) LogRed(tips[index]..", 当前:"..wave) end elseif rule[1] == 3 then local lv = HarmonyManager.GetSingleAdditions(HarmonyAddType.AddLv) if lv < rule[2] then states[index] = false - tips[index] = string.format("鸿蒙阵共鸣等级达%s", rule[2]) + tips[index] = string.format("鸿蒙阵共鸣等级达%s", rule[2])-- 鸿蒙阵共鸣%s级 + btnTxts[index] = string.format("鸿蒙阵共鸣%s级", rule[2]) LogRed(tips[index]..", 当前:"..lv) end elseif rule[1] == 4 then @@ -334,13 +338,15 @@ function this.CheckFightOpenRule(fightId) local equipStarConfig = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig, rule[2]) states[index] = false tips[index] = string.format("拥有%s个%s%s星装备", rule[3], QualityNameDef[equipStarConfig.Quality], equipStarConfig.Stars) + btnTxts[index] = string.format("%s个%s%s星装备", rule[3], QualityNameDef[equipStarConfig.Quality], equipStarConfig.Stars) LogRed(tips[index]..", 当前:"..num) end elseif rule[1] == 5 then local _, tlv, _ = LikabilityManager.GetTotalHeroLikeLv(-1) if tlv < rule[2] then states[index] = false - tips[index] = string.format("神将总好感度等级达%s", rule[2]) + tips[index] = string.format("神将总好感度等级达%s", rule[2]) -- 总好感度%s级 + btnTxts[index] = string.format("总好感度%s级", rule[2]) LogRed(tips[index]..", 当前:"..tlv) end elseif rule[1] == 6 then @@ -348,7 +354,8 @@ function this.CheckFightOpenRule(fightId) local xyPassTimes = XiaoYaoManager.GetCurPassTimes() if xyPassTimes < rule[2] then states[index] = false - tips[index] = string.format("通关逍遥游%s次", rule[2]) + tips[index] = string.format("逍遥游通关%s次", rule[2]) + btnTxts[index] = string.format("逍遥游通关%s次", rule[2]) LogRed(tips[index]..", 当前:"..xyPassTimes) end elseif rule[1] == 7 then @@ -357,24 +364,33 @@ function this.CheckFightOpenRule(fightId) local num = #HeroManager.GetAllHeroDatas(c_lv) if num < c_num then states[index] = false - tips[index] = string.format("拥有%s个等级%s以上的神将", c_num, c_lv) + tips[index] = string.format("拥有%s个等级%s以上的神将", c_num, c_lv)-- %s个%s级神将 + btnTxts[index] = string.format("%s个%s级神将", c_num, c_lv) LogRed(tips[index]..", 当前:"..num) end end end local tip = "" + local btnTxt = "" local isOk = true for index, state in pairs(states) do if not state then isOk = false + -- 提示文字 if tip ~= "" then tip = tip..string.format(",且%s", tips[index]) else tip = tips[index] end + -- 按钮显示文字 + if btnTxt ~= "" then + btnTxt = tip..string.format(",且%s", btnTxts[index]) + else + btnTxt = btnTxts[index] + end end end - return isOk, tip.."解锁" + return isOk, tip.."解锁", btnTxt end LogRed("当前:没有限制条件2") return true @@ -396,8 +412,9 @@ function this.GetBtnText() return limitLevel .. Language[10056] end -- - if not this.CheckFightOpenRule(this.curOpenFight) then - return "条件未达成" + local isOk, tip, btnTxt= this.CheckFightOpenRule(this.curOpenFight) + if not isOk then + return btnTxt end local offset = 1