Merge branch 'china/dev' of http://60.1.1.230/gaoxin/JL_Client into china/dev
commit
a17a8604d9
|
@ -153,15 +153,40 @@ function RewardBoxPanel:SetGiftData()--设置奖励列表
|
|||
for index, value in ipairs(this.rewardGroup) do
|
||||
RewardGroupList[index] = value
|
||||
end
|
||||
itemType = itemConfig[rewardGroup[RewardGroupList[tagNum]].ShowItem[1][1]].ItemType
|
||||
this.ScrollView:SetData(rewardGroup[RewardGroupList[tagNum]].ShowItem,function(index,item)
|
||||
RewardBoxPanel:SetSingleGiftData(index,item,RewardGroupList[tagNum],tagNum)
|
||||
|
||||
local dataList = {}
|
||||
local showItems = rewardGroup[RewardGroupList[tagNum]].ShowItem
|
||||
for _, item in ipairs(showItems) do
|
||||
local itemType = itemConfig[item[1]].ItemType
|
||||
if itemType == ItemType.Hero then
|
||||
-- 判断是否在版本内
|
||||
if HeroManager.InVersion(item[1]) then
|
||||
table.insert(dataList, item)
|
||||
end
|
||||
elseif itemType == ItemType.HeroDebris then
|
||||
-- 判断是否在版本内
|
||||
local heroId = HeroManager.ChipIdToHeroId(item[1])
|
||||
if not heroId or HeroManager.InVersion(heroId) then
|
||||
table.insert(dataList, item)
|
||||
end
|
||||
else
|
||||
table.insert(dataList, item)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
itemType = itemConfig[dataList[1][1]].ItemType
|
||||
for _, data in ipairs(dataList) do
|
||||
LogRed(data[1])
|
||||
end
|
||||
this.ScrollView:SetData(dataList,function(index,item)
|
||||
RewardBoxPanel:SetSingleGiftData(index,item,dataList)
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
--刷新每一条奖励信息
|
||||
function RewardBoxPanel:SetSingleGiftData(index,item,boxId,tagNum)
|
||||
function RewardBoxPanel:SetSingleGiftData(index,item,dataList)
|
||||
itemList[index] = item
|
||||
local icon = Util.GetGameObject(item,"icon")
|
||||
local yihuode = Util.GetGameObject(icon,"yihuode")
|
||||
|
@ -177,18 +202,18 @@ function RewardBoxPanel:SetSingleGiftData(index,item,boxId,tagNum)
|
|||
view.transform:SetAsFirstSibling()
|
||||
itemIconList[item] = view
|
||||
end
|
||||
itemIconList[item]:OnOpen(false,rewardGroup[boxId].ShowItem[index],1,false, false, false, self.sortingOrder)
|
||||
itemIconList[item]:OnOpen(false,dataList[index],1,false, false, false, self.sortingOrder)
|
||||
itemIconList[item].gameObject:SetActive(true)
|
||||
itemIconList[item]:SetEffectLayer(self.sortingOrder)
|
||||
tip.text = GetLanguageStrById(itemConfig[rewardGroup[boxId].ShowItem[index][1]].Name)
|
||||
tip.text = GetLanguageStrById(itemConfig[dataList[index][1]].Name)
|
||||
|
||||
--判断是否是在背包界面打开
|
||||
select:GetComponent("Button").interactable = BagManager.isBagPanel
|
||||
select:SetActive(BagManager.isBagPanel)
|
||||
yihuode:SetActive(false)
|
||||
if itemConfig[rewardGroup[boxId].ShowItem[index][1]].ItemType == ItemType.Incarnation and BagManager.isBagPanel then
|
||||
local num = BagManager.GetItemCountById(rewardGroup[boxId].ShowItem[index][1])
|
||||
if num > 0 or IncarnationManager.GetStatusByItemId(rewardGroup[boxId].ShowItem[index][1]) >= 0 then
|
||||
if itemConfig[dataList[index][1]].ItemType == ItemType.Incarnation and BagManager.isBagPanel then
|
||||
local num = BagManager.GetItemCountById(dataList[index][1])
|
||||
if num > 0 or IncarnationManager.GetStatusByItemId(dataList[index][1]) >= 0 then
|
||||
select:SetActive(false)
|
||||
yihuode:SetActive(true)
|
||||
else
|
||||
|
@ -197,7 +222,7 @@ function RewardBoxPanel:SetSingleGiftData(index,item,boxId,tagNum)
|
|||
end
|
||||
end
|
||||
--判断是否选了该物品
|
||||
if curId == rewardGroup[boxId].ShowItem[index][1] then
|
||||
if curId == dataList[index][1] then
|
||||
go:SetActive(true)
|
||||
else
|
||||
go:SetActive(false)
|
||||
|
@ -212,7 +237,7 @@ function RewardBoxPanel:SetSingleGiftData(index,item,boxId,tagNum)
|
|||
goList[index]:SetActive(false)
|
||||
end
|
||||
go:SetActive(true)
|
||||
curId = rewardGroup[boxId].ShowItem[index][1]
|
||||
curId = dataList[index][1]
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue