// Token: 0x060132C9 RID: 78537 RVA: 0x004E2CFC File Offset: 0x004E0EFC
        public void SetHeroSkinItemInfo(FixedStoreItem fixedStoreItem)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetHeroSkinItemInfoFixedStoreItem_hotfix != null)
            {
                this.m_SetHeroSkinItemInfoFixedStoreItem_hotfix.call(new object[]
                {
                    this,
                    fixedStoreItem
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(fixedStoreItem.Id);

            if (configDataFixedStoreItemInfo != null && configDataFixedStoreItemInfo.ItemType == GoodsType.GoodsType_HeroSkin)
            {
                this.m_storeItemConfig = configDataFixedStoreItemInfo;
                this.m_storeType       = StoreType.StoreType_Static;
                ConfigDataHeroSkinInfo configDataHeroSkinInfo = this.m_configDataLoader.GetConfigDataHeroSkinInfo(this.m_storeItemConfig.ItemId);
                ConfigDataCharImageSkinResourceInfo configDataCharImageSkinResourceInfo = this.m_configDataLoader.GetConfigDataCharImageSkinResourceInfo(configDataHeroSkinInfo.CharImageSkinResource_ID);
                this.m_heroSkinIcon.sprite = AssetUtility.Instance.GetSprite(configDataCharImageSkinResourceInfo.Image);
                ConfigDataHeroInfo configDataHeroInfo = this.m_configDataLoader.GetConfigDataHeroInfo(configDataHeroSkinInfo.SpecifiedHero);
                this.m_heroName.text  = configDataHeroInfo.Name;
                this.m_skinName.text  = this.m_storeItemConfig.Name;
                this.m_priceText.text = this.m_storeItemConfig.NormalPrice.ToString();
                this.SetItemState();
                base.gameObject.SetActive(true);
            }
        }
        // Token: 0x06006F6F RID: 28527 RVA: 0x001F2C18 File Offset: 0x001F0E18
        public int CanBuyGoods(int storeId, int goodsId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanBuyGoodsInt32Int32_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanBuyGoodsInt32Int32_hotfix.call(new object[]
                {
                    this,
                    storeId,
                    goodsId2
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            int goodsId = goodsId2;
            Dictionary <int, FixedStoreInfo> stores = this.m_configDataLoader.FixedStoreData.Stores;

            if (!stores.ContainsKey(storeId))
            {
                return(-1300);
            }
            if (!stores[storeId].StoreItems.ContainsKey(goodsId))
            {
                return(-1301);
            }
            FixedStoreItem item       = null;
            FixedStore     fixedStore = this.FindStoreById(storeId);

            if (fixedStore != null)
            {
                item = fixedStore.Items.Find((FixedStoreItem t) => t.Id == goodsId);
            }
            ConfigDataFixedStoreItemInfo itemConfig = this.m_configDataLoader.FixedStoreData.Stores[storeId].StoreItems[goodsId];

            return(base.CanBuyFixedStoreItem(itemConfig, item));
        }
        // Token: 0x06004055 RID: 16469 RVA: 0x0012B80C File Offset: 0x00129A0C
        private void OnFlushBoughtNums()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnFlushBoughtNums_hotfix != null)
            {
                this.m_OnFlushBoughtNums_hotfix.call(new object[]
                {
                    this
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            DateTime currentTime = this.m_basicInfo.GetCurrentTime();

            foreach (KeyValuePair <int, FixedStore> keyValuePair in this.m_fixedStoreDS.Stores)
            {
                foreach (FixedStoreItem fixedStoreItem in keyValuePair.Value.Items)
                {
                    ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(fixedStoreItem.Id);
                    if (configDataFixedStoreItemInfo != null && fixedStoreItem.NextFlushTime <= currentTime.Ticks)
                    {
                        fixedStoreItem.BoughtCount   = 0;
                        fixedStoreItem.NextFlushTime = GoodsNextFlushCaculateTools.CaculateNextFlushTime(configDataFixedStoreItemInfo.BuyLimitType, configDataFixedStoreItemInfo.Param, currentTime, fixedStoreItem.NextFlushTime).Ticks;
                        this.m_fixedStoreDS.SetDirty(true);
                    }
                }
            }
        }
Esempio n. 4
0
 // Token: 0x0601369D RID: 79517 RVA: 0x004F2988 File Offset: 0x004F0B88
 public void UpdateSoldierSkinDetailPanelBySoldierSkinConfigInfo(ConfigDataSoldierSkinInfo skinConfigInfo, bool isNeedBuy)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_UpdateSoldierSkinDetailPanelBySoldierSkinConfigInfoConfigDataSoldierSkinInfoBoolean_hotfix != null)
     {
         this.m_UpdateSoldierSkinDetailPanelBySoldierSkinConfigInfoConfigDataSoldierSkinInfoBoolean_hotfix.call(new object[]
         {
             this,
             skinConfigInfo,
             isNeedBuy
         });
         return;
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     if (skinConfigInfo != null)
     {
         IConfigDataLoader configDataLoader = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
         this.m_nameText.text = skinConfigInfo.Name;
         if (isNeedBuy)
         {
             ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = configDataLoader.GetConfigDataFixedStoreItemInfo(skinConfigInfo.FixedStoreItemId);
             if (configDataFixedStoreItemInfo != null)
             {
                 this.m_priceText.text = configDataFixedStoreItemInfo.NormalPrice.ToString();
             }
         }
         this.SetSoldierDefaultAndSkinItemInfo(skinConfigInfo.Name, skinConfigInfo.SpecifiedSoldier);
         this.SetPanelBuyButtonState(isNeedBuy);
     }
 }
        // Token: 0x06004060 RID: 16480 RVA: 0x0012C478 File Offset: 0x0012A678
        private void OnAddSkin(FixedStoreItem storeItem)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnAddSkinFixedStoreItem_hotfix != null)
            {
                this.m_OnAddSkinFixedStoreItem_hotfix.call(new object[]
                {
                    this,
                    storeItem
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(storeItem.Id);
            StoreId storeID = configDataFixedStoreItemInfo.StoreID;

            if (storeID != StoreId.StoreId_SkinHero)
            {
                if (storeID == StoreId.StoreId_SkinSoldier)
                {
                    this.m_resource.AddSoldierSkin(configDataFixedStoreItemInfo.ItemId, GameFunctionType.GameFunctionType_None, null);
                }
            }
            else
            {
                this.m_resource.AddHeroSkin(configDataFixedStoreItemInfo.ItemId, GameFunctionType.GameFunctionType_None, null);
            }
        }
Esempio n. 6
0
        // Token: 0x06013734 RID: 79668 RVA: 0x004F4BAC File Offset: 0x004F2DAC
        public void SetSoldierSkinItemInfo(FixedStoreItem soldierSkinItem)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetSoldierSkinItemInfoFixedStoreItem_hotfix != null)
            {
                this.m_SetSoldierSkinItemInfoFixedStoreItem_hotfix.call(new object[]
                {
                    this,
                    soldierSkinItem
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(soldierSkinItem.Id);

            if (configDataFixedStoreItemInfo != null && configDataFixedStoreItemInfo.ItemType == GoodsType.GoodsType_SoldierSkin)
            {
                this.m_storeItemConfig = configDataFixedStoreItemInfo;
                this.m_storeType       = StoreType.StoreType_Static;
                ConfigDataSoldierSkinInfo configDataSoldierSkinInfo = this.m_configDataLoader.GetConfigDataSoldierSkinInfo(this.m_storeItemConfig.ItemId);
                this.m_soldierName.text = this.m_storeItemConfig.Name;
                this.m_priceText.text   = this.m_storeItemConfig.NormalPrice.ToString();
                this.SetSoldierSpineAnim(configDataSoldierSkinInfo);
                this.SetItemState();
                base.gameObject.SetActive(true);
            }
        }
Esempio n. 7
0
        // Token: 0x0600F9FC RID: 63996 RVA: 0x0041CA6C File Offset: 0x0041AC6C
        private Goods GetSelfChooseGoods(int fixedStoreItemId, int selfChooseIndex)
        {
            ConfigDataFixedStoreItemInfo  configDataFixedStoreItemInfo  = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(fixedStoreItemId);
            ConfigDataItemInfo            configDataItemInfo            = this.m_configDataLoader.GetConfigDataItemInfo(configDataFixedStoreItemInfo.ItemId);
            ConfigDataSelfSelectedBoxInfo configDataSelfSelectedBoxInfo = this.m_configDataLoader.GetConfigDataSelfSelectedBoxInfo(configDataItemInfo.FuncTypeParam1);

            return(configDataSelfSelectedBoxInfo.Reward[selfChooseIndex]);
        }
Esempio n. 8
0
        // Token: 0x0600F9FF RID: 63999 RVA: 0x0041CB28 File Offset: 0x0041AD28
        public void OnBuyItemClick()
        {
            int num = this.m_playerContext.CanBuyFixedStoreGoods((int)this.m_storeId, this.m_fixedStoreItemId, this.m_selfChooseIndex);

            if (num == 0)
            {
                FixedStoreBuyStoreItemNetTask fixedStoreBuyStoreItemNetTask = new FixedStoreBuyStoreItemNetTask((int)this.m_storeId, this.m_fixedStoreItemId, this.m_selfChooseIndex);
                fixedStoreBuyStoreItemNetTask.EventOnStop += delegate(Task task)
                {
                    FixedStoreBuyStoreItemNetTask fixedStoreBuyStoreItemNetTask2 = task as FixedStoreBuyStoreItemNetTask;
                    if (fixedStoreBuyStoreItemNetTask2.Result == 0)
                    {
                        ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(this.m_fixedStoreItemId);
                        ConfigDataItemInfo           configDataItemInfo           = this.m_configDataLoader.GetConfigDataItemInfo(configDataFixedStoreItemInfo.ItemId);
                        if (configDataItemInfo != null && (configDataItemInfo.FuncType == ItemFuncType.ItemFuncType_StaticBox || configDataItemInfo.FuncType == ItemFuncType.ItemFuncType_RandomBox))
                        {
                            this.HandleBoxOpenNetTask(GoodsType.GoodsType_Item, configDataFixedStoreItemInfo.ItemId, 1, delegate(List <Goods> goods)
                            {
                                GetRewardGoodsUITask.StartUITask(goods);
                                if (this.EventOnBuySuccess != null)
                                {
                                    this.EventOnBuySuccess();
                                }
                            }, delegate
                            {
                            });
                        }
                        else
                        {
                            List <Goods> storeGoods = this.GetStoreGoods(this.m_fixedStoreItemId, this.m_selfChooseIndex);
                            GetRewardGoodsUITask.StartUITask(storeGoods);
                            if (this.EventOnBuySuccess != null)
                            {
                                this.EventOnBuySuccess();
                            }
                        }
                    }
                    else
                    {
                        CommonUIController.Instance.ShowErrorMessage(fixedStoreBuyStoreItemNetTask2.Result, 2f, null, true);
                    }
                };
                fixedStoreBuyStoreItemNetTask.Start(null);
            }
            else if (num == -500)
            {
                BagFullUITask.StartUITask(this.m_normalItemBuyUITask.CurrentIntent);
            }
            else if (num == -401)
            {
                this.StoreUIController_CrystalNotEnough();
            }
            else
            {
                CommonUIController.Instance.ShowErrorMessage(num, 2f, null, true);
            }
        }
        // Token: 0x0600405C RID: 16476 RVA: 0x0012BF5C File Offset: 0x0012A15C
        public FixedStore GetStore(int storeId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_GetStoreInt32_hotfix != null)
            {
                return((FixedStore)this.m_GetStoreInt32_hotfix.call(new object[]
                {
                    this,
                    storeId
                }));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            FixedStore storeOfferingById = this.GetStoreOfferingById(storeId);

            if (storeOfferingById == null)
            {
                return(null);
            }
            FixedStore fixedStore = this.m_fixedStoreDS.FindStore(storeId);

            if (fixedStore == null)
            {
                return(storeOfferingById);
            }
            DateTime currentTime = this.m_basicInfo.GetCurrentTime();

            using (List <FixedStoreItem> .Enumerator enumerator = fixedStore.Items.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    FixedStoreItem localStoreItem = enumerator.Current;
                    FixedStoreItem fixedStoreItem = storeOfferingById.Items.Find((FixedStoreItem t) => t.Id == localStoreItem.Id);
                    if (fixedStoreItem != null)
                    {
                        ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(fixedStoreItem.Id);
                        if (new DateTime(localStoreItem.NextFlushTime) == DateTime.MaxValue && configDataFixedStoreItemInfo.Count != 0 && localStoreItem.BoughtCount >= configDataFixedStoreItemInfo.Count)
                        {
                            storeOfferingById.Items.Remove(fixedStoreItem);
                        }
                        else
                        {
                            if (new DateTime(localStoreItem.NextFlushTime) > this.m_basicInfo.GetCurrentTime())
                            {
                                fixedStoreItem.BoughtCount   = localStoreItem.BoughtCount;
                                fixedStoreItem.NextFlushTime = localStoreItem.NextFlushTime;
                            }
                            else
                            {
                                fixedStoreItem.NextFlushTime = GoodsNextFlushCaculateTools.CaculateNextFlushTime(configDataFixedStoreItemInfo.BuyLimitType, configDataFixedStoreItemInfo.Param, currentTime, localStoreItem.NextFlushTime).Ticks;
                            }
                            fixedStoreItem.IsFirstBuy = localStoreItem.IsFirstBuy;
                        }
                    }
                }
            }
            return(storeOfferingById);
        }
Esempio n. 10
0
        // Token: 0x0600F9F7 RID: 63991 RVA: 0x0041C684 File Offset: 0x0041A884
        public void SetFiexdStoreSelfChooseItemBuyPanel(StoreId storeId, int fixedStoreItemId, int selfChooseIndex)
        {
            this.m_storeId          = storeId;
            this.m_fixedStoreItemId = fixedStoreItemId;
            this.m_selfChooseIndex  = selfChooseIndex;
            ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(fixedStoreItemId);
            Goods selfChooseGoods = this.GetSelfChooseGoods(fixedStoreItemId, selfChooseIndex);

            this.SetFiexdStoreBuyPanel(selfChooseGoods, configDataFixedStoreItemInfo.CurrencyType, configDataFixedStoreItemInfo.NormalPrice);
        }
        // Token: 0x0601126F RID: 70255 RVA: 0x00473148 File Offset: 0x00471348
        public void SetLimitTime()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetLimitTime_hotfix != null)
            {
                this.m_SetLimitTime_hotfix.call(new object[]
                {
                    this
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (this.IsDefaultSkin)
            {
                this.m_timeGo.SetActive(false);
                return;
            }
            IConfigDataLoader     configDataLoader      = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
            ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;

            if (projectLPlayerContext.HasOwn(GoodsType.GoodsType_HeroSkin, this.HeroSkinInfo.ID))
            {
                this.m_timeGo.SetActive(false);
                return;
            }
            ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = configDataLoader.GetConfigDataFixedStoreItemInfo(this.HeroSkinInfo.FixedStoreItemId);

            if (configDataFixedStoreItemInfo == null)
            {
                return;
            }
            DateTime dateTime = DateTime.Parse(configDataFixedStoreItemInfo.ShowEndTime);

            if (dateTime == DateTime.Parse(DateTime.MaxValue.ToString()))
            {
                this.m_timeGo.SetActive(false);
                return;
            }
            DateTime serverTime = projectLPlayerContext.GetServerTime();
            TimeSpan timeSpan   = dateTime - serverTime;

            if (timeSpan.Days >= 1)
            {
                string arg = configDataLoader.UtilityGetStringByStringTable(StringTableId.StringTableId_Time_Day);
                this.m_timeValueText.text = timeSpan.Days + arg;
            }
            else
            {
                this.m_timeValueText.text = UIUtility.TimeSpanToString2(timeSpan);
            }
            DateTime t = DateTime.Parse(configDataFixedStoreItemInfo.ShowStartTime);

            this.m_timeGo.SetActive(dateTime > serverTime && t < serverTime);
        }
Esempio n. 12
0
        // Token: 0x0600F9F6 RID: 63990 RVA: 0x0041C40C File Offset: 0x0041A60C
        private void SetFiexdStoreItemBuyPanel(StoreId storeId, int fixedStoreItemId)
        {
            this.m_storeId          = storeId;
            this.m_fixedStoreItemId = fixedStoreItemId;
            ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(fixedStoreItemId);

            this.m_itemIconImage.sprite   = AssetUtility.Instance.GetSprite(UIUtility.GetGoodsIconName(configDataFixedStoreItemInfo.ItemType, configDataFixedStoreItemInfo.ItemId));
            this.m_itemIconImage.material = AssetUtility.Instance.GetAsset <Material>(UIUtility.GetGoodsIconMaterialName(configDataFixedStoreItemInfo.ItemType, configDataFixedStoreItemInfo.ItemId));
            this.m_itemNameText.text      = UIUtility.GetGoodsName(configDataFixedStoreItemInfo.ItemType, configDataFixedStoreItemInfo.ItemId);
            this.m_itemPriceIcon.sprite   = AssetUtility.Instance.GetSprite(UIUtility.GetGoodsIconName(configDataFixedStoreItemInfo.CurrencyType, -1));
            if (configDataFixedStoreItemInfo.CurrencyType == GoodsType.GoodsType_Crystal)
            {
                this.m_itemPriceIconEffectGameObject.SetActive(true);
            }
            this.m_itemPriceText.text = configDataFixedStoreItemInfo.NormalPrice.ToString();
            this.SetEnchantStoneResonanceInfoPanel(configDataFixedStoreItemInfo.ItemType, configDataFixedStoreItemInfo.ItemId);
            if (configDataFixedStoreItemInfo.ItemType == GoodsType.GoodsType_Crystal || configDataFixedStoreItemInfo.ItemType == GoodsType.GoodsType_Gold || configDataFixedStoreItemInfo.ItemType == GoodsType.GoodsType_ArenaHonour)
            {
                this.m_itemGoodCountObj.SetActive(false);
            }
            else if (configDataFixedStoreItemInfo.ItemType == GoodsType.GoodsType_Equipment)
            {
                this.m_itemHaveCountText.text = this.m_playerContext.GetBagItemCountByTypeAndID(configDataFixedStoreItemInfo.ItemType, configDataFixedStoreItemInfo.ItemId).ToString();
                this.m_itemGoodCountObj.SetActive(true);
            }
            else
            {
                this.m_itemHaveCountText.text = UIUtility.GetGoodsCount(configDataFixedStoreItemInfo.ItemType, configDataFixedStoreItemInfo.ItemId).ToString();
                this.m_itemGoodCountObj.SetActive(true);
            }
            this.m_itemDescText.text = UIUtility.GetGoodsDesc(configDataFixedStoreItemInfo.ItemType, configDataFixedStoreItemInfo.ItemId);
            bool flag = UIUtility.GoodTypeHaveID(configDataFixedStoreItemInfo.ItemType);

            if (flag)
            {
                if (Convert.ToInt32(configDataFixedStoreItemInfo.Nums) > 1)
                {
                    this.m_itemCountText.text = configDataFixedStoreItemInfo.Nums.ToString();
                    this.m_itemCountText.gameObject.SetActive(true);
                    this.m_itemCountBgGo.SetActive(true);
                }
                else
                {
                    this.m_itemCountText.gameObject.SetActive(false);
                    this.m_itemCountBgGo.SetActive(false);
                }
            }
            else
            {
                this.m_itemCountText.gameObject.SetActive(false);
                this.m_itemCountBgGo.SetActive(false);
            }
        }
 // Token: 0x06004057 RID: 16471 RVA: 0x0012BA2C File Offset: 0x00129C2C
 public bool IsInSaleTime(ConfigDataFixedStoreItemInfo itemConfig)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_IsInSaleTimeConfigDataFixedStoreItemInfo_hotfix != null)
     {
         return(Convert.ToBoolean(this.m_IsInSaleTimeConfigDataFixedStoreItemInfo_hotfix.call(new object[]
         {
             this,
             itemConfig
         })));
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     return(!(DateTime.Parse(itemConfig.ShowEndTime) <= this.m_basicInfo.GetCurrentTime()) && !(this.m_basicInfo.GetCurrentTime() < DateTime.Parse(itemConfig.ShowStartTime)));
 }
Esempio n. 14
0
        // Token: 0x0600F9F5 RID: 63989 RVA: 0x0041C3B0 File Offset: 0x0041A5B0
        public void ShowSelfChooseITemBuyPlane(StoreId storeId, int fixedStoreItemId, int selfChooseIndex)
        {
            this.SetFiexdStoreSelfChooseItemBuyPanel(storeId, fixedStoreItemId, selfChooseIndex);
            ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(fixedStoreItemId);

            if (configDataFixedStoreItemInfo.ItemType == GoodsType.GoodsType_EnchantStone)
            {
                UIUtility.SetUIStateOpen(this.m_itemBuyPanelUIStateController, "ResonanceInfoShow", null, false, true);
            }
            else
            {
                UIUtility.SetUIStateOpen(this.m_itemBuyPanelUIStateController, "Show", null, false, true);
            }
        }
Esempio n. 15
0
        // Token: 0x0600FA1B RID: 64027 RVA: 0x0041D2B8 File Offset: 0x0041B4B8
        public void SetSelfChooseItemBuyPlane(StoreId storeId, int fixedStoreItemId)
        {
            this.m_storeId          = storeId;
            this.m_fixedStoreItemId = fixedStoreItemId;
            ConfigDataFixedStoreItemInfo  configDataFixedStoreItemInfo  = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(fixedStoreItemId);
            ConfigDataItemInfo            configDataItemInfo            = this.m_configDataLoader.GetConfigDataItemInfo(configDataFixedStoreItemInfo.ItemId);
            ConfigDataSelfSelectedBoxInfo configDataSelfSelectedBoxInfo = this.m_configDataLoader.GetConfigDataSelfSelectedBoxInfo(configDataItemInfo.FuncTypeParam1);

            foreach (Goods g in configDataSelfSelectedBoxInfo.Reward)
            {
                GoodsUIController item = GoodsUIController.CreateRewardGoods(g, this.m_content, this.m_itemTemplate, true, new Action <GoodsUIController>(this.OnGoodsClick));
                this.m_goodUIControllerList.Add(item);
            }
        }
 // Token: 0x06004056 RID: 16470 RVA: 0x0012B980 File Offset: 0x00129B80
 public bool IsSoldOut(ConfigDataFixedStoreItemInfo itemConfig, FixedStoreItem item)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_IsSoldOutConfigDataFixedStoreItemInfoFixedStoreItem_hotfix != null)
     {
         return(Convert.ToBoolean(this.m_IsSoldOutConfigDataFixedStoreItemInfoFixedStoreItem_hotfix.call(new object[]
         {
             this,
             itemConfig,
             item
         })));
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     return(itemConfig.Count != 0 && item.BoughtCount >= itemConfig.Count);
 }
        // Token: 0x0600405B RID: 16475 RVA: 0x0012BEA8 File Offset: 0x0012A0A8
        public bool IsOnDiscountPeriod(ConfigDataFixedStoreItemInfo storeItemConfig)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_IsOnDiscountPeriodConfigDataFixedStoreItemInfo_hotfix != null)
            {
                return(Convert.ToBoolean(this.m_IsOnDiscountPeriodConfigDataFixedStoreItemInfo_hotfix.call(new object[]
                {
                    this,
                    storeItemConfig
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            DateTime currentTime = this.m_basicInfo.GetCurrentTime();

            return(currentTime >= DateTime.Parse(storeItemConfig.DiscountStartTime) && currentTime < DateTime.Parse(storeItemConfig.DiscountEndTime));
        }
        // Token: 0x06006F70 RID: 28528 RVA: 0x001F2D50 File Offset: 0x001F0F50
        public void BuyStoreItem(int storeId, int goodsId, long nextFlushTime, bool isReseted)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_BuyStoreItemInt32Int32Int64Boolean_hotfix != null)
            {
                this.m_BuyStoreItemInt32Int32Int64Boolean_hotfix.call(new object[]
                {
                    this,
                    storeId,
                    goodsId2,
                    nextFlushTime,
                    isReseted
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            int        goodsId    = goodsId2;
            FixedStore fixedStore = this.m_fixedStoreDS.FindStore(storeId);

            if (fixedStore == null)
            {
                fixedStore    = new FixedStore();
                fixedStore.Id = storeId;
                this.m_fixedStoreDS.AddStore(fixedStore);
            }
            ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.FixedStoreData.Stores[storeId].StoreItems[goodsId];
            FixedStoreItem fixedStoreItem = fixedStore.Items.Find((FixedStoreItem t) => t.Id == goodsId);

            if (fixedStoreItem == null)
            {
                fixedStoreItem             = new FixedStoreItem();
                fixedStoreItem.Id          = goodsId;
                fixedStoreItem.IsFirstBuy  = true;
                fixedStoreItem.BoughtCount = 0;
                fixedStore.Items.Add(fixedStoreItem);
            }
            int num = base.CaculateCurrencyCount(configDataFixedStoreItemInfo, fixedStoreItem.IsFirstBuy);

            this.m_basicInfo.AddCurrency(configDataFixedStoreItemInfo.CurrencyType, -num, GameFunctionType.GameFunctionType_None, null);
            fixedStoreItem.NextFlushTime = nextFlushTime;
            if (isReseted)
            {
                fixedStoreItem.BoughtCount = 0;
            }
            base.BuyStoreItem(storeId, fixedStoreItem, 1);
        }
        // Token: 0x06004059 RID: 16473 RVA: 0x0012BCBC File Offset: 0x00129EBC
        protected int CanBuyFixedStoreItem(ConfigDataFixedStoreItemInfo itemConfig, FixedStoreItem item)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanBuyFixedStoreItemConfigDataFixedStoreItemInfoFixedStoreItem_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanBuyFixedStoreItemConfigDataFixedStoreItemInfoFixedStoreItem_hotfix.call(new object[]
                {
                    this,
                    itemConfig,
                    item
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (!this.IsInSaleTime(itemConfig))
            {
                return(-1303);
            }
            bool isFirstBuy;

            if (item == null)
            {
                isFirstBuy = true;
            }
            else
            {
                isFirstBuy = this.m_fixedStoreDS.IsFirstBuy(item);
                if (new DateTime(item.NextFlushTime) > this.m_basicInfo.GetCurrentTime() && this.IsSoldOut(itemConfig, item))
                {
                    return(-1302);
                }
            }
            int consumeNums = this.CaculateCurrencyCount(itemConfig, isFirstBuy);
            int num         = this.m_basicInfo.IsCurrencyEnough(itemConfig.CurrencyType, consumeNums);

            if (num != 0)
            {
                return(num);
            }
            if (BagItemBase.IsBagItem(itemConfig.ItemType) && this.m_bag.IsBagFullByCurrentSize())
            {
                return(-500);
            }
            return(0);
        }
 // Token: 0x0600405A RID: 16474 RVA: 0x0012BDF4 File Offset: 0x00129FF4
 public int CaculateCurrencyCount(ConfigDataFixedStoreItemInfo storeItemConfig, bool isFirstBuy)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CaculateCurrencyCountConfigDataFixedStoreItemInfoBoolean_hotfix != null)
     {
         return(Convert.ToInt32(this.m_CaculateCurrencyCountConfigDataFixedStoreItemInfoBoolean_hotfix.call(new object[]
         {
             this,
             storeItemConfig,
             isFirstBuy
         })));
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     if (isFirstBuy)
     {
         return(storeItemConfig.FirstPrice);
     }
     if (this.IsOnDiscountPeriod(storeItemConfig))
     {
         return(storeItemConfig.DiscountPrice);
     }
     return(storeItemConfig.NormalPrice);
 }
Esempio n. 21
0
        // Token: 0x0600F9FB RID: 63995 RVA: 0x0041C9D8 File Offset: 0x0041ABD8
        private List <Goods> GetStoreGoods(int fixedStoreItemId, int selfChooseIndex)
        {
            ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(fixedStoreItemId);
            List <Goods> list = new List <Goods>();

            if (configDataFixedStoreItemInfo.ItemType == GoodsType.GoodsType_Item)
            {
                ConfigDataItemInfo configDataItemInfo = this.m_configDataLoader.GetConfigDataItemInfo(configDataFixedStoreItemInfo.ItemId);
                if (configDataItemInfo.FuncType == ItemFuncType.ItemFuncType_SelfSelectedBox)
                {
                    Goods selfChooseGoods = this.GetSelfChooseGoods(fixedStoreItemId, selfChooseIndex);
                    list.Add(selfChooseGoods);
                    return(list);
                }
            }
            list.Add(new Goods
            {
                GoodsType = configDataFixedStoreItemInfo.ItemType,
                Id        = configDataFixedStoreItemInfo.ItemId,
                Count     = configDataFixedStoreItemInfo.Nums
            });
            return(list);
        }
Esempio n. 22
0
        // Token: 0x0600FA0E RID: 64014 RVA: 0x0041CFDC File Offset: 0x0041B1DC
        protected override void InitAllUIControllers()
        {
            base.InitAllUIControllers();
            this.m_configDataLoader = (GameManager.Instance.ConfigDataLoader as IConfigDataLoader);
            this.m_playerContext    = (GameManager.Instance.PlayerContext as ProjectLPlayerContext);
            this.m_itemSelfChooseBuyUIController = (this.m_uiCtrlArray[0] as NormalItemSelfChooseBuyUIController);
            this.m_itemSelfChooseBuyUIController.Init(this);
            this.m_normalItemBuyUIController = (this.m_uiCtrlArray[1] as NormalItemBuyUIController);
            this.m_normalItemBuyUIController.Init(this);
            UIIntentCustom uiintentCustom = this.m_currIntent as UIIntentCustom;
            StoreId        structParam    = uiintentCustom.GetStructParam <StoreId>("storeId");
            int            structParam2   = uiintentCustom.GetStructParam <int>("fixedStoreItemId");
            ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(structParam2);

            if (configDataFixedStoreItemInfo.ItemType == GoodsType.GoodsType_Item)
            {
                ConfigDataItemInfo configDataItemInfo = this.m_configDataLoader.GetConfigDataItemInfo(configDataFixedStoreItemInfo.ItemId);
                if (configDataItemInfo.FuncType == ItemFuncType.ItemFuncType_SelfSelectedBox)
                {
                    this.m_normalItemBuyUIController.gameObject.SetActive(false);
                    this.m_itemSelfChooseBuyUIController.SetSelfChooseItemBuyPlane(structParam, structParam2);
                }
                else
                {
                    this.m_normalItemBuyUIController.ShowItemBuyPanel(structParam, structParam2);
                    this.m_itemSelfChooseBuyUIController.gameObject.SetActive(false);
                }
            }
            else
            {
                this.m_normalItemBuyUIController.ShowItemBuyPanel(structParam, structParam2);
                this.m_itemSelfChooseBuyUIController.gameObject.SetActive(false);
            }
            this.m_normalItemBuyUIController.EventOnBuySuccess        += this.OnBuyItemSuccess;
            this.m_itemSelfChooseBuyUIController.EventOnSelfBoxChoose += this.OnSelfBoxChoose;
        }
        // Token: 0x060136DC RID: 79580 RVA: 0x004F3C08 File Offset: 0x004F1E08
        protected override void UpdateView()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_UpdateView_hotfix != null)
            {
                this.m_UpdateView_hotfix.call(new object[]
                {
                    this
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            IConfigDataLoader         configDataLoader          = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
            ConfigDataSoldierSkinInfo configDataSoldierSkinInfo = configDataLoader.GetConfigDataSoldierSkinInfo(this.m_soldierSkinConfigId);

            switch (this.m_startFormType)
            {
            case StoreSoldierSkinDetailUITask.StartTaskFromType.StartTaskFromGift:
                this.m_soldierSkinDetailPanelCtrl.UpdateSoldierSkinDetailPanelBySoldierSkinConfigInfo(configDataSoldierSkinInfo, false);
                break;

            case StoreSoldierSkinDetailUITask.StartTaskFromType.StartTaskFromHeroDetail:
                this.m_soldierSkinDetailPanelCtrl.UpdateSoldierSkinDetailPanelBySoldierSkinConfigInfo(configDataSoldierSkinInfo, true);
                break;

            case StoreSoldierSkinDetailUITask.StartTaskFromType.StartTaskFromStore:
            {
                ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = configDataLoader.GetConfigDataFixedStoreItemInfo(configDataSoldierSkinInfo.FixedStoreItemId);
                this.m_soldierSkinDetailPanelCtrl.UpdateSoldierSkinDetailPanelByFixedStoreItemConfigInfo(configDataFixedStoreItemInfo, true);
                break;
            }
            }
            if (this.m_currPipeLineCtx.m_isInitPipeLine || this.m_currPipeLineCtx.m_isTaskResume)
            {
                this.m_soldierSkinDetailPanelCtrl.PlayPanelOpenAnim();
            }
        }
        // Token: 0x0601126A RID: 70250 RVA: 0x00472CA8 File Offset: 0x00470EA8
        public void SetHeroCharSkinItem(int heroSkinId, int index, ConfigDataHeroInfo heroInfo, int heroCurSkinId, string mode)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetHeroCharSkinItemInt32Int32ConfigDataHeroInfoInt32String_hotfix != null)
            {
                this.m_SetHeroCharSkinItemInt32Int32ConfigDataHeroInfoInt32String_hotfix.call(new object[]
                {
                    this,
                    heroSkinId,
                    index,
                    heroInfo,
                    heroCurSkinId,
                    mode
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            this.HeroInfo      = heroInfo;
            this.m_index       = index;
            this.IsDefaultSkin = false;
            IConfigDataLoader configDataLoader = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;

            this.HeroSkinInfo = configDataLoader.GetConfigDataHeroSkinInfo(heroSkinId);
            if (this.HeroSkinInfo == null)
            {
                return;
            }
            this.CharSkinInfo = configDataLoader.GetConfigDataCharImageSkinResourceInfo(this.HeroSkinInfo.CharImageSkinResource_ID);
            if (!GameObjectUtility.HasChinese(this.CharSkinInfo.Image))
            {
                this.m_iconImage.sprite = AssetUtility.Instance.GetSprite(this.CharSkinInfo.Image);
            }
            this.m_nameText.text = this.CharSkinInfo.Name;
            ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
            string stateName = null;

            if (projectLPlayerContext.HasOwn(GoodsType.GoodsType_HeroSkin, heroSkinId))
            {
                if (heroCurSkinId != heroSkinId)
                {
                    if (mode != null)
                    {
                        if (!(mode == "ShowOneSkin"))
                        {
                            if (!(mode == "ShowSkinDetailMode"))
                            {
                                if (mode == "SkinBuyMode")
                                {
                                    stateName = "Bought";
                                }
                            }
                            else
                            {
                                stateName = "Got";
                            }
                        }
                        else
                        {
                            stateName = "Normal";
                        }
                    }
                }
                else
                {
                    stateName = "Wear";
                }
                this.m_timeGo.SetActive(false);
            }
            else
            {
                stateName = "Lock";
                ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = configDataLoader.GetConfigDataFixedStoreItemInfo(this.HeroSkinInfo.FixedStoreItemId);
                if (configDataFixedStoreItemInfo != null)
                {
                    this.m_timeGo.SetActive(configDataFixedStoreItemInfo.ShowEndTime != DateTime.MaxValue.ToString());
                }
                else
                {
                    this.m_timeGo.SetActive(false);
                }
            }
            this.m_stateCtrl.SetToUIState(stateName, false, true);
        }
 // Token: 0x06006F90 RID: 28560 RVA: 0x001F3320 File Offset: 0x001F1520
 public bool __callBase_IsOnDiscountPeriod(ConfigDataFixedStoreItemInfo storeItemConfig)
 {
     return(this.m_owner.__callBase_IsOnDiscountPeriod(storeItemConfig));
 }
 // Token: 0x06006F8F RID: 28559 RVA: 0x001F3310 File Offset: 0x001F1510
 public int __callBase_CaculateCurrencyCount(ConfigDataFixedStoreItemInfo storeItemConfig, bool isFirstBuy)
 {
     return(this.m_owner.__callBase_CaculateCurrencyCount(storeItemConfig, isFirstBuy));
 }
 // Token: 0x06006F8E RID: 28558 RVA: 0x001F3300 File Offset: 0x001F1500
 public int __callBase_CanBuyFixedStoreItem(ConfigDataFixedStoreItemInfo itemConfig, FixedStoreItem item)
 {
     return(this.m_owner.__callBase_CanBuyFixedStoreItem(itemConfig, item));
 }
 // Token: 0x06006F8C RID: 28556 RVA: 0x001F32E0 File Offset: 0x001F14E0
 public bool __callBase_IsInSaleTime(ConfigDataFixedStoreItemInfo itemConfig)
 {
     return(this.m_owner.__callBase_IsInSaleTime(itemConfig));
 }
 // Token: 0x06006F8B RID: 28555 RVA: 0x001F32D0 File Offset: 0x001F14D0
 public bool __callBase_IsSoldOut(ConfigDataFixedStoreItemInfo itemConfig, FixedStoreItem item)
 {
     return(this.m_owner.__callBase_IsSoldOut(itemConfig, item));
 }
 // Token: 0x06006F7F RID: 28543 RVA: 0x001F2FF4 File Offset: 0x001F11F4
 private bool __callBase_IsOnDiscountPeriod(ConfigDataFixedStoreItemInfo storeItemConfig)
 {
     return(base.IsOnDiscountPeriod(storeItemConfig));
 }