require( "scripts/style.lua" );


function QueueMakeDialog( t )
 f = function() MakeDialog(t) end; 
 QueueFunction(f);
end

function QueueDisplayDialog( t )
 f = function() DisplayDialog(t) end; 
 QueueFunction(f);
end 

function Tutorial()

	-- NEED - "SEED"
	CreateNeed("seed");
	Yield();
	-- NEED - "SEED" - END
	
	-- START POPUP
	QueueDisplayDialog({"scripts/tutorialmodalh.lua", body="tutorial_viniculture_start"});
	minigame_start1();
	Yield();
	-- START POPUP - END
	
	--INIT MOUSE
	--SetMouseVisible(false);
	InitSpriteCursor(512,384);
	Yield();
	--INIT MOUSE - END
	
	--POSITIONS
	-- WATER BUTTON  = 430, 100
	--SEED BUTTON = 560,100
	-- FERTILIZER = 690,100
	-- TRIM BUTTON = 840,100
	-- HOE BUTTON = 970,100
	-- SEEDBED = 330,400
	-- POSITIONS - END
	
	-- TEXT = So, let's start planting our grapes. We have the seedbeds all set-up. Each seedbed will be used to plant one grape kind.
	--CreateWindow("scripts/tutorial_minigames/viniculture/window_a.lua");
	QueueDisplayDialog({"scripts/tutorial_minigames/viniculture/window_a.lua"});
	Yield();
	-- TEXT - END
	
	--WAIT
	--Sleep(100);
	--Sleep(50);
	--Yield();
	--WAIT
	
	--WAIT
	--Sleep(20);
	--Yield();
	--WAIT
	
	-- TEXT = From time to time the grapevines will become afflicted by all sorts of needs. When a row has any affliction, you will see an icon under it telling you what  is missing.
	--DestroyWindow();
	--Yield();
	--Sleep(20);
	--Yield();
	CreateWindow("scripts/tutorial_minigames/viniculture/window_b.lua");
	Yield();
	-- TEXT - END
	
	MoveMouseTo(560,100);
	Yield();
	MouseClick("seed");
	Yield();
	MoveMouseTo(330,400);
	Yield();
	CheckTask("seed");
	Yield();
	DoTask("seed");
	Yield();
	
	Sleep(140);
	Yield();
	
	-- TEXT = With the seed planted, the grapes begin to appear. You should keep them healthy, supplying all the needs.
	DestroyWindow();
	Yield();
	Sleep(20);
	Yield();
	CreateWindow("scripts/tutorial_minigames/viniculture/window_c.lua");
	Yield();
	-- TEXT - END
	
	CreateNeed("fertilizer");
	Yield();
	MoveMouseTo(690,100);
	Yield();
	MouseClick("fertilizer");
	Yield();
	MoveMouseTo(330,400);
	Yield();
	CheckTask("fertilizer");
	Yield();
	DoTask("fertilizer");
	Yield();
	
	--Sleep(340);
	--Yield();
	
	--CreateGrapes();
	
	Sleep(150);
	Yield();
	
	CreateNeed("water");
	Yield();
	--MoveMouseTo(430,100);
	--Yield();
	--MouseClick("water");
	--Yield();
	--MoveMouseTo(330,400);
	--Yield();
	--CheckTask("water");
	--Yield();
	--DoTask("water");
	--Yield();
	
	--Sleep(190);
	--Yield();
	
	--CompleteSeedbed();
	
	--SET MOUSE
	EnableCursor(false);
	--SetMouseVisible(true);
	Yield();
	--SET MOUSE - END
	
	-- START POPUP
	DestroyWindow();
	QueueDisplayDialog({"scripts/tutorialmodalh.lua", body="tutorial_viniculture_finish"});
	Yield();
	-- START POPUP - END
	
	EnableTutorial(false);
end



return Tutorial;
