require( "scripts/style.lua" );

MakeDialog
{
	Bitmap
	{
		image="backgrounds/profiles/new/back",
		x=kCenter,
		y=kCenter-50,

		Text
		{
			name = "entername",
			font = {  standardFont,  34,  Color(88,76,46,255)},
			x=3,y=75,w=500,h=40,
			flags = kHAlignCenter + kVAlignCenter,
			label = "enternameprompt"
		},

		TextEdit
		{
			font = { "fonts/lithos.mvec",  30,  Color(88,76,46,255)},
			flags = kHAlignCenter,
			name = "nameedit",
			clearinitial = true,
			x=96,y=173,w=360,h=kMax,
			length=11,
			ignore = kIllegalNameChars
		};

		Button
		{
			x=229, 	y=325,
			name="enterok",
			type = kPush,
			graphics = {"backgrounds/profiles/new/b_ok",	"backgrounds/profiles/new/b_ok_pressed",	"backgrounds/profiles/new/b_ok_mouseover"},
			command =
				function()
					PlayGSound("butt");
					name = GetLabel("nameedit");
					if(IsNameValid(name)) then 
						CreateNewUser(name);
						SetWelcomeName();
						CloseWindow();
					end
					SetFocus( "nameedit" );
				end
		},

	},
}

SetFocus( "nameedit" );


