玉虚谭升星修改

dev_chengFeng
wangzhenxing 2023-04-23 13:45:34 +08:00
parent 254c85f3de
commit 934d262918
1 changed files with 11 additions and 39 deletions

View File

@ -273,24 +273,15 @@ function this.UpdateHeroUpStarData(_curUpStarData)
end
--分析设置升星界面显示的英雄list数据 如果当前升星材料的坑位的英雄数据与 以其他坑位有重合并且选择上的英雄不显示 如果是当前坑位显示的英雄显示对勾
function this.SetShowHeroListData(upStarConsumeMaterial,curHeroList,isFirstPos)--1 消耗的总消耗组 2 当前坑位可选择的所有英雄
-- local curEndShowHeroListData={}
-- for i = 1, #curHeroList do
-- if curHeroList[i].dynamicId ~= curSelectHero.dynamicId then
-- curHeroList[i].isSelect=2
-- table.insert(curEndShowHeroListData,curHeroList[i])
-- elseif isFirstPos then
-- curHeroList[i].isSelect=1
-- table.insert(curEndShowHeroListData,curHeroList[i])
-- end
-- end
local curEndShowHeroListData2={}
for i = 1, #curHeroList do
table.insert(curEndShowHeroListData2,curHeroList[i])
end
local curEndShowHeroListData={}
for i, v in pairs(curEndShowHeroListData2) do
v.isSelect=2
table.insert(curEndShowHeroListData,v)
for i = 1, #curHeroList do
if curHeroList[i].dynamicId ~= curSelectHero.dynamicId then
curHeroList[i].isSelect=2
table.insert(curEndShowHeroListData,curHeroList[i])
elseif isFirstPos then
curHeroList[i].isSelect=1
table.insert(curEndShowHeroListData,curHeroList[i])
end
end
if isFirstPos then
return curEndShowHeroListData
@ -298,32 +289,15 @@ function this.SetShowHeroListData(upStarConsumeMaterial,curHeroList,isFirstPos)-
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
if j==curSelectUpStarData[2] then--curSelectUpStarData 当前坑位选择的英雄信息
for _, v in pairs(curEndShowHeroListData) do
if v.type == RoleUpStarMatType.hero and v.dynamicId==upStarConsumeMaterial[j][k].dynamicId then
v.isSelect=1
elseif v.type == RoleUpStarMatType.item and v.id==upStarConsumeMaterial[j][k].id and v.index==upStarConsumeMaterial[j][k].index then
if v.dynamicId==upStarConsumeMaterial[j][k] then
v.isSelect=1
end
end
else
for i, v in pairs(curEndShowHeroListData) do
if v.type == RoleUpStarMatType.hero and v.dynamicId==upStarConsumeMaterial[j][k].dynamicId then
curEndShowHeroListData[i] = nil
elseif v.type == RoleUpStarMatType.item and v.id==upStarConsumeMaterial[j][k].id and v.index==upStarConsumeMaterial[j][k].index then
if v.dynamicId==upStarConsumeMaterial[j][k] then
curEndShowHeroListData[i] = nil
end
end
@ -354,9 +328,7 @@ function this.AutoSelectUpStarHeroList(_curUpStarData)
-- curSelectUpStarGo = needHeros[i + 1]
for j = 1, LengthOfTable(upStarHeroListData) do
if #curSelectHeroList < _curUpStarData.upStarData[i][4] then
-- if upStarHeroListData[j] and upStarHeroListData[j].dynamicId and upStarHeroListData[j].lockState == 0 and (curSelectHero.heroConfig and upStarHeroListData[j].dynamicId ~= curSelectHero.dynamicId) and upStarHeroListData[j].isFormation == ""
if upStarHeroListData[j].type == RoleUpStarMatType.item or upStarHeroListData[j].type == RoleUpStarMatType.hero and upStarHeroListData[j].lockState == 0 and upStarHeroListData[j].isFormation == ""
if upStarHeroListData[j] and upStarHeroListData[j].dynamicId and upStarHeroListData[j].lockState == 0 and (curSelectHero.heroConfig and upStarHeroListData[j].dynamicId ~= curSelectHero.dynamicId) and upStarHeroListData[j].isFormation == ""
and not HarmonyManager.IsChangeColor(upStarHeroListData[j].dynamicId) and not HarmonyManager:IsEnvoy(upStarHeroListData[j].dynamicId) then
table.insert(curSelectHeroList,upStarHeroListData[j])
end