【称号坐骑时装】飘战力 快捷跳转
parent
9faf244e40
commit
82b1de6537
|
@ -153,6 +153,7 @@ GameEvent = {
|
||||||
OnBagItemNumChange = "Bag.OnBagItemNumChange",
|
OnBagItemNumChange = "Bag.OnBagItemNumChange",
|
||||||
GetNewItem = "Bag.GetNewItem",--得一个新item
|
GetNewItem = "Bag.GetNewItem",--得一个新item
|
||||||
OnRefreshSoulPanelData="Bag.OnRefreshSoulPanelData",
|
OnRefreshSoulPanelData="Bag.OnRefreshSoulPanelData",
|
||||||
|
OnBagShowWarPowerChange="Bag.OnBagShowWarPowerChange",
|
||||||
},
|
},
|
||||||
Adventure = {
|
Adventure = {
|
||||||
OnAreaStateChange = "Adventure.OnAreaStateChange",
|
OnAreaStateChange = "Adventure.OnAreaStateChange",
|
||||||
|
|
|
@ -493,6 +493,7 @@ function BagPanel:AddListener()
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.BagGoldChangeCallBackOnClickTabBtn)
|
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.BagGoldChangeCallBackOnClickTabBtn)
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.Bag.OnRefreshSoulPanelData, this.OnRefreshSoulPanelBagData)
|
Game.GlobalEvent:AddEvent(GameEvent.Bag.OnRefreshSoulPanelData, this.OnRefreshSoulPanelBagData)
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.Player.OnChangeName, this.FreshPlayerInfo)
|
Game.GlobalEvent:AddEvent(GameEvent.Player.OnChangeName, this.FreshPlayerInfo)
|
||||||
|
Game.GlobalEvent:AddEvent(GameEvent.Bag.OnBagShowWarPowerChange, this.ShowWarPowerChange)
|
||||||
end
|
end
|
||||||
|
|
||||||
--移除事件监听(用于子类重写)
|
--移除事件监听(用于子类重写)
|
||||||
|
@ -502,6 +503,7 @@ function BagPanel:RemoveListener()
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.BagGoldChangeCallBackOnClickTabBtn)
|
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.BagGoldChangeCallBackOnClickTabBtn)
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.OnRefreshSoulPanelData, this.OnRefreshSoulPanelBagData)
|
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.OnRefreshSoulPanelData, this.OnRefreshSoulPanelBagData)
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnChangeName, this.FreshPlayerInfo)
|
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnChangeName, this.FreshPlayerInfo)
|
||||||
|
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.OnBagShowWarPowerChange, this.ShowWarPowerChange)
|
||||||
end
|
end
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
function BagPanel:OnOpen(_sortIndex)
|
function BagPanel:OnOpen(_sortIndex)
|
||||||
|
@ -806,5 +808,11 @@ function this.ShowGuideGo()
|
||||||
JumpManager.ShowGuide(UIName.BagPanel, item1Btn)
|
JumpManager.ShowGuide(UIName.BagPanel, item1Btn)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
function this.ShowWarPowerChange()
|
||||||
|
Timer.New(function()
|
||||||
|
MsgPanel.ShowTwo("是否前往坐骑界面?",nil,function()
|
||||||
|
UIManager.OpenPanel(UIName.SettingPanel,2)
|
||||||
|
end)
|
||||||
|
end, 1):Start()
|
||||||
|
end
|
||||||
return BagPanel
|
return BagPanel
|
|
@ -158,12 +158,14 @@ function RewardItemSingleShowPopup:BindEvent()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
elseif itemConfigData.ItemType == ItemType.Ride then
|
elseif itemConfigData.ItemType == ItemType.Ride then
|
||||||
|
local oldPowerNum = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
|
||||||
if PlayerManager.userMountList[itemConfigData.Id] then
|
if PlayerManager.userMountList[itemConfigData.Id] then
|
||||||
MsgPanel.ShowTwo("当前已激活该坐骑,是否要重复使用?",nil,function()
|
MsgPanel.ShowTwo("当前已激活该坐骑,是否要重复使用?",nil,function()
|
||||||
NetManager.ActiveUserMountRequest(itemSid,function (msg)
|
NetManager.ActiveUserMountRequest(itemSid,function (msg)
|
||||||
PlayerManager.SetPlayerMountTime(itemSid,msg.validTime)
|
PlayerManager.SetPlayerMountTime(itemSid,msg.validTime)
|
||||||
self:ClosePanel()
|
self:ClosePanel()
|
||||||
PopupTipPanel.ShowTip("成功激活坐骑!")
|
PopupTipPanel.ShowTip("成功激活坐骑!")
|
||||||
|
this.WarPowerChange(oldPowerNum)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
|
@ -171,6 +173,7 @@ function RewardItemSingleShowPopup:BindEvent()
|
||||||
PlayerManager.SetPlayerMountTime(itemSid,msg.validTime)
|
PlayerManager.SetPlayerMountTime(itemSid,msg.validTime)
|
||||||
self:ClosePanel()
|
self:ClosePanel()
|
||||||
PopupTipPanel.ShowTip("成功激活坐骑!")
|
PopupTipPanel.ShowTip("成功激活坐骑!")
|
||||||
|
this.WarPowerChange(oldPowerNum)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
elseif itemConfigData then
|
elseif itemConfigData then
|
||||||
|
@ -378,5 +381,11 @@ end
|
||||||
function RewardItemSingleShowPopup:OnDestroy()
|
function RewardItemSingleShowPopup:OnDestroy()
|
||||||
|
|
||||||
end
|
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
|
return RewardItemSingleShowPopup
|
Loading…
Reference in New Issue