不满足进阶条件,显示红点

dev_chengFeng
jiaoyangna 2020-11-07 16:41:25 +08:00
parent e2b29242c7
commit bc097708e9
3 changed files with 22 additions and 29 deletions

View File

@ -368,6 +368,8 @@ function this:UpdateHeroUpLvAndBreakData()
end
this:UpdateHeroUpLvAndBreakMaterialShow()
local upLvRedpoint = HeroManager.LvUpBtnRedPoint(curHeroData)
this.upLvBtnRedPoint:SetActive(upLvRedpoint)
parent:CheckRedPointType(1,upLvRedpoint)
end
function RoleInfoLayout:OnSortingOrderChange()

View File

@ -10,9 +10,9 @@ local _CurPageIndex = 1
local orginLayer
local tabsList = {}
local tabs = {
[1] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = "情报",rpType = RedPointType.DynamicActTask,
[1] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = "情报",rpType = -1,
},
[2] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = "进阶",rpType = RedPointType.DynamicActTask,
[2] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = "进阶",rpType = -1,
},
[3] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = "传说",rpType = -1,
},
@ -393,9 +393,14 @@ function this:UpdateBtnList()
title.text = v.title
-- 判断是否需要检测红点
redpot:SetActive(false)
if v.rpType > 0 then
this:ClearPageRedpot(k)
this:BindPageRedpot(k, redpot)
if k == 1 then
local upLvRedpoint = HeroManager.LvUpBtnRedPoint(curHeroData)
redpot.gameObject:SetActive(upLvRedpoint)
elseif k == 2 then
local upStarRedPointState = HeroManager.IsShowUpStarRedPoint(curHeroData)
redpot.gameObject:SetActive(upStarRedPointState)
else
redpot.gameObject:SetActive(false)
end
Util.AddOnceClick(tabsList[k],function()
if k == _CurPageIndex then
@ -407,30 +412,16 @@ function this:UpdateBtnList()
end
end
-- 绑定数据
local _PageBindData = {}
function this:BindPageRedpot(page, redpot)
local rpType = tabs[page].rpType
if not rpType then return end
BindRedPointObject(rpType, redpot)
_PageBindData[rpType] = redpot
end
function this:ClearPageRedpot(page)
-- 清除红点绑定
if page then -- 清除某个
local rpType = tabs[page].rpType
if not rpType then return end
ClearRedPointObject(rpType, _PageBindData[rpType])
_PageBindData[rpType] = nil
else -- 全部清除
for rpt, redpot in pairs(_PageBindData) do
ClearRedPointObject(rpt, redpot)
end
_PageBindData = {}
function this:CheckRedPointType(index,isShowRedPoint)
if tabsList[index] then
local redpot = Util.GetGameObject(tabsList[index], "redPoint")
redpot.gameObject:SetActive(isShowRedPoint)
end
end
-- 绑定数据
local _PageBindData = {}
--页签选中效果设置
function this:SetSelectBtn(index)
LogGreen("当前页签:"..index)

View File

@ -250,7 +250,7 @@ function this:UpdateHeroUpStarProUpShow()
if nextUpStarConFig then nextProUpVal = nextUpStarConFig.PropertiesDisplay end
--this.proUpVal.text = GetPropertyFormatStr(2, nextProUpVal)
--this.UpdateHeroUpStarProUpSkillShow(this.skillInfoGrid,self:NextStarUpSkillTabs())
local nextallAddProVal=HeroManager.CalculateHeroAllProValList(2,curHeroData.dynamicId,false,curHeroData.breakId,upStarRankUpConfig.Id)
this:ProShow(this.atkPro_UpStar,allAddProVal,HeroProType.Attack,nextallAddProVal)
this:ProShow(this.hpPro_UpStar,allAddProVal,HeroProType.Hp,nextallAddProVal)
@ -296,8 +296,8 @@ function this:AutoSelectUpStarHeroList(_curUpStarData)
end
--进阶红点
local upStarRedPointState = HeroManager.IsShowUpStarRedPoint(curHeroData)
-- this.roleUpStarRedPoint:SetActive(upStarRedPointState)
-- this.upStarBtnRedPoint:SetActive(upStarRedPointState)
this.upStarBtnRedPoint:SetActive(upStarRedPointState)
parent:CheckRedPointType(2,upStarRedPointState)
end