Beispiel #1
0
 private bool CanPickUpCard()
 {
     if (this.ShouldIgnoreAllInput())
     {
         return(false);
     }
     if (CollectionManagerDisplay.Get().GetViewMode() != this.m_visualType)
     {
         return(false);
     }
     if (!CollectionDeckTray.Get().CanPickupCard())
     {
         return(false);
     }
     if (this.m_visualType == CollectionManagerDisplay.ViewMode.CARDS)
     {
         if (!this.IsInCollection())
         {
             return(false);
         }
         if (!this.IsUnlocked())
         {
             return(false);
         }
     }
     return(true);
 }
    private CollectionCardVisual GetCollectionCardVisual(int index)
    {
        CollectionCardVisual visual;

        CollectionPageLayoutSettings.Variables currentPageLayoutSettings = CollectionManagerDisplay.Get().GetCurrentPageLayoutSettings();
        float   columnSpacing = currentPageLayoutSettings.m_ColumnSpacing;
        int     columnCount   = currentPageLayoutSettings.m_ColumnCount;
        float   num3          = columnSpacing * (columnCount - 1);
        float   scale         = currentPageLayoutSettings.m_Scale;
        float   rowSpacing    = currentPageLayoutSettings.m_RowSpacing;
        Vector3 position      = this.m_cardStartPositionEightCards.transform.localPosition + currentPageLayoutSettings.m_Offset;
        int     rowNum        = index / columnCount;

        position.x += ((index % columnCount) * columnSpacing) - (num3 * 0.5f);
        position.z -= rowSpacing * rowNum;
        if (index == this.m_collectionCardVisuals.Count)
        {
            visual = (CollectionCardVisual)GameUtils.Instantiate(CollectionManagerDisplay.Get().GetCardVisualPrefab(), base.gameObject, false);
            this.m_collectionCardVisuals.Insert(index, visual);
        }
        else
        {
            visual = this.m_collectionCardVisuals[index];
        }
        visual.SetCMRow(rowNum);
        visual.transform.localScale = new Vector3(scale, scale, scale);
        visual.transform.position   = base.transform.TransformPoint(position);
        return(visual);
    }
 public void EnterCraftMode(CollectionCardVisual cardToDisplay)
 {
     if (!this.m_cancellingCraftMode && !CollectionDeckTray.Get().IsWaitingToDeleteDeck())
     {
         CollectionManagerDisplay.Get().HideAllTips();
         this.m_arcaneDustBalance       = NetCache.Get().GetNetObject <NetCache.NetCacheArcaneDustBalance>().Balance;
         this.m_offClickCatcher.enabled = true;
         KeywordHelpPanelManager.Get().HideKeywordHelp();
         this.MoveCardToBigSpot(cardToDisplay, true);
         if (this.m_craftingUI == null)
         {
             string name = (UniversalInputManager.UsePhoneUI == null) ? "CraftingUI" : "CraftingUI_Phone";
             this.m_craftingUI = AssetLoader.Get().LoadGameObject(name, true, false).GetComponent <CraftingUI>();
             this.m_craftingUI.SetStartingActive();
             GameUtils.SetParent(this.m_craftingUI, this.m_showCraftingUIBone.gameObject, false);
         }
         if ((this.m_cardInfoPane == null) && (UniversalInputManager.UsePhoneUI == null))
         {
             this.m_cardInfoPane = AssetLoader.Get().LoadGameObject("CardInfoPane", true, false).GetComponent <CardInfoPane>();
         }
         this.m_craftingUI.gameObject.SetActive(true);
         this.m_craftingUI.Enable(this.m_showCraftingUIBone.position, this.m_hideCraftingUIBone.position);
         this.FadeEffectsIn();
         this.UpdateCardInfoPane();
         Navigation.Push(new Navigation.NavigateBackHandler(this.CancelCraftMode));
     }
 }
 private bool SwitchToEditDeckMode(CollectionDeck deck)
 {
     if ((CollectionManagerDisplay.Get() == null) || (deck == null))
     {
         return(false);
     }
     this.m_tavernBrawlTray.HideTray();
     this.UpdateDeckPanels(true, true);
     if (UniversalInputManager.UsePhoneUI == null)
     {
         this.m_editDeckButton.gameObject.SetActive(TavernBrawlManager.Get().CurrentMission().canEditDeck);
         this.m_editDeckButton.SetText(GameStrings.Get("GLUE_COLLECTION_DECK_DELETE"));
         if (this.m_editIcon != null)
         {
             this.m_editIcon.SetActive(false);
         }
         if (this.m_deleteIcon != null)
         {
             this.m_deleteIcon.SetActive(true);
         }
         this.m_editDeckHighlight.ChangeState(ActorStateType.HIGHLIGHT_OFF);
     }
     this.m_deckBeingEdited = deck.ID;
     BnetBar.Get().m_currencyFrame.RefreshContents();
     CollectionDeckTray.Get().EnterEditDeckModeForTavernBrawl();
     FriendChallengeMgr.Get().UpdateMyAvailability();
     return(true);
 }
    public bool AddCard(EntityDef cardEntityDef, CardFlair cardFlair, DeckTrayDeckTileVisual deckTileToRemove, bool playSound, Actor animateFromActor = null)
    {
        if (!base.IsModeActive())
        {
            return(false);
        }
        if (cardEntityDef == null)
        {
            UnityEngine.Debug.LogError("Trying to add card EntityDef that is null.");
            return(false);
        }
        string         cardId     = cardEntityDef.GetCardId();
        CollectionDeck taggedDeck = CollectionManager.Get().GetTaggedDeck(this.m_deckType);

        if (taggedDeck == null)
        {
            return(false);
        }
        if (playSound)
        {
            SoundManager.Get().LoadAndPlay("collection_manager_place_card_in_deck", base.gameObject);
        }
        if (taggedDeck.GetTotalCardCount() == 30)
        {
            if (deckTileToRemove == null)
            {
                UnityEngine.Debug.LogWarning(string.Format("CollectionDeckTray.AddCard(): Cannot add card {0} (flair {1}) without removing one first.", cardEntityDef.GetCardId(), cardFlair));
                return(false);
            }
            string    cardID = deckTileToRemove.GetCardID();
            CardFlair flair  = deckTileToRemove.GetCardFlair();
            if (!taggedDeck.RemoveCard(cardID, flair.Premium, deckTileToRemove.IsOwnedSlot()))
            {
                object[] args = new object[] { cardId, cardFlair, cardID, flair };
                UnityEngine.Debug.LogWarning(string.Format("CollectionDeckTray.AddCard({0},{1}): Tried to remove card {2} with flair {3}, but it failed!", args));
                return(false);
            }
        }
        if (!taggedDeck.AddCard(cardEntityDef, cardFlair.Premium))
        {
            UnityEngine.Debug.LogWarning(string.Format("CollectionDeckTray.AddCard({0},{1}): deck.AddCard failed!", cardId, cardFlair));
            return(false);
        }
        if (taggedDeck.GetTotalOwnedCardCount() == 30)
        {
            DeckHelper.Get().Hide();
        }
        this.UpdateCardList(cardEntityDef, true, animateFromActor);
        CollectionManagerDisplay.Get().UpdateCurrentPageCardLocks(true);
        if ((!Options.Get().GetBool(Option.HAS_ADDED_CARDS_TO_DECK, false) && (taggedDeck.GetTotalCardCount() >= 2)) && (!DeckHelper.Get().IsActive() && (taggedDeck.GetTotalCardCount() < 15)))
        {
            NotificationManager.Get().CreateInnkeeperQuote(GameStrings.Get("VO_INNKEEPER_CM_PAGEFLIP_28"), "VO_INNKEEPER_CM_PAGEFLIP_28", 0f, null);
            Options.Get().SetBool(Option.HAS_ADDED_CARDS_TO_DECK, true);
        }
        return(true);
    }
 private void UpdateCurrentFilterValue(int filterValue)
 {
     if (filterValue != this.m_currentFilterValue)
     {
         SoundManager.Get().LoadAndPlay("mana_crystal_refresh");
         CollectionManagerDisplay.Get().FilterByManaCost(filterValue);
     }
     this.m_currentFilterValue = filterValue;
     this.UpdateFilterStates();
 }
    public void OnDestroy()
    {
        CollectionManagerDisplay display = CollectionManagerDisplay.Get();

        if (display != null)
        {
            display.UnregisterManaFilterListener(new CollectionManagerDisplay.FilterStateListener(this.ManaFilterUpdate));
            display.UnregisterSearchFilterListener(new CollectionManagerDisplay.FilterStateListener(this.SearchFilterUpdate));
        }
    }
 public void ShowFilters()
 {
     CollectionManagerDisplay.Get().HideDeckHelpPopup();
     Navigation.Push(new Navigation.NavigateBackHandler(this.HideFilters));
     this.m_activeFilterTray.ToggleTraySlider(true, null, true);
     if (this.m_offClickCatcher != null)
     {
         this.m_offClickCatcher.gameObject.SetActive(true);
     }
     this.m_manaFilter.m_manaCrystalContainer.UpdateSlices();
 }
Beispiel #9
0
 public override void Unload()
 {
     if (UniversalInputManager.UsePhoneUI != null)
     {
         BnetBar.Get().ToggleActive(true);
     }
     this.m_unloading = true;
     CollectionManagerDisplay.Get().Unload();
     Network.SendAckCardsSeen();
     this.m_unloading = false;
 }
    private CollectionCardVisual GetCurrentCardVisual()
    {
        EntityDef def;
        CardFlair flair;

        if (!this.GetShownCardInfo(out def, out flair))
        {
            return(null);
        }
        return(CollectionManagerDisplay.Get().m_pageManager.GetCardVisual(def.GetCardId(), flair));
    }
 private void OnDeleteButtonConfirmationResponse(AlertPopup.Response response, object userData)
 {
     if (response != AlertPopup.Response.CANCEL)
     {
         CollectionDeckTray.Get().DeleteEditingDeck(true);
         if (CollectionManagerDisplay.Get() != null)
         {
             CollectionManagerDisplay.Get().OnDoneEditingDeck();
         }
     }
 }
        public override void SpecificHandle(IGameState previous, IGameState next)
        {
            var ownedCardStacks = CollectionManager.Get().GetOwnedCards();

            foreach (var collectibleCard in ownedCardStacks)
            {
                var cardVisual = CollectionManagerDisplay.Get().m_pageManager.GetCardVisual(collectibleCard.CardId, collectibleCard.PremiumType);
                //Logger.AppendLine($"CardID:{keyValuePair.Value.CardID} OnPage:{cardVisual != null}");
                if (cardVisual != null)
                {
                    cardVisual.GetActor()?.m_rarityGemMesh?.GetComponent <Renderer>()?.material?.SetColor("_TintColor", Color.green);
                }
            }
        }
 private void OnMassDisenchantButtonOut(UIEvent e)
 {
     if (!CollectionManagerDisplay.Get().m_pageManager.IsShowingMassDisenchant())
     {
         if (int.Parse(this.m_potentialDustAmount.Text) > 0)
         {
             this.m_highlight.ChangeState(ActorStateType.HIGHLIGHT_PRIMARY_ACTIVE);
         }
         else
         {
             this.m_highlight.ChangeState(ActorStateType.HIGHLIGHT_OFF);
         }
     }
 }
Beispiel #14
0
    public int GetNumVisibleClasses()
    {
        int num = 0;
        CollectionPageManager pageManager = CollectionManagerDisplay.Get().m_pageManager;

        for (int i = 0; i < this.m_classTags.Length; i++)
        {
            if (pageManager.GetNumPagesForClass(this.m_classTags[i]) > 0)
            {
                num++;
            }
        }
        return(num);
    }
    private void ToggleIncludePremiums(UIEvent e)
    {
        bool show = this.m_includePremiumsCheckBox.IsChecked();

        CollectionManagerDisplay.Get().ShowPremiumCardsNotOwned(show);
        if (show)
        {
            SoundManager.Get().LoadAndPlay("checkbox_toggle_on", base.gameObject);
        }
        else
        {
            SoundManager.Get().LoadAndPlay("checkbox_toggle_off", base.gameObject);
        }
    }
 private void TouchKeyboardSearchDisplay(bool fromActivate = false)
 {
     if (!this.m_isTouchKeyboardDisplayMode)
     {
         this.m_isTouchKeyboardDisplayMode = true;
         if (this.m_background.GetComponent <Renderer>() != null)
         {
             this.m_background.GetComponent <Renderer>().material = this.m_altSearchMaterial;
         }
         base.transform.localPosition = CollectionManagerDisplay.Get().m_activeSearchBone_Win8.transform.localPosition;
         this.HideInput();
         this.ShowInput(fromActivate || W8Touch.Get().IsVirtualKeyboardVisible());
         this.m_xMesh.GetComponent <Renderer>().material.SetColor("_Color", this.m_altSearchColor);
     }
 }
Beispiel #17
0
 protected override void OnRelease()
 {
     if (!this.IsTransactionPendingOnThisCard())
     {
         if (UniversalInputManager.Get().IsTouchMode() || ((CraftingTray.Get() != null) && CraftingTray.Get().IsShown()))
         {
             this.CheckCardSeen();
             this.m_actor.SetActorState(ActorStateType.CARD_IDLE);
             this.EnterCraftingMode();
         }
         else
         {
             Spell spell = this.m_actor.GetSpell(SpellType.DEATHREVERSE);
             if (!this.CanPickUpCard())
             {
                 SoundManager.Get().LoadAndPlay("collection_manager_card_move_invalid_or_click");
                 if (spell != null)
                 {
                     spell.ActivateState(SpellStateType.BIRTH);
                 }
                 EntityDef entityDef = this.m_actor.GetEntityDef();
                 bool      isHero    = (entityDef != null) && entityDef.IsHero();
                 CollectionManagerDisplay.Get().ShowInnkeeeprLClickHelp(isHero);
             }
             else if (this.m_visualType == CollectionManagerDisplay.ViewMode.CARDS)
             {
                 EntityDef cardEntityDef = this.m_actor.GetEntityDef();
                 if (cardEntityDef != null)
                 {
                     if (spell != null)
                     {
                         spell.ActivateState(SpellStateType.BIRTH);
                     }
                     CollectionDeckTray.Get().AddCard(cardEntityDef, this.m_actor.GetCardFlair(), null, false, this.m_actor);
                 }
             }
             else if (this.m_visualType == CollectionManagerDisplay.ViewMode.CARD_BACKS)
             {
                 CollectionDeckTray.Get().SetCardBack(this.m_actor);
             }
             else if (this.m_visualType == CollectionManagerDisplay.ViewMode.HERO_SKINS)
             {
                 CollectionDeckTray.Get().SetHeroSkin(this.m_actor);
             }
         }
     }
 }
 private void OnMassDisenchantButtonReleased(UIEvent e)
 {
     if (!CollectionManagerDisplay.Get().m_pageManager.ArePagesTurning())
     {
         if (CollectionManagerDisplay.Get().m_pageManager.IsShowingMassDisenchant())
         {
             CollectionManagerDisplay.Get().m_pageManager.HideMassDisenchant();
             this.m_highlight.ChangeState(ActorStateType.HIGHLIGHT_OFF);
         }
         else
         {
             CollectionManagerDisplay.Get().m_pageManager.ShowMassDisenchant();
             base.StartCoroutine(MassDisenchant.Get().StartHighlight());
         }
         SoundManager.Get().LoadAndPlay("Hub_Click");
     }
 }
 protected void Awake()
 {
     if (this.m_inactiveFilterButton != null)
     {
         this.m_inactiveFilterButton.AddEventListener(UIEventType.RELEASE, e => this.ShowFilters());
     }
     if (this.m_activeFilterButton != null)
     {
         this.m_activeFilterButton.AddEventListener(UIEventType.RELEASE, e => this.ClearFilters());
     }
     if (this.m_offClickCatcher != null)
     {
         this.m_offClickCatcher.AddEventListener(UIEventType.RELEASE, e => this.OffClickPressed());
     }
     CollectionManagerDisplay.Get().RegisterManaFilterListener(new CollectionManagerDisplay.FilterStateListener(this.ManaFilterUpdate));
     CollectionManagerDisplay.Get().RegisterSearchFilterListener(new CollectionManagerDisplay.FilterStateListener(this.SearchFilterUpdate));
     this.FiltersUpdated();
 }
Beispiel #20
0
    public void SetClass(TAG_CLASS classTag)
    {
        int count = CardBackManager.Get().GetCardBacksOwned().Count;
        int num2  = CollectionManager.Get().GetBestHeroesIOwn(classTag).Count;

        this.SetCardBacksEnabled(count > 1);
        this.SetHeroSkinsEnabled(num2 > 1);
        int index = this.GetIndex(classTag);

        for (int i = 0; i < this.m_classTags.Length; i++)
        {
            TAG_CLASS?nullable = null;
            this.m_classButtons[i].SetClass(nullable, this.m_inactiveMaterial);
            this.m_classButtons[i].SetNewCardCount(0);
        }
        this.m_classButtons[0].SetClass(new TAG_CLASS?(classTag), this.m_classMaterials[index]);
        this.m_classButtons[0].SetNewCardCount(CollectionManagerDisplay.Get().m_pageManager.GetNumNewCardsForClass(classTag));
        this.m_classButtons[1].SetClass(0, this.m_classMaterials[this.m_neutralIndex]);
        this.m_classButtons[1].SetNewCardCount(CollectionManagerDisplay.Get().m_pageManager.GetNumNewCardsForClass(TAG_CLASS.INVALID));
    }
Beispiel #21
0
    public void HandleRelease()
    {
        switch (this.m_tabViewMode)
        {
        case CollectionManagerDisplay.ViewMode.CARDS:
            if (this.m_class.HasValue)
            {
                CollectionManagerDisplay.Get().m_pageManager.JumpToCollectionClassPage(this.m_class.Value);
            }
            break;

        case CollectionManagerDisplay.ViewMode.HERO_SKINS:
            CollectionManagerDisplay.Get().SetViewMode(CollectionManagerDisplay.ViewMode.HERO_SKINS, null);
            break;

        case CollectionManagerDisplay.ViewMode.CARD_BACKS:
            CollectionManagerDisplay.Get().SetViewMode(CollectionManagerDisplay.ViewMode.CARD_BACKS, null);
            break;
        }
        Navigation.GoBack();
    }
Beispiel #22
0
    public void HandleRelease()
    {
        CollectionManagerDisplay.Get().HideDeckHelpPopup();
        CollectionDeck taggedDeck = CollectionManager.Get().GetTaggedDeck(CollectionManager.DeckTag.Editing);
        bool           flag       = taggedDeck != null;

        if (this.m_buttons == null)
        {
            this.m_buttons = this.m_classFilterTray.GetComponentsInChildren <ClassFilterButton>();
        }
        if (!flag)
        {
            this.m_container.SetDefaults();
        }
        else
        {
            TAG_CLASS classTag = taggedDeck.GetClass();
            this.m_container.SetClass(classTag);
        }
        this.m_classFilterTray.ToggleTraySlider(true, this.m_showTwoRowsBone, true);
    }
    private void MissingCardDisplay(Actor actor, string cardID, TAG_PREMIUM premium)
    {
        NetCache.CardValue value2;
        int buy = -1;

        NetCache.NetCacheCardValues netObject = NetCache.Get().GetNetObject <NetCache.NetCacheCardValues>();
        NetCache.CardDefinition     key       = new NetCache.CardDefinition {
            Name    = cardID,
            Premium = premium
        };
        if (netObject.Values.TryGetValue(key, out value2))
        {
            buy = value2.Buy;
        }
        long balance = NetCache.Get().GetNetObject <NetCache.NetCacheArcaneDustBalance>().Balance;

        if (((buy > 0) && (buy <= balance)) && FixedRewardsMgr.Get().CanCraftCard(cardID, premium))
        {
            if (!actor.isGhostCard())
            {
                actor.GhostCardEffect(true);
            }
        }
        else
        {
            CollectionManagerDisplay display = CollectionManagerDisplay.Get();
            if (!actor.MissingCardEffect())
            {
                if (premium == TAG_PREMIUM.GOLDEN)
                {
                    actor.OverrideAllMeshMaterials(display.GetGoldenCardNotOwnedMeshMaterial());
                }
                else
                {
                    actor.OverrideAllMeshMaterials(display.GetCardNotOwnedMeshMaterial());
                }
            }
        }
    }
Beispiel #24
0
    public void SetDefaults()
    {
        this.SetCardBacksEnabled(true);
        this.SetHeroSkinsEnabled(true);
        for (int i = 0; i < this.m_classTags.Length; i++)
        {
            TAG_CLASS?classTag = null;
            this.m_classButtons[i].SetClass(classTag, this.m_inactiveMaterial);
        }
        CollectionPageManager pageManager = CollectionManagerDisplay.Get().m_pageManager;
        int index = 0;

        for (int j = 0; j < this.m_classTags.Length; j++)
        {
            if (pageManager.GetNumPagesForClass(this.m_classTags[j]) > 0)
            {
                this.m_classButtons[index].SetClass(new TAG_CLASS?(this.m_classTags[j]), this.m_classMaterials[j]);
                int numNewCardsForClass = CollectionManagerDisplay.Get().m_pageManager.GetNumNewCardsForClass(this.m_classTags[j]);
                this.m_classButtons[index].SetNewCardCount(numNewCardsForClass);
                index++;
            }
        }
    }
Beispiel #25
0
    private void EnterCraftingMode()
    {
        CollectionManagerDisplay.ViewMode viewMode = CollectionManagerDisplay.Get().GetViewMode();
        if (this.m_visualType == viewMode)
        {
            switch (viewMode)
            {
            case CollectionManagerDisplay.ViewMode.CARDS:
                if (CraftingManager.Get() != null)
                {
                    CraftingManager.Get().EnterCraftMode(this);
                }
                break;

            case CollectionManagerDisplay.ViewMode.HERO_SKINS:
            {
                HeroSkinInfoManager manager2 = HeroSkinInfoManager.Get();
                if (manager2 != null)
                {
                    manager2.EnterPreview(this);
                }
                break;
            }

            case CollectionManagerDisplay.ViewMode.CARD_BACKS:
            {
                CardBackInfoManager manager3 = CardBackInfoManager.Get();
                if (manager3 != null)
                {
                    manager3.EnterPreview(this);
                }
                break;
            }
            }
            CollectionDeckTray.Get().CancelRenamingDeck();
        }
    }
 public void UpdateChoices()
 {
     this.CleanOldChoices();
     if (this.IsActive())
     {
         RandomDeckChoices choices = RandomDeckMaker.GetChoices(CollectionManagerDisplay.Get().GetRDMDeck(), 3);
         if (choices == null)
         {
             UnityEngine.Debug.LogError("DeckHelper.GetChoices() - Can't find choices!!!!");
         }
         else
         {
             foreach (RDMDeckEntry entry in choices.choices)
             {
                 this.m_cardIdChoices.Add(entry.EntityDef.GetCardId());
             }
             bool flag = !this.m_instructionText.Text.Equals(choices.displayString);
             this.m_instructionText.Text = choices.displayString;
             if ((UniversalInputManager.UsePhoneUI != null) && flag)
             {
                 if (NotificationManager.Get().IsQuotePlaying)
                 {
                     this.m_instructionText.Text = string.Empty;
                 }
                 else
                 {
                     this.ShowInnkeeperPopup();
                 }
             }
             foreach (RDMDeckEntry entry2 in choices.choices)
             {
                 Log.Ben.Print(entry2.EntityDef.GetDebugName(), new object[0]);
                 CollectionCardCache.Get().LoadCardDef(entry2.EntityDef.GetCardId(), new CollectionCardCache.LoadCardDefCallback(this.OnCardDefLoaded), entry2, new CardPortraitQuality(3, entry2.Flair.Premium));
             }
         }
     }
 }
 public bool BackFromDeckEdit(bool animate)
 {
     if (!this.IsInDeckEditMode())
     {
         return(false);
     }
     if (animate)
     {
         PresenceMgr.Get().SetPrevStatus();
     }
     if (CollectionManagerDisplay.Get().GetViewMode() != CollectionManagerDisplay.ViewMode.CARDS)
     {
         TAG_CLASS pageClass = (TavernBrawlManager.Get().CurrentDeck() != null) ? TavernBrawlManager.Get().CurrentDeck().GetClass() : TAG_CLASS.DRUID;
         CollectionManagerDisplay.Get().m_pageManager.JumpToCollectionClassPage(pageClass);
     }
     this.m_tavernBrawlTray.ToggleTraySlider(true, null, animate);
     this.RefreshStateBasedUI(animate);
     this.m_deckBeingEdited = 0L;
     BnetBar.Get().m_currencyFrame.RefreshContents();
     FriendChallengeMgr.Get().UpdateMyAvailability();
     this.UpdateEditOrCreate();
     if (UniversalInputManager.UsePhoneUI == null)
     {
         this.m_editDeckButton.SetText(GameStrings.Get("GLUE_EDIT"));
         if (this.m_editIcon != null)
         {
             this.m_editIcon.SetActive(true);
         }
         if (this.m_deleteIcon != null)
         {
             this.m_deleteIcon.SetActive(false);
         }
     }
     CollectionDeckTray.Get().ExitEditDeckModeForTavernBrawl();
     return(true);
 }
Beispiel #28
0
 public void Show()
 {
     this.m_shown = true;
     base.SetEnabled(true);
     base.GetComponent <Collider>().enabled = true;
     if (this.m_actor != null)
     {
         bool show = false;
         if (this.m_visualType == CollectionManagerDisplay.ViewMode.CARDS)
         {
             string    cardId    = this.m_actor.GetEntityDef().GetCardId();
             CardFlair cardFlair = this.m_actor.GetCardFlair();
             show = CollectionManagerDisplay.Get().ShouldShowNewCardGlow(cardId, cardFlair);
             if (!show)
             {
                 CollectionManager.Get().MarkAllInstancesAsSeen(cardId, cardFlair);
             }
         }
         else if ((this.m_visualType != CollectionManagerDisplay.ViewMode.HERO_SKINS) && (this.m_visualType == CollectionManagerDisplay.ViewMode.CARD_BACKS))
         {
         }
         this.ShowNewItemCallout(show);
         this.m_actor.Show();
         ActorStateType stateType = !show ? ActorStateType.CARD_IDLE : ActorStateType.CARD_RECENTLY_ACQUIRED;
         this.m_actor.SetActorState(stateType);
         Renderer[] componentsInChildren = this.m_actor.gameObject.GetComponentsInChildren <Renderer>();
         if (componentsInChildren != null)
         {
             foreach (Renderer renderer in componentsInChildren)
             {
                 renderer.shadowCastingMode = ShadowCastingMode.Off;
             }
         }
         EntityDef entityDef = this.m_actor.GetEntityDef();
         if (entityDef != null)
         {
             string     tag  = "FakeShadow";
             string     str3 = "FakeShadowUnique";
             GameObject obj2 = SceneUtils.FindChildByTag(this.m_actor.gameObject, tag);
             GameObject obj3 = SceneUtils.FindChildByTag(this.m_actor.gameObject, str3);
             if (CollectionManager.Get().IsCardInCollection(entityDef.GetCardId(), this.m_actor.GetCardFlair()))
             {
                 if (entityDef.IsElite())
                 {
                     if (obj2 != null)
                     {
                         obj2.GetComponent <Renderer>().enabled = false;
                     }
                     if (obj3 != null)
                     {
                         obj3.GetComponent <Renderer>().enabled = true;
                     }
                 }
                 else
                 {
                     if (obj2 != null)
                     {
                         obj2.GetComponent <Renderer>().enabled = true;
                     }
                     if (obj3 != null)
                     {
                         obj3.GetComponent <Renderer>().enabled = false;
                     }
                 }
             }
             else
             {
                 if (obj2 != null)
                 {
                     obj2.GetComponent <Renderer>().enabled = false;
                 }
                 if (obj3 != null)
                 {
                     obj3.GetComponent <Renderer>().enabled = false;
                 }
             }
         }
     }
 }
 public void Hide()
 {
     PresenceMgr.Get().SetPrevStatus();
     CollectionManagerDisplay.Get().HideCraftingTray();
     CollectionManagerDisplay.Get().m_pageManager.HideMassDisenchant();
 }
 public static int GetMaxNumCards()
 {
     CollectionPageLayoutSettings.Variables currentPageLayoutSettings = CollectionManagerDisplay.Get().GetCurrentPageLayoutSettings();
     return(currentPageLayoutSettings.m_ColumnCount * currentPageLayoutSettings.m_RowCount);
 }