Exemplo n.º 1
0
    private void _viewBundleTab()
    {
        //IL_03b7: Unknown result type (might be due to invalid IL or missing references)
        //IL_03c1: Unknown result type (might be due to invalid IL or missing references)
        //IL_03da: Unknown result type (might be due to invalid IL or missing references)
        //IL_03e4: Unknown result type (might be due to invalid IL or missing references)
        SetActive(gemTab, false);
        SetActive(materialTab, false);
        SetActive(bundleTab, true);
        CheckOpenedBundleTab();
        if (_purchaseBundleList.Count == 0)
        {
            SetActive((Enum)UI.OBJ_AIM, false);
            SetActive((Enum)UI.TEX_NPCMODEL, false);
            SetActive((Enum)UI.SPR_FRAME_DRAGON, false);
            SetActive((Enum)UI.LBL_NONE, true);
        }
        else
        {
            SetActive((Enum)UI.OBJ_AIM, true);
            SetActive((Enum)UI.TEX_NPCMODEL, true);
            SetActive((Enum)UI.SPR_FRAME_DRAGON, true);
            if (_currentPageIndex < _purchaseBundleList.Count)
            {
                ProductData productData = _purchaseBundleList[_currentPageIndex];
                GlobalSettingsManager.PackParam.PackInfo pack = MonoBehaviourSingleton <GlobalSettingsManager> .I.packParam.GetPack(productData.productId);

                Transform root = SetPrefab(_objBundle, MonoBehaviourSingleton <GlobalSettingsManager> .I.packParam.prefabBundleName, true);
                Utility.ToggleActiveChildren(_objBundle, _currentPageIndex);
                UITexture sprw = FindCtrl(root, UI.SPR_WINDOW).GetComponent <UITexture>();
                ResourceLoad.LoadShopImageTexture(sprw, pack.bundleImageId, delegate(Texture tex)
                {
                    if (sprw != null)
                    {
                        sprw.mainTexture = tex;
                    }
                });
                SetTexture(root, UI.SPR_OFFER, null);
                if (productData.offerType > 0)
                {
                    UITexture spro = FindCtrl(root, UI.SPR_OFFER).GetComponent <UITexture>();
                    ResourceLoad.LoadShopImageOfferTexture(sprw, (uint)productData.offerType, delegate(Texture tex)
                    {
                        if (sprw != null)
                        {
                            spro.width       = tex.get_width();
                            spro.height      = tex.get_height();
                            spro.mainTexture = tex;
                        }
                    });
                }
                RemoveModel(root, UI.OBJ_MODEL);
                if (!string.IsNullOrEmpty(pack.chestName))
                {
                    SetModel(root, UI.OBJ_MODEL, pack.chestName);
                }
                SetActive(GetChildSafe(root, UI.OBJ_OFFER, productData.offerType - 1), true);
                if (productData.remainingDay > 0)
                {
                    SetButtonEnabled(root, UI.BTN_BUY, false);
                    SetActive(root, UI.LBL_BUNDLE_PRICE, false);
                    SetActive(root, UI.LBL_DAY_LEFT, true);
                    SetLabelText(root, UI.LBL_DAY_LEFT, (productData.remainingDay <= 1) ? string.Format(base.sectionData.GetText("DAY_LEFT"), productData.remainingDay) : string.Format(base.sectionData.GetText("DAYS_LEFT"), productData.remainingDay));
                }
                else
                {
                    SetButtonEnabled(root, UI.BTN_BUY, true);
                    SetActive(root, UI.LBL_BUNDLE_PRICE, true);
                    SetActive(root, UI.LBL_DAY_LEFT, false);
                }
                SetLabelText(root, UI.LBL_BUNDLE_PRICE, string.Format(base.sectionData.GetText("PRICE"), productData.priceIncludeTax));
                if (_nativeStoreList != null)
                {
                    StoreData product = _nativeStoreList.getProduct(productData.productId);
                    if (product != null)
                    {
                        SetLabelText(root, UI.LBL_BUNDLE_PRICE, product.price.ToString());
                    }
                }
            }
            SetLabelText(UI.LBL_CURRENT, (_purchaseBundleList.Count <= 0) ? _currentPageIndex : (_currentPageIndex + 1));
            SetLabelText(UI.LBL_TOTAL, _purchaseBundleList.Count);
            bool flag  = _currentPageIndex > 0;
            bool flag2 = _currentPageIndex < _purchaseBundleList.Count - 1;
            SetColor((Enum)UI.SPR_AIM_L, (!flag) ? Color.get_clear() : Color.get_white());
            SetColor((Enum)UI.SPR_AIM_R, (!flag2) ? Color.get_clear() : Color.get_white());
            SetButtonEnabled((Enum)UI.BTN_AIM_L, flag);
            SetButtonEnabled((Enum)UI.BTN_AIM_R, flag2);
            SetActive((Enum)UI.BTN_AIM_L_INACTIVE, !flag);
            SetActive((Enum)UI.BTN_AIM_R_INACTIVE, !flag2);
            SetRepeatButton((Enum)UI.BTN_AIM_L, "AIM_L", (object)null);
            SetRepeatButton((Enum)UI.BTN_AIM_R, "AIM_R", (object)null);
            _updateNPC();
        }
    }