英雄红点fix
This commit is contained in:
parent
260b6f0c95
commit
e688bfd26d
@ -28,22 +28,23 @@ function HeroCell:init()
|
||||
self.clickCallback()
|
||||
end
|
||||
end)
|
||||
self:bind(DataManager.BagData.ItemData, "dirty", function()
|
||||
self:refreshRedPoint()
|
||||
end)
|
||||
end
|
||||
|
||||
function HeroCell:refresh(heroEntity, isGray)
|
||||
self.heroEntity = heroEntity
|
||||
self:bind(self.heroEntity, "isDirty", function()
|
||||
self:refreshRedPoint()
|
||||
end)
|
||||
|
||||
self.selfNode:setVisible(true)
|
||||
self.otherNode:setVisible(false)
|
||||
|
||||
local heroInfo = heroEntity:getConfig()
|
||||
self:_refresh(heroInfo, isGray)
|
||||
|
||||
if DataManager.EquipData:canUpgradeEquip(self.heroEntity:getCfgId()) then
|
||||
self.selfNode:addRedPoint(55, -35, 0.64)
|
||||
else
|
||||
self.selfNode:removeRedPoint()
|
||||
end
|
||||
|
||||
local canLvUp = heroEntity:canLvUp()
|
||||
self.lvUpArrow:setVisible(canLvUp)
|
||||
if canLvUp then
|
||||
@ -85,6 +86,19 @@ function HeroCell:refresh(heroEntity, isGray)
|
||||
end
|
||||
end
|
||||
end
|
||||
self:refreshRedPoint()
|
||||
end
|
||||
|
||||
-- 刷新红点
|
||||
function HeroCell:refreshRedPoint()
|
||||
if self.heroEntity == nil then
|
||||
return
|
||||
end
|
||||
if DataManager.EquipData:canUpgradeEquip(self.heroEntity:getCfgId()) then
|
||||
self.selfNode:addRedPoint(55, -35, 0.64)
|
||||
else
|
||||
self.selfNode:removeRedPoint()
|
||||
end
|
||||
end
|
||||
|
||||
function HeroCell:getHeroId()
|
||||
|
||||
@ -108,6 +108,7 @@ function ItemData:addItemCost(cost, itemGetType)
|
||||
CACHE_ITEM.id = GFunc.getRewardId(cost)
|
||||
CACHE_ITEM.count = -GFunc.getRewardNum(cost)
|
||||
self:addItem(CACHE_ITEM, itemGetType)
|
||||
self:setDirty()
|
||||
end
|
||||
|
||||
function ItemData:addItemCosts(costs, itemGetType)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user