【ID1010436】

【优化】好感度增加通用礼物 及界面优化
dev_chengFeng
jiaoyangna 2021-10-11 12:45:23 +08:00
parent 5f15c8549e
commit d9dce4e4ca
1 changed files with 12 additions and 5 deletions

View File

@ -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