コード例 #1
0
 public void UpdateCurrentPageCardLocks(bool playSound = false)
 {
     if (CollectionDeckTray.Get().GetCurrentContentType() != CollectionDeckTray.DeckContentTypes.Cards)
     {
         foreach (CollectionCardVisual visual in this.m_collectionCardVisuals)
         {
             if (visual.IsShown())
             {
                 visual.ShowLock(CollectionCardVisual.LockType.NONE);
             }
         }
     }
     else
     {
         CollectionDeck taggedDeck = CollectionManager.Get().GetTaggedDeck(CollectionManager.DeckTag.Editing);
         foreach (CollectionCardVisual visual2 in this.m_collectionCardVisuals)
         {
             if (visual2.GetVisualType() != CollectionManagerDisplay.ViewMode.CARD_BACKS)
             {
                 if (!visual2.IsShown())
                 {
                     visual2.ShowLock(CollectionCardVisual.LockType.NONE);
                 }
                 else
                 {
                     Actor     actor     = visual2.GetActor();
                     string    cardId    = actor.GetEntityDef().GetCardId();
                     CardFlair cardFlair = actor.GetCardFlair();
                     CollectionCardStack.ArtStack collectionArtStack = CollectionManager.Get().GetCollectionArtStack(cardId, cardFlair);
                     if (collectionArtStack.Count <= 0)
                     {
                         visual2.ShowLock(CollectionCardVisual.LockType.NONE);
                     }
                     else
                     {
                         CollectionCardVisual.LockType nONE = CollectionCardVisual.LockType.NONE;
                         if (taggedDeck != null)
                         {
                             if (CollectionDeckValidator.GetDeckViolationCardIdOverflow(taggedDeck, cardId, true) != null)
                             {
                                 nONE = CollectionCardVisual.LockType.MAX_COPIES_IN_DECK;
                             }
                             if (((nONE == CollectionCardVisual.LockType.NONE) && (collectionArtStack.Count > 0)) && (taggedDeck.GetCardCount(cardId, cardFlair) >= collectionArtStack.Count))
                             {
                                 nONE = CollectionCardVisual.LockType.NO_MORE_INSTANCES;
                             }
                         }
                         visual2.ShowLock(nONE, playSound);
                     }
                 }
             }
             else
             {
                 visual2.ShowLock(CollectionCardVisual.LockType.NONE);
             }
         }
     }
 }
コード例 #2
0
    public void UpdateLockVisual(EntityDef entityDef, CollectionCardVisual.LockType lockType)
    {
        if ((entityDef == null) || (lockType == CollectionCardVisual.LockType.NONE))
        {
            base.gameObject.SetActive(false);
        }
        else
        {
            GameObject allyBg;
            base.gameObject.SetActive(true);
            TAG_CARDTYPE cardType = entityDef.GetCardType();
            this.m_allyBg.SetActive(false);
            this.m_spellBg.SetActive(false);
            this.m_weaponBg.SetActive(false);
            switch (cardType)
            {
            case TAG_CARDTYPE.MINION:
                allyBg = this.m_allyBg;
                this.m_lockPlate.transform.localPosition = this.m_lockPlateBone.transform.localPosition;
                break;

            case TAG_CARDTYPE.SPELL:
                allyBg = this.m_spellBg;
                this.m_lockPlate.transform.localPosition = this.m_lockPlateBone.transform.localPosition;
                break;

            case TAG_CARDTYPE.WEAPON:
                allyBg = this.m_weaponBg;
                this.m_lockPlate.transform.localPosition = this.m_weaponLockPlateBone.transform.localPosition;
                break;

            default:
                allyBg = this.m_spellBg;
                break;
            }
            float num = 0f;
            switch (lockType)
            {
            case CollectionCardVisual.LockType.MAX_COPIES_IN_DECK:
            {
                num = 0f;
                int      num2 = !entityDef.IsElite() ? 2 : 1;
                object[] args = new object[] { num2 };
                this.SetLockText(GameStrings.Format("GLUE_COLLECTION_LOCK_MAX_DECK_COPIES", args));
                break;
            }

            case CollectionCardVisual.LockType.NO_MORE_INSTANCES:
                num = 1f;
                this.SetLockText(GameStrings.Get("GLUE_COLLECTION_LOCK_NO_MORE_INSTANCES"));
                break;
            }
            this.m_lockPlate.GetComponent <Renderer>().material.SetFloat("_Desaturate", num);
            allyBg.GetComponent <Renderer>().material.SetFloat("_Desaturate", num);
            allyBg.SetActive(true);
        }
    }
コード例 #3
0
 public void UpdateLockVisual(EntityDef entityDef, CollectionCardVisual.LockType lockType, string reason)
 {
     object[] objArray1 = new object[] { entityDef, lockType, reason };
     base.method_8("UpdateLockVisual", objArray1);
 }