1、抽卡界面不展示装备升级红点2、英雄未解锁时显示初始数值
This commit is contained in:
parent
4ce2af94e0
commit
1b435f5c4b
@ -99,13 +99,20 @@ function HeroCell:refreshRedPoint()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if DataManager.FormationData:heroInFormation(GConst.BattleConst.FORMATION_TYPE.STAGE, self.heroEntity:getCfgId()) and DataManager.EquipData:canUpgradeEquip(self.heroEntity:getCfgId()) then
|
if not self.notShowRedPoint and
|
||||||
|
DataManager.FormationData:heroInFormation(GConst.BattleConst.FORMATION_TYPE.STAGE, self.heroEntity:getCfgId()) and
|
||||||
|
DataManager.EquipData:canUpgradeEquip(self.heroEntity:getCfgId()) then
|
||||||
self.selfNode:addRedPoint(55, -35, 0.64)
|
self.selfNode:addRedPoint(55, -35, 0.64)
|
||||||
else
|
else
|
||||||
self.selfNode:removeRedPoint()
|
self.selfNode:removeRedPoint()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 设置是否展示红点
|
||||||
|
function HeroCell:setShowRedPoint(show)
|
||||||
|
self.notShowRedPoint = not show
|
||||||
|
end
|
||||||
|
|
||||||
function HeroCell:getHeroId()
|
function HeroCell:getHeroId()
|
||||||
if not self.heroEntity then
|
if not self.heroEntity then
|
||||||
return
|
return
|
||||||
|
|||||||
@ -49,9 +49,17 @@ function AttrCell:showHp()
|
|||||||
|
|
||||||
local value = 0
|
local value = 0
|
||||||
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
||||||
|
if self.heroEntity:isActived() then
|
||||||
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
||||||
|
else
|
||||||
|
value = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv())
|
||||||
|
end
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
||||||
|
if self.heroEntity:isActived() then
|
||||||
value = self.heroEntity:getCfgHp(self.heroEntity:getLv())
|
value = self.heroEntity:getCfgHp(self.heroEntity:getLv())
|
||||||
|
else
|
||||||
|
value = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv())
|
||||||
|
end
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
||||||
value = self.weaponEntity:getHp()
|
value = self.weaponEntity:getHp()
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
||||||
@ -72,9 +80,17 @@ function AttrCell:showAtk()
|
|||||||
|
|
||||||
local value = 0
|
local value = 0
|
||||||
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
||||||
|
if self.heroEntity:isActived() then
|
||||||
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
||||||
|
else
|
||||||
|
value = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv())
|
||||||
|
end
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
||||||
|
if self.heroEntity:isActived() then
|
||||||
value = self.heroEntity:getCfgAtk(self.heroEntity:getLv())
|
value = self.heroEntity:getCfgAtk(self.heroEntity:getLv())
|
||||||
|
else
|
||||||
|
value = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv())
|
||||||
|
end
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
||||||
value = self.weaponEntity:getAttack()
|
value = self.weaponEntity:getAttack()
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
||||||
|
|||||||
@ -163,8 +163,8 @@ function HeroInfoComp:refresh(checkLevel)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
str = I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_5)
|
str = I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_5)
|
||||||
hpStr = self.heroEntity:getHp(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
hpStr = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
||||||
atkStr = self.heroEntity:getAtk(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
atkStr = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
||||||
end
|
end
|
||||||
self.txUpdesc:setText(str)
|
self.txUpdesc:setText(str)
|
||||||
self.txUpNum:setText(materials[2])
|
self.txUpNum:setText(materials[2])
|
||||||
|
|||||||
@ -15,6 +15,7 @@ function BoxHeroCell:refresh(data)
|
|||||||
self.data = data
|
self.data = data
|
||||||
local id = data.id
|
local id = data.id
|
||||||
local num = data.count
|
local num = data.count
|
||||||
|
self.heroCell:setShowRedPoint(false)
|
||||||
|
|
||||||
local heroEntity = DataManager.HeroData:getHeroById(id)
|
local heroEntity = DataManager.HeroData:getHeroById(id)
|
||||||
if heroEntity then
|
if heroEntity then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user