From 5a3572d65dc4e2d63b438b73f1ff9ed0fa522262 Mon Sep 17 00:00:00 2001 From: wangzhenxing <1545929779@qq.com> Date: Tue, 2 Apr 2024 15:24:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E8=AE=AD=E6=B7=BB=E5=8A=A0=E7=A5=9E?= =?UTF-8?q?=E5=85=B5=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Net/NetManager.lua | 15 +- .../RoleInfo/SpecailTrainingInfoPopup.lua | 148 +++++++++++------- .../RoleInfo/TrainingItemListPanel.lua | 66 ++++---- 3 files changed, 130 insertions(+), 99 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index 6b373f9476..f8e5e12c41 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -7720,14 +7720,15 @@ function NetManager.TrainingUnlockSkillRequest(_heroid,_unlockId,pockemensId,mag end end if pockemensId then - - for i = 1, #pockemensId do - data.pokemonIds:append(tostring(pockemensId[i])) - end - - + for i = 1, #pockemensId do + data.pokemonIds:append(tostring(pockemensId[i])) + end + end + if magicSoldierIds then + for i = 1, #magicSoldierIds do + data.magicSoldierIds:append(tostring(magicSoldierIds[i])) + end end - --data.incarnationCards= incarnationCards if item then if item.itemtype==56 then diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/SpecailTrainingInfoPopup.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/SpecailTrainingInfoPopup.lua index 612878bd7c..7267fbc4e6 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/SpecailTrainingInfoPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/SpecailTrainingInfoPopup.lua @@ -76,7 +76,9 @@ function SpecailTrainingInfoPopup:OnShow() self:SetSingleData(index,go,self.showList[index]) LayoutRebuilder.ForceRebuildLayoutImmediate(go.transform) end) - + --ForceRebuildLayout(self.GameObject.transform) + UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(self.GameObject.transform) + UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(self.GameObject.transform) self.ScrollView:SetIndex(1) LayoutRebuilder.ForceRebuildLayoutImmediate(self.GameObject.transform) end @@ -304,18 +306,26 @@ function SpecailTrainingInfoPopup:SetSingleData(index,_go,_data) end local item={} local pokemenons={} - + local godWeapon={} + --local noHeroList={} if selectSkillUnlockItems1[1].type==3 then for i=1,#selectSkillUnlockItems1 do local t=selectSkillUnlockItems1[i] local pockemen={} pokemenons[i]=selectSkillUnlockItems1[i].dynamicId end - + --noHeroList=pokemenons + elseif selectSkillUnlockItems1[1].type==4 then + for i=1,#selectSkillUnlockItems1 do + local t=selectSkillUnlockItems1[i] + local pockemen={} + godWeapon[i]=selectSkillUnlockItems1[i].dynamicId + end + --noHeroList=godWeapon else - item.id=selectSkillUnlockItems1[1].itemData.id - item.itemNum=1 - item.itemtype=selectSkillUnlockItems1[1].itemData.itemType + item.id=selectSkillUnlockItems1[1].itemData.id + item.itemNum=1 + item.itemtype=selectSkillUnlockItems1[1].itemData.itemType end local TrainingUnlockSkillHeroItem={} for i=1,#selectSkillUnlockItems2 do @@ -333,46 +343,56 @@ function SpecailTrainingInfoPopup:SetSingleData(index,_go,_data) local magicSoldierIds={} magicSoldierIds[1]="" - NetManager.TrainingUnlockSkillRequest( self._curHerodata.dynamicId,tData.Id,pokemenons,nil,TrainingUnlockSkillHeroItem,item,function (msg) - UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1) - if #TrainingUnlockSkillHeroItem>0 then - local t={} - for i=1 ,#TrainingUnlockSkillHeroItem do - t[i]=TrainingUnlockSkillHeroItem[i].id - end - HeroManager.DeleteHeroDatas(t) - end - - if pokemenons and #pokemenons>0 then - PokemonManager.RemovePokemonData(pokemenons) - end - if self.OpenType==1 then - if CheckListIsContainValue1(self._curHerodata.HeroTraining.unlockIds,tData.Id) then - Chose:SetActive(false) - tip2:SetActive(true) - else - Chose:SetActive(true) - tip2:SetActive(false) - end - else + --LogError("111111111111111111111111111111111111111111111111111111111111111111111111111 noHeroList=="..#noHeroList.." TrainingUnlockSkillHeroItem=="..#TrainingUnlockSkillHeroItem) + NetManager.TrainingUnlockSkillRequest( self._curHerodata.dynamicId,tData.Id,pokemenons,godWeapon,TrainingUnlockSkillHeroItem,item,function (msg) + UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1) + if #TrainingUnlockSkillHeroItem>0 then + local t={} + for i=1 ,#TrainingUnlockSkillHeroItem do + t[i]=TrainingUnlockSkillHeroItem[i].id + end + HeroManager.DeleteHeroDatas(t) + end + selectSkillUnlockItems1={} + selectSkillUnlockItems2={} + if pokemenons and #pokemenons>0 then + PokemonManager.RemovePokemonData(pokemenons) + end + if godWeapon and #godWeapon>0 then + --PokemonManager.RemovePokemonData(pokemenons) + GodWeaponManager.RemoveWeaponData(godWeapon) + end + if self.OpenType==1 then if CheckListIsContainValue1(self._curHerodata.HeroTraining.unlockIds,tData.Id) then Chose:SetActive(false) tip2:SetActive(true) - localContent:SetActive(true) - skillBtn:SetActive(true) else Chose:SetActive(true) tip2:SetActive(false) - localContent:SetActive(false) - skillBtn:SetActive(false) - end - end - self.ScrollView:SetData(self.showList, function(index, go) - self:SetSingleData(index,go,self.showList[index]) + end + else + if CheckListIsContainValue1(self._curHerodata.HeroTraining.unlockIds,tData.Id) then + Chose:SetActive(false) + tip2:SetActive(true) + localContent:SetActive(true) + skillBtn:SetActive(true) + else + Chose:SetActive(true) + tip2:SetActive(false) + localContent:SetActive(false) + skillBtn:SetActive(false) + end + end + self.ScrollView:SetData(self.showList, function(index, go) + self:SetSingleData(index,go,self.showList[index]) + end) + --ForceRebuildLayout(_go.transform) + UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(_go.transform) + UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(_go.transform) + --ForceRebuildLayout(self.GameObject.transform) + UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(self.GameObject.transform) + UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(self.GameObject.transform) end) - ForceRebuildLayout(_go.transform) - ForceRebuildLayout(self.GameObject.transform) - end) end end ) @@ -407,6 +427,8 @@ function SpecailTrainingInfoPopup:SetSingleData(index,_go,_data) tmpData[i].type=1---Item 栏位 if tData.NeedItem1[i][1]== 21 then tmpData[i].type=3 + elseif tData.NeedItem1[i][1]== 53 then + tmpData[i].type=4 end if tData.NeedItem1[i][1]== 56 then tmpData[i].Name= ItemBaseTypeName[tData.NeedItem1[i][2]] @@ -488,22 +510,23 @@ function SpecailTrainingInfoPopup:SetSingleData(index,_go,_data) selectSkillUnlockItems2={} if #selectHeroOrItems>0 then - if selectHeroOrItems[1].type==1 then - itemIcon.sprite=self.spLoader:LoadSprite(selectHeroOrItems[1].icon) - - else - local itemConfig = ConfigManager.TryGetConfigData(ConfigName.ItemConfig,selectHeroOrItems[1].id) - if not itemConfig then return end - -- icon.sprite = self.spLoader:LoadSprite(GetResourcePath(itemConfig.ResourceID)) - itemIcon.sprite=self.spLoader:LoadSprite(GetResourcePath(itemConfig.ResourceID)) + if selectHeroOrItems[1].type==1 then + itemIcon.sprite=self.spLoader:LoadSprite(selectHeroOrItems[1].icon) needNum.text=#selectHeroOrItems.."/"..neednum - end - for i=1 ,#selectHeroOrItems do - selectSkillUnlockItems2[i]=selectHeroOrItems[i] - end - add:SetActive(false) - else - itemIcon.sprite=self.spLoader:LoadSprite("UI_hz_zhonghe05_70") + else + local itemConfig = ConfigManager.TryGetConfigData(ConfigName.ItemConfig,selectHeroOrItems[1].id) + if not itemConfig then return end + + -- icon.sprite = self.spLoader:LoadSprite(GetResourcePath(itemConfig.ResourceID)) + itemIcon.sprite=self.spLoader:LoadSprite(GetResourcePath(itemConfig.ResourceID)) + needNum.text=#selectHeroOrItems.."/"..neednum + end + for i=1 ,#selectHeroOrItems do + selectSkillUnlockItems2[i]=selectHeroOrItems[i] + end + add:SetActive(false) + else + itemIcon.sprite=self.spLoader:LoadSprite("r_hero_jinjie-touxiang2") add:SetActive(true) needNum.text="0".."/"..neednum end @@ -529,6 +552,23 @@ function SpecailTrainingInfoPopup:SetSingleData(index,_go,_data) itemIcon.sprite=self.spLoader:LoadSprite("UI_hz_zhonghe05_70") add:SetActive(true) needNum.text="0".."/"..neednum + end + elseif curData.type==4 then + selectSkillUnlockItems1={} + if #selectItems>0 then + LogError("selectItems======================"..#selectItems.." selectItems[1].type==="..selectItems[1].type.."selectItems[1].id=="..selectItems[1].id) + local itemConfig = ConfigManager.TryGetConfigData(ConfigName.ItemConfig,selectItems[1].id) + if not itemConfig then return end + itemIcon.sprite=self.spLoader:LoadSprite(GetResourcePath(itemConfig.ResourceID)) + needNum.text=#selectItems.."/"..neednum + for i=1 ,#selectItems do + selectSkillUnlockItems1[i]=selectItems[i] + end + add:SetActive(false) + else + itemIcon.sprite=self.spLoader:LoadSprite("UI_hz_zhonghe05_70") + add:SetActive(true) + needNum.text="0".."/"..neednum end end diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/TrainingItemListPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/TrainingItemListPanel.lua index 3b6fd95b56..f37e1998a7 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/TrainingItemListPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/TrainingItemListPanel.lua @@ -141,7 +141,29 @@ function TrainingItemListPanel:OnOpen(_curData,_func,NeedNum,selectItems1,select -- heroOrItemDataList[i]=itemDatas[i] end - + elseif _curData.type == 4 then + local pokemonList = GodWeaponManager.GetNoUpZhenWeapons() + local index=0 + for i=1,#pokemonList do + local v={} + v.dynamicId=pokemonList[i].dynamicId + v.pokemonData=pokemonList[i] + v.type=4 + v.index = i--用于祭品选择界面 查看是否选中 + v.star=pokemonList[i].star + v.lv=pokemonList[i].lv + local config=pokemonList[i].config + v.ischip=0 + v.icon= GetResourcePath(config.Icon) + --LogError("v.id========================================="..v.id) + v.id=pokemonList[i].id + v.quality=config.Quality + v.name=config.Name + v.returnCoin=config.CoinReturn + v.frame=GetHeroQuantityImageByquality(config.Quality) + v.num=1 + table.insert(heroOrItemDataList,v) + end else local titemDatas={} if _curData.NeedHeroOther ~=0 then @@ -344,13 +366,7 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择 end end end - -- local meshs1=starGrid:GetComponentsInChildren(typeof(UnityEngine.ParticleSystem)) - -- for key, value in pairs(meshs1:ToTable()) do - -- local mat=value:GetComponent(typeof(UnityEngine.Renderer)) - -- if mat.material.shader.name=="UI Particles/Additive" then - -- mat.material.shader=poolManager:LoadAsset("UI-Particle-Add_1",poolManager.AssetType.Other) - -- end - -- end + Util.SetParticleSortLayer(starGrid,this.sortingOrder + 1) Util.AddOnceClick(cardBtn, function() local isSelect = false @@ -385,7 +401,7 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择 end, 0.5) end - elseif curData.type==3 then + elseif curData.type==3 or curData.type==4 then local choosed = Util.GetGameObject(go.transform, "choosed") choosed:SetActive(false) -- if curSelectHeroList[heroData.dynamicId] then @@ -429,36 +445,10 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择 starSize = Vector2.New(1,-13) end SetHeroStars(this.spLoader, starGrid, star,1,starSize,-15) - LogError("hero star=="..star) - -- local effect=SetHeroFlyEffect(go,this.spLoader,heroData.star,this.sortingOrder+1,1) - -- if effect then - -- local particles=effect:GetComponentsInChildren(typeof(UnityEngine.ParticleSystem)) - -- for key, value in pairs(particles:ToTable()) do - -- local mat=value:GetComponent(typeof(UnityEngine.Renderer)) - -- if mat.material.shader.name=="YXZ/Effect/Mix Masking(Without Moving)_alphablend" then - -- mat.material.shader=poolManager:LoadAsset("YXZ_MixMaskingWithoutMoving_alphablend_1",poolManager.AssetType.Other) - -- end - -- end - -- end + Util.SetParticleSortLayer(starGrid,this.sortingOrder + 1) GongMingMask:SetActive(false)--最后检测是否共鸣 - if heroData.lockState == 1 or (heroData.isFormation ~= "" and heroData.isFormation ~= Language[10410]) then - else - if HarmonyManager.IsChangeColor(heroData.dynamicId) then - Util.GetGameObject(go.transform, "lv/Text"):GetComponent("Text").text = ""..heroData.lv.."" - GongMingMask:SetActive(true) - elseif HarmonyManager:IsEnvoy(heroData.dynamicId) and HarmonyManager.GetSingleAdditionsData(HarmonyAddType.AddLv) then - if HarmonyManager.GetSingleAdditionsData(HarmonyAddType.AddLv).heroTid == 0 then - -- body - Util.GetGameObject(go.transform, "lv/Text"):GetComponent("Text").text = ""..heroData.lv.."" - GongMingMask:SetActive(true) - end - - end - end - Util.AddOnceClick(GongMingMask, function() - PopupTipPanel.ShowTip(Language[12184]) - end) + Util.AddOnceClick(cardBtn, function() local isSelect = false local selectIndex = 0 @@ -498,7 +488,7 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择 end end) Util.AddLongPressClick(cardBtn, function() - UIManager.OpenPanel(UIName.RoleInfoPopup,heroData) + --UIManager.OpenPanel(UIName.RoleInfoPopup,heroData) end, 0.5) else for i = 1, #currentSelectItems do