fix bug
This commit is contained in:
parent
af73f1f5d2
commit
0ad11e3e21
@ -678,6 +678,7 @@ local LocalizationGlobalConst =
|
||||
SUMMON_DESC_6 = "SUMMON_DESC_6",
|
||||
SUMMON_DESC_7 = "SUMMON_DESC_7",
|
||||
HERO_DESC_21 = "HERO_DESC_21",
|
||||
HERO_DESC_22 = "HERO_DESC_22",
|
||||
}
|
||||
|
||||
return LocalizationGlobalConst
|
||||
@ -678,6 +678,7 @@ local localization_global =
|
||||
["SUMMON_DESC_6"] = "普通召唤",
|
||||
["SUMMON_DESC_7"] = "高级召唤",
|
||||
["HERO_DESC_21"] = "等级达到{0}可升星",
|
||||
["HERO_DESC_22"] = "去升星",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -12,8 +12,8 @@ function HeroManager:showHeroUnlockUI(heroIdList)
|
||||
UIManager:showUI("app/ui/hero/hero_unlock_ui", {heroIdList = heroIdList})
|
||||
end
|
||||
|
||||
function HeroManager:showHeroSkillInfoUI(heroEntity, idx, buffId, isUnlock)
|
||||
UIManager:showUI("app/ui/hero/hero_skill_info_ui", {heroEntity = heroEntity, idx = idx, buffId = buffId, isUnlock = isUnlock})
|
||||
function HeroManager:showHeroSkillInfoUI(heroEntity, idx, buffId, isUnlock, isPop)
|
||||
UIManager:showUI("app/ui/hero/hero_skill_info_ui", {heroEntity = heroEntity, idx = idx, buffId = buffId, isUnlock = isUnlock, isPop = isPop})
|
||||
end
|
||||
|
||||
function HeroManager:upgradeHero(heroId, heroEntity, level)
|
||||
|
||||
@ -34,11 +34,13 @@ function HeroInfoComp:init()
|
||||
self.needStarNodeDescTx1 = uiMap["hero_info.up.need_star_node.desc_tx_1"]
|
||||
self.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"]
|
||||
self.needStarNodeDescTx2 = uiMap["hero_info.up.need_star_node.desc_tx_2"]
|
||||
uiMap["hero_info.up.goto_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_18))
|
||||
uiMap["hero_info.up.goto_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_22))
|
||||
self.needStarNodeDescTx2:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_20))
|
||||
local meshProComp = self.needStarNodeDescTx2:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
|
||||
local contentWidth = meshProComp.preferredWidth
|
||||
self.needStarNodeDescTx2:setSizeDeltaX(contentWidth)
|
||||
self.bg5Vfx01 = uiMap["hero_info.bg_5.vfx_c1_ui_up_b01"]
|
||||
self.bg6Vfx01 = uiMap["hero_info.bg_6.vfx_c1_ui_up_b01"]
|
||||
|
||||
self.skill = {}
|
||||
self.skillIcon = {}
|
||||
@ -54,6 +56,11 @@ function HeroInfoComp:init()
|
||||
self.costCells[i] = uiMap["hero_info.up.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
|
||||
end
|
||||
|
||||
self.lvUpVfxs = {}
|
||||
for i = 1, 5 do
|
||||
self.lvUpVfxs[i] = uiMap["hero_info.vfx_c1_ui_uplight_b0" .. i]
|
||||
end
|
||||
|
||||
self.spineObj:setVisible(false)
|
||||
self.txUpdesc:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_15, 1))
|
||||
self.txUpdesc5:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_15, 5))
|
||||
@ -261,19 +268,32 @@ function HeroInfoComp:refresh(checkLevel)
|
||||
-- self.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"]
|
||||
-- self.needStarNodeDescTx2 = uiMap["hero_info.up.need_star_node.desc_tx_2"]
|
||||
|
||||
for i,v in ipairs(self.lvUpVfxs) do
|
||||
v:setActive(false)
|
||||
end
|
||||
if isLvChange then
|
||||
self.spineObj:setVisible(true)
|
||||
self.spineObj:playAnim("idle", false, true)
|
||||
local qlt = self.heroEntity:getQlt()
|
||||
-- self.spineObj:setVisible(true)
|
||||
-- self.spineObj:playAnim("idle", false, true)
|
||||
self.lvUpVfxs[qlt - 1]:setActive(true)
|
||||
self.bg5Vfx01:setActive(true)
|
||||
self.bg6Vfx01:setActive(true)
|
||||
else
|
||||
-- self.spineObj:setVisible(false)
|
||||
self.bg5Vfx01:setActive(false)
|
||||
self.bg6Vfx01:setActive(false)
|
||||
end
|
||||
|
||||
local needPop, isUnlock, skillIdx = self.heroEntity:checkSkillUnlock()
|
||||
if needPop then
|
||||
self.baseObject:performWithDelayGlobal(function()
|
||||
local skillInfo = skillList[skillIdx]
|
||||
if skillInfo then
|
||||
local skillId = skillInfo[2]
|
||||
local cfg = ConfigManager:getConfig("skill_rogue")[skillId]
|
||||
ModuleManager.HeroManager:showHeroSkillInfoUI(self.heroEntity, skillIdx, cfg.buff_id, isUnlock)
|
||||
ModuleManager.HeroManager:showHeroSkillInfoUI(self.heroEntity, skillIdx, cfg.buff_id, isUnlock, needPop)
|
||||
end
|
||||
end, 0.5)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -18,6 +18,7 @@ function HeroSkillInfoUI:ctor(parmas)
|
||||
self.heroEntity = parmas.heroEntity
|
||||
self.idx = parmas.idx or 1
|
||||
self.buffId = parmas.buffId
|
||||
self.isPop = parmas.isPop
|
||||
end
|
||||
|
||||
function HeroSkillInfoUI:onLoadRootComplete()
|
||||
@ -43,18 +44,21 @@ function HeroSkillInfoUI:onLoadRootComplete()
|
||||
self.buffNode = uiMap["hero_skill_info_ui.content.buff_node"]
|
||||
self.content = uiMap["hero_skill_info_ui.content"]
|
||||
self.line2 = uiMap["hero_skill_info_ui.content.line_2"]
|
||||
self.vfx02 = uiMap["hero_skill_info_ui.content.vfx_c1_ui_up_b02"]
|
||||
self.vfx02:setActive(false)
|
||||
|
||||
self.heroCells = {}
|
||||
self.buffImgs = {}
|
||||
self.buffTxs = {}
|
||||
self.skillDescTxs = {}
|
||||
self.skillVfxs = {}
|
||||
for i = 1, 2 do
|
||||
self.heroCells[i] = uiMap["hero_skill_info_ui.content.hero_node.hero_cell_" .. i]:addLuaComponent(HERO_CELL)
|
||||
self.buffImgs[i] = uiMap["hero_skill_info_ui.content.buff_node.buff_img_" .. i]
|
||||
self.buffTxs[i] = uiMap["hero_skill_info_ui.content.buff_node.buff_tx_" .. i]
|
||||
end
|
||||
self.skillDescTxs = {}
|
||||
for i = 1, 3 do
|
||||
self.skillDescTxs[i] = uiMap["hero_skill_info_ui.content.skill_desc_tx_" .. i]
|
||||
self.skillVfxs[i] = uiMap["hero_skill_info_ui.content.skill_desc_tx_" .. i .. ".vfx_c1_ui_up_b03"]
|
||||
self.skillVfxs[i]:setActive(false)
|
||||
end
|
||||
|
||||
uiMap["hero_skill_info_ui.content.hero_node.desc_tx_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_13))
|
||||
@ -94,27 +98,25 @@ function HeroSkillInfoUI:refreshSkillIcon()
|
||||
end
|
||||
|
||||
self.descTx:setText(ModuleManager.HeroManager:getSkillDesc(self.heroEntity:getBaseSkill()))
|
||||
self.vfx02:setActive(self.isPop)
|
||||
end
|
||||
|
||||
function HeroSkillInfoUI:refreshSkillDesc()
|
||||
local skillInfo, currIdx = self.heroEntity:getRogueSkillListByIdx(self.idx)
|
||||
|
||||
local posY = -324
|
||||
for i = 1, 3 do
|
||||
local skillUnlcokLv = skillInfo[i][1]
|
||||
local skillId = skillInfo[i][2]
|
||||
for i = 1, 2 do
|
||||
local skillUnlcokLv = skillInfo[i + 1][1]
|
||||
local skillId = skillInfo[i + 1][2]
|
||||
local lvStr = I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_14, skillUnlcokLv)
|
||||
local skillStr
|
||||
if i == 1 then
|
||||
skillStr = ModuleManager.HeroManager:getSkillRogueDesc(skillId)
|
||||
else
|
||||
skillStr = ModuleManager.HeroManager:getSkillRogueDescEntry(skillId, i - 1)
|
||||
end
|
||||
if currIdx >= i then
|
||||
local skillStr = ModuleManager.HeroManager:getSkillRogueDescEntry(skillId, i)
|
||||
if currIdx - 1 >= i then
|
||||
self.skillDescTxs[i]:setText("<color=#FFFFFF>" .. lvStr .. "</color><color=#FFA44B> " .. skillStr .. "</color>")
|
||||
else
|
||||
self.skillDescTxs[i]:setText("<color=#B4B4B4>" .. lvStr .. "</color><color=#B4B4B4> " .. skillStr .. "</color>")
|
||||
end
|
||||
if self.isPop and currIdx - 1 == i then
|
||||
self.skillVfxs[i]:setActive(true)
|
||||
end
|
||||
self.skillDescTxs[i]:setAnchoredPositionY(posY)
|
||||
local meshProComp = self.skillDescTxs[i]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
|
||||
local contentHeight = meshProComp.preferredHeight
|
||||
|
||||
@ -12,6 +12,8 @@ function StarInfoComp:init()
|
||||
self.descTx = uiMap["star_info.upgrade.desc_tx"]
|
||||
self.upgrade = uiMap["star_info.upgrade"]
|
||||
self.bg = uiMap["star_info.bg"]
|
||||
self.vfx04 = uiMap["star_info.scrollrect.viewport.content.vfx_c1_ui_up_b04"]
|
||||
self.vfx04:setActive(false)
|
||||
self.costCells = {}
|
||||
for i = 1, 2 do
|
||||
self.costCells[i] = uiMap["star_info.upgrade.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
|
||||
@ -23,8 +25,7 @@ function StarInfoComp:init()
|
||||
self.nextLvTx = uiMap["star_info.info_node.next_lv_tx"]
|
||||
|
||||
self.upBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_16))
|
||||
-- self.descTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4))
|
||||
self.lvBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4))
|
||||
self.lvBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_18))
|
||||
self.upBtn:addClickListener(function()
|
||||
ModuleManager.HeroManager:upgradeHeroStar(self.heroEntity:getCfgId())
|
||||
end)
|
||||
@ -39,7 +40,7 @@ function StarInfoComp:init()
|
||||
return STAR_CELL
|
||||
end)
|
||||
self.scrollRectComp:addRefreshCallback(function(index, cell)
|
||||
cell:refresh(self.heroEntity, index)
|
||||
cell:refresh(self.heroEntity, index, self.starUp)
|
||||
end)
|
||||
self.scrollRectComp:clearCells()
|
||||
end
|
||||
@ -57,6 +58,7 @@ function StarInfoComp:setHeroData(heroEntity, onlyLook)
|
||||
end
|
||||
|
||||
function StarInfoComp:refresh(starUp)
|
||||
self.starUp = starUp
|
||||
self:refreshInfo()
|
||||
self:refreshStarBtn()
|
||||
self:refreshStarInfo()
|
||||
@ -128,6 +130,15 @@ end
|
||||
function StarInfoComp:refreshStarInfo()
|
||||
local maxStarLv = self.heroEntity:getMaxStar()
|
||||
self.scrollRectComp:refillCells(maxStarLv)
|
||||
|
||||
if self.starUp then
|
||||
local star = self.heroEntity:getStar()
|
||||
self.scrollRectComp:moveToIndex(star - 1)
|
||||
self.vfx04:setAnchoredPositionY(-33 - (star - 1) * 56)
|
||||
self.vfx04:setActive(true)
|
||||
else
|
||||
self.vfx04:setActive(false)
|
||||
end
|
||||
end
|
||||
|
||||
return StarInfoComp
|
||||
@ -591,7 +591,7 @@ function HeroEntity:getRogueSkillListByIdx(idx)
|
||||
local ids = self.config["rouge_skill_" .. idx]
|
||||
local lv = 0
|
||||
if ids then
|
||||
for i = 1, #ids do
|
||||
for i = #ids, 1, -1 do
|
||||
if self.data.lv >= ids[i][1]then
|
||||
lv = i
|
||||
break
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user