From 401f3d8b25cc229ddb890b308cdb5b95c848dbeb Mon Sep 17 00:00:00 2001
From: xiejun <467745540@qq.com>
Date: Sat, 23 Dec 2023 14:45:58 +0800
Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E8=AE=AD=E7=81=B5=E5=85=BD=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3BUG=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../~Lua/Modules/Net/NetManager.lua | 29 ++-
.../RoleInfo/SpecailTrainingInfoPopup.lua | 58 ++++-
.../RoleInfo/TrainingItemListPanel.lua | 209 ++++++++++++------
3 files changed, 216 insertions(+), 80 deletions(-)
diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua
index ebf69426d4..9be76caecd 100644
--- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua
@@ -7703,7 +7703,7 @@ function NetManager.TrainingUpLvRequest(_heroid,_func)
end)
end
-- 英雄特训技能解锁请求
-function NetManager.TrainingUnlockSkillRequest(_heroid,_unlockId,pockemensId,TrainingUnlockSkillHeroItem,item,_func)
+function NetManager.TrainingUnlockSkillRequest(_heroid,_unlockId,pockemensId,magicSoldierIds,TrainingUnlockSkillHeroItem,item,_func)
local data=HeroInfoProto_pb.TrainingUnlockSkillRequest()
data.heroId= _heroid
data.unlockId= _unlockId
@@ -7717,16 +7717,25 @@ function NetManager.TrainingUnlockSkillRequest(_heroid,_unlockId,pockemensId,Tra
info.num = TrainingUnlockSkillHeroItem[i].num
end
end
-
-
- --data.incarnationCards= incarnationCards
- if item.itemtype==56 then
- data.playerGifts.itemId = item.id
- data.playerGifts.itemNum = item.itemNum
+ if pockemensId then
+
+ for i = 1, #pockemensId do
+ data.pokemonIds:append(tostring(pockemensId[i]))
+ end
+
+
end
- if item.itemtype==29 then
- data.incarnationCards.itemId = item.id
- data.incarnationCards.itemNum = item.itemNum
+
+ --data.incarnationCards= incarnationCards
+ if item then
+ if item.itemtype==56 then
+ data.playerGifts.itemId = item.id
+ data.playerGifts.itemNum = item.itemNum
+ end
+ if item.itemtype==29 then
+ data.incarnationCards.itemId = item.id
+ data.incarnationCards.itemNum = item.itemNum
+ end
end
local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.TrainingUnlockSkillRequest,MessageTypeProto_pb.TrainingUnlockSkillResponse,msg,function(buffer)
diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/SpecailTrainingInfoPopup.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/SpecailTrainingInfoPopup.lua
index 9e875fe77b..06d1a85b0a 100644
--- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/SpecailTrainingInfoPopup.lua
+++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/SpecailTrainingInfoPopup.lua
@@ -288,14 +288,26 @@ function SpecailTrainingInfoPopup:SetSingleData(index,_go,_data)
return
end
if tData.Level<=curLevel then
+
if #selectSkillUnlockItems1==0 or #selectSkillUnlockItems2==0 then
PopupTipPanel.ShowTip(Language[10054])
return
end
local item={}
+ local pokemenons={}
+
+ if selectSkillUnlockItems1[1].type==3 then
+ for i=1,#selectSkillUnlockItems1 do
+ local t=selectSkillUnlockItems1[i]
+ local pockemen={}
+ pokemenons[i]=selectSkillUnlockItems1[i].dynamicId
+ end
+
+ else
item.id=selectSkillUnlockItems1[1].itemData.id
item.itemNum=1
item.itemtype=selectSkillUnlockItems1[1].itemData.itemType
+ end
local TrainingUnlockSkillHeroItem={}
for i=1,#selectSkillUnlockItems2 do
local t=selectSkillUnlockItems2[i]
@@ -309,11 +321,10 @@ function SpecailTrainingInfoPopup:SetSingleData(index,_go,_data)
Heroitem.num=1
TrainingUnlockSkillHeroItem[i]=Heroitem
end
- local pokemenons={}
- pokemenons[1]=""
+
local magicSoldierIds={}
magicSoldierIds[1]=""
- NetManager.TrainingUnlockSkillRequest( self._curHerodata.dynamicId,tData.Id,nil,TrainingUnlockSkillHeroItem,item,function (msg)
+ NetManager.TrainingUnlockSkillRequest( self._curHerodata.dynamicId,tData.Id,pokemenons,nil,TrainingUnlockSkillHeroItem,item,function (msg)
UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1)
end)
end
@@ -347,7 +358,10 @@ function SpecailTrainingInfoPopup:SetSingleData(index,_go,_data)
for i=1,#tData.NeedItem1 do
tmpData[i]={}
tmpData[i].data=tData.NeedItem1[i]
- tmpData[i].type=1---Item 栏位
+ tmpData[i].type=1---Item 栏位
+ if tData.NeedItem1[i][1]== 21 then
+ tmpData[i].type=3
+ end
if tData.NeedItem1[i][1]== 56 then
tmpData[i].Name= ItemBaseTypeName[tData.NeedItem1[i][2]]
else
@@ -378,18 +392,24 @@ function SpecailTrainingInfoPopup:SetSingleData(index,_go,_data)
if curData.type==1 then
Util.GetGameObject(singleSkillList[i],"Name"):GetComponent("Text").text=GetQuantityStrByquality(curData.data[3])..curData.Name
itemIcon.sprite=self.spLoader:LoadSprite("UI_hz_beibao_duigoudi")
- else
+ elseif curData.type==2 then
Util.GetGameObject(singleSkillList[i],"Name"):GetComponent("Text").text=NumToChinese[curData.heroGroupData[1]].."星"..curData.Name
itemIcon.sprite=self.spLoader:LoadSprite("UI_hz_zhonghe05_70")
+ else
+ Util.GetGameObject(singleSkillList[i],"Name"):GetComponent("Text").text=GetQuantityStrByquality(curData.data[3])..curData.Name
+ itemIcon.sprite=self.spLoader:LoadSprite("UI_hz_beibao_duigoudi")
end
local needNum= Util.GetGameObject(singleSkillList[i],"hero/lvbg/CountText"):GetComponent("Text")
local neednum=1
if curData.type==1 then
needNum.text="0".."/"..curData.data[4]
neednum=curData.data[4]
- else
+ elseif curData.type==2 then
needNum.text="0".."/"..curData.heroGroupData[2]
- neednum=curData.heroGroupData[2]
+ neednum=curData.heroGroupData[2]
+ else
+ needNum.text="0".."/"..curData.data[4]
+ neednum=curData.data[4]
end
local add=Util.GetGameObject(singleSkillList[i],"hero/icon/add")
@@ -441,7 +461,29 @@ function SpecailTrainingInfoPopup:SetSingleData(index,_go,_data)
add:SetActive(true)
needNum.text="0".."/"..neednum
end
-
+ elseif curData.type==3 then
+ selectSkillUnlockItems1={}
+ if #selectItems>0 then
+
+ if selectItems[1].type==1 or selectItems[1].type==3 then
+ itemIcon.sprite=self.spLoader:LoadSprite(selectItems[1].icon)
+
+ else
+ local itemConfig = ConfigManager.TryGetConfigData(ConfigName.ItemConfig,selectItems[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=#selectItems.."/"..neednum
+ end
+ 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
end
diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/TrainingItemListPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/TrainingItemListPanel.lua
index 0c854032db..4063daebd7 100644
--- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/TrainingItemListPanel.lua
+++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/TrainingItemListPanel.lua
@@ -96,6 +96,7 @@ function TrainingItemListPanel:OnOpen(_curData,_func,NeedNum,selectItems1,select
curData = _curData
-- heroDataList = heroData
if _curData.type==1 then
+
local itemDatas = BagManager.GetBagItemDataByItemTypeV3(_curData.data[2],_curData.data[1],_curData.data[3])
local index =0
for i=1,#itemDatas do
@@ -112,7 +113,35 @@ function TrainingItemListPanel:OnOpen(_curData,_func,NeedNum,selectItems1,select
end
index=haveNum
-- heroOrItemDataList[i]=itemDatas[i]
- end
+
+ end
+ elseif _curData.type==3 then
+
+ local pokemonList = PokemonManager.GetPokemonDatas()
+ local index=0
+ for i=1,#pokemonList do
+ local v={}
+ v.dynamicId=pokemonList[i].dynamicId
+ v.pokemonData=pokemonList[i]
+ v.type=3
+ v.index = i--用于祭品选择界面 查看是否选中
+ v.star=v.star
+ v.lv=v.lv
+ local config=pokemonList[i].config
+ v.ischip=0
+ v.icon= GetResourcePath(config.Icon)
+ v.id=v.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)
+
+
+ -- heroOrItemDataList[i]=itemDatas[i]
+ end
+
else
local titemDatas={}
if _curData.NeedHeroOther ~=0 then
@@ -169,7 +198,7 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
-- local starGrid = Util.GetGameObject(go.transform, "star")
local cardBtn = Util.GetGameObject(go.transform, "icon")
- if curData.type~=1 then
+ if curData.type==2 then
-- icon.sprite = this.spLoader:LoadSprite(heroData.icon)
local choosed = Util.GetGameObject(go.transform, "choosed")
choosed:SetActive(false)
@@ -355,66 +384,122 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup, heroData.id)
end, 0.5)
end
- -- if curData.type~=1 then
- -- local itemConfig=heroData.heroConfig
- -- -- frame.sprite = this.spLoader:LoadSprite(GetHeroQuantityImageByquality(heroData.heroConfig.quality,heroData.star))
- -- if heroData.lv>0 then
- -- lvGo.gameObject:SetActive(true)
- -- lvGo.text=heroData.lv
- -- else
- -- lvGo.gameObject:SetActive(false)
- -- end
-
- -- formationMask:SetActive(false)
- -- formationImage:SetActive(false)
- -- lockImage:SetActive(false)
- -- name.text = SubString2(GetLanguageStrById(itemConfig.Name),8)
- -- -- local talismana=ConfigManager.GetConfigDataByDoubleKey(ConfigName.EquipTalismana,"TalismanaId",heroData.staticId,"Level",heroData.lv)
- -- local star=heroData.star
- -- if star>0 then
- -- starGrid:SetActive(true)
- -- local starType=1
- -- local starSize=nil
- -- starType=3
- -- star=star+11
- -- starSize = Vector2.New(0.8,-20)
- -- local starScale = -20
- -- SetHeroStars(this.spLoader,starGrid, star,starType,starSize,starScale)
- -- Util.SetParticleSortLayer(starGrid, this.sortingOrder + 3)
- -- else
- -- starGrid:SetActive(false)
- -- end
- -- -- local isSelect = CheckListIsContainValue1(curSelectItemOrHeroList,heroData.did)
- -- -- choosed:SetActive(isSelect)
- -- Util.AddOnceClick(cardBtn, function()
- -- -- if isSelect then
- -- -- choosed:SetActive(false)
- -- -- table.removebyvalue(curSelectItemOrHeroList,heroData.did)
- -- -- isSelect=false
- -- -- return
- -- -- end
- -- -- if LengthOfTable(curSelectItemOrHeroList)>=curNeedRoleNum then
- -- -- PopupTipPanel.ShowTip(Language[10403])
- -- -- return
- -- -- end
- -- -- table.insert(curSelectItemOrHeroList,heroData.did)
- -- -- isSelect=true
- -- -- choosed:SetActive(true)
- -- if currentSelectItem and currentSelectItem.Did == heroData .Did then
- -- return
- -- else
- -- currentSelectItem = heroData
- -- choosed:SetActive(true)
- -- if curSelectGO then
- -- Util.GetGameObject(curSelectGO.transform, "choosed"):SetActive(false)
- -- curSelectGO = go
- -- else
- -- curSelectGO = go
- -- end
- -- choosed:SetActive(true)
- -- end
-
- -- end)
+
+ elseif curData.type==3 then
+ local choosed = Util.GetGameObject(go.transform, "choosed")
+ choosed:SetActive(false)
+ -- if curSelectHeroList[heroData.dynamicId] then
+ -- curSelectHeroList[heroData.dynamicId]=heroData
+ -- choosed:SetActive(true)
+ -- end
+ for i = 1, #currentSelectItems do
+
+ if currentSelectItems[i].dynamicId == heroData.dynamicId then
+ choosed:SetActive(true)
+ end
+
+ end
+ Util.GetGameObject(go.transform, "posIcon"):SetActive(false)
+ local frame = Util.GetGameObject(go.transform, "frame"):GetComponent("Image")
+ local lvGo = Util.GetGameObject(go.transform, "lv")
+ local icon = Util.GetGameObject(go.transform, "icon"):GetComponent("Image")
+ local proIcon = Util.GetGameObject(go.transform, "proIcon")
+ local name = Util.GetGameObject(go.transform, "name"):GetComponent("Text")
+ local formationMask = Util.GetGameObject(go.transform, "formationMask")
+ local formationImage = Util.GetGameObject(formationMask.transform, "formationImage")
+ local lockImage = Util.GetGameObject(formationMask.transform, "lockImage")
+ local noumenon = Util.GetGameObject(go, "noumenon")
+ local starGrid = Util.GetGameObject(go.transform, "star")
+ local cardBtn = Util.GetGameObject(go.transform, "icon")
+ local GongMingMask = Util.GetGameObject(go.transform, "GongMingMask")
+ frame.sprite = this.spLoader:LoadSprite(GetHeroQuantityImageByquality(heroData.pokemonData.config.Quality,heroData.star))
+ lvGo:SetActive(true)
+ lvGo:GetComponent("Text").text = heroData.lv
+ icon.sprite = this.spLoader:LoadSprite(heroData.icon)
+ proIcon:GetComponent("Image").sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(heroData.changeProId))
+ formationMask:SetActive((heroData.isFormation ~=nil and heroData.isFormation ~= "" and heroData.isFormation ~= Language[10410]) or heroData.lockState == 1)
+ formationImage:SetActive(heroData.isFormation ~=nil and heroData.isFormation ~= "" )
+ lockImage:SetActive( heroData.lockState == 1)
+ --noumenon:SetActive( heroData.id == curHeroData.id )
+ name.text = SubString2(GetLanguageStrById(heroData.name),8)
+ local star = heroData.pokemonData.star
+ local starSize=Vector2.New(32.5,32.5)
+ if star>5 then
+ star=star+6
+ 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
+ for i = 1, #currentSelectItems do
+
+ if currentSelectItems[i].dynamicId == heroData.dynamicId then
+ isSelect = true
+ selectIndex = i
+ end
+
+ end
+ if isSelect then
+ choosed:SetActive(false)
+ -- curSelectHeroList[heroData.dynamicId]=nil
+ table.remove(currentSelectItems,selectIndex)
+ -- this.numText.text=string.format("%s/%s",LengthOfTable(curSelectItemOrHeroList),curNeedRoleNum)
+ return
+ end
+ if LengthOfTable(currentSelectItems)>=curNeedRoleNum then
+ PopupTipPanel.ShowTip(Language[10403])
+ return
+ end
+ -- curSelectHeroList[heroData.dynamicId]=heroData
+ table.insert(currentSelectItems,heroData)
+ choosed:SetActive(true)
+ -- this.numText.text=string.format("%s/%s",LengthOfTable(currentSelectItems),curNeedRoleNum)
+ end)
+
+ Util.AddOnceClick(formationMask, function()
+ if heroData.isFormation ~= "" then
+ PopupTipPanel.ShowTip( heroData.isFormation)
+ return
+ end
+ if heroData.lockState == 1 then
+ PopupTipPanel.ShowTip(Language[10413])
+ return
+ end
+ end)
+ Util.AddLongPressClick(cardBtn, function()
+ UIManager.OpenPanel(UIName.RoleInfoPopup,heroData)
+ end, 0.5)
else
for i = 1, #currentSelectItems do
if currentSelectItems[i].itemData.id == heroData.itemData.id and currentSelectItems[i].index == heroData.index then