#include "Data/Levels/Common/Tutorial/Scripts/Utilities.bhass"

CTutorial@ pTutorial;
CLocalizer@ pLocalizer;
CGameText@ pText;
CMarvin@ pMarvin;
CGameObject@ pArrow;

//------------------------------------------------ Init/Release ---------------------------------------------------
void InitTutorial()
{
    @pTutorial = GetGame().GetCurrentLevel().GetTutorial();
    @pLocalizer = GetGame().GetLocalizer();
    @pText = pTutorial.GetGameText("Text");
    @pMarvin = GetGame().GetCurrentLevel().GetMarvin();
    @pArrow = pTutorial.GetGameObject("Arrow");
    pMarvin.Deactivate();
}

void ReleaseTutorial()
{
    pMarvin.Activate();
}


//------------------------------------------------ Script Functions ---------------------------------------------------
void EnterMeadows_2_1800()
{
    pTutorial.GetGameObject("Dialog").SetVisible(true);
    pText.SetVisible(true);
    pArrow.SetVisible(true);
    ChangeSkinAnimation("Arrow", "Data/GUI/AnimEntities/Anim/A_TutoArrowDown.ahsanimation");
	CFloat2 pos;
	pos = pTutorial.GetGameObject("Haystack").GetWorldPosition();
	pos.x += 60;
	pos.y -= 20;
    pArrow.SetPosition(pos);
    pText.SetText(pLocalizer.LocalizeText("MEADOWS_2_1800"));
}

void EnterMeadows_2_1900()
{
	CFloat2 pos;
	pos = pTutorial.GetGameObject("Haystack").GetWorldPosition();
	pos.x -= 20;
	pos.y -= 60;
    pText.SetText(pLocalizer.LocalizeText("MEADOWS_2_1900"));
    ChangeSkinAnimation("Arrow", "Data/GUI/AnimEntities/Anim/A_TutoArrowRightDown.ahsanimation");
    pArrow.SetPosition(pos);
}

void EnterMeadows_2_2000()
{
	CFloat2 pos;
	pos = pTutorial.GetGameObject("ToolBox").GetWorldPosition();
	pos.x += 32;
	pos.y += 32;
    pText.SetText(pLocalizer.LocalizeText("MEADOWS_2_2000"));
    ChangeSkinAnimation("Arrow", "Data/GUI/AnimEntities/Anim/A_TutoArrowDown.ahsanimation");
    pArrow.SetPosition(pos);
}

void EnterMeadows_2_2100()
{
    pText.SetText(pLocalizer.LocalizeText("MEADOWS_2_2100"));
	CFloat2 pos;
	pos = pTutorial.GetGameObject("Wheat").GetWorldPosition();
	pos.x += 32;
	pos.y += 32;
    pArrow.SetPosition(pos);
}

void EnterMeadows_2_2200()
{
    pText.SetText(pLocalizer.LocalizeText("MEADOWS_2_2200"));
	CFloat2 pos;
    pos = pTutorial.GetGameObject("Shovel").GetWorldPosition();
	pos.x += 32;
	pos.y += 32;
    pArrow.SetPosition(pos);
}

void EnterMeadows_2_2300()
{
    pText.SetText(pLocalizer.LocalizeText("MEADOWS_2_2300"));
    pArrow.SetVisible(false);
}

void EnterMeadows_2_2400()
{
    pText.SetText(pLocalizer.LocalizeText("MEADOWS_2_2400"));
}

void EnterMeadows_2_2500()
{
    pText.SetText(pLocalizer.LocalizeText("MEADOWS_2_2500"));
}

void ExitMeadows_2_2500()
{
    pTutorial.GetGameObject("Dialog").SetVisible(false);
    pText.SetVisible(false);
}

