require( "scripts/style.lua" );

function AddCinematicButton()
	if ( IsGameFinished() ) then
		
		t = {};
		table.insert( t, SetStyle( OptionsValidationButtonStyle ) );
		table.insert( t,
			Button
			{
				name = "end_cinematic",
				label = "end_cinematic",
				x = kMax - 150,
				y = kMax- 130,
				command =
					function()
						MuteSoundType( FXSound, true )
						MuteSoundType( MusicSound, true )
						SetCursorAnimation( "default" )
						gTempFunction = 
						function() 
							DoModal("scripts/cinematic_end_1.lua")
						end;
						table.insert( gCommandQueue,gTempFunction );
					end
			}
		);
		table.insert( t,
			Button
			{
				name = "begin_cinematic",
				label = "begin_cinematic",
				x = kMax - 150,
				y = kMax- 170,
				command =
					function()
						MuteSoundType( FXSound, true )
						MuteSoundType( MusicSound, true )
						SetCursorAnimation( "default" )
						gTempFunction = 
						function() 
							DoModal("scripts/cinematic_1.lua")
						end;
						table.insert( gCommandQueue,gTempFunction );
					end
			}
		);
	return Group(t);
		
	end
end

MakeDialog
{
	-- Name the modal dialog
  ShopWindow
	{
		name = "shopwindow",
		x = kCenter,
		y = kCenter,
		w = kMax,
		h = kMax,
		  
		SetStyle( OptionsCancelButtonStyle ); 
		Button
		{
		  name = "quitshop",
		  label = "back",
		  x = kMax - 150,
		  y = kMax-90,
		  close = true,
		  command =
				function()
                    if IsGameInLinearTuto() then
                        DisplayTutorialCallback("TUTO_dog_intro");
                    end
				end
		},
		
		AddCinematicButton();
	},
}