hero
This commit is contained in:
parent
10575642e1
commit
e0cc3842a6
@ -49,23 +49,6 @@ HeroConst.ATTR_SHOW_BASE = {
|
|||||||
GConst.MATCH_HP_NAME, -- 生命
|
GConst.MATCH_HP_NAME, -- 生命
|
||||||
GConst.MATCH_ATTACK_NAME, -- 攻击
|
GConst.MATCH_ATTACK_NAME, -- 攻击
|
||||||
}
|
}
|
||||||
-- 武器
|
|
||||||
HeroConst.ATTR_SHOW_WEAPON = {
|
|
||||||
GConst.MATCH_HP_NAME, -- 生命
|
|
||||||
GConst.MATCH_ATTACK_NAME, -- 攻击
|
|
||||||
GConst.MATCH_CRIT_NAME, -- 暴击率百分比
|
|
||||||
GConst.MATCH_CRIT_TIME_NAME, -- 暴击伤害百分比
|
|
||||||
GConst.MATCH_CURED_NAME, -- 治疗效果提升百分比
|
|
||||||
}
|
|
||||||
-- 防具
|
|
||||||
HeroConst.ATTR_SHOW_ARMOR = {
|
|
||||||
GConst.MATCH_HP_NAME, -- 生命
|
|
||||||
GConst.MATCH_ATTACK_NAME, -- 攻击
|
|
||||||
GConst.MATCH_NORMAL_HURT_NAME, -- 普攻增伤
|
|
||||||
GConst.MATCH_SKILL_HURT_NAME, -- 技能增伤
|
|
||||||
GConst.MATCH_NORMAL_HURTP_NAME, -- 普攻增伤百分比
|
|
||||||
GConst.MATCH_SKILL_HURTP_NAME, -- 技能增伤百分比
|
|
||||||
}
|
|
||||||
-- 皮肤
|
-- 皮肤
|
||||||
HeroConst.ATTR_SHOW_SKIN = {
|
HeroConst.ATTR_SHOW_SKIN = {
|
||||||
GConst.MATCH_HP_FIX_NAME, -- 生命
|
GConst.MATCH_HP_FIX_NAME, -- 生命
|
||||||
@ -78,26 +61,11 @@ HeroConst.ATTR_SHOW_SKIN = {
|
|||||||
GConst.MATCH_SKILL_HURTP_NAME, -- 技能增伤百分比
|
GConst.MATCH_SKILL_HURTP_NAME, -- 技能增伤百分比
|
||||||
GConst.MATCH_CURED_NAME, -- 治疗效果提升百分比
|
GConst.MATCH_CURED_NAME, -- 治疗效果提升百分比
|
||||||
}
|
}
|
||||||
-- 符文
|
|
||||||
HeroConst.ATTR_SHOW_RUNES = {
|
|
||||||
GConst.MATCH_HP_FIX_NAME, -- 生命
|
|
||||||
GConst.MATCH_ATTACK_NAME, -- 攻击
|
|
||||||
GConst.MATCH_NORMAL_HURT_NAME, -- 普攻增伤
|
|
||||||
GConst.MATCH_SKILL_HURT_NAME, -- 技能增伤
|
|
||||||
GConst.MATCH_CRIT_NAME, -- 暴击率百分比
|
|
||||||
GConst.MATCH_CRIT_TIME_NAME, -- 暴击伤害百分比
|
|
||||||
GConst.MATCH_NORMAL_HURTP_NAME, -- 普攻增伤百分比
|
|
||||||
GConst.MATCH_SKILL_HURTP_NAME, -- 技能增伤百分比
|
|
||||||
GConst.MATCH_CURED_NAME, -- 治疗效果提升百分比
|
|
||||||
}
|
|
||||||
|
|
||||||
-- 需要显示属性的模块
|
-- 需要显示属性的模块
|
||||||
HeroConst.SHOW_NODE = {
|
HeroConst.SHOW_NODE = {
|
||||||
HeroConst.ATTR_SHOW_TOTAL,
|
HeroConst.ATTR_SHOW_TOTAL,
|
||||||
HeroConst.ATTR_SHOW_BASE,
|
HeroConst.ATTR_SHOW_BASE,
|
||||||
HeroConst.ATTR_SHOW_WEAPON,
|
|
||||||
HeroConst.ATTR_SHOW_ARMOR,
|
|
||||||
HeroConst.ATTR_SHOW_RUNES,
|
|
||||||
HeroConst.ATTR_SHOW_SKIN,
|
HeroConst.ATTR_SHOW_SKIN,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -149,6 +149,10 @@ function RewardCell:_refreshItem(info, count)
|
|||||||
self:showLight(false)
|
self:showLight(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function RewardCell:setIconSprite(atlas, res)
|
||||||
|
self.icon:setSprite(atlas, res)
|
||||||
|
end
|
||||||
|
|
||||||
function RewardCell:setNumTx(str)
|
function RewardCell:setNumTx(str)
|
||||||
self.numTx:setText(str)
|
self.numTx:setText(str)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -10,13 +10,6 @@ end
|
|||||||
|
|
||||||
function AttrCell:refresh(heroEntity, nodeType, attrType)
|
function AttrCell:refresh(heroEntity, nodeType, attrType)
|
||||||
self.heroEntity = heroEntity
|
self.heroEntity = heroEntity
|
||||||
self.runesEntity = self.heroEntity:getRunes()
|
|
||||||
self.weaponEntity = self.heroEntity:getEquips(GConst.EquipConst.PART_TYPE.WEAPON)
|
|
||||||
self.hatEntity = self.heroEntity:getEquips(GConst.EquipConst.PART_TYPE.HAT)
|
|
||||||
self.clothesEntity = self.heroEntity:getEquips(GConst.EquipConst.PART_TYPE.CLOTHES)
|
|
||||||
self.beltEntity = self.heroEntity:getEquips(GConst.EquipConst.PART_TYPE.BELT)
|
|
||||||
self.handguardEntity = self.heroEntity:getEquips(GConst.EquipConst.PART_TYPE.HANDGUARD)
|
|
||||||
|
|
||||||
self.nodeType = nodeType
|
self.nodeType = nodeType
|
||||||
self.attrName = attrType[self.heroEntity:getMatchType()]
|
self.attrName = attrType[self.heroEntity:getMatchType()]
|
||||||
|
|
||||||
@ -59,17 +52,8 @@ function AttrCell:showHp()
|
|||||||
else
|
else
|
||||||
value = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv())
|
value = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv())
|
||||||
end
|
end
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
|
||||||
value = (self.weaponEntity and self.weaponEntity:getHp() or 0)
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
|
||||||
value = value + (self.hatEntity and self.hatEntity:getHp() or 0)
|
|
||||||
value = value + (self.clothesEntity and self.clothesEntity:getHp() or 0)
|
|
||||||
value = value + (self.beltEntity and self.beltEntity:getHp() or 0)
|
|
||||||
value = value + (self.handguardEntity and self.handguardEntity:getHp() or 0)
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
||||||
value = value + DataManager.SkinData:getHp(self.heroEntity)
|
value = value + DataManager.SkinData:getHp(self.heroEntity)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
|
|
||||||
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
||||||
@ -93,17 +77,8 @@ function AttrCell:showAtk()
|
|||||||
else
|
else
|
||||||
value = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv())
|
value = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv())
|
||||||
end
|
end
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
|
||||||
value = (self.weaponEntity and self.weaponEntity:getAttack() or 0)
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
|
||||||
value = value + (self.hatEntity and self.hatEntity:getAttack() or 0)
|
|
||||||
value = value + (self.clothesEntity and self.clothesEntity:getAttack() or 0)
|
|
||||||
value = value + (self.beltEntity and self.beltEntity:getAttack() or 0)
|
|
||||||
value = value + (self.handguardEntity and self.handguardEntity:getAttack() or 0)
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
||||||
value = value + DataManager.SkinData:getAttack(self.heroEntity)
|
value = value + DataManager.SkinData:getAttack(self.heroEntity)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
|
|
||||||
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
||||||
@ -118,16 +93,8 @@ function AttrCell:showNormalHurt()
|
|||||||
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
||||||
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
|
||||||
value = value + (self.hatEntity and self.hatEntity:getNormalHurt() or 0)
|
|
||||||
value = value + (self.clothesEntity and self.clothesEntity:getNormalHurt() or 0)
|
|
||||||
value = value + (self.beltEntity and self.beltEntity:getNormalHurt() or 0)
|
|
||||||
value = value + (self.handguardEntity and self.handguardEntity:getNormalHurt() or 0)
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
||||||
value = value + DataManager.SkinData:getNormalHurt(self.heroEntity)
|
value = value + DataManager.SkinData:getNormalHurt(self.heroEntity)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
|
|
||||||
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
||||||
@ -142,16 +109,8 @@ function AttrCell:showSkillHurt()
|
|||||||
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
||||||
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
|
||||||
value = value + (self.hatEntity and self.hatEntity:getSkillHurt() or 0)
|
|
||||||
value = value + (self.clothesEntity and self.clothesEntity:getSkillHurt() or 0)
|
|
||||||
value = value + (self.beltEntity and self.beltEntity:getSkillHurt() or 0)
|
|
||||||
value = value + (self.handguardEntity and self.handguardEntity:getSkillHurt() or 0)
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
||||||
value = value + DataManager.SkinData:getSkillHurt(self.heroEntity)
|
value = value + DataManager.SkinData:getSkillHurt(self.heroEntity)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
|
|
||||||
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
||||||
@ -166,13 +125,8 @@ function AttrCell:showCrit()
|
|||||||
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
||||||
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
|
||||||
value = (self.weaponEntity and self.weaponEntity:getCritPercent() or 0)
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
||||||
value = value + DataManager.SkinData:getCritPercent(self.heroEntity)
|
value = value + DataManager.SkinData:getCritPercent(self.heroEntity)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
|
|
||||||
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
||||||
@ -187,13 +141,8 @@ function AttrCell:showCritAtk()
|
|||||||
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
||||||
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
|
||||||
value = (self.weaponEntity and self.weaponEntity:getCritHurtPercent() or 0)
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
||||||
value = value + DataManager.SkinData:getCritHurtPercent(self.heroEntity)
|
value = value + DataManager.SkinData:getCritHurtPercent(self.heroEntity)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
|
|
||||||
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
||||||
@ -210,14 +159,8 @@ function AttrCell:showNormalHurtp()
|
|||||||
-- 特殊处理:显示总属性时,普攻百分比和技能百分比把所有伤害百分比加上
|
-- 特殊处理:显示总属性时,普攻百分比和技能百分比把所有伤害百分比加上
|
||||||
value = value + self.heroEntity:getTotalAttrValue(GConst.MATCH_ALL_HURTP_NAME[self.heroEntity:getMatchType()])
|
value = value + self.heroEntity:getTotalAttrValue(GConst.MATCH_ALL_HURTP_NAME[self.heroEntity:getMatchType()])
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
|
||||||
-- 套装属性,防具只用计算一次
|
|
||||||
value = value + (self.hatEntity and self.hatEntity:getNormalHurtPercent() or 0)
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
||||||
value = value + DataManager.SkinData:getNormalHurtPercent(self.heroEntity)
|
value = value + DataManager.SkinData:getNormalHurtPercent(self.heroEntity)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
|
|
||||||
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
||||||
@ -234,14 +177,8 @@ function AttrCell:showSkillHurtp()
|
|||||||
-- 特殊处理:显示总属性时,普攻百分比和技能百分比把所有伤害百分比加上
|
-- 特殊处理:显示总属性时,普攻百分比和技能百分比把所有伤害百分比加上
|
||||||
value = value + self.heroEntity:getTotalAttrValue(GConst.MATCH_ALL_HURTP_NAME[self.heroEntity:getMatchType()])
|
value = value + self.heroEntity:getTotalAttrValue(GConst.MATCH_ALL_HURTP_NAME[self.heroEntity:getMatchType()])
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
|
||||||
-- 套装属性,防具只用计算一次
|
|
||||||
value = value + (self.hatEntity and self.hatEntity:getSkillHurtPercent() or 0)
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
||||||
value = value + DataManager.SkinData:getSkillHurtPercent(self.heroEntity)
|
value = value + DataManager.SkinData:getSkillHurtPercent(self.heroEntity)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
|
|
||||||
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
||||||
@ -256,13 +193,8 @@ function AttrCell:showCured()
|
|||||||
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then
|
||||||
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
value = self.heroEntity:getTotalAttrValue(self.attrName)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
|
||||||
value = (self.weaponEntity and self.weaponEntity:getHealPercent() or 0)
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_SKIN then
|
||||||
value = value + DataManager.SkinData:getHealPercent(self.heroEntity)
|
value = value + DataManager.SkinData:getHealPercent(self.heroEntity)
|
||||||
elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_RUNES then
|
|
||||||
value = value + (self.runesEntity and self.runesEntity:getAttrValue(self.attrName) or 0)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
self.txValue:setText(GFunc.getAttrShowValue(self.attrName, value))
|
||||||
|
|||||||
@ -14,14 +14,8 @@ function AttrNodeCell:refresh(heroEntity, node)
|
|||||||
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_13))
|
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_13))
|
||||||
elseif node == GConst.HeroConst.ATTR_SHOW_BASE then
|
elseif node == GConst.HeroConst.ATTR_SHOW_BASE then
|
||||||
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_14))
|
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_14))
|
||||||
elseif node == GConst.HeroConst.ATTR_SHOW_WEAPON then
|
|
||||||
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_15))
|
|
||||||
elseif node == GConst.HeroConst.ATTR_SHOW_ARMOR then
|
|
||||||
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_16))
|
|
||||||
elseif node == GConst.HeroConst.ATTR_SHOW_SKIN then
|
elseif node == GConst.HeroConst.ATTR_SHOW_SKIN then
|
||||||
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_17))
|
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_17))
|
||||||
elseif node == GConst.HeroConst.ATTR_SHOW_RUNES then
|
|
||||||
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.RUNES_DESC_22))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.attrCount = 0
|
self.attrCount = 0
|
||||||
@ -40,10 +34,6 @@ function AttrNodeCell:isShowAttr(heroEntity, node, attr)
|
|||||||
if node == GConst.HeroConst.ATTR_SHOW_SKIN then
|
if node == GConst.HeroConst.ATTR_SHOW_SKIN then
|
||||||
return DataManager.SkinData:hasAttr(heroEntity, attr[heroEntity:getMatchType()])
|
return DataManager.SkinData:hasAttr(heroEntity, attr[heroEntity:getMatchType()])
|
||||||
end
|
end
|
||||||
if node == GConst.HeroConst.ATTR_SHOW_RUNES then
|
|
||||||
local runesEntity = heroEntity:getRunes()
|
|
||||||
return runesEntity and runesEntity:hasAttr(attr[heroEntity:getMatchType()]) or false
|
|
||||||
end
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|||||||
@ -65,11 +65,6 @@ function HeroAttrUI:isShowAttr(node)
|
|||||||
if node == GConst.HeroConst.ATTR_SHOW_SKIN then
|
if node == GConst.HeroConst.ATTR_SHOW_SKIN then
|
||||||
return #DataManager.SkinData:getOwnAllAttr(self.heroEntity) > 0
|
return #DataManager.SkinData:getOwnAllAttr(self.heroEntity) > 0
|
||||||
end
|
end
|
||||||
if node == GConst.HeroConst.ATTR_SHOW_RUNES then
|
|
||||||
local runesEntity = self.heroEntity:getRunes()
|
|
||||||
return runesEntity and runesEntity:getAllAttr() and #runesEntity:getAllAttr() > 0 or false
|
|
||||||
end
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -58,10 +58,14 @@ function HeroDetailUI:onLoadRootComplete()
|
|||||||
|
|
||||||
self.txHero1:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4))
|
self.txHero1:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4))
|
||||||
self.txHero2:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4))
|
self.txHero2:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4))
|
||||||
self.txStar1:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_1))
|
-- self.txStar1:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_1))
|
||||||
self.txStar2:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_1))
|
-- self.txStar2:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_1))
|
||||||
self.txSkin1:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_2))
|
-- self.txSkin1:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_2))
|
||||||
self.txSkin2:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_2))
|
-- self.txSkin2:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_2))
|
||||||
|
self.txStar1:setText("升星")
|
||||||
|
self.txStar2:setText("升星")
|
||||||
|
self.txSkin1:setText(I18N:getGlobalText(I18N.GlobalConst.SKIN))
|
||||||
|
self.txSkin2:setText(I18N:getGlobalText(I18N.GlobalConst.SKIN))
|
||||||
if not DataManager.HeroData:isStarOpen() then
|
if not DataManager.HeroData:isStarOpen() then
|
||||||
self.lockStar:setVisible(true)
|
self.lockStar:setVisible(true)
|
||||||
GFunc.centerImgAndTx(self.lockStar, self.txStar1, 5)
|
GFunc.centerImgAndTx(self.lockStar, self.txStar1, 5)
|
||||||
|
|||||||
@ -8,53 +8,53 @@ local SIZE_DELTA_Y_LOOK = 802
|
|||||||
function HeroInfoComp:init()
|
function HeroInfoComp:init()
|
||||||
local uiMap = self:getUIMap()
|
local uiMap = self:getUIMap()
|
||||||
|
|
||||||
self.slider = uiMap["hero_detail_ui.bg.fragment_bg.slider"]
|
self.slider = uiMap["hero_info.fragment_bg.slider"]
|
||||||
self.imgElement = uiMap["hero_detail_ui.bg.hero_element"]
|
self.imgElement = uiMap["hero_info.hero_element"]
|
||||||
self.imgSkill = uiMap["hero_detail_ui.bg.skill_node.skill_icon"]
|
self.imgSkill = uiMap["hero_info.skill_node.skill_icon"]
|
||||||
self.imgFragment = uiMap["hero_detail_ui.bg.fragment_bg.fragment_icon"]
|
self.imgFragment = uiMap["hero_info.fragment_bg.fragment_icon"]
|
||||||
self.btnUp = uiMap["hero_detail_ui.bg.up_btn"]
|
self.btnUp = uiMap["hero_info.up.up_btn"]
|
||||||
self.imgUpIcon = uiMap["hero_detail_ui.bg.up_btn.icon"]
|
self.txUpdesc = uiMap["hero_info.up.up_btn.text"]
|
||||||
self.txUpdesc = uiMap["hero_detail_ui.bg.up_btn.desc"]
|
self.btnUp5 = uiMap["hero_info.up.up_5_btn"]
|
||||||
self.txUpNum = uiMap["hero_detail_ui.bg.up_btn.num"]
|
self.txUpdesc5 = uiMap["hero_info.up.up_5_btn.text"]
|
||||||
self.txLv = uiMap["hero_detail_ui.bg.lv_desc"]
|
self.txLv = uiMap["hero_info.lv_desc"]
|
||||||
self.txElement = uiMap["hero_detail_ui.bg.element_desc"]
|
self.txElement = uiMap["hero_info.element_bg.element_desc"]
|
||||||
self.txSkill = uiMap["hero_detail_ui.bg.skill_desc"]
|
self.txSkill = uiMap["hero_info.skill_desc"]
|
||||||
self.btnSkillDesc = uiMap["hero_info.skill_desc.btn_skill_desc"]
|
self.btnSkillDesc = uiMap["hero_info.skill_desc.btn_skill_desc"]
|
||||||
self.txFragmentNum = uiMap["hero_detail_ui.bg.fragment_bg.fragment_num"]
|
self.txFragmentNum = uiMap["hero_info.fragment_bg.fragment_num"]
|
||||||
self.txHpName = uiMap["hero_detail_ui.bg.hp_name"]
|
self.txHpName = uiMap["hero_info.bg_6.hp_name"]
|
||||||
self.txAtkName = uiMap["hero_detail_ui.bg.atk_name"]
|
self.txAtkName = uiMap["hero_info.atk_name"]
|
||||||
self.txHp = uiMap["hero_detail_ui.bg.hp"]
|
self.txHp = uiMap["hero_info.bg_6.hp"]
|
||||||
self.txAtk = uiMap["hero_detail_ui.bg.atk"]
|
self.txAtk = uiMap["hero_info.atk"]
|
||||||
self.bgFragment = uiMap["hero_detail_ui.bg.fragment_bg"]
|
self.bgFragment = uiMap["hero_info.fragment_bg"]
|
||||||
self.spineObjSkill = uiMap["hero_detail_ui.bg.ui_spine_obj_skill"]
|
self.spineObjSkill = uiMap["hero_info.ui_spine_obj_skill"]
|
||||||
self.spineObjLv = uiMap["hero_detail_ui.bg.ui_spine_obj_lv"]
|
self.spineObjLv = uiMap["hero_info.ui_spine_obj_lv"]
|
||||||
self.spineObj = uiMap["hero_detail_ui.bg.ui_spine_obj"]
|
self.spineObj = uiMap["hero_info.ui_spine_obj"]
|
||||||
self.spineObjAvatar = uiMap["hero_detail_ui.bg.ui_spine_obj_avatar"]
|
self.spineObjAvatar = uiMap["hero_info.ui_spine_obj_avatar"]
|
||||||
self.upgrade = uiMap["hero_info.up"]
|
self.upgrade = uiMap["hero_info.up"]
|
||||||
self.bgElement = uiMap["hero_detail_ui.bg.element_bg"]
|
self.bgElement = uiMap["hero_info.element_bg"]
|
||||||
self.btnAttr = uiMap["hero_info.bg_6.btn_attr"]
|
self.btnAttr = uiMap["hero_info.bg_6.btn_attr"]
|
||||||
self.fragmentNode = uiMap["hero_detail_ui.bg.fragment_bg"]
|
self.fragmentNode = uiMap["hero_info.fragment_bg"]
|
||||||
self.btnSkin = uiMap["hero_info.up.btn_skin"]
|
|
||||||
self.txSkin = uiMap["hero_info.up.btn_skin.tx_skin"]
|
|
||||||
|
|
||||||
self.skill = {}
|
self.skill = {}
|
||||||
self.skillIcon = {}
|
self.skillIcon = {}
|
||||||
self.skillDesc = {}
|
self.skillDesc = {}
|
||||||
for i = 1, 4 do
|
for i = 1, 4 do
|
||||||
self.skill[i] = uiMap["hero_detail_ui.bg.skill_up_" .. i]
|
self.skill[i] = uiMap["hero_info.skill_up_" .. i]
|
||||||
self.skillIcon[i] = uiMap["hero_detail_ui.bg.skill_up_" .. i .. ".icon"]
|
self.skillIcon[i] = uiMap["hero_info.skill_up_" .. i .. ".icon"]
|
||||||
self.skillDesc[i] = uiMap["hero_detail_ui.bg.skill_up_" .. i .. ".desc"]
|
self.skillDesc[i] = uiMap["hero_info.skill_up_" .. i .. ".desc"]
|
||||||
|
end
|
||||||
|
|
||||||
|
self.costCells = {}
|
||||||
|
for i = 1, 2 do
|
||||||
|
self.costCells[i] = uiMap["hero_info.up.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.spineObjSkill:setVisible(false)
|
self.spineObjSkill:setVisible(false)
|
||||||
self.spineObjLv:setVisible(false)
|
self.spineObjLv:setVisible(false)
|
||||||
self.spineObj:setVisible(false)
|
self.spineObj:setVisible(false)
|
||||||
self.txSkin:setText(I18N:getGlobalText(I18N.GlobalConst.SKIN))
|
self.txUpdesc:setText("升1级")
|
||||||
self.btnSkin:setActive(DataManager.SkinData:isOpen())
|
self.txUpdesc5:setText("升5级")
|
||||||
|
|
||||||
self.btnSkin:addClickListener(function()
|
|
||||||
ModuleManager.HeroManager:showHeroSkinUI(self.heroEntity:getCfgId())
|
|
||||||
end)
|
|
||||||
self.btnUp:addClickListener(function()
|
self.btnUp:addClickListener(function()
|
||||||
ModuleManager.HeroManager:upgradeHero(self.heroEntity:getCfgId(), self.heroEntity)
|
ModuleManager.HeroManager:upgradeHero(self.heroEntity:getCfgId(), self.heroEntity)
|
||||||
end)
|
end)
|
||||||
@ -188,14 +188,21 @@ function HeroInfoComp:refresh(checkLevel)
|
|||||||
hpStr = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
hpStr = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
||||||
atkStr = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
atkStr = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR
|
||||||
end
|
end
|
||||||
local costId = self.heroEntity:getLvUpCostId()
|
local costs = {}
|
||||||
self.imgUpIcon:setSprite(GFunc.getIconRes(costId))
|
costs[1] = {id = 1, num = materials[1], type = 1}
|
||||||
self.txUpdesc:setText(str)
|
costs[2] = {id = self.heroEntity:getLvUpCostId(), num = materials[2], type = 1}
|
||||||
self.txUpNum:setText(materials[2])
|
for i,v in ipairs(self.costCells) do
|
||||||
|
v:refreshByConfig(costs[i])
|
||||||
|
end
|
||||||
|
self.costCells[1]:setIconSprite(GConst.ATLAS_PATH.HERO, self.heroEntity:getIcon())
|
||||||
|
-- local costId = self.heroEntity:getLvUpCostId()
|
||||||
|
-- self.imgUpIcon:setSprite(GFunc.getIconRes(costId))
|
||||||
|
-- self.txUpdesc:setText(str)
|
||||||
|
-- self.txUpNum:setText(materials[2])
|
||||||
self.txHp:setText(hpStr)
|
self.txHp:setText(hpStr)
|
||||||
self.txAtk:setText(atkStr)
|
self.txAtk:setText(atkStr)
|
||||||
if canLvUp then
|
if canLvUp then
|
||||||
self.btnUp:addRedPoint(120, 50, 0.6)
|
self.btnUp:addRedPoint(70, 40, 0.6)
|
||||||
else
|
else
|
||||||
self.btnUp:removeRedPoint()
|
self.btnUp:removeRedPoint()
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user