require( "scripts/style.lua" );


LeftArrow2Graphics_Highlight = {
	"buttons/arrow2e.png",
	"buttons/arrow2b.png",
	"buttons/arrow2c.png"
};

RightArrow2Graphics_Highlight = {
	"buttons/arrow1e.png",
	"buttons/arrow1b.png",
	"buttons/arrow1c.png"
};

TitleFont = {
  standardFont,
  52,
  RedColor
};

ItemFont = {
  standardFont,
  32,
  RedColor
};

function FadeFromGame()
	local id = PushModal( 'flosclosetfade' );
	MakeDialog
	{
		TimedFade
		{
			x=0,
			y=0,
			w=800,
			h=600,
			length = 1,
			
		},
	};
	

	WaitForCloseMessage(id);
	
	if (EnterFlosCloset()==true) then
		DisplayDialog { 
			"scripts/bigok.lua", 
			body ="flosclosettip",
			title = ""
		};
	end
	DoModal('scripts/clothingunlock.lua');
	SetupGlows();
	
end

function MakeChoice(group, xVal, yVal, label)
	return Group(
		{
			Button
			{
				x = xVal - 23,
				y = yVal,
				name = label.."left",
				graphics = LeftArrow2Graphics,
				type = kPush,
				command = 
					function() 
						StopButtonFlash();
						ChangeClothing(group,-1);
					end	
			},
			
			Button
			{
				x = xVal - 23,
				y = yVal,
				name = label.."left_highlight",
				graphics = LeftArrow2Graphics_Highlight,
				type = kPush,
				command = 
					function() 
						StopButtonFlash();
						ChangeClothing(group,-1);
					end	
			},
			
			Button
			{
				x = xVal + 132,
				y = yVal,
				name = label.."right",
				graphics = RightArrow2Graphics,
				type = kPush,
				command = 
					function() 
						StopButtonFlash();
						ChangeClothing(group,1);
					end	
			},
			
			Button
			{
				x = xVal + 132,
				y = yVal,
				name = label.."right_highlight",
				graphics = RightArrow2Graphics_Highlight,
				type = kPush,
				command = 
					function() 
						StopButtonFlash();
						ChangeClothing(group,1);
					end	
			},
		}
	)
end

MakeDialog
{
	Bitmap
	{
		name="backgroundimage",
		image="floscloset/closet_bg",
		x=0,y=0,w=kMax,h=kMax,
		
		FlosCloset
		{
			x=0,y=0,w=kMax,h=kMax,
			
			
			MakeChoice(4, 123, 90, "accessory");
			MakeChoice(3, 123, 280, "apron");
			MakeChoice(0, 123, 460, "shoes");
			MakeChoice(2, 532, 130, "top");
			MakeChoice(1, 532, 350, "bottom");
			
			SetStyle(SmallButtonStyle);
			Button
  			{
  				x=150,
  				y=560,
  				name="back",
  				label="back",
  				type = kPush,
 				command=
  					function()
  						HideMainMenu(true);
  						ClearNewClothing();
  						PopModal();
  					end
  			},
  			
  			
			Button
  			{
  				x=kCenter,
  				y=560,
  				name="shuffle",
  				label="shuffle",
  				type = kPush,
 				command=
  					function()
						Shuffle();
  					end
  			},
  			
  			Button
  			{
  				x=500,
  				y=560,
  				name="done",
  				label="done",
  				type = kPush,
 				command=
  					function()
  						HideMainMenu(true);
  						ClearNewClothing();
  						SaveOutfit();
  						PopModal();
  					end
  			},
  			SetStyle(DefaultButtonStyle);
			
			
			
		};
		
		Bitmap
		{
			name="reflectionimage",
			image="floscloset/reflection",
			x=0,y=0,w=kMax,h=kMax,
		}
		
			
	},
	
};

HideMainMenu(false);
ActivateHelpClock(true);