Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.75 KB | None | 0 0
  1. local function mainMenuTheme()
  2.     surface.PlaySound( "main_menu_background.mp3" )
  3.     timer.Simple( 190, function()
  4.         mainMenuTheme()
  5.     end )
  6. end
  7.  
  8. local mainMenuLinks = {
  9.    
  10.     [ "NEW CHRACTER" ] = { funcclick = function() print("clicked1") end },
  11.     [ "CHRACTER SELECTION" ] = { funcclick = function() print("clicked2") end },
  12.     [ "SETTINGS" ] = { funcclick = function() print("clicked3") end },
  13.     [ "DISCONNECT" ] = { funcclick = function() print("clicked4") end }
  14.  
  15. }
  16.  
  17. concommand.Add( "menu", function()
  18.  
  19.     local mainPanel = vgui.Create( "DPanel" )
  20.     mainPanel:SetSize( ScrW(), ScrH() )
  21.     mainPanel.Paint = function()
  22.         draw.RoundedBox( 0, 0, 0, mainPanel:GetWide(), mainPanel:GetTall(), Color( 0, 0, 0, 0 ) )
  23.     end
  24.  
  25.     local title = vgui.Create( "DLabel", mainPanel )
  26.     title:SetFont( "mainmenu_title" )
  27.     title:SetText( "CITY LIFE" )
  28.     title:SetPos( 50, 50 )
  29.     title:SizeToContents()
  30.  
  31.     local subtitle = vgui.Create( "DLabel", mainPanel )
  32.     subtitle:SetFont( "subtitle" )
  33.     subtitle:SetText( "MAIN MENU" )
  34.     subtitle:SetPos( 50, 50 + title:GetTall() )
  35.     subtitle:SizeToContents()
  36.  
  37.     mainMenu()
  38.  
  39. end )
  40.  
  41. function mainMenu()
  42.  
  43.     local menuLinksPanel = vgui.Create( "DPanel", mainPanel )
  44.     menuLinksPanel:SetSize( 400, 600 )
  45.     menuLinksPanel:SetPos( 50, 150 )
  46.     menuLinksPanel.Paint = function()
  47.         draw.RoundedBox( 0, 0, 0, mainPanel:GetWide(), mainPanel:GetTall(), Color( 0, 0, 0, 0 ) )
  48.     end
  49.  
  50.     local i = 0
  51.  
  52.     for k, v in pairs( mainMenuLinks ) do
  53.         local menuLinks = vgui.Create( "DButton", menuLinksPanel )
  54.         menuLinks:SetPos( 0, i )
  55.         menuLinks:SetFont( "subtitle" )
  56.         menuLinks:SetText( k )
  57.         menuLinks.DoClick = v.funcclick
  58.         menuLinks:SizeToContents()
  59.         i = i + 25
  60.     end
  61.  
  62. end
  63.  
  64.  
  65. function chracterCreation()
  66.  
  67. end
  68.  
  69.  
  70. function characterSelection()
  71.  
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement