GohoCraft

Darkrp F4 menu

Jun 19th, 2014
1,275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.54 KB | None | 0 0
  1. // FONTS //
  2. surface.CreateFont( "Tohoma", {
  3.     font = "Tohoma",
  4.     size = 24
  5. })
  6.  
  7. surface.CreateFont( "TohomaLarge", {
  8.     font = "Tohoma",
  9.     size = 40,
  10.     weight = 600
  11. })
  12.  
  13. surface.CreateFont( "TohomaMed", {
  14.     font = "Tohoma",
  15.     size = 26,
  16.     weight = 600,
  17.     antialias = true
  18. })
  19.  
  20. surface.CreateFont( "TohomaBody", {
  21.     font = "Tohoma",
  22.     size = 16,
  23.     weight = 400,
  24.     antialias = true
  25. })
  26.  
  27. surface.CreateFont( "MF4.ItemFont", {
  28.     font = "Noasarck",
  29.     size = 25,
  30.     weight = 400,
  31.     antialias = true
  32. })
  33.  
  34. surface.CreateFont( "SubItemFont", {
  35.     font = "Noasarck",
  36.     size = 22,
  37.     weight = 400,
  38.     antialias = true
  39. })
  40.  
  41. surface.CreateFont("BoldFont", {
  42.         font = "Tahoma",
  43.         size = 21,
  44.         weight = 800,
  45.         antialias = true
  46. })
  47.  
  48.  
  49. // TEXTURES //
  50. blank = surface.GetTextureID( "vgui/white" )
  51. gradleft = surface.GetTextureID( "vgui/gradient-r" )
  52. gradup = surface.GetTextureID( "vgui/gradient-d" )
  53.  
  54.  
  55. // CONFIG STUFF //
  56. Config = {}             -- Main init.
  57. Config.Colors = {}      -- Color list init.
  58. Config.Colors.White = Color(236, 240, 241)
  59.  
  60.  
  61. // CORNER POLY GEN FUNCTION //
  62. function DrawCorner( x, y, w, h, color )
  63.     local ButtonCorner = {{ },{ },{ },{ }}
  64.    
  65.     -- First Vert. | Top Left --
  66.     ButtonCorner[1]["x"] = x
  67.     ButtonCorner[1]["y"] = y
  68.     ButtonCorner[1]["u"] = 0
  69.     ButtonCorner[1]["v"] = 0
  70.    
  71.     -- Sencond Vert. | Top Right --
  72.     ButtonCorner[2]["x"] = x + w
  73.     ButtonCorner[2]["y"] = y
  74.     ButtonCorner[2]["u"] = 1
  75.     ButtonCorner[2]["v"] = 0
  76.    
  77.     -- Third Vert. | Bottom Right --
  78.     ButtonCorner[3]["x"] = x + w + w
  79.     ButtonCorner[3]["y"] = y + h
  80.     ButtonCorner[3]["u"] = 1
  81.     ButtonCorner[3]["v"] = 0
  82.    
  83.     -- Fourth Vert. | Bottom Left --
  84.     ButtonCorner[4]["x"] = x + w
  85.     ButtonCorner[4]["y"] = y + h
  86.     ButtonCorner[4]["u"] = 0
  87.     ButtonCorner[4]["v"] = 1
  88.    
  89.     surface.SetTexture( blank )
  90.     surface.SetDrawColor( color )
  91.     surface.DrawPoly( ButtonCorner )
  92. end
  93.  
  94.  
  95. PANEL = {}
  96.  
  97. function PANEL:Init()
  98.     self.StartTime = SysTime()
  99.    
  100.     self.F4Down = true
  101.    
  102.     self:SetSize( 916, 600 - 42 )
  103.     self:Center()
  104.     self:SetVisible( true )
  105.     self:MakePopup()
  106.     self:SetDraggable( false )
  107.     self:ShowCloseButton( false )
  108.  
  109.     TopBar = vgui.Create( "DPanel", self )
  110.     TopBar:SetSize( self:GetWide(), 30 )
  111.     TopBar.Paint = function()
  112.         draw.RoundedBox( 0, 0, 0, TopBar:GetWide(), TopBar:GetTall(), Config.Colors.BarColor )
  113.     end
  114.    
  115.     CloseButton = vgui.Create( "DButton", TopBar )
  116.     CloseButton:SetSize( 40, 20 )
  117.     CloseButton:SetText("")
  118.     CloseButton:SetPos( TopBar:GetWide() - CloseButton:GetWide() - 12, 0 )
  119.     CloseButton.DoClick = function()
  120.         self:Close()
  121.     end
  122.     CloseButton.Paint = function(self, w, h)
  123.         draw.RoundedBox( 0, 0, 0, w, h, Config.Colors.MainBackground )
  124.         draw.SimpleText( "X", "BoldFont", w/2, h/2, Config.Colors.White, 1, 1 )
  125.         if CloseButton:IsDown() then
  126.             draw.RoundedBox( 0, 2, 0, w - 4, h, Config.Colors.Shadow )
  127.         end
  128.     end
  129.    
  130.     self.Tabs = vgui.Create( "DTabSheet", self )
  131.     self.Tabs:SetPos( 0, 39 )
  132.     self.Tabs:SetSize( self:GetWide(), self:GetTall() )
  133.  
  134.     local ActionsTab = vgui.Create( "DActionsPage" )
  135.     self.Tabs:AddSheet( "Commands", ActionsTab )
  136.    
  137.     local JobsTab = vgui.Create( "DJobPanel" )
  138.     JobsTab:SetSize( 700, 500 )
  139.     self.Tabs:AddSheet( "Jobs", JobsTab )
  140.    
  141.     local EntTab = vgui.Create( "DHolder" )
  142.     EntTab:SetSize( 700, 500 )
  143.    
  144.     local EntPage = vgui.Create( "F4MenuEntities" )
  145.     EntTab:AddTab( "Entities", EntPage )
  146.      
  147.     local F4Page = vgui.Create( "F4MenuShipments" )
  148.     EntTab:AddTab( "Shipments", F4Page )
  149.        
  150.     local AmmoPage = vgui.Create( "F4MenuAmmo" )
  151.     EntTab:AddTab( "Ammo", AmmoPage )
  152.    
  153.     self.Tabs:AddSheet( "Entities", EntTab )
  154.    
  155.     self.Tabs:AddFiller()   // Ignore these ;v
  156.     self.Tabs:AddFiller()
  157.     self.Tabs:AddFiller()
  158.     self.Tabs:AddFiller()
  159.     self.Tabs:AddFiller()
  160.     self.Tabs:AddFiller()
  161.    
  162.     local ForumPage = vgui.Create( "DForumPage" )
  163.     self.Tabs:AddSheet( "Forums", ForumPage )
  164.    
  165.     local DonationPage = vgui.Create( "DDonationPage" )
  166.     self.Tabs:AddSheet( "Donate", DonationPage )
  167. end
  168.  
  169. function PANEL:Close()
  170.     self:Hide()
  171. end
  172.  
  173. function PANEL:Paint()
  174.     // Could be done more efficiently ;v
  175.     Derma_DrawBackgroundBlur( self, self.StartTime )
  176.    
  177.     draw.RoundedBox( 0, 7, 30, 185, self:GetTall(), Config.Colors.BarColor )
  178.     draw.RoundedBox( 0, 7, 30, 185, self:GetTall(), Color( 0, 0, 0, 100 ) )
  179.    
  180.     draw.RoundedBox( 0, 183, 30, self:GetWide(), self:GetTall(), Config.Colors.MainBackground )
  181.  
  182.     draw.RoundedBox( 0, 0, 30, self:GetWide(), 15, Config.Colors.MainBackground )
  183.     DrawCorner( 172, 45 + (0 * 43), 11, 11, Config.Colors.MainBackground )
  184.  
  185.     draw.RoundedBox( 0, 0, 45 + (1 * 40) + (0 * 3), self:GetWide(), 3, Config.Colors.MainBackground )
  186.     DrawCorner( 172, 45 + (1 * 43), 11, 11, Config.Colors.MainBackground )
  187.  
  188.     draw.RoundedBox( 0, 0, 45 + (2 * 40) + (1 * 3), self:GetWide(), 3, Config.Colors.MainBackground )
  189.     DrawCorner( 172, 45 + (2 * 43), 11, 11, Config.Colors.MainBackground )
  190.    
  191.     draw.RoundedBox( 0, 0, 45 + (9 * 40) + (8 * 3), self:GetWide(), 3, Config.Colors.MainBackground )
  192.     DrawCorner( 172, 45 + (9 * 43), 11, 11, Config.Colors.MainBackground )
  193.    
  194.     draw.RoundedBox( 0, 0, 45 + (10 * 40) + (9 * 3), self:GetWide(), 3, Config.Colors.MainBackground )
  195.     DrawCorner( 172, 45 + (10 * 43), 11, 11, Config.Colors.MainBackground )
  196.    
  197.     draw.RoundedBox( 0, 0, 45 + (11 * 40) + (10 * 3), self:GetWide(), 1000, Config.Colors.MainBackground )
  198.    
  199.     draw.RoundedBox( 0, 0, 45 + (3 * 40) + (2 * 3), 193, 45 + (5 * 40) + (4 * 3) + 1, Config.Colors.MainBackground )
  200.    
  201.     draw.RoundedBox( 0, 193, 5, 2, self:GetTall(), Config.Colors.BarColor )
  202.     draw.RoundedBox( 0, 0, 5, 193, self:GetTall(), Config.Colors.Shadow )
  203.  
  204. end
  205.  
  206. vgui.Register( "F4Frame", PANEL, "DFrame" )
Advertisement
Add Comment
Please, Sign In to add comment