require( "scripts/style.lua" );

function UpdateMode(curMode)
	for i=0,1 do
		SetButtonToggleState("mode"..i,false)
	end
	SetButtonToggleState("mode"..curMode,true)
	
	if(curMode == 0) then

	else

	end		
end

ModeButtonGraphics = {
	"buttons/choosenameover.png",
	"buttons/choosenamedown.png",
	"buttons/choosenameover.png",
	"buttons/choosenamedown.png"
};

ModeStyle= {
	type = kRadio,
	flags = kHAlignCenter + kVAlignCenter,
	font = NameButtonFont,
	graphics = ModeButtonGraphics,
	sound = kDefaultButtonSound
};

TextBodyFont = {
  standardFont,
  18,
  BlackColor
};

TextStyle=
{
	parent=DefaultStyle,
	font = TextBodyFont,
	flags = kVAlignCenter + kHAlignCenter,
	x=0,y=44,w=kMax,h=kMax-170
};

HeaderFont = {
  standardFont,
  34,
  BlackColor
};

DialogHeaderFont = {
  standardFont,
  20,
  WhiteColor
};

MakeDialog
{
	-- Name the modal dialog
	name="controlschememenu",
	Bitmap
	{
		image="backgrounds/win_small",
		x=kCenter,
		y=kCenter,
		
	ControlSchemeWindow
	{
		w=kMax,h=kMax,

		SetStyle(CloseButtonStyle);
		Button
		{
			x=kCenter+153,y=13,
			name="closebutton",
			--command = function() CloseWindow(); end;
			command=function() 
				SetGameMode(GetSelectedMode());
				CloseWindow(nil); 
			end;
		};

		Text
		{
			name = "controlschemeheader",
			label = "controlschemeheader",
			x=0,y=11,w=kMax,h=kMax,
			flags = kHAlignCenter + kVAlignTop,
			font = DialogHeaderFont,
		},

		SetStyle(TextStyle),
		Text
		{
			name = "controlschemetext",
			label = "controlschemetext",
		},

		SetStyle(ModeStyle),
		Button
		{
			name="mode0",
			label="novicemode",
			align=kHAlignCenter+kVAlignBottom,
			x=kCenter,	
			y=kMax-165,
			command=function() UpdateMode(0); end;
		},
		Button
		{
			name="mode1",
			label="expertmode",
			align=kHAlignCenter+kVAlignBottom,
			x=kCenter,	
			y=kMax-125,
			command=function() UpdateMode(1); end;
		},

		SetStyle(CheckboxButtonStyle),
		Button{
			name="enabletutorial",
			label="enabletutorial",
			x=170,
			y=265,
			w=150,
			command=
			function()
				GetTutorialMode();
			end
		};

		SetStyle(ScaledButtonStyle),
		Button
		{
			label="ok",
			name="ok",
			cancel=true,
			align=kHAlignCenter+kVAlignBottom,
			x=kCenter,	
			y=kMax-50,
			default=true,
			command=function() 
				SetGameMode(GetSelectedMode());
				CloseWindow("ok"); 
				end;
		},
--		Button
--		{
--			label="cancel",
--			name="cancel",
--			align=kHAlignCenter+kVAlignBottom,
--			x=kCenter+80,
--			y=kMax-40,
--			command=function() CloseWindow(); end;
--		},


	}

	}
}


