Beispiel #1
0
        private void RefreshSelectParam(ConceptCardIconMultiSelect drawicons, MultiConceptCard materials)
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object)drawicons, (UnityEngine.Object)null))
            {
                return;
            }
            bool selected = materials.IsSelected(drawicons.ConceptCard);

            drawicons.RefreshSelectParam(selected);
        }
Beispiel #2
0
        private void RefreshIcons(MultiConceptCard drawicons, MultiConceptCard materials)
        {
            if (drawicons == null)
            {
                return;
            }
            ConceptCardManager ccManager = this.CCManager;
            bool AcceptableExp           = true;
            bool AcceptableTrust         = true;
            bool flag = true;

            if (this.mListType == ConceptCardList.ListType.ENHANCE && ccManager.SelectedConceptCardData != null)
            {
                int mixTotalExp;
                int mixTrustExp;
                int mixTotalAwakeLv;
                ConceptCardManager.CalcTotalExpTrust(ccManager.SelectedConceptCardData, materials, out mixTotalExp, out mixTrustExp, out mixTotalAwakeLv);
                AcceptableExp   = mixTotalExp < ccManager.SelectedConceptCardData.GetExpToLevelMax();
                AcceptableTrust = mixTrustExp < ccManager.SelectedConceptCardData.GetTrustToLevelMax();
                if (ccManager.SelectedConceptCardData.GetReward() == null)
                {
                    AcceptableTrust = false;
                }
                if ((int)ccManager.SelectedConceptCardData.AwakeCount >= ccManager.SelectedConceptCardData.AwakeCountCap)
                {
                    flag = false;
                }
            }
            for (int index1 = 0; index1 < this.mCardIcons.Count; ++index1)
            {
                int index2 = this.mPage * this.mPageSize + index1;
                this.mCardIcons[index1].SetActive(true);
                ConceptCardIcon component1 = (ConceptCardIcon)this.mCardIcons[index1].GetComponent <ConceptCardIcon>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null))
                {
                    component1.Setup(drawicons.GetItem(index2));
                }
                if (0 <= index2 && index2 < drawicons.Count)
                {
                    ConceptCardIconMultiSelect component2 = (ConceptCardIconMultiSelect)this.mCardIcons[index1].GetComponent <ConceptCardIconMultiSelect>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component2, (UnityEngine.Object)null))
                    {
                        bool CanAwake = true;
                        if (this.mListType == ConceptCardList.ListType.ENHANCE && ccManager.SelectedConceptCardData != null)
                        {
                            CanAwake = flag && ccManager.SelectedConceptCardData.Param.iname == component2.ConceptCard.Param.iname;
                        }
                        this.RefreshSelectParam(component2, materials);
                        this.RefreshEnableParam(component2, materials, AcceptableExp, AcceptableTrust, CanAwake);
                    }
                }
            }
        }
Beispiel #3
0
        private void RefreshEnableParam(ConceptCardIconMultiSelect drawicons, MultiConceptCard materials, bool AcceptableExp, bool AcceptableTrust, bool CanAwake)
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object)drawicons, (UnityEngine.Object)null))
            {
                return;
            }
            bool enable = true;

            if (!materials.IsSelected(drawicons.ConceptCard))
            {
                UnitData unitData = MonoSingleton <GameManager> .Instance.Player.Units.Find((Predicate <UnitData>)(u =>
                {
                    if (u.ConceptCard != null)
                    {
                        return((long)u.ConceptCard.UniqueID == (long)drawicons.ConceptCard.UniqueID);
                    }
                    return(false);
                }));

                if (materials.Count >= this.MAX_MULTI_SELECT || drawicons.ConceptCard.Favorite || unitData != null)
                {
                    enable = false;
                }
                else if (this.CCManager.SelectedConceptCardData != null)
                {
                    MultiConceptCard materials1 = new MultiConceptCard();
                    materials1.Add(drawicons.ConceptCard);
                    int mixTotalExp;
                    int mixTrustExp;
                    int mixTotalAwakeLv;
                    ConceptCardManager.CalcTotalExpTrust(this.CCManager.SelectedConceptCardData, materials1, out mixTotalExp, out mixTrustExp, out mixTotalAwakeLv);
                    if ((0 >= mixTotalExp || !AcceptableExp) && (0 >= mixTrustExp || !AcceptableTrust) && !CanAwake)
                    {
                        enable = false;
                    }
                }
            }
            if (this.mListType == ConceptCardList.ListType.SELL && drawicons.ConceptCard.Param.not_sale)
            {
                drawicons.SetNotSellFlag(true);
                enable = false;
            }
            else
            {
                drawicons.SetNotSellFlag(false);
            }
            drawicons.RefreshEnableParam(enable);
        }