Guest User

Untitled

a guest
Aug 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.82 KB | None | 0 0
  1.  
  2. /*---------------------------------------------------------
  3.     TiramisuChatBox
  4. ---------------------------------------------------------*/
  5.  
  6. function SKIN:PaintTiramisuChatBox(panel)
  7.  
  8.     if !panel.Alpha then
  9.         panel.Alpha = 0
  10.     else
  11.         if !panel.Open then
  12.             panel.Alpha = Lerp( 0.2, panel.Alpha, 0 )
  13.         else
  14.              panel.Alpha = Lerp( 0.2, panel.Alpha, 150 )
  15.         end
  16.     end
  17.  
  18.     x, y = panel:ScreenToLocal( 0, 0 )
  19.     lastpos = 0
  20.     color = CAKE.BaseColor or Color( 100, 100, 115, 150 )
  21.    
  22.     // Background
  23.     surface.SetMaterial( matBlurScreen )
  24.     surface.SetDrawColor( 255, 255, 255, panel.Alpha or 0 )
  25.    
  26.     matBlurScreen:SetMaterialFloat( "$blur", panel.Alpha or 0 / 50 )
  27.     render.UpdateScreenEffectTexture()
  28.    
  29.     surface.DrawTexturedRect( x, y, ScrW(), ScrH() )
  30.  
  31.     if ( panel.m_bBackgroundBlur ) then
  32.         Derma_DrawBackgroundBlur( panel, panel.m_fCreateTime )
  33.     end
  34.    
  35.     surface.SetDrawColor( color.r, color.g, color.b, panel.Alpha or 0 )
  36.     surface.DrawRect( x, y, ScrW(), ScrH() )
  37.  
  38.     surface.SetDrawColor( 50, 50, 50, math.Clamp( panel.Alpha or 0 - 50, 0, 255 ) )
  39.  
  40.     for i = 1, panel:GetWide() / 5 * 2  do
  41.         surface.DrawLine( ( i * 5 ), 0, 0, ( i * 5 ) )
  42.     end
  43.  
  44.     // Pretentious line bullshit :P
  45.     x = math.floor( panel:GetWide() / 5 )
  46.     y = math.floor( panel:GetTall() / 5 )
  47.  
  48.     // and some gradient shit for additional overkill
  49.  
  50.     for i = 1, ( y + 5 ) do
  51.         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 ) )
  52.         surface.DrawRect( 0, ( i * 5 ) , panel:GetWide(), 5 )
  53.     end
  54.  
  55.     // Border
  56.     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 )
  57.     surface.DrawOutlinedRect( 0, 0, panel:GetWide(), panel:GetTall() )
  58.  
  59. end
Add Comment
Please, Sign In to add comment