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 --上阵 协议