Skip to content

Commit

Permalink
Update cl_download.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
nodgear authored Oct 5, 2020
1 parent 22f6ea8 commit 7237bd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/awlib/modules/ui_utils/cl_download.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function Aw.UI:DownloadIcon(pnl, tbl, pnlVar)
local i = 1
local function AsyncDownload()
if (!tbl[i]) then p:reject() end

if !pnl then return end
pnl[pnlVar or "Icon"] = "Loading"
DownloadImage(tbl[i]):next(function(result)
p:resolve(result):next(function()
Expand All @@ -102,7 +102,7 @@ function Aw.UI:DrawIcon(x, y, w, h, pnl, col, loadCol, var)
col = col or color_white
loadCol = loadCol or color_green
var = var or "Icon"

if !pnl then return end
if (pnl[var] and type(pnl[var]) == "IMaterial") then
surface.SetMaterial(pnl[var])
surface.SetDrawColor(col)
Expand Down

0 comments on commit 7237bd5

Please sign in to comment.