feat(battle-engine): EffectType full enum + collection/card/vfx extension copies
Replaces partial EffectMgr.EffectType with all 226 decomp values; copies the IsNotNullOrEmpty/EquelsID/FindFromCardId/GetAllFuncVfxResults extension files + UI extensions; adds Renderer/MeshFilter shared-material/mesh/sortingOrder. Compile loop then closed the revealed deps (3242 files). 9.1k -> 18 errors.
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase;
|
||||
|
||||
public class BuildDeckDetailWindow : MonoBehaviour
|
||||
{
|
||||
private const int SUPPLY_TYPE_LABEL_INDEX = 0;
|
||||
|
||||
private const int SUPPLY_NAME_LABEL_INDEX = 1;
|
||||
|
||||
private const int DEPTH_COPY_CONFIRM_DIALOG = 20;
|
||||
|
||||
[SerializeField]
|
||||
private BuildDeckProductDetail _buildDeckProductDetail;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelProductName;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _spriteClassColorIcon;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelDeckCode;
|
||||
|
||||
private BuildDeckProductInfo _productInfo;
|
||||
|
||||
private UICardList _uiCardList;
|
||||
|
||||
private List<string> _loadedCardList = new List<string>();
|
||||
|
||||
public void SetSingleData(UICardList uiCardList, BuildDeckProductInfo productInfo)
|
||||
{
|
||||
_productInfo = productInfo;
|
||||
_uiCardList = uiCardList;
|
||||
_buildDeckProductDetail.SetSingleProductDetail(productInfo);
|
||||
ClassCharacterMasterData charaPrmByClassId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(productInfo.leader_id);
|
||||
_labelProductName.text = productInfo.saleInfo.name;
|
||||
ClassCharaPrm.SetClassLabelSetting(_labelProductName, charaPrmByClassId.ClassColorId);
|
||||
_spriteClassColorIcon.spriteName = ClassCharaPrm.GetIconSpriteName(charaPrmByClassId.clan);
|
||||
_uiCardList.SetClan(charaPrmByClassId.clan);
|
||||
_uiCardList.SetDeckName(productInfo.saleInfo.name);
|
||||
_uiCardList.SetMaxCardNum(40);
|
||||
_labelDeckCode.text = Wizard.Data.SystemText.Get("Shop_0117", productInfo.deck_code);
|
||||
}
|
||||
|
||||
public void OnCloseWindow()
|
||||
{
|
||||
_uiCardList.RemoveData();
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_loadedCardList);
|
||||
}
|
||||
|
||||
public void OnBtnCopyDeckCode()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
NativePluginWrapper.SetStringToClipboard(_productInfo.deck_code);
|
||||
UIManager.GetInstance().CreateConfirmationDialog(Wizard.Data.SystemText.Get("Shop_0118", _productInfo.deck_code)).SetPanelDepth(20);
|
||||
}
|
||||
|
||||
public void OnBtnShowCardList()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
if (_uiCardList.getCardNum() > 0)
|
||||
{
|
||||
ShowUICardList();
|
||||
return;
|
||||
}
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
StartCoroutine(LoadCardAndShowUICardList());
|
||||
}
|
||||
|
||||
private IEnumerator LoadCardAndShowUICardList()
|
||||
{
|
||||
List<int> cardIdList = _productInfo.CardIdList;
|
||||
List<string> assetList = _uiCardList.GetLoadFileList(cardIdList);
|
||||
yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(assetList, null));
|
||||
_loadedCardList.AddRange(assetList);
|
||||
List<int> list = UIManager.GetInstance().getUIBase_CardManager().SortIDList(cardIdList, CardMaster.CardMasterId.Default);
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
_uiCardList.addScrollItem(list[i]);
|
||||
}
|
||||
_uiCardList.SetFormat(Format.Rotation, null);
|
||||
yield return null;
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
ShowUICardList();
|
||||
}
|
||||
|
||||
private void ShowUICardList()
|
||||
{
|
||||
_uiCardList.SetActive(in_Active: true);
|
||||
_uiCardList.ResetScroll();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase;
|
||||
|
||||
public class BuildDeckPlate : MonoBehaviour
|
||||
{
|
||||
private const int MAX_LENGTH_VIEW_DECK_PRODUCT_NAME = 15;
|
||||
|
||||
private const int MAX_LENGTH_VIEW_DECK_PRODUCT_NAME_ALPHABET = 35;
|
||||
|
||||
private readonly Vector3 POS_VIEW_SINGLE_PRODUCT_NAME = new Vector3(13f, -52f, 0f);
|
||||
|
||||
[SerializeField]
|
||||
private UIEventListener _eventListenerDeckImage;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelCostCrystalLeft;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelCostCrystalCenter;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton m_BtnBuy;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel m_LabelBuy;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel m_LabelPurchased;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _LabelPurchaseNum;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _LabelProductName;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _uiDeckTexture;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _spriteClassColorIcon;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelCostTicket;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _leaderSkinTicketIcon;
|
||||
|
||||
public BuildDeckProductInfo ProductInfo { get; private set; }
|
||||
|
||||
public Texture ImageTexture { get; private set; }
|
||||
|
||||
private void Start()
|
||||
{
|
||||
m_LabelPurchased.text = Wizard.Data.SystemText.Get("Shop_0100");
|
||||
}
|
||||
|
||||
public void SetData(BuildDeckProductInfo productInfo, EventDelegate onPushBuyBtnCallback, Action onTapDeckImage)
|
||||
{
|
||||
ProductInfo = productInfo;
|
||||
ClassCharacterMasterData charaPrmByClassId = GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(productInfo.leader_id);
|
||||
_LabelProductName.transform.localPosition = POS_VIEW_SINGLE_PRODUCT_NAME;
|
||||
int maxLength = (Global.IsAlphabetLanguage() ? 35 : 15);
|
||||
_LabelProductName.text = ShopCommonUtility.TrimProductName(productInfo.saleInfo.name, maxLength);
|
||||
ClassCharaPrm.SetClassLabelSetting(_LabelProductName, charaPrmByClassId.ClassColorId);
|
||||
_uiDeckTexture.mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(productInfo.saleInfo.path, ResourcesManager.AssetLoadPathType.ShopBuildDeckThumbnail, isfetch: true));
|
||||
_spriteClassColorIcon.gameObject.SetActive(value: true);
|
||||
_spriteClassColorIcon.spriteName = ClassCharaPrm.GetIconSpriteName(charaPrmByClassId.clan);
|
||||
m_BtnBuy.onClick.Clear();
|
||||
m_BtnBuy.onClick.Add(onPushBuyBtnCallback);
|
||||
_eventListenerDeckImage.onClick = null;
|
||||
_eventListenerDeckImage.onClick = delegate
|
||||
{
|
||||
onTapDeckImage.Call();
|
||||
};
|
||||
_SetBuyButton(productInfo);
|
||||
}
|
||||
|
||||
private void _SetBuyButton(BuildDeckProductInfo productInfo)
|
||||
{
|
||||
int? num = null;
|
||||
if (productInfo.saleInfo.costCrystal.HasValue)
|
||||
{
|
||||
num = productInfo.saleInfo.costCrystal.Value;
|
||||
}
|
||||
if (productInfo.saleInfo.costTicket.HasValue)
|
||||
{
|
||||
num = productInfo.saleInfo.costTicket.Value;
|
||||
}
|
||||
UIManager.SetObjectToGrey(m_BtnBuy.gameObject, b: false);
|
||||
_labelCostTicket.gameObject.SetActive(value: false);
|
||||
_leaderSkinTicketIcon.gameObject.SetActive(value: false);
|
||||
int num2 = 0;
|
||||
if (productInfo.saleInfo.costTicket.HasValue && productInfo.saleInfo.costTicketItemId.HasValue)
|
||||
{
|
||||
num2 = PlayerStaticData.GetItemNum((int)productInfo.saleInfo.costTicketItemId.Value);
|
||||
_labelCostTicket.text = Wizard.Data.SystemText.Get("Shop_0189", productInfo.saleInfo.costTicket.Value.ToString());
|
||||
_leaderSkinTicketIcon.mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(ShopCommonUtility.GetTicketIconPath(productInfo.saleInfo.costTicketItemId.Value.ToString(), isFetch: true));
|
||||
}
|
||||
if (!productInfo.is_purchased)
|
||||
{
|
||||
m_BtnBuy.gameObject.SetActive(value: true);
|
||||
m_BtnBuy.isEnabled = true;
|
||||
m_LabelPurchased.gameObject.SetActive(value: false);
|
||||
if (productInfo.saleInfo.isFree)
|
||||
{
|
||||
m_LabelBuy.text = Wizard.Data.SystemText.Get("Shop_0099");
|
||||
return;
|
||||
}
|
||||
m_LabelBuy.text = Wizard.Data.SystemText.Get("Shop_0095");
|
||||
if (productInfo.saleInfo.costTicket.HasValue && productInfo.saleInfo.costTicketItemId.HasValue)
|
||||
{
|
||||
_labelCostTicket.gameObject.SetActive(value: true);
|
||||
_leaderSkinTicketIcon.gameObject.SetActive(value: true);
|
||||
UIManager.SetObjectToGrey(m_BtnBuy.gameObject, num2 < productInfo.saleInfo.costTicket.Value);
|
||||
}
|
||||
if (!productInfo.saleInfo.costCrystal.HasValue)
|
||||
{
|
||||
_labelCostCrystalLeft.gameObject.SetActive(value: false);
|
||||
_labelCostCrystalCenter.gameObject.SetActive(value: false);
|
||||
}
|
||||
else if (productInfo.purchase_num_max == 1)
|
||||
{
|
||||
SetCostLabel(num.Value, isCenter: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCostLabel(num.Value, isCenter: false);
|
||||
}
|
||||
if (productInfo.purchase_num_max == 1)
|
||||
{
|
||||
_LabelPurchaseNum.gameObject.SetActive(value: false);
|
||||
return;
|
||||
}
|
||||
if (productInfo.is_first_price && productInfo.purchase_num_current <= 0)
|
||||
{
|
||||
_LabelPurchaseNum.gameObject.SetActive(value: true);
|
||||
_LabelPurchaseNum.text = Wizard.Data.SystemText.Get("Shop_0122");
|
||||
return;
|
||||
}
|
||||
_LabelPurchaseNum.gameObject.SetActive(value: true);
|
||||
int num3 = productInfo.purchase_num_max - productInfo.purchase_num_current;
|
||||
_LabelPurchaseNum.text = Wizard.Data.SystemText.Get("Shop_0123", num3.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_BtnBuy.gameObject.SetActive(value: false);
|
||||
m_LabelPurchased.gameObject.SetActive(value: true);
|
||||
_LabelPurchaseNum.gameObject.SetActive(value: false);
|
||||
if (productInfo.saleInfo.costTicket.HasValue && productInfo.saleInfo.costTicketItemId.HasValue)
|
||||
{
|
||||
_labelCostTicket.gameObject.SetActive(value: true);
|
||||
_leaderSkinTicketIcon.gameObject.SetActive(value: true);
|
||||
}
|
||||
if (!productInfo.saleInfo.costCrystal.HasValue)
|
||||
{
|
||||
_labelCostCrystalLeft.gameObject.SetActive(value: false);
|
||||
_labelCostCrystalCenter.gameObject.SetActive(value: false);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCostLabel(num.Value, isCenter: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetCostLabel(int cost, bool isCenter)
|
||||
{
|
||||
string text = Wizard.Data.SystemText.Get("Shop_0112", cost.ToString());
|
||||
if (isCenter)
|
||||
{
|
||||
_labelCostCrystalLeft.gameObject.SetActive(value: false);
|
||||
_labelCostCrystalCenter.gameObject.SetActive(value: true);
|
||||
_labelCostCrystalCenter.text = text;
|
||||
}
|
||||
else
|
||||
{
|
||||
_labelCostCrystalLeft.gameObject.SetActive(value: true);
|
||||
_labelCostCrystalCenter.gameObject.SetActive(value: false);
|
||||
_labelCostCrystalLeft.text = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,788 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.DeckCardEdit;
|
||||
using Wizard.Lottery;
|
||||
|
||||
namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase;
|
||||
|
||||
public class BuildDeckPurchasePage : BaseShopPurchasePage
|
||||
{
|
||||
private const int DEFAULT_INDEX = 0;
|
||||
|
||||
private const string LAYER_DIALOG_PRODUCT_DETAIL = "MyPage";
|
||||
|
||||
private const int SORTODER_DIALOG_PRODUCT_DETAIL = 2;
|
||||
|
||||
private const int DEPTH_DIALOG_PRODUCT_DETAIL = 140;
|
||||
|
||||
private const string LAYER_DIALOG_PURCHASE_REWARD = "MyPage";
|
||||
|
||||
private const int SORTODER_DIALOG_PURCHASE_REWARD = 2;
|
||||
|
||||
private const int DEPTH_DIALOG_PURCHASE_REWARD = 140;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _prefabDialogSelectBuyMeans;
|
||||
|
||||
[SerializeField]
|
||||
private PurchaseConfirm _prefabDialogPurchaseConfirm;
|
||||
|
||||
[SerializeField]
|
||||
private BuildDeckDetailWindow _prefabDialogBuildDeckDetail;
|
||||
|
||||
[SerializeField]
|
||||
private CardDetailUI _cardDetailPrefab;
|
||||
|
||||
private CardDetailUI _cardDetail;
|
||||
|
||||
[SerializeField]
|
||||
private UICardList _cardListPrefab;
|
||||
|
||||
private UICardList _uiCardListClass;
|
||||
|
||||
[SerializeField]
|
||||
private ShopDrumrollScrollManager _drumrollManager;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _btnSeriesRewards;
|
||||
|
||||
[SerializeField]
|
||||
private UIAnchor _achiveAnchor;
|
||||
|
||||
private BuildDeckSeriesPurchaseInfo _selectSeriesInfo;
|
||||
|
||||
private BuildDeckProductInfo _purchaseProductInfo;
|
||||
|
||||
private string _purchaseDeckName = string.Empty;
|
||||
|
||||
private int _purchaseDeckClassId;
|
||||
|
||||
private List<int> _purchaseDeckCardIds;
|
||||
|
||||
private BuildDeckPlate _selectPlate;
|
||||
|
||||
private DialogBase _dialogPurchaseConfirm;
|
||||
|
||||
private DialogBase _dialogSelectBuyMeans;
|
||||
|
||||
private DialogBase _dialogProductDetail;
|
||||
|
||||
private DialogBase _dialogCrystalShortage;
|
||||
|
||||
private BuildDeckBuyTask _buyTask;
|
||||
|
||||
private bool _isBuyConnect;
|
||||
|
||||
private static int _autoShowBuildDeckProductId;
|
||||
|
||||
private static bool _autoShowBuildDeckEnable;
|
||||
|
||||
private Format _deckCreateFormat;
|
||||
|
||||
private List<string> _loadResource = new List<string>();
|
||||
|
||||
private int _addShowSeriesId;
|
||||
|
||||
[SerializeField]
|
||||
private NotificatonAnimation _notificationAnimationPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _achieveLog;
|
||||
|
||||
private NotificatonAnimation _notificationAnimation;
|
||||
|
||||
public static void BuildDeckConfirmDialogShow(int productID)
|
||||
{
|
||||
_autoShowBuildDeckEnable = true;
|
||||
_autoShowBuildDeckProductId = productID;
|
||||
}
|
||||
|
||||
public override void onFirstStart()
|
||||
{
|
||||
_cardDetail = UnityEngine.Object.Instantiate(_cardDetailPrefab);
|
||||
_cardDetail.transform.parent = base.transform;
|
||||
_cardDetail.transform.localPosition = Vector3.zero;
|
||||
_cardDetail.transform.localScale = Vector3.one;
|
||||
_cardDetail.Initialize(LayerMask.NameToLayer("Detail"), CardMaster.CardMasterId.Default);
|
||||
_cardDetail.gameObject.SetActive(value: false);
|
||||
_uiCardListClass = UnityEngine.Object.Instantiate(_cardListPrefab).GetComponent<UICardList>();
|
||||
_uiCardListClass.SetActive(in_Active: false);
|
||||
_uiCardListClass.Init(base.gameObject, _cardDetail, null, null, "Detail", in_DetailCameraUse: true);
|
||||
CreateTopBar(Wizard.Data.SystemText.Get("Shop_0116"), delegate
|
||||
{
|
||||
MyPageMenu.Instance.GoToShopCard();
|
||||
});
|
||||
_achiveAnchor.uiCamera = UIManager.GetInstance().MyPageUICameraObj.GetComponent<Camera>();
|
||||
base.onFirstStart();
|
||||
}
|
||||
|
||||
protected override void onOpen()
|
||||
{
|
||||
base.onOpen();
|
||||
_loadedResourceList = new List<string>();
|
||||
StartGetBuildDeckInfo(OnBuildDeckInfoRequestFinished);
|
||||
}
|
||||
|
||||
protected override void onClose()
|
||||
{
|
||||
base.onClose();
|
||||
DisposeResource();
|
||||
}
|
||||
|
||||
private void DisposeResource()
|
||||
{
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_loadResource);
|
||||
_loadResource.Clear();
|
||||
}
|
||||
|
||||
private void StartGetBuildDeckInfo(Action<NetworkTask.ResultCode> callbackOnSuccess)
|
||||
{
|
||||
BuildDeckPurchaseInfoTask buildDeckPurchaseInfoTask = new BuildDeckPurchaseInfoTask();
|
||||
buildDeckPurchaseInfoTask.SetParameter(_addShowSeriesId);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(buildDeckPurchaseInfoTask, callbackOnSuccess));
|
||||
}
|
||||
|
||||
private void StartBuyBuildDeck(ShopCommonUtility.SalesType costType, int id)
|
||||
{
|
||||
if (!_isBuyConnect)
|
||||
{
|
||||
_isBuyConnect = true;
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
_buyTask = new BuildDeckBuyTask();
|
||||
_buyTask.SetParameter(id, costType);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(_buyTask, delegate(NetworkTask.ResultCode error)
|
||||
{
|
||||
onSuccessPurchase(error, costType);
|
||||
}, _OnFailurePurchase, _OnResultCodeError));
|
||||
}
|
||||
}
|
||||
|
||||
private int GetViewSeriesId()
|
||||
{
|
||||
int seriesId = Wizard.Data.BuildDeckPurchaseInfo.seriesList[0]._seriesId;
|
||||
int value = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LATEST_DECK_SERIES_ID);
|
||||
if (seriesId != value)
|
||||
{
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.LATEST_DECK_SERIES_ID, seriesId);
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.LAST_PURCHASE_DECK_SERIES_ID, seriesId);
|
||||
}
|
||||
if (_autoShowBuildDeckEnable)
|
||||
{
|
||||
return Wizard.Data.BuildDeckPurchaseInfo.GetSeriesId(_autoShowBuildDeckProductId);
|
||||
}
|
||||
int value2 = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.SCENE_TRANSITION_VIEW_DECK_SERIES_ID);
|
||||
if (value2 > -1)
|
||||
{
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.SCENE_TRANSITION_VIEW_DECK_SERIES_ID, -1);
|
||||
return value2;
|
||||
}
|
||||
return PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.LAST_PURCHASE_DECK_SERIES_ID);
|
||||
}
|
||||
|
||||
private void OnBuildDeckInfoRequestFinished(NetworkTask.ResultCode error)
|
||||
{
|
||||
List<int> seriesIdList = GetSeriesIdList();
|
||||
Dictionary<int, BaseSeriesData> seriesMasterDic = GetSeriesDataDictionary();
|
||||
List<BuildDeckSeriesPurchaseInfo> seriesList = Wizard.Data.BuildDeckPurchaseInfo.seriesList;
|
||||
DisposeResource();
|
||||
foreach (BuildDeckSeriesPurchaseInfo item in seriesList)
|
||||
{
|
||||
foreach (BuildDeckProductInfo product in item.productList)
|
||||
{
|
||||
if (product.saleInfo.costTicket.HasValue && product.saleInfo.costTicketItemId.HasValue)
|
||||
{
|
||||
_loadResource.Add(ShopCommonUtility.GetTicketIconPath(product.saleInfo.costTicketItemId.Value.ToString(), isFetch: false));
|
||||
_loadResource.Add(ShopCommonUtility.GetTicketIconRightDownPath(product.saleInfo.costTicketItemId.Value.ToString(), isFetch: false));
|
||||
}
|
||||
}
|
||||
}
|
||||
StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(_loadResource, delegate
|
||||
{
|
||||
StartCoroutine(loadSeriesImages(ResourcesManager.AssetLoadPathType.ShopBuildDeck, seriesIdList, seriesMasterDic, delegate
|
||||
{
|
||||
if (_drumrollSeriesImageList.Count <= 0)
|
||||
{
|
||||
UIManager.GetInstance().OnReadyViewScene(isFadein: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
int viewSeriesId = GetViewSeriesId();
|
||||
int seriesIndex = seriesList.FindIndex((BuildDeckSeriesPurchaseInfo data) => data._seriesId == viewSeriesId);
|
||||
if (seriesIndex < 0)
|
||||
{
|
||||
seriesIndex = 0;
|
||||
}
|
||||
List<ShopDrumrollScrollManager.DrumrollItem> itemList = _drumrollSeriesImageList.Select((Texture tex, int index) => new ShopDrumrollScrollManager.DrumrollItem(tex, seriesList[index]._isNew)).ToList();
|
||||
StartCoroutine(_drumrollManager.CreateDrumrollScroll_Coroutine(itemList, seriesIndex, onSelectSeries, delegate
|
||||
{
|
||||
onSelectSeries(seriesIndex, delegate
|
||||
{
|
||||
UIManager.GetInstance().OnReadyViewScene(isFadein: true);
|
||||
if (_autoShowBuildDeckEnable)
|
||||
{
|
||||
_autoShowBuildDeckEnable = false;
|
||||
BuildDeckProductInfo productInfo = Wizard.Data.BuildDeckPurchaseInfo.GetProductInfo(_autoShowBuildDeckProductId);
|
||||
if (productInfo != null)
|
||||
{
|
||||
createBuildDeckSelectBuyMeansDialog(productInfo);
|
||||
}
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
||||
private List<int> GetSeriesIdList()
|
||||
{
|
||||
return Wizard.Data.BuildDeckPurchaseInfo.seriesList.ConvertAll((BuildDeckSeriesPurchaseInfo info) => info._seriesId);
|
||||
}
|
||||
|
||||
private Dictionary<int, BaseSeriesData> GetSeriesDataDictionary()
|
||||
{
|
||||
Dictionary<int, BaseSeriesData> dictionary = new Dictionary<int, BaseSeriesData>();
|
||||
foreach (KeyValuePair<int, BuildDeckSeries> item in Wizard.Data.Master.BuildDeckSeriesIdDic)
|
||||
{
|
||||
dictionary.Add(item.Key, item.Value);
|
||||
}
|
||||
return dictionary;
|
||||
}
|
||||
|
||||
private void onSelectSeries(int seriesIndex)
|
||||
{
|
||||
onSelectSeries(seriesIndex, null);
|
||||
}
|
||||
|
||||
private void onSelectSeries(int seriesIndex, Action onFinish)
|
||||
{
|
||||
BuildDeckSeriesPurchaseInfo seriesInfo = Wizard.Data.BuildDeckPurchaseInfo.seriesList[seriesIndex];
|
||||
_selectSeriesInfo = seriesInfo;
|
||||
_titleLogoTexture.mainTexture = _seriesTitleImageList[seriesIndex];
|
||||
_labelSeriesDescription.text = seriesInfo._introduction;
|
||||
if (seriesInfo.SeriesRewardList.Count > 0)
|
||||
{
|
||||
_btnSeriesRewards.gameObject.SetActive(value: true);
|
||||
_btnSeriesRewards.onClick.Clear();
|
||||
_btnSeriesRewards.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickSeriesRewardButton(seriesIndex);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
_btnSeriesRewards.gameObject.SetActive(value: false);
|
||||
}
|
||||
int num = _cacheSeriesIdList.IndexOf(seriesInfo._seriesId);
|
||||
if (num != -1)
|
||||
{
|
||||
_cacheRefCountList[num]++;
|
||||
ResetProductListScroll(seriesInfo.productList.Count);
|
||||
onFinish.Call();
|
||||
return;
|
||||
}
|
||||
if (_cacheSeriesIdList.Count >= 4)
|
||||
{
|
||||
int num2 = _cacheRefCountList[0];
|
||||
int cacheIndex = 0;
|
||||
for (int num3 = 1; num3 < _cacheRefCountList.Count; num3++)
|
||||
{
|
||||
if (num2 > _cacheRefCountList[num3])
|
||||
{
|
||||
num2 = _cacheRefCountList[num3];
|
||||
cacheIndex = num3;
|
||||
}
|
||||
}
|
||||
DeleteCacheSeriesByCashIndex(cacheIndex);
|
||||
}
|
||||
UIManager.GetInstance().LoadingViewManager.CreateInSceneCenter();
|
||||
StartCoroutine(loadBuildDecks(delegate
|
||||
{
|
||||
UIManager.GetInstance().LoadingViewManager.CloseInSceneCenter();
|
||||
if (_selectSeriesInfo == seriesInfo)
|
||||
{
|
||||
ResetProductListScroll(seriesInfo.productList.Count);
|
||||
}
|
||||
_cacheSeriesIdList.Add(seriesInfo._seriesId);
|
||||
_cacheRefCountList.Add(1);
|
||||
onFinish.Call();
|
||||
}));
|
||||
}
|
||||
|
||||
private void DeleteCacheSeriesByCashIndex(int cacheIndex)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
BuildDeckSeriesPurchaseInfo buildDeckSeriesPurchaseInfo = Wizard.Data.BuildDeckPurchaseInfo.seriesList.Find((BuildDeckSeriesPurchaseInfo m) => m._seriesId == _cacheSeriesIdList[cacheIndex]);
|
||||
if (buildDeckSeriesPurchaseInfo != null)
|
||||
{
|
||||
for (int num = 0; num < buildDeckSeriesPurchaseInfo.productList.Count; num++)
|
||||
{
|
||||
list.Add(Toolbox.ResourcesManager.GetAssetTypePath(buildDeckSeriesPurchaseInfo.productList[num].saleInfo.path, ResourcesManager.AssetLoadPathType.ShopBuildDeckThumbnail));
|
||||
}
|
||||
}
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(list);
|
||||
_cacheSeriesIdList.RemoveAt(cacheIndex);
|
||||
_cacheRefCountList.RemoveAt(cacheIndex);
|
||||
for (int num2 = 0; num2 < list.Count; num2++)
|
||||
{
|
||||
_cacheResourceList.Remove(list[num2]);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator loadBuildDecks(Action callBack = null)
|
||||
{
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
List<string> listResource = new List<string>();
|
||||
List<BuildDeckProductInfo> productList = _selectSeriesInfo.productList;
|
||||
for (int i = 0; i < productList.Count; i++)
|
||||
{
|
||||
listResource.Add(Toolbox.ResourcesManager.GetAssetTypePath(productList[i].saleInfo.path, ResourcesManager.AssetLoadPathType.ShopBuildDeckThumbnail));
|
||||
}
|
||||
yield return StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(listResource, null));
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
for (int j = 0; j < listResource.Count; j++)
|
||||
{
|
||||
_cacheResourceList.Add(listResource[j]);
|
||||
}
|
||||
callBack.Call();
|
||||
}
|
||||
|
||||
protected override void OnInitializeItem(GameObject go, int wrapIndex, int realIndex)
|
||||
{
|
||||
if (_selectSeriesInfo == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (realIndex >= _selectSeriesInfo.productList.Count || realIndex < 0)
|
||||
{
|
||||
go.SetActive(value: false);
|
||||
return;
|
||||
}
|
||||
go.SetActive(value: true);
|
||||
BuildDeckPlate plate = go.GetComponent<BuildDeckPlate>();
|
||||
EventDelegate eventDelegate = new EventDelegate(this, "onPushBuyButton");
|
||||
eventDelegate.parameters[0].value = plate;
|
||||
plate.SetData(_selectSeriesInfo.productList[realIndex], eventDelegate, delegate
|
||||
{
|
||||
_onTapBuildDeckImage(plate);
|
||||
});
|
||||
}
|
||||
|
||||
private void _onTapBuildDeckImage(BuildDeckPlate plate)
|
||||
{
|
||||
if (!(_dialogProductDetail != null))
|
||||
{
|
||||
_dialogProductDetail = UIManager.GetInstance().CreateDialogClose();
|
||||
_dialogProductDetail.SetSize(DialogBase.Size.M);
|
||||
_dialogProductDetail.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_003_Title"));
|
||||
_dialogProductDetail.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
_dialogProductDetail.gameObject.layer = LayerMask.NameToLayer("MyPage");
|
||||
_dialogProductDetail.SetBackViewLayer(LayerMask.NameToLayer("MyPage"));
|
||||
_dialogProductDetail.SetDepthAndSortingOrder(140, 2);
|
||||
BuildDeckDetailWindow component = UnityEngine.Object.Instantiate(_prefabDialogBuildDeckDetail).GetComponent<BuildDeckDetailWindow>();
|
||||
_dialogProductDetail.SetObj(component.gameObject);
|
||||
component.SetSingleData(_uiCardListClass, plate.ProductInfo);
|
||||
_dialogProductDetail.OnClose = component.OnCloseWindow;
|
||||
}
|
||||
}
|
||||
|
||||
private void onPushBuyButton(BuildDeckPlate plate)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
_selectPlate = plate;
|
||||
createBuildDeckSelectBuyMeansDialog(plate.ProductInfo);
|
||||
}
|
||||
|
||||
private void OnClickSeriesRewardButton(int seriesIndex)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
DialogBase dialogBase = PurchaseRewardDialog.Create(Wizard.Data.BuildDeckPurchaseInfo.seriesList[seriesIndex].SeriesRewardList, _cardDetail, useLargeDetailDialog: false, PurchaseRewardDialog.Layout.NORMAL);
|
||||
dialogBase.SetLayer("MyPage");
|
||||
dialogBase.SetDepthAndSortingOrder(140, 2);
|
||||
}
|
||||
|
||||
private void createBuildDeckSelectBuyMeansDialog(BuildDeckProductInfo pInfo)
|
||||
{
|
||||
if (_dialogSelectBuyMeans != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_ = pInfo.is_purchased;
|
||||
_dialogSelectBuyMeans = _createBaseDialogForSelectBuyMeans(pInfo.saleInfo);
|
||||
BuildDeckSelectBuyMeansDialog component = UnityEngine.Object.Instantiate(_prefabDialogSelectBuyMeans).GetComponent<BuildDeckSelectBuyMeansDialog>();
|
||||
_dialogSelectBuyMeans.SetObj(component.gameObject);
|
||||
Action onPushBuyCrystalBtnCallBack = null;
|
||||
Action onPushBuyRupyBtnCallBack = null;
|
||||
Action onPushBuyTicketBtnCallBack = null;
|
||||
if (pInfo.saleInfo.isFree)
|
||||
{
|
||||
_dialogSelectBuyMeans.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
_dialogSelectBuyMeans.SetButtonText(Wizard.Data.SystemText.Get("Shop_0082"));
|
||||
_dialogSelectBuyMeans.onPushButton1 = delegate
|
||||
{
|
||||
_purchaseProductInfo = pInfo;
|
||||
UIManager.GetInstance().createInSceneCenterLoading();
|
||||
StartBuyBuildDeck(ShopCommonUtility.SalesType.free, pInfo.product_id);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_dialogSelectBuyMeans.SetButtonLayout(DialogBase.ButtonLayout.NONE);
|
||||
onPushBuyCrystalBtnCallBack = delegate
|
||||
{
|
||||
_purchaseProductInfo = pInfo;
|
||||
_createPurchaseConfirmDialog(pInfo.saleInfo, ShopCommonUtility.SalesType.crystal, delegate
|
||||
{
|
||||
StartBuyBuildDeck(ShopCommonUtility.SalesType.crystal, pInfo.product_id);
|
||||
});
|
||||
};
|
||||
onPushBuyRupyBtnCallBack = delegate
|
||||
{
|
||||
_purchaseProductInfo = pInfo;
|
||||
_createPurchaseConfirmDialog(pInfo.saleInfo, ShopCommonUtility.SalesType.rupy, delegate
|
||||
{
|
||||
StartBuyBuildDeck(ShopCommonUtility.SalesType.rupy, pInfo.product_id);
|
||||
});
|
||||
};
|
||||
onPushBuyTicketBtnCallBack = delegate
|
||||
{
|
||||
_purchaseProductInfo = pInfo;
|
||||
_createPurchaseConfirmDialog(pInfo.saleInfo, ShopCommonUtility.SalesType.ticket, delegate
|
||||
{
|
||||
StartBuyBuildDeck(ShopCommonUtility.SalesType.ticket, pInfo.product_id);
|
||||
});
|
||||
};
|
||||
}
|
||||
component.Init(pInfo, _dialogSelectBuyMeans, onPushBuyCrystalBtnCallBack, onPushBuyRupyBtnCallBack, onPushBuyTicketBtnCallBack);
|
||||
}
|
||||
|
||||
private DialogBase _createBaseDialogForSelectBuyMeans(ShopCommonSaleInfo info)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_001_Title"));
|
||||
dialogBase.SetReturnMsg(null, "");
|
||||
return dialogBase;
|
||||
}
|
||||
|
||||
private void _createPurchaseConfirmDialog(ShopCommonSaleInfo info, ShopCommonUtility.SalesType costType, Action buyApiFunc)
|
||||
{
|
||||
if (!(_dialogPurchaseConfirm != null) && ShopCommonUtility.IsHaveEnoughCost(info, costType, delegate
|
||||
{
|
||||
if (_dialogCrystalShortage == null)
|
||||
{
|
||||
_dialogCrystalShortage = ShopCommonUtility.CreateCrystalShortagePopup();
|
||||
}
|
||||
}))
|
||||
{
|
||||
string warningTextId = (_purchaseProductInfo.ContainsOnlyRotationCards() ? null : "Shop_0139");
|
||||
_dialogPurchaseConfirm = ShopCommonUtility.CreatePurchaseConfirmPopup(info, costType, _prefabDialogPurchaseConfirm, buyApiFunc, warningTextId);
|
||||
_dialogPurchaseConfirm.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_002_Title"));
|
||||
}
|
||||
}
|
||||
|
||||
private void _OnFailurePurchase(NetworkTask.ResultCode code)
|
||||
{
|
||||
_isBuyConnect = false;
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
}
|
||||
|
||||
private void _OnResultCodeError(int code)
|
||||
{
|
||||
if (code != 110)
|
||||
{
|
||||
_isBuyConnect = false;
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
_ReloadBuildDeckInfo();
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowRewardDialog(Action onFinish)
|
||||
{
|
||||
if (_buyTask.LotteryRewardList.Count == 0)
|
||||
{
|
||||
onFinish.Call();
|
||||
return;
|
||||
}
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Story_0029"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
RewardBase component = NGUITools.AddChild(dialogBase.gameObject, UIManager.GetInstance().GetRewardDialogPrefab().gameObject).GetComponent<RewardBase>();
|
||||
foreach (ReceivedReward lotteryReward in _buyTask.LotteryRewardList)
|
||||
{
|
||||
component.AddReward(lotteryReward);
|
||||
if (!string.IsNullOrEmpty(lotteryReward.reward_message))
|
||||
{
|
||||
dialogBase.SetTitleLabel(lotteryReward.reward_message);
|
||||
}
|
||||
}
|
||||
component.EndCreate();
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
onFinish.Call();
|
||||
};
|
||||
}
|
||||
|
||||
private void ShowLotteryApplyDialog(Action onFinish)
|
||||
{
|
||||
UIManager.GetInstance().LoadingViewManager.CreateInSceneCenter();
|
||||
string lotteryTexturePath = LotteryApplyDialog.GetLotteryTexturePath(_buyTask.LotteryData, isFetch: false);
|
||||
_loadResource.Add(lotteryTexturePath);
|
||||
StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(lotteryTexturePath, delegate
|
||||
{
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
LotteryApplyDialog.Create(_buyTask.LotteryData, autoClose: false).OnClose = delegate
|
||||
{
|
||||
ShowRewardDialog(delegate
|
||||
{
|
||||
onFinish.Call();
|
||||
});
|
||||
};
|
||||
}));
|
||||
}
|
||||
|
||||
private void onSuccessPurchase(NetworkTask.ResultCode error, ShopCommonUtility.SalesType salesType)
|
||||
{
|
||||
_isBuyConnect = false;
|
||||
BuildDeckProductInfo savePurchaseProductInfo = _purchaseProductInfo;
|
||||
if (_purchaseProductInfo != null)
|
||||
{
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.LAST_PURCHASE_DECK_SERIES_ID, _selectSeriesInfo._seriesId);
|
||||
if (salesType == ShopCommonUtility.SalesType.ticket)
|
||||
{
|
||||
_addShowSeriesId = _selectSeriesInfo._seriesId;
|
||||
}
|
||||
if (!_buyTask.LotteryData.IsEnable && _buyTask.MissionRewardList.Count == 0)
|
||||
{
|
||||
ShowCreateDeckDialog(savePurchaseProductInfo);
|
||||
}
|
||||
else if (_buyTask.LotteryData.IsEnable)
|
||||
{
|
||||
ShowLotteryApplyDialog(delegate
|
||||
{
|
||||
ShowCreateDeckDialog(savePurchaseProductInfo);
|
||||
});
|
||||
}
|
||||
else if (_buyTask.MissionRewardList.Count > 0)
|
||||
{
|
||||
ShowMissionRewardDialog(delegate
|
||||
{
|
||||
ShowCreateDeckDialog(savePurchaseProductInfo);
|
||||
});
|
||||
}
|
||||
}
|
||||
_ReloadBuildDeckInfo();
|
||||
}
|
||||
|
||||
private void ShowCreateDeckDialog(BuildDeckProductInfo savePurchaseProductInfo)
|
||||
{
|
||||
DialogBase diaChange = UIManager.GetInstance().CreateDialogClose();
|
||||
bool hasResurgentCard = savePurchaseProductInfo.HasResurgentCard;
|
||||
string empty = string.Empty;
|
||||
empty = ((_buyTask._seriesRewardList.Count > 0) ? Wizard.Data.SystemText.Get("Shop_0144", savePurchaseProductInfo.saleInfo.name.Replace("\n", "")) : ((!hasResurgentCard) ? Wizard.Data.SystemText.Get("Shop_0124", savePurchaseProductInfo.saleInfo.name.Replace("\n", "")) : Wizard.Data.SystemText.Get("Shop_0256", savePurchaseProductInfo.saleInfo.name.Replace("\n", ""))));
|
||||
diaChange.SetText(empty);
|
||||
diaChange.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_004_Title"));
|
||||
diaChange.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
diaChange.SetButtonText(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_001_Button"));
|
||||
_purchaseDeckName = savePurchaseProductInfo.saleInfo.name;
|
||||
_purchaseDeckClassId = savePurchaseProductInfo.leader_id;
|
||||
_purchaseDeckCardIds = savePurchaseProductInfo.CardIdList;
|
||||
if (hasResurgentCard)
|
||||
{
|
||||
diaChange.onPushButton1 = delegate
|
||||
{
|
||||
CheckEmptyDeck(Format.Rotation);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
diaChange.onPushButton1 = OpenSelectFormatDialog;
|
||||
}
|
||||
diaChange.onPushButton2 = delegate
|
||||
{
|
||||
diaChange.CloseWithoutSelect();
|
||||
};
|
||||
diaChange.onCloseWithoutSelect = delegate
|
||||
{
|
||||
UIManager.GetInstance().StartCoroutine(ShowAchieveLog(_buyTask.NotificatonAnimationParams));
|
||||
_buyTask.NotificatonAnimationParams = null;
|
||||
};
|
||||
}
|
||||
|
||||
private void ShowMissionRewardDialog(Action onFinish)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Story_0029"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
onFinish.Call();
|
||||
};
|
||||
RewardBase component = NGUITools.AddChild(dialogBase.gameObject, UIManager.GetInstance().GetRewardDialogPrefab().gameObject).GetComponent<RewardBase>();
|
||||
for (int num = 0; num < _buyTask.MissionRewardList.Count; num++)
|
||||
{
|
||||
component.AddReward(_buyTask.MissionRewardList[num]);
|
||||
}
|
||||
component.EndCreate();
|
||||
}
|
||||
|
||||
private IEnumerator ShowAchieveLog(List<NotificatonAnimation.Param> paramList)
|
||||
{
|
||||
if (paramList != null)
|
||||
{
|
||||
if (_notificationAnimation != null)
|
||||
{
|
||||
UnityEngine.Object.Destroy(_notificationAnimation.gameObject);
|
||||
_notificationAnimation = null;
|
||||
}
|
||||
_notificationAnimation = NGUITools.AddChild(_achieveLog, _notificationAnimationPrefab.gameObject).GetComponent<NotificatonAnimation>();
|
||||
yield return StartCoroutine(_notificationAnimation.Exec(paramList));
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckEmptyDeck(Format format)
|
||||
{
|
||||
_deckCreateFormat = format;
|
||||
EmptyDeckInfoTask emptyDeckInfoTask = new EmptyDeckInfoTask();
|
||||
emptyDeckInfoTask.SetParameter(_deckCreateFormat);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(emptyDeckInfoTask, OnSuccessDeckListCheck));
|
||||
}
|
||||
|
||||
private void OpenSelectFormatDialog()
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
SystemText systemText = Wizard.Data.SystemText;
|
||||
dialogBase.SetText(systemText.Get("Shop_0138"));
|
||||
dialogBase.SetTitleLabel(systemText.Get("Dia_BuyBuildDeck_004_Title"));
|
||||
dialogBase.AddButton(DialogBase.ButtonType.Blue, isReflect: true, systemText.Get("Common_0155"));
|
||||
dialogBase.AddButton(DialogBase.ButtonType.Blue, isReflect: true, systemText.Get("Common_0154"));
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
CheckEmptyDeck(Format.Unlimited);
|
||||
};
|
||||
dialogBase.onPushButton2 = delegate
|
||||
{
|
||||
CheckEmptyDeck(Format.Rotation);
|
||||
};
|
||||
dialogBase.onCloseWithoutSelect = delegate
|
||||
{
|
||||
UIManager.GetInstance().StartCoroutine(ShowAchieveLog(_buyTask.NotificatonAnimationParams));
|
||||
_buyTask.NotificatonAnimationParams = null;
|
||||
};
|
||||
}
|
||||
|
||||
private void OnSuccessDeckListCheck(NetworkTask.ResultCode errorcode)
|
||||
{
|
||||
if (Wizard.Data.EmptyDeckInfo.CanDeckCreate)
|
||||
{
|
||||
SetUpDeckDataAndChangeViewDeckEdit();
|
||||
return;
|
||||
}
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetText(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_005_Body"));
|
||||
dialogBase.SetTitleLabel(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_005_Title"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
dialogBase.SetButtonText(Wizard.Data.SystemText.Get("Dia_BuyBuildDeck_005_Button"));
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam
|
||||
{
|
||||
IsUpdateFooterMenuTexture = true
|
||||
};
|
||||
DeckListUI.ChangeSceneToDeckList(_deckCreateFormat, param);
|
||||
};
|
||||
}
|
||||
|
||||
private void SetUpDeckDataAndChangeViewDeckEdit()
|
||||
{
|
||||
DeckData deckData = new DeckData();
|
||||
deckData.SetDeckClassID(_purchaseDeckClassId);
|
||||
deckData.SetDeckSleeveID(3000011L);
|
||||
deckData.SetDeckIsComplete(isComplete: true);
|
||||
deckData.SetCardIdList(_purchaseDeckCardIds);
|
||||
DeckData deckData2 = new DeckData(_deckCreateFormat, DeckAttributeType.CustomDeck);
|
||||
deckData2.SetDeckID(Wizard.Data.EmptyDeckInfo.EmptyDeckID);
|
||||
DeckCardEditUI.SetBuildDeckEditParameter(deckData, _purchaseDeckName, deckData2);
|
||||
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.DeckCardEdit);
|
||||
}
|
||||
|
||||
private void _ReloadBuildDeckInfo()
|
||||
{
|
||||
if (MyPageMenu.Instance != null)
|
||||
{
|
||||
MyPageMenu.Instance.UpdateCrystalCount();
|
||||
MyPageMenu.Instance.UpdateRupyCount();
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.GetInstance().UpDateCrystalNum();
|
||||
}
|
||||
List<BuildDeckSeriesPurchaseInfo> oldSeriesList = new List<BuildDeckSeriesPurchaseInfo>(Wizard.Data.BuildDeckPurchaseInfo.seriesList);
|
||||
StartGetBuildDeckInfo(delegate
|
||||
{
|
||||
bool flag = false;
|
||||
List<BuildDeckSeriesPurchaseInfo> seriesList = Wizard.Data.BuildDeckPurchaseInfo.seriesList;
|
||||
for (int i = 0; i < seriesList.Count; i++)
|
||||
{
|
||||
if (oldSeriesList[i]._seriesId != seriesList[i]._seriesId)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
if (seriesList[i]._seriesId == _selectSeriesInfo._seriesId)
|
||||
{
|
||||
if (_selectPlate != null)
|
||||
{
|
||||
if (_selectPlate.ProductInfo.product_id == _purchaseProductInfo.product_id)
|
||||
{
|
||||
_selectSeriesInfo = seriesList[i];
|
||||
BuildDeckPlate[] componentsInChildren = _wrapContent.gameObject.GetComponentsInChildren<BuildDeckPlate>();
|
||||
foreach (BuildDeckPlate plate in componentsInChildren)
|
||||
{
|
||||
int realIndex = _selectSeriesInfo.productList.FindIndex((BuildDeckProductInfo p) => p.product_id == plate.ProductInfo.product_id);
|
||||
OnInitializeItem(plate.gameObject, 0, realIndex);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
onSelectSeries(i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
onSelectSeries(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (oldSeriesList.Count != seriesList.Count)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
_purchaseProductInfo = null;
|
||||
_selectPlate = null;
|
||||
if (flag)
|
||||
{
|
||||
List<int> seriesIdList = GetSeriesIdList();
|
||||
Dictionary<int, BaseSeriesData> seriesDataDictionary = GetSeriesDataDictionary();
|
||||
StartCoroutine(loadSeriesImages(ResourcesManager.AssetLoadPathType.ShopBuildDeck, seriesIdList, seriesDataDictionary, delegate
|
||||
{
|
||||
List<ShopDrumrollScrollManager.DrumrollItem> itemList = _drumrollSeriesImageList.ConvertAll((Texture tex) => new ShopDrumrollScrollManager.DrumrollItem(tex));
|
||||
StartCoroutine(_drumrollManager.CreateDrumrollScroll_Coroutine(itemList, 0, onSelectSeries, delegate
|
||||
{
|
||||
onSelectSeries(0);
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
}));
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user