private void SetUpActor() { if (((this.m_actor != null) && (this.m_slot != null)) && !string.IsNullOrEmpty(this.m_slot.CardID)) { EntityDef entityDef = DefLoader.Get().GetEntityDef(this.m_slot.CardID); bool flag = SceneMgr.Get().GetMode() == SceneMgr.Mode.COLLECTIONMANAGER; this.m_actor.SetDisablePremiumPortrait(true); this.m_actor.SetGhosted(flag && !this.m_slot.Owned); this.m_actor.SetEntityDef(entityDef); this.m_actor.SetCardFlair(new CardFlair(this.m_slot.Premium)); bool cardIsUnique = (entityDef != null) ? entityDef.IsElite() : false; if ((cardIsUnique && this.m_inArena) && (this.m_slot.Count > 1)) { cardIsUnique = false; } this.m_actor.UpdateDeckCardProperties(cardIsUnique, this.m_slot.Count, this.m_useSliderAnimations); CollectionCardCache.Get().LoadCardDef(entityDef.GetCardId(), delegate(string cardID, CardDef cardDef, object data) { if ((this.m_actor != null) && cardID.Equals(this.m_actor.GetEntityDef().GetCardId())) { this.m_actor.SetCardDef(cardDef); this.m_actor.UpdateAllComponents(); this.m_actor.UpdateMaterial(cardDef.GetDeckCardBarPortrait()); this.m_actor.UpdateGhostTileEffect(); } }, null, new CardPortraitQuality(1, this.m_slot.Premium)); } }
public static CollectionCardCache Get() { if (s_instance == null) { s_instance = new CollectionCardCache(); } return(s_instance); }
public bool ChangeActor(Actor actor, CollectionManagerDisplay.ViewMode vtype) { if (!this.m_actorCacheInit) { this.m_actorCacheInit = true; this.m_actorCache.AddActorLoadedListener(new HandActorCache.ActorLoadedCallback(this.OnCardActorLoaded)); this.m_actorCache.Initialize(); } if (!this.m_actorCache.IsInitializing()) { this.m_visualType = vtype; if (this.m_visualType != CollectionManagerDisplay.ViewMode.CARD_BACKS) { EntityDef entityDef = actor.GetEntityDef(); CardFlair cardFlair = actor.GetCardFlair(); bool flag = entityDef != this.m_entityDef; bool flag2 = !cardFlair.Equals(this.m_cardFlair); if (flag || flag2) { this.m_entityDef = entityDef; this.m_cardFlair = cardFlair; this.m_cardActor = this.m_actorCache.GetActor(entityDef, cardFlair); if (this.m_cardActor == null) { return(false); } if (flag) { CollectionCardCache.Get().LoadCardDef(this.m_entityDef.GetCardId(), new CollectionCardCache.LoadCardDefCallback(this.OnCardDefLoaded), new CardPortraitQuality(1, this.m_cardFlair.Premium), null); } else { this.InitDeckTileActor(); this.InitCardActor(); } } return(true); } if (actor != null) { this.m_entityDef = null; this.m_cardFlair = null; this.m_currentCardBack = actor.GetComponentInChildren <CardBack>(); this.m_cardActor = this.m_cardBackActor; this.m_cardBackActor.SetCardbackUpdateIgnore(true); return(true); } } return(false); }
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)); } } } }