fix bug
This commit is contained in:
parent
60eee47520
commit
7f822a3025
@ -772,7 +772,7 @@ function UIPrefabObject:addRedPoint(offsetX, offsetY, scale, iconName, count, na
|
||||
local uiMap = prefabObject:genAllChildren()
|
||||
self.redPoint:setAnchoredPosition(offsetX or 0, offsetY or 0)
|
||||
self.redPoint:setLocalScale(scale, scale, scale)
|
||||
iconName = iconName or "common_point"
|
||||
iconName = iconName or "common_info_1"
|
||||
self.redPoint:setSprite(GConst.ATLAS_PATH.COMMON, iconName)
|
||||
GFunc.getShakeSeq(self.redPoint, false, scale, true)
|
||||
if native then
|
||||
@ -787,7 +787,7 @@ function UIPrefabObject:addRedPoint(offsetX, offsetY, scale, iconName, count, na
|
||||
end)
|
||||
end
|
||||
else
|
||||
iconName = iconName or "common_point"
|
||||
iconName = iconName or "common_info_1"
|
||||
self.redPoint:setSprite(GConst.ATLAS_PATH.COMMON, iconName)
|
||||
self.redPoint:setAnchoredPosition(offsetX or 0, offsetY or 0)
|
||||
self.redPoint:setActive(true)
|
||||
|
||||
@ -135,7 +135,7 @@ function ArenaSeasonRewardUI:showGetReward()
|
||||
end)
|
||||
end)
|
||||
|
||||
self.btnGet:addRedPoint(110, 35, 0.6)
|
||||
self.btnGet:addRedPoint(110, 35, 1)
|
||||
|
||||
local rewards = DataManager.ArenaData:getSeasonRewards(lastId)
|
||||
local rewardCount = #rewards
|
||||
|
||||
@ -236,7 +236,7 @@ function ArenaUI:refreshInfo()
|
||||
end
|
||||
|
||||
if DataManager.ArenaData:hasSeasonReward() then
|
||||
self.btnReward:addRedPoint(36, 25, 0.6)
|
||||
self.btnReward:addRedPoint(36, 25, 1)
|
||||
else
|
||||
self.btnReward:removeRedPoint()
|
||||
end
|
||||
@ -268,7 +268,7 @@ end
|
||||
-- 刷新段位奖励红点
|
||||
function ArenaUI:refreshRedPoint()
|
||||
if DataManager.ArenaData:hasGradingRewardRedDot() then
|
||||
self.btnGradingReward:addRedPoint(50, 50, 0.6)
|
||||
self.btnGradingReward:addRedPoint(50, 50, 1)
|
||||
else
|
||||
self.btnGradingReward:removeRedPoint()
|
||||
end
|
||||
|
||||
@ -111,7 +111,7 @@ function HeroCell:refreshRedPoint()
|
||||
|
||||
if not self.notShowRedPoint and
|
||||
DataManager.FormationData:heroInFormation(GConst.BattleConst.FORMATION_TYPE.STAGE, self.heroEntity:getCfgId()) then
|
||||
self.selfNode:addRedPoint(55, -35, 0.64)
|
||||
self.selfNode:addRedPoint(55, -35, 1)
|
||||
else
|
||||
self.selfNode:removeRedPoint()
|
||||
end
|
||||
|
||||
@ -39,7 +39,7 @@ function PlayerHeadCell:refresh(avatarId, frameId, showRp)
|
||||
|
||||
-- 红点
|
||||
if showRp and (DataManager.PlayerData:hasNewAvatar() or DataManager.PlayerData:hasNewFrame()) then
|
||||
self.baseObject:addRedPoint(50, 50, 0.7)
|
||||
self.baseObject:addRedPoint(50, 50, 1)
|
||||
else
|
||||
self.baseObject:removeRedPoint()
|
||||
end
|
||||
|
||||
@ -21,7 +21,7 @@ function HeroFormationComp:refresh()
|
||||
if formation[i] then
|
||||
local heroEntity = DataManager.HeroData:getHeroById(formation[i])
|
||||
if heroEntity then
|
||||
heroCell:setVisible(true, 0.66)
|
||||
heroCell:setVisible(true, 0.6)
|
||||
heroCell:refresh(heroEntity)
|
||||
heroCell:addClickListener(function()
|
||||
ModuleManager.HeroManager:showHeroDetailUI(heroEntity:getCfgId())
|
||||
@ -40,7 +40,7 @@ function HeroFormationComp:refreshByFormation(formation)
|
||||
if formation[i] then
|
||||
local heroEntity = DataManager.HeroData:getHeroById(formation[i])
|
||||
if heroEntity then
|
||||
heroCell:setVisible(true, 0.66)
|
||||
heroCell:setVisible(true, 0.6)
|
||||
heroCell:refresh(heroEntity)
|
||||
heroCell:addClickListener(function()
|
||||
ModuleManager.HeroManager:showHeroDetailUI(heroEntity:getCfgId())
|
||||
@ -58,7 +58,7 @@ function HeroFormationComp:refreshByEntitys(formation)
|
||||
for i, heroCell in ipairs(self.heroCells) do
|
||||
local heroEntity = formation[i]
|
||||
if heroEntity then
|
||||
heroCell:setVisible(true, 0.66)
|
||||
heroCell:setVisible(true, 0.6)
|
||||
heroCell:refreshBriefInfo(heroEntity)
|
||||
heroCell:addClickListener(function()
|
||||
ModuleManager.HeroManager:showHeroDetailUI(heroEntity:getCfgId(), true, heroEntity)
|
||||
|
||||
@ -81,7 +81,7 @@ function DailyChallengeUI:refreshTask()
|
||||
local taskObj = self.tasks[i]
|
||||
if DataManager.DailyChallengeData:canClaimTask(i) then
|
||||
-- 任务奖励可领取
|
||||
taskObj:addRedPoint(30, 30, 0.6)
|
||||
taskObj:addRedPoint(30, 30, 1)
|
||||
taskObj:setSprite(GConst.ATLAS_PATH.DAILY_CHALLENGE, "daily_task_1")
|
||||
else
|
||||
-- 任务奖励不可领取
|
||||
|
||||
@ -74,10 +74,12 @@ function HeroDetailUI:onLoadRootComplete()
|
||||
self.pageBtns = {}
|
||||
self.pageBtnTxs = {}
|
||||
self.pageBtnLocks = {}
|
||||
self.pageRedImgs = {}
|
||||
for i = 1, 2 do
|
||||
self.pageBtns[i] = uiMap["hero_detail_ui.common.btns.page_btn_" .. i]
|
||||
self.pageBtnTxs[i] = uiMap["hero_detail_ui.common.btns.page_btn_" .. i .. ".text"]
|
||||
self.pageBtnLocks[i] = uiMap["hero_detail_ui.common.btns.page_btn_" .. i .. ".lock_img"]
|
||||
self.pageRedImgs[i] = uiMap["hero_detail_ui.red_node.red_img_" .. i]
|
||||
if self.pageBtnLocks[i] then
|
||||
self.pageBtnLocks[i]:setActive(not self:getIsOpen(i))
|
||||
end
|
||||
@ -128,28 +130,26 @@ function HeroDetailUI:onLoadRootComplete()
|
||||
self:onRefresh()
|
||||
end)
|
||||
self:bind(DataManager.BagData.ItemData, "dirty", function()
|
||||
self:refreshRedPoint()
|
||||
self:refreshPageBtn()
|
||||
end)
|
||||
self:addEventListener(EventManager.CUSTOM_EVENT.HERO_UPGRADE_SUCCESS, function(id)
|
||||
self:refreshRedPoint()
|
||||
self:refreshPageBtn()
|
||||
end)
|
||||
self:addEventListener(EventManager.CUSTOM_EVENT.EQUIP_UPSECTION_SUCCESS, function(part)
|
||||
Logger.logHighlight("升段:"..part)
|
||||
if part == GConst.EquipConst.PART_TYPE.STAR then
|
||||
self.compStar:playEffect(true, true)
|
||||
else
|
||||
self.compSkin:playUpgradeEffect(part)
|
||||
end
|
||||
self:refreshRedPoint()
|
||||
self:refreshPageBtn()
|
||||
end)
|
||||
self:addEventListener(EventManager.CUSTOM_EVENT.EQUIP_UPGRADE_SUCCESS, function(part)
|
||||
Logger.logHighlight("升级:"..part)
|
||||
if part == GConst.EquipConst.PART_TYPE.STAR then
|
||||
self.compStar:playEffect(true, false)
|
||||
else
|
||||
self.compSkin:playUpgradeEffect(part)
|
||||
end
|
||||
self:refreshRedPoint()
|
||||
self:refreshPageBtn()
|
||||
end)
|
||||
self:addEventListener(EventManager.CUSTOM_EVENT.GO_DUNGEON_UI, function()
|
||||
self:closeUI()
|
||||
@ -223,6 +223,11 @@ function HeroDetailUI:refreshPageInfo()
|
||||
elseif self.page == GConst.HeroConst.PANEL_TYPE.SKIN then
|
||||
self:showskinInfo()
|
||||
end
|
||||
self:refreshPageBtn()
|
||||
end
|
||||
|
||||
-- 刷新标签红点
|
||||
function HeroDetailUI:refreshPageBtn()
|
||||
if self.onlyLook then -- 仅查看的不显示升级和激活按钮
|
||||
self.leftBtn:setActive(false)
|
||||
self.rightBtn:setActive(false)
|
||||
@ -241,30 +246,11 @@ function HeroDetailUI:refreshPageInfo()
|
||||
self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.COMMON, "common_tab_2")
|
||||
self.pageBtnTxs[i]:setText("<color=#72778C>" .. self.btnTxs[i] .. "</color>")
|
||||
end
|
||||
self.pageRedImgs[i]:setActive(self.heroEntity:showRedPoint(i))
|
||||
end
|
||||
self:refreshRedPoint()
|
||||
end
|
||||
end
|
||||
|
||||
-- 刷新标签红点
|
||||
function HeroDetailUI:refreshRedPoint()
|
||||
-- if self.heroEntity:canLvUp() then
|
||||
-- self.btnHero:addRedPoint(-55, 0, 0.6)
|
||||
-- else
|
||||
-- self.btnHero:removeRedPoint()
|
||||
-- end
|
||||
-- if DataManager.EquipData:canUpgradeStar(self.heroEntity:getCfgId()) then
|
||||
-- self.btnStar:addRedPoint(-55, 0, 0.6)
|
||||
-- else
|
||||
-- self.btnStar:removeRedPoint()
|
||||
-- end
|
||||
-- if DataManager.EquipData:canUpgradeSkin(self.heroEntity:getCfgId()) then
|
||||
-- self.btnSkin:addRedPoint(-55, 0, 0.6)
|
||||
-- else
|
||||
-- self.btnSkin:removeRedPoint()
|
||||
-- end
|
||||
end
|
||||
|
||||
function HeroDetailUI:showHeroInfo()
|
||||
self.heroInfo:setActive(true)
|
||||
-- self.selectHero:setActive(true)
|
||||
|
||||
@ -224,16 +224,22 @@ function HeroInfoComp:refresh(checkLevel)
|
||||
local costs = {}
|
||||
costs[1] = {id = self.heroEntity:getFragmentId(), num = materials[1], type = 1}
|
||||
costs[2] = {id = self.heroEntity:getLvUpCostId(), num = materials[2], type = 1}
|
||||
local hadNums = {DataManager.BagData.ItemData:getItemNumById(costs[1].id), DataManager.BagData.ItemData:getItemNumById(costs[2].id)}
|
||||
for i,v in ipairs(self.costCells) do
|
||||
v:setActive(true)
|
||||
v:refreshByConfig(costs[i])
|
||||
if hadNums[i] >= costs[i].num then
|
||||
v:setNumTx(hadNums[i] .. "/" .. costs[i].num)
|
||||
else
|
||||
v:setNumTx("<color=#D82F2D>" .. hadNums[i] .. "</color>" .. "/" .. costs[i].num)
|
||||
end
|
||||
end
|
||||
|
||||
if canLvUp then
|
||||
self.btnUp:setTouchEnable(true)
|
||||
self.btnUp5:setTouchEnable(true)
|
||||
self.btnUp:addRedPoint(70, 30, 0.6)
|
||||
self.btnUp5:addRedPoint(70, 30, 0.6)
|
||||
self.btnUp:addRedPoint(70, 30, 1)
|
||||
self.btnUp5:addRedPoint(70, 30, 1)
|
||||
self.btnUp:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[1])
|
||||
self.btnUp5:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[2])
|
||||
else
|
||||
@ -263,7 +269,6 @@ function HeroInfoComp:refresh(checkLevel)
|
||||
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
|
||||
|
||||
@ -279,7 +279,7 @@ function IdleDropUI:refreshBtns()
|
||||
else
|
||||
self.adBtn:setTouchEnable(true)
|
||||
self.adBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_orange_1")
|
||||
self.adBtn:addRedPoint(60, 30, 0.5)
|
||||
self.adBtn:addRedPoint(60, 30, 1)
|
||||
end
|
||||
end
|
||||
|
||||
@ -316,7 +316,7 @@ function IdleDropUI:addGetBtnRedPoint()
|
||||
return
|
||||
end
|
||||
self.getBtnRedPoint = true
|
||||
self.getBtn:addRedPoint(70, 30, 0.5)
|
||||
self.getBtn:addRedPoint(70, 30, 1)
|
||||
end
|
||||
|
||||
function IdleDropUI:removeGetBtnRedPoint()
|
||||
@ -332,7 +332,7 @@ function IdleDropUI:addQuickBtnRedPoint()
|
||||
return
|
||||
end
|
||||
self.quickBtnRedPoint = true
|
||||
self.quickBtn:addRedPoint(90, 30, 0.5)
|
||||
self.quickBtn:addRedPoint(90, 30, 1)
|
||||
end
|
||||
|
||||
function IdleDropUI:removeQuickBtnRedPoint()
|
||||
|
||||
@ -168,7 +168,7 @@ function ArenaComp:refreshShow()
|
||||
end
|
||||
|
||||
if DataManager.ArenaData:hasSeasonReward() then
|
||||
self.btnReward:addRedPoint(30, 25, 0.6)
|
||||
self.btnReward:addRedPoint(30, 25, 1)
|
||||
else
|
||||
self.btnReward:removeRedPoint()
|
||||
end
|
||||
@ -263,7 +263,7 @@ end
|
||||
-- 刷新段位奖励红点
|
||||
function ArenaComp:refreshGradingRewardRedPoint()
|
||||
if DataManager.ArenaData:hasGradingRewardRedDot() then
|
||||
self.btnGradingReward:addRedPoint(50, 50, 0.6)
|
||||
self.btnGradingReward:addRedPoint(50, 50, 1)
|
||||
else
|
||||
self.btnGradingReward:removeRedPoint()
|
||||
end
|
||||
|
||||
@ -283,19 +283,19 @@ function MainComp:refreshRedPoint()
|
||||
local time = Time:getServerTime() - DataManager.IdleData:getLastDropTime()
|
||||
local idleMaxTime = DataManager.IdleData:getIdleMaxTime()
|
||||
if time >= idleMaxTime or DataManager.IdleData:getQuickIdleRemainTimes() > 0 then
|
||||
self.leftBtn:addRedPoint(70, 20, 0.5)
|
||||
self.leftBtn:addRedPoint(70, 20, 1)
|
||||
else
|
||||
self.leftBtn:removeRedPoint()
|
||||
end
|
||||
|
||||
if DataManager.SummonData:hasSummonCostRedPoint() then
|
||||
self.rightBtn:addRedPoint(-70, 20, 0.5)
|
||||
self.rightBtn:addRedPoint(-70, 20, 1)
|
||||
else
|
||||
self.rightBtn:removeRedPoint()
|
||||
end
|
||||
|
||||
if DataManager.ArenaData:hasEntranceRedDot() then
|
||||
self.arenaBtn:addRedPoint(70, 26, 0.5)
|
||||
self.arenaBtn:addRedPoint(70, 26, 1)
|
||||
else
|
||||
self.arenaBtn:removeRedPoint()
|
||||
end
|
||||
|
||||
@ -826,7 +826,7 @@ function MainCityUI:refreshTask()
|
||||
self.taskBtn:setVisible(true)
|
||||
local showRedPoint = DataManager.DailyTaskData:showRedPoint()
|
||||
if showRedPoint then
|
||||
self.taskBtn:addRedPoint(32, 28, 0.5)
|
||||
self.taskBtn:addRedPoint(32, 28, 1)
|
||||
else
|
||||
self.taskBtn:removeRedPoint()
|
||||
end
|
||||
@ -976,7 +976,7 @@ function MainCityUI:setLeftSideBarArrowRedPoint(isShow)
|
||||
end
|
||||
if isShow then
|
||||
if ModuleManager.MaincityManager:getIsMainCityLeftSideBarClose() then
|
||||
self.leftArrowBtn:addRedPoint(19, 10, 0.6)
|
||||
self.leftArrowBtn:addRedPoint(19, 10, 1)
|
||||
else
|
||||
self.leftArrowBtn:removeRedPoint()
|
||||
end
|
||||
@ -991,7 +991,7 @@ function MainCityUI:setRightSideBarArrowRedPoint(isShow)
|
||||
end
|
||||
if isShow then
|
||||
if ModuleManager.MaincityManager:getIsMainCityRightSideBarClose() then
|
||||
self.rightArrowBtn:addRedPoint(19, 10, 0.6)
|
||||
self.rightArrowBtn:addRedPoint(19, 10, 1)
|
||||
else
|
||||
self.rightArrowBtn:removeRedPoint()
|
||||
end
|
||||
@ -1017,13 +1017,13 @@ function MainCityUI:refreshBottomRp()
|
||||
local uiMap = self.root:genAllChildren()
|
||||
local heroRpObj = uiMap["main_ui.bottom_node.icons.ui_spine_obj_2.rp_node"]
|
||||
if DataManager.HeroData:getRp() then
|
||||
heroRpObj:addRedPoint(0, 0, 0.7)
|
||||
heroRpObj:addRedPoint(0, 0, 1)
|
||||
else
|
||||
heroRpObj:removeRedPoint()
|
||||
end
|
||||
local shopRpObj = uiMap["main_ui.bottom_node.icons.ui_spine_obj_3.rp_node"]
|
||||
if DataManager.ShopData:getRp() then
|
||||
shopRpObj:addRedPoint(0, 0, 0.7)
|
||||
shopRpObj:addRedPoint(0, 0, 1)
|
||||
else
|
||||
shopRpObj:removeRedPoint()
|
||||
end
|
||||
@ -1031,7 +1031,7 @@ end
|
||||
|
||||
function MainCityUI:refreshSettingBtn()
|
||||
if (DataManager.MailData:getIsOpen() and DataManager.MailData:getRedPoint()) or DataManager.AIHelperData:getRp() then
|
||||
self.settingbtn:addRedPoint(40, 40, 0.7)
|
||||
self.settingbtn:addRedPoint(40, 40, 1)
|
||||
else
|
||||
self.settingbtn:removeRedPoint()
|
||||
end
|
||||
|
||||
@ -21,7 +21,7 @@ function AvatarCell:refresh(id, isSelect)
|
||||
|
||||
-- 红点
|
||||
if DataManager.PlayerData:isNewAvatar(self.id) then
|
||||
self.baseObject:addRedPoint(45, 45, 0.6)
|
||||
self.baseObject:addRedPoint(45, 45, 1)
|
||||
else
|
||||
self.baseObject:removeRedPoint()
|
||||
end
|
||||
|
||||
@ -21,7 +21,7 @@ function FrameCell:refresh(id, isSelect)
|
||||
|
||||
-- 红点
|
||||
if DataManager.PlayerData:isNewFrame(self.id) then
|
||||
self.baseObject:addRedPoint(45, 45, 0.6)
|
||||
self.baseObject:addRedPoint(45, 45, 1)
|
||||
else
|
||||
self.baseObject:removeRedPoint()
|
||||
end
|
||||
|
||||
@ -125,12 +125,12 @@ function PlayerInfoUI:onRefresh()
|
||||
|
||||
-- 红点
|
||||
if DataManager.PlayerData:hasNewAvatar() then
|
||||
self.tagAvatar:addRedPoint(120, 20, 0.6)
|
||||
self.tagAvatar:addRedPoint(120, 20, 1)
|
||||
else
|
||||
self.tagAvatar:removeRedPoint()
|
||||
end
|
||||
if DataManager.PlayerData:hasNewFrame() then
|
||||
self.tagFrame:addRedPoint(120, 20, 0.6)
|
||||
self.tagFrame:addRedPoint(120, 20, 1)
|
||||
else
|
||||
self.tagFrame:removeRedPoint()
|
||||
end
|
||||
|
||||
@ -281,7 +281,7 @@ function SummonMainUI:refreshSummonBtn()
|
||||
if freeCount <= 0 then
|
||||
if hadNum >= 1 then
|
||||
self.txNumOne:setText(1)
|
||||
self.btnSummonOne:addRedPoint(124, 32, 0.6)
|
||||
self.btnSummonOne:addRedPoint(124, 32, 1)
|
||||
self.imgSummonOneIcon:setSprite(ModuleManager.ItemManager:getItemIcon(costId))
|
||||
else
|
||||
self.btnSummonOne:removeRedPoint()
|
||||
@ -300,7 +300,7 @@ function SummonMainUI:refreshSummonBtn()
|
||||
if hadNum >= 10 then
|
||||
self.txNumTen:setText(10)
|
||||
self.imgSummonTenIcon:setSprite(ModuleManager.ItemManager:getItemIcon(costId))
|
||||
self.btnSummonTen:addRedPoint(124, 32, 0.6)
|
||||
self.btnSummonTen:addRedPoint(124, 32, 1)
|
||||
else
|
||||
self.btnSummonTen:removeRedPoint()
|
||||
local cost = DataManager.SummonData:getSummonGemCost(self.page)
|
||||
|
||||
@ -114,7 +114,7 @@ function SummonRewardUI:refreshSummonBtn()
|
||||
if freeCount <= 0 then
|
||||
if count >= 1 then
|
||||
self.txNumOne:setText(1)
|
||||
self.btnSummonOne:addRedPoint(100, 30, 0.6)
|
||||
self.btnSummonOne:addRedPoint(100, 30, 1)
|
||||
else
|
||||
self.btnSummonOne:removeRedPoint()
|
||||
if cost then
|
||||
@ -135,7 +135,7 @@ function SummonRewardUI:refreshSummonBtn()
|
||||
obj = DataManager.BagData.ItemData:getItemById(costId)
|
||||
if count >= 10 then
|
||||
self.txNumTen:setText(10)
|
||||
self.btnSummonTen:addRedPoint(100, 30, 0.6)
|
||||
self.btnSummonTen:addRedPoint(100, 30, 1)
|
||||
else
|
||||
self.btnSummonTen:removeRedPoint()
|
||||
if cost then
|
||||
@ -223,7 +223,7 @@ function SummonRewardUI:doUITweenShake(delayTime)
|
||||
if self.shakeSeq then
|
||||
self.shakeSeq:Kill()
|
||||
end
|
||||
local duration = 0.6 -- 震动持续时间(秒)
|
||||
local duration = 1 -- 震动持续时间(秒)
|
||||
local strength = BF.Vector2(20, 20) -- 震动强度
|
||||
local vibrato = 60 -- 震动频率
|
||||
local randomness = 90 -- 震动随机性
|
||||
|
||||
@ -765,4 +765,13 @@ function HeroEntity:_getAttrPower()
|
||||
end
|
||||
--@endregion
|
||||
|
||||
--@region 红点
|
||||
function HeroEntity:showRedPoint(page)
|
||||
if page == GConst.HeroConst.PANEL_TYPE.HERO then
|
||||
return self:canLvUp()
|
||||
elseif page == GConst.HeroConst.PANEL_TYPE.STAR then
|
||||
return self:canStarUp()
|
||||
end
|
||||
end
|
||||
--@endregion
|
||||
return HeroEntity
|
||||
Loading…
x
Reference in New Issue
Block a user