require( "scripts/style.lua" );


MyFont = {
  standardFont,
  30,
  BorderColor
};

NameFont = {
  standardFont,
  18,
  MenuRedColor
};





MakeDialog
{
	Bitmap
	{ 
		image="backgrounds/popup",
		x=kCenter,
		y=kCenter,
		
		EnterNameWindow
		{
			x=0,y=0,w=kMax,h=kMax,
			Text
			{
				font = MyFont,
				name = "entername",
				x=0,y=120,w=kMax,h=30,
				flags = kHAlignCenter + kVAlignTop,
				label = "ce_entername"
			};
			
			Bitmap
			{
				image="backgrounds/textfield.png",
				x=kCenter,
				y=180,
				
				TextEdit
				{
					font = NameFont,
					name = "nameedit",
					label = playername,
					x=5,y=6,w=kMax-5,h=kMax,
					length=12,
					ignore = kIllegalNameChars
					
				};
			};
				
			SetStyle(StandardButtonStyle);
			Button
			{
				x=50,
				y=250,
				name="enterok",
				label="ok",
				default = true,
				command = 
					function()
						CloseWindow(GetLabel("nameedit"));
					end
			},
			
			Button
			{
				x=250,
				y=250,
				name="entercancel",
				label="cancel",
				command = 
					function()
						CloseWindow(nil);
					end
			};
			SetStyle(DefaultStyle);
		}
		
	},
	
	SetFocus( "nameedit" )
}



