require( "scripts/style.lua" );

DialogHeaderFont = {
  standardFont,
  24,
  WhiteColor
};

MakeDialog
{
	name="noname",
    Bitmap
    {
        image="backgrounds/win_small",
		x=kCenter,
		y=kCenter,
		
		NoNameWindow
		{
			x = 0, y = 0, w=kMax, h=kMax,
			Button
			{
			font = StandardButtonFont,
			graphics = StandardButtonGraphics,
			cancel = true,
				flags = 5,
			label = "ok",
			name = "ok",
			x = kCenter,y = 250,
			default=true,
			command = function()
					if (GetNumUsers() == 0) then
						gEnterNameValue = "";
						name = DoModal("scripts/entername.lua");
						if (not(name == nil)) then
							CreateNewUser(name);
							mode = DoModal("scripts/controlscheme.lua");
							if(mode == "ok") then
								Play();
							else
								CancelPlay();
							end
							--CloseWindow();
							--return true ;
						end
						CloseWindow();
						--return false ;
					else
						CancelPlay();
						CloseWindow();
						--return true;
					end
			end;
			},

			Text
			{
				font = DialogHeaderFont,
				name = "nonametitle",
				x=0,y=9,w=kMax,h=30,
				flags = kHAlignCenter + kVAlignTop,
				label= "nonametitle",
			};

			Text
			{
				font = DialogBodyFont,
				name = "nonamebody",
				x=12,y=46,
				w=kMax-12,h=kMax-70,
				flags = kVAlignCenter + kHAlignCenter,
				label= "nonamebody",
			};
			
			SetStyle(CloseButtonStyle);
			Button
			{
				x=kCenter+154,y=14,
				name="closebutton",
				command = function() CloseWindow(); end;
			};
		},
    },

} -- MakeDialog
