Skip to content

Commit

Permalink
Revert "Optimize item loading with a delay" (#286)
Browse files Browse the repository at this point in the history
Fixes #282
  • Loading branch information
handsomematt authored Jul 11, 2018
1 parent 25ca32a commit 74fa43a
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions lua/pointshop/vgui/DPointShopMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,13 @@ function PANEL:Init()

DScrollPanel:AddItem(ShopCategoryTabLayout)

-- Create 50ms delay before loading the first item
-- Then a 15ms delay between loading each concurrent item
local delay = 0.05
for _, ITEM in pairs(items) do
if ITEM.Category == CATEGORY.Name then
timer.Simple(delay, function()
local model = vgui.Create('DPointShopItem')
model:SetData(ITEM)
model:SetSize(128, 128)

ShopCategoryTabLayout:Add(model)
end)
delay = delay + 0.015
for _, ITEM in pairs(items) do
if ITEM.Category == CATEGORY.Name then
local model = vgui.Create('DPointShopItem')
model:SetData(ITEM)
model:SetSize(128, 128)

ShopCategoryTabLayout:Add(model)
end
end

Expand Down

0 comments on commit 74fa43a

Please sign in to comment.