Example #1
0
 private void CreateItems(QuestParam questParam)
 {
     if (questParam.bonusObjective == null)
     {
         return;
     }
     for (int index = 0; index < questParam.bonusObjective.Length; ++index)
     {
         QuestBonusObjective bonusObjective = questParam.bonusObjective[index];
         QuestMissionItem    rewardItem     = this.CreateRewardItem(bonusObjective);
         if (bonusObjective.itemType == RewardType.ConceptCard)
         {
             ConceptCardIcon componentInChildren = (ConceptCardIcon)((Component)rewardItem).get_gameObject().GetComponentInChildren <ConceptCardIcon>();
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren, (UnityEngine.Object)null))
             {
                 ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(bonusObjective.item);
                 componentInChildren.Setup(cardDataForDisplay);
             }
         }
         rewardItem.SetGameParameterIndex(index);
         this.m_ListItems.Add(new QuestDetail.ViewParam()
         {
             ListItem     = rewardItem,
             MissionIndex = index,
             IsAchieved   = questParam.IsMissionClear(index)
         });
         GameParameter.UpdateAll(((Component)rewardItem).get_gameObject());
     }
 }
Example #2
0
        private GameObject SetConceptCard(string _iname)
        {
            GameObject gameObject = (GameObject)null;

            if (MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(_iname) == null)
            {
                DebugUtility.LogError("真理念装 INAME:" + _iname + "は存在しません");
                return((GameObject)null);
            }
            if (Object.op_Inequality((Object)this.ConceptCardTemplate, (Object)null))
            {
                gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ConceptCardTemplate);
                if (Object.op_Inequality((Object)gameObject, (Object)null))
                {
                    gameObject.get_transform().SetParent(this.ConceptCardTemplate.get_transform().get_parent(), false);
                    gameObject.SetActive(true);
                    ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(_iname);
                    if (cardDataForDisplay != null)
                    {
                        ConceptCardIcon component = (ConceptCardIcon)gameObject.GetComponent <ConceptCardIcon>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            component.Setup(cardDataForDisplay);
                        }
                    }
                    this.SetAnimatorTrigger(gameObject, "on");
                }
            }
            return(gameObject);
        }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <FlowNode_ReqMailSelectConceptCard.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqMailSelectConceptCard.Json> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else
         {
             Network.RemoveAPI();
             if (jsonObject.body.select == null || jsonObject.body.select.Length <= 0)
             {
                 return;
             }
             ConceptCardData[] data = new ConceptCardData[jsonObject.body.select.Length];
             for (int index = 0; index < jsonObject.body.select.Length; ++index)
             {
                 FlowNode_ReqMailSelectConceptCard.Json_SelectConceptCard selectConceptCard = jsonObject.body.select[index];
                 data[index] = ConceptCardData.CreateConceptCardDataForDisplay(selectConceptCard.iname);
                 MonoSingleton <GameManager> .Instance.Player.SetConceptCardNum(selectConceptCard.iname, selectConceptCard.has_count);
             }
             this.m_GetConceptCardListWindow.Setup(data);
         }
     }
 }
Example #4
0
        public void RefreshIcon()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.mTrustMasterRewardBase, (UnityEngine.Object)null))
            {
                return;
            }
            ConceptCardTrustRewardItemParam reward = this.mConceptCardData.GetReward();

            if (reward != null)
            {
                bool is_on = reward.reward_type == eRewardType.ConceptCard;
                this.SwitchObject(is_on, ((Component)this.mTrustMasterRewardCardIcon).get_gameObject(), this.mTrustMasterRewardItemIconObject);
                this.mTrustMasterRewardBase.get_gameObject().SetActive(true);
                if (is_on)
                {
                    ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(reward.iname);
                    if (cardDataForDisplay == null)
                    {
                        return;
                    }
                    this.mTrustMasterRewardCardIcon.Setup(cardDataForDisplay);
                }
                else
                {
                    this.LoadImage(reward.GetIconPath(), this.mTrustMasterRewardIcon);
                }
            }
            else
            {
                this.mTrustMasterRewardBase.get_gameObject().SetActive(false);
            }
        }
        private bool SelectConceptCard(string _iname)
        {
            if (string.IsNullOrEmpty(_iname))
            {
                return(false);
            }
            ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(_iname);

            GlobalVars.SelectedConceptCardData.Set(cardDataForDisplay);
            return(true);
        }
Example #6
0
        public bool SetConceptCard(ConceptCardTrustRewardItemParam reward_item)
        {
            if (string.IsNullOrEmpty(reward_item.iname))
            {
                return(false);
            }
            ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(reward_item.iname).iname);

            GlobalVars.SelectedConceptCardData.Set(cardDataForDisplay);
            FlowNode_GameObject.ActivateOutputLinks((Component)this, 13);
            return(true);
        }
Example #7
0
        private void Deserialize(Json_TrophyConceptCards json)
        {
            if (json == null)
            {
                return;
            }
            if (json.mail != null && json.mail.Length > 0)
            {
                RewardData rewardData = GlobalVars.LastReward.Get();
                if (rewardData != null)
                {
                    rewardData.IsOverLimit = true;
                }
                foreach (Json_TrophyConceptCard trophyConceptCard in json.mail)
                {
                    if (!string.IsNullOrEmpty(trophyConceptCard.unit))
                    {
                        if (rewardData != null)
                        {
                            ItemParam itemParam = MonoSingleton <GameManager> .Instance.MasterParam.GetItemParam(trophyConceptCard.unit);

                            rewardData.AddReward(itemParam, 1);
                        }
                        FlowNode_ConceptCardGetUnit.AddConceptCardData(ConceptCardData.CreateConceptCardDataForDisplay(trophyConceptCard.iname));
                    }
                }
            }
            if (json.direct == null)
            {
                return;
            }
            RewardData rewardData1 = GlobalVars.LastReward.Get();

            foreach (Json_TrophyConceptCard trophyConceptCard in json.direct)
            {
                GlobalVars.IsDirtyConceptCardData.Set(true);
                if (!string.IsNullOrEmpty(trophyConceptCard.unit))
                {
                    if (rewardData1 != null)
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .Instance.MasterParam.GetItemParam(trophyConceptCard.unit);

                        rewardData1.AddReward(itemParam, 1);
                    }
                    FlowNode_ConceptCardGetUnit.AddConceptCardData(ConceptCardData.CreateConceptCardDataForDisplay(trophyConceptCard.iname));
                }
            }
        }
        public void SetConceptCard(ConceptCardTrustRewardItemParam reward_item)
        {
            if (string.IsNullOrEmpty(reward_item.iname))
            {
                return;
            }
            ConceptCardParam conceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(reward_item.iname);

            this.mItemName.set_text(conceptCardParam.name);
            DataSource.Bind <ConceptCardParam>(((Component)this).get_gameObject(), conceptCardParam);
            if (!Object.op_Inequality((Object)this.mCardIcon, (Object)null))
            {
                return;
            }
            ((Component)this.mCardIcon).get_gameObject().SetActive(true);
            this.mCardIcon.Setup(ConceptCardData.CreateConceptCardDataForDisplay(conceptCardParam.iname));
        }
Example #9
0
        private void OnItemSelect(GameObject go)
        {
            GiftRecieveItemData dataOfClass = DataSource.FindDataOfClass <GiftRecieveItemData>(go, (GiftRecieveItemData)null);

            if (dataOfClass == null)
            {
                return;
            }
            if (dataOfClass.type == GiftTypes.Item)
            {
                GlobalVars.SelectedItemID = dataOfClass.iname;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 14);
            }
            else if (dataOfClass.type == GiftTypes.ConceptCard)
            {
                ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(dataOfClass.iname);
                GlobalVars.SelectedConceptCardData.Set(cardDataForDisplay);
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 15);
            }
            else
            {
                DebugUtility.LogError(string.Format("不明な種類のログインボーナスが設定されています。{0} => {1}個", (object)dataOfClass.iname, (object)dataOfClass.num));
            }
        }
Example #10
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.ShopSoldOut:
                case Network.EErrCode.ShopBuyCostShort:
                case Network.EErrCode.ShopBuyLvShort:
                case Network.EErrCode.ShopBuyNotFound:
                case Network.EErrCode.ShopBuyItemNotFound:
                    this.OnBack();
                    break;

                case Network.EErrCode.ShopRefreshItemList:
                    UIUtility.SystemMessage((string)null, Network.ErrMsg, (UIUtility.DialogResultEvent)(go => this.ActivateOutputLinks(121)), (GameObject)null, false, -1);
                    ((Behaviour)this).set_enabled(false);
                    Network.RemoveAPI();
                    Network.ResetError();
                    break;

                case Network.EErrCode.ShopBuyOutofItemPeriod:
                    UIUtility.SystemMessage((string)null, Network.ErrMsg, (UIUtility.DialogResultEvent)(go => this.ActivateOutputLinks(120)), (GameObject)null, false, -1);
                    ((Behaviour)this).set_enabled(false);
                    Network.RemoveAPI();
                    Network.ResetError();
                    break;

                case Network.EErrCode.ShopBuyOutofPeriod:
                    UIUtility.SystemMessage((string)null, Network.ErrMsg, (UIUtility.DialogResultEvent)(go => this.ActivateOutputLinks(122)), (GameObject)null, false, -1);
                    ((Behaviour)this).set_enabled(false);
                    Network.RemoveAPI();
                    Network.ResetError();
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_ShopBuyResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_ShopBuyResponse> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    ShopData shop = MonoSingleton <GameManager> .Instance.Player.GetShopData(this.mShopType) ?? new ShopData();

                    if (!shop.Deserialize(jsonObject.body))
                    {
                        this.OnFailed();
                    }
                    else
                    {
                        MonoSingleton <GameManager> .Instance.Player.SetShopData(this.mShopType, shop);

                        if (jsonObject.body.cards != null && jsonObject.body.cards.Length > 0)
                        {
                            GlobalVars.IsDirtyConceptCardData.Set(true);
                            Json_ShopBuyConceptCard[] cards = jsonObject.body.cards;
                            for (int index = 0; index < cards.Length; ++index)
                            {
                                if (cards[index] != null && cards[index].IsGetConceptCardUnit)
                                {
                                    FlowNode_ConceptCardGetUnit.AddConceptCardData(ConceptCardData.CreateConceptCardDataForDisplay(cards[index].iname));
                                }
                            }
                        }
                        ShopParam shopParam = MonoSingleton <GameManager> .Instance.MasterParam.GetShopParam(this.mShopType);

                        if (shopParam != null)
                        {
                            PlayerData player   = MonoSingleton <GameManager> .Instance.Player;
                            ShopItem   shopItem = shop.items.FirstOrDefault <ShopItem>((Func <ShopItem, bool>)(item => item.id == GlobalVars.ShopBuyIndex));
                            string     iname    = shopItem.iname;
                            if (shopItem.isSetSaleValue)
                            {
                                MyMetaps.TrackSpendShop(shopItem.saleType, this.mShopType, shopItem.saleValue);
                            }
                            else
                            {
                                int num = !shopItem.IsArtifact ? (!shopItem.IsConceptCard ? MonoSingleton <GameManager> .Instance.GetItemParam(shopItem.iname).GetBuyNum(shopItem.saleType) * shopItem.num : shopItem.saleValue) : MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(shopItem.iname).GetBuyNum(shopItem.saleType) * shopItem.num;

                                if (num > 0)
                                {
                                    MyMetaps.TrackSpendShop(shopItem.saleType, this.mShopType, num);
                                }
                            }
                            player.OnBuyAtShop(shopParam.iname, iname, shopItem.num);
                        }
                        this.Success();
                    }
                }
            }
        }
Example #11
0
        private void Initalize()
        {
            GachaHistoryItemData dataOfClass = DataSource.FindDataOfClass <GachaHistoryItemData>(((Component)this).get_gameObject(), (GachaHistoryItemData)null);

            if (dataOfClass == null)
            {
                DebugUtility.LogError("履歴が存在しません");
            }
            else
            {
                for (int index = dataOfClass.historys.Length - 1; index >= 0; --index)
                {
                    GachaHistoryData history = dataOfClass.historys[index];
                    if (history != null)
                    {
                        GameObject gameObject1 = (GameObject)null;
                        bool       flag        = false;
                        if (history.type == GachaDropData.Type.Unit)
                        {
                            gameObject1 = (GameObject)Object.Instantiate <GameObject>((M0)this.UnitIconObj);
                            if (Object.op_Inequality((Object)gameObject1, (Object)null))
                            {
                                gameObject1.get_transform().SetParent(this.ListParent, false);
                                gameObject1.SetActive(true);
                                DataSource.Bind <UnitData>(gameObject1, GachaHistoryWindow.CreateUnitData(history.unit));
                                flag = history.isNew;
                                this.mItems.Add(gameObject1);
                                gameObject1.get_transform().SetAsFirstSibling();
                            }
                        }
                        else if (history.type == GachaDropData.Type.Item)
                        {
                            gameObject1 = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemIconObj);
                            if (Object.op_Inequality((Object)gameObject1, (Object)null))
                            {
                                gameObject1.get_transform().SetParent(this.ListParent, false);
                                gameObject1.SetActive(true);
                                DataSource.Bind <ItemData>(gameObject1, GachaHistoryWindow.CreateItemData(history.item, history.num));
                                flag = history.isNew;
                                this.mItems.Add(gameObject1);
                                gameObject1.get_transform().SetAsFirstSibling();
                            }
                        }
                        else if (history.type == GachaDropData.Type.Artifact)
                        {
                            gameObject1 = (GameObject)Object.Instantiate <GameObject>((M0)this.ArtifactIconObj);
                            if (Object.op_Inequality((Object)gameObject1, (Object)null))
                            {
                                gameObject1.get_transform().SetParent(this.ListParent, false);
                                gameObject1.SetActive(true);
                                DataSource.Bind <ArtifactData>(gameObject1, GachaHistoryWindow.CreateArtifactData(history.artifact, history.rarity));
                                flag = history.isNew;
                                this.mItems.Add(gameObject1);
                                gameObject1.get_transform().SetAsFirstSibling();
                            }
                        }
                        else if (history.type == GachaDropData.Type.ConceptCard)
                        {
                            gameObject1 = (GameObject)Object.Instantiate <GameObject>((M0)this.ConceptCardIconObj);
                            if (Object.op_Inequality((Object)gameObject1, (Object)null))
                            {
                                gameObject1.get_transform().SetParent(this.ListParent, false);
                                gameObject1.SetActive(true);
                                ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(history.conceptcard.iname);
                                ConceptCardIcon component          = (ConceptCardIcon)gameObject1.GetComponent <ConceptCardIcon>();
                                if (Object.op_Inequality((Object)component, (Object)null))
                                {
                                    component.Setup(cardDataForDisplay);
                                }
                                flag = history.isNew;
                                this.mItems.Add(gameObject1);
                                gameObject1.get_transform().SetAsFirstSibling();
                            }
                        }
                        if (Object.op_Inequality((Object)gameObject1, (Object)null))
                        {
                            SerializeValueBehaviour component = (SerializeValueBehaviour)gameObject1.GetComponent <SerializeValueBehaviour>();
                            if (Object.op_Inequality((Object)component, (Object)null))
                            {
                                GameObject gameObject2 = component.list.GetGameObject("new");
                                if (Object.op_Inequality((Object)gameObject2, (Object)null))
                                {
                                    gameObject2.SetActive(flag);
                                }
                            }
                        }
                    }
                }
                if (Object.op_Inequality((Object)this.TitleText, (Object)null))
                {
                    Text component = (Text)this.TitleText.GetComponent <Text>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        string str = LocalizedText.Get("sys.TEXT_GACHA_HISTORY_FOOTER", (object)dataOfClass.GetDropAt().ToString("yyyy/MM/dd HH:mm:ss"), (object)dataOfClass.gachaTitle);
                        component.set_text(str);
                    }
                }
                GameParameter.UpdateAll(((Component)this).get_gameObject());
            }
        }
        private void Refresh()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.UnitTemplate, (UnityEngine.Object)null))
            {
                return;
            }
            List <UnitData> units = MonoSingleton <GameManager> .Instance.Player.Units;

            for (int index = 0; index < this.mUnits.Count; ++index)
            {
                this.mUnits[index].get_gameObject().SetActive(false);
            }
            this.mShopitem = MonoSingleton <GameManager> .Instance.Player.GetShopData(GlobalVars.ShopType).items.FirstOrDefault <ShopItem>((Func <ShopItem, bool>)(item => item.id == GlobalVars.ShopBuyIndex));

            bool flag1 = !this.mShopitem.IsNotLimited || this.mShopitem.saleType == ESaleType.Coin_P;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.limited_item, (UnityEngine.Object)null))
            {
                this.limited_item.SetActive(flag1);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.no_limited_item, (UnityEngine.Object)null))
            {
                this.no_limited_item.SetActive(!flag1);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Sold, (UnityEngine.Object)null))
            {
                this.Sold.SetActive(!this.mShopitem.IsNotLimited);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SoldNum, (UnityEngine.Object)null))
            {
                this.SoldNum.set_text(this.mShopitem.remaining_num.ToString());
            }
            this.mEnabledSlider = false;
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountSliderHolder, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountSlider, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountSliderNum, (UnityEngine.Object)null))
            {
                if (!this.mShopitem.IsNotLimited && this.mShopitem.remaining_num > 1)
                {
                    this.mEnabledSlider = true;
                    GameParameter component = (GameParameter)((Component)this.LimitedItemPriceText).GetComponent <GameParameter>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                    {
                        ((Behaviour)component).set_enabled(false);
                    }
                    this.AmountSliderHolder.SetActive(true);
                    int remainingCurrency = ShopData.GetRemainingCurrency(this.mShopitem);
                    int buyPrice          = ShopData.GetBuyPrice(this.mShopitem);
                    int num1 = 1;
                    if (buyPrice > 0)
                    {
                        while (buyPrice * num1 <= remainingCurrency)
                        {
                            ++num1;
                        }
                    }
                    int num2 = Math.Max(Math.Min(num1 - 1, this.mShopitem.remaining_num), 1);
                    this.AmountSlider.set_minValue(1f);
                    this.AmountSlider.set_maxValue((float)num2);
                    this.SetSliderValue(1f);
                    // ISSUE: method pointer
                    ((UnityEvent <float>) this.AmountSlider.get_onValueChanged()).AddListener(new UnityAction <float>((object)this, __methodptr(OnSliderValueChanged)));
                }
                else
                {
                    this.mEnabledSlider = false;
                    this.AmountSliderHolder.SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.HasJem, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.HasCoin, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.HasZenny, (UnityEngine.Object)null))
            {
                switch (this.mShopitem.saleType)
                {
                case ESaleType.Gold:
                    this.HasJem.SetActive(false);
                    this.HasCoin.SetActive(false);
                    this.HasZenny.SetActive(true);
                    break;

                case ESaleType.Coin:
                case ESaleType.Coin_P:
                    this.HasJem.SetActive(true);
                    this.HasCoin.SetActive(false);
                    this.HasZenny.SetActive(false);
                    break;

                default:
                    this.HasJem.SetActive(false);
                    this.HasCoin.SetActive(true);
                    this.HasZenny.SetActive(false);
                    break;
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.EnableEquipUnitWindow, (UnityEngine.Object)null))
            {
                this.EnableEquipUnitWindow.get_gameObject().SetActive(false);
                int index1 = 0;
                for (int index2 = 0; index2 < units.Count; ++index2)
                {
                    UnitData data  = units[index2];
                    bool     flag2 = false;
                    for (int index3 = 0; index3 < data.Jobs.Length; ++index3)
                    {
                        JobData job = data.Jobs[index3];
                        if (job.IsActivated)
                        {
                            int equipSlotByItemId = job.FindEquipSlotByItemID(this.mShopitem.iname);
                            if (equipSlotByItemId != -1 && job.CheckEnableEquipSlot(equipSlotByItemId))
                            {
                                flag2 = true;
                                break;
                            }
                        }
                    }
                    if (flag2)
                    {
                        if (index1 >= this.mUnits.Count)
                        {
                            this.UnitTemplate.SetActive(true);
                            GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.UnitTemplate);
                            gameObject.get_transform().SetParent((Transform)this.UnitLayoutParent, false);
                            this.mUnits.Add(gameObject);
                            this.UnitTemplate.SetActive(false);
                        }
                        GameObject gameObject1 = this.mUnits[index1].get_gameObject();
                        DataSource.Bind <UnitData>(gameObject1, data);
                        gameObject1.SetActive(true);
                        this.EnableEquipUnitWindow.get_gameObject().SetActive(true);
                        GameUtility.SetGameObjectActive(this.LayoutRight, true);
                        ++index1;
                    }
                }
            }
            DataSource.Bind <ShopItem>(((Component)this).get_gameObject(), this.mShopitem);
            if (this.mShopitem.IsArtifact)
            {
                DataSource.Bind <ArtifactParam>(((Component)this).get_gameObject(), MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(this.mShopitem.iname));
            }
            else if (this.mShopitem.IsConceptCard)
            {
                GameUtility.SetGameObjectActive(this.ItemIconRoot, false);
                GameUtility.SetGameObjectActive(this.ConceptCardIconRoot, true);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ConceptCardDetail, (UnityEngine.Object)null))
                {
                    ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(this.mShopitem.iname);
                    GlobalVars.SelectedConceptCardData.Set(cardDataForDisplay);
                    GameUtility.SetGameObjectActive(this.ConceptCardDetail, true);
                    GameUtility.SetGameObjectActive(this.LayoutRight, true);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TextDesc, (UnityEngine.Object)null))
                    {
                        this.TextDesc.set_text(cardDataForDisplay.Param.expr);
                    }
                }
            }
            else
            {
                ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(this.mShopitem.iname);

                if (itemDataByItemId != null)
                {
                    DataSource.Bind <ItemData>(((Component)this).get_gameObject(), itemDataByItemId);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TextDesc, (UnityEngine.Object)null))
                    {
                        this.TextDesc.set_text(itemDataByItemId.Param.Expr);
                    }
                }
                else
                {
                    ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(this.mShopitem.iname);

                    if (itemParam != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TextDesc, (UnityEngine.Object)null))
                    {
                        DataSource.Bind <ItemParam>(((Component)this).get_gameObject(), itemParam);
                        this.TextDesc.set_text(itemParam.Expr);
                    }
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Example #13
0
        private void Refresh()
        {
            GameUtility.DestroyGameObjects(this.mItems);
            this.mItems.Clear();
            ShopData shopData = MonoSingleton <GameManager> .Instance.Player.GetShopData(GlobalVars.ShopType);

            if (shopData == null || shopData.items.Count <= 0 || UnityEngine.Object.op_Equality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null))
            {
                return;
            }
            int       shopdata_index = GlobalVars.ShopBuyIndex;
            Transform parent         = !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemParent, (UnityEngine.Object)null) ? this.ItemTemplate.get_transform().get_parent() : this.ItemParent.get_transform();
            ShopItem  shopItem       = shopData.items.FirstOrDefault <ShopItem>((Func <ShopItem, bool>)(item => item.id == shopdata_index));
            List <Json_ShopItemDesc> jsonShopItemDescList = new List <Json_ShopItemDesc>();

            if (shopItem.IsArtifact)
            {
                jsonShopItemDescList.Add(new Json_ShopItemDesc()
                {
                    iname = shopItem.iname,
                    itype = ShopData.ShopItemType2String(shopItem.ShopItemType),
                    num   = shopItem.num
                });
            }
            else if (shopItem.children != null && shopItem.children.Length > 0)
            {
                jsonShopItemDescList.AddRange((IEnumerable <Json_ShopItemDesc>)shopItem.children);
            }
            if (jsonShopItemDescList.Count > 0)
            {
                for (int index = 0; index < jsonShopItemDescList.Count; ++index)
                {
                    Json_ShopItemDesc shop_item_desc = jsonShopItemDescList[index];
                    string            empty          = string.Empty;
                    GameObject        gameObject;
                    string            name;
                    if (shop_item_desc.IsArtifact)
                    {
                        ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(shop_item_desc.iname);

                        if (artifactParam != null)
                        {
                            gameObject = this.InstantiateItem <ArtifactParam>(this.ItemTemplate, parent, artifactParam);
                            name       = artifactParam.name;
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else if (shop_item_desc.IsConceptCard)
                    {
                        ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(shop_item_desc.iname);
                        if (cardDataForDisplay != null)
                        {
                            gameObject = this.InstantiateItem <ConceptCardData>(this.ItemTemplate, parent, cardDataForDisplay);
                            ConceptCardIcon componentInChildren = (ConceptCardIcon)gameObject.GetComponentInChildren <ConceptCardIcon>();
                            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren, (UnityEngine.Object)null))
                            {
                                componentInChildren.Setup(cardDataForDisplay);
                            }
                            name = cardDataForDisplay.Param.name;
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else
                    {
                        ItemData itemData = new ItemData();
                        if (itemData.Setup(0L, shop_item_desc.iname, shop_item_desc.num))
                        {
                            gameObject = this.InstantiateItem <ItemData>(this.ItemTemplate, parent, itemData);
                            name       = itemData.Param.name;
                        }
                        else
                        {
                            continue;
                        }
                    }
                    ShopGiftItem component = (ShopGiftItem)gameObject.GetComponent <ShopGiftItem>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                    {
                        component.SetShopItemInfo(shop_item_desc, name, GlobalVars.ShopBuyAmount);
                    }
                }
            }
            GameParameter.UpdateAll(((Component)parent).get_gameObject());
        }
Example #14
0
        public void Refresh()
        {
            ((Component)this).get_gameObject().SetActive(true);
            ((Component)this.ClearBadge).get_gameObject().SetActive(false);
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            TrophyParam dataOfClass = DataSource.FindDataOfClass <TrophyParam>(((Component)this).get_gameObject(), (TrophyParam)null);

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)instanceDirect, (UnityEngine.Object)null) || dataOfClass == null)
            {
                ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(false);
                ((Component)this.ButtonNormal.button).get_gameObject().SetActive(false);
                ((Component)this.ButtonSecret.button).get_gameObject().SetActive(true);
            }
            else
            {
                TrophyState trophyCounter        = ChallengeMission.GetTrophyCounter(dataOfClass);
                ChallengeMissionItem.State state = ChallengeMissionItem.State.Challenge;
                if (trophyCounter.IsEnded)
                {
                    state = ChallengeMissionItem.State.Ended;
                }
                else if (trophyCounter.IsCompleted)
                {
                    state = ChallengeMissionItem.State.Clear;
                }
                ChallengeMissionItem.ButtonObject buttonObject;
                if (state == ChallengeMissionItem.State.Clear)
                {
                    ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(true);
                    ((Component)this.ButtonNormal.button).get_gameObject().SetActive(false);
                    ((Component)this.ButtonSecret.button).get_gameObject().SetActive(false);
                    buttonObject = this.ButtonHighlight;
                }
                else
                {
                    ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(false);
                    ((Component)this.ButtonNormal.button).get_gameObject().SetActive(true);
                    ((Component)this.ButtonSecret.button).get_gameObject().SetActive(false);
                    buttonObject = this.ButtonNormal;
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ClearBadge, (UnityEngine.Object)null))
                {
                    ((Component)this.ClearBadge).get_gameObject().SetActive(state == ChallengeMissionItem.State.Ended);
                }
                if (buttonObject != null && UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.title, (UnityEngine.Object)null))
                {
                    buttonObject.title.set_text(dataOfClass.Name);
                }
                if (buttonObject != null && UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.button, (UnityEngine.Object)null))
                {
                    ((UnityEventBase)buttonObject.button.get_onClick()).RemoveAllListeners();
                    ((UnityEvent)buttonObject.button.get_onClick()).AddListener(this.OnClick);
                    ((Selectable)buttonObject.button).set_interactable(state != ChallengeMissionItem.State.Ended);
                }
                if (buttonObject != null && UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.reward, (UnityEngine.Object)null))
                {
                    if (dataOfClass.Gold != 0)
                    {
                        buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_GOLD"), (object)dataOfClass.Gold));
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                    }
                    else if (dataOfClass.Exp != 0)
                    {
                        buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_EXP"), (object)dataOfClass.Exp));
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                    }
                    else if (dataOfClass.Coin != 0)
                    {
                        buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)dataOfClass.Coin));
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                    }
                    else if (dataOfClass.Stamina != 0)
                    {
                        buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_STAMINA"), (object)dataOfClass.Stamina));
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                    }
                    else if (dataOfClass.Items != null && dataOfClass.Items.Length > 0)
                    {
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                        ItemParam itemParam = instanceDirect.GetItemParam(dataOfClass.Items[0].iname);
                        if (itemParam != null)
                        {
                            buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_ITEM"), (object)itemParam.name, (object)dataOfClass.Items[0].Num));
                        }
                    }
                    else if (dataOfClass.ConceptCards != null && dataOfClass.ConceptCards.Length > 0)
                    {
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, false);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, true);
                        ConceptCardParam conceptCardParam = instanceDirect.MasterParam.GetConceptCardParam(dataOfClass.ConceptCards[0].iname);
                        if (conceptCardParam != null)
                        {
                            buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_DETAIL_REWARD_CONCEPT_CARD"), (object)conceptCardParam.name, (object)dataOfClass.ConceptCards[0].Num));
                        }
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.conceptCardIcon, (UnityEngine.Object)null))
                        {
                            ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(conceptCardParam.iname);
                            buttonObject.conceptCardIcon.Setup(cardDataForDisplay);
                        }
                    }
                }
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.icon, (UnityEngine.Object)null))
                {
                    return;
                }
                buttonObject.icon.UpdateValue();
            }
        }
Example #15
0
        private void UpdateReward(TrophyParam trophy)
        {
            if (trophy == null)
            {
                return;
            }
            string    format1 = LocalizedText.Get("sys.CHALLENGE_MSG_REWARD_ITEM");
            string    format2 = LocalizedText.Get("sys.CHALLENGE_MSG_REWARD_OTHER");
            bool      flag1   = false;
            bool      flag2   = false;
            bool      flag3   = false;
            bool      flag4   = false;
            bool      flag5   = false;
            string    str1    = string.Empty;
            ItemParam data    = (ItemParam)null;

            if (trophy.Gold != 0)
            {
                flag3 = true;
                string str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_GOLD"), (object)trophy.Gold);
                str1 = string.Format(format2, (object)str2);
            }
            else if (trophy.Exp != 0)
            {
                flag2 = true;
                string str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_EXP"), (object)trophy.Exp);
                str1 = string.Format(format2, (object)str2);
            }
            else if (trophy.Coin != 0)
            {
                flag1 = true;
                string str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)trophy.Coin);
                str1 = string.Format(format2, (object)str2);
                data = MonoSingleton <GameManager> .Instance.GetItemParam("$COIN");
            }
            else if (trophy.Stamina != 0)
            {
                flag4 = true;
                string str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_STAMINA"), (object)trophy.Stamina);
                str1 = string.Format(format2, (object)str2);
            }
            else if (trophy.Items != null && trophy.Items.Length > 0)
            {
                flag1 = true;
                data  = MonoSingleton <GameManager> .Instance.GetItemParam(trophy.Items[0].iname);

                if (data != null)
                {
                    if (data.type == EItemType.Unit)
                    {
                        UnitParam unitParam = MonoSingleton <GameManager> .Instance.GetUnitParam(data.iname);

                        if (unitParam != null)
                        {
                            string str2 = LocalizedText.Get("sys.CHALLENGE_DETAIL_REWARD_UNIT_BR", (object)((int)unitParam.rare + 1), (object)unitParam.name);
                            str1 = string.Format(format2, (object)str2);
                        }
                    }
                    else
                    {
                        str1 = string.Format(format1, (object)data.name, (object)trophy.Items[0].Num);
                    }
                }
            }
            else if (trophy.ConceptCards != null && trophy.ConceptCards.Length > 0)
            {
                flag5 = true;
                ConceptCardParam conceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(trophy.ConceptCards[0].iname);

                if (conceptCardParam != null)
                {
                    str1 = string.Format(LocalizedText.Get("sys.CHALLENGE_MSG_REWARD_CONCEPT_CARD"), (object)conceptCardParam.name, (object)trophy.ConceptCards[0].Num);
                    if (Object.op_Inequality((Object)this.ConceptCardObject, (Object)null))
                    {
                        this.ConceptCardObject.Setup(ConceptCardData.CreateConceptCardDataForDisplay(conceptCardParam.iname));
                    }
                }
            }
            if (Object.op_Inequality((Object)this.ImageItem, (Object)null))
            {
                ((Component)this.ImageItem).get_gameObject().SetActive(flag1);
            }
            if (Object.op_Inequality((Object)this.ImageExp, (Object)null))
            {
                ((Component)this.ImageExp).get_gameObject().SetActive(flag2);
            }
            if (Object.op_Inequality((Object)this.ImageGold, (Object)null))
            {
                ((Component)this.ImageGold).get_gameObject().SetActive(flag3);
            }
            if (Object.op_Inequality((Object)this.ImageStamina, (Object)null))
            {
                ((Component)this.ImageStamina).get_gameObject().SetActive(flag4);
            }
            if (Object.op_Inequality((Object)this.ConceptCardObject, (Object)null))
            {
                ((Component)this.ConceptCardObject).get_gameObject().SetActive(flag5);
            }
            if (data != null)
            {
                DataSource.Bind <ItemParam>(((Component)this).get_gameObject(), data);
            }
            if (!Object.op_Inequality((Object)this.TextMessage, (Object)null))
            {
                return;
            }
            this.TextMessage.set_text(str1);
        }
        private void Refresh()
        {
            this.mShopitem = MonoSingleton <GameManager> .Instance.Player.GetEventShopData().items.FirstOrDefault <EventShopItem>((Func <EventShopItem, bool>)(item => item.id == GlobalVars.ShopBuyIndex));

            this.ItemWindow.SetActive(!this.mShopitem.IsArtifact);
            this.ArtifactWindow.SetActive(this.mShopitem.IsArtifact);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountNum, (UnityEngine.Object)null))
            {
                this.AmountNum.set_text(this.mShopitem.remaining_num.ToString());
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Sold, (UnityEngine.Object)null))
            {
                this.Sold.SetActive(!this.mShopitem.IsNotLimited);
            }
            if (this.mShopitem.IsArtifact)
            {
                ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(this.mShopitem.iname);

                DataSource.Bind <ArtifactParam>(((Component)this).get_gameObject(), artifactParam);
                this.mArtifactParam = artifactParam;
                ArtifactData artifactData = new ArtifactData();
                artifactData.Deserialize(new Json_Artifact()
                {
                    iname = artifactParam.iname,
                    rare  = artifactParam.rareini
                });
                BaseStatus fixed_status = new BaseStatus();
                BaseStatus scale_status = new BaseStatus();
                artifactData.GetHomePassiveBuffStatus(ref fixed_status, ref scale_status, (UnitData)null, 0, true);
                this.ArtifactStatus.SetValues(fixed_status, scale_status, false);
                if (artifactParam.abil_inames != null && artifactParam.abil_inames.Length > 0)
                {
                    AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(artifactParam.abil_inames[0]);

                    List <AbilityData> learningAbilities = artifactData.LearningAbilities;
                    bool flag = false;
                    if (learningAbilities != null)
                    {
                        for (int index = 0; index < learningAbilities.Count; ++index)
                        {
                            AbilityData abilityData = learningAbilities[index];
                            if (abilityData != null && abilityParam.iname == abilityData.Param.iname)
                            {
                                flag = true;
                                break;
                            }
                        }
                    }
                    DataSource.Bind <AbilityParam>(this.ArtifactAbility, abilityParam);
                    if (flag)
                    {
                        this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Unlocked);
                    }
                    else
                    {
                        this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Hidden);
                    }
                }
                else
                {
                    this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Hidden);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_SetEffectsButton, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_SetEffectsButton, (UnityEngine.Object)null) && artifactParam != null)
                {
                    ((Selectable)this.m_SetEffectsButton).set_interactable(MonoSingleton <GameManager> .Instance.MasterParam.ExistSkillAbilityDeriveDataWithArtifact(artifactParam.iname));
                    if (((Selectable)this.m_SetEffectsButton).get_interactable())
                    {
                        ArtifactSetList.SetSelectedArtifactParam(artifactParam);
                    }
                }
            }
            else
            {
                ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(this.mShopitem.iname);

                this.event_shop_item_set_list.Clear();
                if (this.mShopitem.IsSet)
                {
                    for (int index = 0; index < this.mShopitem.children.Length; ++index)
                    {
                        GameObject gameObject = index >= this.event_shop_item_set_list.Count ? (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate) : ((Component)this.event_shop_item_set_list[index]).get_gameObject();
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
                        {
                            gameObject.SetActive(true);
                            Vector3 localScale = gameObject.get_transform().get_localScale();
                            gameObject.get_transform().SetParent(this.ItemParent.get_transform());
                            gameObject.get_transform().set_localScale(localScale);
                            EventShopSetItemListElement component = (EventShopSetItemListElement)gameObject.GetComponent <EventShopSetItemListElement>();
                            StringBuilder stringBuilder           = GameUtility.GetStringBuilder();
                            if (this.mShopitem.children[index].IsArtifact)
                            {
                                ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(this.mShopitem.children[index].iname);

                                if (artifactParam != null)
                                {
                                    stringBuilder.Append(artifactParam.name);
                                }
                                component.ArtifactParam = artifactParam;
                            }
                            else if (this.mShopitem.children[index].IsConceptCard)
                            {
                                ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(this.mShopitem.children[index].iname);
                                if (cardDataForDisplay != null)
                                {
                                    stringBuilder.Append(cardDataForDisplay.Param.name);
                                }
                                component.SetupConceptCard(cardDataForDisplay);
                            }
                            else
                            {
                                ItemData itemData = new ItemData();
                                itemData.Setup(0L, this.mShopitem.children[index].iname, this.mShopitem.children[index].num);
                                if (itemData != null)
                                {
                                    stringBuilder.Append(itemData.Param.name);
                                }
                                component.itemData = itemData;
                            }
                            stringBuilder.Append("×");
                            stringBuilder.Append(this.mShopitem.children[index].num.ToString());
                            component.itemName.set_text(stringBuilder.ToString());
                            component.SetShopItemDesc(this.mShopitem.children[index]);
                            this.event_shop_item_set_list.Add(component);
                        }
                    }
                }
                DataSource.Bind <ItemData>(((Component)this).get_gameObject(), itemDataByItemId);
                DataSource.Bind <ItemParam>(((Component)this).get_gameObject(), MonoSingleton <GameManager> .Instance.GetItemParam(this.mShopitem.iname));
            }
            if (this.mShopitem.IsArtifact)
            {
                this.AmountSliderHolder = this.ArtifactAmountSliderHolder;
                this.AmountSlider       = this.ArtifactAmountSlider;
                this.AmountSliderNum    = this.ArtifactAmountSliderNum;
                this.IncrementButton    = this.ArtifactIncrementButton;
                this.DecrementButton    = this.ArtifactDecrementButton;
            }
            else
            {
                this.AmountSliderHolder = this.ItemAmountSliderHolder;
                this.AmountSlider       = this.ItemAmountSlider;
                this.AmountSliderNum    = this.ItemAmountSliderNum;
                this.IncrementButton    = this.ItemIncrementButton;
                this.DecrementButton    = this.ItemDecrementButton;
            }
            this.mEnabledSlider = false;
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountSliderHolder, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountSlider, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountSliderNum, (UnityEngine.Object)null))
            {
                if (!this.mShopitem.IsNotLimited && this.mShopitem.remaining_num > 1)
                {
                    this.mEnabledSlider = true;
                    GameParameter component = (GameParameter)((Component)this.LimitedItemPriceText).GetComponent <GameParameter>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                    {
                        ((Behaviour)component).set_enabled(false);
                    }
                    this.AmountSliderHolder.SetActive(true);
                    int remainingCurrency = ShopData.GetRemainingCurrency((ShopItem)this.mShopitem);
                    int buyPrice          = ShopData.GetBuyPrice((ShopItem)this.mShopitem);
                    int num1 = 1;
                    if (buyPrice > 0)
                    {
                        while (buyPrice * num1 <= remainingCurrency)
                        {
                            ++num1;
                        }
                    }
                    int num2 = Math.Max(Math.Min(num1 - 1, this.mShopitem.remaining_num), 1);
                    this.AmountSlider.set_minValue(1f);
                    this.AmountSlider.set_maxValue((float)num2);
                    this.SetSliderValue(1f);
                    // ISSUE: method pointer
                    ((UnityEvent <float>) this.AmountSlider.get_onValueChanged()).AddListener(new UnityAction <float>((object)this, __methodptr(OnSliderValueChanged)));
                }
                else
                {
                    this.mEnabledSlider = false;
                    this.AmountSliderHolder.SetActive(false);
                }
            }
            DataSource.Bind <EventShopItem>(((Component)this).get_gameObject(), this.mShopitem);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
        private void RefreshResult(GachaDropData[] _drops, GameObject _block, int _block_type, bool _is_anim = false)
        {
            if (_drops == null || _drops.Length < 0 || UnityEngine.Object.op_Equality((UnityEngine.Object)_block, (UnityEngine.Object)null))
            {
                return;
            }
            _block.SetActive(true);
            int length = _drops.Length;
            SerializeValueBehaviour component1 = (SerializeValueBehaviour)_block.GetComponent <SerializeValueBehaviour>();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null))
            {
                GameObject gameObject1 = component1.list.GetGameObject("icon");
                gameObject1.SetActive(false);
                for (int index1 = 0; index1 < length; ++index1)
                {
                    GachaDropData drop = _drops[index1];
                    int           num  = index1;
                    GachaResultThumbnailWindow.GachaResultType gachaResultType = GachaResultThumbnailWindow.GachaResultType.None;
                    if (drop != null)
                    {
                        GameObject gameObject2 = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)gameObject1);
                        gameObject2.get_transform().SetParent(gameObject1.get_transform().get_parent(), false);
                        ((Behaviour)gameObject2.GetComponent <Animator>()).set_enabled(_is_anim);
                        SerializeValueBehaviour component2 = (SerializeValueBehaviour)gameObject2.GetComponent <SerializeValueBehaviour>();
                        if (!UnityEngine.Object.op_Equality((UnityEngine.Object)component2, (UnityEngine.Object)null))
                        {
                            GameObject gameObject3 = (GameObject)null;
                            if (drop.type == GachaDropData.Type.Unit)
                            {
                                gameObject3 = component2.list.GetGameObject("unit");
                                DataSource.Bind <UnitData>(gameObject3, this.CreateUnitData(drop.unit));
                                gachaResultType = GachaResultThumbnailWindow.GachaResultType.Unit;
                            }
                            else if (drop.type == GachaDropData.Type.Item)
                            {
                                gameObject3 = component2.list.GetGameObject("item");
                                DataSource.Bind <ItemData>(gameObject3, this.CreateItemData(drop.item, drop.num));
                                ItemIcon component3 = (ItemIcon)gameObject3.GetComponent <ItemIcon>();
                                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component3, (UnityEngine.Object)null))
                                {
                                    component3.UpdateValue();
                                }
                                gachaResultType = !string.IsNullOrEmpty(drop.item.Flavor) ? GachaResultThumbnailWindow.GachaResultType.Item : GachaResultThumbnailWindow.GachaResultType.Piece;
                            }
                            else if (drop.type == GachaDropData.Type.Artifact)
                            {
                                gameObject3 = component2.list.GetGameObject("artifact");
                                DataSource.Bind <ArtifactData>(gameObject3, this.CreateArtifactData(drop.artifact, drop.Rare));
                                gachaResultType = GachaResultThumbnailWindow.GachaResultType.Artifact;
                            }
                            else if (drop.type == GachaDropData.Type.ConceptCard)
                            {
                                gameObject3 = component2.list.GetGameObject("conceptcard");
                                ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(drop.conceptcard.iname);
                                ConceptCardIcon component3         = (ConceptCardIcon)gameObject3.GetComponent <ConceptCardIcon>();
                                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component3, (UnityEngine.Object)null))
                                {
                                    component3.Setup(cardDataForDisplay);
                                    SerializeValueBehaviour component4 = (SerializeValueBehaviour)gameObject3.GetComponent <SerializeValueBehaviour>();
                                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component4, (UnityEngine.Object)null))
                                    {
                                        GameObject gameObject4 = component4.list.GetGameObject("unit_icon");
                                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject4, (UnityEngine.Object)null))
                                        {
                                            UnitData data = (UnitData)null;
                                            if (drop.cardunit != null)
                                            {
                                                data = this.CreateUnitData(drop.cardunit);
                                            }
                                            DataSource.Bind <UnitData>(gameObject4, data);
                                            gameObject4.SetActive(drop.cardunit != null);
                                        }
                                        GameObject gameObject5 = component4.list.GetGameObject("skin");
                                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject5, (UnityEngine.Object)null))
                                        {
                                            bool flag = false;
                                            if (drop.conceptcard.effects != null && drop.conceptcard.effects.Length > 0)
                                            {
                                                for (int index2 = 0; index2 < drop.conceptcard.effects.Length; ++index2)
                                                {
                                                    ConceptCardEffectsParam effect = drop.conceptcard.effects[index2];
                                                    if (effect != null && !string.IsNullOrEmpty(effect.skin))
                                                    {
                                                        flag = true;
                                                        break;
                                                    }
                                                }
                                            }
                                            gameObject5.SetActive(flag);
                                        }
                                    }
                                }
                                gachaResultType = GachaResultThumbnailWindow.GachaResultType.ConceptCard;
                            }
                            if (UnityEngine.Object.op_Equality((UnityEngine.Object)gameObject3, (UnityEngine.Object)null))
                            {
                                DebugUtility.LogError("アイコンオブジェクトがありません");
                                break;
                            }
                            SerializeValueBehaviour component5 = (SerializeValueBehaviour)gameObject3.GetComponent <SerializeValueBehaviour>();
                            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component5, (UnityEngine.Object)null))
                            {
                                GameObject gameObject4 = component5.list.GetGameObject("new");
                                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component5, (UnityEngine.Object)null))
                                {
                                    gameObject4.SetActive(drop.isNew);
                                }
                            }
                            ButtonEvent component6 = (ButtonEvent)gameObject3.GetComponent <ButtonEvent>();
                            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component6, (UnityEngine.Object)null))
                            {
                                ButtonEvent.Event @event = component6.GetEvent("CLICK_ICON");
                                if (@event != null)
                                {
                                    @event.valueList.SetField("index", num);
                                    @event.valueList.SetField("type", (int)gachaResultType);
                                    @event.valueList.SetField("block", _block_type);
                                    if (gachaResultType == GachaResultThumbnailWindow.GachaResultType.ConceptCard)
                                    {
                                        @event.valueList.SetField("is_first_get_unit", drop.cardunit != null);
                                    }
                                }
                            }
                            gameObject3.SetActive(true);
                            this.m_ResultIconRootList.Add(gameObject2);
                            if (_block_type == 0)
                            {
                                this.m_ResultIconRootList.Add(gameObject2);
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                }
            }
            SerializeValueBehaviour component7 = (SerializeValueBehaviour)((Component)this).get_gameObject().GetComponent <SerializeValueBehaviour>();

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component7, (UnityEngine.Object)null))
            {
                return;
            }
            GameObject gameObject = component7.list.GetGameObject("space");

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
            {
                return;
            }
            gameObject.get_transform().SetAsLastSibling();
            gameObject.SetActive(length > GachaResultThumbnailWindow.VIEW_COUNT);
        }
Example #18
0
 private void SetupConceptCard(string iname, int num)
 {
     this.mBattleRewardType = EBattleRewardType.ConceptCard;
     this.mConceptCardData  = ConceptCardData.CreateConceptCardDataForDisplay(iname);
     this.mNum = num;
 }
Example #19
0
        private void Refresh()
        {
            GameUtility.DestroyGameObjects(this.mItems);
            this.mItems.Clear();
            Transform parent = !Object.op_Inequality((Object)this.ItemParent, (Object)null) ? this.ItemTemplate.get_transform().get_parent() : this.ItemParent.get_transform();

            if (GlobalVars.TimeOutShopItems != null && GlobalVars.TimeOutShopItems.Count > 0)
            {
                using (List <ShopItem> .Enumerator enumerator = GlobalVars.TimeOutShopItems.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        ShopItem   current = enumerator.Current;
                        string     empty   = string.Empty;
                        GameObject gameObject;
                        string     name;
                        if (current.IsArtifact)
                        {
                            ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(current.iname);

                            if (artifactParam != null)
                            {
                                gameObject = this.InstantiateItem <ArtifactParam>(this.ItemTemplate, parent, artifactParam);
                                name       = artifactParam.name;
                            }
                            else
                            {
                                continue;
                            }
                        }
                        else if (current.IsConceptCard)
                        {
                            ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(current.iname);
                            if (cardDataForDisplay != null)
                            {
                                gameObject = this.InstantiateItem <ConceptCardData>(this.ItemTemplate, parent, cardDataForDisplay);
                                ConceptCardIcon componentInChildren = (ConceptCardIcon)gameObject.GetComponentInChildren <ConceptCardIcon>();
                                if (Object.op_Inequality((Object)componentInChildren, (Object)null))
                                {
                                    componentInChildren.Setup(cardDataForDisplay);
                                }
                                name = cardDataForDisplay.Param.name;
                            }
                            else
                            {
                                continue;
                            }
                        }
                        else
                        {
                            ItemData itemData = new ItemData();
                            if (itemData.Setup(0L, current.iname, current.num))
                            {
                                gameObject = this.InstantiateItem <ItemData>(this.ItemTemplate, parent, itemData);
                                name       = itemData.Param.name;
                            }
                            else
                            {
                                continue;
                            }
                        }
                        ShopTimeOutItem component = (ShopTimeOutItem)gameObject.GetComponent <ShopTimeOutItem>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            component.SetShopItemInfo(current, name);
                        }
                    }
                }
            }
            GameParameter.UpdateAll(((Component)parent).get_gameObject());
        }
Example #20
0
        private void RefreshQuestMissionReward(QuestParam questParam)
        {
            if (questParam.bonusObjective == null)
            {
                return;
            }
            for (int index = 0; index < questParam.bonusObjective.Length; ++index)
            {
                QuestBonusObjective questBonusObjective = questParam.bonusObjective[index];
                QuestMissionItem    questMissionItem;
                if (questBonusObjective.itemType == RewardType.Artifact)
                {
                    questMissionItem = (QuestMissionItem)((GameObject)Object.Instantiate <GameObject>((M0)((Component)this.ArtifactTemplate).get_gameObject())).GetComponent <QuestMissionItem>();
                }
                else if (questBonusObjective.itemType == RewardType.ConceptCard)
                {
                    questMissionItem = (QuestMissionItem)((GameObject)Object.Instantiate <GameObject>((M0)((Component)this.ConceptCardTemplate).get_gameObject())).GetComponent <QuestMissionItem>();
                    ConceptCardIcon component = (ConceptCardIcon)((Component)questMissionItem).get_gameObject().GetComponent <ConceptCardIcon>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(questBonusObjective.item);
                        component.Setup(cardDataForDisplay);
                    }
                }
                else if (questBonusObjective.itemType == RewardType.Nothing)
                {
                    questMissionItem = (QuestMissionItem)((GameObject)Object.Instantiate <GameObject>((M0)((Component)this.NothingRewardTemplate).get_gameObject())).GetComponent <QuestMissionItem>();
                }
                else
                {
                    ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(questBonusObjective.item);

                    if (itemParam != null)
                    {
                        questMissionItem = itemParam.type != EItemType.Unit ? (QuestMissionItem)((GameObject)Object.Instantiate <GameObject>((M0)((Component)this.ItemTemplate).get_gameObject())).GetComponent <QuestMissionItem>() : (QuestMissionItem)((GameObject)Object.Instantiate <GameObject>((M0)((Component)this.UnitTemplate).get_gameObject())).GetComponent <QuestMissionItem>();
                    }
                    else
                    {
                        continue;
                    }
                }
                if (!Object.op_Equality((Object)questMissionItem, (Object)null))
                {
                    if (Object.op_Inequality((Object)questMissionItem.Star, (Object)null))
                    {
                        questMissionItem.Star.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.FrameParam, (Object)null))
                    {
                        questMissionItem.FrameParam.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.IconParam, (Object)null))
                    {
                        questMissionItem.IconParam.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.NameParam, (Object)null))
                    {
                        questMissionItem.NameParam.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.AmountParam, (Object)null))
                    {
                        questMissionItem.AmountParam.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.ObjectigveParam, (Object)null))
                    {
                        questMissionItem.ObjectigveParam.Index = index;
                    }
                    Rect rect = (((Component)questMissionItem).get_transform() as RectTransform).get_rect();
                    // ISSUE: explicit reference operation
                    this.m_ItemHeight = ((Rect)@rect).get_height();
                    ((Component)questMissionItem).get_gameObject().SetActive(true);
                    ((Component)questMissionItem).get_transform().SetParent(this.ContentsParent.get_transform(), false);
                    this.allStarObjects.Add(((Component)questMissionItem.Star).get_gameObject());
                    GameParameter.UpdateAll(((Component)questMissionItem).get_gameObject());
                }
            }
            if (!Object.op_Inequality((Object)this.ScrollRect, (Object)null))
            {
                return;
            }
            this.ScrollRect.set_verticalNormalizedPosition(1f);
            this.ScrollRect.set_horizontalNormalizedPosition(1f);
        }
Example #21
0
        private void Refresh()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null))
            {
                return;
            }
            ShopData shopData = MonoSingleton <GameManager> .Instance.Player.GetShopData(GlobalVars.ShopType);

            DebugUtility.Assert(shopData != null, "ショップ情報が存在しない");
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Updated, (UnityEngine.Object)null))
            {
                this.Updated.SetActive(shopData.btn_update);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Update, (UnityEngine.Object)null))
            {
                this.Update.SetActive(shopData.btn_update);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Lineup, (UnityEngine.Object)null))
            {
                this.Lineup.SetActive(shopData.btn_update);
            }
            for (int index = 0; index < this.mBuyItems.Count; ++index)
            {
                this.mBuyItems[index].get_gameObject().SetActive(false);
            }
            int count = shopData.items.Count;

            for (int index = 0; index < count; ++index)
            {
                ShopItem data1 = shopData.items[index];
                if (index >= this.mBuyItems.Count)
                {
                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                    gameObject.get_transform().SetParent((Transform)this.ItemLayoutParent, false);
                    this.mBuyItems.Add(gameObject);
                }
                GameObject  mBuyItem            = this.mBuyItems[index];
                ShopBuyList componentInChildren = (ShopBuyList)mBuyItem.GetComponentInChildren <ShopBuyList>();
                componentInChildren.ShopItem = data1;
                componentInChildren.SetupDiscountUI();
                DataSource.Bind <ShopItem>(mBuyItem, data1);
                if (data1.IsArtifact)
                {
                    ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(data1.iname);

                    DataSource.Bind <ArtifactParam>(mBuyItem, artifactParam);
                }
                else if (data1.IsConceptCard)
                {
                    ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(data1.iname);
                    componentInChildren.SetupConceptCard(cardDataForDisplay);
                }
                else if (data1.IsItem || data1.IsSet)
                {
                    ItemData data2 = new ItemData();
                    data2.Setup(0L, data1.iname, data1.num);
                    DataSource.Bind <ItemData>(mBuyItem, data2);
                    DataSource.Bind <ItemParam>(mBuyItem, MonoSingleton <GameManager> .Instance.GetItemParam(data1.iname));
                }
                else
                {
                    DebugUtility.LogError(string.Format("不明な商品タイプが設定されています (shopitem.iname({0}) => {1})", (object)data1.iname, (object)data1.ShopItemType));
                }
                ListItemEvents component1 = (ListItemEvents)mBuyItem.GetComponent <ListItemEvents>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null))
                {
                    component1.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelect);
                }
                Button component2 = (Button)mBuyItem.GetComponent <Button>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component2, (UnityEngine.Object)null))
                {
                    ((Selectable)component2).set_interactable(!data1.is_soldout);
                }
                mBuyItem.SetActive(true);
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            if (GlobalVars.ShopType == EShopType.AwakePiece)
            {
                GameParameter.UpdateValuesOfType(GameParameter.ParameterTypes.GLOBAL_PLAYER_PIECEPOINT);
            }
            FlowNode_GameObject.ActivateOutputLinks((Component)this, 2);
        }
Example #22
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                GlobalVars.UnitGetReward = (UnitGetParam)null;
                switch (Network.ErrCode)
                {
                case Network.EErrCode.NoMail:
                    this.OnBack();
                    break;

                case Network.EErrCode.MailReadable:
                    this.OnBack();
                    break;

                case Network.EErrCode.Gift_ConceptCardBoxLimit:
                    this.OnBack();
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <FlowNode_ReadMail2.Json_MailRead> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReadMail2.Json_MailRead> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                try
                {
                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);

                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.items);

                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.units);

                    MonoSingleton <GameManager> .Instance.Player.Deserialize(jsonObject.body.mails);

                    if (jsonObject.body.artifacts != null)
                    {
                        MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.artifacts, true);
                    }
                    if (jsonObject.body.mails != null)
                    {
                        GlobalVars.ConceptCardNum.Set(jsonObject.body.mails.concept_count);
                    }
                    if (jsonObject.body.processed != null)
                    {
                        if (jsonObject.body.processed.Length > 0)
                        {
                            MailData[] mail_datas = new MailData[jsonObject.body.processed.Length];
                            for (int index1 = 0; index1 < mail_datas.Length; ++index1)
                            {
                                mail_datas[index1] = new MailData();
                                mail_datas[index1].Deserialize(jsonObject.body.processed[index1]);
                                if (mail_datas[index1].Contains(GiftTypes.ConceptCard))
                                {
                                    GlobalVars.IsDirtyConceptCardData.Set(true);
                                    for (int index2 = 0; index2 < mail_datas[index1].gifts.Length; ++index2)
                                    {
                                        string conceptCardIname = mail_datas[index1].gifts[index2].ConceptCardIname;
                                        if (mail_datas[index1].gifts[index2].IsGetConceptCardUnit)
                                        {
                                            FlowNode_ConceptCardGetUnit.AddConceptCardData(ConceptCardData.CreateConceptCardDataForDisplay(conceptCardIname));
                                        }
                                    }
                                }
                            }
                            this.SetRewordData(mail_datas);
                        }
                    }
                }
                catch (Exception ex)
                {
                    GlobalVars.UnitGetReward = (UnitGetParam)null;
                    DebugUtility.LogException(ex);
                    return;
                }
                if (GlobalVars.LastReward != null && GlobalVars.LastReward.Get() != null)
                {
                    MonoSingleton <GameManager> .Instance.Player.OnGoldChange(GlobalVars.LastReward.Get().Gold);
                }
                ((Behaviour)this).set_enabled(false);
                this.Success();
            }
        }
        private void Refresh()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null))
            {
                return;
            }
            LimitedShopData limitedShopData = MonoSingleton <GameManager> .Instance.Player.GetLimitedShopData();

            DebugUtility.Assert(limitedShopData != null, "ショップ情報が存在しない");
            this.ShopName.set_text(GlobalVars.LimitedShopItem.shops.info.title);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Updated, (UnityEngine.Object)null))
            {
                this.Updated.SetActive(GlobalVars.LimitedShopItem.btn_update);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Update, (UnityEngine.Object)null))
            {
                this.Update.SetActive(GlobalVars.LimitedShopItem.btn_update);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Lineup, (UnityEngine.Object)null))
            {
                this.Lineup.SetActive(GlobalVars.LimitedShopItem.btn_update);
            }
            for (int index = 0; index < this.mBuyItems.Count; ++index)
            {
                this.mBuyItems[index].get_gameObject().SetActive(false);
            }
            int      count      = limitedShopData.items.Count;
            DateTime serverTime = TimeManager.ServerTime;
            List <LimitedShopItem> nearbyTimeout = new List <LimitedShopItem>();

            for (int index = 0; index < count; ++index)
            {
                LimitedShopItem data1 = limitedShopData.items[index];
                if (data1.end != 0L)
                {
                    DateTime dateTime = TimeManager.FromUnixTime(data1.end);
                    if (!(serverTime >= dateTime))
                    {
                        if ((dateTime - serverTime).TotalHours < 1.0)
                        {
                            nearbyTimeout.Add(data1);
                        }
                    }
                    else
                    {
                        continue;
                    }
                }
                if (index >= this.mBuyItems.Count)
                {
                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                    gameObject.get_transform().SetParent((Transform)this.ItemLayoutParent, false);
                    this.mBuyItems.Add(gameObject);
                }
                GameObject         mBuyItem            = this.mBuyItems[index];
                LimitedShopBuyList componentInChildren = (LimitedShopBuyList)mBuyItem.GetComponentInChildren <LimitedShopBuyList>();
                componentInChildren.limitedShopItem = data1;
                DataSource.Bind <LimitedShopItem>(mBuyItem, data1);
                componentInChildren.amount.SetActive(!data1.IsSet);
                if (data1.IsArtifact)
                {
                    ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(data1.iname);

                    DataSource.Bind <ArtifactParam>(mBuyItem, artifactParam);
                }
                else if (data1.IsConceptCard)
                {
                    ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(data1.iname);
                    componentInChildren.SetupConceptCard(cardDataForDisplay);
                }
                else if (data1.IsItem || data1.IsSet)
                {
                    ItemData data2 = new ItemData();
                    data2.Setup(0L, data1.iname, data1.num);
                    DataSource.Bind <ItemData>(mBuyItem, data2);
                    DataSource.Bind <ItemParam>(mBuyItem, MonoSingleton <GameManager> .Instance.GetItemParam(data1.iname));
                }
                else
                {
                    DebugUtility.LogError(string.Format("不明な商品タイプが設定されています (shopitem.iname({0}) => {1})", (object)data1.iname, (object)data1.ShopItemType));
                }
                ListItemEvents component1 = (ListItemEvents)mBuyItem.GetComponent <ListItemEvents>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null))
                {
                    component1.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelect);
                }
                Button component2 = (Button)mBuyItem.GetComponent <Button>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component2, (UnityEngine.Object)null))
                {
                    ((Selectable)component2).set_interactable(!data1.is_soldout);
                }
                mBuyItem.SetActive(true);
            }
            this.ShowAndSaveTimeOutItem(nearbyTimeout);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Example #24
0
        private void UpdateItems()
        {
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null) || this.mMailListItems == null)
            {
                return;
            }
            List <MailData> currentMails = MonoSingleton <GameManager> .Instance.Player.CurrentMails;

            if (this.mMailListItems.Count < currentMails.Count)
            {
                Transform transform = ((Component)this).get_transform();
                int       num       = currentMails.Count - this.mMailListItems.Count;
                for (int index = 0; index < num; ++index)
                {
                    GameObject listItem = this.CreateListItem();
                    listItem.get_transform().SetParent(transform, false);
                    this.mMailListItems.Add(listItem);
                }
            }
            for (int index1 = 0; index1 < this.mMailListItems.Count; ++index1)
            {
                GameObject mMailListItem = this.mMailListItems[index1];
                if (index1 >= currentMails.Count)
                {
                    mMailListItem.SetActive(false);
                }
                else
                {
                    mMailListItem.SetActive(true);
                    MailData data1 = currentMails[index1];
                    DataSource.Bind <MailData>(mMailListItem, data1);
                    DataSource.Bind <MailData>(((MailListItem)mMailListItem.GetComponent <MailListItem>()).Button, data1);
                    int num = 0;
                    for (int index2 = 0; index2 < data1.gifts.Length; ++index2)
                    {
                        if (data1.gifts[index2].giftTypes != 0L)
                        {
                            ++num;
                        }
                        if (num >= 2)
                        {
                            break;
                        }
                    }
                    if (num >= 2)
                    {
                        MailIcon component = (MailIcon)mMailListItem.GetComponent <MailIcon>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            if (Object.op_Inequality((Object)component.CurrentIcon, (Object)null))
                            {
                                component.CurrentIcon.SetActive(false);
                            }
                            component.CurrentIcon = component.SetIconTemplate;
                            component.CurrentIcon.SetActive(true);
                        }
                    }
                    else
                    {
                        MailIcon component1 = (MailIcon)mMailListItem.GetComponent <MailIcon>();
                        for (int index2 = 0; index2 < data1.gifts.Length; ++index2)
                        {
                            GiftData gift = data1.gifts[index2];
                            if (!gift.NotSet)
                            {
                                if (gift.CheckGiftTypeIncluded(GiftTypes.IgnoreReceiveAll | GiftTypes.Item))
                                {
                                    ItemData data2 = new ItemData();
                                    data2.Setup(0L, gift.iname, gift.num);
                                    DataSource.Bind <ItemData>(mMailListItem, data2);
                                    if (Object.op_Inequality((Object)component1, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                        {
                                            component1.CurrentIcon.SetActive(false);
                                        }
                                        component1.CurrentIcon = component1.ItemIconTemplate;
                                        component1.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.Artifact))
                                {
                                    ArtifactData artifactData = gift.CreateArtifactData();
                                    if (artifactData != null)
                                    {
                                        DataSource.Bind <ArtifactData>(mMailListItem, artifactData);
                                    }
                                    if (Object.op_Inequality((Object)component1, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                        {
                                            component1.CurrentIcon.SetActive(false);
                                        }
                                        component1.CurrentIcon = component1.ArtifactIconTemplate;
                                        component1.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.Award))
                                {
                                    AwardParam awardParam = MonoSingleton <GameManager> .Instance.GetAwardParam(gift.iname);

                                    ItemData data2 = new ItemData();
                                    data2.Setup(0L, awardParam.ToItemParam(), gift.num);
                                    DataSource.Bind <ItemData>(mMailListItem, data2);
                                    if (Object.op_Inequality((Object)component1, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                        {
                                            component1.CurrentIcon.SetActive(false);
                                        }
                                        component1.CurrentIcon = component1.ItemIconTemplate;
                                        component1.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.Coin))
                                {
                                    if (Object.op_Inequality((Object)component1, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                        {
                                            component1.CurrentIcon.SetActive(false);
                                        }
                                        component1.CurrentIcon = component1.CoinIconTemplate;
                                        component1.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.Gold))
                                {
                                    if (Object.op_Inequality((Object)component1, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                        {
                                            component1.CurrentIcon.SetActive(false);
                                        }
                                        component1.CurrentIcon = component1.GoldIconTemplate;
                                        component1.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.ArenaCoin))
                                {
                                    if (Object.op_Inequality((Object)component1, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                        {
                                            component1.CurrentIcon.SetActive(false);
                                        }
                                        component1.CurrentIcon = component1.ArenaCoinIconTemplate;
                                        component1.CurrentIcon.SetActive(true);
                                    }
                                }
                                else
                                {
                                    if (gift.CheckGiftTypeIncluded(GiftTypes.MultiCoin))
                                    {
                                        if (Object.op_Inequality((Object)component1, (Object)null))
                                        {
                                            if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                            {
                                                component1.CurrentIcon.SetActive(false);
                                            }
                                            component1.CurrentIcon = component1.MultiCoinIconTemplate;
                                            component1.CurrentIcon.SetActive(true);
                                            break;
                                        }
                                        break;
                                    }
                                    if (gift.CheckGiftTypeIncluded(GiftTypes.KakeraCoin))
                                    {
                                        if (Object.op_Inequality((Object)component1, (Object)null))
                                        {
                                            if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                            {
                                                component1.CurrentIcon.SetActive(false);
                                            }
                                            component1.CurrentIcon = component1.KakeraCoinIconTemplate;
                                            component1.CurrentIcon.SetActive(true);
                                            break;
                                        }
                                        break;
                                    }
                                    if (gift.CheckGiftTypeIncluded(GiftTypes.ConceptCard))
                                    {
                                        if (Object.op_Inequality((Object)component1, (Object)null))
                                        {
                                            if (MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(gift.ConceptCardIname) == null)
                                            {
                                                DebugUtility.LogError(string.Format("MasterParam.ConceptCardParamに「{0}」が存在しない", (object)gift.ConceptCardIname));
                                                break;
                                            }
                                            ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(gift.ConceptCardIname);
                                            if (Object.op_Inequality((Object)component1.CurrentIcon, (Object)null))
                                            {
                                                component1.CurrentIcon.SetActive(false);
                                            }
                                            component1.CurrentIcon = component1.ConceptCardIconTemplate;
                                            component1.CurrentIcon.SetActive(true);
                                            ConceptCardIcon component2 = (ConceptCardIcon)component1.CurrentIcon.GetComponent <ConceptCardIcon>();
                                            if (Object.op_Inequality((Object)component2, (Object)null))
                                            {
                                                component2.Setup(cardDataForDisplay);
                                                break;
                                            }
                                            break;
                                        }
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    MailListItem component3 = (MailListItem)mMailListItem.GetComponent <MailListItem>();
                    if (Object.op_Inequality((Object)component3, (Object)null))
                    {
                        component3.Set(data1.IsPeriod, data1.IsReadMail(), data1.post_at, data1.read);
                    }
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }