using System;
using UnityEngine;

namespace Wizard;

public class GachaPointExchangeDialog : MonoBehaviour
{
	private const int EXCHANGE_DIALOG_DEPTH = 900;

	private const int EXCHANGE_DIALOG_SORTING_ORDER = 37;

	[SerializeField]
	private GachaPointExchange _gachaPointExchangeOriginal;

	private DialogBase _dialog;

	public void CreateGachaPointExchangeDialog(PackConfig packConfig, Action packInfoCallBack)
	{
		_dialog = UIManager.GetInstance().CreateDialogClose();
		_dialog.SetSize(DialogBase.Size.XL);
		_dialog.SetTitleLabel(Data.SystemText.Get("Shop_0160", Data.Master.CardSetNameMgr.Get(packConfig.GachaPointData.GachaPointPackId.ToString()).LongName));
		_dialog.SetLayer("MyPage");
		_dialog.SetPanelSortingOrder(37);
		_dialog.SetPanelDepth(900);
		GachaPointExchange gachaPointExchange = UnityEngine.Object.Instantiate(_gachaPointExchangeOriginal);
		_dialog.SetObj(gachaPointExchange.gameObject);
		gachaPointExchange.SetCallBack(CloseExchangeDialog, packInfoCallBack);
		gachaPointExchange.CreateCardList(packConfig);
	}

	public void CloseExchangeDialog()
	{
		_dialog.CloseWithoutSelect();
	}
}
