This commit is contained in:
puxuan 2025-08-21 21:05:33 +08:00
parent 02ad035a42
commit 466c8543f1
7 changed files with 67 additions and 35 deletions

View File

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

View File

@ -130,7 +130,11 @@ function ArenaUI:onLoadRootComplete()
end
UIManager:showUI("app/ui/arena/arena_match_ui")
end)
self:bind(DataManager.ArenaData, "isDirty", function()
self:onRefresh()
end)
self:updateTime()
end

View File

@ -25,8 +25,6 @@ function HeroInfoComp:init()
self.txHp = uiMap["hero_info.bg_6.hp_tx"]
self.txAtk = uiMap["hero_info.bg_5.atk_tx"]
-- self.bgFragment = uiMap["hero_info.fragment_bg"]
self.spineObjSkill = uiMap["hero_info.ui_spine_obj_skill"]
-- self.spineObjLv = uiMap["hero_info.ui_spine_obj_lv"]
self.spineObj = uiMap["hero_info.ui_spine_obj"]
self.upgrade = uiMap["hero_info.up"]
self.bgElement = uiMap["hero_info.element_bg"]
@ -56,8 +54,6 @@ function HeroInfoComp:init()
self.costCells[i] = uiMap["hero_info.up.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
end
self.spineObjSkill:setVisible(false)
-- self.spineObjLv:setVisible(false)
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))
@ -155,12 +151,6 @@ function HeroInfoComp:refresh(checkLevel)
skillLv:setText(GConst.EMPTY_STRING)
end
skillBg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueBg(skillId, true))
-- if i == activeCount and isLvChange and self.heroEntity:getLv() == skillLvs[i] then
-- local x, y = skillBg:fastGetAnchoredPosition()
-- self.spineObjSkill:setAnchoredPosition(x, y)
-- self.spineObjSkill:setVisible(true)
-- self.spineObjSkill:playAnim("idle", false, true)
-- end
end
end
end
@ -265,17 +255,17 @@ function HeroInfoComp:refresh(checkLevel)
self.spineObj:playAnim("idle", false, true)
end
if self.onlyLook then -- 仅查看的不显示升级和激活按钮
self.upgrade:setVisible(false)
-- self.baseObject:setSizeDeltaY(SIZE_DELTA_Y_LOOK)
-- self.bgFragment:setVisible(false)
-- self.spineObjLv:setVisible(false)
-- self.txLv:setAnchoredPositionX(lvTxW / 2)
else
self.upgrade:setVisible(true)
-- self.baseObject:setSizeDeltaY(SIZE_DELTA_Y_HERO)
-- self.txLv:setAnchoredPositionX(-44)
-- self.bgFragment:setVisible(true)
self.upgrade:setVisible(not self.onlyLook)
local needPop, isUnlock, skillIdx = self.heroEntity:checkSkillUnlock()
if needPop then
local skillInfo = skillList[skillIdx]
if skillInfo then
local skillId = skillInfo[2]
local cfg = ConfigManager:getConfig("skill_rogue")[skillId]
Logger.logHighlight("================= isUnlock = %s", isUnlock)
ModuleManager.HeroManager:showHeroSkillInfoUI(self.heroEntity, skillIdx, cfg.buff_id, isUnlock)
end
end
end

View File

@ -292,6 +292,12 @@ function MainComp:refreshRedPoint()
else
self.rightBtn:removeRedPoint()
end
if DataManager.ArenaData:hasEntranceRedDot() then
self.arenaBtn:addRedPoint(70, 20, 0.5)
else
self.arenaBtn:removeRedPoint()
end
end
function MainComp:getArenaBtnPosition()

View File

@ -168,11 +168,11 @@ function MainCityUI:_addListeners()
end
return
end
self.bottomBtnSpines[GConst.MainCityConst.BOTTOM_PAGE.SHOP]:playAnimComplete("born1", false, false, function()
self.bottomBtnSpines[GConst.MainCityConst.BOTTOM_PAGE.SHOP]:playAnimComplete("born2", false, false, function()
self.bottomBtnSpines[GConst.MainCityConst.BOTTOM_PAGE.SHOP]:playAnim("idle", false, false)
end)
end)
-- self.bottomBtnSpines[GConst.MainCityConst.BOTTOM_PAGE.SHOP]:playAnimComplete("born1", false, false, function()
-- -- self.bottomBtnSpines[GConst.MainCityConst.BOTTOM_PAGE.SHOP]:playAnimComplete("born2", false, false, function()
-- -- -- self.bottomBtnSpines[GConst.MainCityConst.BOTTOM_PAGE.SHOP]:playAnim("idle", false, false)
-- -- end)
-- end)
self:refreshBottom(GConst.MainCityConst.BOTTOM_PAGE.SHOP, true)
if self.subComps and self.subComps[GConst.MainCityConst.BOTTOM_PAGE.SHOP] then
self.subComps[GConst.MainCityConst.BOTTOM_PAGE.SHOP]:switchPage(page)
@ -310,11 +310,11 @@ function MainCityUI:initBottomUI()
BIReport:postHomeBtnCilck(BIReport.CLICK_BTN_TYPE[MainCityUI.CLICK_BTN_TYPE[i]])
end
self.bottomBtnSpines[i]:playAnimComplete("born1", false, false, function()
self.bottomBtnSpines[i]:playAnimComplete("born2", false, false, function()
self.bottomBtnSpines[i]:playAnim("idle", false, false)
end)
end)
-- self.bottomBtnSpines[i]:playAnimComplete("born1", false, false, function()
-- -- self.bottomBtnSpines[i]:playAnimComplete("born2", false, false, function()
-- -- -- self.bottomBtnSpines[i]:playAnim("idle", false, false)
-- -- end)
-- end)
self:refreshBottom(i, true)
end)
table.insert(self.bottomBtnCells, cellCom)
@ -372,6 +372,8 @@ function MainCityUI:refreshBottom(selectedIndex, playAnim)
end
local oldIndex = self.selectedIndex
self.selectedIndex = selectedIndex and selectedIndex or GConst.MainCityConst.BOTTOM_PAGE.MAIN
self.bottomBtnSpines[oldIndex]:playAnimComplete("born2", false, false)
self.bottomBtnSpines[self.selectedIndex]:playAnimComplete("born1", false, false)
self:switchComp()
-- 动效

View File

@ -102,7 +102,7 @@ function ArenaData:onBoughtGift(giftId)
end
function ArenaData:setDirty()
self.data.isDirty = not self.data.isDirty
self.data.isDirty = not self.data.isDirty
end
-- 通用 ----------------------------------------------------------------------

View File

@ -282,6 +282,7 @@ function HeroEntity:setLv(lv, onlyChangeLv)
if self.data.lv == lv then
return
end
self.oldLv = self.data.lv
self.data.lv = lv
self:_updateAllBaseAttr()
self:setDirty()
@ -534,6 +535,35 @@ function HeroEntity:getUnlockRogueId()
return self.config.rouge_skill
end
function HeroEntity:checkSkillUnlock()
if not self.oldLv then
return false
end
local needPop = false
local isUnlock = false
local skillIdx = 1
for i = 1, 4 do
local ids = self.config["rouge_skill_" .. i]
if ids then
for ii = #ids, 1, -1 do
if self.data.lv >= ids[ii][1] and self.oldLv < ids[ii][1] then
skillIdx = ii
needPop = true
isUnlock = ii == 1
break
end
end
else
break
end
if needPop then
break
end
end
self.oldLv = nil
return needPop, isUnlock, skillIdx
end
function HeroEntity:getRogueSkillList()
if not self.rogueSkillList then
self.rogueSkillList = {}