using UnityEngine;
using UnityEngine.UI;

namespace Cryville.Crtr.Config {
	public class InputConfigEntry : MonoBehaviour {
		[SerializeField]
		Text m_key;

		[SerializeField]
		Text m_value;

		[SerializeField]
		Button m_button;

		public void SetKey(InputConfig master, string name) {
			m_key.text = name;
			m_value.text = "None";
			m_button.onClick.AddListener(() => {
				master.OpenDialog(name);
			});
		}

		public void SetValue(string name) {
			m_value.text = name;
		}

		public void SetEnabled(bool flag) {
			m_button.interactable = flag;
		}
	}
}
