using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class Introduction : MonoBehaviour
{
    private IEnumerator C_WaitForInternet()
    {
        Debug.Log("Wait for internet coroutine");
        bool next = false;
        // TODO : Show initial dialog

        // TODO : Wait for the player selecting pop-up OK button
        while(!next)
        {
            if(Input.GetKeyDown(KeyCode.Return))
            {
                next = true;
                Debug.Log("OK button selected");
            }
            yield return 0;
        }

        // TODO : Show desktop and IE shortcut

        next = false;
        bool showPopup = false;
        // TODO : Wait for player selecting the IE shortcut
        while(!next)
        {
            // The pop-up is displayed
            if(showPopup)
            {
                // TODO : Wait for player selecting popup OK button
                if (Input.GetKeyDown(KeyCode.Return))
                {
                    showPopup = false;
                    // TODO : Hide popup
                }
            }
            // TODO : If the player select an other icon, show a popup
            else if (!showPopup && Input.GetKeyDown(KeyCode.A))
            {
                // TODO : Show popup
                showPopup = true;
            }
            else
            {
                // TODO : Player selected IE shortcut
                if (Input.GetKeyDown(KeyCode.I))
                {
                    Debug.Log("IE shortcut selected");
                    next = true;
                }
            }
            yield return 0;
        }
    }

    private IEnumerator C_InIE()
    {
        Debug.Log("Internet Explorer coroutine");

        // TODO : IE loading
        Debug.Log("IE loading");
        yield return new WaitForSeconds(5f);
        Debug.Log("IE loaded");
        
        yield return 0;
    }
}