using Cute;
using UnityEngine;

public class NtDataTranslate : MonoBehaviour
{
	[SerializeField]
	private TitleUI _titleUI;

	public GameObject BtnTranslate;

	public NtDataTranslateInput InputObj;

	public UILabel TxtTranslate;

	public static NtDataTranslate Instance;

	private void Start()
	{
		initUI();
		requestData();
	}

	private void initUI()
	{
		Instance = this;
		initEventListener();
	}

	private void initEventListener()
	{
		UIEventListener.Get(BtnTranslate).onClick = onClickTranslate;
	}

	private void requestData()
	{
		NtDataTranslateManager.GetInstance().GetTranslateInfo();
	}

	private void onClickTranslate(GameObject btn)
	{
		if (!_titleUI.IsEnableClickButton())
		{
			return;
		}
		GetDataTranslateTask task = new GetDataTranslateTask();
		StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
		{
			NtDataTranslateManager instance = NtDataTranslateManager.GetInstance();
			if (instance.isTranslate)
			{
				instance.ShowRebind();
			}
			else
			{
				instance.ShowMainNotice(instance.HongKongMacaoUserConfirm);
			}
		}));
	}
}
