Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CreateCharacterFirstMenu(characterID)
- gui.EnableScreenClicker( true ) -- enable mouse
- local mainPanel = vgui.Create( "DFrame" )
- mainPanel:SetSize( ScrW(), ScrH() )
- mainPanel:Center()
- mainPanel:SetTitle( "" )
- local background = vgui.Create( "DImage", mainPanel )
- background:SetPos( 0, 0 )
- background:SetSize( ScrW(), ScrH() )
- background:SetImage( "deadman/metro/characterBackground.png" ) -- Set material relative to "garrysmod/materials/"
- local goBack = vgui.Create( "DButton", mainPanel )
- goBack:SetText( "Go back" )
- goBack:SetPos( ScrW()/32, ScrH()/21.6 )
- goBack:SetSize( ScrW()/7.68, ScrH()/21.6 )
- goBack:SetTextColor( Color(255,255,255,255) )
- goBack.DoClick = function()
- mainPanel:Remove()
- net.Start("Metro::PlyRequest")
- net.WriteString("getAllChars")
- net.SendToServer()
- end
- goBack.Paint = function(w, h)
- surface.SetDrawColor( 255, 255, 255, 255 )
- surface.SetMaterial( backgroundButton )
- surface.DrawTexturedRect( 0, 0, 512, 512 ) -- The size don't matter since it will not be bigger than the button
- end
- local TextEntry = vgui.Create( "DTextEntry", mainPanel ) -- create the form as a child of frame
- TextEntry:SetPos( ScrW()/2, ScrH()/2 )
- TextEntry:SetSize( 300, 50)
- TextEntry:SetText( "Placeholder Text" )
- local femaleButton = vgui.Create( "DButton", mainPanel )
- femaleButton:SetText( "Female Character" )
- femaleButton:SetPos( ScrW()/1.4, ScrH()/1.5 )
- femaleButton:SetSize( ScrW()/7.68, ScrH()/21.6 )
- femaleButton:SetTextColor( Color(255,255,255,255) )
- femaleButton.DoClick = function()
- characterSex = "female"
- if nameTextEntry:GetValue() ~= "" and #nameTextEntry:GetValue() > MConf.CharacterMinLength then
- characterName = nameTextEntry:GetValue()
- CreateCharacterSecondMenu(characterID)
- else
- notification.AddLegacy( "Your name is not long enough !", NOTIFY_ERROR , 4 )
- surface.PlaySound( "buttons/button15.wav" )
- end
- end
- femaleButton.Paint = function(w, h)
- surface.SetDrawColor( 255, 255, 255, 255 )
- surface.SetMaterial( backgroundButton )
- surface.DrawTexturedRect( 0, 0, 512, 512 ) -- The size don't matter since it will not be bigger than the button
- end
- local maleButton = vgui.Create( "DButton", mainPanel )
- maleButton:SetText( "Male Character" )
- maleButton:SetPos( ScrW()/2.3, ScrH()/1.5 )
- maleButton:SetSize( ScrW()/7.68, ScrH()/21.6 )
- maleButton:SetTextColor( Color(255,255,255,255) )
- maleButton.DoClick = function()
- characterSex = "male"
- if nameTextEntry:GetValue() ~= "" and #nameTextEntry:GetValue() > MConf.CharacterMinLength then
- characterName = nameTextEntry:GetValue()
- CreateCharacterSecondMenu(characterID)
- else
- notification.AddLegacy( "Your name is not long enough !", NOTIFY_ERROR , 4 )
- surface.PlaySound( "buttons/button15.wav" )
- end
- end
- maleButton.Paint = function(w, h)
- surface.SetDrawColor( 255, 255, 255, 255 )
- surface.SetMaterial( backgroundButton )
- surface.DrawTexturedRect( 0, 0, 512, 512 ) -- The size don't matter since it will not be bigger than the button
- end
- local actualSkin = vgui.Create( "DModelPanel", mainPanel )
- actualSkin:SetSize( ScrW()/2.5, ScrH()/1.5 )
- actualSkin:SetModel( "models/half-dead/metroll/m1b1.mdl" )
- actualSkin:CenterHorizontal(0.2)
- actualSkin:CenterVertical(0.5)
- actualSkin:SetCamPos( Vector(75,0,50) ) -- recul, rotation, hauteur
- function actualSkin:LayoutEntity( Entity ) return end -- disables default rotation
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement