Advertisement
Guest User

Untitled

a guest
Dec 9th, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.49 KB | None | 0 0
  1. // Clientside only stuff goes here
  2. function ShowTeamMenu()
  3. local DermaPanel = vgui.Create( "DFrame" ) -- Creates the frame itself
  4. DermaPanel:SetPos( 80,80 ) -- Position on the players screen
  5. DermaPanel:SetSize( 600, 500 ) -- Size of the frame
  6. DermaPanel:SetTitle( "Main Menu" ) -- Title of the frame
  7. DermaPanel:SetVisible( true )
  8. DermaPanel:SetDraggable( false ) -- Draggable by mouse?
  9. DermaPanel:ShowCloseButton( true ) -- Show the close button?
  10. DermaPanel:MakePopup() -- Show the frame
  11.    
  12. local TestingPanel = vgui.Create( "DPanel", DermaPanel )
  13. TestingPanel:SetPos( 25, 50 )
  14. TestingPanel:SetSize( 550, 50 )
  15. TestingPanel.Paint = function() -- Paint function
  16.     surface.SetDrawColor( 50, 50, 50, 255 ) -- Set our rect color below us; we do this so you can see items added to this panel
  17.     surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() ) -- Draw the rect
  18. surface.DrawText( "Message of the Day: Zyler Rocks!" )
  19. end
  20.    
  21. local PropertySheet = vgui.Create( "DPropertySheet" )
  22. PropertySheet:SetParent( DermaPanel )
  23. PropertySheet:SetPos( 25, 110 )
  24. PropertySheet:SetSize( 550, 315 )
  25.    
  26. local Welcome = vgui.Create( "DLabel" )
  27. Welcome:SetText( "A" )
  28. Welcome:SetColor(Color(191,255,0,255))
  29. Welcome:SizeToContents()
  30.    
  31. local Character = vgui.Create( "DPanel" )
  32. Character:SetSize( 305, 305 )
  33. Character.paint = function()
  34. surface.SetDrawColor(Color(191,255,0,255))
  35. surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() )
  36. surface.DrawText( "Characters" )
  37. end
  38.    
  39. local Props = vgui.Create( "DPanel" )
  40. Props:SetSize( 305, 305 )
  41. Props.paint = function()
  42. surface.SetDrawColor(Color(191,255,0,255))
  43. surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() )
  44. surface.DrawText( "Pick props to spawn" )
  45. end
  46.    
  47.    
  48. local food = {}
  49.    
  50.         food[1] = "models/props_junk/garbage_milkcarton002a.mdl"
  51.     food[2] = "models/props_junk/PopCan01a.mdl"
  52.     food[3] = "models/props_junk/garbage_takeoutcarton001a.mdl"
  53.     food[4] = "models/props_junk/watermelon01.mdl"
  54.     food[5] = "models/props_junk/garbage_metalcan001a.mdl"
  55.     food[6] = "models/props_lab/box01a.mdl"
  56.     food[7] = "models/props_lab/box01b.mdl"
  57.    
  58. local Proplist1 = vgui.Create("DCollapsibleCategory", Props)
  59. Proplist1:SetPos(25, 50)
  60. Proplist1:SetSize( 450, 50 ) -- Keep the second number at 50
  61. Proplist1:SetLabel( "Proplist1" )
  62.    
  63. Proplist1menu = vgui.Create("DModelSelect", Proplist1 )
  64. Proplist1menu:SetSize( 300, 300 )
  65. Proplist1menu:SetSpacing( 5 )
  66. Proplist1menu:EnableHorizontal( true )
  67. Proplist1menu:EnableVerticalScrollbar( false )
  68. Proplist1menu:SetPadding( 4 )
  69.    
  70. for k,v in pairs(food) do
  71.     local icon = vgui.Create( "SpawnIcon", Proplist1menu )
  72.     icon:SetModel( v )
  73.     Proplist1menu:AddItem( icon )
  74.     icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) RunConsoleCommand("gm_spawn", v)
  75. end
  76. end
  77. Proplist1:SetContents(Proplist1menu)
  78. PropertySheet:AddSheet( "Welcome", Welcome, "gui/silkicons/user", false, false, "Rules and stuff" )
  79. PropertySheet:AddSheet( "Character/Groups", Character, "gui/silkicons/group", false, false, "Manage your character and groups" )
  80. PropertySheet:AddSheet( "Props/Tools", Props, "gui/silkicons/group", false, false, "Get Props and Tools" )
  81.  
  82. local groupsnamesasdf = {}
  83. groupsnamesasdf[1] = "Civil Service"
  84. groupsnamesasdf[2] = "Government"
  85. groupsnamesasdf[3] = "Employable"
  86.    
  87.  local groupslist = vgui.Create("DCollapsibleCategory", Character)
  88. groupslist:SetPos(25, 50)
  89. groupslist:SetSize( 450, 45 ) -- Keep the second number at 50
  90. groupslist:SetLabel( "Groups" )
  91.  
  92. local group1 = vgui.Create("DLabel", groupslist)
  93. group1:SetPos(20,20)
  94. group1:SetColor(Color(255,255,255,255))
  95. group1:SetFont("default")
  96. group1:SetText(groupsnamesasdf[1])
  97. group1:SizeToContents()
  98.  
  99. group1menu = vgui.Create("DModelSelect", groupslist )
  100. group1menu:SetPos(40, 40)
  101. group1menu:SetSize( 300, 300 )
  102. group1menu:SetSpacing( 5 )
  103. group1menu:EnableHorizontal( true )
  104. group1menu:EnableVerticalScrollbar( false )
  105. group1menu:SetPadding( 4 )
  106.  
  107. for _, pl in pairs( team.GetPlayers( 1 ) ) do -- loop through all the players on TEAM_WHATEVER
  108.  
  109.     local spawnicon = vgui.Create( "SpawnIcon", group1menu )
  110.     spawnicon:SetModel( pl:GetModel() ) -- get their model, set the spawnicon to it
  111.     spawnicon:SetTooltip( pl:Nick() ) -- "little yellow speech bubbles when you move your cursor over them"
  112.     group1menu:AddItem( spawnicon )
  113.      
  114. end
  115. groupslist:SetContents(group1menu)
  116. end
  117.    
  118. usermessage.Hook( "call_vgui", ShowTeamMenu )
  119.  
  120.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement