Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function ButtonPaint( panel, str )
- panel:SetText( "" ) -- Can't find the varible that holds the text, so I'm just going to go this different way.
- panel.Paint = function()
- draw.RoundedBox( 4, 0, 0, panel:GetWide(), panel:GetTall(), Color( 40, 40, 40, 255 ) )
- draw.RoundedBox( 4, 6, 1, panel:GetWide() - 12, panel:GetTall() - 2, panel.newcol or Color( 60, 60, 60, 255 ) )
- draw.SimpleText( str, "MenuLarge", panel:GetWide() / 2, panel:GetTall() / 2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
- end
- panel.OnCursorEntered = function()
- panel.newcol = Color( 100, 100, 100, 255 )
- surface.PlaySound( "Friends/friend_join.wav" )
- end
- panel.OnCursorExited = function() panel.newcol = false end
- end
- local function Menu()
- local Frame = vgui.Create( "DFrame" )
- Frame:SetSize( 150, 97 )
- // Frame:SetPos( ScrW() / 2 - Frame:GetWide() / 2, ScrH() / 2 - Frame:GetTall() / 2 )
- Frame:Center() -- Thank you C-Unit, I did not know that this existed.
- Frame:SetTitle( "Some title" )
- Frame:ShowCloseButton( false )
- Frame:MakePopup( true )
- Frame:ParentToHUD()
- Frame.Paint = function()
- draw.RoundedBox( 4, 0, 0, Frame:GetWide(), Frame:GetTall(), Color( 40, 40, 40, 255 ) )
- draw.RoundedBox( 4, 1, 22, Frame:GetWide() - 2, Frame:GetTall() - 23, Color( 90, 90, 90, 255 ) )
- for i = 1, 20 do
- local val = 50 + ( i * 2 )
- surface.SetDrawColor( val, val, val, 255 )
- surface.DrawRect( 1, Frame:GetTall() - ( ( i * 2 ) + 1 ), Frame:GetWide() - 2, 2 )
- end
- end
- local Login = vgui.Create( "DButton", Frame )
- Login:SetPos( 5, 27 )
- Login:SetSize( Frame:GetWide() - 10, 30 )
- Login.DoClick = function() end -- Some login function here.
- ButtonPaint( Login, "Login" )
- local Register = vgui.Create( "DButton", Frame )
- Register:SetPos( 5, 62 )
- Register:SetSize( Frame:GetWide() - 10, 30 )
- Register.DoClick = function() RunConsoleCommand( "vb4_registrer" ) end
- ButtonPaint( Register, "Register" )
- end
- concommand.Add( "Test_Menu", Menu ) -- Just a simple command to test the menu, do the way C-Unit did by hooking it on Initialize when done testing.
- AND
- print("Lodaed vb client")
- concommand.Add("vb4_register", function( p, c, a )
- local DFrame1 = vgui.Create('DFrame')
- DFrame1:SetSize(300, 300)
- DFrame1:SetPos(0, 0)
- DFrame1:SetTitle('Forum Registeration')
- DFrame1:SetSizable(true)
- DFrame1:SetDeleteOnClose(false)
- DFrame1:MakePopup()
- local DTextEntry1 = vgui.Create('DTextEntry', DFrame1)
- DTextEntry1:SetSize(100, 20)
- DTextEntry1:SetPos(5, 50)
- DTextEntry1:SetText('')
- local DLabel1 = vgui.Create('DLabel', DFrame1)
- DLabel1:SetPos(8, 30)
- DLabel1:SetText('Username:')
- DLabel1:SizeToContents()
- local DTextEntry2 = vgui.Create('DTextEntry', DFrame1)
- DTextEntry2:SetSize(100, 20)
- DTextEntry2:SetPos(5, 100)
- DTextEntry2:SetText('')
- local DLabel2 = vgui.Create('DLabel', DFrame1)
- DLabel2:SetPos(8, 80)
- DLabel2:SetText('Password:')
- DLabel2:SizeToContents()
- local DLabel3 = vgui.Create('DLabel', DFrame1)
- DLabel3:SetPos(8, 130)
- DLabel3:SetText('Email:')
- DLabel3:SizeToContents()
- local DTextEntry3 = vgui.Create('DTextEntry', DFrame1)
- DTextEntry3:SetSize(100, 20)
- DTextEntry3:SetPos(5, 150)
- DTextEntry3:SetText('')
- // This is if you want a logo right of your username, password, and email.
- /*
- local DPanel1 = vgui.Create('DImage', DFrame1)
- DPanel1:SetSize(296, 272)
- DPanel1:SetPos(1, 25)
- Dpanel1:SetMaterial( ) // Place some image here
- */
- local DButton1 = vgui.Create('DButton', DFrame1)
- DButton1:SetSize(70, 25)
- DButton1:SetPos(115, 271)
- DButton1:SetText('Submit')
- DButton1.DoClick = function()
- p:Register( DTextEntry1:GetValue(), DTextEntry2:GetValue(), DTextEntry3:GetValue() )
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement