|
|
@ -19,12 +19,16 @@ function menu.open( dt ) |
|
|
|
|
|
|
|
|
|
|
|
local txt = vgui.Create( "DTextEntry", f ) |
|
|
|
local txt = vgui.Create( "DTextEntry", f ) |
|
|
|
txt:SetText( "Enter name here" ) |
|
|
|
txt:SetText( "Enter name here" ) |
|
|
|
txt:SizeToContents() |
|
|
|
txt:SetSize( 250, 25 ) |
|
|
|
txt:SetPos( 100, 100 ) |
|
|
|
local txtW, txtH = txt:GetSize() |
|
|
|
|
|
|
|
txt:SetPos( sw/2 - txtW/2, sh/2 - txtH/2 ) |
|
|
|
|
|
|
|
local txtX, txtY = txt:GetPos() |
|
|
|
|
|
|
|
|
|
|
|
local b = vgui.Create( "DButton", f ) |
|
|
|
local b = vgui.Create( "DButton", f ) |
|
|
|
b:SetText( "Create Char" ) |
|
|
|
b:SetText( "Create Char" ) |
|
|
|
b:SizeToContents() |
|
|
|
b:SizeToContents() |
|
|
|
|
|
|
|
local bW, bH = b:GetSize() |
|
|
|
|
|
|
|
b:SetPos( sw/2 - bW/2, txtY - bH ) |
|
|
|
b.DoClick = function() |
|
|
|
b.DoClick = function() |
|
|
|
net.RunNetworkedFunc( "createChar", { name = txt:GetValue() } ) |
|
|
|
net.RunNetworkedFunc( "createChar", { name = txt:GetValue() } ) |
|
|
|
end |
|
|
|
end |
|
|
|