Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.44 KB | None | 0 0
  1. if (CLIENT) then
  2.    
  3. local ply = LocalPlayer()
  4.  
  5.    net.Receive("factionnet", function()
  6.  
  7. local web = vgui.Create("DFrame")
  8.         web:SetSize(1250,600)
  9.         web:SetTitle("")
  10.         web:SetDraggable(false)
  11.         web:ShowCloseButton(false)
  12.         web:Center()
  13.         web:SetVisible(true)
  14.         web:MakePopup()
  15.  
  16. function web:Paint( w, h )
  17.         web.Paint = function( slf )
  18.         draw.Blur( slf, 3, 16 )
  19.         Derma_DrawBackgroundBlur( self )
  20.         surface.SetDrawColor( 255, 255, 255, 255 )  
  21.         --MAIN PANEL
  22.         draw.RoundedBox( 0, 0, 0, 1300, 600, faction.cfg.BackgroundColor ) --BACKGROUND
  23.         draw.RoundedBox( 0, 25, 25, 1200, 60, faction.cfg.BarColor ) --BAR
  24.         draw.RoundedBox( 0, 25, 100, 1200, 475, faction.cfg.LargeBoxColor ) --BOX
  25.         --JOB COLOR BOX
  26.         draw.RoundedBox( 0, 31, 106, 292, 462, faction.cfg.Job1Color )
  27.         draw.RoundedBox( 0, 329, 106, 292, 462, faction.cfg.Job2Color )
  28.         draw.RoundedBox( 0, 627, 106, 292, 462, faction.cfg.Job3Color )
  29.         draw.RoundedBox( 0, 927, 106, 292, 462, faction.cfg.Job4Color )
  30.         --DESCRIPTION BOXES
  31.         draw.RoundedBox( 0, 37, 413, 280, 150, faction.cfg.LargeBoxColor )
  32.         draw.RoundedBox( 0, 335, 413, 280, 150, faction.cfg.LargeBoxColor )
  33.         draw.RoundedBox( 0, 633, 413, 280, 150, faction.cfg.LargeBoxColor )
  34.         draw.RoundedBox( 0, 933, 413, 280, 150, faction.cfg.LargeBoxColor )
  35.     end
  36.  
  37. local header = vgui.Create("DLabel", web)
  38.         header:SetPos(350,-240)
  39.         header:SetSize(900,600)
  40.         header:SetFont( "factions.font" )
  41.         header:SetText( faction.cfg.Text )
  42.         header:SetWrap(false)
  43.         header:SetTextColor( faction.cfg.TextColor )
  44.  
  45.  
  46. ///JOB1 PANEL////
  47.  
  48. local job1 = vgui.Create( "DModelPanel", web )
  49.         job1:SetModel( faction.cfg.Job1Model )
  50.         job1:SetSize( 292, 462 )
  51.         job1:SetPos( 31, 106 )
  52.         job1:SetCamPos( Vector( 60, 0, 40 ) )
  53.         job1:SetLookAt( Vector( 0, 0, 20 ) )
  54.         function job1:LayoutEntity( Entity ) return end
  55.         function job1.Entity:GetPlayerColor() return Vector ( 1, 0, 0 ) end
  56.  
  57. local job1title = vgui.Create("DLabel", web)
  58.         job1title:SetPos(42,135)
  59.         job1title:SetSize(900,600)
  60.         job1title:SetFont( "factions.fontTitle" )
  61.         job1title:SetText( faction.cfg.Job1Text )
  62.         job1title:SetWrap(false)
  63.         job1title:SetTextColor( faction.cfg.TextColor )
  64.  
  65. local job1desc = vgui.Create("DLabel", web)
  66.         job1desc:SetPos(45,413)
  67.         job1desc:SetSize(270,175)
  68.         job1desc:SetFont( "factions.fontDescription" )
  69.         job1desc:SetText( faction.cfg.Job1Description )
  70.         job1desc:SetWrap(true)
  71.         job1desc:SetTextColor( faction.cfg.TextColor )
  72.        
  73. local button1 = vgui.Create( "DButton", web )
  74.         button1:SetSize( 292, 462 )
  75.         button1:SetPos( 31, 106 )
  76.         button1:SetTextColor( faction.cfg.TextColor )
  77.         button1:SetFont( "factions.font" )
  78.         button1:SetText( "" )
  79.         button1.DoClick = function( button )
  80.        
  81.         net.Start("JobBecome1")
  82.         net.SendToServer()
  83.  
  84.         web:Close()
  85.         surface.PlaySound( faction.cfg.JobBecome )
  86.     end
  87.  
  88. function button1:Paint( w, h )
  89.         button1.Paint = function( slf )
  90.         if button1.Hovered then
  91.                 draw.Blur( slf, 1, 16 )
  92.                 button1:SetText( faction.cfg.SelectText )
  93.             else
  94.             button1:SetText( "" )
  95.         end
  96.     end
  97.  
  98.  
  99. ///JOB2 PANEL////
  100.  
  101. local job2 = vgui.Create( "DModelPanel", web )
  102.         job2:SetModel( faction.cfg.Job1Model )
  103.         job2:SetSize( 292, 462 )
  104.         job2:SetPos( 328, 106 )
  105.         job2:SetCamPos( Vector( 60, 0, 40 ) )
  106.         job2:SetLookAt( Vector( 0, 0, 20 ) )
  107.         function job2:LayoutEntity( Entity ) return end
  108.         function job2.Entity:GetPlayerColor() return Vector ( 0, 0, 0 ) end
  109.  
  110. local job2title = vgui.Create("DLabel", web)
  111.         job2title:SetPos(342,135)
  112.         job2title:SetSize(900,600)
  113.         job2title:SetFont( "factions.fontTitle" )
  114.         job2title:SetText( faction.cfg.Job2Text )
  115.         job2title:SetWrap(false)
  116.         job2title:SetTextColor( faction.cfg.TextColor )
  117.  
  118. local job2desc = vgui.Create("DLabel", web)
  119.         job2desc:SetPos(345,413)
  120.         job2desc:SetSize(270,175)
  121.         job2desc:SetFont( "factions.fontDescription" )
  122.         job2desc:SetText( faction.cfg.Job2Description )
  123.         job2desc:SetWrap(true)
  124.         job2desc:SetTextColor( faction.cfg.TextColor )
  125.  
  126. local button2 = vgui.Create( "DButton", web )
  127.         button2:SetSize( 292, 462 )
  128.         button2:SetPos( 328, 106 )
  129.         button2:SetTextColor( faction.cfg.TextColor )
  130.         button2:SetFont( "factions.font" )
  131.         button2.DoClick = function( button )
  132.         ply:SetTeam( faction.cfg.job2 )
  133.         web:Close()
  134.         surface.PlaySound( faction.cfg.JobBecome )
  135.     end
  136.  
  137. function button2:Paint( w, h )
  138.         button2.Paint = function( slf )
  139.         if button2.Hovered then
  140.                 draw.Blur( slf, 1, 16 )
  141.                 button2:SetText( faction.cfg.SelectText )
  142.             else
  143.             button2:SetText( "" )
  144.         end
  145.     end
  146. end
  147.  
  148. ///JOB3 PANEL////
  149.  
  150. local job2 = vgui.Create( "DModelPanel", web )
  151.         job2:SetModel( faction.cfg.Job1Model )
  152.         job2:SetSize( 292, 462 )
  153.         job2:SetPos( 628, 106 )
  154.         job2:SetCamPos( Vector( 60, 0, 40 ) )
  155.         job2:SetLookAt( Vector( 0, 0, 20 ) )
  156.         function job2:LayoutEntity( Entity ) return end
  157.         function job2.Entity:GetPlayerColor() return Vector ( 0, 1, 0 ) end
  158.  
  159. local job2title = vgui.Create("DLabel", web)
  160.         job2title:SetPos(640,135)
  161.         job2title:SetSize(900,600)
  162.         job2title:SetFont( "factions.fontTitle" )
  163.         job2title:SetText( faction.cfg.Job3Text )
  164.         job2title:SetWrap(false)
  165.         job2title:SetTextColor( faction.cfg.TextColor )
  166.  
  167. local job2desc = vgui.Create("DLabel", web)
  168.         job2desc:SetPos(643,413)
  169.         job2desc:SetSize(270,175)
  170.         job2desc:SetFont( "factions.fontDescription" )
  171.         job2desc:SetText( faction.cfg.Job3Description )
  172.         job2desc:SetWrap(true)
  173.         job2desc:SetTextColor( faction.cfg.TextColor )
  174.  
  175. local button3 = vgui.Create( "DButton", web )
  176.         button3:SetSize( 292, 462 )
  177.         button3:SetPos( 627, 106 )
  178.         button3:SetTextColor( faction.cfg.TextColor )
  179.         button3:SetFont( "factions.font" )
  180.         button3.DoClick = function( button )
  181.         ply:SetTeam( faction.cfg.job3 )
  182.         web:Close()
  183.         surface.PlaySound( faction.cfg.JobBecome )
  184.     end
  185.  
  186. function button3:Paint( w, h )
  187.         button3.Paint = function( slf )
  188.         if button3.Hovered then
  189.                 draw.Blur( slf, 1, 16 )
  190.                 button3:SetText( faction.cfg.SelectText )
  191.             else
  192.             button3:SetText( "" )
  193.         end
  194.     end
  195. end
  196.  
  197. ///JOB4 PANEL////
  198.  
  199. local job4 = vgui.Create( "DModelPanel", web )
  200.         job4:SetModel( faction.cfg.Job1Model )
  201.         job4:SetSize( 292, 462 )
  202.         job4:SetPos( 933, 106 )
  203.         job4:SetCamPos( Vector( 60, 0, 40 ) )
  204.         job4:SetLookAt( Vector( 0, 0, 20 ) )
  205.         function job4:LayoutEntity( Entity ) return end
  206.         function job4.Entity:GetPlayerColor() return Vector ( 0, 0, 1 ) end
  207.  
  208. local job4title = vgui.Create("DLabel", web)
  209.         job4title:SetPos(940,135)
  210.         job4title:SetSize(900,600)
  211.         job4title:SetFont( "factions.fontTitle" )
  212.         job4title:SetText( faction.cfg.Job4Text )
  213.         job4title:SetWrap(false)
  214.         job4title:SetTextColor( faction.cfg.TextColor )
  215.  
  216. local job4desc = vgui.Create("DLabel", web)
  217.         job4desc:SetPos(943,413)
  218.         job4desc:SetSize(270,175)
  219.         job4desc:SetFont( "factions.fontDescription" )
  220.         job4desc:SetText( faction.cfg.Job4Description )
  221.         job4desc:SetWrap(true)
  222.         job4desc:SetTextColor( faction.cfg.TextColor )
  223.  
  224. local button4 = vgui.Create( "DButton", web )
  225.         button4:SetSize( 292, 462 )
  226.         button4:SetPos( 927, 106 )
  227.         button4:SetTextColor( faction.cfg.TextColor )
  228.         button4:SetFont( "factions.font" )
  229.         button4.DoClick = function( button )
  230.         ply:SetTeam( faction.cfg.job4 )
  231.         web:Close()
  232.         surface.PlaySound( faction.cfg.JobBecome )
  233.     end
  234.  
  235. function button4:Paint( w, h )
  236.         button4.Paint = function( slf )
  237.         if button4.Hovered then
  238.                 draw.Blur( slf, 1, 16 )
  239.                 button4:SetText( faction.cfg.SelectText )
  240.             else
  241.             button4:SetText( "" )
  242.                         end
  243.                     end
  244.                 end
  245.             end
  246.         end
  247.     end)
  248. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement