Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*---------------------------------------------------------
- TiramisuChatBox
- ---------------------------------------------------------*/
- function SKIN:PaintTiramisuChatBox(panel)
- if !panel.Alpha then
- panel.Alpha = 0
- else
- if !panel.Open then
- panel.Alpha = Lerp( 0.2, panel.Alpha, 0 )
- else
- panel.Alpha = Lerp( 0.2, panel.Alpha, 150 )
- end
- end
- x, y = panel:ScreenToLocal( 0, 0 )
- lastpos = 0
- color = CAKE.BaseColor or Color( 100, 100, 115, 150 )
- // Background
- surface.SetMaterial( matBlurScreen )
- surface.SetDrawColor( 255, 255, 255, panel.Alpha or 0 )
- matBlurScreen:SetMaterialFloat( "$blur", panel.Alpha or 0 / 50 )
- render.UpdateScreenEffectTexture()
- surface.DrawTexturedRect( x, y, ScrW(), ScrH() )
- if ( panel.m_bBackgroundBlur ) then
- Derma_DrawBackgroundBlur( panel, panel.m_fCreateTime )
- end
- surface.SetDrawColor( color.r, color.g, color.b, panel.Alpha or 0 )
- surface.DrawRect( x, y, ScrW(), ScrH() )
- surface.SetDrawColor( 50, 50, 50, math.Clamp( panel.Alpha or 0 - 50, 0, 255 ) )
- for i = 1, panel:GetWide() / 5 * 2 do
- surface.DrawLine( ( i * 5 ), 0, 0, ( i * 5 ) )
- end
- // Pretentious line bullshit :P
- x = math.floor( panel:GetWide() / 5 )
- y = math.floor( panel:GetTall() / 5 )
- // and some gradient shit for additional overkill
- for i = 1, ( y + 5 ) do
- surface.SetDrawColor( math.Clamp( color.r - 50, 0, 255 ), math.Clamp( color.g - 50,0, 255 ), math.Clamp( color.b - 50, 0, 255 ), Lerp( i / ( ( y + 5 ) ), 0 , panel.Alpha or 0 ) )
- surface.DrawRect( 0, ( i * 5 ) , panel:GetWide(), 5 )
- end
- // Border
- surface.SetDrawColor( math.Clamp( color.r - 50, 0, 255 ), math.Clamp( color.g - 50,0, 255 ), math.Clamp( color.b - 50, 0, 255 ), panel.Alpha or 0 )
- surface.DrawOutlinedRect( 0, 0, panel:GetWide(), panel:GetTall() )
- end
Add Comment
Please, Sign In to add comment