【逍遥游】掉落问题修改
parent
3d105fae48
commit
350f13371a
|
@ -40,11 +40,15 @@ function this:OnOpen(_type,_data)
|
|||
this.grid:SetActive(true)
|
||||
this.xianyuan:SetActive(false)
|
||||
local showItemdata=this.GetDropReward(_data)
|
||||
Log("终极大奖:"..#_data.itemlist)
|
||||
Log("终极大奖:"..#showItemdata)
|
||||
local starItemDataList=BagManager.GetItemListFromTempBag(_data)
|
||||
for i = 1, #starItemDataList do
|
||||
this.SetItemData2(starItemDataList[i])
|
||||
end
|
||||
-- Log("终极大奖:"..#_data.itemlist)
|
||||
-- Log("终极大奖:"..#showItemdata)
|
||||
if showItemdata and #showItemdata>0 then
|
||||
for i = 1, #showItemdata do
|
||||
Log("终极大奖:"..showItemdata[i][1])
|
||||
-- Log("终极大奖:"..showItemdata[i][1])
|
||||
local _rewardObj= SubUIManager.Open(SubUIConfig.ItemView, this.grid.transform)
|
||||
_rewardObj:OnOpen(false,showItemdata[i],1)
|
||||
end
|
||||
|
@ -52,7 +56,22 @@ function this:OnOpen(_type,_data)
|
|||
|
||||
end
|
||||
end
|
||||
|
||||
--存储本地
|
||||
function this.SetItemData2(itemdata)
|
||||
if itemdata.itemType==1 then
|
||||
--后端更新
|
||||
elseif itemdata.itemType==2 then
|
||||
EquipManager.UpdateEquipData(itemdata.backData)
|
||||
elseif itemdata.itemType==3 then
|
||||
HeroManager.UpdateHeroDatas(itemdata.backData)
|
||||
elseif itemdata.itemType==4 then
|
||||
TalismanManager.InitUpdateSingleTalismanData(itemdata.backData)
|
||||
elseif itemdata.itemType==5 then
|
||||
EquipTreasureManager.InitSingleTreasureData(itemdata.backData)
|
||||
elseif itemdata.itemType==6 then
|
||||
PokemonManager.UpdatePokemonDatas(itemdata.backData,true)
|
||||
end
|
||||
end
|
||||
function this.GetDropReward(_drop)
|
||||
local _rewardList={}
|
||||
if _drop.itemlist then
|
||||
|
@ -64,26 +83,26 @@ function this.GetDropReward(_drop)
|
|||
table.insert(_rewardList,_rewardData)
|
||||
end
|
||||
end
|
||||
if not _drop.equipId then
|
||||
if _drop.equipId then
|
||||
for i = 1, #_drop.equipId do
|
||||
local _rewardData={}
|
||||
_rewardData[1]=_drop.equipId[i].id
|
||||
_rewardData[1]=_drop.equipId[i].equipId--id
|
||||
_rewardData[2]=1
|
||||
table.insert(_rewardList,_rewardData)
|
||||
end
|
||||
end
|
||||
if not _drop.Hero then
|
||||
if _drop.Hero then
|
||||
for i = 1, #_drop.Hero do
|
||||
local _rewardData={}
|
||||
_rewardData[1]=_drop.Hero[i].id
|
||||
_rewardData[1]=_drop.Hero[i].heroId--id
|
||||
_rewardData[2]=1
|
||||
table.insert(_rewardList,_rewardData)
|
||||
end
|
||||
end
|
||||
if not _drop.soulEquip then
|
||||
if _drop.soulEquip then
|
||||
for i = 1, #_drop.soulEquip do
|
||||
local _rewardData={}
|
||||
_rewardData[1]=_drop.soulEquip[i].id
|
||||
_rewardData[1]=_drop.soulEquip[i].equipId--id
|
||||
_rewardData[2]=1
|
||||
table.insert(_rewardList,_rewardData)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue