fix bug
This commit is contained in:
parent
02ad035a42
commit
466c8543f1
@ -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)
|
function HeroManager:showHeroSkillInfoUI(heroEntity, idx, buffId, isUnlock)
|
||||||
UIManager:showUI("app/ui/hero/hero_skill_info_ui", {heroEntity = heroEntity, idx = idx, buffId = buffId})
|
UIManager:showUI("app/ui/hero/hero_skill_info_ui", {heroEntity = heroEntity, idx = idx, buffId = buffId, isUnlock = isUnlock})
|
||||||
end
|
end
|
||||||
|
|
||||||
function HeroManager:upgradeHero(heroId, heroEntity, level)
|
function HeroManager:upgradeHero(heroId, heroEntity, level)
|
||||||
|
|||||||
@ -131,6 +131,10 @@ function ArenaUI:onLoadRootComplete()
|
|||||||
UIManager:showUI("app/ui/arena/arena_match_ui")
|
UIManager:showUI("app/ui/arena/arena_match_ui")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
self:bind(DataManager.ArenaData, "isDirty", function()
|
||||||
|
self:onRefresh()
|
||||||
|
end)
|
||||||
|
|
||||||
self:updateTime()
|
self:updateTime()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -25,8 +25,6 @@ function HeroInfoComp:init()
|
|||||||
self.txHp = uiMap["hero_info.bg_6.hp_tx"]
|
self.txHp = uiMap["hero_info.bg_6.hp_tx"]
|
||||||
self.txAtk = uiMap["hero_info.bg_5.atk_tx"]
|
self.txAtk = uiMap["hero_info.bg_5.atk_tx"]
|
||||||
-- self.bgFragment = uiMap["hero_info.fragment_bg"]
|
-- 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.spineObj = uiMap["hero_info.ui_spine_obj"]
|
||||||
self.upgrade = uiMap["hero_info.up"]
|
self.upgrade = uiMap["hero_info.up"]
|
||||||
self.bgElement = uiMap["hero_info.element_bg"]
|
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)
|
self.costCells[i] = uiMap["hero_info.up.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.spineObjSkill:setVisible(false)
|
|
||||||
-- self.spineObjLv:setVisible(false)
|
|
||||||
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))
|
||||||
@ -155,12 +151,6 @@ function HeroInfoComp:refresh(checkLevel)
|
|||||||
skillLv:setText(GConst.EMPTY_STRING)
|
skillLv:setText(GConst.EMPTY_STRING)
|
||||||
end
|
end
|
||||||
skillBg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueBg(skillId, true))
|
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
|
end
|
||||||
end
|
end
|
||||||
@ -265,17 +255,17 @@ function HeroInfoComp:refresh(checkLevel)
|
|||||||
self.spineObj:playAnim("idle", false, true)
|
self.spineObj:playAnim("idle", false, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.onlyLook then -- 仅查看的不显示升级和激活按钮
|
self.upgrade:setVisible(not self.onlyLook)
|
||||||
self.upgrade:setVisible(false)
|
|
||||||
-- self.baseObject:setSizeDeltaY(SIZE_DELTA_Y_LOOK)
|
local needPop, isUnlock, skillIdx = self.heroEntity:checkSkillUnlock()
|
||||||
-- self.bgFragment:setVisible(false)
|
if needPop then
|
||||||
-- self.spineObjLv:setVisible(false)
|
local skillInfo = skillList[skillIdx]
|
||||||
-- self.txLv:setAnchoredPositionX(lvTxW / 2)
|
if skillInfo then
|
||||||
else
|
local skillId = skillInfo[2]
|
||||||
self.upgrade:setVisible(true)
|
local cfg = ConfigManager:getConfig("skill_rogue")[skillId]
|
||||||
-- self.baseObject:setSizeDeltaY(SIZE_DELTA_Y_HERO)
|
Logger.logHighlight("================= isUnlock = %s", isUnlock)
|
||||||
-- self.txLv:setAnchoredPositionX(-44)
|
ModuleManager.HeroManager:showHeroSkillInfoUI(self.heroEntity, skillIdx, cfg.buff_id, isUnlock)
|
||||||
-- self.bgFragment:setVisible(true)
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -292,6 +292,12 @@ function MainComp:refreshRedPoint()
|
|||||||
else
|
else
|
||||||
self.rightBtn:removeRedPoint()
|
self.rightBtn:removeRedPoint()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if DataManager.ArenaData:hasEntranceRedDot() then
|
||||||
|
self.arenaBtn:addRedPoint(70, 20, 0.5)
|
||||||
|
else
|
||||||
|
self.arenaBtn:removeRedPoint()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function MainComp:getArenaBtnPosition()
|
function MainComp:getArenaBtnPosition()
|
||||||
|
|||||||
@ -168,11 +168,11 @@ function MainCityUI:_addListeners()
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self.bottomBtnSpines[GConst.MainCityConst.BOTTOM_PAGE.SHOP]:playAnimComplete("born1", false, false, function()
|
-- 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]:playAnimComplete("born2", false, false, function()
|
||||||
self.bottomBtnSpines[GConst.MainCityConst.BOTTOM_PAGE.SHOP]:playAnim("idle", false, false)
|
-- -- -- self.bottomBtnSpines[GConst.MainCityConst.BOTTOM_PAGE.SHOP]:playAnim("idle", false, false)
|
||||||
end)
|
-- -- end)
|
||||||
end)
|
-- end)
|
||||||
self:refreshBottom(GConst.MainCityConst.BOTTOM_PAGE.SHOP, true)
|
self:refreshBottom(GConst.MainCityConst.BOTTOM_PAGE.SHOP, true)
|
||||||
if self.subComps and self.subComps[GConst.MainCityConst.BOTTOM_PAGE.SHOP] then
|
if self.subComps and self.subComps[GConst.MainCityConst.BOTTOM_PAGE.SHOP] then
|
||||||
self.subComps[GConst.MainCityConst.BOTTOM_PAGE.SHOP]:switchPage(page)
|
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]])
|
BIReport:postHomeBtnCilck(BIReport.CLICK_BTN_TYPE[MainCityUI.CLICK_BTN_TYPE[i]])
|
||||||
end
|
end
|
||||||
|
|
||||||
self.bottomBtnSpines[i]:playAnimComplete("born1", false, false, function()
|
-- self.bottomBtnSpines[i]:playAnimComplete("born1", false, false, function()
|
||||||
self.bottomBtnSpines[i]:playAnimComplete("born2", false, false, function()
|
-- -- self.bottomBtnSpines[i]:playAnimComplete("born2", false, false, function()
|
||||||
self.bottomBtnSpines[i]:playAnim("idle", false, false)
|
-- -- -- self.bottomBtnSpines[i]:playAnim("idle", false, false)
|
||||||
end)
|
-- -- end)
|
||||||
end)
|
-- end)
|
||||||
self:refreshBottom(i, true)
|
self:refreshBottom(i, true)
|
||||||
end)
|
end)
|
||||||
table.insert(self.bottomBtnCells, cellCom)
|
table.insert(self.bottomBtnCells, cellCom)
|
||||||
@ -372,6 +372,8 @@ function MainCityUI:refreshBottom(selectedIndex, playAnim)
|
|||||||
end
|
end
|
||||||
local oldIndex = self.selectedIndex
|
local oldIndex = self.selectedIndex
|
||||||
self.selectedIndex = selectedIndex and selectedIndex or GConst.MainCityConst.BOTTOM_PAGE.MAIN
|
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()
|
self:switchComp()
|
||||||
|
|
||||||
-- 动效
|
-- 动效
|
||||||
|
|||||||
@ -282,6 +282,7 @@ function HeroEntity:setLv(lv, onlyChangeLv)
|
|||||||
if self.data.lv == lv then
|
if self.data.lv == lv then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
self.oldLv = self.data.lv
|
||||||
self.data.lv = lv
|
self.data.lv = lv
|
||||||
self:_updateAllBaseAttr()
|
self:_updateAllBaseAttr()
|
||||||
self:setDirty()
|
self:setDirty()
|
||||||
@ -534,6 +535,35 @@ function HeroEntity:getUnlockRogueId()
|
|||||||
return self.config.rouge_skill
|
return self.config.rouge_skill
|
||||||
end
|
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()
|
function HeroEntity:getRogueSkillList()
|
||||||
if not self.rogueSkillList then
|
if not self.rogueSkillList then
|
||||||
self.rogueSkillList = {}
|
self.rogueSkillList = {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user