parent
5f15c8549e
commit
d9dce4e4ca
|
@ -82,7 +82,7 @@ function this.CheckIsMaxLv(heroId)
|
|||
return false
|
||||
end
|
||||
|
||||
function this.GetAllItemsData()
|
||||
function this.GetAllItemsData(pro)
|
||||
local list = {}
|
||||
for k,v in pairs(this.ItemList) do
|
||||
local data = {}
|
||||
|
@ -90,16 +90,23 @@ function this.GetAllItemsData()
|
|||
data.id = k
|
||||
data.property = ItemConfig[k].PropertyName
|
||||
data.Quantity = ItemConfig[k].Quantity
|
||||
if data.property == 0 then
|
||||
data.sortId = -1
|
||||
elseif data.property == pro then
|
||||
data.sortId = 0
|
||||
else
|
||||
data.sortId = data.property
|
||||
end
|
||||
table.insert(list,data)
|
||||
end
|
||||
table.sort(list,function(a,b)
|
||||
if a.Quantity == b.Quantity then
|
||||
if a.property == b.property then
|
||||
if a.sortId == b.sortId then
|
||||
if a.Quantity == b.Quantity then
|
||||
return a.id < b.id
|
||||
end
|
||||
return a.property < b.property
|
||||
else
|
||||
return a.Quantity > b.Quantity
|
||||
else
|
||||
return a.sortId < b.sortId
|
||||
end
|
||||
end)
|
||||
return list
|
||||
|
|
Loading…
Reference in New Issue