require( "scripts/style.lua" );


local playername = gEnterNameValue;

local deleteselected = false;


MakeDialog
{
	Bitmap
	{
		image="backgrounds/entername",
		x=kCenter,
		y=kCenter,


		Bitmap
		{
			image="backgrounds/entername",
			x=kCenter,
			y=kCenter,

--			Text
--			{
--				name = "entername",
--				font = {  standardFont, 34,  BlackColor},
--				x=3,y=25,w=500,h=40,
--				flags = kHAlignCenter + kVAlignTop,
--				label = "enternameprompt"
--			},

			TextEdit
			{
				font = { standardFont,  30,  WhiteColor},
				flags = kHAlignCenter,
				name = "nameedit",
				label = playername,
				clearinitial = deleteselected,
				x=kCenter,y= kCenter + 84, w=290,h=kMax,
				--x=113,y=110,w=290,h=kMax,
				length=18,
				ignore = kIllegalNameChars

			};
		},

		Button
		{
			x=90, 	y=327,
			name="enterok",
			type = kPush,
			graphics = {"buttons/b_ok",	"buttons/b_ok_pressed",	"buttons/b_ok_mouseover"},
			command =
				function()
					CloseWindow(GetLabel("nameedit"));
				end
		},

		Button
		{
			x=240, y=327,
			name="entercancel",
			graphics = {"buttons/b_cancel",	"buttons/b_cancel_pressed",	"buttons/b_cancel_mouseover"},
			type = kPush,
			command =
				function()
					CloseWindow(nil);
				end
		};
	},

}

SetFocus( "nameedit" );


