require( "scripts/style.lua" );


local levelname;


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


		Text
		{
			name = "entername",
			font = {  "fonts/lithos.mvec",  34,  Color(88,76,46,255)},
			x=3,y=25,w=500,h=40,
			flags = kHAlignCenter + kVAlignTop,
			label = "enterlevel"
		},

		TextEdit
		{
			font = { "fonts/lithos.mvec",  30,  Color(88,76,46,255)},
			flags = kHAlignCenter,
			name = "nameedit",
			label = levelname,
			x=96,y=175,w=365,h=kMax,
			length=28,
			--ignore = kIllegalNameChars

		},

		Button
		{
			x=49, 	y=282,
			name="enterok",
			type = kPush,
			graphics = {"backgrounds/profiles/new/b_ok",	"backgrounds/profiles/new/b_ok_pressed",	"backgrounds/profiles/new/b_ok_mouseover"},
			command =
				function()
						nnnn = GetLabel("nameedit");
						script = StartPlay(nnnn);
						if(string.len(script) > 0) then
							--CSWithSh("mainmenu", script);
							DoModal("scripts/shadow.lua");
						end;	
						CloseWindow(GetLabel("nameedit"));

				end
		},

		Button
		{
			x=371, y=285,
			name="entercancel",
			graphics = {"backgrounds/profiles/new/b_cancel",	"backgrounds/profiles/new/b_cancel_pressed",	"backgrounds/profiles/new/b_cancel_mouseover"},
			type = kPush,
			command =
				function()
					CloseWindow(nil);
				end
		},
	},

}

SetFocus( "nameedit" );


