From 74fa43a4cf33ae26c752eeb8bb89eacd6dc8276e Mon Sep 17 00:00:00 2001 From: Matt Stevens Date: Wed, 11 Jul 2018 08:45:12 +0100 Subject: [PATCH] Revert "Optimize item loading with a delay" (#286) Fixes #282 --- lua/pointshop/vgui/DPointShopMenu.lua | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/lua/pointshop/vgui/DPointShopMenu.lua b/lua/pointshop/vgui/DPointShopMenu.lua index 2048ce6..478e655 100644 --- a/lua/pointshop/vgui/DPointShopMenu.lua +++ b/lua/pointshop/vgui/DPointShopMenu.lua @@ -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