Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. -- Cl apres Ent draw
  2.  
  3. surface.CreateFont( "blackpearls_hardware_printermenu_font",{font = "Roboto",size = ScrH()*0.06,weight = 500,antialias = true})
  4.  
  5. surface.CreateFont( "blackpearls_hardware_printermenu_font2",{font = "Roboto",size = ScrH()*0.035,weight = 500,antialias = true})
  6.  
  7. -- DERMA --
  8.  
  9. net.Receive("blackpearls:HardWare:PrinterMenu",function()
  10. local scrw, scrh, printer = ScrW(), ScrH(), net.ReadEntity()
  11.  
  12.  
  13. local hardWare_printer = vgui.Create( "DFrame" )
  14. hardWare_printer:SetSize( scrw*0.4, scrh*0.4 )
  15. hardWare_printer:Center()
  16. hardWare_printer:SetTitle( "" )
  17. hardWare_printer:SetDraggable( false )
  18. hardWare_printer:ShowCloseButton( false )
  19. hardWare_printer:MakePopup()
  20. hardWare_printer.Paint = function( self, w, h )
  21. draw.RoundedBox( 0, 0, 0, w, h, Color(0, 0, 0, 200) )
  22. draw.RoundedBox( 0, 0, 0, w, scrh*0.07, Color(30, 30, 30, 245) )
  23.  
  24. draw.SimpleText("Printer", "blackpearls_hardware_printermenu_font", w/2, scrh*0.032, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  25. end
  26.  
  27. local close = vgui.Create( "DButton", hardWare_printer )
  28. close:SetSize( scrw * 0.03, scrh * 0.03 )
  29. close:SetPos( scrw * 0.36, scrh * 0.01 )
  30. close:SetText("")
  31. close:SetTextColor(Color(255,255,255))
  32. close.Paint = function( self, w, h )
  33. draw.RoundedBox( 1, 0, 0, w, h, Color(60, 60, 60, 255) )
  34. draw.SimpleText("X", "blackpearls_hardware_printermenu_font2", w/2, h/2, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  35. end
  36. function close:DoClick()
  37. hardWare_printer:Hide()
  38. end
  39. end )
  40.  
  41. -- Init
  42.  
  43. util.AddNetworkString("blackpearls:HardWare:PrinterMenu")
  44.  
  45. function ENT:AcceptInput( _event, _a, _p )
  46. if (_event == "Use" && _p:IsPlayer()) then
  47. if not IsValid(_p) then return end
  48. net.Start("blackpearls:HardWare:PrinterMenu")
  49. net.WriteEntity(self)
  50. net.Send(_p)
  51. end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement