diff --git a/Assets/ManagedResources/~Lua/Modules/Map/View/EndLessMapView.lua b/Assets/ManagedResources/~Lua/Modules/Map/View/EndLessMapView.lua index 1cb5a6eeab..009e02663c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Map/View/EndLessMapView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Map/View/EndLessMapView.lua @@ -128,7 +128,7 @@ function EndLessMapView:BindEvent() end MsgPanel.ShowTwo("是否消耗一枚九元露,复活所有神将并将血量恢复为100%?", function()end, function() NetManager.UseAddHpItemRequest(tostring(-1),function () - this.btnJiuYuanLuNum.text = (this.num - 1) + this:OnShow() PopupTipPanel.ShowTip("已将所有神将复活并恢复至满血!") end) end, "取消", "确认", "提示",false) @@ -316,6 +316,7 @@ function EndLessMapView:AddListener() Game.GlobalEvent:AddEvent(GameEvent.Map.EnergyFull, EndLessMapManager.EndlessRedCheck) Game.GlobalEvent:AddEvent(GameEvent.EndLess.MissonChange,this.RefreshTargetRoote) Game.GlobalEvent:AddEvent(GameEvent.EndLess.RefreshHeroData,this.OnShow) + Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold,this.RefreshItemNum) end function EndLessMapView:RemoveListener() @@ -324,9 +325,13 @@ function EndLessMapView:RemoveListener() Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.GetBagEnergy) Game.GlobalEvent:RemoveEvent(GameEvent.Map.EnergyFull, EndLessMapManager.EndlessRedCheck) Game.GlobalEvent:RemoveEvent(GameEvent.EndLess.RefreshHeroData,this.OnShow) + Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold,this.RefreshItemNum) end - +function this.RefreshItemNum() + this.num = BagManager.GetItemCountById(EndLessMapManager.JiuYaunLuId) + this.btnJiuYuanLuNum.text = this.num +end function EndLessMapView:OnOpen() -- 初始化组件显示