fix bug
This commit is contained in:
parent
10ccba3f7d
commit
91ac8062ba
@ -693,6 +693,7 @@ GConst.ALL_ATTR = {
|
||||
ATTR_NORMAL_HURTP_ALL = "attr_normal_hurtp_all",-- 全体普攻增伤(百分比)
|
||||
ATTR_SKILL_HURTP_ALL = "attr_skill_hurtp_all", -- 全体技能增伤(百分比)
|
||||
ATTR_ATKP_ALL = "attr_atkp_all", -- 全体攻击(百分比)
|
||||
ATTR_HPP_ALL = "attr_hpp_all", -- 全体英雄生命(百分比)
|
||||
}
|
||||
|
||||
GConst.GAMEOBJECT_LAYER = {
|
||||
|
||||
@ -2793,9 +2793,6 @@ function BattleBaseController:findAttention()
|
||||
for c = 1, GConst.BattleConst.COLUMN_COUNT do
|
||||
local posId = ModuleManager.BattleManager:getPosId(r, c)
|
||||
local gridEntity = self.battleData:getGridEntity(posId)
|
||||
if not gridEntity then
|
||||
print("=====")
|
||||
end
|
||||
local mainElementType = gridEntity:getElementType()
|
||||
if gridEntity:canChangeInfo() then
|
||||
self.findAttentionPathList = table.clearOrCreate(self.findAttentionPathList)
|
||||
|
||||
@ -20,8 +20,8 @@ function HeroManager:showHeroSkillInfoUI2(heroEntity, buffId)
|
||||
UIManager:showUI("app/ui/hero/hero_skill_info_ui_2", {heroEntity = heroEntity, buffId = buffId})
|
||||
end
|
||||
|
||||
function HeroManager:showAttrAllUI()
|
||||
UIManager:showUI("app/ui/hero/hero_attr_all_ui")
|
||||
function HeroManager:showAttrAllUI(heroEntity)
|
||||
UIManager:showUI("app/ui/hero/hero_attr_all_ui", {heroEntity = heroEntity})
|
||||
end
|
||||
|
||||
function HeroManager:upgradeHero(heroId, heroEntity, level)
|
||||
@ -208,7 +208,7 @@ function HeroManager:getSkillRogueBg(skillId, onlyQlt)
|
||||
-- if cfg.skill_position and not onlyQlt then -- 解锁技能类型
|
||||
-- return "frame_skill_0"
|
||||
-- end
|
||||
return cfg and "base_" .. cfg.qlt
|
||||
return cfg and "base_" .. (cfg.icon_base or 1)
|
||||
end
|
||||
|
||||
function HeroManager:getSkillBg(skillId)
|
||||
|
||||
@ -12,7 +12,8 @@ function HeroAttrUI:onPressBackspace()
|
||||
self:closeUI()
|
||||
end
|
||||
|
||||
function HeroAttrUI:ctor()
|
||||
function HeroAttrUI:ctor(parmas)
|
||||
self.heroEntity = parmas.heroEntity
|
||||
end
|
||||
|
||||
function HeroAttrUI:onLoadRootComplete()
|
||||
@ -29,17 +30,16 @@ function HeroAttrUI:onLoadRootComplete()
|
||||
uiMap["hero_attr_all_ui.content.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_26))
|
||||
uiMap["hero_attr_all_ui.content.hp_desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_27))
|
||||
uiMap["hero_attr_all_ui.content.atk_desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_28))
|
||||
uiMap["hero_attr_all_ui.content.bar_bg.slider_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_29))
|
||||
uiMap["hero_attr_all_ui.content.desc_tx_2"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_29))
|
||||
|
||||
self.slider = uiMap["hero_attr_all_ui.content.bar_bg.slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
|
||||
self.hpAttrTx = uiMap["hero_attr_all_ui.content.hp_attr_tx"]
|
||||
self.atkAttrTx = uiMap["hero_attr_all_ui.content.atk_attr_tx"]
|
||||
end
|
||||
|
||||
function HeroAttrUI:onRefresh()
|
||||
self.slider.value = 0.76
|
||||
self.hpAttrTx:setText("100")
|
||||
self.atkAttrTx:setText("100")
|
||||
local attr = self.heroEntity:getStarAttr()
|
||||
self.hpAttrTx:setText(GFunc.getFinalAttrValue(GConst.ALL_ATTR.ATTR_HPP_ALL, attr.attr_hpp_all or 0))
|
||||
self.atkAttrTx:setText(GFunc.getFinalAttrValue(GConst.ALL_ATTR.ATTR_ATKP_ALL, attr.attr_atkp_all or 0))
|
||||
end
|
||||
|
||||
return HeroAttrUI
|
||||
@ -10,13 +10,13 @@ local DEFAULT_FACTOR = GConst.BattleConst.DEFAULT_FACTOR
|
||||
local BTN_LIGHT = {
|
||||
"act_common_btn_16_1",
|
||||
"act_common_btn_17_1",
|
||||
"act_common_btn_18_1",
|
||||
"act_common_btn_25_1",
|
||||
}
|
||||
|
||||
local BTN_NORMAL = {
|
||||
"act_common_btn_16_2",
|
||||
"act_common_btn_17_2",
|
||||
"act_common_btn_18_2",
|
||||
"act_common_btn_25_2",
|
||||
}
|
||||
|
||||
function HeroDetailUI:getPrefabPath()
|
||||
@ -175,6 +175,11 @@ function HeroDetailUI:onLoadRootComplete()
|
||||
self:addEventListener(EventManager.CUSTOM_EVENT.GO_DUNGEON_UI, function()
|
||||
self:closeUI()
|
||||
end)
|
||||
|
||||
local middle = uiMap["hero_detail_ui.middle"]
|
||||
local rect = self.root:getRectSize()
|
||||
local bgHeight = rect.height * 0.66
|
||||
middle:setSizeDeltaY(bgHeight)
|
||||
end
|
||||
|
||||
function HeroDetailUI:initList()
|
||||
@ -192,13 +197,15 @@ function HeroDetailUI:getIsOpen(page)
|
||||
return false
|
||||
end
|
||||
|
||||
function HeroDetailUI:onRefresh(checkLevel)
|
||||
function HeroDetailUI:onRefresh(checkUp)
|
||||
self.checkLvUpState = checkUp
|
||||
self:updateTop()
|
||||
self:updateHero()
|
||||
self:updateSide()
|
||||
self:refreshPageInfo()
|
||||
self:refreshSkillInfo()
|
||||
self:checkLvUp(checkLevel)
|
||||
self:checkLvUp(checkUp)
|
||||
self.checkLvUpState = nil
|
||||
end
|
||||
|
||||
function HeroDetailUI:changePage(page)
|
||||
@ -281,7 +288,6 @@ function HeroDetailUI:refreshSkillInfo()
|
||||
-- ModuleManager.TipsManager:showSkillTips(skillIcon, cfg.buff_id, skillId)
|
||||
ModuleManager.HeroManager:showHeroSkillInfoUI(self.heroEntity, i, cfg.buff_id)
|
||||
end)
|
||||
skillIcon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(skillId))
|
||||
skillBg:setTouchEnable(true)
|
||||
if skillUnlcokStar > star then
|
||||
self.skillNeedStarNodes[i]:setActive(true)
|
||||
@ -298,7 +304,8 @@ function HeroDetailUI:refreshSkillInfo()
|
||||
self.skillNeedStarDescTx2s[i]:setSizeDeltaX(contentWidth)
|
||||
self.skillNeedStarNodes[i]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_HORIZONTAL_OR_VERTICAL_LAYOUT):RefreshLayout()
|
||||
|
||||
skillBg:setSprite(GConst.ATLAS_PATH.ICON_ITEM, "frame_1")
|
||||
skillBg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueBg(skillId, true) .. "_1")
|
||||
skillIcon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(skillId) .. "_1")
|
||||
else
|
||||
if nextLvUpStar then
|
||||
self.skillNeedStarNodes[i]:setActive(true)
|
||||
@ -318,6 +325,7 @@ function HeroDetailUI:refreshSkillInfo()
|
||||
self.skillNeedStarNodes[i]:setActive(false)
|
||||
end
|
||||
skillBg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueBg(skillId, true))
|
||||
skillIcon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(skillId))
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -387,7 +395,7 @@ function HeroDetailUI:showHeroInfo()
|
||||
end
|
||||
|
||||
self.compHero:setHeroData(self.heroEntity, self.onlyLook)
|
||||
self.compHero:refresh()
|
||||
self.compHero:refresh(self.checkLvUpState)
|
||||
end
|
||||
|
||||
function HeroDetailUI:showStarInfo()
|
||||
@ -405,7 +413,7 @@ function HeroDetailUI:showStarInfo()
|
||||
end
|
||||
|
||||
self.compStar:setHeroData(self.heroEntity, self.onlyLook)
|
||||
self.compStar:refresh()
|
||||
self.compStar:refresh(self.checkLvUpState)
|
||||
end
|
||||
|
||||
function HeroDetailUI:showEquipInfo()
|
||||
@ -423,7 +431,7 @@ function HeroDetailUI:showEquipInfo()
|
||||
end
|
||||
|
||||
self.compEquip:setHeroData(self.heroEntity)
|
||||
self.compEquip:refresh()
|
||||
self.compEquip:refresh(self.checkLvUpState)
|
||||
end
|
||||
|
||||
-- 是否显示左箭头
|
||||
|
||||
@ -59,9 +59,9 @@ function HeroInfoComp:setHeroData(heroEntity, onlyLook)
|
||||
self.curLevel = heroEntity:getLv()
|
||||
self.heroEntity = heroEntity
|
||||
self.onlyLook = onlyLook
|
||||
self:bind(self.heroEntity, "isDirty", function()
|
||||
self:refresh(true)
|
||||
end)
|
||||
-- self:bind(self.heroEntity, "isDirty", function()
|
||||
-- self:refresh(true)
|
||||
-- end)
|
||||
end
|
||||
|
||||
function HeroInfoComp:refresh(lvUp)
|
||||
@ -74,18 +74,17 @@ function HeroInfoComp:refreshLvInfo()
|
||||
local list = self.heroEntity:getLvAttrPointList()
|
||||
self.scrollRectComp:refillCells(#list)
|
||||
|
||||
self.vfx04:setActive(false)
|
||||
if self.lvUp then
|
||||
local lv = self.heroEntity:getLv()
|
||||
for i, v in ipairs(list) do
|
||||
if lv == v then
|
||||
self.scrollRectComp:moveToIndex(i - 1)
|
||||
self.vfx04:setAnchoredPositionY(-33 - (i - 1) * 58)
|
||||
self.vfx04:setAnchoredPositionY(-34 - (i - 1) * 58)
|
||||
self.vfx04:setActive(true)
|
||||
break
|
||||
end
|
||||
end
|
||||
else
|
||||
self.vfx04:setActive(false)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -84,9 +84,9 @@ function HeroSkillInfoUI:refreshSkillIcon()
|
||||
local skillId = skillInfo[1][2]
|
||||
self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_23, currIdx .. "/" .. #skillInfo))
|
||||
|
||||
self.icon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(skillId))
|
||||
if skillUnlcokStar > star then
|
||||
self.skillIcon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, "frame_1")
|
||||
self.skillIcon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueBg(skillId, true) .. "_1")
|
||||
self.icon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(skillId) .. "_1")
|
||||
|
||||
self.unlockTx:setText(I18N:getGlobalText(I18N.GlobalConst.STAR_UNLOCK, skillUnlcokStar))
|
||||
local meshProComp = self.unlockTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
|
||||
@ -96,6 +96,7 @@ function HeroSkillInfoUI:refreshSkillIcon()
|
||||
else
|
||||
self.unlockBg:setActive(false)
|
||||
self.skillIcon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueBg(skillId, true))
|
||||
self.icon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(skillId))
|
||||
end
|
||||
|
||||
self.descTx:setText(ModuleManager.HeroManager:getSkillRogueDesc(skillInfo[1][2]))
|
||||
|
||||
@ -30,7 +30,7 @@ function StarInfoComp:init()
|
||||
ModuleManager.HeroManager:upgradeHeroStar(self.heroEntity:getCfgId())
|
||||
end)
|
||||
self.attrBg:addClickListener(function()
|
||||
ModuleManager.HeroManager:showAttrAllUI()
|
||||
ModuleManager.HeroManager:showAttrAllUI(self.heroEntity)
|
||||
end)
|
||||
|
||||
self.scrollrect = uiMap["star_info.bg.scrollrect"]
|
||||
@ -54,9 +54,9 @@ end
|
||||
function StarInfoComp:setHeroData(heroEntity, onlyLook)
|
||||
self.heroEntity = heroEntity
|
||||
self.onlyLook = onlyLook
|
||||
self:bind(self.heroEntity, "isDirty", function()
|
||||
self:refresh(true)
|
||||
end)
|
||||
-- self:bind(self.heroEntity, "isDirty", function()
|
||||
-- self:refresh(true)
|
||||
-- end)
|
||||
end
|
||||
|
||||
function StarInfoComp:refresh(starUp)
|
||||
@ -96,19 +96,20 @@ function StarInfoComp:refreshStarInfo()
|
||||
local maxStarLv = self.heroEntity:getMaxStar()
|
||||
self.scrollRectComp:refillCells(maxStarLv)
|
||||
|
||||
self.vfx04:setActive(false)
|
||||
if self.starUp then
|
||||
local star = self.heroEntity:getStar()
|
||||
self.scrollRectComp:moveToIndex(star - 1)
|
||||
self.vfx04:setAnchoredPositionY(-33 - (star - 1) * 56)
|
||||
self.vfx04:setAnchoredPositionY(-34 - (star - 1) * 58)
|
||||
self.vfx04:setActive(true)
|
||||
else
|
||||
self.vfx04:setActive(false)
|
||||
self.vfx04:play()
|
||||
end
|
||||
end
|
||||
|
||||
function StarInfoComp:refreshAttrInfo()
|
||||
-- self.attrTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_26))
|
||||
self.attrTx:setText("10%")
|
||||
local attr = self.heroEntity:getStarAttr()
|
||||
self.attrTx:setText(GFunc.getFinalAttrValue(GConst.ALL_ATTR.ATTR_HPP_ALL, attr.attr_hpp_all or 0))
|
||||
local meshProComp = self.attrTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
|
||||
local contentWidth = meshProComp.preferredWidth
|
||||
self.attrTx:setSizeDeltaX(contentWidth)
|
||||
|
||||
@ -166,6 +166,7 @@ function HeroEntity:_updateAllBaseAttr()
|
||||
attr[GConst.ALL_ATTR.ATTR_NORMAL_HURTP_ALL] = self.allBaseAttr[GConst.ALL_ATTR.ATTR_NORMAL_HURTP_ALL]
|
||||
attr[GConst.ALL_ATTR.ATTR_SKILL_HURTP_ALL] = self.allBaseAttr[GConst.ALL_ATTR.ATTR_SKILL_HURTP_ALL]
|
||||
attr[GConst.ALL_ATTR.ATTR_ATKP_ALL] = self.allBaseAttr[GConst.ALL_ATTR.ATTR_ATKP_ALL]
|
||||
attr[GConst.ALL_ATTR.ATTR_ATK_ALL] = self.allBaseAttr[GConst.ALL_ATTR.ATTR_ATK_ALL]
|
||||
|
||||
DataManager.HeroData:setHeroAttr(self:getCfgId(), attr)
|
||||
end
|
||||
@ -185,8 +186,10 @@ end
|
||||
function HeroEntity:_updateStarAttr()
|
||||
self.starAttr = {}
|
||||
for i = 1, self.data.star do
|
||||
local attr = self:getStarAttrCfg()[i]
|
||||
self.starAttr[attr.type] = (self.starAttr[attr.type] or 0) + attr.num
|
||||
local attrs = self:getStarAttrCfg(i)
|
||||
for _, attr in ipairs(attrs) do
|
||||
self.starAttr[attr.type] = (self.starAttr[attr.type] or 0) + attr.num
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -533,10 +536,8 @@ function HeroEntity:getStarUpCostId()
|
||||
end
|
||||
|
||||
function HeroEntity:getStarAttrCfg(star)
|
||||
if star then
|
||||
return self.config.star_attr[star]
|
||||
end
|
||||
return self.config.star_attr
|
||||
local cfg = ConfigManager:getConfig("hero_star")
|
||||
return cfg[star]["attr_" .. self:getQlt()]
|
||||
end
|
||||
|
||||
function HeroEntity:getStarAttrTxt()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user