public TAG_CLASS?GetFirstCardClass() { if (this.m_collectionCardVisuals.Count == 0) { return(null); } CollectionCardVisual visual = this.m_collectionCardVisuals[0]; if (!visual.IsShown()) { return(null); } Actor actor = visual.GetActor(); if (!actor.IsShown()) { return(null); } EntityDef entityDef = actor.GetEntityDef(); if (entityDef == null) { return(null); } return(new TAG_CLASS?(entityDef.GetClass())); }
public void UpdateCollectionCards(List <Actor> actorList, CollectionManagerDisplay.ViewMode mode, bool isMassDisenchanting) { int index = 0; while (index < actorList.Count) { if (index >= GetMaxNumCards()) { break; } Actor actor = actorList[index]; CollectionCardVisual collectionCardVisual = this.GetCollectionCardVisual(index); collectionCardVisual.SetActor(actor, mode); collectionCardVisual.Show(); if (mode == CollectionManagerDisplay.ViewMode.HERO_SKINS) { collectionCardVisual.SetHeroSkinBoxCollider(); } else { collectionCardVisual.SetDefaultBoxCollider(); } index++; } for (int i = index; i < this.m_collectionCardVisuals.Count; i++) { CollectionCardVisual visual2 = this.GetCollectionCardVisual(i); visual2.SetActor(null, CollectionManagerDisplay.ViewMode.CARDS); visual2.Hide(); } this.UpdateFavoriteCardBack(mode); this.UpdateFavoriteHeroSkins(mode, isMassDisenchanting); this.UpdateHeroSkinNames(mode); this.UpdateCurrentPageCardLocks(false); }
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)); } }
public bool GrabCard(CollectionCardVisual cardVisual) { Actor actor = cardVisual.GetActor(); if (!this.CanGrabItem(actor)) { return(false); } if (!this.m_heldCardVisual.ChangeActor(actor, cardVisual.GetVisualType())) { return(false); } this.m_scrollBar.Pause(true); PegCursor.Get().SetMode(PegCursor.Mode.DRAG); CollectionCardBack component = actor.GetComponent <CollectionCardBack>(); this.m_heldCardVisual.SetSlot(null); if (component != null) { this.m_heldCardVisual.SetCardBackId(component.GetCardBackId()); } this.m_heldCardVisual.transform.position = actor.transform.position; this.m_heldCardVisual.Show(this.m_mouseIsOverDeck); SoundManager.Get().LoadAndPlay("collection_manager_pick_up_card", this.m_heldCardVisual.gameObject); return(true); }
public bool CancelCraftMode() { base.StopAllCoroutines(); this.m_offClickCatcher.enabled = false; this.m_cancellingCraftMode = true; this.m_craftingUI.CleanUpEffects(); float time = 0.2f; if (this.m_currentBigActor != null) { iTween.Stop(this.m_currentBigActor.gameObject); iTween.RotateTo(this.m_currentBigActor.gameObject, new Vector3(0f, 0f, 0f), time); this.m_currentBigActor.ToggleForceIdle(false); if (this.m_upsideDownActor != null) { iTween.Stop(this.m_upsideDownActor.gameObject); this.m_upsideDownActor.transform.parent = this.m_currentBigActor.transform; } } else if (this.m_upsideDownActor != null) { object[] args = new object[] { "scale", Vector3.zero, "time", time, "oncomplete", "FinishActorMove", "oncompletetarget", base.gameObject, "easetype", iTween.EaseType.easeOutCirc }; iTween.ScaleTo(this.m_upsideDownActor.gameObject, iTween.Hash(args)); } CollectionCardVisual currentCardVisual = this.GetCurrentCardVisual(); iTween.Stop(this.m_cardCountTab.gameObject); if (currentCardVisual == null) { if (this.m_currentBigActor != null) { object[] objArray2 = new object[] { "scale", Vector3.zero, "time", time, "oncomplete", "FinishActorMove", "oncompletetarget", base.gameObject, "easetype", iTween.EaseType.easeOutCirc }; iTween.ScaleTo(this.m_currentBigActor.gameObject, iTween.Hash(objArray2)); } this.m_cardCountTab.transform.position = new Vector3(0f, 307f, -10f); } else if (this.m_currentBigActor != null) { SoundManager.Get().LoadAndPlay("Card_Transition_In"); Vector3 vector = currentCardVisual.transform.TransformPoint(Vector3.zero); object[] objArray3 = new object[] { "name", "CancelCraftMode", "position", vector, "time", time, "oncomplete", "FinishActorMove", "oncompletetarget", base.gameObject, "easetype", iTween.EaseType.linear }; iTween.MoveTo(this.m_currentBigActor.gameObject, iTween.Hash(objArray3)); if (!this.m_isCurrentActorAGhost) { object[] objArray4 = new object[] { "name", "CancelCraftMode-not ghost", "position", new Vector3(vector.x, vector.y - 0.5f, vector.z), "time", time, "easetype", iTween.EaseType.linear }; iTween.MoveTo(this.m_cardCountTab.gameObject, iTween.Hash(objArray4)); } object[] objArray5 = new object[] { "scale", Vector3.zero, "time", 0.18f, "easetype", iTween.EaseType.linear }; iTween.ScaleTo(this.m_currentBigActor.gameObject, iTween.Hash(objArray5)); if (this.m_upsideDownActor != null) { iTween.RotateTo(this.m_upsideDownActor.gameObject, new Vector3(0f, 359f, 180f), time); object[] objArray6 = new object[] { "name", "CancelCraftMode2", "position", new Vector3(0f, -1f, 0f), "time", time, "islocal", true }; iTween.MoveTo(this.m_upsideDownActor.gameObject, iTween.Hash(objArray6)); iTween.ScaleTo(this.m_upsideDownActor.gameObject, new Vector3(this.m_upsideDownActor.transform.localScale.x * 0.8f, this.m_upsideDownActor.transform.localScale.y * 0.8f, this.m_upsideDownActor.transform.localScale.z * 0.8f), time); } } if ((this.m_craftingUI != null) && this.m_craftingUI.IsEnabled()) { this.m_craftingUI.Disable(this.m_hideCraftingUIBone.position); } this.m_cardCountTab.m_shadow.GetComponent <Animation>().Play("Crafting2ndCardShadowOff"); this.FadeEffectsOut(); if (this.m_cardInfoPane != null) { iTween.Stop(this.m_cardInfoPane.gameObject); this.m_cardInfoPane.gameObject.SetActive(false); } this.TellServerAboutWhatUserDid(); return(true); }