public static void CalcTotalExpTrust(ConceptCardData selectedCard, MultiConceptCard materials, out int mixTotalExp, out int mixTrustExp, out int mixTotalAwakeLv) { int num = 0; mixTotalExp = 0; mixTrustExp = 0; mixTotalAwakeLv = 0; using (List <ConceptCardData> .Enumerator enumerator = materials.GetList().GetEnumerator()) { while (enumerator.MoveNext()) { ConceptCardData current = enumerator.Current; mixTotalExp += current.MixExp; mixTrustExp += current.Param.en_trust; if (selectedCard != null && selectedCard.Param.iname == current.Param.iname) { mixTrustExp += (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.CardTrustPileUp; } if (selectedCard != null && selectedCard.Param.iname == current.Param.iname && (int)selectedCard.AwakeCount + num < selectedCard.AwakeCountCap) { ++num; } } } mixTotalAwakeLv = (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.CardAwakeUnlockLevelCap * num; }
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); }
public static void GalcTotalMixZeny(MultiConceptCard materials, out int totalMixZeny) { totalMixZeny = 0; using (List <ConceptCardData> .Enumerator enumerator = materials.GetList().GetEnumerator()) { while (enumerator.MoveNext()) { ConceptCardData current = enumerator.Current; totalMixZeny += current.Param.en_cost; } } }
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); } } } }
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); }
public static string GetWarningTextByMaterials(MultiConceptCard materials) { string empty = string.Empty; bool flag = false; using (List <ConceptCardData> .Enumerator enumerator = materials.GetList().GetEnumerator()) { while (enumerator.MoveNext()) { if ((int)enumerator.Current.Rarity >= 3) { flag = true; } } } if (flag) { empty = LocalizedText.Get("sys.CONCEPT_CARD_WARNING_HIGH_RARITY"); } return(empty); }
public void Clone(MultiConceptCard mbase) { this.mMultiSelectedUniqueID = new List <OLong>((IEnumerable <OLong>)mbase.mMultiSelectedUniqueID); }
private void RefreshIconList(bool filter = false) { this.InstantiateIcons(); if (this.mCardIcons.Count == 0) { return; } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mIgnoreSelectSameConceptCardToggle, (UnityEngine.Object)null)) { this.mIgnoreSelectSameConceptCardToggle.set_isOn(this.CCManager.ToggleSameSelectCard); this.SaveSameConceptCardToggle(); } this.mSelectedMaterials = this.CCManager.SelectedMaterials; MultiConceptCard iconList = this.GetIconList(); if (this.mListType == ConceptCardList.ListType.ENHANCE) { iconList.Remove(this.CCManager.SelectedConceptCardData); } if (filter) { List <long> longList = new List <long>(); using (List <OLong> .Enumerator enumerator = this.mSelectedMaterials.GetIDList().GetEnumerator()) { while (enumerator.MoveNext()) { long current = (long)enumerator.Current; if (!iconList.Contains(current)) { longList.Add(current); } } } using (List <long> .Enumerator enumerator = longList.GetEnumerator()) { while (enumerator.MoveNext()) { this.mSelectedMaterials.Remove(enumerator.Current); } } } if (this.mPageSize > 0) { this.mMaxPages = (iconList.Count + this.mPageSize - 1) / this.mPageSize; this.mPage = Mathf.Max(0, Mathf.Min(this.mPage, this.mMaxPages - 1)); } this.RefreshIcons(iconList, this.mSelectedMaterials); this.RefreshPage(); this.RefreshParameter(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.EmptyMessage, (UnityEngine.Object)null)) { this.EmptyMessage.SetActive(0 >= iconList.Count); } if (this.SelectedInteractableButton == null) { return; } bool flag = 0 < this.mSelectedMaterials.Count; foreach (Button button in this.SelectedInteractableButton) { if (!UnityEngine.Object.op_Equality((UnityEngine.Object)button, (UnityEngine.Object)null)) { ((Selectable)button).set_interactable(flag); } } }