Advertisement
Guest User

Untitled

a guest
May 25th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. include('shared.lua')
  2.  
  3. function ENT:Draw()
  4. self:DrawModel()
  5. end
  6.  
  7. net.Receive("launchmenu", function ()
  8. local fenetre = vgui.Create( "DFrame" )
  9. fenetre:SetPos( 100, 100 )
  10. fenetre:SetSize( 550, 600 )
  11. fenetre:SetTitle( "Caisse de fortifications" )
  12. fenetre:Center()
  13. fenetre:SetDraggable( true )
  14. fenetre:MakePopup()
  15. fenetre:ShowCloseButton( false )
  16. fenetre.Paint = function(self, w, h)
  17.  
  18. draw.RoundedBox(5,0,0,w,h,Color(50,50,50,255))
  19. draw.RoundedBox(0, 0, 25, w, 1,Color(255,255,255,255))
  20. end
  21.  
  22. local scroll = vgui.Create( "DScrollPanel", fenetre ) -- Create the Scroll panel
  23. scroll:Dock( FILL )
  24.  
  25. local list = vgui.Create( "DIconLayout", scroll )
  26. list:Dock( FILL )
  27. list:SetSpaceY( 50 )
  28. list:SetSpaceX( 100 )
  29.  
  30. for i = 1, 10 do -- Make a loop to create a bunch of panels inside of the DIconLayout
  31. local listitem = list:Add( "DPanel" ) -- Add DPanel to the DIconLayout
  32. listitem:SetSize( 250, 200 ) -- Set the size of it
  33. end
  34.  
  35. --local listlabel = list:Add( "DLabel" ) -- Add a label that will be the only panel on its row
  36. --listlabel.OwnLine = true -- The magic variable that specifies this item has its own line all for itself
  37. --listlabel:SetText( "Hello World!" )
  38.  
  39. local closebouton = vgui.Create( "DButton", fenetre ) -- Create the button and parent it to the frame
  40. closebouton:SetText( "X" ) -- Set the text on the button
  41. closebouton:SetPos( 530, 0 ) -- Set the position on the frame
  42. closebouton:SetSize( 20, 20 ) -- Set the size
  43. closebouton.Paint = function(self, w, h)
  44. draw.RoundedBox(5,0,0,w,h,Color(255,255,255,255))
  45. end
  46. closebouton.DoClick = function()
  47. fenetre:Close()
  48. end
  49.  
  50. local icon01 = vgui.Create( "DModelPanel", fenetre )
  51. icon01:SetSize( 225,225 )
  52. icon01:SetPos( 10,-20 )
  53. icon01:SetModel( "models/props_fortifications/sandbags_corner1.mdl" ) -- you can only change colors on playermodels
  54. function icon01:LayoutEntity( Entity ) return end -- disables default rotation
  55. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement