using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class InstructionDisplay : MonoBehaviour
{

	//Text textField;
	public NewInstructionAlert newInstructionAlert;
	TextMesh textField;
	public const string DEFAULT_INSTRUCTIONS = "Awaiting Instructions...";
	string last_text;

	void setText(string t)
		{
		last_text = t;
		textField.text = t;
		}

	string getText()
		{
		return last_text;
		}

	public void setInstructionText(string instructionText)
		{
		setText(instructionText);
		newInstructionAlert.blink(1);
		}

    public void clearTextIfMatching(string instructionText)
    	{
		if (getText() == instructionText)
			setText("");
    	}

	public void resetInstructions()
	{
		setText(DEFAULT_INSTRUCTIONS);
	}

	// Use this for initialization
	void Start () 
	{
		textField = GetComponent<TextMesh>();
		resetInstructions();
	}

	// Update is called once per frame
	void Update () 
	{
		
	}
}
