添加英雄升级标签红点,标签红点更新fix
This commit is contained in:
parent
08fa2ab356
commit
9a3850c145
@ -52,6 +52,7 @@ EventManager.CUSTOM_EVENT = {
|
|||||||
-- 装备
|
-- 装备
|
||||||
EQUIP_UPGRADE_SUCCESS = "EQUIP_UPGRADE_SUCCESS",
|
EQUIP_UPGRADE_SUCCESS = "EQUIP_UPGRADE_SUCCESS",
|
||||||
EQUIP_UPSECTION_SUCCESS = "EQUIP_UPSECTION_SUCCESS",
|
EQUIP_UPSECTION_SUCCESS = "EQUIP_UPSECTION_SUCCESS",
|
||||||
|
HERO_UPGRADE_SUCCESS = "HERO_UPGRADE_SUCCESS",
|
||||||
GO_DUNGEON_UI = "GO_DUNGEON_UI",
|
GO_DUNGEON_UI = "GO_DUNGEON_UI",
|
||||||
-- BORAD_TOUCH_BEGIN = "BORAD_TOUCH_BEGIN",
|
-- BORAD_TOUCH_BEGIN = "BORAD_TOUCH_BEGIN",
|
||||||
-- BORAD_TOUCH_OVER = "BORAD_TOUCH_OVER"
|
-- BORAD_TOUCH_OVER = "BORAD_TOUCH_OVER"
|
||||||
|
|||||||
@ -115,6 +115,9 @@ function HeroDetailUI:onLoadRootComplete()
|
|||||||
self:refreshShow()
|
self:refreshShow()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
self:addEventListener(EventManager.CUSTOM_EVENT.HERO_UPGRADE_SUCCESS, function(id)
|
||||||
|
self:refreshRedPoint()
|
||||||
|
end)
|
||||||
self:addEventListener(EventManager.CUSTOM_EVENT.EQUIP_UPSECTION_SUCCESS, function(part)
|
self:addEventListener(EventManager.CUSTOM_EVENT.EQUIP_UPSECTION_SUCCESS, function(part)
|
||||||
Logger.logHighlight("升段:"..part)
|
Logger.logHighlight("升段:"..part)
|
||||||
if part == GConst.EquipConst.PART_TYPE.WEAPON then
|
if part == GConst.EquipConst.PART_TYPE.WEAPON then
|
||||||
@ -122,6 +125,7 @@ function HeroDetailUI:onLoadRootComplete()
|
|||||||
else
|
else
|
||||||
self.compArmor:playUpgradeEffect(part)
|
self.compArmor:playUpgradeEffect(part)
|
||||||
end
|
end
|
||||||
|
self:refreshRedPoint()
|
||||||
end)
|
end)
|
||||||
self:addEventListener(EventManager.CUSTOM_EVENT.EQUIP_UPGRADE_SUCCESS, function(part)
|
self:addEventListener(EventManager.CUSTOM_EVENT.EQUIP_UPGRADE_SUCCESS, function(part)
|
||||||
Logger.logHighlight("升级:"..part)
|
Logger.logHighlight("升级:"..part)
|
||||||
@ -130,6 +134,7 @@ function HeroDetailUI:onLoadRootComplete()
|
|||||||
else
|
else
|
||||||
self.compArmor:playUpgradeEffect(part)
|
self.compArmor:playUpgradeEffect(part)
|
||||||
end
|
end
|
||||||
|
self:refreshRedPoint()
|
||||||
end)
|
end)
|
||||||
self:addEventListener(EventManager.CUSTOM_EVENT.GO_DUNGEON_UI, function()
|
self:addEventListener(EventManager.CUSTOM_EVENT.GO_DUNGEON_UI, function()
|
||||||
self:closeUI()
|
self:closeUI()
|
||||||
@ -172,7 +177,17 @@ function HeroDetailUI:refreshShow()
|
|||||||
self.btnLeft:setVisible(self:isExistLeftHero())
|
self.btnLeft:setVisible(self:isExistLeftHero())
|
||||||
self.btnRight:setVisible(self:isExistRightHero())
|
self.btnRight:setVisible(self:isExistRightHero())
|
||||||
self.commonInfo:setSizeDeltaY(SIZE_DELTA_Y_HERO)
|
self.commonInfo:setSizeDeltaY(SIZE_DELTA_Y_HERO)
|
||||||
|
self:refreshRedPoint()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 刷新标签红点
|
||||||
|
function HeroDetailUI:refreshRedPoint()
|
||||||
|
if self.heroEntity:canLvUp() then
|
||||||
|
self.btnHero:addRedPoint(-70, 0, 0.6)
|
||||||
|
else
|
||||||
|
self.btnHero:removeRedPoint()
|
||||||
|
end
|
||||||
if DataManager.EquipData:canUpgradeWeapon(self.heroEntity:getCfgId()) then
|
if DataManager.EquipData:canUpgradeWeapon(self.heroEntity:getCfgId()) then
|
||||||
self.btnWeapon:addRedPoint(-70, 0, 0.6)
|
self.btnWeapon:addRedPoint(-70, 0, 0.6)
|
||||||
else
|
else
|
||||||
@ -184,7 +199,6 @@ function HeroDetailUI:refreshShow()
|
|||||||
self.btnArmor:removeRedPoint()
|
self.btnArmor:removeRedPoint()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
function HeroDetailUI:showHeroInfo()
|
function HeroDetailUI:showHeroInfo()
|
||||||
self.heroInfo:setActive(true)
|
self.heroInfo:setActive(true)
|
||||||
|
|||||||
@ -188,6 +188,7 @@ function HeroEntity:setLv(lv)
|
|||||||
self.data.lv = lv
|
self.data.lv = lv
|
||||||
self:onBaseAttrChange()
|
self:onBaseAttrChange()
|
||||||
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_HERO_LV_UP, lv)
|
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_HERO_LV_UP, lv)
|
||||||
|
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.HERO_UPGRADE_SUCCESS, self:getCfgId())
|
||||||
end
|
end
|
||||||
|
|
||||||
function HeroEntity:getCfgId()
|
function HeroEntity:getCfgId()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user