英雄合成提交部分代码
parent
6dd95ec834
commit
17b6db91e2
|
@ -326,6 +326,7 @@ UIName = {
|
||||||
ArenaTopMatchGuessTipViewPopup = 325,--巅峰赛竞猜结果弹窗
|
ArenaTopMatchGuessTipViewPopup = 325,--巅峰赛竞猜结果弹窗
|
||||||
DynamicActivityPanel = 326,--轮转活动通用窗口
|
DynamicActivityPanel = 326,--轮转活动通用窗口
|
||||||
CompoundHeroPanel = 327,--神将置换、合成界面
|
CompoundHeroPanel = 327,--神将置换、合成界面
|
||||||
|
CompoundHeroUpStarListPanel = 328,--角色合成操作弹窗
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,228 @@
|
||||||
|
require("Base/BasePanel")
|
||||||
|
CompoundHeroUpStarListPanel = Inherit(BasePanel)
|
||||||
|
local this = CompoundHeroUpStarListPanel
|
||||||
|
local curSelectHeroList={}
|
||||||
|
local heroDataList={}
|
||||||
|
local curNeedRoleNum
|
||||||
|
local openThisPanel
|
||||||
|
local curHeroData = {}
|
||||||
|
--初始化组件(用于子类重写)
|
||||||
|
function CompoundHeroUpStarListPanel:InitComponent()
|
||||||
|
|
||||||
|
this.BtnBack = Util.GetGameObject(self.transform, "btnBack")
|
||||||
|
this.BtnSure = Util.GetGameObject(self.transform, "btnSure")
|
||||||
|
this.btnAutoSelect = Util.GetGameObject(self.transform, "btnAutoSelect")
|
||||||
|
this.cardPre = Util.GetGameObject(self.gameObject, "item")
|
||||||
|
--this.grid = Util.GetGameObject(self.gameObject, "scroll/grid")
|
||||||
|
this.desText = Util.GetGameObject(self.gameObject, "desText"):GetComponent("Text")
|
||||||
|
this.numText = Util.GetGameObject(self.gameObject, "numText"):GetComponent("Text")
|
||||||
|
|
||||||
|
this.Scrollbar= Util.GetGameObject(self.gameObject, "Scrollbar"):GetComponent("Scrollbar")
|
||||||
|
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,Util.GetGameObject(self.gameObject, "scroll").transform,
|
||||||
|
this.cardPre, this.Scrollbar, Vector2.New(927.5, 1010), 1, 5, Vector2.New(19.32,15))
|
||||||
|
this.ScrollView.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(6.78, 27)
|
||||||
|
this.ScrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
|
||||||
|
this.ScrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
|
||||||
|
this.ScrollView.moveTween.MomentumAmount = 1
|
||||||
|
this.ScrollView.moveTween.Strength = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
--绑定事件(用于子类重写)
|
||||||
|
function CompoundHeroUpStarListPanel:BindEvent()
|
||||||
|
|
||||||
|
Util.AddClick(this.BtnBack, function()
|
||||||
|
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
||||||
|
self:ClosePanel()
|
||||||
|
end)
|
||||||
|
Util.AddClick(this.BtnSure, function()
|
||||||
|
self:ClosePanel()
|
||||||
|
Log("curSelectHeroList "..LengthOfTable(curSelectHeroList))
|
||||||
|
openThisPanel.UpdateUpStarPosHeroData(curSelectHeroList)
|
||||||
|
end)
|
||||||
|
Util.AddClick(this.btnAutoSelect, function()
|
||||||
|
self:AutoSelectHero()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
--添加事件监听(用于子类重写)
|
||||||
|
function CompoundHeroUpStarListPanel:AddListener()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
--移除事件监听(用于子类重写)
|
||||||
|
function CompoundHeroUpStarListPanel:RemoveListener()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
--界面打开时调用(用于子类重写)
|
||||||
|
function CompoundHeroUpStarListPanel:OnOpen(heroData,HeroRankupGroupData,RankupConsumeMaterialData,_openThisPanel,_curSelectHeroList,_curHeroData)
|
||||||
|
|
||||||
|
openThisPanel= _openThisPanel
|
||||||
|
curSelectHeroList={}
|
||||||
|
for i = 1, #_curSelectHeroList do
|
||||||
|
curSelectHeroList[_curSelectHeroList[i]]=_curSelectHeroList[i]
|
||||||
|
end
|
||||||
|
curHeroData = _curHeroData
|
||||||
|
heroDataList = heroData
|
||||||
|
this.HeroSortData(heroDataList)
|
||||||
|
for i, v in pairs(heroDataList) do
|
||||||
|
for n,w in pairs(FormationManager.formationList) do
|
||||||
|
if HeroManager.heroResolveLicence[n] then
|
||||||
|
for m = 1, #w.teamHeroInfos do
|
||||||
|
if v.dynamicId==w.teamHeroInfos[m].heroId then
|
||||||
|
local isFormationStr = HeroManager.GetHeroFormationStr(n)
|
||||||
|
v.isFormation = isFormationStr
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
this.ScrollView:SetData(heroDataList, function (index, go)
|
||||||
|
this.OnShowSingleCardData(go, heroDataList[index])
|
||||||
|
end)
|
||||||
|
|
||||||
|
curNeedRoleNum=RankupConsumeMaterialData[4]
|
||||||
|
local str = ""
|
||||||
|
if HeroRankupGroupData.Issame == 1 then
|
||||||
|
str = HeroRankupGroupData.StarLimit..Language[11868]
|
||||||
|
else
|
||||||
|
if HeroRankupGroupData.IsId ~= 0 then
|
||||||
|
str = HeroRankupGroupData.StarLimit..Language[11869]..ConfigManager.GetConfigData(ConfigName.HeroConfig,HeroRankupGroupData.IsId).ReadingName
|
||||||
|
else
|
||||||
|
if HeroRankupGroupData.IsSameClan == 0 then
|
||||||
|
str = HeroRankupGroupData.StarLimit..Language[11870]
|
||||||
|
else
|
||||||
|
str = HeroRankupGroupData.StarLimit..Language[11871]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
this.desText.text=string.format(Language[11872],curNeedRoleNum,str)--HeroRankupGroupData.Name)
|
||||||
|
this.numText.text=string.format("%s/%s",LengthOfTable(curSelectHeroList) ,curNeedRoleNum)
|
||||||
|
end
|
||||||
|
function this.OnClickEnterHero(go,heroData,type)
|
||||||
|
|
||||||
|
if type==1 then
|
||||||
|
if LengthOfTable(curSelectHeroList)>=curNeedRoleNum then
|
||||||
|
PopupTipPanel.ShowTip(Language[10660])
|
||||||
|
return
|
||||||
|
else
|
||||||
|
-- table.insert(curSelectHeroList,heroData)
|
||||||
|
curSelectHeroList[heroData.dynamicId] = heroData.dynamicId
|
||||||
|
end
|
||||||
|
elseif type==2 then
|
||||||
|
if curSelectHeroList[heroData.dynamicId] then
|
||||||
|
curSelectHeroList[heroData.dynamicId] = nil
|
||||||
|
end
|
||||||
|
-- for i = 1, #curSelectHeroList do
|
||||||
|
-- if heroData.dynamicId==curSelectHeroList[i].dynamicId then
|
||||||
|
-- table.remove(curSelectHeroList,i)
|
||||||
|
-- break
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
end
|
||||||
|
this.OnShowSingleCardData(go,heroData,type)
|
||||||
|
this.numText.text=string.format("%s/%s",LengthOfTable(curSelectHeroList),curNeedRoleNum)
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
|
||||||
|
local choosed = Util.GetGameObject(go.transform, "choosed")
|
||||||
|
choosed:SetActive(false)
|
||||||
|
if curSelectHeroList[heroData.dynamicId] then
|
||||||
|
curSelectHeroList[heroData.dynamicId]=heroData
|
||||||
|
choosed:SetActive(true)
|
||||||
|
end
|
||||||
|
Util.GetGameObject(go.transform, "frame"):GetComponent("Image").sprite = Util.LoadSprite(GetHeroQuantityImageByquality(heroData.heroConfig.Quality,heroData.star))
|
||||||
|
Util.GetGameObject(go.transform, "lv/Text"):GetComponent("Text").text = heroData.lv
|
||||||
|
Util.GetGameObject(go.transform, "icon"):GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(heroData.heroConfig.Icon))
|
||||||
|
Util.GetGameObject(go.transform, "posIcon"):SetActive(false)--:GetComponent("Image").sprite = Util.LoadSprite(heroData.professionIcon)
|
||||||
|
Util.GetGameObject(go.transform, "proIcon"):GetComponent("Image").sprite = Util.LoadSprite(GetProStrImageByProNum(heroData.heroConfig.PropertyName))
|
||||||
|
local formationMask = Util.GetGameObject(go.transform, "formationMask")
|
||||||
|
-- formationMask:SetActive(false)
|
||||||
|
formationMask:SetActive((heroData.isFormation ~= "" and heroData.isFormation ~= Language[11108]) or heroData.lockState == 1)
|
||||||
|
Util.GetGameObject(formationMask.transform, "formationImage"):SetActive(heroData.isFormation ~= "" )
|
||||||
|
Util.GetGameObject(formationMask.transform, "lockImage"):SetActive( heroData.lockState == 1)
|
||||||
|
Util.GetGameObject(go.transform, "noumenon"):SetActive( heroData.id == curHeroData.id )
|
||||||
|
local starGrid = Util.GetGameObject(go.transform, "star")
|
||||||
|
SetHeroStars(starGrid, heroData.star,1,nil,nil,Vector2.New(0,1))
|
||||||
|
local cardBtn = Util.GetGameObject(go.transform, "icon")
|
||||||
|
Util.AddOnceClick(cardBtn, function()
|
||||||
|
if curSelectHeroList[heroData.dynamicId] then
|
||||||
|
choosed:SetActive(false)
|
||||||
|
curSelectHeroList[heroData.dynamicId]=nil
|
||||||
|
this.numText.text=string.format("%s/%s",LengthOfTable(curSelectHeroList),curNeedRoleNum)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if LengthOfTable(curSelectHeroList)>=curNeedRoleNum then
|
||||||
|
PopupTipPanel.ShowTip(Language[10660])
|
||||||
|
return
|
||||||
|
end
|
||||||
|
curSelectHeroList[heroData.dynamicId]=heroData
|
||||||
|
choosed:SetActive(true)
|
||||||
|
this.numText.text=string.format("%s/%s",LengthOfTable(curSelectHeroList),curNeedRoleNum)
|
||||||
|
end)
|
||||||
|
|
||||||
|
Util.AddOnceClick(formationMask, function()
|
||||||
|
if heroData.isFormation ~= "" then
|
||||||
|
PopupTipPanel.ShowTip( heroData.isFormation)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if heroData.lockState == 1 then
|
||||||
|
PopupTipPanel.ShowTip(Language[11776])
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
function this.HeroSortData(heroData)
|
||||||
|
Log("#heroData "..#heroData)
|
||||||
|
--Language[11108]
|
||||||
|
table.sort(heroData, function(a, b)
|
||||||
|
if (a.isFormation == "" or (a.isFormation ~= "" and a.isFormation == Language[11108])) and (b.isFormation == "" or (b.isFormation ~= "" and b.isFormation == Language[11108]))
|
||||||
|
or (a.isFormation ~= "" and a.isFormation ~= Language[11108]) and (b.isFormation ~= "" and b.isFormation ~= Language[11108]) then
|
||||||
|
if a.lockState == b.lockState then
|
||||||
|
if a.heroConfig.Star == b.heroConfig.Star then
|
||||||
|
if a.lv == b.lv then
|
||||||
|
if a.id ~= curHeroData.id and b.id ~= curHeroData.id or a.id == curHeroData.id and b.id == curHeroData.id then
|
||||||
|
return a.id > b.id
|
||||||
|
else
|
||||||
|
return not a.id ~= curHeroData.id and b.id == curHeroData.id
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return a.lv < b.lv
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return a.heroConfig.Star < b.heroConfig.Star
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return a.lockState < b.lockState
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return (a.isFormation == "" or (a.isFormation ~= "" and a.isFormation == Language[11108])) and (not b.dynamicId ~= "" and b.isFormation ~= Language[11108])
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
function CompoundHeroUpStarListPanel:AutoSelectHero()
|
||||||
|
LogGreen("sssssssssssssssssssss")
|
||||||
|
curSelectHeroList = {}
|
||||||
|
for i = 1, #heroDataList do
|
||||||
|
if LengthOfTable(curSelectHeroList) < curNeedRoleNum and heroDataList[i].isFormation == "" and heroDataList[i].lockState == 0 then--
|
||||||
|
LogGreen("heroDataList[i].dynamicId "..heroDataList[i].dynamicId)
|
||||||
|
curSelectHeroList[heroDataList[i].dynamicId]=heroDataList[i]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
this.numText.text=string.format("%s/%s",LengthOfTable(curSelectHeroList),curNeedRoleNum)
|
||||||
|
this.ScrollView:SetData(heroDataList, function (index, go)
|
||||||
|
this.OnShowSingleCardData(go, heroDataList[index])
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
--界面关闭时调用(用于子类重写)
|
||||||
|
function CompoundHeroUpStarListPanel:OnClose()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
--界面销毁时调用(用于子类重写)
|
||||||
|
function CompoundHeroUpStarListPanel:OnDestroy()
|
||||||
|
|
||||||
|
this.ScrollView = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
return CompoundHeroUpStarListPanel
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d61a49dfbba5e2c4fadc16380d538431
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -144,6 +144,9 @@ function this.ShowTitleData(curHeroCompoundData)
|
||||||
end
|
end
|
||||||
local upStarConsumeMaterial = {}
|
local upStarConsumeMaterial = {}
|
||||||
local upStarMaterialIsAll = {}
|
local upStarMaterialIsAll = {}
|
||||||
|
local curSelectUpStarData
|
||||||
|
local curSelectUpStarGo
|
||||||
|
local upStarRankUpConfig
|
||||||
--更新英雄进阶数据
|
--更新英雄进阶数据
|
||||||
function this.UpdateHeroUpStarData(_curUpStarData)
|
function this.UpdateHeroUpStarData(_curUpStarData)
|
||||||
--进阶吞英雄条件
|
--进阶吞英雄条件
|
||||||
|
@ -196,28 +199,134 @@ function this.UpdateHeroUpStarData(_curUpStarData)
|
||||||
-- else
|
-- else
|
||||||
-- addBtnImage:SetActive(false)
|
-- addBtnImage:SetActive(false)
|
||||||
-- end
|
-- end
|
||||||
if #_curUpStarData.haveHeroList[i + 1] >= curUpStarData[4] then
|
num:GetComponent("Text").text=string.format("<color=#FF0000FF>%s/%s</color>",0,curUpStarData[4])
|
||||||
num:GetComponent("Text").text=string.format("<color=#FFFFFF>%s/%s</color>",#_curUpStarData.haveHeroList[i + 1],curUpStarData[4])
|
-- if #_curUpStarData.haveHeroList[i + 1] >= curUpStarData[4] then
|
||||||
else
|
-- num:GetComponent("Text").text=string.format("<color=#FFFFFF>%s/%s</color>",#_curUpStarData.haveHeroList[i + 1],curUpStarData[4])
|
||||||
num:GetComponent("Text").text=string.format("<color=#FF0000FF>%s/%s</color>",#_curUpStarData.haveHeroList[i + 1],curUpStarData[4])
|
-- else
|
||||||
end
|
-- num:GetComponent("Text").text=string.format("<color=#FF0000FF>%s/%s</color>",#_curUpStarData.haveHeroList[i + 1],curUpStarData[4])
|
||||||
|
-- end
|
||||||
SetHeroStars(starGrid, upStarMaterialsData.StarLimit,1,nil,-15.3)
|
SetHeroStars(starGrid, upStarMaterialsData.StarLimit,1,nil,-15.3)
|
||||||
|
-- LogGreen("_curUpStarData.haveHeroList3[i] "..#_curUpStarData.haveHeroList3[i + 1])
|
||||||
Util.AddOnceClick(addBtn, function()
|
Util.AddOnceClick(addBtn, function()
|
||||||
-- curSelectUpStarData=curUpStarData[i]
|
-- curSelectUpStarData=curUpStarData[i]
|
||||||
-- curSelectUpStarGo=go
|
-- curSelectUpStarGo=go
|
||||||
-- local curShowHeroListData=self:SetShowHeroListData(upStarConsumeMaterial,upStarHeroListData.heroList)
|
-- local curShowHeroListData=self:SetShowHeroListData(upStarConsumeMaterial,upStarHeroListData.heroList)
|
||||||
-- --参数1 显示的herolist 2 3 升当前星的规则 4 打开RoleUpStarListPanel的界面
|
-- --参数1 显示的herolist 2 3 升当前星的规则 4 打开RoleUpStarListPanel的界面
|
||||||
-- UIManager.OpenPanel(UIName.RoleUpStarListPanel,curShowHeroListData,upStarMaterialsData,curUpStarData,this,upStarConsumeMaterial[i],curSelectHero)
|
-- UIManager.OpenPanel(UIName.RoleUpStarListPanel,curShowHeroListData,upStarMaterialsData,curUpStarData,this,upStarConsumeMaterial[i],curSelectHero)
|
||||||
|
|
||||||
|
curSelectUpStarData=curUpStarData
|
||||||
|
curSelectUpStarGo=go
|
||||||
|
local curShowHeroListData=this.SetShowHeroListData(upStarConsumeMaterial,_curUpStarData.haveHeroList3[i + 1])
|
||||||
|
--参数1 显示的herolist 2 3 升当前星的规则 4 打开RoleUpStarListPanel的界面
|
||||||
|
UIManager.OpenPanel(UIName.CompoundHeroUpStarListPanel,curShowHeroListData,upStarMaterialsData,curUpStarData,this,upStarConsumeMaterial[i],curSelectHero)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
if curSelectHero then
|
||||||
|
--自动选择进阶妖灵师材料
|
||||||
|
this.AutoSelectUpStarHeroList(_curUpStarData)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
for i = 1, #needHeros do
|
for i = 1, #needHeros do
|
||||||
needHeros[i]:SetActive(false)
|
needHeros[i]:SetActive(false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--自动选择进阶妖灵师材料
|
end
|
||||||
-- self:AutoSelectUpStarHeroList(curUpStarData)
|
--分析设置升星界面显示的英雄list数据 如果当前升星材料的坑位的英雄数据与 以其他坑位有重合并且选择上的英雄不显示 如果是当前坑位显示的英雄显示对勾
|
||||||
|
function this.SetShowHeroListData(upStarConsumeMaterial,curHeroList)--1 消耗的总消耗组 2 当前坑位可选择的所有英雄
|
||||||
|
local curEndShowHeroListData={}
|
||||||
|
for i = 1, #curHeroList do
|
||||||
|
if curHeroList[i].dynamicId ~= curSelectHero.dynamicId then
|
||||||
|
curHeroList[i].isSelect=2
|
||||||
|
-- LogGreen("curHeroList[i] "..curHeroList[i].dynamicId)
|
||||||
|
table.insert(curEndShowHeroListData,curHeroList[i])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- LogGreen("#curEndShowHeroListData "..#curEndShowHeroListData)
|
||||||
|
for j = 1, #upStarConsumeMaterial do
|
||||||
|
if upStarConsumeMaterial[j] and #upStarConsumeMaterial[j]>0 then
|
||||||
|
for k = 1, #upStarConsumeMaterial[j] do
|
||||||
|
if j==curSelectUpStarData[2] then--curSelectUpStarData 当前坑位选择的英雄信息
|
||||||
|
for _, v in pairs(curEndShowHeroListData) do
|
||||||
|
if v.dynamicId==upStarConsumeMaterial[j][k] then
|
||||||
|
v.isSelect=1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
for i, v in pairs(curEndShowHeroListData) do
|
||||||
|
if v.dynamicId==upStarConsumeMaterial[j][k] then
|
||||||
|
curEndShowHeroListData[i] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local curList={}
|
||||||
|
for _, v in pairs(curEndShowHeroListData) do
|
||||||
|
-- LogGreen("#curList "..v.id.." "..v.isSelect)
|
||||||
|
table.insert(curList,v)
|
||||||
|
end
|
||||||
|
return curList
|
||||||
|
end
|
||||||
|
--升星选择祭品后刷新界面
|
||||||
|
function this.AutoSelectUpStarHeroList(_curUpStarData)
|
||||||
|
local curUpStarData= _curUpStarData.upStarMaterialsData
|
||||||
|
if curUpStarData and #curUpStarData>0 then
|
||||||
|
for i = 1, #curUpStarData do
|
||||||
|
curSelectUpStarGo = needHeros[i + 1]
|
||||||
|
curSelectUpStarData=curUpStarData[i]
|
||||||
|
local upStarHeroListData=_curUpStarData.haveHeroList3[i + 1]
|
||||||
|
local curSelectHeroList = {}
|
||||||
|
if curSelectUpStarData.Issame ==1
|
||||||
|
or curSelectUpStarData.IsId > 0
|
||||||
|
or (curSelectUpStarData.IsSameClan == 1
|
||||||
|
and curSelectUpStarData.StarLimit == 3
|
||||||
|
and curSelectHero.heroConfig.Qualiy ~= 3) then
|
||||||
|
if LengthOfTable(upStarHeroListData) >= _curUpStarData.upStarData[i][4] then
|
||||||
|
for j = 1, LengthOfTable(upStarHeroListData) do
|
||||||
|
LogGreen(_curUpStarData.upStarData[i][4])
|
||||||
|
if #curSelectHeroList < _curUpStarData.upStarData[i][4] then
|
||||||
|
if upStarHeroListData[j].lockState == 0 and upStarHeroListData[j].dynamicId ~= curSelectHero.dynamicId then--upStarHeroListData[i].isFormation == ""
|
||||||
|
table.insert(curSelectHeroList,upStarHeroListData[j])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
this.UpdateUpStarPosHeroData(curSelectHeroList, _curUpStarData.upStarData[i])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
--刷新当前升星坑位英雄的信息
|
||||||
|
function this.UpdateUpStarPosHeroData(curSelectHeroList,_upStarData)
|
||||||
|
-- LogGreen("LengthOfTable(curSelectHeroList) "..LengthOfTable(curSelectHeroList))
|
||||||
|
local upStarData = _upStarData and _upStarData or curSelectUpStarData
|
||||||
|
if LengthOfTable(curSelectHeroList) < upStarData[4] then
|
||||||
|
upStarMaterialIsAll[upStarData[2]]=2
|
||||||
|
Util.GetGameObject(curSelectUpStarGo.transform,"add/add"):SetActive(true)
|
||||||
|
-- local upStarHeroListData=HeroManager.GetUpStarHeroListData(curSelectUpStarData.upStarMaterialsData.Id,curHeroData)
|
||||||
|
-- if upStarHeroListData.state<=0 then
|
||||||
|
-- Util.GetGameObject(curSelectUpStarGo.transform,"add/add"):SetActive(false)
|
||||||
|
-- end
|
||||||
|
Util.GetGameObject(curSelectUpStarGo.transform,"num"):GetComponent("Text").text=string.format("<color=#FF0000FF>%s/%s</color>", LengthOfTable(curSelectHeroList),upStarData[4])
|
||||||
|
else
|
||||||
|
upStarMaterialIsAll[upStarData[2]]=1
|
||||||
|
Util.GetGameObject(curSelectUpStarGo.transform,"add/add"):SetActive(false)
|
||||||
|
Util.GetGameObject(curSelectUpStarGo.transform,"num"):GetComponent("Text").text=string.format("<color=#FFFFFFFF>%s/%s</color>", LengthOfTable(curSelectHeroList),upStarData[4])
|
||||||
|
end
|
||||||
|
local curUpStarConsumeMaterial={}
|
||||||
|
for i, v in pairs(curSelectHeroList) do
|
||||||
|
table.insert(curUpStarConsumeMaterial,v.dynamicId)
|
||||||
|
end
|
||||||
|
upStarConsumeMaterial[upStarData[2]]=curUpStarConsumeMaterial
|
||||||
|
for i = 1, #upStarConsumeMaterial do
|
||||||
|
-- LogGreen("选择升星位置的英雄数量 "..#upStarConsumeMaterial[i])
|
||||||
|
if #upStarConsumeMaterial[i]>0 then
|
||||||
|
for j = 1, #upStarConsumeMaterial[i] do
|
||||||
|
-- LogGreen("选择升星位置的英雄都有谁 "..upStarConsumeMaterial[i][j])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
--更新英雄进阶数据
|
--更新英雄进阶数据
|
||||||
function this.UpdateFirstHeroUpStarData(curHeroCompoundData)
|
function this.UpdateFirstHeroUpStarData(curHeroCompoundData)
|
||||||
|
@ -307,24 +416,47 @@ function this.SingleHeroDataShow(_go,_heroData)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
function this.Compound()
|
function this.Compound()
|
||||||
if compoundNum <= 0 then
|
for k, v in ConfigPairs(ConfigManager.GetConfig(ConfigName.HeroRankupConfig)) do
|
||||||
PopupTipPanel.ShowTip(Language[10431])
|
if v.Star == curSelectHero.heroConfig.Star and v.LimitStar == curSelectHero.heroConfig.Star and v.OpenStar == curSelectHero.heroConfig.Star + 1 then
|
||||||
return
|
upStarRankUpConfig = v
|
||||||
end
|
end
|
||||||
if not materidaIsCan then
|
|
||||||
PopupTipPanel.ShowTip(Language[12193])
|
|
||||||
return
|
|
||||||
end
|
end
|
||||||
NetManager.ComplexTreasureRequest(curSelectEquip.equipType,curIndex,curSelectEquip.quantity,compoundNum,function(msg)
|
local isUpStarMaterialsHero=true
|
||||||
for i = 1, #msg.equipIds do
|
for i = 1, #upStarMaterialIsAll do
|
||||||
EquipTreasureManager.RemoveTreasureByIdDyn(msg.equipIds[i])
|
if upStarMaterialIsAll[i]==2 then
|
||||||
|
isUpStarMaterialsHero=false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if isUpStarMaterialsHero then
|
||||||
|
NetManager.HeroUpStarEvent(curSelectHero.dynamicId,upStarConsumeMaterial ,function (msg)
|
||||||
|
UIManager.OpenPanel(UIName.RoleUpStarSuccessPanel,curSelectHero,upStarRankUpConfig.Id,upStarRankUpConfig.OpenLevel,function ()
|
||||||
|
local dropItemTabs = BagManager.GetTableByBackDropData(msg)
|
||||||
|
if #dropItemTabs > 0 then
|
||||||
|
UIManager.OpenPanel(UIName.RewardItemPopup, msg, 1, function ()
|
||||||
|
this.DeleteUpStarMaterials()
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
this.DeleteUpStarMaterials()
|
||||||
end
|
end
|
||||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
|
|
||||||
this.ShowCurrPosTreasures()
|
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
-- 进阶音效
|
||||||
|
PlaySoundWithoutClick(SoundConfig.Sound_Recruit3)
|
||||||
|
else
|
||||||
|
PopupTipPanel.ShowTip(Language[11852])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
--扣除升星 消耗的材料 更新英雄数据
|
||||||
|
function this.DeleteUpStarMaterials()
|
||||||
|
HeroManager.UpdateSingleHeroDatas(curSelectHero.dynamicId,curSelectHero.lv,curSelectHero.star+1,curSelectHero.breakId,upStarRankUpConfig.Id,true)
|
||||||
|
HeroManager.UpdateSingleHeroSkillData(curSelectHero.dynamicId)
|
||||||
|
--本地数据删除材料英雄
|
||||||
|
for i = 1, #upStarConsumeMaterial do
|
||||||
|
HeroManager.DeleteHeroDatas(upStarConsumeMaterial[i])
|
||||||
|
end
|
||||||
|
--刷新界面
|
||||||
|
this.ShowCurrPosHeroCompound()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- tab节点显示自定义
|
-- tab节点显示自定义
|
||||||
function this.TabAdapter(tab, index, status)
|
function this.TabAdapter(tab, index, status)
|
||||||
local tabLab = Util.GetGameObject(tab, "Text")
|
local tabLab = Util.GetGameObject(tab, "Text")
|
||||||
|
|
|
@ -2883,6 +2883,7 @@ function this.ByCompoundHeroGetAllHeros()
|
||||||
local downSoryHeroList = {}
|
local downSoryHeroList = {}
|
||||||
for i, v in pairs(heroDatas) do
|
for i, v in pairs(heroDatas) do
|
||||||
if v.star == 4 or v.star == 5 then--四星 五星 才能加
|
if v.star == 4 or v.star == 5 then--四星 五星 才能加
|
||||||
|
v.isFormation = ""
|
||||||
table.insert(upSortHeroList,v)
|
table.insert(upSortHeroList,v)
|
||||||
table.insert(downSoryHeroList,v)
|
table.insert(downSoryHeroList,v)
|
||||||
end
|
end
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue