Example #1
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]);
        }
Example #2
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: 0x06013696 RID: 79510 RVA: 0x004F25C8 File Offset: 0x004F07C8
        public void SetSelfChooseItemID(StoreId storeID, StoreItemUIController storeItemUIController)
        {
            UIUtility.SetUIStateOpen(this.m_uiStateController, "Show", null, false, true);
            foreach (GoodsUIController goodsUIController in this.m_goodUIController)
            {
                UnityEngine.Object.Destroy(goodsUIController.gameObject);
            }
            this.m_goodUIController.Clear();
            this.m_storeItemUIController = storeItemUIController;
            ConfigDataItemInfo            configDataItemInfo            = this.m_configDataLoader.GetConfigDataItemInfo(storeItemUIController.m_goodsID);
            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_goodUIController.Add(item);
            }
        }
        // Token: 0x06004058 RID: 16472 RVA: 0x0012BAEC File Offset: 0x00129CEC
        public virtual int CanBuyGoods(int storeId, int goodsId, int selectedIndex)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanBuyGoodsInt32Int32Int32_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanBuyGoodsInt32Int32Int32_hotfix.call(new object[]
                {
                    this,
                    storeId,
                    goodsId2,
                    selectedIndex
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            int            goodsId = goodsId2;
            FixedStoreInfo fixedStoreInfo;

            if (!this.m_configDataLoader.FixedStoreData.Stores.TryGetValue(storeId, out fixedStoreInfo))
            {
                return(-1300);
            }
            ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo;

            if (!fixedStoreInfo.StoreItems.TryGetValue(goodsId, out configDataFixedStoreItemInfo))
            {
                return(-1301);
            }
            if (configDataFixedStoreItemInfo.ItemType == GoodsType.GoodsType_Item)
            {
                ConfigDataItemInfo configDataItemInfo = this.m_configDataLoader.GetConfigDataItemInfo(configDataFixedStoreItemInfo.ItemId);
                if (configDataItemInfo.FuncType == ItemFuncType.ItemFuncType_SelfSelectedBox)
                {
                    ConfigDataSelfSelectedBoxInfo configDataSelfSelectedBoxInfo = this.m_configDataLoader.GetConfigDataSelfSelectedBoxInfo(configDataItemInfo.FuncTypeParam1);
                    if (configDataSelfSelectedBoxInfo.Reward.Count <= selectedIndex || selectedIndex < 0)
                    {
                        return(-539);
                    }
                }
                else if (selectedIndex != -1)
                {
                    return(-540);
                }
            }
            else
            {
                if (configDataFixedStoreItemInfo.ItemType == GoodsType.GoodsType_Gold && this.m_basicInfo.IsGoldOverFlow(configDataFixedStoreItemInfo.Nums))
                {
                    return(-422);
                }
                if (selectedIndex != -1)
                {
                    return(-540);
                }
            }
            FixedStoreItem item       = null;
            FixedStore     fixedStore = this.m_fixedStoreDS.FindStore(storeId);

            if (fixedStore != null)
            {
                item = fixedStore.Items.Find((FixedStoreItem t) => t.Id == goodsId);
            }
            return(this.CanBuyFixedStoreItem(configDataFixedStoreItemInfo, item));
        }
Example #5
0
        // Token: 0x06004764 RID: 18276 RVA: 0x00160280 File Offset: 0x0015E480
        public virtual int CanBuyRandomStoreItem(int storeId, int index, int selectedIndex)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanBuyRandomStoreItemInt32Int32Int32_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanBuyRandomStoreItemInt32Int32Int32_hotfix.call(new object[]
                {
                    this,
                    storeId,
                    index,
                    selectedIndex
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            RandomStore randomStore = this.m_randomStoreDS.FindStore(storeId);

            if (randomStore == null)
            {
                return(-1100);
            }
            if (index < 0 || index >= randomStore.Items.Count)
            {
                return(-1101);
            }
            RandomStoreItem storeItem = this.m_randomStoreDS.GetStoreItem(randomStore, index);

            if (this.IsBoughtStoreItem(storeItem))
            {
                return(-1102);
            }
            ConfigDataRandomStoreItemInfo configDataRandomStoreItemInfo = this.m_configDataLoader.GetConfigDataRandomStoreItemInfo(storeItem.Id);
            int num = this.m_basicInfo.IsCurrencyEnough(configDataRandomStoreItemInfo.CurrencyType, configDataRandomStoreItemInfo.Price);

            if (num != 0)
            {
                return(num);
            }
            if (configDataRandomStoreItemInfo.ItemType == GoodsType.GoodsType_Item)
            {
                ConfigDataItemInfo configDataItemInfo = this.m_configDataLoader.GetConfigDataItemInfo(configDataRandomStoreItemInfo.ItemID);
                if (configDataItemInfo.FuncType == ItemFuncType.ItemFuncType_SelfSelectedBox)
                {
                    ConfigDataSelfSelectedBoxInfo configDataSelfSelectedBoxInfo = this.m_configDataLoader.GetConfigDataSelfSelectedBoxInfo(configDataItemInfo.FuncTypeParam1);
                    if (configDataSelfSelectedBoxInfo.Reward.Count <= selectedIndex || selectedIndex < 0)
                    {
                        return(-539);
                    }
                }
                else if (selectedIndex != -1)
                {
                    return(-540);
                }
            }
            else if (selectedIndex != -1)
            {
                return(-540);
            }
            if (this.m_bag.IsBagFullByCurrentSize())
            {
                return(-500);
            }
            return(0);
        }