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

public class BioBubble : MonoBehaviour {

	private GameObject bioBubble;

	// Use this for initialization
	void Start () {
		bioBubble = GameObject.Find("BioBubble");
		SetActive(false);		
	}
	
	// Update is called once per frame
	void Update () {
		
	}

	public void ShowBio(Npc npc)
	{
		SetActive(true);

		var bioText = GameObject.Find("BioText").GetComponent<Text>();
		bioText.text = npc.Bio;

		var sickOverlayImage = GameObject.Find("SickOverlayImage").GetComponent<Image>();
		sickOverlayImage.color = new Color(sickOverlayImage.color.r, sickOverlayImage.color.g, sickOverlayImage.color.b, 
			npc.CurrentlyInfected ? .5f : 0f);

		var nameText = GameObject.Find("NameText").GetComponent<Text>();
		nameText.text = npc.Name;

		var image = GameObject.Find("ProfileImage").GetComponent<Image>();
		image.sprite = npc.Image;
	}

	public void SetActive(bool active)
	{
		bioBubble.SetActive(active);
	}

	public void HideBio()
	{
		SetActive(false);
	}
}
