optimize by not drawing blur if alpha == 255
This commit is contained in:
parent
27d4dda2a2
commit
bb7de8eac9
1 changed files with 4 additions and 2 deletions
|
@ -77,7 +77,9 @@ local function CreateChatbox()
|
|||
frame.lblTitle:SetVisible(false)
|
||||
|
||||
function frame:Paint(w, h)
|
||||
if CHATBOX_BLUR:GetBool() then
|
||||
local alpha = CHATBOX_ALPHA:GetInt()
|
||||
|
||||
if CHATBOX_BLUR:GetBool() and alpha ~= 255 then
|
||||
local x, y = self:LocalToScreen(0, 0)
|
||||
|
||||
surface_SetMaterial(MATERIAL_BLUR)
|
||||
|
@ -92,7 +94,7 @@ local function CreateChatbox()
|
|||
end
|
||||
|
||||
local color = string.Explode(" ", CHATBOX_COLOR:GetString())
|
||||
surface_SetDrawColor(tonumber(color[1]), tonumber(color[2]), tonumber(color[3]), CHATBOX_ALPHA:GetInt())
|
||||
surface_SetDrawColor(tonumber(color[1]), tonumber(color[2]), tonumber(color[3]), alpha)
|
||||
surface_DrawRect(0, 0, w, h)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue