【称号坐骑时装】飘战力 快捷跳转

dev_chengFeng
zhangqiang 2021-03-30 17:17:11 +08:00
parent 9faf244e40
commit 82b1de6537
3 changed files with 20 additions and 2 deletions

View File

@ -153,6 +153,7 @@ GameEvent = {
OnBagItemNumChange = "Bag.OnBagItemNumChange",
GetNewItem = "Bag.GetNewItem",--得一个新item
OnRefreshSoulPanelData="Bag.OnRefreshSoulPanelData",
OnBagShowWarPowerChange="Bag.OnBagShowWarPowerChange",
},
Adventure = {
OnAreaStateChange = "Adventure.OnAreaStateChange",

View File

@ -493,6 +493,7 @@ function BagPanel:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.BagGoldChangeCallBackOnClickTabBtn)
Game.GlobalEvent:AddEvent(GameEvent.Bag.OnRefreshSoulPanelData, this.OnRefreshSoulPanelBagData)
Game.GlobalEvent:AddEvent(GameEvent.Player.OnChangeName, this.FreshPlayerInfo)
Game.GlobalEvent:AddEvent(GameEvent.Bag.OnBagShowWarPowerChange, this.ShowWarPowerChange)
end
--移除事件监听(用于子类重写)
@ -502,6 +503,7 @@ function BagPanel:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.BagGoldChangeCallBackOnClickTabBtn)
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.OnRefreshSoulPanelData, this.OnRefreshSoulPanelBagData)
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnChangeName, this.FreshPlayerInfo)
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.OnBagShowWarPowerChange, this.ShowWarPowerChange)
end
--界面打开时调用(用于子类重写)
function BagPanel:OnOpen(_sortIndex)
@ -806,5 +808,11 @@ function this.ShowGuideGo()
JumpManager.ShowGuide(UIName.BagPanel, item1Btn)
end
end
function this.ShowWarPowerChange()
Timer.New(function()
MsgPanel.ShowTwo("是否前往坐骑界面?",nil,function()
UIManager.OpenPanel(UIName.SettingPanel,2)
end)
end, 1):Start()
end
return BagPanel

View File

@ -158,12 +158,14 @@ function RewardItemSingleShowPopup:BindEvent()
end)
end
elseif itemConfigData.ItemType == ItemType.Ride then
local oldPowerNum = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
if PlayerManager.userMountList[itemConfigData.Id] then
MsgPanel.ShowTwo("当前已激活该坐骑,是否要重复使用?",nil,function()
NetManager.ActiveUserMountRequest(itemSid,function (msg)
PlayerManager.SetPlayerMountTime(itemSid,msg.validTime)
self:ClosePanel()
PopupTipPanel.ShowTip("成功激活坐骑!")
this.WarPowerChange(oldPowerNum)
end)
end)
else
@ -171,6 +173,7 @@ function RewardItemSingleShowPopup:BindEvent()
PlayerManager.SetPlayerMountTime(itemSid,msg.validTime)
self:ClosePanel()
PopupTipPanel.ShowTip("成功激活坐骑!")
this.WarPowerChange(oldPowerNum)
end)
end
elseif itemConfigData then
@ -378,5 +381,11 @@ end
function RewardItemSingleShowPopup:OnDestroy()
end
function this.WarPowerChange(oldPowerNum)
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnBagShowWarPowerChange,oldPowerNum)
local newPowerNum = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
if oldPowerNum ~= newPowerNum then
UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldPowerNum,newValue = newPowerNum})
end
end
return RewardItemSingleShowPopup