using System;

namespace Wizard;

public static class LootBoxDialogUtility
{
	private const int LOOT_BOX_DIALOG_DEPTH = 3000;

	public static void CreateLootBoxRegulationDialog(PlayerStaticData.LootBoxType type)
	{
		string key;
		string key2;
		switch (type)
		{
		default:
			return;
		case PlayerStaticData.LootBoxType.GACHA:
			key = "Dia_LootBox_002_Title";
			key2 = "Dia_LootBox_002_Body";
			break;
		case PlayerStaticData.LootBoxType.TWOPICK:
			key = "Dia_LootBox_003_Title";
			key2 = "Dia_LootBox_003_Body";
			break;
		case PlayerStaticData.LootBoxType.SEALED:
			key = "Dia_LootBox_Sealed_Title";
			key2 = "Dia_LootBox_Sealed_Body";
			break;
		case PlayerStaticData.LootBoxType.COLOSSEUM:
			key = "Dia_LootBox_004_Title";
			key2 = "Dia_LootBox_004_Body";
			break;
		case PlayerStaticData.LootBoxType.COMPETITION:
			key = "Dia_LootBox_Competition_Title";
			key2 = "Dia_LootBox_Competition_Body";
			break;
		case PlayerStaticData.LootBoxType.SPECIAL_CRYSTAL:
			key = "Dia_LootBox_005_Title";
			key2 = "Dia_LootBox_005_Body";
			break;
		}
		DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
		dialogBase.SetSize(DialogBase.Size.S);
		dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
		dialogBase.SetPanelDepth(3000);
		dialogBase.SetTitleLabel(Data.SystemText.Get(key));
		dialogBase.SetText(Data.SystemText.Get(key2));
	}

	public static void CreatePurchaseNotificationLootBoxDialog(string titleLabel, string itemText, Action onClickPayment, Action onClickCancel)
	{
		DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
		dialogBase.SetSize(DialogBase.Size.M);
		dialogBase.SetTitleLabel(titleLabel);
		dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
		dialogBase.SetButtonText(Data.SystemText.Get("Dia_BuyCrystal_004_Button"));
		dialogBase.SetPanelDepth(3000);
		dialogBase.onPushButton1 = onClickPayment;
		dialogBase.onPushButton2 = onClickCancel;
		string text = Data.SystemText.Get("Dia_LootBox_001", itemText);
		if (PlayerStaticData.IsLootBoxRegulation(PlayerStaticData.LootBoxType.GACHA))
		{
			text = text + "\n" + Data.SystemText.Get("Dia_LootBox_Item_001");
		}
		if (PlayerStaticData.IsLootBoxRegulation(PlayerStaticData.LootBoxType.TWOPICK) || PlayerStaticData.IsLootBoxRegulation(PlayerStaticData.LootBoxType.SEALED) || PlayerStaticData.IsLootBoxRegulation(PlayerStaticData.LootBoxType.COLOSSEUM) || PlayerStaticData.IsLootBoxRegulation(PlayerStaticData.LootBoxType.COMPETITION))
		{
			text = text + "\n" + Data.SystemText.Get("Dia_LootBox_Item_002");
		}
		dialogBase.SetText(text);
	}
}
