From 1b435f5c4b967029f749d76d8991a98caeb3135d Mon Sep 17 00:00:00 2001 From: Fang Date: Fri, 28 Jul 2023 17:58:21 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=8A=BD=E5=8D=A1=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E4=B8=8D=E5=B1=95=E7=A4=BA=E8=A3=85=E5=A4=87=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E7=BA=A2=E7=82=B92=E3=80=81=E8=8B=B1=E9=9B=84=E6=9C=AA?= =?UTF-8?q?=E8=A7=A3=E9=94=81=E6=97=B6=E6=98=BE=E7=A4=BA=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E6=95=B0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/common/cell/hero_cell.lua | 9 ++++++++- lua/app/ui/hero/cell/attr_cell.lua | 24 ++++++++++++++++++++---- lua/app/ui/hero/hero_info_comp.lua | 4 ++-- lua/app/ui/shop/cell/box_hero_cell.lua | 1 + 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/lua/app/ui/common/cell/hero_cell.lua b/lua/app/ui/common/cell/hero_cell.lua index 3812df2e..2adc8302 100644 --- a/lua/app/ui/common/cell/hero_cell.lua +++ b/lua/app/ui/common/cell/hero_cell.lua @@ -99,13 +99,20 @@ function HeroCell:refreshRedPoint() return 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) else self.selfNode:removeRedPoint() end end +-- 设置是否展示红点 +function HeroCell:setShowRedPoint(show) + self.notShowRedPoint = not show +end + function HeroCell:getHeroId() if not self.heroEntity then return diff --git a/lua/app/ui/hero/cell/attr_cell.lua b/lua/app/ui/hero/cell/attr_cell.lua index 41c8dad2..ab441cde 100644 --- a/lua/app/ui/hero/cell/attr_cell.lua +++ b/lua/app/ui/hero/cell/attr_cell.lua @@ -49,9 +49,17 @@ function AttrCell:showHp() local value = 0 if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then - value = self.heroEntity:getTotalAttrValue(self.attrName) + if self.heroEntity:isActived() then + value = self.heroEntity:getTotalAttrValue(self.attrName) + else + value = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv()) + end elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then - value = self.heroEntity:getCfgHp(self.heroEntity:getLv()) + if self.heroEntity:isActived() then + 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 value = self.weaponEntity:getHp() elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then @@ -72,9 +80,17 @@ function AttrCell:showAtk() local value = 0 if self.nodeType == GConst.HeroConst.ATTR_SHOW_TOTAL then - value = self.heroEntity:getTotalAttrValue(self.attrName) + if self.heroEntity:isActived() then + value = self.heroEntity:getTotalAttrValue(self.attrName) + else + value = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv()) + end elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_BASE then - value = self.heroEntity:getCfgAtk(self.heroEntity:getLv()) + if self.heroEntity:isActived() then + 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 value = self.weaponEntity:getAttack() elseif self.nodeType == GConst.HeroConst.ATTR_SHOW_ARMOR then diff --git a/lua/app/ui/hero/hero_info_comp.lua b/lua/app/ui/hero/hero_info_comp.lua index 86cd39a2..f80f7536 100644 --- a/lua/app/ui/hero/hero_info_comp.lua +++ b/lua/app/ui/hero/hero_info_comp.lua @@ -163,8 +163,8 @@ function HeroInfoComp:refresh(checkLevel) end else str = I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_5) - hpStr = self.heroEntity:getHp(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR - atkStr = self.heroEntity:getAtk(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR + hpStr = self.heroEntity:getCfgHp(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR + atkStr = self.heroEntity:getCfgAtk(self.heroEntity:getBeginLv()) // DEFAULT_FACTOR end self.txUpdesc:setText(str) self.txUpNum:setText(materials[2]) diff --git a/lua/app/ui/shop/cell/box_hero_cell.lua b/lua/app/ui/shop/cell/box_hero_cell.lua index f244dfda..56caf032 100644 --- a/lua/app/ui/shop/cell/box_hero_cell.lua +++ b/lua/app/ui/shop/cell/box_hero_cell.lua @@ -15,6 +15,7 @@ function BoxHeroCell:refresh(data) self.data = data local id = data.id local num = data.count + self.heroCell:setShowRedPoint(false) local heroEntity = DataManager.HeroData:getHeroById(id) if heroEntity then