【人物信息栏】修复战力刷新不及时的问题

dev_chengFeng
gaoxin 2021-03-30 20:46:47 +08:00
parent f9d9a0b5cc
commit 6e34c88fa5
10 changed files with 32 additions and 5 deletions

View File

@ -51,6 +51,7 @@ GameEvent = {
Formation = {
--队伍数据改变
OnFormationChange = "Formation.OnFormationChange",
OnFormationPowerChange = "Formation.OnFormationPowerChange",
-- 重置队伍血量
OnResetFormationHp = "Formation.OnResetFormationHp",
-- 掉血消息

View File

@ -506,6 +506,8 @@ function BagPanel:OnShow()
BagManager.isBagPanel = true
this.SetBottomBarIsActive()
-- 刷新一次编队战斗力
FormationManager.RefreshMainFormationPower()
end
--特殊的开启条件
function this.SetBottomBarIsActive()

View File

@ -247,6 +247,10 @@ function CarbonTypePanelV2:OnShow(...)
-- CarbonTypePanelV2:PlayAni()
CarbonManager.GetMissionLevelData()
this.PlayScaleAnim()
-- 刷新一次编队战斗力
FormationManager.RefreshMainFormationPower()
end
function this.UpdateCarbonContent()

View File

@ -416,6 +416,9 @@ function FightPointPassMainPanel:OnShow()
PlayerManager.StarBattleUpLvTipTime(2)
this.battleUpLvTip:SetActive(false)
Util.GetGameObject(this.btnXiaoYao,"curValue/num"):GetComponent("Text").text=string.format("%d/%d",BagManager.GetItemCountById(UpViewRechargeType.YunYouVle),PrivilegeManager.GetPrivilegeNumber(39))
-- 刷新一次编队战斗力
FormationManager.RefreshMainFormationPower()
end
--寻宝显示
function this.UpdateFindTreasureMaterialNum()

View File

@ -248,9 +248,16 @@ function this.GetFormationPower(formationId)
ThinkingAnalyticsManager.SetSuperProperties({
fighting_capacity = power,
})
-- 编队战斗力刷新
Game.GlobalEvent:DispatchEvent(GameEvent.Formation.OnFormationPowerChange, power)
return power
end
-- 刷新主线编队战斗力
function this.RefreshMainFormationPower()
this.GetFormationPower(this.curFormationIndex)
end
--某个妖灵师战力发生变化检查是否在任何一个编队
function this.CheckHeroIdExist(heroId)
if not heroId then

View File

@ -287,6 +287,9 @@ function GuildMainCityPanel:OnShow()
this.LiveGO = poolManager:LoadLive(this.LiveName, this.btntranscriptLive.transform,
Vector3.one * 0.15, Vector3.New(0,0,0))
end
-- 刷新一次编队战斗力
FormationManager.RefreshMainFormationPower()
end
function this:OnSortingOrderChange()

View File

@ -777,7 +777,8 @@ function this:OnShow()
this.RefreshActivityShow()
this.RefreshFuncNewText()
this.RefreshGiftBtnShow()
-- 刷新一次编队战斗力
FormationManager.RefreshMainFormationPower()
-- 主界面time创建

View File

@ -155,6 +155,8 @@ function RoleListPanel:OnShow()
-- if this.ScrollView then
-- this.ScrollView:SetIndex(1)
-- end
-- 刷新一次编队战斗力
FormationManager.RefreshMainFormationPower()
end
--组合当前选项数据

View File

@ -152,6 +152,9 @@ end
function VipPanelV2:OnShow()
self:InitVipContext()
self:SetPanelStatus()
-- 刷新一次编队战斗力
FormationManager.RefreshMainFormationPower()
end
function VipPanelV2:OnClose()

View File

@ -57,7 +57,7 @@ function PlayerInfoView:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Player.OnChangeName, self.OnShow, self)
Game.GlobalEvent:AddEvent(GameEvent.Player.OnHeadFrameChange, self.OnShow, self)
Game.GlobalEvent:AddEvent(GameEvent.Player.OnHeadChange, self.OnShow, self)
Game.GlobalEvent:AddEvent(GameEvent.Formation.OnFormationChange, self.RefreshPower, self)
Game.GlobalEvent:AddEvent(GameEvent.Formation.OnFormationPowerChange, self.RefreshPower, self)
-- 绑定红点
BindRedPointObject(RedPointType.Setting, self.headRedpot)
@ -71,7 +71,7 @@ function PlayerInfoView:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnChangeName, self.OnShow, self)
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnHeadFrameChange, self.OnShow, self)
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnHeadChange, self.OnShow, self)
Game.GlobalEvent:RemoveEvent(GameEvent.Formation.OnFormationChange, self.RefreshPower, self)
Game.GlobalEvent:RemoveEvent(GameEvent.Formation.OnFormationPowerChange, self.RefreshPower, self)
-- 解除绑定
ClearRedPointObject(RedPointType.Setting, self.headRedpot)
@ -107,8 +107,9 @@ function PlayerInfoView:OnShow()
end
function PlayerInfoView:RefreshPower()
self.heroTeamPower.text = FormationManager.GetFormationPower(FormationManager.curFormationIndex)
function PlayerInfoView:RefreshPower(force)
self.heroTeamPower.text = force
-- self.heroTeamPower.text = FormationManager.GetFormationPower(FormationManager.curFormationIndex)
end
--界面关闭时调用(用于子类重写)