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

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

//------------------------------------------------ Init/Release ---------------------------------------------------
void InitTutorial()
{
    @pTutorial = GetGame().GetCurrentLevel().GetTutorial();
    @pLocalizer = GetGame().GetLocalizer();
    @pText = pTutorial.GetGameText("Text");
    @pMarvin = GetGame().GetCurrentLevel().GetMarvin();
	@pArrow = cast<CGameSkin>(pTutorial.GetGameObject("Arrow"));
    GetGame().GetCurrentLevel().Deactivate();
    pMarvin.Deactivate();
    @pDialog = pTutorial.GetGameObject("Dialog");
    pDialog.SetVisible(true);
}

void ReleaseTutorial()
{
    GetGame().GetCurrentLevel().Activate();
    pMarvin.Activate();
    pText.SetVisible(false);
    pDialog.SetVisible(false);
}

//------------------------------------------------ Script Functions ---------------------------------------------------
void EnterVolcano_T1_100()
{
	pText.SetVisible(true);
    pArrow.SetVisible(true);
	pText.SetText(pLocalizer.LocalizeText("VOLCANO_T1_100"));
    ChangeSkinAnimation(pArrow, "Data/GUI/AnimEntities/Anim/A_TutoArrowLeft.ahsanimation");
    CFloat2 pos;
    CGuiModule@ pModule = GetGuiManager().GetModule("InGame");
    CForm@ pForm = pModule.GetForm("EntropyGaugeForm");
    pos = GetGame().GetWorldPositionFromInterface(pForm.GetPosition(), pModule);
    pos.x += 60;
    pos.y += 350;
    pArrow.SetWorldPosition(pos);
}

void EnterVolcano_T1_200()
{
	pText.SetText(pLocalizer.LocalizeText("VOLCANO_T1_200"));
    PointArrowTo(pArrow, "Data/GUI/AnimEntities/Anim/A_TutoArrowDown.ahsanimation", "VolcanoEntropy3", 0, -60);
}

void EnterVolcano_T1_300()
{
	pText.SetText(pLocalizer.LocalizeText("VOLCANO_T1_300"));
    PointArrowTo(pArrow, "Data/GUI/AnimEntities/Anim/A_TutoArrowDown.ahsanimation", "Lava3", 0, -70);
}

void EnterVolcano_T1_400()
{
	pText.SetText(pLocalizer.LocalizeText("VOLCANO_T1_400"));
    PointArrowTo(pArrow, "Data/GUI/AnimEntities/Anim/A_TutoArrowDown.ahsanimation", "Ketchup3", 60, -60);
}

void ExitVolcano_T1_400()
{
	pArrow.SetVisible(false);
}

