Advertisement
kirkarr

Untitled

Oct 31st, 2023
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.23 KB | None | 0 0
  1. surface.CreateFont("Title", {
  2.     font = "Arial",
  3.     extended = true,
  4.     size = 20
  5. })
  6. local selected = Color(255,255,255)
  7. local Frame = vgui.Create("DFrame")
  8. Frame:SetSize(400,300)     -- Good size for example
  9. Frame:Center()
  10. Frame:SetTitle("")
  11. Frame.title = "ChatBubbles color"    
  12. Frame:MakePopup()    
  13. Frame.Paint = function(self, w, h)
  14.     cur = CurTime()
  15.     for i=1,100 do
  16.         draw.Box(w/2+math.cos(i*55+cur*i/305)*w/2,h/2+math.sin(i*55+cur*i/105)*h/2,10,10,selected    )
  17.     end
  18.     draw.RoundedBox(2, 0, 0, w, h, Color(0, 0, 0, 200))
  19.     draw.RoundedBox(2, 0, 0, w, 25, Color(0, 0, 0, 255))
  20.     draw.SimpleText(self.title, "Title", w/2, 5, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
  21. end
  22. local Mixer = vgui.Create("DColorMixer", Frame)
  23. Mixer:Dock(FILL)                    
  24. Mixer:SetPalette(true)              
  25. Mixer:SetAlphaBar(false)                    
  26. Mixer:SetWangs(false)                
  27. Mixer:SetColor(selected)
  28. Mixer.ValueChanged = function (col)
  29.     selected = Mixer:GetColor()    
  30.     chatbubbles["settings"]["colors"]["background"]["r"] = selected.r
  31.     chatbubbles["settings"]["colors"]["background"]["g"] = selected.g
  32.     chatbubbles["settings"]["colors"]["background"]["b"] = selected.b
  33. end    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement