From 82b1de6537aab132bf090b59bc828de8175ab710 Mon Sep 17 00:00:00 2001 From: zhangqiang <657634622@qq.com> Date: Tue, 30 Mar 2021 17:17:11 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=A7=B0=E5=8F=B7=E5=9D=90=E9=AA=91?= =?UTF-8?q?=E6=97=B6=E8=A3=85=E3=80=91=E9=A3=98=E6=88=98=E5=8A=9B=20=20?= =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/ManagedResources/~Lua/Logic/GameEvent.lua | 1 + Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua | 10 +++++++++- .../~Lua/Modules/Popup/RewardItemSingleShowPopup.lua | 11 ++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Logic/GameEvent.lua b/Assets/ManagedResources/~Lua/Logic/GameEvent.lua index a6e6e8f693..0446d97fcc 100644 --- a/Assets/ManagedResources/~Lua/Logic/GameEvent.lua +++ b/Assets/ManagedResources/~Lua/Logic/GameEvent.lua @@ -153,6 +153,7 @@ GameEvent = { OnBagItemNumChange = "Bag.OnBagItemNumChange", GetNewItem = "Bag.GetNewItem",--得一个新item OnRefreshSoulPanelData="Bag.OnRefreshSoulPanelData", + OnBagShowWarPowerChange="Bag.OnBagShowWarPowerChange", }, Adventure = { OnAreaStateChange = "Adventure.OnAreaStateChange", diff --git a/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua b/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua index 258562e13a..d2b5c8da26 100644 --- a/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua @@ -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 \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua b/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua index ee5bf5592c..ec0bbfc163 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemSingleShowPopup.lua @@ -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 \ No newline at end of file