This commit is contained in:
puxuan 2025-09-02 20:44:41 +08:00
parent af73f1f5d2
commit 0ad11e3e21
7 changed files with 64 additions and 29 deletions

View File

@ -678,6 +678,7 @@ local LocalizationGlobalConst =
SUMMON_DESC_6 = "SUMMON_DESC_6", SUMMON_DESC_6 = "SUMMON_DESC_6",
SUMMON_DESC_7 = "SUMMON_DESC_7", SUMMON_DESC_7 = "SUMMON_DESC_7",
HERO_DESC_21 = "HERO_DESC_21", HERO_DESC_21 = "HERO_DESC_21",
HERO_DESC_22 = "HERO_DESC_22",
} }
return LocalizationGlobalConst return LocalizationGlobalConst

View File

@ -678,6 +678,7 @@ local localization_global =
["SUMMON_DESC_6"] = "普通召唤", ["SUMMON_DESC_6"] = "普通召唤",
["SUMMON_DESC_7"] = "高级召唤", ["SUMMON_DESC_7"] = "高级召唤",
["HERO_DESC_21"] = "等级达到{0}可升星", ["HERO_DESC_21"] = "等级达到{0}可升星",
["HERO_DESC_22"] = "去升星",
} }
return localization_global return localization_global

View File

@ -12,8 +12,8 @@ function HeroManager:showHeroUnlockUI(heroIdList)
UIManager:showUI("app/ui/hero/hero_unlock_ui", {heroIdList = heroIdList}) UIManager:showUI("app/ui/hero/hero_unlock_ui", {heroIdList = heroIdList})
end end
function HeroManager:showHeroSkillInfoUI(heroEntity, idx, buffId, 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}) UIManager:showUI("app/ui/hero/hero_skill_info_ui", {heroEntity = heroEntity, idx = idx, buffId = buffId, isUnlock = isUnlock, isPop = isPop})
end end
function HeroManager:upgradeHero(heroId, heroEntity, level) function HeroManager:upgradeHero(heroId, heroEntity, level)

View File

@ -34,11 +34,13 @@ function HeroInfoComp:init()
self.needStarNodeDescTx1 = uiMap["hero_info.up.need_star_node.desc_tx_1"] self.needStarNodeDescTx1 = uiMap["hero_info.up.need_star_node.desc_tx_1"]
self.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"] self.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"]
self.needStarNodeDescTx2 = uiMap["hero_info.up.need_star_node.desc_tx_2"] 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)) self.needStarNodeDescTx2:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_20))
local meshProComp = self.needStarNodeDescTx2:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO) local meshProComp = self.needStarNodeDescTx2:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
local contentWidth = meshProComp.preferredWidth local contentWidth = meshProComp.preferredWidth
self.needStarNodeDescTx2:setSizeDeltaX(contentWidth) 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.skill = {}
self.skillIcon = {} 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) self.costCells[i] = uiMap["hero_info.up.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
end 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.spineObj:setVisible(false)
self.txUpdesc:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_15, 1)) self.txUpdesc:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_15, 1))
self.txUpdesc5:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_15, 5)) 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.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"]
-- self.needStarNodeDescTx2 = uiMap["hero_info.up.need_star_node.desc_tx_2"] -- 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 if isLvChange then
self.spineObj:setVisible(true) local qlt = self.heroEntity:getQlt()
self.spineObj:playAnim("idle", false, true) -- 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 end
local needPop, isUnlock, skillIdx = self.heroEntity:checkSkillUnlock() local needPop, isUnlock, skillIdx = self.heroEntity:checkSkillUnlock()
if needPop then if needPop then
local skillInfo = skillList[skillIdx] self.baseObject:performWithDelayGlobal(function()
if skillInfo then local skillInfo = skillList[skillIdx]
local skillId = skillInfo[2] if skillInfo then
local cfg = ConfigManager:getConfig("skill_rogue")[skillId] local skillId = skillInfo[2]
ModuleManager.HeroManager:showHeroSkillInfoUI(self.heroEntity, skillIdx, cfg.buff_id, isUnlock) local cfg = ConfigManager:getConfig("skill_rogue")[skillId]
end ModuleManager.HeroManager:showHeroSkillInfoUI(self.heroEntity, skillIdx, cfg.buff_id, isUnlock, needPop)
end
end, 0.5)
end end
end end

View File

@ -18,6 +18,7 @@ function HeroSkillInfoUI:ctor(parmas)
self.heroEntity = parmas.heroEntity self.heroEntity = parmas.heroEntity
self.idx = parmas.idx or 1 self.idx = parmas.idx or 1
self.buffId = parmas.buffId self.buffId = parmas.buffId
self.isPop = parmas.isPop
end end
function HeroSkillInfoUI:onLoadRootComplete() function HeroSkillInfoUI:onLoadRootComplete()
@ -43,18 +44,21 @@ function HeroSkillInfoUI:onLoadRootComplete()
self.buffNode = uiMap["hero_skill_info_ui.content.buff_node"] self.buffNode = uiMap["hero_skill_info_ui.content.buff_node"]
self.content = uiMap["hero_skill_info_ui.content"] self.content = uiMap["hero_skill_info_ui.content"]
self.line2 = uiMap["hero_skill_info_ui.content.line_2"] 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.heroCells = {}
self.buffImgs = {} self.buffImgs = {}
self.buffTxs = {} self.buffTxs = {}
self.skillDescTxs = {}
self.skillVfxs = {}
for i = 1, 2 do for i = 1, 2 do
self.heroCells[i] = uiMap["hero_skill_info_ui.content.hero_node.hero_cell_" .. i]:addLuaComponent(HERO_CELL) 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.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] 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.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 end
uiMap["hero_skill_info_ui.content.hero_node.desc_tx_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_13)) 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 end
self.descTx:setText(ModuleManager.HeroManager:getSkillDesc(self.heroEntity:getBaseSkill())) self.descTx:setText(ModuleManager.HeroManager:getSkillDesc(self.heroEntity:getBaseSkill()))
self.vfx02:setActive(self.isPop)
end end
function HeroSkillInfoUI:refreshSkillDesc() function HeroSkillInfoUI:refreshSkillDesc()
local skillInfo, currIdx = self.heroEntity:getRogueSkillListByIdx(self.idx) local skillInfo, currIdx = self.heroEntity:getRogueSkillListByIdx(self.idx)
local posY = -324 local posY = -324
for i = 1, 3 do for i = 1, 2 do
local skillUnlcokLv = skillInfo[i][1] local skillUnlcokLv = skillInfo[i + 1][1]
local skillId = skillInfo[i][2] local skillId = skillInfo[i + 1][2]
local lvStr = I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_14, skillUnlcokLv) local lvStr = I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_14, skillUnlcokLv)
local skillStr local skillStr = ModuleManager.HeroManager:getSkillRogueDescEntry(skillId, i)
if i == 1 then if currIdx - 1 >= i then
skillStr = ModuleManager.HeroManager:getSkillRogueDesc(skillId)
else
skillStr = ModuleManager.HeroManager:getSkillRogueDescEntry(skillId, i - 1)
end
if currIdx >= i then
self.skillDescTxs[i]:setText("<color=#FFFFFF>" .. lvStr .. "</color><color=#FFA44B> " .. skillStr .. "</color>") self.skillDescTxs[i]:setText("<color=#FFFFFF>" .. lvStr .. "</color><color=#FFA44B> " .. skillStr .. "</color>")
else else
self.skillDescTxs[i]:setText("<color=#B4B4B4>" .. lvStr .. "</color><color=#B4B4B4> " .. skillStr .. "</color>") self.skillDescTxs[i]:setText("<color=#B4B4B4>" .. lvStr .. "</color><color=#B4B4B4> " .. skillStr .. "</color>")
end end
if self.isPop and currIdx - 1 == i then
self.skillVfxs[i]:setActive(true)
end
self.skillDescTxs[i]:setAnchoredPositionY(posY) self.skillDescTxs[i]:setAnchoredPositionY(posY)
local meshProComp = self.skillDescTxs[i]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO) local meshProComp = self.skillDescTxs[i]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
local contentHeight = meshProComp.preferredHeight local contentHeight = meshProComp.preferredHeight

View File

@ -12,6 +12,8 @@ function StarInfoComp:init()
self.descTx = uiMap["star_info.upgrade.desc_tx"] self.descTx = uiMap["star_info.upgrade.desc_tx"]
self.upgrade = uiMap["star_info.upgrade"] self.upgrade = uiMap["star_info.upgrade"]
self.bg = uiMap["star_info.bg"] 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 = {} self.costCells = {}
for i = 1, 2 do for i = 1, 2 do
self.costCells[i] = uiMap["star_info.upgrade.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL) 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.nextLvTx = uiMap["star_info.info_node.next_lv_tx"]
self.upBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_16)) 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_18))
self.lvBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4))
self.upBtn:addClickListener(function() self.upBtn:addClickListener(function()
ModuleManager.HeroManager:upgradeHeroStar(self.heroEntity:getCfgId()) ModuleManager.HeroManager:upgradeHeroStar(self.heroEntity:getCfgId())
end) end)
@ -39,7 +40,7 @@ function StarInfoComp:init()
return STAR_CELL return STAR_CELL
end) end)
self.scrollRectComp:addRefreshCallback(function(index, cell) self.scrollRectComp:addRefreshCallback(function(index, cell)
cell:refresh(self.heroEntity, index) cell:refresh(self.heroEntity, index, self.starUp)
end) end)
self.scrollRectComp:clearCells() self.scrollRectComp:clearCells()
end end
@ -57,6 +58,7 @@ function StarInfoComp:setHeroData(heroEntity, onlyLook)
end end
function StarInfoComp:refresh(starUp) function StarInfoComp:refresh(starUp)
self.starUp = starUp
self:refreshInfo() self:refreshInfo()
self:refreshStarBtn() self:refreshStarBtn()
self:refreshStarInfo() self:refreshStarInfo()
@ -128,6 +130,15 @@ end
function StarInfoComp:refreshStarInfo() function StarInfoComp:refreshStarInfo()
local maxStarLv = self.heroEntity:getMaxStar() local maxStarLv = self.heroEntity:getMaxStar()
self.scrollRectComp:refillCells(maxStarLv) 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 end
return StarInfoComp return StarInfoComp

View File

@ -591,7 +591,7 @@ function HeroEntity:getRogueSkillListByIdx(idx)
local ids = self.config["rouge_skill_" .. idx] local ids = self.config["rouge_skill_" .. idx]
local lv = 0 local lv = 0
if ids then if ids then
for i = 1, #ids do for i = #ids, 1, -1 do
if self.data.lv >= ids[i][1]then if self.data.lv >= ids[i][1]then
lv = i lv = i
break break