<commit_before>﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class DayCounterScript : MonoBehaviour {

    private ScreenFader screenFader;
    private Text daysText;
    private Image fadeImage;
    private ClockManager clock;

	// Use this for initialization
	void Awake () {
        fadeImage = GameObject.Find("FadeImage").GetComponent<Image>();
        daysText = GetComponent<Text>();
        screenFader = GameObject.Find(Constants.Game.FADER_OBJECT).GetComponent<ScreenFader>();
        clock = GameObject.Find("Clock").GetComponent<ClockManager>();
	}
	
    public void ShowRemainingDays()
    {
        int remainingDays = clock.GetRemainingDays();

        if(remainingDays > 0)
        {
            daysText.text = "Only " + remainingDays + " day";
            if(remainingDays != 1)
            {
                daysText.text += "s";
            }
            daysText.text += " remaining. ";
            daysText.text += "I can do this!";
        }
        else
        {
            daysText.text += "Last day! I can't forget to submit it by midnight.";
        }

        fadeImage.enabled = true;
        StopAllCoroutines();
        StartCoroutine(FadeAndShowDays());
    }

    IEnumerator FadeAndShowDays()
    {
        clock.Pause();
        //Set black?
        fadeImage.enabled = true;
        fadeImage.color = Color.black;
        //animate days
        yield return StartCoroutine(FadeInDays(1));
        yield return new WaitForSeconds(1);
        StartCoroutine(FadeOutDays(0.5f));<commit_msg>Fixed last day dialog text<commit_after>﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class DayCounterScript : MonoBehaviour {

    private ScreenFader screenFader;
    private Text daysText;
    private Image fadeImage;
    private ClockManager clock;

	// Use this for initialization
	void Awake () {
        fadeImage = GameObject.Find("FadeImage").GetComponent<Image>();
        daysText = GetComponent<Text>();
        screenFader = GameObject.Find(Constants.Game.FADER_OBJECT).GetComponent<ScreenFader>();
        clock = GameObject.Find("Clock").GetComponent<ClockManager>();
	}
	
    public void ShowRemainingDays()
    {
        int remainingDays = clock.GetRemainingDays();

        if(remainingDays > 0)
        {
            daysText.text = "Only " + remainingDays + " day";
            if(remainingDays != 1)
            {
                daysText.text += "s";
            }
            daysText.text += " remaining. ";
            daysText.text += "I can do this!";
        }
        else
        {
            daysText.text = "Last day! I can't forget to submit it by midnight.";
        }

        fadeImage.enabled = true;
        StopAllCoroutines();
        StartCoroutine(FadeAndShowDays());
    }

    IEnumerator FadeAndShowDays()
    {
        clock.Pause();
        //Set black?
        fadeImage.enabled = true;
        fadeImage.color = Color.black;
        //animate days
        yield return StartCoroutine(FadeInDays(1));
        yield return new WaitForSeconds(1);
        StartCoroutine(FadeOutDays(0.5f));
{'fraction_non_alphanumeric': 0.10666239590006406, 'fraction_numerical': 0.003843689942344651, 'mean_word_length': 2.222910216718266, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '649592', 'n_tokens_mistral': 897, 'n_tokens_neox': 862, 'n_words': 191}