diff --git a/Assets/ManagedResources/Prefabs/UI/Fight/FightPointPassMainPanel.prefab b/Assets/ManagedResources/Prefabs/UI/Fight/FightPointPassMainPanel.prefab index 45437cfd6a..97a7930447 100644 --- a/Assets/ManagedResources/Prefabs/UI/Fight/FightPointPassMainPanel.prefab +++ b/Assets/ManagedResources/Prefabs/UI/Fight/FightPointPassMainPanel.prefab @@ -21123,7 +21123,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &2039730614 RectTransform: m_ObjectHideFlags: 0 @@ -43285,7 +43285,7 @@ MonoBehaviour: Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3} - m_FontSize: 34 + m_FontSize: 32 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 3 @@ -43294,8 +43294,8 @@ MonoBehaviour: m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 0.9 m_Text: "10\u7EA7\u89E3\u9501" LanguageIndex: 10529 --- !u!1 &1291161524729645949 @@ -184886,7 +184886,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 50, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &109213283015355470 diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua index c0895ef16c..e6cb11e809 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua @@ -543,7 +543,11 @@ function this.RefreshBossInfo() this.fightRP:SetActive(false) this.fightSaoGuang:SetActive(false) --this.fightGuideEffect:SetActive(false) - this.lockText.text=string.format("再推%s关后开启",nextBossLv-FightPointPassManager.soldierLayerId) + --this.lockText.text=string.format("再推%s关后开启",nextBossLv-FightPointPassManager.soldierLayerId) + local isOk, tip, btnTxt, lockState = FightPointPassManager.CheckFightOpenRule(nextLv) + LogError("tip======================="..tip) + LogError("btntxt============================="..btnTxt) + this.lockText.text=tip end this.openFun:SetActive(true) this.openFunNeedInfo.text=name @@ -554,8 +558,9 @@ end function this.GetLevelInfo(_id) --LogError("_id==========================".._id) local aa=fightLevelConfig[_id] - if aa and aa.OpenRule and (aa.OpenRule[1][1]==9 or aa.OpenRule[1][1]==0 ) then - if FightPointPassManager.soldierLayerId>=aa.OpenRule[1][2] then + if aa and aa.OpenRule then + local isOk, tip, btnTxt, lockState = FightPointPassManager.CheckFightOpenRule(_id) + if isOk then if name=="" then name=aa.Name nextLv=aa.NextLevel @@ -569,6 +574,11 @@ function this.GetLevelInfo(_id) end end + + + + + --刷新小兵信息 function this.RefreshSoliderInfo() this.RefreshBossInfo() @@ -2044,81 +2054,81 @@ function this.RefreshBattleUpLvTip(isShowUIOpen) local isOk, tip, btnTxt, lockState = FightPointPassManager.CheckFightOpenRule(curFightId) -- 可以挑战显示 挑战关卡快速升级 - if not isShowUIOpen and isOk then - this.battleUpLvTip:SetActive(true) - this.battleUpLvTipImg.enabled = true - this.battleUpLvTipTxt.gameObject:SetActive(true) - this.battleLockGo:SetActive(false) + -- if not isShowUIOpen and isOk then + -- this.battleUpLvTip:SetActive(true) + -- this.battleUpLvTipImg.enabled = true + -- this.battleUpLvTipTxt.gameObject:SetActive(true) + -- this.battleLockGo:SetActive(false) - this.battleUpLvTipTxt.text = Language[10610] - return - end + -- this.battleUpLvTipTxt.text = Language[10610] + -- return + -- end -- 没有解锁条件不显示 - local openRule = fightLevelConfig[curFightId].OpenRule - if not openRule then - return - end + -- local openRule = fightLevelConfig[curFightId].OpenRule + -- if not openRule then + -- return + -- end - -- 没有数据不显示 - if not lockState 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.battleUpLvTip:SetActive(true) - this.battleUpLvTipImg.enabled = false - this.battleUpLvTipTxt.gameObject:SetActive(false) - this.battleLockGo:SetActive(true) - Util.AddOnceClick(this.battleUpLvTip, function() - JumpManager.GoJump(36023) - end) - elseif ruleType == 2 then - -- 心魔试炼 - this.battleUpLvTip:SetActive(true) - this.battleUpLvTipImg.enabled = false - this.battleUpLvTipTxt.gameObject:SetActive(false) - this.battleLockGo:SetActive(true) - Util.AddOnceClick(this.battleUpLvTip, function() - JumpManager.GoJump(1011) - end) - elseif ruleType == 4 then - -- 背包 装备 - this.battleUpLvTip:SetActive(true) - this.battleUpLvTipImg.enabled = false - this.battleUpLvTipTxt.gameObject:SetActive(false) - this.battleLockGo:SetActive(true) - Util.AddOnceClick(this.battleUpLvTip, function() - JumpManager.GoJump(1007) - end) - elseif ruleType == 5 then - -- 好感度 - this.battleUpLvTip:SetActive(true) - this.battleUpLvTipImg.enabled = false - this.battleUpLvTipTxt.gameObject:SetActive(false) - this.battleLockGo:SetActive(true) - Util.AddOnceClick(this.battleUpLvTip, function() - JumpManager.GoJump(40033) - end) - elseif ruleType == 7 then - -- 获取神将 - this.battleUpLvTip:SetActive(true) - this.battleUpLvTipImg.enabled = false - this.battleUpLvTipTxt.gameObject:SetActive(false) - this.battleLockGo:SetActive(true) - Util.AddOnceClick(this.battleUpLvTip, function() - JumpManager.GoJump(22001) - end) - end - end - end - 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.battleUpLvTip:SetActive(true) + -- this.battleUpLvTipImg.enabled = false + -- this.battleUpLvTipTxt.gameObject:SetActive(false) + -- this.battleLockGo:SetActive(true) + -- Util.AddOnceClick(this.battleUpLvTip, function() + -- JumpManager.GoJump(36023) + -- end) + -- elseif ruleType == 2 then + -- -- 心魔试炼 + -- this.battleUpLvTip:SetActive(true) + -- this.battleUpLvTipImg.enabled = false + -- this.battleUpLvTipTxt.gameObject:SetActive(false) + -- this.battleLockGo:SetActive(true) + -- Util.AddOnceClick(this.battleUpLvTip, function() + -- JumpManager.GoJump(1011) + -- end) + -- elseif ruleType == 4 then + -- -- 背包 装备 + -- this.battleUpLvTip:SetActive(true) + -- this.battleUpLvTipImg.enabled = false + -- this.battleUpLvTipTxt.gameObject:SetActive(false) + -- this.battleLockGo:SetActive(true) + -- Util.AddOnceClick(this.battleUpLvTip, function() + -- JumpManager.GoJump(1007) + -- end) + -- elseif ruleType == 5 then + -- -- 好感度 + -- this.battleUpLvTip:SetActive(true) + -- this.battleUpLvTipImg.enabled = false + -- this.battleUpLvTipTxt.gameObject:SetActive(false) + -- this.battleLockGo:SetActive(true) + -- Util.AddOnceClick(this.battleUpLvTip, function() + -- JumpManager.GoJump(40033) + -- end) + -- elseif ruleType == 7 then + -- -- 获取神将 + -- this.battleUpLvTip:SetActive(true) + -- this.battleUpLvTipImg.enabled = false + -- this.battleUpLvTipTxt.gameObject:SetActive(false) + -- this.battleLockGo:SetActive(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 0cc8b2fc39..0c86ec5a42 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua @@ -300,114 +300,126 @@ end -- 检测其他关卡条件 function this.CheckFightOpenRule(fightId) + + if not fightId or not mainLevelConfig[fightId] then + return false, "没有这个关卡" + end + + if PlayerManager.level < mainLevelConfig[this.curOpenFight].LevelLimit then + local tip = tostring(mainLevelConfig[this.curOpenFight].LevelLimit .. Language[10056]) + --LogRed(tip .. " 当前:"..PlayerManager.level) + 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 + states[index] = true + if not rule[1] or rule[1] == 0 then + --LogRed("当前:没有限制条件1") + states[index] = true + elseif rule[1] == 1 then + local star = FightLevelManager.GetAllChapterStars() + if star < rule[2] then + states[index] = false + 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])-- 心魔试炼通关999层 + btnTxts[index] = string.format("心魔试炼通关%s层", 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])-- 鸿蒙阵共鸣%s级 + btnTxts[index] = string.format("鸿蒙阵共鸣%s级", rule[2]) + --LogRed(tips[index]..", 当前:"..lv) + end + elseif rule[1] == 4 then + -- 指定星级(运算星级)装备数量(初始可用) + local num = EquipManager.GetLimitStarEquipNum(rule[2]) + if num < rule[3] then + 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]) -- 总好感度%s级 + btnTxts[index] = string.format("总好感度%s级", rule[2]) + --LogRed(tips[index]..", 当前:"..tlv) + end + elseif rule[1] == 6 then + -- 逍遥游通关次数 + local xyPassTimes = XiaoYaoManager.GetCurPassTimes() + if xyPassTimes < rule[2] then + states[index] = false + tips[index] = string.format("逍遥游通关%s次", rule[2]) + btnTxts[index] = string.format("逍遥游通关%s次", rule[2]) + --LogRed(tips[index]..", 当前:"..xyPassTimes) + end + elseif rule[1] == 7 then + local c_lv = rule[2] + local c_num = rule[3] + local num = #HeroManager.GetAllHeroDatas(c_lv) + if num < c_num then + states[index] = false + 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 + elseif rule[1]==8 then + if PlayerManager.level < rule[2] then + states[index] = false + tips[index] = string.format("玩家等级达到%s级",rule[2])-- %s个%s级神将 + btnTxts[index] = string.format("玩家等级达到%s级",rule[2]) + end + elseif rule[1]==9 then + if FightPointPassManager.soldierLayerId < rule[2] then + states[index] = false + tips[index] = string.format("关卡达到%s关",rule[2])-- %s个%s级神将 + btnTxts[index] = string.format("关卡达到%s关",rule[2]) + end + end + end + local tip = "" + local btnTxt = "" + local isOk = true + for index, state in ipairs(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.."解锁", btnTxt, states + end + --LogRed("当前:没有限制条件2") return true - -- if not fightId or not mainLevelConfig[fightId] then - -- return false, "没有这个关卡" - -- end - - -- if PlayerManager.level < mainLevelConfig[this.curOpenFight].LevelLimit then - -- local tip = tostring(mainLevelConfig[this.curOpenFight].LevelLimit .. Language[10056]) - -- --LogRed(tip .. " 当前:"..PlayerManager.level) - -- 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 - -- states[index] = true - -- if not rule[1] or rule[1] == 0 then - -- --LogRed("当前:没有限制条件1") - -- states[index] = true - -- elseif rule[1] == 1 then - -- local star = FightLevelManager.GetAllChapterStars() - -- if star < rule[2] then - -- states[index] = false - -- 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])-- 心魔试炼通关999层 - -- btnTxts[index] = string.format("心魔试炼通关%s层", 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])-- 鸿蒙阵共鸣%s级 - -- btnTxts[index] = string.format("鸿蒙阵共鸣%s级", rule[2]) - -- --LogRed(tips[index]..", 当前:"..lv) - -- end - -- elseif rule[1] == 4 then - -- -- 指定星级(运算星级)装备数量(初始可用) - -- local num = EquipManager.GetLimitStarEquipNum(rule[2]) - -- if num < rule[3] then - -- 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]) -- 总好感度%s级 - -- btnTxts[index] = string.format("总好感度%s级", rule[2]) - -- --LogRed(tips[index]..", 当前:"..tlv) - -- end - -- elseif rule[1] == 6 then - -- -- 逍遥游通关次数 - -- local xyPassTimes = XiaoYaoManager.GetCurPassTimes() - -- if xyPassTimes < rule[2] then - -- states[index] = false - -- tips[index] = string.format("逍遥游通关%s次", rule[2]) - -- btnTxts[index] = string.format("逍遥游通关%s次", rule[2]) - -- --LogRed(tips[index]..", 当前:"..xyPassTimes) - -- end - -- elseif rule[1] == 7 then - -- local c_lv = rule[2] - -- local c_num = rule[3] - -- local num = #HeroManager.GetAllHeroDatas(c_lv) - -- if num < c_num then - -- states[index] = false - -- 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 ipairs(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.."解锁", btnTxt, states - -- end - -- --LogRed("当前:没有限制条件2") - -- return true end diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelSingleChapterPanel.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelSingleChapterPanel.lua index 31c0deaf43..2af54a8137 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelSingleChapterPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelSingleChapterPanel.lua @@ -151,6 +151,10 @@ function this.OnShowPanel() this.SetSingleLevel(curchapterData) sortingOrder = this.sortingOrder end + if chapterData.reward==nil or LengthOfTable(chapterData.reward)==0 then + local aaa={{id=1,state=0},{id=2,state=0},{id=3,state=0}} + chapterData.reward=aaa + end if chapterData.reward and LengthOfTable(chapterData.reward) > 0 then this.SetlevelBox(chapterData.reward) end