From 6c5acdab26bf689d7dddc234cf5abed16286ccfc Mon Sep 17 00:00:00 2001 From: yuanshuai <243578945@qq.com> Date: Fri, 31 Mar 2023 18:20:38 +0800 Subject: [PATCH] =?UTF-8?q?=20=E7=A5=9E=E5=85=B5=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/GodWeapon/GodWeaponInfoPanel.lua | 10 +++++++--- .../Modules/GodWeapon/GodWeaponListPanel_UpWar.lua | 13 +++++++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/GodWeapon/GodWeaponInfoPanel.lua b/Assets/ManagedResources/~Lua/Modules/GodWeapon/GodWeaponInfoPanel.lua index 64ef1135dd..56d2273a2a 100644 --- a/Assets/ManagedResources/~Lua/Modules/GodWeapon/GodWeaponInfoPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/GodWeapon/GodWeaponInfoPanel.lua @@ -44,21 +44,25 @@ end --添加事件监听(用于子类重写) function this:AddListener() - -- Game.GlobalEvent:AddEvent(GameEvent.GodWeapon.RefreshGodWeaponInfoPanel, this.ShowPower) + Game.GlobalEvent:AddEvent(GameEvent.GodWeapon.RefreshGodWeaponInfoPanel, this.UpdateWin) end --移除事件监听(用于子类重写) function this:RemoveListener() - + Game.GlobalEvent:RemoveEvent(GameEvent.GodWeapon.RefreshGodWeaponInfoPanel, this.UpdateWin) end --界面打开时调用(用于子类重写) function this:OnOpen(_data) + this.UpdateWin(_data) +end + +function this.UpdateWin(_data) godwData=_data this.icon.sprite = this.spLoader:LoadSprite(GetResourcePath(_data.config.Icon)) this.nameText.text=_data.config.Name local starSize = Vector2.New(65,65) - PokemonManager.SetHeroStars(this.spLoader, this.starGrid,godwData.star,1,starSize) + PokemonManager.SetHeroStars(this.spLoader, this.starGrid,_data.star,1,starSize) local allPropDic=GodWeaponManager.GetSinglePokemonAddProData(_data.Did,_data.star) local propInfoList={} propInfoList[1]={} diff --git a/Assets/ManagedResources/~Lua/Modules/GodWeapon/GodWeaponListPanel_UpWar.lua b/Assets/ManagedResources/~Lua/Modules/GodWeapon/GodWeaponListPanel_UpWar.lua index 283b13c480..c1f47c6cc0 100644 --- a/Assets/ManagedResources/~Lua/Modules/GodWeapon/GodWeaponListPanel_UpWar.lua +++ b/Assets/ManagedResources/~Lua/Modules/GodWeapon/GodWeaponListPanel_UpWar.lua @@ -77,10 +77,15 @@ function this.SingleItemDataShow(_go,_itemData) SetHeroStars(this.spLoader, Util.GetGameObject(_go.transform, "star/starGrid"), _itemData.star,1,starSize,-5,Vector2.New(0.5,0.5)) Util.AddOnceClick(Util.GetGameObject(_go.transform,"upZhen"), function() if curUpZhenPokemonData then - NetManager.RequestMagicSoldierExchange(curUpZhenPokemonData.Did,_itemData.dynamicId,function() - GodWeaponManager.ChangeWeaponPos(curUpZhenPokemonData.Did,_itemData.dynamicId) - local godWeaponData=GodWeaponManager.GetSingleWeaponData(_itemData.dynamicId) - UIManager.OpenPanel(UIName.GodWeaponInfoPanel,godWeaponData) + NetManager.RequestMagicSoldierLocation(curUpZhenPokemonData.Did,0,function() + local upPos=curUpZhenPokemonData.point + GodWeaponManager.SetWeaponUpZhen(curUpZhenPokemonData.Did,0) + NetManager.RequestMagicSoldierLocation(_itemData.dynamicId,upPos,function() + GodWeaponManager.SetWeaponUpZhen(_itemData.dynamicId,upPos) + local godWeaponData=GodWeaponManager.GetSingleWeaponData(_itemData.dynamicId) + Game.GlobalEvent:DispatchEvent(GameEvent.GodWeapon.RefreshGodWeaponInfoPanel,godWeaponData) + parent:ClosePanel() + end) end) else --上阵 协议